Completed
Branch FET/11104/replace-deprecated-b... (15008a)
by
unknown
13:29 queued 25s
created
new/pricing/help_tours/Pricing_Price_Types_Default_Help_Tour.class.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -99,37 +99,37 @@  discard block
 block discarded – undo
99 99
 
100 100
 
101 101
 	protected function _start() {
102
-		$content = '<h3>' . __('Price Types', 'event_espresso') . '</h3>';
103
-		$content .= '<p>' . __('This tour of the Price Types page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
102
+		$content = '<h3>'.__('Price Types', 'event_espresso').'</h3>';
103
+		$content .= '<p>'.__('This tour of the Price Types page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
104 104
 		return $content;
105 105
 	}
106 106
 
107 107
 	protected function _name_column_stop() {
108
-		return '<p>' . __('The name of the price type. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>';
108
+		return '<p>'.__('The name of the price type. Can be sorted in ascending or descending order.', 'event_espresso').'</p>';
109 109
 	}
110 110
 
111 111
 	protected function _base_type_stop() {
112
-		return '<p>' . __('View if a price type is a discount, surcharge, or tax.', 'event_espresso') . '</p>';
112
+		return '<p>'.__('View if a price type is a discount, surcharge, or tax.', 'event_espresso').'</p>';
113 113
 	}
114 114
 
115 115
 	protected function _member_column_stop() {
116
-		return '<p>' . __('Here you can see if the discount/surcharge is percentage based or a flat monetary amount.', 'event_espresso') . '</p>';
116
+		return '<p>'.__('Here you can see if the discount/surcharge is percentage based or a flat monetary amount.', 'event_espresso').'</p>';
117 117
 	}
118 118
 
119 119
 	protected function _percent_column_stop() {
120
-		return '<p>' . __('View if the discount, surcharge, or tax is percentage-based or a fixed amount.', 'event_espresso') . '</p>';
120
+		return '<p>'.__('View if the discount, surcharge, or tax is percentage-based or a fixed amount.', 'event_espresso').'</p>';
121 121
 	}
122 122
 
123 123
 	protected function _order_column_stop() {
124
-		return '<p>' . __('View the order in which each discount, surcharge, or tax will be applied to the base ticket cost. Zero (0) means it will be applied first.', 'event_espresso') . '</p>';
124
+		return '<p>'.__('View the order in which each discount, surcharge, or tax will be applied to the base ticket cost. Zero (0) means it will be applied first.', 'event_espresso').'</p>';
125 125
 	}
126 126
 
127 127
 	protected function _bulk_actions_stop() {
128
-		return '<p>' . __('Perform bulk actions to multiple price types.', 'event_espresso') . '</p>';
128
+		return '<p>'.__('Perform bulk actions to multiple price types.', 'event_espresso').'</p>';
129 129
 	}
130 130
 
131 131
 	protected function _search_stop() {
132
-		return '<p>' . __('Search through price types. The following source will be searched: Price Type Name.', 'event_espresso') . '</p>';
132
+		return '<p>'.__('Search through price types. The following source will be searched: Price Type Name.', 'event_espresso').'</p>';
133 133
 	}
134 134
 
135 135
 }
136 136
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
templates/event_tickets_datetime_price_modifier_selector.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php echo $price_modifier_selector; ?>
2
-<?php if ( $disabled ) : ?>
2
+<?php if ($disabled) : ?>
3 3
 	<input type="hidden" name="<?php echo $main_name; ?>" value="<?php echo $selected_price_type_id; ?>">
4 4
 <?php endif; ?>
5 5
 
Please login to merge, or discard this patch.
new/pricing/templates/event_tickets_datetime_ticket_price_row.template.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 		<span class="ticket-price-info-display ticket-price-dollar-sign-display"<?php echo $show_currency_symbol; ?>><?php echo $price_currency_symbol; ?></span>
18 18
 	</td>
19 19
 	<td>
20
-		<?php if ( $disabled ) : ?>
20
+		<?php if ($disabled) : ?>
21 21
 			<input type="hidden" size="1" class="edit-price-PRC_amount ee-numeric" name="<?php echo $edit_prices_name; ?>[<?php echo $tkt_row; ?>][<?php echo $PRC_order; ?>][PRC_amount]" value="<?php echo $PRC_amount; ?>">
22 22
 			<input type="text" size="1" class="edit-price-PRC_amount ee-numeric" name="prices_archive[<?php echo $tkt_row; ?>][<?php echo $PRC_order; ?>][PRC_amount]" value="<?php echo $PRC_amount; ?>" disabled>
23 23
 		<?php else : ?>
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 		<span class="ticket-price-info-display ticket-price-percentage-char-display"<?php echo $show_percentage; ?>>%</span>
29 29
 	</td>
30 30
 	<td>
31
-		<?php if ( $disabled ) : ?>
31
+		<?php if ($disabled) : ?>
32 32
 			<span class="ee-lock-icon"></span>
33 33
 		<?php else : ?>
34 34
 			<!-- <span class="gear-icon dashicons dashicons-admin-generic clickable" data-ticket-row="<?php echo $tkt_row; ?>" data-context="price" data-price-row="<?php echo $PRC_order; ?>"></span> -->
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,8 +20,11 @@  discard block
 block discarded – undo
20 20
 		<?php if ( $disabled ) : ?>
21 21
 			<input type="hidden" size="1" class="edit-price-PRC_amount ee-numeric" name="<?php echo $edit_prices_name; ?>[<?php echo $tkt_row; ?>][<?php echo $PRC_order; ?>][PRC_amount]" value="<?php echo $PRC_amount; ?>">
22 22
 			<input type="text" size="1" class="edit-price-PRC_amount ee-numeric" name="prices_archive[<?php echo $tkt_row; ?>][<?php echo $PRC_order; ?>][PRC_amount]" value="<?php echo $PRC_amount; ?>" disabled>
23
-		<?php else : ?>
24
-			<input type="text" size="1" class="edit-price-PRC_amount ee-numeric" name="<?php echo $edit_prices_name; ?>[<?php echo $tkt_row; ?>][<?php echo $PRC_order; ?>][PRC_amount]" value="<?php echo $PRC_amount; ?>">
23
+		<?php else {
24
+	: ?>
25
+			<input type="text" size="1" class="edit-price-PRC_amount ee-numeric" name="<?php echo $edit_prices_name;
26
+}
27
+?>[<?php echo $tkt_row; ?>][<?php echo $PRC_order; ?>][PRC_amount]" value="<?php echo $PRC_amount; ?>">
25 28
 		<?php endif; ?>
26 29
 	</td>
27 30
 	<td>
@@ -30,8 +33,11 @@  discard block
 block discarded – undo
30 33
 	<td>
31 34
 		<?php if ( $disabled ) : ?>
32 35
 			<span class="ee-lock-icon"></span>
33
-		<?php else : ?>
34
-			<!-- <span class="gear-icon dashicons dashicons-admin-generic clickable" data-ticket-row="<?php echo $tkt_row; ?>" data-context="price" data-price-row="<?php echo $PRC_order; ?>"></span> -->
36
+		<?php else {
37
+	: ?>
38
+			<!-- <span class="gear-icon dashicons dashicons-admin-generic clickable" data-ticket-row="<?php echo $tkt_row;
39
+}
40
+?>" data-context="price" data-price-row="<?php echo $PRC_order; ?>"></span> -->
35 41
 			<span class="trash-icon dashicons dashicons-post-trash clickable" data-ticket-row="<?php echo $tkt_row; ?>" data-context="price" data-price-row="<?php echo $PRC_order; ?>"<?php echo $show_trash_icon; ?>></span>
36 42
 			<button data-ticket-row="<?php echo $tkt_row; ?>" data-price-row="<?php echo $PRC_order; ?>" data-context="price" class="ee-create-button"<?php echo $show_create_button; ?>><strong>+</strong></button>
37 43
 		<?php endif; ?>
Please login to merge, or discard this patch.
caffeinated/admin/new/pricing/templates/pricing_admin_overview.template.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 		
2 2
 	<div id="evt-prc-overview-filters-dv">
3 3
 		<ul class="subsubsub">
4
-			<?php foreach ( $view_RLs as $view ) : ?>
4
+			<?php foreach ($view_RLs as $view) : ?>
5 5
 			<li class="">
6
-				<a class="<?php echo $view['class']; ?>" href="<?php echo $view['url'];?>">
7
-					<?php _e( $view['label'], 'event_espresso' ); ?> <span class="count">(<?php echo $view['count']; ?>)</span>
6
+				<a class="<?php echo $view['class']; ?>" href="<?php echo $view['url']; ?>">
7
+					<?php _e($view['label'], 'event_espresso'); ?> <span class="count">(<?php echo $view['count']; ?>)</span>
8 8
 				</a>
9 9
 			</li>
10 10
 			<?php endforeach; ?>
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 		<!--<div class="clear"></div>-->
13 13
 	</div>
14 14
 
15
-    <form id="event-price-overview-frm" action="<?php echo $evt_prc_overview_url;?>" method="post">
15
+    <form id="event-price-overview-frm" action="<?php echo $evt_prc_overview_url; ?>" method="post">
16 16
  		<?php //$list_table->search_box( $search['btn_label'], $search['callback'] ); ?>
17
-		<input type="hidden" id="status" name="status" value="<?php echo $status;?>" />
17
+		<input type="hidden" id="status" name="status" value="<?php echo $status; ?>" />
18 18
 		<input type="hidden" id="per_page" name="per_page" value="" />
19 19
 		<?php echo $list_table->display(); ?>
20 20
     </form>
Please login to merge, or discard this patch.
admin/new/pricing/templates/pricing_details_main_meta_box.template.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,11 @@
 block discarded – undo
9 9
 						<input type="hidden" name="PRT_ID" id="PRT_ID" value="<?php echo $price->type(); ?>" />
10 10
 						<p><strong><?php _e('Price', 'event_espresso'); ?></strong></p>
11 11
 						<p class="description"><?php _e('This is the default base price. Every new ticket created will start off with this base price.', 'event_espresso'); ?></p>
12
-					<?php else : ?>
13
-						<?php echo EEH_Form_Fields::select_input('PRT_ID', $price_types, $price->type(), 'id="PRT_ID"'); ?>
12
+					<?php else {
13
+	: ?>
14
+						<?php echo EEH_Form_Fields::select_input('PRT_ID', $price_types, $price->type(), 'id="PRT_ID"');
15
+}
16
+?>
14 17
 						<p class="description"><?php _e('Price Modifier. Default items will apply to ALL new events you create.', 'event_espresso'); ?></p>
15 18
 					<?php endif; ?>
16 19
 				</td>
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@  discard block
 block discarded – undo
3 3
 	<table class="form-table">
4 4
 		<tbody>
5 5
 			<tr valign="top">
6
-				<th><label for="PRT_ID"><?php _e('Type', 'event_espresso'); ?></label> <?php echo EEH_Template::get_help_tab_link('type_field_info');?></th>
6
+				<th><label for="PRT_ID"><?php _e('Type', 'event_espresso'); ?></label> <?php echo EEH_Template::get_help_tab_link('type_field_info'); ?></th>
7 7
 				<td>
8
-					<?php if ( $price->type_obj() && $price->type_obj()->base_type() === 1 ) : ?>
8
+					<?php if ($price->type_obj() && $price->type_obj()->base_type() === 1) : ?>
9 9
 						<input type="hidden" name="PRT_ID" id="PRT_ID" value="<?php echo $price->type(); ?>" />
10 10
 						<p><strong><?php _e('Price', 'event_espresso'); ?></strong></p>
11 11
 						<p class="description"><?php _e('This is the default base price. Every new ticket created will start off with this base price.', 'event_espresso'); ?></p>
@@ -16,13 +16,13 @@  discard block
 block discarded – undo
16 16
 				</td>
17 17
 			</tr>
18 18
 			<tr valign="top">
19
-				<th><label for="PRC_name"><?php _e('Name', 'event_espresso'); ?></label> <?php echo EEH_Template::get_help_tab_link('name_field_info');?></th>
19
+				<th><label for="PRC_name"><?php _e('Name', 'event_espresso'); ?></label> <?php echo EEH_Template::get_help_tab_link('name_field_info'); ?></th>
20 20
 				<td>
21 21
 					<input class="regular-text" type="text" id="PRC_name" name="PRC_name" value="<?php $price->f('PRC_name'); ?>"/>
22 22
 				</td>
23 23
 			</tr>
24 24
 			<tr valign="top">
25
-				<th><label for="PRC_desc"><?php _e('Description', 'event_espresso'); ?></label> <?php echo EEH_Template::get_help_tab_link('description_field_info');?></th>
25
+				<th><label for="PRC_desc"><?php _e('Description', 'event_espresso'); ?></label> <?php echo EEH_Template::get_help_tab_link('description_field_info'); ?></th>
26 26
 				<td>
27 27
 					<textarea class="regular-text" id="PRC_desc" name="PRC_desc" rows="5" ><?php
28 28
 					 $price->f('PRC_desc');
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 				</td>							
31 31
 			</tr>
32 32
 			<tr valign="top">
33
-				<th><label for="PRC_amount"><?php _e('Amount', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('amount_field_info');?></label></th>
33
+				<th><label for="PRC_amount"><?php _e('Amount', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('amount_field_info'); ?></label></th>
34 34
 				<td>
35 35
 					<input class="small-text ee-numeric" type="text" id="PRC_amount" name="PRC_amount" value="<?php echo $price->amount(); ?>"/>
36 36
 				</td>
Please login to merge, or discard this patch.
admin/new/pricing/templates/pricing_type_details_main_meta_box.template.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 					<label for="PRT_name"><?php _e('Price Type Name', 'event_espresso'); ?></label>
19 19
 				</th>
20 20
 				<td>
21
-					<input class="regular-text" type="text" id="PRT_name" name="PRT_name" value="<?php echo htmlentities($price_type->name()) ;?>"/>
21
+					<input class="regular-text" type="text" id="PRT_name" name="PRT_name" value="<?php echo htmlentities($price_type->name()); ?>"/>
22 22
 					<p class="description"><?php _e('A name for this Price Type.', 'event_espresso'); ?></p>
23 23
 				</td>
24 24
 			</tr>
@@ -29,18 +29,18 @@  discard block
 block discarded – undo
29 29
 				</th>
30 30
 				<td>
31 31
 					<?php $yes_checked = $price_type->is_percent() ? ' checked="checked"' : ''; ?>
32
-					<label style="margin-right:15px;"><input type="radio" name="PRT_is_percent" value="1"<?php echo $yes_checked;?> style="margin-right:5px;">
33
-						<?php _e('Percentage', 'event_espresso');?>
32
+					<label style="margin-right:15px;"><input type="radio" name="PRT_is_percent" value="1"<?php echo $yes_checked; ?> style="margin-right:5px;">
33
+						<?php _e('Percentage', 'event_espresso'); ?>
34 34
 					</label>
35 35
 					<?php $no_checked = $price_type->is_percent() ? '' : ' checked="checked"'; ?>
36
-					<label style="margin-right:15px;"><input type="radio" name="PRT_is_percent" value="0"<?php echo $no_checked;?> style="margin-right:5px;">
37
-						<?php _e('Fixed', 'event_espresso');?>
36
+					<label style="margin-right:15px;"><input type="radio" name="PRT_is_percent" value="0"<?php echo $no_checked; ?> style="margin-right:5px;">
37
+						<?php _e('Fixed', 'event_espresso'); ?>
38 38
 					</label>
39 39
 					<p class="description"><?php _e('Whether this Price Type will be applied as a percentage or applied as a set fixed amount.', 'event_espresso'); ?></p>
40
-					<?php if ( $price_type->base_type() == EEM_Price_Type::base_type_tax ) :
40
+					<?php if ($price_type->base_type() == EEM_Price_Type::base_type_tax) :
41 41
 						//base type is tax so let's just let the user know that taxes are always percentage.
42 42
 						?>
43
-						<p class="description" style="color:#E44064"><?php _e( 'The selected base type for this price type is "Tax".  Taxes are always assumed to be a percentage.  If you want to use a fixed value for a tax then please change the base type to a surcharge.', 'event_espresso' ); ?></p>
43
+						<p class="description" style="color:#E44064"><?php _e('The selected base type for this price type is "Tax".  Taxes are always assumed to be a percentage.  If you want to use a fixed value for a tax then please change the base type to a surcharge.', 'event_espresso'); ?></p>
44 44
 					<?php endif; ?>
45 45
 				</td>
46 46
 			</tr>
Please login to merge, or discard this patch.
caffeinated/admin/new/tickets/Tickets_Admin_Page.core.php 2 patches
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 	protected function _set_page_routes() {
54 54
 
55
-		$tkt_id = ! empty( $this->_req_data['TKT_ID'] )  && ! is_array( $this->_req_data['TKT_ID'] ) ? $this->_req_data['TKT_ID'] : 0;
55
+		$tkt_id = ! empty($this->_req_data['TKT_ID']) && ! is_array($this->_req_data['TKT_ID']) ? $this->_req_data['TKT_ID'] : 0;
56 56
 
57 57
 		$this->_page_routes = array(
58 58
 			'default' => array(
@@ -62,14 +62,14 @@  discard block
 block discarded – undo
62 62
 			'trash_ticket' => array(
63 63
 				'func' => '_trash_or_restore_ticket',
64 64
 				'noheader' => TRUE,
65
-				'args' => array( 'trash' => TRUE ),
65
+				'args' => array('trash' => TRUE),
66 66
 				'capability' => 'ee_delete_default_ticket',
67 67
 				'obj_id' => $tkt_id
68 68
 				),
69 69
 			'trash_tickets' => array(
70 70
 				'func' => '_trash_or_restore_ticket',
71 71
 				'noheader' => TRUE,
72
-				'args' => array( 'trash' => TRUE ),
72
+				'args' => array('trash' => TRUE),
73 73
 				'capability' => 'ee_delete_default_tickets'
74 74
 				),
75 75
 			'restore_ticket' => array(
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 				'label' => __('Trash', 'event_espresso'),
144 144
 				'count' => 0,
145 145
 				'bulk_action' => array(
146
-					'restore_tickets' => __('Restore from Trash' , 'event_espresso'),
146
+					'restore_tickets' => __('Restore from Trash', 'event_espresso'),
147 147
 					'delete_tickets' => __('Delete Permanently', 'event_espresso')
148 148
 					)
149 149
 				)
@@ -161,53 +161,53 @@  discard block
 block discarded – undo
161 161
 
162 162
 
163 163
 
164
-	public function get_default_tickets( $per_page = 10, $count = FALSE, $trashed = FALSE ) {
164
+	public function get_default_tickets($per_page = 10, $count = FALSE, $trashed = FALSE) {
165 165
 
166
-		$orderby= empty( $this->_req_data['orderby'] ) ? 'TKT_name' : $this->_req_data['orderby'];
167
-		$order = empty( $this->_req_data['order'] ) ? 'ASC' : $order;
166
+		$orderby = empty($this->_req_data['orderby']) ? 'TKT_name' : $this->_req_data['orderby'];
167
+		$order = empty($this->_req_data['order']) ? 'ASC' : $order;
168 168
 
169
-		switch ( $orderby ) {
169
+		switch ($orderby) {
170 170
 			case 'TKT_name' :
171
-				$orderby = array( 'TKT_name' => $order );
171
+				$orderby = array('TKT_name' => $order);
172 172
 				break;
173 173
 
174 174
 			case 'TKT_price' :
175
-				$orderby = array( 'TKT_price' => $order );
175
+				$orderby = array('TKT_price' => $order);
176 176
 				break;
177 177
 
178 178
 			case 'TKT_uses' :
179
-				$orderby = array( 'TKT_uses' => $order );
179
+				$orderby = array('TKT_uses' => $order);
180 180
 				break;
181 181
 
182 182
 			case 'TKT_min' :
183
-				$orderby = array( 'TKT_min' => $order );
183
+				$orderby = array('TKT_min' => $order);
184 184
 				break;
185 185
 
186 186
 			case 'TKT_max' :
187
-				$orderby = array( 'TKT_max' => $order );
187
+				$orderby = array('TKT_max' => $order);
188 188
 				break;
189 189
 
190 190
 			case 'TKT_qty' :
191
-				$orderby = array( 'TKT_qty' => $order );
191
+				$orderby = array('TKT_qty' => $order);
192 192
 				break;
193 193
 		}
194 194
 
195
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
196
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
195
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
196
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
197 197
 
198 198
 		$_where = array(
199 199
 			'TKT_is_default' => 1,
200 200
 			'TKT_deleted' => $trashed
201 201
 			);
202 202
 
203
-		$offset = ($current_page-1)*$per_page;
204
-		$limit = array( $offset, $per_page );
203
+		$offset = ($current_page - 1) * $per_page;
204
+		$limit = array($offset, $per_page);
205 205
 
206
-		if ( isset( $this->_req_data['s'] ) ) {
207
-			$sstr = '%' . $this->_req_data['s'] . '%';
206
+		if (isset($this->_req_data['s'])) {
207
+			$sstr = '%'.$this->_req_data['s'].'%';
208 208
 			$_where['OR'] = array(
209
-				'TKT_name' => array('LIKE',$sstr ),
210
-				'TKT_description' => array('LIKE',$sstr )
209
+				'TKT_name' => array('LIKE', $sstr),
210
+				'TKT_description' => array('LIKE', $sstr)
211 211
 				);
212 212
 		}
213 213
 
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
 			'group_by'=>'TKT_ID'
219 219
 			);
220 220
 
221
-		if($count){
221
+		if ($count) {
222 222
 			return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where));
223
-		}else{
223
+		} else {
224 224
 			return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params);
225 225
 		}
226 226
 
@@ -230,41 +230,41 @@  discard block
 block discarded – undo
230 230
 
231 231
 
232 232
 
233
-	protected function _trash_or_restore_ticket(  $trash = FALSE ) {
233
+	protected function _trash_or_restore_ticket($trash = FALSE) {
234 234
 		$success = 1;
235 235
 
236 236
 		$TKT = EEM_Ticket::instance();
237 237
 
238 238
 		//checkboxes?
239
-		if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) {
239
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
240 240
 			//if array has more than one element then success message should be plural
241
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
241
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
242 242
 
243 243
 			//cycle thru the boxes
244
-			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
245
-				if ( $trash ) {
246
-					if ( ! $TKT->delete_by_ID( $TKT_ID ) )
244
+			while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
245
+				if ($trash) {
246
+					if ( ! $TKT->delete_by_ID($TKT_ID))
247 247
 						$success = 0;
248 248
 				} else {
249
-					if ( ! $TKT->restore_by_ID( $TKT_ID ) )
249
+					if ( ! $TKT->restore_by_ID($TKT_ID))
250 250
 						$success = 0;
251 251
 				}
252 252
 			}
253 253
 		} else {
254 254
 			//grab single id and trash
255
-			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
255
+			$TKT_ID = absint($this->_req_data['TKT_ID']);
256 256
 
257
-			if ( $trash ) {
258
-				if ( ! $TKT->delete_by_ID( $TKT_ID ) )
257
+			if ($trash) {
258
+				if ( ! $TKT->delete_by_ID($TKT_ID))
259 259
 					$success = 0;
260 260
 			} else {
261
-				if ( ! $TKT->restore_by_ID( $TKT_ID ) )
261
+				if ( ! $TKT->restore_by_ID($TKT_ID))
262 262
 					$success = 0;
263 263
 			}
264 264
 		}
265 265
 
266 266
 		$action_desc = $trash ? 'moved to the trash' : 'restored';
267
-		$this->_redirect_after_action( $success, 'Tickets', $action_desc, array() );
267
+		$this->_redirect_after_action($success, 'Tickets', $action_desc, array());
268 268
 	}
269 269
 
270 270
 
@@ -277,34 +277,34 @@  discard block
 block discarded – undo
277 277
 		$TKT = EEM_Ticket::instance();
278 278
 
279 279
 		//checkboxes?
280
-		if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) {
280
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
281 281
 			//if array has more than one element then success message should be plural
282
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
282
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
283 283
 
284 284
 			//cycle thru the boxes
285
-			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
285
+			while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
286 286
 				//delete
287
-				if ( ! $this->_delete_the_ticket( $TKT_ID ) ) {
287
+				if ( ! $this->_delete_the_ticket($TKT_ID)) {
288 288
 					$success = 0;
289 289
 				}
290 290
 			}
291 291
 		} else {
292 292
 			//grab single id and trash
293
-			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
294
-			if ( ! $this->_delete_the_ticket( $TKT_ID ) ) {
293
+			$TKT_ID = absint($this->_req_data['TKT_ID']);
294
+			if ( ! $this->_delete_the_ticket($TKT_ID)) {
295 295
 					$success = 0;
296 296
 				}
297 297
 		}
298 298
 
299 299
 		$action_desc = 'deleted';
300
-		$this->_redirect_after_action( $success, 'Tickets', $action_desc, array() );
300
+		$this->_redirect_after_action($success, 'Tickets', $action_desc, array());
301 301
 	}
302 302
 
303 303
 
304 304
 
305 305
 
306
-	protected function _delete_the_ticket( $TKT_ID ) {
307
-		$tkt = EEM_Ticket::instance()->get_one_by_ID( $TKT_ID );
306
+	protected function _delete_the_ticket($TKT_ID) {
307
+		$tkt = EEM_Ticket::instance()->get_one_by_ID($TKT_ID);
308 308
 
309 309
 		//delete all related prices first
310 310
 		$tkt->delete_related_permanently('Price');
Please login to merge, or discard this patch.
Braces   +16 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
@@ -220,7 +222,7 @@  discard block
 block discarded – undo
220 222
 
221 223
 		if($count){
222 224
 			return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where));
223
-		}else{
225
+		} else{
224 226
 			return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params);
225 227
 		}
226 228
 
@@ -243,11 +245,13 @@  discard block
 block discarded – undo
243 245
 			//cycle thru the boxes
244 246
 			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
245 247
 				if ( $trash ) {
246
-					if ( ! $TKT->delete_by_ID( $TKT_ID ) )
247
-						$success = 0;
248
+					if ( ! $TKT->delete_by_ID( $TKT_ID ) ) {
249
+											$success = 0;
250
+					}
248 251
 				} else {
249
-					if ( ! $TKT->restore_by_ID( $TKT_ID ) )
250
-						$success = 0;
252
+					if ( ! $TKT->restore_by_ID( $TKT_ID ) ) {
253
+											$success = 0;
254
+					}
251 255
 				}
252 256
 			}
253 257
 		} else {
@@ -255,11 +259,13 @@  discard block
 block discarded – undo
255 259
 			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
256 260
 
257 261
 			if ( $trash ) {
258
-				if ( ! $TKT->delete_by_ID( $TKT_ID ) )
259
-					$success = 0;
262
+				if ( ! $TKT->delete_by_ID( $TKT_ID ) ) {
263
+									$success = 0;
264
+				}
260 265
 			} else {
261
-				if ( ! $TKT->restore_by_ID( $TKT_ID ) )
262
-					$success = 0;
266
+				if ( ! $TKT->restore_by_ID( $TKT_ID ) ) {
267
+									$success = 0;
268
+				}
263 269
 			}
264 270
 		}
265 271
 
Please login to merge, or discard this patch.
caffeinated/admin/new/tickets/Tickets_Admin_Page_Init.core.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 *
24 24
 * ------------------------------------------------------------------------
25 25
 */
26
-class Tickets_Admin_Page_Init extends EE_Admin_Page_Init  {
26
+class Tickets_Admin_Page_Init extends EE_Admin_Page_Init {
27 27
 
28 28
 
29 29
 
@@ -36,19 +36,19 @@  discard block
 block discarded – undo
36 36
 	 */
37 37
 	public function __construct() {
38 38
 
39
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
39
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
40 40
 
41
-		define( 'TICKETS_PG_SLUG', 'tickets' );
42
-		define( 'TICKETS_LABEL', __('Default Tickets', 'event_espresso'));
43
-		define( 'TICKETS_ADMIN', EE_CORE_CAF_ADMIN . 'new' . DS . TICKETS_PG_SLUG . DS );
44
-		define( 'TICKETS_ADMIN_URL', admin_url( 'admin.php?page=' . TICKETS_PG_SLUG ));
45
-		define( 'TICKETS_ASSETS_PATH', TICKETS_ADMIN . 'assets' . DS );
46
-		define( 'TICKETS_ASSETS_URL', EE_CORE_CAF_ADMIN_URL . 'new' . DS . TICKETS_PG_SLUG .'/assets/' );
47
-		define( 'TICKETS_TEMPLATE_PATH', TICKETS_ADMIN . 'templates' . DS );
48
-		define( 'TICKETS_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL . 'new' . DS . TICKETS_PG_SLUG . DS . 'templates/' );
41
+		define('TICKETS_PG_SLUG', 'tickets');
42
+		define('TICKETS_LABEL', __('Default Tickets', 'event_espresso'));
43
+		define('TICKETS_ADMIN', EE_CORE_CAF_ADMIN.'new'.DS.TICKETS_PG_SLUG.DS);
44
+		define('TICKETS_ADMIN_URL', admin_url('admin.php?page='.TICKETS_PG_SLUG));
45
+		define('TICKETS_ASSETS_PATH', TICKETS_ADMIN.'assets'.DS);
46
+		define('TICKETS_ASSETS_URL', EE_CORE_CAF_ADMIN_URL.'new'.DS.TICKETS_PG_SLUG.'/assets/');
47
+		define('TICKETS_TEMPLATE_PATH', TICKETS_ADMIN.'templates'.DS);
48
+		define('TICKETS_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL.'new'.DS.TICKETS_PG_SLUG.DS.'templates/');
49 49
 
50 50
 		parent::__construct();
51
-		$this->_folder_path = EE_CORE_CAF_ADMIN . 'new' . DS . $this->_folder_name . DS;
51
+		$this->_folder_path = EE_CORE_CAF_ADMIN.'new'.DS.$this->_folder_name.DS;
52 52
 
53 53
 	}
54 54
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
 
64 64
 	protected function _set_menu_map() {
65
-		$this->_menu_map = new EE_Admin_Page_Sub_Menu( array(
65
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(array(
66 66
 			'menu_group' => 'management',
67 67
 			'menu_order' => 15,
68 68
 			'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
 * Event Espresso
4 6
 *
Please login to merge, or discard this patch.
caffeinated/admin/new/tickets/Tickets_List_Table.class.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 				'TKT_taxable' => __('Taxable', 'event_espresso')
60 60
 			);
61 61
 
62
-        $this->_sortable_columns = array(
62
+		$this->_sortable_columns = array(
63 63
 				// TRUE means its already sorted
64 64
 				'TKT_name' => array( 'TKT_name', TRUE ),
65 65
 				'TKT_description' => array( 'TKT_description', FALSE ),
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 				'TKT_min' => array( 'TKT_min', FALSE ),
69 69
 				'TKT_max' => array( 'TKT_max', FALSE ),
70 70
 				'TKT_price' => array( 'TKT_price', FALSE )
71
-	        	);
71
+				);
72 72
 
73
-        $this->_hidden_columns = array(
73
+		$this->_hidden_columns = array(
74 74
 			);
75 75
 
76 76
 	}
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 
32 32
 	protected function _setup_data() {
33 33
 		$trashed = $this->_admin_page->get_view() == 'trashed' ? TRUE : FALSE;
34
-		$this->_data = $this->_admin_page->get_default_tickets( $this->_per_page, FALSE, $trashed );
35
-		$this->_all_data_count = $this->_admin_page->get_default_tickets( $this->_per_page, TRUE, FALSE );
36
-		$this->_trashed_count = $this->_admin_page->get_default_tickets( $this->_per_page, TRUE, TRUE );
34
+		$this->_data = $this->_admin_page->get_default_tickets($this->_per_page, FALSE, $trashed);
35
+		$this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, TRUE, FALSE);
36
+		$this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, TRUE, TRUE);
37 37
 	}
38 38
 
39 39
 
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
 
62 62
         $this->_sortable_columns = array(
63 63
 				// TRUE means its already sorted
64
-				'TKT_name' => array( 'TKT_name', TRUE ),
65
-				'TKT_description' => array( 'TKT_description', FALSE ),
66
-				'TKT_qty' => array( 'TKT_qty', FALSE ),
67
-				'TKT_uses' => array( 'TKT_uses', FALSE ),
68
-				'TKT_min' => array( 'TKT_min', FALSE ),
69
-				'TKT_max' => array( 'TKT_max', FALSE ),
70
-				'TKT_price' => array( 'TKT_price', FALSE )
64
+				'TKT_name' => array('TKT_name', TRUE),
65
+				'TKT_description' => array('TKT_description', FALSE),
66
+				'TKT_qty' => array('TKT_qty', FALSE),
67
+				'TKT_uses' => array('TKT_uses', FALSE),
68
+				'TKT_min' => array('TKT_min', FALSE),
69
+				'TKT_max' => array('TKT_max', FALSE),
70
+				'TKT_price' => array('TKT_price', FALSE)
71 71
 	        	);
72 72
 
73 73
         $this->_hidden_columns = array(
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
 
88 88
 	protected function _add_view_counts() {
89 89
 		$this->_views['all']['count'] = $this->_all_data_count;
90
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_tickets', 'trash_ticket'))
90
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_tickets', 'trash_ticket'))
91 91
 		$this->_views['trashed']['count'] = $this->_trashed_count;
92 92
 	}
93 93
 
94 94
 
95 95
 
96 96
 	function column_cb($item) {
97
-		return $item->ID() === 1 ? '<span class="ee-lock-icon"></span>' : sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() );
97
+		return $item->ID() === 1 ? '<span class="ee-lock-icon"></span>' : sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID());
98 98
 
99 99
 	}
100 100
 
@@ -105,21 +105,21 @@  discard block
 block discarded – undo
105 105
 		$actions = array();
106 106
 
107 107
 		//trash links
108
-		if ( $item->ID() !== 1 ) {
109
-			if ( $this->_view == 'all' ) {
110
-				$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'trash_ticket', 'TKT_ID' => $item->ID() ), TICKETS_ADMIN_URL );
111
-				$actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' . esc_attr__('Move Ticket to trash', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
108
+		if ($item->ID() !== 1) {
109
+			if ($this->_view == 'all') {
110
+				$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'trash_ticket', 'TKT_ID' => $item->ID()), TICKETS_ADMIN_URL);
111
+				$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Ticket to trash', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
112 112
 			} else {
113 113
 				// restore price link
114
-				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_ticket', 'TKT_ID'=>$item->ID() ), TICKETS_ADMIN_URL );
115
-				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Ticket', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>';
114
+				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_ticket', 'TKT_ID'=>$item->ID()), TICKETS_ADMIN_URL);
115
+				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Ticket', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
116 116
 				// delete price link
117
-				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_ticket', 'TKT_ID'=>$item->ID() ), TICKETS_ADMIN_URL );
118
-				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Ticket Permanently', 'event_espresso' ) . '">' . __( 'Delete Permanently', 'event_espresso' ) . '</a>';
117
+				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_ticket', 'TKT_ID'=>$item->ID()), TICKETS_ADMIN_URL);
118
+				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Ticket Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
119 119
 			}
120 120
 		}
121 121
 
122
-		return $item->get('TKT_name') . $this->row_actions( $actions );
122
+		return $item->get('TKT_name').$this->row_actions($actions);
123 123
 	}
124 124
 
125 125
 
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
 
133 133
 
134 134
 	function column_TKT_qty($item) {
135
-		return $item->get_pretty('TKT_qty','text');
135
+		return $item->get_pretty('TKT_qty', 'text');
136 136
 	}
137 137
 
138 138
 
139 139
 
140 140
 	function column_TKT_uses($item) {
141
-		return $item->get_pretty('TKT_uses','text');
141
+		return $item->get_pretty('TKT_uses', 'text');
142 142
 	}
143 143
 
144 144
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 
151 151
 	function column_TKT_max($item) {
152
-		return $item->get_pretty('TKT_max','text');
152
+		return $item->get_pretty('TKT_max', 'text');
153 153
 	}
154 154
 
155 155
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 
3 5
 /**
4 6
  * Event Espresso
@@ -87,8 +89,9 @@  discard block
 block discarded – undo
87 89
 
88 90
 	protected function _add_view_counts() {
89 91
 		$this->_views['all']['count'] = $this->_all_data_count;
90
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_tickets', 'trash_ticket'))
91
-		$this->_views['trashed']['count'] = $this->_trashed_count;
92
+		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_tickets', 'trash_ticket')) {
93
+				$this->_views['trashed']['count'] = $this->_trashed_count;
94
+		}
92 95
 	}
93 96
 
94 97
 
Please login to merge, or discard this patch.