Completed
Branch FET-8365-add-indexes (4b9253)
by
unknown
527:08 queued 512:28
created
admin_pages/about/About_Admin_Page_Init.core.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
 
31 31
 	public function __construct() {
32 32
 		//define some events related constants
33
-		define( 'EE_ABOUT_PG_SLUG', 'espresso_about' );
34
-		define( 'EE_ABOUT_LABEL', __('About', 'event_espresso'));
35
-		define( 'EE_ABOUT_ADMIN', EE_ADMIN_PAGES . 'about' . DS );
36
-		define( 'EE_ABOUT_ADMIN_URL', admin_url( 'admin.php?page=' . EE_ABOUT_PG_SLUG ));
37
-		define( 'EE_ABOUT_TEMPLATE_PATH', EE_ABOUT_ADMIN . 'templates' . DS );
38
-		define( 'EE_ABOUT_ASSETS_URL', EE_ADMIN_PAGES_URL . 'about/assets/' );
33
+		define('EE_ABOUT_PG_SLUG', 'espresso_about');
34
+		define('EE_ABOUT_LABEL', __('About', 'event_espresso'));
35
+		define('EE_ABOUT_ADMIN', EE_ADMIN_PAGES.'about'.DS);
36
+		define('EE_ABOUT_ADMIN_URL', admin_url('admin.php?page='.EE_ABOUT_PG_SLUG));
37
+		define('EE_ABOUT_TEMPLATE_PATH', EE_ABOUT_ADMIN.'templates'.DS);
38
+		define('EE_ABOUT_ASSETS_URL', EE_ADMIN_PAGES_URL.'about/assets/');
39 39
 		parent::__construct();
40 40
 	}
41 41
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	}
45 45
 
46 46
 	protected function _set_menu_map() {
47
-		$this->_menu_map = new EE_Admin_Page_Sub_Menu( array(
47
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(array(
48 48
 			'menu_group' => 'extras',
49 49
 			'menu_order' => 40,
50 50
 			'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_AND_NETWORK_ADMIN,
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.
admin_pages/about/templates/ee4-overview.template.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <div class="changelog">
2 2
 	<?php
3 3
 	//maintenance mode on?
4
-	if ( EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ) {
4
+	if (EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) {
5 5
 		?>
6 6
 		<div class="ee-attention">
7
-			<h2 class="ee-maintenance-mode-callout"><?php  _e('Event Espresso is in full maintenance mode.' , 'event_espresso'); ?></h2>
7
+			<h2 class="ee-maintenance-mode-callout"><?php  _e('Event Espresso is in full maintenance mode.', 'event_espresso'); ?></h2>
8 8
 			<p>
9 9
 				<?php
10 10
 				printf(
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 			<h3><?php _e('Turn your blog into a complete event registration and management system', 'event_espresso'); ?></h3>
83 83
 			<p><?php _e('Create a beautiful event page with ticket selection, venue details, and an integrated single page checkout system. With WordPress, Event Espresso, and Espresso Arabica 2014 (based on the "Twenty Fourteen" theme by WordPress), your events will certainly sell out faster than ever!', 'event_espresso'); ?></p>
84 84
 			<p><?php _e('With a striking design that does not compromise the simplicity of WordPress and Event Espresso 4, Espresso Arabica 2014 will be the best event theme on the market.', 'event_espresso'); ?></p>
85
-			<p><?php echo sprintf( __('%sLearn more >>%s', 'event_espresso'), '<a href="http://eventespresso.com/wiki/setup-event-espresso-arabica-theme/">', '</a>' ); ?></p>
85
+			<p><?php echo sprintf(__('%sLearn more >>%s', 'event_espresso'), '<a href="http://eventespresso.com/wiki/setup-event-espresso-arabica-theme/">', '</a>'); ?></p>
86 86
 		</div>
87 87
 	</div>
88 88
 	<img src="<?php echo EE_GLOBAL_ASSETS_URL; ?>images/screenshots/single-event-page.jpg">
Please login to merge, or discard this patch.
admin_pages/about/templates/whats_new.template.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@
 block discarded – undo
1 1
 <div class="changelog point-releases">
2
-	<h3><?php echo _n( 'Minor Release Information', 'Minor Releases', 1 ); ?></h3>
3
-	<!-- <h3><?php echo _n( 'Major Release Information', 'Major Releases', 1 ); ?></h3>-->
2
+	<h3><?php echo _n('Minor Release Information', 'Minor Releases', 1); ?></h3>
3
+	<!-- <h3><?php echo _n('Major Release Information', 'Major Releases', 1); ?></h3>-->
4 4
 	<?php $type = 'minor'; ?>
5 5
 	<?php //$type = 'major'; ?>
6
-	<p><?php printf( __( '<strong>Version %1$s</strong> is a %2$s bug fix/enhancement release.', 'event_espresso'), EVENT_ESPRESSO_VERSION, $type ); ?>
6
+	<p><?php printf(__('<strong>Version %1$s</strong> is a %2$s bug fix/enhancement release.', 'event_espresso'), EVENT_ESPRESSO_VERSION, $type); ?>
7 7
 		<?php
8
-			$ver = explode( '.', EVENT_ESPRESSO_VERSION );
9
-			array_pop( $ver );
10
-			$ver = implode( '.', $ver );
8
+			$ver = explode('.', EVENT_ESPRESSO_VERSION);
9
+			array_pop($ver);
10
+			$ver = implode('.', $ver);
11 11
 		?>
12
-		<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://eventespresso.com/wiki/ee4-changelog/#' . $ver ); ?>
12
+		<?php printf(__('For more information, see <a href="%s">the release notes</a>.'), 'http://eventespresso.com/wiki/ee4-changelog/#'.$ver); ?>
13 13
  	</p>
14 14
 </div>
15 15
 
16 16
 <div class="changelog">
17 17
 	<?php
18 18
 	//maintenance mode on?
19
-	if ( EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ) {
19
+	if (EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) {
20 20
 		?>
21 21
 		<div class="ee-attention">
22
-			<h2 class="ee-maintenance-mode-callout"><?php  _e('Event Espresso is in full maintenance mode.' , 'event_espresso'); ?></h2>
22
+			<h2 class="ee-maintenance-mode-callout"><?php  _e('Event Espresso is in full maintenance mode.', 'event_espresso'); ?></h2>
23 23
 			<p>
24 24
 			<?php
25 25
 				printf(
Please login to merge, or discard this patch.
admin_pages/events/Event_Categories_Admin_List_Table.class.php 2 patches
Spacing   +19 added lines, -19 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
 /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 class Event_Categories_Admin_List_Table extends EE_Admin_List_Table {
33 33
 
34
-	public function __construct( $admin_page ) {
34
+	public function __construct($admin_page) {
35 35
 		parent::__construct($admin_page);
36 36
 	}
37 37
 
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
 
41 41
 	protected function _setup_data() {
42
-		$this->_data = $this->_admin_page->get_categories( $this->_per_page, $this->_current_page);
43
-		$this->_all_data_count = EEM_Term_Taxonomy::instance()->count( array( array( 'taxonomy' => 'espresso_event_categories' ) ) );
42
+		$this->_data = $this->_admin_page->get_categories($this->_per_page, $this->_current_page);
43
+		$this->_all_data_count = EEM_Term_Taxonomy::instance()->count(array(array('taxonomy' => 'espresso_event_categories')));
44 44
 	}
45 45
 
46 46
 
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 
50 50
 	protected function _set_properties() {
51 51
 		$this->_wp_list_args = array(
52
-			'singular' => __('event category', 'event_espresso' ),
53
-			'plural' => __('event categories', 'event_espresso' ),
52
+			'singular' => __('event category', 'event_espresso'),
53
+			'plural' => __('event categories', 'event_espresso'),
54 54
 			'ajax' => TRUE, //for now,
55 55
 			'screen' => $this->_admin_page->get_current_screen()->id
56 56
 			);
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 			);
65 65
 
66 66
 		$this->_sortable_columns = array(
67
-			'id' => array( 'Term.term_id' => true ),
68
-			'name' => array( 'Term.slug' => false ),
69
-			'count' => array( 'term_count' => false )
67
+			'id' => array('Term.term_id' => true),
68
+			'name' => array('Term.slug' => false),
69
+			'count' => array('term_count' => false)
70 70
 			);
71 71
 
72 72
 		$this->_hidden_columns = array();
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
 
98 98
 	public function column_cb($item) {
99
-		return sprintf( '<input type="checkbox" name="EVT_CAT_ID[]" value="%s" />', $item->get('term_id') );
99
+		return sprintf('<input type="checkbox" name="EVT_CAT_ID[]" value="%s" />', $item->get('term_id'));
100 100
 	}
101 101
 
102 102
 
@@ -123,17 +123,17 @@  discard block
 block discarded – undo
123 123
 			'EVT_CAT_ID' => $item->get('term_id')
124 124
 		);
125 125
 
126
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
127
-		$delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EVENTS_ADMIN_URL );
126
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
127
+		$delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EVENTS_ADMIN_URL);
128 128
 
129 129
 		$actions = array(
130
-			'edit' => '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Category', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>'
130
+			'edit' => '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Category', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'
131 131
 			);
132 132
 
133 133
 
134
-		$actions['delete'] = '<a href="' . $delete_link . '" title="' . esc_attr__('Delete Category', 'event_espresso') . '">' . __('Delete', 'event_espresso') . '</a>';
134
+		$actions['delete'] = '<a href="'.$delete_link.'" title="'.esc_attr__('Delete Category', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>';
135 135
 
136
-		$content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->get_first_related('Term')->get('name') . '</a></strong>';
136
+		$content = '<strong><a class="row-title" href="'.$edit_link.'">'.$item->get_first_related('Term')->get('name').'</a></strong>';
137 137
 		$content .= $this->row_actions($actions);
138 138
 		return $content;
139 139
 	}
@@ -142,20 +142,20 @@  discard block
 block discarded – undo
142 142
 
143 143
 
144 144
 	public function column_shortcode($item) {
145
-		$content = '[ESPRESSO_EVENTS category_slug="' . $item->get_first_related('Term')->get('slug') . '"]';
145
+		$content = '[ESPRESSO_EVENTS category_slug="'.$item->get_first_related('Term')->get('slug').'"]';
146 146
 		return $content;
147 147
 	}
148 148
 
149 149
 
150 150
 
151 151
 
152
-	public function column_count( $item ) {
152
+	public function column_count($item) {
153 153
 		$e_args = array(
154 154
 			'action' => 'default',
155 155
 			'EVT_CAT' => $item->get_first_related('Term')->ID()
156 156
 			);
157
-		$e_link = EE_Admin_Page::add_query_args_and_nonce( $e_args, EVENTS_ADMIN_URL );
158
-		$content = '<a href="' . $e_link . '">' . $item->get('term_count') . '</a>';
157
+		$e_link = EE_Admin_Page::add_query_args_and_nonce($e_args, EVENTS_ADMIN_URL);
158
+		$content = '<a href="'.$e_link.'">'.$item->get('term_count').'</a>';
159 159
 		return $content;
160 160
 	}
161 161
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
admin_pages/events/Events_Admin_List_Table.class.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -111,8 +111,8 @@
 block discarded – undo
111 111
 		$regs = $item->count_related('Registration');
112 112
 		return $regs > 0 && $this->_view == 'trash' ? '<span class="ee-lock-icon"></span>' : sprintf(
113 113
 			'<input type="checkbox" name="EVT_IDs[]" value="%s" />', $item->ID()
114
-        );
115
-    }
114
+		);
115
+	}
116 116
 
117 117
 
118 118
 
Please login to merge, or discard this patch.
Spacing   +62 added lines, -62 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
 /**
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
33 33
 
34 34
 	private $_dtt;
35 35
 
36
-	public function __construct( $admin_page ) {
36
+	public function __construct($admin_page) {
37 37
 		parent::__construct($admin_page);
38
-		require_once( EE_HELPERS . 'EEH_DTT_Helper.helper.php' );
38
+		require_once(EE_HELPERS.'EEH_DTT_Helper.helper.php');
39 39
 	}
40 40
 
41 41
 	protected function _setup_data() {
42 42
 		$this->_data = $this->_admin_page->get_events($this->_per_page, $this->_current_page);
43
- 		$this->_all_data_count = $this->_admin_page->get_events(0,0, TRUE);
43
+ 		$this->_all_data_count = $this->_admin_page->get_events(0, 0, TRUE);
44 44
 	}
45 45
 
46 46
 	protected function _set_properties() {
@@ -68,15 +68,15 @@  discard block
 block discarded – undo
68 68
 
69 69
 
70 70
 		$this->_sortable_columns = array(
71
-			'id' => array( 'EVT_ID' => true ),
72
-			'name' => array( 'EVT_name' => false ),
73
-			'author' => array( 'EVT_wp_user' => false ),
74
-			'venue' => array( 'Venue.VNU_name' => false ),
71
+			'id' => array('EVT_ID' => true),
72
+			'name' => array('EVT_name' => false),
73
+			'author' => array('EVT_wp_user' => false),
74
+			'venue' => array('Venue.VNU_name' => false),
75 75
 			'start_date_time' => array('Datetime.DTT_EVT_start' => false),
76 76
 			'reg_begins' => array('Datetime.Ticket.TKT_start_date' => false),
77 77
 			);
78 78
 
79
-		$this->_hidden_columns = array( 'author' );
79
+		$this->_hidden_columns = array('author');
80 80
 	}
81 81
 
82 82
 
@@ -91,15 +91,15 @@  discard block
 block discarded – undo
91 91
 	protected function _add_view_counts() {
92 92
 		$this->_views['all']['count'] = $this->_admin_page->total_events();
93 93
 		$this->_views['draft']['count'] = $this->_admin_page->total_events_draft();
94
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_events', 'espresso_events_trash_events' ) ) {
94
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
95 95
 			$this->_views['trash']['count'] = $this->_admin_page->total_trashed_events();
96 96
 		}
97 97
 	}
98 98
 
99 99
 
100 100
 
101
-	public function column_status( EE_Event $item ) {
102
-		return '<span class="ee-status-strip ee-status-strip-td event-status-' . $item->get_active_status() . '"></span>';
101
+	public function column_status(EE_Event $item) {
102
+		return '<span class="ee-status-strip ee-status-strip-td event-status-'.$item->get_active_status().'"></span>';
103 103
 	}/**/
104 104
 
105 105
 
@@ -128,10 +128,10 @@  discard block
 block discarded – undo
128 128
 				'action' => 'edit',
129 129
 				'post' => $item->ID()
130 130
 			);
131
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
132
-		$actions = $this->_column_name_action_setup( $item );
131
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
132
+		$actions = $this->_column_name_action_setup($item);
133 133
 		$status = ''; //$item->status() !== 'publish' ? ' (' . $item->status() . ')' : '';
134
-		$content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>' . $status;
134
+		$content = '<strong><a class="row-title" href="'.$edit_link.'">'.$item->name().'</a></strong>'.$status;
135 135
 		$content .= $this->row_actions($actions);
136 136
 		return $content;
137 137
 
@@ -148,72 +148,72 @@  discard block
 block discarded – undo
148 148
 	 *
149 149
 	 * @return array array of actions
150 150
 	 */
151
-	protected function _column_name_action_setup( EE_Event $item ) {
151
+	protected function _column_name_action_setup(EE_Event $item) {
152 152
 		//todo: remove when attendees is active
153
-		if ( !defined('REG_ADMIN_URL') )
153
+		if ( ! defined('REG_ADMIN_URL'))
154 154
 			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
155 155
 
156 156
 		$actions = array();
157 157
 
158
-		if ( EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID() ) ) {
158
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID())) {
159 159
 			$edit_query_args = array(
160 160
 					'action' => 'edit',
161 161
 					'post' => $item->ID()
162 162
 				);
163
-			$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
164
-			$actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Event', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>';
163
+			$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
164
+			$actions['edit'] = '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Event', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>';
165 165
 
166 166
 		}
167 167
 
168
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ) {
168
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID())) {
169 169
 			$attendees_query_args = array(
170 170
 					'action' => 'default',
171 171
 					'event_id' => $item->ID()
172 172
 				);
173
-			$attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL );
174
-			$actions['attendees'] = '<a href="' . $attendees_link . '" title="' . esc_attr__('View Registrations', 'event_espresso') . '">' . __('Registrations', 'event_espresso') . '</a>';
173
+			$attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL);
174
+			$actions['attendees'] = '<a href="'.$attendees_link.'" title="'.esc_attr__('View Registrations', 'event_espresso').'">'.__('Registrations', 'event_espresso').'</a>';
175 175
 		}
176 176
 
177
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_trash_event', $item->ID() ) ) {
177
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_trash_event', $item->ID())) {
178 178
 			$trash_event_query_args = array(
179 179
 					'action' => 'trash_event',
180 180
 					'EVT_ID' => $item->ID()
181 181
 				);
182
-			$trash_event_link = EE_Admin_Page::add_query_args_and_nonce( $trash_event_query_args, EVENTS_ADMIN_URL );
182
+			$trash_event_link = EE_Admin_Page::add_query_args_and_nonce($trash_event_query_args, EVENTS_ADMIN_URL);
183 183
 		}
184 184
 
185
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_restore_event', $item->ID() ) ) {
185
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_restore_event', $item->ID())) {
186 186
 			$restore_event_query_args = array(
187 187
 					'action' => 'restore_event',
188 188
 					'EVT_ID' => $item->ID()
189 189
 				);
190
-			$restore_event_link = EE_Admin_Page::add_query_args_and_nonce( $restore_event_query_args, EVENTS_ADMIN_URL );
190
+			$restore_event_link = EE_Admin_Page::add_query_args_and_nonce($restore_event_query_args, EVENTS_ADMIN_URL);
191 191
 		}
192 192
 
193
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_delete_event', $item->ID() ) ) {
193
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_delete_event', $item->ID())) {
194 194
 			$delete_event_query_args = array(
195 195
 					'action' => 'delete_event',
196 196
 					'EVT_ID' => $item->ID()
197 197
 				);
198
-			$delete_event_link = EE_Admin_Page::add_query_args_and_nonce( $delete_event_query_args, EVENTS_ADMIN_URL );
198
+			$delete_event_link = EE_Admin_Page::add_query_args_and_nonce($delete_event_query_args, EVENTS_ADMIN_URL);
199 199
 		}
200 200
 
201 201
 		$view_link = get_permalink($item->ID());
202 202
 
203
-		$actions['view'] = '<a href="' . $view_link . '" title="' . esc_attr__('View Event', 'event_espresso') . '">' . __('View', 'event_espresso') . '</a>';
203
+		$actions['view'] = '<a href="'.$view_link.'" title="'.esc_attr__('View Event', 'event_espresso').'">'.__('View', 'event_espresso').'</a>';
204 204
 
205
-		switch ( $item->get( 'status' ) ) {
205
+		switch ($item->get('status')) {
206 206
 			case 'trash' :
207
-					if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_restore_event', $item->ID() ) ) {
208
-						$actions['restore_from_trash'] = '<a href="' . $restore_event_link . '" title="' . esc_attr__('Restore from Trash', 'event_espresso') . '">' . __('Restore from Trash', 'event_espresso') . '</a>';
207
+					if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_restore_event', $item->ID())) {
208
+						$actions['restore_from_trash'] = '<a href="'.$restore_event_link.'" title="'.esc_attr__('Restore from Trash', 'event_espresso').'">'.__('Restore from Trash', 'event_espresso').'</a>';
209 209
 					}
210
-					if ( $item->count_related('Registration') === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_delete_event', $item->ID() ) ) {
211
-						$actions['delete permanently'] = '<a href="' . $delete_event_link . '" title="' . esc_attr__('Delete Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>';
210
+					if ($item->count_related('Registration') === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_delete_event', $item->ID())) {
211
+						$actions['delete permanently'] = '<a href="'.$delete_event_link.'" title="'.esc_attr__('Delete Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
212 212
 					}
213 213
 				break;
214 214
 			default :
215
-					if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_trash_event', $item->ID() ) ) {
216
-						$actions['move to trash'] = '<a href="' . $trash_event_link . '" title="' . esc_attr__('Trash Event', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
215
+					if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_trash_event', $item->ID())) {
216
+						$actions['move to trash'] = '<a href="'.$trash_event_link.'" title="'.esc_attr__('Trash Event', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
217 217
 					}
218 218
 		}
219 219
 		return $actions;
@@ -222,34 +222,34 @@  discard block
 block discarded – undo
222 222
 
223 223
 
224 224
 
225
-	public function column_author( EE_Event $item ) {
225
+	public function column_author(EE_Event $item) {
226 226
 		//user author info
227
-		$event_author = get_userdata( $item->wp_user() );
228
-		$gravatar = get_avatar( $item->wp_user(), '15' );
227
+		$event_author = get_userdata($item->wp_user());
228
+		$gravatar = get_avatar($item->wp_user(), '15');
229 229
 		//filter link
230 230
 		$query_args = array(
231 231
 			'action' => 'default',
232 232
 			'EVT_wp_user' => $item->wp_user()
233 233
 			);
234
-		$filter_url = EE_Admin_Page::add_query_args_and_nonce( $query_args, EVENTS_ADMIN_URL );
235
-		return $gravatar . '  <a href="' . $filter_url . '" title="' . esc_attr__('Click to filter events by this author.', 'event_espresso') . '">' . $event_author->display_name . '</a>';
234
+		$filter_url = EE_Admin_Page::add_query_args_and_nonce($query_args, EVENTS_ADMIN_URL);
235
+		return $gravatar.'  <a href="'.$filter_url.'" title="'.esc_attr__('Click to filter events by this author.', 'event_espresso').'">'.$event_author->display_name.'</a>';
236 236
 	}
237 237
 
238 238
 
239 239
 
240 240
 
241 241
 	public function column_venue($item) {
242
-		$venue = $item->get_first_related( 'Venue' );
243
-		return !empty( $venue ) ? $venue->name() : '';
242
+		$venue = $item->get_first_related('Venue');
243
+		return ! empty($venue) ? $venue->name() : '';
244 244
 	}
245 245
 
246 246
 
247 247
 
248 248
 
249 249
 	public function column_start_date_time($item) {
250
-		echo !empty( $this->_dtt ) ?  $this->_dtt->get_i18n_datetime('DTT_EVT_start') : __('No Date was saved for this Event', 'event_espresso');
250
+		echo ! empty($this->_dtt) ? $this->_dtt->get_i18n_datetime('DTT_EVT_start') : __('No Date was saved for this Event', 'event_espresso');
251 251
 		//display in user's timezone?
252
-		echo !empty( $this->_dtt ) ? $this->_dtt->display_in_my_timezone('DTT_EVT_start', 'get_i18n_datetime', '', 'My Timezone: ' ) : '';
252
+		echo ! empty($this->_dtt) ? $this->_dtt->display_in_my_timezone('DTT_EVT_start', 'get_i18n_datetime', '', 'My Timezone: ') : '';
253 253
 
254 254
 	}
255 255
 
@@ -258,9 +258,9 @@  discard block
 block discarded – undo
258 258
 
259 259
 	public function column_reg_begins($item) {
260 260
 		$reg_start = $item->get_ticket_with_earliest_start_time();
261
-		echo !empty( $reg_start ) ? $reg_start->get_i18n_datetime('TKT_start_date') : __('No Tickets have been setup for this Event', 'event_espresso');
261
+		echo ! empty($reg_start) ? $reg_start->get_i18n_datetime('TKT_start_date') : __('No Tickets have been setup for this Event', 'event_espresso');
262 262
 		//display in user's timezone?
263
-		echo !empty( $reg_start ) ? $reg_start->display_in_my_timezone('TKT_start_date', 'get_i18n_datetime', '', 'My Timezone: ' ) : '';/**/
263
+		echo ! empty($reg_start) ? $reg_start->display_in_my_timezone('TKT_start_date', 'get_i18n_datetime', '', 'My Timezone: ') : ''; /**/
264 264
 	}
265 265
 
266 266
 
@@ -278,51 +278,51 @@  discard block
 block discarded – undo
278 278
 				'action' => 'default',
279 279
 				'event_id' => $item->ID()
280 280
 			);
281
-		$attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL );
282
-		$registered_attendees = EEM_Registration::instance()->get_event_registration_count( $item->ID() );
283
-		return  EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ? '<a href="' . $attendees_link . '">' . $registered_attendees . '</a>' : $registered_attendees;
281
+		$attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL);
282
+		$registered_attendees = EEM_Registration::instance()->get_event_registration_count($item->ID());
283
+		return  EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? '<a href="'.$attendees_link.'">'.$registered_attendees.'</a>' : $registered_attendees;
284 284
 	}
285 285
 
286 286
 
287 287
 
288 288
 	public function column_tkts_sold($item) {
289
-		return EEM_Ticket::instance()->sum(array( array('Datetime.EVT_ID' => $item->ID() )), 'TKT_sold' );
289
+		return EEM_Ticket::instance()->sum(array(array('Datetime.EVT_ID' => $item->ID())), 'TKT_sold');
290 290
 	}
291 291
 
292 292
 
293 293
 
294 294
 	public function column_actions($item) {
295 295
 		//todo: remove when attendees is active
296
-		if ( !defined('REG_ADMIN_URL') )
296
+		if ( ! defined('REG_ADMIN_URL'))
297 297
 			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
298 298
 		$actionlinks = array();
299 299
 
300 300
 		$view_link = get_permalink($item->ID());
301 301
 
302
-		$actionlinks[] = '<a href="' .  $view_link . '" title="' . esc_attr__('View Event', 'event_espresso') . '" target="_blank">';
302
+		$actionlinks[] = '<a href="'.$view_link.'" title="'.esc_attr__('View Event', 'event_espresso').'" target="_blank">';
303 303
 		$actionlinks[] = '<div class="dashicons dashicons-search"></div></a>';
304 304
 
305
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'espresso_events_edit', $item->ID() ) ) {
305
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID())) {
306 306
 			$edit_query_args = array(
307 307
 					'action' => 'edit',
308 308
 					'post' => $item->ID()
309 309
 				);
310
-			$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
311
-			$actionlinks[] = '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Event', 'event_espresso') . '"><div class="ee-icon ee-icon-calendar-edit"></div></a>';
310
+			$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
311
+			$actionlinks[] = '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Event', 'event_espresso').'"><div class="ee-icon ee-icon-calendar-edit"></div></a>';
312 312
 		}
313 313
 
314
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ) {
314
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID())) {
315 315
 			$attendees_query_args = array(
316 316
 				'action' => 'default',
317 317
 				'event_id' => $item->ID()
318 318
 			);
319
-			$attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL );
320
-			$actionlinks[] = '<a href="' . $attendees_link . '" title="' . esc_attr__('View Registrants', 'event_espresso') . '"><div class="dashicons dashicons-groups"></div></a>';
319
+			$attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL);
320
+			$actionlinks[] = '<a href="'.$attendees_link.'" title="'.esc_attr__('View Registrants', 'event_espresso').'"><div class="dashicons dashicons-groups"></div></a>';
321 321
 		}
322 322
 
323
-		$actionlinks = apply_filters( 'FHEE__Events_Admin_List_Table__column_actions__action_links', $actionlinks, $item );
323
+		$actionlinks = apply_filters('FHEE__Events_Admin_List_Table__column_actions__action_links', $actionlinks, $item);
324 324
 
325
-		return $this->_action_string( implode( "\n\t", $actionlinks ), $item, 'div' );
325
+		return $this->_action_string(implode("\n\t", $actionlinks), $item, 'div');
326 326
 	}
327 327
 
328 328
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  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 6
 /**
6 7
  * Event Espresso
@@ -150,8 +151,9 @@  discard block
 block discarded – undo
150 151
 	 */
151 152
 	protected function _column_name_action_setup( EE_Event $item ) {
152 153
 		//todo: remove when attendees is active
153
-		if ( !defined('REG_ADMIN_URL') )
154
-			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
154
+		if ( !defined('REG_ADMIN_URL') ) {
155
+					define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
156
+		}
155 157
 
156 158
 		$actions = array();
157 159
 
@@ -293,8 +295,9 @@  discard block
 block discarded – undo
293 295
 
294 296
 	public function column_actions($item) {
295 297
 		//todo: remove when attendees is active
296
-		if ( !defined('REG_ADMIN_URL') )
297
-			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
298
+		if ( !defined('REG_ADMIN_URL') ) {
299
+					define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
300
+		}
298 301
 		$actionlinks = array();
299 302
 
300 303
 		$view_link = get_permalink($item->ID());
Please login to merge, or discard this patch.
admin_pages/events/Events_Admin_Page.core.php 3 patches
Braces   +23 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  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 6
 /**
6 7
  * Event Espresso
@@ -871,8 +872,9 @@  discard block
 block discarded – undo
871 872
 		$venue_id = !empty( $data['venue_id'] ) ? $data['venue_id'] : NULL;
872 873
 
873 874
 		//very important.  If we don't have a venue name then we'll get out because not necessary to create empty venue
874
-		if ( empty( $data['venue_title'] ) )
875
-			return;
875
+		if ( empty( $data['venue_title'] ) ) {
876
+					return;
877
+		}
876 878
 
877 879
 		$venue_array = array(
878 880
 				'VNU_wp_user' => $evtobj->get('EVT_wp_user'),
@@ -1194,7 +1196,9 @@  discard block
 block discarded – undo
1194 1196
 
1195 1197
 
1196 1198
 		//if no postid then get out cause we need it for stuff in here
1197
-		if ( empty( $postid ) ) return;
1199
+		if ( empty( $postid ) ) {
1200
+			return;
1201
+		}
1198 1202
 
1199 1203
 
1200 1204
 		//handle datetime saves
@@ -1436,10 +1440,11 @@  discard block
 block discarded – undo
1436 1440
 			//get the earliest datetime (if present);
1437 1441
 			$earliest_dtt = $this->_cpt_model_obj->ID() > 0 ? $this->_cpt_model_obj->get_first_related('Datetime', array('order_by'=> array('DTT_EVT_start' => 'ASC' ) ) ) : NULL;
1438 1442
 
1439
-			if ( !empty( $earliest_dtt ) )
1440
-				$template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1441
-			else
1442
-				$template_args['TKT_end_date'] = date('Y-m-d h:i a', mktime(0, 0, 0, date("m"), date("d")+7, date("Y") ) );
1443
+			if ( !empty( $earliest_dtt ) ) {
1444
+							$template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1445
+			} else {
1446
+							$template_args['TKT_end_date'] = date('Y-m-d h:i a', mktime(0, 0, 0, date("m"), date("d")+7, date("Y") ) );
1447
+			}
1443 1448
 		}
1444 1449
 
1445 1450
 		$template_args = array_merge( $template_args, $price_args );
@@ -1715,8 +1720,9 @@  discard block
 block discarded – undo
1715 1720
 		}
1716 1721
 		$action = $event_status == 'trash' ? 'moved to the trash' : 'restored from the trash';
1717 1722
 
1718
-		if ( $redirect_after )
1719
-			$this->_redirect_after_action($success, 'Event', $action, array('action' => 'default'));
1723
+		if ( $redirect_after ) {
1724
+					$this->_redirect_after_action($success, 'Event', $action, array('action' => 'default'));
1725
+		}
1720 1726
 	}
1721 1727
 
1722 1728
 	/**
@@ -1841,8 +1847,9 @@  discard block
 block discarded – undo
1841 1847
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1842 1848
 		}
1843 1849
 
1844
-		if ( $redirect_after )
1845
-			$this->_redirect_after_action($success, 'Event', 'deleted', array('action' => 'default', 'status' => 'trash'));
1850
+		if ( $redirect_after ) {
1851
+					$this->_redirect_after_action($success, 'Event', 'deleted', array('action' => 'default', 'status' => 'trash'));
1852
+		}
1846 1853
 	}
1847 1854
 
1848 1855
 	/**
@@ -2074,8 +2081,10 @@  discard block
 block discarded – undo
2074 2081
 	 * @return void
2075 2082
 	 */
2076 2083
 	private function _set_category_object() {
2077
-		if ( isset( $this->_category->id ) && !empty( $this->_category->id ) )
2078
-			return; //already have the category object so get out.
2084
+		if ( isset( $this->_category->id ) && !empty( $this->_category->id ) ) {
2085
+					return;
2086
+		}
2087
+		//already have the category object so get out.
2079 2088
 
2080 2089
 		//set default category object
2081 2090
 		$this->_set_empty_category_object();
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
 	 * Handles saving everything related to Tickets (datetimes, tickets, prices)
917 917
 	 * @param  EE_Event $evtobj The Event object we're attaching data to
918 918
 	 * @param  array    $data   The request data from the form
919
-	 * @return bool             success or fail
919
+	 * @return boolean|null             success or fail
920 920
 	 */
921 921
 	protected function _default_tickets_update( $evtobj, $data ) {
922 922
 		$success = TRUE;
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
 	 * This just returns whatever is set as the _event object property
1252 1252
 	 *
1253 1253
 	 * //todo this will become obsolete once the models are in place
1254
-	 * @return object
1254
+	 * @return EE_CPT_Base
1255 1255
 	 */
1256 1256
 	public function get_event_object() {
1257 1257
 		return $this->_cpt_model_obj;
@@ -1707,9 +1707,8 @@  discard block
 block discarded – undo
1707 1707
 	 * _trash_or_restore_events
1708 1708
 	 *
1709 1709
 	 * @access  private
1710
-	 * @param  int $event_id
1711 1710
 	 * @param  string $event_status
1712
-	 * @return void
1711
+	 * @return boolean
1713 1712
 	 */
1714 1713
 	private function _change_event_status($EVT_ID = FALSE, $event_status = FALSE) {
1715 1714
 		// grab event id
@@ -1829,7 +1828,7 @@  discard block
 block discarded – undo
1829 1828
 	 *
1830 1829
 	 * @access  private
1831 1830
 	 * @param  int $EVT_ID
1832
-	 * @return void
1831
+	 * @return boolean
1833 1832
 	 */
1834 1833
 	private function _permanently_delete_event($EVT_ID = FALSE) {
1835 1834
 		// grab event id
Please login to merge, or discard this patch.
Spacing   +354 added lines, -354 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
 /**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 			'espresso_events' => 'edit'
68 68
 			);
69 69
 
70
-		add_action('AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object', array( $this, 'verify_event_edit' ) );
70
+		add_action('AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object', array($this, 'verify_event_edit'));
71 71
 	}
72 72
 
73 73
 	protected function _ajax_hooks() {
@@ -93,20 +93,20 @@  discard block
 block discarded – undo
93 93
 				'edit' => __('Update Event', 'event_espresso'),
94 94
 				'add_category' => __('Save New Category', 'event_espresso'),
95 95
 				'edit_category' => __('Update Category', 'event_espresso'),
96
-				'template_settings' => __( 'Update Settings', 'event_espresso' )
96
+				'template_settings' => __('Update Settings', 'event_espresso')
97 97
 				)
98 98
 		);
99 99
 	}
100 100
 
101 101
 	protected function _set_page_routes() {
102 102
 		//load formatter helper
103
-		EE_Registry::instance()->load_helper( 'Formatter' );
103
+		EE_Registry::instance()->load_helper('Formatter');
104 104
 		//load field generator helper
105
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
105
+		EE_Registry::instance()->load_helper('Form_Fields');
106 106
 
107 107
 		//is there a evt_id in the request?
108
-		$evt_id = ! empty( $this->_req_data['EVT_ID'] ) && ! is_array( $this->_req_data['EVT_ID'] ) ? $this->_req_data['EVT_ID'] : 0;
109
-		$evt_id = ! empty( $this->_req_data['post'] ) ? $this->_req_data['post'] : $evt_id;
108
+		$evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : 0;
109
+		$evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
110 110
 
111 111
 
112 112
 		$this->_page_routes = array(
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 				'help_tour' => array(
321 321
 					'Event_Editor_Help_Tour'
322 322
 					),
323
-				'qtips' => array( 'EE_Event_Editor_Decaf_Tips' ),
323
+				'qtips' => array('EE_Event_Editor_Decaf_Tips'),
324 324
 				'require_nonce' => FALSE
325 325
 			),
326 326
 			'edit' => array(
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 				'help_tour' => array(
377 377
 					'Event_Edit_Help_Tour'
378 378
 				),
379
-				'qtips' => array( 'EE_Event_Editor_Decaf_Tips' ),
379
+				'qtips' => array('EE_Event_Editor_Decaf_Tips'),
380 380
 				'require_nonce' => FALSE
381 381
 			),
382 382
 			'default_event_settings' => array(
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 						'filename' => 'events_default_settings_status'
399 399
 					)
400 400
 				),
401
-				'help_tour' => array( 'Event_Default_Settings_Help_Tour'),
401
+				'help_tour' => array('Event_Default_Settings_Help_Tour'),
402 402
 				'require_nonce' => FALSE
403 403
 			),
404 404
 			//template settings
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 						'filename' => 'general_settings_templates'
415 415
 					)
416 416
 				),
417
-				'help_tour' => array( 'Templates_Help_Tour' ),
417
+				'help_tour' => array('Templates_Help_Tour'),
418 418
 				'require_nonce' => FALSE
419 419
 			),
420 420
 			//event category stuff
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 					'label' => __('Edit Category', 'event_espresso'),
439 439
 					'order' => 15,
440 440
 					'persistent' => FALSE,
441
-					'url' => isset($this->_req_data['EVT_CAT_ID']) ? add_query_arg(array('EVT_CAT_ID' => $this->_req_data['EVT_CAT_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url
441
+					'url' => isset($this->_req_data['EVT_CAT_ID']) ? add_query_arg(array('EVT_CAT_ID' => $this->_req_data['EVT_CAT_ID']), $this->_current_page_view_url) : $this->_admin_base_url
442 442
 					),
443 443
 				'help_tabs' => array(
444 444
 					'edit_category_help_tab' => array(
@@ -508,14 +508,14 @@  discard block
 block discarded – undo
508 508
 
509 509
 	public function load_scripts_styles() {
510 510
 
511
-		wp_register_style('events-admin-css', EVENTS_ASSETS_URL . 'events-admin-page.css', array(), EVENT_ESPRESSO_VERSION);
512
-		wp_register_style('ee-cat-admin', EVENTS_ASSETS_URL . 'ee-cat-admin.css', array(), EVENT_ESPRESSO_VERSION );
511
+		wp_register_style('events-admin-css', EVENTS_ASSETS_URL.'events-admin-page.css', array(), EVENT_ESPRESSO_VERSION);
512
+		wp_register_style('ee-cat-admin', EVENTS_ASSETS_URL.'ee-cat-admin.css', array(), EVENT_ESPRESSO_VERSION);
513 513
 		wp_enqueue_style('events-admin-css');
514 514
 		wp_enqueue_style('ee-cat-admin');
515 515
 		//todo note: we also need to load_scripts_styles per view (i.e. default/view_report/event_details
516 516
 		//registers for all views
517 517
 		//scripts
518
-		wp_register_script('event_editor_js', EVENTS_ASSETS_URL . 'event_editor.js', array('ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'), EVENT_ESPRESSO_VERSION, TRUE);
518
+		wp_register_script('event_editor_js', EVENTS_ASSETS_URL.'event_editor.js', array('ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'), EVENT_ESPRESSO_VERSION, TRUE);
519 519
 	}
520 520
 
521 521
 	/**
@@ -533,11 +533,11 @@  discard block
 block discarded – undo
533 533
 	public function load_scripts_styles_edit() {
534 534
 		//styles
535 535
 		wp_enqueue_style('espresso-ui-theme');
536
-		wp_register_style('event-editor-css', EVENTS_ASSETS_URL . 'event-editor.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
536
+		wp_register_style('event-editor-css', EVENTS_ASSETS_URL.'event-editor.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
537 537
 		wp_enqueue_style('event-editor-css');
538 538
 
539 539
 		//scripts
540
-		wp_register_script('event-datetime-metabox', EVENTS_ASSETS_URL . 'event-datetime-metabox.js', array('event_editor_js', 'ee-datepicker'), EVENT_ESPRESSO_VERSION );
540
+		wp_register_script('event-datetime-metabox', EVENTS_ASSETS_URL.'event-datetime-metabox.js', array('event_editor_js', 'ee-datepicker'), EVENT_ESPRESSO_VERSION);
541 541
 		wp_enqueue_script('event-datetime-metabox');
542 542
 
543 543
 		EE_Registry::$i18n_js_strings['image_confirm'] = __('Do you really want to delete this image? Please remember to update your event to complete the removal.', 'event_espresso');
@@ -589,35 +589,35 @@  discard block
 block discarded – undo
589 589
 	 */
590 590
 	public function verify_event_edit($event = NULL) {
591 591
 		// no event?
592
-		if ( empty( $event )) {
592
+		if (empty($event)) {
593 593
 			// set event
594 594
 			$event = $this->_cpt_model_obj;
595 595
 		}
596 596
 		// STILL no event?
597
-		if ( empty ( $event )) {
597
+		if (empty ($event)) {
598 598
 			return;
599 599
 		}
600 600
 		// first check if event is active.
601
-		if ( $event->is_expired() || $event->is_inactive() || $event->status() == EEM_Event::cancelled || $event->status() == EEM_Event::postponed ) {
601
+		if ($event->is_expired() || $event->is_inactive() || $event->status() == EEM_Event::cancelled || $event->status() == EEM_Event::postponed) {
602 602
 			return;
603 603
 		}
604 604
 		$orig_status = $event->status();
605 605
 		//made it here so it IS active... next check that any of the tickets are sold.
606
-		if ( $event->is_sold_out() || $event->is_sold_out(TRUE ) ) {
607
-			if ( $event->status() !== $orig_status && $orig_status !== EEM_Event::sold_out  ) {
608
-				EE_Error::add_attention( sprintf(
609
-					__( 'Please note that the Event Status has automaticallly been changed to %s because there are no more spaces available for this event.  However, this change is not permanent until you update the event.  You <em>can</em> change the status back to something else before updating if you wish.', 'event_espresso' ),
610
-					EEH_Template::pretty_status( EEM_Event::sold_out, FALSE, 'sentence' )
606
+		if ($event->is_sold_out() || $event->is_sold_out(TRUE)) {
607
+			if ($event->status() !== $orig_status && $orig_status !== EEM_Event::sold_out) {
608
+				EE_Error::add_attention(sprintf(
609
+					__('Please note that the Event Status has automaticallly been changed to %s because there are no more spaces available for this event.  However, this change is not permanent until you update the event.  You <em>can</em> change the status back to something else before updating if you wish.', 'event_espresso'),
610
+					EEH_Template::pretty_status(EEM_Event::sold_out, FALSE, 'sentence')
611 611
 				));
612 612
 			}
613 613
 			return;
614 614
 		}
615 615
 		//now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
616
-		if ( ! $event->tickets_on_sale() ) {
616
+		if ( ! $event->tickets_on_sale()) {
617 617
 			return;
618 618
 		}
619 619
 		//made it here so show warning
620
-		EE_Error::add_attention( $this->_edit_event_warning() );
620
+		EE_Error::add_attention($this->_edit_event_warning());
621 621
 	}
622 622
 
623 623
 
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
 			),
658 658
 		);
659 659
 
660
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_events', 'espresso_events_trash_events' ) ) {
660
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
661 661
 			$this->_views['trash'] = array(
662 662
 				'slug' => 'trash',
663 663
 				'label' => __('Trash', 'event_espresso'),
@@ -687,39 +687,39 @@  discard block
 block discarded – undo
687 687
 				'desc' => __('View Registrations for Event', 'event_espresso')
688 688
 			)
689 689
 		);
690
-		$items  = apply_filters( 'FHEE__Events_Admin_Page___event_legend_items__items', $items );
690
+		$items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
691 691
 		$statuses = array(
692 692
 			'sold_out_status' => array(
693
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
694
-				'desc' => EEH_Template::pretty_status( EE_Datetime::sold_out, FALSE, 'sentence' )
693
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::sold_out,
694
+				'desc' => EEH_Template::pretty_status(EE_Datetime::sold_out, FALSE, 'sentence')
695 695
 			),
696 696
 			'active_status' => array(
697
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
698
-				'desc' => EEH_Template::pretty_status( EE_Datetime::active, FALSE, 'sentence' )
697
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::active,
698
+				'desc' => EEH_Template::pretty_status(EE_Datetime::active, FALSE, 'sentence')
699 699
 			),
700 700
 			'upcoming_status' => array(
701
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
702
-				'desc' => EEH_Template::pretty_status( EE_Datetime::upcoming, FALSE, 'sentence' )
701
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::upcoming,
702
+				'desc' => EEH_Template::pretty_status(EE_Datetime::upcoming, FALSE, 'sentence')
703 703
 			),
704 704
 			'postponed_status' => array(
705
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
706
-				'desc' => EEH_Template::pretty_status( EE_Datetime::postponed, FALSE, 'sentence' )
705
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::postponed,
706
+				'desc' => EEH_Template::pretty_status(EE_Datetime::postponed, FALSE, 'sentence')
707 707
 			),
708 708
 			'cancelled_status' => array(
709
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
710
-				'desc' => EEH_Template::pretty_status( EE_Datetime::cancelled, FALSE, 'sentence' )
709
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::cancelled,
710
+				'desc' => EEH_Template::pretty_status(EE_Datetime::cancelled, FALSE, 'sentence')
711 711
 			),
712 712
 			'expired_status' => array(
713
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
714
-				'desc' => EEH_Template::pretty_status( EE_Datetime::expired, FALSE, 'sentence' )
713
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::expired,
714
+				'desc' => EEH_Template::pretty_status(EE_Datetime::expired, FALSE, 'sentence')
715 715
 			),
716 716
 			'inactive_status' => array(
717
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
718
-				'desc' => EEH_Template::pretty_status( EE_Datetime::inactive, FALSE, 'sentence' )
717
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::inactive,
718
+				'desc' => EEH_Template::pretty_status(EE_Datetime::inactive, FALSE, 'sentence')
719 719
 			)
720 720
 		);
721
-		$statuses = apply_filters( 'FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses );
722
-		return array_merge( $items, $statuses );
721
+		$statuses = apply_filters('FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses);
722
+		return array_merge($items, $statuses);
723 723
 	}
724 724
 
725 725
 
@@ -731,8 +731,8 @@  discard block
 block discarded – undo
731 731
 	 * @return EEM_Event
732 732
 	 */
733 733
 	private function _event_model() {
734
-		if ( ! $this->_event_model instanceof EEM_Event ) {
735
-			$this->_event_model = EE_Registry::instance()->load_model( 'Event' );
734
+		if ( ! $this->_event_model instanceof EEM_Event) {
735
+			$this->_event_model = EE_Registry::instance()->load_model('Event');
736 736
 		}
737 737
 		return $this->_event_model;
738 738
 	}
@@ -751,12 +751,12 @@  discard block
 block discarded – undo
751 751
 	 * @param  string $new_slug  what the slug is
752 752
 	 * @return string            The new html string for the permalink area
753 753
 	 */
754
-	public function extra_permalink_field_buttons( $return, $id, $new_title, $new_slug ) {
754
+	public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug) {
755 755
 		//make sure this is only when editing
756
-		if ( !empty( $id ) ) {
757
-			$post = get_post( $id );
758
-			$return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">' . __('Shortcode', 'event_espresso') . '</a> ';
759
-			$return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id=\'' . $post->ID . '\']"">';
756
+		if ( ! empty($id)) {
757
+			$post = get_post($id);
758
+			$return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'.__('Shortcode', 'event_espresso').'</a> ';
759
+			$return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id=\''.$post->ID.'\']"">';
760 760
 		}
761 761
 		return $return;
762 762
 	}
@@ -772,8 +772,8 @@  discard block
 block discarded – undo
772 772
 	 * @return string html for generated table
773 773
 	 */
774 774
 	protected function _events_overview_list_table() {
775
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
776
-		$this->_template_args['after_list_table'] = EEH_Template::get_button_or_link( get_post_type_archive_link('espresso_events'), __("View Event Archive Page", "event_espresso"), 'button' ) .
775
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
776
+		$this->_template_args['after_list_table'] = EEH_Template::get_button_or_link(get_post_type_archive_link('espresso_events'), __("View Event Archive Page", "event_espresso"), 'button').
777 777
 		$this->_display_legend($this->_event_legend_items());
778 778
 		$this->_admin_page_title .= $this->get_action_link_or_button('create_new', 'add', array(), 'add-new-h2');
779 779
 		$this->display_admin_list_table_page_with_no_sidebar();
@@ -791,46 +791,46 @@  discard block
 block discarded – undo
791 791
 
792 792
 
793 793
 
794
-	protected function _insert_update_cpt_item( $post_id, $post ) {
794
+	protected function _insert_update_cpt_item($post_id, $post) {
795 795
 
796 796
 		$event_values = array(
797
-			'EVT_display_desc' => !empty( $this->_req_data['display_desc'] ) ? 1 : 0,
798
-			'EVT_display_ticket_selector' => !empty( $this->_req_data['display_ticket_selector'] ) ? 1 : 0,
797
+			'EVT_display_desc' => ! empty($this->_req_data['display_desc']) ? 1 : 0,
798
+			'EVT_display_ticket_selector' => ! empty($this->_req_data['display_ticket_selector']) ? 1 : 0,
799 799
 			'EVT_additional_limit' => min(
800
-					apply_filters( 'FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255 ),
801
-					!empty( $this->_req_data['additional_limit'] ) ? $this->_req_data['additional_limit'] : NULL ),
802
-			'EVT_default_registration_status' => !empty( $this->_req_data['EVT_default_registration_status'] ) ? $this->_req_data['EVT_default_registration_status'] : EE_Registry::instance()->CFG->registration->default_STS_ID,
803
-			'EVT_member_only' => !empty( $this->_req_data['member_only'] ) ? 1 : 0,
804
-			'EVT_allow_overflow' => !empty( $this->_req_data['EVT_allow_overflow'] ) ? 1 : 0,
805
-			'EVT_timezone_string' => !empty( $this->_req_data['timezone_string'] ) ? $this->_req_data['timezone_string'] : NULL,
806
-			'EVT_external_URL' => !empty( $this->_req_data['externalURL'] ) ? $this->_req_data['externalURL'] : NULL,
807
-			'EVT_phone' => !empty( $this->_req_data['event_phone'] ) ? $this->_req_data['event_phone'] : NULL
800
+					apply_filters('FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255),
801
+					! empty($this->_req_data['additional_limit']) ? $this->_req_data['additional_limit'] : NULL ),
802
+			'EVT_default_registration_status' => ! empty($this->_req_data['EVT_default_registration_status']) ? $this->_req_data['EVT_default_registration_status'] : EE_Registry::instance()->CFG->registration->default_STS_ID,
803
+			'EVT_member_only' => ! empty($this->_req_data['member_only']) ? 1 : 0,
804
+			'EVT_allow_overflow' => ! empty($this->_req_data['EVT_allow_overflow']) ? 1 : 0,
805
+			'EVT_timezone_string' => ! empty($this->_req_data['timezone_string']) ? $this->_req_data['timezone_string'] : NULL,
806
+			'EVT_external_URL' => ! empty($this->_req_data['externalURL']) ? $this->_req_data['externalURL'] : NULL,
807
+			'EVT_phone' => ! empty($this->_req_data['event_phone']) ? $this->_req_data['event_phone'] : NULL
808 808
 			);
809 809
 
810 810
 		//update event
811
-		$success = $this->_event_model()->update_by_ID( $event_values, $post_id );
811
+		$success = $this->_event_model()->update_by_ID($event_values, $post_id);
812 812
 
813 813
 
814 814
 		//get event_object for other metaboxes... though it would seem to make sense to just use $this->_event_model()->get_one_by_ID( $post_id ).. i have to setup where conditions to override the filters in the model that filter out autodraft and inherit statuses so we GET the inherit id!
815
-		$get_one_where = array( $this->_event_model()->primary_key_name() => $post_id, 'status' => $post->post_status );
816
-		$event = $this->_event_model()->get_one( array($get_one_where) );
815
+		$get_one_where = array($this->_event_model()->primary_key_name() => $post_id, 'status' => $post->post_status);
816
+		$event = $this->_event_model()->get_one(array($get_one_where));
817 817
 
818 818
 
819 819
 		//the following are default callbacks for event attachment updates that can be overridden by caffeinated functionality and/or addons.
820
-		$event_update_callbacks = apply_filters( 'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', array( array($this, '_default_venue_update' ), array( $this, '_default_tickets_update') ) );
820
+		$event_update_callbacks = apply_filters('FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', array(array($this, '_default_venue_update'), array($this, '_default_tickets_update')));
821 821
 
822 822
 		$att_success = TRUE;
823 823
 
824
-		foreach ( $event_update_callbacks as $e_callback ) {
825
-			$_succ = call_user_func_array( $e_callback, array( $event,  $this->_req_data ) );
826
-			$att_success = !$att_success ? $att_success : $_succ; //if ANY of these updates fail then we want the appropriate global error message
824
+		foreach ($event_update_callbacks as $e_callback) {
825
+			$_succ = call_user_func_array($e_callback, array($event, $this->_req_data));
826
+			$att_success = ! $att_success ? $att_success : $_succ; //if ANY of these updates fail then we want the appropriate global error message
827 827
 		}
828 828
 
829 829
 		//any errors?
830
-		if ( $success && FALSE === $att_success ) {
831
-			EE_Error::add_error( __('Event Details saved successfully but something went wrong with saving attachments.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
832
-		} else if ( $success === FALSE ) {
833
-			EE_Error::add_error( __('Event Details did not save successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
830
+		if ($success && FALSE === $att_success) {
831
+			EE_Error::add_error(__('Event Details saved successfully but something went wrong with saving attachments.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
832
+		} else if ($success === FALSE) {
833
+			EE_Error::add_error(__('Event Details did not save successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
834 834
 		}
835 835
 	}
836 836
 
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
 	/**
841 841
 	 * @see parent::restore_item()
842 842
 	 */
843
-	protected function _restore_cpt_item( $post_id, $revision_id ) {
843
+	protected function _restore_cpt_item($post_id, $revision_id) {
844 844
 		//copy existing event meta to new post
845 845
 		$post_evt = $this->_event_model()->get_one_by_ID($post_id);
846 846
 
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
 		$post_evt->restore_revision($revision_id);
849 849
 
850 850
 		//related objs restore
851
-		$post_evt->restore_revision($revision_id, array( 'Venue', 'Datetime', 'Price' ) );
851
+		$post_evt->restore_revision($revision_id, array('Venue', 'Datetime', 'Price'));
852 852
 	}
853 853
 
854 854
 
@@ -860,50 +860,50 @@  discard block
 block discarded – undo
860 860
 	 * @param  array  $data   The request data from the form
861 861
 	 * @return bool           Success or fail.
862 862
 	 */
863
-	protected function _default_venue_update( $evtobj, $data ) {
864
-		require_once( EE_MODELS . 'EEM_Venue.model.php' );
863
+	protected function _default_venue_update($evtobj, $data) {
864
+		require_once(EE_MODELS.'EEM_Venue.model.php');
865 865
 		$venue_model = EE_Registry::instance()->load_model('Venue');
866 866
 		$rows_affected = NULL;
867
-		$venue_id = !empty( $data['venue_id'] ) ? $data['venue_id'] : NULL;
867
+		$venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : NULL;
868 868
 
869 869
 		//very important.  If we don't have a venue name then we'll get out because not necessary to create empty venue
870
-		if ( empty( $data['venue_title'] ) )
870
+		if (empty($data['venue_title']))
871 871
 			return;
872 872
 
873 873
 		$venue_array = array(
874 874
 				'VNU_wp_user' => $evtobj->get('EVT_wp_user'),
875
-				'VNU_name' => !empty( $data['venue_title'] ) ? $data['venue_title'] : NULL,
876
-				'VNU_desc' => !empty( $data['venue_description'] ) ? $data['venue_description'] : NULL,
877
-				'VNU_identifier' => !empty( $data['venue_identifier'] ) ? $data['venue_identifier'] : NULL,
878
-				'VNU_short_desc' => !empty( $data['venue_short_description'] ) ? $data['venue_short_description'] : NULL,
879
-				'VNU_address' => !empty( $data['address'] ) ? $data['address'] : NULL,
880
-				'VNU_address2' => !empty( $data['address2'] ) ? $data['address2'] : NULL,
881
-				'VNU_city' => !empty( $data['city'] ) ? $data['city'] : NULL,
882
-				'STA_ID' => !empty( $data['state'] ) ? $data['state'] : NULL,
883
-				'CNT_ISO' => !empty( $data['countries'] ) ? $data['countries'] : NULL,
884
-				'VNU_zip' => !empty( $data['zip'] ) ? $data['zip'] : NULL,
885
-				'VNU_phone' => !empty( $data['venue_phone'] ) ? $data['venue_phone'] : NULL,
886
-				'VNU_capacity' => !empty( $data['venue_capacity'] ) ? $data['venue_capacity'] : NULL,
887
-				'VNU_url' => !empty($data['venue_url'] ) ? $data['venue_url'] : NULL,
888
-				'VNU_virtual_phone' => !empty($data['virtual_phone']) ? $data['virtual_phone'] : NULL,
889
-				'VNU_virtual_url' => !empty( $data['virtual_url'] ) ? $data['virtual_url'] : NULL,
890
-				'VNU_enable_for_gmap' => isset( $data['enable_for_gmap'] ) ? 1 : 0,
875
+				'VNU_name' => ! empty($data['venue_title']) ? $data['venue_title'] : NULL,
876
+				'VNU_desc' => ! empty($data['venue_description']) ? $data['venue_description'] : NULL,
877
+				'VNU_identifier' => ! empty($data['venue_identifier']) ? $data['venue_identifier'] : NULL,
878
+				'VNU_short_desc' => ! empty($data['venue_short_description']) ? $data['venue_short_description'] : NULL,
879
+				'VNU_address' => ! empty($data['address']) ? $data['address'] : NULL,
880
+				'VNU_address2' => ! empty($data['address2']) ? $data['address2'] : NULL,
881
+				'VNU_city' => ! empty($data['city']) ? $data['city'] : NULL,
882
+				'STA_ID' => ! empty($data['state']) ? $data['state'] : NULL,
883
+				'CNT_ISO' => ! empty($data['countries']) ? $data['countries'] : NULL,
884
+				'VNU_zip' => ! empty($data['zip']) ? $data['zip'] : NULL,
885
+				'VNU_phone' => ! empty($data['venue_phone']) ? $data['venue_phone'] : NULL,
886
+				'VNU_capacity' => ! empty($data['venue_capacity']) ? $data['venue_capacity'] : NULL,
887
+				'VNU_url' => ! empty($data['venue_url']) ? $data['venue_url'] : NULL,
888
+				'VNU_virtual_phone' => ! empty($data['virtual_phone']) ? $data['virtual_phone'] : NULL,
889
+				'VNU_virtual_url' => ! empty($data['virtual_url']) ? $data['virtual_url'] : NULL,
890
+				'VNU_enable_for_gmap' => isset($data['enable_for_gmap']) ? 1 : 0,
891 891
 				'status' => 'publish'
892 892
 			);
893 893
 
894 894
 
895 895
 		//if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
896
-		if ( !empty( $venue_id ) ) {
897
-			$update_where = array( $venue_model->primary_key_name() => $venue_id );
898
-			$rows_affected = $venue_model->update( $venue_array, array( $update_where ) );
896
+		if ( ! empty($venue_id)) {
897
+			$update_where = array($venue_model->primary_key_name() => $venue_id);
898
+			$rows_affected = $venue_model->update($venue_array, array($update_where));
899 899
 			//we've gotta make sure that the venue is always attached to a revision.. add_relation_to should take care of making sure that the relation is already present.
900
-			$evtobj->_add_relation_to( $venue_id, 'Venue' );
900
+			$evtobj->_add_relation_to($venue_id, 'Venue');
901 901
 			return $rows_affected > 0 ? TRUE : FALSE;
902 902
 		} else {
903 903
 			//we insert the venue
904
-			$venue_id = $venue_model->insert( $venue_array );
905
-			$evtobj->_add_relation_to( $venue_id, 'Venue' );
906
-			return !empty( $venue_id ) ? TRUE : FALSE;
904
+			$venue_id = $venue_model->insert($venue_array);
905
+			$evtobj->_add_relation_to($venue_id, 'Venue');
906
+			return ! empty($venue_id) ? TRUE : FALSE;
907 907
 		}
908 908
 		return TRUE; //when we have the ancestor come in it's already been handled by the revision save.
909 909
 	}
@@ -917,41 +917,41 @@  discard block
 block discarded – undo
917 917
 	 * @param  array    $data   The request data from the form
918 918
 	 * @return bool             success or fail
919 919
 	 */
920
-	protected function _default_tickets_update( $evtobj, $data ) {
920
+	protected function _default_tickets_update($evtobj, $data) {
921 921
 		$success = TRUE;
922
-		foreach ( $data['edit_event_datetimes'] as $row => $dtt ) {
923
-			$dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty( $dtt['DTT_EVT_end'] ) ? $dtt['DTT_EVT_end'] : $dtt['DTT_EVT_start'];
922
+		foreach ($data['edit_event_datetimes'] as $row => $dtt) {
923
+			$dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty($dtt['DTT_EVT_end']) ? $dtt['DTT_EVT_end'] : $dtt['DTT_EVT_start'];
924 924
 			$datetime_values = array(
925
-				'DTT_ID' => !empty( $dtt['DTT_ID'] ) ? $dtt['DTT_ID'] : NULL,
925
+				'DTT_ID' => ! empty($dtt['DTT_ID']) ? $dtt['DTT_ID'] : NULL,
926 926
 				'DTT_EVT_start' => $dtt['DTT_EVT_start'],
927 927
 				'DTT_EVT_end' => $dtt['DTT_EVT_end'],
928
-				'DTT_reg_limit' => empty( $dtt['DTT_reg_limit'] ) ? INF : $dtt['DTT_reg_limit'],
928
+				'DTT_reg_limit' => empty($dtt['DTT_reg_limit']) ? INF : $dtt['DTT_reg_limit'],
929 929
 				'DTT_order' => $row,
930 930
 				);
931 931
 
932 932
 			//if we have an id then let's get existing object first and then set the new values.  Otherwise we instantiate a new object for save.
933 933
 
934
-			if ( !empty( $dtt['DTT_ID'] ) ) {
935
-				$DTM = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($dtt['DTT_ID'] );
936
-				foreach ( $datetime_values as $field => $value ) {
937
-					$DTM->set( $field, $value );
934
+			if ( ! empty($dtt['DTT_ID'])) {
935
+				$DTM = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($dtt['DTT_ID']);
936
+				foreach ($datetime_values as $field => $value) {
937
+					$DTM->set($field, $value);
938 938
 				}
939 939
 
940 940
 				$DTM->save();
941 941
 				//make sure the $dtt_id here is saved just in case after the add_relation_to() the autosave replaces it.  We need to do this so we dont' TRASH the parent DTT.
942 942
 				$saved_dtts[$DTM->ID()] = $DTM;
943 943
 			} else {
944
-				$DTM = EE_Registry::instance()->load_class('Datetime', array( $datetime_values ), FALSE, FALSE );
944
+				$DTM = EE_Registry::instance()->load_class('Datetime', array($datetime_values), FALSE, FALSE);
945 945
 			}
946 946
 
947
-			$DTT = $evtobj->_add_relation_to( $DTM, 'Datetime' );
947
+			$DTT = $evtobj->_add_relation_to($DTM, 'Datetime');
948 948
 
949 949
 			//load DTT helper
950 950
 			EE_Registry::instance()->load_helper('DTT_Helper');
951 951
 
952 952
 			//before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
953
-			if( $DTT->get_raw('DTT_EVT_start') > $DTT->get_raw('DTT_EVT_end') ) {
954
-				$DTT->set('DTT_EVT_end', $DTT->get('DTT_EVT_start') );
953
+			if ($DTT->get_raw('DTT_EVT_start') > $DTT->get_raw('DTT_EVT_end')) {
954
+				$DTT->set('DTT_EVT_end', $DTT->get('DTT_EVT_start'));
955 955
 				$DTT = EEH_DTT_Helper::date_time_add($DTT, 'DTT_EVT_end', 'days');
956 956
 				$DTT->save();
957 957
 			}
@@ -959,29 +959,29 @@  discard block
 block discarded – undo
959 959
 			//now we got to make sure we add the new DTT_ID to the $saved_dtts array  because it is possible there was a new one created for the autosave.
960 960
 			$saved_dtt = $DTT;
961 961
 
962
-			$success = !$success ? $success : $DTT; //if ANY of these updates fail then we want the appropriate global error message. //todod this is actually sucky we need a better error message but this is what it is for now.
962
+			$success = ! $success ? $success : $DTT; //if ANY of these updates fail then we want the appropriate global error message. //todod this is actually sucky we need a better error message but this is what it is for now.
963 963
 		}
964 964
 
965 965
 		//no dtts get deleted so we don't do any of that logic here.
966 966
 		//update tickets next
967
-		$old_tickets = isset( $data['ticket_IDs'] ) ? explode(',', $data['ticket_IDs'] ) : array();
968
-		foreach ( $data['edit_tickets'] as $row => $tkt ) {
967
+		$old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : array();
968
+		foreach ($data['edit_tickets'] as $row => $tkt) {
969 969
 			$update_prices = false;
970
-			$ticket_price = isset( $data['edit_prices'][$row][1]['PRC_amount'] ) ? $data['edit_prices'][$row][1]['PRC_amount'] : 0;
970
+			$ticket_price = isset($data['edit_prices'][$row][1]['PRC_amount']) ? $data['edit_prices'][$row][1]['PRC_amount'] : 0;
971 971
 
972 972
 			$TKT_values = array(
973
-				'TKT_ID' => !empty( $tkt['TKT_ID'] ) ? $tkt['TKT_ID'] : NULL,
974
-				'TTM_ID' => !empty( $tkt['TTM_ID'] ) ? $tkt['TTM_ID'] : 0,
975
-				'TKT_name' => !empty( $tkt['TKT_name'] ) ? $tkt['TKT_name'] : '',
976
-				'TKT_description' => !empty( $tkt['TKT_description'] ) ? $tkt['TKT_description'] : '',
977
-				'TKT_start_date' => isset( $tkt['TKT_start_date'] ) ? $tkt['TKT_start_date'] : current_time('mysql'),
978
-				'TKT_end_date' => isset( $tkt['TKT_end_date'] ) ? $tkt['TKT_end_date'] : current_time('mysql'),
979
-				'TKT_qty' => empty( $tkt['TKT_qty'] ) ? INF : $tkt['TKT_qty'],
980
-				'TKT_uses' => empty( $tkt['TKT_uses'] ) ? INF : $tkt['TKT_uses'],
981
-				'TKT_min' => empty( $tkt['TKT_min'] ) ? 0 : $tkt['TKT_min'],
982
-				'TKT_max' => empty( $tkt['TKT_max'] ) ? INF : $tkt['TKT_max'],
973
+				'TKT_ID' => ! empty($tkt['TKT_ID']) ? $tkt['TKT_ID'] : NULL,
974
+				'TTM_ID' => ! empty($tkt['TTM_ID']) ? $tkt['TTM_ID'] : 0,
975
+				'TKT_name' => ! empty($tkt['TKT_name']) ? $tkt['TKT_name'] : '',
976
+				'TKT_description' => ! empty($tkt['TKT_description']) ? $tkt['TKT_description'] : '',
977
+				'TKT_start_date' => isset($tkt['TKT_start_date']) ? $tkt['TKT_start_date'] : current_time('mysql'),
978
+				'TKT_end_date' => isset($tkt['TKT_end_date']) ? $tkt['TKT_end_date'] : current_time('mysql'),
979
+				'TKT_qty' => empty($tkt['TKT_qty']) ? INF : $tkt['TKT_qty'],
980
+				'TKT_uses' => empty($tkt['TKT_uses']) ? INF : $tkt['TKT_uses'],
981
+				'TKT_min' => empty($tkt['TKT_min']) ? 0 : $tkt['TKT_min'],
982
+				'TKT_max' => empty($tkt['TKT_max']) ? INF : $tkt['TKT_max'],
983 983
 				'TKT_row' => $row,
984
-				'TKT_order' => isset( $tkt['TKT_order'] ) ? $tkt['TKT_order'] : $row,
984
+				'TKT_order' => isset($tkt['TKT_order']) ? $tkt['TKT_order'] : $row,
985 985
 				'TKT_price' => $ticket_price
986 986
 				);
987 987
 
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
 
990 990
 
991 991
 			//if this is a default TKT, then we need to set the TKT_ID to 0 and update accordingly, which means in turn that the prices will become new prices as well.
992
-			if ( isset( $tkt['TKT_is_default'] ) && $tkt['TKT_is_default'] ) {
992
+			if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
993 993
 				$TKT_values['TKT_ID'] = 0;
994 994
 				$TKT_values['TKT_is_default'] = 0;
995 995
 				$TKT_values['TKT_price'] = $ticket_price;
@@ -1000,22 +1000,22 @@  discard block
 block discarded – undo
1000 1000
 			//we actually do our saves a head of doing any add_relations to because its entirely possible that this ticket didn't removed or added to any datetime in the session but DID have it's items modified.
1001 1001
 			//keep in mind that if the TKT has been sold (and we have changed pricing information), then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
1002 1002
 
1003
-			if ( !empty( $tkt['TKT_ID'] ) ) {
1004
-				$TKT = EE_Registry::instance()->load_model( 'Ticket')->get_one_by_ID( $tkt['TKT_ID'] );
1003
+			if ( ! empty($tkt['TKT_ID'])) {
1004
+				$TKT = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($tkt['TKT_ID']);
1005 1005
 
1006 1006
 
1007
-				$ticket_sold = $TKT->count_related('Registration', array( array( 'STS_ID' => array( 'NOT IN', array( EEM_Registration::status_id_incomplete ) ) ) ) ) > 0 ? true : false;
1007
+				$ticket_sold = $TKT->count_related('Registration', array(array('STS_ID' => array('NOT IN', array(EEM_Registration::status_id_incomplete))))) > 0 ? true : false;
1008 1008
 
1009 1009
 				//let's just check the total price for the existing ticket and determine if it matches the new total price.  if they are different then we create a new ticket (if tkts sold) if they aren't different then we go ahead and modify existing ticket.
1010
-				$create_new_TKT = $ticket_sold && $ticket_price != $TKT->get('TKT_price') && !$TKT->get('TKT_deleted') ? TRUE : FALSE;
1010
+				$create_new_TKT = $ticket_sold && $ticket_price != $TKT->get('TKT_price') && ! $TKT->get('TKT_deleted') ? TRUE : FALSE;
1011 1011
 
1012 1012
 				//set new values
1013
-				foreach ( $TKT_values as $field => $value ) {
1014
-					$TKT->set( $field, $value );
1013
+				foreach ($TKT_values as $field => $value) {
1014
+					$TKT->set($field, $value);
1015 1015
 				}
1016 1016
 
1017 1017
 				//if $create_new_TKT is false then we can safely update the existing ticket.  Otherwise we have to create a new ticket.
1018
-				if ( $create_new_TKT ) {
1018
+				if ($create_new_TKT) {
1019 1019
 					//archive the old ticket first
1020 1020
 					$TKT->set('TKT_deleted', 1);
1021 1021
 					$TKT->save();
@@ -1026,22 +1026,22 @@  discard block
 block discarded – undo
1026 1026
 
1027 1027
 					//create new ticket that's a copy of the existing except a new id of course (and not archived) AND has the new TKT_price associated with it.
1028 1028
 					$TKT = clone $TKT;
1029
-					$TKT->set( 'TKT_ID', 0 );
1030
-					$TKT->set( 'TKT_deleted', 0 );
1031
-					$TKT->set( 'TKT_price', $ticket_price );
1032
-					$TKT->set( 'TKT_sold', 0 );
1029
+					$TKT->set('TKT_ID', 0);
1030
+					$TKT->set('TKT_deleted', 0);
1031
+					$TKT->set('TKT_price', $ticket_price);
1032
+					$TKT->set('TKT_sold', 0);
1033 1033
 
1034 1034
 					//now we need to make sure that $new prices are created as well and attached to new ticket.
1035 1035
 					$update_prices = TRUE;
1036 1036
 				}
1037 1037
 
1038 1038
 				//make sure price is set if it hasn't been already
1039
-				$TKT->set( 'TKT_price', $ticket_price );
1039
+				$TKT->set('TKT_price', $ticket_price);
1040 1040
 
1041 1041
 			} else {
1042 1042
 				//no TKT_id so a new TKT
1043 1043
 				$TKT_values['TKT_price'] = $ticket_price;
1044
-				$TKT = EE_Registry::instance()->load_class('Ticket', array( $TKT_values ), FALSE, FALSE );
1044
+				$TKT = EE_Registry::instance()->load_class('Ticket', array($TKT_values), FALSE, FALSE);
1045 1045
 				$update_prices = TRUE;
1046 1046
 			}
1047 1047
 
@@ -1049,27 +1049,27 @@  discard block
 block discarded – undo
1049 1049
 			$TKT->save();
1050 1050
 
1051 1051
 			//before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1052
-			if( $TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date') ) {
1053
-				$TKT->set('TKT_end_date', $TKT->get('TKT_start_date') );
1052
+			if ($TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date')) {
1053
+				$TKT->set('TKT_end_date', $TKT->get('TKT_start_date'));
1054 1054
 				EE_Registry::instance()->load_helper('DTT_Helper');
1055 1055
 				$TKT = EEH_DTT_Helper::date_time_add($TKT, 'TKT_end_date', 'days');
1056 1056
 				$TKT->save();
1057 1057
 			}
1058 1058
 
1059 1059
 			//initially let's add the ticket to the dtt
1060
-			$saved_dtt->_add_relation_to( $TKT, 'Ticket' );
1060
+			$saved_dtt->_add_relation_to($TKT, 'Ticket');
1061 1061
 
1062 1062
 			$saved_tickets[$TKT->ID()] = $TKT;
1063 1063
 
1064 1064
 			//add prices to ticket
1065
-			$this->_add_prices_to_ticket( $data['edit_prices'][$row], $TKT, $update_prices );
1065
+			$this->_add_prices_to_ticket($data['edit_prices'][$row], $TKT, $update_prices);
1066 1066
 		}
1067 1067
 		//however now we need to handle permanantly deleting tickets via the ui.  Keep in mind that the ui does not allow deleting/archiving tickets that have ticket sold.  However, it does allow for deleting tickets that have no tickets sold, in which case we want to get rid of permanantely because there is no need to save in db.
1068
-		$old_tickets = isset( $old_tickets[0] ) && $old_tickets[0] == '' ? array() : $old_tickets;
1069
-		$tickets_removed = array_diff( $old_tickets, array_keys( $saved_tickets ) );
1068
+		$old_tickets = isset($old_tickets[0]) && $old_tickets[0] == '' ? array() : $old_tickets;
1069
+		$tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
1070 1070
 
1071
-		foreach ( $tickets_removed as $id ) {
1072
-			$id = absint( $id );
1071
+		foreach ($tickets_removed as $id) {
1072
+			$id = absint($id);
1073 1073
 
1074 1074
 			//get the ticket for this id
1075 1075
 			$tkt_to_remove = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($id);
@@ -1077,7 +1077,7 @@  discard block
 block discarded – undo
1077 1077
 			//need to get all the related datetimes on this ticket and remove from every single one of them (remember this process can ONLY kick off if there are NO tkts_sold)
1078 1078
 			$dtts = $tkt_to_remove->get_many_related('Datetime');
1079 1079
 
1080
-			foreach( $dtts as $dtt ) {
1080
+			foreach ($dtts as $dtt) {
1081 1081
 				$tkt_to_remove->_remove_relation_to($dtt, 'Datetime');
1082 1082
 			}
1083 1083
 
@@ -1102,31 +1102,31 @@  discard block
 block discarded – undo
1102 1102
 	 * @param bool 		$new_prices Whether attach existing incoming prices or create new ones.
1103 1103
 	 * @return  void
1104 1104
 	 */
1105
-	private function  _add_prices_to_ticket( $prices, EE_Ticket $ticket, $new_prices = FALSE ) {
1106
-		foreach ( $prices as $row => $prc ) {
1105
+	private function  _add_prices_to_ticket($prices, EE_Ticket $ticket, $new_prices = FALSE) {
1106
+		foreach ($prices as $row => $prc) {
1107 1107
 			$PRC_values = array(
1108
-				'PRC_ID' => !empty( $prc['PRC_ID'] ) ? $prc['PRC_ID'] : NULL,
1109
-				'PRT_ID' => !empty( $prc['PRT_ID'] ) ? $prc['PRT_ID'] : NULL,
1110
-				'PRC_amount' => !empty( $prc['PRC_amount'] ) ? $prc['PRC_amount'] : 0,
1111
-				'PRC_name' => !empty( $prc['PRC_name'] ) ? $prc['PRC_name'] : '',
1112
-				'PRC_desc' => !empty( $prc['PRC_desc'] ) ? $prc['PRC_desc'] : '',
1108
+				'PRC_ID' => ! empty($prc['PRC_ID']) ? $prc['PRC_ID'] : NULL,
1109
+				'PRT_ID' => ! empty($prc['PRT_ID']) ? $prc['PRT_ID'] : NULL,
1110
+				'PRC_amount' => ! empty($prc['PRC_amount']) ? $prc['PRC_amount'] : 0,
1111
+				'PRC_name' => ! empty($prc['PRC_name']) ? $prc['PRC_name'] : '',
1112
+				'PRC_desc' => ! empty($prc['PRC_desc']) ? $prc['PRC_desc'] : '',
1113 1113
 				'PRC_is_default' => 0, //make sure prices are NOT set as default from this context
1114 1114
 				'PRC_order' => $row
1115 1115
 				);
1116 1116
 
1117
-			if ( $new_prices || empty( $PRC_values['PRC_ID'] ) ) {
1117
+			if ($new_prices || empty($PRC_values['PRC_ID'])) {
1118 1118
 				$PRC_values['PRC_ID'] = 0;
1119
-				$PRC = EE_Registry::instance()->load_class('Price', array( $PRC_values ), FALSE, FALSE);
1119
+				$PRC = EE_Registry::instance()->load_class('Price', array($PRC_values), FALSE, FALSE);
1120 1120
 			} else {
1121
-				$PRC = EE_Registry::instance()->load_model( 'Price' )->get_one_by_ID( $prc['PRC_ID'] );
1121
+				$PRC = EE_Registry::instance()->load_model('Price')->get_one_by_ID($prc['PRC_ID']);
1122 1122
 				//update this price with new values
1123
-				foreach ( $PRC_values as $field => $newprc ) {
1124
-					$PRC->set( $field, $newprc );
1123
+				foreach ($PRC_values as $field => $newprc) {
1124
+					$PRC->set($field, $newprc);
1125 1125
 				}
1126 1126
 				$PRC->save();
1127 1127
 			}
1128 1128
 
1129
-			$PRC = $ticket->_add_relation_to( $PRC, 'Price' );
1129
+			$PRC = $ticket->_add_relation_to($PRC, 'Price');
1130 1130
 		}
1131 1131
 	}
1132 1132
 
@@ -1149,33 +1149,33 @@  discard block
 block discarded – undo
1149 1149
 
1150 1150
 		return; //TEMPORARILY EXITING CAUSE THIS IS A TODO
1151 1151
 
1152
-		$postid = isset( $this->_req_data['post_ID'] ) ? $this->_req_data['post_ID'] : NULL;
1152
+		$postid = isset($this->_req_data['post_ID']) ? $this->_req_data['post_ID'] : NULL;
1153 1153
 
1154 1154
 
1155 1155
 		//if no postid then get out cause we need it for stuff in here
1156
-		if ( empty( $postid ) ) return;
1156
+		if (empty($postid)) return;
1157 1157
 
1158 1158
 
1159 1159
 		//handle datetime saves
1160 1160
 		$items = array();
1161 1161
 
1162
-		$get_one_where = array( $this->_event_model()->primary_key_name() => $postid );
1163
-		$event = $this->_event_model()->get_one( array($get_one_where) );
1162
+		$get_one_where = array($this->_event_model()->primary_key_name() => $postid);
1163
+		$event = $this->_event_model()->get_one(array($get_one_where));
1164 1164
 
1165 1165
 		//now let's get the attached datetimes from the most recent autosave
1166 1166
 		$dtts = $event->get_many_related('Datetime');
1167 1167
 
1168 1168
 		$dtt_ids = array();
1169
-		foreach( $dtts as $dtt ) {
1169
+		foreach ($dtts as $dtt) {
1170 1170
 			$dtt_ids[] = $dtt->ID();
1171 1171
 			$order = $dtt->order();
1172 1172
 			$this->_template_args['data']['items']['ID-'.$order] = $dtt->ID();
1173 1173
 		}
1174
-		$this->_template_args['data']['items']['datetime_IDS'] = serialize( $dtt_ids );
1174
+		$this->_template_args['data']['items']['datetime_IDS'] = serialize($dtt_ids);
1175 1175
 
1176 1176
 		//handle DECAF venues
1177 1177
 		//we need to make sure that the venue_id gets updated in the form so that future autosaves will properly conntect that venue to the event.
1178
-		if ( $do_venue_autosaves = apply_filters( 'FHEE__Events_Admin_Page__ee_autosave_edit_do_decaf_venue_save', TRUE ) ) {
1178
+		if ($do_venue_autosaves = apply_filters('FHEE__Events_Admin_Page__ee_autosave_edit_do_decaf_venue_save', TRUE)) {
1179 1179
 			$venue = $event->get_first_related('Venue');
1180 1180
 			$this->_template_args['data']['items']['venue-id'] = $venue->ID();
1181 1181
 		}
@@ -1186,23 +1186,23 @@  discard block
 block discarded – undo
1186 1186
 
1187 1187
 		$ticket_ids = array();
1188 1188
 		$price_ids = array();
1189
-		foreach ( $tickets as $ticket ) {
1189
+		foreach ($tickets as $ticket) {
1190 1190
 			$ticket_ids[] = $price->ID();
1191 1191
 			$ticket_order = $price->get('TKT_order');
1192
-			$this->_template_args['data']['items']['edit-ticket-id-' . $ticket_order] = $ticket->ID();
1193
-			$this->_template_args['data']['items']['edit-ticket-event-id-' . $order] = $event->ID();
1192
+			$this->_template_args['data']['items']['edit-ticket-id-'.$ticket_order] = $ticket->ID();
1193
+			$this->_template_args['data']['items']['edit-ticket-event-id-'.$order] = $event->ID();
1194 1194
 
1195 1195
 			//now we have to make sure the prices are updated appropriately
1196 1196
 			$prices = $ticket->get_many_related('Prices');
1197 1197
 
1198
-			foreach ( $prices as $price ) {
1198
+			foreach ($prices as $price) {
1199 1199
 				$price_ids[] = $price->ID();
1200 1200
 				$price_order = $price->get('PRC_order');
1201
-				$this->_template_args['data']['items']['quick-edit-ticket-price-id-ticketrow-' . $ticket_order . '-' . $price_order] = $price->ID();
1202
-				$this->_template_args['data']['items']['edit-ticket-price-id-ticketrow-' . $ticket_row . '-' . $price_row] = $price->ID();
1203
-				$this->_template_args['data']['items']['edit-ticket-price-is-default-ticketrow-' . $ticket_row . '-' . $price_row] = $price->get('PRC_is_default');
1201
+				$this->_template_args['data']['items']['quick-edit-ticket-price-id-ticketrow-'.$ticket_order.'-'.$price_order] = $price->ID();
1202
+				$this->_template_args['data']['items']['edit-ticket-price-id-ticketrow-'.$ticket_row.'-'.$price_row] = $price->ID();
1203
+				$this->_template_args['data']['items']['edit-ticket-price-is-default-ticketrow-'.$ticket_row.'-'.$price_row] = $price->get('PRC_is_default');
1204 1204
 			}
1205
-			$this->_template_args['data']['items']['price-IDs-ticketrow-' . $ticket_row] = implode(',', $price_ids);
1205
+			$this->_template_args['data']['items']['price-IDs-ticketrow-'.$ticket_row] = implode(',', $price_ids);
1206 1206
 		}
1207 1207
 		$this->_template_args['data']['items']['ticket-IDs'] = implode(',', $ticket_ids);
1208 1208
 	}
@@ -1220,26 +1220,26 @@  discard block
 block discarded – undo
1220 1220
 	private function _generate_publish_box_extra_content() {
1221 1221
 
1222 1222
 		//load formatter helper
1223
-  		EE_Registry::instance()->load_helper( 'Formatter' );
1223
+  		EE_Registry::instance()->load_helper('Formatter');
1224 1224
 
1225 1225
   		//args for getting related registrations
1226
-  		$approved_query_args = array( array( 'REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_approved ) );
1227
-  		$not_approved_query_args = array( array( 'REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_not_approved ) );
1228
-  		$pending_payment_query_args = array( array( 'REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_pending_payment ) );
1226
+  		$approved_query_args = array(array('REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_approved));
1227
+  		$not_approved_query_args = array(array('REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_not_approved));
1228
+  		$pending_payment_query_args = array(array('REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_pending_payment));
1229 1229
 
1230 1230
 
1231 1231
 		// publish box
1232
-		$publish_box_extra_args['view_approved_reg_url'] = add_query_arg(array('action' => 'default', 'event_id' => $this->_cpt_model_obj->ID(), '_reg_status' => EEM_Registration::status_id_approved ), REG_ADMIN_URL);
1233
-		$publish_box_extra_args['view_not_approved_reg_url'] = add_query_arg(array('action' => 'default', 'event_id' => $this->_cpt_model_obj->ID(), '_reg_status' => EEM_Registration::status_id_not_approved ), REG_ADMIN_URL);
1234
-		$publish_box_extra_args['view_pending_payment_reg_url'] = add_query_arg(array('action' => 'default', 'event_id' => $this->_cpt_model_obj->ID(), '_reg_status' => EEM_Registration::status_id_pending_payment ), REG_ADMIN_URL);
1232
+		$publish_box_extra_args['view_approved_reg_url'] = add_query_arg(array('action' => 'default', 'event_id' => $this->_cpt_model_obj->ID(), '_reg_status' => EEM_Registration::status_id_approved), REG_ADMIN_URL);
1233
+		$publish_box_extra_args['view_not_approved_reg_url'] = add_query_arg(array('action' => 'default', 'event_id' => $this->_cpt_model_obj->ID(), '_reg_status' => EEM_Registration::status_id_not_approved), REG_ADMIN_URL);
1234
+		$publish_box_extra_args['view_pending_payment_reg_url'] = add_query_arg(array('action' => 'default', 'event_id' => $this->_cpt_model_obj->ID(), '_reg_status' => EEM_Registration::status_id_pending_payment), REG_ADMIN_URL);
1235 1235
 		$publish_box_extra_args['approved_regs'] = $this->_cpt_model_obj->count_related('Registration', $approved_query_args);
1236 1236
 		$publish_box_extra_args['not_approved_regs'] = $this->_cpt_model_obj->count_related('Registration', $not_approved_query_args);
1237 1237
 		$publish_box_extra_args['pending_payment_regs'] = $this->_cpt_model_obj->count_related('Registration', $pending_payment_query_args);
1238
-		$publish_box_extra_args['misc_pub_section_class'] = apply_filters( 'FHEE_Events_Admin_Page___generate_publish_box_extra_content__misc_pub_section_class', 'misc-pub-section');
1238
+		$publish_box_extra_args['misc_pub_section_class'] = apply_filters('FHEE_Events_Admin_Page___generate_publish_box_extra_content__misc_pub_section_class', 'misc-pub-section');
1239 1239
 		//$publish_box_extra_args['email_attendees_url'] = add_query_arg(array('event_admin_reports' => 'event_newsletter', 'event_id' => $this->_cpt_model_obj->id), 'admin.php?page=espresso_registrations');
1240
-		$publish_box_extra_args['event_editor_overview_add'] = do_action( 'AHEE__Events_Admin_Page___generate_publish_box_extra_content__event_editor_overview_add', $this->_cpt_model_obj );
1240
+		$publish_box_extra_args['event_editor_overview_add'] = do_action('AHEE__Events_Admin_Page___generate_publish_box_extra_content__event_editor_overview_add', $this->_cpt_model_obj);
1241 1241
 		// load template
1242
-		EEH_Template::display_template( EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php', $publish_box_extra_args );
1242
+		EEH_Template::display_template(EVENTS_TEMPLATE_PATH.'event_publish_box_extras.template.php', $publish_box_extra_args);
1243 1243
 	}
1244 1244
 
1245 1245
 
@@ -1271,7 +1271,7 @@  discard block
 block discarded – undo
1271 1271
 		$this->verify_cpt_object();
1272 1272
 		add_meta_box('espresso_event_editor_tickets', __('Event Datetime & Ticket', 'event_espresso'), array($this, 'ticket_metabox'), $this->page_slug, 'normal', 'high');
1273 1273
 		add_meta_box('espresso_event_editor_event_options', __('Event Registration Options', 'event_espresso'), array($this, 'registration_options_meta_box'), $this->page_slug, 'side', 'default');
1274
-		add_meta_box('espresso_event_editor_venue', __('Venue Details', 'event_espresso'), array( $this, 'venue_metabox' ), $this->page_slug, 'normal', 'core');
1274
+		add_meta_box('espresso_event_editor_venue', __('Venue Details', 'event_espresso'), array($this, 'venue_metabox'), $this->page_slug, 'normal', 'core');
1275 1275
 		//note if you're looking for other metaboxes in here, where a metabox has a related management page in the admin you will find it setup in the related management page's "_Hooks" file.  i.e. messages metabox is found in "espresso_events_Messages_Hooks.class.php".
1276 1276
 	}
1277 1277
 
@@ -1296,53 +1296,53 @@  discard block
 block discarded – undo
1296 1296
 			'disabled' => ''
1297 1297
 			);
1298 1298
 
1299
-		$event_id = is_object( $this->_cpt_model_obj ) ? $this->_cpt_model_obj->ID() : NULL;
1299
+		$event_id = is_object($this->_cpt_model_obj) ? $this->_cpt_model_obj->ID() : NULL;
1300 1300
 
1301
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1301
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1302 1302
 
1303 1303
 		/**
1304 1304
 		 * 1. Start with retrieving Datetimes
1305 1305
 		 * 2. Fore each datetime get related tickets
1306 1306
 		 * 3. For each ticket get related prices
1307 1307
 		 */
1308
-		$times = EE_Registry::instance()->load_model('Datetime' )->get_all_event_dates( $event_id );
1309
-		EE_Registry::instance()->load_helper('DTT_Helper' );
1308
+		$times = EE_Registry::instance()->load_model('Datetime')->get_all_event_dates($event_id);
1309
+		EE_Registry::instance()->load_helper('DTT_Helper');
1310 1310
 
1311 1311
 		$firstdtt = array_slice($times, 0, 1);
1312 1312
 		//do we get related tickets?
1313
-		if ( $firstdtt[0]->get('DTT_ID') !== 0 ) {
1314
-			foreach ( $times as $time ) {
1313
+		if ($firstdtt[0]->get('DTT_ID') !== 0) {
1314
+			foreach ($times as $time) {
1315 1315
 				$existing_datetime_ids[] = $time->get('DTT_ID');
1316 1316
 				$template_args['time'] = $time;
1317
-				$related_tickets = $time->get_many_related('Ticket', array( array( 'OR' => array( 'TKT_deleted' => 1, 'TKT_deleted*' => 0 ) ), 'default_where_conditions' => 'none' ) );
1317
+				$related_tickets = $time->get_many_related('Ticket', array(array('OR' => array('TKT_deleted' => 1, 'TKT_deleted*' => 0)), 'default_where_conditions' => 'none'));
1318 1318
 
1319
-				if ( !empty($related_tickets) ) {
1319
+				if ( ! empty($related_tickets)) {
1320 1320
 					$template_args['total_ticket_rows'] = count($related_tickets);
1321 1321
 					$row = 0;
1322
-					foreach ( $related_tickets as $ticket ) {
1322
+					foreach ($related_tickets as $ticket) {
1323 1323
 						$existing_ticket_ids[] = $ticket->get('TKT_ID');
1324
-						$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, FALSE, $row );
1324
+						$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, FALSE, $row);
1325 1325
 
1326 1326
 						$row++;
1327 1327
 					}
1328 1328
 				} else {
1329 1329
 					$template_args['total_ticket_rows'] = 1;
1330 1330
 					$ticket = EE_Registry::instance()->load_model('Ticket')->create_default_object();
1331
-					$template_args['ticket_rows'] .= $this->_get_ticket_row( $ticket );
1331
+					$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket);
1332 1332
 				}
1333 1333
 			}
1334 1334
 		} else {
1335 1335
 			$template_args['time'] = $times[0];
1336 1336
 			$ticket = EE_Registry::instance()->load_model('Ticket')->get_all_default_tickets();
1337
-			$template_args['ticket_rows'] .= $this->_get_ticket_row( $ticket[1] ); //note we're just sending the first default row (decaf can't manage default tickets so this should be sufficent);
1337
+			$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket[1]); //note we're just sending the first default row (decaf can't manage default tickets so this should be sufficent);
1338 1338
 		}
1339 1339
 
1340 1340
 		$template_args['event_datetime_help_link'] = $this->_get_help_tab_link('event_editor_event_datetimes_help_tab');
1341 1341
 		$template_args['ticket_options_help_link'] = $this->_get_help_tab_link('ticket_options_info');
1342 1342
 		$template_args['existing_datetime_ids'] = implode(',', $existing_datetime_ids);
1343 1343
 		$template_args['existing_ticket_ids'] = implode(',', $existing_ticket_ids);
1344
-		$template_args['ticket_js_structure'] = $this->_get_ticket_row( EE_Registry::instance()->load_model('Ticket')->create_default_object(), TRUE );
1345
-		$template = apply_filters( 'FHEE__Events_Admin_Page__ticket_metabox__template', EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php' );
1344
+		$template_args['ticket_js_structure'] = $this->_get_ticket_row(EE_Registry::instance()->load_model('Ticket')->create_default_object(), TRUE);
1345
+		$template = apply_filters('FHEE__Events_Admin_Page__ticket_metabox__template', EVENTS_TEMPLATE_PATH.'event_tickets_metabox_main.template.php');
1346 1346
 		EEH_Template::display_template($template, $template_args);
1347 1347
 	}
1348 1348
 
@@ -1356,21 +1356,21 @@  discard block
 block discarded – undo
1356 1356
 	 * @param  boolean    $skeleton whether we're generating a skeleton for js manipulation
1357 1357
 	 * @return string               generated html for the ticket row.
1358 1358
 	 */
1359
-	private function _get_ticket_row( $ticket, $skeleton = FALSE, $row = 0 ) {
1359
+	private function _get_ticket_row($ticket, $skeleton = FALSE, $row = 0) {
1360 1360
 		$template_args = array(
1361
-			'tkt_status_class' => ' tkt-status-' . $ticket->ticket_status(),
1362
-			'tkt_archive_class' => $ticket->ticket_status() === EE_Ticket::archived && !$skeleton ? ' tkt-archived' : '',
1361
+			'tkt_status_class' => ' tkt-status-'.$ticket->ticket_status(),
1362
+			'tkt_archive_class' => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived' : '',
1363 1363
 			'ticketrow' => $skeleton ? 'TICKETNUM' : $row,
1364 1364
 			'TKT_ID' => $ticket->get('TKT_ID'),
1365 1365
 			'TKT_name' => $ticket->get('TKT_name'),
1366 1366
 			'TKT_start_date' => $skeleton ? '' : $ticket->get_date('TKT_start_date', 'Y-m-d h:i a'),
1367 1367
 			'TKT_end_date' => $skeleton ? '' : $ticket->get_date('TKT_end_date', 'Y-m-d h:i a'),
1368 1368
 			'TKT_is_default' => $ticket->get('TKT_is_default'),
1369
-			'TKT_qty' => $ticket->get_pretty('TKT_qty','input'),
1369
+			'TKT_qty' => $ticket->get_pretty('TKT_qty', 'input'),
1370 1370
 			'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1371 1371
 			'TKT_sold' => $skeleton ? 0 : $ticket->get('TKT_sold'),
1372
-			'trash_icon' => ( $skeleton || ( !empty( $ticket ) && ! $ticket->get('TKT_deleted') ) ) && ( !empty( $ticket ) && $ticket->get('TKT_sold') === 0 ) ? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1373
-			'disabled' => $skeleton || ( !empty( $ticket ) && ! $ticket->get('TKT_deleted' ) ) ? '' : ' disabled=disabled'
1372
+			'trash_icon' => ($skeleton || ( ! empty($ticket) && ! $ticket->get('TKT_deleted'))) && ( ! empty($ticket) && $ticket->get('TKT_sold') === 0) ? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1373
+			'disabled' => $skeleton || ( ! empty($ticket) && ! $ticket->get('TKT_deleted')) ? '' : ' disabled=disabled'
1374 1374
 			);
1375 1375
 
1376 1376
 		$price = $ticket->ID() !== 0 ? $ticket->get_first_related('Price', array('default_where_conditions' => 'none')) : EE_Registry::instance()->load_model('Price')->create_default_object();
@@ -1386,23 +1386,23 @@  discard block
 block discarded – undo
1386 1386
 
1387 1387
 		//make sure we have default start and end dates if skeleton
1388 1388
 		//handle rows that should NOT be empty
1389
-		if ( empty( $template_args['TKT_start_date'] ) ) {
1389
+		if (empty($template_args['TKT_start_date'])) {
1390 1390
 			//if empty then the start date will be now.
1391 1391
 			$template_args['TKT_start_date'] = date('Y-m-d h:i a', current_time('timestamp'));
1392 1392
 		}
1393 1393
 
1394
-		if ( empty( $template_args['TKT_end_date'] ) ) {
1394
+		if (empty($template_args['TKT_end_date'])) {
1395 1395
 			//get the earliest datetime (if present);
1396
-			$earliest_dtt = $this->_cpt_model_obj->ID() > 0 ? $this->_cpt_model_obj->get_first_related('Datetime', array('order_by'=> array('DTT_EVT_start' => 'ASC' ) ) ) : NULL;
1396
+			$earliest_dtt = $this->_cpt_model_obj->ID() > 0 ? $this->_cpt_model_obj->get_first_related('Datetime', array('order_by'=> array('DTT_EVT_start' => 'ASC'))) : NULL;
1397 1397
 
1398
-			if ( !empty( $earliest_dtt ) )
1398
+			if ( ! empty($earliest_dtt))
1399 1399
 				$template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1400 1400
 			else
1401
-				$template_args['TKT_end_date'] = date('Y-m-d h:i a', mktime(0, 0, 0, date("m"), date("d")+7, date("Y") ) );
1401
+				$template_args['TKT_end_date'] = date('Y-m-d h:i a', mktime(0, 0, 0, date("m"), date("d") + 7, date("Y")));
1402 1402
 		}
1403 1403
 
1404
-		$template_args = array_merge( $template_args, $price_args );
1405
-		$template = apply_filters( 'FHEE__Events_Admin_Page__get_ticket_row__template', EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php', $ticket);
1404
+		$template_args = array_merge($template_args, $price_args);
1405
+		$template = apply_filters('FHEE__Events_Admin_Page__get_ticket_row__template', EVENTS_TEMPLATE_PATH.'event_tickets_metabox_ticket_row.template.php', $ticket);
1406 1406
 		return EEH_Template::display_template($template, $template_args, TRUE);
1407 1407
 	}
1408 1408
 
@@ -1415,7 +1415,7 @@  discard block
 block discarded – undo
1415 1415
 			array('id' => false, 'text' => __('No', 'event_espresso'))
1416 1416
 		);
1417 1417
 
1418
-		$default_reg_status_values = EEM_Registration::reg_status_array(array(EEM_Registration::status_id_cancelled, EEM_Registration::status_id_declined, EEM_Registration::status_id_incomplete ), TRUE);
1418
+		$default_reg_status_values = EEM_Registration::reg_status_array(array(EEM_Registration::status_id_cancelled, EEM_Registration::status_id_declined, EEM_Registration::status_id_incomplete), TRUE);
1419 1419
 
1420 1420
 		//$template_args['is_active_select'] = EEH_Form_Fields::select_input('is_active', $yes_no_values, $this->_cpt_model_obj->is_active());
1421 1421
 		$template_args['_event'] = $this->_cpt_model_obj;
@@ -1424,8 +1424,8 @@  discard block
 block discarded – undo
1424 1424
 		$template_args['default_registration_status'] = EEH_Form_Fields::select_input('default_reg_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status());
1425 1425
 		$template_args['display_description'] = EEH_Form_Fields::select_input('display_desc', $yes_no_values, $this->_cpt_model_obj->display_description());
1426 1426
 		$template_args['display_ticket_selector'] = EEH_Form_Fields::select_input('display_ticket_selector', $yes_no_values, $this->_cpt_model_obj->display_ticket_selector(), '', '', false);
1427
-		$template_args['additional_registration_options'] = apply_filters( 'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options', '', $template_args, $yes_no_values, $default_reg_status_values );
1428
-		$templatepath = EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php';
1427
+		$template_args['additional_registration_options'] = apply_filters('FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options', '', $template_args, $yes_no_values, $default_reg_status_values);
1428
+		$templatepath = EVENTS_TEMPLATE_PATH.'event_registration_options.template.php';
1429 1429
 		EEH_Template::display_template($templatepath, $template_args);
1430 1430
 	}
1431 1431
 
@@ -1439,14 +1439,14 @@  discard block
 block discarded – undo
1439 1439
 
1440 1440
 		//first let's see if we have a venue already
1441 1441
 		$event_id = $this->_cpt_model_obj->ID();
1442
-		$venue = !empty( $event_id ) ? $this->_cpt_model_obj->venues() : NULL;
1443
-		$venue = empty( $venue ) ? EE_Registry::instance()->load_model('Venue')->create_default_object() : array_shift( $venue );
1442
+		$venue = ! empty($event_id) ? $this->_cpt_model_obj->venues() : NULL;
1443
+		$venue = empty($venue) ? EE_Registry::instance()->load_model('Venue')->create_default_object() : array_shift($venue);
1444 1444
 		$template_args['_venue'] = $venue;
1445 1445
 
1446 1446
 		$template_args['states_dropdown'] = EEH_Form_Fields::generate_form_input(
1447 1447
 			$QFI = new EE_Question_Form_Input(
1448
-				EE_Question::new_instance( array( 'QST_display_text' => 'State', 'QST_system' => 'state' )),
1449
-				EE_Answer::new_instance( array(  'ANS_value'=> $venue->state_ID() )),
1448
+				EE_Question::new_instance(array('QST_display_text' => 'State', 'QST_system' => 'state')),
1449
+				EE_Answer::new_instance(array('ANS_value'=> $venue->state_ID())),
1450 1450
 				array(
1451 1451
 					'input_name' =>  'state',
1452 1452
 					'input_id' => 'phys-state',
@@ -1458,8 +1458,8 @@  discard block
 block discarded – undo
1458 1458
 		);
1459 1459
 		$template_args['countries_dropdown'] = EEH_Form_Fields::generate_form_input(
1460 1460
 			$QFI = new EE_Question_Form_Input(
1461
-				EE_Question::new_instance( array( 'QST_display_text' => 'Country', 'QST_system' => 'country' )),
1462
-				EE_Answer::new_instance( array(  'ANS_value'=> $venue->country_ID() )),
1461
+				EE_Question::new_instance(array('QST_display_text' => 'Country', 'QST_system' => 'country')),
1462
+				EE_Answer::new_instance(array('ANS_value'=> $venue->country_ID())),
1463 1463
 				array(
1464 1464
 					'input_name' =>  'countries',
1465 1465
 					'input_id' => 'phys-country',
@@ -1470,8 +1470,8 @@  discard block
 block discarded – undo
1470 1470
 			)
1471 1471
 		);
1472 1472
 
1473
-		$template_path = EVENTS_TEMPLATE_PATH . 'event_venues_metabox_content.template.php';
1474
-		EEH_Template::display_template( $template_path, $template_args );
1473
+		$template_path = EVENTS_TEMPLATE_PATH.'event_venues_metabox_content.template.php';
1474
+		EEH_Template::display_template($template_path, $template_args);
1475 1475
 	}
1476 1476
 
1477 1477
 
@@ -1498,21 +1498,21 @@  discard block
 block discarded – undo
1498 1498
 		$EEME = $this->_event_model();
1499 1499
 
1500 1500
 		$offset = ($current_page - 1) * $per_page;
1501
-		$limit = $count ? NULL : $offset . ',' . $per_page;
1501
+		$limit = $count ? NULL : $offset.','.$per_page;
1502 1502
 		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'EVT_ID';
1503 1503
 		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : "DESC";
1504 1504
 
1505 1505
 		if (isset($this->_req_data['month_range'])) {
1506 1506
 			$pieces = explode(' ', $this->_req_data['month_range'], 3);
1507
-			$month_r = !empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
1508
-			$year_r = !empty($pieces[1]) ? $pieces[1] : '';
1507
+			$month_r = ! empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
1508
+			$year_r = ! empty($pieces[1]) ? $pieces[1] : '';
1509 1509
 		}
1510 1510
 
1511 1511
 		$where = array();
1512 1512
 
1513
-		$status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL;
1513
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : NULL;
1514 1514
 		//determine what post_status our condition will have for the query.
1515
-		switch ( $status ) {
1515
+		switch ($status) {
1516 1516
 			case 'month' :
1517 1517
 			case 'today' :
1518 1518
 			case NULL :
@@ -1520,7 +1520,7 @@  discard block
 block discarded – undo
1520 1520
 				break;
1521 1521
 
1522 1522
 			case 'draft' :
1523
-				$where['status'] = array( 'IN', array('draft', 'auto-draft') );
1523
+				$where['status'] = array('IN', array('draft', 'auto-draft'));
1524 1524
 				break;
1525 1525
 
1526 1526
 			default :
@@ -1528,37 +1528,37 @@  discard block
 block discarded – undo
1528 1528
 		}
1529 1529
 
1530 1530
 		//categories?
1531
-		$category = isset( $this->_req_data['EVT_CAT'] ) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL;
1531
+		$category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL;
1532 1532
 
1533
-		if ( !empty ( $category ) ) {
1533
+		if ( ! empty ($category)) {
1534 1534
 			$where['Term_Taxonomy.taxonomy'] = 'espresso_event_categories';
1535 1535
 			$where['Term_Taxonomy.term_id'] = $category;
1536 1536
 		}
1537 1537
 
1538 1538
 		//date where conditions
1539 1539
 		if (isset($this->_req_data['month_range']) && $this->_req_data['month_range'] != '') {
1540
-			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array( strtotime($year_r . '-' . $month_r . '-01 00:00:00'), strtotime($year_r . '-' . $month_r . '-31 23:59:59' ) ) );
1540
+			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array(strtotime($year_r.'-'.$month_r.'-01 00:00:00'), strtotime($year_r.'-'.$month_r.'-31 23:59:59')));
1541 1541
 		} else if (isset($this->_req_data['status']) && $this->_req_data['status'] == 'today') {
1542
-			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array( strtotime(date('Y-m-d') . ' 0:00:00'), strtotime(date('Y-m-d') . ' 23:59:59') ) );
1543
-		} else if ( isset($this->_req_data['status']) && $this->_req_data['status'] == 'month' ) {
1542
+			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array(strtotime(date('Y-m-d').' 0:00:00'), strtotime(date('Y-m-d').' 23:59:59')));
1543
+		} else if (isset($this->_req_data['status']) && $this->_req_data['status'] == 'month') {
1544 1544
 			$this_year_r = date('Y');
1545 1545
 			$this_month_r = date('m');
1546 1546
 			$days_this_month = date('t');
1547 1547
 			$start = ' 00:00:00';
1548 1548
 			$end = ' 23:59:59';
1549
-			$where['Datetime.DTT_EVT_start'] = array( 'BETWEEN', array( strtotime($this_year_r . '-' . $this_month_r . '-01' . $start), strtotime($this_year_r . '-' . $this_month_r . '-' . $days_this_month . $end) ) );
1549
+			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array(strtotime($this_year_r.'-'.$this_month_r.'-01'.$start), strtotime($this_year_r.'-'.$this_month_r.'-'.$days_this_month.$end)));
1550 1550
 		}
1551 1551
 		
1552 1552
 
1553
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {
1554
-			$where['EVT_wp_user'] =  get_current_user_id();
1553
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1554
+			$where['EVT_wp_user'] = get_current_user_id();
1555 1555
 		} else {
1556
-			if ( ! isset( $where['status'] ) ) {
1557
-				if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_events', 'get_events' ) ) {
1556
+			if ( ! isset($where['status'])) {
1557
+				if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
1558 1558
 					$where['OR'] = array(
1559
-						'status*restrict_private' => array( '!=', 'private' ),
1559
+						'status*restrict_private' => array('!=', 'private'),
1560 1560
 						'AND' => array(
1561
-							'status*inclusive' => array( '=', 'private' ),
1561
+							'status*inclusive' => array('=', 'private'),
1562 1562
 							'EVT_wp_user' => get_current_user_id()
1563 1563
 						)
1564 1564
 					);
@@ -1566,16 +1566,16 @@  discard block
 block discarded – undo
1566 1566
 			}
1567 1567
 		}
1568 1568
 
1569
-		if ( isset( $this->_req_data['EVT_wp_user'] ) ) {
1570
-			if ( $this->_req_data['EVT_wp_user'] != get_current_user_id() && EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {
1569
+		if (isset($this->_req_data['EVT_wp_user'])) {
1570
+			if ($this->_req_data['EVT_wp_user'] != get_current_user_id() && EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1571 1571
 				$where['EVT_wp_user'] = $this->_req_data['EVT_wp_user'];
1572 1572
 			}
1573 1573
 		}
1574 1574
 
1575 1575
 
1576 1576
 		//search query handling
1577
-		if ( isset( $this->_req_data['s'] ) ) {
1578
-			$search_string = '%' . $this->_req_data['s'] . '%';
1577
+		if (isset($this->_req_data['s'])) {
1578
+			$search_string = '%'.$this->_req_data['s'].'%';
1579 1579
 			$where['OR'] = array(
1580 1580
 				'EVT_name' => array('LIKE', $search_string),
1581 1581
 				'EVT_desc' => array('LIKE', $search_string),
@@ -1584,32 +1584,32 @@  discard block
 block discarded – undo
1584 1584
 		}
1585 1585
 
1586 1586
 
1587
-		$where = apply_filters( 'FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data );
1588
-		$query_params = apply_filters( 'FHEE__Events_Admin_Page__get_events__query_params', array($where, 'limit' => $limit, 'order_by' => $orderby, 'order' => $order, 'group_by' => 'EVT_ID' ), $this->_req_data );
1587
+		$where = apply_filters('FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data);
1588
+		$query_params = apply_filters('FHEE__Events_Admin_Page__get_events__query_params', array($where, 'limit' => $limit, 'order_by' => $orderby, 'order' => $order, 'group_by' => 'EVT_ID'), $this->_req_data);
1589 1589
 
1590 1590
 
1591 1591
 		//let's first check if we have special requests coming in.
1592
-		if ( isset( $this->_req_data['active_status'] ) ) {
1593
-			switch ( $this->_req_data['active_status'] ) {
1592
+		if (isset($this->_req_data['active_status'])) {
1593
+			switch ($this->_req_data['active_status']) {
1594 1594
 				case 'upcoming' :
1595
-					return $EEME->get_upcoming_events( $query_params, $count );
1595
+					return $EEME->get_upcoming_events($query_params, $count);
1596 1596
 					break;
1597 1597
 
1598 1598
 				case 'expired' :
1599
-					return $EEME->get_expired_events( $query_params, $count );
1599
+					return $EEME->get_expired_events($query_params, $count);
1600 1600
 					break;
1601 1601
 
1602 1602
 				case 'active' :
1603
-					return $EEME->get_active_events( $query_params, $count );
1603
+					return $EEME->get_active_events($query_params, $count);
1604 1604
 					break;
1605 1605
 
1606 1606
 				case 'inactive' :
1607
-					return $EEME->get_inactive_events( $query_params, $count );
1607
+					return $EEME->get_inactive_events($query_params, $count);
1608 1608
 					break;
1609 1609
 			}
1610 1610
 		}
1611 1611
 
1612
-		$events = $count ? $EEME->count( array( $where ), 'EVT_ID' ) : $EEME->get_all( $query_params );
1612
+		$events = $count ? $EEME->count(array($where), 'EVT_ID') : $EEME->get_all($query_params);
1613 1613
 
1614 1614
 		return $events;
1615 1615
 	}
@@ -1618,23 +1618,23 @@  discard block
 block discarded – undo
1618 1618
 
1619 1619
 
1620 1620
 	//handling for WordPress CPT actions (trash, restore, delete)
1621
-	public function trash_cpt_item( $post_id ) {
1621
+	public function trash_cpt_item($post_id) {
1622 1622
 		$this->_req_data['EVT_ID'] = $post_id;
1623
-		$this->_trash_or_restore_event( 'trash', FALSE );
1623
+		$this->_trash_or_restore_event('trash', FALSE);
1624 1624
 	}
1625 1625
 
1626 1626
 
1627 1627
 
1628 1628
 
1629
-	public function restore_cpt_item( $post_id ) {
1629
+	public function restore_cpt_item($post_id) {
1630 1630
 		$this->_req_data['EVT_ID'] = $post_id;
1631
-		$this->_trash_or_restore_event( 'draft', FALSE );
1631
+		$this->_trash_or_restore_event('draft', FALSE);
1632 1632
 	}
1633 1633
 
1634 1634
 
1635
-	public function delete_cpt_item( $post_id ) {
1635
+	public function delete_cpt_item($post_id) {
1636 1636
 		$this->_req_data['EVT_ID'] = $post_id;
1637
-		$this->_delete_event( FALSE );
1637
+		$this->_delete_event(FALSE);
1638 1638
 	}
1639 1639
 
1640 1640
 
@@ -1646,7 +1646,7 @@  discard block
 block discarded – undo
1646 1646
 	 * @param  string $event_status
1647 1647
 	 * @return void
1648 1648
 	 */
1649
-	protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = TRUE ) {
1649
+	protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = TRUE) {
1650 1650
 		//determine the event id and set to array.
1651 1651
 		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : FALSE;
1652 1652
 		// loop thru events
@@ -1654,7 +1654,7 @@  discard block
 block discarded – undo
1654 1654
 			// clean status
1655 1655
 			$event_status = sanitize_key($event_status);
1656 1656
 			// grab status
1657
-			if (!empty($event_status)) {
1657
+			if ( ! empty($event_status)) {
1658 1658
 				$success = $this->_change_event_status($EVT_ID, $event_status);
1659 1659
 			} else {
1660 1660
 				$success = FALSE;
@@ -1668,7 +1668,7 @@  discard block
 block discarded – undo
1668 1668
 		}
1669 1669
 		$action = $event_status == 'trash' ? 'moved to the trash' : 'restored from the trash';
1670 1670
 
1671
-		if ( $redirect_after )
1671
+		if ($redirect_after)
1672 1672
 			$this->_redirect_after_action($success, 'Event', $action, array('action' => 'default'));
1673 1673
 	}
1674 1674
 
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
 		// clean status
1684 1684
 		$event_status = sanitize_key($event_status);
1685 1685
 		// grab status
1686
-		if (!empty($event_status)) {
1686
+		if ( ! empty($event_status)) {
1687 1687
 			$success = TRUE;
1688 1688
 			//determine the event id and set to array.
1689 1689
 			$EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : array();
@@ -1720,13 +1720,13 @@  discard block
 block discarded – undo
1720 1720
 	 */
1721 1721
 	private function _change_event_status($EVT_ID = FALSE, $event_status = FALSE) {
1722 1722
 		// grab event id
1723
-		if (!$EVT_ID) {
1723
+		if ( ! $EVT_ID) {
1724 1724
 			$msg = __('An error occurred. No Event ID or an invalid Event ID was received.', 'event_espresso');
1725 1725
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1726 1726
 			return FALSE;
1727 1727
 		}
1728 1728
 
1729
-		$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID( $EVT_ID );
1729
+		$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
1730 1730
 
1731 1731
 		// clean status
1732 1732
 		$event_status = sanitize_key($event_status);
@@ -1752,7 +1752,7 @@  discard block
 block discarded – undo
1752 1752
 				$hook = FALSE;
1753 1753
 		}
1754 1754
 		//use class to change status
1755
-		$this->_cpt_model_obj->set_status( $event_status );
1755
+		$this->_cpt_model_obj->set_status($event_status);
1756 1756
 		$success = $this->_cpt_model_obj->save();
1757 1757
 
1758 1758
 		if ($success === FALSE) {
@@ -1772,15 +1772,15 @@  discard block
 block discarded – undo
1772 1772
 	 * @access protected
1773 1773
 	 * @return void
1774 1774
 	 */
1775
-	protected function _delete_event( $redirect_after = TRUE ) {
1775
+	protected function _delete_event($redirect_after = TRUE) {
1776 1776
 		//determine the event id and set to array.
1777 1777
 		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : NULL;
1778
-		$EVT_ID = isset( $this->_req_data['post'] ) ? absint( $this->_req_data['post'] ) : $EVT_ID;
1778
+		$EVT_ID = isset($this->_req_data['post']) ? absint($this->_req_data['post']) : $EVT_ID;
1779 1779
 
1780 1780
 
1781 1781
 		// loop thru events
1782 1782
 		if ($EVT_ID) {
1783
-			$success = $this->_permanently_delete_event( $EVT_ID );
1783
+			$success = $this->_permanently_delete_event($EVT_ID);
1784 1784
 			// get list of events with no prices
1785 1785
 			$espresso_no_ticket_prices = get_option('ee_no_ticket_prices', array());
1786 1786
 			// remove this event from the list of events with no prices
@@ -1794,7 +1794,7 @@  discard block
 block discarded – undo
1794 1794
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1795 1795
 		}
1796 1796
 
1797
-		if ( $redirect_after )
1797
+		if ($redirect_after)
1798 1798
 			$this->_redirect_after_action($success, 'Event', 'deleted', array('action' => 'default', 'status' => 'trash'));
1799 1799
 	}
1800 1800
 
@@ -1840,7 +1840,7 @@  discard block
 block discarded – undo
1840 1840
 	 */
1841 1841
 	private function _permanently_delete_event($EVT_ID = FALSE) {
1842 1842
 		// grab event id
1843
-		if (!$EVT_ID = absint($EVT_ID)) {
1843
+		if ( ! $EVT_ID = absint($EVT_ID)) {
1844 1844
 			$msg = __('An error occurred. No Event ID or an invalid Event ID was received.', 'event_espresso');
1845 1845
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1846 1846
 			return FALSE;
@@ -1851,10 +1851,10 @@  discard block
 block discarded – undo
1851 1851
 
1852 1852
 		//need to delete related tickets and prices first.
1853 1853
 		$datetimes = $this->_cpt_model_obj->get_many_related('Datetime');
1854
-		foreach ( $datetimes as $datetime ) {
1854
+		foreach ($datetimes as $datetime) {
1855 1855
 			$this->_cpt_model_obj->_remove_relation_to($datetime, 'Datetime');
1856 1856
 			$tickets = $datetime->get_many_related('Ticket');
1857
-			foreach ( $tickets as $ticket ) {
1857
+			foreach ($tickets as $ticket) {
1858 1858
 				$ticket->_remove_relation_to($datetime, 'Datetime');
1859 1859
 				$ticket->delete_related_permanently('Price');
1860 1860
 				$ticket->delete_permanently();
@@ -1864,14 +1864,14 @@  discard block
 block discarded – undo
1864 1864
 
1865 1865
 		//what about related venues or terms?
1866 1866
 		$venues = $this->_cpt_model_obj->get_many_related('Venue');
1867
-		foreach ( $venues as $venue ) {
1867
+		foreach ($venues as $venue) {
1868 1868
 			$this->_cpt_model_obj->_remove_relation_to($venue, 'Venue');
1869 1869
 		}
1870 1870
 
1871 1871
 		//any attached question groups?
1872 1872
 		$question_groups = $this->_cpt_model_obj->get_many_related('Question_Group');
1873
-		if ( !empty( $question_groups ) ) {
1874
-			foreach ( $question_groups as $question_group ) {
1873
+		if ( ! empty($question_groups)) {
1874
+			foreach ($question_groups as $question_group) {
1875 1875
 				$this->_cpt_model_obj->_remove_relation_to($question_group, 'Question_Group');
1876 1876
 			}
1877 1877
 		}
@@ -1880,13 +1880,13 @@  discard block
 block discarded – undo
1880 1880
 
1881 1881
 
1882 1882
 		//Message Template Groups
1883
-		$this->_cpt_model_obj->_remove_relations( 'Message_Template_Group' );
1883
+		$this->_cpt_model_obj->_remove_relations('Message_Template_Group');
1884 1884
 
1885 1885
 
1886 1886
 		//term taxonomies
1887 1887
 		$term_taxonomies = $this->_cpt_model_obj->term_taxonomies();
1888 1888
 
1889
-		foreach ( $term_taxonomies as $term_taxonomy ) {
1889
+		foreach ($term_taxonomies as $term_taxonomy) {
1890 1890
 			$this->_cpt_model_obj->remove_relation_to_term_taxonomy($term_taxonomy);
1891 1891
 		}
1892 1892
 
@@ -1900,7 +1900,7 @@  discard block
 block discarded – undo
1900 1900
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1901 1901
 			return FALSE;
1902 1902
 		}
1903
-		do_action( 'AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted' );
1903
+		do_action('AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted');
1904 1904
 		return TRUE;
1905 1905
 	}
1906 1906
 
@@ -1917,7 +1917,7 @@  discard block
 block discarded – undo
1917 1917
 	 */
1918 1918
 	public function total_events() {
1919 1919
 
1920
-		$count = EEM_Event::instance()->count( array(), 'EVT_ID' );
1920
+		$count = EEM_Event::instance()->count(array(), 'EVT_ID');
1921 1921
 		return $count;
1922 1922
 	}
1923 1923
 
@@ -1932,10 +1932,10 @@  discard block
 block discarded – undo
1932 1932
 	 */
1933 1933
 	public function total_events_draft() {
1934 1934
 		$where = array(
1935
-			'status' => array( 'IN', array('draft', 'auto-draft' ) )
1935
+			'status' => array('IN', array('draft', 'auto-draft'))
1936 1936
 			);
1937 1937
 
1938
-		$count = EEM_Event::instance()->count( array( $where ), 'EVT_ID' );
1938
+		$count = EEM_Event::instance()->count(array($where), 'EVT_ID');
1939 1939
 		return $count;
1940 1940
 	}
1941 1941
 
@@ -1954,7 +1954,7 @@  discard block
 block discarded – undo
1954 1954
 			'status' => 'trash'
1955 1955
 			);
1956 1956
 
1957
-		$count = EEM_Event::instance()->count( array( $where ), 'EVT_ID' );
1957
+		$count = EEM_Event::instance()->count(array($where), 'EVT_ID');
1958 1958
 		return $count;
1959 1959
 	}
1960 1960
 
@@ -1982,11 +1982,11 @@  discard block
 block discarded – undo
1982 1982
 			// translated
1983 1983
 			TRUE
1984 1984
 		);
1985
-		$this->_template_args['default_reg_status'] = isset( EE_Registry::instance()->CFG->registration->default_STS_ID ) ? sanitize_text_field( EE_Registry::instance()->CFG->registration->default_STS_ID ) : EEM_Registration::status_id_pending_payment;
1985
+		$this->_template_args['default_reg_status'] = isset(EE_Registry::instance()->CFG->registration->default_STS_ID) ? sanitize_text_field(EE_Registry::instance()->CFG->registration->default_STS_ID) : EEM_Registration::status_id_pending_payment;
1986 1986
 
1987 1987
 		$this->_set_add_edit_form_tags('update_default_event_settings');
1988 1988
 		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
1989
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template(EVENTS_TEMPLATE_PATH . 'event_settings.template.php', $this->_template_args, TRUE);
1989
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(EVENTS_TEMPLATE_PATH.'event_settings.template.php', $this->_template_args, TRUE);
1990 1990
 		$this->display_admin_page_with_sidebar();
1991 1991
 	}
1992 1992
 
@@ -2012,9 +2012,9 @@  discard block
 block discarded – undo
2012 2012
 
2013 2013
 	protected function _template_settings() {
2014 2014
 		$this->_admin_page_title = __('Template Settings (Preview)', 'event_espresso');
2015
-		$this->_template_args['preview_img'] = '<img src="' . EVENTS_ASSETS_URL . DS . 'images' . DS . 'caffeinated_template_features.jpg" alt="' . esc_attr__( 'Template Settings Preview screenshot', 'event_espresso' ) . '" />';
2016
-		$this->_template_args['preview_text'] = '<strong>'.__( 'Template Settings is a feature that is only available in the Caffeinated version of Event Espresso. Template Settings allow you to configure some of the appearance options for both the Event List and Event Details pages.', 'event_espresso' ).'</strong>';
2017
-		$this->display_admin_caf_preview_page( 'template_settings_tab' );
2015
+		$this->_template_args['preview_img'] = '<img src="'.EVENTS_ASSETS_URL.DS.'images'.DS.'caffeinated_template_features.jpg" alt="'.esc_attr__('Template Settings Preview screenshot', 'event_espresso').'" />';
2016
+		$this->_template_args['preview_text'] = '<strong>'.__('Template Settings is a feature that is only available in the Caffeinated version of Event Espresso. Template Settings allow you to configure some of the appearance options for both the Event List and Event Details pages.', 'event_espresso').'</strong>';
2017
+		$this->display_admin_caf_preview_page('template_settings_tab');
2018 2018
 	}
2019 2019
 
2020 2020
 
@@ -2027,22 +2027,22 @@  discard block
 block discarded – undo
2027 2027
 	 * @return void
2028 2028
 	 */
2029 2029
 	private function _set_category_object() {
2030
-		if ( isset( $this->_category->id ) && !empty( $this->_category->id ) )
2030
+		if (isset($this->_category->id) && ! empty($this->_category->id))
2031 2031
 			return; //already have the category object so get out.
2032 2032
 
2033 2033
 		//set default category object
2034 2034
 		$this->_set_empty_category_object();
2035 2035
 
2036 2036
 		//only set if we've got an id
2037
-		if ( !isset($this->_req_data['EVT_CAT_ID'] ) ) {
2037
+		if ( ! isset($this->_req_data['EVT_CAT_ID'])) {
2038 2038
 			return;
2039 2039
 		}
2040 2040
 
2041 2041
 		$category_id = absint($this->_req_data['EVT_CAT_ID']);
2042 2042
 
2043
-		$term = get_term( $category_id, 'espresso_event_categories' );
2043
+		$term = get_term($category_id, 'espresso_event_categories');
2044 2044
 
2045
-		if ( !empty( $term ) ) {
2045
+		if ( ! empty($term)) {
2046 2046
 			$this->_category->category_name = $term->name;
2047 2047
 			$this->_category->category_identifier = $term->slug;
2048 2048
 			$this->_category->category_desc = $term->description;
@@ -2056,13 +2056,13 @@  discard block
 block discarded – undo
2056 2056
 
2057 2057
 	private function _set_empty_category_object() {
2058 2058
 		$this->_category = new stdClass();
2059
-		$this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc  = '';
2059
+		$this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = '';
2060 2060
 		$this->_category->id = $this->_category->parent = 0;
2061 2061
 	}
2062 2062
 
2063 2063
 
2064 2064
 	protected function _category_list_table() {
2065
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2065
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2066 2066
 		$this->_search_btn_label = __('Categories', 'event_espresso');
2067 2067
 		$this->_admin_page_title .= $this->get_action_link_or_button('add_category', 'add_category', array(), 'add-new-h2');
2068 2068
 		$this->display_admin_list_table_page_with_sidebar();
@@ -2072,22 +2072,22 @@  discard block
 block discarded – undo
2072 2072
 	protected function _category_details($view) {
2073 2073
 
2074 2074
 		//load formatter helper
2075
-		EE_Registry::instance()->load_helper( 'Formatter' );
2075
+		EE_Registry::instance()->load_helper('Formatter');
2076 2076
 		//load field generator helper
2077
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
2077
+		EE_Registry::instance()->load_helper('Form_Fields');
2078 2078
 
2079 2079
 		$route = $view == 'edit' ? 'update_category' : 'insert_category';
2080 2080
 		$this->_set_add_edit_form_tags($route);
2081 2081
 
2082 2082
 		$this->_set_category_object();
2083
-		$id = !empty($this->_category->id) ? $this->_category->id : '';
2083
+		$id = ! empty($this->_category->id) ? $this->_category->id : '';
2084 2084
 
2085 2085
 		$delete_action = 'delete_category';
2086 2086
 
2087 2087
 		//custom redirect
2088
-		$redirect = EE_Admin_Page::add_query_args_and_nonce( array('action' => 'category_list'), $this->_admin_base_url );
2088
+		$redirect = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'category_list'), $this->_admin_base_url);
2089 2089
 
2090
-		$this->_set_publish_post_box_vars( 'EVT_CAT_ID', $id, $delete_action, $redirect );
2090
+		$this->_set_publish_post_box_vars('EVT_CAT_ID', $id, $delete_action, $redirect);
2091 2091
 
2092 2092
 		//take care of contents
2093 2093
 		$this->_template_args['admin_page_content'] = $this->_category_details_content();
@@ -2101,25 +2101,25 @@  discard block
 block discarded – undo
2101 2101
 			'type' => 'wp_editor',
2102 2102
 			'value' => EEH_Formatter::admin_format_content($this->_category->category_desc),
2103 2103
 			'class' => 'my_editor_custom',
2104
-			'wpeditor_args' => array('media_buttons' => FALSE )
2104
+			'wpeditor_args' => array('media_buttons' => FALSE)
2105 2105
 		);
2106
-		$_wp_editor = $this->_generate_admin_form_fields( $editor_args, 'array' );
2106
+		$_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array');
2107 2107
 
2108
-		$all_terms = get_terms( array('espresso_event_categories' ), array( 'hide_empty' => 0, 'exclude' => array( $this->_category->id ) ) );
2108
+		$all_terms = get_terms(array('espresso_event_categories'), array('hide_empty' => 0, 'exclude' => array($this->_category->id)));
2109 2109
 
2110 2110
 		//setup category select for term parents.
2111 2111
 		$category_select_values[] = array(
2112 2112
 			'text' => __('No Parent', 'event_espresso'),
2113 2113
 			'id' => 0
2114 2114
 			);
2115
-		foreach ( $all_terms as $term ) {
2115
+		foreach ($all_terms as $term) {
2116 2116
 			$category_select_values[] = array(
2117 2117
 				'text' => $term->name,
2118 2118
 				'id' => $term->term_id
2119 2119
 				);
2120 2120
 		}
2121 2121
 
2122
-		$category_select = EEH_Form_Fields::select_input( 'category_parent', $category_select_values, $this->_category->parent );
2122
+		$category_select = EEH_Form_Fields::select_input('category_parent', $category_select_values, $this->_category->parent);
2123 2123
 
2124 2124
 		$template_args = array(
2125 2125
 			'category' => $this->_category,
@@ -2129,15 +2129,15 @@  discard block
 block discarded – undo
2129 2129
 			'disable' => '',
2130 2130
 			'disabled_message' => FALSE
2131 2131
 			);
2132
-		$template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2133
-		return EEH_Template::display_template($template, $template_args, TRUE );
2132
+		$template = EVENTS_TEMPLATE_PATH.'event_category_details.template.php';
2133
+		return EEH_Template::display_template($template, $template_args, TRUE);
2134 2134
 	}
2135 2135
 
2136 2136
 
2137 2137
 	protected function _delete_categories() {
2138
-		$cat_ids = isset( $this->_req_data['EVT_CAT_ID'] ) ? (array) $this->_req_data['EVT_CAT_ID'] : (array) $this->_req_data['category_id'];
2138
+		$cat_ids = isset($this->_req_data['EVT_CAT_ID']) ? (array) $this->_req_data['EVT_CAT_ID'] : (array) $this->_req_data['category_id'];
2139 2139
 
2140
-		foreach ( $cat_ids as $cat_id ) {
2140
+		foreach ($cat_ids as $cat_id) {
2141 2141
 			$this->_delete_category($cat_id);
2142 2142
 		}
2143 2143
 
@@ -2145,7 +2145,7 @@  discard block
 block discarded – undo
2145 2145
 		$query_args = array(
2146 2146
 			'action' => 'category_list'
2147 2147
 			);
2148
-		$this->_redirect_after_action(0,'','',$query_args);
2148
+		$this->_redirect_after_action(0, '', '', $query_args);
2149 2149
 
2150 2150
 	}
2151 2151
 
@@ -2155,61 +2155,61 @@  discard block
 block discarded – undo
2155 2155
 
2156 2156
 	protected function _delete_category($cat_id) {
2157 2157
 		global $wpdb;
2158
-		$cat_id = absint( $cat_id );
2159
-		wp_delete_term( $cat_id, 'espresso_event_categories' );
2158
+		$cat_id = absint($cat_id);
2159
+		wp_delete_term($cat_id, 'espresso_event_categories');
2160 2160
 	}
2161 2161
 
2162 2162
 
2163 2163
 
2164 2164
 	protected function _insert_or_update_category($new_category) {
2165 2165
 
2166
-		$cat_id = $new_category ? $this->_insert_category() : $this->_insert_category( TRUE );
2166
+		$cat_id = $new_category ? $this->_insert_category() : $this->_insert_category(TRUE);
2167 2167
 		$success = 0; //we already have a success message so lets not send another.
2168 2168
 
2169
-		if ( $cat_id ) {
2169
+		if ($cat_id) {
2170 2170
 			$query_args = array(
2171 2171
 				'action'     => 'edit_category',
2172 2172
 				'EVT_CAT_ID' => $cat_id
2173 2173
 			);
2174 2174
 		} else {
2175
-			$query_args = array( 'action' => 'add_category' );
2175
+			$query_args = array('action' => 'add_category');
2176 2176
 		}
2177
-		$this->_redirect_after_action( $success, '','', $query_args, TRUE );
2177
+		$this->_redirect_after_action($success, '', '', $query_args, TRUE);
2178 2178
 
2179 2179
 	}
2180 2180
 
2181 2181
 
2182 2182
 
2183
-	private function _insert_category( $update = FALSE ) {
2183
+	private function _insert_category($update = FALSE) {
2184 2184
 		$cat_id = $update ? $this->_req_data['EVT_CAT_ID'] : '';
2185
-		$category_name= isset( $this->_req_data['category_name'] ) ? $this->_req_data['category_name'] : '';
2186
-		$category_desc= isset( $this->_req_data['category_desc'] ) ? $this->_req_data['category_desc'] : '';
2187
-		$category_parent = isset( $this->_req_data['category_parent'] ) ? $this->_req_data['category_parent'] : 0;
2185
+		$category_name = isset($this->_req_data['category_name']) ? $this->_req_data['category_name'] : '';
2186
+		$category_desc = isset($this->_req_data['category_desc']) ? $this->_req_data['category_desc'] : '';
2187
+		$category_parent = isset($this->_req_data['category_parent']) ? $this->_req_data['category_parent'] : 0;
2188 2188
 
2189
-		if ( empty( $category_name ) ) {
2190
-			$msg = __( 'You must add a name for the category.', 'event_espresso' );
2191
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2189
+		if (empty($category_name)) {
2190
+			$msg = __('You must add a name for the category.', 'event_espresso');
2191
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2192 2192
 			return false;
2193 2193
 		}
2194 2194
 
2195
-		$term_args=array(
2195
+		$term_args = array(
2196 2196
 			'name'=>$category_name,
2197 2197
 			'description'=>$category_desc,
2198 2198
 			'parent'=>$category_parent
2199 2199
 		);
2200 2200
 		//was the category_identifier input disabled?
2201
-		if(isset($this->_req_data['category_identifier'])){
2201
+		if (isset($this->_req_data['category_identifier'])) {
2202 2202
 			$term_args['slug'] = $this->_req_data['category_identifier'];
2203 2203
 		}
2204
-		$insert_ids = $update ? wp_update_term( $cat_id, 'espresso_event_categories', $term_args ) :wp_insert_term( $category_name, 'espresso_event_categories', $term_args );
2204
+		$insert_ids = $update ? wp_update_term($cat_id, 'espresso_event_categories', $term_args) : wp_insert_term($category_name, 'espresso_event_categories', $term_args);
2205 2205
 
2206
-		if ( !is_array( $insert_ids ) ) {
2207
-			$msg = __( 'An error occurred and the category has not been saved to the database.', 'event_espresso' );
2208
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2206
+		if ( ! is_array($insert_ids)) {
2207
+			$msg = __('An error occurred and the category has not been saved to the database.', 'event_espresso');
2208
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2209 2209
 		} else {
2210 2210
 			$cat_id = $insert_ids['term_id'];
2211
-			$msg = sprintf ( __('The category %s was successfuly saved', 'event_espresso'), $category_name );
2212
-			EE_Error::add_success( $msg );
2211
+			$msg = sprintf(__('The category %s was successfuly saved', 'event_espresso'), $category_name);
2212
+			EE_Error::add_success($msg);
2213 2213
 		}
2214 2214
 
2215 2215
 		return $cat_id;
@@ -2218,32 +2218,32 @@  discard block
 block discarded – undo
2218 2218
 
2219 2219
 
2220 2220
 
2221
-	public function get_categories( $per_page = 10, $current_page = 1, $count = FALSE ) {
2221
+	public function get_categories($per_page = 10, $current_page = 1, $count = FALSE) {
2222 2222
 		global $wpdb;
2223 2223
 
2224 2224
 		//testing term stuff
2225
-		$orderby = isset( $this->_req_data['orderby'] ) ? $this->_req_data['orderby'] : 'Term.term_id';
2226
-		$order = isset( $this->_req_data['order'] ) ? $this->_req_data['order'] : 'DESC';
2227
-		$limit = ($current_page-1)*$per_page;
2225
+		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'Term.term_id';
2226
+		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
2227
+		$limit = ($current_page - 1) * $per_page;
2228 2228
 
2229
-		$where = array( 'taxonomy' => 'espresso_event_categories' );
2229
+		$where = array('taxonomy' => 'espresso_event_categories');
2230 2230
 
2231
-		if ( isset( $this->_req_data['s'] ) ) {
2232
-			$sstr = '%' . $this->_req_data['s'] . '%';
2231
+		if (isset($this->_req_data['s'])) {
2232
+			$sstr = '%'.$this->_req_data['s'].'%';
2233 2233
 			$where['OR'] = array(
2234
-				'Term.name' => array( 'LIKE', $sstr),
2235
-				'description' => array( 'LIKE', $sstr )
2234
+				'Term.name' => array('LIKE', $sstr),
2235
+				'description' => array('LIKE', $sstr)
2236 2236
 				);
2237 2237
 		}
2238 2238
 
2239 2239
 		$query_params = array(
2240
-			$where ,
2241
-			'order_by' => array( $orderby => $order ),
2242
-			'limit' => $limit . ',' . $per_page,
2240
+			$where,
2241
+			'order_by' => array($orderby => $order),
2242
+			'limit' => $limit.','.$per_page,
2243 2243
 			'force_join' => array('Term')
2244 2244
 			);
2245 2245
 
2246
-		$categories = $count ? EEM_Term_Taxonomy::instance()->count( $query_params, 'term_id' ) :EEM_Term_Taxonomy::instance()->get_all( $query_params );
2246
+		$categories = $count ? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id') : EEM_Term_Taxonomy::instance()->get_all($query_params);
2247 2247
 
2248 2248
 		return $categories;
2249 2249
 	}
Please login to merge, or discard this patch.
admin_pages/events/help_tabs/event_editor_venue_details.help_tab.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,5 +3,5 @@
 block discarded – undo
3 3
 <?php _e('A venue is the place or location that is hosting your event. This setting is optional which means that you are not required to select a venue for your event.', 'event_espresso'); ?>
4 4
 </p>
5 5
 <p>
6
-<?php echo sprintf(__('Venues can be managed through the %sVenues page%s. This feature is only available in the caffeinated version of Event Espresso.', 'event_espresso'),'<a href="admin.php?page=espresso_venues">','</a>'); ?>
6
+<?php echo sprintf(__('Venues can be managed through the %sVenues page%s. This feature is only available in the caffeinated version of Event Espresso.', 'event_espresso'), '<a href="admin.php?page=espresso_venues">', '</a>'); ?>
7 7
 </p>
8 8
\ No newline at end of file
Please login to merge, or discard this patch.
admin_pages/events/help_tabs/events_default_settings_status.help_tab.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <h3><?php _e('Default Registration Status', 'event_espresso'); ?></h3>
2 2
 <p>
3
-<strong><?php echo EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ); ?></strong><br />
4
-<?php printf( __('A status of %s means that a registration has been accepted as complete. The registration will count towards the registration limit, remaining tickets, and calculations for available seats. Payments (if necessary) can also be made by primary registrants with this status.', 'event_espresso'), EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) ); ?>
3
+<strong><?php echo EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence'); ?></strong><br />
4
+<?php printf(__('A status of %s means that a registration has been accepted as complete. The registration will count towards the registration limit, remaining tickets, and calculations for available seats. Payments (if necessary) can also be made by primary registrants with this status.', 'event_espresso'), EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')); ?>
5 5
 </p>
6 6
 <p>
7
-<strong><?php echo EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ); ?></strong><br />
8
-<?php printf( __('A status of %1$s means that a registration has not paid but they ARE able to make payments (if necessary).  %2$s registrations do NOT count towards registration limits, remaining tickets, and calculations for available seats.  If registration for a free event occurs, then registrations are automatically set to %3$s. For paid tickets, %1$s registrations are set to %3$s when full payment is recorded.', 'event_espresso'), EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ), EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence'), EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) ); ?>
7
+<strong><?php echo EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence'); ?></strong><br />
8
+<?php printf(__('A status of %1$s means that a registration has not paid but they ARE able to make payments (if necessary).  %2$s registrations do NOT count towards registration limits, remaining tickets, and calculations for available seats.  If registration for a free event occurs, then registrations are automatically set to %3$s. For paid tickets, %1$s registrations are set to %3$s when full payment is recorded.', 'event_espresso'), EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence'), EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence'), EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')); ?>
9 9
 </p>
10 10
 <p>
11
-<strong><?php echo EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ); ?></strong><br />
12
-<?php printf( __('A status of %1$s means that a registration has not paid and they cannot make payments for towards an event.  Un-approved registrations do NOT count towards registration limits, remaining tickets, and calculations for available seats.  This setting differs from the "%2$s" default in that free ticket registrations and paid in full ticket registrations do NOT automatically switch the Registration to %3$s.  Instead, the event admin must manually set the registration to either "%2$s" for registrations requiring payments, or "%3$s" for free events.', 'event_espresso'), EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ), EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'upper' ), EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'upper' ) ); ?>
11
+<strong><?php echo EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence'); ?></strong><br />
12
+<?php printf(__('A status of %1$s means that a registration has not paid and they cannot make payments for towards an event.  Un-approved registrations do NOT count towards registration limits, remaining tickets, and calculations for available seats.  This setting differs from the "%2$s" default in that free ticket registrations and paid in full ticket registrations do NOT automatically switch the Registration to %3$s.  Instead, the event admin must manually set the registration to either "%2$s" for registrations requiring payments, or "%3$s" for free events.', 'event_espresso'), EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence'), EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'upper'), EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'upper')); ?>
13 13
 </p>
14 14
\ No newline at end of file
Please login to merge, or discard this patch.
admin_pages/events/help_tabs/general_settings_templates.help_tab.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 </li>
34 34
 <li>
35 35
 <strong><?php _e('Display Descriptions', 'event_espresso'); ?></strong><br />
36
-<?php printf( __('Whether descriptions should be shown on the event list page.%sSelecting "none" will NOT display any of the text content you entered into the main text editor on the event admin page.%sSelecting "excerpt" will display the text you entered into the "Excerpt" textarea on the event admin page, OR, any text in the main text editor above the "' . htmlentities( '<!--more-->' ) . '" tag.%sSelecting "full description" will display ALL of the text content you entered into the main text editor on the event admin page.', 'event_espresso'), '<br/>', '<br/>', '<br/>' );?>
36
+<?php printf(__('Whether descriptions should be shown on the event list page.%sSelecting "none" will NOT display any of the text content you entered into the main text editor on the event admin page.%sSelecting "excerpt" will display the text you entered into the "Excerpt" textarea on the event admin page, OR, any text in the main text editor above the "'.htmlentities('<!--more-->').'" tag.%sSelecting "full description" will display ALL of the text content you entered into the main text editor on the event admin page.', 'event_espresso'), '<br/>', '<br/>', '<br/>'); ?>
37 37
 </li>
38 38
 <li>
39 39
 <strong><?php _e('Display Ticket Selector', 'event_espresso'); ?></strong><br />
Please login to merge, or discard this patch.