@@ -4,10 +4,10 @@ |
||
| 4 | 4 | </strong> |
| 5 | 5 | </p> |
| 6 | 6 | <p> |
| 7 | -<?php printf(__('Mijireh is basically a middle-man between Event Espresso and over 90 payment gateways. Most of the configuration occurs on %sMijireh\' website%s, where you configure your Mijireh store with the %spayment gateway of your choice%s.', 'event_espresso'),'<a href="http://www.mijireh.com/">','</a>','<a href="http://www.mijireh.com/docs/payment-gateways/">','</a>'); ?> |
|
| 7 | +<?php printf(__('Mijireh is basically a middle-man between Event Espresso and over 90 payment gateways. Most of the configuration occurs on %sMijireh\' website%s, where you configure your Mijireh store with the %spayment gateway of your choice%s.', 'event_espresso'), '<a href="http://www.mijireh.com/">', '</a>', '<a href="http://www.mijireh.com/docs/payment-gateways/">', '</a>'); ?> |
|
| 8 | 8 | </p> |
| 9 | 9 | <p><strong><?php _e('Mijireh Checkout Page Design', 'event_espresso'); ?></strong></p> |
| 10 | 10 | <p> |
| 11 | -<?php _e("As you're probably aware, when users pay with Mijireh Gateway, they are taken to a secure offsite page, hosted by Mijireh. This page can easily be made to have the look-and-feel of your website through a process called 'slurping', where Mijireh 'slurps' up your website's design and uses it on their checkout page. ", 'event_espresso');?> |
|
| 12 | -<?php printf(__("In order to do this, we automatically create a new WordPress page which is design to be slurped by Mijireh. You can customize the page like any other, but the page must contain Mijireh's special '{{mijireh-checkout-form}}' shortcode. Once you have finished designing the page, publish it, and %s then click the special 'slurp now' button%s. Mijireh may take several minutes to slurp the page. Once Mijireh is finished slurping, you can delete the page, or mark it as a draft. ", 'event_espresso'),'<a href="https://docs.google.com/a/eventespresso.com/file/d/0B5P8GXTvZgfMdjREYUtGM18wSms/edit?usp=drivesdk">','</a>');?> |
|
| 11 | +<?php _e("As you're probably aware, when users pay with Mijireh Gateway, they are taken to a secure offsite page, hosted by Mijireh. This page can easily be made to have the look-and-feel of your website through a process called 'slurping', where Mijireh 'slurps' up your website's design and uses it on their checkout page. ", 'event_espresso'); ?> |
|
| 12 | +<?php printf(__("In order to do this, we automatically create a new WordPress page which is design to be slurped by Mijireh. You can customize the page like any other, but the page must contain Mijireh's special '{{mijireh-checkout-form}}' shortcode. Once you have finished designing the page, publish it, and %s then click the special 'slurp now' button%s. Mijireh may take several minutes to slurp the page. Once Mijireh is finished slurping, you can delete the page, or mark it as a draft. ", 'event_espresso'), '<a href="https://docs.google.com/a/eventespresso.com/file/d/0B5P8GXTvZgfMdjREYUtGM18wSms/edit?usp=drivesdk">', '</a>'); ?> |
|
| 13 | 13 | </p> |
| 14 | 14 | \ No newline at end of file |
@@ -13,13 +13,13 @@ discard block |
||
| 13 | 13 | //(all other times it gets resurrected from a wordpress option) |
| 14 | 14 | $stages = glob(EE_CORE.'data_migration_scripts/4_8_0_stages/*'); |
| 15 | 15 | $class_to_filepath = array(); |
| 16 | -foreach($stages as $filepath){ |
|
| 16 | +foreach ($stages as $filepath) { |
|
| 17 | 17 | $matches = array(); |
| 18 | - preg_match('~4_8_0_stages/(.*).dmsstage.php~',$filepath,$matches); |
|
| 18 | + preg_match('~4_8_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
| 19 | 19 | $class_to_filepath[$matches[1]] = $filepath; |
| 20 | 20 | } |
| 21 | 21 | //give addons a chance to autoload their stages too |
| 22 | -$class_to_filepath = apply_filters('FHEE__EE_DMS_4_8_0__autoloaded_stages',$class_to_filepath); |
|
| 22 | +$class_to_filepath = apply_filters('FHEE__EE_DMS_4_8_0__autoloaded_stages', $class_to_filepath); |
|
| 23 | 23 | EEH_Autoloader::register_autoloader($class_to_filepath); |
| 24 | 24 | |
| 25 | 25 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @since 4.6.0 |
| 36 | 36 | * |
| 37 | 37 | */ |
| 38 | -class EE_DMS_Core_4_8_0 extends EE_Data_Migration_Script_Base{ |
|
| 38 | +class EE_DMS_Core_4_8_0 extends EE_Data_Migration_Script_Base { |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * return EE_DMS_Core_4_8_0 |
@@ -62,14 +62,14 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function can_migrate_from_version($version_array) { |
| 64 | 64 | $version_string = $version_array['Core']; |
| 65 | - if( $version_string <= '4.8.0' && $version_string >= '4.7.0' ){ |
|
| 65 | + if ($version_string <= '4.8.0' && $version_string >= '4.7.0') { |
|
| 66 | 66 | // echo "$version_string can be migrated from"; |
| 67 | 67 | return true; |
| 68 | - }elseif( ! $version_string ){ |
|
| 68 | + }elseif ( ! $version_string) { |
|
| 69 | 69 | // echo "no version string provided: $version_string"; |
| 70 | 70 | //no version string provided... this must be pre 4.3 |
| 71 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 72 | - }else{ |
|
| 71 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
| 72 | + } else { |
|
| 73 | 73 | // echo "$version_string doesnt apply"; |
| 74 | 74 | return false; |
| 75 | 75 | } |
@@ -90,18 +90,18 @@ discard block |
||
| 90 | 90 | * @return bool |
| 91 | 91 | */ |
| 92 | 92 | public function schema_changes_before_migration() { |
| 93 | - $now_in_mysql = current_time( 'mysql', true ); |
|
| 93 | + $now_in_mysql = current_time('mysql', true); |
|
| 94 | 94 | |
| 95 | - require_once( EE_HELPERS . 'EEH_Activation.helper.php' ); |
|
| 96 | - $table_name='esp_answer'; |
|
| 97 | - $sql=" ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 95 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
| 96 | + $table_name = 'esp_answer'; |
|
| 97 | + $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 98 | 98 | REG_ID INT UNSIGNED NOT NULL, |
| 99 | 99 | QST_ID INT UNSIGNED NOT NULL, |
| 100 | 100 | ANS_value TEXT NOT NULL, |
| 101 | 101 | PRIMARY KEY (ANS_ID), |
| 102 | 102 | KEY REG_ID (REG_ID), |
| 103 | 103 | KEY QST_ID (QST_ID)"; |
| 104 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 104 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 105 | 105 | |
| 106 | 106 | $table_name = 'esp_attendee_meta'; |
| 107 | 107 | $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | CNT_is_EU TINYINT(1) DEFAULT '0', |
| 142 | 142 | CNT_active TINYINT(1) DEFAULT '0', |
| 143 | 143 | PRIMARY KEY (CNT_ISO)"; |
| 144 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 144 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 145 | 145 | |
| 146 | 146 | $table_name = 'esp_currency'; |
| 147 | 147 | $sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | CUR_dec_plc VARCHAR(1) COLLATE utf8_bin NOT NULL DEFAULT '2', |
| 152 | 152 | CUR_active TINYINT(1) DEFAULT '0', |
| 153 | 153 | PRIMARY KEY (CUR_code)"; |
| 154 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 154 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | $table_name = 'esp_currency_payment_method'; |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | KEY EVT_ID (EVT_ID), |
| 182 | 182 | KEY DTT_is_primary (DTT_is_primary)"; |
| 183 | 183 | |
| 184 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 184 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 185 | 185 | |
| 186 | 186 | $table_name = 'esp_event_meta'; |
| 187 | 187 | $sql = " |
@@ -200,41 +200,41 @@ discard block |
||
| 200 | 200 | EVT_donations TINYINT(1) NULL, |
| 201 | 201 | PRIMARY KEY (EVTM_ID), |
| 202 | 202 | KEY EVT_ID (EVT_ID)"; |
| 203 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 203 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 204 | 204 | |
| 205 | 205 | |
| 206 | 206 | |
| 207 | - $table_name='esp_event_question_group'; |
|
| 208 | - $sql="EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 207 | + $table_name = 'esp_event_question_group'; |
|
| 208 | + $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 209 | 209 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 210 | 210 | QSG_ID INT UNSIGNED NOT NULL, |
| 211 | 211 | EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 212 | 212 | PRIMARY KEY (EQG_ID), |
| 213 | 213 | KEY EVT_ID (EVT_ID), |
| 214 | 214 | KEY QSG_ID (QSG_ID)"; |
| 215 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 215 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 216 | 216 | |
| 217 | 217 | |
| 218 | 218 | |
| 219 | - $table_name='esp_event_venue'; |
|
| 220 | - $sql="EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 219 | + $table_name = 'esp_event_venue'; |
|
| 220 | + $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 221 | 221 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 222 | 222 | VNU_ID BIGINT(20) UNSIGNED NOT NULL, |
| 223 | 223 | EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 224 | 224 | PRIMARY KEY (EVV_ID)"; |
| 225 | - $this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 225 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 226 | 226 | |
| 227 | 227 | |
| 228 | 228 | |
| 229 | - $table_name='esp_extra_meta'; |
|
| 230 | - $sql="EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 229 | + $table_name = 'esp_extra_meta'; |
|
| 230 | + $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 231 | 231 | OBJ_ID INT(11) DEFAULT NULL, |
| 232 | 232 | EXM_type VARCHAR(45) DEFAULT NULL, |
| 233 | 233 | EXM_key VARCHAR(45) DEFAULT NULL, |
| 234 | 234 | EXM_value TEXT, |
| 235 | 235 | PRIMARY KEY (EXM_ID), |
| 236 | 236 | KEY EXM_type (EXM_type,OBJ_ID,EXM_key)"; |
| 237 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 237 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 238 | 238 | |
| 239 | 239 | $table_name = 'esp_extra_join'; |
| 240 | 240 | $sql = "EXJ_ID INT(11) NOT NULL AUTO_INCREMENT, |
@@ -247,8 +247,8 @@ discard block |
||
| 247 | 247 | KEY second_model (EXJ_second_model_name,EXJ_second_model_id)"; |
| 248 | 248 | $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
| 249 | 249 | |
| 250 | - $table_name='esp_line_item'; |
|
| 251 | - $sql="LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 250 | + $table_name = 'esp_line_item'; |
|
| 251 | + $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 252 | 252 | LIN_code VARCHAR(245) NOT NULL DEFAULT '', |
| 253 | 253 | TXN_ID INT(11) DEFAULT NULL, |
| 254 | 254 | LIN_name VARCHAR(245) NOT NULL DEFAULT '', |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | PRIMARY KEY (LIN_ID), |
| 268 | 268 | KEY LIN_code (LIN_code(191)), |
| 269 | 269 | KEY TXN_ID (TXN_ID)"; |
| 270 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB' ); |
|
| 270 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 271 | 271 | |
| 272 | 272 | $table_name = 'esp_log'; |
| 273 | 273 | $sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT, |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | MTP_is_active TINYINT(1) NOT NULL DEFAULT '1', |
| 307 | 307 | PRIMARY KEY (GRP_ID), |
| 308 | 308 | KEY MTP_user_id (MTP_user_id)"; |
| 309 | - $this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB'); |
|
| 309 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 310 | 310 | |
| 311 | 311 | $table_name = 'esp_event_message_template'; |
| 312 | 312 | $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | PRIMARY KEY (EMT_ID), |
| 316 | 316 | KEY EVT_ID (EVT_ID), |
| 317 | 317 | KEY GRP_ID (GRP_ID)"; |
| 318 | - $this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB'); |
|
| 318 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 319 | 319 | |
| 320 | 320 | |
| 321 | 321 | $table_name = 'esp_payment'; |
@@ -388,8 +388,8 @@ discard block |
||
| 388 | 388 | PRIMARY KEY (TTM_ID)"; |
| 389 | 389 | $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
| 390 | 390 | |
| 391 | - $table_name='esp_question'; |
|
| 392 | - $sql='QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 391 | + $table_name = 'esp_question'; |
|
| 392 | + $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 393 | 393 | QST_display_text TEXT NOT NULL, |
| 394 | 394 | QST_admin_label VARCHAR(255) NOT NULL, |
| 395 | 395 | QST_system VARCHAR(25) DEFAULT NULL, |
@@ -403,22 +403,22 @@ discard block |
||
| 403 | 403 | QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0, |
| 404 | 404 | PRIMARY KEY (QST_ID), |
| 405 | 405 | KEY QST_order (QST_order)'; |
| 406 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 406 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 407 | 407 | |
| 408 | - $table_name='esp_question_group_question'; |
|
| 409 | - $sql="QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 408 | + $table_name = 'esp_question_group_question'; |
|
| 409 | + $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 410 | 410 | QSG_ID INT UNSIGNED NOT NULL, |
| 411 | 411 | QST_ID INT UNSIGNED NOT NULL, |
| 412 | 412 | QGQ_order INT UNSIGNED NOT NULL DEFAULT 0, |
| 413 | 413 | PRIMARY KEY (QGQ_ID), |
| 414 | 414 | KEY QST_ID (QST_ID), |
| 415 | 415 | KEY QSG_ID_order (QSG_ID,QGQ_order)"; |
| 416 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 416 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 417 | 417 | |
| 418 | 418 | |
| 419 | 419 | |
| 420 | - $table_name='esp_question_option'; |
|
| 421 | - $sql="QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 420 | + $table_name = 'esp_question_option'; |
|
| 421 | + $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 422 | 422 | QSO_value VARCHAR(255) NOT NULL, |
| 423 | 423 | QSO_desc TEXT NOT NULL, |
| 424 | 424 | QST_ID INT UNSIGNED NOT NULL, |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | PRIMARY KEY (QSO_ID), |
| 429 | 429 | KEY QST_ID (QST_ID), |
| 430 | 430 | KEY QSO_order (QSO_order)"; |
| 431 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 431 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 432 | 432 | |
| 433 | 433 | |
| 434 | 434 | |
@@ -474,8 +474,8 @@ discard block |
||
| 474 | 474 | |
| 475 | 475 | |
| 476 | 476 | |
| 477 | - $table_name='esp_checkin'; |
|
| 478 | - $sql="CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 477 | + $table_name = 'esp_checkin'; |
|
| 478 | + $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 479 | 479 | REG_ID INT(10) UNSIGNED NOT NULL, |
| 480 | 480 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 481 | 481 | CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | PRC_parent INT(10) UNSIGNED DEFAULT 0, |
| 571 | 571 | PRIMARY KEY (PRC_ID), |
| 572 | 572 | KEY PRT_ID (PRT_ID)"; |
| 573 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 573 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 574 | 574 | |
| 575 | 575 | $table_name = "esp_price_type"; |
| 576 | 576 | $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
@@ -608,10 +608,10 @@ discard block |
||
| 608 | 608 | TKT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 609 | 609 | PRIMARY KEY (TKT_ID), |
| 610 | 610 | KEY TKT_start_date (TKT_start_date)"; |
| 611 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 611 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 612 | 612 | |
| 613 | 613 | $table_name = 'esp_question_group'; |
| 614 | - $sql='QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 614 | + $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 615 | 615 | QSG_name VARCHAR(255) NOT NULL, |
| 616 | 616 | QSG_identifier VARCHAR(100) NOT NULL, |
| 617 | 617 | QSG_desc TEXT NULL, |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | PRIMARY KEY (QSG_ID), |
| 625 | 625 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier), |
| 626 | 626 | KEY QSG_order (QSG_order)'; |
| 627 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 627 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 628 | 628 | |
| 629 | 629 | /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
| 630 | 630 | $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | return $script_4_7_defaults->schema_changes_after_migration(); |
| 661 | 661 | } |
| 662 | 662 | |
| 663 | - public function migration_page_hooks(){ |
|
| 663 | + public function migration_page_hooks() { |
|
| 664 | 664 | |
| 665 | 665 | } |
| 666 | 666 | |
@@ -674,19 +674,19 @@ discard block |
||
| 674 | 674 | //CNT_ISO, CNT_ISO3, RGN_ID, CNT_name, CNT_cur_code, CNT_cur_single, CNT_cur_plural, CNT_cur_sign, CNT_cur_sign_b4, CNT_cur_dec_plc, CNT_tel_code, CNT_is_EU, CNT_active |
| 675 | 675 | //('AD', 'AND', 0, 'Andorra', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+376', 0, 0), |
| 676 | 676 | $newer_countries = array( |
| 677 | - array( 'AX', 'ALA', 0, 'Alan Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0 ), |
|
| 678 | - array( 'BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0 ), |
|
| 679 | - array( 'CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0 ), |
|
| 680 | - array( 'GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0 ), |
|
| 681 | - array( 'IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0 ), |
|
| 682 | - array( 'JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0 ), |
|
| 683 | - array( 'MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0 ), |
|
| 684 | - array( 'MN', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+382', 0, 0 ), |
|
| 685 | - array( 'RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+941', 1, 0 ), |
|
| 686 | - array( 'SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0 ), |
|
| 687 | - array( 'SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0 ), |
|
| 688 | - array( 'XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+381', 0, 0 ), |
|
| 689 | - array( 'YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0 ), |
|
| 677 | + array('AX', 'ALA', 0, 'Alan Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0), |
|
| 678 | + array('BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0), |
|
| 679 | + array('CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0), |
|
| 680 | + array('GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0), |
|
| 681 | + array('IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0), |
|
| 682 | + array('JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0), |
|
| 683 | + array('MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0), |
|
| 684 | + array('MN', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+382', 0, 0), |
|
| 685 | + array('RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+941', 1, 0), |
|
| 686 | + array('SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0), |
|
| 687 | + array('SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0), |
|
| 688 | + array('XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+381', 0, 0), |
|
| 689 | + array('YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0), |
|
| 690 | 690 | ); |
| 691 | 691 | global $wpdb; |
| 692 | 692 | $country_table = $wpdb->prefix."esp_country"; |
@@ -705,14 +705,14 @@ discard block |
||
| 705 | 705 | "CNT_is_EU" => '%d', |
| 706 | 706 | "CNT_active" => '%d', |
| 707 | 707 | ); |
| 708 | - if ( $wpdb->get_var( "SHOW TABLES LIKE '" . $country_table . "'") == $country_table ) { |
|
| 709 | - foreach( $newer_countries as $country ) { |
|
| 710 | - $SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1" ; |
|
| 708 | + if ($wpdb->get_var("SHOW TABLES LIKE '".$country_table."'") == $country_table) { |
|
| 709 | + foreach ($newer_countries as $country) { |
|
| 710 | + $SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1"; |
|
| 711 | 711 | $countries = $wpdb->get_var($SQL); |
| 712 | - if ( ! $countries ) { |
|
| 712 | + if ( ! $countries) { |
|
| 713 | 713 | |
| 714 | - $wpdb->insert( $country_table, |
|
| 715 | - array_combine( array_keys( $country_format), $country ), |
|
| 714 | + $wpdb->insert($country_table, |
|
| 715 | + array_combine(array_keys($country_format), $country), |
|
| 716 | 716 | $country_format |
| 717 | 717 | ); |
| 718 | 718 | } |
@@ -730,7 +730,7 @@ discard block |
||
| 730 | 730 | // CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active |
| 731 | 731 | //( 'EUR', 'Euro', 'Euros', '€', 2,1), |
| 732 | 732 | $newer_currencies = array( |
| 733 | - array( 'RSD', 'Dinar', 'Dinars', '', 3, 1 ), |
|
| 733 | + array('RSD', 'Dinar', 'Dinars', '', 3, 1), |
|
| 734 | 734 | ); |
| 735 | 735 | global $wpdb; |
| 736 | 736 | $currency_table = $wpdb->prefix."esp_currency"; |
@@ -742,14 +742,14 @@ discard block |
||
| 742 | 742 | "CUR_dec_plc" => '%d', |
| 743 | 743 | "CUR_active" => '%d', |
| 744 | 744 | ); |
| 745 | - if ( $wpdb->get_var( "SHOW TABLES LIKE '" . $currency_table . "'") == $currency_table ) { |
|
| 746 | - foreach( $newer_currencies as $currency ) { |
|
| 747 | - $SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1" ; |
|
| 745 | + if ($wpdb->get_var("SHOW TABLES LIKE '".$currency_table."'") == $currency_table) { |
|
| 746 | + foreach ($newer_currencies as $currency) { |
|
| 747 | + $SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1"; |
|
| 748 | 748 | $countries = $wpdb->get_var($SQL); |
| 749 | - if ( ! $countries ) { |
|
| 749 | + if ( ! $countries) { |
|
| 750 | 750 | |
| 751 | - $wpdb->insert( $currency_table, |
|
| 752 | - array_combine( array_keys( $currency_format), $currency ), |
|
| 751 | + $wpdb->insert($currency_table, |
|
| 752 | + array_combine(array_keys($currency_format), $currency), |
|
| 753 | 753 | $currency_format |
| 754 | 754 | ); |
| 755 | 755 | } |
@@ -761,9 +761,9 @@ discard block |
||
| 761 | 761 | * which should just be a temporary issue for folks who installed 4.8.0-4.8.5; |
| 762 | 762 | * we should be able to stop doing this in 4.9 |
| 763 | 763 | */ |
| 764 | - public function fix_non_default_taxes(){ |
|
| 764 | + public function fix_non_default_taxes() { |
|
| 765 | 765 | global $wpdb; |
| 766 | - $query = $wpdb->prepare( "UPDATE |
|
| 766 | + $query = $wpdb->prepare("UPDATE |
|
| 767 | 767 | {$wpdb->prefix}esp_price p INNER JOIN |
| 768 | 768 | {$wpdb->prefix}esp_price_type pt ON p.PRT_ID = pt.PRT_ID |
| 769 | 769 | SET |
@@ -771,8 +771,8 @@ discard block |
||
| 771 | 771 | WHERE |
| 772 | 772 | p.PRC_is_default = 0 AND |
| 773 | 773 | pt.PBT_ID = %d |
| 774 | - ", EEM_Price_Type::base_type_tax ); |
|
| 775 | - $wpdb->query( $query ); |
|
| 774 | + ", EEM_Price_Type::base_type_tax); |
|
| 775 | + $wpdb->query($query); |
|
| 776 | 776 | } |
| 777 | 777 | } |
| 778 | 778 | |
@@ -14,13 +14,13 @@ discard block |
||
| 14 | 14 | // (all other times it gets resurrected from a wordpress option) |
| 15 | 15 | $stages = glob(EE_CORE.'data_migration_scripts/4_7_0_stages/*'); |
| 16 | 16 | $class_to_filepath = array(); |
| 17 | -foreach($stages as $filepath){ |
|
| 17 | +foreach ($stages as $filepath) { |
|
| 18 | 18 | $matches = array(); |
| 19 | - preg_match('~4_7_0_stages/(.*).dmsstage.php~',$filepath,$matches); |
|
| 19 | + preg_match('~4_7_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
| 20 | 20 | $class_to_filepath[$matches[1]] = $filepath; |
| 21 | 21 | } |
| 22 | 22 | //give addons a chance to autoload their stages too |
| 23 | -$class_to_filepath = apply_filters('FHEE__EE_DMS_4_7_0__autoloaded_stages',$class_to_filepath); |
|
| 23 | +$class_to_filepath = apply_filters('FHEE__EE_DMS_4_7_0__autoloaded_stages', $class_to_filepath); |
|
| 24 | 24 | EEH_Autoloader::register_autoloader($class_to_filepath); |
| 25 | 25 | |
| 26 | 26 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * @since 4.7.0 |
| 37 | 37 | * |
| 38 | 38 | */ |
| 39 | -class EE_DMS_Core_4_7_0 extends EE_Data_Migration_Script_Base{ |
|
| 39 | +class EE_DMS_Core_4_7_0 extends EE_Data_Migration_Script_Base { |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * return EE_DMS_Core_4_7_0 |
@@ -58,18 +58,18 @@ discard block |
||
| 58 | 58 | * @return bool |
| 59 | 59 | */ |
| 60 | 60 | public function can_migrate_from_version($version_array) { |
| 61 | - EE_Registry::instance()->load_helper( 'Activation' ); |
|
| 61 | + EE_Registry::instance()->load_helper('Activation'); |
|
| 62 | 62 | $version_string = $version_array['Core']; |
| 63 | 63 | if ( |
| 64 | - ( $version_string <= '4.7.0' && $version_string >= '4.6.0' ) |
|
| 64 | + ($version_string <= '4.7.0' && $version_string >= '4.6.0') |
|
| 65 | 65 | || |
| 66 | - ( $version_string >= '4.7.0' && |
|
| 67 | - ! EEH_Activation::table_exists( 'esp_registration_payment' ) && |
|
| 68 | - EEH_Activation::table_exists( 'esp_registration' ) ) ) { |
|
| 66 | + ($version_string >= '4.7.0' && |
|
| 67 | + ! EEH_Activation::table_exists('esp_registration_payment') && |
|
| 68 | + EEH_Activation::table_exists('esp_registration')) ) { |
|
| 69 | 69 | return true; |
| 70 | - } elseif ( ! $version_string ) { |
|
| 70 | + } elseif ( ! $version_string) { |
|
| 71 | 71 | //no version string provided... this must be pre 4.3 |
| 72 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 72 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
| 73 | 73 | } else { |
| 74 | 74 | return false; |
| 75 | 75 | } |
@@ -91,16 +91,16 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function schema_changes_before_migration() { |
| 93 | 93 | //relies on 4.1's EEH_Activation::create_table |
| 94 | - require_once( EE_HELPERS . 'EEH_Activation.helper.php' ); |
|
| 95 | - $table_name='esp_answer'; |
|
| 96 | - $sql=" ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 94 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
| 95 | + $table_name = 'esp_answer'; |
|
| 96 | + $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 97 | 97 | REG_ID INT UNSIGNED NOT NULL, |
| 98 | 98 | QST_ID INT UNSIGNED NOT NULL, |
| 99 | 99 | ANS_value TEXT NOT NULL, |
| 100 | 100 | PRIMARY KEY (ANS_ID), |
| 101 | 101 | KEY REG_ID (REG_ID), |
| 102 | 102 | KEY QST_ID (QST_ID)"; |
| 103 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 103 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 104 | 104 | |
| 105 | 105 | $table_name = 'esp_attendee_meta'; |
| 106 | 106 | $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | CNT_is_EU TINYINT(1) DEFAULT '0', |
| 141 | 141 | CNT_active TINYINT(1) DEFAULT '0', |
| 142 | 142 | PRIMARY KEY (CNT_ISO)"; |
| 143 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 143 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 144 | 144 | |
| 145 | 145 | $table_name = 'esp_currency'; |
| 146 | 146 | $sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | CUR_dec_plc VARCHAR(1) COLLATE utf8_bin NOT NULL DEFAULT '2', |
| 151 | 151 | CUR_active TINYINT(1) DEFAULT '0', |
| 152 | 152 | PRIMARY KEY (CUR_code)"; |
| 153 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 153 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 154 | 154 | |
| 155 | 155 | |
| 156 | 156 | $table_name = 'esp_currency_payment_method'; |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | KEY EVT_ID (EVT_ID), |
| 181 | 181 | KEY DTT_is_primary (DTT_is_primary)"; |
| 182 | 182 | |
| 183 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 183 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 184 | 184 | |
| 185 | 185 | $table_name = 'esp_event_meta'; |
| 186 | 186 | $sql = " |
@@ -199,44 +199,44 @@ discard block |
||
| 199 | 199 | EVT_donations TINYINT(1) NULL, |
| 200 | 200 | PRIMARY KEY (EVTM_ID), |
| 201 | 201 | KEY EVT_ID (EVT_ID)"; |
| 202 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 202 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 203 | 203 | |
| 204 | 204 | |
| 205 | 205 | |
| 206 | - $table_name='esp_event_question_group'; |
|
| 207 | - $sql="EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 206 | + $table_name = 'esp_event_question_group'; |
|
| 207 | + $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 208 | 208 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 209 | 209 | QSG_ID INT UNSIGNED NOT NULL, |
| 210 | 210 | EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 211 | 211 | PRIMARY KEY (EQG_ID), |
| 212 | 212 | KEY EVT_ID (EVT_ID), |
| 213 | 213 | KEY QSG_ID (QSG_ID)"; |
| 214 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 214 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 215 | 215 | |
| 216 | 216 | |
| 217 | 217 | |
| 218 | - $table_name='esp_event_venue'; |
|
| 219 | - $sql="EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 218 | + $table_name = 'esp_event_venue'; |
|
| 219 | + $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 220 | 220 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 221 | 221 | VNU_ID BIGINT(20) UNSIGNED NOT NULL, |
| 222 | 222 | EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 223 | 223 | PRIMARY KEY (EVV_ID)"; |
| 224 | - $this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 224 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 225 | 225 | |
| 226 | 226 | |
| 227 | 227 | |
| 228 | - $table_name='esp_extra_meta'; |
|
| 229 | - $sql="EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 228 | + $table_name = 'esp_extra_meta'; |
|
| 229 | + $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 230 | 230 | OBJ_ID INT(11) DEFAULT NULL, |
| 231 | 231 | EXM_type VARCHAR(45) DEFAULT NULL, |
| 232 | 232 | EXM_key VARCHAR(45) DEFAULT NULL, |
| 233 | 233 | EXM_value TEXT, |
| 234 | 234 | PRIMARY KEY (EXM_ID), |
| 235 | 235 | KEY EXM_type (EXM_type, OBJ_ID, EXM_key(45))"; |
| 236 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 236 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 237 | 237 | |
| 238 | - $table_name='esp_line_item'; |
|
| 239 | - $sql="LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 238 | + $table_name = 'esp_line_item'; |
|
| 239 | + $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 240 | 240 | LIN_code VARCHAR(245) NOT NULL DEFAULT '', |
| 241 | 241 | TXN_ID INT(11) DEFAULT NULL, |
| 242 | 242 | LIN_name VARCHAR(245) NOT NULL DEFAULT '', |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | PRIMARY KEY (LIN_ID), |
| 255 | 255 | KEY LIN_code (LIN_code(191)), |
| 256 | 256 | KEY TXN_ID (TXN_ID)"; |
| 257 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB' ); |
|
| 257 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 258 | 258 | |
| 259 | 259 | $table_name = 'esp_log'; |
| 260 | 260 | $sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT, |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | MTP_is_active TINYINT(1) NOT NULL DEFAULT '1', |
| 295 | 295 | PRIMARY KEY (GRP_ID), |
| 296 | 296 | KEY MTP_user_id (MTP_user_id)"; |
| 297 | - $this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB'); |
|
| 297 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 298 | 298 | |
| 299 | 299 | $table_name = 'esp_event_message_template'; |
| 300 | 300 | $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | PRIMARY KEY (EMT_ID), |
| 304 | 304 | KEY EVT_ID (EVT_ID), |
| 305 | 305 | KEY GRP_ID (GRP_ID)"; |
| 306 | - $this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB'); |
|
| 306 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 307 | 307 | |
| 308 | 308 | |
| 309 | 309 | $table_name = 'esp_payment'; |
@@ -376,8 +376,8 @@ discard block |
||
| 376 | 376 | PRIMARY KEY (TTM_ID)"; |
| 377 | 377 | $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
| 378 | 378 | |
| 379 | - $table_name='esp_question'; |
|
| 380 | - $sql='QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 379 | + $table_name = 'esp_question'; |
|
| 380 | + $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 381 | 381 | QST_display_text TEXT NOT NULL, |
| 382 | 382 | QST_admin_label VARCHAR(255) NOT NULL, |
| 383 | 383 | QST_system VARCHAR(25) DEFAULT NULL, |
@@ -390,22 +390,22 @@ discard block |
||
| 390 | 390 | QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0, |
| 391 | 391 | PRIMARY KEY (QST_ID), |
| 392 | 392 | KEY QST_order (QST_order)'; |
| 393 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 393 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 394 | 394 | |
| 395 | - $table_name='esp_question_group_question'; |
|
| 396 | - $sql="QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 395 | + $table_name = 'esp_question_group_question'; |
|
| 396 | + $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 397 | 397 | QSG_ID INT UNSIGNED NOT NULL, |
| 398 | 398 | QST_ID INT UNSIGNED NOT NULL, |
| 399 | 399 | QGQ_order INT UNSIGNED NOT NULL DEFAULT 0, |
| 400 | 400 | PRIMARY KEY (QGQ_ID), |
| 401 | 401 | KEY QST_ID (QST_ID), |
| 402 | 402 | KEY QSG_ID_order (QSG_ID, QGQ_order)"; |
| 403 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 403 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 404 | 404 | |
| 405 | 405 | |
| 406 | 406 | |
| 407 | - $table_name='esp_question_option'; |
|
| 408 | - $sql="QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 407 | + $table_name = 'esp_question_option'; |
|
| 408 | + $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 409 | 409 | QSO_value VARCHAR(255) NOT NULL, |
| 410 | 410 | QSO_desc TEXT NOT NULL, |
| 411 | 411 | QST_ID INT UNSIGNED NOT NULL, |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | PRIMARY KEY (QSO_ID), |
| 415 | 415 | KEY QST_ID (QST_ID), |
| 416 | 416 | KEY QSO_order (QSO_order)"; |
| 417 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 417 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 418 | 418 | |
| 419 | 419 | |
| 420 | 420 | |
@@ -460,8 +460,8 @@ discard block |
||
| 460 | 460 | |
| 461 | 461 | |
| 462 | 462 | |
| 463 | - $table_name='esp_checkin'; |
|
| 464 | - $sql="CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 463 | + $table_name = 'esp_checkin'; |
|
| 464 | + $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 465 | 465 | REG_ID INT(10) UNSIGNED NOT NULL, |
| 466 | 466 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 467 | 467 | CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | PRC_parent INT(10) UNSIGNED DEFAULT 0, |
| 557 | 557 | PRIMARY KEY (PRC_ID), |
| 558 | 558 | KEY PRT_ID (PRT_ID)"; |
| 559 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 559 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 560 | 560 | |
| 561 | 561 | $table_name = "esp_price_type"; |
| 562 | 562 | $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
@@ -594,10 +594,10 @@ discard block |
||
| 594 | 594 | TKT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 595 | 595 | PRIMARY KEY (TKT_ID), |
| 596 | 596 | KEY TKT_start_date (TKT_start_date)"; |
| 597 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 597 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 598 | 598 | |
| 599 | 599 | $table_name = 'esp_question_group'; |
| 600 | - $sql='QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 600 | + $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 601 | 601 | QSG_name VARCHAR(255) NOT NULL, |
| 602 | 602 | QSG_identifier VARCHAR(100) NOT NULL, |
| 603 | 603 | QSG_desc TEXT NULL, |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | PRIMARY KEY (QSG_ID), |
| 611 | 611 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier), |
| 612 | 612 | KEY QSG_order (QSG_order)'; |
| 613 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 613 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 614 | 614 | |
| 615 | 615 | /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
| 616 | 616 | $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | return true; |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | - public function migration_page_hooks(){ |
|
| 645 | + public function migration_page_hooks() { |
|
| 646 | 646 | |
| 647 | 647 | } |
| 648 | 648 | } |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | * @since $VID:$ |
| 15 | 15 | * |
| 16 | 16 | */ |
| 17 | -abstract class EE_PMT_Base{ |
|
| 17 | +abstract class EE_PMT_Base { |
|
| 18 | 18 | |
| 19 | 19 | const onsite = 'on-site'; |
| 20 | 20 | const offsite = 'off-site'; |
@@ -95,36 +95,36 @@ discard block |
||
| 95 | 95 | * @return EE_PMT_Base |
| 96 | 96 | */ |
| 97 | 97 | function __construct($pm_instance = NULL) { |
| 98 | - if ( $pm_instance instanceof EE_Payment_Method ){ |
|
| 98 | + if ($pm_instance instanceof EE_Payment_Method) { |
|
| 99 | 99 | $this->set_instance($pm_instance); |
| 100 | 100 | } |
| 101 | 101 | $this->_set_file_folder(); |
| 102 | 102 | $this->_set_file_url(); |
| 103 | - if($this->_gateway){ |
|
| 104 | - $this->_gateway->set_payment_model( EEM_Payment::instance() ); |
|
| 105 | - $this->_gateway->set_payment_log( EEM_Change_Log::instance() ); |
|
| 106 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
| 107 | - $this->_gateway->set_template_helper( new EEH_Template() ); |
|
| 108 | - EE_Registry::instance()->load_helper( 'Line_Item' ); |
|
| 109 | - $this->_gateway->set_line_item_helper( new EEH_Line_Item() ); |
|
| 110 | - EE_Registry::instance()->load_helper( 'Money' ); |
|
| 111 | - $this->_gateway->set_money_helper( new EEH_Money() ); |
|
| 103 | + if ($this->_gateway) { |
|
| 104 | + $this->_gateway->set_payment_model(EEM_Payment::instance()); |
|
| 105 | + $this->_gateway->set_payment_log(EEM_Change_Log::instance()); |
|
| 106 | + EE_Registry::instance()->load_helper('Template'); |
|
| 107 | + $this->_gateway->set_template_helper(new EEH_Template()); |
|
| 108 | + EE_Registry::instance()->load_helper('Line_Item'); |
|
| 109 | + $this->_gateway->set_line_item_helper(new EEH_Line_Item()); |
|
| 110 | + EE_Registry::instance()->load_helper('Money'); |
|
| 111 | + $this->_gateway->set_money_helper(new EEH_Money()); |
|
| 112 | 112 | } |
| 113 | - if ( ! isset( $this->_has_billing_form ) ) { |
|
| 113 | + if ( ! isset($this->_has_billing_form)) { |
|
| 114 | 114 | // by default, On Site gateways have a billing form |
| 115 | - if ( $this->payment_occurs() == EE_PMT_Base::onsite ) { |
|
| 116 | - $this->set_has_billing_form( true ); |
|
| 115 | + if ($this->payment_occurs() == EE_PMT_Base::onsite) { |
|
| 116 | + $this->set_has_billing_form(true); |
|
| 117 | 117 | } else { |
| 118 | - $this->set_has_billing_form( false ); |
|
| 118 | + $this->set_has_billing_form(false); |
|
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - if( ! $this->_pretty_name){ |
|
| 122 | + if ( ! $this->_pretty_name) { |
|
| 123 | 123 | throw new EE_Error(sprintf(__("You must set the pretty name for the Payment Method Type in the constructor (_pretty_name), and please make it internationalized", "event_espresso"))); |
| 124 | 124 | } |
| 125 | 125 | //if the child didn't specify a default button, use the credit card one |
| 126 | - if( $this->_default_button_url === NULL){ |
|
| 127 | - $this->_default_button_url = EE_PLUGIN_DIR_URL . 'payment_methods' . DS . 'pay-by-credit-card.png'; |
|
| 126 | + if ($this->_default_button_url === NULL) { |
|
| 127 | + $this->_default_button_url = EE_PLUGIN_DIR_URL.'payment_methods'.DS.'pay-by-credit-card.png'; |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | /** |
| 134 | 134 | * @param boolean $has_billing_form |
| 135 | 135 | */ |
| 136 | - public function set_has_billing_form( $has_billing_form ) { |
|
| 137 | - $this->_has_billing_form = filter_var( $has_billing_form, FILTER_VALIDATE_BOOLEAN ); |
|
| 136 | + public function set_has_billing_form($has_billing_form) { |
|
| 137 | + $this->_has_billing_form = filter_var($has_billing_form, FILTER_VALIDATE_BOOLEAN); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
@@ -142,10 +142,10 @@ discard block |
||
| 142 | 142 | /** |
| 143 | 143 | * sets the file_folder property |
| 144 | 144 | */ |
| 145 | - protected function _set_file_folder(){ |
|
| 145 | + protected function _set_file_folder() { |
|
| 146 | 146 | $reflector = new ReflectionClass(get_class($this)); |
| 147 | 147 | $fn = $reflector->getFileName(); |
| 148 | - $this->_file_folder = dirname($fn).DS; |
|
| 148 | + $this->_file_folder = dirname($fn).DS; |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | |
@@ -153,10 +153,10 @@ discard block |
||
| 153 | 153 | /** |
| 154 | 154 | * sets the file URL with a trailing slash for this PMT |
| 155 | 155 | */ |
| 156 | - protected function _set_file_url(){ |
|
| 157 | - $plugins_dir_fixed = str_replace('\\',DS,WP_PLUGIN_DIR); |
|
| 158 | - $file_folder_fixed = str_replace('\\',DS,$this->file_folder()); |
|
| 159 | - $file_path = str_replace($plugins_dir_fixed,WP_PLUGIN_URL,$file_folder_fixed); |
|
| 156 | + protected function _set_file_url() { |
|
| 157 | + $plugins_dir_fixed = str_replace('\\', DS, WP_PLUGIN_DIR); |
|
| 158 | + $file_folder_fixed = str_replace('\\', DS, $this->file_folder()); |
|
| 159 | + $file_path = str_replace($plugins_dir_fixed, WP_PLUGIN_URL, $file_folder_fixed); |
|
| 160 | 160 | $this->_file_url = $file_path; |
| 161 | 161 | } |
| 162 | 162 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | * Gets the default description on all payment methods of this type |
| 165 | 165 | * @return string |
| 166 | 166 | */ |
| 167 | - public function default_description(){ |
|
| 167 | + public function default_description() { |
|
| 168 | 168 | return $this->_default_description; |
| 169 | 169 | } |
| 170 | 170 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | * Returns the folder containing the PMT child class, with a trailing slash |
| 175 | 175 | * @return string |
| 176 | 176 | */ |
| 177 | - public function file_folder(){ |
|
| 177 | + public function file_folder() { |
|
| 178 | 178 | return $this->_file_folder; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | /** |
| 184 | 184 | * @return string |
| 185 | 185 | */ |
| 186 | - public function file_url(){ |
|
| 186 | + public function file_url() { |
|
| 187 | 187 | return $this->_file_url; |
| 188 | 188 | } |
| 189 | 189 | |
@@ -194,14 +194,14 @@ discard block |
||
| 194 | 194 | * Its important teh payment method instance is set before |
| 195 | 195 | * @param EE_Payment_Method $payment_method_instance |
| 196 | 196 | */ |
| 197 | - function set_instance($payment_method_instance){ |
|
| 197 | + function set_instance($payment_method_instance) { |
|
| 198 | 198 | $this->_pm_instance = $payment_method_instance; |
| 199 | 199 | //if they have already requested the settings form, make sure its |
| 200 | 200 | //data matches this model object |
| 201 | - if($this->_settings_form){ |
|
| 201 | + if ($this->_settings_form) { |
|
| 202 | 202 | $this->settings_form()->populate_model_obj($payment_method_instance); |
| 203 | 203 | } |
| 204 | - if($this->_gateway && $this->_gateway instanceof EE_Gateway){ |
|
| 204 | + if ($this->_gateway && $this->_gateway instanceof EE_Gateway) { |
|
| 205 | 205 | $this->_gateway->set_settings($payment_method_instance->settings_array()); |
| 206 | 206 | } |
| 207 | 207 | } |
@@ -212,14 +212,14 @@ discard block |
||
| 212 | 212 | * Gets teh form for displaying to admins where they setup the payment method |
| 213 | 213 | * @return EE_Payment_Method_Form |
| 214 | 214 | */ |
| 215 | - function settings_form(){ |
|
| 216 | - if( ! $this->_settings_form){ |
|
| 215 | + function settings_form() { |
|
| 216 | + if ( ! $this->_settings_form) { |
|
| 217 | 217 | $this->_settings_form = $this->generate_new_settings_form(); |
| 218 | - $this->_settings_form->set_payment_method_type( $this ); |
|
| 219 | - $this->_settings_form->_construct_finalize(NULL, NULL ); |
|
| 218 | + $this->_settings_form->set_payment_method_type($this); |
|
| 219 | + $this->_settings_form->_construct_finalize(NULL, NULL); |
|
| 220 | 220 | //if we have already assigned a model object to this pmt, make |
| 221 | 221 | //sure its reflected in teh form we just generated |
| 222 | - if($this->_pm_instance){ |
|
| 222 | + if ($this->_pm_instance) { |
|
| 223 | 223 | $this->_settings_form->populate_model_obj($this->_pm_instance); |
| 224 | 224 | } |
| 225 | 225 | } |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | * this payment method type's settings form later in the request |
| 246 | 246 | * @param EE_Payment_Method_Form $form |
| 247 | 247 | */ |
| 248 | - public function set_settings_form($form){ |
|
| 248 | + public function set_settings_form($form) { |
|
| 249 | 249 | $this->_settings_form = $form; |
| 250 | 250 | } |
| 251 | 251 | |
@@ -268,10 +268,10 @@ discard block |
||
| 268 | 268 | * @param array $extra_args |
| 269 | 269 | * @return \EE_Billing_Attendee_Info_Form|\EE_Billing_Info_Form|null |
| 270 | 270 | */ |
| 271 | - public function billing_form( EE_Transaction $transaction = NULL, $extra_args = array() ){ |
|
| 271 | + public function billing_form(EE_Transaction $transaction = NULL, $extra_args = array()) { |
|
| 272 | 272 | // has billing form already been regenerated ? or overwrite cache? |
| 273 | - if ( ! $this->_billing_form instanceof EE_Billing_Info_Form || ! $this->_cache_billing_form ){ |
|
| 274 | - $this->_billing_form = $this->generate_new_billing_form( $transaction, $extra_args ); |
|
| 273 | + if ( ! $this->_billing_form instanceof EE_Billing_Info_Form || ! $this->_cache_billing_form) { |
|
| 274 | + $this->_billing_form = $this->generate_new_billing_form($transaction, $extra_args); |
|
| 275 | 275 | } |
| 276 | 276 | //if we know who the attendee is, and this is a billing form |
| 277 | 277 | //that uses attendee info, populate it |
@@ -280,8 +280,8 @@ discard block |
||
| 280 | 280 | $transaction instanceof EE_Transaction && |
| 281 | 281 | $transaction->primary_registration() instanceof EE_Registration && |
| 282 | 282 | $transaction->primary_registration()->attendee() instanceof EE_Attendee |
| 283 | - ){ |
|
| 284 | - $this->_billing_form->populate_from_attendee( $transaction->primary_registration()->attendee() ); |
|
| 283 | + ) { |
|
| 284 | + $this->_billing_form->populate_from_attendee($transaction->primary_registration()->attendee()); |
|
| 285 | 285 | } |
| 286 | 286 | return $this->_billing_form; |
| 287 | 287 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | * @param \EE_Transaction $transaction |
| 293 | 293 | * @return \EE_Billing_Info_Form |
| 294 | 294 | */ |
| 295 | - abstract function generate_new_billing_form( EE_Transaction $transaction = NULL ); |
|
| 295 | + abstract function generate_new_billing_form(EE_Transaction $transaction = NULL); |
|
| 296 | 296 | |
| 297 | 297 | |
| 298 | 298 | |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | * @param \EE_Billing_Info_Form $billing_form |
| 304 | 304 | * @return \EE_Billing_Info_Form |
| 305 | 305 | */ |
| 306 | - public function apply_billing_form_debug_settings( EE_Billing_Info_Form $billing_form ) { |
|
| 306 | + public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form) { |
|
| 307 | 307 | return $billing_form; |
| 308 | 308 | } |
| 309 | 309 | |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | * if you have form |
| 315 | 315 | * @param EE_Payment_Method $form |
| 316 | 316 | */ |
| 317 | - public function set_billing_form($form){ |
|
| 317 | + public function set_billing_form($form) { |
|
| 318 | 318 | $this->_billing_form = $form; |
| 319 | 319 | } |
| 320 | 320 | |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | * Returns whether or not this payment method requires HTTPS to be used |
| 325 | 325 | * @return boolean |
| 326 | 326 | */ |
| 327 | - function requires_https(){ |
|
| 327 | + function requires_https() { |
|
| 328 | 328 | return $this->_requires_https; |
| 329 | 329 | } |
| 330 | 330 | |
@@ -342,9 +342,9 @@ discard block |
||
| 342 | 342 | * @return EE_Payment |
| 343 | 343 | * @throws EE_Error |
| 344 | 344 | */ |
| 345 | - function process_payment( EE_Transaction $transaction, $amount = null, $billing_info = null, $return_url = null,$fail_url = '', $method = 'CART', $by_admin = false ){ |
|
| 345 | + function process_payment(EE_Transaction $transaction, $amount = null, $billing_info = null, $return_url = null, $fail_url = '', $method = 'CART', $by_admin = false) { |
|
| 346 | 346 | // @todo: add surcharge for the payment method, if any |
| 347 | - if ( $this->_gateway ) { |
|
| 347 | + if ($this->_gateway) { |
|
| 348 | 348 | //there is a gateway, so we're going to make a payment object |
| 349 | 349 | //but wait! do they already have a payment in progress that we thought was failed? |
| 350 | 350 | $duplicate_properties = array( |
@@ -355,10 +355,10 @@ discard block |
||
| 355 | 355 | 'PAY_amount' => $amount !== null ? $amount : $transaction->remaining(), |
| 356 | 356 | 'PAY_gateway_response' => null, |
| 357 | 357 | ); |
| 358 | - $payment = EEM_Payment::instance()->get_one( array( $duplicate_properties )); |
|
| 358 | + $payment = EEM_Payment::instance()->get_one(array($duplicate_properties)); |
|
| 359 | 359 | //if we didn't already have a payment in progress for the same thing, |
| 360 | 360 | //then we actually want to make a new payment |
| 361 | - if ( ! $payment instanceof EE_Payment ){ |
|
| 361 | + if ( ! $payment instanceof EE_Payment) { |
|
| 362 | 362 | $payment = EE_Payment::new_instance( |
| 363 | 363 | array_merge( |
| 364 | 364 | $duplicate_properties, |
@@ -374,10 +374,10 @@ discard block |
||
| 374 | 374 | } |
| 375 | 375 | //make sure the payment has been saved to show we started it, and so it has an ID should the gateway try to log it |
| 376 | 376 | $payment->save(); |
| 377 | - $billing_values = $this->_get_billing_values_from_form( $billing_info ); |
|
| 377 | + $billing_values = $this->_get_billing_values_from_form($billing_info); |
|
| 378 | 378 | |
| 379 | 379 | // Offsite Gateway |
| 380 | - if( $this->_gateway instanceof EE_Offsite_Gateway ){ |
|
| 380 | + if ($this->_gateway instanceof EE_Offsite_Gateway) { |
|
| 381 | 381 | |
| 382 | 382 | $payment = $this->_gateway->set_redirection_info( |
| 383 | 383 | $payment, |
@@ -393,17 +393,17 @@ discard block |
||
| 393 | 393 | ); |
| 394 | 394 | $payment->save(); |
| 395 | 395 | // Onsite Gateway |
| 396 | - } elseif ( $this->_gateway instanceof EE_Onsite_Gateway ) { |
|
| 396 | + } elseif ($this->_gateway instanceof EE_Onsite_Gateway) { |
|
| 397 | 397 | |
| 398 | - $payment = $this->_gateway->do_direct_payment($payment,$billing_values); |
|
| 398 | + $payment = $this->_gateway->do_direct_payment($payment, $billing_values); |
|
| 399 | 399 | $payment->save(); |
| 400 | 400 | |
| 401 | 401 | } else { |
| 402 | 402 | throw new EE_Error( |
| 403 | 403 | sprintf( |
| 404 | - __('Gateway for payment method type "%s" is "%s", not a subclass of either EE_Offsite_Gateway or EE_Onsite_Gateway, or null (to indicate NO gateway)', 'event_espresso' ), |
|
| 404 | + __('Gateway for payment method type "%s" is "%s", not a subclass of either EE_Offsite_Gateway or EE_Onsite_Gateway, or null (to indicate NO gateway)', 'event_espresso'), |
|
| 405 | 405 | get_class($this), |
| 406 | - gettype( $this->_gateway ) |
|
| 406 | + gettype($this->_gateway) |
|
| 407 | 407 | ) |
| 408 | 408 | ); |
| 409 | 409 | } |
@@ -425,8 +425,8 @@ discard block |
||
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | // if there is billing info, clean it and save it now |
| 428 | - if( $billing_info instanceof EE_Billing_Attendee_Info_Form ){ |
|
| 429 | - $this->_save_billing_info_to_attendee( $billing_info, $transaction ); |
|
| 428 | + if ($billing_info instanceof EE_Billing_Attendee_Info_Form) { |
|
| 429 | + $this->_save_billing_info_to_attendee($billing_info, $transaction); |
|
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | return $payment; |
@@ -439,10 +439,10 @@ discard block |
||
| 439 | 439 | * @param EE_Billing_Info_Form $billing_form |
| 440 | 440 | * @return array |
| 441 | 441 | */ |
| 442 | - protected function _get_billing_values_from_form( $billing_form ){ |
|
| 443 | - if($billing_form instanceof EE_Form_Section_Proper ){ |
|
| 444 | - return $billing_form->input_pretty_values( true ); |
|
| 445 | - }else{ |
|
| 442 | + protected function _get_billing_values_from_form($billing_form) { |
|
| 443 | + if ($billing_form instanceof EE_Form_Section_Proper) { |
|
| 444 | + return $billing_form->input_pretty_values(true); |
|
| 445 | + } else { |
|
| 446 | 446 | return NULL; |
| 447 | 447 | } |
| 448 | 448 | } |
@@ -456,13 +456,13 @@ discard block |
||
| 456 | 456 | * @return EE_Payment |
| 457 | 457 | * @throws EE_Error |
| 458 | 458 | */ |
| 459 | - public function handle_ipn($req_data,$transaction){ |
|
| 459 | + public function handle_ipn($req_data, $transaction) { |
|
| 460 | 460 | $transaction = EEM_Transaction::instance()->ensure_is_obj($transaction); |
| 461 | - if( ! $this->_gateway instanceof EE_Offsite_Gateway){ |
|
| 462 | - throw new EE_Error(sprintf(__("Could not handle IPN because '%s' is not an offsite gateway", "event_espresso"), print_r( $this->_gateway, TRUE ))); |
|
| 461 | + if ( ! $this->_gateway instanceof EE_Offsite_Gateway) { |
|
| 462 | + throw new EE_Error(sprintf(__("Could not handle IPN because '%s' is not an offsite gateway", "event_espresso"), print_r($this->_gateway, TRUE))); |
|
| 463 | 463 | |
| 464 | 464 | } |
| 465 | - $payment = $this->_gateway->handle_payment_update( $req_data, $transaction ); |
|
| 465 | + $payment = $this->_gateway->handle_payment_update($req_data, $transaction); |
|
| 466 | 466 | return $payment; |
| 467 | 467 | } |
| 468 | 468 | |
@@ -475,22 +475,22 @@ discard block |
||
| 475 | 475 | * @param EE_Transaction $transaction |
| 476 | 476 | * @return boolean success |
| 477 | 477 | */ |
| 478 | - protected function _save_billing_info_to_attendee($billing_form, $transaction){ |
|
| 479 | - if( ! $transaction || ! $transaction instanceof EE_Transaction){ |
|
| 478 | + protected function _save_billing_info_to_attendee($billing_form, $transaction) { |
|
| 479 | + if ( ! $transaction || ! $transaction instanceof EE_Transaction) { |
|
| 480 | 480 | EE_Error::add_error(__("Cannot save billing info because no transaction was specified", "event_espresso"), __FILE__, __FUNCTION__, __LINE__); |
| 481 | 481 | return false; |
| 482 | 482 | } |
| 483 | 483 | $primary_reg = $transaction->primary_registration(); |
| 484 | - if( ! $primary_reg ){ |
|
| 484 | + if ( ! $primary_reg) { |
|
| 485 | 485 | EE_Error::add_error(__("Cannot save billing info because the transaction has no primary registration", "event_espresso"), __FILE__, __FUNCTION__, __LINE__); |
| 486 | 486 | return false; |
| 487 | 487 | } |
| 488 | 488 | $attendee = $primary_reg->attendee(); |
| 489 | - if( ! $attendee ){ |
|
| 489 | + if ( ! $attendee) { |
|
| 490 | 490 | EE_Error::add_error(__("Cannot save billing info because the transaction's primary registration has no attendee!", "event_espresso"), __FILE__, __FUNCTION__, __LINE__); |
| 491 | 491 | return false; |
| 492 | 492 | } |
| 493 | - return $attendee->save_and_clean_billing_info_for_payment_method($billing_form, $transaction->payment_method() ); |
|
| 493 | + return $attendee->save_and_clean_billing_info_for_payment_method($billing_form, $transaction->payment_method()); |
|
| 494 | 494 | |
| 495 | 495 | } |
| 496 | 496 | |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | * @param array $req_data |
| 504 | 504 | * @return EE_Payment |
| 505 | 505 | */ |
| 506 | - protected function find_payment_for_ipn( EE_Transaction $transaction, $req_data = array() ){ |
|
| 506 | + protected function find_payment_for_ipn(EE_Transaction $transaction, $req_data = array()) { |
|
| 507 | 507 | return $transaction->last_payment(); |
| 508 | 508 | } |
| 509 | 509 | |
@@ -520,8 +520,8 @@ discard block |
||
| 520 | 520 | * and identifies the IPN as being for this payment method (not just fo ra payment method of this type) |
| 521 | 521 | * @throws EE_Error |
| 522 | 522 | */ |
| 523 | - public function handle_unclaimed_ipn( $req_data = array() ){ |
|
| 524 | - throw new EE_Error(sprintf(__("Payment Method '%s' cannot handle unclaimed IPNs", "event_espresso"), get_class($this) )); |
|
| 523 | + public function handle_unclaimed_ipn($req_data = array()) { |
|
| 524 | + throw new EE_Error(sprintf(__("Payment Method '%s' cannot handle unclaimed IPNs", "event_espresso"), get_class($this))); |
|
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | * @param EE_Transaction $transaction |
| 538 | 538 | * @return EE_Payment |
| 539 | 539 | */ |
| 540 | - public function finalize_payment_for($transaction){ |
|
| 540 | + public function finalize_payment_for($transaction) { |
|
| 541 | 541 | return $transaction->last_payment(); |
| 542 | 542 | } |
| 543 | 543 | |
@@ -547,10 +547,10 @@ discard block |
||
| 547 | 547 | * Whether or not this payment method's gateway supports sending refund requests |
| 548 | 548 | * @return boolean |
| 549 | 549 | */ |
| 550 | - public function supports_sending_refunds(){ |
|
| 551 | - if($this->_gateway && $this->_gateway instanceof EE_Gateway){ |
|
| 550 | + public function supports_sending_refunds() { |
|
| 551 | + if ($this->_gateway && $this->_gateway instanceof EE_Gateway) { |
|
| 552 | 552 | return $this->_gateway->supports_sending_refunds(); |
| 553 | - }else{ |
|
| 553 | + } else { |
|
| 554 | 554 | return false; |
| 555 | 555 | } |
| 556 | 556 | } |
@@ -564,14 +564,14 @@ discard block |
||
| 564 | 564 | * @throws EE_Error |
| 565 | 565 | * @return EE_Payment |
| 566 | 566 | */ |
| 567 | - public function process_refund( EE_Payment $payment, $refund_info = array()){ |
|
| 568 | - if ( $this->_gateway && $this->_gateway instanceof EE_Gateway ) { |
|
| 569 | - return $this->_gateway->do_direct_refund( $payment, $refund_info ); |
|
| 567 | + public function process_refund(EE_Payment $payment, $refund_info = array()) { |
|
| 568 | + if ($this->_gateway && $this->_gateway instanceof EE_Gateway) { |
|
| 569 | + return $this->_gateway->do_direct_refund($payment, $refund_info); |
|
| 570 | 570 | } else { |
| 571 | 571 | throw new EE_Error( |
| 572 | 572 | sprintf( |
| 573 | - __( 'Payment Method Type "%s" does not support sending refund requests', 'event_espresso' ), |
|
| 574 | - get_class( $this ) |
|
| 573 | + __('Payment Method Type "%s" does not support sending refund requests', 'event_espresso'), |
|
| 574 | + get_class($this) |
|
| 575 | 575 | ) |
| 576 | 576 | ); |
| 577 | 577 | } |
@@ -585,15 +585,15 @@ discard block |
||
| 585 | 585 | * @return string |
| 586 | 586 | * @throws EE_Error |
| 587 | 587 | */ |
| 588 | - public function payment_occurs(){ |
|
| 589 | - if( ! $this->_gateway){ |
|
| 588 | + public function payment_occurs() { |
|
| 589 | + if ( ! $this->_gateway) { |
|
| 590 | 590 | return EE_PMT_Base::offline; |
| 591 | - }elseif($this->_gateway instanceof EE_Onsite_Gateway){ |
|
| 591 | + }elseif ($this->_gateway instanceof EE_Onsite_Gateway) { |
|
| 592 | 592 | return EE_PMT_Base::onsite; |
| 593 | - }elseif($this->_gateway instanceof EE_Offsite_Gateway){ |
|
| 593 | + }elseif ($this->_gateway instanceof EE_Offsite_Gateway) { |
|
| 594 | 594 | return EE_PMT_Base::offsite; |
| 595 | - }else{ |
|
| 596 | - throw new EE_Error(sprintf(__("Payment method type '%s's gateway isn't an instance of EE_Onsite_Gateway, EE_Offsite_Gateway, or null. It must be one of those", "event_espresso"),get_class($this))); |
|
| 595 | + } else { |
|
| 596 | + throw new EE_Error(sprintf(__("Payment method type '%s's gateway isn't an instance of EE_Onsite_Gateway, EE_Offsite_Gateway, or null. It must be one of those", "event_espresso"), get_class($this))); |
|
| 597 | 597 | } |
| 598 | 598 | } |
| 599 | 599 | |
@@ -606,9 +606,9 @@ discard block |
||
| 606 | 606 | * @param EE_Payment $payment |
| 607 | 607 | * @return string |
| 608 | 608 | */ |
| 609 | - public function payment_overview_content(EE_Payment $payment){ |
|
| 609 | + public function payment_overview_content(EE_Payment $payment) { |
|
| 610 | 610 | EE_Registry::instance()->load_helper('Template'); |
| 611 | - return EEH_Template::display_template(EE_LIBRARIES.'payment_methods'.DS.'templates'.DS.'payment_details_content.template.php', array('payment_method'=>$this->_pm_instance,'payment'=>$payment) , true); |
|
| 611 | + return EEH_Template::display_template(EE_LIBRARIES.'payment_methods'.DS.'templates'.DS.'payment_details_content.template.php', array('payment_method'=>$this->_pm_instance, 'payment'=>$payment), true); |
|
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | * @type array $template_args any arguments you want passed to the template file while rendering. |
| 622 | 622 | * Keys will be variable names and values with be their values. |
| 623 | 623 | */ |
| 624 | - public function help_tabs_config(){ |
|
| 624 | + public function help_tabs_config() { |
|
| 625 | 625 | return array(); |
| 626 | 626 | } |
| 627 | 627 | |
@@ -632,9 +632,9 @@ discard block |
||
| 632 | 632 | * the payment method's table's PMT_type column) |
| 633 | 633 | * @return string |
| 634 | 634 | */ |
| 635 | - public function system_name(){ |
|
| 635 | + public function system_name() { |
|
| 636 | 636 | $classname = get_class($this); |
| 637 | - return str_replace("EE_PMT_",'',$classname); |
|
| 637 | + return str_replace("EE_PMT_", '', $classname); |
|
| 638 | 638 | } |
| 639 | 639 | |
| 640 | 640 | |
@@ -643,7 +643,7 @@ discard block |
||
| 643 | 643 | * A pretty i18n version of the PMT name |
| 644 | 644 | * @return string |
| 645 | 645 | */ |
| 646 | - public function pretty_name(){ |
|
| 646 | + public function pretty_name() { |
|
| 647 | 647 | return $this->_pretty_name; |
| 648 | 648 | } |
| 649 | 649 | |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | * Gets the default absolute URL to the payment method type's button |
| 654 | 654 | * @return string |
| 655 | 655 | */ |
| 656 | - public function default_button_url(){ |
|
| 656 | + public function default_button_url() { |
|
| 657 | 657 | return $this->_default_button_url; |
| 658 | 658 | } |
| 659 | 659 | |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | * Gets the gateway used by this payment method (if any) |
| 664 | 664 | * @return EE_Gateway |
| 665 | 665 | */ |
| 666 | - public function get_gateway(){ |
|
| 666 | + public function get_gateway() { |
|
| 667 | 667 | return $this->_gateway; |
| 668 | 668 | } |
| 669 | 669 | |
@@ -672,9 +672,9 @@ discard block |
||
| 672 | 672 | /** |
| 673 | 673 | * @return string html for the link to a help tab |
| 674 | 674 | */ |
| 675 | - public function get_help_tab_link(){ |
|
| 676 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
| 677 | - return EEH_Template::get_help_tab_link( $this->get_help_tab_name() ); |
|
| 675 | + public function get_help_tab_link() { |
|
| 676 | + EE_Registry::instance()->load_helper('Template'); |
|
| 677 | + return EEH_Template::get_help_tab_link($this->get_help_tab_name()); |
|
| 678 | 678 | } |
| 679 | 679 | |
| 680 | 680 | |
@@ -683,8 +683,8 @@ discard block |
||
| 683 | 683 | * Returns the name of the help tab for this PMT |
| 684 | 684 | * @return string |
| 685 | 685 | */ |
| 686 | - public function get_help_tab_name(){ |
|
| 687 | - return 'ee_' . strtolower( $this->system_name() ) . '_help_tab'; |
|
| 686 | + public function get_help_tab_name() { |
|
| 687 | + return 'ee_'.strtolower($this->system_name()).'_help_tab'; |
|
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | /** |
@@ -692,8 +692,8 @@ discard block |
||
| 692 | 692 | * this PMT by an admin |
| 693 | 693 | * @return string |
| 694 | 694 | */ |
| 695 | - public function cap_name(){ |
|
| 696 | - return 'ee_payment_method_' . strtolower( $this->system_name() ); |
|
| 695 | + public function cap_name() { |
|
| 696 | + return 'ee_payment_method_'.strtolower($this->system_name()); |
|
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | /** |
@@ -705,9 +705,9 @@ discard block |
||
| 705 | 705 | * @param EE_Payment $payment |
| 706 | 706 | * @return void |
| 707 | 707 | */ |
| 708 | - public function update_txn_based_on_payment( $payment ){ |
|
| 709 | - if( $this->_gateway instanceof EE_Gateway ){ |
|
| 710 | - $this->_gateway->update_txn_based_on_payment( $payment ); |
|
| 708 | + public function update_txn_based_on_payment($payment) { |
|
| 709 | + if ($this->_gateway instanceof EE_Gateway) { |
|
| 710 | + $this->_gateway->update_txn_based_on_payment($payment); |
|
| 711 | 711 | } |
| 712 | 712 | } |
| 713 | 713 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * needed helpers and models (see all the methods starting with "set_", eg seg_line_item_helper which should be passed an object |
| 31 | 31 | * which implements EEHI_Line_Item_Helper; etc). |
| 32 | 32 | */ |
| 33 | -abstract class EE_Gateway{ |
|
| 33 | +abstract class EE_Gateway { |
|
| 34 | 34 | /** |
| 35 | 35 | * a constant used as a possible value for $_currencies_supported to indicate |
| 36 | 36 | * that ALL currencies are supported by this gateway |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | /** |
| 109 | 109 | * @return EE_Gateway |
| 110 | 110 | */ |
| 111 | - public function __construct(){ |
|
| 111 | + public function __construct() { |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -120,10 +120,10 @@ discard block |
||
| 120 | 120 | * beginning again) |
| 121 | 121 | * @return array |
| 122 | 122 | */ |
| 123 | - public function __sleep(){ |
|
| 123 | + public function __sleep() { |
|
| 124 | 124 | $properties = get_object_vars($this); |
| 125 | - unset( $properties[ '_pay_model' ] ); |
|
| 126 | - unset( $properties[ '_pay_log' ] ); |
|
| 125 | + unset($properties['_pay_model']); |
|
| 126 | + unset($properties['_pay_log']); |
|
| 127 | 127 | return array_keys($properties); |
| 128 | 128 | } |
| 129 | 129 | /** |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | * see $_supports_sending_refunds |
| 132 | 132 | * @return boolean |
| 133 | 133 | */ |
| 134 | - public function supports_sending_refunds(){ |
|
| 134 | + public function supports_sending_refunds() { |
|
| 135 | 135 | return $this->_supports_sending_refunds; |
| 136 | 136 | } |
| 137 | 137 | /** |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * see $_supports_receiving_refunds |
| 140 | 140 | * @return boolean |
| 141 | 141 | */ |
| 142 | - public function supports_receiving_refunds(){ |
|
| 142 | + public function supports_receiving_refunds() { |
|
| 143 | 143 | return $this->_supports_receiving_refunds; |
| 144 | 144 | } |
| 145 | 145 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | * @return EE_Payment for the refund |
| 155 | 155 | * @throws EE_Error |
| 156 | 156 | */ |
| 157 | - public function do_direct_refund( EE_Payment $payment, $refund_info = null ) { |
|
| 157 | + public function do_direct_refund(EE_Payment $payment, $refund_info = null) { |
|
| 158 | 158 | return NULL; |
| 159 | 159 | } |
| 160 | 160 | |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | * etc |
| 166 | 166 | * @param array $settings_array |
| 167 | 167 | */ |
| 168 | - public function set_settings($settings_array){ |
|
| 169 | - foreach($settings_array as $name => $value){ |
|
| 168 | + public function set_settings($settings_array) { |
|
| 169 | + foreach ($settings_array as $name => $value) { |
|
| 170 | 170 | $property_name = "_".$name; |
| 171 | 171 | $this->{$property_name} = $value; |
| 172 | 172 | } |
@@ -175,14 +175,14 @@ discard block |
||
| 175 | 175 | * See this class description |
| 176 | 176 | * @param EEMI_Payment $payment_model |
| 177 | 177 | */ |
| 178 | - public function set_payment_model($payment_model){ |
|
| 178 | + public function set_payment_model($payment_model) { |
|
| 179 | 179 | $this->_pay_model = $payment_model; |
| 180 | 180 | } |
| 181 | 181 | /** |
| 182 | 182 | * See this class description |
| 183 | 183 | * @param EEMI_Payment_Log $payment_log_model |
| 184 | 184 | */ |
| 185 | - public function set_payment_log($payment_log_model){ |
|
| 185 | + public function set_payment_log($payment_log_model) { |
|
| 186 | 186 | $this->_pay_log = $payment_log_model; |
| 187 | 187 | } |
| 188 | 188 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | * See this class description |
| 191 | 191 | * @param EEHI_Template $template_helper |
| 192 | 192 | */ |
| 193 | - public function set_template_helper($template_helper){ |
|
| 193 | + public function set_template_helper($template_helper) { |
|
| 194 | 194 | $this->_template = $template_helper; |
| 195 | 195 | } |
| 196 | 196 | |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | * See this class description |
| 199 | 199 | * @param EEHI_Line_Item $line_item_helper |
| 200 | 200 | */ |
| 201 | - public function set_line_item_helper( $line_item_helper ){ |
|
| 201 | + public function set_line_item_helper($line_item_helper) { |
|
| 202 | 202 | $this->_line_item = $line_item_helper; |
| 203 | 203 | } |
| 204 | 204 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | * See this class description |
| 207 | 207 | * @param EEHI_Money $money_helper |
| 208 | 208 | */ |
| 209 | - public function set_money_helper( $money_helper ){ |
|
| 209 | + public function set_money_helper($money_helper) { |
|
| 210 | 210 | $this->_money = $money_helper; |
| 211 | 211 | } |
| 212 | 212 | |
@@ -215,23 +215,23 @@ discard block |
||
| 215 | 215 | * @param $message |
| 216 | 216 | * @param $payment |
| 217 | 217 | */ |
| 218 | - public function log($message,$payment){ |
|
| 219 | - if($payment instanceof EEI_Payment){ |
|
| 220 | - $type='Payment'; |
|
| 218 | + public function log($message, $payment) { |
|
| 219 | + if ($payment instanceof EEI_Payment) { |
|
| 220 | + $type = 'Payment'; |
|
| 221 | 221 | $id = $payment->ID(); |
| 222 | - }else{ |
|
| 222 | + } else { |
|
| 223 | 223 | $type = 'Payment_Method'; |
| 224 | 224 | $id = $this->_ID; |
| 225 | 225 | } |
| 226 | - $this->_pay_log->gateway_log($message,$id,$type); |
|
| 226 | + $this->_pay_log->gateway_log($message, $id, $type); |
|
| 227 | 227 | } |
| 228 | 228 | /** |
| 229 | 229 | * Formats the amount so it can generally be sent to gateways |
| 230 | 230 | * @param float $amount |
| 231 | 231 | * @return string |
| 232 | 232 | */ |
| 233 | - public function format_currency($amount){ |
|
| 234 | - return number_format( $amount, 2, '.', '' ); |
|
| 233 | + public function format_currency($amount) { |
|
| 234 | + return number_format($amount, 2, '.', ''); |
|
| 235 | 235 | // return $this->_template->format_currency($amount, true); |
| 236 | 236 | } |
| 237 | 237 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | * or a string indicating they're all supported (EE_gateway::all_currencies_supported) |
| 241 | 241 | * @return mixed array or string |
| 242 | 242 | */ |
| 243 | - public function currencies_supported(){ |
|
| 243 | + public function currencies_supported() { |
|
| 244 | 244 | return $this->_currencies_supported; |
| 245 | 245 | } |
| 246 | 246 | |
@@ -252,14 +252,14 @@ discard block |
||
| 252 | 252 | * @param EE_Transaction $transaction |
| 253 | 253 | * @return float |
| 254 | 254 | */ |
| 255 | - protected function _sum_items_and_taxes( EE_Transaction $transaction){ |
|
| 255 | + protected function _sum_items_and_taxes(EE_Transaction $transaction) { |
|
| 256 | 256 | $total_line_item = $transaction->total_line_item(); |
| 257 | 257 | $total = 0; |
| 258 | - foreach($total_line_item->get_items() as $item_line_item ){ |
|
| 259 | - $total += max( $item_line_item->total(), 0 ); |
|
| 258 | + foreach ($total_line_item->get_items() as $item_line_item) { |
|
| 259 | + $total += max($item_line_item->total(), 0); |
|
| 260 | 260 | } |
| 261 | - foreach($total_line_item->tax_descendants() as $tax_line_item ){ |
|
| 262 | - $total += max( $tax_line_item->total(), 0 ); |
|
| 261 | + foreach ($total_line_item->tax_descendants() as $tax_line_item) { |
|
| 262 | + $total += max($tax_line_item->total(), 0); |
|
| 263 | 263 | } |
| 264 | 264 | return $total; |
| 265 | 265 | } |
@@ -270,9 +270,9 @@ discard block |
||
| 270 | 270 | * @param EEI_Payment $payment |
| 271 | 271 | * @return boolean |
| 272 | 272 | */ |
| 273 | - protected function _can_easily_itemize_transaction_for( EEI_Payment $payment ){ |
|
| 273 | + protected function _can_easily_itemize_transaction_for(EEI_Payment $payment) { |
|
| 274 | 274 | return $this->_money->compare_floats( |
| 275 | - $this->_sum_items_and_taxes( $payment->transaction() ), |
|
| 275 | + $this->_sum_items_and_taxes($payment->transaction()), |
|
| 276 | 276 | $payment->transaction()->total() ) && |
| 277 | 277 | $this->_money->compare_floats( |
| 278 | 278 | $payment->amount(), |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | * @param EE_Payment $payment |
| 291 | 291 | * @return void |
| 292 | 292 | */ |
| 293 | - public function update_txn_based_on_payment( $payment ){ |
|
| 293 | + public function update_txn_based_on_payment($payment) { |
|
| 294 | 294 | //maybe update the transaction or line items or registrations |
| 295 | 295 | //but most gateways don't need to do this, because they only update the payment |
| 296 | 296 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * ------------------------------------------------------------------------ |
| 23 | 23 | */ |
| 24 | -class EE_Template_Layout extends EE_Div_Per_Section_Layout{ |
|
| 24 | +class EE_Template_Layout extends EE_Div_Per_Section_Layout { |
|
| 25 | 25 | |
| 26 | 26 | protected $_layout_template_file = NULL; |
| 27 | 27 | protected $_layout_begin_template_file = NULL; |
@@ -42,12 +42,12 @@ discard block |
||
| 42 | 42 | * @type array $_template_args |
| 43 | 43 | * } |
| 44 | 44 | */ |
| 45 | - public function __construct( $template_options = array() ) { |
|
| 45 | + public function __construct($template_options = array()) { |
|
| 46 | 46 | // loop thru incoming options |
| 47 | - foreach( $template_options as $key => $value ) { |
|
| 47 | + foreach ($template_options as $key => $value) { |
|
| 48 | 48 | // add underscore to $key to match property names |
| 49 | - $_key = '_' . $key; |
|
| 50 | - if ( property_exists( $this, $_key )) { |
|
| 49 | + $_key = '_'.$key; |
|
| 50 | + if (property_exists($this, $_key)) { |
|
| 51 | 51 | $this->{$_key} = $value; |
| 52 | 52 | } |
| 53 | 53 | } |
@@ -65,9 +65,9 @@ discard block |
||
| 65 | 65 | * @return string |
| 66 | 66 | */ |
| 67 | 67 | public function layout_form() { |
| 68 | - if ( $this->_layout_template_file ) { |
|
| 69 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
| 70 | - return EEH_Template::locate_template( $this->_layout_template_file, $this->template_args(), TRUE, TRUE ); |
|
| 68 | + if ($this->_layout_template_file) { |
|
| 69 | + EE_Registry::instance()->load_helper('Template'); |
|
| 70 | + return EEH_Template::locate_template($this->_layout_template_file, $this->template_args(), TRUE, TRUE); |
|
| 71 | 71 | } else { |
| 72 | 72 | return parent::layout_form(); |
| 73 | 73 | } |
@@ -80,10 +80,10 @@ discard block |
||
| 80 | 80 | * @return string |
| 81 | 81 | */ |
| 82 | 82 | public function layout_form_begin() { |
| 83 | - if($this->_layout_begin_template_file){ |
|
| 83 | + if ($this->_layout_begin_template_file) { |
|
| 84 | 84 | EE_Registry::instance()->load_helper('Template'); |
| 85 | - return EEH_Template::locate_template( $this->_layout_begin_template_file, $this->template_args(), TRUE, TRUE ); |
|
| 86 | - }else{ |
|
| 85 | + return EEH_Template::locate_template($this->_layout_begin_template_file, $this->template_args(), TRUE, TRUE); |
|
| 86 | + } else { |
|
| 87 | 87 | return parent::layout_form_begin(); |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -96,10 +96,10 @@ discard block |
||
| 96 | 96 | * @param EE_Form_Input_Base $input |
| 97 | 97 | * @return string |
| 98 | 98 | */ |
| 99 | - public function layout_input( $input ) { |
|
| 100 | - if($this->_input_template_file){ |
|
| 99 | + public function layout_input($input) { |
|
| 100 | + if ($this->_input_template_file) { |
|
| 101 | 101 | EE_Registry::instance()->load_helper('Template'); |
| 102 | - return EEH_Template::locate_template( $this->_input_template_file, array( 'input' => $input ), TRUE, TRUE ); |
|
| 102 | + return EEH_Template::locate_template($this->_input_template_file, array('input' => $input), TRUE, TRUE); |
|
| 103 | 103 | } |
| 104 | 104 | return parent::layout_input($input); |
| 105 | 105 | } |
@@ -112,12 +112,12 @@ discard block |
||
| 112 | 112 | * @param EE_Form_Section_Proper $form_section |
| 113 | 113 | * @return string |
| 114 | 114 | */ |
| 115 | - public function layout_subsection( $form_section ) { |
|
| 116 | - if($this->_subsection_template_file){ |
|
| 115 | + public function layout_subsection($form_section) { |
|
| 116 | + if ($this->_subsection_template_file) { |
|
| 117 | 117 | EE_Registry::instance()->load_helper('Template'); |
| 118 | - return EEH_Template::locate_template( $this->_subsection_template_file, $this->template_args(), TRUE, TRUE ); |
|
| 118 | + return EEH_Template::locate_template($this->_subsection_template_file, $this->template_args(), TRUE, TRUE); |
|
| 119 | 119 | } |
| 120 | - return parent::layout_subsection( $form_section ); |
|
| 120 | + return parent::layout_subsection($form_section); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | |
@@ -127,10 +127,10 @@ discard block |
||
| 127 | 127 | * @return string |
| 128 | 128 | */ |
| 129 | 129 | public function layout_form_end() { |
| 130 | - if($this->_layout_end_template_file){ |
|
| 130 | + if ($this->_layout_end_template_file) { |
|
| 131 | 131 | EE_Registry::instance()->load_helper('Template'); |
| 132 | - return EEH_Template::locate_template( $this->_layout_end_template_file, $this->template_args(), TRUE, TRUE); |
|
| 133 | - }else{ |
|
| 132 | + return EEH_Template::locate_template($this->_layout_end_template_file, $this->template_args(), TRUE, TRUE); |
|
| 133 | + } else { |
|
| 134 | 134 | return parent::layout_form_end(); |
| 135 | 135 | } |
| 136 | 136 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | /** |
| 141 | 141 | * @param array $template_args |
| 142 | 142 | */ |
| 143 | - public function set_template_args( $template_args = array() ) { |
|
| 143 | + public function set_template_args($template_args = array()) { |
|
| 144 | 144 | $this->_template_args = $template_args; |
| 145 | 145 | } |
| 146 | 146 | |
@@ -149,8 +149,8 @@ discard block |
||
| 149 | 149 | /** |
| 150 | 150 | * @param array $template_args |
| 151 | 151 | */ |
| 152 | - public function add_template_args( $template_args = array() ) { |
|
| 153 | - $this->_template_args = array_merge_recursive( $this->_template_args, $template_args ); |
|
| 152 | + public function add_template_args($template_args = array()) { |
|
| 153 | + $this->_template_args = array_merge_recursive($this->_template_args, $template_args); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | |
@@ -159,13 +159,13 @@ discard block |
||
| 159 | 159 | * @return array |
| 160 | 160 | */ |
| 161 | 161 | public function template_args() { |
| 162 | - foreach ( $this->form_section()->subsections() as $subsection_name => $subsection ) { |
|
| 163 | - $subsection_name = self::prep_form_subsection_key_name( $subsection_name ); |
|
| 164 | - if ( strpos( $subsection_name, '[' ) !== FALSE ) { |
|
| 165 | - $sub_name = explode( '[', $subsection_name ); |
|
| 166 | - $this->_template_args[ $sub_name[0] ][ rtrim( $sub_name[1], ']' ) ] = $this->layout_subsection( $subsection ); |
|
| 162 | + foreach ($this->form_section()->subsections() as $subsection_name => $subsection) { |
|
| 163 | + $subsection_name = self::prep_form_subsection_key_name($subsection_name); |
|
| 164 | + if (strpos($subsection_name, '[') !== FALSE) { |
|
| 165 | + $sub_name = explode('[', $subsection_name); |
|
| 166 | + $this->_template_args[$sub_name[0]][rtrim($sub_name[1], ']')] = $this->layout_subsection($subsection); |
|
| 167 | 167 | } else { |
| 168 | - $this->_template_args[ $subsection_name ] = $this->layout_subsection( $subsection ); |
|
| 168 | + $this->_template_args[$subsection_name] = $this->layout_subsection($subsection); |
|
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | // d( $this->_template_args ); |
@@ -181,9 +181,9 @@ discard block |
||
| 181 | 181 | * @param string $subsection_name |
| 182 | 182 | * @return string |
| 183 | 183 | */ |
| 184 | - public static function prep_form_subsection_key_name( $subsection_name = '' ) { |
|
| 185 | - $subsection_name = str_replace( array( '-', ' ' ), array( '', '_' ), $subsection_name ); |
|
| 186 | - return is_numeric( substr( $subsection_name, 0, 1 )) ? 'form_' . $subsection_name : $subsection_name; |
|
| 184 | + public static function prep_form_subsection_key_name($subsection_name = '') { |
|
| 185 | + $subsection_name = str_replace(array('-', ' '), array('', '_'), $subsection_name); |
|
| 186 | + return is_numeric(substr($subsection_name, 0, 1)) ? 'form_'.$subsection_name : $subsection_name; |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | |
@@ -195,8 +195,8 @@ discard block |
||
| 195 | 195 | * @param string $subsection_name |
| 196 | 196 | * @return string |
| 197 | 197 | */ |
| 198 | - public static function get_subform_name( $subsection_name = '' ) { |
|
| 199 | - return EE_Template_Layout::prep_form_subsection_key_name( $subsection_name ); |
|
| 198 | + public static function get_subform_name($subsection_name = '') { |
|
| 199 | + return EE_Template_Layout::prep_form_subsection_key_name($subsection_name); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
@@ -8,19 +8,19 @@ |
||
| 8 | 8 | <div class="ee-list-table-legend-container"> |
| 9 | 9 | <h3><?php _e('Legend', 'event_espresso'); ?></h3> |
| 10 | 10 | <dl class="alignleft ee-list-table-legend"> |
| 11 | - <?php foreach ( $items as $item => $details ) : ?> |
|
| 12 | - <?php if ( $per_col < $count ) : ?> |
|
| 11 | + <?php foreach ($items as $item => $details) : ?> |
|
| 12 | + <?php if ($per_col < $count) : ?> |
|
| 13 | 13 | </dl> |
| 14 | 14 | <dl class="alignleft ee-list-table-legend"> |
| 15 | 15 | <?php $count = 1; endif; ?> |
| 16 | 16 | <dt id="ee-legend-item-<?php echo $item; ?>"> |
| 17 | - <?php $class = ! empty( $details['class'] ) ? $details['class'] : 'ee-legend-img-container'; ?> |
|
| 18 | - <?php if ( strpos( $details[ 'class' ], '<span' ) !== false ) { |
|
| 17 | + <?php $class = ! empty($details['class']) ? $details['class'] : 'ee-legend-img-container'; ?> |
|
| 18 | + <?php if (strpos($details['class'], '<span') !== false) { |
|
| 19 | 19 | echo $class; |
| 20 | 20 | } else { ?> |
| 21 | 21 | <span class="<?php echo $class; ?>"> |
| 22 | - <?php if ( ! empty( $details[ 'icon' ] ) ) : ?> |
|
| 23 | - <img src="<?php echo $details[ 'icon' ]; ?>" class="ee-legend-icon" alt="<?php echo esc_attr( $details[ 'desc' ] ); ?>"/> |
|
| 22 | + <?php if ( ! empty($details['icon'])) : ?> |
|
| 23 | + <img src="<?php echo $details['icon']; ?>" class="ee-legend-icon" alt="<?php echo esc_attr($details['desc']); ?>"/> |
|
| 24 | 24 | <?php endif; ?> |
| 25 | 25 | </span> |
| 26 | 26 | <?php } ?> |
@@ -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 | |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | * ------------------------------------------------------------------------ |
| 32 | 32 | */ |
| 33 | 33 | |
| 34 | -if ( ! class_exists( 'WP_List_Table' )) { |
|
| 35 | - require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); |
|
| 34 | +if ( ! class_exists('WP_List_Table')) { |
|
| 35 | + require_once(ABSPATH.'wp-admin/includes/class-wp-list-table.php'); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | abstract class EE_Admin_List_Table extends WP_List_Table { |
@@ -243,16 +243,16 @@ discard block |
||
| 243 | 243 | * constructor |
| 244 | 244 | * @param EE_Admin_Page object $admin_page we use this for obtaining everything we need in the list table. |
| 245 | 245 | */ |
| 246 | - public function __construct( EE_Admin_Page $admin_page ) { |
|
| 246 | + public function __construct(EE_Admin_Page $admin_page) { |
|
| 247 | 247 | $this->_admin_page = $admin_page; |
| 248 | 248 | $this->_req_data = $this->_admin_page->get_request_data(); |
| 249 | 249 | $this->_view = $this->_admin_page->get_view(); |
| 250 | - $this->_views = empty( $this->_views ) ? $this->_admin_page->get_list_table_view_RLs() : $this->_views; |
|
| 250 | + $this->_views = empty($this->_views) ? $this->_admin_page->get_list_table_view_RLs() : $this->_views; |
|
| 251 | 251 | $this->_current_page = $this->get_pagenum(); |
| 252 | - $this->_screen = $this->_admin_page->get_current_page() . '_' . $this->_admin_page->get_current_view(); |
|
| 253 | - $this->_yes_no = array( __('No', 'event_espresso'), __('Yes', 'event_espresso')); |
|
| 252 | + $this->_screen = $this->_admin_page->get_current_page().'_'.$this->_admin_page->get_current_view(); |
|
| 253 | + $this->_yes_no = array(__('No', 'event_espresso'), __('Yes', 'event_espresso')); |
|
| 254 | 254 | |
| 255 | - $this->_per_page = $this->get_items_per_page( $this->_screen . '_per_page', 10 ); |
|
| 255 | + $this->_per_page = $this->get_items_per_page($this->_screen.'_per_page', 10); |
|
| 256 | 256 | |
| 257 | 257 | $this->_setup_data(); |
| 258 | 258 | $this->_add_view_counts(); |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | $this->_set_properties(); |
| 263 | 263 | |
| 264 | 264 | //set primary column |
| 265 | - add_filter( 'list_table_primary_column', array( $this, 'set_primary_column' ) ); |
|
| 265 | + add_filter('list_table_primary_column', array($this, 'set_primary_column')); |
|
| 266 | 266 | |
| 267 | 267 | //set parent defaults |
| 268 | 268 | parent::__construct($this->_wp_list_args); |
@@ -338,17 +338,17 @@ discard block |
||
| 338 | 338 | * @return html string |
| 339 | 339 | */ |
| 340 | 340 | protected function _get_hidden_fields() { |
| 341 | - $action = isset( $this->_req_data['route'] ) ? $this->_req_data['route'] : ''; |
|
| 342 | - $action = empty( $action ) && isset( $this->_req_data['action'] ) ? $this->_req_data['action'] : $action; |
|
| 341 | + $action = isset($this->_req_data['route']) ? $this->_req_data['route'] : ''; |
|
| 342 | + $action = empty($action) && isset($this->_req_data['action']) ? $this->_req_data['action'] : $action; |
|
| 343 | 343 | //if action is STILL empty, then we set it to default |
| 344 | - $action = empty( $action ) ? 'default' : $action; |
|
| 345 | - $field = '<input type="hidden" name="page" value="' . $this->_req_data['page'] . '" />' . "\n"; |
|
| 346 | - $field .= '<input type="hidden" name="route" value="'. $action .'" />' . "\n";/**/ |
|
| 347 | - $field .= '<input type="hidden" name="perpage" value="' . $this->_per_page . '" />' . "\n"; |
|
| 344 | + $action = empty($action) ? 'default' : $action; |
|
| 345 | + $field = '<input type="hidden" name="page" value="'.$this->_req_data['page'].'" />'."\n"; |
|
| 346 | + $field .= '<input type="hidden" name="route" value="'.$action.'" />'."\n"; /**/ |
|
| 347 | + $field .= '<input type="hidden" name="perpage" value="'.$this->_per_page.'" />'."\n"; |
|
| 348 | 348 | |
| 349 | 349 | $bulk_actions = $this->_get_bulk_actions(); |
| 350 | - foreach ( $bulk_actions as $bulk_action => $label ) { |
|
| 351 | - $field .= '<input type="hidden" name="' . $bulk_action . '_nonce" value="' . wp_create_nonce ( $bulk_action . '_nonce' ) . '" />' . "\n"; |
|
| 350 | + foreach ($bulk_actions as $bulk_action => $label) { |
|
| 351 | + $field .= '<input type="hidden" name="'.$bulk_action.'_nonce" value="'.wp_create_nonce($bulk_action.'_nonce').'" />'."\n"; |
|
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | return $field; |
@@ -378,15 +378,15 @@ discard block |
||
| 378 | 378 | * |
| 379 | 379 | * @var array |
| 380 | 380 | */ |
| 381 | - $_sortable = apply_filters( "FHEE_manage_{$this->screen->id}_sortable_columns", $_sortable, $this->_screen ); |
|
| 381 | + $_sortable = apply_filters("FHEE_manage_{$this->screen->id}_sortable_columns", $_sortable, $this->_screen); |
|
| 382 | 382 | |
| 383 | 383 | $sortable = array(); |
| 384 | - foreach ( $_sortable as $id => $data ) { |
|
| 385 | - if ( empty( $data ) ) |
|
| 384 | + foreach ($_sortable as $id => $data) { |
|
| 385 | + if (empty($data)) |
|
| 386 | 386 | continue; |
| 387 | 387 | |
| 388 | 388 | //fix for offset errors with WP_List_Table default get_columninfo() |
| 389 | - if ( is_array($data) ) { |
|
| 389 | + if (is_array($data)) { |
|
| 390 | 390 | $_data[0] = key($data); |
| 391 | 391 | $_data[1] = isset($data[1]) ? $data[1] : false; |
| 392 | 392 | } else { |
@@ -395,14 +395,14 @@ discard block |
||
| 395 | 395 | |
| 396 | 396 | $data = (array) $data; |
| 397 | 397 | |
| 398 | - if ( !isset( $data[1] ) ) |
|
| 398 | + if ( ! isset($data[1])) |
|
| 399 | 399 | $_data[1] = false; |
| 400 | 400 | |
| 401 | 401 | |
| 402 | 402 | $sortable[$id] = $_data; |
| 403 | 403 | } |
| 404 | 404 | $primary = $this->get_primary_column_name(); |
| 405 | - $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); |
|
| 405 | + $this->_column_headers = array($columns, $hidden, $sortable, $primary); |
|
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | |
@@ -411,8 +411,8 @@ discard block |
||
| 411 | 411 | * @return string |
| 412 | 412 | */ |
| 413 | 413 | protected function get_primary_column_name() { |
| 414 | - foreach( class_parents( $this ) as $parent ) { |
|
| 415 | - if ( method_exists( $parent, 'get_primary_column_name' ) && $parent == 'WP_List_Table' ) { |
|
| 414 | + foreach (class_parents($this) as $parent) { |
|
| 415 | + if (method_exists($parent, 'get_primary_column_name') && $parent == 'WP_List_Table') { |
|
| 416 | 416 | return parent::get_primary_column_name(); |
| 417 | 417 | } |
| 418 | 418 | } |
@@ -424,10 +424,10 @@ discard block |
||
| 424 | 424 | * Added for WP4.1 backward compat (@see https://events.codebasehq.com/projects/event-espresso/tickets/8814) |
| 425 | 425 | * @return string |
| 426 | 426 | */ |
| 427 | - protected function handle_row_actions( $item, $column_name, $primary ) { |
|
| 428 | - foreach( class_parents( $this ) as $parent ) { |
|
| 429 | - if ( method_exists( $parent, 'handle_row_actions' ) && $parent == 'WP_List_Table' ) { |
|
| 430 | - return parent::handle_row_actions( $item, $column_name, $primary ); |
|
| 427 | + protected function handle_row_actions($item, $column_name, $primary) { |
|
| 428 | + foreach (class_parents($this) as $parent) { |
|
| 429 | + if (method_exists($parent, 'handle_row_actions') && $parent == 'WP_List_Table') { |
|
| 430 | + return parent::handle_row_actions($item, $column_name, $primary); |
|
| 431 | 431 | } |
| 432 | 432 | } |
| 433 | 433 | return ''; |
@@ -445,11 +445,11 @@ discard block |
||
| 445 | 445 | protected function _get_bulk_actions() { |
| 446 | 446 | $actions = array(); |
| 447 | 447 | //the _views property should have the bulk_actions, so let's go through and extract them into a properly formatted array for the wp_list_table(); |
| 448 | - foreach ( $this->_views as $view => $args) { |
|
| 449 | - if ( isset( $args['bulk_action']) && is_array($args['bulk_action']) && $this->_view == $view ) |
|
| 448 | + foreach ($this->_views as $view => $args) { |
|
| 449 | + if (isset($args['bulk_action']) && is_array($args['bulk_action']) && $this->_view == $view) |
|
| 450 | 450 | //each bulk action will correspond with a admin page route, so we can check whatever the capability is for that page route and skip adding the bulk action if no access for the current logged in user. |
| 451 | - foreach ( $args['bulk_action'] as $route =>$label ) { |
|
| 452 | - if ( $this->_admin_page->check_user_access( $route, true ) ) { |
|
| 451 | + foreach ($args['bulk_action'] as $route =>$label) { |
|
| 452 | + if ($this->_admin_page->check_user_access($route, true)) { |
|
| 453 | 453 | $actions[$route] = $label; |
| 454 | 454 | } |
| 455 | 455 | } |
@@ -467,18 +467,18 @@ discard block |
||
| 467 | 467 | */ |
| 468 | 468 | private function _filters() { |
| 469 | 469 | $classname = get_class($this); |
| 470 | - $filters = apply_filters( "FHEE__{$classname}__filters", (array) $this->_get_table_filters(), $this, $this->_screen ); |
|
| 470 | + $filters = apply_filters("FHEE__{$classname}__filters", (array) $this->_get_table_filters(), $this, $this->_screen); |
|
| 471 | 471 | |
| 472 | - if ( empty( $filters )) { |
|
| 472 | + if (empty($filters)) { |
|
| 473 | 473 | return; |
| 474 | 474 | } |
| 475 | - foreach ( $filters as $filter ) { |
|
| 475 | + foreach ($filters as $filter) { |
|
| 476 | 476 | echo $filter; |
| 477 | 477 | } |
| 478 | 478 | //add filter button at end |
| 479 | - echo '<input type="submit" class="button-secondary" value="' . __('Filter', 'event_espresso') . '" id="post-query-submit" />'; |
|
| 479 | + echo '<input type="submit" class="button-secondary" value="'.__('Filter', 'event_espresso').'" id="post-query-submit" />'; |
|
| 480 | 480 | //add reset filters button at end |
| 481 | - echo '<a class="button button-secondary" href="' . $this->_admin_page->get_current_page_view_url() . '" style="display:inline-block">' . __('Reset Filters', 'event_espresso') . '</a>'; |
|
| 481 | + echo '<a class="button button-secondary" href="'.$this->_admin_page->get_current_page_view_url().'" style="display:inline-block">'.__('Reset Filters', 'event_espresso').'</a>'; |
|
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | |
@@ -492,8 +492,8 @@ discard block |
||
| 492 | 492 | * @param string $column_name |
| 493 | 493 | * @return string |
| 494 | 494 | */ |
| 495 | - public function set_primary_column( $column_name ) { |
|
| 496 | - return ! empty( $this->_primary_column ) ? $this->_primary_column : $column_name; |
|
| 495 | + public function set_primary_column($column_name) { |
|
| 496 | + return ! empty($this->_primary_column) ? $this->_primary_column : $column_name; |
|
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | array( |
| 513 | 513 | 'total_items' => $total_items, |
| 514 | 514 | 'per_page' => $this->_per_page, |
| 515 | - 'total_pages' => ceil($total_items / $this->_per_page ) |
|
| 515 | + 'total_pages' => ceil($total_items / $this->_per_page) |
|
| 516 | 516 | ) |
| 517 | 517 | ); |
| 518 | 518 | } |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | * |
| 529 | 529 | * @return string html content for the column |
| 530 | 530 | */ |
| 531 | - public function column_default( $item, $column_name ) { |
|
| 531 | + public function column_default($item, $column_name) { |
|
| 532 | 532 | /** |
| 533 | 533 | * Dynamic hook allowing for adding additional column content in this list table. |
| 534 | 534 | * Note that $this->screen->id is in the format |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | * hook prefix ("event-espresso") will be different. |
| 539 | 539 | * |
| 540 | 540 | */ |
| 541 | - do_action( 'AHEE__EE_Admin_List_Table__column_' . $column_name . '__' . $this->screen->id, $item, $this->_screen ); |
|
| 541 | + do_action('AHEE__EE_Admin_List_Table__column_'.$column_name.'__'.$this->screen->id, $item, $this->_screen); |
|
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | * |
| 555 | 555 | * @var array |
| 556 | 556 | */ |
| 557 | - $columns = apply_filters( 'FHEE_manage_'.$this->screen->id.'_columns', $this->_columns, $this->_screen ); |
|
| 557 | + $columns = apply_filters('FHEE_manage_'.$this->screen->id.'_columns', $this->_columns, $this->_screen); |
|
| 558 | 558 | return $columns; |
| 559 | 559 | } |
| 560 | 560 | |
@@ -566,18 +566,18 @@ discard block |
||
| 566 | 566 | $views = $this->get_views(); |
| 567 | 567 | $assembled_views = ''; |
| 568 | 568 | |
| 569 | - if ( empty( $views )) { |
|
| 569 | + if (empty($views)) { |
|
| 570 | 570 | return; |
| 571 | 571 | } |
| 572 | 572 | echo "<ul class='subsubsub'>\n"; |
| 573 | - foreach ( $views as $view ) { |
|
| 574 | - $count = isset($view['count'] ) && !empty($view['count']) ? absint( $view['count'] ) : 0; |
|
| 575 | - if ( isset( $view['slug'] ) && isset( $view['class'] ) && isset( $view['url'] ) && isset( $view['label']) ) { |
|
| 576 | - $assembled_views[ $view['slug'] ] = "\t<li class='" . $view['class'] . "'>" . '<a href="' . $view['url'] . '">' . $view['label'] . '</a> <span class="count">(' . $count . ')</span>'; |
|
| 573 | + foreach ($views as $view) { |
|
| 574 | + $count = isset($view['count']) && ! empty($view['count']) ? absint($view['count']) : 0; |
|
| 575 | + if (isset($view['slug']) && isset($view['class']) && isset($view['url']) && isset($view['label'])) { |
|
| 576 | + $assembled_views[$view['slug']] = "\t<li class='".$view['class']."'>".'<a href="'.$view['url'].'">'.$view['label'].'</a> <span class="count">('.$count.')</span>'; |
|
| 577 | 577 | } |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | - echo is_array( $assembled_views) && ! empty( $assembled_views ) ? implode( " |</li>\n", $assembled_views ) . "</li>\n" : ''; |
|
| 580 | + echo is_array($assembled_views) && ! empty($assembled_views) ? implode(" |</li>\n", $assembled_views)."</li>\n" : ''; |
|
| 581 | 581 | echo "</ul>"; |
| 582 | 582 | } |
| 583 | 583 | |
@@ -590,10 +590,10 @@ discard block |
||
| 590 | 590 | * |
| 591 | 591 | * @param object $item The current item |
| 592 | 592 | */ |
| 593 | - public function single_row( $item ) { |
|
| 594 | - $row_class = $this->_get_row_class( $item ); |
|
| 595 | - echo '<tr class="' . esc_attr( $row_class ) . '">'; |
|
| 596 | - $this->single_row_columns( $item ); |
|
| 593 | + public function single_row($item) { |
|
| 594 | + $row_class = $this->_get_row_class($item); |
|
| 595 | + echo '<tr class="'.esc_attr($row_class).'">'; |
|
| 596 | + $this->single_row_columns($item); |
|
| 597 | 597 | echo '</tr>'; |
| 598 | 598 | } |
| 599 | 599 | |
@@ -604,13 +604,13 @@ discard block |
||
| 604 | 604 | * @param object $item the current item |
| 605 | 605 | * @return string |
| 606 | 606 | */ |
| 607 | - protected function _get_row_class( $item ) { |
|
| 607 | + protected function _get_row_class($item) { |
|
| 608 | 608 | static $row_class = ''; |
| 609 | - $row_class = ( $row_class == '' ? 'alternate' : '' ); |
|
| 609 | + $row_class = ($row_class == '' ? 'alternate' : ''); |
|
| 610 | 610 | |
| 611 | 611 | $new_row_class = $row_class; |
| 612 | 612 | |
| 613 | - if ( !empty($this->_ajax_sorting_callback) ) { |
|
| 613 | + if ( ! empty($this->_ajax_sorting_callback)) { |
|
| 614 | 614 | $new_row_class .= ' rowsortable'; |
| 615 | 615 | } |
| 616 | 616 | |
@@ -629,13 +629,13 @@ discard block |
||
| 629 | 629 | |
| 630 | 630 | public function get_hidden_columns() { |
| 631 | 631 | $user_id = get_current_user_id(); |
| 632 | - $has_default = get_user_option('default'. $this->screen->id . 'columnshidden', $user_id); |
|
| 633 | - if ( empty( $has_default ) && !empty($this->_hidden_columns ) ) { |
|
| 634 | - update_user_option($user_id, 'default'.$this->screen->id . 'columnshidden', TRUE); |
|
| 635 | - update_user_option($user_id, 'manage' . $this->screen->id . 'columnshidden', $this->_hidden_columns, TRUE ); |
|
| 632 | + $has_default = get_user_option('default'.$this->screen->id.'columnshidden', $user_id); |
|
| 633 | + if (empty($has_default) && ! empty($this->_hidden_columns)) { |
|
| 634 | + update_user_option($user_id, 'default'.$this->screen->id.'columnshidden', TRUE); |
|
| 635 | + update_user_option($user_id, 'manage'.$this->screen->id.'columnshidden', $this->_hidden_columns, TRUE); |
|
| 636 | 636 | } |
| 637 | - $ref = 'manage' . $this->screen->id . 'columnshidden'; |
|
| 638 | - $saved_columns = (array) get_user_option( $ref, $user_id ); |
|
| 637 | + $ref = 'manage'.$this->screen->id.'columnshidden'; |
|
| 638 | + $saved_columns = (array) get_user_option($ref, $user_id); |
|
| 639 | 639 | return $saved_columns; |
| 640 | 640 | } |
| 641 | 641 | |
@@ -650,47 +650,47 @@ discard block |
||
| 650 | 650 | * |
| 651 | 651 | * @param object $item The current item |
| 652 | 652 | */ |
| 653 | - public function single_row_columns( $item ) { |
|
| 654 | - list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); |
|
| 653 | + public function single_row_columns($item) { |
|
| 654 | + list($columns, $hidden, $sortable, $primary) = $this->get_column_info(); |
|
| 655 | 655 | |
| 656 | 656 | global $wp_version; |
| 657 | - $use_hidden_class = version_compare( $wp_version, '4.3-RC', '>=' ); |
|
| 657 | + $use_hidden_class = version_compare($wp_version, '4.3-RC', '>='); |
|
| 658 | 658 | |
| 659 | - foreach ( $columns as $column_name => $column_display_name ) { |
|
| 659 | + foreach ($columns as $column_name => $column_display_name) { |
|
| 660 | 660 | |
| 661 | 661 | /** |
| 662 | 662 | * With WordPress version 4.3.RC+ WordPress started using the hidden css class to control whether columns are |
| 663 | 663 | * hidden or not instead of using "display:none;". This bit of code provides backward compat. |
| 664 | 664 | */ |
| 665 | - $hidden_class = $use_hidden_class && in_array( $column_name, $hidden ) ? ' hidden' : ''; |
|
| 666 | - $style = ! $use_hidden_class && in_array( $column_name, $hidden ) ? ' style="display:none;"' : ''; |
|
| 665 | + $hidden_class = $use_hidden_class && in_array($column_name, $hidden) ? ' hidden' : ''; |
|
| 666 | + $style = ! $use_hidden_class && in_array($column_name, $hidden) ? ' style="display:none;"' : ''; |
|
| 667 | 667 | |
| 668 | - $classes = $column_name . ' column-' . $column_name.$hidden_class; |
|
| 669 | - if ( $primary == $column_name ) { |
|
| 668 | + $classes = $column_name.' column-'.$column_name.$hidden_class; |
|
| 669 | + if ($primary == $column_name) { |
|
| 670 | 670 | $classes .= ' has-row-actions column-primary'; |
| 671 | 671 | } |
| 672 | 672 | |
| 673 | - $data = ' data-colname="' . wp_strip_all_tags( $column_display_name ) . '"'; |
|
| 673 | + $data = ' data-colname="'.wp_strip_all_tags($column_display_name).'"'; |
|
| 674 | 674 | |
| 675 | 675 | $class = "class='$classes'"; |
| 676 | 676 | |
| 677 | 677 | $attributes = "$class$style$data"; |
| 678 | 678 | |
| 679 | - if ( 'cb' === $column_name ) { |
|
| 679 | + if ('cb' === $column_name) { |
|
| 680 | 680 | echo '<th scope="row" class="check-column">'; |
| 681 | - echo apply_filters( 'FHEE__EE_Admin_List_Table__single_row_columns__column_cb_content', $this->column_cb( $item ), $item, $this ); |
|
| 681 | + echo apply_filters('FHEE__EE_Admin_List_Table__single_row_columns__column_cb_content', $this->column_cb($item), $item, $this); |
|
| 682 | 682 | echo '</th>'; |
| 683 | 683 | } |
| 684 | - elseif ( method_exists( $this, 'column_' . $column_name ) ) { |
|
| 684 | + elseif (method_exists($this, 'column_'.$column_name)) { |
|
| 685 | 685 | echo "<td $attributes>"; |
| 686 | - echo apply_filters( 'FHEE__EE_Admin_List_Table__single_row_columns__column_' . $column_name . '__column_content', call_user_func( array( $this, 'column_' . $column_name ), $item ), $item, $this ); |
|
| 687 | - echo $this->handle_row_actions( $item, $column_name, $primary ); |
|
| 686 | + echo apply_filters('FHEE__EE_Admin_List_Table__single_row_columns__column_'.$column_name.'__column_content', call_user_func(array($this, 'column_'.$column_name), $item), $item, $this); |
|
| 687 | + echo $this->handle_row_actions($item, $column_name, $primary); |
|
| 688 | 688 | echo "</td>"; |
| 689 | 689 | } |
| 690 | 690 | else { |
| 691 | 691 | echo "<td $attributes>"; |
| 692 | - echo apply_filters( 'FHEE__EE_Admin_List_Table__single_row_columns__column_default__column_content', $this->column_default( $item, $column_name ), $item, $column_name, $this ); |
|
| 693 | - echo $this->handle_row_actions( $item, $column_name, $primary ); |
|
| 692 | + echo apply_filters('FHEE__EE_Admin_List_Table__single_row_columns__column_default__column_content', $this->column_default($item, $column_name), $item, $column_name, $this); |
|
| 693 | + echo $this->handle_row_actions($item, $column_name, $primary); |
|
| 694 | 694 | echo "</td>"; |
| 695 | 695 | } |
| 696 | 696 | } |
@@ -698,19 +698,19 @@ discard block |
||
| 698 | 698 | |
| 699 | 699 | |
| 700 | 700 | |
| 701 | - public function extra_tablenav( $which ) { |
|
| 702 | - if ( $which == 'top' ) { |
|
| 701 | + public function extra_tablenav($which) { |
|
| 702 | + if ($which == 'top') { |
|
| 703 | 703 | $this->_filters(); |
| 704 | 704 | echo $this->_get_hidden_fields(); |
| 705 | 705 | echo '<br class="clear">'; |
| 706 | - }else{ |
|
| 706 | + } else { |
|
| 707 | 707 | echo '<div class="list-table-bottom-buttons alignleft actions">'; |
| 708 | - foreach($this->_bottom_buttons as $type => $action){ |
|
| 709 | - $route = isset( $action['route'] ) ? $action['route'] : ''; |
|
| 710 | - $extra_request = isset( $action['extra_request'] ) ? $action['extra_request'] : ''; |
|
| 708 | + foreach ($this->_bottom_buttons as $type => $action) { |
|
| 709 | + $route = isset($action['route']) ? $action['route'] : ''; |
|
| 710 | + $extra_request = isset($action['extra_request']) ? $action['extra_request'] : ''; |
|
| 711 | 711 | echo $this->_admin_page->get_action_link_or_button($route, $type, $extra_request); |
| 712 | 712 | } |
| 713 | - do_action( 'AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', $this, $this->_screen ); |
|
| 713 | + do_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', $this, $this->_screen); |
|
| 714 | 714 | echo '</div>'; |
| 715 | 715 | } |
| 716 | 716 | //echo $this->_entries_per_page_dropdown; |
@@ -760,13 +760,13 @@ discard block |
||
| 760 | 760 | * |
| 761 | 761 | * @return string The assembled action elements container. |
| 762 | 762 | */ |
| 763 | - protected function _action_string( $action_items, $item, $action_container = 'ul', $action_class = '', $action_id = '' ) { |
|
| 763 | + protected function _action_string($action_items, $item, $action_container = 'ul', $action_class = '', $action_id = '') { |
|
| 764 | 764 | $content = ''; |
| 765 | - $action_class = ! empty( $action_class ) ? ' class="' . $action_class . '"' : ''; |
|
| 766 | - $action_id = ! empty( $action_id ) ? ' id="' . $action_id . '"' : ''; |
|
| 767 | - $content .= ! empty( $action_container ) ? '<' . $action_container . $action_class . $action_id . '>' : ''; |
|
| 768 | - $content .= apply_filters( 'FHEE__EE_Admin_List_Table___action_string__action_items', $action_items, $item, $this ); |
|
| 769 | - $content .= ! empty( $container ) ? '</' . $container . '>' : ''; |
|
| 765 | + $action_class = ! empty($action_class) ? ' class="'.$action_class.'"' : ''; |
|
| 766 | + $action_id = ! empty($action_id) ? ' id="'.$action_id.'"' : ''; |
|
| 767 | + $content .= ! empty($action_container) ? '<'.$action_container.$action_class.$action_id.'>' : ''; |
|
| 768 | + $content .= apply_filters('FHEE__EE_Admin_List_Table___action_string__action_items', $action_items, $item, $this); |
|
| 769 | + $content .= ! empty($container) ? '</'.$container.'>' : ''; |
|
| 770 | 770 | return $content; |
| 771 | 771 | } |
| 772 | 772 | } |
@@ -5,7 +5,9 @@ |
||
| 5 | 5 | * @subpackage helpers |
| 6 | 6 | * @since 4.5.0 |
| 7 | 7 | */ |
| 8 | -if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
| 8 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 9 | + exit('No direct script access allowed'); |
|
| 10 | +} |
|
| 9 | 11 | |
| 10 | 12 | |
| 11 | 13 | /** |
@@ -15,9 +15,9 @@ discard block |
||
| 15 | 15 | * @return boolean |
| 16 | 16 | */ |
| 17 | 17 | function ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() { |
| 18 | - $in_use = has_filter( 'FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns' ) |
|
| 19 | - || has_action( 'AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save' ); |
|
| 20 | - if( $in_use ) { |
|
| 18 | + $in_use = has_filter('FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns') |
|
| 19 | + || has_action('AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save'); |
|
| 20 | + if ($in_use) { |
|
| 21 | 21 | $msg = __( |
| 22 | 22 | 'We detected you are using the filter FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns or AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save.' |
| 23 | 23 | . 'Both of these have been deprecated and should not be used anymore. You should instead use FHEE__EE_Form_Section_Proper___construct__options_array to customize the contents of the form,' |
@@ -26,18 +26,18 @@ discard block |
||
| 26 | 26 | 'event_espresso' ) |
| 27 | 27 | ; |
| 28 | 28 | EE_Error::doing_it_wrong( |
| 29 | - __CLASS__ . '::' . __FUNCTION__, |
|
| 29 | + __CLASS__.'::'.__FUNCTION__, |
|
| 30 | 30 | $msg, |
| 31 | 31 | '4.8.32.rc.000' |
| 32 | 32 | ); |
| 33 | 33 | //it seems the doing_it_wrong messages get output during some hidden html tags, so add an error to make sure this gets noticed |
| 34 | - if ( is_admin() && ! defined( 'DOING_AJAX' ) ) { |
|
| 35 | - EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 34 | + if (is_admin() && ! defined('DOING_AJAX')) { |
|
| 35 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | return $in_use; |
| 39 | 39 | } |
| 40 | -add_action( 'AHEE__Registrations_Admin_Page___registration_details_metabox__start', 'ee_deprecated_using_old_registration_admin_custom_questions_form_hooks' ); |
|
| 40 | +add_action('AHEE__Registrations_Admin_Page___registration_details_metabox__start', 'ee_deprecated_using_old_registration_admin_custom_questions_form_hooks'); |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * @deprecated since 4.8.32.rc.000 because it has issues on https://events.codebasehq.com/projects/event-espresso/tickets/9165 |
@@ -46,34 +46,34 @@ discard block |
||
| 46 | 46 | * @param EE_Admin_Page $admin_page |
| 47 | 47 | * @return void |
| 48 | 48 | */ |
| 49 | -function ee_deprecated_update_attendee_registration_form_old( $admin_page ) { |
|
| 49 | +function ee_deprecated_update_attendee_registration_form_old($admin_page) { |
|
| 50 | 50 | //check if the old hooks are in use. If not, do the default |
| 51 | - if( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() |
|
| 52 | - || ! $admin_page instanceof EE_Admin_Page ) { |
|
| 51 | + if ( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() |
|
| 52 | + || ! $admin_page instanceof EE_Admin_Page) { |
|
| 53 | 53 | return; |
| 54 | 54 | } |
| 55 | 55 | $req_data = $admin_page->get_request_data(); |
| 56 | - $qstns = isset( $req_data['qstn'] ) ? $req_data['qstn'] : FALSE; |
|
| 57 | - $REG_ID = isset( $req_data['_REG_ID'] ) ? absint( $req_data['_REG_ID'] ) : FALSE; |
|
| 58 | - $qstns = apply_filters( 'FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns ); |
|
| 59 | - if ( ! $REG_ID || ! $qstns ) { |
|
| 60 | - EE_Error::add_error( __('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 56 | + $qstns = isset($req_data['qstn']) ? $req_data['qstn'] : FALSE; |
|
| 57 | + $REG_ID = isset($req_data['_REG_ID']) ? absint($req_data['_REG_ID']) : FALSE; |
|
| 58 | + $qstns = apply_filters('FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns); |
|
| 59 | + if ( ! $REG_ID || ! $qstns) { |
|
| 60 | + EE_Error::add_error(__('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
| 61 | 61 | } |
| 62 | 62 | $success = TRUE; |
| 63 | 63 | |
| 64 | 64 | // allow others to get in on this awesome fun :D |
| 65 | - do_action( 'AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns ); |
|
| 65 | + do_action('AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns); |
|
| 66 | 66 | // loop thru questions... FINALLY!!! |
| 67 | 67 | |
| 68 | - foreach ( $qstns as $QST_ID => $qstn ) { |
|
| 68 | + foreach ($qstns as $QST_ID => $qstn) { |
|
| 69 | 69 | //if $qstn isn't an array then it doesn't already have an answer, so let's create the answer |
| 70 | - if ( !is_array($qstn) ) { |
|
| 71 | - $success = $this->_save_new_answer( $REG_ID, $QST_ID, $qstn); |
|
| 70 | + if ( ! is_array($qstn)) { |
|
| 71 | + $success = $this->_save_new_answer($REG_ID, $QST_ID, $qstn); |
|
| 72 | 72 | continue; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
| 76 | - foreach ( $qstn as $ANS_ID => $ANS_value ) { |
|
| 76 | + foreach ($qstn as $ANS_ID => $ANS_value) { |
|
| 77 | 77 | //get answer |
| 78 | 78 | $query_params = array( |
| 79 | 79 | 0 => array( |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | ); |
| 85 | 85 | $answer = EEM_Answer::instance()->get_one($query_params); |
| 86 | 86 | //this MAY be an array but NOT have an answer because its multi select. If so then we need to create the answer |
| 87 | - if ( ! $answer instanceof EE_Answer ) { |
|
| 87 | + if ( ! $answer instanceof EE_Answer) { |
|
| 88 | 88 | $set_values = array( |
| 89 | 89 | 'QST_ID' => $QST_ID, |
| 90 | 90 | 'REG_ID' => $REG_ID, |
@@ -99,11 +99,11 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | $what = __('Registration Form', 'event_espresso'); |
| 102 | - $route = $REG_ID ? array( 'action' => 'view_registration', '_REG_ID' => $REG_ID ) : array( 'action' => 'default' ); |
|
| 103 | - $admin_page->redirect_after_action( $success, $what, __('updated', 'event_espresso'), $route ); |
|
| 102 | + $route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default'); |
|
| 103 | + $admin_page->redirect_after_action($success, $what, __('updated', 'event_espresso'), $route); |
|
| 104 | 104 | exit; |
| 105 | 105 | } |
| 106 | -add_action( 'AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', 'ee_deprecated_update_attendee_registration_form_old', 10, 1 ); |
|
| 106 | +add_action('AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', 'ee_deprecated_update_attendee_registration_form_old', 10, 1); |
|
| 107 | 107 | /** |
| 108 | 108 | * Render the registration admin page's custom questions area in the old fashion |
| 109 | 109 | * and firing the old hooks. When this method is removed, we can probably also |
@@ -116,31 +116,31 @@ discard block |
||
| 116 | 116 | * @return bool |
| 117 | 117 | * @throws \EE_Error |
| 118 | 118 | */ |
| 119 | -function ee_deprecated_reg_questions_meta_box_old( $do_default_action, $admin_page, $registration ) { |
|
| 119 | +function ee_deprecated_reg_questions_meta_box_old($do_default_action, $admin_page, $registration) { |
|
| 120 | 120 | //check if the old hooks are in use. If not, do the default |
| 121 | - if( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() |
|
| 122 | - || ! $admin_page instanceof EE_Admin_Page ) { |
|
| 121 | + if ( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() |
|
| 122 | + || ! $admin_page instanceof EE_Admin_Page) { |
|
| 123 | 123 | return $do_default_action; |
| 124 | 124 | } |
| 125 | - add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array( $admin_page, 'form_before_question_group' ), 10, 1 ); |
|
| 126 | - add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', array( $admin_page, 'form_after_question_group' ), 10, 1 ); |
|
| 127 | - add_filter( 'FHEE__EEH_Form_Fields__label_html', array( $admin_page, 'form_form_field_label_wrap' ), 10, 1 ); |
|
| 128 | - add_filter( 'FHEE__EEH_Form_Fields__input_html', array( $admin_page, 'form_form_field_input__wrap' ), 10, 1 ); |
|
| 125 | + add_filter('FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array($admin_page, 'form_before_question_group'), 10, 1); |
|
| 126 | + add_filter('FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', array($admin_page, 'form_after_question_group'), 10, 1); |
|
| 127 | + add_filter('FHEE__EEH_Form_Fields__label_html', array($admin_page, 'form_form_field_label_wrap'), 10, 1); |
|
| 128 | + add_filter('FHEE__EEH_Form_Fields__input_html', array($admin_page, 'form_form_field_input__wrap'), 10, 1); |
|
| 129 | 129 | |
| 130 | - $question_groups = EEM_Event::instance()->assemble_array_of_groups_questions_and_options( $registration, $registration->get('EVT_ID') ); |
|
| 130 | + $question_groups = EEM_Event::instance()->assemble_array_of_groups_questions_and_options($registration, $registration->get('EVT_ID')); |
|
| 131 | 131 | |
| 132 | - EE_Registry::instance()->load_helper( 'Form_Fields' ); |
|
| 132 | + EE_Registry::instance()->load_helper('Form_Fields'); |
|
| 133 | 133 | $template_args = array( |
| 134 | - 'att_questions' => EEH_Form_Fields::generate_question_groups_html( $question_groups ), |
|
| 134 | + 'att_questions' => EEH_Form_Fields::generate_question_groups_html($question_groups), |
|
| 135 | 135 | 'reg_questions_form_action' => 'edit_registration', |
| 136 | 136 | 'REG_ID' => $registration->ID() |
| 137 | 137 | ); |
| 138 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_questions.template.php'; |
|
| 139 | - echo EEH_Template::display_template( $template_path, $template_args, TRUE ); |
|
| 138 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_questions.template.php'; |
|
| 139 | + echo EEH_Template::display_template($template_path, $template_args, TRUE); |
|
| 140 | 140 | //indicate that we should not do the default admin page code |
| 141 | 141 | return false; |
| 142 | 142 | } |
| 143 | -add_action( 'FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', 'ee_deprecated_reg_questions_meta_box_old', 10, 3 ); |
|
| 143 | +add_action('FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', 'ee_deprecated_reg_questions_meta_box_old', 10, 3); |
|
| 144 | 144 | |
| 145 | 145 | /** |
| 146 | 146 | * ee_deprecated__registration_checkout__button_text |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * @param \EE_Checkout $checkout |
| 150 | 150 | * @return string |
| 151 | 151 | */ |
| 152 | -function ee_deprecated__registration_checkout__button_text( $submit_button_text, EE_Checkout $checkout ) { |
|
| 152 | +function ee_deprecated__registration_checkout__button_text($submit_button_text, EE_Checkout $checkout) { |
|
| 153 | 153 | // list of old filters |
| 154 | 154 | $deprecated_filters = array( |
| 155 | 155 | 'update_registration_details' => true, |
@@ -159,16 +159,16 @@ discard block |
||
| 159 | 159 | 'proceed_to' => true, |
| 160 | 160 | ); |
| 161 | 161 | // loop thru and call doing_it_wrong() or remove any that aren't being used |
| 162 | - foreach ( $deprecated_filters as $deprecated_filter => $on ) { |
|
| 162 | + foreach ($deprecated_filters as $deprecated_filter => $on) { |
|
| 163 | 163 | // was this filter called ? |
| 164 | - if ( has_action( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter )) { |
|
| 164 | + if (has_action('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter)) { |
|
| 165 | 165 | // only display doing_it_wrong() notice to Event Admins during non-AJAX requests |
| 166 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_ee', 'hide_doing_it_wrong_for_deprecated_SPCO_filter' ) && ! defined( 'DOING_AJAX' ) ) { |
|
| 166 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_ee', 'hide_doing_it_wrong_for_deprecated_SPCO_filter') && ! defined('DOING_AJAX')) { |
|
| 167 | 167 | EE_Error::doing_it_wrong( |
| 168 | - 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter, |
|
| 168 | + 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter, |
|
| 169 | 169 | sprintf( |
| 170 | - __( 'The %1$s filter is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the following new filter: %2$s"%3$s" found in "%4$s"', 'event_espresso' ), |
|
| 171 | - 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter, |
|
| 170 | + __('The %1$s filter is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the following new filter: %2$s"%3$s" found in "%4$s"', 'event_espresso'), |
|
| 171 | + 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter, |
|
| 172 | 172 | '<br />', |
| 173 | 173 | 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', |
| 174 | 174 | '/modules/single_page_checkout/inc/EE_SPCO_Reg_Step.class.php' |
@@ -178,24 +178,24 @@ discard block |
||
| 178 | 178 | ); |
| 179 | 179 | } |
| 180 | 180 | } else { |
| 181 | - unset( $deprecated_filters[ $deprecated_filter ] ); |
|
| 181 | + unset($deprecated_filters[$deprecated_filter]); |
|
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | - if ( ! empty( $deprecated_filters )) { |
|
| 185 | - |
|
| 186 | - if ( $checkout->current_step->slug() == 'attendee_information' && $checkout->revisit && isset( $deprecated_filters[ 'update_registration_details' ] )) { |
|
| 187 | - $submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__update_registration_details', $submit_button_text ); |
|
| 188 | - } else if ( $checkout->current_step->slug() == 'payment_options' && $checkout->revisit && isset( $deprecated_filters[ 'process_payment' ] ) ) { |
|
| 189 | - $submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__process_payment', $submit_button_text ); |
|
| 190 | - } else if ( $checkout->next_step instanceof EE_SPCO_Reg_Step && $checkout->next_step->slug() == 'finalize_registration' && isset( $deprecated_filters[ 'finalize_registration' ] ) ) { |
|
| 191 | - $submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__finalize_registration', $submit_button_text ); |
|
| 184 | + if ( ! empty($deprecated_filters)) { |
|
| 185 | + |
|
| 186 | + if ($checkout->current_step->slug() == 'attendee_information' && $checkout->revisit && isset($deprecated_filters['update_registration_details'])) { |
|
| 187 | + $submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__update_registration_details', $submit_button_text); |
|
| 188 | + } else if ($checkout->current_step->slug() == 'payment_options' && $checkout->revisit && isset($deprecated_filters['process_payment'])) { |
|
| 189 | + $submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__process_payment', $submit_button_text); |
|
| 190 | + } else if ($checkout->next_step instanceof EE_SPCO_Reg_Step && $checkout->next_step->slug() == 'finalize_registration' && isset($deprecated_filters['finalize_registration'])) { |
|
| 191 | + $submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__finalize_registration', $submit_button_text); |
|
| 192 | 192 | } |
| 193 | - if ( $checkout->next_step instanceof EE_SPCO_Reg_Step ) { |
|
| 194 | - if ( $checkout->payment_required() && $checkout->next_step->slug() == 'payment_options' && isset( $deprecated_filters[ 'and_proceed_to_payment' ] ) ) { |
|
| 195 | - $submit_button_text .= apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__and_proceed_to_payment', $submit_button_text ); |
|
| 193 | + if ($checkout->next_step instanceof EE_SPCO_Reg_Step) { |
|
| 194 | + if ($checkout->payment_required() && $checkout->next_step->slug() == 'payment_options' && isset($deprecated_filters['and_proceed_to_payment'])) { |
|
| 195 | + $submit_button_text .= apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__and_proceed_to_payment', $submit_button_text); |
|
| 196 | 196 | } |
| 197 | - if ( $checkout->next_step->slug() != 'finalize_registration' && ! $checkout->revisit && isset( $deprecated_filters[ 'proceed_to' ] ) ) { |
|
| 198 | - $submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__proceed_to', $submit_button_text ) . $checkout->next_step->name(); |
|
| 197 | + if ($checkout->next_step->slug() != 'finalize_registration' && ! $checkout->revisit && isset($deprecated_filters['proceed_to'])) { |
|
| 198 | + $submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__proceed_to', $submit_button_text).$checkout->next_step->name(); |
|
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | return $submit_button_text; |
| 204 | 204 | |
| 205 | 205 | } |
| 206 | -add_filter( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_deprecated__registration_checkout__button_text', 10, 2 ); |
|
| 206 | +add_filter('FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_deprecated__registration_checkout__button_text', 10, 2); |
|
| 207 | 207 | |
| 208 | 208 | |
| 209 | 209 | |
@@ -214,16 +214,16 @@ discard block |
||
| 214 | 214 | * @param \EE_Checkout $checkout |
| 215 | 215 | * @param boolean $status_updates |
| 216 | 216 | */ |
| 217 | -function ee_deprecated_finalize_transaction( EE_Checkout $checkout, $status_updates ) { |
|
| 217 | +function ee_deprecated_finalize_transaction(EE_Checkout $checkout, $status_updates) { |
|
| 218 | 218 | $action_ref = NULL; |
| 219 | - $action_ref = has_action( 'AHEE__EE_Transaction__finalize__new_transaction' ) ? 'AHEE__EE_Transaction__finalize__new_transaction' : $action_ref; |
|
| 220 | - $action_ref = has_action( 'AHEE__EE_Transaction__finalize__all_transaction' ) ? 'AHEE__EE_Transaction__finalize__all_transaction' : $action_ref; |
|
| 221 | - if ( $action_ref ) { |
|
| 219 | + $action_ref = has_action('AHEE__EE_Transaction__finalize__new_transaction') ? 'AHEE__EE_Transaction__finalize__new_transaction' : $action_ref; |
|
| 220 | + $action_ref = has_action('AHEE__EE_Transaction__finalize__all_transaction') ? 'AHEE__EE_Transaction__finalize__all_transaction' : $action_ref; |
|
| 221 | + if ($action_ref) { |
|
| 222 | 222 | |
| 223 | 223 | EE_Error::doing_it_wrong( |
| 224 | 224 | $action_ref, |
| 225 | 225 | sprintf( |
| 226 | - __( 'This action is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use one of the following new actions: %1$s"%3$s" found in "%2$s" %1$s"%4$s" found in "%2$s" %1$s"%5$s" found in "%2$s" %1$s"%6$s" found in "%2$s"', 'event_espresso' ), |
|
| 226 | + __('This action is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use one of the following new actions: %1$s"%3$s" found in "%2$s" %1$s"%4$s" found in "%2$s" %1$s"%5$s" found in "%2$s" %1$s"%6$s" found in "%2$s"', 'event_espresso'), |
|
| 227 | 227 | '<br />', |
| 228 | 228 | '/core/business/EE_Transaction_Processor.class.php', |
| 229 | 229 | 'AHEE__EE_Transaction_Processor__finalize', |
@@ -234,29 +234,29 @@ discard block |
||
| 234 | 234 | '4.6.0', |
| 235 | 235 | E_USER_DEPRECATED |
| 236 | 236 | ); |
| 237 | - switch ( $action_ref ) { |
|
| 237 | + switch ($action_ref) { |
|
| 238 | 238 | case 'AHEE__EE_Transaction__finalize__new_transaction' : |
| 239 | - do_action( 'AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, $checkout->admin_request ); |
|
| 239 | + do_action('AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, $checkout->admin_request); |
|
| 240 | 240 | break; |
| 241 | 241 | case 'AHEE__EE_Transaction__finalize__all_transaction' : |
| 242 | - do_action( 'AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, array( 'new_reg' => ! $checkout->revisit, 'to_approved' => $status_updates ), $checkout->admin_request ); |
|
| 242 | + do_action('AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, array('new_reg' => ! $checkout->revisit, 'to_approved' => $status_updates), $checkout->admin_request); |
|
| 243 | 243 | break; |
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | -add_action( 'AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', 'ee_deprecated_finalize_transaction', 10, 2 ); |
|
| 247 | +add_action('AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', 'ee_deprecated_finalize_transaction', 10, 2); |
|
| 248 | 248 | /** |
| 249 | 249 | * ee_deprecated_finalize_registration |
| 250 | 250 | * |
| 251 | 251 | * @param EE_Registration $registration |
| 252 | 252 | */ |
| 253 | -function ee_deprecated_finalize_registration( EE_Registration $registration ) { |
|
| 254 | - $action_ref = has_action( 'AHEE__EE_Registration__finalize__update_and_new_reg' ) ? 'AHEE__EE_Registration__finalize__update_and_new_reg' : NULL; |
|
| 255 | - if ( $action_ref ) { |
|
| 253 | +function ee_deprecated_finalize_registration(EE_Registration $registration) { |
|
| 254 | + $action_ref = has_action('AHEE__EE_Registration__finalize__update_and_new_reg') ? 'AHEE__EE_Registration__finalize__update_and_new_reg' : NULL; |
|
| 255 | + if ($action_ref) { |
|
| 256 | 256 | EE_Error::doing_it_wrong( |
| 257 | 257 | $action_ref, |
| 258 | 258 | sprintf( |
| 259 | - __( 'This action is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the following new action: %1$s"%3$s" found in "%2$s"', 'event_espresso' ), |
|
| 259 | + __('This action is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the following new action: %1$s"%3$s" found in "%2$s"', 'event_espresso'), |
|
| 260 | 260 | '<br />', |
| 261 | 261 | '/core/business/EE_Registration_Processor.class.php', |
| 262 | 262 | 'AHEE__EE_Registration_Processor__trigger_registration_status_changed_hook' |
@@ -264,10 +264,10 @@ discard block |
||
| 264 | 264 | '4.6.0', |
| 265 | 265 | E_USER_DEPRECATED |
| 266 | 266 | ); |
| 267 | - do_action( 'AHEE__EE_Registration__finalize__update_and_new_reg', $registration, ( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ))); |
|
| 267 | + do_action('AHEE__EE_Registration__finalize__update_and_new_reg', $registration, (is_admin() && ! (defined('DOING_AJAX') && DOING_AJAX))); |
|
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | -add_action( 'AHEE__EE_Registration_Processor__trigger_registration_update_notifications', 'ee_deprecated_finalize_registration', 10, 1 ); |
|
| 270 | +add_action('AHEE__EE_Registration_Processor__trigger_registration_update_notifications', 'ee_deprecated_finalize_registration', 10, 1); |
|
| 271 | 271 | |
| 272 | 272 | |
| 273 | 273 | |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | * |
| 289 | 289 | * @return array |
| 290 | 290 | */ |
| 291 | -function ee_deprecated_get_templates( $templates, EE_messenger $messenger, EE_message_type $message_type, EE_Messages_Template_Pack $template_pack ) { |
|
| 291 | +function ee_deprecated_get_templates($templates, EE_messenger $messenger, EE_message_type $message_type, EE_Messages_Template_Pack $template_pack) { |
|
| 292 | 292 | $old_default_classnames = array( |
| 293 | 293 | 'EE_Messages_Email_Cancelled_Registration_Defaults', |
| 294 | 294 | 'EE_Messages_Email_Declined_Registration_Defaults', |
@@ -304,23 +304,23 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | $old_class_instance = new stdClass(); |
| 306 | 306 | |
| 307 | - foreach ( $old_default_classnames as $classname ) { |
|
| 308 | - $filter_ref = 'FHEE__' . $classname . '___create_new_templates___templates'; |
|
| 309 | - if ( has_filter( $filter_ref ) ) { |
|
| 310 | - EE_Error::doing_it_wrong( $filter_ref, __('This filter is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the new filter provided which is "FHEE__EE_Template_Pack___get_templates__templates" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0', E_USER_DEPRECATED ); |
|
| 307 | + foreach ($old_default_classnames as $classname) { |
|
| 308 | + $filter_ref = 'FHEE__'.$classname.'___create_new_templates___templates'; |
|
| 309 | + if (has_filter($filter_ref)) { |
|
| 310 | + EE_Error::doing_it_wrong($filter_ref, __('This filter is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the new filter provided which is "FHEE__EE_Template_Pack___get_templates__templates" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0', E_USER_DEPRECATED); |
|
| 311 | 311 | } |
| 312 | - $templates = apply_filters( $filter_ref, $templates, $old_class_instance ); |
|
| 312 | + $templates = apply_filters($filter_ref, $templates, $old_class_instance); |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | return $templates; |
| 316 | 316 | } |
| 317 | -add_filter( 'FHEE__EE_Template_Pack___get_templates__templates', 'ee_deprecated_get_templates', 10, 4 ); |
|
| 317 | +add_filter('FHEE__EE_Template_Pack___get_templates__templates', 'ee_deprecated_get_templates', 10, 4); |
|
| 318 | 318 | |
| 319 | 319 | /** |
| 320 | 320 | * Called after EED_Module::set_hooks() and EED_Module::set_admin_hooks() was called. |
| 321 | 321 | * Checks if any deprecated hooks were hooked-into and provide doing_it_wrong messages appropriately. |
| 322 | 322 | */ |
| 323 | -function ee_deprecated_hooks(){ |
|
| 323 | +function ee_deprecated_hooks() { |
|
| 324 | 324 | /** |
| 325 | 325 | * @var $hooks array where keys are hook names, and their values are array{ |
| 326 | 326 | * @type string $version when deprecated |
@@ -331,26 +331,26 @@ discard block |
||
| 331 | 331 | $hooks = array( |
| 332 | 332 | 'AHEE__EE_System___do_setup_validations' => array( |
| 333 | 333 | 'version' => '4.6.0', |
| 334 | - 'alternative' => __( 'Instead use "AHEE__EEH_Activation__validate_messages_system" which is called after validating messages (done on every new install, upgrade, reactivation, and downgrade)', 'event_espresso' ), |
|
| 334 | + 'alternative' => __('Instead use "AHEE__EEH_Activation__validate_messages_system" which is called after validating messages (done on every new install, upgrade, reactivation, and downgrade)', 'event_espresso'), |
|
| 335 | 335 | 'still_works' => FALSE |
| 336 | 336 | ) |
| 337 | 337 | ); |
| 338 | - foreach( $hooks as $name => $deprecation_info ){ |
|
| 339 | - if( has_action( $name ) ){ |
|
| 338 | + foreach ($hooks as $name => $deprecation_info) { |
|
| 339 | + if (has_action($name)) { |
|
| 340 | 340 | EE_Error::doing_it_wrong( |
| 341 | 341 | $name, |
| 342 | 342 | sprintf( |
| 343 | - __('This filter is deprecated. %1$s%2$s','event_espresso'), |
|
| 344 | - $deprecation_info[ 'still_works' ] ? __('It *may* work as an attempt to build in backwards compatibility.', 'event_espresso') : __( 'It has been completely removed.', 'event_espresso' ), |
|
| 345 | - isset( $deprecation_info[ 'alternative' ] ) ? $deprecation_info[ 'alternative' ] : __( 'Please read the current EE4 documentation further or contact Support.', 'event_espresso' ) |
|
| 343 | + __('This filter is deprecated. %1$s%2$s', 'event_espresso'), |
|
| 344 | + $deprecation_info['still_works'] ? __('It *may* work as an attempt to build in backwards compatibility.', 'event_espresso') : __('It has been completely removed.', 'event_espresso'), |
|
| 345 | + isset($deprecation_info['alternative']) ? $deprecation_info['alternative'] : __('Please read the current EE4 documentation further or contact Support.', 'event_espresso') |
|
| 346 | 346 | ), |
| 347 | - isset( $deprecation_info[ 'version' ] ) ? $deprecation_info[ 'version' ] : __( 'recently', 'event_espresso' ), |
|
| 347 | + isset($deprecation_info['version']) ? $deprecation_info['version'] : __('recently', 'event_espresso'), |
|
| 348 | 348 | E_USER_DEPRECATED |
| 349 | 349 | ); |
| 350 | 350 | } |
| 351 | 351 | } |
| 352 | 352 | } |
| 353 | -add_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', 'ee_deprecated_hooks' ); |
|
| 353 | +add_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', 'ee_deprecated_hooks'); |
|
| 354 | 354 | |
| 355 | 355 | |
| 356 | 356 | |
@@ -373,25 +373,25 @@ discard block |
||
| 373 | 373 | * |
| 374 | 374 | * @return string The default contents for the messenger, message type, context and field. |
| 375 | 375 | */ |
| 376 | -function ee_deprecated_get_default_field_content( $contents, $actual_path, EE_messenger $messenger, EE_message_type $message_type, $field, $context, EE_Messages_Template_Pack $template_pack ) { |
|
| 376 | +function ee_deprecated_get_default_field_content($contents, $actual_path, EE_messenger $messenger, EE_message_type $message_type, $field, $context, EE_Messages_Template_Pack $template_pack) { |
|
| 377 | 377 | |
| 378 | 378 | $classnames_to_try = array( |
| 379 | - get_class( $messenger ) => $messenger, |
|
| 380 | - get_class( $message_type ) => $message_type, |
|
| 379 | + get_class($messenger) => $messenger, |
|
| 380 | + get_class($message_type) => $message_type, |
|
| 381 | 381 | 'EE_Messages_Base' => $message_type |
| 382 | 382 | ); |
| 383 | 383 | |
| 384 | - foreach ( $classnames_to_try as $classname => $obj ) { |
|
| 385 | - $filter_ref = 'FHEE__' . $classname . '__get_default_field_content'; |
|
| 386 | - if ( has_filter( $filter_ref ) ) { |
|
| 387 | - EE_Error::doing_it_wrong( $filter_ref, __('This filter is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_specific_template__contents" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0', E_USER_DEPRECATED ); |
|
| 384 | + foreach ($classnames_to_try as $classname => $obj) { |
|
| 385 | + $filter_ref = 'FHEE__'.$classname.'__get_default_field_content'; |
|
| 386 | + if (has_filter($filter_ref)) { |
|
| 387 | + EE_Error::doing_it_wrong($filter_ref, __('This filter is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_specific_template__contents" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0', E_USER_DEPRECATED); |
|
| 388 | 388 | } |
| 389 | - $contents = apply_filters( $filter_ref, $contents, $obj ); |
|
| 389 | + $contents = apply_filters($filter_ref, $contents, $obj); |
|
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | return $contents; |
| 393 | 393 | } |
| 394 | -add_filter( 'FHEE__EE_Messages_Template_Pack__get_specific_template__contents', 'ee_deprecated_get_default_field_content', 10, 7 ); |
|
| 394 | +add_filter('FHEE__EE_Messages_Template_Pack__get_specific_template__contents', 'ee_deprecated_get_default_field_content', 10, 7); |
|
| 395 | 395 | |
| 396 | 396 | |
| 397 | 397 | |
@@ -419,23 +419,23 @@ discard block |
||
| 419 | 419 | * |
| 420 | 420 | * @return string The path to the file being used. |
| 421 | 421 | */ |
| 422 | -function ee_deprecated_get_inline_css_template_filters( $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack ) { |
|
| 422 | +function ee_deprecated_get_inline_css_template_filters($variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack) { |
|
| 423 | 423 | |
| 424 | - if ( $messenger == 'email' ) { |
|
| 424 | + if ($messenger == 'email') { |
|
| 425 | 425 | $filter_ref = $url ? 'FHEE__EE_Email_Messenger__get_inline_css_template__css_url' : 'FHEE__EE_Email_Messenger__get_inline_css_template__css_path'; |
| 426 | - } elseif ( $messenger == 'html' ) { |
|
| 426 | + } elseif ($messenger == 'html') { |
|
| 427 | 427 | $filter_ref = $url ? 'FHEE__EE_Html_messenger__get_inline_css_template__css_url' : 'FHEE__EE_Html_messenger__get_inline_css_template__css_path'; |
| 428 | 428 | } else { |
| 429 | 429 | return $variation_path; |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | - if ( has_filter( $filter_ref ) ) { |
|
| 433 | - EE_Error::doing_it_wrong( $filter_ref, __('This filter is deprecated. It is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_variation" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0', E_USER_DEPRECATED ); |
|
| 432 | + if (has_filter($filter_ref)) { |
|
| 433 | + EE_Error::doing_it_wrong($filter_ref, __('This filter is deprecated. It is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_variation" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0', E_USER_DEPRECATED); |
|
| 434 | 434 | } |
| 435 | 435 | |
| 436 | - return apply_filters( $filter_ref, $variation_path, $url, $type ); |
|
| 436 | + return apply_filters($filter_ref, $variation_path, $url, $type); |
|
| 437 | 437 | } |
| 438 | -add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', 'ee_deprecated_get_inline_css_template_filters', 10, 8 ); |
|
| 438 | +add_filter('FHEE__EE_Messages_Template_Pack__get_variation', 'ee_deprecated_get_inline_css_template_filters', 10, 8); |
|
| 439 | 439 | |
| 440 | 440 | |
| 441 | 441 | |
@@ -451,78 +451,78 @@ discard block |
||
| 451 | 451 | class EE_Messages_Init extends EE_Base { |
| 452 | 452 | |
| 453 | 453 | public function __construct() { |
| 454 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 454 | + self::doing_it_wrong_call(__METHOD__); |
|
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | /** |
| 458 | 458 | * @param $method_name |
| 459 | 459 | */ |
| 460 | - public static function doing_it_wrong_call( $method_name ) { |
|
| 461 | - EE_Error::doing_it_wrong( __CLASS__, sprintf( __('The %s in this class is deprecated as of EE4.5.0. All functionality formerly in this class is now in the EED_Messages module.', 'event_espresso'), $method_name ), '4.5.0', E_USER_DEPRECATED ); |
|
| 460 | + public static function doing_it_wrong_call($method_name) { |
|
| 461 | + EE_Error::doing_it_wrong(__CLASS__, sprintf(__('The %s in this class is deprecated as of EE4.5.0. All functionality formerly in this class is now in the EED_Messages module.', 'event_espresso'), $method_name), '4.5.0', E_USER_DEPRECATED); |
|
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | /** |
| 465 | 465 | * @deprecated 4.5.0 |
| 466 | 466 | */ |
| 467 | 467 | public static function set_autoloaders() { |
| 468 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 468 | + self::doing_it_wrong_call(__METHOD__); |
|
| 469 | 469 | EED_Messages::set_autoloaders(); |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | /** |
| 473 | 473 | * @deprecated 4.5.0 |
| 474 | 474 | */ |
| 475 | - public function payment_reminder( $transaction ) { |
|
| 476 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 477 | - EED_Messages::payment_reminder( $transaction ); |
|
| 475 | + public function payment_reminder($transaction) { |
|
| 476 | + self::doing_it_wrong_call(__METHOD__); |
|
| 477 | + EED_Messages::payment_reminder($transaction); |
|
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 | /** |
| 481 | 481 | * @deprecated 4.5.0 |
| 482 | 482 | */ |
| 483 | - public function payment( $transaction, $payment ) { |
|
| 484 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 485 | - EED_Messages::payment( $transaction, $payment ); |
|
| 483 | + public function payment($transaction, $payment) { |
|
| 484 | + self::doing_it_wrong_call(__METHOD__); |
|
| 485 | + EED_Messages::payment($transaction, $payment); |
|
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | /** |
| 489 | 489 | * @deprecated 4.5.0 |
| 490 | 490 | */ |
| 491 | - public function cancelled_registration( $transaction ) { |
|
| 492 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 493 | - EED_Messages::cancelled_registration( $transaction ); |
|
| 491 | + public function cancelled_registration($transaction) { |
|
| 492 | + self::doing_it_wrong_call(__METHOD__); |
|
| 493 | + EED_Messages::cancelled_registration($transaction); |
|
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | /** |
| 497 | 497 | * @deprecated 4.5.0 |
| 498 | 498 | */ |
| 499 | - public function maybe_registration( $transaction, $reg_msg, $from_admin ) { |
|
| 500 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 501 | - EED_Messages::maybe_registration( $transaction, $reg_msg, $from_admin ); |
|
| 499 | + public function maybe_registration($transaction, $reg_msg, $from_admin) { |
|
| 500 | + self::doing_it_wrong_call(__METHOD__); |
|
| 501 | + EED_Messages::maybe_registration($transaction, $reg_msg, $from_admin); |
|
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 504 | /** |
| 505 | 505 | * @deprecated 4.5.0 |
| 506 | 506 | */ |
| 507 | - public function process_resend( $success, $req_data ) { |
|
| 508 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 509 | - EED_Messages::process_resend( $req_data ); |
|
| 507 | + public function process_resend($success, $req_data) { |
|
| 508 | + self::doing_it_wrong_call(__METHOD__); |
|
| 509 | + EED_Messages::process_resend($req_data); |
|
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | /** |
| 513 | 513 | * @deprecated 4.5.0 |
| 514 | 514 | */ |
| 515 | - public function process_admin_payment( $success, $payment ) { |
|
| 516 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 517 | - EED_Messages::process_admin_payment( $success, $payment ); |
|
| 515 | + public function process_admin_payment($success, $payment) { |
|
| 516 | + self::doing_it_wrong_call(__METHOD__); |
|
| 517 | + EED_Messages::process_admin_payment($success, $payment); |
|
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | /** |
| 521 | 521 | * @deprecated 4.5.0 |
| 522 | 522 | */ |
| 523 | - public function send_newsletter_message( $contacts, $grp_id ) { |
|
| 524 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 525 | - EED_Messages::send_newsletter_message( $contacts, $grp_id ); |
|
| 523 | + public function send_newsletter_message($contacts, $grp_id) { |
|
| 524 | + self::doing_it_wrong_call(__METHOD__); |
|
| 525 | + EED_Messages::send_newsletter_message($contacts, $grp_id); |
|
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | |
@@ -543,13 +543,13 @@ discard block |
||
| 543 | 543 | * |
| 544 | 544 | * @return array additional cpts. |
| 545 | 545 | */ |
| 546 | -function ee_deprecated_get_cpts( $cpts ) { |
|
| 547 | - if ( has_filter( 'FHEE__EE_Register_CPTs__construct__CPTs' ) ) { |
|
| 548 | - EE_Error::doing_it_wrong( 'FHEE__EE_Register_CPTs__construct__CPTs', __('This filter is deprecated. It will still work for the time being. However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_CPTs__cpts" found in EE_Register_CPTs::get_CPTs()', 'event_espresso'), '4.5.0', E_USER_DEPRECATED ); |
|
| 546 | +function ee_deprecated_get_cpts($cpts) { |
|
| 547 | + if (has_filter('FHEE__EE_Register_CPTs__construct__CPTs')) { |
|
| 548 | + EE_Error::doing_it_wrong('FHEE__EE_Register_CPTs__construct__CPTs', __('This filter is deprecated. It will still work for the time being. However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_CPTs__cpts" found in EE_Register_CPTs::get_CPTs()', 'event_espresso'), '4.5.0', E_USER_DEPRECATED); |
|
| 549 | 549 | } |
| 550 | - return apply_filters( 'FHEE__EE_Register_CPTs__construct__CPTs', $cpts ); |
|
| 550 | + return apply_filters('FHEE__EE_Register_CPTs__construct__CPTs', $cpts); |
|
| 551 | 551 | } |
| 552 | -add_filter( 'FHEE__EE_Register_CPTs__get_CPTs__cpts', 'ee_deprecated_get_cpts', 10 ); |
|
| 552 | +add_filter('FHEE__EE_Register_CPTs__get_CPTs__cpts', 'ee_deprecated_get_cpts', 10); |
|
| 553 | 553 | |
| 554 | 554 | |
| 555 | 555 | |
@@ -563,10 +563,10 @@ discard block |
||
| 563 | 563 | * |
| 564 | 564 | * @return array additional custom taxonomies. |
| 565 | 565 | */ |
| 566 | -function ee_deprecated_get_taxonomies( $cts ) { |
|
| 567 | - if ( has_filter( 'FHEE__EE_Register_CPTs__construct__taxonomies' ) ) { |
|
| 568 | - EE_Error::doing_it_wrong( 'FHEE__EE_Register_CPTs__construct__taxonomies', __('This filter is deprecated. It will still work for the time being. However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_taxonomies__taxonomies" found in EE_Register_CPTs::get_taxonomies()', 'event_espresso'), '4.5.0', E_USER_DEPRECATED ); |
|
| 566 | +function ee_deprecated_get_taxonomies($cts) { |
|
| 567 | + if (has_filter('FHEE__EE_Register_CPTs__construct__taxonomies')) { |
|
| 568 | + EE_Error::doing_it_wrong('FHEE__EE_Register_CPTs__construct__taxonomies', __('This filter is deprecated. It will still work for the time being. However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_taxonomies__taxonomies" found in EE_Register_CPTs::get_taxonomies()', 'event_espresso'), '4.5.0', E_USER_DEPRECATED); |
|
| 569 | 569 | } |
| 570 | - return apply_filters( 'FHEE__EE_Register_CPTs__construct__taxonomies', $cts ); |
|
| 570 | + return apply_filters('FHEE__EE_Register_CPTs__construct__taxonomies', $cts); |
|
| 571 | 571 | } |
| 572 | -add_filter( 'FHEE__EE_Register_CPTs__get_taxonomies__taxonomies', 'ee_deprecated_get_taxonomies', 10 ); |
|
| 572 | +add_filter('FHEE__EE_Register_CPTs__get_taxonomies__taxonomies', 'ee_deprecated_get_taxonomies', 10); |
|