@@ -245,13 +245,13 @@ discard block |
||
245 | 245 | 'persistent' => FALSE |
246 | 246 | ), |
247 | 247 | 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ), |
248 | - 'help_tabs' => array( |
|
248 | + 'help_tabs' => array( |
|
249 | 249 | 'registration_form_add_question_help_tab' => array( |
250 | 250 | 'title' => esc_html__('Add Question', 'event_espresso'), |
251 | 251 | 'filename' => 'registration_form_add_question' |
252 | 252 | ), |
253 | 253 | ), |
254 | - 'help_tour' => array( 'Registration_Form_Add_Question_Help_Tour'), |
|
254 | + 'help_tour' => array( 'Registration_Form_Add_Question_Help_Tour'), |
|
255 | 255 | 'require_nonce' => FALSE |
256 | 256 | ), |
257 | 257 | |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | 'filename' => 'registration_form_add_question_group' |
269 | 269 | ), |
270 | 270 | ), |
271 | - 'help_tour' => array( 'Registration_Form_Add_Question_Group_Help_Tour'), |
|
271 | + 'help_tour' => array( 'Registration_Form_Add_Question_Group_Help_Tour'), |
|
272 | 272 | 'require_nonce' => FALSE |
273 | 273 | ), |
274 | 274 | |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | 'filename' => 'registration_form_edit_question_group' |
287 | 287 | ), |
288 | 288 | ), |
289 | - 'help_tour' => array( 'Registration_Form_Edit_Question_Group_Help_Tour'), |
|
289 | + 'help_tour' => array( 'Registration_Form_Edit_Question_Group_Help_Tour'), |
|
290 | 290 | 'require_nonce' => FALSE |
291 | 291 | ), |
292 | 292 | |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | 'filename' => 'registration_form_reg_form_settings' |
306 | 306 | ), |
307 | 307 | ), |
308 | - 'help_tour' => array( 'Registration_Form_Settings_Help_Tour'), |
|
308 | + 'help_tour' => array( 'Registration_Form_Settings_Help_Tour'), |
|
309 | 309 | 'require_nonce' => FALSE |
310 | 310 | ) |
311 | 311 | |
@@ -933,7 +933,7 @@ discard block |
||
933 | 933 | * @return EE_Form_Section_Proper |
934 | 934 | */ |
935 | 935 | protected function _email_validation_settings_form() { |
936 | - return new EE_Form_Section_Proper( |
|
936 | + return new EE_Form_Section_Proper( |
|
937 | 937 | array( |
938 | 938 | 'name' => 'email_validation_settings', |
939 | 939 | 'html_id' => 'email_validation_settings', |
@@ -951,7 +951,7 @@ discard block |
||
951 | 951 | ), |
952 | 952 | array( |
953 | 953 | 'html_label_text' => esc_html__( 'Email Validation Level', 'event_espresso' ) |
954 | - . EEH_Template::get_help_tab_link( 'email_validation_info' ), |
|
954 | + . EEH_Template::get_help_tab_link( 'email_validation_info' ), |
|
955 | 955 | 'html_help_text' => esc_html__( 'These levels range from basic validation ( ie: [email protected] ) to more advanced checks against international email addresses (ie: üñîçøðé@example.com ) with additional MX and A record checks to confirm the domain actually exists. More information on on each level can be found within the help section.', 'event_espresso'), |
956 | 956 | 'default' => isset( EE_Registry::instance()->CFG->registration->email_validation_level ) |
957 | 957 | ? EE_Registry::instance()->CFG->registration->email_validation_level |
@@ -973,8 +973,8 @@ discard block |
||
973 | 973 | * @return \EE_Registration_Config |
974 | 974 | */ |
975 | 975 | public function update_email_validation_settings_form( EE_Registration_Config $EE_Registration_Config ) { |
976 | - $prev_email_validation_level = $EE_Registration_Config->email_validation_level; |
|
977 | - try { |
|
976 | + $prev_email_validation_level = $EE_Registration_Config->email_validation_level; |
|
977 | + try { |
|
978 | 978 | $email_validation_settings_form = $this->_email_validation_settings_form(); |
979 | 979 | // if not displaying a form, then check for form submission |
980 | 980 | if ( $email_validation_settings_form->was_submitted() ) { |
@@ -985,38 +985,38 @@ discard block |
||
985 | 985 | // grab validated data from form |
986 | 986 | $valid_data = $email_validation_settings_form->valid_data(); |
987 | 987 | if ( isset( $valid_data['email_validation_level'] ) ) { |
988 | - $email_validation_level = $valid_data['email_validation_level']; |
|
989 | - // now if they want to use international email addresses |
|
990 | - if ( $email_validation_level === 'i18n' || $email_validation_level === 'i18n_dns' ) { |
|
991 | - // in case we need to reset their email validation level, |
|
992 | - // make sure that the previous value wasn't already set to one of the i18n options. |
|
993 | - if ( $prev_email_validation_level === 'i18n' || $prev_email_validation_level === 'i18n_dns' ) { |
|
994 | - // if so, then reset it back to "basic" since that is the only other option that, |
|
995 | - // despite offering poor validation, supports i18n email addresses |
|
996 | - $prev_email_validation_level = 'basic'; |
|
997 | - } |
|
998 | - // confirm our i18n email validation will work on the server |
|
999 | - if ( ! $this->_verify_pcre_support($EE_Registration_Config, $email_validation_level)) { |
|
1000 | - // or reset email validation level to previous value |
|
1001 | - $email_validation_level = $prev_email_validation_level; |
|
1002 | - } |
|
1003 | - } |
|
1004 | - $EE_Registration_Config->email_validation_level = $email_validation_level; |
|
1005 | - } else { |
|
988 | + $email_validation_level = $valid_data['email_validation_level']; |
|
989 | + // now if they want to use international email addresses |
|
990 | + if ( $email_validation_level === 'i18n' || $email_validation_level === 'i18n_dns' ) { |
|
991 | + // in case we need to reset their email validation level, |
|
992 | + // make sure that the previous value wasn't already set to one of the i18n options. |
|
993 | + if ( $prev_email_validation_level === 'i18n' || $prev_email_validation_level === 'i18n_dns' ) { |
|
994 | + // if so, then reset it back to "basic" since that is the only other option that, |
|
995 | + // despite offering poor validation, supports i18n email addresses |
|
996 | + $prev_email_validation_level = 'basic'; |
|
997 | + } |
|
998 | + // confirm our i18n email validation will work on the server |
|
999 | + if ( ! $this->_verify_pcre_support($EE_Registration_Config, $email_validation_level)) { |
|
1000 | + // or reset email validation level to previous value |
|
1001 | + $email_validation_level = $prev_email_validation_level; |
|
1002 | + } |
|
1003 | + } |
|
1004 | + $EE_Registration_Config->email_validation_level = $email_validation_level; |
|
1005 | + } else { |
|
1006 | 1006 | EE_Error::add_error( |
1007 | 1007 | esc_html__( |
1008 | 1008 | 'Invalid or missing Email Validation settings. Please refresh the form and try again.', |
1009 | 1009 | 'event_espresso' |
1010 | 1010 | ), |
1011 | - __FILE__, __FUNCTION__, __LINE__ |
|
1012 | - ); |
|
1011 | + __FILE__, __FUNCTION__, __LINE__ |
|
1012 | + ); |
|
1013 | 1013 | } |
1014 | 1014 | } else { |
1015 | 1015 | if ( $email_validation_settings_form->submission_error_message() !== '' ) { |
1016 | 1016 | EE_Error::add_error( |
1017 | 1017 | $email_validation_settings_form->submission_error_message(), |
1018 | - __FILE__, __FUNCTION__, __LINE__ |
|
1019 | - ); |
|
1018 | + __FILE__, __FUNCTION__, __LINE__ |
|
1019 | + ); |
|
1020 | 1020 | } |
1021 | 1021 | } |
1022 | 1022 | } |
@@ -1028,61 +1028,61 @@ discard block |
||
1028 | 1028 | |
1029 | 1029 | |
1030 | 1030 | |
1031 | - /** |
|
1032 | - * confirms that the server's PHP version has the PCRE module enabled, |
|
1033 | - * and that the PCRE version works with our i18n email validation |
|
1034 | - * |
|
1035 | - * @param \EE_Registration_Config $EE_Registration_Config |
|
1036 | - * @param string $email_validation_level |
|
1037 | - * @return bool |
|
1038 | - */ |
|
1039 | - private function _verify_pcre_support(EE_Registration_Config $EE_Registration_Config, $email_validation_level) |
|
1040 | - { |
|
1041 | - // first check that PCRE is enabled |
|
1042 | - if ( ! defined('PREG_BAD_UTF8_ERROR')) { |
|
1043 | - EE_Error::add_error( |
|
1044 | - sprintf( |
|
1045 | - esc_html__( |
|
1046 | - 'We\'re sorry, but it appears that your server\'s version of PHP was not compiled with PCRE unicode support.%1$sPlease contact your hosting company and ask them whether the PCRE compiled with your version of PHP on your server can be been built with the "--enable-unicode-properties" and "--enable-utf8" configuration switches to enable more complex regex expressions.%1$sIf they are unable, or unwilling to do so, then your server will not support international email addresses using UTF-8 unicode characters. This means you will either have to lower your email validation level to "Basic" or "WordPress Default", or switch to a hosting company that has/can enable PCRE unicode support on the server.', |
|
1047 | - 'event_espresso' |
|
1048 | - ), |
|
1049 | - '<br />' |
|
1050 | - ), |
|
1051 | - __FILE__, |
|
1052 | - __FUNCTION__, |
|
1053 | - __LINE__ |
|
1054 | - ); |
|
1055 | - return false; |
|
1056 | - } else { |
|
1057 | - // PCRE support is enabled, but let's still |
|
1058 | - // perform a test to see if the server will support it. |
|
1059 | - // but first, save the updated validation level to the config, |
|
1060 | - // so that the validation strategy picks it up. |
|
1061 | - // this will get bumped back down if it doesn't work |
|
1062 | - $EE_Registration_Config->email_validation_level = $email_validation_level; |
|
1063 | - try { |
|
1064 | - $email_validator = new EE_Email_Validation_Strategy(); |
|
1065 | - $i18n_email_address = apply_filters( |
|
1066 | - 'FHEE__Extend_Registration_Form_Admin_Page__update_email_validation_settings_form__i18n_email_address', |
|
1067 | - 'jägerjü[email protected]' |
|
1068 | - ); |
|
1069 | - $email_validator->validate($i18n_email_address); |
|
1070 | - } catch (Exception $e) { |
|
1071 | - EE_Error::add_error( |
|
1072 | - sprintf( |
|
1073 | - esc_html__( |
|
1074 | - 'We\'re sorry, but it appears that your server\'s configuration will not support the "International" or "International + DNS Check" email validation levels.%1$sTo correct this issue, please consult with your hosting company regarding your server\'s PCRE settings.%1$sIt is recommended that your PHP version be configured to use PCRE 8.10 or newer.%1$sMore information regarding PCRE versions and installation can be found here: %2$s', |
|
1075 | - 'event_espresso' |
|
1076 | - ), |
|
1077 | - '<br />', |
|
1078 | - '<a href="http://php.net/manual/en/pcre.installation.php" target="_blank">http://php.net/manual/en/pcre.installation.php</a>' |
|
1079 | - ), |
|
1080 | - __FILE__, __FUNCTION__, __LINE__ |
|
1081 | - ); |
|
1082 | - return false; |
|
1083 | - } |
|
1084 | - } |
|
1085 | - return true; |
|
1086 | - } |
|
1031 | + /** |
|
1032 | + * confirms that the server's PHP version has the PCRE module enabled, |
|
1033 | + * and that the PCRE version works with our i18n email validation |
|
1034 | + * |
|
1035 | + * @param \EE_Registration_Config $EE_Registration_Config |
|
1036 | + * @param string $email_validation_level |
|
1037 | + * @return bool |
|
1038 | + */ |
|
1039 | + private function _verify_pcre_support(EE_Registration_Config $EE_Registration_Config, $email_validation_level) |
|
1040 | + { |
|
1041 | + // first check that PCRE is enabled |
|
1042 | + if ( ! defined('PREG_BAD_UTF8_ERROR')) { |
|
1043 | + EE_Error::add_error( |
|
1044 | + sprintf( |
|
1045 | + esc_html__( |
|
1046 | + 'We\'re sorry, but it appears that your server\'s version of PHP was not compiled with PCRE unicode support.%1$sPlease contact your hosting company and ask them whether the PCRE compiled with your version of PHP on your server can be been built with the "--enable-unicode-properties" and "--enable-utf8" configuration switches to enable more complex regex expressions.%1$sIf they are unable, or unwilling to do so, then your server will not support international email addresses using UTF-8 unicode characters. This means you will either have to lower your email validation level to "Basic" or "WordPress Default", or switch to a hosting company that has/can enable PCRE unicode support on the server.', |
|
1047 | + 'event_espresso' |
|
1048 | + ), |
|
1049 | + '<br />' |
|
1050 | + ), |
|
1051 | + __FILE__, |
|
1052 | + __FUNCTION__, |
|
1053 | + __LINE__ |
|
1054 | + ); |
|
1055 | + return false; |
|
1056 | + } else { |
|
1057 | + // PCRE support is enabled, but let's still |
|
1058 | + // perform a test to see if the server will support it. |
|
1059 | + // but first, save the updated validation level to the config, |
|
1060 | + // so that the validation strategy picks it up. |
|
1061 | + // this will get bumped back down if it doesn't work |
|
1062 | + $EE_Registration_Config->email_validation_level = $email_validation_level; |
|
1063 | + try { |
|
1064 | + $email_validator = new EE_Email_Validation_Strategy(); |
|
1065 | + $i18n_email_address = apply_filters( |
|
1066 | + 'FHEE__Extend_Registration_Form_Admin_Page__update_email_validation_settings_form__i18n_email_address', |
|
1067 | + 'jägerjü[email protected]' |
|
1068 | + ); |
|
1069 | + $email_validator->validate($i18n_email_address); |
|
1070 | + } catch (Exception $e) { |
|
1071 | + EE_Error::add_error( |
|
1072 | + sprintf( |
|
1073 | + esc_html__( |
|
1074 | + 'We\'re sorry, but it appears that your server\'s configuration will not support the "International" or "International + DNS Check" email validation levels.%1$sTo correct this issue, please consult with your hosting company regarding your server\'s PCRE settings.%1$sIt is recommended that your PHP version be configured to use PCRE 8.10 or newer.%1$sMore information regarding PCRE versions and installation can be found here: %2$s', |
|
1075 | + 'event_espresso' |
|
1076 | + ), |
|
1077 | + '<br />', |
|
1078 | + '<a href="http://php.net/manual/en/pcre.installation.php" target="_blank">http://php.net/manual/en/pcre.installation.php</a>' |
|
1079 | + ), |
|
1080 | + __FILE__, __FUNCTION__, __LINE__ |
|
1081 | + ); |
|
1082 | + return false; |
|
1083 | + } |
|
1084 | + } |
|
1085 | + return true; |
|
1086 | + } |
|
1087 | 1087 | |
1088 | 1088 | } |
@@ -1,5 +1,5 @@ discard block |
||
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 | /** |
@@ -36,13 +36,13 @@ discard block |
||
36 | 36 | * @param bool $routing indicate whether we want to just load the object and handle routing or just load the object. |
37 | 37 | * @access public |
38 | 38 | */ |
39 | - public function __construct( $routing = TRUE ) { |
|
40 | - define( 'REGISTRATION_FORM_CAF_ADMIN', EE_CORE_CAF_ADMIN_EXTEND . 'registration_form' . DS ); |
|
41 | - define( 'REGISTRATION_FORM_CAF_ASSETS_PATH', REGISTRATION_FORM_CAF_ADMIN . 'assets' . DS ); |
|
42 | - define( 'REGISTRATION_FORM_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registration_form/assets/' ); |
|
43 | - define( 'REGISTRATION_FORM_CAF_TEMPLATE_PATH', REGISTRATION_FORM_CAF_ADMIN . 'templates' . DS ); |
|
44 | - define( 'REGISTRATION_FORM_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registration_form/templates/' ); |
|
45 | - parent::__construct( $routing ); |
|
39 | + public function __construct($routing = TRUE) { |
|
40 | + define('REGISTRATION_FORM_CAF_ADMIN', EE_CORE_CAF_ADMIN_EXTEND.'registration_form'.DS); |
|
41 | + define('REGISTRATION_FORM_CAF_ASSETS_PATH', REGISTRATION_FORM_CAF_ADMIN.'assets'.DS); |
|
42 | + define('REGISTRATION_FORM_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'registration_form/assets/'); |
|
43 | + define('REGISTRATION_FORM_CAF_TEMPLATE_PATH', REGISTRATION_FORM_CAF_ADMIN.'templates'.DS); |
|
44 | + define('REGISTRATION_FORM_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'registration_form/templates/'); |
|
45 | + parent::__construct($routing); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | |
53 | 53 | protected function _extend_page_config() { |
54 | 54 | $this->_admin_base_path = REGISTRATION_FORM_CAF_ADMIN; |
55 | - $qst_id = ! empty( $this->_req_data['QST_ID'] ) && ! is_array( $this->_req_data['QST_ID'] ) ? $this->_req_data['QST_ID'] : 0; |
|
56 | - $qsg_id = ! empty( $this->_req_data['QSG_ID'] ) && ! is_array( $this->_req_data['QSG_ID'] ) ? $this->_req_data['QSG_ID'] : 0; |
|
55 | + $qst_id = ! empty($this->_req_data['QST_ID']) && ! is_array($this->_req_data['QST_ID']) ? $this->_req_data['QST_ID'] : 0; |
|
56 | + $qsg_id = ! empty($this->_req_data['QSG_ID']) && ! is_array($this->_req_data['QSG_ID']) ? $this->_req_data['QSG_ID'] : 0; |
|
57 | 57 | |
58 | 58 | $new_page_routes = array( |
59 | 59 | 'question_groups' => array( |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | 'func' => '_trash_or_restore_questions', |
87 | 87 | 'capability' => 'ee_delete_question', |
88 | 88 | 'obj_id' => $qst_id, |
89 | - 'args' => array( 'trash' => FALSE ), |
|
89 | + 'args' => array('trash' => FALSE), |
|
90 | 90 | 'noheader' => TRUE |
91 | 91 | ), |
92 | 92 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | |
146 | 146 | 'trash_question_group' => array( |
147 | 147 | 'func' => '_trash_or_restore_question_groups', |
148 | - 'args' => array( 'trash' => TRUE ), |
|
148 | + 'args' => array('trash' => TRUE), |
|
149 | 149 | 'capability' => 'ee_delete_question_group', |
150 | 150 | 'obj_id' => $qsg_id, |
151 | 151 | 'noheader' => TRUE |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | |
154 | 154 | 'restore_question_group' => array( |
155 | 155 | 'func' => '_trash_or_restore_question_groups', |
156 | - 'args' => array( 'trash' => FALSE ), |
|
156 | + 'args' => array('trash' => FALSE), |
|
157 | 157 | 'capability' => 'ee_delete_question_group', |
158 | 158 | 'obj_id' => $qsg_id, |
159 | 159 | 'noheader' => TRUE |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | 'update_question_group' => array( |
170 | 170 | 'func' => '_insert_or_update_question_group', |
171 | - 'args' => array('new_question_group' => FALSE ), |
|
171 | + 'args' => array('new_question_group' => FALSE), |
|
172 | 172 | 'capability' => 'ee_edit_question_group', |
173 | 173 | 'obj_id' => $qsg_id, |
174 | 174 | 'noheader' => TRUE, |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | 'noheader' => TRUE |
207 | 207 | ), |
208 | 208 | ); |
209 | - $this->_page_routes = array_merge( $this->_page_routes, $new_page_routes ); |
|
209 | + $this->_page_routes = array_merge($this->_page_routes, $new_page_routes); |
|
210 | 210 | |
211 | 211 | $new_page_config = array( |
212 | 212 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | 'filename' => 'registration_form_question_groups_views_bulk_actions_search' |
231 | 231 | ), |
232 | 232 | ), |
233 | - 'help_tour' => array( 'Registration_Form_Question_Groups_Help_Tour'), |
|
233 | + 'help_tour' => array('Registration_Form_Question_Groups_Help_Tour'), |
|
234 | 234 | 'metaboxes' => $this->_default_espresso_metaboxes, |
235 | 235 | 'require_nonce' => FALSE, |
236 | 236 | 'qtips' => array( |
@@ -244,14 +244,14 @@ discard block |
||
244 | 244 | 'order' => 5, |
245 | 245 | 'persistent' => FALSE |
246 | 246 | ), |
247 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ), |
|
247 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
248 | 248 | 'help_tabs' => array( |
249 | 249 | 'registration_form_add_question_help_tab' => array( |
250 | 250 | 'title' => esc_html__('Add Question', 'event_espresso'), |
251 | 251 | 'filename' => 'registration_form_add_question' |
252 | 252 | ), |
253 | 253 | ), |
254 | - 'help_tour' => array( 'Registration_Form_Add_Question_Help_Tour'), |
|
254 | + 'help_tour' => array('Registration_Form_Add_Question_Help_Tour'), |
|
255 | 255 | 'require_nonce' => FALSE |
256 | 256 | ), |
257 | 257 | |
@@ -261,14 +261,14 @@ discard block |
||
261 | 261 | 'order' => 5, |
262 | 262 | 'persistent' => FALSE |
263 | 263 | ), |
264 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ), |
|
264 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
265 | 265 | 'help_tabs' => array( |
266 | 266 | 'registration_form_add_question_group_help_tab' => array( |
267 | 267 | 'title' => esc_html__('Add Question Group', 'event_espresso'), |
268 | 268 | 'filename' => 'registration_form_add_question_group' |
269 | 269 | ), |
270 | 270 | ), |
271 | - 'help_tour' => array( 'Registration_Form_Add_Question_Group_Help_Tour'), |
|
271 | + 'help_tour' => array('Registration_Form_Add_Question_Group_Help_Tour'), |
|
272 | 272 | 'require_nonce' => FALSE |
273 | 273 | ), |
274 | 274 | |
@@ -277,16 +277,16 @@ discard block |
||
277 | 277 | 'label' => esc_html__('Edit Question Group', 'event_espresso'), |
278 | 278 | 'order' => 5, |
279 | 279 | 'persistent' => FALSE, |
280 | - 'url' => isset($this->_req_data['question_group_id']) ? add_query_arg(array('question_group_id' => $this->_req_data['question_group_id'] ), $this->_current_page_view_url ) : $this->_admin_base_url |
|
280 | + 'url' => isset($this->_req_data['question_group_id']) ? add_query_arg(array('question_group_id' => $this->_req_data['question_group_id']), $this->_current_page_view_url) : $this->_admin_base_url |
|
281 | 281 | ), |
282 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ), |
|
282 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
283 | 283 | 'help_tabs' => array( |
284 | 284 | 'registration_form_edit_question_group_help_tab' => array( |
285 | 285 | 'title' => esc_html__('Edit Question Group', 'event_espresso'), |
286 | 286 | 'filename' => 'registration_form_edit_question_group' |
287 | 287 | ), |
288 | 288 | ), |
289 | - 'help_tour' => array( 'Registration_Form_Edit_Question_Group_Help_Tour'), |
|
289 | + 'help_tour' => array('Registration_Form_Edit_Question_Group_Help_Tour'), |
|
290 | 290 | 'require_nonce' => FALSE |
291 | 291 | ), |
292 | 292 | |
@@ -298,19 +298,19 @@ discard block |
||
298 | 298 | 'labels' => array( |
299 | 299 | 'publishbox' => esc_html__('Update Settings', 'event_espresso') |
300 | 300 | ), |
301 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ), |
|
301 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
302 | 302 | 'help_tabs' => array( |
303 | 303 | 'registration_form_reg_form_settings_help_tab' => array( |
304 | 304 | 'title' => esc_html__('Registration Form Settings', 'event_espresso'), |
305 | 305 | 'filename' => 'registration_form_reg_form_settings' |
306 | 306 | ), |
307 | 307 | ), |
308 | - 'help_tour' => array( 'Registration_Form_Settings_Help_Tour'), |
|
308 | + 'help_tour' => array('Registration_Form_Settings_Help_Tour'), |
|
309 | 309 | 'require_nonce' => FALSE |
310 | 310 | ) |
311 | 311 | |
312 | 312 | ); |
313 | - $this->_page_config = array_merge( $this->_page_config, $new_page_config ); |
|
313 | + $this->_page_config = array_merge($this->_page_config, $new_page_config); |
|
314 | 314 | |
315 | 315 | //change the list table we're going to use so it's the NEW list table! |
316 | 316 | $this->_page_config['default']['list_table'] = 'Extend_Registration_Form_Questions_Admin_List_Table'; |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | 'edit_question_group' => esc_html__('Edit Question Group', 'event_espresso'), |
325 | 325 | 'delete_question_group' => esc_html__('Delete Question Group', 'event_espresso'), |
326 | 326 | ); |
327 | - $this->_labels['buttons'] = array_merge( $this->_labels['buttons'], $new_labels ); |
|
327 | + $this->_labels['buttons'] = array_merge($this->_labels['buttons'], $new_labels); |
|
328 | 328 | |
329 | 329 | } |
330 | 330 | |
@@ -333,14 +333,14 @@ discard block |
||
333 | 333 | |
334 | 334 | |
335 | 335 | protected function _ajax_hooks() { |
336 | - add_action('wp_ajax_espresso_update_question_group_order', array( $this, 'update_question_group_order' )); |
|
336 | + add_action('wp_ajax_espresso_update_question_group_order', array($this, 'update_question_group_order')); |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | |
340 | 340 | |
341 | 341 | |
342 | 342 | public function load_scripts_styles_question_groups() { |
343 | - wp_enqueue_script( 'espresso_ajax_table_sorting' ); |
|
343 | + wp_enqueue_script('espresso_ajax_table_sorting'); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | * @return void |
362 | 362 | */ |
363 | 363 | public function load_sortable_question_script() { |
364 | - wp_register_script('ee-question-sortable', REGISTRATION_FORM_CAF_ASSETS_URL . 'ee_question_order.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, true); |
|
364 | + wp_register_script('ee-question-sortable', REGISTRATION_FORM_CAF_ASSETS_URL.'ee_question_order.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, true); |
|
365 | 365 | wp_enqueue_script('ee-question-sortable'); |
366 | 366 | } |
367 | 367 | |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | ) |
381 | 381 | ); |
382 | 382 | |
383 | - if ( EE_Registry::instance()->CAP->current_user_can('ee_delete_questions', 'espresso_registration_form_trash_questions' ) ) { |
|
383 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_questions', 'espresso_registration_form_trash_questions')) { |
|
384 | 384 | $this->_views['trash'] = array( |
385 | 385 | 'slug' => 'trash', |
386 | 386 | 'label' => esc_html__('Trash', 'event_espresso'), |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | ) |
411 | 411 | ); |
412 | 412 | |
413 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_groups', 'espresso_registration_form_trash_question_groups' ) ) { |
|
413 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_question_groups', 'espresso_registration_form_trash_question_groups')) { |
|
414 | 414 | $this->_views['trash'] = array( |
415 | 415 | 'slug' => 'trash', |
416 | 416 | 'label' => esc_html__('Trash', 'event_espresso'), |
@@ -446,24 +446,24 @@ discard block |
||
446 | 446 | |
447 | 447 | |
448 | 448 | |
449 | - protected function _delete_question(){ |
|
450 | - $success = $this->_delete_items( $this->_question_model ); |
|
449 | + protected function _delete_question() { |
|
450 | + $success = $this->_delete_items($this->_question_model); |
|
451 | 451 | $this->_redirect_after_action( |
452 | 452 | $success, |
453 | - $this->_question_model->item_name( $success ), |
|
453 | + $this->_question_model->item_name($success), |
|
454 | 454 | 'deleted', |
455 | - array( 'action' => 'default', 'status' => 'all' ) |
|
455 | + array('action' => 'default', 'status' => 'all') |
|
456 | 456 | ); |
457 | 457 | } |
458 | 458 | |
459 | 459 | |
460 | 460 | protected function _delete_questions() { |
461 | - $success = $this->_delete_items( $this->_question_model ); |
|
461 | + $success = $this->_delete_items($this->_question_model); |
|
462 | 462 | $this->_redirect_after_action( |
463 | 463 | $success, |
464 | - $this->_question_model->item_name( $success ), |
|
464 | + $this->_question_model->item_name($success), |
|
465 | 465 | 'deleted permanently', |
466 | - array( 'action' => 'default', 'status' => 'trash' ) |
|
466 | + array('action' => 'default', 'status' => 'trash') |
|
467 | 467 | ); |
468 | 468 | } |
469 | 469 | |
@@ -474,26 +474,26 @@ discard block |
||
474 | 474 | * @param EEM_Soft_Delete_Base $model |
475 | 475 | * @return int number of items deleted permanently |
476 | 476 | */ |
477 | - private function _delete_items(EEM_Soft_Delete_Base $model){ |
|
477 | + private function _delete_items(EEM_Soft_Delete_Base $model) { |
|
478 | 478 | $success = 0; |
479 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
480 | - if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
479 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
480 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
481 | 481 | // if array has more than one element than success message should be plural |
482 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
482 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
483 | 483 | // cycle thru bulk action checkboxes |
484 | - while (list( $ID, $value ) = each($this->_req_data['checkbox'])) { |
|
485 | - if ( ! $this->_delete_item( $ID, $model ) ) { |
|
484 | + while (list($ID, $value) = each($this->_req_data['checkbox'])) { |
|
485 | + if ( ! $this->_delete_item($ID, $model)) { |
|
486 | 486 | $success = 0; |
487 | 487 | } |
488 | 488 | } |
489 | 489 | |
490 | - }elseif( !empty($this->_req_data['QSG_ID'])){ |
|
491 | - $success = $this->_delete_item( $this->_req_data['QSG_ID'], $model ); |
|
490 | + }elseif ( ! empty($this->_req_data['QSG_ID'])) { |
|
491 | + $success = $this->_delete_item($this->_req_data['QSG_ID'], $model); |
|
492 | 492 | |
493 | - }elseif( !empty($this->_req_data['QST_ID'])){ |
|
494 | - $success = $this->_delete_item( $this->_req_data['QST_ID'], $model ); |
|
495 | - }else{ |
|
496 | - EE_Error::add_error( sprintf(esc_html__("No Questions or Question Groups were selected for deleting. This error usually shows when you've attempted to delete via bulk action but there were no selections.", "event_espresso")), __FILE__, __FUNCTION__, __LINE__ ); |
|
493 | + }elseif ( ! empty($this->_req_data['QST_ID'])) { |
|
494 | + $success = $this->_delete_item($this->_req_data['QST_ID'], $model); |
|
495 | + } else { |
|
496 | + EE_Error::add_error(sprintf(esc_html__("No Questions or Question Groups were selected for deleting. This error usually shows when you've attempted to delete via bulk action but there were no selections.", "event_espresso")), __FILE__, __FUNCTION__, __LINE__); |
|
497 | 497 | } |
498 | 498 | return $success; |
499 | 499 | } |
@@ -504,11 +504,11 @@ discard block |
||
504 | 504 | * @param EEM_Soft_Delete_Base $model |
505 | 505 | * @return boolean |
506 | 506 | */ |
507 | - protected function _delete_item( $id, $model ) { |
|
508 | - if( $model instanceof EEM_Question ) { |
|
509 | - EEM_Question_Option::instance()->delete_permanently( array( array( 'QST_ID' => absint( $id ) ) ) ); |
|
507 | + protected function _delete_item($id, $model) { |
|
508 | + if ($model instanceof EEM_Question) { |
|
509 | + EEM_Question_Option::instance()->delete_permanently(array(array('QST_ID' => absint($id)))); |
|
510 | 510 | } |
511 | - return $model->delete_permanently_by_ID( absint( $id ) ); |
|
511 | + return $model->delete_permanently_by_ID(absint($id)); |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | |
@@ -520,41 +520,41 @@ discard block |
||
520 | 520 | |
521 | 521 | |
522 | 522 | |
523 | - protected function _edit_question_group( $type = 'add' ) { |
|
524 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
525 | - $ID=isset( $this->_req_data['QSG_ID'] ) && ! empty( $this->_req_data['QSG_ID'] ) ? absint( $this->_req_data['QSG_ID'] ) : FALSE; |
|
523 | + protected function _edit_question_group($type = 'add') { |
|
524 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
525 | + $ID = isset($this->_req_data['QSG_ID']) && ! empty($this->_req_data['QSG_ID']) ? absint($this->_req_data['QSG_ID']) : FALSE; |
|
526 | 526 | |
527 | - switch( $this->_req_action ) { |
|
527 | + switch ($this->_req_action) { |
|
528 | 528 | case 'add_question_group' : |
529 | - $this->_admin_page_title = esc_html__( 'Add Question Group', 'event_espresso' ); |
|
529 | + $this->_admin_page_title = esc_html__('Add Question Group', 'event_espresso'); |
|
530 | 530 | break; |
531 | 531 | case 'edit_question_group' : |
532 | - $this->_admin_page_title = esc_html__( 'Edit Question Group', 'event_espresso' ); |
|
532 | + $this->_admin_page_title = esc_html__('Edit Question Group', 'event_espresso'); |
|
533 | 533 | break; |
534 | 534 | default : |
535 | - $this->_admin_page_title = ucwords( str_replace( '_', ' ', $this->_req_action )); |
|
535 | + $this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action)); |
|
536 | 536 | } |
537 | 537 | // add ID to title if editing |
538 | - $this->_admin_page_title = $ID ? $this->_admin_page_title . ' # ' . $ID : $this->_admin_page_title; |
|
539 | - if($ID){ |
|
538 | + $this->_admin_page_title = $ID ? $this->_admin_page_title.' # '.$ID : $this->_admin_page_title; |
|
539 | + if ($ID) { |
|
540 | 540 | /** @var EE_Question_Group $questionGroup */ |
541 | - $questionGroup=$this->_question_group_model->get_one_by_ID( $ID); |
|
542 | - $additional_hidden_fields=array('QSG_ID'=>array('type'=>'hidden','value'=>$ID)); |
|
541 | + $questionGroup = $this->_question_group_model->get_one_by_ID($ID); |
|
542 | + $additional_hidden_fields = array('QSG_ID'=>array('type'=>'hidden', 'value'=>$ID)); |
|
543 | 543 | $this->_set_add_edit_form_tags('update_question_group', $additional_hidden_fields); |
544 | - }else{ |
|
544 | + } else { |
|
545 | 545 | /** @var EE_Question_Group $questionGroup */ |
546 | 546 | $questionGroup = EEM_Question_Group::instance()->create_default_object(); |
547 | 547 | $questionGroup->set_order_to_latest(); |
548 | 548 | $this->_set_add_edit_form_tags('insert_question_group'); |
549 | 549 | } |
550 | 550 | $this->_template_args['values'] = $this->_yes_no_values; |
551 | - $this->_template_args['all_questions']=$questionGroup->questions_in_and_not_in_group(); |
|
552 | - $this->_template_args['QSG_ID']=$ID ? $ID : TRUE; |
|
553 | - $this->_template_args['question_group']=$questionGroup; |
|
551 | + $this->_template_args['all_questions'] = $questionGroup->questions_in_and_not_in_group(); |
|
552 | + $this->_template_args['QSG_ID'] = $ID ? $ID : TRUE; |
|
553 | + $this->_template_args['question_group'] = $questionGroup; |
|
554 | 554 | |
555 | - $redirect_URL = add_query_arg( array( 'action' => 'question_groups'), $this->_admin_base_url ); |
|
556 | - $this->_set_publish_post_box_vars( 'id', $ID, FALSE, $redirect_URL ); |
|
557 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( REGISTRATION_FORM_CAF_TEMPLATE_PATH . 'question_groups_main_meta_box.template.php', $this->_template_args, TRUE ); |
|
555 | + $redirect_URL = add_query_arg(array('action' => 'question_groups'), $this->_admin_base_url); |
|
556 | + $this->_set_publish_post_box_vars('id', $ID, FALSE, $redirect_URL); |
|
557 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template(REGISTRATION_FORM_CAF_TEMPLATE_PATH.'question_groups_main_meta_box.template.php', $this->_template_args, TRUE); |
|
558 | 558 | |
559 | 559 | // the details template wrapper |
560 | 560 | $this->display_admin_page_with_sidebar(); |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | |
566 | 566 | protected function _delete_question_groups() { |
567 | 567 | $success = $this->_delete_items($this->_question_group_model); |
568 | - $this->_redirect_after_action( $success, $this->_question_group_model->item_name($success), 'deleted permanently', array( 'action'=>'question_groups', 'status'=>'trash' )); |
|
568 | + $this->_redirect_after_action($success, $this->_question_group_model->item_name($success), 'deleted permanently', array('action'=>'question_groups', 'status'=>'trash')); |
|
569 | 569 | } |
570 | 570 | |
571 | 571 | |
@@ -573,71 +573,71 @@ discard block |
||
573 | 573 | /** |
574 | 574 | * @param bool $new_question_group |
575 | 575 | */ |
576 | - protected function _insert_or_update_question_group( $new_question_group = TRUE) { |
|
577 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
578 | - $set_column_values=$this->_set_column_values_for($this->_question_group_model); |
|
579 | - if ( $new_question_group ){ |
|
576 | + protected function _insert_or_update_question_group($new_question_group = TRUE) { |
|
577 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
578 | + $set_column_values = $this->_set_column_values_for($this->_question_group_model); |
|
579 | + if ($new_question_group) { |
|
580 | 580 | $QSG_ID = $this->_question_group_model->insert($set_column_values); |
581 | 581 | $success = $QSG_ID ? 1 : 0; |
582 | 582 | } else { |
583 | 583 | $QSG_ID = absint($this->_req_data['QSG_ID']); |
584 | - unset( $set_column_values[ 'QSG_ID' ] ); |
|
585 | - $success= $this->_question_group_model->update( $set_column_values, array( array( 'QSG_ID' => $QSG_ID ))); |
|
584 | + unset($set_column_values['QSG_ID']); |
|
585 | + $success = $this->_question_group_model->update($set_column_values, array(array('QSG_ID' => $QSG_ID))); |
|
586 | 586 | } |
587 | - $phone_question_id = EEM_Question::instance()->get_Question_ID_from_system_string( EEM_Attendee::system_question_phone ); |
|
587 | + $phone_question_id = EEM_Question::instance()->get_Question_ID_from_system_string(EEM_Attendee::system_question_phone); |
|
588 | 588 | // update the existing related questions |
589 | 589 | // BUT FIRST... delete the phone question from the Question_Group_Question if it is being added to this question group (therefore removed from the existing group) |
590 | - if ( isset( $this->_req_data['questions'], $this->_req_data['questions'][ $phone_question_id ] )) { |
|
590 | + if (isset($this->_req_data['questions'], $this->_req_data['questions'][$phone_question_id])) { |
|
591 | 591 | // delete where QST ID = system phone question ID and Question Group ID is NOT this group |
592 | - EEM_Question_Group_Question::instance()->delete( array( array( 'QST_ID' => $phone_question_id, 'QSG_ID' => array( '!=', $QSG_ID )))); |
|
592 | + EEM_Question_Group_Question::instance()->delete(array(array('QST_ID' => $phone_question_id, 'QSG_ID' => array('!=', $QSG_ID)))); |
|
593 | 593 | } |
594 | 594 | /** @type EE_Question_Group $question_group */ |
595 | - $question_group=$this->_question_group_model->get_one_by_ID( $QSG_ID ); |
|
595 | + $question_group = $this->_question_group_model->get_one_by_ID($QSG_ID); |
|
596 | 596 | $questions = $question_group->questions(); |
597 | 597 | // make sure system phone question is added to list of questions for this group |
598 | - if ( ! isset( $questions[$phone_question_id ] )) { |
|
599 | - $questions[ $phone_question_id ] = EEM_Question::instance()->get_one_by_ID( $phone_question_id ); |
|
598 | + if ( ! isset($questions[$phone_question_id])) { |
|
599 | + $questions[$phone_question_id] = EEM_Question::instance()->get_one_by_ID($phone_question_id); |
|
600 | 600 | } |
601 | 601 | |
602 | - foreach( $questions as $question_ID => $question ){ |
|
602 | + foreach ($questions as $question_ID => $question) { |
|
603 | 603 | // first we always check for order. |
604 | - if ( ! empty( $this->_req_data['question_orders'][ $question_ID ] ) ){ |
|
604 | + if ( ! empty($this->_req_data['question_orders'][$question_ID])) { |
|
605 | 605 | //update question order |
606 | - $question_group->update_question_order( $question_ID, $this->_req_data['question_orders'][ $question_ID ] ); |
|
606 | + $question_group->update_question_order($question_ID, $this->_req_data['question_orders'][$question_ID]); |
|
607 | 607 | } |
608 | 608 | |
609 | 609 | // then we always check if adding or removing. |
610 | - if ( isset( $this->_req_data['questions'], $this->_req_data['questions'][ $question_ID ] )) { |
|
611 | - $question_group->add_question( $question_ID ); |
|
610 | + if (isset($this->_req_data['questions'], $this->_req_data['questions'][$question_ID])) { |
|
611 | + $question_group->add_question($question_ID); |
|
612 | 612 | } else { |
613 | 613 | // not found, remove it (but only if not a system question for the personal group with the exception of lname system question - we allow removal of it) |
614 | 614 | if ( |
615 | 615 | in_array( |
616 | 616 | $question->system_ID(), |
617 | - EEM_Question::instance()->required_system_questions_in_system_question_group( $question_group->system_group() ) |
|
617 | + EEM_Question::instance()->required_system_questions_in_system_question_group($question_group->system_group()) |
|
618 | 618 | ) |
619 | 619 | ) { |
620 | 620 | continue; |
621 | 621 | } else { |
622 | - $question_group->remove_question( $question_ID ); |
|
622 | + $question_group->remove_question($question_ID); |
|
623 | 623 | } |
624 | 624 | } |
625 | 625 | } |
626 | 626 | // save new related questions |
627 | - if ( isset( $this->_req_data['questions'] )) { |
|
628 | - foreach( $this->_req_data['questions'] as $QST_ID ){ |
|
629 | - $question_group->add_question( $QST_ID ); |
|
630 | - if ( isset( $this->_req_data['question_orders'][ $QST_ID ] )) { |
|
631 | - $question_group->update_question_order( $QST_ID, $this->_req_data['question_orders'][ $QST_ID ] ); |
|
627 | + if (isset($this->_req_data['questions'])) { |
|
628 | + foreach ($this->_req_data['questions'] as $QST_ID) { |
|
629 | + $question_group->add_question($QST_ID); |
|
630 | + if (isset($this->_req_data['question_orders'][$QST_ID])) { |
|
631 | + $question_group->update_question_order($QST_ID, $this->_req_data['question_orders'][$QST_ID]); |
|
632 | 632 | } |
633 | 633 | } |
634 | 634 | } |
635 | 635 | |
636 | - if ( $success !== FALSE ) { |
|
637 | - $msg = $new_question_group ? sprintf( esc_html__('The %s has been created', 'event_espresso'), $this->_question_group_model->item_name() ) : sprintf( esc_html__('The %s has been updated', 'event_espresso' ), $this->_question_group_model->item_name() ); |
|
638 | - EE_Error::add_success( $msg ); |
|
636 | + if ($success !== FALSE) { |
|
637 | + $msg = $new_question_group ? sprintf(esc_html__('The %s has been created', 'event_espresso'), $this->_question_group_model->item_name()) : sprintf(esc_html__('The %s has been updated', 'event_espresso'), $this->_question_group_model->item_name()); |
|
638 | + EE_Error::add_success($msg); |
|
639 | 639 | } |
640 | - $this->_redirect_after_action(FALSE, '', '', array('action'=>'edit_question_group','QSG_ID'=>$QSG_ID), TRUE); |
|
640 | + $this->_redirect_after_action(FALSE, '', '', array('action'=>'edit_question_group', 'QSG_ID'=>$QSG_ID), TRUE); |
|
641 | 641 | |
642 | 642 | } |
643 | 643 | |
@@ -645,20 +645,20 @@ discard block |
||
645 | 645 | * duplicates a question and all its question options and redirects to the new question. |
646 | 646 | */ |
647 | 647 | public function _duplicate_question() { |
648 | - $question_ID = (int)$this->_req_data[ 'QST_ID' ]; |
|
649 | - $question = EEM_Question::instance()->get_one_by_ID( $question_ID ); |
|
650 | - if( $question instanceof EE_Question ) { |
|
648 | + $question_ID = (int) $this->_req_data['QST_ID']; |
|
649 | + $question = EEM_Question::instance()->get_one_by_ID($question_ID); |
|
650 | + if ($question instanceof EE_Question) { |
|
651 | 651 | $new_question = $question->duplicate(); |
652 | - if( $new_question instanceof EE_Question ) { |
|
653 | - $this->_redirect_after_action( true, esc_html__( 'Question', 'event_espresso' ), esc_html__( 'Duplicated', 'event_espresso' ), array('action'=>'edit_question', 'QST_ID' => $new_question->ID() ), TRUE); |
|
652 | + if ($new_question instanceof EE_Question) { |
|
653 | + $this->_redirect_after_action(true, esc_html__('Question', 'event_espresso'), esc_html__('Duplicated', 'event_espresso'), array('action'=>'edit_question', 'QST_ID' => $new_question->ID()), TRUE); |
|
654 | 654 | } else { |
655 | 655 | global $wpdb; |
656 | - EE_Error::add_error( sprintf( esc_html__( 'Could not duplicate question with ID %1$d because: %2$s', 'event_espresso' ), $question_ID, $wpdb->last_error ), __FILE__, __FUNCTION__, __LINE__ ); |
|
657 | - $this->_redirect_after_action(false, '', '', array('action'=>'default'), false ); |
|
656 | + EE_Error::add_error(sprintf(esc_html__('Could not duplicate question with ID %1$d because: %2$s', 'event_espresso'), $question_ID, $wpdb->last_error), __FILE__, __FUNCTION__, __LINE__); |
|
657 | + $this->_redirect_after_action(false, '', '', array('action'=>'default'), false); |
|
658 | 658 | } |
659 | 659 | } else { |
660 | - EE_Error::add_error( sprintf( esc_html__( 'Could not duplicate question with ID %d because it didn\'t exist!', 'event_espresso' ), $question_ID ), __FILE__, __FUNCTION__, __LINE__ ); |
|
661 | - $this->_redirect_after_action( false, '', '', array( 'action' => 'default' ), false ); |
|
660 | + EE_Error::add_error(sprintf(esc_html__('Could not duplicate question with ID %d because it didn\'t exist!', 'event_espresso'), $question_ID), __FILE__, __FUNCTION__, __LINE__); |
|
661 | + $this->_redirect_after_action(false, '', '', array('action' => 'default'), false); |
|
662 | 662 | } |
663 | 663 | } |
664 | 664 | |
@@ -667,8 +667,8 @@ discard block |
||
667 | 667 | /** |
668 | 668 | * @param bool $trash |
669 | 669 | */ |
670 | - protected function _trash_or_restore_question_groups( $trash = TRUE) { |
|
671 | - $this->_trash_or_restore_items( $this->_question_group_model, $trash ); |
|
670 | + protected function _trash_or_restore_question_groups($trash = TRUE) { |
|
671 | + $this->_trash_or_restore_items($this->_question_group_model, $trash); |
|
672 | 672 | } |
673 | 673 | |
674 | 674 | |
@@ -676,9 +676,9 @@ discard block |
||
676 | 676 | /** |
677 | 677 | *_trash_question |
678 | 678 | */ |
679 | - protected function _trash_question(){ |
|
680 | - $success=$this->_question_model->delete_by_ID( (int)$this->_req_data['QST_ID'] ); |
|
681 | - $query_args=array('action'=>'default','status'=>'all'); |
|
679 | + protected function _trash_question() { |
|
680 | + $success = $this->_question_model->delete_by_ID((int) $this->_req_data['QST_ID']); |
|
681 | + $query_args = array('action'=>'default', 'status'=>'all'); |
|
682 | 682 | $this->_redirect_after_action($success, $this->_question_model->item_name($success), 'trashed', $query_args); |
683 | 683 | } |
684 | 684 | |
@@ -687,8 +687,8 @@ discard block |
||
687 | 687 | /** |
688 | 688 | * @param bool $trash |
689 | 689 | */ |
690 | - protected function _trash_or_restore_questions( $trash=TRUE){ |
|
691 | - $this->_trash_or_restore_items( $this->_question_model, $trash ); |
|
690 | + protected function _trash_or_restore_questions($trash = TRUE) { |
|
691 | + $this->_trash_or_restore_items($this->_question_model, $trash); |
|
692 | 692 | } |
693 | 693 | |
694 | 694 | |
@@ -700,21 +700,21 @@ discard block |
||
700 | 700 | *@param EEM_Soft_Delete_Base $model |
701 | 701 | * @param boolean $trash whether to trash or restore |
702 | 702 | */ |
703 | - private function _trash_or_restore_items( EEM_Soft_Delete_Base $model, $trash = TRUE ) { |
|
703 | + private function _trash_or_restore_items(EEM_Soft_Delete_Base $model, $trash = TRUE) { |
|
704 | 704 | |
705 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
705 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
706 | 706 | |
707 | 707 | $success = 1; |
708 | 708 | //Checkboxes |
709 | 709 | //echo "trash $trash"; |
710 | 710 | //var_dump($this->_req_data['checkbox']);die; |
711 | - if ( isset( $this->_req_data['checkbox'] )) { |
|
712 | - if ( ! empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] )) { |
|
711 | + if (isset($this->_req_data['checkbox'])) { |
|
712 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
713 | 713 | // if array has more than one element than success message should be plural |
714 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
714 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
715 | 715 | // cycle thru bulk action checkboxes |
716 | - while (list( $ID, $value ) = each($this->_req_data['checkbox'])) { |
|
717 | - if ( ! $model->delete_or_restore_by_ID($trash,absint($ID))) { |
|
716 | + while (list($ID, $value) = each($this->_req_data['checkbox'])) { |
|
717 | + if ( ! $model->delete_or_restore_by_ID($trash, absint($ID))) { |
|
718 | 718 | $success = 0; |
719 | 719 | } |
720 | 720 | } |
@@ -722,7 +722,7 @@ discard block |
||
722 | 722 | } else { |
723 | 723 | // grab single id and delete |
724 | 724 | $ID = absint($this->_req_data['checkbox']); |
725 | - if ( ! $model->delete_or_restore_by_ID($trash,$ID)) { |
|
725 | + if ( ! $model->delete_or_restore_by_ID($trash, $ID)) { |
|
726 | 726 | $success = 0; |
727 | 727 | } |
728 | 728 | } |
@@ -730,25 +730,25 @@ discard block |
||
730 | 730 | } else { |
731 | 731 | // delete via trash link |
732 | 732 | // grab single id and delete |
733 | - $ID = absint($this->_req_data[ $model->primary_key_name() ]); |
|
734 | - if ( ! $model->delete_or_restore_by_ID($trash,$ID)) { |
|
733 | + $ID = absint($this->_req_data[$model->primary_key_name()]); |
|
734 | + if ( ! $model->delete_or_restore_by_ID($trash, $ID)) { |
|
735 | 735 | $success = 0; |
736 | 736 | } |
737 | 737 | |
738 | 738 | } |
739 | 739 | |
740 | 740 | |
741 | - $action = $model instanceof EEM_Question ? 'default' : 'question_groups';//strtolower( $model->item_name(2) ); |
|
741 | + $action = $model instanceof EEM_Question ? 'default' : 'question_groups'; //strtolower( $model->item_name(2) ); |
|
742 | 742 | //echo "action :$action"; |
743 | 743 | //$action = 'questions' ? 'default' : $action; |
744 | - if($trash){ |
|
744 | + if ($trash) { |
|
745 | 745 | $action_desc = 'trashed'; |
746 | 746 | $status = 'trash'; |
747 | - }else{ |
|
747 | + } else { |
|
748 | 748 | $action_desc = 'restored'; |
749 | 749 | $status = 'all'; |
750 | 750 | } |
751 | - $this->_redirect_after_action( $success, $model->item_name($success), $action_desc, array( 'action' => $action, 'status'=>$status ) ); |
|
751 | + $this->_redirect_after_action($success, $model->item_name($success), $action_desc, array('action' => $action, 'status'=>$status)); |
|
752 | 752 | } |
753 | 753 | |
754 | 754 | |
@@ -759,16 +759,16 @@ discard block |
||
759 | 759 | * @param bool|false $count |
760 | 760 | * @return \EE_Soft_Delete_Base_Class[]|int |
761 | 761 | */ |
762 | - public function get_trashed_questions( $per_page, $current_page = 1, $count = FALSE ) { |
|
762 | + public function get_trashed_questions($per_page, $current_page = 1, $count = FALSE) { |
|
763 | 763 | $query_params = $this->get_query_params(EEM_Question::instance(), $per_page, $current_page); |
764 | 764 | |
765 | - if( $count ){ |
|
765 | + if ($count) { |
|
766 | 766 | //note: this a subclass of EEM_Soft_Delete_Base, so this is actually only getting non-trashed items |
767 | - $where = isset( $query_params[0] ) ? array( $query_params[0] ) : array(); |
|
768 | - $results=$this->_question_model->count_deleted($where); |
|
769 | - }else{ |
|
767 | + $where = isset($query_params[0]) ? array($query_params[0]) : array(); |
|
768 | + $results = $this->_question_model->count_deleted($where); |
|
769 | + } else { |
|
770 | 770 | //note: this a subclass of EEM_Soft_Delete_Base, so this is actually only getting non-trashed items |
771 | - $results=$this->_question_model->get_all_deleted($query_params); |
|
771 | + $results = $this->_question_model->get_all_deleted($query_params); |
|
772 | 772 | } |
773 | 773 | return $results; |
774 | 774 | } |
@@ -781,13 +781,13 @@ discard block |
||
781 | 781 | * @param bool|false $count |
782 | 782 | * @return \EE_Soft_Delete_Base_Class[] |
783 | 783 | */ |
784 | - public function get_question_groups( $per_page, $current_page = 1, $count = FALSE ) { |
|
785 | - $questionGroupModel=EEM_Question_Group::instance(); |
|
786 | - $query_params=$this->get_query_params($questionGroupModel,$per_page,$current_page); |
|
787 | - if ($count){ |
|
788 | - $where = isset( $query_params[0] ) ? array( $query_params[0] ) : array(); |
|
784 | + public function get_question_groups($per_page, $current_page = 1, $count = FALSE) { |
|
785 | + $questionGroupModel = EEM_Question_Group::instance(); |
|
786 | + $query_params = $this->get_query_params($questionGroupModel, $per_page, $current_page); |
|
787 | + if ($count) { |
|
788 | + $where = isset($query_params[0]) ? array($query_params[0]) : array(); |
|
789 | 789 | $results = $questionGroupModel->count($where); |
790 | - }else{ |
|
790 | + } else { |
|
791 | 791 | $results = $questionGroupModel->get_all($query_params); |
792 | 792 | } |
793 | 793 | return $results; |
@@ -801,14 +801,14 @@ discard block |
||
801 | 801 | * @param bool $count |
802 | 802 | * @return \EE_Soft_Delete_Base_Class[]|int |
803 | 803 | */ |
804 | - public function get_trashed_question_groups( $per_page, $current_page = 1, $count = FALSE ) { |
|
805 | - $questionGroupModel=EEM_Question_Group::instance(); |
|
806 | - $query_params=$this->get_query_params($questionGroupModel,$per_page,$current_page); |
|
807 | - if($count){ |
|
808 | - $where = isset( $query_params[0] ) ? array($query_params[0]) : array(); |
|
804 | + public function get_trashed_question_groups($per_page, $current_page = 1, $count = FALSE) { |
|
805 | + $questionGroupModel = EEM_Question_Group::instance(); |
|
806 | + $query_params = $this->get_query_params($questionGroupModel, $per_page, $current_page); |
|
807 | + if ($count) { |
|
808 | + $where = isset($query_params[0]) ? array($query_params[0]) : array(); |
|
809 | 809 | $query_params['limit'] = NULL; |
810 | 810 | $results = $questionGroupModel->count_deleted($where); |
811 | - }else{ |
|
811 | + } else { |
|
812 | 812 | $results = $questionGroupModel->get_all_deleted($query_params); |
813 | 813 | } |
814 | 814 | return $results; |
@@ -821,32 +821,32 @@ discard block |
||
821 | 821 | */ |
822 | 822 | public function update_question_group_order() { |
823 | 823 | |
824 | - $success = esc_html__( 'Question group order was updated successfully.', 'event_espresso' ); |
|
824 | + $success = esc_html__('Question group order was updated successfully.', 'event_espresso'); |
|
825 | 825 | |
826 | 826 | // grab our row IDs |
827 | - $row_ids = isset( $this->_req_data['row_ids'] ) && ! empty( $this->_req_data['row_ids'] ) |
|
828 | - ? explode( ',', rtrim( $this->_req_data['row_ids'], ',' )) |
|
827 | + $row_ids = isset($this->_req_data['row_ids']) && ! empty($this->_req_data['row_ids']) |
|
828 | + ? explode(',', rtrim($this->_req_data['row_ids'], ',')) |
|
829 | 829 | : array(); |
830 | 830 | |
831 | - $perpage = !empty( $this->_req_data['perpage'] ) |
|
831 | + $perpage = ! empty($this->_req_data['perpage']) |
|
832 | 832 | ? (int) $this->_req_data['perpage'] |
833 | 833 | : NULL; |
834 | - $curpage = !empty( $this->_req_data['curpage'] ) |
|
834 | + $curpage = ! empty($this->_req_data['curpage']) |
|
835 | 835 | ? (int) $this->_req_data['curpage'] |
836 | 836 | : NULL; |
837 | 837 | |
838 | - if ( ! empty( $row_ids ) ) { |
|
838 | + if ( ! empty($row_ids)) { |
|
839 | 839 | //figure out where we start the row_id count at for the current page. |
840 | - $qsgcount = empty( $curpage ) ? 0 : ($curpage - 1 ) * $perpage; |
|
840 | + $qsgcount = empty($curpage) ? 0 : ($curpage - 1) * $perpage; |
|
841 | 841 | |
842 | - $row_count = count( $row_ids ); |
|
843 | - for( $i = 0; $i < $row_count; $i++ ) { |
|
842 | + $row_count = count($row_ids); |
|
843 | + for ($i = 0; $i < $row_count; $i++) { |
|
844 | 844 | //Update the questions when re-ordering |
845 | 845 | $updated = EEM_Question_Group::instance()->update( |
846 | - array( 'QSG_order' => $qsgcount ), |
|
847 | - array( array( 'QSG_ID' => $row_ids[ $i ] ) ) |
|
846 | + array('QSG_order' => $qsgcount), |
|
847 | + array(array('QSG_ID' => $row_ids[$i])) |
|
848 | 848 | ); |
849 | - if ( $updated === false ) { |
|
849 | + if ($updated === false) { |
|
850 | 850 | $success = false; |
851 | 851 | } |
852 | 852 | $qsgcount++; |
@@ -856,10 +856,10 @@ discard block |
||
856 | 856 | } |
857 | 857 | |
858 | 858 | $errors = ! $success |
859 | - ? esc_html__( 'An error occurred. The question group order was not updated.', 'event_espresso' ) |
|
859 | + ? esc_html__('An error occurred. The question group order was not updated.', 'event_espresso') |
|
860 | 860 | : false; |
861 | 861 | |
862 | - echo json_encode( array( 'return_data' => false, 'success' => $success, 'errors' => $errors )); |
|
862 | + echo json_encode(array('return_data' => false, 'success' => $success, 'errors' => $errors)); |
|
863 | 863 | die(); |
864 | 864 | |
865 | 865 | } |
@@ -878,17 +878,17 @@ discard block |
||
878 | 878 | $this->_template_args['values'] = $this->_yes_no_values; |
879 | 879 | add_action( |
880 | 880 | 'AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template', |
881 | - array( $this, 'email_validation_settings_form' ), |
|
881 | + array($this, 'email_validation_settings_form'), |
|
882 | 882 | 2 |
883 | 883 | ); |
884 | - $this->_template_args = (array)apply_filters( |
|
884 | + $this->_template_args = (array) apply_filters( |
|
885 | 885 | 'FHEE__Extend_Registration_Form_Admin_Page___reg_form_settings___template_args', |
886 | 886 | $this->_template_args |
887 | 887 | ); |
888 | - $this->_set_add_edit_form_tags( 'update_reg_form_settings' ); |
|
889 | - $this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE ); |
|
888 | + $this->_set_add_edit_form_tags('update_reg_form_settings'); |
|
889 | + $this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE); |
|
890 | 890 | $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
891 | - REGISTRATION_FORM_CAF_TEMPLATE_PATH . 'reg_form_settings.template.php', |
|
891 | + REGISTRATION_FORM_CAF_TEMPLATE_PATH.'reg_form_settings.template.php', |
|
892 | 892 | $this->_template_args, |
893 | 893 | TRUE |
894 | 894 | ); |
@@ -909,7 +909,7 @@ discard block |
||
909 | 909 | EE_Registry::instance()->CFG, |
910 | 910 | __FILE__, __FUNCTION__, __LINE__ |
911 | 911 | ); |
912 | - $this->_redirect_after_action( $success, esc_html__('Registration Form Options', 'event_espresso'), 'updated', array( 'action' => 'view_reg_form_settings' ) ); |
|
912 | + $this->_redirect_after_action($success, esc_html__('Registration Form Options', 'event_espresso'), 'updated', array('action' => 'view_reg_form_settings')); |
|
913 | 913 | } |
914 | 914 | |
915 | 915 | |
@@ -940,20 +940,20 @@ discard block |
||
940 | 940 | 'layout_strategy' => new EE_Admin_Two_Column_Layout(), |
941 | 941 | 'subsections' => array( |
942 | 942 | 'email_validation_hdr' => new EE_Form_Section_HTML( |
943 | - EEH_HTML::h2( esc_html__( 'Email Validation Settings', 'event_espresso' ) ) |
|
943 | + EEH_HTML::h2(esc_html__('Email Validation Settings', 'event_espresso')) |
|
944 | 944 | ), |
945 | 945 | 'email_validation_level' => new EE_Select_Input( |
946 | 946 | array( |
947 | - 'basic' => esc_html__( 'Basic', 'event_espresso' ), |
|
948 | - 'wp_default' => esc_html__( 'WordPress Default', 'event_espresso' ), |
|
949 | - 'i18n' => esc_html__( 'International', 'event_espresso' ), |
|
950 | - 'i18n_dns' => esc_html__( 'International + DNS Check', 'event_espresso' ), |
|
947 | + 'basic' => esc_html__('Basic', 'event_espresso'), |
|
948 | + 'wp_default' => esc_html__('WordPress Default', 'event_espresso'), |
|
949 | + 'i18n' => esc_html__('International', 'event_espresso'), |
|
950 | + 'i18n_dns' => esc_html__('International + DNS Check', 'event_espresso'), |
|
951 | 951 | ), |
952 | 952 | array( |
953 | - 'html_label_text' => esc_html__( 'Email Validation Level', 'event_espresso' ) |
|
954 | - . EEH_Template::get_help_tab_link( 'email_validation_info' ), |
|
955 | - 'html_help_text' => esc_html__( 'These levels range from basic validation ( ie: [email protected] ) to more advanced checks against international email addresses (ie: üñîçøðé@example.com ) with additional MX and A record checks to confirm the domain actually exists. More information on on each level can be found within the help section.', 'event_espresso'), |
|
956 | - 'default' => isset( EE_Registry::instance()->CFG->registration->email_validation_level ) |
|
953 | + 'html_label_text' => esc_html__('Email Validation Level', 'event_espresso') |
|
954 | + . EEH_Template::get_help_tab_link('email_validation_info'), |
|
955 | + 'html_help_text' => esc_html__('These levels range from basic validation ( ie: [email protected] ) to more advanced checks against international email addresses (ie: üñîçøðé@example.com ) with additional MX and A record checks to confirm the domain actually exists. More information on on each level can be found within the help section.', 'event_espresso'), |
|
956 | + 'default' => isset(EE_Registry::instance()->CFG->registration->email_validation_level) |
|
957 | 957 | ? EE_Registry::instance()->CFG->registration->email_validation_level |
958 | 958 | : 'wp_default', |
959 | 959 | 'required' => false |
@@ -972,25 +972,25 @@ discard block |
||
972 | 972 | * @param \EE_Registration_Config $EE_Registration_Config |
973 | 973 | * @return \EE_Registration_Config |
974 | 974 | */ |
975 | - public function update_email_validation_settings_form( EE_Registration_Config $EE_Registration_Config ) { |
|
975 | + public function update_email_validation_settings_form(EE_Registration_Config $EE_Registration_Config) { |
|
976 | 976 | $prev_email_validation_level = $EE_Registration_Config->email_validation_level; |
977 | 977 | try { |
978 | 978 | $email_validation_settings_form = $this->_email_validation_settings_form(); |
979 | 979 | // if not displaying a form, then check for form submission |
980 | - if ( $email_validation_settings_form->was_submitted() ) { |
|
980 | + if ($email_validation_settings_form->was_submitted()) { |
|
981 | 981 | // capture form data |
982 | 982 | $email_validation_settings_form->receive_form_submission(); |
983 | 983 | // validate form data |
984 | - if ( $email_validation_settings_form->is_valid() ) { |
|
984 | + if ($email_validation_settings_form->is_valid()) { |
|
985 | 985 | // grab validated data from form |
986 | 986 | $valid_data = $email_validation_settings_form->valid_data(); |
987 | - if ( isset( $valid_data['email_validation_level'] ) ) { |
|
987 | + if (isset($valid_data['email_validation_level'])) { |
|
988 | 988 | $email_validation_level = $valid_data['email_validation_level']; |
989 | 989 | // now if they want to use international email addresses |
990 | - if ( $email_validation_level === 'i18n' || $email_validation_level === 'i18n_dns' ) { |
|
990 | + if ($email_validation_level === 'i18n' || $email_validation_level === 'i18n_dns') { |
|
991 | 991 | // in case we need to reset their email validation level, |
992 | 992 | // make sure that the previous value wasn't already set to one of the i18n options. |
993 | - if ( $prev_email_validation_level === 'i18n' || $prev_email_validation_level === 'i18n_dns' ) { |
|
993 | + if ($prev_email_validation_level === 'i18n' || $prev_email_validation_level === 'i18n_dns') { |
|
994 | 994 | // if so, then reset it back to "basic" since that is the only other option that, |
995 | 995 | // despite offering poor validation, supports i18n email addresses |
996 | 996 | $prev_email_validation_level = 'basic'; |
@@ -1012,7 +1012,7 @@ discard block |
||
1012 | 1012 | ); |
1013 | 1013 | } |
1014 | 1014 | } else { |
1015 | - if ( $email_validation_settings_form->submission_error_message() !== '' ) { |
|
1015 | + if ($email_validation_settings_form->submission_error_message() !== '') { |
|
1016 | 1016 | EE_Error::add_error( |
1017 | 1017 | $email_validation_settings_form->submission_error_message(), |
1018 | 1018 | __FILE__, __FUNCTION__, __LINE__ |
@@ -1020,7 +1020,7 @@ discard block |
||
1020 | 1020 | } |
1021 | 1021 | } |
1022 | 1022 | } |
1023 | - } catch ( EE_Error $e ) { |
|
1023 | + } catch (EE_Error $e) { |
|
1024 | 1024 | $e->get_error(); |
1025 | 1025 | } |
1026 | 1026 | return $EE_Registration_Config; |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | $ticket_details_css_id = apply_filters( |
99 | - 'FHEE__ticket_selector_chart_template__ticket_details_css_id', |
|
100 | - "tckt-slctr-tkt-details-{$EVT_ID}-{$TKT_ID}" |
|
101 | - ); |
|
99 | + 'FHEE__ticket_selector_chart_template__ticket_details_css_id', |
|
100 | + "tckt-slctr-tkt-details-{$EVT_ID}-{$TKT_ID}" |
|
101 | + ); |
|
102 | 102 | ?> |
103 | 103 | <tr class="tckt-slctr-tbl-tr <?php echo $status_class . ' ' . espresso_get_object_css_class( $ticket ); ?>"> |
104 | 104 | <?php |
@@ -469,13 +469,13 @@ discard block |
||
469 | 469 | <th scope="col" class="ee-ticket-selector-ticket-qty-th cntr"> |
470 | 470 | <?php |
471 | 471 | /** |
472 | - * Filters the text printed for the header of the quantity column in the ticket selector table |
|
473 | - * |
|
474 | - * @since 4.7.2 |
|
475 | - * |
|
476 | - * @param string 'Qty*' The translatable text to display in the table header for the Quantity of tickets |
|
477 | - * @param int $EVT_ID The Event ID |
|
478 | - */ |
|
472 | + * Filters the text printed for the header of the quantity column in the ticket selector table |
|
473 | + * |
|
474 | + * @since 4.7.2 |
|
475 | + * |
|
476 | + * @param string 'Qty*' The translatable text to display in the table header for the Quantity of tickets |
|
477 | + * @param int $EVT_ID The Event ID |
|
478 | + */ |
|
479 | 479 | echo esc_html( apply_filters( 'FHEE__ticket_selector_chart_template__table_header_qty', __( 'Qty*', 'event_espresso' ), $EVT_ID ) ); |
480 | 480 | ?> |
481 | 481 | </th> |
@@ -8,32 +8,32 @@ discard block |
||
8 | 8 | |
9 | 9 | $row = 1; |
10 | 10 | $max = 1; |
11 | -$ticket_count = count( $tickets ); |
|
11 | +$ticket_count = count($tickets); |
|
12 | 12 | |
13 | -if ( ! $ticket_count ) { |
|
13 | +if ( ! $ticket_count) { |
|
14 | 14 | return; |
15 | 15 | } |
16 | 16 | |
17 | 17 | $required_ticket_sold_out = FALSE; |
18 | -$template_settings = isset ( EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector ) ? EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector : new EE_Ticket_Selector_Config(); |
|
18 | +$template_settings = isset (EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector) ? EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector : new EE_Ticket_Selector_Config(); |
|
19 | 19 | ob_start(); |
20 | 20 | |
21 | -foreach ( $tickets as $TKT_ID => $ticket ) { |
|
22 | - if ( $ticket instanceof EE_Ticket ) { |
|
21 | +foreach ($tickets as $TKT_ID => $ticket) { |
|
22 | + if ($ticket instanceof EE_Ticket) { |
|
23 | 23 | // d( $ticket ); |
24 | - $max =$ticket->max(); |
|
24 | + $max = $ticket->max(); |
|
25 | 25 | $min = 0; |
26 | 26 | $remaining = $ticket->remaining(); |
27 | - if ( $ticket->is_on_sale() && $ticket->is_remaining() ) { |
|
27 | + if ($ticket->is_on_sale() && $ticket->is_remaining()) { |
|
28 | 28 | // offer the number of $tickets_remaining or $max_atndz, whichever is smaller |
29 | - $max = min( $remaining, $max_atndz ); |
|
29 | + $max = min($remaining, $max_atndz); |
|
30 | 30 | // but... we also want to restrict the number of tickets by the ticket max setting, |
31 | 31 | // however, the max still can't be higher than what was just set above |
32 | - $max = $ticket->max() > 0 ? min( $ticket->max(), $max ) : $max; |
|
32 | + $max = $ticket->max() > 0 ? min($ticket->max(), $max) : $max; |
|
33 | 33 | // and we also want to restrict the minimum number of tickets by the ticket min setting |
34 | 34 | $min = $ticket->min() > 0 ? $ticket->min() : 0; |
35 | 35 | // and if the ticket is required, then make sure that min qty is at least 1 |
36 | - $min = $ticket->required() ? max( $min, 1 ) : $min; |
|
36 | + $min = $ticket->required() ? max($min, 1) : $min; |
|
37 | 37 | } else { |
38 | 38 | // set flag if ticket is required (flag is set to start date so that future tickets are not blocked) |
39 | 39 | $required_ticket_sold_out = $ticket->required() && ! $remaining ? $ticket->start_date() : $required_ticket_sold_out; |
@@ -42,40 +42,40 @@ discard block |
||
42 | 42 | $ticket_price = $ticket->get_ticket_total_with_taxes(); |
43 | 43 | $ticket_bundle = FALSE; |
44 | 44 | // for ticket bundles, set min and max qty the same |
45 | - if ( $ticket->min() != 0 && $ticket->min() == $ticket->max() ) { |
|
45 | + if ($ticket->min() != 0 && $ticket->min() == $ticket->max()) { |
|
46 | 46 | $ticket_price = $ticket_price * $ticket->min(); |
47 | 47 | $ticket_bundle = TRUE; |
48 | 48 | } |
49 | - $ticket_price = apply_filters( 'FHEE__ticket_selector_chart_template__ticket_price', $ticket_price, $ticket ); |
|
49 | + $ticket_price = apply_filters('FHEE__ticket_selector_chart_template__ticket_price', $ticket_price, $ticket); |
|
50 | 50 | // if a previous required ticket with the same sale start date is sold out, then mark this ticket as sold out as well. |
51 | 51 | // tickets that go on sale at a later date than the required ticket will NOT be affected |
52 | 52 | $tkt_status = $required_ticket_sold_out !== FALSE && $required_ticket_sold_out === $ticket->start_date() ? EE_Ticket::sold_out : $ticket->ticket_status(); |
53 | 53 | $tkt_status = $event_status === EE_Datetime::sold_out ? EE_Ticket::sold_out : $tkt_status; |
54 | 54 | // check ticket status |
55 | - switch ( $tkt_status ) { |
|
55 | + switch ($tkt_status) { |
|
56 | 56 | // sold_out |
57 | 57 | case EE_Ticket::sold_out : |
58 | - $ticket_status = '<span class="ticket-sales-sold-out">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
58 | + $ticket_status = '<span class="ticket-sales-sold-out">'.$ticket->ticket_status(TRUE).'</span>'; |
|
59 | 59 | $status_class = 'ticket-sales-sold-out lt-grey-text'; |
60 | 60 | break; |
61 | 61 | // expired |
62 | 62 | case EE_Ticket::expired : |
63 | - $ticket_status = '<span class="ticket-sales-expired">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
63 | + $ticket_status = '<span class="ticket-sales-expired">'.$ticket->ticket_status(TRUE).'</span>'; |
|
64 | 64 | $status_class = 'ticket-sales-expired lt-grey-text'; |
65 | 65 | break; |
66 | 66 | // archived |
67 | 67 | case EE_Ticket::archived : |
68 | - $ticket_status = '<span class="archived-ticket">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
68 | + $ticket_status = '<span class="archived-ticket">'.$ticket->ticket_status(TRUE).'</span>'; |
|
69 | 69 | $status_class = 'archived-ticket hidden'; |
70 | 70 | break; |
71 | 71 | // pending |
72 | 72 | case EE_Ticket::pending : |
73 | - $ticket_status = '<span class="ticket-pending">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
73 | + $ticket_status = '<span class="ticket-pending">'.$ticket->ticket_status(TRUE).'</span>'; |
|
74 | 74 | $status_class = 'ticket-pending'; |
75 | 75 | break; |
76 | 76 | // onsale |
77 | 77 | case EE_Ticket::onsale : |
78 | - $ticket_status = '<span class="ticket-on-sale">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
78 | + $ticket_status = '<span class="ticket-on-sale">'.$ticket->ticket_status(TRUE).'</span>'; |
|
79 | 79 | $status_class = 'ticket-on-sale'; |
80 | 80 | break; |
81 | 81 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * |
91 | 91 | * @var string|bool |
92 | 92 | */ |
93 | - if ( false !== ( $new_row_content = apply_filters( 'FHEE__ticket_selector_chart_template__do_ticket_entire_row', false, $ticket, $max, $min, $required_ticket_sold_out, $ticket_price, $ticket_bundle, $ticket_status, $status_class ) ) ) { |
|
93 | + if (false !== ($new_row_content = apply_filters('FHEE__ticket_selector_chart_template__do_ticket_entire_row', false, $ticket, $max, $min, $required_ticket_sold_out, $ticket_price, $ticket_bundle, $ticket_status, $status_class))) { |
|
94 | 94 | echo $new_row_content; |
95 | 95 | continue; |
96 | 96 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | "tckt-slctr-tkt-details-{$EVT_ID}-{$TKT_ID}" |
101 | 101 | ); |
102 | 102 | ?> |
103 | - <tr class="tckt-slctr-tbl-tr <?php echo $status_class . ' ' . espresso_get_object_css_class( $ticket ); ?>"> |
|
103 | + <tr class="tckt-slctr-tbl-tr <?php echo $status_class.' '.espresso_get_object_css_class($ticket); ?>"> |
|
104 | 104 | <?php |
105 | 105 | /** |
106 | 106 | * Allow plugins to hook in and abort the generation and display of the contents of this |
@@ -112,24 +112,24 @@ discard block |
||
112 | 112 | * |
113 | 113 | * @var string|bool |
114 | 114 | */ |
115 | - if ( false !== ( $new_row_cells_content = apply_filters( 'FHEE__ticket_selector_chart_template__do_ticket_inside_row', false, $ticket, $max, $min, $required_ticket_sold_out, $ticket_price, $ticket_bundle, $ticket_status, $status_class ) ) ) { |
|
115 | + if (false !== ($new_row_cells_content = apply_filters('FHEE__ticket_selector_chart_template__do_ticket_inside_row', false, $ticket, $max, $min, $required_ticket_sold_out, $ticket_price, $ticket_bundle, $ticket_status, $status_class))) { |
|
116 | 116 | echo $new_row_cells_content; |
117 | 117 | echo '</tr>'; |
118 | 118 | continue; |
119 | 119 | } |
120 | 120 | ?> |
121 | 121 | <td class="tckt-slctr-tbl-td-name"> |
122 | - <b><?php echo $ticket->get_pretty('TKT_name');?></b> |
|
123 | - <?php if ( $template_settings->show_ticket_details ) : ?> |
|
124 | - <a id="display-<?php echo $ticket_details_css_id; ?>" class="display-tckt-slctr-tkt-details display-the-hidden lt-grey-text smaller-text hide-if-no-js" rel="<?php echo $ticket_details_css_id; ?>" title="<?php echo esc_attr( apply_filters( 'FHEE__ticket_selector_chart_template__show_ticket_details_link_title', __( 'click to show additional ticket details', 'event_espresso' )) ); ?>"> |
|
125 | - <?php echo sprintf( __( 'show%1$sdetails%1$s+', 'event_espresso' ), ' ' ); ?> |
|
122 | + <b><?php echo $ticket->get_pretty('TKT_name'); ?></b> |
|
123 | + <?php if ($template_settings->show_ticket_details) : ?> |
|
124 | + <a id="display-<?php echo $ticket_details_css_id; ?>" class="display-tckt-slctr-tkt-details display-the-hidden lt-grey-text smaller-text hide-if-no-js" rel="<?php echo $ticket_details_css_id; ?>" title="<?php echo esc_attr(apply_filters('FHEE__ticket_selector_chart_template__show_ticket_details_link_title', __('click to show additional ticket details', 'event_espresso'))); ?>"> |
|
125 | + <?php echo sprintf(__('show%1$sdetails%1$s+', 'event_espresso'), ' '); ?> |
|
126 | 126 | </a> |
127 | - <a id="hide-<?php echo $ticket_details_css_id; ?>" class="hide-tckt-slctr-tkt-details hide-the-displayed lt-grey-text smaller-text hide-if-no-js" rel="<?php echo $ticket_details_css_id; ?>" title="<?php echo esc_attr( apply_filters( 'FHEE__ticket_selector_chart_template__hide_ticket_details_link_title', __( 'click to hide additional ticket details', 'event_espresso' )) ); ?>" style="display:none;"> |
|
128 | - <?php echo sprintf( __( 'hide%1$sdetails%1$s-', 'event_espresso' ), ' ' ); ?> |
|
127 | + <a id="hide-<?php echo $ticket_details_css_id; ?>" class="hide-tckt-slctr-tkt-details hide-the-displayed lt-grey-text smaller-text hide-if-no-js" rel="<?php echo $ticket_details_css_id; ?>" title="<?php echo esc_attr(apply_filters('FHEE__ticket_selector_chart_template__hide_ticket_details_link_title', __('click to hide additional ticket details', 'event_espresso'))); ?>" style="display:none;"> |
|
128 | + <?php echo sprintf(__('hide%1$sdetails%1$s-', 'event_espresso'), ' '); ?> |
|
129 | 129 | </a> |
130 | 130 | <?php endif; //end show details check ?> |
131 | - <?php if ( $ticket->required() ) { ?> |
|
132 | - <p class="ticket-required-pg"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_required_message', __( 'This ticket is required and must be purchased.', 'event_espresso' )); ?></p> |
|
131 | + <?php if ($ticket->required()) { ?> |
|
132 | + <p class="ticket-required-pg"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_required_message', __('This ticket is required and must be purchased.', 'event_espresso')); ?></p> |
|
133 | 133 | <?php } ?> |
134 | 134 | <?php |
135 | 135 | // echo '<br/><b>$max_atndz : ' . $max_atndz . '</b>'; |
@@ -143,63 +143,63 @@ discard block |
||
143 | 143 | // echo '<br/><b> $ticket->required() : ' . $ticket->uses() . '</b>'; |
144 | 144 | ?> |
145 | 145 | </td> |
146 | - <?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE )) { ?> |
|
147 | - <td class="tckt-slctr-tbl-td-price jst-rght"><?php echo EEH_Template::format_currency( $ticket_price ); ?> <span class="smaller-text no-bold"><?php |
|
148 | - if ( $ticket_bundle ) { |
|
149 | - echo apply_filters( 'FHEE__ticket_selector_chart_template__per_ticket_bundle_text', __( ' / bundle', 'event_espresso' )); |
|
146 | + <?php if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?> |
|
147 | + <td class="tckt-slctr-tbl-td-price jst-rght"><?php echo EEH_Template::format_currency($ticket_price); ?> <span class="smaller-text no-bold"><?php |
|
148 | + if ($ticket_bundle) { |
|
149 | + echo apply_filters('FHEE__ticket_selector_chart_template__per_ticket_bundle_text', __(' / bundle', 'event_espresso')); |
|
150 | 150 | } else { |
151 | - echo apply_filters( 'FHEE__ticket_selector_chart_template__per_ticket_text', __( '', 'event_espresso' )); |
|
151 | + echo apply_filters('FHEE__ticket_selector_chart_template__per_ticket_text', __('', 'event_espresso')); |
|
152 | 152 | }?></span> </td> |
153 | 153 | <?php } ?> |
154 | 154 | <td class="tckt-slctr-tbl-td-qty cntr"> |
155 | 155 | <?php |
156 | 156 | $hidden_input_qty = $max_atndz > 1 ? TRUE : FALSE; |
157 | 157 | // sold out or other status ? |
158 | - if ( $tkt_status == EE_Ticket::sold_out || $remaining == 0 ) { |
|
158 | + if ($tkt_status == EE_Ticket::sold_out || $remaining == 0) { |
|
159 | 159 | ?> |
160 | - <span class="sold-out"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_sold_out_msg', __( 'Sold Out', 'event_espresso' ));?></span> |
|
160 | + <span class="sold-out"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_sold_out_msg', __('Sold Out', 'event_espresso')); ?></span> |
|
161 | 161 | <?php |
162 | - } else if ( $tkt_status == EE_Ticket::expired || $tkt_status == EE_Ticket::archived ) { |
|
162 | + } else if ($tkt_status == EE_Ticket::expired || $tkt_status == EE_Ticket::archived) { |
|
163 | 163 | echo $ticket_status; |
164 | - } else if ( $tkt_status == EE_Ticket::pending ) { |
|
164 | + } else if ($tkt_status == EE_Ticket::pending) { |
|
165 | 165 | ?> |
166 | 166 | <div class="ticket-pending-pg"> |
167 | - <span class="ticket-pending"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_goes_on_sale_msg', __( 'Goes On Sale', 'event_espresso' )); ?></span><br/> |
|
168 | - <span class="small-text"><?php echo $ticket->get_i18n_datetime( 'TKT_start_date', apply_filters( 'FHEE__EED_Ticket_Selector__display_goes_on_sale__date_format', $date_format ) ); ?></span> |
|
167 | + <span class="ticket-pending"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_goes_on_sale_msg', __('Goes On Sale', 'event_espresso')); ?></span><br/> |
|
168 | + <span class="small-text"><?php echo $ticket->get_i18n_datetime('TKT_start_date', apply_filters('FHEE__EED_Ticket_Selector__display_goes_on_sale__date_format', $date_format)); ?></span> |
|
169 | 169 | </div> |
170 | 170 | <?php |
171 | 171 | // min qty purchasable is less than tickets available |
172 | - } else if ( $ticket->min() > $remaining ) { |
|
172 | + } else if ($ticket->min() > $remaining) { |
|
173 | 173 | ?> |
174 | 174 | <div class="archived-ticket-pg"> |
175 | - <span class="archived-ticket small-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_not_available_msg', __( 'Not Available', 'event_espresso' )); ?></span><br/> |
|
175 | + <span class="archived-ticket small-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_not_available_msg', __('Not Available', 'event_espresso')); ?></span><br/> |
|
176 | 176 | </div> |
177 | 177 | <?php |
178 | 178 | // if only one attendee is allowed to register at a time |
179 | - } else if ( $max_atndz == 1 ) { |
|
179 | + } else if ($max_atndz == 1) { |
|
180 | 180 | // display submit button since we have tickets available |
181 | - add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' ); |
|
181 | + add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true'); |
|
182 | 182 | ?> |
183 | - <input type="radio" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID . '-' . $row; ?>" class="ticket-selector-tbl-qty-slct" value="<?php echo $row . '-'; ?>1" <?php echo $row == 1 ? ' checked="checked"' : ''; ?> title=""/> |
|
183 | + <input type="radio" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID.'-'.$row; ?>" class="ticket-selector-tbl-qty-slct" value="<?php echo $row.'-'; ?>1" <?php echo $row == 1 ? ' checked="checked"' : ''; ?> title=""/> |
|
184 | 184 | <?php |
185 | 185 | $hidden_input_qty = FALSE; |
186 | 186 | |
187 | - } else if ( $max_atndz == 0 ) { |
|
188 | - echo '<span class="sold-out">' . apply_filters( 'FHEE__ticket_selector_chart_template__ticket_closed_msg', __( 'Closed', 'event_espresso' )) . '</span>'; |
|
189 | - } elseif ( $max > 0 ) { |
|
187 | + } else if ($max_atndz == 0) { |
|
188 | + echo '<span class="sold-out">'.apply_filters('FHEE__ticket_selector_chart_template__ticket_closed_msg', __('Closed', 'event_espresso')).'</span>'; |
|
189 | + } elseif ($max > 0) { |
|
190 | 190 | // display submit button since we have tickets available |
191 | - add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' ); |
|
191 | + add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true'); |
|
192 | 192 | |
193 | 193 | ?> |
194 | - <select name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID . '-' . $row; ?>" class="ticket-selector-tbl-qty-slct" title=""> |
|
194 | + <select name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID.'-'.$row; ?>" class="ticket-selector-tbl-qty-slct" title=""> |
|
195 | 195 | <?php |
196 | 196 | // this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased |
197 | - if ( ! $ticket->required() && $min !== 0 ) { |
|
197 | + if ( ! $ticket->required() && $min !== 0) { |
|
198 | 198 | ?> |
199 | 199 | <option value="0"> 0 </option> |
200 | 200 | <?php } |
201 | 201 | // offer ticket quantities from the min to the max |
202 | - for ( $i = $min; $i <= $max; $i++) { |
|
202 | + for ($i = $min; $i <= $max; $i++) { |
|
203 | 203 | ?> |
204 | 204 | <option value="<?php echo $i; ?>"> <?php echo $i; ?> </option> |
205 | 205 | <?php } ?> |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | |
210 | 210 | } |
211 | 211 | // depending on group reg we need to change the format for qty |
212 | - if ( $hidden_input_qty ) { |
|
212 | + if ($hidden_input_qty) { |
|
213 | 213 | ?> |
214 | 214 | <input type="hidden" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" value="0" /> |
215 | 215 | <?php |
@@ -219,33 +219,33 @@ discard block |
||
219 | 219 | |
220 | 220 | </td> |
221 | 221 | </tr> |
222 | - <?php if ( $template_settings->show_ticket_details ) : ?> |
|
223 | - <tr class="tckt-slctr-tkt-details-tr <?php echo espresso_get_object_css_class( $ticket, '', 'details' );?>"> |
|
222 | + <?php if ($template_settings->show_ticket_details) : ?> |
|
223 | + <tr class="tckt-slctr-tkt-details-tr <?php echo espresso_get_object_css_class($ticket, '', 'details'); ?>"> |
|
224 | 224 | <td class="tckt-slctr-tkt-details-td" colspan="3" > |
225 | 225 | <div id="<?php echo $ticket_details_css_id; ?>-dv" class="tckt-slctr-tkt-details-dv" style="display: none;"> |
226 | 226 | |
227 | 227 | <section class="tckt-slctr-tkt-details-sctn"> |
228 | - <h3><?php _e( 'Details', 'event_espresso' ); ?></h3> |
|
228 | + <h3><?php _e('Details', 'event_espresso'); ?></h3> |
|
229 | 229 | <p><?php echo $ticket->description(); ?></p> |
230 | 230 | |
231 | - <?php if ( $ticket_price != 0 && apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE )) { ?> |
|
231 | + <?php if ($ticket_price != 0 && apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?> |
|
232 | 232 | <section class="tckt-slctr-tkt-price-sctn"> |
233 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading', __( 'Price', 'event_espresso' )); ?></h5> |
|
233 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading', __('Price', 'event_espresso')); ?></h5> |
|
234 | 234 | <div class="tckt-slctr-tkt-details-tbl-wrap-dv"> |
235 | 235 | <table class="tckt-slctr-tkt-details-tbl"> |
236 | 236 | <thead> |
237 | 237 | <tr> |
238 | - <th class="ee-third-width"><span class="small-text"><?php _e( 'Name', 'event_espresso' ); ?></span></th> |
|
239 | - <th class="jst-cntr"><span class="small-text"><?php _e( 'Description', 'event_espresso' ); ?></span></th> |
|
240 | - <th class="ee-fourth-width jst-rght"><span class="small-text"><?php _e( 'Amount', 'event_espresso' ); ?></span></th> |
|
238 | + <th class="ee-third-width"><span class="small-text"><?php _e('Name', 'event_espresso'); ?></span></th> |
|
239 | + <th class="jst-cntr"><span class="small-text"><?php _e('Description', 'event_espresso'); ?></span></th> |
|
240 | + <th class="ee-fourth-width jst-rght"><span class="small-text"><?php _e('Amount', 'event_espresso'); ?></span></th> |
|
241 | 241 | </tr> |
242 | 242 | </thead> |
243 | 243 | <tbody> |
244 | - <?php if ( $ticket->base_price() instanceof EE_Price ) { ?> |
|
244 | + <?php if ($ticket->base_price() instanceof EE_Price) { ?> |
|
245 | 245 | <tr> |
246 | - <td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="small-text"><b><?php echo $ticket->base_price()->name(); ?></b></td> |
|
247 | - <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="small-text"><?php echo $ticket->base_price()->desc(); ?></td> |
|
248 | - <td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $ticket->base_price()->pretty_price(); ?></td> |
|
246 | + <td data-th="<?php _e('Name', 'event_espresso'); ?>" class="small-text"><b><?php echo $ticket->base_price()->name(); ?></b></td> |
|
247 | + <td data-th="<?php _e('Description', 'event_espresso'); ?>" class="small-text"><?php echo $ticket->base_price()->desc(); ?></td> |
|
248 | + <td data-th="<?php _e('Amount', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $ticket->base_price()->pretty_price(); ?></td> |
|
249 | 249 | </tr> |
250 | 250 | <?php |
251 | 251 | $running_total = $ticket->base_price()->amount(); |
@@ -253,44 +253,44 @@ discard block |
||
253 | 253 | $running_total = 0; |
254 | 254 | } |
255 | 255 | // now add price modifiers |
256 | - foreach ( $ticket->price_modifiers() as $price_mod ) { ?> |
|
256 | + foreach ($ticket->price_modifiers() as $price_mod) { ?> |
|
257 | 257 | <tr> |
258 | - <td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $price_mod->name(); ?></td> |
|
259 | - <?php if ( $price_mod->is_percent() ) { ?> |
|
260 | - <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="small-text"><?php echo $price_mod->desc(); ?> <?php echo $price_mod->amount(); ?>%</td> |
|
258 | + <td data-th="<?php _e('Name', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $price_mod->name(); ?></td> |
|
259 | + <?php if ($price_mod->is_percent()) { ?> |
|
260 | + <td data-th="<?php _e('Description', 'event_espresso'); ?>" class="small-text"><?php echo $price_mod->desc(); ?> <?php echo $price_mod->amount(); ?>%</td> |
|
261 | 261 | <?php |
262 | - $new_sub_total = $running_total * ( $price_mod->amount() / 100 ); |
|
262 | + $new_sub_total = $running_total * ($price_mod->amount() / 100); |
|
263 | 263 | $new_sub_total = $price_mod->is_discount() ? $new_sub_total * -1 : $new_sub_total; |
264 | 264 | ?> |
265 | 265 | <?php } else { ?> |
266 | 266 | <?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1 : $price_mod->amount(); ?> |
267 | - <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="small-text"><?php echo $price_mod->desc(); ?></td> |
|
267 | + <td data-th="<?php _e('Description', 'event_espresso'); ?>" class="small-text"><?php echo $price_mod->desc(); ?></td> |
|
268 | 268 | <?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1 : $price_mod->amount(); ?> |
269 | 269 | <?php } ?> |
270 | - <td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency( $new_sub_total ); ?></td> |
|
270 | + <td data-th="<?php _e('Amount', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency($new_sub_total); ?></td> |
|
271 | 271 | <?php $running_total += $new_sub_total; ?> |
272 | 272 | </tr> |
273 | 273 | <?php } ?> |
274 | - <?php if ( $ticket->taxable() ) { ?> |
|
274 | + <?php if ($ticket->taxable()) { ?> |
|
275 | 275 | <?php //$ticket_subtotal =$ticket->get_ticket_subtotal(); ?> |
276 | 276 | <tr> |
277 | - <td colspan="2" class="jst-rght small-text sbttl"><b><?php _e( 'subtotal', 'event_espresso' ); ?></b></td> |
|
278 | - <td data-th="<?php _e( 'subtotal', 'event_espresso' ); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency( $running_total ); ?></b></td> |
|
277 | + <td colspan="2" class="jst-rght small-text sbttl"><b><?php _e('subtotal', 'event_espresso'); ?></b></td> |
|
278 | + <td data-th="<?php _e('subtotal', 'event_espresso'); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency($running_total); ?></b></td> |
|
279 | 279 | </tr> |
280 | 280 | |
281 | - <?php foreach ( $ticket->get_ticket_taxes_for_admin() as $tax ) { ?> |
|
281 | + <?php foreach ($ticket->get_ticket_taxes_for_admin() as $tax) { ?> |
|
282 | 282 | <tr> |
283 | - <td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $tax->name(); ?></td> |
|
284 | - <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $tax->amount(); ?>%</td> |
|
285 | - <?php $tax_amount = $running_total * ( $tax->amount() / 100 ); ?> |
|
286 | - <td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency( $tax_amount ); ?></td> |
|
283 | + <td data-th="<?php _e('Name', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $tax->name(); ?></td> |
|
284 | + <td data-th="<?php _e('Description', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $tax->amount(); ?>%</td> |
|
285 | + <?php $tax_amount = $running_total * ($tax->amount() / 100); ?> |
|
286 | + <td data-th="<?php _e('Amount', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency($tax_amount); ?></td> |
|
287 | 287 | <?php $running_total += $tax_amount; ?> |
288 | 288 | </tr> |
289 | 289 | <?php } ?> |
290 | 290 | <?php } ?> |
291 | 291 | <tr> |
292 | - <td colspan="2" class="jst-rght small-text ttl-lbl-td"><b><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_total_price', __( 'Total', 'event_espresso' )); ?></b></td> |
|
293 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_total_price', __( 'Total', 'event_espresso' )); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency( $running_total ); ?></b></td> |
|
292 | + <td colspan="2" class="jst-rght small-text ttl-lbl-td"><b><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_total_price', __('Total', 'event_espresso')); ?></b></td> |
|
293 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_total_price', __('Total', 'event_espresso')); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency($running_total); ?></b></td> |
|
294 | 294 | </tr> |
295 | 295 | </tbody> |
296 | 296 | </table> |
@@ -300,106 +300,106 @@ discard block |
||
300 | 300 | <?php } ?> |
301 | 301 | |
302 | 302 | <section class="tckt-slctr-tkt-sale-dates-sctn"> |
303 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading', __( 'Sale Dates', 'event_espresso' )); ?></h5> |
|
304 | - <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message', __( 'The dates when this option is available for purchase.', 'event_espresso' )); ?></span><br/> |
|
305 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale', __( 'Goes On Sale:', 'event_espresso' )); ?></span><span class="dashicons dashicons-calendar"></span><?php echo $ticket->get_i18n_datetime( 'TKT_start_date', $date_format) . ' '; ?><span class="dashicons dashicons-clock"></span><?php echo $ticket->get_i18n_datetime( 'TKT_start_date', $time_format ) ; ?><br/> |
|
306 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_sales_end', __( 'Sales End:', 'event_espresso' )); ?></span><span class="dashicons dashicons-calendar"></span><?php echo $ticket->get_i18n_datetime( 'TKT_end_date', $date_format ) . ' '; ?><span class="dashicons dashicons-clock"></span><?php echo $ticket->get_i18n_datetime( 'TKT_end_date', $time_format ) ; ?><br/> |
|
303 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading', __('Sale Dates', 'event_espresso')); ?></h5> |
|
304 | + <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_dates_available_message', __('The dates when this option is available for purchase.', 'event_espresso')); ?></span><br/> |
|
305 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale', __('Goes On Sale:', 'event_espresso')); ?></span><span class="dashicons dashicons-calendar"></span><?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format).' '; ?><span class="dashicons dashicons-clock"></span><?php echo $ticket->get_i18n_datetime('TKT_start_date', $time_format); ?><br/> |
|
306 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_sales_end', __('Sales End:', 'event_espresso')); ?></span><span class="dashicons dashicons-calendar"></span><?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format).' '; ?><span class="dashicons dashicons-clock"></span><?php echo $ticket->get_i18n_datetime('TKT_end_date', $time_format); ?><br/> |
|
307 | 307 | </section> |
308 | 308 | <br/> |
309 | 309 | |
310 | - <?php do_action( 'AHEE__ticket_selector_chart_template__after_ticket_date', $ticket ); ?> |
|
310 | + <?php do_action('AHEE__ticket_selector_chart_template__after_ticket_date', $ticket); ?> |
|
311 | 311 | |
312 | - <?php if ( $ticket->min() &&$ticket->max() ) { ?> |
|
312 | + <?php if ($ticket->min() && $ticket->max()) { ?> |
|
313 | 313 | <section class="tckt-slctr-tkt-quantities-sctn"> |
314 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading', __( 'Purchasable Quantities', 'event_espresso' )); ?></h5> |
|
315 | - <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message', __( 'The number of tickets that can be purchased per transaction (if available).', 'event_espresso' )); ?></span><br/> |
|
316 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty', __( 'Minimum Qty:', 'event_espresso' )); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?> |
|
317 | - <?php if ( $ticket->min() > $remaining ) { ?> <span class="important-notice small-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message', __( 'The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining', 'event_espresso' )); ?></span><?php } ?><br/> |
|
314 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading', __('Purchasable Quantities', 'event_espresso')); ?></h5> |
|
315 | + <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message', __('The number of tickets that can be purchased per transaction (if available).', 'event_espresso')); ?></span><br/> |
|
316 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty', __('Minimum Qty:', 'event_espresso')); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?> |
|
317 | + <?php if ($ticket->min() > $remaining) { ?> <span class="important-notice small-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message', __('The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining', 'event_espresso')); ?></span><?php } ?><br/> |
|
318 | 318 | <?php //$max = min( $max, $max_atndz );?> |
319 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty', __( 'Maximum Qty:', 'event_espresso' )); ?></span><?php echo $ticket->max() === EE_INF ? __( 'no limit', 'event_espresso' ) : max( $ticket->max(), 1 ); ?><br/> |
|
319 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty', __('Maximum Qty:', 'event_espresso')); ?></span><?php echo $ticket->max() === EE_INF ? __('no limit', 'event_espresso') : max($ticket->max(), 1); ?><br/> |
|
320 | 320 | </section> |
321 | 321 | <br/> |
322 | 322 | <?php } ?> |
323 | 323 | |
324 | - <?php if ( $ticket->uses() !== EE_INF && ( ! defined( 'EE_DECAF' ) || EE_DECAF !== TRUE )) { ?> |
|
324 | + <?php if ($ticket->uses() !== EE_INF && ( ! defined('EE_DECAF') || EE_DECAF !== TRUE)) { ?> |
|
325 | 325 | <section class="tckt-slctr-tkt-uses-sctn"> |
326 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading', __( 'Event Date Ticket Uses', 'event_espresso' )); ?></h5> |
|
326 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading', __('Event Date Ticket Uses', 'event_espresso')); ?></h5> |
|
327 | 327 | <span class="drk-grey-text small-text no-bold"> - <?php |
328 | 328 | echo apply_filters( |
329 | 329 | 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_message', |
330 | 330 | sprintf( |
331 | - __( 'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s', 'event_espresso' ), |
|
331 | + __('The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s', 'event_espresso'), |
|
332 | 332 | '<br/>', |
333 | 333 | '<strong>', |
334 | 334 | '</strong>' |
335 | 335 | ) |
336 | 336 | ); |
337 | 337 | ?></span><br/> |
338 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes', __( '# Datetimes:', 'event_espresso' )); ?></span><?php echo $ticket->uses();?><br/> |
|
338 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes', __('# Datetimes:', 'event_espresso')); ?></span><?php echo $ticket->uses(); ?><br/> |
|
339 | 339 | </section> |
340 | 340 | <?php } ?> |
341 | 341 | |
342 | 342 | <?php |
343 | - $datetimes = $ticket->datetimes_ordered( $event_is_expired, FALSE ); |
|
343 | + $datetimes = $ticket->datetimes_ordered($event_is_expired, FALSE); |
|
344 | 344 | $chart_column_width = $template_settings->show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width'; |
345 | - if ( ! empty( $datetimes )) { ?> |
|
345 | + if ( ! empty($datetimes)) { ?> |
|
346 | 346 | <section class="tckt-slctr-tkt-datetimes-sctn"> |
347 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading', __( 'Access', 'event_espresso' )); ?></h5> |
|
348 | - <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_message', __( 'This option allows access to the following dates and times.', 'event_espresso' )); ?></span> |
|
347 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_heading', __('Access', 'event_espresso')); ?></h5> |
|
348 | + <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_message', __('This option allows access to the following dates and times.', 'event_espresso')); ?></span> |
|
349 | 349 | <div class="tckt-slctr-tkt-details-tbl-wrap-dv"> |
350 | 350 | <table class="tckt-slctr-tkt-details-tbl"> |
351 | 351 | <thead> |
352 | 352 | <tr> |
353 | 353 | <th class="tckt-slctr-tkt-details-date-th"> |
354 | - <span class="dashicons dashicons-calendar"></span><span class="small-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __( 'Date ', 'event_espresso' )); ?></span> |
|
354 | + <span class="dashicons dashicons-calendar"></span><span class="small-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __('Date ', 'event_espresso')); ?></span> |
|
355 | 355 | </th> |
356 | 356 | <th class="tckt-slctr-tkt-details-time-th <?php echo $chart_column_width; ?>"> |
357 | - <span class="dashicons dashicons-clock"></span><span class="small-text"><?php _e( 'Time ', 'event_espresso' ); ?></span> |
|
357 | + <span class="dashicons dashicons-clock"></span><span class="small-text"><?php _e('Time ', 'event_espresso'); ?></span> |
|
358 | 358 | </th> |
359 | - <?php if ( $template_settings->show_ticket_sale_columns ) : ?> |
|
359 | + <?php if ($template_settings->show_ticket_sale_columns) : ?> |
|
360 | 360 | <th class="tckt-slctr-tkt-details-this-ticket-sold-th ee-fourth-width cntr"> |
361 | - <span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', sprintf( __( 'Sold', 'event_espresso' ), '<br/>' )); ?></span> |
|
361 | + <span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', sprintf(__('Sold', 'event_espresso'), '<br/>')); ?></span> |
|
362 | 362 | </th> |
363 | 363 | <th class="tckt-slctr-tkt-details-this-ticket-left-th ee-fourth-width cntr"> |
364 | - <span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', sprintf( __( 'Remaining', 'event_espresso' ), '<br/>' )); ?></span> |
|
364 | + <span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', sprintf(__('Remaining', 'event_espresso'), '<br/>')); ?></span> |
|
365 | 365 | </th> |
366 | 366 | <th class="tckt-slctr-tkt-details-total-tickets-sold-th ee-fourth-width cntr"> |
367 | - <span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', sprintf( __( 'Total%sSold', 'event_espresso' ), '<br/>' )); ?></span> |
|
367 | + <span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', sprintf(__('Total%sSold', 'event_espresso'), '<br/>')); ?></span> |
|
368 | 368 | </th> |
369 | 369 | <th class="tckt-slctr-tkt-details-total-tickets-left-th ee-fourth-width cntr"> |
370 | - <span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', sprintf( __( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' )); ?></span> |
|
370 | + <span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', sprintf(__('Total Spaces%sLeft', 'event_espresso'), '<br/>')); ?></span> |
|
371 | 371 | </th> |
372 | 372 | <?php endif; //end $template_settings->show_ticket_sale_columns conditional ?> |
373 | 373 | </tr> |
374 | 374 | </thead> |
375 | 375 | <tbody> |
376 | 376 | <?php |
377 | - foreach ( $datetimes as $datetime ) { |
|
378 | - if ( $datetime instanceof EE_Datetime ) { |
|
377 | + foreach ($datetimes as $datetime) { |
|
378 | + if ($datetime instanceof EE_Datetime) { |
|
379 | 379 | ?> |
380 | 380 | |
381 | 381 | <tr> |
382 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __( 'Event Date ', 'event_espresso' )); ?>" class="small-text"> |
|
382 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __('Event Date ', 'event_espresso')); ?>" class="small-text"> |
|
383 | 383 | <?php $datetime_name = $datetime->name(); ?> |
384 | - <?php echo ! empty( $datetime_name ) ? '<b>' . $datetime_name . '</b><br/>' : ''; ?> |
|
385 | - <?php echo $datetime->date_range( $date_format, __( ' to ', 'event_espresso' )); ?> |
|
384 | + <?php echo ! empty($datetime_name) ? '<b>'.$datetime_name.'</b><br/>' : ''; ?> |
|
385 | + <?php echo $datetime->date_range($date_format, __(' to ', 'event_espresso')); ?> |
|
386 | 386 | </td> |
387 | - <td data-th="<?php _e( 'Time ', 'event_espresso' ); ?>" class="cntr small-text"> |
|
388 | - <?php echo $datetime->time_range( $time_format, __( ' to ', 'event_espresso' )); ?> |
|
387 | + <td data-th="<?php _e('Time ', 'event_espresso'); ?>" class="cntr small-text"> |
|
388 | + <?php echo $datetime->time_range($time_format, __(' to ', 'event_espresso')); ?> |
|
389 | 389 | </td> |
390 | - <?php if ( $template_settings->show_ticket_sale_columns ) : ?> |
|
391 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', __( 'Sold', 'event_espresso' )); ?>" class="cntr small-text"> |
|
390 | + <?php if ($template_settings->show_ticket_sale_columns) : ?> |
|
391 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', __('Sold', 'event_espresso')); ?>" class="cntr small-text"> |
|
392 | 392 | <?php echo $ticket->sold(); ?> |
393 | 393 | </td> |
394 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', __( 'Remaining', 'event_espresso' )); ?>" class="cntr small-text"> |
|
395 | - <?php echo $ticket->qty() === EE_INF ? '<span class="smaller-text">' . __( 'unlimited ', 'event_espresso' ) . '</span>' : $ticket->qty() - $ticket->sold(); ?> |
|
394 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', __('Remaining', 'event_espresso')); ?>" class="cntr small-text"> |
|
395 | + <?php echo $ticket->qty() === EE_INF ? '<span class="smaller-text">'.__('unlimited ', 'event_espresso').'</span>' : $ticket->qty() - $ticket->sold(); ?> |
|
396 | 396 | </td> |
397 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', __( 'Total Sold', 'event_espresso' )); ?>" class="cntr small-text"> |
|
397 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', __('Total Sold', 'event_espresso')); ?>" class="cntr small-text"> |
|
398 | 398 | <?php echo $datetime->sold(); ?> |
399 | 399 | </td> |
400 | - <?php $tkts_left = $datetime->sold_out() ? '<span class="sold-out smaller-text">' . __( 'Sold Out', 'event_espresso' ) . '</span>' : $datetime->spaces_remaining(); ?> |
|
401 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', __( 'Total Spaces Left', 'event_espresso' )); ?>" class="cntr small-text"> |
|
402 | - <?php echo $tkts_left === EE_INF ? '<span class="smaller-text">' . __( 'unlimited ', 'event_espresso' ) . '</span>' : $tkts_left; ?> |
|
400 | + <?php $tkts_left = $datetime->sold_out() ? '<span class="sold-out smaller-text">'.__('Sold Out', 'event_espresso').'</span>' : $datetime->spaces_remaining(); ?> |
|
401 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', __('Total Spaces Left', 'event_espresso')); ?>" class="cntr small-text"> |
|
402 | + <?php echo $tkts_left === EE_INF ? '<span class="smaller-text">'.__('unlimited ', 'event_espresso').'</span>' : $tkts_left; ?> |
|
403 | 403 | </td> |
404 | 404 | <?php endif; //end $template_settings->show_ticket_sale_columns conditional ?> |
405 | 405 | </tr> |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | </div> |
418 | 418 | </td> |
419 | 419 | </tr> |
420 | - <?php endif; //end template_settings->show_ticket_details check?> |
|
420 | + <?php endif; //end template_settings->show_ticket_details check?> |
|
421 | 421 | <?php |
422 | 422 | $row++; |
423 | 423 | } |
@@ -426,32 +426,32 @@ discard block |
||
426 | 426 | $ticket_row_html = ob_get_clean(); |
427 | 427 | // if there is only ONE ticket with a max qty of ONE, and it is free... then not much need for the ticket selector |
428 | 428 | $hide_ticket_selector = $ticket_count == 1 && $max == 1 && $ticket->is_free() ? true : false; |
429 | -$hide_ticket_selector = apply_filters( 'FHEE__ticket_selector_chart_template__hide_ticket_selector', $hide_ticket_selector, $EVT_ID ); |
|
429 | +$hide_ticket_selector = apply_filters('FHEE__ticket_selector_chart_template__hide_ticket_selector', $hide_ticket_selector, $EVT_ID); |
|
430 | 430 | //EEH_Debug_Tools::printr( $ticket_count, '$ticket_count', __FILE__, __LINE__ ); |
431 | 431 | //EEH_Debug_Tools::printr( $max, '$max', __FILE__, __LINE__ ); |
432 | 432 | //EEH_Debug_Tools::printr( $hide_ticket_selector, '$hide_ticket_selector', __FILE__, __LINE__ ); |
433 | 433 | //EEH_Debug_Tools::printr( $table_style, '$table_style', __FILE__, __LINE__ ); |
434 | 434 | remove_filter( |
435 | 435 | 'FHEE__EE_Ticket_Selector__after_ticket_selector_submit', |
436 | - array( 'EED_Ticket_Selector', 'no_tkt_slctr_end_dv' ) |
|
436 | + array('EED_Ticket_Selector', 'no_tkt_slctr_end_dv') |
|
437 | 437 | ); |
438 | 438 | remove_filter( |
439 | 439 | 'FHEE__EE_Ticket_Selector__after_view_details_btn', |
440 | - array( 'EED_Ticket_Selector', 'no_tkt_slctr_end_dv' ) |
|
440 | + array('EED_Ticket_Selector', 'no_tkt_slctr_end_dv') |
|
441 | 441 | ); |
442 | -if ( ! $hide_ticket_selector ) { |
|
442 | +if ( ! $hide_ticket_selector) { |
|
443 | 443 | ?> |
444 | 444 | <div id="tkt-slctr-tbl-wrap-dv-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl-wrap-dv"> |
445 | 445 | |
446 | - <?php do_action( 'AHEE__ticket_selector_chart__template__before_ticket_selector', $event ); ?> |
|
446 | + <?php do_action('AHEE__ticket_selector_chart__template__before_ticket_selector', $event); ?> |
|
447 | 447 | |
448 | 448 | <table id="tkt-slctr-tbl-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl"> |
449 | 449 | <thead> |
450 | 450 | <tr> |
451 | 451 | <th scope="col" class="ee-ticket-selector-ticket-details-th"> |
452 | - <?php echo esc_html( apply_filters( 'FHEE__ticket_selector_chart_template__table_header_available_tickets', '', $EVT_ID ) ); ?> |
|
452 | + <?php echo esc_html(apply_filters('FHEE__ticket_selector_chart_template__table_header_available_tickets', '', $EVT_ID)); ?> |
|
453 | 453 | </th> |
454 | - <?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE )) { ?> |
|
454 | + <?php if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?> |
|
455 | 455 | <th scope="col" class="ee-ticket-selector-ticket-price-th cntr"> |
456 | 456 | <?php |
457 | 457 | /** |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | * @param string 'Price' The translatable text to display in the table header for price |
463 | 463 | * @param int $EVT_ID The Event ID |
464 | 464 | */ |
465 | - echo esc_html( apply_filters( 'FHEE__ticket_selector_chart_template__table_header_price', __( 'Price', 'event_espresso' ), $EVT_ID ) ); |
|
465 | + echo esc_html(apply_filters('FHEE__ticket_selector_chart_template__table_header_price', __('Price', 'event_espresso'), $EVT_ID)); |
|
466 | 466 | ?> |
467 | 467 | </th> |
468 | 468 | <?php } ?> |
@@ -476,24 +476,24 @@ discard block |
||
476 | 476 | * @param string 'Qty*' The translatable text to display in the table header for the Quantity of tickets |
477 | 477 | * @param int $EVT_ID The Event ID |
478 | 478 | */ |
479 | - echo esc_html( apply_filters( 'FHEE__ticket_selector_chart_template__table_header_qty', __( 'Qty*', 'event_espresso' ), $EVT_ID ) ); |
|
479 | + echo esc_html(apply_filters('FHEE__ticket_selector_chart_template__table_header_qty', __('Qty*', 'event_espresso'), $EVT_ID)); |
|
480 | 480 | ?> |
481 | 481 | </th> |
482 | 482 | </tr> |
483 | 483 | </thead> |
484 | 484 | <tbody> |
485 | - <?php echo $ticket_row_html;?> |
|
485 | + <?php echo $ticket_row_html; ?> |
|
486 | 486 | </tbody> |
487 | 487 | </table> |
488 | 488 | |
489 | 489 | <input type="hidden" name="noheader" value="true" /> |
490 | - <input type="hidden" name="tkt-slctr-return-url-<?php echo $EVT_ID ?>" value="<?php echo EEH_URL::filter_input_server_url();?>" /> |
|
490 | + <input type="hidden" name="tkt-slctr-return-url-<?php echo $EVT_ID ?>" value="<?php echo EEH_URL::filter_input_server_url(); ?>" /> |
|
491 | 491 | <input type="hidden" name="tkt-slctr-rows-<?php echo $EVT_ID; ?>" value="<?php echo $row - 1; ?>" /> |
492 | 492 | <input type="hidden" name="tkt-slctr-max-atndz-<?php echo $EVT_ID; ?>" value="<?php echo $max_atndz; ?>" /> |
493 | 493 | <input type="hidden" name="tkt-slctr-event-id" value="<?php echo $EVT_ID; ?>" /> |
494 | 494 | |
495 | 495 | <?php |
496 | -if ( $max_atndz > 0 && ! $hide_ticket_selector ) { |
|
496 | +if ($max_atndz > 0 && ! $hide_ticket_selector) { |
|
497 | 497 | echo apply_filters( |
498 | 498 | 'FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote', |
499 | 499 | '' |
@@ -501,10 +501,10 @@ discard block |
||
501 | 501 | } |
502 | 502 | ?> |
503 | 503 | |
504 | - <?php do_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event ); ?> |
|
504 | + <?php do_action('AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event); ?> |
|
505 | 505 | |
506 | 506 | </div> |
507 | -<?php } else if ( isset( $TKT_ID ) ) { ?> |
|
507 | +<?php } else if (isset($TKT_ID)) { ?> |
|
508 | 508 | <input type="hidden" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" value="1"/> |
509 | 509 | <input type="hidden" name="tkt-slctr-ticket-id-<?php echo $EVT_ID; ?>[]" value="<?php echo $TKT_ID; ?>"/> |
510 | 510 | <input type="hidden" name="noheader" value="true"/> |
@@ -513,27 +513,27 @@ discard block |
||
513 | 513 | <input type="hidden" name="tkt-slctr-max-atndz-<?php echo $EVT_ID; ?>" value="<?php echo $max_atndz; ?>"/> |
514 | 514 | <input type="hidden" name="tkt-slctr-event-id" value="<?php echo $EVT_ID; ?>"/> |
515 | 515 | <?php |
516 | - if ( $ticket instanceof EE_Ticket ) { |
|
517 | - do_action( 'AHEE__ticket_selector_chart__template__before_ticket_selector', $event ); |
|
516 | + if ($ticket instanceof EE_Ticket) { |
|
517 | + do_action('AHEE__ticket_selector_chart__template__before_ticket_selector', $event); |
|
518 | 518 | $ticket_description = $ticket->description(); |
519 | 519 | ?> |
520 | 520 | <div id="no-tkt-slctr-ticket-dv-<?php echo $EVT_ID; ?>" class="no-tkt-slctr-ticket-dv"> |
521 | 521 | <div class="no-tkt-slctr-ticket-content-dv"> |
522 | 522 | <h5><?php echo $ticket->name(); ?></h5> |
523 | - <?php if ( ! empty( $ticket_description ) ) { ?> |
|
523 | + <?php if ( ! empty($ticket_description)) { ?> |
|
524 | 524 | <p><?php echo $ticket_description; ?></p> |
525 | 525 | <?php } ?> |
526 | 526 | </div> |
527 | 527 | <?php |
528 | 528 | add_filter( |
529 | 529 | 'FHEE__EE_Ticket_Selector__after_ticket_selector_submit', |
530 | - array( 'EED_Ticket_Selector', 'no_tkt_slctr_end_dv' ) |
|
530 | + array('EED_Ticket_Selector', 'no_tkt_slctr_end_dv') |
|
531 | 531 | ); |
532 | 532 | add_filter( |
533 | 533 | 'FHEE__EE_Ticket_Selector__after_view_details_btn', |
534 | - array( 'EED_Ticket_Selector', 'no_tkt_slctr_end_dv' ) |
|
534 | + array('EED_Ticket_Selector', 'no_tkt_slctr_end_dv') |
|
535 | 535 | ); |
536 | - do_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event ); |
|
536 | + do_action('AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event); |
|
537 | 537 | } |
538 | 538 | } |
539 | 539 | ?> |
@@ -1,36 +1,36 @@ |
||
1 | 1 | |
2 | 2 | <h4 id="reg-page-totals-hdr" class=""> |
3 | - <span class="drk-grey-text"><?php _e('Registrations:', 'event_espresso'); ?></span> <?php echo $reg_count;?> |
|
3 | + <span class="drk-grey-text"><?php _e('Registrations:', 'event_espresso'); ?></span> <?php echo $reg_count; ?> |
|
4 | 4 | </h4> |
5 | 5 | |
6 | 6 | <div class="spco-payment-info-dv"> |
7 | 7 | <table id="spco-payment-info-table"> |
8 | 8 | <thead> |
9 | 9 | <tr> |
10 | - <th scope="col" width=""><?php _e('Name and Description', 'event_espresso');?></th> |
|
11 | - <th scope="col" width="15%" class="jst-cntr"><?php _e('Price', 'event_espresso');?></th> |
|
12 | - <th scope="col" width="5%" class="jst-cntr"><?php _e( 'Qty', 'event_espresso' ); ?></th> |
|
13 | - <th scope="col" width="15%" class="jst-cntr"><?php _e('Total', 'event_espresso');?></th> |
|
14 | - <?php do_action( 'AHEE__registration_page_payment_options__payment_info_table_thead_row_end' ); ?> |
|
10 | + <th scope="col" width=""><?php _e('Name and Description', 'event_espresso'); ?></th> |
|
11 | + <th scope="col" width="15%" class="jst-cntr"><?php _e('Price', 'event_espresso'); ?></th> |
|
12 | + <th scope="col" width="5%" class="jst-cntr"><?php _e('Qty', 'event_espresso'); ?></th> |
|
13 | + <th scope="col" width="15%" class="jst-cntr"><?php _e('Total', 'event_espresso'); ?></th> |
|
14 | + <?php do_action('AHEE__registration_page_payment_options__payment_info_table_thead_row_end'); ?> |
|
15 | 15 | </tr> |
16 | 16 | </thead> |
17 | 17 | <tbody> |
18 | - <?php echo $transaction_details;?> |
|
19 | - <?php do_action( 'AHEE__registration_page_payment_options__payment_info_table_tbody_end' ); ?> |
|
18 | + <?php echo $transaction_details; ?> |
|
19 | + <?php do_action('AHEE__registration_page_payment_options__payment_info_table_tbody_end'); ?> |
|
20 | 20 | </tbody> |
21 | 21 | </table> |
22 | 22 | </div> |
23 | 23 | <div class="clear-float"> </div> |
24 | 24 | |
25 | - <?php echo $before_payment_options; ?> |
|
25 | + <?php echo $before_payment_options; ?> |
|
26 | 26 | |
27 | 27 | <div id="methods-of-payment"> |
28 | 28 | <?php echo $payment_options; ?> |
29 | 29 | </div> |
30 | 30 | <!-- end #methods-of-payment --> |
31 | 31 | |
32 | - <?php echo $after_payment_options; ?> |
|
32 | + <?php echo $after_payment_options; ?> |
|
33 | 33 | |
34 | - <?php echo $default_hidden_inputs; ?> |
|
35 | - <?php echo $extra_hidden_inputs; ?> |
|
34 | + <?php echo $default_hidden_inputs; ?> |
|
35 | + <?php echo $extra_hidden_inputs; ?> |
|
36 | 36 |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | |
164 | 164 | /** |
165 | 165 | * grab url requests and route them |
166 | - * @access private |
|
167 | - * @return void |
|
168 | - */ |
|
166 | + * @access private |
|
167 | + * @return void |
|
168 | + */ |
|
169 | 169 | public function _set_page_routes() { |
170 | 170 | |
171 | 171 | $this->_get_registration_status_array(); |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | 'title' => __('Registrations Other', 'event_espresso'), |
438 | 438 | 'filename' => 'registrations_overview_other' |
439 | 439 | ) |
440 | - ), |
|
440 | + ), |
|
441 | 441 | 'help_tour' => array( 'Registration_Overview_Help_Tour' ), |
442 | 442 | 'qtips' => array('Registration_List_Table_Tips'), |
443 | 443 | 'list_table' => 'EE_Registrations_List_Table', |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | : $this->_admin_base_url, |
457 | 457 | 'persistent' => FALSE |
458 | 458 | ), |
459 | - 'help_tabs' => array( |
|
459 | + 'help_tabs' => array( |
|
460 | 460 | 'registrations_details_help_tab' => array( |
461 | 461 | 'title' => __('Registration Details', 'event_espresso'), |
462 | 462 | 'filename' => 'registrations_details' |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | 'order' => 20 |
521 | 521 | ), |
522 | 522 | 'list_table' => 'EE_Attendee_Contact_List_Table', |
523 | - 'help_tabs' => array( |
|
523 | + 'help_tabs' => array( |
|
524 | 524 | 'registrations_contact_list_help_tab' => array( |
525 | 525 | 'title' => __('Registrations Contact List', 'event_espresso'), |
526 | 526 | 'filename' => 'registrations_contact_list' |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | 'title' => __('Contact List Other', 'event_espresso'), |
538 | 538 | 'filename' => 'registrations_contact_list_other' |
539 | 539 | ) |
540 | - ), |
|
540 | + ), |
|
541 | 541 | 'help_tour' => array( 'Contact_List_Help_Tour' ), |
542 | 542 | 'metaboxes' => array(), |
543 | 543 | 'require_nonce' => FALSE |
@@ -571,9 +571,9 @@ discard block |
||
571 | 571 | |
572 | 572 | /** |
573 | 573 | * get list of registration statuses |
574 | - * @access private |
|
575 | - * @return void |
|
576 | - */ |
|
574 | + * @access private |
|
575 | + * @return void |
|
576 | + */ |
|
577 | 577 | private function _get_registration_status_array() { |
578 | 578 | self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE); |
579 | 579 | } |
@@ -861,8 +861,8 @@ discard block |
||
861 | 861 | |
862 | 862 | |
863 | 863 | /** |
864 | - * @throws \EE_Error |
|
865 | - */ |
|
864 | + * @throws \EE_Error |
|
865 | + */ |
|
866 | 866 | protected function _registrations_overview_list_table() { |
867 | 867 | $this->_template_args['admin_page_header'] = ''; |
868 | 868 | $EVT_ID = ! empty( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : 0; |
@@ -922,7 +922,7 @@ discard block |
||
922 | 922 | return TRUE; |
923 | 923 | } |
924 | 924 | |
925 | - $REG = EEM_Registration::instance(); |
|
925 | + $REG = EEM_Registration::instance(); |
|
926 | 926 | |
927 | 927 | $REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE; |
928 | 928 | |
@@ -1146,9 +1146,9 @@ discard block |
||
1146 | 1146 | |
1147 | 1147 | /** |
1148 | 1148 | * generates HTML for the View Registration Details Admin page |
1149 | - * @access protected |
|
1150 | - * @return void |
|
1151 | - */ |
|
1149 | + * @access protected |
|
1150 | + * @return void |
|
1151 | + */ |
|
1152 | 1152 | protected function _registration_details() { |
1153 | 1153 | |
1154 | 1154 | $this->_template_args = array(); |
@@ -1414,10 +1414,10 @@ discard block |
||
1414 | 1414 | |
1415 | 1415 | /** |
1416 | 1416 | * approve_registration |
1417 | - * @access protected |
|
1418 | - * @param bool $notify whether or not to notify the registrant about their approval. |
|
1419 | - * @return void |
|
1420 | - */ |
|
1417 | + * @access protected |
|
1418 | + * @param bool $notify whether or not to notify the registrant about their approval. |
|
1419 | + * @return void |
|
1420 | + */ |
|
1421 | 1421 | protected function approve_registration( $notify = false ) { |
1422 | 1422 | $this->_reg_status_change_return( EEM_Registration::status_id_approved, $notify ); |
1423 | 1423 | } |
@@ -1427,10 +1427,10 @@ discard block |
||
1427 | 1427 | |
1428 | 1428 | /** |
1429 | 1429 | * decline_registration |
1430 | - * @access protected |
|
1431 | - * @param bool $notify whether or not to notify the registrant about their approval. |
|
1432 | - * @return void |
|
1433 | - */ |
|
1430 | + * @access protected |
|
1431 | + * @param bool $notify whether or not to notify the registrant about their approval. |
|
1432 | + * @return void |
|
1433 | + */ |
|
1434 | 1434 | protected function decline_registration( $notify = false ) { |
1435 | 1435 | $this->_reg_status_change_return( EEM_Registration::status_id_declined, $notify ); |
1436 | 1436 | } |
@@ -1440,10 +1440,10 @@ discard block |
||
1440 | 1440 | |
1441 | 1441 | /** |
1442 | 1442 | * cancel_registration |
1443 | - * @access protected |
|
1444 | - * @param bool $notify whether or not to notify the registrant about their approval. |
|
1445 | - * @return void |
|
1446 | - */ |
|
1443 | + * @access protected |
|
1444 | + * @param bool $notify whether or not to notify the registrant about their approval. |
|
1445 | + * @return void |
|
1446 | + */ |
|
1447 | 1447 | protected function cancel_registration( $notify = false ) { |
1448 | 1448 | $this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $notify ); |
1449 | 1449 | } |
@@ -1454,10 +1454,10 @@ discard block |
||
1454 | 1454 | |
1455 | 1455 | /** |
1456 | 1456 | * not_approve_registration |
1457 | - * @access protected |
|
1458 | - * @param bool $notify whether or not to notify the registrant about their approval. |
|
1459 | - * @return void |
|
1460 | - */ |
|
1457 | + * @access protected |
|
1458 | + * @param bool $notify whether or not to notify the registrant about their approval. |
|
1459 | + * @return void |
|
1460 | + */ |
|
1461 | 1461 | protected function not_approve_registration( $notify = false ) { |
1462 | 1462 | $this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $notify ); |
1463 | 1463 | } |
@@ -1466,10 +1466,10 @@ discard block |
||
1466 | 1466 | |
1467 | 1467 | /** |
1468 | 1468 | * decline_registration |
1469 | - * @access protected |
|
1470 | - * @param bool $notify whether or not to notify the registrant about their approval. |
|
1471 | - * @return void |
|
1472 | - */ |
|
1469 | + * @access protected |
|
1470 | + * @param bool $notify whether or not to notify the registrant about their approval. |
|
1471 | + * @return void |
|
1472 | + */ |
|
1473 | 1473 | protected function pending_registration( $notify = false ) { |
1474 | 1474 | $this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $notify ); |
1475 | 1475 | } |
@@ -1479,9 +1479,9 @@ discard block |
||
1479 | 1479 | |
1480 | 1480 | /** |
1481 | 1481 | * generates HTML for the Registration main meta box |
1482 | - * @access public |
|
1483 | - * @return void |
|
1484 | - */ |
|
1482 | + * @access public |
|
1483 | + * @return void |
|
1484 | + */ |
|
1485 | 1485 | public function _reg_details_meta_box() { |
1486 | 1486 | EEH_Autoloader::register_line_item_display_autoloaders(); |
1487 | 1487 | EEH_Autoloader::register_line_item_filter_autoloaders(); |
@@ -1518,7 +1518,7 @@ discard block |
||
1518 | 1518 | : ''; |
1519 | 1519 | |
1520 | 1520 | $this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee |
1521 | - && EE_Registry::instance()->CAP->current_user_can( |
|
1521 | + && EE_Registry::instance()->CAP->current_user_can( |
|
1522 | 1522 | 'ee_send_message', |
1523 | 1523 | 'espresso_registrations_resend_registration' |
1524 | 1524 | ) |
@@ -1594,7 +1594,7 @@ discard block |
||
1594 | 1594 | * |
1595 | 1595 | * @access public |
1596 | 1596 | * @return void |
1597 | - */ |
|
1597 | + */ |
|
1598 | 1598 | public function _reg_questions_meta_box() { |
1599 | 1599 | //allow someone to override this method entirely |
1600 | 1600 | if( apply_filters( 'FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration ) ) { |
@@ -1796,12 +1796,12 @@ discard block |
||
1796 | 1796 | |
1797 | 1797 | /** |
1798 | 1798 | * generates HTML for the Registration main meta box |
1799 | - * @access public |
|
1800 | - * @return void |
|
1801 | - */ |
|
1799 | + * @access public |
|
1800 | + * @return void |
|
1801 | + */ |
|
1802 | 1802 | public function _reg_attendees_meta_box() { |
1803 | 1803 | |
1804 | - $REG = EEM_Registration::instance(); |
|
1804 | + $REG = EEM_Registration::instance(); |
|
1805 | 1805 | //get all other registrations on this transaction, and cache |
1806 | 1806 | //the attendees for them so we don't have to run another query using force_join |
1807 | 1807 | $registrations = $REG->get_all(array( |
@@ -1853,9 +1853,9 @@ discard block |
||
1853 | 1853 | |
1854 | 1854 | /** |
1855 | 1855 | * generates HTML for the Edit Registration side meta box |
1856 | - * @access public |
|
1857 | - * @return void |
|
1858 | - */ |
|
1856 | + * @access public |
|
1857 | + * @return void |
|
1858 | + */ |
|
1859 | 1859 | public function _reg_registrant_side_meta_box() { |
1860 | 1860 | |
1861 | 1861 | /*@var $attendee EE_Attendee */ |
@@ -2236,9 +2236,9 @@ discard block |
||
2236 | 2236 | |
2237 | 2237 | /** |
2238 | 2238 | * set_reg_event |
2239 | - * @access private |
|
2240 | - * @return boolean |
|
2241 | - */ |
|
2239 | + * @access private |
|
2240 | + * @return boolean |
|
2241 | + */ |
|
2242 | 2242 | private function _set_reg_event() { |
2243 | 2243 | if ( is_object( $this->_reg_event )) { |
2244 | 2244 | return TRUE; |
@@ -2378,9 +2378,9 @@ discard block |
||
2378 | 2378 | |
2379 | 2379 | /** |
2380 | 2380 | * generates HTML for the Attendee Contact List |
2381 | - * @access protected |
|
2382 | - * @return void |
|
2383 | - */ |
|
2381 | + * @access protected |
|
2382 | + * @return void |
|
2383 | + */ |
|
2384 | 2384 | protected function _attendee_contact_list_table() { |
2385 | 2385 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
2386 | 2386 | $this->_search_btn_label = __('Contacts', 'event_espresso'); |
@@ -2394,9 +2394,9 @@ discard block |
||
2394 | 2394 | /** |
2395 | 2395 | * get_attendees |
2396 | 2396 | * @param bool $count whether to return count or data. |
2397 | - * @access public |
|
2398 | - * @return array |
|
2399 | - */ |
|
2397 | + * @access public |
|
2398 | + * @return array |
|
2399 | + */ |
|
2400 | 2400 | public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) { |
2401 | 2401 | |
2402 | 2402 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -2728,9 +2728,9 @@ discard block |
||
2728 | 2728 | |
2729 | 2729 | /** |
2730 | 2730 | * _attendee_details |
2731 | - * @access protected |
|
2732 | - * @return void |
|
2733 | - */ |
|
2731 | + * @access protected |
|
2732 | + * @return void |
|
2733 | + */ |
|
2734 | 2734 | public function attendee_registrations_meta_box( $post ) { |
2735 | 2735 | |
2736 | 2736 | $this->_template_args['attendee'] = $this->_cpt_model_obj; |
@@ -2763,10 +2763,10 @@ discard block |
||
2763 | 2763 | |
2764 | 2764 | /** |
2765 | 2765 | * _trash_or_restore_attendee |
2766 | - * @param boolean $trash - whether to move item to trash (TRUE) or restore it (FALSE) |
|
2767 | - * @access protected |
|
2768 | - * @return void |
|
2769 | - */ |
|
2766 | + * @param boolean $trash - whether to move item to trash (TRUE) or restore it (FALSE) |
|
2767 | + * @access protected |
|
2768 | + * @return void |
|
2769 | + */ |
|
2770 | 2770 | protected function _trash_or_restore_attendees( $trash = TRUE ) { |
2771 | 2771 | |
2772 | 2772 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -56,26 +56,26 @@ discard block |
||
56 | 56 | * @param bool $routing |
57 | 57 | * @return Registrations_Admin_Page |
58 | 58 | */ |
59 | - public function __construct( $routing = TRUE ) { |
|
60 | - parent::__construct( $routing ); |
|
61 | - add_action( 'wp_loaded', array( $this, 'wp_loaded' )); |
|
59 | + public function __construct($routing = TRUE) { |
|
60 | + parent::__construct($routing); |
|
61 | + add_action('wp_loaded', array($this, 'wp_loaded')); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | |
65 | 65 | |
66 | 66 | public function wp_loaded() { |
67 | 67 | // when adding a new registration... |
68 | - if ( isset( $this->_req_data[ 'action' ] ) && $this->_req_data[ 'action' ] == 'new_registration' ) { |
|
68 | + if (isset($this->_req_data['action']) && $this->_req_data['action'] == 'new_registration') { |
|
69 | 69 | EE_System::do_not_cache(); |
70 | 70 | if ( |
71 | - ! isset( $this->_req_data[ 'processing_registration' ] ) |
|
72 | - || absint( $this->_req_data[ 'processing_registration' ] ) !== 1 |
|
71 | + ! isset($this->_req_data['processing_registration']) |
|
72 | + || absint($this->_req_data['processing_registration']) !== 1 |
|
73 | 73 | ) { |
74 | 74 | // and it's NOT the attendee information reg step |
75 | 75 | // force cookie expiration by setting time to last week |
76 | - setcookie( 'ee_registration_added', 0, time() - WEEK_IN_SECONDS, '/' ); |
|
76 | + setcookie('ee_registration_added', 0, time() - WEEK_IN_SECONDS, '/'); |
|
77 | 77 | // and update the global |
78 | - $_COOKIE[ 'ee_registration_added' ] = 0; |
|
78 | + $_COOKIE['ee_registration_added'] = 0; |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 | } |
@@ -109,16 +109,16 @@ discard block |
||
109 | 109 | 'trash' => 'post.php' |
110 | 110 | ); |
111 | 111 | |
112 | - add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10 ); |
|
112 | + add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10); |
|
113 | 113 | //add filters so that the comment urls don't take users to a confusing 404 page |
114 | - add_filter('get_comment_link', array( $this, 'clear_comment_link' ), 10, 3 ); |
|
114 | + add_filter('get_comment_link', array($this, 'clear_comment_link'), 10, 3); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
118 | - public function clear_comment_link( $link, $comment, $args ) { |
|
118 | + public function clear_comment_link($link, $comment, $args) { |
|
119 | 119 | //gotta make sure this only happens on this route |
120 | - $post_type = get_post_type( $comment->comment_post_ID); |
|
121 | - if ( $post_type == 'espresso_attendees' ) |
|
120 | + $post_type = get_post_type($comment->comment_post_ID); |
|
121 | + if ($post_type == 'espresso_attendees') |
|
122 | 122 | return '#commentsdiv'; |
123 | 123 | return $link; |
124 | 124 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | protected function _ajax_hooks() { |
128 | 128 | //todo: all hooks for registrations ajax goes in here |
129 | - add_action( 'wp_ajax_toggle_checkin_status', array( $this, 'toggle_checkin_status' )); |
|
129 | + add_action('wp_ajax_toggle_checkin_status', array($this, 'toggle_checkin_status')); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | 'add-attendee' => __('Add Contact', 'event_espresso'), |
142 | 142 | 'edit' => __('Edit Contact', 'event_espresso'), |
143 | 143 | 'report'=> __("Event Registrations CSV Report", "event_espresso"), |
144 | - 'report_all' => __( 'All Registrations CSV Report', 'event_espresso' ), |
|
145 | - 'contact_list_report' => __( 'Contact List Report', 'event_espresso' ), |
|
144 | + 'report_all' => __('All Registrations CSV Report', 'event_espresso'), |
|
145 | + 'contact_list_report' => __('Contact List Report', 'event_espresso'), |
|
146 | 146 | 'contact_list_export'=> __("Export Data", "event_espresso"), |
147 | 147 | ), |
148 | 148 | 'publishbox' => array( |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | |
171 | 171 | $this->_get_registration_status_array(); |
172 | 172 | |
173 | - $reg_id = ! empty( $this->_req_data['_REG_ID'] ) && ! is_array( $this->_req_data['_REG_ID'] ) ? $this->_req_data['_REG_ID'] : 0; |
|
174 | - $att_id = ! empty( $this->_req_data[ 'ATT_ID' ] ) && ! is_array( $this->_req_data['ATT_ID'] ) ? $this->_req_data['ATT_ID'] : 0; |
|
175 | - $att_id = ! empty( $this->_req_data['post'] ) && ! is_array( $this->_req_data['post'] ) ? $this->_req_data['post'] : $att_id; |
|
173 | + $reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0; |
|
174 | + $att_id = ! empty($this->_req_data['ATT_ID']) && ! is_array($this->_req_data['ATT_ID']) ? $this->_req_data['ATT_ID'] : 0; |
|
175 | + $att_id = ! empty($this->_req_data['post']) && ! is_array($this->_req_data['post']) ? $this->_req_data['post'] : $att_id; |
|
176 | 176 | |
177 | 177 | $this->_page_routes = array( |
178 | 178 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | 'restore_registrations' => array( |
207 | 207 | 'func' => '_trash_or_restore_registrations', |
208 | - 'args' => array( 'trash' => FALSE ), |
|
208 | + 'args' => array('trash' => FALSE), |
|
209 | 209 | 'noheader' => TRUE, |
210 | 210 | 'capability' => 'ee_delete_registrations' |
211 | 211 | ), |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | 'filename' => 'registrations_overview_other' |
439 | 439 | ) |
440 | 440 | ), |
441 | - 'help_tour' => array( 'Registration_Overview_Help_Tour' ), |
|
441 | + 'help_tour' => array('Registration_Overview_Help_Tour'), |
|
442 | 442 | 'qtips' => array('Registration_List_Table_Tips'), |
443 | 443 | 'list_table' => 'EE_Registrations_List_Table', |
444 | 444 | 'require_nonce' => FALSE |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | 'order' => 15, |
451 | 451 | 'url' => isset($this->_req_data['_REG_ID']) |
452 | 452 | ? add_query_arg( |
453 | - array('_REG_ID' => $this->_req_data['_REG_ID'] ), |
|
453 | + array('_REG_ID' => $this->_req_data['_REG_ID']), |
|
454 | 454 | $this->_current_page_view_url |
455 | 455 | ) |
456 | 456 | : $this->_admin_base_url, |
@@ -474,8 +474,8 @@ discard block |
||
474 | 474 | 'filename' => 'registrations_details_registrant_details' |
475 | 475 | ) |
476 | 476 | ), |
477 | - 'help_tour' => array( 'Registration_Details_Help_Tour' ), |
|
478 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_registration_details_metaboxes' ) ), |
|
477 | + 'help_tour' => array('Registration_Details_Help_Tour'), |
|
478 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_registration_details_metaboxes')), |
|
479 | 479 | 'require_nonce' => FALSE |
480 | 480 | ), |
481 | 481 | |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | 'order' => 15, |
500 | 500 | 'persistent' => FALSE |
501 | 501 | ), |
502 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes' ) ), |
|
502 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes')), |
|
503 | 503 | 'require_nonce' => FALSE |
504 | 504 | ), |
505 | 505 | |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | 'label' => __('Edit Contact', 'event_espresso'), |
509 | 509 | 'order' => 15, |
510 | 510 | 'persistent' => FALSE, |
511 | - 'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID'] ), $this->_current_page_view_url ) : $this->_admin_base_url |
|
511 | + 'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID']), $this->_current_page_view_url) : $this->_admin_base_url |
|
512 | 512 | ), |
513 | 513 | 'metaboxes' => array('attendee_editor_metaboxes'), |
514 | 514 | 'require_nonce' => FALSE |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | 'filename' => 'registrations_contact_list_other' |
539 | 539 | ) |
540 | 540 | ), |
541 | - 'help_tour' => array( 'Contact_List_Help_Tour' ), |
|
541 | + 'help_tour' => array('Contact_List_Help_Tour'), |
|
542 | 542 | 'metaboxes' => array(), |
543 | 543 | 'require_nonce' => FALSE |
544 | 544 | ), |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | protected function _add_screen_options() {} |
558 | 558 | protected function _add_feature_pointers() {} |
559 | 559 | public function admin_init() { |
560 | - EE_Registry::$i18n_js_strings[ 'update_att_qstns' ] = __( 'click "Update Registration Questions" to save your changes', 'event_espresso' ); |
|
560 | + EE_Registry::$i18n_js_strings['update_att_qstns'] = __('click "Update Registration Questions" to save your changes', 'event_espresso'); |
|
561 | 561 | } |
562 | 562 | public function admin_notices() {} |
563 | 563 | public function admin_footer_scripts() {} |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | * @return void |
576 | 576 | */ |
577 | 577 | private function _get_registration_status_array() { |
578 | - self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE); |
|
578 | + self::$_reg_status = EEM_Registration::reg_status_array(array(), TRUE); |
|
579 | 579 | } |
580 | 580 | |
581 | 581 | |
@@ -598,11 +598,11 @@ discard block |
||
598 | 598 | public function load_scripts_styles() { |
599 | 599 | //style |
600 | 600 | //wp_register_style('espresso_attendees', ATT_ASSETS_URL . 'espresso_attendees_admin.css', array(), EVENT_ESPRESSO_VERSION ); |
601 | - wp_register_style('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION ); |
|
601 | + wp_register_style('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION); |
|
602 | 602 | wp_enqueue_style('espresso_reg'); |
603 | 603 | |
604 | 604 | //script |
605 | - wp_register_script('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE); |
|
605 | + wp_register_script('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE); |
|
606 | 606 | wp_enqueue_script('espresso_reg'); |
607 | 607 | } |
608 | 608 | |
@@ -611,9 +611,9 @@ discard block |
||
611 | 611 | public function load_scripts_styles_edit_attendee() { |
612 | 612 | //stuff to only show up on our attendee edit details page. |
613 | 613 | $attendee_details_translations = array( |
614 | - 'att_publish_text' => sprintf( __('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created') ) |
|
614 | + 'att_publish_text' => sprintf(__('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created')) |
|
615 | 615 | ); |
616 | - wp_localize_script( 'espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations ); |
|
616 | + wp_localize_script('espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations); |
|
617 | 617 | wp_enqueue_script('jquery-validate'); |
618 | 618 | } |
619 | 619 | |
@@ -622,8 +622,8 @@ discard block |
||
622 | 622 | //styles |
623 | 623 | wp_enqueue_style('espresso-ui-theme'); |
624 | 624 | //scripts |
625 | - $this->_get_reg_custom_questions_form( $this->_registration->ID() ); |
|
626 | - $this->_reg_custom_questions_form->wp_enqueue_scripts( true ); |
|
625 | + $this->_get_reg_custom_questions_form($this->_registration->ID()); |
|
626 | + $this->_reg_custom_questions_form->wp_enqueue_scripts(true); |
|
627 | 627 | } |
628 | 628 | |
629 | 629 | |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | |
634 | 634 | public function load_scripts_styles_contact_list() { |
635 | 635 | wp_deregister_style('espresso_reg'); |
636 | - wp_register_style('espresso_att', REG_ASSETS_URL . 'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION ); |
|
636 | + wp_register_style('espresso_att', REG_ASSETS_URL.'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION); |
|
637 | 637 | wp_enqueue_style('espresso_att'); |
638 | 638 | } |
639 | 639 | |
@@ -642,9 +642,9 @@ discard block |
||
642 | 642 | |
643 | 643 | |
644 | 644 | public function load_scripts_styles_new_registration() { |
645 | - wp_register_script( 'ee-spco-for-admin', REG_ASSETS_URL . 'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE ); |
|
645 | + wp_register_script('ee-spco-for-admin', REG_ASSETS_URL.'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE); |
|
646 | 646 | wp_enqueue_script('ee-spco-for-admin'); |
647 | - add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' ); |
|
647 | + add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true'); |
|
648 | 648 | EE_Form_Section_Proper::wp_enqueue_scripts(); |
649 | 649 | EED_Ticket_Selector::load_tckt_slctr_assets(); |
650 | 650 | EE_Datepicker_Input::enqueue_styles_and_scripts(); |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | //for notification related bulk actions we need to make sure only active messengers have an option. |
672 | 672 | EED_Messages::set_autoloaders(); |
673 | 673 | /** @type EE_Message_Resource_Manager $message_resource_manager */ |
674 | - $message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
674 | + $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
675 | 675 | $active_mts = $message_resource_manager->list_of_active_message_types(); |
676 | 676 | //key= bulk_action_slug, value= message type. |
677 | 677 | $match_array = array( |
@@ -684,23 +684,23 @@ discard block |
||
684 | 684 | |
685 | 685 | /** setup reg status bulk actions **/ |
686 | 686 | $def_reg_status_actions['approve_registration'] = __('Approve Registrations', 'event_espresso'); |
687 | - if ( in_array( $match_array['approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
687 | + if (in_array($match_array['approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
688 | 688 | $def_reg_status_actions['approve_and_notify_registration'] = __('Approve and Notify Registrations', 'event_espresso'); |
689 | 689 | } |
690 | 690 | $def_reg_status_actions['decline_registration'] = __('Decline Registrations', 'event_espresso'); |
691 | - if ( in_array( $match_array['decline_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
691 | + if (in_array($match_array['decline_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
692 | 692 | $def_reg_status_actions['decline_and_notify_registration'] = __('Decline and Notify Registrations', 'event_espresso'); |
693 | 693 | } |
694 | 694 | $def_reg_status_actions['pending_registration'] = __('Set Registrations to Pending Payment', 'event_espresso'); |
695 | - if ( in_array( $match_array['pending_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
695 | + if (in_array($match_array['pending_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
696 | 696 | $def_reg_status_actions['pending_and_notify_registration'] = __('Set Registrations to Pending Payment and Notify', 'event_espresso'); |
697 | 697 | } |
698 | 698 | $def_reg_status_actions['no_approve_registration'] = __('Set Registrations to Not Approved', 'event_espresso'); |
699 | - if ( in_array( $match_array['no_approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
699 | + if (in_array($match_array['no_approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
700 | 700 | $def_reg_status_actions['no_approve_and_notify_registration'] = __('Set Registrations to Not Approved and Notify', 'event_espresso'); |
701 | 701 | } |
702 | 702 | $def_reg_status_actions['cancel_registration'] = __('Cancel Registrations', 'event_espresso'); |
703 | - if ( in_array( $match_array['cancel_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
703 | + if (in_array($match_array['cancel_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
704 | 704 | $def_reg_status_actions['cancel_and_notify_registration'] = __('Cancel Registrations and Notify', 'event_espresso'); |
705 | 705 | } |
706 | 706 | |
@@ -709,29 +709,29 @@ discard block |
||
709 | 709 | 'slug' => 'all', |
710 | 710 | 'label' => __('View All Registrations', 'event_espresso'), |
711 | 711 | 'count' => 0, |
712 | - 'bulk_action' => array_merge( $def_reg_status_actions, array( |
|
712 | + 'bulk_action' => array_merge($def_reg_status_actions, array( |
|
713 | 713 | 'trash_registrations' => __('Trash Registrations', 'event_espresso') |
714 | - ) ) |
|
714 | + )) |
|
715 | 715 | ), |
716 | 716 | 'month' => array( |
717 | 717 | 'slug' => 'month', |
718 | 718 | 'label' => __('This Month', 'event_espresso'), |
719 | 719 | 'count' => 0, |
720 | - 'bulk_action' => array_merge( $def_reg_status_actions, array( |
|
720 | + 'bulk_action' => array_merge($def_reg_status_actions, array( |
|
721 | 721 | 'trash_registrations' => __('Trash Registrations', 'event_espresso') |
722 | 722 | )) |
723 | 723 | ), |
724 | 724 | 'today' => array( |
725 | 725 | 'slug' => 'today', |
726 | - 'label' => sprintf( __('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp' ) ) ), |
|
726 | + 'label' => sprintf(__('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp'))), |
|
727 | 727 | 'count' => 0, |
728 | - 'bulk_action' => array_merge( $def_reg_status_actions, array( |
|
728 | + 'bulk_action' => array_merge($def_reg_status_actions, array( |
|
729 | 729 | 'trash_registrations' => __('Trash Registrations', 'event_espresso') |
730 | 730 | )) |
731 | 731 | ) |
732 | 732 | ); |
733 | 733 | |
734 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_delete_registration' ) ) { |
|
734 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_delete_registration')) { |
|
735 | 735 | $this->_views['incomplete'] = array( |
736 | 736 | 'slug' => 'incomplete', |
737 | 737 | 'label' => __('Incomplete', 'event_espresso'), |
@@ -767,7 +767,7 @@ discard block |
||
767 | 767 | ) |
768 | 768 | ); |
769 | 769 | |
770 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_trash_attendees' ) ) { |
|
770 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) { |
|
771 | 771 | $this->_views['trash'] = array( |
772 | 772 | 'slug' => 'trash', |
773 | 773 | 'label' => __('Trash', 'event_espresso'), |
@@ -806,18 +806,18 @@ discard block |
||
806 | 806 | 'desc' => __('View Transaction Invoice', 'event_espresso') |
807 | 807 | ), |
808 | 808 | ); |
809 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) { |
|
809 | + if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) { |
|
810 | 810 | $fc_items['resend_registration'] = array( |
811 | 811 | 'class' => 'dashicons dashicons-email-alt', |
812 | 812 | 'desc' => __('Resend Registration Details', 'event_espresso') |
813 | 813 | ); |
814 | 814 | } else { |
815 | - $fc_items['blank'] = array( 'class' => 'blank', 'desc' => '' ); |
|
815 | + $fc_items['blank'] = array('class' => 'blank', 'desc' => ''); |
|
816 | 816 | } |
817 | 817 | |
818 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) { |
|
819 | - $related_for_icon = EEH_MSG_Template::get_message_action_icon( 'see_notifications_for' ); |
|
820 | - if ( isset( $related_for_icon['css_class']) && isset( $related_for_icon['label'] ) ) { |
|
818 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) { |
|
819 | + $related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for'); |
|
820 | + if (isset($related_for_icon['css_class']) && isset($related_for_icon['label'])) { |
|
821 | 821 | $fc_items['view_related_messages'] = array( |
822 | 822 | 'class' => $related_for_icon['css_class'], |
823 | 823 | 'desc' => $related_for_icon['label'], |
@@ -827,31 +827,31 @@ discard block |
||
827 | 827 | |
828 | 828 | $sc_items = array( |
829 | 829 | 'approved_status' => array( |
830 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved, |
|
831 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) |
|
830 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved, |
|
831 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence') |
|
832 | 832 | ), |
833 | 833 | 'pending_status' => array( |
834 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment, |
|
835 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ) |
|
834 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment, |
|
835 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence') |
|
836 | 836 | ), |
837 | 837 | 'incomplete_status' => array( |
838 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_incomplete, |
|
839 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_incomplete, FALSE, 'sentence' ) |
|
838 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_incomplete, |
|
839 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_incomplete, FALSE, 'sentence') |
|
840 | 840 | ), |
841 | 841 | 'not_approved' => array( |
842 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved, |
|
843 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ) |
|
842 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved, |
|
843 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence') |
|
844 | 844 | ), |
845 | 845 | 'declined_status' => array( |
846 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined, |
|
847 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) |
|
846 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined, |
|
847 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence') |
|
848 | 848 | ), |
849 | 849 | 'cancelled_status' => array( |
850 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled, |
|
851 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) |
|
850 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled, |
|
851 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence') |
|
852 | 852 | ) |
853 | 853 | ); |
854 | - return array_merge( $fc_items, $sc_items ); |
|
854 | + return array_merge($fc_items, $sc_items); |
|
855 | 855 | } |
856 | 856 | |
857 | 857 | |
@@ -865,9 +865,9 @@ discard block |
||
865 | 865 | */ |
866 | 866 | protected function _registrations_overview_list_table() { |
867 | 867 | $this->_template_args['admin_page_header'] = ''; |
868 | - $EVT_ID = ! empty( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : 0; |
|
869 | - if ( $EVT_ID ) { |
|
870 | - if ( EE_Registry::instance()->CAP->current_user_can( |
|
868 | + $EVT_ID = ! empty($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : 0; |
|
869 | + if ($EVT_ID) { |
|
870 | + if (EE_Registry::instance()->CAP->current_user_can( |
|
871 | 871 | 'ee_edit_registrations', |
872 | 872 | 'espresso_registrations_new_registration', |
873 | 873 | $EVT_ID |
@@ -876,34 +876,34 @@ discard block |
||
876 | 876 | $this->_admin_page_title .= $this->get_action_link_or_button( |
877 | 877 | 'new_registration', |
878 | 878 | 'add-registrant', |
879 | - array( 'event_id' => $EVT_ID ), |
|
879 | + array('event_id' => $EVT_ID), |
|
880 | 880 | 'add-new-h2' |
881 | 881 | ); |
882 | 882 | } |
883 | - $event = EEM_Event::instance()->get_one_by_ID( $EVT_ID ); |
|
884 | - if ( $event instanceof EE_Event ) { |
|
883 | + $event = EEM_Event::instance()->get_one_by_ID($EVT_ID); |
|
884 | + if ($event instanceof EE_Event) { |
|
885 | 885 | $this->_template_args['admin_page_header'] = sprintf( |
886 | - __( '%s Viewing registrations for the event: %s%s', 'event_espresso' ), |
|
886 | + __('%s Viewing registrations for the event: %s%s', 'event_espresso'), |
|
887 | 887 | '<h3 style="line-height:1.5em;">', |
888 | - '<br /><a href="' . EE_Admin_Page::add_query_args_and_nonce( |
|
889 | - array( 'action' => 'edit', 'post' => $event->ID() ), |
|
888 | + '<br /><a href="'.EE_Admin_Page::add_query_args_and_nonce( |
|
889 | + array('action' => 'edit', 'post' => $event->ID()), |
|
890 | 890 | EVENTS_ADMIN_URL |
891 | - ) . '"> ' . $event->get( 'EVT_name' ) . ' </a> ', |
|
891 | + ).'"> '.$event->get('EVT_name').' </a> ', |
|
892 | 892 | '</h3>' |
893 | 893 | ); |
894 | 894 | } |
895 | - $DTT_ID = ! empty( $this->_req_data['datetime_id'] ) ? absint( $this->_req_data['datetime_id'] ) : 0; |
|
896 | - $datetime = EEM_Datetime::instance()->get_one_by_ID( $DTT_ID ); |
|
897 | - if ( $datetime instanceof EE_Datetime && $this->_template_args['admin_page_header'] !== '' ) { |
|
898 | - $this->_template_args['admin_page_header'] = substr( $this->_template_args['admin_page_header'], 0, -5 ); |
|
895 | + $DTT_ID = ! empty($this->_req_data['datetime_id']) ? absint($this->_req_data['datetime_id']) : 0; |
|
896 | + $datetime = EEM_Datetime::instance()->get_one_by_ID($DTT_ID); |
|
897 | + if ($datetime instanceof EE_Datetime && $this->_template_args['admin_page_header'] !== '') { |
|
898 | + $this->_template_args['admin_page_header'] = substr($this->_template_args['admin_page_header'], 0, -5); |
|
899 | 899 | $this->_template_args['admin_page_header'] .= ' <span class="drk-grey-text">'; |
900 | 900 | $this->_template_args['admin_page_header'] .= '<span class="dashicons dashicons-calendar"></span>'; |
901 | 901 | $this->_template_args['admin_page_header'] .= $datetime->name(); |
902 | - $this->_template_args['admin_page_header'] .= ' ( ' . $datetime->start_date() . ' )'; |
|
902 | + $this->_template_args['admin_page_header'] .= ' ( '.$datetime->start_date().' )'; |
|
903 | 903 | $this->_template_args['admin_page_header'] .= '</span></h3>'; |
904 | 904 | } |
905 | 905 | } |
906 | - $this->_template_args['after_list_table'] = $this->_display_legend( $this->_registration_legend_items() ); |
|
906 | + $this->_template_args['after_list_table'] = $this->_display_legend($this->_registration_legend_items()); |
|
907 | 907 | $this->display_admin_list_table_page_with_no_sidebar(); |
908 | 908 | } |
909 | 909 | |
@@ -918,19 +918,19 @@ discard block |
||
918 | 918 | */ |
919 | 919 | private function _set_registration_object() { |
920 | 920 | //get out if we've already set the object |
921 | - if ( is_object( $this->_registration )) { |
|
921 | + if (is_object($this->_registration)) { |
|
922 | 922 | return TRUE; |
923 | 923 | } |
924 | 924 | |
925 | 925 | $REG = EEM_Registration::instance(); |
926 | 926 | |
927 | - $REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE; |
|
927 | + $REG_ID = ( ! empty($this->_req_data['_REG_ID'])) ? absint($this->_req_data['_REG_ID']) : FALSE; |
|
928 | 928 | |
929 | - if ( $this->_registration = $REG->get_one_by_ID( $REG_ID )) |
|
929 | + if ($this->_registration = $REG->get_one_by_ID($REG_ID)) |
|
930 | 930 | return TRUE; |
931 | 931 | else { |
932 | - $error_msg = sprintf( __('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID ); |
|
933 | - EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
932 | + $error_msg = sprintf(__('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID); |
|
933 | + EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__); |
|
934 | 934 | $this->_registration = NULL; |
935 | 935 | return FALSE; |
936 | 936 | } |
@@ -948,25 +948,25 @@ discard block |
||
948 | 948 | * @throws \EE_Error |
949 | 949 | * @return mixed (int|array) int = count || array of registration objects |
950 | 950 | */ |
951 | - public function get_registrations( $per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE ) { |
|
952 | - $EVT_ID = ! empty( $this->_req_data['event_id'] ) && $this->_req_data['event_id'] > 0 ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
953 | - $CAT_ID = ! empty( $this->_req_data['EVT_CAT'] ) && (int) $this->_req_data['EVT_CAT'] > 0? absint( $this->_req_data['EVT_CAT'] ) : FALSE; |
|
954 | - $DTT_ID = isset( $this->_req_data['datetime_id'] ) ? absint( $this->_req_data['datetime_id'] ) : null; |
|
955 | - $reg_status = ! empty( $this->_req_data['_reg_status'] ) ? sanitize_text_field( $this->_req_data['_reg_status'] ) : FALSE; |
|
956 | - $month_range = ! empty( $this->_req_data['month_range'] ) ? sanitize_text_field( $this->_req_data['month_range'] ) : FALSE;//should be like 2013-april |
|
957 | - $today_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'today' ? TRUE : FALSE; |
|
958 | - $this_month_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'month' ? TRUE : FALSE; |
|
951 | + public function get_registrations($per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE) { |
|
952 | + $EVT_ID = ! empty($this->_req_data['event_id']) && $this->_req_data['event_id'] > 0 ? absint($this->_req_data['event_id']) : FALSE; |
|
953 | + $CAT_ID = ! empty($this->_req_data['EVT_CAT']) && (int) $this->_req_data['EVT_CAT'] > 0 ? absint($this->_req_data['EVT_CAT']) : FALSE; |
|
954 | + $DTT_ID = isset($this->_req_data['datetime_id']) ? absint($this->_req_data['datetime_id']) : null; |
|
955 | + $reg_status = ! empty($this->_req_data['_reg_status']) ? sanitize_text_field($this->_req_data['_reg_status']) : FALSE; |
|
956 | + $month_range = ! empty($this->_req_data['month_range']) ? sanitize_text_field($this->_req_data['month_range']) : FALSE; //should be like 2013-april |
|
957 | + $today_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'today' ? TRUE : FALSE; |
|
958 | + $this_month_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'month' ? TRUE : FALSE; |
|
959 | 959 | $start_date = FALSE; |
960 | 960 | $end_date = FALSE; |
961 | 961 | $_where = array(); |
962 | - $trash = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'trash' ? TRUE : FALSE; |
|
963 | - $incomplete = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'incomplete' ? TRUE : FALSE; |
|
962 | + $trash = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'trash' ? TRUE : FALSE; |
|
963 | + $incomplete = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'incomplete' ? TRUE : FALSE; |
|
964 | 964 | |
965 | 965 | //set orderby |
966 | 966 | $this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : ''; |
967 | 967 | |
968 | 968 | |
969 | - switch ( $this->_req_data['orderby'] ) { |
|
969 | + switch ($this->_req_data['orderby']) { |
|
970 | 970 | case '_REG_ID': |
971 | 971 | $orderby = 'REG_ID'; |
972 | 972 | break; |
@@ -986,30 +986,30 @@ discard block |
||
986 | 986 | $orderby = 'REG_date'; |
987 | 987 | } |
988 | 988 | |
989 | - $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC'; |
|
990 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
991 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
989 | + $sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC'; |
|
990 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
991 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
992 | 992 | |
993 | 993 | |
994 | - $offset = ($current_page-1)*$per_page; |
|
995 | - $limit = $count ? NULL : array( $offset, $per_page ); |
|
994 | + $offset = ($current_page - 1) * $per_page; |
|
995 | + $limit = $count ? NULL : array($offset, $per_page); |
|
996 | 996 | |
997 | - if($EVT_ID){ |
|
998 | - $_where['EVT_ID']=$EVT_ID; |
|
997 | + if ($EVT_ID) { |
|
998 | + $_where['EVT_ID'] = $EVT_ID; |
|
999 | 999 | } |
1000 | - if($CAT_ID){ |
|
1000 | + if ($CAT_ID) { |
|
1001 | 1001 | $_where['Event.Term_Taxonomy.term_id'] = $CAT_ID; |
1002 | 1002 | } |
1003 | 1003 | //if DTT is included we filter by that datetime. |
1004 | - if ( $DTT_ID ) { |
|
1004 | + if ($DTT_ID) { |
|
1005 | 1005 | $_where['Ticket.Datetime.DTT_ID'] = $DTT_ID; |
1006 | 1006 | } |
1007 | - if ( $incomplete ) { |
|
1007 | + if ($incomplete) { |
|
1008 | 1008 | $_where['STS_ID'] = EEM_Registration::status_id_incomplete; |
1009 | 1009 | } else if ( ! $trash) { |
1010 | - $_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete ); |
|
1010 | + $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
1011 | 1011 | } |
1012 | - if($reg_status){ |
|
1012 | + if ($reg_status) { |
|
1013 | 1013 | $_where['STS_ID'] = $reg_status; |
1014 | 1014 | } |
1015 | 1015 | |
@@ -1021,103 +1021,103 @@ discard block |
||
1021 | 1021 | $time_start = ' 00:00:00'; |
1022 | 1022 | $time_end = ' 23:59:59'; |
1023 | 1023 | |
1024 | - if($today_a || $today ){ |
|
1024 | + if ($today_a || $today) { |
|
1025 | 1025 | $curdate = date('Y-m-d', current_time('timestamp')); |
1026 | - $_where['REG_date']= array('BETWEEN', |
|
1026 | + $_where['REG_date'] = array('BETWEEN', |
|
1027 | 1027 | array( |
1028 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_start, 'Y-m-d H:i:s' ), |
|
1029 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_end, 'Y-m-d H:i:s' ), |
|
1028 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_start, 'Y-m-d H:i:s'), |
|
1029 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_end, 'Y-m-d H:i:s'), |
|
1030 | 1030 | )); |
1031 | - }elseif($this_month_a || $this_month){ |
|
1031 | + }elseif ($this_month_a || $this_month) { |
|
1032 | 1032 | $this_month_r = date('m', current_time('timestamp')); |
1033 | - $days_this_month = date( 't', current_time('timestamp') ); |
|
1034 | - $_where['REG_date']= array('BETWEEN', |
|
1033 | + $days_this_month = date('t', current_time('timestamp')); |
|
1034 | + $_where['REG_date'] = array('BETWEEN', |
|
1035 | 1035 | array( |
1036 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, 'Y-m-d H:i:s' ), |
|
1037 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, 'Y-m-d H:i:s' ) |
|
1036 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-01'.' '.$time_start, 'Y-m-d H:i:s'), |
|
1037 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-'.$days_this_month.' '.$time_end, 'Y-m-d H:i:s') |
|
1038 | 1038 | )); |
1039 | - }elseif($month_range){ |
|
1039 | + }elseif ($month_range) { |
|
1040 | 1040 | $pieces = explode(' ', $this->_req_data['month_range'], 3); |
1041 | - $month_r = !empty($pieces[0]) ? date('m', strtotime( $month_range ) ) : ''; |
|
1042 | - $year_r = !empty($pieces[1]) ? $pieces[1] : ''; |
|
1043 | - $days_in_month = date('t', strtotime($year_r . '-' . $month_r . '-' . '01') ); |
|
1044 | - $_where['REG_date']= array('BETWEEN', |
|
1045 | - array( EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-' . $days_in_month . ' 23:59:59', 'Y-m-d H:i:s' ) ) ); |
|
1046 | - }elseif($start_date && $end_date){ |
|
1041 | + $month_r = ! empty($pieces[0]) ? date('m', strtotime($month_range)) : ''; |
|
1042 | + $year_r = ! empty($pieces[1]) ? $pieces[1] : ''; |
|
1043 | + $days_in_month = date('t', strtotime($year_r.'-'.$month_r.'-'.'01')); |
|
1044 | + $_where['REG_date'] = array('BETWEEN', |
|
1045 | + array(EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-'.$days_in_month.' 23:59:59', 'Y-m-d H:i:s'))); |
|
1046 | + }elseif ($start_date && $end_date) { |
|
1047 | 1047 | throw new EE_Error("not yet supported"); |
1048 | - }elseif($start_date){ |
|
1048 | + }elseif ($start_date) { |
|
1049 | 1049 | throw new EE_Error("not yet supported"); |
1050 | - }elseif($end_date){ |
|
1050 | + }elseif ($end_date) { |
|
1051 | 1051 | throw new EE_Error("not yet supported"); |
1052 | 1052 | } |
1053 | 1053 | |
1054 | - if ( ! empty( $this->_req_data['s'] ) ) { |
|
1055 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
1054 | + if ( ! empty($this->_req_data['s'])) { |
|
1055 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
1056 | 1056 | $_where['OR'] = array( |
1057 | - 'Event.EVT_name' => array( 'LIKE', $sstr), |
|
1058 | - 'Event.EVT_desc' => array( 'LIKE', $sstr ), |
|
1059 | - 'Event.EVT_short_desc' => array( 'LIKE' , $sstr ), |
|
1060 | - 'Attendee.ATT_full_name' => array( 'LIKE', $sstr ), |
|
1061 | - 'Attendee.ATT_fname' => array( 'LIKE', $sstr ), |
|
1062 | - 'Attendee.ATT_lname' => array( 'LIKE', $sstr ), |
|
1063 | - 'Attendee.ATT_short_bio' => array( 'LIKE', $sstr ), |
|
1064 | - 'Attendee.ATT_email' => array('LIKE', $sstr ), |
|
1065 | - 'Attendee.ATT_address' => array( 'LIKE', $sstr ), |
|
1066 | - 'Attendee.ATT_address2' => array( 'LIKE', $sstr ), |
|
1067 | - 'Attendee.ATT_city' => array( 'LIKE', $sstr ), |
|
1068 | - 'REG_final_price' => array( 'LIKE', $sstr ), |
|
1069 | - 'REG_code' => array( 'LIKE', $sstr ), |
|
1070 | - 'REG_count' => array( 'LIKE' , $sstr ), |
|
1071 | - 'REG_group_size' => array( 'LIKE' , $sstr ), |
|
1072 | - 'Ticket.TKT_name' => array( 'LIKE', $sstr ), |
|
1073 | - 'Ticket.TKT_description' => array( 'LIKE', $sstr ), |
|
1074 | - 'Transaction.Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $sstr ) |
|
1057 | + 'Event.EVT_name' => array('LIKE', $sstr), |
|
1058 | + 'Event.EVT_desc' => array('LIKE', $sstr), |
|
1059 | + 'Event.EVT_short_desc' => array('LIKE', $sstr), |
|
1060 | + 'Attendee.ATT_full_name' => array('LIKE', $sstr), |
|
1061 | + 'Attendee.ATT_fname' => array('LIKE', $sstr), |
|
1062 | + 'Attendee.ATT_lname' => array('LIKE', $sstr), |
|
1063 | + 'Attendee.ATT_short_bio' => array('LIKE', $sstr), |
|
1064 | + 'Attendee.ATT_email' => array('LIKE', $sstr), |
|
1065 | + 'Attendee.ATT_address' => array('LIKE', $sstr), |
|
1066 | + 'Attendee.ATT_address2' => array('LIKE', $sstr), |
|
1067 | + 'Attendee.ATT_city' => array('LIKE', $sstr), |
|
1068 | + 'REG_final_price' => array('LIKE', $sstr), |
|
1069 | + 'REG_code' => array('LIKE', $sstr), |
|
1070 | + 'REG_count' => array('LIKE', $sstr), |
|
1071 | + 'REG_group_size' => array('LIKE', $sstr), |
|
1072 | + 'Ticket.TKT_name' => array('LIKE', $sstr), |
|
1073 | + 'Ticket.TKT_description' => array('LIKE', $sstr), |
|
1074 | + 'Transaction.Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $sstr) |
|
1075 | 1075 | ); |
1076 | 1076 | } |
1077 | 1077 | |
1078 | 1078 | //capability checks |
1079 | - if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations' ) ) { |
|
1079 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations')) { |
|
1080 | 1080 | $_where['AND'] = array( |
1081 | 1081 | 'Event.EVT_wp_user' => get_current_user_id() |
1082 | 1082 | ); |
1083 | 1083 | } |
1084 | 1084 | |
1085 | - if( $count ){ |
|
1086 | - if ( $trash ) { |
|
1087 | - return EEM_Registration::instance()->count_deleted( array( $_where )); |
|
1088 | - } else if ( $incomplete ) { |
|
1089 | - return EEM_Registration::instance()->count( array( $_where )); |
|
1085 | + if ($count) { |
|
1086 | + if ($trash) { |
|
1087 | + return EEM_Registration::instance()->count_deleted(array($_where)); |
|
1088 | + } else if ($incomplete) { |
|
1089 | + return EEM_Registration::instance()->count(array($_where)); |
|
1090 | 1090 | } else { |
1091 | - return EEM_Registration::instance()->count( array( $_where, 'default_where_conditions' => 'this_model_only' )); |
|
1091 | + return EEM_Registration::instance()->count(array($_where, 'default_where_conditions' => 'this_model_only')); |
|
1092 | 1092 | } |
1093 | 1093 | } else { |
1094 | 1094 | //make sure we remove default where conditions cause all registrations matching query are returned |
1095 | - $query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'default_where_conditions' => 'this_model_only' ); |
|
1096 | - if ( $per_page !== -1 ) { |
|
1095 | + $query_params = array($_where, 'order_by' => array($orderby => $sort), 'default_where_conditions' => 'this_model_only'); |
|
1096 | + if ($per_page !== -1) { |
|
1097 | 1097 | $query_params['limit'] = $limit; |
1098 | 1098 | } |
1099 | - $registrations = $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params); |
|
1099 | + $registrations = $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params); |
|
1100 | 1100 | |
1101 | - if ( $EVT_ID && isset( $registrations[0] ) && $registrations[0] instanceof EE_Registration && $registrations[0]->event_obj()) { |
|
1101 | + if ($EVT_ID && isset($registrations[0]) && $registrations[0] instanceof EE_Registration && $registrations[0]->event_obj()) { |
|
1102 | 1102 | $first_registration = $registrations[0]; |
1103 | 1103 | //EEH_Debug_Tools::printr( $registrations[0], '$registrations <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
1104 | 1104 | $event_name = $first_registration->event_obj()->name(); |
1105 | - $event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y, g:i:s a', $registrations[0]->DTT_EVT_start ) : ''; |
|
1105 | + $event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a'); // isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y, g:i:s a', $registrations[0]->DTT_EVT_start ) : ''; |
|
1106 | 1106 | // edit event link |
1107 | - if ( $event_name != '' ) { |
|
1108 | - $edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit_event', 'EVT_ID'=>$EVT_ID ), EVENTS_ADMIN_URL ); |
|
1109 | - $edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $event_name . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>'; |
|
1110 | - $event_name .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ; |
|
1107 | + if ($event_name != '') { |
|
1108 | + $edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit_event', 'EVT_ID'=>$EVT_ID), EVENTS_ADMIN_URL); |
|
1109 | + $edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$event_name.'">'.__('Edit Event', 'event_espresso').'</a>'; |
|
1110 | + $event_name .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>'; |
|
1111 | 1111 | } |
1112 | 1112 | |
1113 | - $back_2_reg_url = self::add_query_args_and_nonce( array( 'action'=>'default' ), REG_ADMIN_URL ); |
|
1114 | - $back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="' . esc_attr__( 'click to return to viewing all registrations ', 'event_espresso' ) . '">« ' . __( 'Back to All Registrations', 'event_espresso' ) . '</a>'; |
|
1113 | + $back_2_reg_url = self::add_query_args_and_nonce(array('action'=>'default'), REG_ADMIN_URL); |
|
1114 | + $back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="'.esc_attr__('click to return to viewing all registrations ', 'event_espresso').'">« '.__('Back to All Registrations', 'event_espresso').'</a>'; |
|
1115 | 1115 | |
1116 | 1116 | $this->_template_args['before_admin_page_content'] = ' |
1117 | 1117 | <div id="admin-page-header"> |
1118 | - <h1><span class="small-text not-bold">'.__( 'Event: ', 'event_espresso' ).'</span>'. $event_name .'</h1> |
|
1119 | - <h3><span class="small-text not-bold">'.__( 'Date: ', 'event_espresso' ). '</span>'. $event_date .'</h3> |
|
1120 | - <span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk . '</span> |
|
1118 | + <h1><span class="small-text not-bold">'.__('Event: ', 'event_espresso').'</span>'.$event_name.'</h1> |
|
1119 | + <h3><span class="small-text not-bold">'.__('Date: ', 'event_espresso').'</span>'.$event_date.'</h3> |
|
1120 | + <span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk.'</span> |
|
1121 | 1121 | </div> |
1122 | 1122 | '; |
1123 | 1123 | |
@@ -1155,7 +1155,7 @@ discard block |
||
1155 | 1155 | |
1156 | 1156 | $this->_set_registration_object(); |
1157 | 1157 | |
1158 | - if ( is_object( $this->_registration )) { |
|
1158 | + if (is_object($this->_registration)) { |
|
1159 | 1159 | $transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance(); |
1160 | 1160 | $this->_session = $transaction->session_data(); |
1161 | 1161 | |
@@ -1163,10 +1163,10 @@ discard block |
||
1163 | 1163 | |
1164 | 1164 | |
1165 | 1165 | $this->_template_args['reg_nmbr']['value'] = $this->_registration->ID(); |
1166 | - $this->_template_args['reg_nmbr']['label'] = __( 'Registration Number', 'event_espresso' ); |
|
1166 | + $this->_template_args['reg_nmbr']['label'] = __('Registration Number', 'event_espresso'); |
|
1167 | 1167 | |
1168 | - $this->_template_args['reg_datetime']['value'] = $this->_registration->get_i18n_datetime( 'REG_date' ); |
|
1169 | - $this->_template_args['reg_datetime']['label'] = __( 'Date', 'event_espresso' ); |
|
1168 | + $this->_template_args['reg_datetime']['value'] = $this->_registration->get_i18n_datetime('REG_date'); |
|
1169 | + $this->_template_args['reg_datetime']['label'] = __('Date', 'event_espresso'); |
|
1170 | 1170 | |
1171 | 1171 | $this->_template_args['grand_total'] = $transaction->total(); |
1172 | 1172 | |
@@ -1174,19 +1174,19 @@ discard block |
||
1174 | 1174 | // link back to overview |
1175 | 1175 | $this->_template_args['reg_overview_url'] = REG_ADMIN_URL; |
1176 | 1176 | $this->_template_args['registration'] = $this->_registration; |
1177 | - $this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $event_id ), REG_ADMIN_URL ); |
|
1178 | - $this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions' ), admin_url( 'admin.php' ) ); |
|
1179 | - $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id ), admin_url( 'admin.php' ) ); |
|
1177 | + $this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $event_id), REG_ADMIN_URL); |
|
1178 | + $this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions'), admin_url('admin.php')); |
|
1179 | + $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id), admin_url('admin.php')); |
|
1180 | 1180 | |
1181 | 1181 | //next and previous links |
1182 | - $next_reg = $this->_registration->next(null, array(), 'REG_ID' ); |
|
1183 | - $this->_template_args['next_registration'] = $next_reg ? $this->_next_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-right ee-icon-size-22' ) : ''; |
|
1184 | - $previous_reg = $this->_registration->previous( null, array(), 'REG_ID' ); |
|
1185 | - $this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-left ee-icon-size-22' ) : ''; |
|
1182 | + $next_reg = $this->_registration->next(null, array(), 'REG_ID'); |
|
1183 | + $this->_template_args['next_registration'] = $next_reg ? $this->_next_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-right ee-icon-size-22') : ''; |
|
1184 | + $previous_reg = $this->_registration->previous(null, array(), 'REG_ID'); |
|
1185 | + $this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-left ee-icon-size-22') : ''; |
|
1186 | 1186 | |
1187 | 1187 | // grab header |
1188 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_header.template.php'; |
|
1189 | - $this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1188 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_header.template.php'; |
|
1189 | + $this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1190 | 1190 | |
1191 | 1191 | } else { |
1192 | 1192 | |
@@ -1205,17 +1205,17 @@ discard block |
||
1205 | 1205 | |
1206 | 1206 | |
1207 | 1207 | protected function _registration_details_metaboxes() { |
1208 | - do_action( 'AHEE__Registrations_Admin_Page___registration_details_metabox__start', $this ); |
|
1208 | + do_action('AHEE__Registrations_Admin_Page___registration_details_metabox__start', $this); |
|
1209 | 1209 | $this->_set_registration_object(); |
1210 | 1210 | $attendee = $this->_registration instanceof EE_Registration ? $this->_registration->attendee() : null; |
1211 | - add_meta_box( 'edit-reg-status-mbox', __( 'Registration Status', 'event_espresso' ), array( $this, 'set_reg_status_buttons_metabox' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1212 | - add_meta_box( 'edit-reg-details-mbox', __( 'Registration Details', 'event_espresso' ), array( $this, '_reg_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1213 | - if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox' ) ) { |
|
1214 | - add_meta_box( 'edit-reg-questions-mbox', __( 'Registration Form Answers', 'event_espresso' ), array( $this, '_reg_questions_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1211 | + add_meta_box('edit-reg-status-mbox', __('Registration Status', 'event_espresso'), array($this, 'set_reg_status_buttons_metabox'), $this->wp_page_slug, 'normal', 'high'); |
|
1212 | + add_meta_box('edit-reg-details-mbox', __('Registration Details', 'event_espresso'), array($this, '_reg_details_meta_box'), $this->wp_page_slug, 'normal', 'high'); |
|
1213 | + if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox')) { |
|
1214 | + add_meta_box('edit-reg-questions-mbox', __('Registration Form Answers', 'event_espresso'), array($this, '_reg_questions_meta_box'), $this->wp_page_slug, 'normal', 'high'); |
|
1215 | 1215 | } |
1216 | - add_meta_box( 'edit-reg-registrant-mbox', __( 'Contact Details', 'event_espresso' ), array( $this, '_reg_registrant_side_meta_box' ), $this->wp_page_slug, 'side', 'high' ); |
|
1217 | - if ( $this->_registration->group_size() > 1 ) { |
|
1218 | - add_meta_box( 'edit-reg-attendees-mbox', __( 'Other Registrations in this Transaction', 'event_espresso' ), array( $this, '_reg_attendees_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1216 | + add_meta_box('edit-reg-registrant-mbox', __('Contact Details', 'event_espresso'), array($this, '_reg_registrant_side_meta_box'), $this->wp_page_slug, 'side', 'high'); |
|
1217 | + if ($this->_registration->group_size() > 1) { |
|
1218 | + add_meta_box('edit-reg-attendees-mbox', __('Other Registrations in this Transaction', 'event_espresso'), array($this, '_reg_attendees_meta_box'), $this->wp_page_slug, 'normal', 'high'); |
|
1219 | 1219 | } |
1220 | 1220 | } |
1221 | 1221 | |
@@ -1234,22 +1234,22 @@ discard block |
||
1234 | 1234 | $is_complete = $this->_registration->transaction()->is_completed(); |
1235 | 1235 | //let's get an array of all possible buttons that we can just reference |
1236 | 1236 | $status_buttons = $this->_get_reg_status_buttons(); |
1237 | - $template_args[ 'reg_status_value' ] = $this->_registration->pretty_status(); |
|
1238 | - $template_args[ 'reg_status_class' ] = 'status-' . $this->_registration->status_ID(); |
|
1237 | + $template_args['reg_status_value'] = $this->_registration->pretty_status(); |
|
1238 | + $template_args['reg_status_class'] = 'status-'.$this->_registration->status_ID(); |
|
1239 | 1239 | $template_args['attendee'] = $this->_registration->attendee(); |
1240 | - $template = REG_TEMPLATE_PATH . 'reg_status_change_buttons.template.php'; |
|
1241 | - if ( $this->_set_registration_object() ) { |
|
1240 | + $template = REG_TEMPLATE_PATH.'reg_status_change_buttons.template.php'; |
|
1241 | + if ($this->_set_registration_object()) { |
|
1242 | 1242 | $current_status = $this->_registration->status_ID(); |
1243 | - unset( $status_buttons[$current_status] ); |
|
1244 | - if ( $current_status != EEM_Registration::status_id_pending_payment && $is_complete ) { |
|
1245 | - unset( $status_buttons[EEM_Registration::status_id_pending_payment] ); |
|
1243 | + unset($status_buttons[$current_status]); |
|
1244 | + if ($current_status != EEM_Registration::status_id_pending_payment && $is_complete) { |
|
1245 | + unset($status_buttons[EEM_Registration::status_id_pending_payment]); |
|
1246 | 1246 | } |
1247 | - $template_args['status_buttons'] = implode( "\n", $status_buttons ); |
|
1247 | + $template_args['status_buttons'] = implode("\n", $status_buttons); |
|
1248 | 1248 | } |
1249 | 1249 | $template_args['form_url'] = REG_ADMIN_URL; |
1250 | 1250 | $template_args['REG_ID'] = $this->_registration->ID(); |
1251 | - $template_args['nonce'] = wp_nonce_field( 'change_reg_status_nonce', 'change_reg_status_nonce', FALSE, FALSE ); |
|
1252 | - EEH_Template::display_template( $template, $template_args ); |
|
1251 | + $template_args['nonce'] = wp_nonce_field('change_reg_status_nonce', 'change_reg_status_nonce', FALSE, FALSE); |
|
1252 | + EEH_Template::display_template($template, $template_args); |
|
1253 | 1253 | |
1254 | 1254 | } |
1255 | 1255 | |
@@ -1263,11 +1263,11 @@ discard block |
||
1263 | 1263 | private function _get_reg_status_buttons() { |
1264 | 1264 | |
1265 | 1265 | $buttons = array( |
1266 | - EEM_Registration::status_id_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_approved . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) . '">', |
|
1267 | - EEM_Registration::status_id_pending_payment => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_pending_payment . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ) . '">', |
|
1268 | - EEM_Registration::status_id_not_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_not_approved . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ) . '">', |
|
1269 | - EEM_Registration::status_id_declined => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_declined . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) . '">', |
|
1270 | - EEM_Registration::status_id_cancelled =>'<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_cancelled . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) . '">', |
|
1266 | + EEM_Registration::status_id_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_approved.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence').'">', |
|
1267 | + EEM_Registration::status_id_pending_payment => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_pending_payment.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence').'">', |
|
1268 | + EEM_Registration::status_id_not_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_not_approved.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence').'">', |
|
1269 | + EEM_Registration::status_id_declined => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_declined.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence').'">', |
|
1270 | + EEM_Registration::status_id_cancelled =>'<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_cancelled.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence').'">', |
|
1271 | 1271 | ); |
1272 | 1272 | return $buttons; |
1273 | 1273 | } |
@@ -1281,13 +1281,13 @@ discard block |
||
1281 | 1281 | * |
1282 | 1282 | * @return array (array with reg_id(s) updated and whether update was successful. |
1283 | 1283 | */ |
1284 | - protected function _set_registration_status_from_request( $status = false, $notify = false ) { |
|
1285 | - $REG_ID = isset( $this->_req_data['_REG_ID'] ) ? (array) $this->_req_data['_REG_ID'] : array(); |
|
1284 | + protected function _set_registration_status_from_request($status = false, $notify = false) { |
|
1285 | + $REG_ID = isset($this->_req_data['_REG_ID']) ? (array) $this->_req_data['_REG_ID'] : array(); |
|
1286 | 1286 | |
1287 | - $success = $this->_set_registration_status( $REG_ID, $status ); |
|
1287 | + $success = $this->_set_registration_status($REG_ID, $status); |
|
1288 | 1288 | |
1289 | 1289 | //notify? |
1290 | - if ( $success && $notify && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) { |
|
1290 | + if ($success && $notify && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) { |
|
1291 | 1291 | $this->_process_resend_registration(); |
1292 | 1292 | } |
1293 | 1293 | |
@@ -1305,19 +1305,19 @@ discard block |
||
1305 | 1305 | * @param bool $status |
1306 | 1306 | * @return array (an array with 'success' key representing whether status change was successful, and 'REG_ID' as the array of updated registrations). |
1307 | 1307 | */ |
1308 | - protected function _set_registration_status( $REG_ID, $status = false ) { |
|
1308 | + protected function _set_registration_status($REG_ID, $status = false) { |
|
1309 | 1309 | $success = true; |
1310 | 1310 | // set default status if none is passed |
1311 | 1311 | $status = $status ? $status : EEM_Registration::status_id_pending_payment; |
1312 | 1312 | |
1313 | 1313 | //typecast and sanitize reg_id |
1314 | - $reg_ids = array_filter( (array) $REG_ID, 'absint' ); |
|
1314 | + $reg_ids = array_filter((array) $REG_ID, 'absint'); |
|
1315 | 1315 | |
1316 | 1316 | //loop through REG_ID's and change status |
1317 | - foreach ( $reg_ids as $r_id ) { |
|
1318 | - $registration = EEM_Registration::instance()->get_one_by_ID( $r_id ); |
|
1319 | - if ( $registration instanceof EE_Registration ) { |
|
1320 | - $registration->set_status( $status ); |
|
1317 | + foreach ($reg_ids as $r_id) { |
|
1318 | + $registration = EEM_Registration::instance()->get_one_by_ID($r_id); |
|
1319 | + if ($registration instanceof EE_Registration) { |
|
1320 | + $registration->set_status($status); |
|
1321 | 1321 | $result = $registration->save(); |
1322 | 1322 | |
1323 | 1323 | //verifying explicit fails because update *may* just return 0 for 0 rows affected |
@@ -1329,7 +1329,7 @@ discard block |
||
1329 | 1329 | $this->_req_data['_REG_ID'] = $reg_ids; |
1330 | 1330 | |
1331 | 1331 | //return $success and processed registrations |
1332 | - return array( 'REG_ID' => $reg_ids, 'success' => $success ); |
|
1332 | + return array('REG_ID' => $reg_ids, 'success' => $success); |
|
1333 | 1333 | } |
1334 | 1334 | |
1335 | 1335 | |
@@ -1341,37 +1341,37 @@ discard block |
||
1341 | 1341 | * @param bool $notify indicates whether the _set_registration_status_from_request does notifications or not. |
1342 | 1342 | * @return void |
1343 | 1343 | */ |
1344 | - protected function _reg_status_change_return( $STS_ID, $notify = false ) { |
|
1344 | + protected function _reg_status_change_return($STS_ID, $notify = false) { |
|
1345 | 1345 | |
1346 | - $result = ! empty( $STS_ID ) ? $this->_set_registration_status_from_request( $STS_ID, $notify ) : array( 'success' => false ); |
|
1346 | + $result = ! empty($STS_ID) ? $this->_set_registration_status_from_request($STS_ID, $notify) : array('success' => false); |
|
1347 | 1347 | |
1348 | 1348 | |
1349 | - $success = isset( $result['success'] ) && $result['success']; |
|
1349 | + $success = isset($result['success']) && $result['success']; |
|
1350 | 1350 | |
1351 | 1351 | //setup success message |
1352 | - if ( $success ) { |
|
1353 | - $msg = is_array( $result['REG_ID'] ) && count( $result['REG_ID'] ) > 1 ? sprintf( __('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower' ) ) : sprintf( __('Registrations have been set to %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower' ) ) ; |
|
1354 | - EE_Error::add_success( $msg ); |
|
1352 | + if ($success) { |
|
1353 | + $msg = is_array($result['REG_ID']) && count($result['REG_ID']) > 1 ? sprintf(__('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower')) : sprintf(__('Registrations have been set to %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower')); |
|
1354 | + EE_Error::add_success($msg); |
|
1355 | 1355 | } else { |
1356 | - EE_Error::add_error( __('Something went wrong, and the status was not changed', 'event_espresso' ), __FILE__, __LINE__, __FUNCTION__ ); |
|
1356 | + EE_Error::add_error(__('Something went wrong, and the status was not changed', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__); |
|
1357 | 1357 | } |
1358 | 1358 | |
1359 | - $route = isset( $this->_req_data['return'] ) && $this->_req_data['return'] == 'view_registration' ? array( 'action' => 'view_registration', '_REG_ID' => $result['REG_ID'][0] ) : array( 'action' => 'default' ); |
|
1359 | + $route = isset($this->_req_data['return']) && $this->_req_data['return'] == 'view_registration' ? array('action' => 'view_registration', '_REG_ID' => $result['REG_ID'][0]) : array('action' => 'default'); |
|
1360 | 1360 | //unset nonces |
1361 | - foreach ( $this->_req_data as $ref => $value ) { |
|
1362 | - if ( strpos( $ref, 'nonce' ) !== false ) { |
|
1363 | - unset( $this->_req_data[$ref] ); |
|
1361 | + foreach ($this->_req_data as $ref => $value) { |
|
1362 | + if (strpos($ref, 'nonce') !== false) { |
|
1363 | + unset($this->_req_data[$ref]); |
|
1364 | 1364 | continue; |
1365 | 1365 | } |
1366 | 1366 | |
1367 | - $value = is_array( $value ) ? array_map( 'urlencode', $value ) : urlencode( $value ); |
|
1367 | + $value = is_array($value) ? array_map('urlencode', $value) : urlencode($value); |
|
1368 | 1368 | $this->_req_data[$ref] = $value; |
1369 | 1369 | } |
1370 | 1370 | |
1371 | 1371 | //merge request vars so that the reloaded list table contains any existing filter query params |
1372 | - $route = array_merge( $this->_req_data, $route ); |
|
1372 | + $route = array_merge($this->_req_data, $route); |
|
1373 | 1373 | |
1374 | - $this->_redirect_after_action( false, '', '', $route, true ); |
|
1374 | + $this->_redirect_after_action(false, '', '', $route, true); |
|
1375 | 1375 | } |
1376 | 1376 | |
1377 | 1377 | |
@@ -1383,29 +1383,29 @@ discard block |
||
1383 | 1383 | protected function _change_reg_status() { |
1384 | 1384 | $this->_req_data['return'] = 'view_registration'; |
1385 | 1385 | //set notify based on whether the send notifications toggle is set or not |
1386 | - $notify = ! empty( $this->_req_data['txn_reg_status_change']['send_notifications'] ); |
|
1387 | - $this->_req_data[ '_reg_status_id' ] = isset( $this->_req_data[ '_reg_status_id' ] ) ? $this->_req_data[ '_reg_status_id' ] : ''; |
|
1386 | + $notify = ! empty($this->_req_data['txn_reg_status_change']['send_notifications']); |
|
1387 | + $this->_req_data['_reg_status_id'] = isset($this->_req_data['_reg_status_id']) ? $this->_req_data['_reg_status_id'] : ''; |
|
1388 | 1388 | |
1389 | - switch ( $this->_req_data['_reg_status_id'] ) { |
|
1390 | - case EEH_Template::pretty_status( EEM_Registration::status_id_approved, false, 'sentence' ) : |
|
1391 | - $this->approve_registration( $notify ); |
|
1389 | + switch ($this->_req_data['_reg_status_id']) { |
|
1390 | + case EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence') : |
|
1391 | + $this->approve_registration($notify); |
|
1392 | 1392 | break; |
1393 | - case EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, false, 'sentence' ) : |
|
1394 | - $this->pending_registration( $notify ); |
|
1393 | + case EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence') : |
|
1394 | + $this->pending_registration($notify); |
|
1395 | 1395 | break; |
1396 | - case EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, false, 'sentence' ) : |
|
1397 | - $this->not_approve_registration( $notify ); |
|
1396 | + case EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence') : |
|
1397 | + $this->not_approve_registration($notify); |
|
1398 | 1398 | break; |
1399 | - case EEH_Template::pretty_status( EEM_Registration::status_id_declined, false, 'sentence' ) : |
|
1400 | - $this->decline_registration( $notify ); |
|
1399 | + case EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence') : |
|
1400 | + $this->decline_registration($notify); |
|
1401 | 1401 | break; |
1402 | - case EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, false, 'sentence' ) : |
|
1403 | - $this->cancel_registration( $notify ); |
|
1402 | + case EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence') : |
|
1403 | + $this->cancel_registration($notify); |
|
1404 | 1404 | break; |
1405 | 1405 | default : |
1406 | 1406 | $result['success'] = false; |
1407 | - unset( $this->_req_data['return'] ); |
|
1408 | - $this->_reg_status_change_return( '', false ); |
|
1407 | + unset($this->_req_data['return']); |
|
1408 | + $this->_reg_status_change_return('', false); |
|
1409 | 1409 | break; |
1410 | 1410 | } |
1411 | 1411 | } |
@@ -1418,8 +1418,8 @@ discard block |
||
1418 | 1418 | * @param bool $notify whether or not to notify the registrant about their approval. |
1419 | 1419 | * @return void |
1420 | 1420 | */ |
1421 | - protected function approve_registration( $notify = false ) { |
|
1422 | - $this->_reg_status_change_return( EEM_Registration::status_id_approved, $notify ); |
|
1421 | + protected function approve_registration($notify = false) { |
|
1422 | + $this->_reg_status_change_return(EEM_Registration::status_id_approved, $notify); |
|
1423 | 1423 | } |
1424 | 1424 | |
1425 | 1425 | |
@@ -1431,8 +1431,8 @@ discard block |
||
1431 | 1431 | * @param bool $notify whether or not to notify the registrant about their approval. |
1432 | 1432 | * @return void |
1433 | 1433 | */ |
1434 | - protected function decline_registration( $notify = false ) { |
|
1435 | - $this->_reg_status_change_return( EEM_Registration::status_id_declined, $notify ); |
|
1434 | + protected function decline_registration($notify = false) { |
|
1435 | + $this->_reg_status_change_return(EEM_Registration::status_id_declined, $notify); |
|
1436 | 1436 | } |
1437 | 1437 | |
1438 | 1438 | |
@@ -1444,8 +1444,8 @@ discard block |
||
1444 | 1444 | * @param bool $notify whether or not to notify the registrant about their approval. |
1445 | 1445 | * @return void |
1446 | 1446 | */ |
1447 | - protected function cancel_registration( $notify = false ) { |
|
1448 | - $this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $notify ); |
|
1447 | + protected function cancel_registration($notify = false) { |
|
1448 | + $this->_reg_status_change_return(EEM_Registration::status_id_cancelled, $notify); |
|
1449 | 1449 | } |
1450 | 1450 | |
1451 | 1451 | |
@@ -1458,8 +1458,8 @@ discard block |
||
1458 | 1458 | * @param bool $notify whether or not to notify the registrant about their approval. |
1459 | 1459 | * @return void |
1460 | 1460 | */ |
1461 | - protected function not_approve_registration( $notify = false ) { |
|
1462 | - $this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $notify ); |
|
1461 | + protected function not_approve_registration($notify = false) { |
|
1462 | + $this->_reg_status_change_return(EEM_Registration::status_id_not_approved, $notify); |
|
1463 | 1463 | } |
1464 | 1464 | |
1465 | 1465 | |
@@ -1470,8 +1470,8 @@ discard block |
||
1470 | 1470 | * @param bool $notify whether or not to notify the registrant about their approval. |
1471 | 1471 | * @return void |
1472 | 1472 | */ |
1473 | - protected function pending_registration( $notify = false ) { |
|
1474 | - $this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $notify ); |
|
1473 | + protected function pending_registration($notify = false) { |
|
1474 | + $this->_reg_status_change_return(EEM_Registration::status_id_pending_payment, $notify); |
|
1475 | 1475 | } |
1476 | 1476 | |
1477 | 1477 | |
@@ -1485,19 +1485,19 @@ discard block |
||
1485 | 1485 | public function _reg_details_meta_box() { |
1486 | 1486 | EEH_Autoloader::register_line_item_display_autoloaders(); |
1487 | 1487 | EEH_Autoloader::register_line_item_filter_autoloaders(); |
1488 | - EE_Registry::instance()->load_helper( 'Line_Item' ); |
|
1488 | + EE_Registry::instance()->load_helper('Line_Item'); |
|
1489 | 1489 | $transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance(); |
1490 | 1490 | $this->_session = $transaction->session_data(); |
1491 | 1491 | |
1492 | 1492 | $filters = new EE_Line_Item_Filter_Collection(); |
1493 | - $filters->add( new EE_Single_Registration_Line_Item_Filter( $this->_registration ) ); |
|
1494 | - $filters->add( new EE_Non_Zero_Line_Item_Filter() ); |
|
1495 | - $line_item_filter_processor = new EE_Line_Item_Filter_Processor( $filters, $transaction->total_line_item() ); |
|
1493 | + $filters->add(new EE_Single_Registration_Line_Item_Filter($this->_registration)); |
|
1494 | + $filters->add(new EE_Non_Zero_Line_Item_Filter()); |
|
1495 | + $line_item_filter_processor = new EE_Line_Item_Filter_Processor($filters, $transaction->total_line_item()); |
|
1496 | 1496 | $filtered_line_item_tree = $line_item_filter_processor->process(); |
1497 | 1497 | |
1498 | 1498 | $this->_template_args['REG_ID'] = $this->_registration->ID(); |
1499 | - $line_item_display = new EE_Line_Item_Display( 'reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy' ); |
|
1500 | - $this->_template_args['line_item_table'] = $line_item_display->display_line_item( $filtered_line_item_tree, array( 'EE_Registration' => $this->_registration ) ); |
|
1499 | + $line_item_display = new EE_Line_Item_Display('reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy'); |
|
1500 | + $this->_template_args['line_item_table'] = $line_item_display->display_line_item($filtered_line_item_tree, array('EE_Registration' => $this->_registration)); |
|
1501 | 1501 | |
1502 | 1502 | |
1503 | 1503 | $attendee = $this->_registration->attendee(); |
@@ -1508,10 +1508,10 @@ discard block |
||
1508 | 1508 | ) |
1509 | 1509 | ? EEH_Template::get_button_or_link( |
1510 | 1510 | EE_Admin_Page::add_query_args_and_nonce( |
1511 | - array( 'action' => 'view_transaction', 'TXN_ID' => $transaction->ID() ), |
|
1511 | + array('action' => 'view_transaction', 'TXN_ID' => $transaction->ID()), |
|
1512 | 1512 | TXN_ADMIN_URL |
1513 | 1513 | ), |
1514 | - esc_html__( ' View Transaction' ), |
|
1514 | + esc_html__(' View Transaction'), |
|
1515 | 1515 | 'button secondary-button right', |
1516 | 1516 | 'dashicons dashicons-cart' |
1517 | 1517 | ) |
@@ -1531,59 +1531,59 @@ discard block |
||
1531 | 1531 | ), |
1532 | 1532 | REG_ADMIN_URL |
1533 | 1533 | ), |
1534 | - esc_html__( ' Resend Registration' ), |
|
1534 | + esc_html__(' Resend Registration'), |
|
1535 | 1535 | 'button secondary-button right', |
1536 | 1536 | 'dashicons dashicons-email-alt' |
1537 | 1537 | ) |
1538 | 1538 | : ''; |
1539 | 1539 | |
1540 | 1540 | $this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign; |
1541 | - $payment = $transaction->get_first_related( 'Payment' ); |
|
1541 | + $payment = $transaction->get_first_related('Payment'); |
|
1542 | 1542 | $payment = ! $payment instanceof EE_Payment ? EE_Payment::new_instance() : $payment; |
1543 | - $payment_method = $payment->get_first_related( 'Payment_Method' ); |
|
1543 | + $payment_method = $payment->get_first_related('Payment_Method'); |
|
1544 | 1544 | $payment_method = ! $payment_method instanceof EE_Payment_Method ? EE_Payment_Method::new_instance() : $payment_method; |
1545 | - $reg_status_class = 'status-' . $this->_registration->status_ID(); |
|
1545 | + $reg_status_class = 'status-'.$this->_registration->status_ID(); |
|
1546 | 1546 | $reg_details = array( |
1547 | 1547 | 'payment_method' => $payment_method->name(), |
1548 | 1548 | 'response_msg' => $payment->gateway_response(), |
1549 | - 'registration_id' => $this->_registration->get( 'REG_code' ), |
|
1549 | + 'registration_id' => $this->_registration->get('REG_code'), |
|
1550 | 1550 | 'registration_session' => $this->_registration->session_ID(), |
1551 | - 'ip_address' => isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '', |
|
1552 | - 'user_agent' => isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '', |
|
1551 | + 'ip_address' => isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '', |
|
1552 | + 'user_agent' => isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '', |
|
1553 | 1553 | ); |
1554 | 1554 | |
1555 | 1555 | |
1556 | - if ( isset( $reg_details['registration_id'] )) { |
|
1556 | + if (isset($reg_details['registration_id'])) { |
|
1557 | 1557 | $this->_template_args['reg_details']['registration_id']['value'] = $reg_details['registration_id']; |
1558 | - $this->_template_args['reg_details']['registration_id']['label'] = __( 'Registration ID', 'event_espresso' ); |
|
1558 | + $this->_template_args['reg_details']['registration_id']['label'] = __('Registration ID', 'event_espresso'); |
|
1559 | 1559 | $this->_template_args['reg_details']['registration_id']['class'] = 'regular-text'; |
1560 | 1560 | } |
1561 | 1561 | |
1562 | - if ( isset( $reg_details['payment_method'] ) ) { |
|
1562 | + if (isset($reg_details['payment_method'])) { |
|
1563 | 1563 | $this->_template_args['reg_details']['payment_method']['value'] = $reg_details['payment_method']; |
1564 | - $this->_template_args['reg_details']['payment_method']['label'] = __( 'Most Recent Payment Method', 'event_espresso' ); |
|
1564 | + $this->_template_args['reg_details']['payment_method']['label'] = __('Most Recent Payment Method', 'event_espresso'); |
|
1565 | 1565 | $this->_template_args['reg_details']['payment_method']['class'] = 'regular-text'; |
1566 | 1566 | $this->_template_args['reg_details']['response_msg']['value'] = $reg_details['response_msg']; |
1567 | - $this->_template_args['reg_details']['response_msg']['label'] = __( 'Payment method response', 'event_espresso' ); |
|
1567 | + $this->_template_args['reg_details']['response_msg']['label'] = __('Payment method response', 'event_espresso'); |
|
1568 | 1568 | $this->_template_args['reg_details']['response_msg']['class'] = 'regular-text'; |
1569 | 1569 | } |
1570 | 1570 | |
1571 | 1571 | $this->_template_args['reg_details']['registration_session']['value'] = $reg_details['registration_session']; |
1572 | - $this->_template_args['reg_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' ); |
|
1572 | + $this->_template_args['reg_details']['registration_session']['label'] = __('Registration Session', 'event_espresso'); |
|
1573 | 1573 | $this->_template_args['reg_details']['registration_session']['class'] = 'regular-text'; |
1574 | 1574 | |
1575 | 1575 | $this->_template_args['reg_details']['ip_address']['value'] = $reg_details['ip_address']; |
1576 | - $this->_template_args['reg_details']['ip_address']['label'] = __( 'Registration placed from IP', 'event_espresso' ); |
|
1576 | + $this->_template_args['reg_details']['ip_address']['label'] = __('Registration placed from IP', 'event_espresso'); |
|
1577 | 1577 | $this->_template_args['reg_details']['ip_address']['class'] = 'regular-text'; |
1578 | 1578 | |
1579 | 1579 | $this->_template_args['reg_details']['user_agent']['value'] = $reg_details['user_agent']; |
1580 | - $this->_template_args['reg_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' ); |
|
1580 | + $this->_template_args['reg_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso'); |
|
1581 | 1581 | $this->_template_args['reg_details']['user_agent']['class'] = 'large-text'; |
1582 | 1582 | |
1583 | - $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL ); |
|
1583 | + $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL); |
|
1584 | 1584 | |
1585 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_details.template.php'; |
|
1586 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1585 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_details.template.php'; |
|
1586 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1587 | 1587 | |
1588 | 1588 | } |
1589 | 1589 | |
@@ -1597,14 +1597,14 @@ discard block |
||
1597 | 1597 | */ |
1598 | 1598 | public function _reg_questions_meta_box() { |
1599 | 1599 | //allow someone to override this method entirely |
1600 | - if( apply_filters( 'FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration ) ) { |
|
1601 | - $form = $this->_get_reg_custom_questions_form( $this->_registration->ID() ); |
|
1602 | - $this->_template_args[ 'att_questions' ] = count( $form->subforms() ) > 0 ? $form->get_html_and_js() : ''; |
|
1600 | + if (apply_filters('FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration)) { |
|
1601 | + $form = $this->_get_reg_custom_questions_form($this->_registration->ID()); |
|
1602 | + $this->_template_args['att_questions'] = count($form->subforms()) > 0 ? $form->get_html_and_js() : ''; |
|
1603 | 1603 | $this->_template_args['reg_questions_form_action'] = 'edit_registration'; |
1604 | 1604 | $this->_template_args['REG_ID'] = $this->_registration->ID(); |
1605 | 1605 | |
1606 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_questions.template.php'; |
|
1607 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1606 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_questions.template.php'; |
|
1607 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1608 | 1608 | } |
1609 | 1609 | } |
1610 | 1610 | |
@@ -1618,12 +1618,12 @@ discard block |
||
1618 | 1618 | * @param string $output |
1619 | 1619 | * @return string |
1620 | 1620 | */ |
1621 | - public function form_before_question_group( $output ) { |
|
1621 | + public function form_before_question_group($output) { |
|
1622 | 1622 | EE_Error::doing_it_wrong( |
1623 | - __CLASS__ . '::' . __FUNCTION__, |
|
1624 | - __( 'This method would have been protected but was used on a filter callback' |
|
1623 | + __CLASS__.'::'.__FUNCTION__, |
|
1624 | + __('This method would have been protected but was used on a filter callback' |
|
1625 | 1625 | . 'so needed to be public. Please discontinue usage as it will be removed soon.', |
1626 | - 'event_espresso' ), |
|
1626 | + 'event_espresso'), |
|
1627 | 1627 | '4.8.32.rc.000' |
1628 | 1628 | ); |
1629 | 1629 | return ' |
@@ -1642,20 +1642,20 @@ discard block |
||
1642 | 1642 | * @param string $output |
1643 | 1643 | * @return string |
1644 | 1644 | */ |
1645 | - public function form_after_question_group( $output ) { |
|
1645 | + public function form_after_question_group($output) { |
|
1646 | 1646 | EE_Error::doing_it_wrong( |
1647 | - __CLASS__ . '::' . __FUNCTION__, |
|
1648 | - __( 'This method would have been protected but was used on a filter callback' |
|
1647 | + __CLASS__.'::'.__FUNCTION__, |
|
1648 | + __('This method would have been protected but was used on a filter callback' |
|
1649 | 1649 | . 'so needed to be public. Please discontinue usage as it will be removed soon.', |
1650 | - 'event_espresso' ), |
|
1650 | + 'event_espresso'), |
|
1651 | 1651 | '4.8.32.rc.000' |
1652 | 1652 | ); |
1653 | 1653 | return ' |
1654 | 1654 | <tr class="hide-if-no-js"> |
1655 | 1655 | <th> </th> |
1656 | 1656 | <td class="reg-admin-edit-attendee-question-td"> |
1657 | - <a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__( 'click to edit question', 'event_espresso' ) . '"> |
|
1658 | - <span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __( 'edit the above question group', 'event_espresso' ) . '</span> |
|
1657 | + <a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__('click to edit question', 'event_espresso').'"> |
|
1658 | + <span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso').'</span> |
|
1659 | 1659 | <div class="dashicons dashicons-edit"></div> |
1660 | 1660 | </a> |
1661 | 1661 | </td> |
@@ -1675,18 +1675,18 @@ discard block |
||
1675 | 1675 | * @param string $label |
1676 | 1676 | * @return string |
1677 | 1677 | */ |
1678 | - public function form_form_field_label_wrap( $label ) { |
|
1678 | + public function form_form_field_label_wrap($label) { |
|
1679 | 1679 | EE_Error::doing_it_wrong( |
1680 | - __CLASS__ . '::' . __FUNCTION__, |
|
1681 | - __( 'This method would have been protected but was used on a filter callback' |
|
1680 | + __CLASS__.'::'.__FUNCTION__, |
|
1681 | + __('This method would have been protected but was used on a filter callback' |
|
1682 | 1682 | . 'so needed to be public. Please discontinue usage as it will be removed soon.', |
1683 | - 'event_espresso' ), |
|
1683 | + 'event_espresso'), |
|
1684 | 1684 | '4.8.32.rc.000' |
1685 | 1685 | ); |
1686 | 1686 | return ' |
1687 | 1687 | <tr> |
1688 | 1688 | <th> |
1689 | - ' . $label . ' |
|
1689 | + ' . $label.' |
|
1690 | 1690 | </th>'; |
1691 | 1691 | } |
1692 | 1692 | |
@@ -1700,17 +1700,17 @@ discard block |
||
1700 | 1700 | * @param string $input |
1701 | 1701 | * @return string |
1702 | 1702 | */ |
1703 | - public function form_form_field_input__wrap( $input ) { |
|
1703 | + public function form_form_field_input__wrap($input) { |
|
1704 | 1704 | EE_Error::doing_it_wrong( |
1705 | - __CLASS__ . '::' . __FUNCTION__, |
|
1706 | - __( 'This method would have been protected but was used on a filter callback' |
|
1705 | + __CLASS__.'::'.__FUNCTION__, |
|
1706 | + __('This method would have been protected but was used on a filter callback' |
|
1707 | 1707 | . 'so needed to be public. Please discontinue usage as it will be removed soon.', |
1708 | - 'event_espresso' ), |
|
1708 | + 'event_espresso'), |
|
1709 | 1709 | '4.8.32.rc.000' |
1710 | 1710 | ); |
1711 | 1711 | return ' |
1712 | 1712 | <td class="reg-admin-attendee-questions-input-td disabled-input"> |
1713 | - ' . $input . ' |
|
1713 | + ' . $input.' |
|
1714 | 1714 | </td> |
1715 | 1715 | </tr>'; |
1716 | 1716 | } |
@@ -1724,14 +1724,14 @@ discard block |
||
1724 | 1724 | * @return void |
1725 | 1725 | */ |
1726 | 1726 | protected function _update_attendee_registration_form() { |
1727 | - do_action( 'AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', $this ); |
|
1728 | - if( $_SERVER['REQUEST_METHOD'] == 'POST'){ |
|
1729 | - $REG_ID = isset( $this->_req_data['_REG_ID'] ) ? absint( $this->_req_data['_REG_ID'] ) : FALSE; |
|
1730 | - $success = $this->_save_reg_custom_questions_form( $REG_ID ); |
|
1731 | - if( $success ) { |
|
1727 | + do_action('AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', $this); |
|
1728 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
1729 | + $REG_ID = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : FALSE; |
|
1730 | + $success = $this->_save_reg_custom_questions_form($REG_ID); |
|
1731 | + if ($success) { |
|
1732 | 1732 | $what = __('Registration Form', 'event_espresso'); |
1733 | - $route = $REG_ID ? array( 'action' => 'view_registration', '_REG_ID' => $REG_ID ) : array( 'action' => 'default' ); |
|
1734 | - $this->_redirect_after_action( $success, $what, __('updated', 'event_espresso'), $route ); |
|
1733 | + $route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default'); |
|
1734 | + $this->_redirect_after_action($success, $what, __('updated', 'event_espresso'), $route); |
|
1735 | 1735 | } |
1736 | 1736 | } |
1737 | 1737 | } |
@@ -1742,11 +1742,11 @@ discard block |
||
1742 | 1742 | * @param int $REG_ID |
1743 | 1743 | * @return EE_Registration_Custom_Questions_Form |
1744 | 1744 | */ |
1745 | - protected function _get_reg_custom_questions_form( $REG_ID ) { |
|
1746 | - if( ! $this->_reg_custom_questions_form ) { |
|
1747 | - require_once( REG_ADMIN . 'form_sections' . DS . 'EE_Registration_Custom_Questions_Form.form.php' ); |
|
1748 | - $this->_reg_custom_questions_form = new EE_Registration_Custom_Questions_Form( EEM_Registration::instance()->get_one_by_ID( $REG_ID ) ); |
|
1749 | - $this->_reg_custom_questions_form->_construct_finalize( null, null ); |
|
1745 | + protected function _get_reg_custom_questions_form($REG_ID) { |
|
1746 | + if ( ! $this->_reg_custom_questions_form) { |
|
1747 | + require_once(REG_ADMIN.'form_sections'.DS.'EE_Registration_Custom_Questions_Form.form.php'); |
|
1748 | + $this->_reg_custom_questions_form = new EE_Registration_Custom_Questions_Form(EEM_Registration::instance()->get_one_by_ID($REG_ID)); |
|
1749 | + $this->_reg_custom_questions_form->_construct_finalize(null, null); |
|
1750 | 1750 | } |
1751 | 1751 | return $this->_reg_custom_questions_form; |
1752 | 1752 | } |
@@ -1759,17 +1759,17 @@ discard block |
||
1759 | 1759 | * @param bool $REG_ID |
1760 | 1760 | * @return bool |
1761 | 1761 | */ |
1762 | - private function _save_reg_custom_questions_form( $REG_ID = FALSE ) { |
|
1762 | + private function _save_reg_custom_questions_form($REG_ID = FALSE) { |
|
1763 | 1763 | |
1764 | 1764 | if ( ! $REG_ID) { |
1765 | - EE_Error::add_error( __('An error occurred. No registration ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
1765 | + EE_Error::add_error(__('An error occurred. No registration ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1766 | 1766 | } |
1767 | - $form = $this->_get_reg_custom_questions_form( $REG_ID ); |
|
1768 | - $form->receive_form_submission( $this->_req_data ); |
|
1767 | + $form = $this->_get_reg_custom_questions_form($REG_ID); |
|
1768 | + $form->receive_form_submission($this->_req_data); |
|
1769 | 1769 | $success = false; |
1770 | - if( $form->is_valid() ) { |
|
1771 | - foreach( $form->subforms() as $question_group_id => $question_group_form ) { |
|
1772 | - foreach( $question_group_form->inputs() as $question_id => $input ) { |
|
1770 | + if ($form->is_valid()) { |
|
1771 | + foreach ($form->subforms() as $question_group_id => $question_group_form) { |
|
1772 | + foreach ($question_group_form->inputs() as $question_id => $input) { |
|
1773 | 1773 | $where_conditions = array( |
1774 | 1774 | 'QST_ID' => $question_id, |
1775 | 1775 | 'REG_ID' => $REG_ID |
@@ -1777,19 +1777,19 @@ discard block |
||
1777 | 1777 | $possibly_new_values = array( |
1778 | 1778 | 'ANS_value' => $input->normalized_value() |
1779 | 1779 | ); |
1780 | - $answer = EEM_Answer::instance()->get_one( array( $where_conditions ) ); |
|
1781 | - if( $answer instanceof EE_Answer ) { |
|
1782 | - $success = $answer->save( $possibly_new_values ); |
|
1780 | + $answer = EEM_Answer::instance()->get_one(array($where_conditions)); |
|
1781 | + if ($answer instanceof EE_Answer) { |
|
1782 | + $success = $answer->save($possibly_new_values); |
|
1783 | 1783 | } else { |
1784 | 1784 | //insert it then |
1785 | - $cols_n_vals = array_merge( $where_conditions, $possibly_new_values ); |
|
1786 | - $answer = EE_Answer::new_instance( $cols_n_vals ); |
|
1785 | + $cols_n_vals = array_merge($where_conditions, $possibly_new_values); |
|
1786 | + $answer = EE_Answer::new_instance($cols_n_vals); |
|
1787 | 1787 | $success = $answer->save(); |
1788 | 1788 | } |
1789 | 1789 | } |
1790 | 1790 | } |
1791 | 1791 | } else { |
1792 | - EE_Error::add_error( $form->get_validation_error_string(), __FILE__, __FUNCTION__, __LINE__ ); |
|
1792 | + EE_Error::add_error($form->get_validation_error_string(), __FILE__, __FUNCTION__, __LINE__); |
|
1793 | 1793 | } |
1794 | 1794 | return $success; |
1795 | 1795 | } |
@@ -1807,31 +1807,31 @@ discard block |
||
1807 | 1807 | $registrations = $REG->get_all(array( |
1808 | 1808 | array( |
1809 | 1809 | 'TXN_ID'=>$this->_registration->transaction_ID(), |
1810 | - 'REG_ID'=>array('!=',$this->_registration->ID()) |
|
1810 | + 'REG_ID'=>array('!=', $this->_registration->ID()) |
|
1811 | 1811 | ), |
1812 | 1812 | 'force_join'=>array('Attendee'))); |
1813 | 1813 | |
1814 | 1814 | $this->_template_args['attendees'] = array(); |
1815 | 1815 | $this->_template_args['attendee_notice'] = ''; |
1816 | - if ( empty( $registrations) || ( is_array($registrations) && ! EEH_Array::get_one_item_from_array($registrations) ) ) { |
|
1817 | - EE_Error::add_error( __('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
1816 | + if (empty($registrations) || (is_array($registrations) && ! EEH_Array::get_one_item_from_array($registrations))) { |
|
1817 | + EE_Error::add_error(__('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1818 | 1818 | $this->_template_args['attendee_notice'] = EE_Error::get_notices(); |
1819 | 1819 | } else { |
1820 | 1820 | |
1821 | 1821 | $att_nmbr = 1; |
1822 | - foreach ( $registrations as $registration ) { |
|
1822 | + foreach ($registrations as $registration) { |
|
1823 | 1823 | /* @var $registration EE_Registration */ |
1824 | 1824 | $attendee = $registration->attendee() ? $registration->attendee() : EEM_Attendee::instance()->create_default_object(); |
1825 | - $this->_template_args['attendees'][ $att_nmbr ]['STS_ID'] = $registration->status_ID(); |
|
1826 | - $this->_template_args['attendees'][ $att_nmbr ]['fname'] = $attendee->fname();//( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : ''; |
|
1827 | - $this->_template_args['attendees'][ $att_nmbr ]['lname'] = $attendee->lname();//( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : ''; |
|
1828 | - $this->_template_args['attendees'][ $att_nmbr ]['email'] = $attendee->email();//( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : ''; |
|
1829 | - $this->_template_args['attendees'][ $att_nmbr ]['final_price'] = $registration->final_price();//( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : ''; |
|
1825 | + $this->_template_args['attendees'][$att_nmbr]['STS_ID'] = $registration->status_ID(); |
|
1826 | + $this->_template_args['attendees'][$att_nmbr]['fname'] = $attendee->fname(); //( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : ''; |
|
1827 | + $this->_template_args['attendees'][$att_nmbr]['lname'] = $attendee->lname(); //( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : ''; |
|
1828 | + $this->_template_args['attendees'][$att_nmbr]['email'] = $attendee->email(); //( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : ''; |
|
1829 | + $this->_template_args['attendees'][$att_nmbr]['final_price'] = $registration->final_price(); //( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : ''; |
|
1830 | 1830 | |
1831 | - $this->_template_args['attendees'][ $att_nmbr ]['address'] = implode( ', ', $attendee->full_address_as_array() ); |
|
1831 | + $this->_template_args['attendees'][$att_nmbr]['address'] = implode(', ', $attendee->full_address_as_array()); |
|
1832 | 1832 | |
1833 | - $this->_template_args['attendees'][ $att_nmbr ]['att_link'] = self::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL ); |
|
1834 | - $this->_template_args['attendees'][ $att_nmbr ]['event_name'] = $registration->event_obj()->name(); |
|
1833 | + $this->_template_args['attendees'][$att_nmbr]['att_link'] = self::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL); |
|
1834 | + $this->_template_args['attendees'][$att_nmbr]['event_name'] = $registration->event_obj()->name(); |
|
1835 | 1835 | |
1836 | 1836 | $att_nmbr++; |
1837 | 1837 | } |
@@ -1841,8 +1841,8 @@ discard block |
||
1841 | 1841 | |
1842 | 1842 | // $this->_template_args['registration_form_url'] = add_query_arg( array( 'action' => 'edit_registration', 'process' => 'attendees' ), REG_ADMIN_URL ); |
1843 | 1843 | } |
1844 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_attendees.template.php'; |
|
1845 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1844 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_attendees.template.php'; |
|
1845 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1846 | 1846 | |
1847 | 1847 | } |
1848 | 1848 | |
@@ -1863,14 +1863,14 @@ discard block |
||
1863 | 1863 | $attendee = $att_check instanceof EE_Attendee ? $att_check : EEM_Attendee::instance()->create_default_object(); |
1864 | 1864 | |
1865 | 1865 | //now let's determine if this is not the primary registration. If it isn't then we set the primary_registration object for reference BUT ONLY if the Attendee object loaded is not the same as the primary registration object (that way we know if we need to show create button or not) |
1866 | - if ( ! $this->_registration->is_primary_registrant() ) { |
|
1866 | + if ( ! $this->_registration->is_primary_registrant()) { |
|
1867 | 1867 | |
1868 | 1868 | $primary_registration = $this->_registration->get_primary_registration(); |
1869 | 1869 | $primary_attendee = $primary_registration instanceof EE_Registration |
1870 | 1870 | ? $primary_registration->attendee() |
1871 | 1871 | : null; |
1872 | 1872 | |
1873 | - if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID() ) { |
|
1873 | + if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID()) { |
|
1874 | 1874 | //in here? This means the displayed registration is not the primary registrant but ALREADY HAS its own custom attendee object so let's not worry about the primary reg. |
1875 | 1875 | $primary_registration = NULL; |
1876 | 1876 | } |
@@ -1879,27 +1879,27 @@ discard block |
||
1879 | 1879 | } |
1880 | 1880 | |
1881 | 1881 | $this->_template_args['ATT_ID'] = $attendee->ID(); |
1882 | - $this->_template_args['fname'] = $attendee->fname();//$this->_registration->ATT_fname; |
|
1883 | - $this->_template_args['lname'] = $attendee->lname();//$this->_registration->ATT_lname; |
|
1884 | - $this->_template_args['email'] = $attendee->email();//$this->_registration->ATT_email; |
|
1882 | + $this->_template_args['fname'] = $attendee->fname(); //$this->_registration->ATT_fname; |
|
1883 | + $this->_template_args['lname'] = $attendee->lname(); //$this->_registration->ATT_lname; |
|
1884 | + $this->_template_args['email'] = $attendee->email(); //$this->_registration->ATT_email; |
|
1885 | 1885 | $this->_template_args['phone'] = $attendee->phone(); |
1886 | 1886 | |
1887 | - $this->_template_args[ 'formatted_address' ] = EEH_Address::format( $attendee ); |
|
1887 | + $this->_template_args['formatted_address'] = EEH_Address::format($attendee); |
|
1888 | 1888 | |
1889 | 1889 | |
1890 | 1890 | //edit link |
1891 | - $this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL ); |
|
1891 | + $this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL); |
|
1892 | 1892 | $this->_template_args['att_edit_label'] = __('View/Edit Contact', 'event_espresso'); |
1893 | 1893 | |
1894 | 1894 | //create link |
1895 | - $this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'duplicate_attendee', '_REG_ID' => $this->_registration->ID() ), REG_ADMIN_URL ): ''; |
|
1895 | + $this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'duplicate_attendee', '_REG_ID' => $this->_registration->ID()), REG_ADMIN_URL) : ''; |
|
1896 | 1896 | $this->_template_args['create_label'] = __('Create Contact', 'event_espresso'); |
1897 | 1897 | |
1898 | 1898 | $this->_template_args['att_check'] = $att_check; |
1899 | 1899 | |
1900 | 1900 | |
1901 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_side_meta_box_registrant.template.php'; |
|
1902 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1901 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_side_meta_box_registrant.template.php'; |
|
1902 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1903 | 1903 | } |
1904 | 1904 | |
1905 | 1905 | |
@@ -1912,7 +1912,7 @@ discard block |
||
1912 | 1912 | * @access protected |
1913 | 1913 | * @return void |
1914 | 1914 | */ |
1915 | - protected function _trash_or_restore_registrations( $trash = TRUE ) { |
|
1915 | + protected function _trash_or_restore_registrations($trash = TRUE) { |
|
1916 | 1916 | $REGM = EEM_Registration::instance(); |
1917 | 1917 | |
1918 | 1918 | $success = 1; |
@@ -1922,26 +1922,26 @@ discard block |
||
1922 | 1922 | $dtts = array(); |
1923 | 1923 | |
1924 | 1924 | //if empty _REG_ID then get out because there's nothing to do |
1925 | - if ( empty( $this->_req_data['_REG_ID'] ) ) { |
|
1925 | + if (empty($this->_req_data['_REG_ID'])) { |
|
1926 | 1926 | $msg = $trash ? __('In order to trash registrations you must select which ones you wish to trash by clicking the checkboxes.', 'event_espresso') : __('In order to restore registrations you must select which ones you wish to restore by clicking the checkboxes.', 'event_espresso'); |
1927 | - EE_Error::add_error( $msg, __FILE__, __LINE__, __FUNCTION__ ); |
|
1928 | - $this->_redirect_after_action(FALSE, '', '', array(), TRUE ); |
|
1927 | + EE_Error::add_error($msg, __FILE__, __LINE__, __FUNCTION__); |
|
1928 | + $this->_redirect_after_action(FALSE, '', '', array(), TRUE); |
|
1929 | 1929 | } |
1930 | 1930 | |
1931 | 1931 | //Checkboxes |
1932 | - if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
1932 | + if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
1933 | 1933 | // if array has more than one element than success message should be plural |
1934 | - $success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1; |
|
1934 | + $success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1; |
|
1935 | 1935 | // cycle thru checkboxes |
1936 | - while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) { |
|
1936 | + while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) { |
|
1937 | 1937 | /** @var EE_Registration $REG */ |
1938 | - $REG = $REGM->get_one_by_ID( $REG_ID); |
|
1938 | + $REG = $REGM->get_one_by_ID($REG_ID); |
|
1939 | 1939 | $payment_count = $REG->get_first_related('Transaction')->count_related('Payment'); |
1940 | - if ( $payment_count > 0 ) { |
|
1941 | - $name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __( 'Unknown Attendee', 'event_espresso' ); |
|
1940 | + if ($payment_count > 0) { |
|
1941 | + $name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __('Unknown Attendee', 'event_espresso'); |
|
1942 | 1942 | $error = 1; |
1943 | 1943 | $success = 0; |
1944 | - EE_Error::add_error( sprintf( __('The registration for %s could not be trashed because it has payments attached to the related transaction. If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name ), __FILE__, __FUNCTION__, __LINE__ ); |
|
1944 | + EE_Error::add_error(sprintf(__('The registration for %s could not be trashed because it has payments attached to the related transaction. If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name), __FILE__, __FUNCTION__, __LINE__); |
|
1945 | 1945 | continue; //can't trash this registration because it has payments. |
1946 | 1946 | } |
1947 | 1947 | $ticket = $REG->get_first_related('Ticket'); |
@@ -1950,7 +1950,7 @@ discard block |
||
1950 | 1950 | $dtts = array_merge($dtts, $dtt); |
1951 | 1951 | |
1952 | 1952 | $updated = $trash ? $REG->delete() : $REG->restore(); |
1953 | - if ( !$updated ) { |
|
1953 | + if ( ! $updated) { |
|
1954 | 1954 | $success = 0; |
1955 | 1955 | } else { |
1956 | 1956 | $success = 2; |
@@ -1965,7 +1965,7 @@ discard block |
||
1965 | 1965 | $tickets[$ticket->ID()] = $ticket; |
1966 | 1966 | $dtts = $ticket->get_many_related('Datetime'); |
1967 | 1967 | $updated = $trash ? $REG->delete() : $REG->restore(); |
1968 | - if ( ! $updated ) { |
|
1968 | + if ( ! $updated) { |
|
1969 | 1969 | $success = 0; |
1970 | 1970 | } |
1971 | 1971 | |
@@ -1975,10 +1975,10 @@ discard block |
||
1975 | 1975 | EEM_Ticket::instance()->update_tickets_sold($tickets); |
1976 | 1976 | EEM_Datetime::instance()->update_sold($dtts); |
1977 | 1977 | |
1978 | - $what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' ); |
|
1979 | - $action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' ); |
|
1978 | + $what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso'); |
|
1979 | + $action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso'); |
|
1980 | 1980 | $overwrite_msgs = $error ? TRUE : FALSE; |
1981 | - $this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), $overwrite_msgs ); |
|
1981 | + $this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), $overwrite_msgs); |
|
1982 | 1982 | } |
1983 | 1983 | |
1984 | 1984 | |
@@ -2002,16 +2002,16 @@ discard block |
||
2002 | 2002 | $success = 1; |
2003 | 2003 | |
2004 | 2004 | //Checkboxes |
2005 | - if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
2005 | + if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
2006 | 2006 | // if array has more than one element than success message should be plural |
2007 | - $success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1; |
|
2007 | + $success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1; |
|
2008 | 2008 | // cycle thru checkboxes |
2009 | - while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) { |
|
2009 | + while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) { |
|
2010 | 2010 | $REG = $REG_MDL->get_one_by_ID($REG_ID); |
2011 | - if ( ! $REG instanceof EE_Registration ) |
|
2011 | + if ( ! $REG instanceof EE_Registration) |
|
2012 | 2012 | continue; |
2013 | 2013 | $deleted = $this->_delete_registration($REG); |
2014 | - if ( !$deleted ) { |
|
2014 | + if ( ! $deleted) { |
|
2015 | 2015 | $success = 0; |
2016 | 2016 | } |
2017 | 2017 | } |
@@ -2021,15 +2021,15 @@ discard block |
||
2021 | 2021 | $REG_ID = $this->_req_data['_REG_ID']; |
2022 | 2022 | $REG = $REG_MDL->get_one_by_ID($REG_ID); |
2023 | 2023 | $deleted = $this->_delete_registration($REG); |
2024 | - if ( ! $deleted ) { |
|
2024 | + if ( ! $deleted) { |
|
2025 | 2025 | $success = 0; |
2026 | 2026 | } |
2027 | 2027 | |
2028 | 2028 | } |
2029 | 2029 | |
2030 | - $what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' ); |
|
2031 | - $action_desc = __( 'permanently deleted.', 'event_espresso' ); |
|
2032 | - $this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), TRUE ); |
|
2030 | + $what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso'); |
|
2031 | + $action_desc = __('permanently deleted.', 'event_espresso'); |
|
2032 | + $this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), TRUE); |
|
2033 | 2033 | } |
2034 | 2034 | |
2035 | 2035 | |
@@ -2041,31 +2041,31 @@ discard block |
||
2041 | 2041 | * @param EE_Registration $REG registration to be deleted permenantly |
2042 | 2042 | * @return boolean true = successful deletion, false = fail. |
2043 | 2043 | */ |
2044 | - protected function _delete_registration( EE_Registration $REG ) { |
|
2044 | + protected function _delete_registration(EE_Registration $REG) { |
|
2045 | 2045 | //first we start with the transaction... ultimately, we WILL not delete permanently if there are any related registrations on the transaction that are NOT trashed. |
2046 | 2046 | $TXN = $REG->get_first_related('Transaction'); |
2047 | 2047 | $REGS = $TXN->get_many_related('Registration'); |
2048 | 2048 | |
2049 | 2049 | $all_trashed = TRUE; |
2050 | - foreach ( $REGS as $registration ) { |
|
2051 | - if ( ! $registration->get('REG_deleted') ) |
|
2050 | + foreach ($REGS as $registration) { |
|
2051 | + if ( ! $registration->get('REG_deleted')) |
|
2052 | 2052 | $all_trashed = FALSE; |
2053 | 2053 | } |
2054 | 2054 | |
2055 | - if ( ! $all_trashed ) { |
|
2056 | - EE_Error::add_error( __('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well. These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
2055 | + if ( ! $all_trashed) { |
|
2056 | + EE_Error::add_error(__('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well. These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
2057 | 2057 | return false; |
2058 | 2058 | } |
2059 | 2059 | |
2060 | 2060 | //k made it here so that means we can delete all the related transactions and their answers (but let's do them separately from THIS one). |
2061 | - foreach ( $REGS as $registration ) { |
|
2061 | + foreach ($REGS as $registration) { |
|
2062 | 2062 | |
2063 | 2063 | //delete related answers |
2064 | 2064 | $registration->delete_related_permanently('Answer'); |
2065 | 2065 | |
2066 | 2066 | //remove relationship to EE_Attendee (but we ALWAYS leave the contact record intact) |
2067 | 2067 | $attendee = $registration->get_first_related('Attendee'); |
2068 | - if ( $attendee instanceof EE_Attendee ) { |
|
2068 | + if ($attendee instanceof EE_Attendee) { |
|
2069 | 2069 | $registration->_remove_relation_to($attendee, 'Attendee'); |
2070 | 2070 | } |
2071 | 2071 | |
@@ -2075,7 +2075,7 @@ discard block |
||
2075 | 2075 | //now delete permanently the checkins related to this registration. |
2076 | 2076 | $registration->delete_related_permanently('Checkin'); |
2077 | 2077 | |
2078 | - if ( $registration->ID() === $REG->ID() ) |
|
2078 | + if ($registration->ID() === $REG->ID()) |
|
2079 | 2079 | continue; //we don't want to delete permanently the existing registration just yet. |
2080 | 2080 | |
2081 | 2081 | //remove relation to transaction for these registrations if NOT the existing registrations |
@@ -2108,35 +2108,35 @@ discard block |
||
2108 | 2108 | * @return void |
2109 | 2109 | */ |
2110 | 2110 | public function new_registration() { |
2111 | - if ( ! $this->_set_reg_event() ) { |
|
2112 | - throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso') ); |
|
2111 | + if ( ! $this->_set_reg_event()) { |
|
2112 | + throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso')); |
|
2113 | 2113 | } |
2114 | - EE_Registry::instance()->REQ->set_espresso_page( TRUE ); |
|
2114 | + EE_Registry::instance()->REQ->set_espresso_page(TRUE); |
|
2115 | 2115 | // gotta start with a clean slate if we're not coming here via ajax |
2116 | 2116 | if ( |
2117 | - ! defined('DOING_AJAX' ) |
|
2118 | - && ( ! isset( $this->_req_data['processing_registration'] ) || isset( $this->_req_data['step_error'] ) ) |
|
2117 | + ! defined('DOING_AJAX') |
|
2118 | + && ( ! isset($this->_req_data['processing_registration']) || isset($this->_req_data['step_error'])) |
|
2119 | 2119 | ) { |
2120 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
2120 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
2121 | 2121 | } |
2122 | 2122 | |
2123 | - $this->_template_args['event_name'] = '' ; |
|
2123 | + $this->_template_args['event_name'] = ''; |
|
2124 | 2124 | // event name |
2125 | - if ( $this->_reg_event ) { |
|
2125 | + if ($this->_reg_event) { |
|
2126 | 2126 | $this->_template_args['event_name'] = $this->_reg_event->name(); |
2127 | - $edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$this->_reg_event->ID() ), EVENTS_ADMIN_URL ); |
|
2128 | - $edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $this->_reg_event->name() . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>'; |
|
2129 | - $this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ; |
|
2127 | + $edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$this->_reg_event->ID()), EVENTS_ADMIN_URL); |
|
2128 | + $edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$this->_reg_event->name().'">'.__('Edit Event', 'event_espresso').'</a>'; |
|
2129 | + $this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>'; |
|
2130 | 2130 | } |
2131 | 2131 | |
2132 | 2132 | $this->_template_args['step_content'] = $this->_get_registration_step_content(); |
2133 | 2133 | |
2134 | - if ( defined('DOING_AJAX' ) ) { |
|
2134 | + if (defined('DOING_AJAX')) { |
|
2135 | 2135 | $this->_return_json(); |
2136 | 2136 | } |
2137 | 2137 | // grab header |
2138 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee.template.php'; |
|
2139 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
2138 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_register_new_attendee.template.php'; |
|
2139 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
2140 | 2140 | |
2141 | 2141 | //$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE ); |
2142 | 2142 | // the details template wrapper |
@@ -2153,7 +2153,7 @@ discard block |
||
2153 | 2153 | * @return string html |
2154 | 2154 | */ |
2155 | 2155 | protected function _get_registration_step_content() { |
2156 | - if ( isset( $_COOKIE[ 'ee_registration_added' ] ) && $_COOKIE[ 'ee_registration_added' ] ) { |
|
2156 | + if (isset($_COOKIE['ee_registration_added']) && $_COOKIE['ee_registration_added']) { |
|
2157 | 2157 | $warning_msg = sprintf( |
2158 | 2158 | __( |
2159 | 2159 | '%2$sWARNING!!!%3$s%1$sPlease do not use the back button to return to this page for the purpose of adding another registration.%1$sThis can result in lost and/or corrupted data.%1$sIf you wish to add another registration, then please click the%1$s%7$s"Add Another New Registration to Event"%8$s button%1$son the Transaction details page, after you are redirected.%1$s%1$s%4$s redirecting in %5$s seconds %6$s', |
@@ -2169,7 +2169,7 @@ discard block |
||
2169 | 2169 | '</b>' |
2170 | 2170 | ); |
2171 | 2171 | return ' |
2172 | - <div id="ee-add-reg-back-button-dv"><p>' . $warning_msg . '</p></div> |
|
2172 | + <div id="ee-add-reg-back-button-dv"><p>' . $warning_msg.'</p></div> |
|
2173 | 2173 | <script > |
2174 | 2174 | // WHOAH !!! it appears that someone is using the back button from the Transaction admin page |
2175 | 2175 | // after just adding a new registration... we gotta try to put a stop to that !!! |
@@ -2204,16 +2204,16 @@ discard block |
||
2204 | 2204 | $cart = EE_Registry::instance()->SSN->cart(); |
2205 | 2205 | $step = ! $cart instanceof EE_Cart ? 'ticket' : 'questions'; |
2206 | 2206 | |
2207 | - switch ( $step ) { |
|
2207 | + switch ($step) { |
|
2208 | 2208 | case 'ticket' : |
2209 | 2209 | $hidden_fields['processing_registration']['value'] = 1; |
2210 | 2210 | $template_args['title'] = __('Step One: Select the Ticket for this registration', 'event_espresso'); |
2211 | - $template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector( $this->_reg_event ); |
|
2211 | + $template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector($this->_reg_event); |
|
2212 | 2212 | $template_args['step_button_text'] = __('Add Tickets and Continue to Registrant Details', 'event_espresso'); |
2213 | 2213 | $template_args['show_notification_toggle'] = FALSE; |
2214 | 2214 | break; |
2215 | 2215 | case 'questions' : |
2216 | - $hidden_fields[ 'processing_registration' ][ 'value' ] = 2; |
|
2216 | + $hidden_fields['processing_registration']['value'] = 2; |
|
2217 | 2217 | $template_args['title'] = __('Step Two: Add Registrant Details for this Registration', 'event_espresso'); |
2218 | 2218 | //in theory we should be able to run EED_SPCO at this point because the cart should have been setup properly by the first process_reg_step run. |
2219 | 2219 | $template_args['content'] = EED_Single_Page_Checkout::registration_checkout_for_admin(); |
@@ -2222,10 +2222,10 @@ discard block |
||
2222 | 2222 | break; |
2223 | 2223 | } |
2224 | 2224 | |
2225 | - $this->_set_add_edit_form_tags( 'process_reg_step', $hidden_fields ); //we come back to the process_registration_step route. |
|
2225 | + $this->_set_add_edit_form_tags('process_reg_step', $hidden_fields); //we come back to the process_registration_step route. |
|
2226 | 2226 | |
2227 | 2227 | return EEH_Template::display_template( |
2228 | - REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE |
|
2228 | + REG_TEMPLATE_PATH.'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE |
|
2229 | 2229 | ); |
2230 | 2230 | } |
2231 | 2231 | |
@@ -2240,11 +2240,11 @@ discard block |
||
2240 | 2240 | * @return boolean |
2241 | 2241 | */ |
2242 | 2242 | private function _set_reg_event() { |
2243 | - if ( is_object( $this->_reg_event )) { |
|
2243 | + if (is_object($this->_reg_event)) { |
|
2244 | 2244 | return TRUE; |
2245 | 2245 | } |
2246 | - $EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
2247 | - if ( ! $EVT_ID ) { |
|
2246 | + $EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE; |
|
2247 | + if ( ! $EVT_ID) { |
|
2248 | 2248 | return FALSE; |
2249 | 2249 | } |
2250 | 2250 | |
@@ -2265,82 +2265,82 @@ discard block |
||
2265 | 2265 | public function process_reg_step() { |
2266 | 2266 | EE_System::do_not_cache(); |
2267 | 2267 | $this->_set_reg_event(); |
2268 | - EE_Registry::instance()->REQ->set_espresso_page( TRUE ); |
|
2268 | + EE_Registry::instance()->REQ->set_espresso_page(TRUE); |
|
2269 | 2269 | |
2270 | 2270 | //what step are we on? |
2271 | 2271 | $cart = EE_Registry::instance()->SSN->cart(); |
2272 | 2272 | $step = ! $cart instanceof EE_Cart ? 'ticket' : 'questions'; |
2273 | 2273 | |
2274 | 2274 | //if doing ajax then we need to verify the nonce |
2275 | - if ( defined( 'DOING_AJAX' ) ) { |
|
2276 | - $nonce = isset( $this->_req_data[$this->_req_nonce] ) ? sanitize_text_field( $this->_req_data[$this->_req_nonce] ) : ''; |
|
2277 | - $this->_verify_nonce( $nonce, $this->_req_nonce ); |
|
2275 | + if (defined('DOING_AJAX')) { |
|
2276 | + $nonce = isset($this->_req_data[$this->_req_nonce]) ? sanitize_text_field($this->_req_data[$this->_req_nonce]) : ''; |
|
2277 | + $this->_verify_nonce($nonce, $this->_req_nonce); |
|
2278 | 2278 | } |
2279 | 2279 | |
2280 | - switch ( $step ) { |
|
2280 | + switch ($step) { |
|
2281 | 2281 | |
2282 | 2282 | case 'ticket' : |
2283 | 2283 | //process ticket selection |
2284 | 2284 | $success = EED_Ticket_Selector::instance()->process_ticket_selections(); |
2285 | - if ( $success ) { |
|
2286 | - EE_Error::add_success( __('Tickets Selected. Now complete the registration.'), 'event_espresso'); |
|
2285 | + if ($success) { |
|
2286 | + EE_Error::add_success(__('Tickets Selected. Now complete the registration.'), 'event_espresso'); |
|
2287 | 2287 | } else { |
2288 | 2288 | $query_args['step_error'] = $this->_req_data['step_error'] = TRUE; |
2289 | 2289 | } |
2290 | - if ( defined('DOING_AJAX') ) { |
|
2290 | + if (defined('DOING_AJAX')) { |
|
2291 | 2291 | $this->new_registration(); //display next step |
2292 | 2292 | } else { |
2293 | 2293 | $query_args['action'] = 'new_registration'; |
2294 | 2294 | $query_args['processing_registration'] = 1; |
2295 | 2295 | $query_args['event_id'] = $this->_reg_event->ID(); |
2296 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
2296 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
2297 | 2297 | } |
2298 | 2298 | break; |
2299 | 2299 | |
2300 | 2300 | case 'questions' : |
2301 | - if( ! isset( $this->_req_data[ 'txn_reg_status_change' ], $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ] ) ) { |
|
2302 | - add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15 ); |
|
2301 | + if ( ! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['send_notifications'])) { |
|
2302 | + add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15); |
|
2303 | 2303 | } |
2304 | 2304 | //process registration |
2305 | 2305 | $transaction = EED_Single_Page_Checkout::instance()->process_registration_from_admin(); |
2306 | - if ( $cart instanceof EE_Cart ) { |
|
2306 | + if ($cart instanceof EE_Cart) { |
|
2307 | 2307 | $grand_total = $cart->get_cart_grand_total(); |
2308 | - if ( $grand_total instanceof EE_Line_Item ) { |
|
2308 | + if ($grand_total instanceof EE_Line_Item) { |
|
2309 | 2309 | $grand_total->save_this_and_descendants_to_txn(); |
2310 | 2310 | } |
2311 | 2311 | } |
2312 | - if ( ! $transaction instanceof EE_Transaction ) { |
|
2312 | + if ( ! $transaction instanceof EE_Transaction) { |
|
2313 | 2313 | $query_args = array( |
2314 | 2314 | 'action' => 'new_registration', |
2315 | 2315 | 'processing_registration' => 2, |
2316 | 2316 | 'event_id' => $this->_reg_event->ID() |
2317 | 2317 | ); |
2318 | 2318 | |
2319 | - if ( defined('DOING_AJAX' )) { |
|
2319 | + if (defined('DOING_AJAX')) { |
|
2320 | 2320 | //display registration form again because there are errors (maybe validation?) |
2321 | 2321 | $this->new_registration(); |
2322 | 2322 | return; |
2323 | 2323 | } else { |
2324 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
2324 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
2325 | 2325 | return; |
2326 | 2326 | } |
2327 | 2327 | } |
2328 | 2328 | /** @type EE_Transaction_Payments $transaction_payments */ |
2329 | - $transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' ); |
|
2329 | + $transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments'); |
|
2330 | 2330 | // maybe update status, and make sure to save transaction if not done already |
2331 | - if ( ! $transaction_payments->update_transaction_status_based_on_total_paid( $transaction )) { |
|
2331 | + if ( ! $transaction_payments->update_transaction_status_based_on_total_paid($transaction)) { |
|
2332 | 2332 | $transaction->save(); |
2333 | 2333 | } |
2334 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
2334 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
2335 | 2335 | $this->_req_data = array(); |
2336 | 2336 | $query_args = array( |
2337 | 2337 | 'action' => 'redirect_to_txn', |
2338 | 2338 | 'TXN_ID' => $transaction->ID(), |
2339 | 2339 | 'EVT_ID' => $this->_reg_event->ID(), |
2340 | - 'event_name' => urlencode( $this->_reg_event->name() ), |
|
2340 | + 'event_name' => urlencode($this->_reg_event->name()), |
|
2341 | 2341 | 'redirect_from' => 'new_registration' |
2342 | 2342 | ); |
2343 | - $this->_redirect_after_action( false, '', '', $query_args, true ); |
|
2343 | + $this->_redirect_after_action(false, '', '', $query_args, true); |
|
2344 | 2344 | break; |
2345 | 2345 | } |
2346 | 2346 | |
@@ -2357,21 +2357,21 @@ discard block |
||
2357 | 2357 | */ |
2358 | 2358 | public function redirect_to_txn() { |
2359 | 2359 | EE_System::do_not_cache(); |
2360 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
2360 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
2361 | 2361 | $query_args = array( |
2362 | 2362 | 'action' => 'view_transaction', |
2363 | - 'TXN_ID' => isset( $this->_req_data['TXN_ID'] ) ? absint( $this->_req_data[ 'TXN_ID' ] ) : 0, |
|
2363 | + 'TXN_ID' => isset($this->_req_data['TXN_ID']) ? absint($this->_req_data['TXN_ID']) : 0, |
|
2364 | 2364 | 'page' => 'espresso_transactions' |
2365 | 2365 | ); |
2366 | - if ( isset( $this->_req_data[ 'EVT_ID' ], $this->_req_data[ 'redirect_from' ] ) ) { |
|
2367 | - $query_args['EVT_ID'] = $this->_req_data[ 'EVT_ID' ]; |
|
2368 | - $query_args['event_name'] = urlencode( $this->_req_data[ 'event_name' ] ); |
|
2369 | - $query_args['redirect_from'] = $this->_req_data[ 'redirect_from' ]; |
|
2366 | + if (isset($this->_req_data['EVT_ID'], $this->_req_data['redirect_from'])) { |
|
2367 | + $query_args['EVT_ID'] = $this->_req_data['EVT_ID']; |
|
2368 | + $query_args['event_name'] = urlencode($this->_req_data['event_name']); |
|
2369 | + $query_args['redirect_from'] = $this->_req_data['redirect_from']; |
|
2370 | 2370 | } |
2371 | 2371 | EE_Error::add_success( |
2372 | - __( 'Registration Created. Please review the transaction and add any payments as necessary', 'event_espresso' ) |
|
2372 | + __('Registration Created. Please review the transaction and add any payments as necessary', 'event_espresso') |
|
2373 | 2373 | ); |
2374 | - $this->_redirect_after_action( false, '', '', $query_args, true ); |
|
2374 | + $this->_redirect_after_action(false, '', '', $query_args, true); |
|
2375 | 2375 | } |
2376 | 2376 | |
2377 | 2377 | |
@@ -2382,7 +2382,7 @@ discard block |
||
2382 | 2382 | * @return void |
2383 | 2383 | */ |
2384 | 2384 | protected function _attendee_contact_list_table() { |
2385 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
2385 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
2386 | 2386 | $this->_search_btn_label = __('Contacts', 'event_espresso'); |
2387 | 2387 | $this->display_admin_list_table_page_with_no_sidebar(); |
2388 | 2388 | } |
@@ -2397,10 +2397,10 @@ discard block |
||
2397 | 2397 | * @access public |
2398 | 2398 | * @return array |
2399 | 2399 | */ |
2400 | - public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) { |
|
2400 | + public function get_attendees($per_page, $count = FALSE, $trash = FALSE) { |
|
2401 | 2401 | |
2402 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
2403 | - require_once( REG_ADMIN . 'EE_Attendee_Contact_List_Table.class.php' ); |
|
2402 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
2403 | + require_once(REG_ADMIN.'EE_Attendee_Contact_List_Table.class.php'); |
|
2404 | 2404 | $ATT_MDL = EEM_Attendee::instance(); |
2405 | 2405 | |
2406 | 2406 | $this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : ''; |
@@ -2428,47 +2428,47 @@ discard block |
||
2428 | 2428 | $orderby = 'ATT_lname'; |
2429 | 2429 | } |
2430 | 2430 | |
2431 | - $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC'; |
|
2431 | + $sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC'; |
|
2432 | 2432 | |
2433 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
2434 | - $per_page = isset( $per_page ) && !empty( $per_page ) ? $per_page : 10; |
|
2435 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
2433 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
2434 | + $per_page = isset($per_page) && ! empty($per_page) ? $per_page : 10; |
|
2435 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
2436 | 2436 | |
2437 | 2437 | $_where = array(); |
2438 | 2438 | |
2439 | - if ( isset( $this->_req_data['s'] ) ) { |
|
2440 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
2439 | + if (isset($this->_req_data['s'])) { |
|
2440 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
2441 | 2441 | $_where['OR'] = array( |
2442 | - 'Registration.Event.EVT_name' => array( 'LIKE', $sstr), |
|
2443 | - 'Registration.Event.EVT_desc' => array( 'LIKE', $sstr ), |
|
2444 | - 'Registration.Event.EVT_short_desc' => array( 'LIKE' , $sstr ), |
|
2445 | - 'ATT_fname' => array( 'LIKE', $sstr ), |
|
2446 | - 'ATT_lname' => array( 'LIKE', $sstr ), |
|
2447 | - 'ATT_short_bio' => array( 'LIKE', $sstr ), |
|
2448 | - 'ATT_email' => array('LIKE', $sstr ), |
|
2449 | - 'ATT_address' => array( 'LIKE', $sstr ), |
|
2450 | - 'ATT_address2' => array( 'LIKE', $sstr ), |
|
2451 | - 'ATT_city' => array( 'LIKE', $sstr ), |
|
2452 | - 'Country.CNT_name' => array( 'LIKE', $sstr ), |
|
2453 | - 'State.STA_name' => array('LIKE', $sstr ), |
|
2454 | - 'ATT_phone' => array( 'LIKE', $sstr ), |
|
2455 | - 'Registration.REG_final_price' => array( 'LIKE', $sstr ), |
|
2456 | - 'Registration.REG_code' => array( 'LIKE', $sstr ), |
|
2457 | - 'Registration.REG_count' => array( 'LIKE' , $sstr ), |
|
2458 | - 'Registration.REG_group_size' => array( 'LIKE' , $sstr ) |
|
2442 | + 'Registration.Event.EVT_name' => array('LIKE', $sstr), |
|
2443 | + 'Registration.Event.EVT_desc' => array('LIKE', $sstr), |
|
2444 | + 'Registration.Event.EVT_short_desc' => array('LIKE', $sstr), |
|
2445 | + 'ATT_fname' => array('LIKE', $sstr), |
|
2446 | + 'ATT_lname' => array('LIKE', $sstr), |
|
2447 | + 'ATT_short_bio' => array('LIKE', $sstr), |
|
2448 | + 'ATT_email' => array('LIKE', $sstr), |
|
2449 | + 'ATT_address' => array('LIKE', $sstr), |
|
2450 | + 'ATT_address2' => array('LIKE', $sstr), |
|
2451 | + 'ATT_city' => array('LIKE', $sstr), |
|
2452 | + 'Country.CNT_name' => array('LIKE', $sstr), |
|
2453 | + 'State.STA_name' => array('LIKE', $sstr), |
|
2454 | + 'ATT_phone' => array('LIKE', $sstr), |
|
2455 | + 'Registration.REG_final_price' => array('LIKE', $sstr), |
|
2456 | + 'Registration.REG_code' => array('LIKE', $sstr), |
|
2457 | + 'Registration.REG_count' => array('LIKE', $sstr), |
|
2458 | + 'Registration.REG_group_size' => array('LIKE', $sstr) |
|
2459 | 2459 | ); |
2460 | 2460 | } |
2461 | 2461 | |
2462 | 2462 | |
2463 | - $offset = ($current_page-1)*$per_page; |
|
2464 | - $limit = $count ? NULL : array( $offset, $per_page ); |
|
2463 | + $offset = ($current_page - 1) * $per_page; |
|
2464 | + $limit = $count ? NULL : array($offset, $per_page); |
|
2465 | 2465 | |
2466 | - if ( $trash ) { |
|
2467 | - $_where['status'] = array( '!=', 'publish' ); |
|
2468 | - $all_attendees = $count ? $ATT_MDL->count( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit)): $ATT_MDL->get_all( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit)); |
|
2466 | + if ($trash) { |
|
2467 | + $_where['status'] = array('!=', 'publish'); |
|
2468 | + $all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)); |
|
2469 | 2469 | } else { |
2470 | - $_where['status'] = array( 'IN', array( 'publish' ) ); |
|
2471 | - $all_attendees = $count ? $ATT_MDL->count( array($_where, 'order_by'=>array($orderby=>$sort),'limit'=>$limit)) : $ATT_MDL->get_all( array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit) ); |
|
2470 | + $_where['status'] = array('IN', array('publish')); |
|
2471 | + $all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)); |
|
2472 | 2472 | } |
2473 | 2473 | |
2474 | 2474 | return $all_attendees; |
@@ -2485,10 +2485,10 @@ discard block |
||
2485 | 2485 | */ |
2486 | 2486 | protected function _resend_registration() { |
2487 | 2487 | $this->_process_resend_registration(); |
2488 | - $query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID'] ) : array( |
|
2488 | + $query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID']) : array( |
|
2489 | 2489 | 'action' => 'default' |
2490 | 2490 | ); |
2491 | - $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE ); |
|
2491 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
2492 | 2492 | } |
2493 | 2493 | |
2494 | 2494 | |
@@ -2496,26 +2496,26 @@ discard block |
||
2496 | 2496 | |
2497 | 2497 | |
2498 | 2498 | |
2499 | - public function _registrations_report(){ |
|
2500 | - if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) { |
|
2501 | - wp_redirect( EE_Admin_Page::add_query_args_and_nonce( |
|
2499 | + public function _registrations_report() { |
|
2500 | + if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) { |
|
2501 | + wp_redirect(EE_Admin_Page::add_query_args_and_nonce( |
|
2502 | 2502 | array( |
2503 | 2503 | 'page' => 'espresso_batch', |
2504 | 2504 | 'batch' => 'file', |
2505 | - 'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL, |
|
2506 | - 'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\RegistrationsReport' ), |
|
2507 | - 'return_url' => urlencode( $this->_req_data[ 'return_url' ] ), |
|
2508 | - )) ); |
|
2505 | + 'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL, |
|
2506 | + 'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\RegistrationsReport'), |
|
2507 | + 'return_url' => urlencode($this->_req_data['return_url']), |
|
2508 | + ))); |
|
2509 | 2509 | } else { |
2510 | 2510 | $new_request_args = array( |
2511 | 2511 | 'export' => 'report', |
2512 | 2512 | 'action' => 'registrations_report_for_event', |
2513 | - 'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL, |
|
2513 | + 'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL, |
|
2514 | 2514 | ); |
2515 | 2515 | $this->_req_data = array_merge($this->_req_data, $new_request_args); |
2516 | 2516 | |
2517 | - if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) { |
|
2518 | - require_once(EE_CLASSES . 'EE_Export.class.php'); |
|
2517 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
2518 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
2519 | 2519 | $EE_Export = EE_Export::instance($this->_req_data); |
2520 | 2520 | $EE_Export->export(); |
2521 | 2521 | } |
@@ -2524,26 +2524,26 @@ discard block |
||
2524 | 2524 | |
2525 | 2525 | |
2526 | 2526 | |
2527 | - public function _contact_list_export(){ |
|
2528 | - if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) { |
|
2529 | - require_once(EE_CLASSES . 'EE_Export.class.php'); |
|
2527 | + public function _contact_list_export() { |
|
2528 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
2529 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
2530 | 2530 | $EE_Export = EE_Export::instance($this->_req_data); |
2531 | 2531 | $EE_Export->export_attendees(); |
2532 | 2532 | } |
2533 | 2533 | } |
2534 | 2534 | |
2535 | - public function _contact_list_report(){ |
|
2536 | - if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) { |
|
2537 | - wp_redirect( EE_Admin_Page::add_query_args_and_nonce( |
|
2535 | + public function _contact_list_report() { |
|
2536 | + if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) { |
|
2537 | + wp_redirect(EE_Admin_Page::add_query_args_and_nonce( |
|
2538 | 2538 | array( |
2539 | 2539 | 'page' => 'espresso_batch', |
2540 | 2540 | 'batch' => 'file', |
2541 | - 'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\AttendeesReport' ), |
|
2542 | - 'return_url' => urlencode( $this->_req_data[ 'return_url' ] ), |
|
2543 | - )) ); |
|
2541 | + 'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\AttendeesReport'), |
|
2542 | + 'return_url' => urlencode($this->_req_data['return_url']), |
|
2543 | + ))); |
|
2544 | 2544 | } else { |
2545 | - if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) { |
|
2546 | - require_once(EE_CLASSES . 'EE_Export.class.php'); |
|
2545 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
2546 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
2547 | 2547 | $EE_Export = EE_Export::instance($this->_req_data); |
2548 | 2548 | $EE_Export->report_attendees(); |
2549 | 2549 | } |
@@ -2562,73 +2562,73 @@ discard block |
||
2562 | 2562 | * @return void |
2563 | 2563 | */ |
2564 | 2564 | protected function _duplicate_attendee() { |
2565 | - $action = !empty( $this->_req_data['return'] ) ? $this->_req_data['return'] : 'default'; |
|
2565 | + $action = ! empty($this->_req_data['return']) ? $this->_req_data['return'] : 'default'; |
|
2566 | 2566 | //verify we have necessary info |
2567 | - if ( empty($this->_req_data['_REG_ID'] ) ) { |
|
2568 | - EE_Error::add_error( __('Unable to create the contact for the registration because the required parameters are not present (_REG_ID )', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__ ); |
|
2569 | - $query_args = array( 'action' => $action ); |
|
2567 | + if (empty($this->_req_data['_REG_ID'])) { |
|
2568 | + EE_Error::add_error(__('Unable to create the contact for the registration because the required parameters are not present (_REG_ID )', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__); |
|
2569 | + $query_args = array('action' => $action); |
|
2570 | 2570 | $this->_redirect_after_action('', '', '', $query_args, TRUE); |
2571 | 2571 | } |
2572 | 2572 | |
2573 | 2573 | //okay necessary deets present... let's dupe the incoming attendee and attach to incoming registration. |
2574 | - $registration = EEM_Registration::instance()->get_one_by_ID( $this->_req_data['_REG_ID'] ); |
|
2574 | + $registration = EEM_Registration::instance()->get_one_by_ID($this->_req_data['_REG_ID']); |
|
2575 | 2575 | $attendee = $registration->attendee(); |
2576 | 2576 | |
2577 | 2577 | //remove relation of existing attendee on registration |
2578 | - $registration->_remove_relation_to($attendee, 'Attendee' ); |
|
2578 | + $registration->_remove_relation_to($attendee, 'Attendee'); |
|
2579 | 2579 | //new attendee |
2580 | 2580 | $new_attendee = clone $attendee; |
2581 | - $new_attendee->set( 'ATT_ID', 0 ); |
|
2581 | + $new_attendee->set('ATT_ID', 0); |
|
2582 | 2582 | $new_attendee->save(); |
2583 | 2583 | |
2584 | 2584 | //add new attendee to reg |
2585 | - $registration->_add_relation_to( $new_attendee, 'Attendee'); |
|
2585 | + $registration->_add_relation_to($new_attendee, 'Attendee'); |
|
2586 | 2586 | |
2587 | - EE_Error::add_success( __('New Contact record created. Now make any edits you wish to make for this contact.', 'event_espresso') ); |
|
2587 | + EE_Error::add_success(__('New Contact record created. Now make any edits you wish to make for this contact.', 'event_espresso')); |
|
2588 | 2588 | |
2589 | 2589 | //redirect to edit page for attendee |
2590 | - $query_args = array( 'post' => $new_attendee->ID(), 'action' => 'edit_attendee' ); |
|
2590 | + $query_args = array('post' => $new_attendee->ID(), 'action' => 'edit_attendee'); |
|
2591 | 2591 | |
2592 | - $this->_redirect_after_action( '', '', '', $query_args, TRUE ); |
|
2592 | + $this->_redirect_after_action('', '', '', $query_args, TRUE); |
|
2593 | 2593 | } |
2594 | 2594 | |
2595 | 2595 | |
2596 | 2596 | //related to cpt routes |
2597 | 2597 | protected function _insert_update_cpt_item($post_id, $post) { |
2598 | 2598 | $success = true; |
2599 | - $attendee = EEM_Attendee::instance()->get_one_by_ID( $post_id ); |
|
2599 | + $attendee = EEM_Attendee::instance()->get_one_by_ID($post_id); |
|
2600 | 2600 | //for attendee updates |
2601 | - if ( $post->post_type = 'espresso_attendees' && !empty( $attendee ) ) { |
|
2601 | + if ($post->post_type = 'espresso_attendees' && ! empty($attendee)) { |
|
2602 | 2602 | //note we should only be UPDATING attendees at this point. |
2603 | 2603 | $updated_fields = array( |
2604 | 2604 | 'ATT_fname' => $this->_req_data['ATT_fname'], |
2605 | 2605 | 'ATT_lname' => $this->_req_data['ATT_lname'], |
2606 | - 'ATT_full_name'=> $this->_req_data['ATT_fname'] . ' ' . $this->_req_data['ATT_lname'], |
|
2606 | + 'ATT_full_name'=> $this->_req_data['ATT_fname'].' '.$this->_req_data['ATT_lname'], |
|
2607 | 2607 | 'ATT_address' => isset($this->_req_data['ATT_address']) ? $this->_req_data['ATT_address'] : '', |
2608 | 2608 | 'ATT_address2' => isset($this->_req_data['ATT_address2']) ? $this->_req_data['ATT_address2'] : '', |
2609 | - 'ATT_city' => isset( $this->_req_data['ATT_city'] ) ? $this->_req_data['ATT_city'] : '', |
|
2610 | - 'STA_ID' => isset( $this->_req_data['STA_ID'] ) ? $this->_req_data['STA_ID'] : '', |
|
2611 | - 'CNT_ISO' => isset( $this->_req_data['CNT_ISO'] ) ? $this->_req_data['CNT_ISO'] : '', |
|
2612 | - 'ATT_zip' => isset( $this->_req_data['ATT_zip'] ) ? $this->_req_data['ATT_zip'] : '', |
|
2613 | - 'ATT_email' => isset( $this->_req_data['ATT_email'] ) ? $this->_req_data['ATT_email'] : '', |
|
2614 | - 'ATT_phone' => isset( $this->_req_data['ATT_phone'] ) ? $this->_req_data['ATT_phone'] : '' |
|
2609 | + 'ATT_city' => isset($this->_req_data['ATT_city']) ? $this->_req_data['ATT_city'] : '', |
|
2610 | + 'STA_ID' => isset($this->_req_data['STA_ID']) ? $this->_req_data['STA_ID'] : '', |
|
2611 | + 'CNT_ISO' => isset($this->_req_data['CNT_ISO']) ? $this->_req_data['CNT_ISO'] : '', |
|
2612 | + 'ATT_zip' => isset($this->_req_data['ATT_zip']) ? $this->_req_data['ATT_zip'] : '', |
|
2613 | + 'ATT_email' => isset($this->_req_data['ATT_email']) ? $this->_req_data['ATT_email'] : '', |
|
2614 | + 'ATT_phone' => isset($this->_req_data['ATT_phone']) ? $this->_req_data['ATT_phone'] : '' |
|
2615 | 2615 | ); |
2616 | - foreach ( $updated_fields as $field => $value ) { |
|
2616 | + foreach ($updated_fields as $field => $value) { |
|
2617 | 2617 | $attendee->set($field, $value); |
2618 | 2618 | } |
2619 | 2619 | |
2620 | 2620 | $success = $attendee->save(); |
2621 | 2621 | |
2622 | - $attendee_update_callbacks = apply_filters( 'FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array() ); |
|
2623 | - foreach ( $attendee_update_callbacks as $a_callback ) { |
|
2624 | - if ( FALSE === call_user_func_array( $a_callback, array($attendee, $this->_req_data ) ) ) { |
|
2625 | - throw new EE_Error( sprintf( __('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback. Please check the spelling.', 'event_espresso'), $a_callback ) ); |
|
2622 | + $attendee_update_callbacks = apply_filters('FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array()); |
|
2623 | + foreach ($attendee_update_callbacks as $a_callback) { |
|
2624 | + if (FALSE === call_user_func_array($a_callback, array($attendee, $this->_req_data))) { |
|
2625 | + throw new EE_Error(sprintf(__('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback. Please check the spelling.', 'event_espresso'), $a_callback)); |
|
2626 | 2626 | } |
2627 | 2627 | } |
2628 | 2628 | } |
2629 | 2629 | |
2630 | - if ( $success === FALSE ) |
|
2631 | - EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
2630 | + if ($success === FALSE) |
|
2631 | + EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
2632 | 2632 | |
2633 | 2633 | } |
2634 | 2634 | |
@@ -2648,17 +2648,17 @@ discard block |
||
2648 | 2648 | remove_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
2649 | 2649 | remove_meta_box('commentstatusdiv', $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
2650 | 2650 | |
2651 | - if ( post_type_supports( 'espresso_attendees', 'excerpt') ) { |
|
2652 | - add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal' ); |
|
2651 | + if (post_type_supports('espresso_attendees', 'excerpt')) { |
|
2652 | + add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal'); |
|
2653 | 2653 | } |
2654 | 2654 | |
2655 | - if ( post_type_supports( 'espresso_attendees', 'comments') ) { |
|
2655 | + if (post_type_supports('espresso_attendees', 'comments')) { |
|
2656 | 2656 | add_meta_box('commentsdiv', __('Notes on the Contact', 'event_espresso'), 'post_comment_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
2657 | 2657 | } |
2658 | 2658 | |
2659 | - add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array( $this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core' ); |
|
2660 | - add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core' ); |
|
2661 | - add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array( $this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high'); |
|
2659 | + add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array($this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core'); |
|
2660 | + add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
|
2661 | + add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array($this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high'); |
|
2662 | 2662 | } |
2663 | 2663 | |
2664 | 2664 | |
@@ -2667,10 +2667,10 @@ discard block |
||
2667 | 2667 | * @param WP_Post $post wp post object |
2668 | 2668 | * @return string attendee contact info ( and form ) |
2669 | 2669 | */ |
2670 | - public function attendee_contact_info( $post ) { |
|
2670 | + public function attendee_contact_info($post) { |
|
2671 | 2671 | //get attendee object ( should already have it ) |
2672 | 2672 | $this->_template_args['attendee'] = $this->_cpt_model_obj; |
2673 | - $template = REG_TEMPLATE_PATH . 'attendee_contact_info_metabox_content.template.php'; |
|
2673 | + $template = REG_TEMPLATE_PATH.'attendee_contact_info_metabox_content.template.php'; |
|
2674 | 2674 | EEH_Template::display_template($template, $this->_template_args); |
2675 | 2675 | } |
2676 | 2676 | |
@@ -2686,12 +2686,12 @@ discard block |
||
2686 | 2686 | $this->_template_args['attendee'] = $this->_cpt_model_obj; |
2687 | 2687 | $this->_template_args['state_html'] = EEH_Form_Fields::generate_form_input( |
2688 | 2688 | new EE_Question_Form_Input( |
2689 | - EE_Question::new_instance( array( |
|
2689 | + EE_Question::new_instance(array( |
|
2690 | 2690 | 'QST_ID' => 0, |
2691 | 2691 | 'QST_display_text' => __('State/Province', 'event_espresso'), |
2692 | 2692 | 'QST_system' => 'admin-state' |
2693 | 2693 | )), |
2694 | - EE_Answer::new_instance( array( |
|
2694 | + EE_Answer::new_instance(array( |
|
2695 | 2695 | 'ANS_ID' => 0, |
2696 | 2696 | 'ANS_value' => $this->_cpt_model_obj->state_ID() |
2697 | 2697 | )), |
@@ -2704,12 +2704,12 @@ discard block |
||
2704 | 2704 | )); |
2705 | 2705 | $this->_template_args['country_html'] = EEH_Form_Fields::generate_form_input( |
2706 | 2706 | new EE_Question_Form_Input( |
2707 | - EE_Question::new_instance( array( |
|
2707 | + EE_Question::new_instance(array( |
|
2708 | 2708 | 'QST_ID' => 0, |
2709 | 2709 | 'QST_display_text' => __('Country', 'event_espresso'), |
2710 | 2710 | 'QST_system' => 'admin-country' |
2711 | 2711 | )), |
2712 | - EE_Answer::new_instance( array( |
|
2712 | + EE_Answer::new_instance(array( |
|
2713 | 2713 | 'ANS_ID' => 0, |
2714 | 2714 | 'ANS_value' => $this->_cpt_model_obj->country_ID() |
2715 | 2715 | )), |
@@ -2720,8 +2720,8 @@ discard block |
||
2720 | 2720 | 'append_qstn_id' => FALSE |
2721 | 2721 | ) |
2722 | 2722 | )); |
2723 | - $template = REG_TEMPLATE_PATH . 'attendee_address_details_metabox_content.template.php'; |
|
2724 | - EEH_Template::display_template($template, $this->_template_args ); |
|
2723 | + $template = REG_TEMPLATE_PATH.'attendee_address_details_metabox_content.template.php'; |
|
2724 | + EEH_Template::display_template($template, $this->_template_args); |
|
2725 | 2725 | |
2726 | 2726 | } |
2727 | 2727 | |
@@ -2731,11 +2731,11 @@ discard block |
||
2731 | 2731 | * @access protected |
2732 | 2732 | * @return void |
2733 | 2733 | */ |
2734 | - public function attendee_registrations_meta_box( $post ) { |
|
2734 | + public function attendee_registrations_meta_box($post) { |
|
2735 | 2735 | |
2736 | 2736 | $this->_template_args['attendee'] = $this->_cpt_model_obj; |
2737 | 2737 | $this->_template_args['registrations'] = $this->_cpt_model_obj->get_many_related('Registration'); |
2738 | - $template = REG_TEMPLATE_PATH . 'attendee_registrations_main_meta_box.template.php'; |
|
2738 | + $template = REG_TEMPLATE_PATH.'attendee_registrations_main_meta_box.template.php'; |
|
2739 | 2739 | EEH_Template::display_template($template, $this->_template_args); |
2740 | 2740 | |
2741 | 2741 | } |
@@ -2749,8 +2749,8 @@ discard block |
||
2749 | 2749 | * @return string html for new form. |
2750 | 2750 | */ |
2751 | 2751 | public function after_title_form_fields($post) { |
2752 | - if ( $post->post_type == 'espresso_attendees' ) { |
|
2753 | - $template = REG_TEMPLATE_PATH . 'attendee_details_after_title_form_fields.template.php'; |
|
2752 | + if ($post->post_type == 'espresso_attendees') { |
|
2753 | + $template = REG_TEMPLATE_PATH.'attendee_details_after_title_form_fields.template.php'; |
|
2754 | 2754 | $template_args['attendee'] = $this->_cpt_model_obj; |
2755 | 2755 | EEH_Template::display_template($template, $template_args); |
2756 | 2756 | } |
@@ -2767,21 +2767,21 @@ discard block |
||
2767 | 2767 | * @access protected |
2768 | 2768 | * @return void |
2769 | 2769 | */ |
2770 | - protected function _trash_or_restore_attendees( $trash = TRUE ) { |
|
2770 | + protected function _trash_or_restore_attendees($trash = TRUE) { |
|
2771 | 2771 | |
2772 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
2772 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
2773 | 2773 | |
2774 | 2774 | $ATT_MDL = EEM_Attendee::instance(); |
2775 | 2775 | |
2776 | 2776 | $success = 1; |
2777 | 2777 | //Checkboxes |
2778 | - if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
2778 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
2779 | 2779 | // if array has more than one element than success message should be plural |
2780 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
2780 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
2781 | 2781 | // cycle thru checkboxes |
2782 | - while (list( $ATT_ID, $value ) = each($this->_req_data['checkbox'])) { |
|
2783 | - $updated = $trash ? $ATT_MDL->update_by_ID(array( 'status' => 'trash' ), $ATT_ID) : $ATT_MDL->update_by_ID( array('status' => 'publish' ), $ATT_ID); |
|
2784 | - if ( !$updated ) { |
|
2782 | + while (list($ATT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
2783 | + $updated = $trash ? $ATT_MDL->update_by_ID(array('status' => 'trash'), $ATT_ID) : $ATT_MDL->update_by_ID(array('status' => 'publish'), $ATT_ID); |
|
2784 | + if ( ! $updated) { |
|
2785 | 2785 | $success = 0; |
2786 | 2786 | } |
2787 | 2787 | } |
@@ -2790,18 +2790,18 @@ discard block |
||
2790 | 2790 | // grab single id and delete |
2791 | 2791 | $ATT_ID = absint($this->_req_data['ATT_ID']); |
2792 | 2792 | //get attendee |
2793 | - $att = $ATT_MDL->get_one_by_ID( $ATT_ID ); |
|
2793 | + $att = $ATT_MDL->get_one_by_ID($ATT_ID); |
|
2794 | 2794 | $updated = $trash ? $att->set_status('trash') : $att->set_status('publish'); |
2795 | 2795 | $updated = $att->save(); |
2796 | - if ( ! $updated ) { |
|
2796 | + if ( ! $updated) { |
|
2797 | 2797 | $success = 0; |
2798 | 2798 | } |
2799 | 2799 | |
2800 | 2800 | } |
2801 | 2801 | |
2802 | - $what = $success > 1 ? __( 'Contacts', 'event_espresso' ) : __( 'Contact', 'event_espresso' ); |
|
2803 | - $action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' ); |
|
2804 | - $this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'contact_list' ) ); |
|
2802 | + $what = $success > 1 ? __('Contacts', 'event_espresso') : __('Contact', 'event_espresso'); |
|
2803 | + $action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso'); |
|
2804 | + $this->_redirect_after_action($success, $what, $action_desc, array('action' => 'contact_list')); |
|
2805 | 2805 | |
2806 | 2806 | } |
2807 | 2807 |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'ABSPATH' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('ABSPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /* |
5 | 5 | Plugin Name: Event Espresso |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * |
42 | 42 | */ |
43 | 43 | |
44 | -if ( function_exists( 'espresso_version' ) ) { |
|
44 | +if (function_exists('espresso_version')) { |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * espresso_duplicate_plugin_error |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | function espresso_duplicate_plugin_error() { |
51 | 51 | ?> |
52 | 52 | <div class="error"> |
53 | - <p><?php _e( 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', 'event_espresso' ); ?></p> |
|
53 | + <p><?php _e('Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', 'event_espresso'); ?></p> |
|
54 | 54 | </div> |
55 | 55 | <?php |
56 | - espresso_deactivate_plugin( plugin_basename( __FILE__ ) ); |
|
56 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
57 | 57 | } |
58 | - add_action( 'admin_notices', 'espresso_duplicate_plugin_error', 1 ); |
|
58 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
59 | 59 | |
60 | 60 | } else { |
61 | 61 | |
@@ -66,103 +66,103 @@ discard block |
||
66 | 66 | * @return string |
67 | 67 | */ |
68 | 68 | function espresso_version() { |
69 | - return apply_filters( 'FHEE__espresso__espresso_version', '4.9.8.rc.008' ); |
|
69 | + return apply_filters('FHEE__espresso__espresso_version', '4.9.8.rc.008'); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | // define versions |
73 | - define( 'EVENT_ESPRESSO_VERSION', espresso_version() ); |
|
74 | - define( 'EE_MIN_WP_VER_REQUIRED', '4.1' ); |
|
75 | - define( 'EE_MIN_WP_VER_RECOMMENDED', '4.4.2' ); |
|
76 | - define( 'EE_MIN_PHP_VER_REQUIRED', '5.3.0' ); |
|
77 | - define( 'EE_MIN_PHP_VER_RECOMMENDED', '5.4.44' ); |
|
78 | - define( 'EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - ' . EVENT_ESPRESSO_VERSION ); |
|
79 | - define( 'EVENT_ESPRESSO_MAIN_FILE', __FILE__ ); |
|
73 | + define('EVENT_ESPRESSO_VERSION', espresso_version()); |
|
74 | + define('EE_MIN_WP_VER_REQUIRED', '4.1'); |
|
75 | + define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2'); |
|
76 | + define('EE_MIN_PHP_VER_REQUIRED', '5.3.0'); |
|
77 | + define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44'); |
|
78 | + define('EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - '.EVENT_ESPRESSO_VERSION); |
|
79 | + define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
80 | 80 | //used to be DIRECTORY_SEPARATOR, but that caused issues on windows |
81 | - if ( ! defined( 'DS' ) ) { |
|
82 | - define( 'DS', '/' ); |
|
81 | + if ( ! defined('DS')) { |
|
82 | + define('DS', '/'); |
|
83 | 83 | } |
84 | - if ( ! defined( 'PS' ) ) { |
|
85 | - define( 'PS', PATH_SEPARATOR ); |
|
84 | + if ( ! defined('PS')) { |
|
85 | + define('PS', PATH_SEPARATOR); |
|
86 | 86 | } |
87 | - if ( ! defined( 'SP' ) ) { |
|
88 | - define( 'SP', ' ' ); |
|
87 | + if ( ! defined('SP')) { |
|
88 | + define('SP', ' '); |
|
89 | 89 | } |
90 | - if ( ! defined( 'EENL' ) ) { |
|
91 | - define( 'EENL', "\n" ); |
|
90 | + if ( ! defined('EENL')) { |
|
91 | + define('EENL', "\n"); |
|
92 | 92 | } |
93 | - define( 'EE_SUPPORT_EMAIL', '[email protected]' ); |
|
93 | + define('EE_SUPPORT_EMAIL', '[email protected]'); |
|
94 | 94 | // define the plugin directory and URL |
95 | - define( 'EE_PLUGIN_BASENAME', plugin_basename( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
96 | - define( 'EE_PLUGIN_DIR_PATH', plugin_dir_path( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
97 | - define( 'EE_PLUGIN_DIR_URL', plugin_dir_url( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
95 | + define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE)); |
|
96 | + define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE)); |
|
97 | + define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE)); |
|
98 | 98 | // main root folder paths |
99 | - define( 'EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS ); |
|
100 | - define( 'EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS ); |
|
101 | - define( 'EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS ); |
|
102 | - define( 'EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS ); |
|
103 | - define( 'EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS ); |
|
104 | - define( 'EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS ); |
|
105 | - define( 'EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS ); |
|
106 | - define( 'EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS ); |
|
99 | + define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH.'admin_pages'.DS); |
|
100 | + define('EE_CORE', EE_PLUGIN_DIR_PATH.'core'.DS); |
|
101 | + define('EE_MODULES', EE_PLUGIN_DIR_PATH.'modules'.DS); |
|
102 | + define('EE_PUBLIC', EE_PLUGIN_DIR_PATH.'public'.DS); |
|
103 | + define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH.'shortcodes'.DS); |
|
104 | + define('EE_WIDGETS', EE_PLUGIN_DIR_PATH.'widgets'.DS); |
|
105 | + define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH.'payment_methods'.DS); |
|
106 | + define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH.'caffeinated'.DS); |
|
107 | 107 | // core system paths |
108 | - define( 'EE_ADMIN', EE_CORE . 'admin' . DS ); |
|
109 | - define( 'EE_CPTS', EE_CORE . 'CPTs' . DS ); |
|
110 | - define( 'EE_CLASSES', EE_CORE . 'db_classes' . DS ); |
|
111 | - define( 'EE_INTERFACES', EE_CORE . 'interfaces' . DS ); |
|
112 | - define( 'EE_BUSINESS', EE_CORE . 'business' . DS ); |
|
113 | - define( 'EE_MODELS', EE_CORE . 'db_models' . DS ); |
|
114 | - define( 'EE_HELPERS', EE_CORE . 'helpers' . DS ); |
|
115 | - define( 'EE_LIBRARIES', EE_CORE . 'libraries' . DS ); |
|
116 | - define( 'EE_TEMPLATES', EE_CORE . 'templates' . DS ); |
|
117 | - define( 'EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS ); |
|
118 | - define( 'EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS ); |
|
119 | - define( 'EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS ); |
|
108 | + define('EE_ADMIN', EE_CORE.'admin'.DS); |
|
109 | + define('EE_CPTS', EE_CORE.'CPTs'.DS); |
|
110 | + define('EE_CLASSES', EE_CORE.'db_classes'.DS); |
|
111 | + define('EE_INTERFACES', EE_CORE.'interfaces'.DS); |
|
112 | + define('EE_BUSINESS', EE_CORE.'business'.DS); |
|
113 | + define('EE_MODELS', EE_CORE.'db_models'.DS); |
|
114 | + define('EE_HELPERS', EE_CORE.'helpers'.DS); |
|
115 | + define('EE_LIBRARIES', EE_CORE.'libraries'.DS); |
|
116 | + define('EE_TEMPLATES', EE_CORE.'templates'.DS); |
|
117 | + define('EE_THIRD_PARTY', EE_CORE.'third_party_libs'.DS); |
|
118 | + define('EE_GLOBAL_ASSETS', EE_TEMPLATES.'global_assets'.DS); |
|
119 | + define('EE_FORM_SECTIONS', EE_LIBRARIES.'form_sections'.DS); |
|
120 | 120 | // gateways |
121 | - define( 'EE_GATEWAYS', EE_MODULES . 'gateways' . DS ); |
|
122 | - define( 'EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS ); |
|
121 | + define('EE_GATEWAYS', EE_MODULES.'gateways'.DS); |
|
122 | + define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL.'modules'.DS.'gateways'.DS); |
|
123 | 123 | // asset URL paths |
124 | - define( 'EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS ); |
|
125 | - define( 'EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS ); |
|
126 | - define( 'EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS ); |
|
127 | - define( 'EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS ); |
|
128 | - define( 'EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/' ); |
|
129 | - define( 'EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/' ); |
|
124 | + define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL.'core'.DS.'templates'.DS); |
|
125 | + define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL.'global_assets'.DS); |
|
126 | + define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL.'images'.DS); |
|
127 | + define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL.'core'.DS.'third_party_libs'.DS); |
|
128 | + define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL.'core/helpers/assets/'); |
|
129 | + define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL.'core/libraries/'); |
|
130 | 130 | // define upload paths |
131 | 131 | $uploads = wp_upload_dir(); |
132 | 132 | // define the uploads directory and URL |
133 | - define( 'EVENT_ESPRESSO_UPLOAD_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS ); |
|
134 | - define( 'EVENT_ESPRESSO_UPLOAD_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS ); |
|
133 | + define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'].DS.'espresso'.DS); |
|
134 | + define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'].DS.'espresso'.DS); |
|
135 | 135 | // define the templates directory and URL |
136 | - define( 'EVENT_ESPRESSO_TEMPLATE_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'templates' . DS ); |
|
137 | - define( 'EVENT_ESPRESSO_TEMPLATE_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'templates' . DS ); |
|
136 | + define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'].DS.'espresso'.DS.'templates'.DS); |
|
137 | + define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'].DS.'espresso'.DS.'templates'.DS); |
|
138 | 138 | // define the gateway directory and URL |
139 | - define( 'EVENT_ESPRESSO_GATEWAY_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'gateways' . DS ); |
|
140 | - define( 'EVENT_ESPRESSO_GATEWAY_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'gateways' . DS ); |
|
139 | + define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'].DS.'espresso'.DS.'gateways'.DS); |
|
140 | + define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'].DS.'espresso'.DS.'gateways'.DS); |
|
141 | 141 | // languages folder/path |
142 | - define( 'EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS ); |
|
143 | - define( 'EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS ); |
|
142 | + define('EE_LANGUAGES_SAFE_LOC', '..'.DS.'uploads'.DS.'espresso'.DS.'languages'.DS); |
|
143 | + define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'languages'.DS); |
|
144 | 144 | //check for dompdf fonts in uploads |
145 | - if ( file_exists( EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ) ) { |
|
146 | - define( 'DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ); |
|
145 | + if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS)) { |
|
146 | + define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS); |
|
147 | 147 | } |
148 | 148 | //ajax constants |
149 | - define( 'EE_FRONT_AJAX', isset( $_REQUEST[ 'ee_front_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_front_ajax' ] ) ? true : false ); |
|
150 | - define( 'EE_ADMIN_AJAX', isset( $_REQUEST[ 'ee_admin_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_admin_ajax' ] ) ? true : false ); |
|
149 | + define('EE_FRONT_AJAX', isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false); |
|
150 | + define('EE_ADMIN_AJAX', isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false); |
|
151 | 151 | //just a handy constant occasionally needed for finding values representing infinity in the DB |
152 | 152 | //you're better to use this than its straight value (currently -1) in case you ever |
153 | 153 | //want to change its default value! or find when -1 means infinity |
154 | - define( 'EE_INF_IN_DB', -1 ); |
|
155 | - define( 'EE_INF', INF > (float)PHP_INT_MAX ? INF : PHP_INT_MAX ); |
|
156 | - define( 'EE_DEBUG', false ); |
|
154 | + define('EE_INF_IN_DB', -1); |
|
155 | + define('EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX); |
|
156 | + define('EE_DEBUG', false); |
|
157 | 157 | |
158 | 158 | /** |
159 | 159 | * espresso_plugin_activation |
160 | 160 | * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
161 | 161 | */ |
162 | 162 | function espresso_plugin_activation() { |
163 | - update_option( 'ee_espresso_activation', true ); |
|
163 | + update_option('ee_espresso_activation', true); |
|
164 | 164 | } |
165 | - register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' ); |
|
165 | + register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
166 | 166 | |
167 | 167 | |
168 | 168 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | // } |
177 | 177 | // |
178 | 178 | } |
179 | - register_deactivation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation' ); |
|
179 | + register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation'); |
|
180 | 180 | |
181 | 181 | |
182 | 182 | |
@@ -186,15 +186,15 @@ discard block |
||
186 | 186 | */ |
187 | 187 | function espresso_load_error_handling() { |
188 | 188 | // load debugging tools |
189 | - if ( WP_DEBUG === true && is_readable( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ) ) { |
|
190 | - require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ); |
|
189 | + if (WP_DEBUG === true && is_readable(EE_HELPERS.'EEH_Debug_Tools.helper.php')) { |
|
190 | + require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php'); |
|
191 | 191 | EEH_Debug_Tools::instance(); |
192 | 192 | } |
193 | 193 | // load error handling |
194 | - if ( is_readable( EE_CORE . 'EE_Error.core.php' ) ) { |
|
195 | - require_once( EE_CORE . 'EE_Error.core.php' ); |
|
194 | + if (is_readable(EE_CORE.'EE_Error.core.php')) { |
|
195 | + require_once(EE_CORE.'EE_Error.core.php'); |
|
196 | 196 | } else { |
197 | - wp_die( __( 'The EE_Error core class could not be loaded.', 'event_espresso' ) ); |
|
197 | + wp_die(__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
198 | 198 | } |
199 | 199 | } |
200 | 200 | |
@@ -208,25 +208,25 @@ discard block |
||
208 | 208 | * @param string $full_path_to_file |
209 | 209 | * @throws EE_Error |
210 | 210 | */ |
211 | - function espresso_load_required( $classname, $full_path_to_file ) { |
|
211 | + function espresso_load_required($classname, $full_path_to_file) { |
|
212 | 212 | static $error_handling_loaded = false; |
213 | - if ( ! $error_handling_loaded ) { |
|
213 | + if ( ! $error_handling_loaded) { |
|
214 | 214 | espresso_load_error_handling(); |
215 | 215 | $error_handling_loaded = true; |
216 | 216 | } |
217 | - if ( is_readable( $full_path_to_file ) ) { |
|
218 | - require_once( $full_path_to_file ); |
|
217 | + if (is_readable($full_path_to_file)) { |
|
218 | + require_once($full_path_to_file); |
|
219 | 219 | } else { |
220 | - throw new EE_Error ( sprintf( |
|
221 | - __( 'The %s class file could not be located or is not readable due to file permissions.', 'event_espresso' ), |
|
220 | + throw new EE_Error(sprintf( |
|
221 | + __('The %s class file could not be located or is not readable due to file permissions.', 'event_espresso'), |
|
222 | 222 | $classname |
223 | - ) ); |
|
223 | + )); |
|
224 | 224 | } |
225 | 225 | } |
226 | 226 | |
227 | - espresso_load_required( 'EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' ); |
|
228 | - espresso_load_required( 'EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' ); |
|
229 | - espresso_load_required( 'EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php' ); |
|
227 | + espresso_load_required('EEH_Base', EE_CORE.'helpers'.DS.'EEH_Base.helper.php'); |
|
228 | + espresso_load_required('EEH_File', EE_CORE.'helpers'.DS.'EEH_File.helper.php'); |
|
229 | + espresso_load_required('EE_Bootstrap', EE_CORE.'EE_Bootstrap.core.php'); |
|
230 | 230 | new EE_Bootstrap(); |
231 | 231 | |
232 | 232 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | |
237 | 237 | |
238 | -if ( ! function_exists( 'espresso_deactivate_plugin' ) ) { |
|
238 | +if ( ! function_exists('espresso_deactivate_plugin')) { |
|
239 | 239 | /** |
240 | 240 | * deactivate_plugin |
241 | 241 | * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
@@ -244,11 +244,11 @@ discard block |
||
244 | 244 | * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
245 | 245 | * @return void |
246 | 246 | */ |
247 | - function espresso_deactivate_plugin( $plugin_basename = '' ) { |
|
248 | - if ( ! function_exists( 'deactivate_plugins' ) ) { |
|
249 | - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
|
247 | + function espresso_deactivate_plugin($plugin_basename = '') { |
|
248 | + if ( ! function_exists('deactivate_plugins')) { |
|
249 | + require_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
250 | 250 | } |
251 | - unset( $_GET[ 'activate' ], $_REQUEST[ 'activate' ] ); |
|
252 | - deactivate_plugins( $plugin_basename ); |
|
251 | + unset($_GET['activate'], $_REQUEST['activate']); |
|
252 | + deactivate_plugins($plugin_basename); |
|
253 | 253 | } |
254 | 254 | } |