@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
3 | - exit('NO direct script access allowed'); |
|
3 | + exit('NO direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | /** |
@@ -21,68 +21,68 @@ discard block |
||
21 | 21 | { |
22 | 22 | |
23 | 23 | |
24 | - public function __construct($routing = true) |
|
25 | - { |
|
26 | - parent::__construct($routing); |
|
27 | - define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'general_settings/templates/'); |
|
28 | - } |
|
24 | + public function __construct($routing = true) |
|
25 | + { |
|
26 | + parent::__construct($routing); |
|
27 | + define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'general_settings/templates/'); |
|
28 | + } |
|
29 | 29 | |
30 | 30 | |
31 | - protected function _extend_page_config() |
|
32 | - { |
|
31 | + protected function _extend_page_config() |
|
32 | + { |
|
33 | 33 | |
34 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'general_settings'; |
|
34 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'general_settings'; |
|
35 | 35 | |
36 | - //filters and action hooks here |
|
37 | - add_action('AHEE__admin_option_settings__template__before', array($this, 'debug_logging_options'), 9); |
|
38 | - add_filter('FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin', |
|
39 | - array($this, 'update_debug_logging_options'), 10, 1); |
|
36 | + //filters and action hooks here |
|
37 | + add_action('AHEE__admin_option_settings__template__before', array($this, 'debug_logging_options'), 9); |
|
38 | + add_filter('FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin', |
|
39 | + array($this, 'update_debug_logging_options'), 10, 1); |
|
40 | 40 | |
41 | - } |
|
41 | + } |
|
42 | 42 | |
43 | 43 | |
44 | 44 | |
45 | - /************* Logging Settings *************/ |
|
45 | + /************* Logging Settings *************/ |
|
46 | 46 | |
47 | - /** |
|
48 | - * debug_logging_options |
|
49 | - * |
|
50 | - * @param array $template_args |
|
51 | - * |
|
52 | - * @return void |
|
53 | - */ |
|
54 | - public function debug_logging_options($template_args = array()) |
|
55 | - { |
|
56 | - $template_args['use_full_logging'] = EE_Registry::instance()->CFG->admin->use_full_logging; |
|
57 | - $template_args['use_remote_logging'] = isset(EE_Registry::instance()->CFG->admin->use_remote_logging) ? absint(EE_Registry::instance()->CFG->admin->use_remote_logging) : false; |
|
58 | - $template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url) && ! empty(EE_Registry::instance()->CFG->admin->remote_logging_url) ? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : ''; |
|
59 | - $template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php'; |
|
60 | - EEH_Template::display_template($template, $template_args); |
|
61 | - } |
|
47 | + /** |
|
48 | + * debug_logging_options |
|
49 | + * |
|
50 | + * @param array $template_args |
|
51 | + * |
|
52 | + * @return void |
|
53 | + */ |
|
54 | + public function debug_logging_options($template_args = array()) |
|
55 | + { |
|
56 | + $template_args['use_full_logging'] = EE_Registry::instance()->CFG->admin->use_full_logging; |
|
57 | + $template_args['use_remote_logging'] = isset(EE_Registry::instance()->CFG->admin->use_remote_logging) ? absint(EE_Registry::instance()->CFG->admin->use_remote_logging) : false; |
|
58 | + $template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url) && ! empty(EE_Registry::instance()->CFG->admin->remote_logging_url) ? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : ''; |
|
59 | + $template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php'; |
|
60 | + EEH_Template::display_template($template, $template_args); |
|
61 | + } |
|
62 | 62 | |
63 | 63 | |
64 | - /** |
|
65 | - * update_debug_logging_options |
|
66 | - * |
|
67 | - * @param array $admin_options |
|
68 | - * |
|
69 | - * @return array |
|
70 | - */ |
|
71 | - public function update_debug_logging_options($admin_options = array()) |
|
72 | - { |
|
73 | - $use_full_logging = isset($this->_req_data['use_full_logging']) ? (bool)absint($this->_req_data['use_full_logging']) : $admin_options->use_full_logging; |
|
74 | - $admin_options->use_full_logging = $use_full_logging; |
|
64 | + /** |
|
65 | + * update_debug_logging_options |
|
66 | + * |
|
67 | + * @param array $admin_options |
|
68 | + * |
|
69 | + * @return array |
|
70 | + */ |
|
71 | + public function update_debug_logging_options($admin_options = array()) |
|
72 | + { |
|
73 | + $use_full_logging = isset($this->_req_data['use_full_logging']) ? (bool)absint($this->_req_data['use_full_logging']) : $admin_options->use_full_logging; |
|
74 | + $admin_options->use_full_logging = $use_full_logging; |
|
75 | 75 | |
76 | - if ($use_full_logging === false) { |
|
77 | - EE_Error::get_notices(false); |
|
78 | - EE_Error::reset_notices(); |
|
79 | - } |
|
76 | + if ($use_full_logging === false) { |
|
77 | + EE_Error::get_notices(false); |
|
78 | + EE_Error::reset_notices(); |
|
79 | + } |
|
80 | 80 | |
81 | - $admin_options->use_remote_logging = isset($this->_req_data['use_remote_logging']) ? absint($this->_req_data['use_remote_logging']) : $admin_options->use_remote_logging; |
|
82 | - $admin_options->remote_logging_url = isset($this->_req_data['remote_logging_url']) ? esc_url_raw($this->_req_data['remote_logging_url']) : $admin_options->remote_logging_url; |
|
81 | + $admin_options->use_remote_logging = isset($this->_req_data['use_remote_logging']) ? absint($this->_req_data['use_remote_logging']) : $admin_options->use_remote_logging; |
|
82 | + $admin_options->remote_logging_url = isset($this->_req_data['remote_logging_url']) ? esc_url_raw($this->_req_data['remote_logging_url']) : $admin_options->remote_logging_url; |
|
83 | 83 | |
84 | - return $admin_options; |
|
85 | - } |
|
84 | + return $admin_options; |
|
85 | + } |
|
86 | 86 | |
87 | 87 | |
88 | 88 | } |
@@ -24,14 +24,14 @@ discard block |
||
24 | 24 | public function __construct($routing = true) |
25 | 25 | { |
26 | 26 | parent::__construct($routing); |
27 | - define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'general_settings/templates/'); |
|
27 | + define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'general_settings/templates/'); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function _extend_page_config() |
32 | 32 | { |
33 | 33 | |
34 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'general_settings'; |
|
34 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'general_settings'; |
|
35 | 35 | |
36 | 36 | //filters and action hooks here |
37 | 37 | add_action('AHEE__admin_option_settings__template__before', array($this, 'debug_logging_options'), 9); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $template_args['use_full_logging'] = EE_Registry::instance()->CFG->admin->use_full_logging; |
57 | 57 | $template_args['use_remote_logging'] = isset(EE_Registry::instance()->CFG->admin->use_remote_logging) ? absint(EE_Registry::instance()->CFG->admin->use_remote_logging) : false; |
58 | 58 | $template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url) && ! empty(EE_Registry::instance()->CFG->admin->remote_logging_url) ? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : ''; |
59 | - $template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php'; |
|
59 | + $template = GEN_SET_CAF_TEMPLATE_PATH.'debug_log_settings.template.php'; |
|
60 | 60 | EEH_Template::display_template($template, $template_args); |
61 | 61 | } |
62 | 62 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function update_debug_logging_options($admin_options = array()) |
72 | 72 | { |
73 | - $use_full_logging = isset($this->_req_data['use_full_logging']) ? (bool)absint($this->_req_data['use_full_logging']) : $admin_options->use_full_logging; |
|
73 | + $use_full_logging = isset($this->_req_data['use_full_logging']) ? (bool) absint($this->_req_data['use_full_logging']) : $admin_options->use_full_logging; |
|
74 | 74 | $admin_options->use_full_logging = $use_full_logging; |
75 | 75 | |
76 | 76 | if ($use_full_logging === false) { |
@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | $stages = glob(EE_CORE . 'data_migration_scripts/4_2_0_stages/*'); |
16 | 16 | $class_to_filepath = array(); |
17 | 17 | if ( ! empty($stages)) { |
18 | - foreach ($stages as $filepath) { |
|
19 | - $matches = array(); |
|
20 | - preg_match('~4_2_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
21 | - $class_to_filepath[$matches[1]] = $filepath; |
|
22 | - } |
|
18 | + foreach ($stages as $filepath) { |
|
19 | + $matches = array(); |
|
20 | + preg_match('~4_2_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
21 | + $class_to_filepath[$matches[1]] = $filepath; |
|
22 | + } |
|
23 | 23 | } |
24 | 24 | //give addons a chance to autoload their stages too |
25 | 25 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_2_0__autoloaded_stages', $class_to_filepath); |
@@ -32,64 +32,64 @@ discard block |
||
32 | 32 | |
33 | 33 | |
34 | 34 | |
35 | - /** |
|
36 | - * EE_DMS_Core_4_2_0 constructor. |
|
37 | - * |
|
38 | - * @param TableManager $table_manager |
|
39 | - * @param TableAnalysis $table_analysis |
|
40 | - */ |
|
41 | - public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
42 | - { |
|
43 | - $this->_pretty_name = __("Data Migration to Event Espresso 4.2.0.P", "event_espresso"); |
|
44 | - $this->_priority = 10; |
|
45 | - $this->_migration_stages = array( |
|
46 | - new EE_DMS_4_2_0_question_group_questions(), |
|
47 | - new EE_DMS_4_2_0_datetime_fields(), |
|
48 | - ); |
|
49 | - parent::__construct($table_manager, $table_analysis); |
|
50 | - } |
|
35 | + /** |
|
36 | + * EE_DMS_Core_4_2_0 constructor. |
|
37 | + * |
|
38 | + * @param TableManager $table_manager |
|
39 | + * @param TableAnalysis $table_analysis |
|
40 | + */ |
|
41 | + public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
42 | + { |
|
43 | + $this->_pretty_name = __("Data Migration to Event Espresso 4.2.0.P", "event_espresso"); |
|
44 | + $this->_priority = 10; |
|
45 | + $this->_migration_stages = array( |
|
46 | + new EE_DMS_4_2_0_question_group_questions(), |
|
47 | + new EE_DMS_4_2_0_datetime_fields(), |
|
48 | + ); |
|
49 | + parent::__construct($table_manager, $table_analysis); |
|
50 | + } |
|
51 | 51 | |
52 | 52 | |
53 | 53 | |
54 | - public function can_migrate_from_version($version_array) |
|
55 | - { |
|
56 | - $version_string = $version_array['Core']; |
|
57 | - if (version_compare($version_string, '4.2.0', '<=') && version_compare($version_string, '4.1.0', '>=')) { |
|
54 | + public function can_migrate_from_version($version_array) |
|
55 | + { |
|
56 | + $version_string = $version_array['Core']; |
|
57 | + if (version_compare($version_string, '4.2.0', '<=') && version_compare($version_string, '4.1.0', '>=')) { |
|
58 | 58 | // echo "$version_string can be migrated fro"; |
59 | - return true; |
|
60 | - } elseif ( ! $version_string) { |
|
59 | + return true; |
|
60 | + } elseif ( ! $version_string) { |
|
61 | 61 | // echo "no version string provided: $version_string"; |
62 | - //no version string provided... this must be pre 4.1 |
|
63 | - //because since 4.1 we're |
|
64 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
65 | - } else { |
|
62 | + //no version string provided... this must be pre 4.1 |
|
63 | + //because since 4.1 we're |
|
64 | + return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
65 | + } else { |
|
66 | 66 | // echo "$version_string doesnt apply"; |
67 | - return false; |
|
68 | - } |
|
69 | - } |
|
67 | + return false; |
|
68 | + } |
|
69 | + } |
|
70 | 70 | |
71 | 71 | |
72 | 72 | |
73 | - public function pretty_name() |
|
74 | - { |
|
75 | - return __("Core Data Migration to version 4.2.0", "event_espresso"); |
|
76 | - } |
|
73 | + public function pretty_name() |
|
74 | + { |
|
75 | + return __("Core Data Migration to version 4.2.0", "event_espresso"); |
|
76 | + } |
|
77 | 77 | |
78 | 78 | |
79 | 79 | |
80 | - public function schema_changes_before_migration() |
|
81 | - { |
|
82 | - //relies on 4.1's EEH_Activation::create_table |
|
83 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
84 | - $table_name = 'esp_answer'; |
|
85 | - $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
80 | + public function schema_changes_before_migration() |
|
81 | + { |
|
82 | + //relies on 4.1's EEH_Activation::create_table |
|
83 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
84 | + $table_name = 'esp_answer'; |
|
85 | + $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
86 | 86 | REG_ID INT UNSIGNED NOT NULL, |
87 | 87 | QST_ID INT UNSIGNED NOT NULL, |
88 | 88 | ANS_value TEXT NOT NULL, |
89 | 89 | PRIMARY KEY (ANS_ID)"; |
90 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
91 | - $table_name = 'esp_attendee_meta'; |
|
92 | - $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
90 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
91 | + $table_name = 'esp_attendee_meta'; |
|
92 | + $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
93 | 93 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
94 | 94 | ATT_fname VARCHAR(45) NOT NULL, |
95 | 95 | ATT_lname VARCHAR(45) NOT NULL, |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | KEY ATT_fname (ATT_fname), |
106 | 106 | KEY ATT_lname (ATT_lname), |
107 | 107 | KEY ATT_email (ATT_email)"; |
108 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
109 | - $table_name = 'esp_country'; |
|
110 | - $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
108 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
109 | + $table_name = 'esp_country'; |
|
110 | + $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
111 | 111 | CNT_ISO3 VARCHAR(3) COLLATE utf8_bin NOT NULL, |
112 | 112 | RGN_ID TINYINT(3) UNSIGNED DEFAULT NULL, |
113 | 113 | CNT_name VARCHAR(45) COLLATE utf8_bin NOT NULL, |
@@ -123,9 +123,9 @@ discard block |
||
123 | 123 | CNT_is_EU TINYINT(1) DEFAULT '0', |
124 | 124 | CNT_active TINYINT(1) DEFAULT '0', |
125 | 125 | PRIMARY KEY (CNT_ISO)"; |
126 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
127 | - $table_name = 'esp_datetime'; |
|
128 | - $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
126 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
127 | + $table_name = 'esp_datetime'; |
|
128 | + $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
129 | 129 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
130 | 130 | DTT_name VARCHAR(255) NOT NULL DEFAULT '', |
131 | 131 | DTT_description TEXT NOT NULL, |
@@ -140,9 +140,9 @@ discard block |
||
140 | 140 | PRIMARY KEY (DTT_ID), |
141 | 141 | KEY EVT_ID (EVT_ID), |
142 | 142 | KEY DTT_is_primary (DTT_is_primary)"; |
143 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
144 | - $table_name = 'esp_event_meta'; |
|
145 | - $sql = " |
|
143 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
144 | + $table_name = 'esp_event_meta'; |
|
145 | + $sql = " |
|
146 | 146 | EVTM_ID INT NOT NULL AUTO_INCREMENT, |
147 | 147 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
148 | 148 | EVT_display_desc TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -157,31 +157,31 @@ discard block |
||
157 | 157 | EVT_external_URL VARCHAR(200) NULL, |
158 | 158 | EVT_donations TINYINT(1) NULL, |
159 | 159 | PRIMARY KEY (EVTM_ID)"; |
160 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
161 | - $table_name = 'esp_event_question_group'; |
|
162 | - $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
160 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
161 | + $table_name = 'esp_event_question_group'; |
|
162 | + $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
163 | 163 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
164 | 164 | QSG_ID INT UNSIGNED NOT NULL, |
165 | 165 | EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
166 | 166 | PRIMARY KEY (EQG_ID)"; |
167 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
168 | - $table_name = 'esp_event_venue'; |
|
169 | - $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
167 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
168 | + $table_name = 'esp_event_venue'; |
|
169 | + $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
170 | 170 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
171 | 171 | VNU_ID BIGINT(20) UNSIGNED NOT NULL, |
172 | 172 | EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
173 | 173 | PRIMARY KEY (EVV_ID)"; |
174 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
175 | - $table_name = 'esp_extra_meta'; |
|
176 | - $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
174 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
175 | + $table_name = 'esp_extra_meta'; |
|
176 | + $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
177 | 177 | OBJ_ID INT(11) DEFAULT NULL, |
178 | 178 | EXM_type VARCHAR(45) DEFAULT NULL, |
179 | 179 | EXM_key VARCHAR(45) DEFAULT NULL, |
180 | 180 | EXM_value TEXT, |
181 | 181 | PRIMARY KEY (EXM_ID)"; |
182 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
183 | - $table_name = 'esp_line_item'; |
|
184 | - $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
182 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
183 | + $table_name = 'esp_line_item'; |
|
184 | + $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
185 | 185 | LIN_code VARCHAR(245) NOT NULL DEFAULT '', |
186 | 186 | TXN_ID INT(11) DEFAULT NULL, |
187 | 187 | LIN_name VARCHAR(245) NOT NULL DEFAULT '', |
@@ -197,18 +197,18 @@ discard block |
||
197 | 197 | OBJ_ID INT(11) DEFAULT NULL, |
198 | 198 | OBJ_type VARCHAR(45)DEFAULT NULL, |
199 | 199 | PRIMARY KEY (LIN_ID)"; |
200 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
201 | - $table_name = 'esp_message_template'; |
|
202 | - $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
200 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
201 | + $table_name = 'esp_message_template'; |
|
202 | + $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
203 | 203 | GRP_ID INT(10) UNSIGNED NOT NULL, |
204 | 204 | MTP_context VARCHAR(50) NOT NULL, |
205 | 205 | MTP_template_field VARCHAR(30) NOT NULL, |
206 | 206 | MTP_content TEXT NOT NULL, |
207 | 207 | PRIMARY KEY (MTP_ID), |
208 | 208 | KEY GRP_ID (GRP_ID)"; |
209 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
210 | - $table_name = 'esp_message_template_group'; |
|
211 | - $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
209 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
210 | + $table_name = 'esp_message_template_group'; |
|
211 | + $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
212 | 212 | EVT_ID BIGINT(20) UNSIGNED DEFAULT NULL, |
213 | 213 | MTP_user_id INT(10) NOT NULL DEFAULT '1', |
214 | 214 | MTP_messenger VARCHAR(30) NOT NULL, |
@@ -220,9 +220,9 @@ discard block |
||
220 | 220 | PRIMARY KEY (GRP_ID), |
221 | 221 | KEY EVT_ID (EVT_ID), |
222 | 222 | KEY MTP_user_id (MTP_user_id)"; |
223 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
224 | - $table_name = 'esp_payment'; |
|
225 | - $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
223 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
224 | + $table_name = 'esp_payment'; |
|
225 | + $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
226 | 226 | TXN_ID INT(10) UNSIGNED DEFAULT NULL, |
227 | 227 | STS_ID VARCHAR(3) COLLATE utf8_bin DEFAULT NULL, |
228 | 228 | PAY_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -238,9 +238,9 @@ discard block |
||
238 | 238 | PRIMARY KEY (PAY_ID), |
239 | 239 | KEY TXN_ID (TXN_ID), |
240 | 240 | KEY PAY_timestamp (PAY_timestamp)"; |
241 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
242 | - $table_name = "esp_ticket"; |
|
243 | - $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
241 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
242 | + $table_name = "esp_ticket"; |
|
243 | + $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
244 | 244 | TTM_ID INT(10) UNSIGNED NOT NULL, |
245 | 245 | TKT_name VARCHAR(245) NOT NULL DEFAULT '', |
246 | 246 | TKT_description TEXT NOT NULL, |
@@ -259,28 +259,28 @@ discard block |
||
259 | 259 | TKT_parent INT(10) UNSIGNED DEFAULT '0', |
260 | 260 | TKT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
261 | 261 | PRIMARY KEY (TKT_ID)"; |
262 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
263 | - $table_name = "esp_ticket_price"; |
|
264 | - $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
262 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
263 | + $table_name = "esp_ticket_price"; |
|
264 | + $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
265 | 265 | TKT_ID INT(10) UNSIGNED NOT NULL, |
266 | 266 | PRC_ID INT(10) UNSIGNED NOT NULL, |
267 | 267 | PRIMARY KEY (TKP_ID)"; |
268 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
269 | - $table_name = "esp_datetime_ticket"; |
|
270 | - $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
268 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
269 | + $table_name = "esp_datetime_ticket"; |
|
270 | + $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
271 | 271 | DTT_ID INT(10) UNSIGNED NOT NULL, |
272 | 272 | TKT_ID INT(10) UNSIGNED NOT NULL, |
273 | 273 | PRIMARY KEY (DTK_ID)"; |
274 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
275 | - $table_name = "esp_ticket_template"; |
|
276 | - $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
274 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
275 | + $table_name = "esp_ticket_template"; |
|
276 | + $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
277 | 277 | TTM_name VARCHAR(45) NOT NULL, |
278 | 278 | TTM_description TEXT, |
279 | 279 | TTM_file VARCHAR(45), |
280 | 280 | PRIMARY KEY (TTM_ID)"; |
281 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
282 | - $table_name = "esp_price"; |
|
283 | - $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
281 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
282 | + $table_name = "esp_price"; |
|
283 | + $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
284 | 284 | PRT_ID TINYINT(3) UNSIGNED NOT NULL, |
285 | 285 | PRC_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
286 | 286 | PRC_name VARCHAR(245) NOT NULL, |
@@ -291,9 +291,9 @@ discard block |
||
291 | 291 | PRC_order TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', |
292 | 292 | PRC_parent INT(10) UNSIGNED DEFAULT 0, |
293 | 293 | PRIMARY KEY (PRC_ID)"; |
294 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
295 | - $table_name = "esp_price_type"; |
|
296 | - $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
294 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
295 | + $table_name = "esp_price_type"; |
|
296 | + $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
297 | 297 | PRT_name VARCHAR(45) NOT NULL, |
298 | 298 | PBT_ID TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', |
299 | 299 | PRT_is_percent TINYINT(1) NOT NULL DEFAULT '0', |
@@ -301,9 +301,9 @@ discard block |
||
301 | 301 | PRT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
302 | 302 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
303 | 303 | PRIMARY KEY (PRT_ID)"; |
304 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
305 | - $table_name = 'esp_question'; |
|
306 | - $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
304 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
305 | + $table_name = 'esp_question'; |
|
306 | + $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
307 | 307 | QST_display_text TEXT NOT NULL, |
308 | 308 | QST_admin_label VARCHAR(255) NOT NULL, |
309 | 309 | QST_system VARCHAR(25) DEFAULT NULL, |
@@ -315,10 +315,10 @@ discard block |
||
315 | 315 | QST_wp_user BIGINT UNSIGNED NULL, |
316 | 316 | QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0, |
317 | 317 | PRIMARY KEY (QST_ID)'; |
318 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
319 | - $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
320 | - $table_name = 'esp_question_group'; |
|
321 | - $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
318 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
319 | + $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
320 | + $table_name = 'esp_question_group'; |
|
321 | + $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
322 | 322 | QSG_name VARCHAR(255) NOT NULL, |
323 | 323 | QSG_identifier VARCHAR(100) NOT NULL, |
324 | 324 | QSG_desc TEXT NULL, |
@@ -329,24 +329,24 @@ discard block |
||
329 | 329 | QSG_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
330 | 330 | PRIMARY KEY (QSG_ID), |
331 | 331 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)'; |
332 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
333 | - $table_name = 'esp_question_group_question'; |
|
334 | - $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
332 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
333 | + $table_name = 'esp_question_group_question'; |
|
334 | + $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
335 | 335 | QSG_ID INT UNSIGNED NOT NULL, |
336 | 336 | QST_ID INT UNSIGNED NOT NULL, |
337 | 337 | QGQ_order INT UNSIGNED NOT NULL DEFAULT 0, |
338 | 338 | PRIMARY KEY (QGQ_ID) "; |
339 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
340 | - $table_name = 'esp_question_option'; |
|
341 | - $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
339 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
340 | + $table_name = 'esp_question_option'; |
|
341 | + $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
342 | 342 | QSO_value VARCHAR(255) NOT NULL, |
343 | 343 | QSO_desc TEXT NOT NULL, |
344 | 344 | QST_ID INT UNSIGNED NOT NULL, |
345 | 345 | QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
346 | 346 | PRIMARY KEY (QSO_ID)"; |
347 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
348 | - $table_name = 'esp_registration'; |
|
349 | - $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
347 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
348 | + $table_name = 'esp_registration'; |
|
349 | + $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
350 | 350 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
351 | 351 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
352 | 352 | TXN_ID INT(10) UNSIGNED NOT NULL, |
@@ -369,25 +369,25 @@ discard block |
||
369 | 369 | KEY STS_ID (STS_ID), |
370 | 370 | KEY REG_url_link (REG_url_link), |
371 | 371 | KEY REG_code (REG_code)"; |
372 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
373 | - $table_name = 'esp_checkin'; |
|
374 | - $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
372 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
373 | + $table_name = 'esp_checkin'; |
|
374 | + $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
375 | 375 | REG_ID INT(10) UNSIGNED NOT NULL, |
376 | 376 | DTT_ID INT(10) UNSIGNED NOT NULL, |
377 | 377 | CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
378 | 378 | CHK_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
379 | 379 | PRIMARY KEY (CHK_ID)"; |
380 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
381 | - $table_name = 'esp_state'; |
|
382 | - $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
380 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
381 | + $table_name = 'esp_state'; |
|
382 | + $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
383 | 383 | CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
384 | 384 | STA_abbrev VARCHAR(6) COLLATE utf8_bin NOT NULL, |
385 | 385 | STA_name VARCHAR(100) COLLATE utf8_bin NOT NULL, |
386 | 386 | STA_active TINYINT(1) DEFAULT '1', |
387 | 387 | PRIMARY KEY (STA_ID)"; |
388 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
389 | - $table_name = 'esp_status'; |
|
390 | - $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
388 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
389 | + $table_name = 'esp_status'; |
|
390 | + $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
391 | 391 | STS_code VARCHAR(45) COLLATE utf8_bin NOT NULL, |
392 | 392 | STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL, |
393 | 393 | STS_can_edit TINYINT(1) NOT NULL DEFAULT 0, |
@@ -395,9 +395,9 @@ discard block |
||
395 | 395 | STS_open TINYINT(1) NOT NULL DEFAULT 1, |
396 | 396 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
397 | 397 | KEY STS_type (STS_type)"; |
398 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
399 | - $table_name = 'esp_transaction'; |
|
400 | - $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
398 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
399 | + $table_name = 'esp_transaction'; |
|
400 | + $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
401 | 401 | TXN_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
402 | 402 | TXN_total DECIMAL(10,3) DEFAULT '0.00', |
403 | 403 | TXN_paid DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
@@ -407,9 +407,9 @@ discard block |
||
407 | 407 | PRIMARY KEY (TXN_ID), |
408 | 408 | KEY TXN_timestamp (TXN_timestamp), |
409 | 409 | KEY STS_ID (STS_ID)"; |
410 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
411 | - $table_name = 'esp_venue_meta'; |
|
412 | - $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
410 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
411 | + $table_name = 'esp_venue_meta'; |
|
412 | + $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
413 | 413 | VNU_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
414 | 414 | VNU_address VARCHAR(255) DEFAULT NULL, |
415 | 415 | VNU_address2 VARCHAR(255) DEFAULT NULL, |
@@ -427,38 +427,38 @@ discard block |
||
427 | 427 | PRIMARY KEY (VNUM_ID), |
428 | 428 | KEY STA_ID (STA_ID), |
429 | 429 | KEY CNT_ISO (CNT_ISO)"; |
430 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
431 | - $script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
432 | - //setting up the DEFAULT stats and countries is also essential for the data migrations to run |
|
433 | - //(because many need to convert old string states to foreign keys into the states table) |
|
434 | - $script_with_defaults->insert_default_states(); |
|
435 | - $script_with_defaults->insert_default_countries(); |
|
436 | - //setting up DEFAULT prices, price types, and tickets is also essential for the price migrations |
|
437 | - $script_with_defaults->insert_default_price_types(); |
|
438 | - $script_with_defaults->insert_default_prices(); |
|
439 | - $script_with_defaults->insert_default_tickets(); |
|
440 | - //setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre |
|
441 | - EE_Config::instance()->update_espresso_config(false, true); |
|
442 | - return true; |
|
443 | - } |
|
444 | - |
|
445 | - |
|
446 | - |
|
447 | - /** |
|
448 | - * We COULD clean up the esp_question.QST_order field here. We'll leave it for now |
|
449 | - * |
|
450 | - * @return boolean |
|
451 | - */ |
|
452 | - public function schema_changes_after_migration() |
|
453 | - { |
|
454 | - return true; |
|
455 | - } |
|
456 | - |
|
457 | - |
|
458 | - |
|
459 | - public function migration_page_hooks() |
|
460 | - { |
|
461 | - } |
|
430 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
431 | + $script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
432 | + //setting up the DEFAULT stats and countries is also essential for the data migrations to run |
|
433 | + //(because many need to convert old string states to foreign keys into the states table) |
|
434 | + $script_with_defaults->insert_default_states(); |
|
435 | + $script_with_defaults->insert_default_countries(); |
|
436 | + //setting up DEFAULT prices, price types, and tickets is also essential for the price migrations |
|
437 | + $script_with_defaults->insert_default_price_types(); |
|
438 | + $script_with_defaults->insert_default_prices(); |
|
439 | + $script_with_defaults->insert_default_tickets(); |
|
440 | + //setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre |
|
441 | + EE_Config::instance()->update_espresso_config(false, true); |
|
442 | + return true; |
|
443 | + } |
|
444 | + |
|
445 | + |
|
446 | + |
|
447 | + /** |
|
448 | + * We COULD clean up the esp_question.QST_order field here. We'll leave it for now |
|
449 | + * |
|
450 | + * @return boolean |
|
451 | + */ |
|
452 | + public function schema_changes_after_migration() |
|
453 | + { |
|
454 | + return true; |
|
455 | + } |
|
456 | + |
|
457 | + |
|
458 | + |
|
459 | + public function migration_page_hooks() |
|
460 | + { |
|
461 | + } |
|
462 | 462 | } |
463 | 463 | |
464 | 464 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | //unfortunately, this needs to be done upon INCLUSION of this file, |
13 | 13 | //instead of construction, because it only gets constructed on first page load |
14 | 14 | //(all other times it gets resurrected from a wordpress option) |
15 | -$stages = glob(EE_CORE . 'data_migration_scripts/4_2_0_stages/*'); |
|
15 | +$stages = glob(EE_CORE.'data_migration_scripts/4_2_0_stages/*'); |
|
16 | 16 | $class_to_filepath = array(); |
17 | 17 | if ( ! empty($stages)) { |
18 | 18 | foreach ($stages as $filepath) { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | // echo "no version string provided: $version_string"; |
62 | 62 | //no version string provided... this must be pre 4.1 |
63 | 63 | //because since 4.1 we're |
64 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
64 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
65 | 65 | } else { |
66 | 66 | // echo "$version_string doesnt apply"; |
67 | 67 | return false; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | public function schema_changes_before_migration() |
81 | 81 | { |
82 | 82 | //relies on 4.1's EEH_Activation::create_table |
83 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
83 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
84 | 84 | $table_name = 'esp_answer'; |
85 | 85 | $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
86 | 86 | REG_ID INT UNSIGNED NOT NULL, |
@@ -14,11 +14,11 @@ discard block |
||
14 | 14 | $stages = glob(EE_CORE . 'data_migration_scripts/4_3_0_stages/*'); |
15 | 15 | $class_to_filepath = array(); |
16 | 16 | if ( ! empty($stages)) { |
17 | - foreach ($stages as $filepath) { |
|
18 | - $matches = array(); |
|
19 | - preg_match('~4_3_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
20 | - $class_to_filepath[$matches[1]] = $filepath; |
|
21 | - } |
|
17 | + foreach ($stages as $filepath) { |
|
18 | + $matches = array(); |
|
19 | + preg_match('~4_3_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
20 | + $class_to_filepath[$matches[1]] = $filepath; |
|
21 | + } |
|
22 | 22 | } |
23 | 23 | //give addons a chance to autoload their stages too |
24 | 24 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_3_0__autoloaded_stages', $class_to_filepath); |
@@ -31,64 +31,64 @@ discard block |
||
31 | 31 | |
32 | 32 | |
33 | 33 | |
34 | - /** |
|
35 | - * EE_DMS_Core_4_3_0 constructor. |
|
36 | - * |
|
37 | - * @param TableManager $table_manager |
|
38 | - * @param TableAnalysis $table_analysis |
|
39 | - */ |
|
40 | - public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
41 | - { |
|
42 | - $this->_pretty_name = __("Data Migration to Event Espresso 4.3.0.P", "event_espresso"); |
|
43 | - $this->_priority = 10; |
|
44 | - $this->_migration_stages = array( |
|
45 | - new EE_DMS_4_3_0_question_option_order(), |
|
46 | - new EE_DMS_4_3_0_event_message_templates(), |
|
47 | - new EE_DMS_4_3_0_critical_page_shortcode_tracking(), |
|
48 | - ); |
|
49 | - parent::__construct($table_manager, $table_analysis); |
|
50 | - } |
|
34 | + /** |
|
35 | + * EE_DMS_Core_4_3_0 constructor. |
|
36 | + * |
|
37 | + * @param TableManager $table_manager |
|
38 | + * @param TableAnalysis $table_analysis |
|
39 | + */ |
|
40 | + public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
41 | + { |
|
42 | + $this->_pretty_name = __("Data Migration to Event Espresso 4.3.0.P", "event_espresso"); |
|
43 | + $this->_priority = 10; |
|
44 | + $this->_migration_stages = array( |
|
45 | + new EE_DMS_4_3_0_question_option_order(), |
|
46 | + new EE_DMS_4_3_0_event_message_templates(), |
|
47 | + new EE_DMS_4_3_0_critical_page_shortcode_tracking(), |
|
48 | + ); |
|
49 | + parent::__construct($table_manager, $table_analysis); |
|
50 | + } |
|
51 | 51 | |
52 | 52 | |
53 | 53 | |
54 | - public function can_migrate_from_version($version_array) |
|
55 | - { |
|
56 | - $version_string = $version_array['Core']; |
|
57 | - if (version_compare($version_string, '4.3.0', '<=') && version_compare($version_string, '4.2.0', '>=')) { |
|
54 | + public function can_migrate_from_version($version_array) |
|
55 | + { |
|
56 | + $version_string = $version_array['Core']; |
|
57 | + if (version_compare($version_string, '4.3.0', '<=') && version_compare($version_string, '4.2.0', '>=')) { |
|
58 | 58 | // echo "$version_string can be migrated fro"; |
59 | - return true; |
|
60 | - } elseif ( ! $version_string) { |
|
59 | + return true; |
|
60 | + } elseif ( ! $version_string) { |
|
61 | 61 | // echo "no version string provided: $version_string"; |
62 | - //no version string provided... this must be pre 4.2 |
|
63 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
64 | - } else { |
|
62 | + //no version string provided... this must be pre 4.2 |
|
63 | + return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
64 | + } else { |
|
65 | 65 | // echo "$version_string doesnt apply"; |
66 | - return false; |
|
67 | - } |
|
68 | - } |
|
66 | + return false; |
|
67 | + } |
|
68 | + } |
|
69 | 69 | |
70 | 70 | |
71 | 71 | |
72 | - public function pretty_name() |
|
73 | - { |
|
74 | - return __("Core Data Migration to version 4.3.0", "event_espresso"); |
|
75 | - } |
|
72 | + public function pretty_name() |
|
73 | + { |
|
74 | + return __("Core Data Migration to version 4.3.0", "event_espresso"); |
|
75 | + } |
|
76 | 76 | |
77 | 77 | |
78 | 78 | |
79 | - public function schema_changes_before_migration() |
|
80 | - { |
|
81 | - //relies on 4.1's EEH_Activation::create_table |
|
82 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
83 | - $table_name = 'esp_answer'; |
|
84 | - $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
79 | + public function schema_changes_before_migration() |
|
80 | + { |
|
81 | + //relies on 4.1's EEH_Activation::create_table |
|
82 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
83 | + $table_name = 'esp_answer'; |
|
84 | + $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
85 | 85 | REG_ID INT UNSIGNED NOT NULL, |
86 | 86 | QST_ID INT UNSIGNED NOT NULL, |
87 | 87 | ANS_value TEXT NOT NULL, |
88 | 88 | PRIMARY KEY (ANS_ID)"; |
89 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
90 | - $table_name = 'esp_attendee_meta'; |
|
91 | - $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
89 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
90 | + $table_name = 'esp_attendee_meta'; |
|
91 | + $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
92 | 92 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
93 | 93 | ATT_fname VARCHAR(45) NOT NULL, |
94 | 94 | ATT_lname VARCHAR(45) NOT NULL, |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | KEY ATT_fname (ATT_fname), |
105 | 105 | KEY ATT_lname (ATT_lname), |
106 | 106 | KEY ATT_email (ATT_email)"; |
107 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
108 | - $table_name = 'esp_country'; |
|
109 | - $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
107 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
108 | + $table_name = 'esp_country'; |
|
109 | + $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
110 | 110 | CNT_ISO3 VARCHAR(3) COLLATE utf8_bin NOT NULL, |
111 | 111 | RGN_ID TINYINT(3) UNSIGNED DEFAULT NULL, |
112 | 112 | CNT_name VARCHAR(45) COLLATE utf8_bin NOT NULL, |
@@ -122,9 +122,9 @@ discard block |
||
122 | 122 | CNT_is_EU TINYINT(1) DEFAULT '0', |
123 | 123 | CNT_active TINYINT(1) DEFAULT '0', |
124 | 124 | PRIMARY KEY (CNT_ISO)"; |
125 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
126 | - $table_name = 'esp_datetime'; |
|
127 | - $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
125 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
126 | + $table_name = 'esp_datetime'; |
|
127 | + $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
128 | 128 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
129 | 129 | DTT_name VARCHAR(255) NOT NULL DEFAULT '', |
130 | 130 | DTT_description TEXT NOT NULL, |
@@ -139,9 +139,9 @@ discard block |
||
139 | 139 | PRIMARY KEY (DTT_ID), |
140 | 140 | KEY EVT_ID (EVT_ID), |
141 | 141 | KEY DTT_is_primary (DTT_is_primary)"; |
142 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
143 | - $table_name = 'esp_event_meta'; |
|
144 | - $sql = " |
|
142 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
143 | + $table_name = 'esp_event_meta'; |
|
144 | + $sql = " |
|
145 | 145 | EVTM_ID INT NOT NULL AUTO_INCREMENT, |
146 | 146 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
147 | 147 | EVT_display_desc TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -156,31 +156,31 @@ discard block |
||
156 | 156 | EVT_external_URL VARCHAR(200) NULL, |
157 | 157 | EVT_donations TINYINT(1) NULL, |
158 | 158 | PRIMARY KEY (EVTM_ID)"; |
159 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
160 | - $table_name = 'esp_event_question_group'; |
|
161 | - $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
159 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
160 | + $table_name = 'esp_event_question_group'; |
|
161 | + $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
162 | 162 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
163 | 163 | QSG_ID INT UNSIGNED NOT NULL, |
164 | 164 | EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
165 | 165 | PRIMARY KEY (EQG_ID)"; |
166 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
167 | - $table_name = 'esp_event_venue'; |
|
168 | - $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
166 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
167 | + $table_name = 'esp_event_venue'; |
|
168 | + $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
169 | 169 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
170 | 170 | VNU_ID BIGINT(20) UNSIGNED NOT NULL, |
171 | 171 | EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
172 | 172 | PRIMARY KEY (EVV_ID)"; |
173 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
174 | - $table_name = 'esp_extra_meta'; |
|
175 | - $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
173 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
174 | + $table_name = 'esp_extra_meta'; |
|
175 | + $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
176 | 176 | OBJ_ID INT(11) DEFAULT NULL, |
177 | 177 | EXM_type VARCHAR(45) DEFAULT NULL, |
178 | 178 | EXM_key VARCHAR(45) DEFAULT NULL, |
179 | 179 | EXM_value TEXT, |
180 | 180 | PRIMARY KEY (EXM_ID)"; |
181 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
182 | - $table_name = 'esp_line_item'; |
|
183 | - $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
181 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
182 | + $table_name = 'esp_line_item'; |
|
183 | + $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
184 | 184 | LIN_code VARCHAR(245) NOT NULL DEFAULT '', |
185 | 185 | TXN_ID INT(11) DEFAULT NULL, |
186 | 186 | LIN_name VARCHAR(245) NOT NULL DEFAULT '', |
@@ -196,19 +196,19 @@ discard block |
||
196 | 196 | OBJ_ID INT(11) DEFAULT NULL, |
197 | 197 | OBJ_type VARCHAR(45)DEFAULT NULL, |
198 | 198 | PRIMARY KEY (LIN_ID)"; |
199 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
200 | - $table_name = 'esp_message_template'; |
|
201 | - $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
199 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
200 | + $table_name = 'esp_message_template'; |
|
201 | + $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
202 | 202 | GRP_ID INT(10) UNSIGNED NOT NULL, |
203 | 203 | MTP_context VARCHAR(50) NOT NULL, |
204 | 204 | MTP_template_field VARCHAR(30) NOT NULL, |
205 | 205 | MTP_content TEXT NOT NULL, |
206 | 206 | PRIMARY KEY (MTP_ID), |
207 | 207 | KEY GRP_ID (GRP_ID)"; |
208 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
209 | - $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID'); |
|
210 | - $table_name = 'esp_message_template_group'; |
|
211 | - $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
208 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
209 | + $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID'); |
|
210 | + $table_name = 'esp_message_template_group'; |
|
211 | + $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
212 | 212 | MTP_user_id INT(10) NOT NULL DEFAULT '1', |
213 | 213 | MTP_name VARCHAR(245) NOT NULL DEFAULT '', |
214 | 214 | MTP_description VARCHAR(245) NOT NULL DEFAULT '', |
@@ -220,17 +220,17 @@ discard block |
||
220 | 220 | MTP_is_active TINYINT(1) NOT NULL DEFAULT '1', |
221 | 221 | PRIMARY KEY (GRP_ID), |
222 | 222 | KEY MTP_user_id (MTP_user_id)"; |
223 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
224 | - $table_name = 'esp_event_message_template'; |
|
225 | - $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
223 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
224 | + $table_name = 'esp_event_message_template'; |
|
225 | + $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
226 | 226 | EVT_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
227 | 227 | GRP_ID INT(10) UNSIGNED NOT NULL DEFAULT 0, |
228 | 228 | PRIMARY KEY (EMT_ID), |
229 | 229 | KEY EVT_ID (EVT_ID), |
230 | 230 | KEY GRP_ID (GRP_ID)"; |
231 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
232 | - $table_name = 'esp_payment'; |
|
233 | - $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
231 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
232 | + $table_name = 'esp_payment'; |
|
233 | + $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
234 | 234 | TXN_ID INT(10) UNSIGNED DEFAULT NULL, |
235 | 235 | STS_ID VARCHAR(3) COLLATE utf8_bin DEFAULT NULL, |
236 | 236 | PAY_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -246,9 +246,9 @@ discard block |
||
246 | 246 | PRIMARY KEY (PAY_ID), |
247 | 247 | KEY TXN_ID (TXN_ID), |
248 | 248 | KEY PAY_timestamp (PAY_timestamp)"; |
249 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
250 | - $table_name = "esp_ticket"; |
|
251 | - $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
249 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
250 | + $table_name = "esp_ticket"; |
|
251 | + $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
252 | 252 | TTM_ID INT(10) UNSIGNED NOT NULL, |
253 | 253 | TKT_name VARCHAR(245) NOT NULL DEFAULT '', |
254 | 254 | TKT_description TEXT NOT NULL, |
@@ -268,28 +268,28 @@ discard block |
||
268 | 268 | TKT_parent INT(10) UNSIGNED DEFAULT '0', |
269 | 269 | TKT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
270 | 270 | PRIMARY KEY (TKT_ID)"; |
271 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
272 | - $table_name = "esp_ticket_price"; |
|
273 | - $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
271 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
272 | + $table_name = "esp_ticket_price"; |
|
273 | + $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
274 | 274 | TKT_ID INT(10) UNSIGNED NOT NULL, |
275 | 275 | PRC_ID INT(10) UNSIGNED NOT NULL, |
276 | 276 | PRIMARY KEY (TKP_ID)"; |
277 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
278 | - $table_name = "esp_datetime_ticket"; |
|
279 | - $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
277 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
278 | + $table_name = "esp_datetime_ticket"; |
|
279 | + $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
280 | 280 | DTT_ID INT(10) UNSIGNED NOT NULL, |
281 | 281 | TKT_ID INT(10) UNSIGNED NOT NULL, |
282 | 282 | PRIMARY KEY (DTK_ID)"; |
283 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
284 | - $table_name = "esp_ticket_template"; |
|
285 | - $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
283 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
284 | + $table_name = "esp_ticket_template"; |
|
285 | + $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
286 | 286 | TTM_name VARCHAR(45) NOT NULL, |
287 | 287 | TTM_description TEXT, |
288 | 288 | TTM_file VARCHAR(45), |
289 | 289 | PRIMARY KEY (TTM_ID)"; |
290 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
291 | - $table_name = "esp_price"; |
|
292 | - $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
290 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
291 | + $table_name = "esp_price"; |
|
292 | + $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
293 | 293 | PRT_ID TINYINT(3) UNSIGNED NOT NULL, |
294 | 294 | PRC_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
295 | 295 | PRC_name VARCHAR(245) NOT NULL, |
@@ -300,9 +300,9 @@ discard block |
||
300 | 300 | PRC_order TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', |
301 | 301 | PRC_parent INT(10) UNSIGNED DEFAULT 0, |
302 | 302 | PRIMARY KEY (PRC_ID)"; |
303 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
304 | - $table_name = "esp_price_type"; |
|
305 | - $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
303 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
304 | + $table_name = "esp_price_type"; |
|
305 | + $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
306 | 306 | PRT_name VARCHAR(45) NOT NULL, |
307 | 307 | PBT_ID TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', |
308 | 308 | PRT_is_percent TINYINT(1) NOT NULL DEFAULT '0', |
@@ -310,9 +310,9 @@ discard block |
||
310 | 310 | PRT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
311 | 311 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
312 | 312 | PRIMARY KEY (PRT_ID)"; |
313 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
314 | - $table_name = 'esp_question'; |
|
315 | - $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
313 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
314 | + $table_name = 'esp_question'; |
|
315 | + $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
316 | 316 | QST_display_text TEXT NOT NULL, |
317 | 317 | QST_admin_label VARCHAR(255) NOT NULL, |
318 | 318 | QST_system VARCHAR(25) DEFAULT NULL, |
@@ -324,10 +324,10 @@ discard block |
||
324 | 324 | QST_wp_user BIGINT UNSIGNED NULL, |
325 | 325 | QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0, |
326 | 326 | PRIMARY KEY (QST_ID)'; |
327 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
328 | - $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
329 | - $table_name = 'esp_question_group'; |
|
330 | - $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
327 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
328 | + $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
329 | + $table_name = 'esp_question_group'; |
|
330 | + $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
331 | 331 | QSG_name VARCHAR(255) NOT NULL, |
332 | 332 | QSG_identifier VARCHAR(100) NOT NULL, |
333 | 333 | QSG_desc TEXT NULL, |
@@ -338,25 +338,25 @@ discard block |
||
338 | 338 | QSG_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
339 | 339 | PRIMARY KEY (QSG_ID), |
340 | 340 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)'; |
341 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
342 | - $table_name = 'esp_question_group_question'; |
|
343 | - $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
341 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
342 | + $table_name = 'esp_question_group_question'; |
|
343 | + $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
344 | 344 | QSG_ID INT UNSIGNED NOT NULL, |
345 | 345 | QST_ID INT UNSIGNED NOT NULL, |
346 | 346 | QGQ_order INT UNSIGNED NOT NULL DEFAULT 0, |
347 | 347 | PRIMARY KEY (QGQ_ID) "; |
348 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
349 | - $table_name = 'esp_question_option'; |
|
350 | - $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
348 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
349 | + $table_name = 'esp_question_option'; |
|
350 | + $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
351 | 351 | QSO_value VARCHAR(255) NOT NULL, |
352 | 352 | QSO_desc TEXT NOT NULL, |
353 | 353 | QST_ID INT UNSIGNED NOT NULL, |
354 | 354 | QSO_order INT UNSIGNED NOT NULL DEFAULT 0, |
355 | 355 | QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
356 | 356 | PRIMARY KEY (QSO_ID)"; |
357 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
358 | - $table_name = 'esp_registration'; |
|
359 | - $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
357 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
358 | + $table_name = 'esp_registration'; |
|
359 | + $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
360 | 360 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
361 | 361 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
362 | 362 | TXN_ID INT(10) UNSIGNED NOT NULL, |
@@ -379,25 +379,25 @@ discard block |
||
379 | 379 | KEY STS_ID (STS_ID), |
380 | 380 | KEY REG_url_link (REG_url_link), |
381 | 381 | KEY REG_code (REG_code)"; |
382 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
383 | - $table_name = 'esp_checkin'; |
|
384 | - $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
382 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
383 | + $table_name = 'esp_checkin'; |
|
384 | + $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
385 | 385 | REG_ID INT(10) UNSIGNED NOT NULL, |
386 | 386 | DTT_ID INT(10) UNSIGNED NOT NULL, |
387 | 387 | CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
388 | 388 | CHK_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
389 | 389 | PRIMARY KEY (CHK_ID)"; |
390 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
391 | - $table_name = 'esp_state'; |
|
392 | - $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
390 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
391 | + $table_name = 'esp_state'; |
|
392 | + $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
393 | 393 | CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
394 | 394 | STA_abbrev VARCHAR(6) COLLATE utf8_bin NOT NULL, |
395 | 395 | STA_name VARCHAR(100) COLLATE utf8_bin NOT NULL, |
396 | 396 | STA_active TINYINT(1) DEFAULT '1', |
397 | 397 | PRIMARY KEY (STA_ID)"; |
398 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
399 | - $table_name = 'esp_status'; |
|
400 | - $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
398 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
399 | + $table_name = 'esp_status'; |
|
400 | + $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
401 | 401 | STS_code VARCHAR(45) COLLATE utf8_bin NOT NULL, |
402 | 402 | STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL, |
403 | 403 | STS_can_edit TINYINT(1) NOT NULL DEFAULT 0, |
@@ -405,9 +405,9 @@ discard block |
||
405 | 405 | STS_open TINYINT(1) NOT NULL DEFAULT 1, |
406 | 406 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
407 | 407 | KEY STS_type (STS_type)"; |
408 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
409 | - $table_name = 'esp_transaction'; |
|
410 | - $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
408 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
409 | + $table_name = 'esp_transaction'; |
|
410 | + $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
411 | 411 | TXN_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
412 | 412 | TXN_total DECIMAL(10,3) DEFAULT '0.00', |
413 | 413 | TXN_paid DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
@@ -417,9 +417,9 @@ discard block |
||
417 | 417 | PRIMARY KEY (TXN_ID), |
418 | 418 | KEY TXN_timestamp (TXN_timestamp), |
419 | 419 | KEY STS_ID (STS_ID)"; |
420 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
421 | - $table_name = 'esp_venue_meta'; |
|
422 | - $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
420 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
421 | + $table_name = 'esp_venue_meta'; |
|
422 | + $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
423 | 423 | VNU_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
424 | 424 | VNU_address VARCHAR(255) DEFAULT NULL, |
425 | 425 | VNU_address2 VARCHAR(255) DEFAULT NULL, |
@@ -437,79 +437,79 @@ discard block |
||
437 | 437 | PRIMARY KEY (VNUM_ID), |
438 | 438 | KEY STA_ID (STA_ID), |
439 | 439 | KEY CNT_ISO (CNT_ISO)"; |
440 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
441 | - $script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
442 | - //setting up the DEFAULT stats and countries is also essential for the data migrations to run |
|
443 | - //(because many need to convert old string states to foreign keys into the states table) |
|
444 | - $script_with_defaults->insert_default_states(); |
|
445 | - $script_with_defaults->insert_default_countries(); |
|
446 | - //setting up DEFAULT prices, price types, and tickets is also essential for the price migrations |
|
447 | - $script_with_defaults->insert_default_price_types(); |
|
448 | - $script_with_defaults->insert_default_prices(); |
|
449 | - //but the schema on the tickets table has changed since 4.1, so use our DEFAULT ticket method instead of 4.1's |
|
450 | - $this->insert_default_tickets(); |
|
451 | - //setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre |
|
452 | - EE_Config::instance()->update_espresso_config(false, true); |
|
453 | - return true; |
|
454 | - } |
|
455 | - |
|
456 | - |
|
457 | - |
|
458 | - /** |
|
459 | - * @return boolean |
|
460 | - */ |
|
461 | - public function schema_changes_after_migration() |
|
462 | - { |
|
463 | - return true; |
|
464 | - } |
|
465 | - |
|
466 | - |
|
467 | - |
|
468 | - public function migration_page_hooks() |
|
469 | - { |
|
470 | - } |
|
471 | - |
|
472 | - |
|
473 | - |
|
474 | - /** |
|
475 | - * insert DEFAULT ticket |
|
476 | - * Almost identical to EE_DMS_Core_4_1_0::insert_default_tickets, except is aware of the TKT_required field |
|
477 | - * |
|
478 | - * @access public |
|
479 | - * @static |
|
480 | - * @return void |
|
481 | - */ |
|
482 | - public function insert_default_tickets() |
|
483 | - { |
|
484 | - global $wpdb; |
|
485 | - $ticket_table = $wpdb->prefix . "esp_ticket"; |
|
486 | - if ($this->_get_table_analysis()->tableExists($ticket_table)) { |
|
487 | - $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table; |
|
488 | - $tickets_exist = $wpdb->get_var($SQL); |
|
489 | - if ( ! $tickets_exist) { |
|
490 | - $SQL = "INSERT INTO $ticket_table |
|
440 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
441 | + $script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
442 | + //setting up the DEFAULT stats and countries is also essential for the data migrations to run |
|
443 | + //(because many need to convert old string states to foreign keys into the states table) |
|
444 | + $script_with_defaults->insert_default_states(); |
|
445 | + $script_with_defaults->insert_default_countries(); |
|
446 | + //setting up DEFAULT prices, price types, and tickets is also essential for the price migrations |
|
447 | + $script_with_defaults->insert_default_price_types(); |
|
448 | + $script_with_defaults->insert_default_prices(); |
|
449 | + //but the schema on the tickets table has changed since 4.1, so use our DEFAULT ticket method instead of 4.1's |
|
450 | + $this->insert_default_tickets(); |
|
451 | + //setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre |
|
452 | + EE_Config::instance()->update_espresso_config(false, true); |
|
453 | + return true; |
|
454 | + } |
|
455 | + |
|
456 | + |
|
457 | + |
|
458 | + /** |
|
459 | + * @return boolean |
|
460 | + */ |
|
461 | + public function schema_changes_after_migration() |
|
462 | + { |
|
463 | + return true; |
|
464 | + } |
|
465 | + |
|
466 | + |
|
467 | + |
|
468 | + public function migration_page_hooks() |
|
469 | + { |
|
470 | + } |
|
471 | + |
|
472 | + |
|
473 | + |
|
474 | + /** |
|
475 | + * insert DEFAULT ticket |
|
476 | + * Almost identical to EE_DMS_Core_4_1_0::insert_default_tickets, except is aware of the TKT_required field |
|
477 | + * |
|
478 | + * @access public |
|
479 | + * @static |
|
480 | + * @return void |
|
481 | + */ |
|
482 | + public function insert_default_tickets() |
|
483 | + { |
|
484 | + global $wpdb; |
|
485 | + $ticket_table = $wpdb->prefix . "esp_ticket"; |
|
486 | + if ($this->_get_table_analysis()->tableExists($ticket_table)) { |
|
487 | + $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table; |
|
488 | + $tickets_exist = $wpdb->get_var($SQL); |
|
489 | + if ( ! $tickets_exist) { |
|
490 | + $SQL = "INSERT INTO $ticket_table |
|
491 | 491 | ( TKT_ID, TTM_ID, TKT_name, TKT_description, TKT_qty, TKT_sold, TKT_uses, TKT_required, TKT_min, TKT_max, TKT_price, TKT_start_date, TKT_end_date, TKT_taxable, TKT_order, TKT_row, TKT_is_default, TKT_parent, TKT_deleted ) VALUES |
492 | 492 | ( 1, 0, '" |
493 | - . __("Free Ticket", "event_espresso") |
|
494 | - . "', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, 0);"; |
|
495 | - $SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL', $SQL); |
|
496 | - $wpdb->query($SQL); |
|
497 | - } |
|
498 | - } |
|
499 | - $ticket_price_table = $wpdb->prefix . "esp_ticket_price"; |
|
500 | - if ($this->_get_table_analysis()->tableExists($ticket_price_table)) { |
|
501 | - $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table; |
|
502 | - $ticket_prc_exist = $wpdb->get_var($SQL); |
|
503 | - if ( ! $ticket_prc_exist) { |
|
504 | - $SQL = "INSERT INTO $ticket_price_table |
|
493 | + . __("Free Ticket", "event_espresso") |
|
494 | + . "', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, 0);"; |
|
495 | + $SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL', $SQL); |
|
496 | + $wpdb->query($SQL); |
|
497 | + } |
|
498 | + } |
|
499 | + $ticket_price_table = $wpdb->prefix . "esp_ticket_price"; |
|
500 | + if ($this->_get_table_analysis()->tableExists($ticket_price_table)) { |
|
501 | + $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table; |
|
502 | + $ticket_prc_exist = $wpdb->get_var($SQL); |
|
503 | + if ( ! $ticket_prc_exist) { |
|
504 | + $SQL = "INSERT INTO $ticket_price_table |
|
505 | 505 | ( TKP_ID, TKT_ID, PRC_ID ) VALUES |
506 | 506 | ( 1, 1, 1 ) |
507 | 507 | "; |
508 | - $SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL__ticket_price', $SQL); |
|
509 | - $wpdb->query($SQL); |
|
510 | - } |
|
511 | - } |
|
512 | - } |
|
508 | + $SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL__ticket_price', $SQL); |
|
509 | + $wpdb->query($SQL); |
|
510 | + } |
|
511 | + } |
|
512 | + } |
|
513 | 513 | |
514 | 514 | } |
515 | 515 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | //unfortunately, this needs to be done upon INCLUSION of this file, |
12 | 12 | //instead of construction, because it only gets constructed on first page load |
13 | 13 | //(all other times it gets resurrected from a wordpress option) |
14 | -$stages = glob(EE_CORE . 'data_migration_scripts/4_3_0_stages/*'); |
|
14 | +$stages = glob(EE_CORE.'data_migration_scripts/4_3_0_stages/*'); |
|
15 | 15 | $class_to_filepath = array(); |
16 | 16 | if ( ! empty($stages)) { |
17 | 17 | foreach ($stages as $filepath) { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } elseif ( ! $version_string) { |
61 | 61 | // echo "no version string provided: $version_string"; |
62 | 62 | //no version string provided... this must be pre 4.2 |
63 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
63 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
64 | 64 | } else { |
65 | 65 | // echo "$version_string doesnt apply"; |
66 | 66 | return false; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | public function schema_changes_before_migration() |
80 | 80 | { |
81 | 81 | //relies on 4.1's EEH_Activation::create_table |
82 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
82 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
83 | 83 | $table_name = 'esp_answer'; |
84 | 84 | $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
85 | 85 | REG_ID INT UNSIGNED NOT NULL, |
@@ -482,9 +482,9 @@ discard block |
||
482 | 482 | public function insert_default_tickets() |
483 | 483 | { |
484 | 484 | global $wpdb; |
485 | - $ticket_table = $wpdb->prefix . "esp_ticket"; |
|
485 | + $ticket_table = $wpdb->prefix."esp_ticket"; |
|
486 | 486 | if ($this->_get_table_analysis()->tableExists($ticket_table)) { |
487 | - $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table; |
|
487 | + $SQL = 'SELECT COUNT(TKT_ID) FROM '.$ticket_table; |
|
488 | 488 | $tickets_exist = $wpdb->get_var($SQL); |
489 | 489 | if ( ! $tickets_exist) { |
490 | 490 | $SQL = "INSERT INTO $ticket_table |
@@ -496,9 +496,9 @@ discard block |
||
496 | 496 | $wpdb->query($SQL); |
497 | 497 | } |
498 | 498 | } |
499 | - $ticket_price_table = $wpdb->prefix . "esp_ticket_price"; |
|
499 | + $ticket_price_table = $wpdb->prefix."esp_ticket_price"; |
|
500 | 500 | if ($this->_get_table_analysis()->tableExists($ticket_price_table)) { |
501 | - $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table; |
|
501 | + $SQL = 'SELECT COUNT(TKP_ID) FROM '.$ticket_price_table; |
|
502 | 502 | $ticket_prc_exist = $wpdb->get_var($SQL); |
503 | 503 | if ( ! $ticket_prc_exist) { |
504 | 504 | $SQL = "INSERT INTO $ticket_price_table |
@@ -14,9 +14,9 @@ discard block |
||
14 | 14 | $stages = glob(EE_CORE . 'data_migration_scripts/4_6_0_stages/*'); |
15 | 15 | $class_to_filepath = array(); |
16 | 16 | foreach ($stages as $filepath) { |
17 | - $matches = array(); |
|
18 | - preg_match('~4_6_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
19 | - $class_to_filepath[$matches[1]] = $filepath; |
|
17 | + $matches = array(); |
|
18 | + preg_match('~4_6_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
19 | + $class_to_filepath[$matches[1]] = $filepath; |
|
20 | 20 | } |
21 | 21 | //give addons a chance to autoload their stages too |
22 | 22 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_6_0__autoloaded_stages', $class_to_filepath); |
@@ -35,80 +35,80 @@ discard block |
||
35 | 35 | class EE_DMS_Core_4_6_0 extends EE_Data_Migration_Script_Base |
36 | 36 | { |
37 | 37 | |
38 | - /** |
|
39 | - * return EE_DMS_Core_4_6_0 |
|
40 | - * |
|
41 | - * @param TableManager $table_manager |
|
42 | - * @param TableAnalysis $table_analysis |
|
43 | - */ |
|
44 | - public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
45 | - { |
|
46 | - $this->_pretty_name = __("Data Migration to Event Espresso 4.6.0.P", "event_espresso"); |
|
47 | - $this->_priority = 10; |
|
48 | - $this->_migration_stages = array( |
|
49 | - new EE_DMS_4_6_0_gateways(), |
|
50 | - new EE_DMS_4_6_0_payment_method_currencies(), |
|
51 | - new EE_DMS_4_6_0_question_types(), |
|
52 | - new EE_DMS_4_6_0_country_system_question(), |
|
53 | - new EE_DMS_4_6_0_state_system_question(), |
|
54 | - new EE_DMS_4_6_0_billing_info(), |
|
55 | - new EE_DMS_4_6_0_transactions(), |
|
56 | - new EE_DMS_4_6_0_payments(), |
|
57 | - new EE_DMS_4_6_0_invoice_settings(), |
|
58 | - ); |
|
59 | - parent::__construct($table_manager, $table_analysis); |
|
60 | - } |
|
61 | - |
|
62 | - |
|
63 | - |
|
64 | - /** |
|
65 | - * @param array $version_array |
|
66 | - * @return bool |
|
67 | - */ |
|
68 | - public function can_migrate_from_version($version_array) |
|
69 | - { |
|
70 | - $version_string = $version_array['Core']; |
|
71 | - if (version_compare($version_string, '4.6.0', '<=') && version_compare($version_string, '4.5.0', '>=')) { |
|
38 | + /** |
|
39 | + * return EE_DMS_Core_4_6_0 |
|
40 | + * |
|
41 | + * @param TableManager $table_manager |
|
42 | + * @param TableAnalysis $table_analysis |
|
43 | + */ |
|
44 | + public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
45 | + { |
|
46 | + $this->_pretty_name = __("Data Migration to Event Espresso 4.6.0.P", "event_espresso"); |
|
47 | + $this->_priority = 10; |
|
48 | + $this->_migration_stages = array( |
|
49 | + new EE_DMS_4_6_0_gateways(), |
|
50 | + new EE_DMS_4_6_0_payment_method_currencies(), |
|
51 | + new EE_DMS_4_6_0_question_types(), |
|
52 | + new EE_DMS_4_6_0_country_system_question(), |
|
53 | + new EE_DMS_4_6_0_state_system_question(), |
|
54 | + new EE_DMS_4_6_0_billing_info(), |
|
55 | + new EE_DMS_4_6_0_transactions(), |
|
56 | + new EE_DMS_4_6_0_payments(), |
|
57 | + new EE_DMS_4_6_0_invoice_settings(), |
|
58 | + ); |
|
59 | + parent::__construct($table_manager, $table_analysis); |
|
60 | + } |
|
61 | + |
|
62 | + |
|
63 | + |
|
64 | + /** |
|
65 | + * @param array $version_array |
|
66 | + * @return bool |
|
67 | + */ |
|
68 | + public function can_migrate_from_version($version_array) |
|
69 | + { |
|
70 | + $version_string = $version_array['Core']; |
|
71 | + if (version_compare($version_string, '4.6.0', '<=') && version_compare($version_string, '4.5.0', '>=')) { |
|
72 | 72 | // echo "$version_string can be migrated from"; |
73 | - return true; |
|
74 | - } elseif ( ! $version_string) { |
|
73 | + return true; |
|
74 | + } elseif ( ! $version_string) { |
|
75 | 75 | // echo "no version string provided: $version_string"; |
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 { |
|
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 { |
|
79 | 79 | // echo "$version_string doesnt apply"; |
80 | - return false; |
|
81 | - } |
|
82 | - } |
|
80 | + return false; |
|
81 | + } |
|
82 | + } |
|
83 | 83 | |
84 | 84 | |
85 | 85 | |
86 | - /** |
|
87 | - * @return string|void |
|
88 | - */ |
|
89 | - public function pretty_name() |
|
90 | - { |
|
91 | - return __("Core Data Migration to version 4.6.0", "event_espresso"); |
|
92 | - } |
|
86 | + /** |
|
87 | + * @return string|void |
|
88 | + */ |
|
89 | + public function pretty_name() |
|
90 | + { |
|
91 | + return __("Core Data Migration to version 4.6.0", "event_espresso"); |
|
92 | + } |
|
93 | 93 | |
94 | 94 | |
95 | 95 | |
96 | - /** |
|
97 | - * @return bool |
|
98 | - */ |
|
99 | - public function schema_changes_before_migration() |
|
100 | - { |
|
101 | - //relies on 4.1's EEH_Activation::create_table |
|
102 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
103 | - $table_name = 'esp_answer'; |
|
104 | - $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
96 | + /** |
|
97 | + * @return bool |
|
98 | + */ |
|
99 | + public function schema_changes_before_migration() |
|
100 | + { |
|
101 | + //relies on 4.1's EEH_Activation::create_table |
|
102 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
103 | + $table_name = 'esp_answer'; |
|
104 | + $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
105 | 105 | REG_ID INT UNSIGNED NOT NULL, |
106 | 106 | QST_ID INT UNSIGNED NOT NULL, |
107 | 107 | ANS_value TEXT NOT NULL, |
108 | 108 | PRIMARY KEY (ANS_ID)"; |
109 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
110 | - $table_name = 'esp_attendee_meta'; |
|
111 | - $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
109 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
110 | + $table_name = 'esp_attendee_meta'; |
|
111 | + $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
112 | 112 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
113 | 113 | ATT_fname VARCHAR(45) NOT NULL, |
114 | 114 | ATT_lname VARCHAR(45) NOT NULL, |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | KEY ATT_fname (ATT_fname), |
125 | 125 | KEY ATT_lname (ATT_lname), |
126 | 126 | KEY ATT_email (ATT_email)"; |
127 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
128 | - $table_name = 'esp_country'; |
|
129 | - $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
127 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
128 | + $table_name = 'esp_country'; |
|
129 | + $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
130 | 130 | CNT_ISO3 VARCHAR(3) COLLATE utf8_bin NOT NULL, |
131 | 131 | RGN_ID TINYINT(3) UNSIGNED DEFAULT NULL, |
132 | 132 | CNT_name VARCHAR(45) COLLATE utf8_bin NOT NULL, |
@@ -142,24 +142,24 @@ discard block |
||
142 | 142 | CNT_is_EU TINYINT(1) DEFAULT '0', |
143 | 143 | CNT_active TINYINT(1) DEFAULT '0', |
144 | 144 | PRIMARY KEY (CNT_ISO)"; |
145 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
146 | - $table_name = 'esp_currency'; |
|
147 | - $sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
|
145 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
146 | + $table_name = 'esp_currency'; |
|
147 | + $sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
|
148 | 148 | CUR_single VARCHAR(45) COLLATE utf8_bin DEFAULT 'dollar', |
149 | 149 | CUR_plural VARCHAR(45) COLLATE utf8_bin DEFAULT 'dollars', |
150 | 150 | CUR_sign VARCHAR(45) COLLATE utf8_bin DEFAULT '$', |
151 | 151 | CUR_dec_plc VARCHAR(1) COLLATE utf8_bin NOT NULL DEFAULT '2', |
152 | 152 | CUR_active TINYINT(1) DEFAULT '0', |
153 | 153 | PRIMARY KEY (CUR_code)"; |
154 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
155 | - $table_name = 'esp_currency_payment_method'; |
|
156 | - $sql = "CPM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
154 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
155 | + $table_name = 'esp_currency_payment_method'; |
|
156 | + $sql = "CPM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
157 | 157 | CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
158 | 158 | PMD_ID INT(11) NOT NULL, |
159 | 159 | PRIMARY KEY (CPM_ID)"; |
160 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
161 | - $table_name = 'esp_datetime'; |
|
162 | - $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
160 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
161 | + $table_name = 'esp_datetime'; |
|
162 | + $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
163 | 163 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
164 | 164 | DTT_name VARCHAR(255) NOT NULL DEFAULT '', |
165 | 165 | DTT_description TEXT NOT NULL, |
@@ -174,9 +174,9 @@ discard block |
||
174 | 174 | PRIMARY KEY (DTT_ID), |
175 | 175 | KEY EVT_ID (EVT_ID), |
176 | 176 | KEY DTT_is_primary (DTT_is_primary)"; |
177 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
178 | - $table_name = 'esp_event_meta'; |
|
179 | - $sql = " |
|
177 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
178 | + $table_name = 'esp_event_meta'; |
|
179 | + $sql = " |
|
180 | 180 | EVTM_ID INT NOT NULL AUTO_INCREMENT, |
181 | 181 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
182 | 182 | EVT_display_desc TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -191,31 +191,31 @@ discard block |
||
191 | 191 | EVT_external_URL VARCHAR(200) NULL, |
192 | 192 | EVT_donations TINYINT(1) NULL, |
193 | 193 | PRIMARY KEY (EVTM_ID)"; |
194 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
195 | - $table_name = 'esp_event_question_group'; |
|
196 | - $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
194 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
195 | + $table_name = 'esp_event_question_group'; |
|
196 | + $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
197 | 197 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
198 | 198 | QSG_ID INT UNSIGNED NOT NULL, |
199 | 199 | EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
200 | 200 | PRIMARY KEY (EQG_ID)"; |
201 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
202 | - $table_name = 'esp_event_venue'; |
|
203 | - $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
201 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
202 | + $table_name = 'esp_event_venue'; |
|
203 | + $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
204 | 204 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
205 | 205 | VNU_ID BIGINT(20) UNSIGNED NOT NULL, |
206 | 206 | EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
207 | 207 | PRIMARY KEY (EVV_ID)"; |
208 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
209 | - $table_name = 'esp_extra_meta'; |
|
210 | - $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
208 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
209 | + $table_name = 'esp_extra_meta'; |
|
210 | + $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
211 | 211 | OBJ_ID INT(11) DEFAULT NULL, |
212 | 212 | EXM_type VARCHAR(45) DEFAULT NULL, |
213 | 213 | EXM_key VARCHAR(45) DEFAULT NULL, |
214 | 214 | EXM_value TEXT, |
215 | 215 | PRIMARY KEY (EXM_ID)"; |
216 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
217 | - $table_name = 'esp_line_item'; |
|
218 | - $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
216 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
217 | + $table_name = 'esp_line_item'; |
|
218 | + $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
219 | 219 | LIN_code VARCHAR(245) NOT NULL DEFAULT '', |
220 | 220 | TXN_ID INT(11) DEFAULT NULL, |
221 | 221 | LIN_name VARCHAR(245) NOT NULL DEFAULT '', |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | OBJ_ID INT(11) DEFAULT NULL, |
232 | 232 | OBJ_type VARCHAR(45)DEFAULT NULL, |
233 | 233 | PRIMARY KEY (LIN_ID)"; |
234 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
235 | - $table_name = 'esp_log'; |
|
236 | - $sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
234 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
235 | + $table_name = 'esp_log'; |
|
236 | + $sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
237 | 237 | LOG_time DATETIME DEFAULT NULL, |
238 | 238 | OBJ_ID VARCHAR(45) DEFAULT NULL, |
239 | 239 | OBJ_type VARCHAR(45) DEFAULT NULL, |
@@ -241,19 +241,19 @@ discard block |
||
241 | 241 | LOG_message TEXT, |
242 | 242 | LOG_wp_user INT(11) DEFAULT NULL, |
243 | 243 | PRIMARY KEY (LOG_ID)"; |
244 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
245 | - $table_name = 'esp_message_template'; |
|
246 | - $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
244 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
245 | + $table_name = 'esp_message_template'; |
|
246 | + $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
247 | 247 | GRP_ID INT(10) UNSIGNED NOT NULL, |
248 | 248 | MTP_context VARCHAR(50) NOT NULL, |
249 | 249 | MTP_template_field VARCHAR(30) NOT NULL, |
250 | 250 | MTP_content TEXT NOT NULL, |
251 | 251 | PRIMARY KEY (MTP_ID), |
252 | 252 | KEY GRP_ID (GRP_ID)"; |
253 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
254 | - $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID'); |
|
255 | - $table_name = 'esp_message_template_group'; |
|
256 | - $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
253 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
254 | + $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID'); |
|
255 | + $table_name = 'esp_message_template_group'; |
|
256 | + $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
257 | 257 | MTP_user_id INT(10) NOT NULL DEFAULT '1', |
258 | 258 | MTP_name VARCHAR(245) NOT NULL DEFAULT '', |
259 | 259 | MTP_description VARCHAR(245) NOT NULL DEFAULT '', |
@@ -265,17 +265,17 @@ discard block |
||
265 | 265 | MTP_is_active TINYINT(1) NOT NULL DEFAULT '1', |
266 | 266 | PRIMARY KEY (GRP_ID), |
267 | 267 | KEY MTP_user_id (MTP_user_id)"; |
268 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
269 | - $table_name = 'esp_event_message_template'; |
|
270 | - $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
268 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
269 | + $table_name = 'esp_event_message_template'; |
|
270 | + $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
271 | 271 | EVT_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
272 | 272 | GRP_ID INT(10) UNSIGNED NOT NULL DEFAULT 0, |
273 | 273 | PRIMARY KEY (EMT_ID), |
274 | 274 | KEY EVT_ID (EVT_ID), |
275 | 275 | KEY GRP_ID (GRP_ID)"; |
276 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
277 | - $table_name = 'esp_payment'; |
|
278 | - $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
276 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
277 | + $table_name = 'esp_payment'; |
|
278 | + $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
279 | 279 | TXN_ID INT(10) UNSIGNED DEFAULT NULL, |
280 | 280 | STS_ID VARCHAR(3) COLLATE utf8_bin DEFAULT NULL, |
281 | 281 | PAY_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -292,9 +292,9 @@ discard block |
||
292 | 292 | PRIMARY KEY (PAY_ID), |
293 | 293 | KEY TXN_ID (TXN_ID), |
294 | 294 | KEY PAY_timestamp (PAY_timestamp)"; |
295 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
296 | - $table_name = 'esp_payment_method'; |
|
297 | - $sql = "PMD_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
295 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
296 | + $table_name = 'esp_payment_method'; |
|
297 | + $sql = "PMD_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
298 | 298 | PMD_type VARCHAR(124) DEFAULT NULL, |
299 | 299 | PMD_name VARCHAR(255) DEFAULT NULL, |
300 | 300 | PMD_desc TEXT, |
@@ -309,28 +309,28 @@ discard block |
||
309 | 309 | PMD_scope VARCHAR(255) NULL DEFAULT 'frontend', |
310 | 310 | PRIMARY KEY (PMD_ID), |
311 | 311 | UNIQUE KEY PMD_slug_UNIQUE (PMD_slug)"; |
312 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
313 | - $table_name = "esp_ticket_price"; |
|
314 | - $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
312 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
313 | + $table_name = "esp_ticket_price"; |
|
314 | + $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
315 | 315 | TKT_ID INT(10) UNSIGNED NOT NULL, |
316 | 316 | PRC_ID INT(10) UNSIGNED NOT NULL, |
317 | 317 | PRIMARY KEY (TKP_ID)"; |
318 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
319 | - $table_name = "esp_datetime_ticket"; |
|
320 | - $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
318 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
319 | + $table_name = "esp_datetime_ticket"; |
|
320 | + $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
321 | 321 | DTT_ID INT(10) UNSIGNED NOT NULL, |
322 | 322 | TKT_ID INT(10) UNSIGNED NOT NULL, |
323 | 323 | PRIMARY KEY (DTK_ID)"; |
324 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
325 | - $table_name = "esp_ticket_template"; |
|
326 | - $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
324 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
325 | + $table_name = "esp_ticket_template"; |
|
326 | + $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
327 | 327 | TTM_name VARCHAR(45) NOT NULL, |
328 | 328 | TTM_description TEXT, |
329 | 329 | TTM_file VARCHAR(45), |
330 | 330 | PRIMARY KEY (TTM_ID)"; |
331 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
332 | - $table_name = 'esp_question'; |
|
333 | - $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
331 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
332 | + $table_name = 'esp_question'; |
|
333 | + $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
334 | 334 | QST_display_text TEXT NOT NULL, |
335 | 335 | QST_admin_label VARCHAR(255) NOT NULL, |
336 | 336 | QST_system VARCHAR(25) DEFAULT NULL, |
@@ -342,25 +342,25 @@ discard block |
||
342 | 342 | QST_wp_user BIGINT UNSIGNED NULL, |
343 | 343 | QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0, |
344 | 344 | PRIMARY KEY (QST_ID)'; |
345 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
346 | - $table_name = 'esp_question_group_question'; |
|
347 | - $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
345 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
346 | + $table_name = 'esp_question_group_question'; |
|
347 | + $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
348 | 348 | QSG_ID INT UNSIGNED NOT NULL, |
349 | 349 | QST_ID INT UNSIGNED NOT NULL, |
350 | 350 | QGQ_order INT UNSIGNED NOT NULL DEFAULT 0, |
351 | 351 | PRIMARY KEY (QGQ_ID) "; |
352 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
353 | - $table_name = 'esp_question_option'; |
|
354 | - $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
352 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
353 | + $table_name = 'esp_question_option'; |
|
354 | + $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
355 | 355 | QSO_value VARCHAR(255) NOT NULL, |
356 | 356 | QSO_desc TEXT NOT NULL, |
357 | 357 | QST_ID INT UNSIGNED NOT NULL, |
358 | 358 | QSO_order INT UNSIGNED NOT NULL DEFAULT 0, |
359 | 359 | QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
360 | 360 | PRIMARY KEY (QSO_ID)"; |
361 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
362 | - $table_name = 'esp_registration'; |
|
363 | - $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
361 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
362 | + $table_name = 'esp_registration'; |
|
363 | + $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
364 | 364 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
365 | 365 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
366 | 366 | TXN_ID INT(10) UNSIGNED NOT NULL, |
@@ -383,25 +383,25 @@ discard block |
||
383 | 383 | KEY STS_ID (STS_ID), |
384 | 384 | KEY REG_url_link (REG_url_link), |
385 | 385 | KEY REG_code (REG_code)"; |
386 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
387 | - $table_name = 'esp_checkin'; |
|
388 | - $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
386 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
387 | + $table_name = 'esp_checkin'; |
|
388 | + $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
389 | 389 | REG_ID INT(10) UNSIGNED NOT NULL, |
390 | 390 | DTT_ID INT(10) UNSIGNED NOT NULL, |
391 | 391 | CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
392 | 392 | CHK_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
393 | 393 | PRIMARY KEY (CHK_ID)"; |
394 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
395 | - $table_name = 'esp_state'; |
|
396 | - $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
394 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
395 | + $table_name = 'esp_state'; |
|
396 | + $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
397 | 397 | CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
398 | 398 | STA_abbrev VARCHAR(24) COLLATE utf8_bin NOT NULL, |
399 | 399 | STA_name VARCHAR(100) COLLATE utf8_bin NOT NULL, |
400 | 400 | STA_active TINYINT(1) DEFAULT '1', |
401 | 401 | PRIMARY KEY (STA_ID)"; |
402 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
403 | - $table_name = 'esp_status'; |
|
404 | - $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
402 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
403 | + $table_name = 'esp_status'; |
|
404 | + $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
405 | 405 | STS_code VARCHAR(45) COLLATE utf8_bin NOT NULL, |
406 | 406 | STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL, |
407 | 407 | STS_can_edit TINYINT(1) NOT NULL DEFAULT 0, |
@@ -409,9 +409,9 @@ discard block |
||
409 | 409 | STS_open TINYINT(1) NOT NULL DEFAULT 1, |
410 | 410 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
411 | 411 | KEY STS_type (STS_type)"; |
412 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
413 | - $table_name = 'esp_transaction'; |
|
414 | - $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
412 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
413 | + $table_name = 'esp_transaction'; |
|
414 | + $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
415 | 415 | TXN_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
416 | 416 | TXN_total DECIMAL(10,3) DEFAULT '0.00', |
417 | 417 | TXN_paid DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
@@ -423,9 +423,9 @@ discard block |
||
423 | 423 | PRIMARY KEY (TXN_ID), |
424 | 424 | KEY TXN_timestamp (TXN_timestamp), |
425 | 425 | KEY STS_ID (STS_ID)"; |
426 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
427 | - $table_name = 'esp_venue_meta'; |
|
428 | - $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
426 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
427 | + $table_name = 'esp_venue_meta'; |
|
428 | + $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
429 | 429 | VNU_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
430 | 430 | VNU_address VARCHAR(255) DEFAULT NULL, |
431 | 431 | VNU_address2 VARCHAR(255) DEFAULT NULL, |
@@ -443,10 +443,10 @@ discard block |
||
443 | 443 | PRIMARY KEY (VNUM_ID), |
444 | 444 | KEY STA_ID (STA_ID), |
445 | 445 | KEY CNT_ISO (CNT_ISO)"; |
446 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
447 | - //modified tables |
|
448 | - $table_name = "esp_price"; |
|
449 | - $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
446 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
447 | + //modified tables |
|
448 | + $table_name = "esp_price"; |
|
449 | + $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
450 | 450 | PRT_ID TINYINT(3) UNSIGNED NOT NULL, |
451 | 451 | PRC_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
452 | 452 | PRC_name VARCHAR(245) NOT NULL, |
@@ -458,9 +458,9 @@ discard block |
||
458 | 458 | PRC_wp_user BIGINT UNSIGNED NULL, |
459 | 459 | PRC_parent INT(10) UNSIGNED DEFAULT 0, |
460 | 460 | PRIMARY KEY (PRC_ID)"; |
461 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
462 | - $table_name = "esp_price_type"; |
|
463 | - $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
461 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
462 | + $table_name = "esp_price_type"; |
|
463 | + $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
464 | 464 | PRT_name VARCHAR(45) NOT NULL, |
465 | 465 | PBT_ID TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', |
466 | 466 | PRT_is_percent TINYINT(1) NOT NULL DEFAULT '0', |
@@ -469,9 +469,9 @@ discard block |
||
469 | 469 | PRT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
470 | 470 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
471 | 471 | PRIMARY KEY (PRT_ID)"; |
472 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
473 | - $table_name = "esp_ticket"; |
|
474 | - $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
472 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
473 | + $table_name = "esp_ticket"; |
|
474 | + $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
475 | 475 | TTM_ID INT(10) UNSIGNED NOT NULL, |
476 | 476 | TKT_name VARCHAR(245) NOT NULL DEFAULT '', |
477 | 477 | TKT_description TEXT NOT NULL, |
@@ -492,10 +492,10 @@ discard block |
||
492 | 492 | TKT_parent INT(10) UNSIGNED DEFAULT '0', |
493 | 493 | TKT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
494 | 494 | PRIMARY KEY (TKT_ID)"; |
495 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
496 | - $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
497 | - $table_name = 'esp_question_group'; |
|
498 | - $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
495 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
496 | + $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
497 | + $table_name = 'esp_question_group'; |
|
498 | + $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
499 | 499 | QSG_name VARCHAR(255) NOT NULL, |
500 | 500 | QSG_identifier VARCHAR(100) NOT NULL, |
501 | 501 | QSG_desc TEXT NULL, |
@@ -507,119 +507,119 @@ discard block |
||
507 | 507 | QSG_wp_user BIGINT UNSIGNED NULL, |
508 | 508 | PRIMARY KEY (QSG_ID), |
509 | 509 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)'; |
510 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
511 | - /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
512 | - $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
513 | - //(because many need to convert old string states to foreign keys into the states table) |
|
514 | - $script_4_1_defaults->insert_default_states(); |
|
515 | - $script_4_1_defaults->insert_default_countries(); |
|
516 | - /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
517 | - $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
518 | - $script_4_5_defaults->insert_default_price_types(); |
|
519 | - $script_4_5_defaults->insert_default_prices(); |
|
520 | - $script_4_5_defaults->insert_default_tickets(); |
|
521 | - //setting up the config wp option pretty well counts as a 'schema change', or at least should happen here |
|
522 | - EE_Config::instance()->update_espresso_config(false, true); |
|
523 | - $this->add_default_admin_only_payments(); |
|
524 | - $this->insert_default_currencies(); |
|
525 | - return true; |
|
526 | - } |
|
527 | - |
|
528 | - |
|
529 | - |
|
530 | - /** |
|
531 | - * @return boolean |
|
532 | - */ |
|
533 | - public function schema_changes_after_migration() |
|
534 | - { |
|
535 | - return true; |
|
536 | - } |
|
537 | - |
|
538 | - |
|
539 | - |
|
540 | - public function migration_page_hooks() |
|
541 | - { |
|
542 | - } |
|
543 | - |
|
544 | - |
|
545 | - |
|
546 | - public function add_default_admin_only_payments() |
|
547 | - { |
|
548 | - global $wpdb; |
|
549 | - $table_name = $wpdb->prefix . "esp_payment_method"; |
|
550 | - $user_id = EEH_Activation::get_default_creator_id(); |
|
551 | - if ($this->_get_table_analysis()->tableExists($table_name)) { |
|
552 | - $SQL = "SELECT COUNT( * ) FROM $table_name"; |
|
553 | - $existing_payment_methods = $wpdb->get_var($SQL); |
|
554 | - $default_admin_only_payment_methods = apply_filters( |
|
555 | - 'FHEE__EEH_Activation__add_default_admin_only_payments__default_admin_only_payment_methods', |
|
556 | - array( |
|
557 | - __("Bank", 'event_espresso') => __("Bank Draft", 'event_espresso'), |
|
558 | - __("Cash", 'event_espresso') => __("Cash Delivered Physically", 'event_espresso'), |
|
559 | - __("Check", 'event_espresso') => __("Paper Check", 'event_espresso'), |
|
560 | - __("Credit Card", 'event_espresso') => __("Offline Credit Card Payment", 'event_espresso'), |
|
561 | - __("Debit Card", 'event_espresso') => __("Offline Debit Payment", 'event_espresso'), |
|
562 | - __("Invoice", 'event_espresso') => __("Invoice received with monies included", |
|
563 | - 'event_espresso'), |
|
564 | - __("Money Order", 'event_espresso') => '', |
|
565 | - __("Paypal", 'event_espresso') => __("Paypal eCheck, Invoice, etc", 'event_espresso'), |
|
566 | - __('Other', 'event_espresso') => __('Other method of payment', 'event_espresso'), |
|
567 | - )); |
|
568 | - //make sure we hae payment method records for the following |
|
569 | - //so admins can record payments for them from the admin page |
|
570 | - foreach ($default_admin_only_payment_methods as $nicename => $description) { |
|
571 | - $slug = sanitize_key($nicename); |
|
572 | - //check that such a payment method exists |
|
573 | - $exists = $wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $table_name WHERE PMD_slug = %s", $slug)); |
|
574 | - if ( ! $exists) { |
|
575 | - $values = array( |
|
576 | - 'PMD_type' => 'Admin_Only', |
|
577 | - 'PMD_name' => $nicename, |
|
578 | - 'PMD_admin_name' => $nicename, |
|
579 | - 'PMD_admin_desc' => $description, |
|
580 | - 'PMD_slug' => $slug, |
|
581 | - 'PMD_wp_user' => $user_id, |
|
582 | - 'PMD_scope' => serialize(array('ADMIN')), |
|
583 | - ); |
|
584 | - $success = $wpdb->insert( |
|
585 | - $table_name, |
|
586 | - $values, |
|
587 | - array( |
|
588 | - '%s',//PMD_type |
|
589 | - '%s',//PMD_name |
|
590 | - '%s',//PMD_admin_name |
|
591 | - '%s',//PMD_admin_desc |
|
592 | - '%s',//PMD_slug |
|
593 | - '%d',//PMD_wp_user |
|
594 | - '%s',//PMD_scope |
|
595 | - ) |
|
596 | - ); |
|
597 | - if ( ! $success) { |
|
598 | - $this->add_error(sprintf(__("Could not insert new admin-only payment method with values %s during migration", |
|
599 | - "event_espresso"), $this->_json_encode($values))); |
|
600 | - } |
|
601 | - } |
|
602 | - } |
|
603 | - } |
|
604 | - } |
|
605 | - |
|
606 | - |
|
607 | - |
|
608 | - /** |
|
609 | - * insert_default_countries |
|
610 | - * |
|
611 | - * @static |
|
612 | - * @return void |
|
613 | - */ |
|
614 | - public function insert_default_currencies() |
|
615 | - { |
|
616 | - global $wpdb; |
|
617 | - $currency_table = $wpdb->prefix . "esp_currency"; |
|
618 | - if ($this->_get_table_analysis()->tableExists($currency_table)) { |
|
619 | - $SQL = "SELECT COUNT('CUR_code') FROM $currency_table"; |
|
620 | - $countries = $wpdb->get_var($SQL); |
|
621 | - if ( ! $countries) { |
|
622 | - $SQL = "INSERT INTO $currency_table |
|
510 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
511 | + /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
512 | + $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
513 | + //(because many need to convert old string states to foreign keys into the states table) |
|
514 | + $script_4_1_defaults->insert_default_states(); |
|
515 | + $script_4_1_defaults->insert_default_countries(); |
|
516 | + /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
517 | + $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
518 | + $script_4_5_defaults->insert_default_price_types(); |
|
519 | + $script_4_5_defaults->insert_default_prices(); |
|
520 | + $script_4_5_defaults->insert_default_tickets(); |
|
521 | + //setting up the config wp option pretty well counts as a 'schema change', or at least should happen here |
|
522 | + EE_Config::instance()->update_espresso_config(false, true); |
|
523 | + $this->add_default_admin_only_payments(); |
|
524 | + $this->insert_default_currencies(); |
|
525 | + return true; |
|
526 | + } |
|
527 | + |
|
528 | + |
|
529 | + |
|
530 | + /** |
|
531 | + * @return boolean |
|
532 | + */ |
|
533 | + public function schema_changes_after_migration() |
|
534 | + { |
|
535 | + return true; |
|
536 | + } |
|
537 | + |
|
538 | + |
|
539 | + |
|
540 | + public function migration_page_hooks() |
|
541 | + { |
|
542 | + } |
|
543 | + |
|
544 | + |
|
545 | + |
|
546 | + public function add_default_admin_only_payments() |
|
547 | + { |
|
548 | + global $wpdb; |
|
549 | + $table_name = $wpdb->prefix . "esp_payment_method"; |
|
550 | + $user_id = EEH_Activation::get_default_creator_id(); |
|
551 | + if ($this->_get_table_analysis()->tableExists($table_name)) { |
|
552 | + $SQL = "SELECT COUNT( * ) FROM $table_name"; |
|
553 | + $existing_payment_methods = $wpdb->get_var($SQL); |
|
554 | + $default_admin_only_payment_methods = apply_filters( |
|
555 | + 'FHEE__EEH_Activation__add_default_admin_only_payments__default_admin_only_payment_methods', |
|
556 | + array( |
|
557 | + __("Bank", 'event_espresso') => __("Bank Draft", 'event_espresso'), |
|
558 | + __("Cash", 'event_espresso') => __("Cash Delivered Physically", 'event_espresso'), |
|
559 | + __("Check", 'event_espresso') => __("Paper Check", 'event_espresso'), |
|
560 | + __("Credit Card", 'event_espresso') => __("Offline Credit Card Payment", 'event_espresso'), |
|
561 | + __("Debit Card", 'event_espresso') => __("Offline Debit Payment", 'event_espresso'), |
|
562 | + __("Invoice", 'event_espresso') => __("Invoice received with monies included", |
|
563 | + 'event_espresso'), |
|
564 | + __("Money Order", 'event_espresso') => '', |
|
565 | + __("Paypal", 'event_espresso') => __("Paypal eCheck, Invoice, etc", 'event_espresso'), |
|
566 | + __('Other', 'event_espresso') => __('Other method of payment', 'event_espresso'), |
|
567 | + )); |
|
568 | + //make sure we hae payment method records for the following |
|
569 | + //so admins can record payments for them from the admin page |
|
570 | + foreach ($default_admin_only_payment_methods as $nicename => $description) { |
|
571 | + $slug = sanitize_key($nicename); |
|
572 | + //check that such a payment method exists |
|
573 | + $exists = $wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $table_name WHERE PMD_slug = %s", $slug)); |
|
574 | + if ( ! $exists) { |
|
575 | + $values = array( |
|
576 | + 'PMD_type' => 'Admin_Only', |
|
577 | + 'PMD_name' => $nicename, |
|
578 | + 'PMD_admin_name' => $nicename, |
|
579 | + 'PMD_admin_desc' => $description, |
|
580 | + 'PMD_slug' => $slug, |
|
581 | + 'PMD_wp_user' => $user_id, |
|
582 | + 'PMD_scope' => serialize(array('ADMIN')), |
|
583 | + ); |
|
584 | + $success = $wpdb->insert( |
|
585 | + $table_name, |
|
586 | + $values, |
|
587 | + array( |
|
588 | + '%s',//PMD_type |
|
589 | + '%s',//PMD_name |
|
590 | + '%s',//PMD_admin_name |
|
591 | + '%s',//PMD_admin_desc |
|
592 | + '%s',//PMD_slug |
|
593 | + '%d',//PMD_wp_user |
|
594 | + '%s',//PMD_scope |
|
595 | + ) |
|
596 | + ); |
|
597 | + if ( ! $success) { |
|
598 | + $this->add_error(sprintf(__("Could not insert new admin-only payment method with values %s during migration", |
|
599 | + "event_espresso"), $this->_json_encode($values))); |
|
600 | + } |
|
601 | + } |
|
602 | + } |
|
603 | + } |
|
604 | + } |
|
605 | + |
|
606 | + |
|
607 | + |
|
608 | + /** |
|
609 | + * insert_default_countries |
|
610 | + * |
|
611 | + * @static |
|
612 | + * @return void |
|
613 | + */ |
|
614 | + public function insert_default_currencies() |
|
615 | + { |
|
616 | + global $wpdb; |
|
617 | + $currency_table = $wpdb->prefix . "esp_currency"; |
|
618 | + if ($this->_get_table_analysis()->tableExists($currency_table)) { |
|
619 | + $SQL = "SELECT COUNT('CUR_code') FROM $currency_table"; |
|
620 | + $countries = $wpdb->get_var($SQL); |
|
621 | + if ( ! $countries) { |
|
622 | + $SQL = "INSERT INTO $currency_table |
|
623 | 623 | ( CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active) VALUES |
624 | 624 | ( 'EUR', 'Euro', 'Euros', '€', 2,1), |
625 | 625 | ( 'AED', 'Dirham', 'Dirhams', 'د.إ',2,1), |
@@ -773,10 +773,10 @@ discard block |
||
773 | 773 | ( 'ZAR', 'Rand', 'Rands', 'R', 2,1), |
774 | 774 | ( 'ZMK', 'Kwacha', 'Kwachas', '', 2,1), |
775 | 775 | ( 'ZWD', 'Dollar', 'Dollars', 'Z$', 2,1);"; |
776 | - $wpdb->query($SQL); |
|
777 | - } |
|
778 | - } |
|
779 | - } |
|
776 | + $wpdb->query($SQL); |
|
777 | + } |
|
778 | + } |
|
779 | + } |
|
780 | 780 | |
781 | 781 | } |
782 | 782 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | //unfortunately, this needs to be done upon INCLUSION of this file, |
12 | 12 | //instead of construction, because it only gets constructed on first page load |
13 | 13 | //(all other times it gets resurrected from a wordpress option) |
14 | -$stages = glob(EE_CORE . 'data_migration_scripts/4_6_0_stages/*'); |
|
14 | +$stages = glob(EE_CORE.'data_migration_scripts/4_6_0_stages/*'); |
|
15 | 15 | $class_to_filepath = array(); |
16 | 16 | foreach ($stages as $filepath) { |
17 | 17 | $matches = array(); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 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 |
|
77 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
78 | 78 | } else { |
79 | 79 | // echo "$version_string doesnt apply"; |
80 | 80 | return false; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | public function schema_changes_before_migration() |
100 | 100 | { |
101 | 101 | //relies on 4.1's EEH_Activation::create_table |
102 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
102 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
103 | 103 | $table_name = 'esp_answer'; |
104 | 104 | $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
105 | 105 | REG_ID INT UNSIGNED NOT NULL, |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | public function add_default_admin_only_payments() |
547 | 547 | { |
548 | 548 | global $wpdb; |
549 | - $table_name = $wpdb->prefix . "esp_payment_method"; |
|
549 | + $table_name = $wpdb->prefix."esp_payment_method"; |
|
550 | 550 | $user_id = EEH_Activation::get_default_creator_id(); |
551 | 551 | if ($this->_get_table_analysis()->tableExists($table_name)) { |
552 | 552 | $SQL = "SELECT COUNT( * ) FROM $table_name"; |
@@ -585,13 +585,13 @@ discard block |
||
585 | 585 | $table_name, |
586 | 586 | $values, |
587 | 587 | array( |
588 | - '%s',//PMD_type |
|
589 | - '%s',//PMD_name |
|
590 | - '%s',//PMD_admin_name |
|
591 | - '%s',//PMD_admin_desc |
|
592 | - '%s',//PMD_slug |
|
593 | - '%d',//PMD_wp_user |
|
594 | - '%s',//PMD_scope |
|
588 | + '%s', //PMD_type |
|
589 | + '%s', //PMD_name |
|
590 | + '%s', //PMD_admin_name |
|
591 | + '%s', //PMD_admin_desc |
|
592 | + '%s', //PMD_slug |
|
593 | + '%d', //PMD_wp_user |
|
594 | + '%s', //PMD_scope |
|
595 | 595 | ) |
596 | 596 | ); |
597 | 597 | if ( ! $success) { |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | public function insert_default_currencies() |
615 | 615 | { |
616 | 616 | global $wpdb; |
617 | - $currency_table = $wpdb->prefix . "esp_currency"; |
|
617 | + $currency_table = $wpdb->prefix."esp_currency"; |
|
618 | 618 | if ($this->_get_table_analysis()->tableExists($currency_table)) { |
619 | 619 | $SQL = "SELECT COUNT('CUR_code') FROM $currency_table"; |
620 | 620 | $countries = $wpdb->get_var($SQL); |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | $stages = glob(EE_CORE . 'data_migration_scripts/4_8_0_stages/*'); |
18 | 18 | $class_to_filepath = array(); |
19 | 19 | foreach ($stages as $filepath) { |
20 | - $matches = array(); |
|
21 | - preg_match('~4_8_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
22 | - $class_to_filepath[$matches[1]] = $filepath; |
|
20 | + $matches = array(); |
|
21 | + preg_match('~4_8_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
22 | + $class_to_filepath[$matches[1]] = $filepath; |
|
23 | 23 | } |
24 | 24 | //give addons a chance to autoload their stages too |
25 | 25 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_8_0__autoloaded_stages', $class_to_filepath); |
@@ -38,81 +38,81 @@ discard block |
||
38 | 38 | class EE_DMS_Core_4_8_0 extends EE_Data_Migration_Script_Base |
39 | 39 | { |
40 | 40 | |
41 | - /** |
|
42 | - * return EE_DMS_Core_4_8_0 |
|
43 | - * |
|
44 | - * @param TableManager $table_manager |
|
45 | - * @param TableAnalysis $table_analysis |
|
46 | - */ |
|
47 | - public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
48 | - { |
|
49 | - $this->_pretty_name = __("Data Migration to Event Espresso 4.8.0.P (for promotions)", "event_espresso"); |
|
50 | - $this->_priority = 10; |
|
51 | - $this->_migration_stages = array( |
|
52 | - new EE_DMS_4_8_0_pretax_totals(), |
|
53 | - new EE_DMS_4_8_0_event_subtotals(), |
|
54 | - ); |
|
55 | - parent::__construct($table_manager, $table_analysis); |
|
56 | - } |
|
41 | + /** |
|
42 | + * return EE_DMS_Core_4_8_0 |
|
43 | + * |
|
44 | + * @param TableManager $table_manager |
|
45 | + * @param TableAnalysis $table_analysis |
|
46 | + */ |
|
47 | + public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
48 | + { |
|
49 | + $this->_pretty_name = __("Data Migration to Event Espresso 4.8.0.P (for promotions)", "event_espresso"); |
|
50 | + $this->_priority = 10; |
|
51 | + $this->_migration_stages = array( |
|
52 | + new EE_DMS_4_8_0_pretax_totals(), |
|
53 | + new EE_DMS_4_8_0_event_subtotals(), |
|
54 | + ); |
|
55 | + parent::__construct($table_manager, $table_analysis); |
|
56 | + } |
|
57 | 57 | |
58 | 58 | |
59 | 59 | |
60 | - /** |
|
61 | - * Because this is being done at basically the same time as the MER-ready branch |
|
62 | - * of core, it's possible people might have installed MEr-ready branch first, |
|
63 | - * and then this one, in which case we still want to perform this migration, |
|
64 | - * even though the version might not have increased |
|
65 | - * |
|
66 | - * @param array $version_array |
|
67 | - * @return bool |
|
68 | - */ |
|
69 | - public function can_migrate_from_version($version_array) |
|
70 | - { |
|
71 | - $version_string = $version_array['Core']; |
|
72 | - if (version_compare($version_string, '4.8.0', '<=') && version_compare($version_string, '4.7.0', '>=')) { |
|
60 | + /** |
|
61 | + * Because this is being done at basically the same time as the MER-ready branch |
|
62 | + * of core, it's possible people might have installed MEr-ready branch first, |
|
63 | + * and then this one, in which case we still want to perform this migration, |
|
64 | + * even though the version might not have increased |
|
65 | + * |
|
66 | + * @param array $version_array |
|
67 | + * @return bool |
|
68 | + */ |
|
69 | + public function can_migrate_from_version($version_array) |
|
70 | + { |
|
71 | + $version_string = $version_array['Core']; |
|
72 | + if (version_compare($version_string, '4.8.0', '<=') && version_compare($version_string, '4.7.0', '>=')) { |
|
73 | 73 | // echo "$version_string can be migrated from"; |
74 | - return true; |
|
75 | - } elseif ( ! $version_string) { |
|
74 | + return true; |
|
75 | + } elseif ( ! $version_string) { |
|
76 | 76 | // echo "no version string provided: $version_string"; |
77 | - //no version string provided... this must be pre 4.3 |
|
78 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
79 | - } else { |
|
77 | + //no version string provided... this must be pre 4.3 |
|
78 | + return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
79 | + } else { |
|
80 | 80 | // echo "$version_string doesnt apply"; |
81 | - return false; |
|
82 | - } |
|
83 | - } |
|
81 | + return false; |
|
82 | + } |
|
83 | + } |
|
84 | 84 | |
85 | 85 | |
86 | 86 | |
87 | - /** |
|
88 | - * @return string|void |
|
89 | - */ |
|
90 | - public function pretty_name() |
|
91 | - { |
|
92 | - return __("Core Data Migration to version 4.8.0", "event_espresso"); |
|
93 | - } |
|
87 | + /** |
|
88 | + * @return string|void |
|
89 | + */ |
|
90 | + public function pretty_name() |
|
91 | + { |
|
92 | + return __("Core Data Migration to version 4.8.0", "event_espresso"); |
|
93 | + } |
|
94 | 94 | |
95 | 95 | |
96 | 96 | |
97 | - /** |
|
98 | - * @return bool |
|
99 | - */ |
|
100 | - public function schema_changes_before_migration() |
|
101 | - { |
|
102 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
103 | - $now_in_mysql = current_time('mysql', true); |
|
104 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
105 | - $table_name = 'esp_answer'; |
|
106 | - $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
97 | + /** |
|
98 | + * @return bool |
|
99 | + */ |
|
100 | + public function schema_changes_before_migration() |
|
101 | + { |
|
102 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
103 | + $now_in_mysql = current_time('mysql', true); |
|
104 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
105 | + $table_name = 'esp_answer'; |
|
106 | + $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
107 | 107 | REG_ID int(10) unsigned NOT NULL, |
108 | 108 | QST_ID int(10) unsigned NOT NULL, |
109 | 109 | ANS_value text NOT NULL, |
110 | 110 | PRIMARY KEY (ANS_ID), |
111 | 111 | KEY REG_ID (REG_ID), |
112 | 112 | KEY QST_ID (QST_ID)"; |
113 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
114 | - $table_name = 'esp_attendee_meta'; |
|
115 | - $sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
113 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
114 | + $table_name = 'esp_attendee_meta'; |
|
115 | + $sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
116 | 116 | ATT_ID bigint(20) unsigned NOT NULL, |
117 | 117 | ATT_fname varchar(45) NOT NULL, |
118 | 118 | ATT_lname varchar(45) NOT NULL, |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | KEY ATT_email (ATT_email), |
130 | 130 | KEY ATT_lname (ATT_lname), |
131 | 131 | KEY ATT_fname (ATT_fname)"; |
132 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
133 | - $table_name = 'esp_country'; |
|
134 | - $sql = "CNT_ISO varchar(2) collate utf8_bin NOT NULL, |
|
132 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
133 | + $table_name = 'esp_country'; |
|
134 | + $sql = "CNT_ISO varchar(2) collate utf8_bin NOT NULL, |
|
135 | 135 | CNT_ISO3 varchar(3) collate utf8_bin NOT NULL, |
136 | 136 | RGN_ID tinyint(3) unsigned DEFAULT NULL, |
137 | 137 | CNT_name varchar(45) collate utf8_bin NOT NULL, |
@@ -147,25 +147,25 @@ discard block |
||
147 | 147 | CNT_is_EU tinyint(1) DEFAULT '0', |
148 | 148 | CNT_active tinyint(1) DEFAULT '0', |
149 | 149 | PRIMARY KEY (CNT_ISO)"; |
150 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
151 | - $table_name = 'esp_currency'; |
|
152 | - $sql = "CUR_code varchar(6) collate utf8_bin NOT NULL, |
|
150 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
151 | + $table_name = 'esp_currency'; |
|
152 | + $sql = "CUR_code varchar(6) collate utf8_bin NOT NULL, |
|
153 | 153 | CUR_single varchar(45) collate utf8_bin DEFAULT 'dollar', |
154 | 154 | CUR_plural varchar(45) collate utf8_bin DEFAULT 'dollars', |
155 | 155 | CUR_sign varchar(45) collate utf8_bin DEFAULT '$', |
156 | 156 | CUR_dec_plc varchar(1) collate utf8_bin NOT NULL DEFAULT '2', |
157 | 157 | CUR_active tinyint(1) DEFAULT '0', |
158 | 158 | PRIMARY KEY (CUR_code)"; |
159 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
160 | - $table_name = 'esp_currency_payment_method'; |
|
161 | - $sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
159 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
160 | + $table_name = 'esp_currency_payment_method'; |
|
161 | + $sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
162 | 162 | CUR_code varchar(6) collate utf8_bin NOT NULL, |
163 | 163 | PMD_ID int(11) NOT NULL, |
164 | 164 | PRIMARY KEY (CPM_ID), |
165 | 165 | KEY PMD_ID (PMD_ID)"; |
166 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
167 | - $table_name = 'esp_datetime'; |
|
168 | - $sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
166 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
167 | + $table_name = 'esp_datetime'; |
|
168 | + $sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
169 | 169 | EVT_ID bigint(20) unsigned NOT NULL, |
170 | 170 | DTT_name varchar(255) NOT NULL DEFAULT '', |
171 | 171 | DTT_description text NOT NULL, |
@@ -181,9 +181,9 @@ discard block |
||
181 | 181 | KEY DTT_EVT_start (DTT_EVT_start), |
182 | 182 | KEY EVT_ID (EVT_ID), |
183 | 183 | KEY DTT_is_primary (DTT_is_primary)"; |
184 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
185 | - $table_name = 'esp_event_meta'; |
|
186 | - $sql = " |
|
184 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
185 | + $table_name = 'esp_event_meta'; |
|
186 | + $sql = " |
|
187 | 187 | EVTM_ID int(10) NOT NULL AUTO_INCREMENT, |
188 | 188 | EVT_ID bigint(20) unsigned NOT NULL, |
189 | 189 | EVT_display_desc tinyint(1) unsigned NOT NULL DEFAULT 1, |
@@ -199,34 +199,34 @@ discard block |
||
199 | 199 | EVT_donations tinyint(1) NULL, |
200 | 200 | PRIMARY KEY (EVTM_ID), |
201 | 201 | KEY EVT_ID (EVT_ID)"; |
202 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
203 | - $table_name = 'esp_event_question_group'; |
|
204 | - $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
202 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
203 | + $table_name = 'esp_event_question_group'; |
|
204 | + $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
205 | 205 | EVT_ID bigint(20) unsigned NOT NULL, |
206 | 206 | QSG_ID int(10) unsigned NOT NULL, |
207 | 207 | EQG_primary tinyint(1) unsigned NOT NULL DEFAULT 0, |
208 | 208 | PRIMARY KEY (EQG_ID), |
209 | 209 | KEY EVT_ID (EVT_ID), |
210 | 210 | KEY QSG_ID (QSG_ID)"; |
211 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
212 | - $table_name = 'esp_event_venue'; |
|
213 | - $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT, |
|
211 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
212 | + $table_name = 'esp_event_venue'; |
|
213 | + $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT, |
|
214 | 214 | EVT_ID bigint(20) unsigned NOT NULL, |
215 | 215 | VNU_ID bigint(20) unsigned NOT NULL, |
216 | 216 | EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0, |
217 | 217 | PRIMARY KEY (EVV_ID)"; |
218 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
219 | - $table_name = 'esp_extra_meta'; |
|
220 | - $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
218 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
219 | + $table_name = 'esp_extra_meta'; |
|
220 | + $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
221 | 221 | OBJ_ID int(11) DEFAULT NULL, |
222 | 222 | EXM_type varchar(45) DEFAULT NULL, |
223 | 223 | EXM_key varchar(45) DEFAULT NULL, |
224 | 224 | EXM_value text, |
225 | 225 | PRIMARY KEY (EXM_ID), |
226 | 226 | KEY EXM_type (EXM_type,OBJ_ID,EXM_key)"; |
227 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
228 | - $table_name = 'esp_extra_join'; |
|
229 | - $sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT, |
|
227 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
228 | + $table_name = 'esp_extra_join'; |
|
229 | + $sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT, |
|
230 | 230 | EXJ_first_model_id varchar(6) NOT NULL, |
231 | 231 | EXJ_first_model_name varchar(20) NOT NULL, |
232 | 232 | EXJ_second_model_id varchar(6) NOT NULL, |
@@ -234,9 +234,9 @@ discard block |
||
234 | 234 | PRIMARY KEY (EXJ_ID), |
235 | 235 | KEY first_model (EXJ_first_model_name,EXJ_first_model_id), |
236 | 236 | KEY second_model (EXJ_second_model_name,EXJ_second_model_id)"; |
237 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
238 | - $table_name = 'esp_line_item'; |
|
239 | - $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT, |
|
237 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
238 | + $table_name = 'esp_line_item'; |
|
239 | + $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT, |
|
240 | 240 | LIN_code varchar(245) NOT NULL DEFAULT '', |
241 | 241 | TXN_ID int(11) DEFAULT NULL, |
242 | 242 | LIN_name varchar(245) NOT NULL DEFAULT '', |
@@ -255,9 +255,9 @@ discard block |
||
255 | 255 | PRIMARY KEY (LIN_ID), |
256 | 256 | KEY LIN_code (LIN_code(191)), |
257 | 257 | KEY TXN_ID (TXN_ID)"; |
258 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
259 | - $table_name = 'esp_log'; |
|
260 | - $sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT, |
|
258 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
259 | + $table_name = 'esp_log'; |
|
260 | + $sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT, |
|
261 | 261 | LOG_time datetime DEFAULT NULL, |
262 | 262 | OBJ_ID varchar(45) DEFAULT NULL, |
263 | 263 | OBJ_type varchar(45) DEFAULT NULL, |
@@ -268,18 +268,18 @@ discard block |
||
268 | 268 | KEY LOG_time (LOG_time), |
269 | 269 | KEY OBJ (OBJ_type,OBJ_ID), |
270 | 270 | KEY LOG_type (LOG_type)"; |
271 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
272 | - $table_name = 'esp_message_template'; |
|
273 | - $sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
271 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
272 | + $table_name = 'esp_message_template'; |
|
273 | + $sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
274 | 274 | GRP_ID int(10) unsigned NOT NULL, |
275 | 275 | MTP_context varchar(50) NOT NULL, |
276 | 276 | MTP_template_field varchar(30) NOT NULL, |
277 | 277 | MTP_content text NOT NULL, |
278 | 278 | PRIMARY KEY (MTP_ID), |
279 | 279 | KEY GRP_ID (GRP_ID)"; |
280 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
281 | - $table_name = 'esp_message_template_group'; |
|
282 | - $sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
280 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
281 | + $table_name = 'esp_message_template_group'; |
|
282 | + $sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
283 | 283 | MTP_user_id int(10) NOT NULL DEFAULT '1', |
284 | 284 | MTP_name varchar(245) NOT NULL DEFAULT '', |
285 | 285 | MTP_description varchar(245) NOT NULL DEFAULT '', |
@@ -291,17 +291,17 @@ discard block |
||
291 | 291 | MTP_is_active tinyint(1) NOT NULL DEFAULT '1', |
292 | 292 | PRIMARY KEY (GRP_ID), |
293 | 293 | KEY MTP_user_id (MTP_user_id)"; |
294 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
295 | - $table_name = 'esp_event_message_template'; |
|
296 | - $sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
|
294 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
295 | + $table_name = 'esp_event_message_template'; |
|
296 | + $sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
|
297 | 297 | EVT_ID bigint(20) unsigned NOT NULL DEFAULT 0, |
298 | 298 | GRP_ID int(10) unsigned NOT NULL DEFAULT 0, |
299 | 299 | PRIMARY KEY (EMT_ID), |
300 | 300 | KEY EVT_ID (EVT_ID), |
301 | 301 | KEY GRP_ID (GRP_ID)"; |
302 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
303 | - $table_name = 'esp_payment'; |
|
304 | - $sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
302 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
303 | + $table_name = 'esp_payment'; |
|
304 | + $sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
305 | 305 | TXN_ID int(10) unsigned DEFAULT NULL, |
306 | 306 | STS_ID varchar(3) collate utf8_bin DEFAULT NULL, |
307 | 307 | PAY_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -318,9 +318,9 @@ discard block |
||
318 | 318 | PRIMARY KEY (PAY_ID), |
319 | 319 | KEY PAY_timestamp (PAY_timestamp), |
320 | 320 | KEY TXN_ID (TXN_ID)"; |
321 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
322 | - $table_name = 'esp_payment_method'; |
|
323 | - $sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT, |
|
321 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
322 | + $table_name = 'esp_payment_method'; |
|
323 | + $sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT, |
|
324 | 324 | PMD_type varchar(124) DEFAULT NULL, |
325 | 325 | PMD_name varchar(255) DEFAULT NULL, |
326 | 326 | PMD_desc text, |
@@ -336,32 +336,32 @@ discard block |
||
336 | 336 | PRIMARY KEY (PMD_ID), |
337 | 337 | UNIQUE KEY PMD_slug_UNIQUE (PMD_slug), |
338 | 338 | KEY PMD_type (PMD_type)"; |
339 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
340 | - $table_name = "esp_ticket_price"; |
|
341 | - $sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
339 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
340 | + $table_name = "esp_ticket_price"; |
|
341 | + $sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
342 | 342 | TKT_ID int(10) unsigned NOT NULL, |
343 | 343 | PRC_ID int(10) unsigned NOT NULL, |
344 | 344 | PRIMARY KEY (TKP_ID), |
345 | 345 | KEY TKT_ID (TKT_ID), |
346 | 346 | KEY PRC_ID (PRC_ID)"; |
347 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
348 | - $table_name = "esp_datetime_ticket"; |
|
349 | - $sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
347 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
348 | + $table_name = "esp_datetime_ticket"; |
|
349 | + $sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
350 | 350 | DTT_ID int(10) unsigned NOT NULL, |
351 | 351 | TKT_ID int(10) unsigned NOT NULL, |
352 | 352 | PRIMARY KEY (DTK_ID), |
353 | 353 | KEY DTT_ID (DTT_ID), |
354 | 354 | KEY TKT_ID (TKT_ID)"; |
355 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
356 | - $table_name = "esp_ticket_template"; |
|
357 | - $sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
355 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
356 | + $table_name = "esp_ticket_template"; |
|
357 | + $sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
358 | 358 | TTM_name varchar(45) NOT NULL, |
359 | 359 | TTM_description text, |
360 | 360 | TTM_file varchar(45), |
361 | 361 | PRIMARY KEY (TTM_ID)"; |
362 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
363 | - $table_name = 'esp_question'; |
|
364 | - $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
362 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
363 | + $table_name = 'esp_question'; |
|
364 | + $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
365 | 365 | QST_display_text text NOT NULL, |
366 | 366 | QST_admin_label varchar(255) NOT NULL, |
367 | 367 | QST_system varchar(25) NOT NULL DEFAULT "", |
@@ -375,18 +375,18 @@ discard block |
||
375 | 375 | QST_deleted tinyint(2) unsigned NOT NULL DEFAULT 0, |
376 | 376 | PRIMARY KEY (QST_ID), |
377 | 377 | KEY QST_order (QST_order)'; |
378 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
379 | - $table_name = 'esp_question_group_question'; |
|
380 | - $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
378 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
379 | + $table_name = 'esp_question_group_question'; |
|
380 | + $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
381 | 381 | QSG_ID int(10) unsigned NOT NULL, |
382 | 382 | QST_ID int(10) unsigned NOT NULL, |
383 | 383 | QGQ_order int(10) unsigned NOT NULL DEFAULT 0, |
384 | 384 | PRIMARY KEY (QGQ_ID), |
385 | 385 | KEY QST_ID (QST_ID), |
386 | 386 | KEY QSG_ID_order (QSG_ID,QGQ_order)"; |
387 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
388 | - $table_name = 'esp_question_option'; |
|
389 | - $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
387 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
388 | + $table_name = 'esp_question_option'; |
|
389 | + $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
390 | 390 | QSO_value varchar(255) NOT NULL, |
391 | 391 | QSO_desc text NOT NULL, |
392 | 392 | QST_ID int(10) unsigned NOT NULL, |
@@ -396,9 +396,9 @@ discard block |
||
396 | 396 | PRIMARY KEY (QSO_ID), |
397 | 397 | KEY QST_ID (QST_ID), |
398 | 398 | KEY QSO_order (QSO_order)"; |
399 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
400 | - $table_name = 'esp_registration'; |
|
401 | - $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
399 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
400 | + $table_name = 'esp_registration'; |
|
401 | + $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
402 | 402 | EVT_ID bigint(20) unsigned NOT NULL, |
403 | 403 | ATT_ID bigint(20) unsigned NOT NULL, |
404 | 404 | TXN_ID int(10) unsigned NOT NULL, |
@@ -422,18 +422,18 @@ discard block |
||
422 | 422 | KEY TKT_ID (TKT_ID), |
423 | 423 | KEY EVT_ID (EVT_ID), |
424 | 424 | KEY STS_ID (STS_ID)"; |
425 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
426 | - $table_name = 'esp_registration_payment'; |
|
427 | - $sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
425 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
426 | + $table_name = 'esp_registration_payment'; |
|
427 | + $sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
428 | 428 | REG_ID int(10) unsigned NOT NULL, |
429 | 429 | PAY_ID int(10) unsigned NULL, |
430 | 430 | RPY_amount decimal(10,3) NOT NULL DEFAULT '0.00', |
431 | 431 | PRIMARY KEY (RPY_ID), |
432 | 432 | KEY REG_ID (REG_ID), |
433 | 433 | KEY PAY_ID (PAY_ID)"; |
434 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
435 | - $table_name = 'esp_checkin'; |
|
436 | - $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
434 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
435 | + $table_name = 'esp_checkin'; |
|
436 | + $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
437 | 437 | REG_ID int(10) unsigned NOT NULL, |
438 | 438 | DTT_ID int(10) unsigned NOT NULL, |
439 | 439 | CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1, |
@@ -441,9 +441,9 @@ discard block |
||
441 | 441 | PRIMARY KEY (CHK_ID), |
442 | 442 | KEY REG_ID (REG_ID), |
443 | 443 | KEY DTT_ID (DTT_ID)"; |
444 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
445 | - $table_name = 'esp_state'; |
|
446 | - $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT, |
|
444 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
445 | + $table_name = 'esp_state'; |
|
446 | + $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT, |
|
447 | 447 | CNT_ISO varchar(2) collate utf8_bin NOT NULL, |
448 | 448 | STA_abbrev varchar(24) collate utf8_bin NOT NULL, |
449 | 449 | STA_name varchar(100) collate utf8_bin NOT NULL, |
@@ -451,9 +451,9 @@ discard block |
||
451 | 451 | PRIMARY KEY (STA_ID), |
452 | 452 | KEY STA_abbrev (STA_abbrev), |
453 | 453 | KEY CNT_ISO (CNT_ISO)"; |
454 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
455 | - $table_name = 'esp_status'; |
|
456 | - $sql = "STS_ID varchar(3) NOT NULL, |
|
454 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
455 | + $table_name = 'esp_status'; |
|
456 | + $sql = "STS_ID varchar(3) NOT NULL, |
|
457 | 457 | STS_code varchar(45) NOT NULL, |
458 | 458 | STS_type varchar(45) NOT NULL, |
459 | 459 | STS_can_edit tinyint(1) NOT NULL DEFAULT 0, |
@@ -461,9 +461,9 @@ discard block |
||
461 | 461 | STS_open tinyint(1) NOT NULL DEFAULT 1, |
462 | 462 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
463 | 463 | KEY STS_type (STS_type)"; |
464 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
465 | - $table_name = 'esp_transaction'; |
|
466 | - $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
464 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
465 | + $table_name = 'esp_transaction'; |
|
466 | + $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
467 | 467 | TXN_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00', |
468 | 468 | TXN_total decimal(10,3) DEFAULT '0.00', |
469 | 469 | TXN_paid decimal(10,3) NOT NULL DEFAULT '0.00', |
@@ -475,9 +475,9 @@ discard block |
||
475 | 475 | PRIMARY KEY (TXN_ID), |
476 | 476 | KEY TXN_timestamp (TXN_timestamp), |
477 | 477 | KEY STS_ID (STS_ID)"; |
478 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
479 | - $table_name = 'esp_venue_meta'; |
|
480 | - $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
478 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
479 | + $table_name = 'esp_venue_meta'; |
|
480 | + $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
481 | 481 | VNU_ID bigint(20) unsigned NOT NULL DEFAULT 0, |
482 | 482 | VNU_address varchar(255) DEFAULT NULL, |
483 | 483 | VNU_address2 varchar(255) DEFAULT NULL, |
@@ -496,10 +496,10 @@ discard block |
||
496 | 496 | KEY VNU_ID (VNU_ID), |
497 | 497 | KEY STA_ID (STA_ID), |
498 | 498 | KEY CNT_ISO (CNT_ISO)"; |
499 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
500 | - //modified tables |
|
501 | - $table_name = "esp_price"; |
|
502 | - $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
499 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
500 | + //modified tables |
|
501 | + $table_name = "esp_price"; |
|
502 | + $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
503 | 503 | PRT_ID tinyint(3) unsigned NOT NULL, |
504 | 504 | PRC_amount decimal(10,3) NOT NULL DEFAULT '0.00', |
505 | 505 | PRC_name varchar(245) NOT NULL, |
@@ -512,9 +512,9 @@ discard block |
||
512 | 512 | PRC_parent int(10) unsigned DEFAULT 0, |
513 | 513 | PRIMARY KEY (PRC_ID), |
514 | 514 | KEY PRT_ID (PRT_ID)"; |
515 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
516 | - $table_name = "esp_price_type"; |
|
517 | - $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT, |
|
515 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
516 | + $table_name = "esp_price_type"; |
|
517 | + $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT, |
|
518 | 518 | PRT_name varchar(45) NOT NULL, |
519 | 519 | PBT_ID tinyint(3) unsigned NOT NULL DEFAULT '1', |
520 | 520 | PRT_is_percent tinyint(1) NOT NULL DEFAULT '0', |
@@ -523,9 +523,9 @@ discard block |
||
523 | 523 | PRT_deleted tinyint(1) NOT NULL DEFAULT '0', |
524 | 524 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
525 | 525 | PRIMARY KEY (PRT_ID)"; |
526 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
527 | - $table_name = "esp_ticket"; |
|
528 | - $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
526 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
527 | + $table_name = "esp_ticket"; |
|
528 | + $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
529 | 529 | TTM_ID int(10) unsigned NOT NULL, |
530 | 530 | TKT_name varchar(245) NOT NULL DEFAULT '', |
531 | 531 | TKT_description text NOT NULL, |
@@ -547,9 +547,9 @@ discard block |
||
547 | 547 | TKT_deleted tinyint(1) NOT NULL DEFAULT '0', |
548 | 548 | PRIMARY KEY (TKT_ID), |
549 | 549 | KEY TKT_start_date (TKT_start_date)"; |
550 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
551 | - $table_name = 'esp_question_group'; |
|
552 | - $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
550 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
551 | + $table_name = 'esp_question_group'; |
|
552 | + $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
553 | 553 | QSG_name varchar(255) NOT NULL, |
554 | 554 | QSG_identifier varchar(100) NOT NULL, |
555 | 555 | QSG_desc text NULL, |
@@ -562,221 +562,221 @@ discard block |
||
562 | 562 | PRIMARY KEY (QSG_ID), |
563 | 563 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier), |
564 | 564 | KEY QSG_order (QSG_order)'; |
565 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
566 | - /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
567 | - $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
568 | - //(because many need to convert old string states to foreign keys into the states table) |
|
569 | - $script_4_1_defaults->insert_default_states(); |
|
570 | - $script_4_1_defaults->insert_default_countries(); |
|
571 | - /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
572 | - $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
573 | - $script_4_5_defaults->insert_default_price_types(); |
|
574 | - $script_4_5_defaults->insert_default_prices(); |
|
575 | - $script_4_5_defaults->insert_default_tickets(); |
|
576 | - /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */ |
|
577 | - $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0'); |
|
578 | - $script_4_6_defaults->add_default_admin_only_payments(); |
|
579 | - $script_4_6_defaults->insert_default_currencies(); |
|
580 | - $this->verify_new_countries(); |
|
581 | - $this->verify_new_currencies(); |
|
582 | - return true; |
|
583 | - } |
|
565 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
566 | + /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
567 | + $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
568 | + //(because many need to convert old string states to foreign keys into the states table) |
|
569 | + $script_4_1_defaults->insert_default_states(); |
|
570 | + $script_4_1_defaults->insert_default_countries(); |
|
571 | + /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
572 | + $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
573 | + $script_4_5_defaults->insert_default_price_types(); |
|
574 | + $script_4_5_defaults->insert_default_prices(); |
|
575 | + $script_4_5_defaults->insert_default_tickets(); |
|
576 | + /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */ |
|
577 | + $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0'); |
|
578 | + $script_4_6_defaults->add_default_admin_only_payments(); |
|
579 | + $script_4_6_defaults->insert_default_currencies(); |
|
580 | + $this->verify_new_countries(); |
|
581 | + $this->verify_new_currencies(); |
|
582 | + return true; |
|
583 | + } |
|
584 | 584 | |
585 | 585 | |
586 | 586 | |
587 | - /** |
|
588 | - * @return boolean |
|
589 | - */ |
|
590 | - public function schema_changes_after_migration() |
|
591 | - { |
|
592 | - $this->fix_non_default_taxes(); |
|
593 | - //this is actually the same as the last DMS |
|
594 | - /** @var EE_DMS_Core_4_7_0 $script_4_7_defaults */ |
|
595 | - $script_4_7_defaults = EE_Registry::instance()->load_dms('Core_4_7_0'); |
|
596 | - return $script_4_7_defaults->schema_changes_after_migration(); |
|
597 | - } |
|
587 | + /** |
|
588 | + * @return boolean |
|
589 | + */ |
|
590 | + public function schema_changes_after_migration() |
|
591 | + { |
|
592 | + $this->fix_non_default_taxes(); |
|
593 | + //this is actually the same as the last DMS |
|
594 | + /** @var EE_DMS_Core_4_7_0 $script_4_7_defaults */ |
|
595 | + $script_4_7_defaults = EE_Registry::instance()->load_dms('Core_4_7_0'); |
|
596 | + return $script_4_7_defaults->schema_changes_after_migration(); |
|
597 | + } |
|
598 | 598 | |
599 | 599 | |
600 | 600 | |
601 | - public function migration_page_hooks() |
|
602 | - { |
|
603 | - } |
|
601 | + public function migration_page_hooks() |
|
602 | + { |
|
603 | + } |
|
604 | 604 | |
605 | 605 | |
606 | 606 | |
607 | - /** |
|
608 | - * verifies each of the new countries exists that somehow we missed in 4.1 |
|
609 | - */ |
|
610 | - public function verify_new_countries() |
|
611 | - { |
|
612 | - //a list of countries (and specifically some which were missed in another list):https://gist.github.com/adhipg/1600028 |
|
613 | - //how many decimal places? https://en.wikipedia.org/wiki/ISO_4217 |
|
614 | - //currency symbols: http://www.xe.com/symbols.php |
|
615 | - //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 |
|
616 | - //('AD', 'AND', 0, 'Andorra', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+376', 0, 0), |
|
617 | - $newer_countries = array( |
|
618 | - array('AX', 'ALA', 0, 'Åland Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0), |
|
619 | - array('BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0), |
|
620 | - array('CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0), |
|
621 | - array('GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0), |
|
622 | - array('IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0), |
|
623 | - array('JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0), |
|
624 | - array('MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0), |
|
625 | - array('ME', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+382', 0, 0), |
|
626 | - array('RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+381', 1, 0), |
|
627 | - array('SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0), |
|
628 | - array('SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0), |
|
629 | - array('XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+383', 0, 0), |
|
630 | - array('YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0), |
|
631 | - array( |
|
632 | - 'BQ', |
|
633 | - 'BES', |
|
634 | - 0, |
|
635 | - 'Bonaire, Saint Eustatius and Saba', |
|
636 | - 'USD', |
|
637 | - 'Dollar', |
|
638 | - 'Dollars', |
|
639 | - '$', |
|
640 | - 1, |
|
641 | - 2, |
|
642 | - '+599', |
|
643 | - 0, |
|
644 | - 0, |
|
645 | - ), |
|
646 | - array('BV', 'BVT', 0, 'Bouvet Island', 'NOK', 'Krone', 'Krones', 'kr', 1, 2, '+47', 0, 0), |
|
647 | - array('IO', 'IOT', 0, 'British Indian Ocean Territory', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+246', 0, 0), |
|
648 | - array('CX', 'CXR', 0, 'Christmas Island', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+61', 0, 0), |
|
649 | - array('CC', 'CCK', 0, 'Cocos (Keeling) Islands', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+891', 0, 0), |
|
650 | - array( |
|
651 | - 'HM', |
|
652 | - 'HMD', |
|
653 | - 0, |
|
654 | - 'Heard Island and McDonald Islands', |
|
655 | - 'AUD', |
|
656 | - 'Dollar', |
|
657 | - 'Dollars', |
|
658 | - '$', |
|
659 | - 1, |
|
660 | - 2, |
|
661 | - '+891', |
|
662 | - 0, |
|
663 | - 0, |
|
664 | - ), |
|
665 | - array('PS', 'PSE', 0, 'Palestinian Territory', 'ILS', 'Shekel', 'Shekels', '₪', 1, 2, '+970', 0, 0), |
|
666 | - array( |
|
667 | - 'GS', |
|
668 | - 'SGS', |
|
669 | - 0, |
|
670 | - 'South Georgia and the South Sandwich Islands', |
|
671 | - 'GBP', |
|
672 | - 'Pound', |
|
673 | - 'Pounds', |
|
674 | - '£', |
|
675 | - 1, |
|
676 | - 2, |
|
677 | - '+500', |
|
678 | - 0, |
|
679 | - 0, |
|
680 | - ), |
|
681 | - array('TL', 'TLS', 0, 'Timor-Leste', 'USD', 'Dollar', 'Dollars', '$', 1, 2, '+670', 0, 0), |
|
682 | - array('TF', 'ATF', 0, 'French Southern Territories', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+262', 0, 0), |
|
683 | - array( |
|
684 | - 'UM', |
|
685 | - 'UMI', |
|
686 | - 0, |
|
687 | - 'United States Minor Outlying Islands', |
|
688 | - 'USD', |
|
689 | - 'Dollar', |
|
690 | - 'Dollars', |
|
691 | - '$', |
|
692 | - 1, |
|
693 | - 2, |
|
694 | - '+1', |
|
695 | - 0, |
|
696 | - 0, |
|
697 | - ), |
|
698 | - ); |
|
699 | - global $wpdb; |
|
700 | - $country_table = $wpdb->prefix . "esp_country"; |
|
701 | - $country_format = array( |
|
702 | - "CNT_ISO" => '%s', |
|
703 | - "CNT_ISO3" => '%s', |
|
704 | - "RGN_ID" => '%d', |
|
705 | - "CNT_name" => '%s', |
|
706 | - "CNT_cur_code" => '%s', |
|
707 | - "CNT_cur_single" => '%s', |
|
708 | - "CNT_cur_plural" => '%s', |
|
709 | - "CNT_cur_sign" => '%s', |
|
710 | - "CNT_cur_sign_b4" => '%d', |
|
711 | - "CNT_cur_dec_plc" => '%d', |
|
712 | - "CNT_tel_code" => '%s', |
|
713 | - "CNT_is_EU" => '%d', |
|
714 | - "CNT_active" => '%d', |
|
715 | - ); |
|
716 | - if ($this->_get_table_analysis()->tableExists($country_table)) { |
|
717 | - foreach ($newer_countries as $country) { |
|
718 | - $SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1"; |
|
719 | - $countries = $wpdb->get_var($SQL); |
|
720 | - if ( ! $countries) { |
|
721 | - $wpdb->insert($country_table, |
|
722 | - array_combine(array_keys($country_format), $country), |
|
723 | - $country_format |
|
724 | - ); |
|
725 | - } |
|
726 | - } |
|
727 | - } |
|
728 | - } |
|
607 | + /** |
|
608 | + * verifies each of the new countries exists that somehow we missed in 4.1 |
|
609 | + */ |
|
610 | + public function verify_new_countries() |
|
611 | + { |
|
612 | + //a list of countries (and specifically some which were missed in another list):https://gist.github.com/adhipg/1600028 |
|
613 | + //how many decimal places? https://en.wikipedia.org/wiki/ISO_4217 |
|
614 | + //currency symbols: http://www.xe.com/symbols.php |
|
615 | + //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 |
|
616 | + //('AD', 'AND', 0, 'Andorra', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+376', 0, 0), |
|
617 | + $newer_countries = array( |
|
618 | + array('AX', 'ALA', 0, 'Åland Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0), |
|
619 | + array('BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0), |
|
620 | + array('CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0), |
|
621 | + array('GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0), |
|
622 | + array('IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0), |
|
623 | + array('JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0), |
|
624 | + array('MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0), |
|
625 | + array('ME', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+382', 0, 0), |
|
626 | + array('RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+381', 1, 0), |
|
627 | + array('SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0), |
|
628 | + array('SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0), |
|
629 | + array('XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+383', 0, 0), |
|
630 | + array('YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0), |
|
631 | + array( |
|
632 | + 'BQ', |
|
633 | + 'BES', |
|
634 | + 0, |
|
635 | + 'Bonaire, Saint Eustatius and Saba', |
|
636 | + 'USD', |
|
637 | + 'Dollar', |
|
638 | + 'Dollars', |
|
639 | + '$', |
|
640 | + 1, |
|
641 | + 2, |
|
642 | + '+599', |
|
643 | + 0, |
|
644 | + 0, |
|
645 | + ), |
|
646 | + array('BV', 'BVT', 0, 'Bouvet Island', 'NOK', 'Krone', 'Krones', 'kr', 1, 2, '+47', 0, 0), |
|
647 | + array('IO', 'IOT', 0, 'British Indian Ocean Territory', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+246', 0, 0), |
|
648 | + array('CX', 'CXR', 0, 'Christmas Island', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+61', 0, 0), |
|
649 | + array('CC', 'CCK', 0, 'Cocos (Keeling) Islands', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+891', 0, 0), |
|
650 | + array( |
|
651 | + 'HM', |
|
652 | + 'HMD', |
|
653 | + 0, |
|
654 | + 'Heard Island and McDonald Islands', |
|
655 | + 'AUD', |
|
656 | + 'Dollar', |
|
657 | + 'Dollars', |
|
658 | + '$', |
|
659 | + 1, |
|
660 | + 2, |
|
661 | + '+891', |
|
662 | + 0, |
|
663 | + 0, |
|
664 | + ), |
|
665 | + array('PS', 'PSE', 0, 'Palestinian Territory', 'ILS', 'Shekel', 'Shekels', '₪', 1, 2, '+970', 0, 0), |
|
666 | + array( |
|
667 | + 'GS', |
|
668 | + 'SGS', |
|
669 | + 0, |
|
670 | + 'South Georgia and the South Sandwich Islands', |
|
671 | + 'GBP', |
|
672 | + 'Pound', |
|
673 | + 'Pounds', |
|
674 | + '£', |
|
675 | + 1, |
|
676 | + 2, |
|
677 | + '+500', |
|
678 | + 0, |
|
679 | + 0, |
|
680 | + ), |
|
681 | + array('TL', 'TLS', 0, 'Timor-Leste', 'USD', 'Dollar', 'Dollars', '$', 1, 2, '+670', 0, 0), |
|
682 | + array('TF', 'ATF', 0, 'French Southern Territories', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+262', 0, 0), |
|
683 | + array( |
|
684 | + 'UM', |
|
685 | + 'UMI', |
|
686 | + 0, |
|
687 | + 'United States Minor Outlying Islands', |
|
688 | + 'USD', |
|
689 | + 'Dollar', |
|
690 | + 'Dollars', |
|
691 | + '$', |
|
692 | + 1, |
|
693 | + 2, |
|
694 | + '+1', |
|
695 | + 0, |
|
696 | + 0, |
|
697 | + ), |
|
698 | + ); |
|
699 | + global $wpdb; |
|
700 | + $country_table = $wpdb->prefix . "esp_country"; |
|
701 | + $country_format = array( |
|
702 | + "CNT_ISO" => '%s', |
|
703 | + "CNT_ISO3" => '%s', |
|
704 | + "RGN_ID" => '%d', |
|
705 | + "CNT_name" => '%s', |
|
706 | + "CNT_cur_code" => '%s', |
|
707 | + "CNT_cur_single" => '%s', |
|
708 | + "CNT_cur_plural" => '%s', |
|
709 | + "CNT_cur_sign" => '%s', |
|
710 | + "CNT_cur_sign_b4" => '%d', |
|
711 | + "CNT_cur_dec_plc" => '%d', |
|
712 | + "CNT_tel_code" => '%s', |
|
713 | + "CNT_is_EU" => '%d', |
|
714 | + "CNT_active" => '%d', |
|
715 | + ); |
|
716 | + if ($this->_get_table_analysis()->tableExists($country_table)) { |
|
717 | + foreach ($newer_countries as $country) { |
|
718 | + $SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1"; |
|
719 | + $countries = $wpdb->get_var($SQL); |
|
720 | + if ( ! $countries) { |
|
721 | + $wpdb->insert($country_table, |
|
722 | + array_combine(array_keys($country_format), $country), |
|
723 | + $country_format |
|
724 | + ); |
|
725 | + } |
|
726 | + } |
|
727 | + } |
|
728 | + } |
|
729 | 729 | |
730 | 730 | |
731 | 731 | |
732 | - /** |
|
733 | - * verifies each of the new currencies exists that somehow we missed in 4.6 |
|
734 | - */ |
|
735 | - public function verify_new_currencies() |
|
736 | - { |
|
737 | - //a list of countries (and specifically some which were missed in another list):https://gist.github.com/adhipg/1600028 |
|
738 | - //how many decimal places? https://en.wikipedia.org/wiki/ISO_4217 |
|
739 | - //currency symbols: http://www.xe.com/symbols.php |
|
740 | - // CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active |
|
741 | - //( 'EUR', 'Euro', 'Euros', '€', 2,1), |
|
742 | - $newer_currencies = array( |
|
743 | - array('RSD', 'Dinar', 'Dinars', '', 3, 1), |
|
744 | - ); |
|
745 | - global $wpdb; |
|
746 | - $currency_table = $wpdb->prefix . "esp_currency"; |
|
747 | - $currency_format = array( |
|
748 | - "CUR_code" => '%s', |
|
749 | - "CUR_single" => '%s', |
|
750 | - "CUR_plural" => '%s', |
|
751 | - "CUR_sign" => '%s', |
|
752 | - "CUR_dec_plc" => '%d', |
|
753 | - "CUR_active" => '%d', |
|
754 | - ); |
|
755 | - if ($this->_get_table_analysis()->tableExists($currency_table)) { |
|
756 | - foreach ($newer_currencies as $currency) { |
|
757 | - $SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1"; |
|
758 | - $countries = $wpdb->get_var($SQL); |
|
759 | - if ( ! $countries) { |
|
760 | - $wpdb->insert($currency_table, |
|
761 | - array_combine(array_keys($currency_format), $currency), |
|
762 | - $currency_format |
|
763 | - ); |
|
764 | - } |
|
765 | - } |
|
766 | - } |
|
767 | - } |
|
732 | + /** |
|
733 | + * verifies each of the new currencies exists that somehow we missed in 4.6 |
|
734 | + */ |
|
735 | + public function verify_new_currencies() |
|
736 | + { |
|
737 | + //a list of countries (and specifically some which were missed in another list):https://gist.github.com/adhipg/1600028 |
|
738 | + //how many decimal places? https://en.wikipedia.org/wiki/ISO_4217 |
|
739 | + //currency symbols: http://www.xe.com/symbols.php |
|
740 | + // CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active |
|
741 | + //( 'EUR', 'Euro', 'Euros', '€', 2,1), |
|
742 | + $newer_currencies = array( |
|
743 | + array('RSD', 'Dinar', 'Dinars', '', 3, 1), |
|
744 | + ); |
|
745 | + global $wpdb; |
|
746 | + $currency_table = $wpdb->prefix . "esp_currency"; |
|
747 | + $currency_format = array( |
|
748 | + "CUR_code" => '%s', |
|
749 | + "CUR_single" => '%s', |
|
750 | + "CUR_plural" => '%s', |
|
751 | + "CUR_sign" => '%s', |
|
752 | + "CUR_dec_plc" => '%d', |
|
753 | + "CUR_active" => '%d', |
|
754 | + ); |
|
755 | + if ($this->_get_table_analysis()->tableExists($currency_table)) { |
|
756 | + foreach ($newer_currencies as $currency) { |
|
757 | + $SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1"; |
|
758 | + $countries = $wpdb->get_var($SQL); |
|
759 | + if ( ! $countries) { |
|
760 | + $wpdb->insert($currency_table, |
|
761 | + array_combine(array_keys($currency_format), $currency), |
|
762 | + $currency_format |
|
763 | + ); |
|
764 | + } |
|
765 | + } |
|
766 | + } |
|
767 | + } |
|
768 | 768 | |
769 | 769 | |
770 | 770 | |
771 | - /** |
|
772 | - * addresses https://events.codebasehq.com/projects/event-espresso/tickets/8731 |
|
773 | - * which should just be a temporary issue for folks who installed 4.8.0-4.8.5; |
|
774 | - * we should be able to stop doing this in 4.9 |
|
775 | - */ |
|
776 | - public function fix_non_default_taxes() |
|
777 | - { |
|
778 | - global $wpdb; |
|
779 | - $query = $wpdb->prepare("UPDATE |
|
771 | + /** |
|
772 | + * addresses https://events.codebasehq.com/projects/event-espresso/tickets/8731 |
|
773 | + * which should just be a temporary issue for folks who installed 4.8.0-4.8.5; |
|
774 | + * we should be able to stop doing this in 4.9 |
|
775 | + */ |
|
776 | + public function fix_non_default_taxes() |
|
777 | + { |
|
778 | + global $wpdb; |
|
779 | + $query = $wpdb->prepare("UPDATE |
|
780 | 780 | {$wpdb->prefix}esp_price p INNER JOIN |
781 | 781 | {$wpdb->prefix}esp_price_type pt ON p.PRT_ID = pt.PRT_ID |
782 | 782 | SET |
@@ -785,6 +785,6 @@ discard block |
||
785 | 785 | p.PRC_is_default = 0 AND |
786 | 786 | pt.PBT_ID = %d |
787 | 787 | ", EEM_Price_Type::base_type_tax); |
788 | - $wpdb->query($query); |
|
789 | - } |
|
788 | + $wpdb->query($query); |
|
789 | + } |
|
790 | 790 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | //unfortunately, this needs to be done upon INCLUSION of this file, |
15 | 15 | //instead of construction, because it only gets constructed on first page load |
16 | 16 | //(all other times it gets resurrected from a wordpress option) |
17 | -$stages = glob(EE_CORE . 'data_migration_scripts/4_8_0_stages/*'); |
|
17 | +$stages = glob(EE_CORE.'data_migration_scripts/4_8_0_stages/*'); |
|
18 | 18 | $class_to_filepath = array(); |
19 | 19 | foreach ($stages as $filepath) { |
20 | 20 | $matches = array(); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } elseif ( ! $version_string) { |
76 | 76 | // echo "no version string provided: $version_string"; |
77 | 77 | //no version string provided... this must be pre 4.3 |
78 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
78 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
79 | 79 | } else { |
80 | 80 | // echo "$version_string doesnt apply"; |
81 | 81 | return false; |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function schema_changes_before_migration() |
101 | 101 | { |
102 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
102 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
103 | 103 | $now_in_mysql = current_time('mysql', true); |
104 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
104 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
105 | 105 | $table_name = 'esp_answer'; |
106 | 106 | $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
107 | 107 | REG_ID int(10) unsigned NOT NULL, |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | ), |
698 | 698 | ); |
699 | 699 | global $wpdb; |
700 | - $country_table = $wpdb->prefix . "esp_country"; |
|
700 | + $country_table = $wpdb->prefix."esp_country"; |
|
701 | 701 | $country_format = array( |
702 | 702 | "CNT_ISO" => '%s', |
703 | 703 | "CNT_ISO3" => '%s', |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | array('RSD', 'Dinar', 'Dinars', '', 3, 1), |
744 | 744 | ); |
745 | 745 | global $wpdb; |
746 | - $currency_table = $wpdb->prefix . "esp_currency"; |
|
746 | + $currency_table = $wpdb->prefix."esp_currency"; |
|
747 | 747 | $currency_format = array( |
748 | 748 | "CUR_code" => '%s', |
749 | 749 | "CUR_single" => '%s', |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | $stages = glob(EE_CORE . 'data_migration_scripts/4_5_0_stages/*'); |
17 | 17 | $class_to_filepath = array(); |
18 | 18 | foreach ($stages as $filepath) { |
19 | - $matches = array(); |
|
20 | - preg_match('~4_5_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
21 | - $class_to_filepath[$matches[1]] = $filepath; |
|
19 | + $matches = array(); |
|
20 | + preg_match('~4_5_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
21 | + $class_to_filepath[$matches[1]] = $filepath; |
|
22 | 22 | } |
23 | 23 | //give addons a chance to autoload their stages too |
24 | 24 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_5_0__autoloaded_stages', $class_to_filepath); |
@@ -31,66 +31,66 @@ discard block |
||
31 | 31 | |
32 | 32 | |
33 | 33 | |
34 | - /** |
|
35 | - * EE_DMS_Core_4_5_0 constructor. |
|
36 | - * |
|
37 | - * @param TableManager $table_manager |
|
38 | - * @param TableAnalysis $table_analysis |
|
39 | - */ |
|
40 | - public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
41 | - { |
|
42 | - $this->_pretty_name = __("Data Migration to Event Espresso 4.5.0.P", "event_espresso"); |
|
43 | - $this->_priority = 10; |
|
44 | - $this->_migration_stages = array( |
|
45 | - new EE_DMS_4_5_0_update_wp_user_for_tickets(), |
|
46 | - new EE_DMS_4_5_0_update_wp_user_for_prices(), |
|
47 | - new EE_DMS_4_5_0_update_wp_user_for_price_types(), |
|
48 | - new EE_DMS_4_5_0_update_wp_user_for_question_groups(), |
|
49 | - new EE_DMS_4_5_0_invoice_settings(), |
|
50 | - ); |
|
51 | - parent::__construct($table_manager, $table_analysis); |
|
52 | - } |
|
53 | - |
|
54 | - |
|
55 | - |
|
56 | - public function can_migrate_from_version($version_array) |
|
57 | - { |
|
58 | - $version_string = $version_array['Core']; |
|
59 | - if (version_compare($version_string, '4.5.0', '<=') && version_compare($version_string, '4.3.0', '>=')) { |
|
34 | + /** |
|
35 | + * EE_DMS_Core_4_5_0 constructor. |
|
36 | + * |
|
37 | + * @param TableManager $table_manager |
|
38 | + * @param TableAnalysis $table_analysis |
|
39 | + */ |
|
40 | + public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
41 | + { |
|
42 | + $this->_pretty_name = __("Data Migration to Event Espresso 4.5.0.P", "event_espresso"); |
|
43 | + $this->_priority = 10; |
|
44 | + $this->_migration_stages = array( |
|
45 | + new EE_DMS_4_5_0_update_wp_user_for_tickets(), |
|
46 | + new EE_DMS_4_5_0_update_wp_user_for_prices(), |
|
47 | + new EE_DMS_4_5_0_update_wp_user_for_price_types(), |
|
48 | + new EE_DMS_4_5_0_update_wp_user_for_question_groups(), |
|
49 | + new EE_DMS_4_5_0_invoice_settings(), |
|
50 | + ); |
|
51 | + parent::__construct($table_manager, $table_analysis); |
|
52 | + } |
|
53 | + |
|
54 | + |
|
55 | + |
|
56 | + public function can_migrate_from_version($version_array) |
|
57 | + { |
|
58 | + $version_string = $version_array['Core']; |
|
59 | + if (version_compare($version_string, '4.5.0', '<=') && version_compare($version_string, '4.3.0', '>=')) { |
|
60 | 60 | // echo "$version_string can be migrated from"; |
61 | - return true; |
|
62 | - } elseif ( ! $version_string) { |
|
61 | + return true; |
|
62 | + } elseif ( ! $version_string) { |
|
63 | 63 | // echo "no version string provided: $version_string"; |
64 | - //no version string provided... this must be pre 4.3 |
|
65 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
66 | - } else { |
|
64 | + //no version string provided... this must be pre 4.3 |
|
65 | + return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
66 | + } else { |
|
67 | 67 | // echo "$version_string doesnt apply"; |
68 | - return false; |
|
69 | - } |
|
70 | - } |
|
68 | + return false; |
|
69 | + } |
|
70 | + } |
|
71 | 71 | |
72 | 72 | |
73 | 73 | |
74 | - public function pretty_name() |
|
75 | - { |
|
76 | - return __("Core Data Migration to version 4.5.0", "event_espresso"); |
|
77 | - } |
|
74 | + public function pretty_name() |
|
75 | + { |
|
76 | + return __("Core Data Migration to version 4.5.0", "event_espresso"); |
|
77 | + } |
|
78 | 78 | |
79 | 79 | |
80 | 80 | |
81 | - public function schema_changes_before_migration() |
|
82 | - { |
|
83 | - //relies on 4.1's EEH_Activation::create_table |
|
84 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
85 | - $table_name = 'esp_answer'; |
|
86 | - $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
81 | + public function schema_changes_before_migration() |
|
82 | + { |
|
83 | + //relies on 4.1's EEH_Activation::create_table |
|
84 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
85 | + $table_name = 'esp_answer'; |
|
86 | + $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
87 | 87 | REG_ID INT UNSIGNED NOT NULL, |
88 | 88 | QST_ID INT UNSIGNED NOT NULL, |
89 | 89 | ANS_value TEXT NOT NULL, |
90 | 90 | PRIMARY KEY (ANS_ID)"; |
91 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
92 | - $table_name = 'esp_attendee_meta'; |
|
93 | - $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
91 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
92 | + $table_name = 'esp_attendee_meta'; |
|
93 | + $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
94 | 94 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
95 | 95 | ATT_fname VARCHAR(45) NOT NULL, |
96 | 96 | ATT_lname VARCHAR(45) NOT NULL, |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | KEY ATT_fname (ATT_fname), |
107 | 107 | KEY ATT_lname (ATT_lname), |
108 | 108 | KEY ATT_email (ATT_email)"; |
109 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
110 | - $table_name = 'esp_country'; |
|
111 | - $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
109 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
110 | + $table_name = 'esp_country'; |
|
111 | + $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
112 | 112 | CNT_ISO3 VARCHAR(3) COLLATE utf8_bin NOT NULL, |
113 | 113 | RGN_ID TINYINT(3) UNSIGNED DEFAULT NULL, |
114 | 114 | CNT_name VARCHAR(45) COLLATE utf8_bin NOT NULL, |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | CNT_is_EU TINYINT(1) DEFAULT '0', |
125 | 125 | CNT_active TINYINT(1) DEFAULT '0', |
126 | 126 | PRIMARY KEY (CNT_ISO)"; |
127 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
128 | - $table_name = 'esp_datetime'; |
|
129 | - $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
127 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
128 | + $table_name = 'esp_datetime'; |
|
129 | + $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
130 | 130 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
131 | 131 | DTT_name VARCHAR(255) NOT NULL DEFAULT '', |
132 | 132 | DTT_description TEXT NOT NULL, |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | PRIMARY KEY (DTT_ID), |
142 | 142 | KEY EVT_ID (EVT_ID), |
143 | 143 | KEY DTT_is_primary (DTT_is_primary)"; |
144 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
145 | - $table_name = 'esp_event_meta'; |
|
146 | - $sql = " |
|
144 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
145 | + $table_name = 'esp_event_meta'; |
|
146 | + $sql = " |
|
147 | 147 | EVTM_ID INT NOT NULL AUTO_INCREMENT, |
148 | 148 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
149 | 149 | EVT_display_desc TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -158,31 +158,31 @@ discard block |
||
158 | 158 | EVT_external_URL VARCHAR(200) NULL, |
159 | 159 | EVT_donations TINYINT(1) NULL, |
160 | 160 | PRIMARY KEY (EVTM_ID)"; |
161 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
162 | - $table_name = 'esp_event_question_group'; |
|
163 | - $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
161 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
162 | + $table_name = 'esp_event_question_group'; |
|
163 | + $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
164 | 164 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
165 | 165 | QSG_ID INT UNSIGNED NOT NULL, |
166 | 166 | EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
167 | 167 | PRIMARY KEY (EQG_ID)"; |
168 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
169 | - $table_name = 'esp_event_venue'; |
|
170 | - $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
168 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
169 | + $table_name = 'esp_event_venue'; |
|
170 | + $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
171 | 171 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
172 | 172 | VNU_ID BIGINT(20) UNSIGNED NOT NULL, |
173 | 173 | EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
174 | 174 | PRIMARY KEY (EVV_ID)"; |
175 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
176 | - $table_name = 'esp_extra_meta'; |
|
177 | - $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
175 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
176 | + $table_name = 'esp_extra_meta'; |
|
177 | + $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
178 | 178 | OBJ_ID INT(11) DEFAULT NULL, |
179 | 179 | EXM_type VARCHAR(45) DEFAULT NULL, |
180 | 180 | EXM_key VARCHAR(45) DEFAULT NULL, |
181 | 181 | EXM_value TEXT, |
182 | 182 | PRIMARY KEY (EXM_ID)"; |
183 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
184 | - $table_name = 'esp_line_item'; |
|
185 | - $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
183 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
184 | + $table_name = 'esp_line_item'; |
|
185 | + $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
186 | 186 | LIN_code VARCHAR(245) NOT NULL DEFAULT '', |
187 | 187 | TXN_ID INT(11) DEFAULT NULL, |
188 | 188 | LIN_name VARCHAR(245) NOT NULL DEFAULT '', |
@@ -198,19 +198,19 @@ discard block |
||
198 | 198 | OBJ_ID INT(11) DEFAULT NULL, |
199 | 199 | OBJ_type VARCHAR(45)DEFAULT NULL, |
200 | 200 | PRIMARY KEY (LIN_ID)"; |
201 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
202 | - $table_name = 'esp_message_template'; |
|
203 | - $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
201 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
202 | + $table_name = 'esp_message_template'; |
|
203 | + $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
204 | 204 | GRP_ID INT(10) UNSIGNED NOT NULL, |
205 | 205 | MTP_context VARCHAR(50) NOT NULL, |
206 | 206 | MTP_template_field VARCHAR(30) NOT NULL, |
207 | 207 | MTP_content TEXT NOT NULL, |
208 | 208 | PRIMARY KEY (MTP_ID), |
209 | 209 | KEY GRP_ID (GRP_ID)"; |
210 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
211 | - $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID'); |
|
212 | - $table_name = 'esp_message_template_group'; |
|
213 | - $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
210 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
211 | + $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID'); |
|
212 | + $table_name = 'esp_message_template_group'; |
|
213 | + $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
214 | 214 | MTP_user_id INT(10) NOT NULL DEFAULT '1', |
215 | 215 | MTP_name VARCHAR(245) NOT NULL DEFAULT '', |
216 | 216 | MTP_description VARCHAR(245) NOT NULL DEFAULT '', |
@@ -222,17 +222,17 @@ discard block |
||
222 | 222 | MTP_is_active TINYINT(1) NOT NULL DEFAULT '1', |
223 | 223 | PRIMARY KEY (GRP_ID), |
224 | 224 | KEY MTP_user_id (MTP_user_id)"; |
225 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
226 | - $table_name = 'esp_event_message_template'; |
|
227 | - $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
225 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
226 | + $table_name = 'esp_event_message_template'; |
|
227 | + $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
228 | 228 | EVT_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
229 | 229 | GRP_ID INT(10) UNSIGNED NOT NULL DEFAULT 0, |
230 | 230 | PRIMARY KEY (EMT_ID), |
231 | 231 | KEY EVT_ID (EVT_ID), |
232 | 232 | KEY GRP_ID (GRP_ID)"; |
233 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
234 | - $table_name = 'esp_payment'; |
|
235 | - $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
233 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
234 | + $table_name = 'esp_payment'; |
|
235 | + $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
236 | 236 | TXN_ID INT(10) UNSIGNED DEFAULT NULL, |
237 | 237 | STS_ID VARCHAR(3) COLLATE utf8_bin DEFAULT NULL, |
238 | 238 | PAY_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -248,28 +248,28 @@ discard block |
||
248 | 248 | PRIMARY KEY (PAY_ID), |
249 | 249 | KEY TXN_ID (TXN_ID), |
250 | 250 | KEY PAY_timestamp (PAY_timestamp)"; |
251 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
252 | - $table_name = "esp_ticket_price"; |
|
253 | - $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
251 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
252 | + $table_name = "esp_ticket_price"; |
|
253 | + $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
254 | 254 | TKT_ID INT(10) UNSIGNED NOT NULL, |
255 | 255 | PRC_ID INT(10) UNSIGNED NOT NULL, |
256 | 256 | PRIMARY KEY (TKP_ID)"; |
257 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
258 | - $table_name = "esp_datetime_ticket"; |
|
259 | - $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
257 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
258 | + $table_name = "esp_datetime_ticket"; |
|
259 | + $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
260 | 260 | DTT_ID INT(10) UNSIGNED NOT NULL, |
261 | 261 | TKT_ID INT(10) UNSIGNED NOT NULL, |
262 | 262 | PRIMARY KEY (DTK_ID)"; |
263 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
264 | - $table_name = "esp_ticket_template"; |
|
265 | - $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
263 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
264 | + $table_name = "esp_ticket_template"; |
|
265 | + $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
266 | 266 | TTM_name VARCHAR(45) NOT NULL, |
267 | 267 | TTM_description TEXT, |
268 | 268 | TTM_file VARCHAR(45), |
269 | 269 | PRIMARY KEY (TTM_ID)"; |
270 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
271 | - $table_name = 'esp_question'; |
|
272 | - $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
270 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
271 | + $table_name = 'esp_question'; |
|
272 | + $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
273 | 273 | QST_display_text TEXT NOT NULL, |
274 | 274 | QST_admin_label VARCHAR(255) NOT NULL, |
275 | 275 | QST_system VARCHAR(25) DEFAULT NULL, |
@@ -281,25 +281,25 @@ discard block |
||
281 | 281 | QST_wp_user BIGINT UNSIGNED NULL, |
282 | 282 | QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0, |
283 | 283 | PRIMARY KEY (QST_ID)'; |
284 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
285 | - $table_name = 'esp_question_group_question'; |
|
286 | - $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
284 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
285 | + $table_name = 'esp_question_group_question'; |
|
286 | + $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
287 | 287 | QSG_ID INT UNSIGNED NOT NULL, |
288 | 288 | QST_ID INT UNSIGNED NOT NULL, |
289 | 289 | QGQ_order INT UNSIGNED NOT NULL DEFAULT 0, |
290 | 290 | PRIMARY KEY (QGQ_ID) "; |
291 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
292 | - $table_name = 'esp_question_option'; |
|
293 | - $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
291 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
292 | + $table_name = 'esp_question_option'; |
|
293 | + $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
294 | 294 | QSO_value VARCHAR(255) NOT NULL, |
295 | 295 | QSO_desc TEXT NOT NULL, |
296 | 296 | QST_ID INT UNSIGNED NOT NULL, |
297 | 297 | QSO_order INT UNSIGNED NOT NULL DEFAULT 0, |
298 | 298 | QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
299 | 299 | PRIMARY KEY (QSO_ID)"; |
300 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
301 | - $table_name = 'esp_registration'; |
|
302 | - $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
300 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
301 | + $table_name = 'esp_registration'; |
|
302 | + $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
303 | 303 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
304 | 304 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
305 | 305 | TXN_ID INT(10) UNSIGNED NOT NULL, |
@@ -322,25 +322,25 @@ discard block |
||
322 | 322 | KEY STS_ID (STS_ID), |
323 | 323 | KEY REG_url_link (REG_url_link), |
324 | 324 | KEY REG_code (REG_code)"; |
325 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
326 | - $table_name = 'esp_checkin'; |
|
327 | - $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
325 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
326 | + $table_name = 'esp_checkin'; |
|
327 | + $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
328 | 328 | REG_ID INT(10) UNSIGNED NOT NULL, |
329 | 329 | DTT_ID INT(10) UNSIGNED NOT NULL, |
330 | 330 | CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
331 | 331 | CHK_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
332 | 332 | PRIMARY KEY (CHK_ID)"; |
333 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
334 | - $table_name = 'esp_state'; |
|
335 | - $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
333 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
334 | + $table_name = 'esp_state'; |
|
335 | + $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
336 | 336 | CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
337 | 337 | STA_abbrev VARCHAR(6) COLLATE utf8_bin NOT NULL, |
338 | 338 | STA_name VARCHAR(100) COLLATE utf8_bin NOT NULL, |
339 | 339 | STA_active TINYINT(1) DEFAULT '1', |
340 | 340 | PRIMARY KEY (STA_ID)"; |
341 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
342 | - $table_name = 'esp_status'; |
|
343 | - $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
341 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
342 | + $table_name = 'esp_status'; |
|
343 | + $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
344 | 344 | STS_code VARCHAR(45) COLLATE utf8_bin NOT NULL, |
345 | 345 | STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL, |
346 | 346 | STS_can_edit TINYINT(1) NOT NULL DEFAULT 0, |
@@ -348,9 +348,9 @@ discard block |
||
348 | 348 | STS_open TINYINT(1) NOT NULL DEFAULT 1, |
349 | 349 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
350 | 350 | KEY STS_type (STS_type)"; |
351 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
352 | - $table_name = 'esp_transaction'; |
|
353 | - $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
351 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
352 | + $table_name = 'esp_transaction'; |
|
353 | + $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
354 | 354 | TXN_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
355 | 355 | TXN_total DECIMAL(10,3) DEFAULT '0.00', |
356 | 356 | TXN_paid DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
@@ -361,9 +361,9 @@ discard block |
||
361 | 361 | PRIMARY KEY (TXN_ID), |
362 | 362 | KEY TXN_timestamp (TXN_timestamp), |
363 | 363 | KEY STS_ID (STS_ID)"; |
364 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
365 | - $table_name = 'esp_venue_meta'; |
|
366 | - $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
364 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
365 | + $table_name = 'esp_venue_meta'; |
|
366 | + $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
367 | 367 | VNU_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
368 | 368 | VNU_address VARCHAR(255) DEFAULT NULL, |
369 | 369 | VNU_address2 VARCHAR(255) DEFAULT NULL, |
@@ -381,10 +381,10 @@ discard block |
||
381 | 381 | PRIMARY KEY (VNUM_ID), |
382 | 382 | KEY STA_ID (STA_ID), |
383 | 383 | KEY CNT_ISO (CNT_ISO)"; |
384 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
385 | - //modified tables |
|
386 | - $table_name = "esp_price"; |
|
387 | - $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
384 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
385 | + //modified tables |
|
386 | + $table_name = "esp_price"; |
|
387 | + $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
388 | 388 | PRT_ID TINYINT(3) UNSIGNED NOT NULL, |
389 | 389 | PRC_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
390 | 390 | PRC_name VARCHAR(245) NOT NULL, |
@@ -396,9 +396,9 @@ discard block |
||
396 | 396 | PRC_wp_user BIGINT UNSIGNED NULL, |
397 | 397 | PRC_parent INT(10) UNSIGNED DEFAULT 0, |
398 | 398 | PRIMARY KEY (PRC_ID)"; |
399 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
400 | - $table_name = "esp_price_type"; |
|
401 | - $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
399 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
400 | + $table_name = "esp_price_type"; |
|
401 | + $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
402 | 402 | PRT_name VARCHAR(45) NOT NULL, |
403 | 403 | PBT_ID TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', |
404 | 404 | PRT_is_percent TINYINT(1) NOT NULL DEFAULT '0', |
@@ -407,9 +407,9 @@ discard block |
||
407 | 407 | PRT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
408 | 408 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
409 | 409 | PRIMARY KEY (PRT_ID)"; |
410 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
411 | - $table_name = "esp_ticket"; |
|
412 | - $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
410 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
411 | + $table_name = "esp_ticket"; |
|
412 | + $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
413 | 413 | TTM_ID INT(10) UNSIGNED NOT NULL, |
414 | 414 | TKT_name VARCHAR(245) NOT NULL DEFAULT '', |
415 | 415 | TKT_description TEXT NOT NULL, |
@@ -430,10 +430,10 @@ discard block |
||
430 | 430 | TKT_parent INT(10) UNSIGNED DEFAULT '0', |
431 | 431 | TKT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
432 | 432 | PRIMARY KEY (TKT_ID)"; |
433 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
434 | - $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
435 | - $table_name = 'esp_question_group'; |
|
436 | - $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
433 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
434 | + $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
435 | + $table_name = 'esp_question_group'; |
|
436 | + $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
437 | 437 | QSG_name VARCHAR(255) NOT NULL, |
438 | 438 | QSG_identifier VARCHAR(100) NOT NULL, |
439 | 439 | QSG_desc TEXT NULL, |
@@ -445,135 +445,135 @@ discard block |
||
445 | 445 | QSG_wp_user BIGINT UNSIGNED NULL, |
446 | 446 | PRIMARY KEY (QSG_ID), |
447 | 447 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)'; |
448 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
449 | - $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
450 | - //(because many need to convert old string states to foreign keys into the states table) |
|
451 | - $script_4_1_defaults->insert_default_states(); |
|
452 | - $script_4_1_defaults->insert_default_countries(); |
|
453 | - //schema on price, price_types and tickets has changed so use the DEFAULT method in here instead of 4.1's and later. |
|
454 | - $this->insert_default_price_types(); |
|
455 | - $this->insert_default_prices(); |
|
456 | - $this->insert_default_tickets(); |
|
457 | - //setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre |
|
458 | - EE_Config::instance()->update_espresso_config(false, true); |
|
459 | - return true; |
|
460 | - } |
|
461 | - |
|
462 | - |
|
463 | - |
|
464 | - /** |
|
465 | - * @return boolean |
|
466 | - */ |
|
467 | - public function schema_changes_after_migration() |
|
468 | - { |
|
469 | - return true; |
|
470 | - } |
|
471 | - |
|
472 | - |
|
473 | - |
|
474 | - public function migration_page_hooks() |
|
475 | - { |
|
476 | - } |
|
477 | - |
|
478 | - |
|
479 | - |
|
480 | - /** |
|
481 | - * insert_default_price_types |
|
482 | - * |
|
483 | - * @since 4.5.0 |
|
484 | - * @return void |
|
485 | - */ |
|
486 | - public function insert_default_price_types() |
|
487 | - { |
|
488 | - global $wpdb; |
|
489 | - $price_type_table = $wpdb->prefix . "esp_price_type"; |
|
490 | - if ($this->_get_table_analysis()->tableExists($price_type_table)) { |
|
491 | - $SQL = 'SELECT COUNT(PRT_ID) FROM ' . $price_type_table; |
|
492 | - $price_types_exist = $wpdb->get_var($SQL); |
|
493 | - if ( ! $price_types_exist) { |
|
494 | - $user_id = EEH_Activation::get_default_creator_id(); |
|
495 | - $SQL = "INSERT INTO $price_type_table ( PRT_ID, PRT_name, PBT_ID, PRT_is_percent, PRT_order, PRT_wp_user, PRT_deleted ) VALUES |
|
448 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
449 | + $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
450 | + //(because many need to convert old string states to foreign keys into the states table) |
|
451 | + $script_4_1_defaults->insert_default_states(); |
|
452 | + $script_4_1_defaults->insert_default_countries(); |
|
453 | + //schema on price, price_types and tickets has changed so use the DEFAULT method in here instead of 4.1's and later. |
|
454 | + $this->insert_default_price_types(); |
|
455 | + $this->insert_default_prices(); |
|
456 | + $this->insert_default_tickets(); |
|
457 | + //setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre |
|
458 | + EE_Config::instance()->update_espresso_config(false, true); |
|
459 | + return true; |
|
460 | + } |
|
461 | + |
|
462 | + |
|
463 | + |
|
464 | + /** |
|
465 | + * @return boolean |
|
466 | + */ |
|
467 | + public function schema_changes_after_migration() |
|
468 | + { |
|
469 | + return true; |
|
470 | + } |
|
471 | + |
|
472 | + |
|
473 | + |
|
474 | + public function migration_page_hooks() |
|
475 | + { |
|
476 | + } |
|
477 | + |
|
478 | + |
|
479 | + |
|
480 | + /** |
|
481 | + * insert_default_price_types |
|
482 | + * |
|
483 | + * @since 4.5.0 |
|
484 | + * @return void |
|
485 | + */ |
|
486 | + public function insert_default_price_types() |
|
487 | + { |
|
488 | + global $wpdb; |
|
489 | + $price_type_table = $wpdb->prefix . "esp_price_type"; |
|
490 | + if ($this->_get_table_analysis()->tableExists($price_type_table)) { |
|
491 | + $SQL = 'SELECT COUNT(PRT_ID) FROM ' . $price_type_table; |
|
492 | + $price_types_exist = $wpdb->get_var($SQL); |
|
493 | + if ( ! $price_types_exist) { |
|
494 | + $user_id = EEH_Activation::get_default_creator_id(); |
|
495 | + $SQL = "INSERT INTO $price_type_table ( PRT_ID, PRT_name, PBT_ID, PRT_is_percent, PRT_order, PRT_wp_user, PRT_deleted ) VALUES |
|
496 | 496 | (1, '" . __('Base Price', 'event_espresso') . "', 1, 0, 0, $user_id, 0), |
497 | 497 | (2, '" . __('Percent Discount', 'event_espresso') . "', 2, 1, 20, $user_id, 0), |
498 | 498 | (3, '" . __('Dollar Discount', 'event_espresso') . "', 2, 0, 30, $user_id, 0), |
499 | 499 | (4, '" . __('Percent Surcharge', 'event_espresso') . "', 3, 1, 40, $user_id, 0), |
500 | 500 | (5, '" . __('Dollar Surcharge', 'event_espresso') . "', 3, 0, 50, $user_id, 0);"; |
501 | - $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL); |
|
502 | - $wpdb->query($SQL); |
|
503 | - } |
|
504 | - } |
|
505 | - } |
|
506 | - |
|
507 | - |
|
508 | - |
|
509 | - /** |
|
510 | - * insert DEFAULT prices. |
|
511 | - * If we're INSTALLING 4.x CAF, then we add a few extra DEFAULT prices |
|
512 | - * when EEH_Activaion's initialize_db_content is called via ahook in |
|
513 | - * EE_Brewing_regular |
|
514 | - * |
|
515 | - * @since 4.5.0 |
|
516 | - * @return void |
|
517 | - */ |
|
518 | - public function insert_default_prices() |
|
519 | - { |
|
520 | - global $wpdb; |
|
521 | - $price_table = $wpdb->prefix . "esp_price"; |
|
522 | - if ($this->_get_table_analysis()->tableExists($price_table)) { |
|
523 | - $SQL = 'SELECT COUNT(PRC_ID) FROM ' . $price_table; |
|
524 | - $prices_exist = $wpdb->get_var($SQL); |
|
525 | - if ( ! $prices_exist) { |
|
526 | - $user_id = EEH_Activation::get_default_creator_id(); |
|
527 | - $SQL = "INSERT INTO $price_table |
|
501 | + $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL); |
|
502 | + $wpdb->query($SQL); |
|
503 | + } |
|
504 | + } |
|
505 | + } |
|
506 | + |
|
507 | + |
|
508 | + |
|
509 | + /** |
|
510 | + * insert DEFAULT prices. |
|
511 | + * If we're INSTALLING 4.x CAF, then we add a few extra DEFAULT prices |
|
512 | + * when EEH_Activaion's initialize_db_content is called via ahook in |
|
513 | + * EE_Brewing_regular |
|
514 | + * |
|
515 | + * @since 4.5.0 |
|
516 | + * @return void |
|
517 | + */ |
|
518 | + public function insert_default_prices() |
|
519 | + { |
|
520 | + global $wpdb; |
|
521 | + $price_table = $wpdb->prefix . "esp_price"; |
|
522 | + if ($this->_get_table_analysis()->tableExists($price_table)) { |
|
523 | + $SQL = 'SELECT COUNT(PRC_ID) FROM ' . $price_table; |
|
524 | + $prices_exist = $wpdb->get_var($SQL); |
|
525 | + if ( ! $prices_exist) { |
|
526 | + $user_id = EEH_Activation::get_default_creator_id(); |
|
527 | + $SQL = "INSERT INTO $price_table |
|
528 | 528 | (PRC_ID, PRT_ID, PRC_amount, PRC_name, PRC_desc, PRC_is_default, PRC_overrides, PRC_wp_user, PRC_order, PRC_deleted, PRC_parent ) VALUES |
529 | 529 | (1, 1, '0.00', 'Free Admission', '', 1, NULL, $user_id, 0, 0, 0);"; |
530 | - $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_prices__SQL', $SQL); |
|
531 | - $wpdb->query($SQL); |
|
532 | - } |
|
533 | - } |
|
534 | - } |
|
535 | - |
|
536 | - |
|
537 | - |
|
538 | - /** |
|
539 | - * insert DEFAULT ticket |
|
540 | - * Almost identical to EE_DMS_Core_4_3_0::insert_default_tickets, except is aware of the TKT_wp_user field |
|
541 | - * |
|
542 | - * @since 4.5.0 |
|
543 | - * @return void |
|
544 | - */ |
|
545 | - public function insert_default_tickets() |
|
546 | - { |
|
547 | - global $wpdb; |
|
548 | - $ticket_table = $wpdb->prefix . "esp_ticket"; |
|
549 | - if ($this->_get_table_analysis()->tableExists($ticket_table)) { |
|
550 | - $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table; |
|
551 | - $tickets_exist = $wpdb->get_var($SQL); |
|
552 | - if ( ! $tickets_exist) { |
|
553 | - $user_id = EEH_Activation::get_default_creator_id(); |
|
554 | - $SQL = "INSERT INTO $ticket_table |
|
530 | + $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_prices__SQL', $SQL); |
|
531 | + $wpdb->query($SQL); |
|
532 | + } |
|
533 | + } |
|
534 | + } |
|
535 | + |
|
536 | + |
|
537 | + |
|
538 | + /** |
|
539 | + * insert DEFAULT ticket |
|
540 | + * Almost identical to EE_DMS_Core_4_3_0::insert_default_tickets, except is aware of the TKT_wp_user field |
|
541 | + * |
|
542 | + * @since 4.5.0 |
|
543 | + * @return void |
|
544 | + */ |
|
545 | + public function insert_default_tickets() |
|
546 | + { |
|
547 | + global $wpdb; |
|
548 | + $ticket_table = $wpdb->prefix . "esp_ticket"; |
|
549 | + if ($this->_get_table_analysis()->tableExists($ticket_table)) { |
|
550 | + $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table; |
|
551 | + $tickets_exist = $wpdb->get_var($SQL); |
|
552 | + if ( ! $tickets_exist) { |
|
553 | + $user_id = EEH_Activation::get_default_creator_id(); |
|
554 | + $SQL = "INSERT INTO $ticket_table |
|
555 | 555 | ( TKT_ID, TTM_ID, TKT_name, TKT_description, TKT_qty, TKT_sold, TKT_uses, TKT_required, TKT_min, TKT_max, TKT_price, TKT_start_date, TKT_end_date, TKT_taxable, TKT_order, TKT_row, TKT_is_default, TKT_parent, TKT_wp_user, TKT_deleted ) VALUES |
556 | 556 | ( 1, 0, '" |
557 | - . __("Free Ticket", "event_espresso") |
|
558 | - . "', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, $user_id, 0);"; |
|
559 | - $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL', $SQL); |
|
560 | - $wpdb->query($SQL); |
|
561 | - } |
|
562 | - } |
|
563 | - $ticket_price_table = $wpdb->prefix . "esp_ticket_price"; |
|
564 | - if ($this->_get_table_analysis()->tableExists($ticket_price_table)) { |
|
565 | - $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table; |
|
566 | - $ticket_prc_exist = $wpdb->get_var($SQL); |
|
567 | - if ( ! $ticket_prc_exist) { |
|
568 | - $SQL = "INSERT INTO $ticket_price_table |
|
557 | + . __("Free Ticket", "event_espresso") |
|
558 | + . "', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, $user_id, 0);"; |
|
559 | + $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL', $SQL); |
|
560 | + $wpdb->query($SQL); |
|
561 | + } |
|
562 | + } |
|
563 | + $ticket_price_table = $wpdb->prefix . "esp_ticket_price"; |
|
564 | + if ($this->_get_table_analysis()->tableExists($ticket_price_table)) { |
|
565 | + $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table; |
|
566 | + $ticket_prc_exist = $wpdb->get_var($SQL); |
|
567 | + if ( ! $ticket_prc_exist) { |
|
568 | + $SQL = "INSERT INTO $ticket_price_table |
|
569 | 569 | ( TKP_ID, TKT_ID, PRC_ID ) VALUES |
570 | 570 | ( 1, 1, 1 ) |
571 | 571 | "; |
572 | - $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL__ticket_price', $SQL); |
|
573 | - $wpdb->query($SQL); |
|
574 | - } |
|
575 | - } |
|
576 | - } |
|
572 | + $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL__ticket_price', $SQL); |
|
573 | + $wpdb->query($SQL); |
|
574 | + } |
|
575 | + } |
|
576 | + } |
|
577 | 577 | |
578 | 578 | } |
579 | 579 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | //unfortunately, this needs to be done upon INCLUSION of this file, |
14 | 14 | //instead of construction, because it only gets constructed on first page load |
15 | 15 | //(all other times it gets resurrected from a wordpress option) |
16 | -$stages = glob(EE_CORE . 'data_migration_scripts/4_5_0_stages/*'); |
|
16 | +$stages = glob(EE_CORE.'data_migration_scripts/4_5_0_stages/*'); |
|
17 | 17 | $class_to_filepath = array(); |
18 | 18 | foreach ($stages as $filepath) { |
19 | 19 | $matches = array(); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | } elseif ( ! $version_string) { |
63 | 63 | // echo "no version string provided: $version_string"; |
64 | 64 | //no version string provided... this must be pre 4.3 |
65 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
65 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
66 | 66 | } else { |
67 | 67 | // echo "$version_string doesnt apply"; |
68 | 68 | return false; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | public function schema_changes_before_migration() |
82 | 82 | { |
83 | 83 | //relies on 4.1's EEH_Activation::create_table |
84 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
84 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
85 | 85 | $table_name = 'esp_answer'; |
86 | 86 | $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
87 | 87 | REG_ID INT UNSIGNED NOT NULL, |
@@ -486,18 +486,18 @@ discard block |
||
486 | 486 | public function insert_default_price_types() |
487 | 487 | { |
488 | 488 | global $wpdb; |
489 | - $price_type_table = $wpdb->prefix . "esp_price_type"; |
|
489 | + $price_type_table = $wpdb->prefix."esp_price_type"; |
|
490 | 490 | if ($this->_get_table_analysis()->tableExists($price_type_table)) { |
491 | - $SQL = 'SELECT COUNT(PRT_ID) FROM ' . $price_type_table; |
|
491 | + $SQL = 'SELECT COUNT(PRT_ID) FROM '.$price_type_table; |
|
492 | 492 | $price_types_exist = $wpdb->get_var($SQL); |
493 | 493 | if ( ! $price_types_exist) { |
494 | 494 | $user_id = EEH_Activation::get_default_creator_id(); |
495 | 495 | $SQL = "INSERT INTO $price_type_table ( PRT_ID, PRT_name, PBT_ID, PRT_is_percent, PRT_order, PRT_wp_user, PRT_deleted ) VALUES |
496 | - (1, '" . __('Base Price', 'event_espresso') . "', 1, 0, 0, $user_id, 0), |
|
497 | - (2, '" . __('Percent Discount', 'event_espresso') . "', 2, 1, 20, $user_id, 0), |
|
498 | - (3, '" . __('Dollar Discount', 'event_espresso') . "', 2, 0, 30, $user_id, 0), |
|
499 | - (4, '" . __('Percent Surcharge', 'event_espresso') . "', 3, 1, 40, $user_id, 0), |
|
500 | - (5, '" . __('Dollar Surcharge', 'event_espresso') . "', 3, 0, 50, $user_id, 0);"; |
|
496 | + (1, '".__('Base Price', 'event_espresso')."', 1, 0, 0, $user_id, 0), |
|
497 | + (2, '".__('Percent Discount', 'event_espresso')."', 2, 1, 20, $user_id, 0), |
|
498 | + (3, '".__('Dollar Discount', 'event_espresso')."', 2, 0, 30, $user_id, 0), |
|
499 | + (4, '".__('Percent Surcharge', 'event_espresso')."', 3, 1, 40, $user_id, 0), |
|
500 | + (5, '".__('Dollar Surcharge', 'event_espresso')."', 3, 0, 50, $user_id, 0);"; |
|
501 | 501 | $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL); |
502 | 502 | $wpdb->query($SQL); |
503 | 503 | } |
@@ -518,9 +518,9 @@ discard block |
||
518 | 518 | public function insert_default_prices() |
519 | 519 | { |
520 | 520 | global $wpdb; |
521 | - $price_table = $wpdb->prefix . "esp_price"; |
|
521 | + $price_table = $wpdb->prefix."esp_price"; |
|
522 | 522 | if ($this->_get_table_analysis()->tableExists($price_table)) { |
523 | - $SQL = 'SELECT COUNT(PRC_ID) FROM ' . $price_table; |
|
523 | + $SQL = 'SELECT COUNT(PRC_ID) FROM '.$price_table; |
|
524 | 524 | $prices_exist = $wpdb->get_var($SQL); |
525 | 525 | if ( ! $prices_exist) { |
526 | 526 | $user_id = EEH_Activation::get_default_creator_id(); |
@@ -545,9 +545,9 @@ discard block |
||
545 | 545 | public function insert_default_tickets() |
546 | 546 | { |
547 | 547 | global $wpdb; |
548 | - $ticket_table = $wpdb->prefix . "esp_ticket"; |
|
548 | + $ticket_table = $wpdb->prefix."esp_ticket"; |
|
549 | 549 | if ($this->_get_table_analysis()->tableExists($ticket_table)) { |
550 | - $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table; |
|
550 | + $SQL = 'SELECT COUNT(TKT_ID) FROM '.$ticket_table; |
|
551 | 551 | $tickets_exist = $wpdb->get_var($SQL); |
552 | 552 | if ( ! $tickets_exist) { |
553 | 553 | $user_id = EEH_Activation::get_default_creator_id(); |
@@ -560,9 +560,9 @@ discard block |
||
560 | 560 | $wpdb->query($SQL); |
561 | 561 | } |
562 | 562 | } |
563 | - $ticket_price_table = $wpdb->prefix . "esp_ticket_price"; |
|
563 | + $ticket_price_table = $wpdb->prefix."esp_ticket_price"; |
|
564 | 564 | if ($this->_get_table_analysis()->tableExists($ticket_price_table)) { |
565 | - $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table; |
|
565 | + $SQL = 'SELECT COUNT(TKP_ID) FROM '.$ticket_price_table; |
|
566 | 566 | $ticket_prc_exist = $wpdb->get_var($SQL); |
567 | 567 | if ( ! $ticket_prc_exist) { |
568 | 568 | $SQL = "INSERT INTO $ticket_price_table |
@@ -9,7 +9,6 @@ discard block |
||
9 | 9 | * and recalculates esp_registration.REG_final_price to actually be the final price |
10 | 10 | * for that registration (before this it was just the ticket's price, NOT including |
11 | 11 | * taxes or other price modifiers) |
12 | - |
|
13 | 12 | */ |
14 | 13 | // make sure we have all the stages loaded too |
15 | 14 | // unfortunately, this needs to be done upon INCLUSION of this file, |
@@ -18,9 +17,9 @@ discard block |
||
18 | 17 | $stages = glob(EE_CORE . 'data_migration_scripts/4_7_0_stages/*'); |
19 | 18 | $class_to_filepath = array(); |
20 | 19 | foreach ($stages as $filepath) { |
21 | - $matches = array(); |
|
22 | - preg_match('~4_7_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
23 | - $class_to_filepath[$matches[1]] = $filepath; |
|
20 | + $matches = array(); |
|
21 | + preg_match('~4_7_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
22 | + $class_to_filepath[$matches[1]] = $filepath; |
|
24 | 23 | } |
25 | 24 | //give addons a chance to autoload their stages too |
26 | 25 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_7_0__autoloaded_stages', $class_to_filepath); |
@@ -39,82 +38,82 @@ discard block |
||
39 | 38 | class EE_DMS_Core_4_7_0 extends EE_Data_Migration_Script_Base |
40 | 39 | { |
41 | 40 | |
42 | - /** |
|
43 | - * return EE_DMS_Core_4_7_0 |
|
44 | - * |
|
45 | - * @param TableManager $table_manager |
|
46 | - * @param TableAnalysis $table_analysis |
|
47 | - */ |
|
48 | - public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
49 | - { |
|
50 | - $this->_pretty_name = __("Data Migration to Event Espresso 4.7.0.p", "event_espresso"); |
|
51 | - $this->_priority = 10; |
|
52 | - $this->_migration_stages = array( |
|
53 | - new EE_DMS_4_7_0_Add_Taxes_To_REG_Final_Price(), |
|
54 | - new EE_DMS_4_7_0_Registration_Payments(), |
|
55 | - ); |
|
56 | - parent::__construct($table_manager, $table_analysis); |
|
57 | - } |
|
41 | + /** |
|
42 | + * return EE_DMS_Core_4_7_0 |
|
43 | + * |
|
44 | + * @param TableManager $table_manager |
|
45 | + * @param TableAnalysis $table_analysis |
|
46 | + */ |
|
47 | + public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
48 | + { |
|
49 | + $this->_pretty_name = __("Data Migration to Event Espresso 4.7.0.p", "event_espresso"); |
|
50 | + $this->_priority = 10; |
|
51 | + $this->_migration_stages = array( |
|
52 | + new EE_DMS_4_7_0_Add_Taxes_To_REG_Final_Price(), |
|
53 | + new EE_DMS_4_7_0_Registration_Payments(), |
|
54 | + ); |
|
55 | + parent::__construct($table_manager, $table_analysis); |
|
56 | + } |
|
58 | 57 | |
59 | 58 | |
60 | 59 | |
61 | - /** |
|
62 | - * @param array $version_array |
|
63 | - * @return bool |
|
64 | - */ |
|
65 | - public function can_migrate_from_version($version_array) |
|
66 | - { |
|
67 | - $version_string = $version_array['Core']; |
|
68 | - if ( |
|
69 | - ( |
|
70 | - version_compare($version_string, '4.7.0', '<=') |
|
71 | - && version_compare($version_string, '4.6.0', '>=') |
|
72 | - ) |
|
73 | - || ( |
|
74 | - version_compare($version_string, '4.7.0', '>=') |
|
75 | - && ! $this->_get_table_analysis()->tableExists('esp_registration_payment') |
|
76 | - && $this->_get_table_analysis()->tableExists('esp_registration') |
|
77 | - ) |
|
78 | - ) { |
|
79 | - return true; |
|
80 | - } elseif ( ! $version_string) { |
|
81 | - //no version string provided... this must be pre 4.3 |
|
82 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
83 | - } else { |
|
84 | - return false; |
|
85 | - } |
|
86 | - } |
|
60 | + /** |
|
61 | + * @param array $version_array |
|
62 | + * @return bool |
|
63 | + */ |
|
64 | + public function can_migrate_from_version($version_array) |
|
65 | + { |
|
66 | + $version_string = $version_array['Core']; |
|
67 | + if ( |
|
68 | + ( |
|
69 | + version_compare($version_string, '4.7.0', '<=') |
|
70 | + && version_compare($version_string, '4.6.0', '>=') |
|
71 | + ) |
|
72 | + || ( |
|
73 | + version_compare($version_string, '4.7.0', '>=') |
|
74 | + && ! $this->_get_table_analysis()->tableExists('esp_registration_payment') |
|
75 | + && $this->_get_table_analysis()->tableExists('esp_registration') |
|
76 | + ) |
|
77 | + ) { |
|
78 | + return true; |
|
79 | + } elseif ( ! $version_string) { |
|
80 | + //no version string provided... this must be pre 4.3 |
|
81 | + return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
82 | + } else { |
|
83 | + return false; |
|
84 | + } |
|
85 | + } |
|
87 | 86 | |
88 | 87 | |
89 | 88 | |
90 | - /** |
|
91 | - * @return string|void |
|
92 | - */ |
|
93 | - public function pretty_name() |
|
94 | - { |
|
95 | - return __("Core Data Migration to version 4.7.0", "event_espresso"); |
|
96 | - } |
|
89 | + /** |
|
90 | + * @return string|void |
|
91 | + */ |
|
92 | + public function pretty_name() |
|
93 | + { |
|
94 | + return __("Core Data Migration to version 4.7.0", "event_espresso"); |
|
95 | + } |
|
97 | 96 | |
98 | 97 | |
99 | 98 | |
100 | - /** |
|
101 | - * @return bool |
|
102 | - */ |
|
103 | - public function schema_changes_before_migration() |
|
104 | - { |
|
105 | - //relies on 4.1's EEH_Activation::create_table |
|
106 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
107 | - $table_name = 'esp_answer'; |
|
108 | - $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
99 | + /** |
|
100 | + * @return bool |
|
101 | + */ |
|
102 | + public function schema_changes_before_migration() |
|
103 | + { |
|
104 | + //relies on 4.1's EEH_Activation::create_table |
|
105 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
106 | + $table_name = 'esp_answer'; |
|
107 | + $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
109 | 108 | REG_ID INT UNSIGNED NOT NULL, |
110 | 109 | QST_ID INT UNSIGNED NOT NULL, |
111 | 110 | ANS_value TEXT NOT NULL, |
112 | 111 | PRIMARY KEY (ANS_ID), |
113 | 112 | KEY REG_ID (REG_ID), |
114 | 113 | KEY QST_ID (QST_ID)"; |
115 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
116 | - $table_name = 'esp_attendee_meta'; |
|
117 | - $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
114 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
115 | + $table_name = 'esp_attendee_meta'; |
|
116 | + $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
118 | 117 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
119 | 118 | ATT_fname VARCHAR(45) NOT NULL, |
120 | 119 | ATT_lname VARCHAR(45) NOT NULL, |
@@ -131,9 +130,9 @@ discard block |
||
131 | 130 | KEY ATT_email (ATT_email), |
132 | 131 | KEY ATT_lname (ATT_lname), |
133 | 132 | KEY ATT_fname (ATT_fname)"; |
134 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
135 | - $table_name = 'esp_country'; |
|
136 | - $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
133 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
134 | + $table_name = 'esp_country'; |
|
135 | + $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
137 | 136 | CNT_ISO3 VARCHAR(3) COLLATE utf8_bin NOT NULL, |
138 | 137 | RGN_ID TINYINT(3) UNSIGNED DEFAULT NULL, |
139 | 138 | CNT_name VARCHAR(45) COLLATE utf8_bin NOT NULL, |
@@ -149,25 +148,25 @@ discard block |
||
149 | 148 | CNT_is_EU TINYINT(1) DEFAULT '0', |
150 | 149 | CNT_active TINYINT(1) DEFAULT '0', |
151 | 150 | PRIMARY KEY (CNT_ISO)"; |
152 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
153 | - $table_name = 'esp_currency'; |
|
154 | - $sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
|
151 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
152 | + $table_name = 'esp_currency'; |
|
153 | + $sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
|
155 | 154 | CUR_single VARCHAR(45) COLLATE utf8_bin DEFAULT 'dollar', |
156 | 155 | CUR_plural VARCHAR(45) COLLATE utf8_bin DEFAULT 'dollars', |
157 | 156 | CUR_sign VARCHAR(45) COLLATE utf8_bin DEFAULT '$', |
158 | 157 | CUR_dec_plc VARCHAR(1) COLLATE utf8_bin NOT NULL DEFAULT '2', |
159 | 158 | CUR_active TINYINT(1) DEFAULT '0', |
160 | 159 | PRIMARY KEY (CUR_code)"; |
161 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
162 | - $table_name = 'esp_currency_payment_method'; |
|
163 | - $sql = "CPM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
160 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
161 | + $table_name = 'esp_currency_payment_method'; |
|
162 | + $sql = "CPM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
164 | 163 | CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
165 | 164 | PMD_ID INT(11) NOT NULL, |
166 | 165 | PRIMARY KEY (CPM_ID), |
167 | 166 | KEY PMD_ID (PMD_ID)"; |
168 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
169 | - $table_name = 'esp_datetime'; |
|
170 | - $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
167 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
168 | + $table_name = 'esp_datetime'; |
|
169 | + $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
171 | 170 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
172 | 171 | DTT_name VARCHAR(255) NOT NULL DEFAULT '', |
173 | 172 | DTT_description TEXT NOT NULL, |
@@ -183,9 +182,9 @@ discard block |
||
183 | 182 | KEY DTT_EVT_start (DTT_EVT_start), |
184 | 183 | KEY EVT_ID (EVT_ID), |
185 | 184 | KEY DTT_is_primary (DTT_is_primary)"; |
186 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
187 | - $table_name = 'esp_event_meta'; |
|
188 | - $sql = " |
|
185 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
186 | + $table_name = 'esp_event_meta'; |
|
187 | + $sql = " |
|
189 | 188 | EVTM_ID INT NOT NULL AUTO_INCREMENT, |
190 | 189 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
191 | 190 | EVT_display_desc TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -201,34 +200,34 @@ discard block |
||
201 | 200 | EVT_donations TINYINT(1) NULL, |
202 | 201 | PRIMARY KEY (EVTM_ID), |
203 | 202 | KEY EVT_ID (EVT_ID)"; |
204 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
205 | - $table_name = 'esp_event_question_group'; |
|
206 | - $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
203 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
204 | + $table_name = 'esp_event_question_group'; |
|
205 | + $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
207 | 206 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
208 | 207 | QSG_ID INT UNSIGNED NOT NULL, |
209 | 208 | EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
210 | 209 | PRIMARY KEY (EQG_ID), |
211 | 210 | KEY EVT_ID (EVT_ID), |
212 | 211 | KEY QSG_ID (QSG_ID)"; |
213 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
214 | - $table_name = 'esp_event_venue'; |
|
215 | - $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
212 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
213 | + $table_name = 'esp_event_venue'; |
|
214 | + $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
216 | 215 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
217 | 216 | VNU_ID BIGINT(20) UNSIGNED NOT NULL, |
218 | 217 | EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
219 | 218 | PRIMARY KEY (EVV_ID)"; |
220 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
221 | - $table_name = 'esp_extra_meta'; |
|
222 | - $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
219 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
220 | + $table_name = 'esp_extra_meta'; |
|
221 | + $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
223 | 222 | OBJ_ID INT(11) DEFAULT NULL, |
224 | 223 | EXM_type VARCHAR(45) DEFAULT NULL, |
225 | 224 | EXM_key VARCHAR(45) DEFAULT NULL, |
226 | 225 | EXM_value TEXT, |
227 | 226 | PRIMARY KEY (EXM_ID), |
228 | 227 | KEY EXM_type (EXM_type, OBJ_ID, EXM_key(45))"; |
229 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
230 | - $table_name = 'esp_line_item'; |
|
231 | - $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
228 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
229 | + $table_name = 'esp_line_item'; |
|
230 | + $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
232 | 231 | LIN_code VARCHAR(245) NOT NULL DEFAULT '', |
233 | 232 | TXN_ID INT(11) DEFAULT NULL, |
234 | 233 | LIN_name VARCHAR(245) NOT NULL DEFAULT '', |
@@ -246,9 +245,9 @@ discard block |
||
246 | 245 | PRIMARY KEY (LIN_ID), |
247 | 246 | KEY LIN_code (LIN_code(191)), |
248 | 247 | KEY TXN_ID (TXN_ID)"; |
249 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
250 | - $table_name = 'esp_log'; |
|
251 | - $sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
248 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
249 | + $table_name = 'esp_log'; |
|
250 | + $sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
252 | 251 | LOG_time DATETIME DEFAULT NULL, |
253 | 252 | OBJ_ID VARCHAR(45) DEFAULT NULL, |
254 | 253 | OBJ_type VARCHAR(45) DEFAULT NULL, |
@@ -259,18 +258,18 @@ discard block |
||
259 | 258 | KEY LOG_time (LOG_time), |
260 | 259 | KEY OBJ (OBJ_type,OBJ_ID), |
261 | 260 | KEY LOG_type (LOG_type)"; |
262 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
263 | - $table_name = 'esp_message_template'; |
|
264 | - $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
261 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
262 | + $table_name = 'esp_message_template'; |
|
263 | + $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
265 | 264 | GRP_ID INT(10) UNSIGNED NOT NULL, |
266 | 265 | MTP_context VARCHAR(50) NOT NULL, |
267 | 266 | MTP_template_field VARCHAR(30) NOT NULL, |
268 | 267 | MTP_content TEXT NOT NULL, |
269 | 268 | PRIMARY KEY (MTP_ID), |
270 | 269 | KEY GRP_ID (GRP_ID)"; |
271 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
272 | - $table_name = 'esp_message_template_group'; |
|
273 | - $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
270 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
271 | + $table_name = 'esp_message_template_group'; |
|
272 | + $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
274 | 273 | MTP_user_id INT(10) NOT NULL DEFAULT '1', |
275 | 274 | MTP_name VARCHAR(245) NOT NULL DEFAULT '', |
276 | 275 | MTP_description VARCHAR(245) NOT NULL DEFAULT '', |
@@ -282,17 +281,17 @@ discard block |
||
282 | 281 | MTP_is_active TINYINT(1) NOT NULL DEFAULT '1', |
283 | 282 | PRIMARY KEY (GRP_ID), |
284 | 283 | KEY MTP_user_id (MTP_user_id)"; |
285 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
286 | - $table_name = 'esp_event_message_template'; |
|
287 | - $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
284 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
285 | + $table_name = 'esp_event_message_template'; |
|
286 | + $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
288 | 287 | EVT_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
289 | 288 | GRP_ID INT(10) UNSIGNED NOT NULL DEFAULT 0, |
290 | 289 | PRIMARY KEY (EMT_ID), |
291 | 290 | KEY EVT_ID (EVT_ID), |
292 | 291 | KEY GRP_ID (GRP_ID)"; |
293 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
294 | - $table_name = 'esp_payment'; |
|
295 | - $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
292 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
293 | + $table_name = 'esp_payment'; |
|
294 | + $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
296 | 295 | TXN_ID INT(10) UNSIGNED DEFAULT NULL, |
297 | 296 | STS_ID VARCHAR(3) COLLATE utf8_bin DEFAULT NULL, |
298 | 297 | PAY_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -309,9 +308,9 @@ discard block |
||
309 | 308 | PRIMARY KEY (PAY_ID), |
310 | 309 | KEY PAY_timestamp (PAY_timestamp), |
311 | 310 | KEY TXN_ID (TXN_ID)"; |
312 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
313 | - $table_name = 'esp_payment_method'; |
|
314 | - $sql = "PMD_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
311 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
312 | + $table_name = 'esp_payment_method'; |
|
313 | + $sql = "PMD_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
315 | 314 | PMD_type VARCHAR(124) DEFAULT NULL, |
316 | 315 | PMD_name VARCHAR(255) DEFAULT NULL, |
317 | 316 | PMD_desc TEXT, |
@@ -327,32 +326,32 @@ discard block |
||
327 | 326 | PRIMARY KEY (PMD_ID), |
328 | 327 | UNIQUE KEY PMD_slug_UNIQUE (PMD_slug), |
329 | 328 | KEY PMD_type (PMD_type)"; |
330 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
331 | - $table_name = "esp_ticket_price"; |
|
332 | - $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
329 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
330 | + $table_name = "esp_ticket_price"; |
|
331 | + $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
333 | 332 | TKT_ID INT(10) UNSIGNED NOT NULL, |
334 | 333 | PRC_ID INT(10) UNSIGNED NOT NULL, |
335 | 334 | PRIMARY KEY (TKP_ID), |
336 | 335 | KEY TKT_ID (TKT_ID), |
337 | 336 | KEY PRC_ID (PRC_ID)"; |
338 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
339 | - $table_name = "esp_datetime_ticket"; |
|
340 | - $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
337 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
338 | + $table_name = "esp_datetime_ticket"; |
|
339 | + $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
341 | 340 | DTT_ID INT(10) UNSIGNED NOT NULL, |
342 | 341 | TKT_ID INT(10) UNSIGNED NOT NULL, |
343 | 342 | PRIMARY KEY (DTK_ID), |
344 | 343 | KEY DTT_ID (DTT_ID), |
345 | 344 | KEY TKT_ID (TKT_ID)"; |
346 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
347 | - $table_name = "esp_ticket_template"; |
|
348 | - $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
345 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
346 | + $table_name = "esp_ticket_template"; |
|
347 | + $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
349 | 348 | TTM_name VARCHAR(45) NOT NULL, |
350 | 349 | TTM_description TEXT, |
351 | 350 | TTM_file VARCHAR(45), |
352 | 351 | PRIMARY KEY (TTM_ID)"; |
353 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
354 | - $table_name = 'esp_question'; |
|
355 | - $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
352 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
353 | + $table_name = 'esp_question'; |
|
354 | + $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
356 | 355 | QST_display_text TEXT NOT NULL, |
357 | 356 | QST_admin_label VARCHAR(255) NOT NULL, |
358 | 357 | QST_system VARCHAR(25) DEFAULT NULL, |
@@ -365,18 +364,18 @@ discard block |
||
365 | 364 | QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0, |
366 | 365 | PRIMARY KEY (QST_ID), |
367 | 366 | KEY QST_order (QST_order)'; |
368 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
369 | - $table_name = 'esp_question_group_question'; |
|
370 | - $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
367 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
368 | + $table_name = 'esp_question_group_question'; |
|
369 | + $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
371 | 370 | QSG_ID INT UNSIGNED NOT NULL, |
372 | 371 | QST_ID INT UNSIGNED NOT NULL, |
373 | 372 | QGQ_order INT UNSIGNED NOT NULL DEFAULT 0, |
374 | 373 | PRIMARY KEY (QGQ_ID), |
375 | 374 | KEY QST_ID (QST_ID), |
376 | 375 | KEY QSG_ID_order (QSG_ID, QGQ_order)"; |
377 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
378 | - $table_name = 'esp_question_option'; |
|
379 | - $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
376 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
377 | + $table_name = 'esp_question_option'; |
|
378 | + $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
380 | 379 | QSO_value VARCHAR(255) NOT NULL, |
381 | 380 | QSO_desc TEXT NOT NULL, |
382 | 381 | QST_ID INT UNSIGNED NOT NULL, |
@@ -385,9 +384,9 @@ discard block |
||
385 | 384 | PRIMARY KEY (QSO_ID), |
386 | 385 | KEY QST_ID (QST_ID), |
387 | 386 | KEY QSO_order (QSO_order)"; |
388 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
389 | - $table_name = 'esp_registration'; |
|
390 | - $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
387 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
388 | + $table_name = 'esp_registration'; |
|
389 | + $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
391 | 390 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
392 | 391 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
393 | 392 | TXN_ID INT(10) UNSIGNED NOT NULL, |
@@ -411,18 +410,18 @@ discard block |
||
411 | 410 | KEY TKT_ID (TKT_ID), |
412 | 411 | KEY EVT_ID (EVT_ID), |
413 | 412 | KEY STS_ID (STS_ID)"; |
414 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
415 | - $table_name = 'esp_registration_payment'; |
|
416 | - $sql = "RPY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
413 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
414 | + $table_name = 'esp_registration_payment'; |
|
415 | + $sql = "RPY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
417 | 416 | REG_ID INT(10) UNSIGNED NOT NULL, |
418 | 417 | PAY_ID INT(10) UNSIGNED NULL, |
419 | 418 | RPY_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
420 | 419 | PRIMARY KEY (RPY_ID), |
421 | 420 | KEY REG_ID (REG_ID), |
422 | 421 | KEY PAY_ID (PAY_ID)"; |
423 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
424 | - $table_name = 'esp_checkin'; |
|
425 | - $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
422 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
423 | + $table_name = 'esp_checkin'; |
|
424 | + $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
426 | 425 | REG_ID INT(10) UNSIGNED NOT NULL, |
427 | 426 | DTT_ID INT(10) UNSIGNED NOT NULL, |
428 | 427 | CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -430,9 +429,9 @@ discard block |
||
430 | 429 | PRIMARY KEY (CHK_ID), |
431 | 430 | KEY REG_ID (REG_ID), |
432 | 431 | KEY DTT_ID (DTT_ID)"; |
433 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
434 | - $table_name = 'esp_state'; |
|
435 | - $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
432 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
433 | + $table_name = 'esp_state'; |
|
434 | + $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
436 | 435 | CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
437 | 436 | STA_abbrev VARCHAR(24) COLLATE utf8_bin NOT NULL, |
438 | 437 | STA_name VARCHAR(100) COLLATE utf8_bin NOT NULL, |
@@ -440,9 +439,9 @@ discard block |
||
440 | 439 | PRIMARY KEY (STA_ID), |
441 | 440 | KEY STA_abbrev (STA_abbrev), |
442 | 441 | KEY CNT_ISO (CNT_ISO)"; |
443 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
444 | - $table_name = 'esp_status'; |
|
445 | - $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
442 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
443 | + $table_name = 'esp_status'; |
|
444 | + $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
446 | 445 | STS_code VARCHAR(45) COLLATE utf8_bin NOT NULL, |
447 | 446 | STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL, |
448 | 447 | STS_can_edit TINYINT(1) NOT NULL DEFAULT 0, |
@@ -450,9 +449,9 @@ discard block |
||
450 | 449 | STS_open TINYINT(1) NOT NULL DEFAULT 1, |
451 | 450 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
452 | 451 | KEY STS_type (STS_type)"; |
453 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
454 | - $table_name = 'esp_transaction'; |
|
455 | - $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
452 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
453 | + $table_name = 'esp_transaction'; |
|
454 | + $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
456 | 455 | TXN_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
457 | 456 | TXN_total DECIMAL(10,3) DEFAULT '0.00', |
458 | 457 | TXN_paid DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
@@ -464,9 +463,9 @@ discard block |
||
464 | 463 | PRIMARY KEY (TXN_ID), |
465 | 464 | KEY TXN_timestamp (TXN_timestamp), |
466 | 465 | KEY STS_ID (STS_ID)"; |
467 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
468 | - $table_name = 'esp_venue_meta'; |
|
469 | - $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
466 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
467 | + $table_name = 'esp_venue_meta'; |
|
468 | + $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
470 | 469 | VNU_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
471 | 470 | VNU_address VARCHAR(255) DEFAULT NULL, |
472 | 471 | VNU_address2 VARCHAR(255) DEFAULT NULL, |
@@ -485,10 +484,10 @@ discard block |
||
485 | 484 | KEY VNU_ID (VNU_ID), |
486 | 485 | KEY STA_ID (STA_ID), |
487 | 486 | KEY CNT_ISO (CNT_ISO)"; |
488 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
489 | - //modified tables |
|
490 | - $table_name = "esp_price"; |
|
491 | - $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
487 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
488 | + //modified tables |
|
489 | + $table_name = "esp_price"; |
|
490 | + $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
492 | 491 | PRT_ID TINYINT(3) UNSIGNED NOT NULL, |
493 | 492 | PRC_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
494 | 493 | PRC_name VARCHAR(245) NOT NULL, |
@@ -501,9 +500,9 @@ discard block |
||
501 | 500 | PRC_parent INT(10) UNSIGNED DEFAULT 0, |
502 | 501 | PRIMARY KEY (PRC_ID), |
503 | 502 | KEY PRT_ID (PRT_ID)"; |
504 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
505 | - $table_name = "esp_price_type"; |
|
506 | - $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
503 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
504 | + $table_name = "esp_price_type"; |
|
505 | + $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
507 | 506 | PRT_name VARCHAR(45) NOT NULL, |
508 | 507 | PBT_ID TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', |
509 | 508 | PRT_is_percent TINYINT(1) NOT NULL DEFAULT '0', |
@@ -512,9 +511,9 @@ discard block |
||
512 | 511 | PRT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
513 | 512 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
514 | 513 | PRIMARY KEY (PRT_ID)"; |
515 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
516 | - $table_name = "esp_ticket"; |
|
517 | - $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
514 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
515 | + $table_name = "esp_ticket"; |
|
516 | + $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
518 | 517 | TTM_ID INT(10) UNSIGNED NOT NULL, |
519 | 518 | TKT_name VARCHAR(245) NOT NULL DEFAULT '', |
520 | 519 | TKT_description TEXT NOT NULL, |
@@ -536,9 +535,9 @@ discard block |
||
536 | 535 | TKT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
537 | 536 | PRIMARY KEY (TKT_ID), |
538 | 537 | KEY TKT_start_date (TKT_start_date)"; |
539 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
540 | - $table_name = 'esp_question_group'; |
|
541 | - $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
538 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
539 | + $table_name = 'esp_question_group'; |
|
540 | + $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
542 | 541 | QSG_name VARCHAR(255) NOT NULL, |
543 | 542 | QSG_identifier VARCHAR(100) NOT NULL, |
544 | 543 | QSG_desc TEXT NULL, |
@@ -551,38 +550,38 @@ discard block |
||
551 | 550 | PRIMARY KEY (QSG_ID), |
552 | 551 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier), |
553 | 552 | KEY QSG_order (QSG_order)'; |
554 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
555 | - /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
556 | - $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
557 | - //(because many need to convert old string states to foreign keys into the states table) |
|
558 | - $script_4_1_defaults->insert_default_states(); |
|
559 | - $script_4_1_defaults->insert_default_countries(); |
|
560 | - /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
561 | - $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
562 | - $script_4_5_defaults->insert_default_price_types(); |
|
563 | - $script_4_5_defaults->insert_default_prices(); |
|
564 | - $script_4_5_defaults->insert_default_tickets(); |
|
565 | - /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */ |
|
566 | - $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0'); |
|
567 | - $script_4_6_defaults->add_default_admin_only_payments(); |
|
568 | - $script_4_6_defaults->insert_default_currencies(); |
|
569 | - return true; |
|
570 | - } |
|
553 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
554 | + /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
555 | + $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
556 | + //(because many need to convert old string states to foreign keys into the states table) |
|
557 | + $script_4_1_defaults->insert_default_states(); |
|
558 | + $script_4_1_defaults->insert_default_countries(); |
|
559 | + /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
560 | + $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
561 | + $script_4_5_defaults->insert_default_price_types(); |
|
562 | + $script_4_5_defaults->insert_default_prices(); |
|
563 | + $script_4_5_defaults->insert_default_tickets(); |
|
564 | + /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */ |
|
565 | + $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0'); |
|
566 | + $script_4_6_defaults->add_default_admin_only_payments(); |
|
567 | + $script_4_6_defaults->insert_default_currencies(); |
|
568 | + return true; |
|
569 | + } |
|
571 | 570 | |
572 | 571 | |
573 | 572 | |
574 | - /** |
|
575 | - * @return boolean |
|
576 | - */ |
|
577 | - public function schema_changes_after_migration() |
|
578 | - { |
|
579 | - return true; |
|
580 | - } |
|
573 | + /** |
|
574 | + * @return boolean |
|
575 | + */ |
|
576 | + public function schema_changes_after_migration() |
|
577 | + { |
|
578 | + return true; |
|
579 | + } |
|
581 | 580 | |
582 | 581 | |
583 | 582 | |
584 | - public function migration_page_hooks() |
|
585 | - { |
|
586 | - } |
|
583 | + public function migration_page_hooks() |
|
584 | + { |
|
585 | + } |
|
587 | 586 | } |
588 | 587 | // end of file: /core/data_migration_scripts/EE_DMS_Core_4_7_0.dms.php |
589 | 588 | \ No newline at end of file |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | // unfortunately, this needs to be done upon INCLUSION of this file, |
16 | 16 | // instead of construction, because it only gets constructed on first page load |
17 | 17 | // (all other times it gets resurrected from a wordpress option) |
18 | -$stages = glob(EE_CORE . 'data_migration_scripts/4_7_0_stages/*'); |
|
18 | +$stages = glob(EE_CORE.'data_migration_scripts/4_7_0_stages/*'); |
|
19 | 19 | $class_to_filepath = array(); |
20 | 20 | foreach ($stages as $filepath) { |
21 | 21 | $matches = array(); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | return true; |
80 | 80 | } elseif ( ! $version_string) { |
81 | 81 | //no version string provided... this must be pre 4.3 |
82 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
82 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
83 | 83 | } else { |
84 | 84 | return false; |
85 | 85 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | public function schema_changes_before_migration() |
104 | 104 | { |
105 | 105 | //relies on 4.1's EEH_Activation::create_table |
106 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
106 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
107 | 107 | $table_name = 'esp_answer'; |
108 | 108 | $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
109 | 109 | REG_ID INT UNSIGNED NOT NULL, |
@@ -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 |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * @link {@link http://www.eventespresso.com} |
40 | 40 | * @since 4.0 |
41 | 41 | */ |
42 | -if ( function_exists( 'espresso_version' ) ) { |
|
42 | +if (function_exists('espresso_version')) { |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * espresso_duplicate_plugin_error |
@@ -56,15 +56,15 @@ discard block |
||
56 | 56 | </p> |
57 | 57 | </div> |
58 | 58 | <?php |
59 | - espresso_deactivate_plugin( plugin_basename( __FILE__ ) ); |
|
59 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
60 | 60 | } |
61 | - add_action( 'admin_notices', 'espresso_duplicate_plugin_error', 1 ); |
|
61 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
62 | 62 | |
63 | 63 | } else { |
64 | 64 | |
65 | - define( 'EE_MIN_PHP_VER_REQUIRED', '5.3.0' ); |
|
65 | + define('EE_MIN_PHP_VER_REQUIRED', '5.3.0'); |
|
66 | 66 | |
67 | - if ( ! version_compare( PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=' ) ) { |
|
67 | + if ( ! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
68 | 68 | |
69 | 69 | /** |
70 | 70 | * espresso_minimum_php_version_error |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | </p> |
91 | 91 | </div> |
92 | 92 | <?php |
93 | - espresso_deactivate_plugin( plugin_basename( __FILE__ ) ); |
|
93 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
94 | 94 | } |
95 | - add_action( 'admin_notices', 'espresso_minimum_php_version_error', 1 ); |
|
95 | + add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
96 | 96 | |
97 | 97 | } else { |
98 | 98 | |
@@ -103,99 +103,99 @@ discard block |
||
103 | 103 | * @return string |
104 | 104 | */ |
105 | 105 | function espresso_version() { |
106 | - return apply_filters( 'FHEE__espresso__espresso_version', '4.9.22.rc.002' ); |
|
106 | + return apply_filters('FHEE__espresso__espresso_version', '4.9.22.rc.002'); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | // define versions |
110 | - define( 'EVENT_ESPRESSO_VERSION', espresso_version() ); |
|
111 | - define( 'EE_MIN_WP_VER_REQUIRED', '4.1' ); |
|
112 | - define( 'EE_MIN_WP_VER_RECOMMENDED', '4.4.2' ); |
|
113 | - define( 'EE_MIN_PHP_VER_RECOMMENDED', '5.4.44' ); |
|
114 | - define( 'EVENT_ESPRESSO_MAIN_FILE', __FILE__ ); |
|
110 | + define('EVENT_ESPRESSO_VERSION', espresso_version()); |
|
111 | + define('EE_MIN_WP_VER_REQUIRED', '4.1'); |
|
112 | + define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2'); |
|
113 | + define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44'); |
|
114 | + define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
115 | 115 | |
116 | 116 | //used to be DIRECTORY_SEPARATOR, but that caused issues on windows |
117 | - if ( ! defined( 'DS' ) ) { |
|
118 | - define( 'DS', '/' ); |
|
117 | + if ( ! defined('DS')) { |
|
118 | + define('DS', '/'); |
|
119 | 119 | } |
120 | - if ( ! defined( 'PS' ) ) { |
|
121 | - define( 'PS', PATH_SEPARATOR ); |
|
120 | + if ( ! defined('PS')) { |
|
121 | + define('PS', PATH_SEPARATOR); |
|
122 | 122 | } |
123 | - if ( ! defined( 'SP' ) ) { |
|
124 | - define( 'SP', ' ' ); |
|
123 | + if ( ! defined('SP')) { |
|
124 | + define('SP', ' '); |
|
125 | 125 | } |
126 | - if ( ! defined( 'EENL' ) ) { |
|
127 | - define( 'EENL', "\n" ); |
|
126 | + if ( ! defined('EENL')) { |
|
127 | + define('EENL', "\n"); |
|
128 | 128 | } |
129 | - define( 'EE_SUPPORT_EMAIL', '[email protected]' ); |
|
129 | + define('EE_SUPPORT_EMAIL', '[email protected]'); |
|
130 | 130 | // define the plugin directory and URL |
131 | - define( 'EE_PLUGIN_BASENAME', plugin_basename( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
132 | - define( 'EE_PLUGIN_DIR_PATH', plugin_dir_path( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
133 | - define( 'EE_PLUGIN_DIR_URL', plugin_dir_url( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
131 | + define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE)); |
|
132 | + define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE)); |
|
133 | + define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE)); |
|
134 | 134 | // main root folder paths |
135 | - define( 'EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS ); |
|
136 | - define( 'EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS ); |
|
137 | - define( 'EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS ); |
|
138 | - define( 'EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS ); |
|
139 | - define( 'EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS ); |
|
140 | - define( 'EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS ); |
|
141 | - define( 'EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS ); |
|
142 | - define( 'EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS ); |
|
135 | + define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH.'admin_pages'.DS); |
|
136 | + define('EE_CORE', EE_PLUGIN_DIR_PATH.'core'.DS); |
|
137 | + define('EE_MODULES', EE_PLUGIN_DIR_PATH.'modules'.DS); |
|
138 | + define('EE_PUBLIC', EE_PLUGIN_DIR_PATH.'public'.DS); |
|
139 | + define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH.'shortcodes'.DS); |
|
140 | + define('EE_WIDGETS', EE_PLUGIN_DIR_PATH.'widgets'.DS); |
|
141 | + define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH.'payment_methods'.DS); |
|
142 | + define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH.'caffeinated'.DS); |
|
143 | 143 | // core system paths |
144 | - define( 'EE_ADMIN', EE_CORE . 'admin' . DS ); |
|
145 | - define( 'EE_CPTS', EE_CORE . 'CPTs' . DS ); |
|
146 | - define( 'EE_CLASSES', EE_CORE . 'db_classes' . DS ); |
|
147 | - define( 'EE_INTERFACES', EE_CORE . 'interfaces' . DS ); |
|
148 | - define( 'EE_BUSINESS', EE_CORE . 'business' . DS ); |
|
149 | - define( 'EE_MODELS', EE_CORE . 'db_models' . DS ); |
|
150 | - define( 'EE_HELPERS', EE_CORE . 'helpers' . DS ); |
|
151 | - define( 'EE_LIBRARIES', EE_CORE . 'libraries' . DS ); |
|
152 | - define( 'EE_TEMPLATES', EE_CORE . 'templates' . DS ); |
|
153 | - define( 'EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS ); |
|
154 | - define( 'EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS ); |
|
155 | - define( 'EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS ); |
|
144 | + define('EE_ADMIN', EE_CORE.'admin'.DS); |
|
145 | + define('EE_CPTS', EE_CORE.'CPTs'.DS); |
|
146 | + define('EE_CLASSES', EE_CORE.'db_classes'.DS); |
|
147 | + define('EE_INTERFACES', EE_CORE.'interfaces'.DS); |
|
148 | + define('EE_BUSINESS', EE_CORE.'business'.DS); |
|
149 | + define('EE_MODELS', EE_CORE.'db_models'.DS); |
|
150 | + define('EE_HELPERS', EE_CORE.'helpers'.DS); |
|
151 | + define('EE_LIBRARIES', EE_CORE.'libraries'.DS); |
|
152 | + define('EE_TEMPLATES', EE_CORE.'templates'.DS); |
|
153 | + define('EE_THIRD_PARTY', EE_CORE.'third_party_libs'.DS); |
|
154 | + define('EE_GLOBAL_ASSETS', EE_TEMPLATES.'global_assets'.DS); |
|
155 | + define('EE_FORM_SECTIONS', EE_LIBRARIES.'form_sections'.DS); |
|
156 | 156 | // gateways |
157 | - define( 'EE_GATEWAYS', EE_MODULES . 'gateways' . DS ); |
|
158 | - define( 'EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS ); |
|
157 | + define('EE_GATEWAYS', EE_MODULES.'gateways'.DS); |
|
158 | + define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL.'modules'.DS.'gateways'.DS); |
|
159 | 159 | // asset URL paths |
160 | - define( 'EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS ); |
|
161 | - define( 'EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS ); |
|
162 | - define( 'EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS ); |
|
163 | - define( 'EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS ); |
|
164 | - define( 'EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/' ); |
|
165 | - define( 'EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/' ); |
|
160 | + define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL.'core'.DS.'templates'.DS); |
|
161 | + define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL.'global_assets'.DS); |
|
162 | + define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL.'images'.DS); |
|
163 | + define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL.'core'.DS.'third_party_libs'.DS); |
|
164 | + define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL.'core/helpers/assets/'); |
|
165 | + define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL.'core/libraries/'); |
|
166 | 166 | // define upload paths |
167 | 167 | $uploads = wp_upload_dir(); |
168 | 168 | // define the uploads directory and URL |
169 | - define( 'EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'] . DS . 'espresso' . DS ); |
|
170 | - define( 'EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'] . DS . 'espresso' . DS ); |
|
169 | + define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'].DS.'espresso'.DS); |
|
170 | + define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'].DS.'espresso'.DS); |
|
171 | 171 | // define the templates directory and URL |
172 | - define( 'EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'templates' . DS ); |
|
173 | - define( 'EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'templates' . DS ); |
|
172 | + define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'].DS.'espresso'.DS.'templates'.DS); |
|
173 | + define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'].DS.'espresso'.DS.'templates'.DS); |
|
174 | 174 | // define the gateway directory and URL |
175 | - define( 'EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'gateways' . DS ); |
|
176 | - define( 'EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'gateways' . DS ); |
|
175 | + define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'].DS.'espresso'.DS.'gateways'.DS); |
|
176 | + define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'].DS.'espresso'.DS.'gateways'.DS); |
|
177 | 177 | // languages folder/path |
178 | - define( 'EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS ); |
|
179 | - define( 'EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS ); |
|
178 | + define('EE_LANGUAGES_SAFE_LOC', '..'.DS.'uploads'.DS.'espresso'.DS.'languages'.DS); |
|
179 | + define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'languages'.DS); |
|
180 | 180 | //check for dompdf fonts in uploads |
181 | - if ( file_exists( EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ) ) { |
|
182 | - define( 'DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ); |
|
181 | + if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS)) { |
|
182 | + define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS); |
|
183 | 183 | } |
184 | 184 | //ajax constants |
185 | 185 | define( |
186 | 186 | 'EE_FRONT_AJAX', |
187 | - isset( $_REQUEST['ee_front_ajax'] ) || isset( $_REQUEST['data']['ee_front_ajax'] ) ? true : false |
|
187 | + isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false |
|
188 | 188 | ); |
189 | 189 | define( |
190 | 190 | 'EE_ADMIN_AJAX', |
191 | - isset( $_REQUEST['ee_admin_ajax'] ) || isset( $_REQUEST['data']['ee_admin_ajax'] ) ? true : false |
|
191 | + isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false |
|
192 | 192 | ); |
193 | 193 | //just a handy constant occasionally needed for finding values representing infinity in the DB |
194 | 194 | //you're better to use this than its straight value (currently -1) in case you ever |
195 | 195 | //want to change its default value! or find when -1 means infinity |
196 | - define( 'EE_INF_IN_DB', -1 ); |
|
197 | - define( 'EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX ); |
|
198 | - define( 'EE_DEBUG', false ); |
|
196 | + define('EE_INF_IN_DB', -1); |
|
197 | + define('EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX); |
|
198 | + define('EE_DEBUG', false); |
|
199 | 199 | |
200 | 200 | |
201 | 201 | /** |
@@ -203,9 +203,9 @@ discard block |
||
203 | 203 | * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
204 | 204 | */ |
205 | 205 | function espresso_plugin_activation() { |
206 | - update_option( 'ee_espresso_activation', true ); |
|
206 | + update_option('ee_espresso_activation', true); |
|
207 | 207 | } |
208 | - register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' ); |
|
208 | + register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
209 | 209 | |
210 | 210 | |
211 | 211 | |
@@ -215,15 +215,15 @@ discard block |
||
215 | 215 | */ |
216 | 216 | function espresso_load_error_handling() { |
217 | 217 | // load debugging tools |
218 | - if ( WP_DEBUG === true && is_readable( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ) ) { |
|
219 | - require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ); |
|
218 | + if (WP_DEBUG === true && is_readable(EE_HELPERS.'EEH_Debug_Tools.helper.php')) { |
|
219 | + require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php'); |
|
220 | 220 | EEH_Debug_Tools::instance(); |
221 | 221 | } |
222 | 222 | // load error handling |
223 | - if ( is_readable( EE_CORE . 'EE_Error.core.php' ) ) { |
|
224 | - require_once( EE_CORE . 'EE_Error.core.php' ); |
|
223 | + if (is_readable(EE_CORE.'EE_Error.core.php')) { |
|
224 | + require_once(EE_CORE.'EE_Error.core.php'); |
|
225 | 225 | } else { |
226 | - wp_die( esc_html__( 'The EE_Error core class could not be loaded.', 'event_espresso' ) ); |
|
226 | + wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
227 | 227 | } |
228 | 228 | } |
229 | 229 | |
@@ -237,16 +237,16 @@ discard block |
||
237 | 237 | * @param string $full_path_to_file |
238 | 238 | * @throws EE_Error |
239 | 239 | */ |
240 | - function espresso_load_required( $classname, $full_path_to_file ) { |
|
240 | + function espresso_load_required($classname, $full_path_to_file) { |
|
241 | 241 | static $error_handling_loaded = false; |
242 | - if ( ! $error_handling_loaded ) { |
|
242 | + if ( ! $error_handling_loaded) { |
|
243 | 243 | espresso_load_error_handling(); |
244 | 244 | $error_handling_loaded = true; |
245 | 245 | } |
246 | - if ( is_readable( $full_path_to_file ) ) { |
|
247 | - require_once( $full_path_to_file ); |
|
246 | + if (is_readable($full_path_to_file)) { |
|
247 | + require_once($full_path_to_file); |
|
248 | 248 | } else { |
249 | - throw new EE_Error ( |
|
249 | + throw new EE_Error( |
|
250 | 250 | sprintf( |
251 | 251 | esc_html__( |
252 | 252 | 'The %s class file could not be located or is not readable due to file permissions.', |
@@ -258,15 +258,15 @@ discard block |
||
258 | 258 | } |
259 | 259 | } |
260 | 260 | |
261 | - espresso_load_required( 'EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' ); |
|
262 | - espresso_load_required( 'EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' ); |
|
263 | - espresso_load_required( 'EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php' ); |
|
261 | + espresso_load_required('EEH_Base', EE_CORE.'helpers'.DS.'EEH_Base.helper.php'); |
|
262 | + espresso_load_required('EEH_File', EE_CORE.'helpers'.DS.'EEH_File.helper.php'); |
|
263 | + espresso_load_required('EE_Bootstrap', EE_CORE.'EE_Bootstrap.core.php'); |
|
264 | 264 | new EE_Bootstrap(); |
265 | 265 | |
266 | 266 | } |
267 | 267 | } |
268 | 268 | |
269 | -if ( ! function_exists( 'espresso_deactivate_plugin' ) ) { |
|
269 | +if ( ! function_exists('espresso_deactivate_plugin')) { |
|
270 | 270 | |
271 | 271 | /** |
272 | 272 | * deactivate_plugin |
@@ -276,12 +276,12 @@ discard block |
||
276 | 276 | * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
277 | 277 | * @return void |
278 | 278 | */ |
279 | - function espresso_deactivate_plugin( $plugin_basename = '' ) { |
|
280 | - if ( ! function_exists( 'deactivate_plugins' ) ) { |
|
281 | - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
|
279 | + function espresso_deactivate_plugin($plugin_basename = '') { |
|
280 | + if ( ! function_exists('deactivate_plugins')) { |
|
281 | + require_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
282 | 282 | } |
283 | - unset( $_GET['activate'], $_REQUEST['activate'] ); |
|
284 | - deactivate_plugins( $plugin_basename ); |
|
283 | + unset($_GET['activate'], $_REQUEST['activate']); |
|
284 | + deactivate_plugins($plugin_basename); |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | } |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | namespace EventEspresso\modules\ticket_selector; |
3 | 3 | |
4 | 4 | if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
5 | - exit( 'No direct script access allowed' ); |
|
5 | + exit( 'No direct script access allowed' ); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -19,445 +19,445 @@ discard block |
||
19 | 19 | class DisplayTicketSelector |
20 | 20 | { |
21 | 21 | |
22 | - /** |
|
23 | - * event that ticket selector is being generated for |
|
24 | - * |
|
25 | - * @access protected |
|
26 | - * @var \EE_Event $event |
|
27 | - */ |
|
28 | - protected $event; |
|
29 | - |
|
30 | - /** |
|
31 | - * Used to flag when the ticket selector is being called from an external iframe. |
|
32 | - * |
|
33 | - * @var bool $iframe |
|
34 | - */ |
|
35 | - protected $iframe = false; |
|
36 | - |
|
37 | - /** |
|
38 | - * max attendees that can register for event at one time |
|
39 | - * |
|
40 | - * @var int $max_attendees |
|
41 | - */ |
|
42 | - private $max_attendees = EE_INF; |
|
43 | - |
|
44 | - |
|
45 | - |
|
46 | - /** |
|
47 | - * @param boolean $iframe |
|
48 | - */ |
|
49 | - public function setIframe( $iframe = true ) |
|
50 | - { |
|
51 | - $this->iframe = filter_var( $iframe, FILTER_VALIDATE_BOOLEAN ); |
|
52 | - } |
|
53 | - |
|
54 | - |
|
55 | - |
|
56 | - /** |
|
57 | - * finds and sets the \EE_Event object for use throughout class |
|
58 | - * |
|
59 | - * @param mixed $event |
|
60 | - * @return bool |
|
61 | - */ |
|
62 | - protected function setEvent( $event = null ) |
|
63 | - { |
|
64 | - if ( $event === null ) { |
|
65 | - global $post; |
|
66 | - $event = $post; |
|
67 | - } |
|
68 | - if ( $event instanceof \EE_Event ) { |
|
69 | - $this->event = $event; |
|
70 | - } else if ( $event instanceof \WP_Post ) { |
|
71 | - if ( isset( $event->EE_Event ) && $event->EE_Event instanceof \EE_Event ) { |
|
72 | - $this->event = $event->EE_Event; |
|
73 | - } else if ( $event->post_type === 'espresso_events' ) { |
|
74 | - $event->EE_Event = \EEM_Event::instance()->instantiate_class_from_post_object( $event ); |
|
75 | - $this->event = $event->EE_Event; |
|
76 | - } |
|
77 | - } else { |
|
78 | - $user_msg = __( 'No Event object or an invalid Event object was supplied.', 'event_espresso' ); |
|
79 | - $dev_msg = $user_msg . __( |
|
80 | - '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.', |
|
81 | - 'event_espresso' |
|
82 | - ); |
|
83 | - \EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
84 | - return false; |
|
85 | - } |
|
86 | - return true; |
|
87 | - } |
|
88 | - |
|
89 | - |
|
90 | - |
|
91 | - /** |
|
92 | - * @return int |
|
93 | - */ |
|
94 | - public function getMaxAttendees() |
|
95 | - { |
|
96 | - return $this->max_attendees; |
|
97 | - } |
|
98 | - |
|
99 | - |
|
100 | - |
|
101 | - /** |
|
102 | - * @param int $max_attendees |
|
103 | - */ |
|
104 | - public function setMaxAttendees( $max_attendees ) |
|
105 | - { |
|
106 | - $this->max_attendees = absint( $max_attendees ); |
|
107 | - } |
|
108 | - |
|
109 | - |
|
110 | - |
|
111 | - /** |
|
112 | - * creates buttons for selecting number of attendees for an event |
|
113 | - * |
|
114 | - * @param \WP_Post|int $event |
|
115 | - * @param bool $view_details |
|
116 | - * @return string |
|
117 | - * @throws \EE_Error |
|
118 | - */ |
|
119 | - public function display( $event = null, $view_details = false ) |
|
120 | - { |
|
121 | - // reset filter for displaying submit button |
|
122 | - remove_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' ); |
|
123 | - // poke and prod incoming event till it tells us what it is |
|
124 | - if ( ! $this->setEvent( $event ) ) { |
|
125 | - return false; |
|
126 | - } |
|
127 | - if ( apply_filters( 'FHEE__EED_Events_Archive__event_list_iframe', false ) ) { |
|
128 | - $this->setIframe(); |
|
129 | - } |
|
130 | - $event_post = $this->event instanceof \EE_Event ? $this->event->ID() : $event; |
|
131 | - // grab event status |
|
132 | - $_event_active_status = $this->event->get_active_status(); |
|
133 | - if ( |
|
134 | - ! is_admin() |
|
135 | - && ( |
|
136 | - ! $this->event->display_ticket_selector() |
|
137 | - || $view_details |
|
138 | - || post_password_required( $event_post ) |
|
139 | - || ( |
|
140 | - $_event_active_status !== \EE_Datetime::active |
|
141 | - && $_event_active_status !== \EE_Datetime::upcoming |
|
142 | - && $_event_active_status !== \EE_Datetime::sold_out |
|
143 | - && ! ( |
|
144 | - $_event_active_status === \EE_Datetime::inactive |
|
145 | - && is_user_logged_in() |
|
146 | - ) |
|
147 | - ) |
|
148 | - ) |
|
149 | - ) { |
|
150 | - return ! is_single() ? $this->displayViewDetailsButton() : ''; |
|
151 | - } |
|
152 | - $template_args = array(); |
|
153 | - $template_args[ 'event_status' ] = $_event_active_status; |
|
154 | - $template_args[ 'date_format' ] = apply_filters( |
|
155 | - 'FHEE__EED_Ticket_Selector__display_ticket_selector__date_format', |
|
156 | - get_option( 'date_format' ) |
|
157 | - ); |
|
158 | - $template_args[ 'time_format' ] = apply_filters( |
|
159 | - 'FHEE__EED_Ticket_Selector__display_ticket_selector__time_format', |
|
160 | - get_option( 'time_format' ) |
|
161 | - ); |
|
162 | - $template_args[ 'EVT_ID' ] = $this->event->ID(); |
|
163 | - $template_args[ 'event' ] = $this->event; |
|
164 | - // is the event expired ? |
|
165 | - $template_args[ 'event_is_expired' ] = $this->event->is_expired(); |
|
166 | - if ( $template_args[ 'event_is_expired' ] ) { |
|
167 | - return '<div class="ee-event-expired-notice"><span class="important-notice">' . __( |
|
168 | - 'We\'re sorry, but all tickets sales have ended because the event is expired.', |
|
169 | - 'event_espresso' |
|
170 | - ) . '</span></div>'; |
|
171 | - } |
|
172 | - $ticket_query_args = array( |
|
173 | - array( 'Datetime.EVT_ID' => $this->event->ID() ), |
|
174 | - 'order_by' => array( |
|
175 | - 'TKT_order' => 'ASC', |
|
176 | - 'TKT_required' => 'DESC', |
|
177 | - 'TKT_start_date' => 'ASC', |
|
178 | - 'TKT_end_date' => 'ASC', |
|
179 | - 'Datetime.DTT_EVT_start' => 'DESC', |
|
180 | - ), |
|
181 | - ); |
|
182 | - if ( ! \EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector->show_expired_tickets ) { |
|
183 | - //use the correct applicable time query depending on what version of core is being run. |
|
184 | - $current_time = method_exists( 'EEM_Datetime', 'current_time_for_query' ) |
|
185 | - ? time() |
|
186 | - : current_time( 'timestamp' ); |
|
187 | - $ticket_query_args[ 0 ][ 'TKT_end_date' ] = array( '>', $current_time ); |
|
188 | - } |
|
189 | - // get all tickets for this event ordered by the datetime |
|
190 | - $template_args[ 'tickets' ] = \EEM_Ticket::instance()->get_all( $ticket_query_args ); |
|
191 | - if ( count( $template_args[ 'tickets' ] ) < 1 ) { |
|
192 | - return '<div class="ee-event-expired-notice"><span class="important-notice">' . __( |
|
193 | - 'We\'re sorry, but all ticket sales have ended.', |
|
194 | - 'event_espresso' |
|
195 | - ) . '</span></div>'; |
|
196 | - } |
|
197 | - // filter the maximum qty that can appear in the Ticket Selector qty dropdowns |
|
198 | - $this->setMaxAttendees( |
|
199 | - apply_filters( |
|
200 | - 'FHEE__EE_Ticket_Selector__display_ticket_selector__max_tickets', |
|
201 | - $this->event->additional_limit() |
|
202 | - ) |
|
203 | - ); |
|
204 | - $template_args[ 'max_atndz' ] = $this->getMaxAttendees(); |
|
205 | - if ( $template_args[ 'max_atndz' ] < 1 ) { |
|
206 | - $sales_closed_msg = __( |
|
207 | - 'We\'re sorry, but ticket sales have been closed at this time. Please check back again later.', |
|
208 | - 'event_espresso' |
|
209 | - ); |
|
210 | - if ( current_user_can( 'edit_post', $this->event->ID() ) ) { |
|
211 | - $link = get_edit_post_link( $this->event->ID() ); |
|
212 | - $sales_closed_msg .= sprintf( |
|
213 | - __( |
|
214 | - '%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', |
|
215 | - 'event_espresso' |
|
216 | - ), |
|
217 | - '<div class="ee-attention" style="text-align: left;"><b>', |
|
218 | - '</b><br />', |
|
219 | - $link = '<span class="edit-link"><a class="post-edit-link" href="' . $link . '">', |
|
220 | - '</a></span></div>' |
|
221 | - ); |
|
222 | - } |
|
223 | - return '<p><span class="important-notice">' . $sales_closed_msg . '</span></p>'; |
|
224 | - } |
|
225 | - $templates[ 'ticket_selector' ] = TICKET_SELECTOR_TEMPLATES_PATH . 'ticket_selector_chart.template.php'; |
|
226 | - $templates[ 'ticket_selector' ] = apply_filters( |
|
227 | - 'FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', |
|
228 | - $templates[ 'ticket_selector' ], |
|
229 | - $this->event |
|
230 | - ); |
|
231 | - // redirecting to another site for registration ?? |
|
232 | - $external_url = $this->event->external_url() !== null || $this->event->external_url() !== '' |
|
233 | - ? $this->event->external_url() |
|
234 | - : ''; |
|
235 | - // if not redirecting to another site for registration |
|
236 | - if ( ! $external_url ) { |
|
237 | - // then display the ticket selector |
|
238 | - $ticket_selector = \EEH_Template::locate_template( $templates[ 'ticket_selector' ], $template_args ); |
|
239 | - } else { |
|
240 | - // if not we still need to trigger the display of the submit button |
|
241 | - add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' ); |
|
242 | - //display notice to admin that registration is external |
|
243 | - $ticket_selector = ! is_admin() |
|
244 | - ? '' |
|
245 | - : __( |
|
246 | - 'Registration is at an external URL for this event.', |
|
247 | - 'event_espresso' |
|
248 | - ); |
|
249 | - } |
|
250 | - $ticket_selector = ! is_admin() |
|
251 | - ? $this->formOpen( |
|
252 | - $this->event->ID(), |
|
253 | - $external_url |
|
254 | - ) . $ticket_selector |
|
255 | - : $ticket_selector; |
|
256 | - // now set up the form (but not for the admin) |
|
257 | - // submit button and form close tag |
|
258 | - $ticket_selector .= ! is_admin() ? $this->displaySubmitButton() : ''; |
|
259 | - // set no cache headers and constants |
|
260 | - \EE_System::do_not_cache(); |
|
261 | - return $ticket_selector; |
|
262 | - } |
|
263 | - |
|
264 | - |
|
265 | - |
|
266 | - /** |
|
267 | - * formOpen |
|
268 | - * |
|
269 | - * @param int $ID |
|
270 | - * @param string $external_url |
|
271 | - * @return string |
|
272 | - */ |
|
273 | - public function formOpen( $ID = 0, $external_url = '' ) |
|
274 | - { |
|
275 | - // if redirecting, we don't need any anything else |
|
276 | - if ( $external_url ) { |
|
277 | - $html = '<form method="GET" action="' . \EEH_URL::refactor_url( $external_url ) . '">'; |
|
278 | - $query_args = \EEH_URL::get_query_string( $external_url ); |
|
279 | - foreach ( (array)$query_args as $query_arg => $value ) { |
|
280 | - $html .= '<input type="hidden" name="' . $query_arg . '" value="' . $value . '">'; |
|
281 | - } |
|
282 | - return $html; |
|
283 | - } |
|
284 | - // if there is no submit button, then don't start building a form |
|
285 | - // because the "View Details" button will build its own form |
|
286 | - if ( ! apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) { |
|
287 | - return ''; |
|
288 | - } |
|
289 | - $checkout_url = \EEH_Event_View::event_link_url( $ID ); |
|
290 | - if ( ! $checkout_url ) { |
|
291 | - \EE_Error::add_error( |
|
292 | - __( 'The URL for the Event Details page could not be retrieved.', 'event_espresso' ), |
|
293 | - __FILE__, |
|
294 | - __FUNCTION__, |
|
295 | - __LINE__ |
|
296 | - ); |
|
297 | - } |
|
298 | - $extra_params = $this->iframe ? ' target="_blank"' : ''; |
|
299 | - $html = '<form method="POST" action="' . $checkout_url . '"' . $extra_params . '>'; |
|
300 | - $html .= wp_nonce_field( 'process_ticket_selections', 'process_ticket_selections_nonce_' . $ID, true, false ); |
|
301 | - $html .= '<input type="hidden" name="ee" value="process_ticket_selections">'; |
|
302 | - $html = apply_filters( 'FHEE__EE_Ticket_Selector__ticket_selector_form_open__html', $html, $this->event ); |
|
303 | - return $html; |
|
304 | - } |
|
305 | - |
|
306 | - |
|
307 | - |
|
308 | - /** |
|
309 | - * displaySubmitButton |
|
310 | - * |
|
311 | - * @access public |
|
312 | - * @return string |
|
313 | - * @throws \EE_Error |
|
314 | - */ |
|
315 | - public function displaySubmitButton() |
|
316 | - { |
|
317 | - $html = ''; |
|
318 | - if ( ! is_admin() ) { |
|
319 | - // standard TS displayed with submit button, ie: "Register Now" |
|
320 | - if ( apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) { |
|
321 | - $btn_text = apply_filters( |
|
322 | - 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit__btn_text', |
|
323 | - __( 'Register Now', 'event_espresso' ), |
|
324 | - $this->event |
|
325 | - ); |
|
326 | - $external_url = $this->event->external_url(); |
|
327 | - $html .= '<input id="ticket-selector-submit-' . $this->event->ID() . '-btn"'; |
|
328 | - $html .= ' class="ticket-selector-submit-btn '; |
|
329 | - $html .= empty( $external_url ) ? 'ticket-selector-submit-ajax"' : '"'; |
|
330 | - $html .= ' type="submit" value="' . $btn_text . '" />'; |
|
331 | - $html .= apply_filters( |
|
332 | - 'FHEE__EE_Ticket_Selector__after_ticket_selector_submit', |
|
333 | - '', |
|
334 | - $this->event |
|
335 | - ); |
|
336 | - $html .= $this->ticketSelectorEndDiv(); |
|
337 | - $html .= '<br/>' . $this->formClose(); |
|
338 | - } else if ( |
|
339 | - // a "Dude Where's my Ticket Selector?" (DWMTS) type event (ie: $_max_atndz === 1) |
|
340 | - $this->getMaxAttendees() === 1 |
|
341 | - // and the event is sold out |
|
342 | - && $this->event->is_sold_out() |
|
343 | - ) { |
|
344 | - // then instead of a View Details or Submit button, just display a "Sold Out" message |
|
345 | - $html .= apply_filters( |
|
346 | - 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit__sold_out_msg', |
|
347 | - sprintf( |
|
348 | - __( |
|
349 | - '%1$s"%2$s" is currently sold out.%4$sPlease check back again later, as spots may become available.%3$s', |
|
350 | - 'event_espresso' |
|
351 | - ), |
|
352 | - '<p class="no-ticket-selector-msg clear-float">', |
|
353 | - $this->event->name(), |
|
354 | - '</p>', |
|
355 | - '<br />' |
|
356 | - ), |
|
357 | - $this->event |
|
358 | - ); |
|
359 | - // sold out DWMTS event, no TS, no submit or view details button, but has additional content |
|
360 | - $html .= $this->ticketSelectorEndDiv(); |
|
361 | - } else if ( |
|
362 | - $this->getMaxAttendees() === 1 |
|
363 | - && apply_filters( 'FHEE__EE_Ticket_Selector__hide_ticket_selector', false ) |
|
364 | - && ! is_single() |
|
365 | - ) { |
|
366 | - // this is a "Dude Where's my Ticket Selector?" (DWMTS) type event, |
|
367 | - // but no tickets are available, so display event's "View Details" button. |
|
368 | - // it is being viewed via somewhere other than a single post |
|
369 | - $html .= $this->displayViewDetailsButton( true ); |
|
370 | - } else if ( is_archive() ) { |
|
371 | - // event list, no tickets available so display event's "View Details" button |
|
372 | - $html .= $this->ticketSelectorEndDiv(); |
|
373 | - $html .= $this->displayViewDetailsButton(); |
|
374 | - } else { |
|
375 | - // no submit or view details button, and no additional content |
|
376 | - $html .= $this->ticketSelectorEndDiv(); |
|
377 | - } |
|
378 | - if ( ! $this->iframe && ! is_archive() ) { |
|
379 | - $html .= \EEH_Template::powered_by_event_espresso('', '', array('utm_content' => 'ticket_selector')); |
|
380 | - } |
|
381 | - } |
|
382 | - return $html; |
|
383 | - } |
|
384 | - |
|
385 | - |
|
386 | - |
|
387 | - /** |
|
388 | - * displayViewDetailsButton |
|
389 | - * |
|
390 | - * @param bool $DWMTS indicates a "Dude Where's my Ticket Selector?" (DWMTS) type event |
|
391 | - * (ie: $_max_atndz === 1) where there are no available tickets, |
|
392 | - * either because they are sold out, expired, or not yet on sale. |
|
393 | - * In this case, we need to close the form BEFORE adding any closing divs |
|
394 | - * @return string |
|
395 | - * @throws \EE_Error |
|
396 | - */ |
|
397 | - public function displayViewDetailsButton( $DWMTS = false ) |
|
398 | - { |
|
399 | - if ( ! $this->event->get_permalink() ) { |
|
400 | - \EE_Error::add_error( |
|
401 | - __( 'The URL for the Event Details page could not be retrieved.', 'event_espresso' ), |
|
402 | - __FILE__, __FUNCTION__, __LINE__ |
|
403 | - ); |
|
404 | - } |
|
405 | - $extra_params = $this->iframe ? ' target="_blank"' : ''; |
|
406 | - $view_details_btn = '<form method="POST" action="' . $this->event->get_permalink() . '"'. $extra_params.'>'; |
|
407 | - $btn_text = apply_filters( |
|
408 | - 'FHEE__EE_Ticket_Selector__display_view_details_btn__btn_text', |
|
409 | - __( 'View Details', 'event_espresso' ), |
|
410 | - $this->event |
|
411 | - ); |
|
412 | - $view_details_btn .= '<input id="ticket-selector-submit-' |
|
413 | - . $this->event->ID() |
|
414 | - . '-btn" class="ticket-selector-submit-btn view-details-btn" type="submit" value="' |
|
415 | - . $btn_text |
|
416 | - . '" />'; |
|
417 | - $view_details_btn .= apply_filters( 'FHEE__EE_Ticket_Selector__after_view_details_btn', '', $this->event ); |
|
418 | - if ( $DWMTS ) { |
|
419 | - $view_details_btn .= $this->formClose(); |
|
420 | - $view_details_btn .= $this->ticketSelectorEndDiv(); |
|
421 | - $view_details_btn .= '<br/>'; |
|
422 | - } else { |
|
423 | - $view_details_btn .= $this->clearTicketSelector(); |
|
424 | - $view_details_btn .= '<br/>'; |
|
425 | - $view_details_btn .= $this->formClose(); |
|
426 | - } |
|
427 | - return $view_details_btn; |
|
428 | - } |
|
429 | - |
|
430 | - |
|
431 | - |
|
432 | - /** |
|
433 | - * @return string |
|
434 | - */ |
|
435 | - public function ticketSelectorEndDiv() |
|
436 | - { |
|
437 | - return '<div class="clear"></div></div>'; |
|
438 | - } |
|
439 | - |
|
440 | - |
|
441 | - |
|
442 | - /** |
|
443 | - * @return string |
|
444 | - */ |
|
445 | - public function clearTicketSelector() |
|
446 | - { |
|
447 | - // standard TS displayed, appears after a "Register Now" or "view Details" button |
|
448 | - return '<div class="clear"></div>'; |
|
449 | - } |
|
450 | - |
|
451 | - |
|
452 | - |
|
453 | - /** |
|
454 | - * @access public |
|
455 | - * @return string |
|
456 | - */ |
|
457 | - public function formClose() |
|
458 | - { |
|
459 | - return '</form>'; |
|
460 | - } |
|
22 | + /** |
|
23 | + * event that ticket selector is being generated for |
|
24 | + * |
|
25 | + * @access protected |
|
26 | + * @var \EE_Event $event |
|
27 | + */ |
|
28 | + protected $event; |
|
29 | + |
|
30 | + /** |
|
31 | + * Used to flag when the ticket selector is being called from an external iframe. |
|
32 | + * |
|
33 | + * @var bool $iframe |
|
34 | + */ |
|
35 | + protected $iframe = false; |
|
36 | + |
|
37 | + /** |
|
38 | + * max attendees that can register for event at one time |
|
39 | + * |
|
40 | + * @var int $max_attendees |
|
41 | + */ |
|
42 | + private $max_attendees = EE_INF; |
|
43 | + |
|
44 | + |
|
45 | + |
|
46 | + /** |
|
47 | + * @param boolean $iframe |
|
48 | + */ |
|
49 | + public function setIframe( $iframe = true ) |
|
50 | + { |
|
51 | + $this->iframe = filter_var( $iframe, FILTER_VALIDATE_BOOLEAN ); |
|
52 | + } |
|
53 | + |
|
54 | + |
|
55 | + |
|
56 | + /** |
|
57 | + * finds and sets the \EE_Event object for use throughout class |
|
58 | + * |
|
59 | + * @param mixed $event |
|
60 | + * @return bool |
|
61 | + */ |
|
62 | + protected function setEvent( $event = null ) |
|
63 | + { |
|
64 | + if ( $event === null ) { |
|
65 | + global $post; |
|
66 | + $event = $post; |
|
67 | + } |
|
68 | + if ( $event instanceof \EE_Event ) { |
|
69 | + $this->event = $event; |
|
70 | + } else if ( $event instanceof \WP_Post ) { |
|
71 | + if ( isset( $event->EE_Event ) && $event->EE_Event instanceof \EE_Event ) { |
|
72 | + $this->event = $event->EE_Event; |
|
73 | + } else if ( $event->post_type === 'espresso_events' ) { |
|
74 | + $event->EE_Event = \EEM_Event::instance()->instantiate_class_from_post_object( $event ); |
|
75 | + $this->event = $event->EE_Event; |
|
76 | + } |
|
77 | + } else { |
|
78 | + $user_msg = __( 'No Event object or an invalid Event object was supplied.', 'event_espresso' ); |
|
79 | + $dev_msg = $user_msg . __( |
|
80 | + '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.', |
|
81 | + 'event_espresso' |
|
82 | + ); |
|
83 | + \EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
84 | + return false; |
|
85 | + } |
|
86 | + return true; |
|
87 | + } |
|
88 | + |
|
89 | + |
|
90 | + |
|
91 | + /** |
|
92 | + * @return int |
|
93 | + */ |
|
94 | + public function getMaxAttendees() |
|
95 | + { |
|
96 | + return $this->max_attendees; |
|
97 | + } |
|
98 | + |
|
99 | + |
|
100 | + |
|
101 | + /** |
|
102 | + * @param int $max_attendees |
|
103 | + */ |
|
104 | + public function setMaxAttendees( $max_attendees ) |
|
105 | + { |
|
106 | + $this->max_attendees = absint( $max_attendees ); |
|
107 | + } |
|
108 | + |
|
109 | + |
|
110 | + |
|
111 | + /** |
|
112 | + * creates buttons for selecting number of attendees for an event |
|
113 | + * |
|
114 | + * @param \WP_Post|int $event |
|
115 | + * @param bool $view_details |
|
116 | + * @return string |
|
117 | + * @throws \EE_Error |
|
118 | + */ |
|
119 | + public function display( $event = null, $view_details = false ) |
|
120 | + { |
|
121 | + // reset filter for displaying submit button |
|
122 | + remove_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' ); |
|
123 | + // poke and prod incoming event till it tells us what it is |
|
124 | + if ( ! $this->setEvent( $event ) ) { |
|
125 | + return false; |
|
126 | + } |
|
127 | + if ( apply_filters( 'FHEE__EED_Events_Archive__event_list_iframe', false ) ) { |
|
128 | + $this->setIframe(); |
|
129 | + } |
|
130 | + $event_post = $this->event instanceof \EE_Event ? $this->event->ID() : $event; |
|
131 | + // grab event status |
|
132 | + $_event_active_status = $this->event->get_active_status(); |
|
133 | + if ( |
|
134 | + ! is_admin() |
|
135 | + && ( |
|
136 | + ! $this->event->display_ticket_selector() |
|
137 | + || $view_details |
|
138 | + || post_password_required( $event_post ) |
|
139 | + || ( |
|
140 | + $_event_active_status !== \EE_Datetime::active |
|
141 | + && $_event_active_status !== \EE_Datetime::upcoming |
|
142 | + && $_event_active_status !== \EE_Datetime::sold_out |
|
143 | + && ! ( |
|
144 | + $_event_active_status === \EE_Datetime::inactive |
|
145 | + && is_user_logged_in() |
|
146 | + ) |
|
147 | + ) |
|
148 | + ) |
|
149 | + ) { |
|
150 | + return ! is_single() ? $this->displayViewDetailsButton() : ''; |
|
151 | + } |
|
152 | + $template_args = array(); |
|
153 | + $template_args[ 'event_status' ] = $_event_active_status; |
|
154 | + $template_args[ 'date_format' ] = apply_filters( |
|
155 | + 'FHEE__EED_Ticket_Selector__display_ticket_selector__date_format', |
|
156 | + get_option( 'date_format' ) |
|
157 | + ); |
|
158 | + $template_args[ 'time_format' ] = apply_filters( |
|
159 | + 'FHEE__EED_Ticket_Selector__display_ticket_selector__time_format', |
|
160 | + get_option( 'time_format' ) |
|
161 | + ); |
|
162 | + $template_args[ 'EVT_ID' ] = $this->event->ID(); |
|
163 | + $template_args[ 'event' ] = $this->event; |
|
164 | + // is the event expired ? |
|
165 | + $template_args[ 'event_is_expired' ] = $this->event->is_expired(); |
|
166 | + if ( $template_args[ 'event_is_expired' ] ) { |
|
167 | + return '<div class="ee-event-expired-notice"><span class="important-notice">' . __( |
|
168 | + 'We\'re sorry, but all tickets sales have ended because the event is expired.', |
|
169 | + 'event_espresso' |
|
170 | + ) . '</span></div>'; |
|
171 | + } |
|
172 | + $ticket_query_args = array( |
|
173 | + array( 'Datetime.EVT_ID' => $this->event->ID() ), |
|
174 | + 'order_by' => array( |
|
175 | + 'TKT_order' => 'ASC', |
|
176 | + 'TKT_required' => 'DESC', |
|
177 | + 'TKT_start_date' => 'ASC', |
|
178 | + 'TKT_end_date' => 'ASC', |
|
179 | + 'Datetime.DTT_EVT_start' => 'DESC', |
|
180 | + ), |
|
181 | + ); |
|
182 | + if ( ! \EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector->show_expired_tickets ) { |
|
183 | + //use the correct applicable time query depending on what version of core is being run. |
|
184 | + $current_time = method_exists( 'EEM_Datetime', 'current_time_for_query' ) |
|
185 | + ? time() |
|
186 | + : current_time( 'timestamp' ); |
|
187 | + $ticket_query_args[ 0 ][ 'TKT_end_date' ] = array( '>', $current_time ); |
|
188 | + } |
|
189 | + // get all tickets for this event ordered by the datetime |
|
190 | + $template_args[ 'tickets' ] = \EEM_Ticket::instance()->get_all( $ticket_query_args ); |
|
191 | + if ( count( $template_args[ 'tickets' ] ) < 1 ) { |
|
192 | + return '<div class="ee-event-expired-notice"><span class="important-notice">' . __( |
|
193 | + 'We\'re sorry, but all ticket sales have ended.', |
|
194 | + 'event_espresso' |
|
195 | + ) . '</span></div>'; |
|
196 | + } |
|
197 | + // filter the maximum qty that can appear in the Ticket Selector qty dropdowns |
|
198 | + $this->setMaxAttendees( |
|
199 | + apply_filters( |
|
200 | + 'FHEE__EE_Ticket_Selector__display_ticket_selector__max_tickets', |
|
201 | + $this->event->additional_limit() |
|
202 | + ) |
|
203 | + ); |
|
204 | + $template_args[ 'max_atndz' ] = $this->getMaxAttendees(); |
|
205 | + if ( $template_args[ 'max_atndz' ] < 1 ) { |
|
206 | + $sales_closed_msg = __( |
|
207 | + 'We\'re sorry, but ticket sales have been closed at this time. Please check back again later.', |
|
208 | + 'event_espresso' |
|
209 | + ); |
|
210 | + if ( current_user_can( 'edit_post', $this->event->ID() ) ) { |
|
211 | + $link = get_edit_post_link( $this->event->ID() ); |
|
212 | + $sales_closed_msg .= sprintf( |
|
213 | + __( |
|
214 | + '%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', |
|
215 | + 'event_espresso' |
|
216 | + ), |
|
217 | + '<div class="ee-attention" style="text-align: left;"><b>', |
|
218 | + '</b><br />', |
|
219 | + $link = '<span class="edit-link"><a class="post-edit-link" href="' . $link . '">', |
|
220 | + '</a></span></div>' |
|
221 | + ); |
|
222 | + } |
|
223 | + return '<p><span class="important-notice">' . $sales_closed_msg . '</span></p>'; |
|
224 | + } |
|
225 | + $templates[ 'ticket_selector' ] = TICKET_SELECTOR_TEMPLATES_PATH . 'ticket_selector_chart.template.php'; |
|
226 | + $templates[ 'ticket_selector' ] = apply_filters( |
|
227 | + 'FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', |
|
228 | + $templates[ 'ticket_selector' ], |
|
229 | + $this->event |
|
230 | + ); |
|
231 | + // redirecting to another site for registration ?? |
|
232 | + $external_url = $this->event->external_url() !== null || $this->event->external_url() !== '' |
|
233 | + ? $this->event->external_url() |
|
234 | + : ''; |
|
235 | + // if not redirecting to another site for registration |
|
236 | + if ( ! $external_url ) { |
|
237 | + // then display the ticket selector |
|
238 | + $ticket_selector = \EEH_Template::locate_template( $templates[ 'ticket_selector' ], $template_args ); |
|
239 | + } else { |
|
240 | + // if not we still need to trigger the display of the submit button |
|
241 | + add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' ); |
|
242 | + //display notice to admin that registration is external |
|
243 | + $ticket_selector = ! is_admin() |
|
244 | + ? '' |
|
245 | + : __( |
|
246 | + 'Registration is at an external URL for this event.', |
|
247 | + 'event_espresso' |
|
248 | + ); |
|
249 | + } |
|
250 | + $ticket_selector = ! is_admin() |
|
251 | + ? $this->formOpen( |
|
252 | + $this->event->ID(), |
|
253 | + $external_url |
|
254 | + ) . $ticket_selector |
|
255 | + : $ticket_selector; |
|
256 | + // now set up the form (but not for the admin) |
|
257 | + // submit button and form close tag |
|
258 | + $ticket_selector .= ! is_admin() ? $this->displaySubmitButton() : ''; |
|
259 | + // set no cache headers and constants |
|
260 | + \EE_System::do_not_cache(); |
|
261 | + return $ticket_selector; |
|
262 | + } |
|
263 | + |
|
264 | + |
|
265 | + |
|
266 | + /** |
|
267 | + * formOpen |
|
268 | + * |
|
269 | + * @param int $ID |
|
270 | + * @param string $external_url |
|
271 | + * @return string |
|
272 | + */ |
|
273 | + public function formOpen( $ID = 0, $external_url = '' ) |
|
274 | + { |
|
275 | + // if redirecting, we don't need any anything else |
|
276 | + if ( $external_url ) { |
|
277 | + $html = '<form method="GET" action="' . \EEH_URL::refactor_url( $external_url ) . '">'; |
|
278 | + $query_args = \EEH_URL::get_query_string( $external_url ); |
|
279 | + foreach ( (array)$query_args as $query_arg => $value ) { |
|
280 | + $html .= '<input type="hidden" name="' . $query_arg . '" value="' . $value . '">'; |
|
281 | + } |
|
282 | + return $html; |
|
283 | + } |
|
284 | + // if there is no submit button, then don't start building a form |
|
285 | + // because the "View Details" button will build its own form |
|
286 | + if ( ! apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) { |
|
287 | + return ''; |
|
288 | + } |
|
289 | + $checkout_url = \EEH_Event_View::event_link_url( $ID ); |
|
290 | + if ( ! $checkout_url ) { |
|
291 | + \EE_Error::add_error( |
|
292 | + __( 'The URL for the Event Details page could not be retrieved.', 'event_espresso' ), |
|
293 | + __FILE__, |
|
294 | + __FUNCTION__, |
|
295 | + __LINE__ |
|
296 | + ); |
|
297 | + } |
|
298 | + $extra_params = $this->iframe ? ' target="_blank"' : ''; |
|
299 | + $html = '<form method="POST" action="' . $checkout_url . '"' . $extra_params . '>'; |
|
300 | + $html .= wp_nonce_field( 'process_ticket_selections', 'process_ticket_selections_nonce_' . $ID, true, false ); |
|
301 | + $html .= '<input type="hidden" name="ee" value="process_ticket_selections">'; |
|
302 | + $html = apply_filters( 'FHEE__EE_Ticket_Selector__ticket_selector_form_open__html', $html, $this->event ); |
|
303 | + return $html; |
|
304 | + } |
|
305 | + |
|
306 | + |
|
307 | + |
|
308 | + /** |
|
309 | + * displaySubmitButton |
|
310 | + * |
|
311 | + * @access public |
|
312 | + * @return string |
|
313 | + * @throws \EE_Error |
|
314 | + */ |
|
315 | + public function displaySubmitButton() |
|
316 | + { |
|
317 | + $html = ''; |
|
318 | + if ( ! is_admin() ) { |
|
319 | + // standard TS displayed with submit button, ie: "Register Now" |
|
320 | + if ( apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) { |
|
321 | + $btn_text = apply_filters( |
|
322 | + 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit__btn_text', |
|
323 | + __( 'Register Now', 'event_espresso' ), |
|
324 | + $this->event |
|
325 | + ); |
|
326 | + $external_url = $this->event->external_url(); |
|
327 | + $html .= '<input id="ticket-selector-submit-' . $this->event->ID() . '-btn"'; |
|
328 | + $html .= ' class="ticket-selector-submit-btn '; |
|
329 | + $html .= empty( $external_url ) ? 'ticket-selector-submit-ajax"' : '"'; |
|
330 | + $html .= ' type="submit" value="' . $btn_text . '" />'; |
|
331 | + $html .= apply_filters( |
|
332 | + 'FHEE__EE_Ticket_Selector__after_ticket_selector_submit', |
|
333 | + '', |
|
334 | + $this->event |
|
335 | + ); |
|
336 | + $html .= $this->ticketSelectorEndDiv(); |
|
337 | + $html .= '<br/>' . $this->formClose(); |
|
338 | + } else if ( |
|
339 | + // a "Dude Where's my Ticket Selector?" (DWMTS) type event (ie: $_max_atndz === 1) |
|
340 | + $this->getMaxAttendees() === 1 |
|
341 | + // and the event is sold out |
|
342 | + && $this->event->is_sold_out() |
|
343 | + ) { |
|
344 | + // then instead of a View Details or Submit button, just display a "Sold Out" message |
|
345 | + $html .= apply_filters( |
|
346 | + 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit__sold_out_msg', |
|
347 | + sprintf( |
|
348 | + __( |
|
349 | + '%1$s"%2$s" is currently sold out.%4$sPlease check back again later, as spots may become available.%3$s', |
|
350 | + 'event_espresso' |
|
351 | + ), |
|
352 | + '<p class="no-ticket-selector-msg clear-float">', |
|
353 | + $this->event->name(), |
|
354 | + '</p>', |
|
355 | + '<br />' |
|
356 | + ), |
|
357 | + $this->event |
|
358 | + ); |
|
359 | + // sold out DWMTS event, no TS, no submit or view details button, but has additional content |
|
360 | + $html .= $this->ticketSelectorEndDiv(); |
|
361 | + } else if ( |
|
362 | + $this->getMaxAttendees() === 1 |
|
363 | + && apply_filters( 'FHEE__EE_Ticket_Selector__hide_ticket_selector', false ) |
|
364 | + && ! is_single() |
|
365 | + ) { |
|
366 | + // this is a "Dude Where's my Ticket Selector?" (DWMTS) type event, |
|
367 | + // but no tickets are available, so display event's "View Details" button. |
|
368 | + // it is being viewed via somewhere other than a single post |
|
369 | + $html .= $this->displayViewDetailsButton( true ); |
|
370 | + } else if ( is_archive() ) { |
|
371 | + // event list, no tickets available so display event's "View Details" button |
|
372 | + $html .= $this->ticketSelectorEndDiv(); |
|
373 | + $html .= $this->displayViewDetailsButton(); |
|
374 | + } else { |
|
375 | + // no submit or view details button, and no additional content |
|
376 | + $html .= $this->ticketSelectorEndDiv(); |
|
377 | + } |
|
378 | + if ( ! $this->iframe && ! is_archive() ) { |
|
379 | + $html .= \EEH_Template::powered_by_event_espresso('', '', array('utm_content' => 'ticket_selector')); |
|
380 | + } |
|
381 | + } |
|
382 | + return $html; |
|
383 | + } |
|
384 | + |
|
385 | + |
|
386 | + |
|
387 | + /** |
|
388 | + * displayViewDetailsButton |
|
389 | + * |
|
390 | + * @param bool $DWMTS indicates a "Dude Where's my Ticket Selector?" (DWMTS) type event |
|
391 | + * (ie: $_max_atndz === 1) where there are no available tickets, |
|
392 | + * either because they are sold out, expired, or not yet on sale. |
|
393 | + * In this case, we need to close the form BEFORE adding any closing divs |
|
394 | + * @return string |
|
395 | + * @throws \EE_Error |
|
396 | + */ |
|
397 | + public function displayViewDetailsButton( $DWMTS = false ) |
|
398 | + { |
|
399 | + if ( ! $this->event->get_permalink() ) { |
|
400 | + \EE_Error::add_error( |
|
401 | + __( 'The URL for the Event Details page could not be retrieved.', 'event_espresso' ), |
|
402 | + __FILE__, __FUNCTION__, __LINE__ |
|
403 | + ); |
|
404 | + } |
|
405 | + $extra_params = $this->iframe ? ' target="_blank"' : ''; |
|
406 | + $view_details_btn = '<form method="POST" action="' . $this->event->get_permalink() . '"'. $extra_params.'>'; |
|
407 | + $btn_text = apply_filters( |
|
408 | + 'FHEE__EE_Ticket_Selector__display_view_details_btn__btn_text', |
|
409 | + __( 'View Details', 'event_espresso' ), |
|
410 | + $this->event |
|
411 | + ); |
|
412 | + $view_details_btn .= '<input id="ticket-selector-submit-' |
|
413 | + . $this->event->ID() |
|
414 | + . '-btn" class="ticket-selector-submit-btn view-details-btn" type="submit" value="' |
|
415 | + . $btn_text |
|
416 | + . '" />'; |
|
417 | + $view_details_btn .= apply_filters( 'FHEE__EE_Ticket_Selector__after_view_details_btn', '', $this->event ); |
|
418 | + if ( $DWMTS ) { |
|
419 | + $view_details_btn .= $this->formClose(); |
|
420 | + $view_details_btn .= $this->ticketSelectorEndDiv(); |
|
421 | + $view_details_btn .= '<br/>'; |
|
422 | + } else { |
|
423 | + $view_details_btn .= $this->clearTicketSelector(); |
|
424 | + $view_details_btn .= '<br/>'; |
|
425 | + $view_details_btn .= $this->formClose(); |
|
426 | + } |
|
427 | + return $view_details_btn; |
|
428 | + } |
|
429 | + |
|
430 | + |
|
431 | + |
|
432 | + /** |
|
433 | + * @return string |
|
434 | + */ |
|
435 | + public function ticketSelectorEndDiv() |
|
436 | + { |
|
437 | + return '<div class="clear"></div></div>'; |
|
438 | + } |
|
439 | + |
|
440 | + |
|
441 | + |
|
442 | + /** |
|
443 | + * @return string |
|
444 | + */ |
|
445 | + public function clearTicketSelector() |
|
446 | + { |
|
447 | + // standard TS displayed, appears after a "Register Now" or "view Details" button |
|
448 | + return '<div class="clear"></div>'; |
|
449 | + } |
|
450 | + |
|
451 | + |
|
452 | + |
|
453 | + /** |
|
454 | + * @access public |
|
455 | + * @return string |
|
456 | + */ |
|
457 | + public function formClose() |
|
458 | + { |
|
459 | + return '</form>'; |
|
460 | + } |
|
461 | 461 | |
462 | 462 | |
463 | 463 |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\modules\ticket_selector; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | /** |
47 | 47 | * @param boolean $iframe |
48 | 48 | */ |
49 | - public function setIframe( $iframe = true ) |
|
49 | + public function setIframe($iframe = true) |
|
50 | 50 | { |
51 | - $this->iframe = filter_var( $iframe, FILTER_VALIDATE_BOOLEAN ); |
|
51 | + $this->iframe = filter_var($iframe, FILTER_VALIDATE_BOOLEAN); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
@@ -59,28 +59,28 @@ discard block |
||
59 | 59 | * @param mixed $event |
60 | 60 | * @return bool |
61 | 61 | */ |
62 | - protected function setEvent( $event = null ) |
|
62 | + protected function setEvent($event = null) |
|
63 | 63 | { |
64 | - if ( $event === null ) { |
|
64 | + if ($event === null) { |
|
65 | 65 | global $post; |
66 | 66 | $event = $post; |
67 | 67 | } |
68 | - if ( $event instanceof \EE_Event ) { |
|
68 | + if ($event instanceof \EE_Event) { |
|
69 | 69 | $this->event = $event; |
70 | - } else if ( $event instanceof \WP_Post ) { |
|
71 | - if ( isset( $event->EE_Event ) && $event->EE_Event instanceof \EE_Event ) { |
|
70 | + } else if ($event instanceof \WP_Post) { |
|
71 | + if (isset($event->EE_Event) && $event->EE_Event instanceof \EE_Event) { |
|
72 | 72 | $this->event = $event->EE_Event; |
73 | - } else if ( $event->post_type === 'espresso_events' ) { |
|
74 | - $event->EE_Event = \EEM_Event::instance()->instantiate_class_from_post_object( $event ); |
|
73 | + } else if ($event->post_type === 'espresso_events') { |
|
74 | + $event->EE_Event = \EEM_Event::instance()->instantiate_class_from_post_object($event); |
|
75 | 75 | $this->event = $event->EE_Event; |
76 | 76 | } |
77 | 77 | } else { |
78 | - $user_msg = __( 'No Event object or an invalid Event object was supplied.', 'event_espresso' ); |
|
79 | - $dev_msg = $user_msg . __( |
|
78 | + $user_msg = __('No Event object or an invalid Event object was supplied.', 'event_espresso'); |
|
79 | + $dev_msg = $user_msg.__( |
|
80 | 80 | '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.', |
81 | 81 | 'event_espresso' |
82 | 82 | ); |
83 | - \EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
83 | + \EE_Error::add_error($user_msg.'||'.$dev_msg, __FILE__, __FUNCTION__, __LINE__); |
|
84 | 84 | return false; |
85 | 85 | } |
86 | 86 | return true; |
@@ -101,9 +101,9 @@ discard block |
||
101 | 101 | /** |
102 | 102 | * @param int $max_attendees |
103 | 103 | */ |
104 | - public function setMaxAttendees( $max_attendees ) |
|
104 | + public function setMaxAttendees($max_attendees) |
|
105 | 105 | { |
106 | - $this->max_attendees = absint( $max_attendees ); |
|
106 | + $this->max_attendees = absint($max_attendees); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | |
@@ -116,15 +116,15 @@ discard block |
||
116 | 116 | * @return string |
117 | 117 | * @throws \EE_Error |
118 | 118 | */ |
119 | - public function display( $event = null, $view_details = false ) |
|
119 | + public function display($event = null, $view_details = false) |
|
120 | 120 | { |
121 | 121 | // reset filter for displaying submit button |
122 | - remove_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' ); |
|
122 | + remove_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true'); |
|
123 | 123 | // poke and prod incoming event till it tells us what it is |
124 | - if ( ! $this->setEvent( $event ) ) { |
|
124 | + if ( ! $this->setEvent($event)) { |
|
125 | 125 | return false; |
126 | 126 | } |
127 | - if ( apply_filters( 'FHEE__EED_Events_Archive__event_list_iframe', false ) ) { |
|
127 | + if (apply_filters('FHEE__EED_Events_Archive__event_list_iframe', false)) { |
|
128 | 128 | $this->setIframe(); |
129 | 129 | } |
130 | 130 | $event_post = $this->event instanceof \EE_Event ? $this->event->ID() : $event; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | && ( |
136 | 136 | ! $this->event->display_ticket_selector() |
137 | 137 | || $view_details |
138 | - || post_password_required( $event_post ) |
|
138 | + || post_password_required($event_post) |
|
139 | 139 | || ( |
140 | 140 | $_event_active_status !== \EE_Datetime::active |
141 | 141 | && $_event_active_status !== \EE_Datetime::upcoming |
@@ -150,27 +150,27 @@ discard block |
||
150 | 150 | return ! is_single() ? $this->displayViewDetailsButton() : ''; |
151 | 151 | } |
152 | 152 | $template_args = array(); |
153 | - $template_args[ 'event_status' ] = $_event_active_status; |
|
154 | - $template_args[ 'date_format' ] = apply_filters( |
|
153 | + $template_args['event_status'] = $_event_active_status; |
|
154 | + $template_args['date_format'] = apply_filters( |
|
155 | 155 | 'FHEE__EED_Ticket_Selector__display_ticket_selector__date_format', |
156 | - get_option( 'date_format' ) |
|
156 | + get_option('date_format') |
|
157 | 157 | ); |
158 | - $template_args[ 'time_format' ] = apply_filters( |
|
158 | + $template_args['time_format'] = apply_filters( |
|
159 | 159 | 'FHEE__EED_Ticket_Selector__display_ticket_selector__time_format', |
160 | - get_option( 'time_format' ) |
|
160 | + get_option('time_format') |
|
161 | 161 | ); |
162 | - $template_args[ 'EVT_ID' ] = $this->event->ID(); |
|
163 | - $template_args[ 'event' ] = $this->event; |
|
162 | + $template_args['EVT_ID'] = $this->event->ID(); |
|
163 | + $template_args['event'] = $this->event; |
|
164 | 164 | // is the event expired ? |
165 | - $template_args[ 'event_is_expired' ] = $this->event->is_expired(); |
|
166 | - if ( $template_args[ 'event_is_expired' ] ) { |
|
167 | - return '<div class="ee-event-expired-notice"><span class="important-notice">' . __( |
|
165 | + $template_args['event_is_expired'] = $this->event->is_expired(); |
|
166 | + if ($template_args['event_is_expired']) { |
|
167 | + return '<div class="ee-event-expired-notice"><span class="important-notice">'.__( |
|
168 | 168 | 'We\'re sorry, but all tickets sales have ended because the event is expired.', |
169 | 169 | 'event_espresso' |
170 | - ) . '</span></div>'; |
|
170 | + ).'</span></div>'; |
|
171 | 171 | } |
172 | 172 | $ticket_query_args = array( |
173 | - array( 'Datetime.EVT_ID' => $this->event->ID() ), |
|
173 | + array('Datetime.EVT_ID' => $this->event->ID()), |
|
174 | 174 | 'order_by' => array( |
175 | 175 | 'TKT_order' => 'ASC', |
176 | 176 | 'TKT_required' => 'DESC', |
@@ -179,20 +179,20 @@ discard block |
||
179 | 179 | 'Datetime.DTT_EVT_start' => 'DESC', |
180 | 180 | ), |
181 | 181 | ); |
182 | - if ( ! \EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector->show_expired_tickets ) { |
|
182 | + if ( ! \EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector->show_expired_tickets) { |
|
183 | 183 | //use the correct applicable time query depending on what version of core is being run. |
184 | - $current_time = method_exists( 'EEM_Datetime', 'current_time_for_query' ) |
|
184 | + $current_time = method_exists('EEM_Datetime', 'current_time_for_query') |
|
185 | 185 | ? time() |
186 | - : current_time( 'timestamp' ); |
|
187 | - $ticket_query_args[ 0 ][ 'TKT_end_date' ] = array( '>', $current_time ); |
|
186 | + : current_time('timestamp'); |
|
187 | + $ticket_query_args[0]['TKT_end_date'] = array('>', $current_time); |
|
188 | 188 | } |
189 | 189 | // get all tickets for this event ordered by the datetime |
190 | - $template_args[ 'tickets' ] = \EEM_Ticket::instance()->get_all( $ticket_query_args ); |
|
191 | - if ( count( $template_args[ 'tickets' ] ) < 1 ) { |
|
192 | - return '<div class="ee-event-expired-notice"><span class="important-notice">' . __( |
|
190 | + $template_args['tickets'] = \EEM_Ticket::instance()->get_all($ticket_query_args); |
|
191 | + if (count($template_args['tickets']) < 1) { |
|
192 | + return '<div class="ee-event-expired-notice"><span class="important-notice">'.__( |
|
193 | 193 | 'We\'re sorry, but all ticket sales have ended.', |
194 | 194 | 'event_espresso' |
195 | - ) . '</span></div>'; |
|
195 | + ).'</span></div>'; |
|
196 | 196 | } |
197 | 197 | // filter the maximum qty that can appear in the Ticket Selector qty dropdowns |
198 | 198 | $this->setMaxAttendees( |
@@ -201,14 +201,14 @@ discard block |
||
201 | 201 | $this->event->additional_limit() |
202 | 202 | ) |
203 | 203 | ); |
204 | - $template_args[ 'max_atndz' ] = $this->getMaxAttendees(); |
|
205 | - if ( $template_args[ 'max_atndz' ] < 1 ) { |
|
204 | + $template_args['max_atndz'] = $this->getMaxAttendees(); |
|
205 | + if ($template_args['max_atndz'] < 1) { |
|
206 | 206 | $sales_closed_msg = __( |
207 | 207 | 'We\'re sorry, but ticket sales have been closed at this time. Please check back again later.', |
208 | 208 | 'event_espresso' |
209 | 209 | ); |
210 | - if ( current_user_can( 'edit_post', $this->event->ID() ) ) { |
|
211 | - $link = get_edit_post_link( $this->event->ID() ); |
|
210 | + if (current_user_can('edit_post', $this->event->ID())) { |
|
211 | + $link = get_edit_post_link($this->event->ID()); |
|
212 | 212 | $sales_closed_msg .= sprintf( |
213 | 213 | __( |
214 | 214 | '%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', |
@@ -216,16 +216,16 @@ discard block |
||
216 | 216 | ), |
217 | 217 | '<div class="ee-attention" style="text-align: left;"><b>', |
218 | 218 | '</b><br />', |
219 | - $link = '<span class="edit-link"><a class="post-edit-link" href="' . $link . '">', |
|
219 | + $link = '<span class="edit-link"><a class="post-edit-link" href="'.$link.'">', |
|
220 | 220 | '</a></span></div>' |
221 | 221 | ); |
222 | 222 | } |
223 | - return '<p><span class="important-notice">' . $sales_closed_msg . '</span></p>'; |
|
223 | + return '<p><span class="important-notice">'.$sales_closed_msg.'</span></p>'; |
|
224 | 224 | } |
225 | - $templates[ 'ticket_selector' ] = TICKET_SELECTOR_TEMPLATES_PATH . 'ticket_selector_chart.template.php'; |
|
226 | - $templates[ 'ticket_selector' ] = apply_filters( |
|
225 | + $templates['ticket_selector'] = TICKET_SELECTOR_TEMPLATES_PATH.'ticket_selector_chart.template.php'; |
|
226 | + $templates['ticket_selector'] = apply_filters( |
|
227 | 227 | 'FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', |
228 | - $templates[ 'ticket_selector' ], |
|
228 | + $templates['ticket_selector'], |
|
229 | 229 | $this->event |
230 | 230 | ); |
231 | 231 | // redirecting to another site for registration ?? |
@@ -233,12 +233,12 @@ discard block |
||
233 | 233 | ? $this->event->external_url() |
234 | 234 | : ''; |
235 | 235 | // if not redirecting to another site for registration |
236 | - if ( ! $external_url ) { |
|
236 | + if ( ! $external_url) { |
|
237 | 237 | // then display the ticket selector |
238 | - $ticket_selector = \EEH_Template::locate_template( $templates[ 'ticket_selector' ], $template_args ); |
|
238 | + $ticket_selector = \EEH_Template::locate_template($templates['ticket_selector'], $template_args); |
|
239 | 239 | } else { |
240 | 240 | // if not we still need to trigger the display of the submit button |
241 | - add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' ); |
|
241 | + add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true'); |
|
242 | 242 | //display notice to admin that registration is external |
243 | 243 | $ticket_selector = ! is_admin() |
244 | 244 | ? '' |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | ? $this->formOpen( |
252 | 252 | $this->event->ID(), |
253 | 253 | $external_url |
254 | - ) . $ticket_selector |
|
254 | + ).$ticket_selector |
|
255 | 255 | : $ticket_selector; |
256 | 256 | // now set up the form (but not for the admin) |
257 | 257 | // submit button and form close tag |
@@ -270,36 +270,36 @@ discard block |
||
270 | 270 | * @param string $external_url |
271 | 271 | * @return string |
272 | 272 | */ |
273 | - public function formOpen( $ID = 0, $external_url = '' ) |
|
273 | + public function formOpen($ID = 0, $external_url = '') |
|
274 | 274 | { |
275 | 275 | // if redirecting, we don't need any anything else |
276 | - if ( $external_url ) { |
|
277 | - $html = '<form method="GET" action="' . \EEH_URL::refactor_url( $external_url ) . '">'; |
|
278 | - $query_args = \EEH_URL::get_query_string( $external_url ); |
|
279 | - foreach ( (array)$query_args as $query_arg => $value ) { |
|
280 | - $html .= '<input type="hidden" name="' . $query_arg . '" value="' . $value . '">'; |
|
276 | + if ($external_url) { |
|
277 | + $html = '<form method="GET" action="'.\EEH_URL::refactor_url($external_url).'">'; |
|
278 | + $query_args = \EEH_URL::get_query_string($external_url); |
|
279 | + foreach ((array) $query_args as $query_arg => $value) { |
|
280 | + $html .= '<input type="hidden" name="'.$query_arg.'" value="'.$value.'">'; |
|
281 | 281 | } |
282 | 282 | return $html; |
283 | 283 | } |
284 | 284 | // if there is no submit button, then don't start building a form |
285 | 285 | // because the "View Details" button will build its own form |
286 | - if ( ! apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) { |
|
286 | + if ( ! apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false)) { |
|
287 | 287 | return ''; |
288 | 288 | } |
289 | - $checkout_url = \EEH_Event_View::event_link_url( $ID ); |
|
290 | - if ( ! $checkout_url ) { |
|
289 | + $checkout_url = \EEH_Event_View::event_link_url($ID); |
|
290 | + if ( ! $checkout_url) { |
|
291 | 291 | \EE_Error::add_error( |
292 | - __( 'The URL for the Event Details page could not be retrieved.', 'event_espresso' ), |
|
292 | + __('The URL for the Event Details page could not be retrieved.', 'event_espresso'), |
|
293 | 293 | __FILE__, |
294 | 294 | __FUNCTION__, |
295 | 295 | __LINE__ |
296 | 296 | ); |
297 | 297 | } |
298 | 298 | $extra_params = $this->iframe ? ' target="_blank"' : ''; |
299 | - $html = '<form method="POST" action="' . $checkout_url . '"' . $extra_params . '>'; |
|
300 | - $html .= wp_nonce_field( 'process_ticket_selections', 'process_ticket_selections_nonce_' . $ID, true, false ); |
|
299 | + $html = '<form method="POST" action="'.$checkout_url.'"'.$extra_params.'>'; |
|
300 | + $html .= wp_nonce_field('process_ticket_selections', 'process_ticket_selections_nonce_'.$ID, true, false); |
|
301 | 301 | $html .= '<input type="hidden" name="ee" value="process_ticket_selections">'; |
302 | - $html = apply_filters( 'FHEE__EE_Ticket_Selector__ticket_selector_form_open__html', $html, $this->event ); |
|
302 | + $html = apply_filters('FHEE__EE_Ticket_Selector__ticket_selector_form_open__html', $html, $this->event); |
|
303 | 303 | return $html; |
304 | 304 | } |
305 | 305 | |
@@ -315,26 +315,26 @@ discard block |
||
315 | 315 | public function displaySubmitButton() |
316 | 316 | { |
317 | 317 | $html = ''; |
318 | - if ( ! is_admin() ) { |
|
318 | + if ( ! is_admin()) { |
|
319 | 319 | // standard TS displayed with submit button, ie: "Register Now" |
320 | - if ( apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) { |
|
320 | + if (apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false)) { |
|
321 | 321 | $btn_text = apply_filters( |
322 | 322 | 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit__btn_text', |
323 | - __( 'Register Now', 'event_espresso' ), |
|
323 | + __('Register Now', 'event_espresso'), |
|
324 | 324 | $this->event |
325 | 325 | ); |
326 | 326 | $external_url = $this->event->external_url(); |
327 | - $html .= '<input id="ticket-selector-submit-' . $this->event->ID() . '-btn"'; |
|
327 | + $html .= '<input id="ticket-selector-submit-'.$this->event->ID().'-btn"'; |
|
328 | 328 | $html .= ' class="ticket-selector-submit-btn '; |
329 | - $html .= empty( $external_url ) ? 'ticket-selector-submit-ajax"' : '"'; |
|
330 | - $html .= ' type="submit" value="' . $btn_text . '" />'; |
|
329 | + $html .= empty($external_url) ? 'ticket-selector-submit-ajax"' : '"'; |
|
330 | + $html .= ' type="submit" value="'.$btn_text.'" />'; |
|
331 | 331 | $html .= apply_filters( |
332 | 332 | 'FHEE__EE_Ticket_Selector__after_ticket_selector_submit', |
333 | 333 | '', |
334 | 334 | $this->event |
335 | 335 | ); |
336 | 336 | $html .= $this->ticketSelectorEndDiv(); |
337 | - $html .= '<br/>' . $this->formClose(); |
|
337 | + $html .= '<br/>'.$this->formClose(); |
|
338 | 338 | } else if ( |
339 | 339 | // a "Dude Where's my Ticket Selector?" (DWMTS) type event (ie: $_max_atndz === 1) |
340 | 340 | $this->getMaxAttendees() === 1 |
@@ -360,14 +360,14 @@ discard block |
||
360 | 360 | $html .= $this->ticketSelectorEndDiv(); |
361 | 361 | } else if ( |
362 | 362 | $this->getMaxAttendees() === 1 |
363 | - && apply_filters( 'FHEE__EE_Ticket_Selector__hide_ticket_selector', false ) |
|
363 | + && apply_filters('FHEE__EE_Ticket_Selector__hide_ticket_selector', false) |
|
364 | 364 | && ! is_single() |
365 | 365 | ) { |
366 | 366 | // this is a "Dude Where's my Ticket Selector?" (DWMTS) type event, |
367 | 367 | // but no tickets are available, so display event's "View Details" button. |
368 | 368 | // it is being viewed via somewhere other than a single post |
369 | - $html .= $this->displayViewDetailsButton( true ); |
|
370 | - } else if ( is_archive() ) { |
|
369 | + $html .= $this->displayViewDetailsButton(true); |
|
370 | + } else if (is_archive()) { |
|
371 | 371 | // event list, no tickets available so display event's "View Details" button |
372 | 372 | $html .= $this->ticketSelectorEndDiv(); |
373 | 373 | $html .= $this->displayViewDetailsButton(); |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | // no submit or view details button, and no additional content |
376 | 376 | $html .= $this->ticketSelectorEndDiv(); |
377 | 377 | } |
378 | - if ( ! $this->iframe && ! is_archive() ) { |
|
378 | + if ( ! $this->iframe && ! is_archive()) { |
|
379 | 379 | $html .= \EEH_Template::powered_by_event_espresso('', '', array('utm_content' => 'ticket_selector')); |
380 | 380 | } |
381 | 381 | } |
@@ -394,19 +394,19 @@ discard block |
||
394 | 394 | * @return string |
395 | 395 | * @throws \EE_Error |
396 | 396 | */ |
397 | - public function displayViewDetailsButton( $DWMTS = false ) |
|
397 | + public function displayViewDetailsButton($DWMTS = false) |
|
398 | 398 | { |
399 | - if ( ! $this->event->get_permalink() ) { |
|
399 | + if ( ! $this->event->get_permalink()) { |
|
400 | 400 | \EE_Error::add_error( |
401 | - __( 'The URL for the Event Details page could not be retrieved.', 'event_espresso' ), |
|
401 | + __('The URL for the Event Details page could not be retrieved.', 'event_espresso'), |
|
402 | 402 | __FILE__, __FUNCTION__, __LINE__ |
403 | 403 | ); |
404 | 404 | } |
405 | 405 | $extra_params = $this->iframe ? ' target="_blank"' : ''; |
406 | - $view_details_btn = '<form method="POST" action="' . $this->event->get_permalink() . '"'. $extra_params.'>'; |
|
406 | + $view_details_btn = '<form method="POST" action="'.$this->event->get_permalink().'"'.$extra_params.'>'; |
|
407 | 407 | $btn_text = apply_filters( |
408 | 408 | 'FHEE__EE_Ticket_Selector__display_view_details_btn__btn_text', |
409 | - __( 'View Details', 'event_espresso' ), |
|
409 | + __('View Details', 'event_espresso'), |
|
410 | 410 | $this->event |
411 | 411 | ); |
412 | 412 | $view_details_btn .= '<input id="ticket-selector-submit-' |
@@ -414,8 +414,8 @@ discard block |
||
414 | 414 | . '-btn" class="ticket-selector-submit-btn view-details-btn" type="submit" value="' |
415 | 415 | . $btn_text |
416 | 416 | . '" />'; |
417 | - $view_details_btn .= apply_filters( 'FHEE__EE_Ticket_Selector__after_view_details_btn', '', $this->event ); |
|
418 | - if ( $DWMTS ) { |
|
417 | + $view_details_btn .= apply_filters('FHEE__EE_Ticket_Selector__after_view_details_btn', '', $this->event); |
|
418 | + if ($DWMTS) { |
|
419 | 419 | $view_details_btn .= $this->formClose(); |
420 | 420 | $view_details_btn .= $this->ticketSelectorEndDiv(); |
421 | 421 | $view_details_btn .= '<br/>'; |