@@ -16,13 +16,13 @@ discard block |
||
| 16 | 16 | //(all other times it gets resurrected from a wordpress option) |
| 17 | 17 | $stages = glob(EE_CORE.'data_migration_scripts/4_8_0_stages/*'); |
| 18 | 18 | $class_to_filepath = array(); |
| 19 | -foreach($stages as $filepath){ |
|
| 19 | +foreach ($stages as $filepath) { |
|
| 20 | 20 | $matches = array(); |
| 21 | - preg_match('~4_8_0_stages/(.*).dmsstage.php~',$filepath,$matches); |
|
| 21 | + preg_match('~4_8_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
| 22 | 22 | $class_to_filepath[$matches[1]] = $filepath; |
| 23 | 23 | } |
| 24 | 24 | //give addons a chance to autoload their stages too |
| 25 | -$class_to_filepath = apply_filters('FHEE__EE_DMS_4_8_0__autoloaded_stages',$class_to_filepath); |
|
| 25 | +$class_to_filepath = apply_filters('FHEE__EE_DMS_4_8_0__autoloaded_stages', $class_to_filepath); |
|
| 26 | 26 | EEH_Autoloader::register_autoloader($class_to_filepath); |
| 27 | 27 | |
| 28 | 28 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * @since 4.6.0 |
| 39 | 39 | * |
| 40 | 40 | */ |
| 41 | -class EE_DMS_Core_4_8_0 extends EE_Data_Migration_Script_Base{ |
|
| 41 | +class EE_DMS_Core_4_8_0 extends EE_Data_Migration_Script_Base { |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * return EE_DMS_Core_4_8_0 |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | * @param TableManager $table_manager |
| 47 | 47 | * @param TableAnalysis $table_analysis |
| 48 | 48 | */ |
| 49 | - public function __construct( TableManager $table_manager = null, TableAnalysis $table_analysis = null ) { |
|
| 49 | + public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) { |
|
| 50 | 50 | $this->_pretty_name = __("Data Migration to Event Espresso 4.8.0.P (for promotions)", "event_espresso"); |
| 51 | 51 | $this->_priority = 10; |
| 52 | 52 | $this->_migration_stages = array( |
| 53 | 53 | new EE_DMS_4_8_0_pretax_totals(), |
| 54 | 54 | new EE_DMS_4_8_0_event_subtotals(), |
| 55 | 55 | ); |
| 56 | - parent::__construct( $table_manager, $table_analysis ); |
|
| 56 | + parent::__construct($table_manager, $table_analysis); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
@@ -68,14 +68,14 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function can_migrate_from_version($version_array) { |
| 70 | 70 | $version_string = $version_array['Core']; |
| 71 | - if ( version_compare( $version_string, '4.8.0', '<=' ) && version_compare( $version_string, '4.7.0', '>=' ) ) { |
|
| 71 | + if (version_compare($version_string, '4.8.0', '<=') && version_compare($version_string, '4.7.0', '>=')) { |
|
| 72 | 72 | // echo "$version_string can be migrated from"; |
| 73 | 73 | return true; |
| 74 | - }elseif( ! $version_string ){ |
|
| 74 | + }elseif ( ! $version_string) { |
|
| 75 | 75 | // echo "no version string provided: $version_string"; |
| 76 | 76 | //no version string provided... this must be pre 4.3 |
| 77 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 78 | - }else{ |
|
| 77 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
| 78 | + } else { |
|
| 79 | 79 | // echo "$version_string doesnt apply"; |
| 80 | 80 | return false; |
| 81 | 81 | } |
@@ -96,19 +96,19 @@ discard block |
||
| 96 | 96 | * @return bool |
| 97 | 97 | */ |
| 98 | 98 | public function schema_changes_before_migration() { |
| 99 | - require_once( EE_HELPERS . 'EEH_Activation.helper.php' ); |
|
| 100 | - $now_in_mysql = current_time( 'mysql', true ); |
|
| 99 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
| 100 | + $now_in_mysql = current_time('mysql', true); |
|
| 101 | 101 | |
| 102 | - require_once( EE_HELPERS . 'EEH_Activation.helper.php' ); |
|
| 103 | - $table_name='esp_answer'; |
|
| 104 | - $sql=" ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 102 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
| 103 | + $table_name = 'esp_answer'; |
|
| 104 | + $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 105 | 105 | REG_ID int(10) unsigned NOT NULL, |
| 106 | 106 | QST_ID int(10) unsigned NOT NULL, |
| 107 | 107 | ANS_value text NOT NULL, |
| 108 | 108 | PRIMARY KEY (ANS_ID), |
| 109 | 109 | KEY REG_ID (REG_ID), |
| 110 | 110 | KEY QST_ID (QST_ID)"; |
| 111 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 111 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 112 | 112 | |
| 113 | 113 | $table_name = 'esp_attendee_meta'; |
| 114 | 114 | $sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | CNT_is_EU tinyint(1) DEFAULT '0', |
| 149 | 149 | CNT_active tinyint(1) DEFAULT '0', |
| 150 | 150 | PRIMARY KEY (CNT_ISO)"; |
| 151 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 151 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 152 | 152 | |
| 153 | 153 | $table_name = 'esp_currency'; |
| 154 | 154 | $sql = "CUR_code varchar(6) collate utf8_bin NOT NULL, |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | CUR_dec_plc varchar(1) collate utf8_bin NOT NULL DEFAULT '2', |
| 159 | 159 | CUR_active tinyint(1) DEFAULT '0', |
| 160 | 160 | PRIMARY KEY (CUR_code)"; |
| 161 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 161 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 162 | 162 | |
| 163 | 163 | |
| 164 | 164 | $table_name = 'esp_currency_payment_method'; |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | KEY EVT_ID (EVT_ID), |
| 189 | 189 | KEY DTT_is_primary (DTT_is_primary)"; |
| 190 | 190 | |
| 191 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 191 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 192 | 192 | |
| 193 | 193 | $table_name = 'esp_event_meta'; |
| 194 | 194 | $sql = " |
@@ -207,41 +207,41 @@ discard block |
||
| 207 | 207 | EVT_donations tinyint(1) NULL, |
| 208 | 208 | PRIMARY KEY (EVTM_ID), |
| 209 | 209 | KEY EVT_ID (EVT_ID)"; |
| 210 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 210 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 211 | 211 | |
| 212 | 212 | |
| 213 | 213 | |
| 214 | - $table_name='esp_event_question_group'; |
|
| 215 | - $sql="EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 214 | + $table_name = 'esp_event_question_group'; |
|
| 215 | + $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 216 | 216 | EVT_ID bigint(20) unsigned NOT NULL, |
| 217 | 217 | QSG_ID int(10) unsigned NOT NULL, |
| 218 | 218 | EQG_primary tinyint(1) unsigned NOT NULL DEFAULT 0, |
| 219 | 219 | PRIMARY KEY (EQG_ID), |
| 220 | 220 | KEY EVT_ID (EVT_ID), |
| 221 | 221 | KEY QSG_ID (QSG_ID)"; |
| 222 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 222 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 223 | 223 | |
| 224 | 224 | |
| 225 | 225 | |
| 226 | - $table_name='esp_event_venue'; |
|
| 227 | - $sql="EVV_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 226 | + $table_name = 'esp_event_venue'; |
|
| 227 | + $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 228 | 228 | EVT_ID bigint(20) unsigned NOT NULL, |
| 229 | 229 | VNU_ID bigint(20) unsigned NOT NULL, |
| 230 | 230 | EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0, |
| 231 | 231 | PRIMARY KEY (EVV_ID)"; |
| 232 | - $this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 232 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 233 | 233 | |
| 234 | 234 | |
| 235 | 235 | |
| 236 | - $table_name='esp_extra_meta'; |
|
| 237 | - $sql="EXM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 236 | + $table_name = 'esp_extra_meta'; |
|
| 237 | + $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 238 | 238 | OBJ_ID int(11) DEFAULT NULL, |
| 239 | 239 | EXM_type varchar(45) DEFAULT NULL, |
| 240 | 240 | EXM_key varchar(45) DEFAULT NULL, |
| 241 | 241 | EXM_value text, |
| 242 | 242 | PRIMARY KEY (EXM_ID), |
| 243 | 243 | KEY EXM_type (EXM_type,OBJ_ID,EXM_key)"; |
| 244 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 244 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 245 | 245 | |
| 246 | 246 | $table_name = 'esp_extra_join'; |
| 247 | 247 | $sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT, |
@@ -254,8 +254,8 @@ discard block |
||
| 254 | 254 | KEY second_model (EXJ_second_model_name,EXJ_second_model_id)"; |
| 255 | 255 | $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
| 256 | 256 | |
| 257 | - $table_name='esp_line_item'; |
|
| 258 | - $sql="LIN_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 257 | + $table_name = 'esp_line_item'; |
|
| 258 | + $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 259 | 259 | LIN_code varchar(245) NOT NULL DEFAULT '', |
| 260 | 260 | TXN_ID int(11) DEFAULT NULL, |
| 261 | 261 | LIN_name varchar(245) NOT NULL DEFAULT '', |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | PRIMARY KEY (LIN_ID), |
| 275 | 275 | KEY LIN_code (LIN_code(191)), |
| 276 | 276 | KEY TXN_ID (TXN_ID)"; |
| 277 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB' ); |
|
| 277 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 278 | 278 | |
| 279 | 279 | $table_name = 'esp_log'; |
| 280 | 280 | $sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT, |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | MTP_is_active tinyint(1) NOT NULL DEFAULT '1', |
| 314 | 314 | PRIMARY KEY (GRP_ID), |
| 315 | 315 | KEY MTP_user_id (MTP_user_id)"; |
| 316 | - $this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB'); |
|
| 316 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 317 | 317 | |
| 318 | 318 | $table_name = 'esp_event_message_template'; |
| 319 | 319 | $sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | PRIMARY KEY (EMT_ID), |
| 323 | 323 | KEY EVT_ID (EVT_ID), |
| 324 | 324 | KEY GRP_ID (GRP_ID)"; |
| 325 | - $this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB'); |
|
| 325 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 326 | 326 | |
| 327 | 327 | |
| 328 | 328 | $table_name = 'esp_payment'; |
@@ -395,8 +395,8 @@ discard block |
||
| 395 | 395 | PRIMARY KEY (TTM_ID)"; |
| 396 | 396 | $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
| 397 | 397 | |
| 398 | - $table_name='esp_question'; |
|
| 399 | - $sql='QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 398 | + $table_name = 'esp_question'; |
|
| 399 | + $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 400 | 400 | QST_display_text text NOT NULL, |
| 401 | 401 | QST_admin_label varchar(255) NOT NULL, |
| 402 | 402 | QST_system varchar(25) NOT NULL DEFAULT "", |
@@ -410,22 +410,22 @@ discard block |
||
| 410 | 410 | QST_deleted tinyint(2) unsigned NOT NULL DEFAULT 0, |
| 411 | 411 | PRIMARY KEY (QST_ID), |
| 412 | 412 | KEY QST_order (QST_order)'; |
| 413 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 413 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 414 | 414 | |
| 415 | - $table_name='esp_question_group_question'; |
|
| 416 | - $sql="QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 415 | + $table_name = 'esp_question_group_question'; |
|
| 416 | + $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 417 | 417 | QSG_ID int(10) unsigned NOT NULL, |
| 418 | 418 | QST_ID int(10) unsigned NOT NULL, |
| 419 | 419 | QGQ_order int(10) unsigned NOT NULL DEFAULT 0, |
| 420 | 420 | PRIMARY KEY (QGQ_ID), |
| 421 | 421 | KEY QST_ID (QST_ID), |
| 422 | 422 | KEY QSG_ID_order (QSG_ID,QGQ_order)"; |
| 423 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 423 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 424 | 424 | |
| 425 | 425 | |
| 426 | 426 | |
| 427 | - $table_name='esp_question_option'; |
|
| 428 | - $sql="QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 427 | + $table_name = 'esp_question_option'; |
|
| 428 | + $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 429 | 429 | QSO_value varchar(255) NOT NULL, |
| 430 | 430 | QSO_desc text NOT NULL, |
| 431 | 431 | QST_ID int(10) unsigned NOT NULL, |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | PRIMARY KEY (QSO_ID), |
| 436 | 436 | KEY QST_ID (QST_ID), |
| 437 | 437 | KEY QSO_order (QSO_order)"; |
| 438 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 438 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 439 | 439 | |
| 440 | 440 | |
| 441 | 441 | |
@@ -481,8 +481,8 @@ discard block |
||
| 481 | 481 | |
| 482 | 482 | |
| 483 | 483 | |
| 484 | - $table_name='esp_checkin'; |
|
| 485 | - $sql="CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 484 | + $table_name = 'esp_checkin'; |
|
| 485 | + $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 486 | 486 | REG_ID int(10) unsigned NOT NULL, |
| 487 | 487 | DTT_ID int(10) unsigned NOT NULL, |
| 488 | 488 | CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1, |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | PRC_parent int(10) unsigned DEFAULT 0, |
| 578 | 578 | PRIMARY KEY (PRC_ID), |
| 579 | 579 | KEY PRT_ID (PRT_ID)"; |
| 580 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
| 580 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 581 | 581 | |
| 582 | 582 | $table_name = "esp_price_type"; |
| 583 | 583 | $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT, |
@@ -615,10 +615,10 @@ discard block |
||
| 615 | 615 | TKT_deleted tinyint(1) NOT NULL DEFAULT '0', |
| 616 | 616 | PRIMARY KEY (TKT_ID), |
| 617 | 617 | KEY TKT_start_date (TKT_start_date)"; |
| 618 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 618 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 619 | 619 | |
| 620 | 620 | $table_name = 'esp_question_group'; |
| 621 | - $sql='QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 621 | + $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 622 | 622 | QSG_name varchar(255) NOT NULL, |
| 623 | 623 | QSG_identifier varchar(100) NOT NULL, |
| 624 | 624 | QSG_desc text NULL, |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | PRIMARY KEY (QSG_ID), |
| 632 | 632 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier), |
| 633 | 633 | KEY QSG_order (QSG_order)'; |
| 634 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' ); |
|
| 634 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 635 | 635 | |
| 636 | 636 | /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
| 637 | 637 | $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | return $script_4_7_defaults->schema_changes_after_migration(); |
| 668 | 668 | } |
| 669 | 669 | |
| 670 | - public function migration_page_hooks(){ |
|
| 670 | + public function migration_page_hooks() { |
|
| 671 | 671 | |
| 672 | 672 | } |
| 673 | 673 | |
@@ -681,31 +681,31 @@ discard block |
||
| 681 | 681 | //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 |
| 682 | 682 | //('AD', 'AND', 0, 'Andorra', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+376', 0, 0), |
| 683 | 683 | $newer_countries = array( |
| 684 | - array( 'AX', 'ALA', 0, 'Åland Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0 ), |
|
| 685 | - array( 'BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0 ), |
|
| 686 | - array( 'CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0 ), |
|
| 687 | - array( 'GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0 ), |
|
| 688 | - array( 'IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0 ), |
|
| 689 | - array( 'JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0 ), |
|
| 690 | - array( 'MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0 ), |
|
| 691 | - array( 'ME', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+382', 0, 0 ), |
|
| 692 | - array( 'RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+381', 1, 0 ), |
|
| 693 | - array( 'SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0 ), |
|
| 694 | - array( 'SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0 ), |
|
| 695 | - array( 'XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+383', 0, 0 ), |
|
| 696 | - array( 'YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0 ), |
|
| 697 | - array( 'BQ', 'BES', 0, 'Bonaire, Saint Eustatius and Saba', 'USD', 'Dollar', 'Dollars', '$', 1, 2, '+599', 0, 0 ), |
|
| 698 | - array( 'BV', 'BVT', 0, 'Bouvet Island', 'NOK', 'Krone', 'Krones', 'kr', 1, 2, '+47', 0, 0 ), |
|
| 699 | - array( 'IO', 'IOT', 0, 'British Indian Ocean Territory', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+246', 0, 0 ), |
|
| 700 | - array( 'CX', 'CXR', 0, 'Christmas Island', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+61', 0, 0 ), |
|
| 701 | - array( 'CC', 'CCK', 0, 'Cocos (Keeling) Islands', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+891', 0, 0 ), |
|
| 702 | - array( 'HM', 'HMD', 0, 'Heard Island and McDonald Islands', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+891', 0, 0 ), |
|
| 703 | - array( 'PS', 'PSE', 0, 'Palestinian Territory', 'ILS', 'Shekel', 'Shekels', '₪', 1, 2, '+970', 0, 0 ), |
|
| 704 | - array( 'GS', 'SGS', 0, 'South Georgia and the South Sandwich Islands', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+500', 0, 0 ), |
|
| 705 | - array( 'TL', 'TLS', 0, 'Timor-Leste', 'USD', 'Dollar', 'Dollars', '$', 1, 2, '+670', 0, 0 ), |
|
| 706 | - array( 'TF', 'ATF', 0, 'French Southern Territories', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+262', 0, 0 ), |
|
| 707 | - |
|
| 708 | - array( 'UM', 'UMI', 0, 'United States Minor Outlying Islands', 'USD', 'Dollar', 'Dollars', '$', 1, 2, '+1', 0, 0 ), |
|
| 684 | + array('AX', 'ALA', 0, 'Åland Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0), |
|
| 685 | + array('BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0), |
|
| 686 | + array('CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0), |
|
| 687 | + array('GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0), |
|
| 688 | + array('IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0), |
|
| 689 | + array('JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0), |
|
| 690 | + array('MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0), |
|
| 691 | + array('ME', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+382', 0, 0), |
|
| 692 | + array('RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+381', 1, 0), |
|
| 693 | + array('SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0), |
|
| 694 | + array('SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0), |
|
| 695 | + array('XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+383', 0, 0), |
|
| 696 | + array('YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0), |
|
| 697 | + array('BQ', 'BES', 0, 'Bonaire, Saint Eustatius and Saba', 'USD', 'Dollar', 'Dollars', '$', 1, 2, '+599', 0, 0), |
|
| 698 | + array('BV', 'BVT', 0, 'Bouvet Island', 'NOK', 'Krone', 'Krones', 'kr', 1, 2, '+47', 0, 0), |
|
| 699 | + array('IO', 'IOT', 0, 'British Indian Ocean Territory', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+246', 0, 0), |
|
| 700 | + array('CX', 'CXR', 0, 'Christmas Island', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+61', 0, 0), |
|
| 701 | + array('CC', 'CCK', 0, 'Cocos (Keeling) Islands', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+891', 0, 0), |
|
| 702 | + array('HM', 'HMD', 0, 'Heard Island and McDonald Islands', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+891', 0, 0), |
|
| 703 | + array('PS', 'PSE', 0, 'Palestinian Territory', 'ILS', 'Shekel', 'Shekels', '₪', 1, 2, '+970', 0, 0), |
|
| 704 | + array('GS', 'SGS', 0, 'South Georgia and the South Sandwich Islands', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+500', 0, 0), |
|
| 705 | + array('TL', 'TLS', 0, 'Timor-Leste', 'USD', 'Dollar', 'Dollars', '$', 1, 2, '+670', 0, 0), |
|
| 706 | + array('TF', 'ATF', 0, 'French Southern Territories', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+262', 0, 0), |
|
| 707 | + |
|
| 708 | + array('UM', 'UMI', 0, 'United States Minor Outlying Islands', 'USD', 'Dollar', 'Dollars', '$', 1, 2, '+1', 0, 0), |
|
| 709 | 709 | ); |
| 710 | 710 | global $wpdb; |
| 711 | 711 | $country_table = $wpdb->prefix."esp_country"; |
@@ -724,14 +724,14 @@ discard block |
||
| 724 | 724 | "CNT_is_EU" => '%d', |
| 725 | 725 | "CNT_active" => '%d', |
| 726 | 726 | ); |
| 727 | - if ( $this->_get_table_analysis()->tableExists( $country_table ) ) { |
|
| 728 | - foreach( $newer_countries as $country ) { |
|
| 729 | - $SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1" ; |
|
| 727 | + if ($this->_get_table_analysis()->tableExists($country_table)) { |
|
| 728 | + foreach ($newer_countries as $country) { |
|
| 729 | + $SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1"; |
|
| 730 | 730 | $countries = $wpdb->get_var($SQL); |
| 731 | - if ( ! $countries ) { |
|
| 731 | + if ( ! $countries) { |
|
| 732 | 732 | |
| 733 | - $wpdb->insert( $country_table, |
|
| 734 | - array_combine( array_keys( $country_format), $country ), |
|
| 733 | + $wpdb->insert($country_table, |
|
| 734 | + array_combine(array_keys($country_format), $country), |
|
| 735 | 735 | $country_format |
| 736 | 736 | ); |
| 737 | 737 | } |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | // CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active |
| 750 | 750 | //( 'EUR', 'Euro', 'Euros', '€', 2,1), |
| 751 | 751 | $newer_currencies = array( |
| 752 | - array( 'RSD', 'Dinar', 'Dinars', '', 3, 1 ), |
|
| 752 | + array('RSD', 'Dinar', 'Dinars', '', 3, 1), |
|
| 753 | 753 | ); |
| 754 | 754 | global $wpdb; |
| 755 | 755 | $currency_table = $wpdb->prefix."esp_currency"; |
@@ -761,14 +761,14 @@ discard block |
||
| 761 | 761 | "CUR_dec_plc" => '%d', |
| 762 | 762 | "CUR_active" => '%d', |
| 763 | 763 | ); |
| 764 | - if ( $this->_get_table_analysis()->tableExists( $currency_table ) ) { |
|
| 765 | - foreach( $newer_currencies as $currency ) { |
|
| 766 | - $SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1" ; |
|
| 764 | + if ($this->_get_table_analysis()->tableExists($currency_table)) { |
|
| 765 | + foreach ($newer_currencies as $currency) { |
|
| 766 | + $SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1"; |
|
| 767 | 767 | $countries = $wpdb->get_var($SQL); |
| 768 | - if ( ! $countries ) { |
|
| 768 | + if ( ! $countries) { |
|
| 769 | 769 | |
| 770 | - $wpdb->insert( $currency_table, |
|
| 771 | - array_combine( array_keys( $currency_format), $currency ), |
|
| 770 | + $wpdb->insert($currency_table, |
|
| 771 | + array_combine(array_keys($currency_format), $currency), |
|
| 772 | 772 | $currency_format |
| 773 | 773 | ); |
| 774 | 774 | } |
@@ -780,9 +780,9 @@ discard block |
||
| 780 | 780 | * which should just be a temporary issue for folks who installed 4.8.0-4.8.5; |
| 781 | 781 | * we should be able to stop doing this in 4.9 |
| 782 | 782 | */ |
| 783 | - public function fix_non_default_taxes(){ |
|
| 783 | + public function fix_non_default_taxes() { |
|
| 784 | 784 | global $wpdb; |
| 785 | - $query = $wpdb->prepare( "UPDATE |
|
| 785 | + $query = $wpdb->prepare("UPDATE |
|
| 786 | 786 | {$wpdb->prefix}esp_price p INNER JOIN |
| 787 | 787 | {$wpdb->prefix}esp_price_type pt ON p.PRT_ID = pt.PRT_ID |
| 788 | 788 | SET |
@@ -790,7 +790,7 @@ discard block |
||
| 790 | 790 | WHERE |
| 791 | 791 | p.PRC_is_default = 0 AND |
| 792 | 792 | pt.PBT_ID = %d |
| 793 | - ", EEM_Price_Type::base_type_tax ); |
|
| 794 | - $wpdb->query( $query ); |
|
| 793 | + ", EEM_Price_Type::base_type_tax); |
|
| 794 | + $wpdb->query($query); |
|
| 795 | 795 | } |
| 796 | 796 | } |
@@ -8,18 +8,18 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | $row = 1; |
| 10 | 10 | $max = 1; |
| 11 | -$ticket_count = count( $tickets ); |
|
| 11 | +$ticket_count = count($tickets); |
|
| 12 | 12 | |
| 13 | -if ( ! $ticket_count ) { |
|
| 13 | +if ( ! $ticket_count) { |
|
| 14 | 14 | return; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | $required_ticket_sold_out = FALSE; |
| 18 | -$template_settings = isset ( EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector ) |
|
| 18 | +$template_settings = isset (EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector) |
|
| 19 | 19 | ? EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector |
| 20 | 20 | : new EE_Ticket_Selector_Config(); |
| 21 | 21 | |
| 22 | -$tax_settings = isset ( EE_Registry::instance()->CFG->tax_settings ) |
|
| 22 | +$tax_settings = isset (EE_Registry::instance()->CFG->tax_settings) |
|
| 23 | 23 | ? EE_Registry::instance()->CFG->tax_settings |
| 24 | 24 | : new EE_Tax_Config(); |
| 25 | 25 | |
@@ -28,21 +28,21 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | ob_start(); |
| 30 | 30 | |
| 31 | -foreach ( $tickets as $TKT_ID => $ticket ) { |
|
| 32 | - if ( $ticket instanceof EE_Ticket ) { |
|
| 31 | +foreach ($tickets as $TKT_ID => $ticket) { |
|
| 32 | + if ($ticket instanceof EE_Ticket) { |
|
| 33 | 33 | $max = $ticket->max(); |
| 34 | 34 | $min = 0; |
| 35 | 35 | $remaining = $ticket->remaining(); |
| 36 | - if ( $ticket->is_on_sale() && $ticket->is_remaining() ) { |
|
| 36 | + if ($ticket->is_on_sale() && $ticket->is_remaining()) { |
|
| 37 | 37 | // offer the number of $tickets_remaining or $max_atndz, whichever is smaller |
| 38 | - $max = min( $remaining, $max_atndz ); |
|
| 38 | + $max = min($remaining, $max_atndz); |
|
| 39 | 39 | // but... we also want to restrict the number of tickets by the ticket max setting, |
| 40 | 40 | // however, the max still can't be higher than what was just set above |
| 41 | - $max = $ticket->max() > 0 ? min( $ticket->max(), $max ) : $max; |
|
| 41 | + $max = $ticket->max() > 0 ? min($ticket->max(), $max) : $max; |
|
| 42 | 42 | // and we also want to restrict the minimum number of tickets by the ticket min setting |
| 43 | 43 | $min = $ticket->min() > 0 ? $ticket->min() : 0; |
| 44 | 44 | // and if the ticket is required, then make sure that min qty is at least 1 |
| 45 | - $min = $ticket->required() ? max( $min, 1 ) : $min; |
|
| 45 | + $min = $ticket->required() ? max($min, 1) : $min; |
|
| 46 | 46 | } else { |
| 47 | 47 | // set flag if ticket is required (flag is set to start date so that future tickets are not blocked) |
| 48 | 48 | $required_ticket_sold_out = $ticket->required() && ! $remaining ? $ticket->start_date() : $required_ticket_sold_out; |
@@ -54,41 +54,41 @@ discard block |
||
| 54 | 54 | $taxable_tickets = $ticket->taxable() ? true : $taxable_tickets; |
| 55 | 55 | $ticket_bundle = FALSE; |
| 56 | 56 | // for ticket bundles, set min and max qty the same |
| 57 | - if ( $ticket->min() != 0 && $ticket->min() == $ticket->max() ) { |
|
| 57 | + if ($ticket->min() != 0 && $ticket->min() == $ticket->max()) { |
|
| 58 | 58 | $ticket_price = $ticket_price * $ticket->min(); |
| 59 | 59 | $ticket_bundle = TRUE; |
| 60 | 60 | } |
| 61 | - $ticket_price = apply_filters( 'FHEE__ticket_selector_chart_template__ticket_price', $ticket_price, $ticket ); |
|
| 61 | + $ticket_price = apply_filters('FHEE__ticket_selector_chart_template__ticket_price', $ticket_price, $ticket); |
|
| 62 | 62 | // if a previous required ticket with the same sale start date is sold out, then mark this ticket as sold out as well. |
| 63 | 63 | // tickets that go on sale at a later date than the required ticket will NOT be affected |
| 64 | 64 | $tkt_status = $required_ticket_sold_out !== FALSE && $required_ticket_sold_out === $ticket->start_date() ? EE_Ticket::sold_out : $ticket->ticket_status(); |
| 65 | 65 | $tkt_status = $event_status === EE_Datetime::sold_out ? EE_Ticket::sold_out : $tkt_status; |
| 66 | 66 | // check ticket status |
| 67 | - switch ( $tkt_status ) { |
|
| 67 | + switch ($tkt_status) { |
|
| 68 | 68 | // sold_out |
| 69 | 69 | case EE_Ticket::sold_out : |
| 70 | - $ticket_status = '<span class="ticket-sales-sold-out">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
| 70 | + $ticket_status = '<span class="ticket-sales-sold-out">'.$ticket->ticket_status(TRUE).'</span>'; |
|
| 71 | 71 | $status_class = 'ticket-sales-sold-out lt-grey-text'; |
| 72 | 72 | break; |
| 73 | 73 | // expired |
| 74 | 74 | case EE_Ticket::expired : |
| 75 | - $ticket_status = '<span class="ticket-sales-expired">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
| 75 | + $ticket_status = '<span class="ticket-sales-expired">'.$ticket->ticket_status(TRUE).'</span>'; |
|
| 76 | 76 | $status_class = 'ticket-sales-expired lt-grey-text'; |
| 77 | 77 | break; |
| 78 | 78 | // archived |
| 79 | 79 | case EE_Ticket::archived : |
| 80 | - $ticket_status = '<span class="archived-ticket">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
| 80 | + $ticket_status = '<span class="archived-ticket">'.$ticket->ticket_status(TRUE).'</span>'; |
|
| 81 | 81 | $status_class = 'archived-ticket hidden'; |
| 82 | 82 | break; |
| 83 | 83 | // pending |
| 84 | 84 | case EE_Ticket::pending : |
| 85 | - $ticket_status = '<span class="ticket-pending">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
| 85 | + $ticket_status = '<span class="ticket-pending">'.$ticket->ticket_status(TRUE).'</span>'; |
|
| 86 | 86 | $status_class = 'ticket-pending'; |
| 87 | 87 | break; |
| 88 | 88 | // onsale |
| 89 | 89 | case EE_Ticket::onsale : |
| 90 | 90 | default : |
| 91 | - $ticket_status = '<span class="ticket-on-sale">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
| 91 | + $ticket_status = '<span class="ticket-on-sale">'.$ticket->ticket_status(TRUE).'</span>'; |
|
| 92 | 92 | $status_class = 'ticket-on-sale'; |
| 93 | 93 | break; |
| 94 | 94 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | "tckt-slctr-tkt-details-{$EVT_ID}-{$TKT_ID}" |
| 129 | 129 | ); |
| 130 | 130 | ?> |
| 131 | - <tr class="tckt-slctr-tbl-tr <?php echo $status_class . ' ' . espresso_get_object_css_class( $ticket ); ?>"> |
|
| 131 | + <tr class="tckt-slctr-tbl-tr <?php echo $status_class.' '.espresso_get_object_css_class($ticket); ?>"> |
|
| 132 | 132 | <?php |
| 133 | 133 | /** |
| 134 | 134 | * Allow plugins to hook in and abort the generation and display of the contents of this |
@@ -140,24 +140,24 @@ discard block |
||
| 140 | 140 | * |
| 141 | 141 | * @var string|bool |
| 142 | 142 | */ |
| 143 | - if ( false !== ( $new_row_cells_content = apply_filters( 'FHEE__ticket_selector_chart_template__do_ticket_inside_row', false, $ticket, $max, $min, $required_ticket_sold_out, $ticket_price, $ticket_bundle, $ticket_status, $status_class ) ) ) { |
|
| 143 | + if (false !== ($new_row_cells_content = apply_filters('FHEE__ticket_selector_chart_template__do_ticket_inside_row', false, $ticket, $max, $min, $required_ticket_sold_out, $ticket_price, $ticket_bundle, $ticket_status, $status_class))) { |
|
| 144 | 144 | echo $new_row_cells_content; |
| 145 | 145 | echo '</tr>'; |
| 146 | 146 | continue; |
| 147 | 147 | } |
| 148 | 148 | ?> |
| 149 | 149 | <td class="tckt-slctr-tbl-td-name"> |
| 150 | - <b><?php echo $ticket->get_pretty('TKT_name');?></b> |
|
| 151 | - <?php if ( $template_settings->show_ticket_details ) : ?> |
|
| 152 | - <a id="display-<?php echo $ticket_details_css_id; ?>" class="display-tckt-slctr-tkt-details display-the-hidden lt-grey-text smaller-text hide-if-no-js" rel="<?php echo $ticket_details_css_id; ?>" title="<?php echo esc_attr( apply_filters( 'FHEE__ticket_selector_chart_template__show_ticket_details_link_title', __( 'click to show additional ticket details', 'event_espresso' )) ); ?>"> |
|
| 153 | - <?php echo sprintf( __( 'show%1$sdetails%1$s+', 'event_espresso' ), ' ' ); ?> |
|
| 150 | + <b><?php echo $ticket->get_pretty('TKT_name'); ?></b> |
|
| 151 | + <?php if ($template_settings->show_ticket_details) : ?> |
|
| 152 | + <a id="display-<?php echo $ticket_details_css_id; ?>" class="display-tckt-slctr-tkt-details display-the-hidden lt-grey-text smaller-text hide-if-no-js" rel="<?php echo $ticket_details_css_id; ?>" title="<?php echo esc_attr(apply_filters('FHEE__ticket_selector_chart_template__show_ticket_details_link_title', __('click to show additional ticket details', 'event_espresso'))); ?>"> |
|
| 153 | + <?php echo sprintf(__('show%1$sdetails%1$s+', 'event_espresso'), ' '); ?> |
|
| 154 | 154 | </a> |
| 155 | - <a id="hide-<?php echo $ticket_details_css_id; ?>" class="hide-tckt-slctr-tkt-details hide-the-displayed lt-grey-text smaller-text hide-if-no-js" rel="<?php echo $ticket_details_css_id; ?>" title="<?php echo esc_attr( apply_filters( 'FHEE__ticket_selector_chart_template__hide_ticket_details_link_title', __( 'click to hide additional ticket details', 'event_espresso' )) ); ?>" style="display:none;"> |
|
| 156 | - <?php echo sprintf( __( 'hide%1$sdetails%1$s-', 'event_espresso' ), ' ' ); ?> |
|
| 155 | + <a id="hide-<?php echo $ticket_details_css_id; ?>" class="hide-tckt-slctr-tkt-details hide-the-displayed lt-grey-text smaller-text hide-if-no-js" rel="<?php echo $ticket_details_css_id; ?>" title="<?php echo esc_attr(apply_filters('FHEE__ticket_selector_chart_template__hide_ticket_details_link_title', __('click to hide additional ticket details', 'event_espresso'))); ?>" style="display:none;"> |
|
| 156 | + <?php echo sprintf(__('hide%1$sdetails%1$s-', 'event_espresso'), ' '); ?> |
|
| 157 | 157 | </a> |
| 158 | 158 | <?php endif; //end show details check ?> |
| 159 | - <?php if ( $ticket->required() ) { ?> |
|
| 160 | - <p class="ticket-required-pg"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_required_message', __( 'This ticket is required and must be purchased.', 'event_espresso' )); ?></p> |
|
| 159 | + <?php if ($ticket->required()) { ?> |
|
| 160 | + <p class="ticket-required-pg"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_required_message', __('This ticket is required and must be purchased.', 'event_espresso')); ?></p> |
|
| 161 | 161 | <?php } ?> |
| 162 | 162 | <?php |
| 163 | 163 | // echo '<br/><b>$max_atndz : ' . $max_atndz . '</b>'; |
@@ -171,66 +171,66 @@ discard block |
||
| 171 | 171 | // echo '<br/><b> $ticket->required() : ' . $ticket->uses() . '</b>'; |
| 172 | 172 | ?> |
| 173 | 173 | </td> |
| 174 | - <?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE )) { ?> |
|
| 174 | + <?php if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?> |
|
| 175 | 175 | <td class="tckt-slctr-tbl-td-price jst-rght"><?php |
| 176 | - echo EEH_Template::format_currency( $ticket_price ); |
|
| 176 | + echo EEH_Template::format_currency($ticket_price); |
|
| 177 | 177 | echo $ticket->taxable() ? '<span class="taxable-tickets-asterisk grey-text">*</span>' : ''; |
| 178 | 178 | ?> <span class="smaller-text no-bold"><?php |
| 179 | - if ( $ticket_bundle ) { |
|
| 180 | - echo apply_filters( 'FHEE__ticket_selector_chart_template__per_ticket_bundle_text', __( ' / bundle', 'event_espresso' )); |
|
| 179 | + if ($ticket_bundle) { |
|
| 180 | + echo apply_filters('FHEE__ticket_selector_chart_template__per_ticket_bundle_text', __(' / bundle', 'event_espresso')); |
|
| 181 | 181 | } else { |
| 182 | - echo apply_filters( 'FHEE__ticket_selector_chart_template__per_ticket_text', __( '', 'event_espresso' )); |
|
| 182 | + echo apply_filters('FHEE__ticket_selector_chart_template__per_ticket_text', __('', 'event_espresso')); |
|
| 183 | 183 | }?></span> </td> |
| 184 | 184 | <?php } ?> |
| 185 | 185 | <td class="tckt-slctr-tbl-td-qty cntr"> |
| 186 | 186 | <?php |
| 187 | 187 | $hidden_input_qty = $max_atndz > 1 ? TRUE : FALSE; |
| 188 | 188 | // sold out or other status ? |
| 189 | - if ( $tkt_status == EE_Ticket::sold_out || $remaining == 0 ) { |
|
| 189 | + if ($tkt_status == EE_Ticket::sold_out || $remaining == 0) { |
|
| 190 | 190 | ?> |
| 191 | - <span class="sold-out"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_sold_out_msg', __( 'Sold Out', 'event_espresso' ));?></span> |
|
| 191 | + <span class="sold-out"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_sold_out_msg', __('Sold Out', 'event_espresso')); ?></span> |
|
| 192 | 192 | <?php |
| 193 | - } else if ( $tkt_status == EE_Ticket::expired || $tkt_status == EE_Ticket::archived ) { |
|
| 193 | + } else if ($tkt_status == EE_Ticket::expired || $tkt_status == EE_Ticket::archived) { |
|
| 194 | 194 | echo $ticket_status; |
| 195 | - } else if ( $tkt_status == EE_Ticket::pending ) { |
|
| 195 | + } else if ($tkt_status == EE_Ticket::pending) { |
|
| 196 | 196 | ?> |
| 197 | 197 | <div class="ticket-pending-pg"> |
| 198 | - <span class="ticket-pending"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_goes_on_sale_msg', __( 'Goes On Sale', 'event_espresso' )); ?></span><br/> |
|
| 199 | - <span class="small-text"><?php echo $ticket->get_i18n_datetime( 'TKT_start_date', apply_filters( 'FHEE__EED_Ticket_Selector__display_goes_on_sale__date_format', $date_format ) ); ?></span> |
|
| 198 | + <span class="ticket-pending"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_goes_on_sale_msg', __('Goes On Sale', 'event_espresso')); ?></span><br/> |
|
| 199 | + <span class="small-text"><?php echo $ticket->get_i18n_datetime('TKT_start_date', apply_filters('FHEE__EED_Ticket_Selector__display_goes_on_sale__date_format', $date_format)); ?></span> |
|
| 200 | 200 | </div> |
| 201 | 201 | <?php |
| 202 | 202 | // min qty purchasable is less than tickets available |
| 203 | - } else if ( $ticket->min() > $remaining ) { |
|
| 203 | + } else if ($ticket->min() > $remaining) { |
|
| 204 | 204 | ?> |
| 205 | 205 | <div class="archived-ticket-pg"> |
| 206 | - <span class="archived-ticket small-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_not_available_msg', __( 'Not Available', 'event_espresso' )); ?></span><br/> |
|
| 206 | + <span class="archived-ticket small-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_not_available_msg', __('Not Available', 'event_espresso')); ?></span><br/> |
|
| 207 | 207 | </div> |
| 208 | 208 | <?php |
| 209 | 209 | // if only one attendee is allowed to register at a time |
| 210 | - } else if ( $max_atndz == 1 ) { |
|
| 210 | + } else if ($max_atndz == 1) { |
|
| 211 | 211 | // display submit button since we have tickets available |
| 212 | - add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' ); |
|
| 212 | + add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true'); |
|
| 213 | 213 | ?> |
| 214 | - <input type="radio" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID . '-' . $row; ?>" class="ticket-selector-tbl-qty-slct" value="<?php echo $row . '-'; ?>1" <?php echo $row == 1 ? ' checked="checked"' : ''; ?> title=""/> |
|
| 214 | + <input type="radio" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID.'-'.$row; ?>" class="ticket-selector-tbl-qty-slct" value="<?php echo $row.'-'; ?>1" <?php echo $row == 1 ? ' checked="checked"' : ''; ?> title=""/> |
|
| 215 | 215 | <?php |
| 216 | 216 | $hidden_input_qty = FALSE; |
| 217 | 217 | |
| 218 | - } else if ( $max_atndz == 0 ) { |
|
| 219 | - echo '<span class="sold-out">' . apply_filters( 'FHEE__ticket_selector_chart_template__ticket_closed_msg', __( 'Closed', 'event_espresso' )) . '</span>'; |
|
| 220 | - } elseif ( $max > 0 ) { |
|
| 218 | + } else if ($max_atndz == 0) { |
|
| 219 | + echo '<span class="sold-out">'.apply_filters('FHEE__ticket_selector_chart_template__ticket_closed_msg', __('Closed', 'event_espresso')).'</span>'; |
|
| 220 | + } elseif ($max > 0) { |
|
| 221 | 221 | // display submit button since we have tickets available |
| 222 | - add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' ); |
|
| 222 | + add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true'); |
|
| 223 | 223 | |
| 224 | 224 | ?> |
| 225 | - <select name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID . '-' . $row; ?>" class="ticket-selector-tbl-qty-slct" title=""> |
|
| 225 | + <select name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID.'-'.$row; ?>" class="ticket-selector-tbl-qty-slct" title=""> |
|
| 226 | 226 | <?php |
| 227 | 227 | // this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased |
| 228 | - if ( ! $ticket->required() && $min !== 0 ) { |
|
| 228 | + if ( ! $ticket->required() && $min !== 0) { |
|
| 229 | 229 | ?> |
| 230 | 230 | <option value="0"> 0 </option> |
| 231 | 231 | <?php } |
| 232 | 232 | // offer ticket quantities from the min to the max |
| 233 | - for ( $i = $min; $i <= $max; $i++) { |
|
| 233 | + for ($i = $min; $i <= $max; $i++) { |
|
| 234 | 234 | ?> |
| 235 | 235 | <option value="<?php echo $i; ?>"> <?php echo $i; ?> </option> |
| 236 | 236 | <?php } ?> |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | |
| 241 | 241 | } |
| 242 | 242 | // depending on group reg we need to change the format for qty |
| 243 | - if ( $hidden_input_qty ) { |
|
| 243 | + if ($hidden_input_qty) { |
|
| 244 | 244 | ?> |
| 245 | 245 | <input type="hidden" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" value="0" /> |
| 246 | 246 | <?php |
@@ -250,33 +250,33 @@ discard block |
||
| 250 | 250 | |
| 251 | 251 | </td> |
| 252 | 252 | </tr> |
| 253 | - <?php if ( $template_settings->show_ticket_details ) : ?> |
|
| 254 | - <tr class="tckt-slctr-tkt-details-tr <?php echo espresso_get_object_css_class( $ticket, '', 'details' );?>"> |
|
| 253 | + <?php if ($template_settings->show_ticket_details) : ?> |
|
| 254 | + <tr class="tckt-slctr-tkt-details-tr <?php echo espresso_get_object_css_class($ticket, '', 'details'); ?>"> |
|
| 255 | 255 | <td class="tckt-slctr-tkt-details-td" colspan="3" > |
| 256 | 256 | <div id="<?php echo $ticket_details_css_id; ?>-dv" class="tckt-slctr-tkt-details-dv" style="display: none;"> |
| 257 | 257 | |
| 258 | 258 | <section class="tckt-slctr-tkt-details-sctn"> |
| 259 | - <h3><?php _e( 'Details', 'event_espresso' ); ?></h3> |
|
| 259 | + <h3><?php _e('Details', 'event_espresso'); ?></h3> |
|
| 260 | 260 | <p><?php echo $ticket->description(); ?></p> |
| 261 | 261 | |
| 262 | - <?php if ( $ticket_price != 0 && apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE )) { ?> |
|
| 262 | + <?php if ($ticket_price != 0 && apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?> |
|
| 263 | 263 | <section class="tckt-slctr-tkt-price-sctn"> |
| 264 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading', __( 'Price', 'event_espresso' )); ?></h5> |
|
| 264 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading', __('Price', 'event_espresso')); ?></h5> |
|
| 265 | 265 | <div class="tckt-slctr-tkt-details-tbl-wrap-dv"> |
| 266 | 266 | <table class="tckt-slctr-tkt-details-tbl"> |
| 267 | 267 | <thead> |
| 268 | 268 | <tr> |
| 269 | - <th class="ee-third-width"><span class="small-text"><?php _e( 'Name', 'event_espresso' ); ?></span></th> |
|
| 270 | - <th class="jst-cntr"><span class="small-text"><?php _e( 'Description', 'event_espresso' ); ?></span></th> |
|
| 271 | - <th class="ee-fourth-width jst-rght"><span class="small-text"><?php _e( 'Amount', 'event_espresso' ); ?></span></th> |
|
| 269 | + <th class="ee-third-width"><span class="small-text"><?php _e('Name', 'event_espresso'); ?></span></th> |
|
| 270 | + <th class="jst-cntr"><span class="small-text"><?php _e('Description', 'event_espresso'); ?></span></th> |
|
| 271 | + <th class="ee-fourth-width jst-rght"><span class="small-text"><?php _e('Amount', 'event_espresso'); ?></span></th> |
|
| 272 | 272 | </tr> |
| 273 | 273 | </thead> |
| 274 | 274 | <tbody> |
| 275 | - <?php if ( $ticket->base_price() instanceof EE_Price ) { ?> |
|
| 275 | + <?php if ($ticket->base_price() instanceof EE_Price) { ?> |
|
| 276 | 276 | <tr> |
| 277 | - <td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="small-text"><b><?php echo $ticket->base_price()->name(); ?></b></td> |
|
| 278 | - <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="small-text"><?php echo $ticket->base_price()->desc(); ?></td> |
|
| 279 | - <td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $ticket->base_price()->pretty_price(); ?></td> |
|
| 277 | + <td data-th="<?php _e('Name', 'event_espresso'); ?>" class="small-text"><b><?php echo $ticket->base_price()->name(); ?></b></td> |
|
| 278 | + <td data-th="<?php _e('Description', 'event_espresso'); ?>" class="small-text"><?php echo $ticket->base_price()->desc(); ?></td> |
|
| 279 | + <td data-th="<?php _e('Amount', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $ticket->base_price()->pretty_price(); ?></td> |
|
| 280 | 280 | </tr> |
| 281 | 281 | <?php |
| 282 | 282 | $running_total = $ticket->base_price()->amount(); |
@@ -284,44 +284,44 @@ discard block |
||
| 284 | 284 | $running_total = 0; |
| 285 | 285 | } |
| 286 | 286 | // now add price modifiers |
| 287 | - foreach ( $ticket->price_modifiers() as $price_mod ) { ?> |
|
| 287 | + foreach ($ticket->price_modifiers() as $price_mod) { ?> |
|
| 288 | 288 | <tr> |
| 289 | - <td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $price_mod->name(); ?></td> |
|
| 290 | - <?php if ( $price_mod->is_percent() ) { ?> |
|
| 291 | - <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="small-text"><?php echo $price_mod->desc(); ?> <?php echo $price_mod->amount(); ?>%</td> |
|
| 289 | + <td data-th="<?php _e('Name', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $price_mod->name(); ?></td> |
|
| 290 | + <?php if ($price_mod->is_percent()) { ?> |
|
| 291 | + <td data-th="<?php _e('Description', 'event_espresso'); ?>" class="small-text"><?php echo $price_mod->desc(); ?> <?php echo $price_mod->amount(); ?>%</td> |
|
| 292 | 292 | <?php |
| 293 | - $new_sub_total = $running_total * ( $price_mod->amount() / 100 ); |
|
| 293 | + $new_sub_total = $running_total * ($price_mod->amount() / 100); |
|
| 294 | 294 | $new_sub_total = $price_mod->is_discount() ? $new_sub_total * -1 : $new_sub_total; |
| 295 | 295 | ?> |
| 296 | 296 | <?php } else { ?> |
| 297 | 297 | <?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1 : $price_mod->amount(); ?> |
| 298 | - <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="small-text"><?php echo $price_mod->desc(); ?></td> |
|
| 298 | + <td data-th="<?php _e('Description', 'event_espresso'); ?>" class="small-text"><?php echo $price_mod->desc(); ?></td> |
|
| 299 | 299 | <?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1 : $price_mod->amount(); ?> |
| 300 | 300 | <?php } ?> |
| 301 | - <td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency( $new_sub_total ); ?></td> |
|
| 301 | + <td data-th="<?php _e('Amount', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency($new_sub_total); ?></td> |
|
| 302 | 302 | <?php $running_total += $new_sub_total; ?> |
| 303 | 303 | </tr> |
| 304 | 304 | <?php } ?> |
| 305 | - <?php if ( $ticket->taxable() ) { ?> |
|
| 305 | + <?php if ($ticket->taxable()) { ?> |
|
| 306 | 306 | <?php //$ticket_subtotal =$ticket->get_ticket_subtotal(); ?> |
| 307 | 307 | <tr> |
| 308 | - <td colspan="2" class="jst-rght small-text sbttl"><b><?php _e( 'subtotal', 'event_espresso' ); ?></b></td> |
|
| 309 | - <td data-th="<?php _e( 'subtotal', 'event_espresso' ); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency( $running_total ); ?></b></td> |
|
| 308 | + <td colspan="2" class="jst-rght small-text sbttl"><b><?php _e('subtotal', 'event_espresso'); ?></b></td> |
|
| 309 | + <td data-th="<?php _e('subtotal', 'event_espresso'); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency($running_total); ?></b></td> |
|
| 310 | 310 | </tr> |
| 311 | 311 | |
| 312 | - <?php foreach ( $ticket->get_ticket_taxes_for_admin() as $tax ) { ?> |
|
| 312 | + <?php foreach ($ticket->get_ticket_taxes_for_admin() as $tax) { ?> |
|
| 313 | 313 | <tr> |
| 314 | - <td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $tax->name(); ?></td> |
|
| 315 | - <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $tax->amount(); ?>%</td> |
|
| 316 | - <?php $tax_amount = $running_total * ( $tax->amount() / 100 ); ?> |
|
| 317 | - <td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency( $tax_amount ); ?></td> |
|
| 314 | + <td data-th="<?php _e('Name', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $tax->name(); ?></td> |
|
| 315 | + <td data-th="<?php _e('Description', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $tax->amount(); ?>%</td> |
|
| 316 | + <?php $tax_amount = $running_total * ($tax->amount() / 100); ?> |
|
| 317 | + <td data-th="<?php _e('Amount', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency($tax_amount); ?></td> |
|
| 318 | 318 | <?php $running_total += $tax_amount; ?> |
| 319 | 319 | </tr> |
| 320 | 320 | <?php } ?> |
| 321 | 321 | <?php } ?> |
| 322 | 322 | <tr> |
| 323 | - <td colspan="2" class="jst-rght small-text ttl-lbl-td"><b><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_total_price', __( 'Total', 'event_espresso' )); ?></b></td> |
|
| 324 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_total_price', __( 'Total', 'event_espresso' )); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency( $running_total ); ?></b></td> |
|
| 323 | + <td colspan="2" class="jst-rght small-text ttl-lbl-td"><b><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_total_price', __('Total', 'event_espresso')); ?></b></td> |
|
| 324 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_total_price', __('Total', 'event_espresso')); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency($running_total); ?></b></td> |
|
| 325 | 325 | </tr> |
| 326 | 326 | </tbody> |
| 327 | 327 | </table> |
@@ -331,106 +331,106 @@ discard block |
||
| 331 | 331 | <?php } ?> |
| 332 | 332 | |
| 333 | 333 | <section class="tckt-slctr-tkt-sale-dates-sctn"> |
| 334 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading', __( 'Sale Dates', 'event_espresso' )); ?></h5> |
|
| 335 | - <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message', __( 'The dates when this option is available for purchase.', 'event_espresso' )); ?></span><br/> |
|
| 336 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale', __( 'Goes On Sale:', 'event_espresso' )); ?></span><span class="dashicons dashicons-calendar"></span><?php echo $ticket->get_i18n_datetime( 'TKT_start_date', $date_format) . ' '; ?><span class="dashicons dashicons-clock"></span><?php echo $ticket->get_i18n_datetime( 'TKT_start_date', $time_format ) ; ?><br/> |
|
| 337 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_sales_end', __( 'Sales End:', 'event_espresso' )); ?></span><span class="dashicons dashicons-calendar"></span><?php echo $ticket->get_i18n_datetime( 'TKT_end_date', $date_format ) . ' '; ?><span class="dashicons dashicons-clock"></span><?php echo $ticket->get_i18n_datetime( 'TKT_end_date', $time_format ) ; ?><br/> |
|
| 334 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading', __('Sale Dates', 'event_espresso')); ?></h5> |
|
| 335 | + <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_dates_available_message', __('The dates when this option is available for purchase.', 'event_espresso')); ?></span><br/> |
|
| 336 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale', __('Goes On Sale:', 'event_espresso')); ?></span><span class="dashicons dashicons-calendar"></span><?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format).' '; ?><span class="dashicons dashicons-clock"></span><?php echo $ticket->get_i18n_datetime('TKT_start_date', $time_format); ?><br/> |
|
| 337 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_sales_end', __('Sales End:', 'event_espresso')); ?></span><span class="dashicons dashicons-calendar"></span><?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format).' '; ?><span class="dashicons dashicons-clock"></span><?php echo $ticket->get_i18n_datetime('TKT_end_date', $time_format); ?><br/> |
|
| 338 | 338 | </section> |
| 339 | 339 | <br/> |
| 340 | 340 | |
| 341 | - <?php do_action( 'AHEE__ticket_selector_chart_template__after_ticket_date', $ticket ); ?> |
|
| 341 | + <?php do_action('AHEE__ticket_selector_chart_template__after_ticket_date', $ticket); ?> |
|
| 342 | 342 | |
| 343 | - <?php if ( $ticket->min() &&$ticket->max() ) { ?> |
|
| 343 | + <?php if ($ticket->min() && $ticket->max()) { ?> |
|
| 344 | 344 | <section class="tckt-slctr-tkt-quantities-sctn"> |
| 345 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading', __( 'Purchasable Quantities', 'event_espresso' )); ?></h5> |
|
| 346 | - <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message', __( 'The number of tickets that can be purchased per transaction (if available).', 'event_espresso' )); ?></span><br/> |
|
| 347 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty', __( 'Minimum Qty:', 'event_espresso' )); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?> |
|
| 348 | - <?php if ( $ticket->min() > $remaining ) { ?> <span class="important-notice small-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message', __( 'The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining', 'event_espresso' )); ?></span><?php } ?><br/> |
|
| 345 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading', __('Purchasable Quantities', 'event_espresso')); ?></h5> |
|
| 346 | + <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message', __('The number of tickets that can be purchased per transaction (if available).', 'event_espresso')); ?></span><br/> |
|
| 347 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty', __('Minimum Qty:', 'event_espresso')); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?> |
|
| 348 | + <?php if ($ticket->min() > $remaining) { ?> <span class="important-notice small-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message', __('The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining', 'event_espresso')); ?></span><?php } ?><br/> |
|
| 349 | 349 | <?php //$max = min( $max, $max_atndz );?> |
| 350 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty', __( 'Maximum Qty:', 'event_espresso' )); ?></span><?php echo $ticket->max() === EE_INF ? __( 'no limit', 'event_espresso' ) : max( $ticket->max(), 1 ); ?><br/> |
|
| 350 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty', __('Maximum Qty:', 'event_espresso')); ?></span><?php echo $ticket->max() === EE_INF ? __('no limit', 'event_espresso') : max($ticket->max(), 1); ?><br/> |
|
| 351 | 351 | </section> |
| 352 | 352 | <br/> |
| 353 | 353 | <?php } ?> |
| 354 | 354 | |
| 355 | - <?php if ( $ticket->uses() !== EE_INF && ( ! defined( 'EE_DECAF' ) || EE_DECAF !== TRUE )) { ?> |
|
| 355 | + <?php if ($ticket->uses() !== EE_INF && ( ! defined('EE_DECAF') || EE_DECAF !== TRUE)) { ?> |
|
| 356 | 356 | <section class="tckt-slctr-tkt-uses-sctn"> |
| 357 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading', __( 'Event Date Ticket Uses', 'event_espresso' )); ?></h5> |
|
| 357 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading', __('Event Date Ticket Uses', 'event_espresso')); ?></h5> |
|
| 358 | 358 | <span class="drk-grey-text small-text no-bold"> - <?php |
| 359 | 359 | echo apply_filters( |
| 360 | 360 | 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_message', |
| 361 | 361 | sprintf( |
| 362 | - __( 'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s', 'event_espresso' ), |
|
| 362 | + __('The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s', 'event_espresso'), |
|
| 363 | 363 | '<br/>', |
| 364 | 364 | '<strong>', |
| 365 | 365 | '</strong>' |
| 366 | 366 | ) |
| 367 | 367 | ); |
| 368 | 368 | ?></span><br/> |
| 369 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes', __( '# Datetimes:', 'event_espresso' )); ?></span><?php echo $ticket->uses();?><br/> |
|
| 369 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes', __('# Datetimes:', 'event_espresso')); ?></span><?php echo $ticket->uses(); ?><br/> |
|
| 370 | 370 | </section> |
| 371 | 371 | <?php } ?> |
| 372 | 372 | |
| 373 | 373 | <?php |
| 374 | - $datetimes = $ticket->datetimes_ordered( $event_is_expired, FALSE ); |
|
| 374 | + $datetimes = $ticket->datetimes_ordered($event_is_expired, FALSE); |
|
| 375 | 375 | $chart_column_width = $template_settings->show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width'; |
| 376 | - if ( ! empty( $datetimes )) { ?> |
|
| 376 | + if ( ! empty($datetimes)) { ?> |
|
| 377 | 377 | <section class="tckt-slctr-tkt-datetimes-sctn"> |
| 378 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading', __( 'Access', 'event_espresso' )); ?></h5> |
|
| 379 | - <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_message', __( 'This option allows access to the following dates and times.', 'event_espresso' )); ?></span> |
|
| 378 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_heading', __('Access', 'event_espresso')); ?></h5> |
|
| 379 | + <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_message', __('This option allows access to the following dates and times.', 'event_espresso')); ?></span> |
|
| 380 | 380 | <div class="tckt-slctr-tkt-details-tbl-wrap-dv"> |
| 381 | 381 | <table class="tckt-slctr-tkt-details-tbl"> |
| 382 | 382 | <thead> |
| 383 | 383 | <tr> |
| 384 | 384 | <th class="tckt-slctr-tkt-details-date-th"> |
| 385 | - <span class="dashicons dashicons-calendar"></span><span class="small-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __( 'Date ', 'event_espresso' )); ?></span> |
|
| 385 | + <span class="dashicons dashicons-calendar"></span><span class="small-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __('Date ', 'event_espresso')); ?></span> |
|
| 386 | 386 | </th> |
| 387 | 387 | <th class="tckt-slctr-tkt-details-time-th <?php echo $chart_column_width; ?>"> |
| 388 | - <span class="dashicons dashicons-clock"></span><span class="small-text"><?php _e( 'Time ', 'event_espresso' ); ?></span> |
|
| 388 | + <span class="dashicons dashicons-clock"></span><span class="small-text"><?php _e('Time ', 'event_espresso'); ?></span> |
|
| 389 | 389 | </th> |
| 390 | - <?php if ( $template_settings->show_ticket_sale_columns ) : ?> |
|
| 390 | + <?php if ($template_settings->show_ticket_sale_columns) : ?> |
|
| 391 | 391 | <th class="tckt-slctr-tkt-details-this-ticket-sold-th ee-fourth-width cntr"> |
| 392 | - <span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', sprintf( __( 'Sold', 'event_espresso' ), '<br/>' )); ?></span> |
|
| 392 | + <span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', sprintf(__('Sold', 'event_espresso'), '<br/>')); ?></span> |
|
| 393 | 393 | </th> |
| 394 | 394 | <th class="tckt-slctr-tkt-details-this-ticket-left-th ee-fourth-width cntr"> |
| 395 | - <span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', sprintf( __( 'Remaining', 'event_espresso' ), '<br/>' )); ?></span> |
|
| 395 | + <span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', sprintf(__('Remaining', 'event_espresso'), '<br/>')); ?></span> |
|
| 396 | 396 | </th> |
| 397 | 397 | <th class="tckt-slctr-tkt-details-total-tickets-sold-th ee-fourth-width cntr"> |
| 398 | - <span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', sprintf( __( 'Total%sSold', 'event_espresso' ), '<br/>' )); ?></span> |
|
| 398 | + <span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', sprintf(__('Total%sSold', 'event_espresso'), '<br/>')); ?></span> |
|
| 399 | 399 | </th> |
| 400 | 400 | <th class="tckt-slctr-tkt-details-total-tickets-left-th ee-fourth-width cntr"> |
| 401 | - <span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', sprintf( __( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' )); ?></span> |
|
| 401 | + <span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', sprintf(__('Total Spaces%sLeft', 'event_espresso'), '<br/>')); ?></span> |
|
| 402 | 402 | </th> |
| 403 | 403 | <?php endif; //end $template_settings->show_ticket_sale_columns conditional ?> |
| 404 | 404 | </tr> |
| 405 | 405 | </thead> |
| 406 | 406 | <tbody> |
| 407 | 407 | <?php |
| 408 | - foreach ( $datetimes as $datetime ) { |
|
| 409 | - if ( $datetime instanceof EE_Datetime ) { |
|
| 408 | + foreach ($datetimes as $datetime) { |
|
| 409 | + if ($datetime instanceof EE_Datetime) { |
|
| 410 | 410 | ?> |
| 411 | 411 | |
| 412 | 412 | <tr> |
| 413 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __( 'Event Date ', 'event_espresso' )); ?>" class="small-text"> |
|
| 413 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __('Event Date ', 'event_espresso')); ?>" class="small-text"> |
|
| 414 | 414 | <?php $datetime_name = $datetime->name(); ?> |
| 415 | - <?php echo ! empty( $datetime_name ) ? '<b>' . $datetime_name . '</b><br/>' : ''; ?> |
|
| 416 | - <?php echo $datetime->date_range( $date_format, __( ' to ', 'event_espresso' )); ?> |
|
| 415 | + <?php echo ! empty($datetime_name) ? '<b>'.$datetime_name.'</b><br/>' : ''; ?> |
|
| 416 | + <?php echo $datetime->date_range($date_format, __(' to ', 'event_espresso')); ?> |
|
| 417 | 417 | </td> |
| 418 | - <td data-th="<?php _e( 'Time ', 'event_espresso' ); ?>" class="cntr small-text"> |
|
| 419 | - <?php echo $datetime->time_range( $time_format, __( ' to ', 'event_espresso' )); ?> |
|
| 418 | + <td data-th="<?php _e('Time ', 'event_espresso'); ?>" class="cntr small-text"> |
|
| 419 | + <?php echo $datetime->time_range($time_format, __(' to ', 'event_espresso')); ?> |
|
| 420 | 420 | </td> |
| 421 | - <?php if ( $template_settings->show_ticket_sale_columns ) : ?> |
|
| 422 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', __( 'Sold', 'event_espresso' )); ?>" class="cntr small-text"> |
|
| 421 | + <?php if ($template_settings->show_ticket_sale_columns) : ?> |
|
| 422 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', __('Sold', 'event_espresso')); ?>" class="cntr small-text"> |
|
| 423 | 423 | <?php echo $ticket->sold(); ?> |
| 424 | 424 | </td> |
| 425 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', __( 'Remaining', 'event_espresso' )); ?>" class="cntr small-text"> |
|
| 426 | - <?php echo $ticket->qty() === EE_INF ? '<span class="smaller-text">' . __( 'unlimited ', 'event_espresso' ) . '</span>' : $ticket->qty() - $ticket->sold(); ?> |
|
| 425 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', __('Remaining', 'event_espresso')); ?>" class="cntr small-text"> |
|
| 426 | + <?php echo $ticket->qty() === EE_INF ? '<span class="smaller-text">'.__('unlimited ', 'event_espresso').'</span>' : $ticket->qty() - $ticket->sold(); ?> |
|
| 427 | 427 | </td> |
| 428 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', __( 'Total Sold', 'event_espresso' )); ?>" class="cntr small-text"> |
|
| 428 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', __('Total Sold', 'event_espresso')); ?>" class="cntr small-text"> |
|
| 429 | 429 | <?php echo $datetime->sold(); ?> |
| 430 | 430 | </td> |
| 431 | - <?php $tkts_left = $datetime->sold_out() ? '<span class="sold-out smaller-text">' . __( 'Sold Out', 'event_espresso' ) . '</span>' : $datetime->spaces_remaining(); ?> |
|
| 432 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', __( 'Total Spaces Left', 'event_espresso' )); ?>" class="cntr small-text"> |
|
| 433 | - <?php echo $tkts_left === EE_INF ? '<span class="smaller-text">' . __( 'unlimited ', 'event_espresso' ) . '</span>' : $tkts_left; ?> |
|
| 431 | + <?php $tkts_left = $datetime->sold_out() ? '<span class="sold-out smaller-text">'.__('Sold Out', 'event_espresso').'</span>' : $datetime->spaces_remaining(); ?> |
|
| 432 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', __('Total Spaces Left', 'event_espresso')); ?>" class="cntr small-text"> |
|
| 433 | + <?php echo $tkts_left === EE_INF ? '<span class="smaller-text">'.__('unlimited ', 'event_espresso').'</span>' : $tkts_left; ?> |
|
| 434 | 434 | </td> |
| 435 | 435 | <?php endif; //end $template_settings->show_ticket_sale_columns conditional ?> |
| 436 | 436 | </tr> |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | </div> |
| 449 | 449 | </td> |
| 450 | 450 | </tr> |
| 451 | - <?php endif; //end template_settings->show_ticket_details check?> |
|
| 451 | + <?php endif; //end template_settings->show_ticket_details check?> |
|
| 452 | 452 | <?php |
| 453 | 453 | $row++; |
| 454 | 454 | } |
@@ -457,18 +457,18 @@ discard block |
||
| 457 | 457 | $ticket_row_html = ob_get_clean(); |
| 458 | 458 | // if there is only ONE ticket with a max qty of ONE, and it is free... then not much need for the ticket selector |
| 459 | 459 | $hide_ticket_selector = $ticket_count == 1 && $max == 1 && $ticket->is_free() ? true : false; |
| 460 | -$hide_ticket_selector = apply_filters( 'FHEE__ticket_selector_chart_template__hide_ticket_selector', $hide_ticket_selector, $EVT_ID ); |
|
| 460 | +$hide_ticket_selector = apply_filters('FHEE__ticket_selector_chart_template__hide_ticket_selector', $hide_ticket_selector, $EVT_ID); |
|
| 461 | 461 | // EEH_Debug_Tools::printr( $ticket_count, '$ticket_count', __FILE__, __LINE__ ); |
| 462 | 462 | // EEH_Debug_Tools::printr( $max, '$max', __FILE__, __LINE__ ); |
| 463 | 463 | // EEH_Debug_Tools::printr( $hide_ticket_selector, '$hide_ticket_selector', __FILE__, __LINE__ ); |
| 464 | 464 | //EEH_Debug_Tools::printr( $table_style, '$table_style', __FILE__, __LINE__ ); |
| 465 | 465 | remove_filter( |
| 466 | 466 | 'FHEE__EE_Ticket_Selector__after_ticket_selector_submit', |
| 467 | - array( 'EED_Ticket_Selector', 'no_tkt_slctr_end_dv' ) |
|
| 467 | + array('EED_Ticket_Selector', 'no_tkt_slctr_end_dv') |
|
| 468 | 468 | ); |
| 469 | 469 | remove_filter( |
| 470 | 470 | 'FHEE__EE_Ticket_Selector__after_view_details_btn', |
| 471 | - array( 'EED_Ticket_Selector', 'no_tkt_slctr_end_dv' ) |
|
| 471 | + array('EED_Ticket_Selector', 'no_tkt_slctr_end_dv') |
|
| 472 | 472 | ); |
| 473 | 473 | /** |
| 474 | 474 | * Filters the anchor ID used when redirecting to the Ticket Selector if no quantity selected |
@@ -478,20 +478,20 @@ discard block |
||
| 478 | 478 | * @param string '#tkt-slctr-tbl-' . $EVT_ID The html ID to anchor to |
| 479 | 479 | * @param int $EVT_ID The Event ID |
| 480 | 480 | */ |
| 481 | -$anchor_id = apply_filters( 'FHEE__EE_Ticket_Selector__redirect_anchor_id', '#tkt-slctr-tbl-' . $EVT_ID, $EVT_ID ); |
|
| 482 | -if ( ! $hide_ticket_selector ) { |
|
| 481 | +$anchor_id = apply_filters('FHEE__EE_Ticket_Selector__redirect_anchor_id', '#tkt-slctr-tbl-'.$EVT_ID, $EVT_ID); |
|
| 482 | +if ( ! $hide_ticket_selector) { |
|
| 483 | 483 | ?> |
| 484 | 484 | <div id="tkt-slctr-tbl-wrap-dv-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl-wrap-dv"> |
| 485 | 485 | |
| 486 | - <?php do_action( 'AHEE__ticket_selector_chart__template__before_ticket_selector', $event ); ?> |
|
| 486 | + <?php do_action('AHEE__ticket_selector_chart__template__before_ticket_selector', $event); ?> |
|
| 487 | 487 | |
| 488 | 488 | <table id="tkt-slctr-tbl-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl"> |
| 489 | 489 | <thead> |
| 490 | 490 | <tr> |
| 491 | 491 | <th scope="col" class="ee-ticket-selector-ticket-details-th"> |
| 492 | - <?php echo esc_html( apply_filters( 'FHEE__ticket_selector_chart_template__table_header_available_tickets', '', $EVT_ID ) ); ?> |
|
| 492 | + <?php echo esc_html(apply_filters('FHEE__ticket_selector_chart_template__table_header_available_tickets', '', $EVT_ID)); ?> |
|
| 493 | 493 | </th> |
| 494 | - <?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE )) { ?> |
|
| 494 | + <?php if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?> |
|
| 495 | 495 | <th scope="col" class="ee-ticket-selector-ticket-price-th cntr"> |
| 496 | 496 | <?php |
| 497 | 497 | /** |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | * @param string 'Price' The translatable text to display in the table header for price |
| 503 | 503 | * @param int $EVT_ID The Event ID |
| 504 | 504 | */ |
| 505 | - echo esc_html( apply_filters( 'FHEE__ticket_selector_chart_template__table_header_price', __( 'Price', 'event_espresso' ), $EVT_ID ) ); |
|
| 505 | + echo esc_html(apply_filters('FHEE__ticket_selector_chart_template__table_header_price', __('Price', 'event_espresso'), $EVT_ID)); |
|
| 506 | 506 | ?> |
| 507 | 507 | </th> |
| 508 | 508 | <?php } ?> |
@@ -516,34 +516,34 @@ discard block |
||
| 516 | 516 | * @param string 'Qty*' The translatable text to display in the table header for the Quantity of tickets |
| 517 | 517 | * @param int $EVT_ID The Event ID |
| 518 | 518 | */ |
| 519 | - echo esc_html( apply_filters( 'FHEE__ticket_selector_chart_template__table_header_qty', __( 'Qty*', 'event_espresso' ), $EVT_ID ) ); |
|
| 519 | + echo esc_html(apply_filters('FHEE__ticket_selector_chart_template__table_header_qty', __('Qty*', 'event_espresso'), $EVT_ID)); |
|
| 520 | 520 | ?> |
| 521 | 521 | </th> |
| 522 | 522 | </tr> |
| 523 | 523 | </thead> |
| 524 | 524 | <tbody> |
| 525 | - <?php echo $ticket_row_html;?> |
|
| 525 | + <?php echo $ticket_row_html; ?> |
|
| 526 | 526 | </tbody> |
| 527 | 527 | </table> |
| 528 | 528 | <?php |
| 529 | - if ( $taxable_tickets && apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', true ) ) { |
|
| 530 | - if ( $tax_settings->prices_displayed_including_taxes ) { |
|
| 531 | - $ticket_price_includes_taxes = __( '* price includes taxes', 'event_espresso' ); |
|
| 529 | + if ($taxable_tickets && apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) { |
|
| 530 | + if ($tax_settings->prices_displayed_including_taxes) { |
|
| 531 | + $ticket_price_includes_taxes = __('* price includes taxes', 'event_espresso'); |
|
| 532 | 532 | } else { |
| 533 | - $ticket_price_includes_taxes = __( '* price does not include taxes', 'event_espresso' ); |
|
| 533 | + $ticket_price_includes_taxes = __('* price does not include taxes', 'event_espresso'); |
|
| 534 | 534 | } |
| 535 | - echo '<p class="small-text lt-grey-text" style="text-align:right; margin: -1em 0 1em;">' . $ticket_price_includes_taxes . '</p>'; |
|
| 535 | + echo '<p class="small-text lt-grey-text" style="text-align:right; margin: -1em 0 1em;">'.$ticket_price_includes_taxes.'</p>'; |
|
| 536 | 536 | } |
| 537 | 537 | ?> |
| 538 | 538 | |
| 539 | 539 | <input type="hidden" name="noheader" value="true" /> |
| 540 | - <input type="hidden" name="tkt-slctr-return-url-<?php echo $EVT_ID ?>" value="<?php echo EEH_URL::filter_input_server_url() . $anchor_id; ?>" /> |
|
| 540 | + <input type="hidden" name="tkt-slctr-return-url-<?php echo $EVT_ID ?>" value="<?php echo EEH_URL::filter_input_server_url().$anchor_id; ?>" /> |
|
| 541 | 541 | <input type="hidden" name="tkt-slctr-rows-<?php echo $EVT_ID; ?>" value="<?php echo $row - 1; ?>" /> |
| 542 | 542 | <input type="hidden" name="tkt-slctr-max-atndz-<?php echo $EVT_ID; ?>" value="<?php echo $max_atndz; ?>" /> |
| 543 | 543 | <input type="hidden" name="tkt-slctr-event-id" value="<?php echo $EVT_ID; ?>" /> |
| 544 | 544 | |
| 545 | 545 | <?php |
| 546 | -if ( $max_atndz > 0 && ! $hide_ticket_selector ) { |
|
| 546 | +if ($max_atndz > 0 && ! $hide_ticket_selector) { |
|
| 547 | 547 | echo apply_filters( |
| 548 | 548 | 'FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote', |
| 549 | 549 | '' |
@@ -551,39 +551,39 @@ discard block |
||
| 551 | 551 | } |
| 552 | 552 | ?> |
| 553 | 553 | |
| 554 | - <?php do_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event ); ?> |
|
| 554 | + <?php do_action('AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event); ?> |
|
| 555 | 555 | |
| 556 | 556 | </div> |
| 557 | -<?php } else if ( isset( $TKT_ID ) ) { ?> |
|
| 557 | +<?php } else if (isset($TKT_ID)) { ?> |
|
| 558 | 558 | <input type="hidden" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" value="1"/> |
| 559 | 559 | <input type="hidden" name="tkt-slctr-ticket-id-<?php echo $EVT_ID; ?>[]" value="<?php echo $TKT_ID; ?>"/> |
| 560 | 560 | <input type="hidden" name="noheader" value="true"/> |
| 561 | -<input type="hidden" name="tkt-slctr-return-url-<?php echo $EVT_ID ?>" value="<?php echo EEH_URL::filter_input_server_url() . $anchor_id; ?>"/> |
|
| 561 | +<input type="hidden" name="tkt-slctr-return-url-<?php echo $EVT_ID ?>" value="<?php echo EEH_URL::filter_input_server_url().$anchor_id; ?>"/> |
|
| 562 | 562 | <input type="hidden" name="tkt-slctr-rows-<?php echo $EVT_ID; ?>" value="<?php echo $row - 1; ?>"/> |
| 563 | 563 | <input type="hidden" name="tkt-slctr-max-atndz-<?php echo $EVT_ID; ?>" value="<?php echo $max_atndz; ?>"/> |
| 564 | 564 | <input type="hidden" name="tkt-slctr-event-id" value="<?php echo $EVT_ID; ?>"/> |
| 565 | 565 | <?php |
| 566 | - if ( $ticket instanceof EE_Ticket ) { |
|
| 567 | - do_action( 'AHEE__ticket_selector_chart__template__before_ticket_selector', $event ); |
|
| 566 | + if ($ticket instanceof EE_Ticket) { |
|
| 567 | + do_action('AHEE__ticket_selector_chart__template__before_ticket_selector', $event); |
|
| 568 | 568 | $ticket_description = $ticket->description(); |
| 569 | 569 | ?> |
| 570 | 570 | <div id="no-tkt-slctr-ticket-dv-<?php echo $EVT_ID; ?>" class="no-tkt-slctr-ticket-dv"> |
| 571 | 571 | <div class="no-tkt-slctr-ticket-content-dv"> |
| 572 | 572 | <h5><?php echo $ticket->name(); ?></h5> |
| 573 | - <?php if ( ! empty( $ticket_description ) ) { ?> |
|
| 573 | + <?php if ( ! empty($ticket_description)) { ?> |
|
| 574 | 574 | <p><?php echo $ticket_description; ?></p> |
| 575 | 575 | <?php } ?> |
| 576 | 576 | </div> |
| 577 | 577 | <?php |
| 578 | 578 | add_filter( |
| 579 | 579 | 'FHEE__EE_Ticket_Selector__after_ticket_selector_submit', |
| 580 | - array( 'EED_Ticket_Selector', 'no_tkt_slctr_end_dv' ) |
|
| 580 | + array('EED_Ticket_Selector', 'no_tkt_slctr_end_dv') |
|
| 581 | 581 | ); |
| 582 | 582 | add_filter( |
| 583 | 583 | 'FHEE__EE_Ticket_Selector__after_view_details_btn', |
| 584 | - array( 'EED_Ticket_Selector', 'no_tkt_slctr_end_dv' ) |
|
| 584 | + array('EED_Ticket_Selector', 'no_tkt_slctr_end_dv') |
|
| 585 | 585 | ); |
| 586 | - do_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event ); |
|
| 586 | + do_action('AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event); |
|
| 587 | 587 | } |
| 588 | 588 | } |
| 589 | 589 | ?> |
@@ -65,15 +65,15 @@ discard block |
||
| 65 | 65 | * @return EED_Ticket_Selector |
| 66 | 66 | */ |
| 67 | 67 | public static function instance() { |
| 68 | - return parent::get_instance( __CLASS__ ); |
|
| 68 | + return parent::get_instance(__CLASS__); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | |
| 73 | - protected function set_config(){ |
|
| 74 | - $this->set_config_section( 'template_settings' ); |
|
| 75 | - $this->set_config_class( 'EE_Ticket_Selector_Config' ); |
|
| 76 | - $this->set_config_name( 'EED_Ticket_Selector' ); |
|
| 73 | + protected function set_config() { |
|
| 74 | + $this->set_config_section('template_settings'); |
|
| 75 | + $this->set_config_class('EE_Ticket_Selector_Config'); |
|
| 76 | + $this->set_config_name('EED_Ticket_Selector'); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public static function set_hooks() { |
| 90 | 90 | // routing |
| 91 | - EE_Config::register_route( 'iframe', 'EED_Ticket_Selector', 'ticket_selector_iframe', 'ticket_selector' ); |
|
| 92 | - EE_Config::register_route( 'process_ticket_selections', 'EED_Ticket_Selector', 'process_ticket_selections' ); |
|
| 93 | - add_action( 'wp_loaded', array( 'EED_Ticket_Selector', 'set_definitions' ), 2 ); |
|
| 91 | + EE_Config::register_route('iframe', 'EED_Ticket_Selector', 'ticket_selector_iframe', 'ticket_selector'); |
|
| 92 | + EE_Config::register_route('process_ticket_selections', 'EED_Ticket_Selector', 'process_ticket_selections'); |
|
| 93 | + add_action('wp_loaded', array('EED_Ticket_Selector', 'set_definitions'), 2); |
|
| 94 | 94 | //add_action( 'AHEE_event_details_before_post', array( 'EED_Ticket_Selector', 'ticket_selector_form_open' ), 10, 1 ); |
| 95 | - add_action( 'AHEE_event_details_header_bottom', array( 'EED_Ticket_Selector', 'display_ticket_selector' ), 10, 1 ); |
|
| 95 | + add_action('AHEE_event_details_header_bottom', array('EED_Ticket_Selector', 'display_ticket_selector'), 10, 1); |
|
| 96 | 96 | //add_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', array( 'EED_Ticket_Selector', 'display_ticket_selector_submit' ), 10, 1 ); |
| 97 | 97 | //add_action( 'AHEE_event_details_after_post', array( 'EED_Ticket_Selector', 'ticket_selector_form_close' ), 10 ); |
| 98 | - add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'load_tckt_slctr_assets' ), 10 ); |
|
| 98 | + add_action('wp_enqueue_scripts', array('EED_Ticket_Selector', 'load_tckt_slctr_assets'), 10); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
@@ -107,10 +107,10 @@ discard block |
||
| 107 | 107 | * @return void |
| 108 | 108 | */ |
| 109 | 109 | public static function set_hooks_admin() { |
| 110 | - add_action( 'wp_loaded', array( 'EED_Ticket_Selector', 'set_definitions' ), 2 ); |
|
| 110 | + add_action('wp_loaded', array('EED_Ticket_Selector', 'set_definitions'), 2); |
|
| 111 | 111 | //add button for iframe code to event editor. |
| 112 | - add_filter( 'get_sample_permalink_html', array( 'EED_Ticket_Selector', 'iframe_code_button' ), 10, 4 ); |
|
| 113 | - add_action( 'admin_enqueue_scripts', array( 'EED_Ticket_Selector', 'load_tckt_slctr_assets_admin' ), 10 ); |
|
| 112 | + add_filter('get_sample_permalink_html', array('EED_Ticket_Selector', 'iframe_code_button'), 10, 4); |
|
| 113 | + add_action('admin_enqueue_scripts', array('EED_Ticket_Selector', 'load_tckt_slctr_assets_admin'), 10); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | |
@@ -122,15 +122,15 @@ discard block |
||
| 122 | 122 | * @return void |
| 123 | 123 | */ |
| 124 | 124 | public static function set_definitions() { |
| 125 | - define( 'TICKET_SELECTOR_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
| 126 | - define( 'TICKET_SELECTOR_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS ); |
|
| 125 | + define('TICKET_SELECTOR_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
| 126 | + define('TICKET_SELECTOR_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
| 127 | 127 | |
| 128 | 128 | //if config is not set, initialize |
| 129 | 129 | //If config is not set, set it. |
| 130 | - if ( ! isset( EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector ) ) { |
|
| 130 | + if ( ! isset(EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector)) { |
|
| 131 | 131 | EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector = new EE_Ticket_Selector_Config(); |
| 132 | 132 | } |
| 133 | - EE_Registry::$i18n_js_strings[ 'ts_embed_iframe_title' ] = __( 'Copy and Paste the following:', 'event_espresso' ); |
|
| 133 | + EE_Registry::$i18n_js_strings['ts_embed_iframe_title'] = __('Copy and Paste the following:', 'event_espresso'); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | * @param object $WP |
| 142 | 142 | * @return void |
| 143 | 143 | */ |
| 144 | - public function run( $WP ) {} |
|
| 144 | + public function run($WP) {} |
|
| 145 | 145 | |
| 146 | 146 | |
| 147 | 147 | /** |
@@ -153,23 +153,23 @@ discard block |
||
| 153 | 153 | public function ticket_selector_iframe() { |
| 154 | 154 | self::$_in_iframe = true; |
| 155 | 155 | /** @type EEM_Event $EEM_Event */ |
| 156 | - $EEM_Event = EE_Registry::instance()->load_model( 'Event' ); |
|
| 156 | + $EEM_Event = EE_Registry::instance()->load_model('Event'); |
|
| 157 | 157 | $event = $EEM_Event->get_one_by_ID( |
| 158 | - EE_Registry::instance()->REQ->get( 'event', 0 ) |
|
| 158 | + EE_Registry::instance()->REQ->get('event', 0) |
|
| 159 | 159 | ); |
| 160 | - EE_Registry::instance()->REQ->set_espresso_page( true ); |
|
| 161 | - $template_args['ticket_selector'] = EED_Ticket_Selector::display_ticket_selector( $event ); |
|
| 160 | + EE_Registry::instance()->REQ->set_espresso_page(true); |
|
| 161 | + $template_args['ticket_selector'] = EED_Ticket_Selector::display_ticket_selector($event); |
|
| 162 | 162 | $template_args['css'] = apply_filters( |
| 163 | 163 | 'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css', |
| 164 | 164 | array( |
| 165 | - TICKET_SELECTOR_ASSETS_URL . 'ticket_selector_embed.css?ver=' . EVENT_ESPRESSO_VERSION, |
|
| 166 | - TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css?ver=' . EVENT_ESPRESSO_VERSION, |
|
| 167 | - includes_url( 'css/dashicons.min.css?ver=' . $GLOBALS['wp_version'] ), |
|
| 168 | - EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION |
|
| 165 | + TICKET_SELECTOR_ASSETS_URL.'ticket_selector_embed.css?ver='.EVENT_ESPRESSO_VERSION, |
|
| 166 | + TICKET_SELECTOR_ASSETS_URL.'ticket_selector.css?ver='.EVENT_ESPRESSO_VERSION, |
|
| 167 | + includes_url('css/dashicons.min.css?ver='.$GLOBALS['wp_version']), |
|
| 168 | + EE_GLOBAL_ASSETS_URL.'css/espresso_default.css?ver='.EVENT_ESPRESSO_VERSION |
|
| 169 | 169 | ) |
| 170 | 170 | ); |
| 171 | - EE_Registry::$i18n_js_strings[ 'ticket_selector_iframe' ] = true; |
|
| 172 | - EE_Registry::$i18n_js_strings[ 'EEDTicketSelectorMsg' ] = esc_html__( 'Please choose at least one ticket before continuing.', 'event_espresso' ); |
|
| 171 | + EE_Registry::$i18n_js_strings['ticket_selector_iframe'] = true; |
|
| 172 | + EE_Registry::$i18n_js_strings['EEDTicketSelectorMsg'] = esc_html__('Please choose at least one ticket before continuing.', 'event_espresso'); |
|
| 173 | 173 | $template_args['eei18n'] = apply_filters( |
| 174 | 174 | 'FHEE__EED_Ticket_Selector__ticket_selector_iframe__eei18n_js_strings', |
| 175 | 175 | EE_Registry::localize_i18n_js_strings() |
@@ -177,18 +177,18 @@ discard block |
||
| 177 | 177 | $template_args['js'] = apply_filters( |
| 178 | 178 | 'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js', |
| 179 | 179 | array( |
| 180 | - includes_url( 'js/jquery/jquery.js?ver=' . $GLOBALS['wp_version'] ), |
|
| 181 | - EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js?ver=' . EVENT_ESPRESSO_VERSION, |
|
| 182 | - TICKET_SELECTOR_ASSETS_URL . 'ticket_selector_iframe_embed.js?ver=' . EVENT_ESPRESSO_VERSION |
|
| 180 | + includes_url('js/jquery/jquery.js?ver='.$GLOBALS['wp_version']), |
|
| 181 | + EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js?ver='.EVENT_ESPRESSO_VERSION, |
|
| 182 | + TICKET_SELECTOR_ASSETS_URL.'ticket_selector_iframe_embed.js?ver='.EVENT_ESPRESSO_VERSION |
|
| 183 | 183 | ) |
| 184 | 184 | ); |
| 185 | - $template_args[ 'notices' ] = EEH_Template::display_template( |
|
| 186 | - EE_TEMPLATES . 'espresso-ajax-notices.template.php', |
|
| 185 | + $template_args['notices'] = EEH_Template::display_template( |
|
| 186 | + EE_TEMPLATES.'espresso-ajax-notices.template.php', |
|
| 187 | 187 | array(), |
| 188 | 188 | true |
| 189 | 189 | ); |
| 190 | 190 | EEH_Template::display_template( |
| 191 | - TICKET_SELECTOR_TEMPLATES_PATH . 'ticket_selector_chart_iframe.template.php', |
|
| 191 | + TICKET_SELECTOR_TEMPLATES_PATH.'ticket_selector_chart_iframe.template.php', |
|
| 192 | 192 | $template_args |
| 193 | 193 | ); |
| 194 | 194 | exit; |
@@ -207,25 +207,25 @@ discard block |
||
| 207 | 207 | * |
| 208 | 208 | * @return string The new html string for the permalink area. |
| 209 | 209 | */ |
| 210 | - public static function iframe_code_button( $permalink_string, $id, $new_title, $new_slug ) { |
|
| 210 | + public static function iframe_code_button($permalink_string, $id, $new_title, $new_slug) { |
|
| 211 | 211 | //make sure this is ONLY when editing and the event id has been set. |
| 212 | - if ( ! empty( $id ) ) { |
|
| 213 | - $post = get_post( $id ); |
|
| 212 | + if ( ! empty($id)) { |
|
| 213 | + $post = get_post($id); |
|
| 214 | 214 | //if NOT event then let's get out. |
| 215 | - if ( $post->post_type !== 'espresso_events' ) { |
|
| 215 | + if ($post->post_type !== 'espresso_events') { |
|
| 216 | 216 | return $permalink_string; |
| 217 | 217 | } |
| 218 | 218 | $permalink_string .= '<a id="js-ticket-selector-embed-trigger" class="button button-small" href="#" tabindex="-1">' |
| 219 | - . __( 'Embed', 'event_espresso' ) |
|
| 219 | + . __('Embed', 'event_espresso') |
|
| 220 | 220 | . '</a> '; |
| 221 | - $ticket_selector_url = add_query_arg( array( 'ticket_selector' => 'iframe', 'event' => $id ), site_url() ); |
|
| 221 | + $ticket_selector_url = add_query_arg(array('ticket_selector' => 'iframe', 'event' => $id), site_url()); |
|
| 222 | 222 | $iframe_string = esc_html( |
| 223 | - '<iframe src="' . $ticket_selector_url . '" width="100%" height="100%"></iframe>' |
|
| 223 | + '<iframe src="'.$ticket_selector_url.'" width="100%" height="100%"></iframe>' |
|
| 224 | 224 | ); |
| 225 | 225 | $permalink_string .= ' |
| 226 | 226 | <div id="js-ts-iframe" style="display:none"> |
| 227 | 227 | <div style="width:100%; height: 500px;"> |
| 228 | - ' . $iframe_string . ' |
|
| 228 | + ' . $iframe_string.' |
|
| 229 | 229 | </div> |
| 230 | 230 | </div>'; |
| 231 | 231 | } |
@@ -244,22 +244,22 @@ discard block |
||
| 244 | 244 | * @param mixed $event |
| 245 | 245 | * @return bool |
| 246 | 246 | */ |
| 247 | - protected static function set_event( $event = null ) { |
|
| 248 | - if( $event === null ) { |
|
| 247 | + protected static function set_event($event = null) { |
|
| 248 | + if ($event === null) { |
|
| 249 | 249 | global $post; |
| 250 | 250 | $event = $post; |
| 251 | 251 | } |
| 252 | - if ( $event instanceof EE_Event ) { |
|
| 252 | + if ($event instanceof EE_Event) { |
|
| 253 | 253 | self::$_event = $event; |
| 254 | - } else if ( $event instanceof WP_Post && isset( $event->EE_Event ) && $event->EE_Event instanceof EE_Event ) { |
|
| 254 | + } else if ($event instanceof WP_Post && isset($event->EE_Event) && $event->EE_Event instanceof EE_Event) { |
|
| 255 | 255 | self::$_event = $event->EE_Event; |
| 256 | - } else if ( $event instanceof WP_Post && $event->post_type == 'espresso_events' ) { |
|
| 257 | - $event->EE_Event = EEM_Event::instance()->instantiate_class_from_post_object( $event ); |
|
| 256 | + } else if ($event instanceof WP_Post && $event->post_type == 'espresso_events') { |
|
| 257 | + $event->EE_Event = EEM_Event::instance()->instantiate_class_from_post_object($event); |
|
| 258 | 258 | self::$_event = $event->EE_Event; |
| 259 | 259 | } else { |
| 260 | - $user_msg = __( 'No Event object or an invalid Event object was supplied.', 'event_espresso' ); |
|
| 261 | - $dev_msg = $user_msg . __( 'In order to generate a ticket selector, please ensure you are passing either an EE_Event object or a WP_Post object of the post type "espresso_event" to the EE_Ticket_Selector class constructor.', 'event_espresso' ); |
|
| 262 | - EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 260 | + $user_msg = __('No Event object or an invalid Event object was supplied.', 'event_espresso'); |
|
| 261 | + $dev_msg = $user_msg.__('In order to generate a ticket selector, please ensure you are passing either an EE_Event object or a WP_Post object of the post type "espresso_event" to the EE_Ticket_Selector class constructor.', 'event_espresso'); |
|
| 262 | + EE_Error::add_error($user_msg.'||'.$dev_msg, __FILE__, __FUNCTION__, __LINE__); |
|
| 263 | 263 | return false; |
| 264 | 264 | } |
| 265 | 265 | return true; |
@@ -278,11 +278,11 @@ discard block |
||
| 278 | 278 | * @param bool $view_details |
| 279 | 279 | * @return string |
| 280 | 280 | */ |
| 281 | - public static function display_ticket_selector( $event = NULL, $view_details = FALSE ) { |
|
| 281 | + public static function display_ticket_selector($event = NULL, $view_details = FALSE) { |
|
| 282 | 282 | // reset filter for displaying submit button |
| 283 | - remove_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' ); |
|
| 283 | + remove_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true'); |
|
| 284 | 284 | // poke and prod incoming event till it tells us what it is |
| 285 | - if ( ! EED_Ticket_Selector::set_event( $event )) { |
|
| 285 | + if ( ! EED_Ticket_Selector::set_event($event)) { |
|
| 286 | 286 | return false; |
| 287 | 287 | } |
| 288 | 288 | $event_post = self::$_event instanceof EE_Event ? self::$_event->ID() : $event; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | && ( |
| 294 | 294 | ! self::$_event->display_ticket_selector() |
| 295 | 295 | || $view_details |
| 296 | - || post_password_required( $event_post ) |
|
| 296 | + || post_password_required($event_post) |
|
| 297 | 297 | || ( |
| 298 | 298 | $_event_active_status != EE_Datetime::active |
| 299 | 299 | && $_event_active_status != EE_Datetime::upcoming |
@@ -311,34 +311,34 @@ discard block |
||
| 311 | 311 | $template_args = array(); |
| 312 | 312 | $template_args['event_status'] = $_event_active_status; |
| 313 | 313 | |
| 314 | - $template_args['date_format'] = apply_filters( 'FHEE__EED_Ticket_Selector__display_ticket_selector__date_format', get_option( 'date_format' ) ); |
|
| 315 | - $template_args['time_format'] = apply_filters( 'FHEE__EED_Ticket_Selector__display_ticket_selector__time_format', get_option( 'time_format' ) ); |
|
| 314 | + $template_args['date_format'] = apply_filters('FHEE__EED_Ticket_Selector__display_ticket_selector__date_format', get_option('date_format')); |
|
| 315 | + $template_args['time_format'] = apply_filters('FHEE__EED_Ticket_Selector__display_ticket_selector__time_format', get_option('time_format')); |
|
| 316 | 316 | |
| 317 | 317 | $template_args['EVT_ID'] = self::$_event->ID(); |
| 318 | 318 | $template_args['event'] = self::$_event; |
| 319 | 319 | |
| 320 | 320 | // is the event expired ? |
| 321 | 321 | $template_args['event_is_expired'] = self::$_event->is_expired(); |
| 322 | - if ( $template_args['event_is_expired'] ) { |
|
| 323 | - return '<div class="ee-event-expired-notice"><span class="important-notice">' . __( 'We\'re sorry, but all tickets sales have ended because the event is expired.', 'event_espresso' ) . '</span></div>'; |
|
| 322 | + if ($template_args['event_is_expired']) { |
|
| 323 | + return '<div class="ee-event-expired-notice"><span class="important-notice">'.__('We\'re sorry, but all tickets sales have ended because the event is expired.', 'event_espresso').'</span></div>'; |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | $ticket_query_args = array( |
| 327 | - array( 'Datetime.EVT_ID' => self::$_event->ID() ), |
|
| 328 | - 'order_by' => array( 'TKT_order' => 'ASC', 'TKT_required' => 'DESC', 'TKT_start_date' => 'ASC', 'TKT_end_date' => 'ASC' , 'Datetime.DTT_EVT_start' => 'DESC' ) |
|
| 327 | + array('Datetime.EVT_ID' => self::$_event->ID()), |
|
| 328 | + 'order_by' => array('TKT_order' => 'ASC', 'TKT_required' => 'DESC', 'TKT_start_date' => 'ASC', 'TKT_end_date' => 'ASC', 'Datetime.DTT_EVT_start' => 'DESC') |
|
| 329 | 329 | ); |
| 330 | 330 | |
| 331 | - if ( ! EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector->show_expired_tickets ) { |
|
| 331 | + if ( ! EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector->show_expired_tickets) { |
|
| 332 | 332 | //use the correct applicable time query depending on what version of core is being run. |
| 333 | - $current_time = method_exists( 'EEM_Datetime', 'current_time_for_query' ) ? time() : current_time('timestamp'); |
|
| 334 | - $ticket_query_args[0]['TKT_end_date'] = array( '>', $current_time ); |
|
| 333 | + $current_time = method_exists('EEM_Datetime', 'current_time_for_query') ? time() : current_time('timestamp'); |
|
| 334 | + $ticket_query_args[0]['TKT_end_date'] = array('>', $current_time); |
|
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | // get all tickets for this event ordered by the datetime |
| 338 | - $template_args['tickets'] = EEM_Ticket::instance()->get_all( $ticket_query_args ); |
|
| 338 | + $template_args['tickets'] = EEM_Ticket::instance()->get_all($ticket_query_args); |
|
| 339 | 339 | |
| 340 | - if ( count( $template_args['tickets'] ) < 1 ) { |
|
| 341 | - return '<div class="ee-event-expired-notice"><span class="important-notice">' . __( 'We\'re sorry, but all ticket sales have ended.', 'event_espresso' ) . '</span></div>'; |
|
| 340 | + if (count($template_args['tickets']) < 1) { |
|
| 341 | + return '<div class="ee-event-expired-notice"><span class="important-notice">'.__('We\'re sorry, but all ticket sales have ended.', 'event_espresso').'</span></div>'; |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | // filter the maximum qty that can appear in the Ticket Selector qty dropdowns |
@@ -347,36 +347,36 @@ discard block |
||
| 347 | 347 | self::$_event->additional_limit() |
| 348 | 348 | ); |
| 349 | 349 | $template_args['max_atndz'] = \EED_Ticket_Selector::$_max_atndz; |
| 350 | - if ( $template_args['max_atndz'] < 1 ) { |
|
| 351 | - $sales_closed_msg = __( 'We\'re sorry, but ticket sales have been closed at this time. Please check back again later.', 'event_espresso' ); |
|
| 352 | - if ( current_user_can( 'edit_post', self::$_event->ID() )) { |
|
| 353 | - $sales_closed_msg .= sprintf( |
|
| 354 | - __( '%sNote to Event Admin:%sThe "Maximum number of tickets allowed per order for this event" in the Event Registration Options has been set to "0". This effectively turns off ticket sales. %s(click to edit this event)%s', 'event_espresso' ), |
|
| 350 | + if ($template_args['max_atndz'] < 1) { |
|
| 351 | + $sales_closed_msg = __('We\'re sorry, but ticket sales have been closed at this time. Please check back again later.', 'event_espresso'); |
|
| 352 | + if (current_user_can('edit_post', self::$_event->ID())) { |
|
| 353 | + $sales_closed_msg .= sprintf( |
|
| 354 | + __('%sNote to Event Admin:%sThe "Maximum number of tickets allowed per order for this event" in the Event Registration Options has been set to "0". This effectively turns off ticket sales. %s(click to edit this event)%s', 'event_espresso'), |
|
| 355 | 355 | '<div class="ee-attention" style="text-align: left;"><b>', |
| 356 | 356 | '</b><br />', |
| 357 | - $link = '<span class="edit-link"><a class="post-edit-link" href="' . get_edit_post_link( self::$_event->ID() ) . '">', |
|
| 357 | + $link = '<span class="edit-link"><a class="post-edit-link" href="'.get_edit_post_link(self::$_event->ID()).'">', |
|
| 358 | 358 | '</a></span></div>' |
| 359 | 359 | ); |
| 360 | 360 | } |
| 361 | - return '<p><span class="important-notice">' . $sales_closed_msg . '</span></p>'; |
|
| 361 | + return '<p><span class="important-notice">'.$sales_closed_msg.'</span></p>'; |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | - $templates['ticket_selector'] = TICKET_SELECTOR_TEMPLATES_PATH . 'ticket_selector_chart.template.php'; |
|
| 365 | - $templates['ticket_selector'] = apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', $templates['ticket_selector'], self::$_event ); |
|
| 364 | + $templates['ticket_selector'] = TICKET_SELECTOR_TEMPLATES_PATH.'ticket_selector_chart.template.php'; |
|
| 365 | + $templates['ticket_selector'] = apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', $templates['ticket_selector'], self::$_event); |
|
| 366 | 366 | |
| 367 | 367 | // redirecting to another site for registration ?? |
| 368 | 368 | $external_url = self::$_event->external_url() !== NULL || self::$_event->external_url() !== '' ? self::$_event->external_url() : FALSE; |
| 369 | 369 | // set up the form (but not for the admin) |
| 370 | - $ticket_selector = ! is_admin() ? EED_Ticket_Selector::ticket_selector_form_open( self::$_event->ID(), $external_url ) : ''; |
|
| 370 | + $ticket_selector = ! is_admin() ? EED_Ticket_Selector::ticket_selector_form_open(self::$_event->ID(), $external_url) : ''; |
|
| 371 | 371 | // if not redirecting to another site for registration |
| 372 | - if ( ! $external_url ) { |
|
| 372 | + if ( ! $external_url) { |
|
| 373 | 373 | // then display the ticket selector |
| 374 | - $ticket_selector .= EEH_Template::locate_template( $templates['ticket_selector'], $template_args ); |
|
| 374 | + $ticket_selector .= EEH_Template::locate_template($templates['ticket_selector'], $template_args); |
|
| 375 | 375 | } else { |
| 376 | 376 | // if not we still need to trigger the display of the submit button |
| 377 | - add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' ); |
|
| 377 | + add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true'); |
|
| 378 | 378 | //display notice to admin that registration is external |
| 379 | - $ticket_selector .= ! is_admin() ? '' : __( 'Registration is at an external URL for this event.', 'event_espresso' ); |
|
| 379 | + $ticket_selector .= ! is_admin() ? '' : __('Registration is at an external URL for this event.', 'event_espresso'); |
|
| 380 | 380 | } |
| 381 | 381 | // submit button and form close tag |
| 382 | 382 | $ticket_selector .= ! is_admin() ? EED_Ticket_Selector::display_ticket_selector_submit() : ''; |
@@ -396,25 +396,25 @@ discard block |
||
| 396 | 396 | * @param string $external_url |
| 397 | 397 | * @return string |
| 398 | 398 | */ |
| 399 | - public static function ticket_selector_form_open( $ID = 0, $external_url = '' ) { |
|
| 399 | + public static function ticket_selector_form_open($ID = 0, $external_url = '') { |
|
| 400 | 400 | // if redirecting, we don't need any anything else |
| 401 | - if ( $external_url ) { |
|
| 402 | - $html = '<form method="GET" action="' . EEH_URL::refactor_url( $external_url ) . '">'; |
|
| 403 | - $query_args = EEH_URL::get_query_string( $external_url ); |
|
| 404 | - foreach ( $query_args as $query_arg => $value ) { |
|
| 405 | - $html .= '<input type="hidden" name="' . $query_arg . '" value="' . $value . '">'; |
|
| 401 | + if ($external_url) { |
|
| 402 | + $html = '<form method="GET" action="'.EEH_URL::refactor_url($external_url).'">'; |
|
| 403 | + $query_args = EEH_URL::get_query_string($external_url); |
|
| 404 | + foreach ($query_args as $query_arg => $value) { |
|
| 405 | + $html .= '<input type="hidden" name="'.$query_arg.'" value="'.$value.'">'; |
|
| 406 | 406 | } |
| 407 | 407 | return $html; |
| 408 | 408 | } |
| 409 | - $checkout_url = EEH_Event_View::event_link_url( $ID ); |
|
| 410 | - if ( ! $checkout_url ) { |
|
| 411 | - EE_Error::add_error( __('The URL for the Event Details page could not be retrieved.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 409 | + $checkout_url = EEH_Event_View::event_link_url($ID); |
|
| 410 | + if ( ! $checkout_url) { |
|
| 411 | + EE_Error::add_error(__('The URL for the Event Details page could not be retrieved.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
| 412 | 412 | } |
| 413 | 413 | $extra_params = self::$_in_iframe ? ' target="_blank"' : ''; |
| 414 | - $html = '<form method="POST" action="' . $checkout_url . '"' . $extra_params . '>'; |
|
| 415 | - $html .= wp_nonce_field( 'process_ticket_selections', 'process_ticket_selections_nonce', TRUE, FALSE ); |
|
| 414 | + $html = '<form method="POST" action="'.$checkout_url.'"'.$extra_params.'>'; |
|
| 415 | + $html .= wp_nonce_field('process_ticket_selections', 'process_ticket_selections_nonce', TRUE, FALSE); |
|
| 416 | 416 | $html .= '<input type="hidden" name="ee" value="process_ticket_selections">'; |
| 417 | - $html = apply_filters( 'FHEE__EE_Ticket_Selector__ticket_selector_form_open__html', $html, self::$_event ); |
|
| 417 | + $html = apply_filters('FHEE__EE_Ticket_Selector__ticket_selector_form_open__html', $html, self::$_event); |
|
| 418 | 418 | return $html; |
| 419 | 419 | } |
| 420 | 420 | |
@@ -429,30 +429,30 @@ discard block |
||
| 429 | 429 | * @return string |
| 430 | 430 | */ |
| 431 | 431 | public static function display_ticket_selector_submit() { |
| 432 | - if ( ! is_admin() ) { |
|
| 433 | - if ( apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', FALSE ) ) { |
|
| 432 | + if ( ! is_admin()) { |
|
| 433 | + if (apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', FALSE)) { |
|
| 434 | 434 | $btn_text = apply_filters( |
| 435 | 435 | 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit__btn_text', |
| 436 | - __('Register Now', 'event_espresso' ), |
|
| 436 | + __('Register Now', 'event_espresso'), |
|
| 437 | 437 | EED_Ticket_Selector::$_event |
| 438 | 438 | ); |
| 439 | 439 | $external_url = EED_Ticket_Selector::$_event->external_url(); |
| 440 | - $html = '<input id="ticket-selector-submit-'. EED_Ticket_Selector::$_event->ID() .'-btn"'; |
|
| 440 | + $html = '<input id="ticket-selector-submit-'.EED_Ticket_Selector::$_event->ID().'-btn"'; |
|
| 441 | 441 | $html .= ' class="ticket-selector-submit-btn '; |
| 442 | - $html .= empty( $external_url ) ? 'ticket-selector-submit-ajax"' : '"'; |
|
| 443 | - $html .= ' type="submit" value="' . $btn_text . '" />'; |
|
| 442 | + $html .= empty($external_url) ? 'ticket-selector-submit-ajax"' : '"'; |
|
| 443 | + $html .= ' type="submit" value="'.$btn_text.'" />'; |
|
| 444 | 444 | $html .= apply_filters( |
| 445 | 445 | 'FHEE__EE_Ticket_Selector__after_ticket_selector_submit', |
| 446 | 446 | '', |
| 447 | 447 | EED_Ticket_Selector::$_event |
| 448 | 448 | ); |
| 449 | 449 | $html .= '<div class="clear"><br/></div></form>'; |
| 450 | - if ( ! is_archive() ) { |
|
| 450 | + if ( ! is_archive()) { |
|
| 451 | 451 | $html .= \EEH_Template::powered_by_event_espresso(); |
| 452 | 452 | } |
| 453 | 453 | return $html; |
| 454 | - } else if ( is_archive() ) { |
|
| 455 | - return EED_Ticket_Selector::ticket_selector_form_close() . EED_Ticket_Selector::display_view_details_btn(); |
|
| 454 | + } else if (is_archive()) { |
|
| 455 | + return EED_Ticket_Selector::ticket_selector_form_close().EED_Ticket_Selector::display_view_details_btn(); |
|
| 456 | 456 | } else if ( |
| 457 | 457 | EED_Ticket_Selector::$_event instanceof EE_Event |
| 458 | 458 | // if $_max_atndz === 1 (ie: a "Dude Where's my Ticket Selector?" type event) |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | $html = apply_filters( |
| 465 | 465 | 'FHEE__EE_Ticket_Selector__no_ticket_selector_submit', |
| 466 | 466 | sprintf( |
| 467 | - __( '%1$s"%2$s" is currently sold out. Please check back again later, as spots may become available.%3$s', 'event_espresso' ), |
|
| 467 | + __('%1$s"%2$s" is currently sold out. Please check back again later, as spots may become available.%3$s', 'event_espresso'), |
|
| 468 | 468 | '<p class="no-ticket-selector-msg important-notice">', |
| 469 | 469 | EED_Ticket_Selector::$_event->name(), |
| 470 | 470 | '</p>' |
@@ -506,13 +506,13 @@ discard block |
||
| 506 | 506 | * @return string |
| 507 | 507 | */ |
| 508 | 508 | public static function display_view_details_btn() { |
| 509 | - if ( ! self::$_event->get_permalink() ) { |
|
| 510 | - EE_Error::add_error( __('The URL for the Event Details page could not be retrieved.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 509 | + if ( ! self::$_event->get_permalink()) { |
|
| 510 | + EE_Error::add_error(__('The URL for the Event Details page could not be retrieved.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
| 511 | 511 | } |
| 512 | - $view_details_btn = '<form method="POST" action="' . self::$_event->get_permalink() . '">'; |
|
| 513 | - $btn_text = apply_filters( 'FHEE__EE_Ticket_Selector__display_view_details_btn__btn_text', __( 'View Details', 'event_espresso' ), self::$_event ); |
|
| 514 | - $view_details_btn .= '<input id="ticket-selector-submit-'. self::$_event->ID() .'-btn" class="ticket-selector-submit-btn view-details-btn" type="submit" value="' . $btn_text . '" />'; |
|
| 515 | - $view_details_btn .= apply_filters( 'FHEE__EE_Ticket_Selector__after_view_details_btn', '', self::$_event ); |
|
| 512 | + $view_details_btn = '<form method="POST" action="'.self::$_event->get_permalink().'">'; |
|
| 513 | + $btn_text = apply_filters('FHEE__EE_Ticket_Selector__display_view_details_btn__btn_text', __('View Details', 'event_espresso'), self::$_event); |
|
| 514 | + $view_details_btn .= '<input id="ticket-selector-submit-'.self::$_event->ID().'-btn" class="ticket-selector-submit-btn view-details-btn" type="submit" value="'.$btn_text.'" />'; |
|
| 515 | + $view_details_btn .= apply_filters('FHEE__EE_Ticket_Selector__after_view_details_btn', '', self::$_event); |
|
| 516 | 516 | $view_details_btn .= '<div class="clear"><br/></div>'; |
| 517 | 517 | $view_details_btn .= '</form>'; |
| 518 | 518 | return $view_details_btn; |
@@ -530,11 +530,11 @@ discard block |
||
| 530 | 530 | * @return array|boolean |
| 531 | 531 | */ |
| 532 | 532 | public function process_ticket_selections() { |
| 533 | - do_action( 'EED_Ticket_Selector__process_ticket_selections__before' ); |
|
| 533 | + do_action('EED_Ticket_Selector__process_ticket_selections__before'); |
|
| 534 | 534 | // check nonce |
| 535 | - if ( ! is_admin() && ( ! EE_Registry::instance()->REQ->is_set( 'process_ticket_selections_nonce' ) || ! wp_verify_nonce( EE_Registry::instance()->REQ->get( 'process_ticket_selections_nonce' ), 'process_ticket_selections' ))) { |
|
| 535 | + if ( ! is_admin() && ( ! EE_Registry::instance()->REQ->is_set('process_ticket_selections_nonce') || ! wp_verify_nonce(EE_Registry::instance()->REQ->get('process_ticket_selections_nonce'), 'process_ticket_selections'))) { |
|
| 536 | 536 | EE_Error::add_error( |
| 537 | - sprintf( __( 'We\'re sorry but your request failed to pass a security check.%sPlease click the back button on your browser and try again.', 'event_espresso' ), '<br/>' ), |
|
| 537 | + sprintf(__('We\'re sorry but your request failed to pass a security check.%sPlease click the back button on your browser and try again.', 'event_espresso'), '<br/>'), |
|
| 538 | 538 | __FILE__, __FUNCTION__, __LINE__ |
| 539 | 539 | ); |
| 540 | 540 | return FALSE; |
@@ -548,16 +548,16 @@ discard block |
||
| 548 | 548 | |
| 549 | 549 | //we should really only have 1 registration in the works now (ie, no MER) so clear any previous items in the cart. |
| 550 | 550 | // When MER happens this will probably need to be tweaked, possibly wrapped in a conditional checking for some constant defined in MER etc. |
| 551 | - EE_Registry::instance()->load_core( 'Session' ); |
|
| 551 | + EE_Registry::instance()->load_core('Session'); |
|
| 552 | 552 | // unless otherwise requested, clear the session |
| 553 | - if ( apply_filters( 'FHEE__EE_Ticket_Selector__process_ticket_selections__clear_session', TRUE )) { |
|
| 554 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
| 553 | + if (apply_filters('FHEE__EE_Ticket_Selector__process_ticket_selections__clear_session', TRUE)) { |
|
| 554 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
| 555 | 555 | } |
| 556 | 556 | //d( EE_Registry::instance()->SSN ); |
| 557 | 557 | |
| 558 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
| 558 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
| 559 | 559 | // do we have an event id? |
| 560 | - if ( EE_Registry::instance()->REQ->is_set( 'tkt-slctr-event-id' ) ) { |
|
| 560 | + if (EE_Registry::instance()->REQ->is_set('tkt-slctr-event-id')) { |
|
| 561 | 561 | // validate/sanitize data |
| 562 | 562 | $valid = self::_validate_post_data(); |
| 563 | 563 | |
@@ -567,41 +567,41 @@ discard block |
||
| 567 | 567 | //EEH_Debug_Tools::printr( $valid[ 'max_atndz' ], 'max_atndz', __FILE__, __LINE__ ); |
| 568 | 568 | |
| 569 | 569 | //check total tickets ordered vs max number of attendees that can register |
| 570 | - if ( $valid['total_tickets'] > $valid['max_atndz'] ) { |
|
| 570 | + if ($valid['total_tickets'] > $valid['max_atndz']) { |
|
| 571 | 571 | |
| 572 | 572 | // ordering too many tickets !!! |
| 573 | 573 | $total_tickets_string = _n('You have attempted to purchase %s ticket.', 'You have attempted to purchase %s tickets.', $valid['total_tickets'], 'event_espresso'); |
| 574 | - $limit_error_1 = sprintf( $total_tickets_string, $valid['total_tickets'] ); |
|
| 574 | + $limit_error_1 = sprintf($total_tickets_string, $valid['total_tickets']); |
|
| 575 | 575 | // dev only message |
| 576 | 576 | $max_atndz_string = _n('The registration limit for this event is %s ticket per registration, therefore the total number of tickets you may purchase at a time can not exceed %s.', 'The registration limit for this event is %s tickets per registration, therefore the total number of tickets you may purchase at a time can not exceed %s.', $valid['max_atndz'], 'event_espresso'); |
| 577 | - $limit_error_2 = sprintf( $max_atndz_string, $valid['max_atndz'], $valid['max_atndz'] ); |
|
| 578 | - EE_Error::add_error( $limit_error_1 . '<br/>' . $limit_error_2, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 577 | + $limit_error_2 = sprintf($max_atndz_string, $valid['max_atndz'], $valid['max_atndz']); |
|
| 578 | + EE_Error::add_error($limit_error_1.'<br/>'.$limit_error_2, __FILE__, __FUNCTION__, __LINE__); |
|
| 579 | 579 | } else { |
| 580 | 580 | |
| 581 | 581 | // all data appears to be valid |
| 582 | 582 | $tckts_slctd = FALSE; |
| 583 | 583 | $success = TRUE; |
| 584 | 584 | // load cart |
| 585 | - EE_Registry::instance()->load_core( 'Cart' ); |
|
| 585 | + EE_Registry::instance()->load_core('Cart'); |
|
| 586 | 586 | |
| 587 | 587 | // cycle thru the number of data rows sent from the event listing |
| 588 | - for ( $x = 0; $x < $valid['rows']; $x++ ) { |
|
| 588 | + for ($x = 0; $x < $valid['rows']; $x++) { |
|
| 589 | 589 | // does this row actually contain a ticket quantity? |
| 590 | - if ( isset( $valid['qty'][$x] ) && $valid['qty'][$x] > 0 ) { |
|
| 590 | + if (isset($valid['qty'][$x]) && $valid['qty'][$x] > 0) { |
|
| 591 | 591 | // YES we have a ticket quantity |
| 592 | 592 | $tckts_slctd = TRUE; |
| 593 | 593 | // d( $valid['ticket_obj'][$x] ); |
| 594 | - if ( $valid['ticket_obj'][$x] instanceof EE_Ticket ) { |
|
| 594 | + if ($valid['ticket_obj'][$x] instanceof EE_Ticket) { |
|
| 595 | 595 | // then add ticket to cart |
| 596 | - $ticket_added = self::_add_ticket_to_cart( $valid['ticket_obj'][$x], $valid['qty'][$x] ); |
|
| 596 | + $ticket_added = self::_add_ticket_to_cart($valid['ticket_obj'][$x], $valid['qty'][$x]); |
|
| 597 | 597 | $success = ! $ticket_added ? FALSE : $success; |
| 598 | - if ( EE_Error::has_error() ) { |
|
| 598 | + if (EE_Error::has_error()) { |
|
| 599 | 599 | break; |
| 600 | 600 | } |
| 601 | 601 | } else { |
| 602 | 602 | // nothing added to cart retrieved |
| 603 | 603 | EE_Error::add_error( |
| 604 | - sprintf( __( 'A valid ticket could not be retrieved for the event.%sPlease click the back button on your browser and try again.', 'event_espresso' ), '<br/>' ), |
|
| 604 | + sprintf(__('A valid ticket could not be retrieved for the event.%sPlease click the back button on your browser and try again.', 'event_espresso'), '<br/>'), |
|
| 605 | 605 | __FILE__, __FUNCTION__, __LINE__ |
| 606 | 606 | ); |
| 607 | 607 | } |
@@ -610,45 +610,45 @@ discard block |
||
| 610 | 610 | //d( EE_Registry::instance()->CART ); |
| 611 | 611 | //die(); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< KILL REDIRECT HERE BEFORE CART UPDATE |
| 612 | 612 | |
| 613 | - if ( $tckts_slctd ) { |
|
| 614 | - if ( $success ) { |
|
| 615 | - do_action( 'FHEE__EE_Ticket_Selector__process_ticket_selections__before_redirecting_to_checkout', EE_Registry::instance()->CART, $this ); |
|
| 613 | + if ($tckts_slctd) { |
|
| 614 | + if ($success) { |
|
| 615 | + do_action('FHEE__EE_Ticket_Selector__process_ticket_selections__before_redirecting_to_checkout', EE_Registry::instance()->CART, $this); |
|
| 616 | 616 | EE_Registry::instance()->CART->recalculate_all_cart_totals(); |
| 617 | - EE_Registry::instance()->CART->save_cart( FALSE ); |
|
| 617 | + EE_Registry::instance()->CART->save_cart(FALSE); |
|
| 618 | 618 | EE_Registry::instance()->SSN->update(); |
| 619 | 619 | //d( EE_Registry::instance()->CART ); |
| 620 | 620 | //die(); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< OR HERE TO KILL REDIRECT AFTER CART UPDATE |
| 621 | 621 | // just return TRUE for registrations being made from admin |
| 622 | - if ( is_admin() ) { |
|
| 622 | + if (is_admin()) { |
|
| 623 | 623 | return TRUE; |
| 624 | 624 | } |
| 625 | - wp_safe_redirect( apply_filters( 'FHEE__EE_Ticket_Selector__process_ticket_selections__success_redirect_url', EE_Registry::instance()->CFG->core->reg_page_url() )); |
|
| 625 | + wp_safe_redirect(apply_filters('FHEE__EE_Ticket_Selector__process_ticket_selections__success_redirect_url', EE_Registry::instance()->CFG->core->reg_page_url())); |
|
| 626 | 626 | exit(); |
| 627 | 627 | |
| 628 | 628 | } else { |
| 629 | - if ( ! EE_Error::has_error() ) { |
|
| 629 | + if ( ! EE_Error::has_error()) { |
|
| 630 | 630 | // nothing added to cart |
| 631 | - EE_Error::add_attention( __( 'No tickets were added for the event', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 631 | + EE_Error::add_attention(__('No tickets were added for the event', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
| 632 | 632 | } |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | } else { |
| 636 | 636 | // no ticket quantities were selected |
| 637 | - EE_Error::add_error( __( 'You need to select a ticket quantity before you can proceed.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 637 | + EE_Error::add_error(__('You need to select a ticket quantity before you can proceed.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
| 638 | 638 | } |
| 639 | 639 | } |
| 640 | 640 | //die(); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< KILL BEFORE REDIRECT |
| 641 | 641 | // at this point, just return if registration is being made from admin |
| 642 | - if ( is_admin() ) { |
|
| 642 | + if (is_admin()) { |
|
| 643 | 643 | return FALSE; |
| 644 | 644 | } |
| 645 | - if ( $valid['return_url'] ) { |
|
| 646 | - EE_Error::get_notices( FALSE, TRUE ); |
|
| 647 | - wp_safe_redirect( $valid['return_url'] ); |
|
| 645 | + if ($valid['return_url']) { |
|
| 646 | + EE_Error::get_notices(FALSE, TRUE); |
|
| 647 | + wp_safe_redirect($valid['return_url']); |
|
| 648 | 648 | exit(); |
| 649 | - } elseif ( isset( $event_to_add['id'] )) { |
|
| 650 | - EE_Error::get_notices( FALSE, TRUE ); |
|
| 651 | - wp_safe_redirect( get_permalink( $event_to_add['id'] )); |
|
| 649 | + } elseif (isset($event_to_add['id'])) { |
|
| 650 | + EE_Error::get_notices(FALSE, TRUE); |
|
| 651 | + wp_safe_redirect(get_permalink($event_to_add['id'])); |
|
| 652 | 652 | exit(); |
| 653 | 653 | } else { |
| 654 | 654 | echo EE_Error::get_notices(); |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | } else { |
| 658 | 658 | // $_POST['tkt-slctr-event-id'] was not set ?!?!?!? |
| 659 | 659 | EE_Error::add_error( |
| 660 | - sprintf( __( 'An event id was not provided or was not received.%sPlease click the back button on your browser and try again.', 'event_espresso' ), '<br/>' ), |
|
| 660 | + sprintf(__('An event id was not provided or was not received.%sPlease click the back button on your browser and try again.', 'event_espresso'), '<br/>'), |
|
| 661 | 661 | __FILE__, __FUNCTION__, __LINE__ |
| 662 | 662 | ); |
| 663 | 663 | } |
@@ -675,18 +675,18 @@ discard block |
||
| 675 | 675 | * @return array or FALSE |
| 676 | 676 | */ |
| 677 | 677 | private static function _validate_post_data() { |
| 678 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
| 678 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
| 679 | 679 | |
| 680 | 680 | // start with an empty array() |
| 681 | 681 | $valid_data = array(); |
| 682 | 682 | // d( $_POST ); |
| 683 | 683 | //if event id is valid |
| 684 | - $id = absint( EE_Registry::instance()->REQ->get( 'tkt-slctr-event-id' )); |
|
| 685 | - if ( $id ) { |
|
| 684 | + $id = absint(EE_Registry::instance()->REQ->get('tkt-slctr-event-id')); |
|
| 685 | + if ($id) { |
|
| 686 | 686 | // grab valid id |
| 687 | 687 | $valid_data['id'] = $id; |
| 688 | 688 | // grab and sanitize return-url |
| 689 | - $valid_data['return_url'] = esc_url_raw( EE_Registry::instance()->REQ->get( 'tkt-slctr-return-url-' . $id )); |
|
| 689 | + $valid_data['return_url'] = esc_url_raw(EE_Registry::instance()->REQ->get('tkt-slctr-return-url-'.$id)); |
|
| 690 | 690 | // array of other form names |
| 691 | 691 | $inputs_to_clean = array( |
| 692 | 692 | 'event_id' => 'tkt-slctr-event-id', |
@@ -699,22 +699,22 @@ discard block |
||
| 699 | 699 | // let's track the total number of tickets ordered.' |
| 700 | 700 | $valid_data['total_tickets'] = 0; |
| 701 | 701 | // cycle through $inputs_to_clean array |
| 702 | - foreach ( $inputs_to_clean as $what => $input_to_clean ) { |
|
| 702 | + foreach ($inputs_to_clean as $what => $input_to_clean) { |
|
| 703 | 703 | // check for POST data |
| 704 | - if ( EE_Registry::instance()->REQ->is_set( $input_to_clean . $id )) { |
|
| 704 | + if (EE_Registry::instance()->REQ->is_set($input_to_clean.$id)) { |
|
| 705 | 705 | // grab value |
| 706 | - $input_value = EE_Registry::instance()->REQ->get( $input_to_clean . $id ); |
|
| 706 | + $input_value = EE_Registry::instance()->REQ->get($input_to_clean.$id); |
|
| 707 | 707 | switch ($what) { |
| 708 | 708 | |
| 709 | 709 | // integers |
| 710 | 710 | case 'event_id': |
| 711 | - $valid_data[$what] = absint( $input_value ); |
|
| 711 | + $valid_data[$what] = absint($input_value); |
|
| 712 | 712 | // get event via the event id we put in the form |
| 713 | - $valid_data['event'] = EE_Registry::instance()->load_model( 'Event' )->get_one_by_ID( $valid_data['event_id'] ); |
|
| 713 | + $valid_data['event'] = EE_Registry::instance()->load_model('Event')->get_one_by_ID($valid_data['event_id']); |
|
| 714 | 714 | break; |
| 715 | 715 | case 'rows': |
| 716 | 716 | case 'max_atndz': |
| 717 | - $valid_data[$what] = absint( $input_value ); |
|
| 717 | + $valid_data[$what] = absint($input_value); |
|
| 718 | 718 | break; |
| 719 | 719 | |
| 720 | 720 | // arrays of integers |
@@ -722,27 +722,27 @@ discard block |
||
| 722 | 722 | // d( $input_value ); |
| 723 | 723 | $row_qty = $input_value; |
| 724 | 724 | // if qty is coming from a radio button input, then we need to assemble an array of rows |
| 725 | - if( ! is_array( $row_qty )) { |
|
| 725 | + if ( ! is_array($row_qty)) { |
|
| 726 | 726 | // get number of rows |
| 727 | - $rows = EE_Registry::instance()->REQ->is_set( 'tkt-slctr-rows-' . $id ) ? absint( EE_Registry::instance()->REQ->get( 'tkt-slctr-rows-' . $id )) : 1; |
|
| 727 | + $rows = EE_Registry::instance()->REQ->is_set('tkt-slctr-rows-'.$id) ? absint(EE_Registry::instance()->REQ->get('tkt-slctr-rows-'.$id)) : 1; |
|
| 728 | 728 | // d( $rows ); |
| 729 | 729 | // explode ints by the dash |
| 730 | - $row_qty = explode( '-', $row_qty ); |
|
| 731 | - $row = isset( $row_qty[0] ) ? ( absint( $row_qty[0] )) : 1; |
|
| 732 | - $qty = isset( $row_qty[1] ) ? absint( $row_qty[1] ) : 0; |
|
| 733 | - $row_qty = array( $row => $qty ); |
|
| 730 | + $row_qty = explode('-', $row_qty); |
|
| 731 | + $row = isset($row_qty[0]) ? (absint($row_qty[0])) : 1; |
|
| 732 | + $qty = isset($row_qty[1]) ? absint($row_qty[1]) : 0; |
|
| 733 | + $row_qty = array($row => $qty); |
|
| 734 | 734 | // d( $row_qty ); |
| 735 | - for( $x = 1; $x <= $rows; $x++ ) { |
|
| 736 | - if ( ! isset( $row_qty[$x] )) { |
|
| 735 | + for ($x = 1; $x <= $rows; $x++) { |
|
| 736 | + if ( ! isset($row_qty[$x])) { |
|
| 737 | 737 | $row_qty[$x] = 0; |
| 738 | 738 | } |
| 739 | 739 | } |
| 740 | 740 | } |
| 741 | - ksort( $row_qty ); |
|
| 741 | + ksort($row_qty); |
|
| 742 | 742 | // d( $row_qty ); |
| 743 | 743 | // cycle thru values |
| 744 | - foreach ( $row_qty as $qty ) { |
|
| 745 | - $qty = absint( $qty ); |
|
| 744 | + foreach ($row_qty as $qty) { |
|
| 745 | + $qty = absint($qty); |
|
| 746 | 746 | // sanitize as integers |
| 747 | 747 | $valid_data[$what][] = $qty; |
| 748 | 748 | $valid_data['total_tickets'] += $qty; |
@@ -753,19 +753,19 @@ discard block |
||
| 753 | 753 | case 'ticket_id': |
| 754 | 754 | $value_array = array(); |
| 755 | 755 | // cycle thru values |
| 756 | - foreach ( $input_value as $key=>$value ) { |
|
| 756 | + foreach ($input_value as $key=>$value) { |
|
| 757 | 757 | // allow only numbers, letters, spaces, commas and dashes |
| 758 | - $value_array[ $key ] = wp_strip_all_tags( $value ); |
|
| 758 | + $value_array[$key] = wp_strip_all_tags($value); |
|
| 759 | 759 | // get ticket via the ticket id we put in the form |
| 760 | - $ticket_obj = EE_Registry::instance()->load_model( 'Ticket' )->get_one_by_ID( $value ); |
|
| 761 | - $valid_data['ticket_obj'][ $key ] = $ticket_obj; |
|
| 760 | + $ticket_obj = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($value); |
|
| 761 | + $valid_data['ticket_obj'][$key] = $ticket_obj; |
|
| 762 | 762 | } |
| 763 | - $valid_data[ $what ] = $value_array; |
|
| 763 | + $valid_data[$what] = $value_array; |
|
| 764 | 764 | break; |
| 765 | 765 | |
| 766 | 766 | case 'return_url' : |
| 767 | 767 | // grab and sanitize return-url |
| 768 | - $valid_data[$what] = esc_url_raw( $input_value ); |
|
| 768 | + $valid_data[$what] = esc_url_raw($input_value); |
|
| 769 | 769 | break; |
| 770 | 770 | |
| 771 | 771 | } // end switch $what |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | } // end foreach $inputs_to_clean |
| 774 | 774 | |
| 775 | 775 | } else { |
| 776 | - EE_Error::add_error( __('The event id provided was not valid.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 776 | + EE_Error::add_error(__('The event id provided was not valid.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
| 777 | 777 | return FALSE; |
| 778 | 778 | } |
| 779 | 779 | |
@@ -791,28 +791,28 @@ discard block |
||
| 791 | 791 | * @param int $qty |
| 792 | 792 | * @return TRUE on success, FALSE on fail |
| 793 | 793 | */ |
| 794 | - private static function _add_ticket_to_cart( EE_Ticket $ticket = NULL, $qty = 1 ) { |
|
| 795 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
| 794 | + private static function _add_ticket_to_cart(EE_Ticket $ticket = NULL, $qty = 1) { |
|
| 795 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
| 796 | 796 | // get the number of spaces left for this datetime ticket |
| 797 | - $available_spaces = self::_ticket_datetime_availability( $ticket ); |
|
| 797 | + $available_spaces = self::_ticket_datetime_availability($ticket); |
|
| 798 | 798 | // compare available spaces against the number of tickets being purchased |
| 799 | - if ( $available_spaces >= $qty ) { |
|
| 799 | + if ($available_spaces >= $qty) { |
|
| 800 | 800 | // allow addons to prevent a ticket from being added to cart |
| 801 | - if ( ! apply_filters( 'FHEE__EE_Ticket_Selector___add_ticket_to_cart__allow_add_to_cart', true, $ticket, $qty, $available_spaces ) ) { |
|
| 801 | + if ( ! apply_filters('FHEE__EE_Ticket_Selector___add_ticket_to_cart__allow_add_to_cart', true, $ticket, $qty, $available_spaces)) { |
|
| 802 | 802 | return false; |
| 803 | 803 | } |
| 804 | 804 | // add event to cart |
| 805 | - if( EE_Registry::instance()->CART->add_ticket_to_cart( $ticket, $qty )) { |
|
| 806 | - self::_recalculate_ticket_datetime_availability( $ticket, $qty ); |
|
| 805 | + if (EE_Registry::instance()->CART->add_ticket_to_cart($ticket, $qty)) { |
|
| 806 | + self::_recalculate_ticket_datetime_availability($ticket, $qty); |
|
| 807 | 807 | return true; |
| 808 | 808 | } else { |
| 809 | 809 | return false; |
| 810 | 810 | } |
| 811 | 811 | } else { |
| 812 | 812 | // tickets can not be purchased but let's find the exact number left for the last ticket selected PRIOR to subtracting tickets |
| 813 | - $available_spaces = self::_ticket_datetime_availability( $ticket, true ); |
|
| 813 | + $available_spaces = self::_ticket_datetime_availability($ticket, true); |
|
| 814 | 814 | // greedy greedy greedy eh? |
| 815 | - if ( $available_spaces > 0 ) { |
|
| 815 | + if ($available_spaces > 0) { |
|
| 816 | 816 | // add error messaging - we're using the _n function that will generate the appropriate singular or plural message based on the number of $available_spaces |
| 817 | 817 | EE_Error::add_error( |
| 818 | 818 | sprintf( |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | __FILE__, __FUNCTION__, __LINE__ |
| 829 | 829 | ); |
| 830 | 830 | } else { |
| 831 | - EE_Error::add_error( __('We\'re sorry, but there are no available spaces left for this event at this particular date and time.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 831 | + EE_Error::add_error(__('We\'re sorry, but there are no available spaces left for this event at this particular date and time.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
| 832 | 832 | } |
| 833 | 833 | return false; |
| 834 | 834 | } |
@@ -846,22 +846,22 @@ discard block |
||
| 846 | 846 | * @param bool $get_original_ticket_spaces |
| 847 | 847 | * @return int |
| 848 | 848 | */ |
| 849 | - private static function _ticket_datetime_availability( EE_Ticket $ticket, $get_original_ticket_spaces = FALSE ) { |
|
| 849 | + private static function _ticket_datetime_availability(EE_Ticket $ticket, $get_original_ticket_spaces = FALSE) { |
|
| 850 | 850 | // if the $_available_spaces array has not been set up yet... |
| 851 | - if ( ! isset( self::$_available_spaces['tickets'][ $ticket->ID() ] )) { |
|
| 852 | - self::_set_initial_ticket_datetime_availability( $ticket ); |
|
| 851 | + if ( ! isset(self::$_available_spaces['tickets'][$ticket->ID()])) { |
|
| 852 | + self::_set_initial_ticket_datetime_availability($ticket); |
|
| 853 | 853 | } |
| 854 | 854 | $available_spaces = $ticket->qty() - $ticket->sold(); |
| 855 | - if ( isset( self::$_available_spaces['tickets'][ $ticket->ID() ] )) { |
|
| 855 | + if (isset(self::$_available_spaces['tickets'][$ticket->ID()])) { |
|
| 856 | 856 | // loop thru tickets, which will ALSO include individual ticket records AND a total |
| 857 | - foreach ( self::$_available_spaces['tickets'][ $ticket->ID() ] as $DTD_ID => $spaces ) { |
|
| 857 | + foreach (self::$_available_spaces['tickets'][$ticket->ID()] as $DTD_ID => $spaces) { |
|
| 858 | 858 | // if we want the original datetime availability BEFORE we started subtracting tickets ? |
| 859 | - if ( $get_original_ticket_spaces ) { |
|
| 859 | + if ($get_original_ticket_spaces) { |
|
| 860 | 860 | // then grab the available spaces from the "tickets" array and compare with the above to get the lowest number |
| 861 | - $available_spaces = min( $available_spaces, self::$_available_spaces['tickets'][ $ticket->ID() ][ $DTD_ID ] ); |
|
| 861 | + $available_spaces = min($available_spaces, self::$_available_spaces['tickets'][$ticket->ID()][$DTD_ID]); |
|
| 862 | 862 | } else { |
| 863 | 863 | // we want the updated ticket availability as stored in the "datetimes" array |
| 864 | - $available_spaces = min( $available_spaces, self::$_available_spaces['datetimes'][ $DTD_ID ] ); |
|
| 864 | + $available_spaces = min($available_spaces, self::$_available_spaces['datetimes'][$DTD_ID]); |
|
| 865 | 865 | } |
| 866 | 866 | } |
| 867 | 867 | } |
@@ -877,23 +877,23 @@ discard block |
||
| 877 | 877 | * @param EE_Ticket $ticket |
| 878 | 878 | * @return int |
| 879 | 879 | */ |
| 880 | - private static function _set_initial_ticket_datetime_availability( EE_Ticket $ticket ) { |
|
| 880 | + private static function _set_initial_ticket_datetime_availability(EE_Ticket $ticket) { |
|
| 881 | 881 | // first, get all of the datetimes that are available to this ticket |
| 882 | 882 | $datetimes = $ticket->get_many_related( |
| 883 | 883 | 'Datetime', |
| 884 | - array( array( 'DTT_EVT_end' => array( '>=', EEM_Datetime::instance()->current_time_for_query( 'DTT_EVT_end' ) ) ), 'order_by' => array( 'DTT_EVT_start' => 'ASC' )) |
|
| 884 | + array(array('DTT_EVT_end' => array('>=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end'))), 'order_by' => array('DTT_EVT_start' => 'ASC')) |
|
| 885 | 885 | ); |
| 886 | - if ( ! empty( $datetimes )) { |
|
| 886 | + if ( ! empty($datetimes)) { |
|
| 887 | 887 | // now loop thru all of the datetimes |
| 888 | - foreach ( $datetimes as $datetime ) { |
|
| 889 | - if ( $datetime instanceof EE_Datetime ) { |
|
| 888 | + foreach ($datetimes as $datetime) { |
|
| 889 | + if ($datetime instanceof EE_Datetime) { |
|
| 890 | 890 | // the number of spaces available for the datetime without considering individual ticket quantities |
| 891 | 891 | $spaces_remaining = $datetime->spaces_remaining(); |
| 892 | 892 | // save the total available spaces ( the lesser of the ticket qty minus the number of tickets sold or the datetime spaces remaining) to this ticket using the datetime ID as the key |
| 893 | - self::$_available_spaces['tickets'][ $ticket->ID() ][ $datetime->ID() ] = min(( $ticket->qty() - $ticket->sold() ), $spaces_remaining ); |
|
| 893 | + self::$_available_spaces['tickets'][$ticket->ID()][$datetime->ID()] = min(($ticket->qty() - $ticket->sold()), $spaces_remaining); |
|
| 894 | 894 | // if the remaining spaces for this datetime is already set, then compare that against the datetime spaces remaining, and take the lowest number, |
| 895 | 895 | // else just take the datetime spaces remaining, and assign to the datetimes array |
| 896 | - self::$_available_spaces['datetimes'][ $datetime->ID() ] = isset( self::$_available_spaces['datetimes'][ $datetime->ID() ] ) ? min( self::$_available_spaces['datetimes'][ $datetime->ID() ], $spaces_remaining ) : $spaces_remaining; |
|
| 896 | + self::$_available_spaces['datetimes'][$datetime->ID()] = isset(self::$_available_spaces['datetimes'][$datetime->ID()]) ? min(self::$_available_spaces['datetimes'][$datetime->ID()], $spaces_remaining) : $spaces_remaining; |
|
| 897 | 897 | } |
| 898 | 898 | } |
| 899 | 899 | } |
@@ -909,12 +909,12 @@ discard block |
||
| 909 | 909 | * @param int $qty |
| 910 | 910 | * @return int |
| 911 | 911 | */ |
| 912 | - private static function _recalculate_ticket_datetime_availability( EE_Ticket $ticket, $qty = 0 ) { |
|
| 913 | - if ( isset( self::$_available_spaces['tickets'][ $ticket->ID() ] )) { |
|
| 912 | + private static function _recalculate_ticket_datetime_availability(EE_Ticket $ticket, $qty = 0) { |
|
| 913 | + if (isset(self::$_available_spaces['tickets'][$ticket->ID()])) { |
|
| 914 | 914 | // loop thru tickets, which will ALSO include individual ticket records AND a total |
| 915 | - foreach ( self::$_available_spaces['tickets'][ $ticket->ID() ] as $DTD_ID => $spaces ) { |
|
| 915 | + foreach (self::$_available_spaces['tickets'][$ticket->ID()] as $DTD_ID => $spaces) { |
|
| 916 | 916 | // subtract the qty of selected tickets from each datetime's available spaces this ticket has access to, |
| 917 | - self::$_available_spaces['datetimes'][ $DTD_ID ] = self::$_available_spaces['datetimes'][ $DTD_ID ] - $qty; |
|
| 917 | + self::$_available_spaces['datetimes'][$DTD_ID] = self::$_available_spaces['datetimes'][$DTD_ID] - $qty; |
|
| 918 | 918 | } |
| 919 | 919 | } |
| 920 | 920 | } |
@@ -931,8 +931,8 @@ discard block |
||
| 931 | 931 | */ |
| 932 | 932 | public static function load_tckt_slctr_assets() { |
| 933 | 933 | // add some style |
| 934 | - if ( apply_filters( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', FALSE ) ) { |
|
| 935 | - wp_register_style('ticket_selector', TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css'); |
|
| 934 | + if (apply_filters('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', FALSE)) { |
|
| 935 | + wp_register_style('ticket_selector', TICKET_SELECTOR_ASSETS_URL.'ticket_selector.css'); |
|
| 936 | 936 | wp_enqueue_style('ticket_selector'); |
| 937 | 937 | // make it dance |
| 938 | 938 | // wp_register_script('ticket_selector', TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.js', array('espresso_core'), '', TRUE); |
@@ -946,9 +946,9 @@ discard block |
||
| 946 | 946 | |
| 947 | 947 | public static function load_tckt_slctr_assets_admin() { |
| 948 | 948 | //iframe button js on admin event editor page |
| 949 | - if ( EE_Registry::instance()->REQ->get('page') == 'espresso_events' && EE_Registry::instance()->REQ->get('action') == 'edit' ) { |
|
| 950 | - wp_register_script( 'ticket_selector_embed', TICKET_SELECTOR_ASSETS_URL . 'ticket-selector-embed.js', array( 'ee-dialog' ), EVENT_ESPRESSO_VERSION, true ); |
|
| 951 | - wp_enqueue_script( 'ticket_selector_embed' ); |
|
| 949 | + if (EE_Registry::instance()->REQ->get('page') == 'espresso_events' && EE_Registry::instance()->REQ->get('action') == 'edit') { |
|
| 950 | + wp_register_script('ticket_selector_embed', TICKET_SELECTOR_ASSETS_URL.'ticket-selector-embed.js', array('ee-dialog'), EVENT_ESPRESSO_VERSION, true); |
|
| 951 | + wp_enqueue_script('ticket_selector_embed'); |
|
| 952 | 952 | } |
| 953 | 953 | } |
| 954 | 954 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | -<?php if ( ! defined( 'ABSPATH' ) ) { |
|
| 2 | - exit( 'No direct script access allowed' ); |
|
| 1 | +<?php if ( ! defined('ABSPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | 3 | } |
| 4 | 4 | /* |
| 5 | 5 | Plugin Name: Event Espresso |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * |
| 43 | 43 | */ |
| 44 | 44 | |
| 45 | -if ( function_exists( 'espresso_version' ) ) { |
|
| 45 | +if (function_exists('espresso_version')) { |
|
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * espresso_duplicate_plugin_error |
@@ -51,12 +51,12 @@ discard block |
||
| 51 | 51 | function espresso_duplicate_plugin_error() { |
| 52 | 52 | ?> |
| 53 | 53 | <div class="error"> |
| 54 | - <p><?php _e( 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', 'event_espresso' ); ?></p> |
|
| 54 | + <p><?php _e('Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', 'event_espresso'); ?></p> |
|
| 55 | 55 | </div> |
| 56 | 56 | <?php |
| 57 | - espresso_deactivate_plugin( plugin_basename( __FILE__ ) ); |
|
| 57 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
| 58 | 58 | } |
| 59 | - add_action( 'admin_notices', 'espresso_duplicate_plugin_error', 1 ); |
|
| 59 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
| 60 | 60 | |
| 61 | 61 | } else { |
| 62 | 62 | |
@@ -67,103 +67,103 @@ discard block |
||
| 67 | 67 | * @return string |
| 68 | 68 | */ |
| 69 | 69 | function espresso_version() { |
| 70 | - return apply_filters( 'FHEE__espresso__espresso_version', '4.9.14.rc.001' ); |
|
| 70 | + return apply_filters('FHEE__espresso__espresso_version', '4.9.14.rc.001'); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // define versions |
| 74 | - define( 'EVENT_ESPRESSO_VERSION', espresso_version() ); |
|
| 75 | - define( 'EE_MIN_WP_VER_REQUIRED', '4.1' ); |
|
| 76 | - define( 'EE_MIN_WP_VER_RECOMMENDED', '4.4.2' ); |
|
| 77 | - define( 'EE_MIN_PHP_VER_REQUIRED', '5.3.0' ); |
|
| 78 | - define( 'EE_MIN_PHP_VER_RECOMMENDED', '5.4.44' ); |
|
| 79 | - define( 'EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - ' . EVENT_ESPRESSO_VERSION ); |
|
| 80 | - define( 'EVENT_ESPRESSO_MAIN_FILE', __FILE__ ); |
|
| 74 | + define('EVENT_ESPRESSO_VERSION', espresso_version()); |
|
| 75 | + define('EE_MIN_WP_VER_REQUIRED', '4.1'); |
|
| 76 | + define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2'); |
|
| 77 | + define('EE_MIN_PHP_VER_REQUIRED', '5.3.0'); |
|
| 78 | + define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44'); |
|
| 79 | + define('EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - '.EVENT_ESPRESSO_VERSION); |
|
| 80 | + define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
| 81 | 81 | //used to be DIRECTORY_SEPARATOR, but that caused issues on windows |
| 82 | - if ( ! defined( 'DS' ) ) { |
|
| 83 | - define( 'DS', '/' ); |
|
| 82 | + if ( ! defined('DS')) { |
|
| 83 | + define('DS', '/'); |
|
| 84 | 84 | } |
| 85 | - if ( ! defined( 'PS' ) ) { |
|
| 86 | - define( 'PS', PATH_SEPARATOR ); |
|
| 85 | + if ( ! defined('PS')) { |
|
| 86 | + define('PS', PATH_SEPARATOR); |
|
| 87 | 87 | } |
| 88 | - if ( ! defined( 'SP' ) ) { |
|
| 89 | - define( 'SP', ' ' ); |
|
| 88 | + if ( ! defined('SP')) { |
|
| 89 | + define('SP', ' '); |
|
| 90 | 90 | } |
| 91 | - if ( ! defined( 'EENL' ) ) { |
|
| 92 | - define( 'EENL', "\n" ); |
|
| 91 | + if ( ! defined('EENL')) { |
|
| 92 | + define('EENL', "\n"); |
|
| 93 | 93 | } |
| 94 | - define( 'EE_SUPPORT_EMAIL', '[email protected]' ); |
|
| 94 | + define('EE_SUPPORT_EMAIL', '[email protected]'); |
|
| 95 | 95 | // define the plugin directory and URL |
| 96 | - define( 'EE_PLUGIN_BASENAME', plugin_basename( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
| 97 | - define( 'EE_PLUGIN_DIR_PATH', plugin_dir_path( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
| 98 | - define( 'EE_PLUGIN_DIR_URL', plugin_dir_url( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
| 96 | + define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE)); |
|
| 97 | + define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE)); |
|
| 98 | + define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE)); |
|
| 99 | 99 | // main root folder paths |
| 100 | - define( 'EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS ); |
|
| 101 | - define( 'EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS ); |
|
| 102 | - define( 'EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS ); |
|
| 103 | - define( 'EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS ); |
|
| 104 | - define( 'EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS ); |
|
| 105 | - define( 'EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS ); |
|
| 106 | - define( 'EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS ); |
|
| 107 | - define( 'EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS ); |
|
| 100 | + define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH.'admin_pages'.DS); |
|
| 101 | + define('EE_CORE', EE_PLUGIN_DIR_PATH.'core'.DS); |
|
| 102 | + define('EE_MODULES', EE_PLUGIN_DIR_PATH.'modules'.DS); |
|
| 103 | + define('EE_PUBLIC', EE_PLUGIN_DIR_PATH.'public'.DS); |
|
| 104 | + define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH.'shortcodes'.DS); |
|
| 105 | + define('EE_WIDGETS', EE_PLUGIN_DIR_PATH.'widgets'.DS); |
|
| 106 | + define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH.'payment_methods'.DS); |
|
| 107 | + define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH.'caffeinated'.DS); |
|
| 108 | 108 | // core system paths |
| 109 | - define( 'EE_ADMIN', EE_CORE . 'admin' . DS ); |
|
| 110 | - define( 'EE_CPTS', EE_CORE . 'CPTs' . DS ); |
|
| 111 | - define( 'EE_CLASSES', EE_CORE . 'db_classes' . DS ); |
|
| 112 | - define( 'EE_INTERFACES', EE_CORE . 'interfaces' . DS ); |
|
| 113 | - define( 'EE_BUSINESS', EE_CORE . 'business' . DS ); |
|
| 114 | - define( 'EE_MODELS', EE_CORE . 'db_models' . DS ); |
|
| 115 | - define( 'EE_HELPERS', EE_CORE . 'helpers' . DS ); |
|
| 116 | - define( 'EE_LIBRARIES', EE_CORE . 'libraries' . DS ); |
|
| 117 | - define( 'EE_TEMPLATES', EE_CORE . 'templates' . DS ); |
|
| 118 | - define( 'EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS ); |
|
| 119 | - define( 'EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS ); |
|
| 120 | - define( 'EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS ); |
|
| 109 | + define('EE_ADMIN', EE_CORE.'admin'.DS); |
|
| 110 | + define('EE_CPTS', EE_CORE.'CPTs'.DS); |
|
| 111 | + define('EE_CLASSES', EE_CORE.'db_classes'.DS); |
|
| 112 | + define('EE_INTERFACES', EE_CORE.'interfaces'.DS); |
|
| 113 | + define('EE_BUSINESS', EE_CORE.'business'.DS); |
|
| 114 | + define('EE_MODELS', EE_CORE.'db_models'.DS); |
|
| 115 | + define('EE_HELPERS', EE_CORE.'helpers'.DS); |
|
| 116 | + define('EE_LIBRARIES', EE_CORE.'libraries'.DS); |
|
| 117 | + define('EE_TEMPLATES', EE_CORE.'templates'.DS); |
|
| 118 | + define('EE_THIRD_PARTY', EE_CORE.'third_party_libs'.DS); |
|
| 119 | + define('EE_GLOBAL_ASSETS', EE_TEMPLATES.'global_assets'.DS); |
|
| 120 | + define('EE_FORM_SECTIONS', EE_LIBRARIES.'form_sections'.DS); |
|
| 121 | 121 | // gateways |
| 122 | - define( 'EE_GATEWAYS', EE_MODULES . 'gateways' . DS ); |
|
| 123 | - define( 'EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS ); |
|
| 122 | + define('EE_GATEWAYS', EE_MODULES.'gateways'.DS); |
|
| 123 | + define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL.'modules'.DS.'gateways'.DS); |
|
| 124 | 124 | // asset URL paths |
| 125 | - define( 'EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS ); |
|
| 126 | - define( 'EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS ); |
|
| 127 | - define( 'EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS ); |
|
| 128 | - define( 'EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS ); |
|
| 129 | - define( 'EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/' ); |
|
| 130 | - define( 'EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/' ); |
|
| 125 | + define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL.'core'.DS.'templates'.DS); |
|
| 126 | + define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL.'global_assets'.DS); |
|
| 127 | + define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL.'images'.DS); |
|
| 128 | + define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL.'core'.DS.'third_party_libs'.DS); |
|
| 129 | + define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL.'core/helpers/assets/'); |
|
| 130 | + define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL.'core/libraries/'); |
|
| 131 | 131 | // define upload paths |
| 132 | 132 | $uploads = wp_upload_dir(); |
| 133 | 133 | // define the uploads directory and URL |
| 134 | - define( 'EVENT_ESPRESSO_UPLOAD_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS ); |
|
| 135 | - define( 'EVENT_ESPRESSO_UPLOAD_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS ); |
|
| 134 | + define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'].DS.'espresso'.DS); |
|
| 135 | + define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'].DS.'espresso'.DS); |
|
| 136 | 136 | // define the templates directory and URL |
| 137 | - define( 'EVENT_ESPRESSO_TEMPLATE_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'templates' . DS ); |
|
| 138 | - define( 'EVENT_ESPRESSO_TEMPLATE_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'templates' . DS ); |
|
| 137 | + define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'].DS.'espresso'.DS.'templates'.DS); |
|
| 138 | + define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'].DS.'espresso'.DS.'templates'.DS); |
|
| 139 | 139 | // define the gateway directory and URL |
| 140 | - define( 'EVENT_ESPRESSO_GATEWAY_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'gateways' . DS ); |
|
| 141 | - define( 'EVENT_ESPRESSO_GATEWAY_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'gateways' . DS ); |
|
| 140 | + define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'].DS.'espresso'.DS.'gateways'.DS); |
|
| 141 | + define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'].DS.'espresso'.DS.'gateways'.DS); |
|
| 142 | 142 | // languages folder/path |
| 143 | - define( 'EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS ); |
|
| 144 | - define( 'EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS ); |
|
| 143 | + define('EE_LANGUAGES_SAFE_LOC', '..'.DS.'uploads'.DS.'espresso'.DS.'languages'.DS); |
|
| 144 | + define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'languages'.DS); |
|
| 145 | 145 | //check for dompdf fonts in uploads |
| 146 | - if ( file_exists( EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ) ) { |
|
| 147 | - define( 'DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ); |
|
| 146 | + if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS)) { |
|
| 147 | + define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS); |
|
| 148 | 148 | } |
| 149 | 149 | //ajax constants |
| 150 | - define( 'EE_FRONT_AJAX', isset( $_REQUEST[ 'ee_front_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_front_ajax' ] ) ? true : false ); |
|
| 151 | - define( 'EE_ADMIN_AJAX', isset( $_REQUEST[ 'ee_admin_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_admin_ajax' ] ) ? true : false ); |
|
| 150 | + define('EE_FRONT_AJAX', isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false); |
|
| 151 | + define('EE_ADMIN_AJAX', isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false); |
|
| 152 | 152 | //just a handy constant occasionally needed for finding values representing infinity in the DB |
| 153 | 153 | //you're better to use this than its straight value (currently -1) in case you ever |
| 154 | 154 | //want to change its default value! or find when -1 means infinity |
| 155 | - define( 'EE_INF_IN_DB', -1 ); |
|
| 156 | - define( 'EE_INF', INF > (float)PHP_INT_MAX ? INF : PHP_INT_MAX ); |
|
| 157 | - define( 'EE_DEBUG', false ); |
|
| 155 | + define('EE_INF_IN_DB', -1); |
|
| 156 | + define('EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX); |
|
| 157 | + define('EE_DEBUG', false); |
|
| 158 | 158 | |
| 159 | 159 | /** |
| 160 | 160 | * espresso_plugin_activation |
| 161 | 161 | * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
| 162 | 162 | */ |
| 163 | 163 | function espresso_plugin_activation() { |
| 164 | - update_option( 'ee_espresso_activation', true ); |
|
| 164 | + update_option('ee_espresso_activation', true); |
|
| 165 | 165 | } |
| 166 | - register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' ); |
|
| 166 | + register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
| 167 | 167 | |
| 168 | 168 | |
| 169 | 169 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | // } |
| 178 | 178 | // |
| 179 | 179 | } |
| 180 | - register_deactivation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation' ); |
|
| 180 | + register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation'); |
|
| 181 | 181 | |
| 182 | 182 | |
| 183 | 183 | |
@@ -187,15 +187,15 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | function espresso_load_error_handling() { |
| 189 | 189 | // load debugging tools |
| 190 | - if ( WP_DEBUG === true && is_readable( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ) ) { |
|
| 191 | - require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ); |
|
| 190 | + if (WP_DEBUG === true && is_readable(EE_HELPERS.'EEH_Debug_Tools.helper.php')) { |
|
| 191 | + require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php'); |
|
| 192 | 192 | EEH_Debug_Tools::instance(); |
| 193 | 193 | } |
| 194 | 194 | // load error handling |
| 195 | - if ( is_readable( EE_CORE . 'EE_Error.core.php' ) ) { |
|
| 196 | - require_once( EE_CORE . 'EE_Error.core.php' ); |
|
| 195 | + if (is_readable(EE_CORE.'EE_Error.core.php')) { |
|
| 196 | + require_once(EE_CORE.'EE_Error.core.php'); |
|
| 197 | 197 | } else { |
| 198 | - wp_die( __( 'The EE_Error core class could not be loaded.', 'event_espresso' ) ); |
|
| 198 | + wp_die(__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | |
@@ -209,25 +209,25 @@ discard block |
||
| 209 | 209 | * @param string $full_path_to_file |
| 210 | 210 | * @throws EE_Error |
| 211 | 211 | */ |
| 212 | - function espresso_load_required( $classname, $full_path_to_file ) { |
|
| 212 | + function espresso_load_required($classname, $full_path_to_file) { |
|
| 213 | 213 | static $error_handling_loaded = false; |
| 214 | - if ( ! $error_handling_loaded ) { |
|
| 214 | + if ( ! $error_handling_loaded) { |
|
| 215 | 215 | espresso_load_error_handling(); |
| 216 | 216 | $error_handling_loaded = true; |
| 217 | 217 | } |
| 218 | - if ( is_readable( $full_path_to_file ) ) { |
|
| 219 | - require_once( $full_path_to_file ); |
|
| 218 | + if (is_readable($full_path_to_file)) { |
|
| 219 | + require_once($full_path_to_file); |
|
| 220 | 220 | } else { |
| 221 | - throw new EE_Error ( sprintf( |
|
| 222 | - __( 'The %s class file could not be located or is not readable due to file permissions.', 'event_espresso' ), |
|
| 221 | + throw new EE_Error(sprintf( |
|
| 222 | + __('The %s class file could not be located or is not readable due to file permissions.', 'event_espresso'), |
|
| 223 | 223 | $classname |
| 224 | - ) ); |
|
| 224 | + )); |
|
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - espresso_load_required( 'EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' ); |
|
| 229 | - espresso_load_required( 'EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' ); |
|
| 230 | - espresso_load_required( 'EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php' ); |
|
| 228 | + espresso_load_required('EEH_Base', EE_CORE.'helpers'.DS.'EEH_Base.helper.php'); |
|
| 229 | + espresso_load_required('EEH_File', EE_CORE.'helpers'.DS.'EEH_File.helper.php'); |
|
| 230 | + espresso_load_required('EE_Bootstrap', EE_CORE.'EE_Bootstrap.core.php'); |
|
| 231 | 231 | new EE_Bootstrap(); |
| 232 | 232 | |
| 233 | 233 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | |
| 238 | 238 | |
| 239 | -if ( ! function_exists( 'espresso_deactivate_plugin' ) ) { |
|
| 239 | +if ( ! function_exists('espresso_deactivate_plugin')) { |
|
| 240 | 240 | /** |
| 241 | 241 | * deactivate_plugin |
| 242 | 242 | * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
@@ -245,11 +245,11 @@ discard block |
||
| 245 | 245 | * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
| 246 | 246 | * @return void |
| 247 | 247 | */ |
| 248 | - function espresso_deactivate_plugin( $plugin_basename = '' ) { |
|
| 249 | - if ( ! function_exists( 'deactivate_plugins' ) ) { |
|
| 250 | - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
|
| 248 | + function espresso_deactivate_plugin($plugin_basename = '') { |
|
| 249 | + if ( ! function_exists('deactivate_plugins')) { |
|
| 250 | + require_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
| 251 | 251 | } |
| 252 | - unset( $_GET[ 'activate' ], $_REQUEST[ 'activate' ] ); |
|
| 253 | - deactivate_plugins( $plugin_basename ); |
|
| 252 | + unset($_GET['activate'], $_REQUEST['activate']); |
|
| 253 | + deactivate_plugins($plugin_basename); |
|
| 254 | 254 | } |
| 255 | 255 | } |