Completed
Branch master (148746)
by
unknown
08:25 queued 02:26
created
4_6_0_stages/EE_DMS_4_6_0_payment_method_currencies.dmsstage.php 2 patches
Indentation   +166 added lines, -166 removed lines patch added patch discarded remove patch
@@ -12,176 +12,176 @@
 block discarded – undo
12 12
  */
13 13
 class EE_DMS_4_6_0_payment_method_currencies extends EE_Data_Migration_Script_Stage
14 14
 {
15
-    protected $_currency_table_name;
16
-    protected $_currency_payment_method_table_name;
17
-    protected $_payment_method_table_name;
18
-    /**
19
-     * each key is the name of a 4.1-style gateway we know how to migrate to 4.6
20
-     * @var array
21
-     */
22
-    protected $_gateway_currencies = array(
23
-        'Aim' => array(
24
-            'AUD',
25
-            'USD',
26
-            'CAD',
27
-            'EUR',
28
-            'GBP',
29
-            'NZD',
30
-        ),
31
-        'Bank' => 'all',
32
-        'Check' => 'all',
33
-        'Invoice' => 'all',
34
-        'Mijireh' => 'all',
35
-        'Paypal_Pro' => array(
36
-            'USD',
37
-            'GBP',
38
-            'CAD',
39
-            'AUD',
40
-            'BRL',
41
-            'CHF',
42
-            'CZK',
43
-            'DKK',
44
-            'EUR',
45
-            'HKD',
46
-            'HUF',
47
-            'ILS',
48
-            'JPY',
49
-            'MXN',
50
-            'MYR',
51
-            'NOK',
52
-            'NZD',
53
-            'PHP',
54
-            'PLN',
55
-            'SEK',
56
-            'SGD',
57
-            'THB',
58
-            'TRY',
59
-            'TWD',
60
-        ),
61
-        'Paypal_Standard' => array(
62
-            'USD',
63
-            'GBP',
64
-            'CAD',
65
-            'AUD',
66
-            'BRL',
67
-            'CHF',
68
-            'CZK',
69
-            'DKK',
70
-            'EUR',
71
-            'HKD',
72
-            'HUF',
73
-            'ILS',
74
-            'JPY',
75
-            'MXN',
76
-            'MYR',
77
-            'NOK',
78
-            'NZD',
79
-            'PHP',
80
-            'PLN',
81
-            'SEK',
82
-            'SGD',
83
-            'THB',
84
-            'TRY',
85
-            'TWD'
86
-        )
87
-    );
88
-    public function __construct()
89
-    {
90
-        global $wpdb;
91
-        $this->_pretty_name = esc_html__('Payment Method Currencies', 'event_espresso');
92
-        $this->_payment_method_table_name = $wpdb->prefix . 'esp_payment_method';
93
-        $this->_currency_payment_method_table_name = $wpdb->prefix . 'esp_currency_payment_method';
94
-        $this->_currency_table_name = $wpdb->prefix . 'esp_currency';
95
-        parent::__construct();
96
-    }
15
+	protected $_currency_table_name;
16
+	protected $_currency_payment_method_table_name;
17
+	protected $_payment_method_table_name;
18
+	/**
19
+	 * each key is the name of a 4.1-style gateway we know how to migrate to 4.6
20
+	 * @var array
21
+	 */
22
+	protected $_gateway_currencies = array(
23
+		'Aim' => array(
24
+			'AUD',
25
+			'USD',
26
+			'CAD',
27
+			'EUR',
28
+			'GBP',
29
+			'NZD',
30
+		),
31
+		'Bank' => 'all',
32
+		'Check' => 'all',
33
+		'Invoice' => 'all',
34
+		'Mijireh' => 'all',
35
+		'Paypal_Pro' => array(
36
+			'USD',
37
+			'GBP',
38
+			'CAD',
39
+			'AUD',
40
+			'BRL',
41
+			'CHF',
42
+			'CZK',
43
+			'DKK',
44
+			'EUR',
45
+			'HKD',
46
+			'HUF',
47
+			'ILS',
48
+			'JPY',
49
+			'MXN',
50
+			'MYR',
51
+			'NOK',
52
+			'NZD',
53
+			'PHP',
54
+			'PLN',
55
+			'SEK',
56
+			'SGD',
57
+			'THB',
58
+			'TRY',
59
+			'TWD',
60
+		),
61
+		'Paypal_Standard' => array(
62
+			'USD',
63
+			'GBP',
64
+			'CAD',
65
+			'AUD',
66
+			'BRL',
67
+			'CHF',
68
+			'CZK',
69
+			'DKK',
70
+			'EUR',
71
+			'HKD',
72
+			'HUF',
73
+			'ILS',
74
+			'JPY',
75
+			'MXN',
76
+			'MYR',
77
+			'NOK',
78
+			'NZD',
79
+			'PHP',
80
+			'PLN',
81
+			'SEK',
82
+			'SGD',
83
+			'THB',
84
+			'TRY',
85
+			'TWD'
86
+		)
87
+	);
88
+	public function __construct()
89
+	{
90
+		global $wpdb;
91
+		$this->_pretty_name = esc_html__('Payment Method Currencies', 'event_espresso');
92
+		$this->_payment_method_table_name = $wpdb->prefix . 'esp_payment_method';
93
+		$this->_currency_payment_method_table_name = $wpdb->prefix . 'esp_currency_payment_method';
94
+		$this->_currency_table_name = $wpdb->prefix . 'esp_currency';
95
+		parent::__construct();
96
+	}
97 97
 
98
-    protected function _count_records_to_migrate()
99
-    {
100
-        $count = 0;
101
-        foreach ($this->_gateway_currencies as $currencies) {
102
-            if ($currencies == 'all') {
103
-                $currencies = $this->_get_all_currencies();
104
-            }
105
-            $count += count($currencies);
106
-        }
107
-        return $count;
108
-    }
98
+	protected function _count_records_to_migrate()
99
+	{
100
+		$count = 0;
101
+		foreach ($this->_gateway_currencies as $currencies) {
102
+			if ($currencies == 'all') {
103
+				$currencies = $this->_get_all_currencies();
104
+			}
105
+			$count += count($currencies);
106
+		}
107
+		return $count;
108
+	}
109 109
 
110 110
 
111 111
 
112
-    protected function _migration_step($num_items_to_migrate = 50)
113
-    {
114
-        $items_actually_migrated = 0;
115
-        $relations_to_add_this_step = $this->_gather_relations_to_add($num_items_to_migrate);
116
-        foreach ($relations_to_add_this_step as $pm_slug => $currencies) {
117
-            $id = $this->get_migration_script()->get_mapping_new_pk('EE_Gateway_Config', $pm_slug, $this->_payment_method_table_name);
118
-            foreach ($currencies as $currency) {
119
-                if ($id) {
120
-                    $this->_add_currency_relations($id, $currency);
121
-                }
122
-                $items_actually_migrated++;
123
-            }
124
-        }
125
-        if ($this->count_records_migrated() + $items_actually_migrated >= $this->count_records_to_migrate()) {
126
-            $this->set_completed();
127
-        }
128
-        return $items_actually_migrated;
129
-    }
112
+	protected function _migration_step($num_items_to_migrate = 50)
113
+	{
114
+		$items_actually_migrated = 0;
115
+		$relations_to_add_this_step = $this->_gather_relations_to_add($num_items_to_migrate);
116
+		foreach ($relations_to_add_this_step as $pm_slug => $currencies) {
117
+			$id = $this->get_migration_script()->get_mapping_new_pk('EE_Gateway_Config', $pm_slug, $this->_payment_method_table_name);
118
+			foreach ($currencies as $currency) {
119
+				if ($id) {
120
+					$this->_add_currency_relations($id, $currency);
121
+				}
122
+				$items_actually_migrated++;
123
+			}
124
+		}
125
+		if ($this->count_records_migrated() + $items_actually_migrated >= $this->count_records_to_migrate()) {
126
+			$this->set_completed();
127
+		}
128
+		return $items_actually_migrated;
129
+	}
130 130
 
131
-    private function _gather_relations_to_add($num_items_to_migrate)
132
-    {
133
-        $relations_to_add_this_step = array();
134
-        $migrate_up_to_count = $this->count_records_migrated() + $num_items_to_migrate;
135
-        $iterator = 0;
136
-        foreach ($this->_gateway_currencies as $pm_slug => $currencies) {
137
-            if ($currencies == 'all') {
138
-                $currencies = $this->_get_all_currencies();
139
-            }
140
-            foreach ($currencies as $currency_code) {
141
-                if (
142
-                    $this->count_records_migrated() <= $iterator &&
143
-                        $iterator < $migrate_up_to_count
144
-                ) {
145
-                    $relations_to_add_this_step[ $pm_slug ] [] = $currency_code;
146
-                }
147
-                $iterator++;
148
-            }
149
-        }
150
-        return $relations_to_add_this_step;
151
-    }
152
-    /**
153
-     * Gets all the currency codes in the database
154
-     * @return array
155
-     */
156
-    private function _get_all_currencies()
157
-    {
158
-        global $wpdb;
159
-        $currencies = $wpdb->get_col("SELECT CUR_code FROM {$this->_currency_table_name}");
160
-        return $currencies;
161
-    }
131
+	private function _gather_relations_to_add($num_items_to_migrate)
132
+	{
133
+		$relations_to_add_this_step = array();
134
+		$migrate_up_to_count = $this->count_records_migrated() + $num_items_to_migrate;
135
+		$iterator = 0;
136
+		foreach ($this->_gateway_currencies as $pm_slug => $currencies) {
137
+			if ($currencies == 'all') {
138
+				$currencies = $this->_get_all_currencies();
139
+			}
140
+			foreach ($currencies as $currency_code) {
141
+				if (
142
+					$this->count_records_migrated() <= $iterator &&
143
+						$iterator < $migrate_up_to_count
144
+				) {
145
+					$relations_to_add_this_step[ $pm_slug ] [] = $currency_code;
146
+				}
147
+				$iterator++;
148
+			}
149
+		}
150
+		return $relations_to_add_this_step;
151
+	}
152
+	/**
153
+	 * Gets all the currency codes in the database
154
+	 * @return array
155
+	 */
156
+	private function _get_all_currencies()
157
+	{
158
+		global $wpdb;
159
+		$currencies = $wpdb->get_col("SELECT CUR_code FROM {$this->_currency_table_name}");
160
+		return $currencies;
161
+	}
162 162
 
163
-    /**
164
-     * Adds teh relation between the payment method and the currencies it can be used for
165
-     * @param int $id
166
-     * @param string $gateway_slug
167
-     */
168
-    private function _add_currency_relations($pm_id, $currency_code)
169
-    {
170
-        global $wpdb;
171
-        $cur_pm_relation = array(
172
-                    'CUR_code' => $currency_code,
173
-                    'PMD_ID' => $pm_id,
174
-                );
175
-        $success = $wpdb->insert(
176
-            $this->_currency_payment_method_table_name,
177
-            $cur_pm_relation,
178
-            array(
179
-                    '%s',// CUR_code
180
-                    '%d',// PMD_ID
181
-                )
182
-        );
183
-        if (! $success) {
184
-            $this->add_error(sprintf(esc_html__('Could not add currency relation %s because %s', "event_espresso"), wp_json_encode($cur_pm_relation), $wpdb->last_error));
185
-        }
186
-    }
163
+	/**
164
+	 * Adds teh relation between the payment method and the currencies it can be used for
165
+	 * @param int $id
166
+	 * @param string $gateway_slug
167
+	 */
168
+	private function _add_currency_relations($pm_id, $currency_code)
169
+	{
170
+		global $wpdb;
171
+		$cur_pm_relation = array(
172
+					'CUR_code' => $currency_code,
173
+					'PMD_ID' => $pm_id,
174
+				);
175
+		$success = $wpdb->insert(
176
+			$this->_currency_payment_method_table_name,
177
+			$cur_pm_relation,
178
+			array(
179
+					'%s',// CUR_code
180
+					'%d',// PMD_ID
181
+				)
182
+		);
183
+		if (! $success) {
184
+			$this->add_error(sprintf(esc_html__('Could not add currency relation %s because %s', "event_espresso"), wp_json_encode($cur_pm_relation), $wpdb->last_error));
185
+		}
186
+	}
187 187
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
     {
90 90
         global $wpdb;
91 91
         $this->_pretty_name = esc_html__('Payment Method Currencies', 'event_espresso');
92
-        $this->_payment_method_table_name = $wpdb->prefix . 'esp_payment_method';
93
-        $this->_currency_payment_method_table_name = $wpdb->prefix . 'esp_currency_payment_method';
94
-        $this->_currency_table_name = $wpdb->prefix . 'esp_currency';
92
+        $this->_payment_method_table_name = $wpdb->prefix.'esp_payment_method';
93
+        $this->_currency_payment_method_table_name = $wpdb->prefix.'esp_currency_payment_method';
94
+        $this->_currency_table_name = $wpdb->prefix.'esp_currency';
95 95
         parent::__construct();
96 96
     }
97 97
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
                     $this->count_records_migrated() <= $iterator &&
143 143
                         $iterator < $migrate_up_to_count
144 144
                 ) {
145
-                    $relations_to_add_this_step[ $pm_slug ] [] = $currency_code;
145
+                    $relations_to_add_this_step[$pm_slug] [] = $currency_code;
146 146
                 }
147 147
                 $iterator++;
148 148
             }
@@ -176,11 +176,11 @@  discard block
 block discarded – undo
176 176
             $this->_currency_payment_method_table_name,
177 177
             $cur_pm_relation,
178 178
             array(
179
-                    '%s',// CUR_code
180
-                    '%d',// PMD_ID
179
+                    '%s', // CUR_code
180
+                    '%d', // PMD_ID
181 181
                 )
182 182
         );
183
-        if (! $success) {
183
+        if ( ! $success) {
184 184
             $this->add_error(sprintf(esc_html__('Could not add currency relation %s because %s', "event_espresso"), wp_json_encode($cur_pm_relation), $wpdb->last_error));
185 185
         }
186 186
     }
Please login to merge, or discard this patch.
4_6_0_stages/EE_DMS_4_6_0_country_system_question.dmsstage.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     {
24 24
         global $wpdb;
25 25
         $this->_pretty_name = esc_html__('Country - System Question', 'event_espresso');
26
-        $this->_old_table = $wpdb->prefix . 'esp_question';
26
+        $this->_old_table = $wpdb->prefix.'esp_question';
27 27
         $this->_extra_where_sql = "WHERE QST_system = 'country'";
28 28
         parent::__construct();
29 29
     }
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
             global $wpdb;
42 42
             $success = $wpdb->update(
43 43
                 $this->_old_table,
44
-                array( 'QST_type' => 'COUNTRY' ),  // data
45
-                array( 'QST_ID' => $question['QST_ID'] ),  // where
46
-                array( '%s' ),   // data format
47
-                array( '%d' )  // where format
44
+                array('QST_type' => 'COUNTRY'), // data
45
+                array('QST_ID' => $question['QST_ID']), // where
46
+                array('%s'), // data format
47
+                array('%d')  // where format
48 48
             );
49
-            if (! $success) {
49
+            if ( ! $success) {
50 50
                 $this->add_error(
51 51
                     sprintf(
52 52
                         esc_html__('Could not update question system name "%1$s" for question ID=%2$d because "%3$s"', 'event_espresso'),
Please login to merge, or discard this patch.
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -11,48 +11,48 @@
 block discarded – undo
11 11
  */
12 12
 class EE_DMS_4_6_0_country_system_question extends EE_Data_Migration_Script_Stage_Table
13 13
 {
14
-    /**
15
-     * Just initializes the status of the migration
16
-     *
17
-     * @return EE_DMS_4_6_0_country_system_question
18
-     */
19
-    public function __construct()
20
-    {
21
-        global $wpdb;
22
-        $this->_pretty_name = esc_html__('Country - System Question', 'event_espresso');
23
-        $this->_old_table = $wpdb->prefix . 'esp_question';
24
-        $this->_extra_where_sql = "WHERE QST_system = 'country'";
25
-        parent::__construct();
26
-    }
14
+	/**
15
+	 * Just initializes the status of the migration
16
+	 *
17
+	 * @return EE_DMS_4_6_0_country_system_question
18
+	 */
19
+	public function __construct()
20
+	{
21
+		global $wpdb;
22
+		$this->_pretty_name = esc_html__('Country - System Question', 'event_espresso');
23
+		$this->_old_table = $wpdb->prefix . 'esp_question';
24
+		$this->_extra_where_sql = "WHERE QST_system = 'country'";
25
+		parent::__construct();
26
+	}
27 27
 
28 28
 
29 29
 
30
-    /**
31
-     * updates the question with the new question type
32
-     * @param array $question an associative array where keys are column names and values are their values.
33
-     * @return null
34
-     */
35
-    protected function _migrate_old_row($question)
36
-    {
37
-        if ($question['QST_ID'] && $question['QST_system'] == 'country') {
38
-            global $wpdb;
39
-            $success = $wpdb->update(
40
-                $this->_old_table,
41
-                array( 'QST_type' => 'COUNTRY' ),  // data
42
-                array( 'QST_ID' => $question['QST_ID'] ),  // where
43
-                array( '%s' ),   // data format
44
-                array( '%d' )  // where format
45
-            );
46
-            if (! $success) {
47
-                $this->add_error(
48
-                    sprintf(
49
-                        esc_html__('Could not update question system name "%1$s" for question ID=%2$d because "%3$s"', 'event_espresso'),
50
-                        wp_json_encode($question['QST_system']),
51
-                        $question['QST_ID'],
52
-                        $wpdb->last_error
53
-                    )
54
-                );
55
-            }
56
-        }
57
-    }
30
+	/**
31
+	 * updates the question with the new question type
32
+	 * @param array $question an associative array where keys are column names and values are their values.
33
+	 * @return null
34
+	 */
35
+	protected function _migrate_old_row($question)
36
+	{
37
+		if ($question['QST_ID'] && $question['QST_system'] == 'country') {
38
+			global $wpdb;
39
+			$success = $wpdb->update(
40
+				$this->_old_table,
41
+				array( 'QST_type' => 'COUNTRY' ),  // data
42
+				array( 'QST_ID' => $question['QST_ID'] ),  // where
43
+				array( '%s' ),   // data format
44
+				array( '%d' )  // where format
45
+			);
46
+			if (! $success) {
47
+				$this->add_error(
48
+					sprintf(
49
+						esc_html__('Could not update question system name "%1$s" for question ID=%2$d because "%3$s"', 'event_espresso'),
50
+						wp_json_encode($question['QST_system']),
51
+						$question['QST_ID'],
52
+						$wpdb->last_error
53
+					)
54
+				);
55
+			}
56
+		}
57
+	}
58 58
 }
Please login to merge, or discard this patch.
4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_question_groups.dmsstage.php 2 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -9,39 +9,39 @@
 block discarded – undo
9 9
 */
10 10
 class EE_DMS_4_5_0_update_wp_user_for_question_groups extends EE_Data_Migration_Script_Stage_Table
11 11
 {
12
-    public function __construct()
13
-    {
14
-        global $wpdb;
15
-        $this->_pretty_name = esc_html__("Question Groups", "event_espresso");
16
-        $this->_old_table = $wpdb->prefix . "esp_question_group";
17
-        parent::__construct();
18
-    }
19
-    protected function _migrate_old_row($old_row)
20
-    {
21
-        // foreach ticket row we add the id for the current logged in user.
22
-        global $wpdb;
23
-        $user_id = EEH_Activation::get_default_creator_id();
24
-        $updated = $wpdb->update(
25
-            $this->_old_table,
26
-            array('QSG_wp_user' => $user_id),
27
-            array('QSG_ID' => $old_row['QSG_ID']),
28
-            array('%d',// QSG_wp_user
29
-                    ),
30
-            array('%d',// QSG_ID
31
-                    )
32
-        );
33
-        if (false === $updated) {
34
-            $this->add_error(
35
-                sprintf(
36
-                    esc_html__(
37
-                        "Error in updating table %s setting QSG_wp_user = %d where QSG_ID = %d",
38
-                        'event_espresso'
39
-                    ),
40
-                    $this->_old_table,
41
-                    $user_id,
42
-                    $old_row['QSG_ID']
43
-                )
44
-            );
45
-        }
46
-    }
12
+	public function __construct()
13
+	{
14
+		global $wpdb;
15
+		$this->_pretty_name = esc_html__("Question Groups", "event_espresso");
16
+		$this->_old_table = $wpdb->prefix . "esp_question_group";
17
+		parent::__construct();
18
+	}
19
+	protected function _migrate_old_row($old_row)
20
+	{
21
+		// foreach ticket row we add the id for the current logged in user.
22
+		global $wpdb;
23
+		$user_id = EEH_Activation::get_default_creator_id();
24
+		$updated = $wpdb->update(
25
+			$this->_old_table,
26
+			array('QSG_wp_user' => $user_id),
27
+			array('QSG_ID' => $old_row['QSG_ID']),
28
+			array('%d',// QSG_wp_user
29
+					),
30
+			array('%d',// QSG_ID
31
+					)
32
+		);
33
+		if (false === $updated) {
34
+			$this->add_error(
35
+				sprintf(
36
+					esc_html__(
37
+						"Error in updating table %s setting QSG_wp_user = %d where QSG_ID = %d",
38
+						'event_espresso'
39
+					),
40
+					$this->_old_table,
41
+					$user_id,
42
+					$old_row['QSG_ID']
43
+				)
44
+			);
45
+		}
46
+	}
47 47
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     {
14 14
         global $wpdb;
15 15
         $this->_pretty_name = esc_html__("Question Groups", "event_espresso");
16
-        $this->_old_table = $wpdb->prefix . "esp_question_group";
16
+        $this->_old_table = $wpdb->prefix."esp_question_group";
17 17
         parent::__construct();
18 18
     }
19 19
     protected function _migrate_old_row($old_row)
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
             $this->_old_table,
26 26
             array('QSG_wp_user' => $user_id),
27 27
             array('QSG_ID' => $old_row['QSG_ID']),
28
-            array('%d',// QSG_wp_user
28
+            array('%d', // QSG_wp_user
29 29
                     ),
30
-            array('%d',// QSG_ID
30
+            array('%d', // QSG_ID
31 31
                     )
32 32
         );
33 33
         if (false === $updated) {
Please login to merge, or discard this patch.
4_5_0_stages/EE_DMS_4_5_0_invoice_settings.dmsstage.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
     protected function _migration_step($num_items = 1)
55 55
     {
56 56
         // if this isn't set then something is really wrong
57
-        if (! EE_Config::instance()->gateway instanceof EE_Gateway_Config) {
57
+        if ( ! EE_Config::instance()->gateway instanceof EE_Gateway_Config) {
58 58
             throw new EE_Error(esc_html__('It appears the Event Espresso Core Configuration is not setup correctly.', 'event_espresso'));
59 59
         }
60 60
         $invoice_settings = isset(EE_Config::instance()->gateway->payment_settings['Invoice']) ? EE_Config::instance()->gateway->payment_settings['Invoice'] : null;
61
-        if (! $invoice_settings) {
61
+        if ( ! $invoice_settings) {
62 62
             $this->add_error(esc_html__('Could not migrate EE4.4 invoice settings to EE4.5 because they didnt exist', 'event_espresso'));
63 63
         } else {
64 64
             $invoice_settings['template_payment_instructions'] = $invoice_settings['pdf_instructions'];
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
                 );
94 94
             }
95 95
             $templates_relative_path = 'modules/gateways/Invoice/lib/templates/';
96
-            $overridden_invoice_body = EEH_Template::locate_template($templates_relative_path . 'invoice_body.template.php', null, false, false, true);
97
-            $overridden_receipt_body = EEH_Template::locate_template($templates_relative_path . 'receipt_body.template.php', null, false, false, true);
96
+            $overridden_invoice_body = EEH_Template::locate_template($templates_relative_path.'invoice_body.template.php', null, false, false, true);
97
+            $overridden_receipt_body = EEH_Template::locate_template($templates_relative_path.'receipt_body.template.php', null, false, false, true);
98 98
             if ($overridden_invoice_body || $overridden_receipt_body) {
99 99
                 new PersistentAdminNotice(
100 100
                     'invoice_overriding_templates',
Please login to merge, or discard this patch.
Indentation   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -16,97 +16,97 @@
 block discarded – undo
16 16
  */
17 17
 class EE_DMS_4_5_0_invoice_settings extends EE_Data_Migration_Script_Stage
18 18
 {
19
-    /**
20
-     * Just initializes the status of the migration
21
-     */
22
-    public function __construct()
23
-    {
24
-        $this->_pretty_name = esc_html__('Update Invoice Gateway Settings', 'event_espresso');
25
-        parent::__construct();
26
-    }
19
+	/**
20
+	 * Just initializes the status of the migration
21
+	 */
22
+	public function __construct()
23
+	{
24
+		$this->_pretty_name = esc_html__('Update Invoice Gateway Settings', 'event_espresso');
25
+		parent::__construct();
26
+	}
27 27
 
28 28
 
29 29
 
30
-    /**
31
-     * _count_records_to_migrate
32
-     * Counts the records to migrate; the public version may cache it
33
-     *
34
-     * @access protected
35
-     * @return int
36
-     */
37
-    protected function _count_records_to_migrate()
38
-    {
39
-        return 1;
40
-    }
30
+	/**
31
+	 * _count_records_to_migrate
32
+	 * Counts the records to migrate; the public version may cache it
33
+	 *
34
+	 * @access protected
35
+	 * @return int
36
+	 */
37
+	protected function _count_records_to_migrate()
38
+	{
39
+		return 1;
40
+	}
41 41
 
42 42
 
43 43
 
44
-    /**
45
-     *    _migration_step
46
-     *
47
-     * @access protected
48
-     * @param int $num_items
49
-     * @throws EE_Error
50
-     * @return int number of items ACTUALLY migrated
51
-     * @throws InvalidDataTypeException
52
-     */
53
-    protected function _migration_step($num_items = 1)
54
-    {
55
-        // if this isn't set then something is really wrong
56
-        if (! EE_Config::instance()->gateway instanceof EE_Gateway_Config) {
57
-            throw new EE_Error(esc_html__('It appears the Event Espresso Core Configuration is not setup correctly.', 'event_espresso'));
58
-        }
59
-        $invoice_settings = isset(EE_Config::instance()->gateway->payment_settings['Invoice']) ? EE_Config::instance()->gateway->payment_settings['Invoice'] : null;
60
-        if (! $invoice_settings) {
61
-            $this->add_error(esc_html__('Could not migrate EE4.4 invoice settings to EE4.5 because they didnt exist', 'event_espresso'));
62
-        } else {
63
-            $invoice_settings['template_payment_instructions'] = $invoice_settings['pdf_instructions'];
64
-            $invoice_settings['template_invoice_payee_name'] = $invoice_settings['payable_to'];
65
-            $invoice_settings['template_invoice_address'] = $invoice_settings['payment_address'];
66
-            $invoice_settings['template_invoice_email'] = '';
67
-            $invoice_settings['template_invoice_tax_number'] = '';
68
-            unset($invoice_settings['pdf_instructions']);
69
-            unset($invoice_settings['payable_to']);
70
-            unset($invoice_settings['payment_address']);
71
-            EE_Config::instance()->gateway->payment_settings['Invoice'] = $invoice_settings;
72
-            EE_Config::instance()->update_espresso_config(false, false);
44
+	/**
45
+	 *    _migration_step
46
+	 *
47
+	 * @access protected
48
+	 * @param int $num_items
49
+	 * @throws EE_Error
50
+	 * @return int number of items ACTUALLY migrated
51
+	 * @throws InvalidDataTypeException
52
+	 */
53
+	protected function _migration_step($num_items = 1)
54
+	{
55
+		// if this isn't set then something is really wrong
56
+		if (! EE_Config::instance()->gateway instanceof EE_Gateway_Config) {
57
+			throw new EE_Error(esc_html__('It appears the Event Espresso Core Configuration is not setup correctly.', 'event_espresso'));
58
+		}
59
+		$invoice_settings = isset(EE_Config::instance()->gateway->payment_settings['Invoice']) ? EE_Config::instance()->gateway->payment_settings['Invoice'] : null;
60
+		if (! $invoice_settings) {
61
+			$this->add_error(esc_html__('Could not migrate EE4.4 invoice settings to EE4.5 because they didnt exist', 'event_espresso'));
62
+		} else {
63
+			$invoice_settings['template_payment_instructions'] = $invoice_settings['pdf_instructions'];
64
+			$invoice_settings['template_invoice_payee_name'] = $invoice_settings['payable_to'];
65
+			$invoice_settings['template_invoice_address'] = $invoice_settings['payment_address'];
66
+			$invoice_settings['template_invoice_email'] = '';
67
+			$invoice_settings['template_invoice_tax_number'] = '';
68
+			unset($invoice_settings['pdf_instructions']);
69
+			unset($invoice_settings['payable_to']);
70
+			unset($invoice_settings['payment_address']);
71
+			EE_Config::instance()->gateway->payment_settings['Invoice'] = $invoice_settings;
72
+			EE_Config::instance()->update_espresso_config(false, false);
73 73
 
74
-            // @todo: check 'invoice_css' too because we can't easily affect that so we might need to set a persistent notice
75
-            // (why is it tough to change? because we want to update the receipt and invoice message template, but
76
-            // message templates are only initialized AFTER migrations and those two are new in 4.5. So if we wanted to
77
-            // update them from a DMS, we'd need to have the DMS create the message templates which is quite a lot of code;
78
-            // also we don't want to build a dependency on the messages code because it is likely to change soon
79
-            if (
80
-                isset($invoice_settings['invoice_css'])
81
-                && ! in_array($invoice_settings['invoice_css'], ['', 'simple.css'])
82
-            ) {
83
-                new PersistentAdminNotice(
84
-                    'invoice_css_not_updated',
85
-                    sprintf(
86
-                        esc_html__(
87
-                            'You had previously set your Invoice Payment Method\'s stylesheet to be %1$s, but that setting has moved. PDF and HTML Invoices and Receipts are now Messages, which means you can easily modify them from your Wordpress Dashboard instead of using filters or uploading template files. Please visit Messages -> Receipt and Messages -> Invoice to change their stylesheets.',
88
-                            'event_espresso'
89
-                        ),
90
-                        $invoice_settings['invoice_css']
91
-                    )
92
-                );
93
-            }
94
-            $templates_relative_path = 'modules/gateways/Invoice/lib/templates/';
95
-            $overridden_invoice_body = EEH_Template::locate_template($templates_relative_path . 'invoice_body.template.php', null, false, false, true);
96
-            $overridden_receipt_body = EEH_Template::locate_template($templates_relative_path . 'receipt_body.template.php', null, false, false, true);
97
-            if ($overridden_invoice_body || $overridden_receipt_body) {
98
-                new PersistentAdminNotice(
99
-                    'invoice_overriding_templates',
100
-                    esc_html__(
101
-                        'Note: in this version of Event Espresso, PDF and HTML Invoices and Receipts are now Messages and can be changed just like any other messages; however we noticed you had previously overridden the old default Invoice/Receipt templates. Because of this, your old Invoice/Receipt templates will continue to be used INSTEAD of the new Invoice/Receipt message equivalents. We recommend deleting your old Invoice/Receipt templates and modifying the new Invoice and Receipt messages\'s content in Messages -> Invoice and Messages -> Receipt.',
102
-                        'event_espresso'
103
-                    ),
104
-                    true
105
-                );
106
-            }
107
-        }
108
-        // regardless of whether it worked or not, we ought to continue the migration
109
-        $this->set_completed();
110
-        return 1;
111
-    }
74
+			// @todo: check 'invoice_css' too because we can't easily affect that so we might need to set a persistent notice
75
+			// (why is it tough to change? because we want to update the receipt and invoice message template, but
76
+			// message templates are only initialized AFTER migrations and those two are new in 4.5. So if we wanted to
77
+			// update them from a DMS, we'd need to have the DMS create the message templates which is quite a lot of code;
78
+			// also we don't want to build a dependency on the messages code because it is likely to change soon
79
+			if (
80
+				isset($invoice_settings['invoice_css'])
81
+				&& ! in_array($invoice_settings['invoice_css'], ['', 'simple.css'])
82
+			) {
83
+				new PersistentAdminNotice(
84
+					'invoice_css_not_updated',
85
+					sprintf(
86
+						esc_html__(
87
+							'You had previously set your Invoice Payment Method\'s stylesheet to be %1$s, but that setting has moved. PDF and HTML Invoices and Receipts are now Messages, which means you can easily modify them from your Wordpress Dashboard instead of using filters or uploading template files. Please visit Messages -> Receipt and Messages -> Invoice to change their stylesheets.',
88
+							'event_espresso'
89
+						),
90
+						$invoice_settings['invoice_css']
91
+					)
92
+				);
93
+			}
94
+			$templates_relative_path = 'modules/gateways/Invoice/lib/templates/';
95
+			$overridden_invoice_body = EEH_Template::locate_template($templates_relative_path . 'invoice_body.template.php', null, false, false, true);
96
+			$overridden_receipt_body = EEH_Template::locate_template($templates_relative_path . 'receipt_body.template.php', null, false, false, true);
97
+			if ($overridden_invoice_body || $overridden_receipt_body) {
98
+				new PersistentAdminNotice(
99
+					'invoice_overriding_templates',
100
+					esc_html__(
101
+						'Note: in this version of Event Espresso, PDF and HTML Invoices and Receipts are now Messages and can be changed just like any other messages; however we noticed you had previously overridden the old default Invoice/Receipt templates. Because of this, your old Invoice/Receipt templates will continue to be used INSTEAD of the new Invoice/Receipt message equivalents. We recommend deleting your old Invoice/Receipt templates and modifying the new Invoice and Receipt messages\'s content in Messages -> Invoice and Messages -> Receipt.',
102
+						'event_espresso'
103
+					),
104
+					true
105
+				);
106
+			}
107
+		}
108
+		// regardless of whether it worked or not, we ought to continue the migration
109
+		$this->set_completed();
110
+		return 1;
111
+	}
112 112
 }
Please login to merge, or discard this patch.
4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_tickets.dmsstage.php 2 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -9,39 +9,39 @@
 block discarded – undo
9 9
 */
10 10
 class EE_DMS_4_5_0_update_wp_user_for_tickets extends EE_Data_Migration_Script_Stage_Table
11 11
 {
12
-    public function __construct()
13
-    {
14
-        global $wpdb;
15
-        $this->_pretty_name = esc_html__("Tickets", "event_espresso");
16
-        $this->_old_table = $wpdb->prefix . "esp_ticket";
17
-        parent::__construct();
18
-    }
19
-    protected function _migrate_old_row($old_row)
20
-    {
21
-        // foreach ticket row we add the id for the current logged in user.
22
-        global $wpdb;
23
-        $user_id = EEH_Activation::get_default_creator_id();
24
-        $updated = $wpdb->update(
25
-            $this->_old_table,
26
-            array('TKT_wp_user' => $user_id),
27
-            array('TKT_ID' => $old_row['TKT_ID']),
28
-            array('%d',// TKT_wp_user
29
-                    ),
30
-            array('%d',// TKT_ID
31
-                    )
32
-        );
33
-        if (false === $updated) {
34
-            $this->add_error(
35
-                sprintf(
36
-                    esc_html__(
37
-                        "Error in updating table %s setting TKT_wp_user = %d where TKT_ID = %d",
38
-                        'event_espresso'
39
-                    ),
40
-                    $this->_old_table,
41
-                    $user_id,
42
-                    $old_row['TKT_ID']
43
-                )
44
-            );
45
-        }
46
-    }
12
+	public function __construct()
13
+	{
14
+		global $wpdb;
15
+		$this->_pretty_name = esc_html__("Tickets", "event_espresso");
16
+		$this->_old_table = $wpdb->prefix . "esp_ticket";
17
+		parent::__construct();
18
+	}
19
+	protected function _migrate_old_row($old_row)
20
+	{
21
+		// foreach ticket row we add the id for the current logged in user.
22
+		global $wpdb;
23
+		$user_id = EEH_Activation::get_default_creator_id();
24
+		$updated = $wpdb->update(
25
+			$this->_old_table,
26
+			array('TKT_wp_user' => $user_id),
27
+			array('TKT_ID' => $old_row['TKT_ID']),
28
+			array('%d',// TKT_wp_user
29
+					),
30
+			array('%d',// TKT_ID
31
+					)
32
+		);
33
+		if (false === $updated) {
34
+			$this->add_error(
35
+				sprintf(
36
+					esc_html__(
37
+						"Error in updating table %s setting TKT_wp_user = %d where TKT_ID = %d",
38
+						'event_espresso'
39
+					),
40
+					$this->_old_table,
41
+					$user_id,
42
+					$old_row['TKT_ID']
43
+				)
44
+			);
45
+		}
46
+	}
47 47
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     {
14 14
         global $wpdb;
15 15
         $this->_pretty_name = esc_html__("Tickets", "event_espresso");
16
-        $this->_old_table = $wpdb->prefix . "esp_ticket";
16
+        $this->_old_table = $wpdb->prefix."esp_ticket";
17 17
         parent::__construct();
18 18
     }
19 19
     protected function _migrate_old_row($old_row)
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
             $this->_old_table,
26 26
             array('TKT_wp_user' => $user_id),
27 27
             array('TKT_ID' => $old_row['TKT_ID']),
28
-            array('%d',// TKT_wp_user
28
+            array('%d', // TKT_wp_user
29 29
                     ),
30
-            array('%d',// TKT_ID
30
+            array('%d', // TKT_ID
31 31
                     )
32 32
         );
33 33
         if (false === $updated) {
Please login to merge, or discard this patch.
4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_price_types.dmsstage.php 2 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -9,36 +9,36 @@
 block discarded – undo
9 9
 */
10 10
 class EE_DMS_4_5_0_update_wp_user_for_price_types extends EE_Data_Migration_Script_Stage_Table
11 11
 {
12
-    public function __construct()
13
-    {
14
-        global $wpdb;
15
-        $this->_pretty_name = esc_html__("Price Types", "event_espresso");
16
-        $this->_old_table = $wpdb->prefix . "esp_price_type";
17
-        parent::__construct();
18
-    }
19
-    protected function _migrate_old_row($old_row)
20
-    {
21
-        // foreach ticket row we add the id for the current logged in user.
22
-        global $wpdb;
23
-        $user_id = EEH_Activation::get_default_creator_id();
24
-        $updated = $wpdb->update(
25
-            $this->_old_table,
26
-            array('PRT_wp_user' => $user_id),
27
-            array('PRT_ID' => $old_row['PRT_ID']),
28
-            array('%d',// PRT_wp_user
29
-                    ),
30
-            array('%d',// PRT_ID
31
-                    )
32
-        );
33
-        if (false === $updated) {
34
-            $this->add_error(
35
-                sprintf(
36
-                    esc_html__("Error in updating table %s setting PRT_wp_user = %d where PRT_ID = %d", 'event_espresso'),
37
-                    $this->_old_table,
38
-                    $user_id,
39
-                    $old_row['PRT_ID']
40
-                )
41
-            );
42
-        }
43
-    }
12
+	public function __construct()
13
+	{
14
+		global $wpdb;
15
+		$this->_pretty_name = esc_html__("Price Types", "event_espresso");
16
+		$this->_old_table = $wpdb->prefix . "esp_price_type";
17
+		parent::__construct();
18
+	}
19
+	protected function _migrate_old_row($old_row)
20
+	{
21
+		// foreach ticket row we add the id for the current logged in user.
22
+		global $wpdb;
23
+		$user_id = EEH_Activation::get_default_creator_id();
24
+		$updated = $wpdb->update(
25
+			$this->_old_table,
26
+			array('PRT_wp_user' => $user_id),
27
+			array('PRT_ID' => $old_row['PRT_ID']),
28
+			array('%d',// PRT_wp_user
29
+					),
30
+			array('%d',// PRT_ID
31
+					)
32
+		);
33
+		if (false === $updated) {
34
+			$this->add_error(
35
+				sprintf(
36
+					esc_html__("Error in updating table %s setting PRT_wp_user = %d where PRT_ID = %d", 'event_espresso'),
37
+					$this->_old_table,
38
+					$user_id,
39
+					$old_row['PRT_ID']
40
+				)
41
+			);
42
+		}
43
+	}
44 44
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     {
14 14
         global $wpdb;
15 15
         $this->_pretty_name = esc_html__("Price Types", "event_espresso");
16
-        $this->_old_table = $wpdb->prefix . "esp_price_type";
16
+        $this->_old_table = $wpdb->prefix."esp_price_type";
17 17
         parent::__construct();
18 18
     }
19 19
     protected function _migrate_old_row($old_row)
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
             $this->_old_table,
26 26
             array('PRT_wp_user' => $user_id),
27 27
             array('PRT_ID' => $old_row['PRT_ID']),
28
-            array('%d',// PRT_wp_user
28
+            array('%d', // PRT_wp_user
29 29
                     ),
30
-            array('%d',// PRT_ID
30
+            array('%d', // PRT_ID
31 31
                     )
32 32
         );
33 33
         if (false === $updated) {
Please login to merge, or discard this patch.
4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_prices.dmsstage.php 2 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -9,39 +9,39 @@
 block discarded – undo
9 9
 */
10 10
 class EE_DMS_4_5_0_update_wp_user_for_prices extends EE_Data_Migration_Script_Stage_Table
11 11
 {
12
-    public function __construct()
13
-    {
14
-        global $wpdb;
15
-        $this->_pretty_name = esc_html__("Prices", "event_espresso");
16
-        $this->_old_table = $wpdb->prefix . "esp_price";
17
-        parent::__construct();
18
-    }
19
-    protected function _migrate_old_row($old_row)
20
-    {
21
-        // foreach ticket row we add the id for the current logged in user.
22
-        global $wpdb;
23
-        $user_id = EEH_Activation::get_default_creator_id();
24
-        $updated = $wpdb->update(
25
-            $this->_old_table,
26
-            array('PRC_wp_user' => $user_id),
27
-            array('PRC_ID' => $old_row['PRC_ID']),
28
-            array('%d',// PRC_wp_user
29
-                    ),
30
-            array('%d',// PRC_ID
31
-                    )
32
-        );
33
-        if (false === $updated) {
34
-            $this->add_error(
35
-                sprintf(
36
-                    esc_html__(
37
-                        "Error in updating table %s setting PRC_wp_user = %d where PRC_ID = %d",
38
-                        'event_espresso'
39
-                    ),
40
-                    $this->_old_table,
41
-                    $user_id,
42
-                    $old_row['PRC_ID']
43
-                )
44
-            );
45
-        }
46
-    }
12
+	public function __construct()
13
+	{
14
+		global $wpdb;
15
+		$this->_pretty_name = esc_html__("Prices", "event_espresso");
16
+		$this->_old_table = $wpdb->prefix . "esp_price";
17
+		parent::__construct();
18
+	}
19
+	protected function _migrate_old_row($old_row)
20
+	{
21
+		// foreach ticket row we add the id for the current logged in user.
22
+		global $wpdb;
23
+		$user_id = EEH_Activation::get_default_creator_id();
24
+		$updated = $wpdb->update(
25
+			$this->_old_table,
26
+			array('PRC_wp_user' => $user_id),
27
+			array('PRC_ID' => $old_row['PRC_ID']),
28
+			array('%d',// PRC_wp_user
29
+					),
30
+			array('%d',// PRC_ID
31
+					)
32
+		);
33
+		if (false === $updated) {
34
+			$this->add_error(
35
+				sprintf(
36
+					esc_html__(
37
+						"Error in updating table %s setting PRC_wp_user = %d where PRC_ID = %d",
38
+						'event_espresso'
39
+					),
40
+					$this->_old_table,
41
+					$user_id,
42
+					$old_row['PRC_ID']
43
+				)
44
+			);
45
+		}
46
+	}
47 47
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     {
14 14
         global $wpdb;
15 15
         $this->_pretty_name = esc_html__("Prices", "event_espresso");
16
-        $this->_old_table = $wpdb->prefix . "esp_price";
16
+        $this->_old_table = $wpdb->prefix."esp_price";
17 17
         parent::__construct();
18 18
     }
19 19
     protected function _migrate_old_row($old_row)
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
             $this->_old_table,
26 26
             array('PRC_wp_user' => $user_id),
27 27
             array('PRC_ID' => $old_row['PRC_ID']),
28
-            array('%d',// PRC_wp_user
28
+            array('%d', // PRC_wp_user
29 29
                     ),
30
-            array('%d',// PRC_ID
30
+            array('%d', // PRC_ID
31 31
                     )
32 32
         );
33 33
         if (false === $updated) {
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_5_0.dms.php 2 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
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_5_0_stages/*');
18
+$stages = glob(EE_CORE.'data_migration_scripts/4_5_0_stages/*');
19 19
 $class_to_filepath = array();
20 20
 foreach ($stages as $filepath) {
21 21
     $matches = array();
22 22
     preg_match('~4_5_0_stages/(.*).dmsstage.php~', $filepath, $matches);
23
-    $class_to_filepath[ $matches[1] ] = $filepath;
23
+    $class_to_filepath[$matches[1]] = $filepath;
24 24
 }
25 25
 // give addons a chance to autoload their stages too
26 26
 $class_to_filepath = apply_filters('FHEE__EE_DMS_4_5_0__autoloaded_stages', $class_to_filepath);
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
         if (version_compare($version_string, '4.5.0.decaf', '<') && version_compare($version_string, '4.3.0.decaf', '>=')) {
62 62
 //          echo "$version_string can be migrated from";
63 63
             return true;
64
-        } elseif (! $version_string) {
64
+        } elseif ( ! $version_string) {
65 65
 //          echo "no version string provided: $version_string";
66 66
             // no version string provided... this must be pre 4.3
67
-            return false;// changed mind. dont want people thinking they should migrate yet because they cant
67
+            return false; // changed mind. dont want people thinking they should migrate yet because they cant
68 68
         } else {
69 69
 //          echo "$version_string doesnt apply";
70 70
             return false;
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     public function schema_changes_before_migration()
77 77
     {
78 78
         // relies on 4.1's EEH_Activation::create_table
79
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
79
+        require_once(EE_HELPERS.'EEH_Activation.helper.php');
80 80
         $table_name = 'esp_answer';
81 81
         $sql = "ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
82 82
 					REG_ID int(10) unsigned NOT NULL,
@@ -481,18 +481,18 @@  discard block
 block discarded – undo
481 481
     public function insert_default_price_types()
482 482
     {
483 483
         global $wpdb;
484
-        $price_type_table = $wpdb->prefix . "esp_price_type";
484
+        $price_type_table = $wpdb->prefix."esp_price_type";
485 485
         if ($this->_get_table_analysis()->tableExists($price_type_table)) {
486
-            $SQL = 'SELECT COUNT(PRT_ID) FROM ' . $price_type_table;
486
+            $SQL = 'SELECT COUNT(PRT_ID) FROM '.$price_type_table;
487 487
             $price_types_exist = $wpdb->get_var($SQL);
488
-            if (! $price_types_exist) {
488
+            if ( ! $price_types_exist) {
489 489
                 $user_id = EEH_Activation::get_default_creator_id();
490 490
                 $SQL = "INSERT INTO $price_type_table ( PRT_ID, PRT_name, PBT_ID, PRT_is_percent, PRT_order, PRT_wp_user, PRT_deleted ) VALUES
491
-							(1, '" . esc_html__('Base Price', 'event_espresso') . "', 1,  0, 0, $user_id, 0),
492
-							(2, '" . esc_html__('Percent Discount', 'event_espresso') . "', 2,  1, 20, $user_id, 0),
493
-							(3, '" . esc_html__('Dollar Discount', 'event_espresso') . "', 2,  0, 30, $user_id, 0),
494
-							(4, '" . esc_html__('Percent Surcharge', 'event_espresso') . "', 3,  1, 40, $user_id,  0),
495
-							(5, '" . esc_html__('Dollar Surcharge', 'event_espresso') . "', 3,  0, 50, $user_id, 0);";
491
+							(1, '".esc_html__('Base Price', 'event_espresso')."', 1,  0, 0, $user_id, 0),
492
+							(2, '".esc_html__('Percent Discount', 'event_espresso')."', 2,  1, 20, $user_id, 0),
493
+							(3, '".esc_html__('Dollar Discount', 'event_espresso')."', 2,  0, 30, $user_id, 0),
494
+							(4, '".esc_html__('Percent Surcharge', 'event_espresso')."', 3,  1, 40, $user_id,  0),
495
+							(5, '".esc_html__('Dollar Surcharge', 'event_espresso')."', 3,  0, 50, $user_id, 0);";
496 496
                 $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL);
497 497
                 $wpdb->query($SQL);
498 498
             }
@@ -513,11 +513,11 @@  discard block
 block discarded – undo
513 513
     public function insert_default_prices()
514 514
     {
515 515
         global $wpdb;
516
-        $price_table = $wpdb->prefix . "esp_price";
516
+        $price_table = $wpdb->prefix."esp_price";
517 517
         if ($this->_get_table_analysis()->tableExists($price_table)) {
518
-            $SQL = 'SELECT COUNT(PRC_ID) FROM ' . $price_table;
518
+            $SQL = 'SELECT COUNT(PRC_ID) FROM '.$price_table;
519 519
             $prices_exist = $wpdb->get_var($SQL);
520
-            if (! $prices_exist) {
520
+            if ( ! $prices_exist) {
521 521
                 $user_id = EEH_Activation::get_default_creator_id();
522 522
                 $SQL = "INSERT INTO $price_table
523 523
 							(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
@@ -540,11 +540,11 @@  discard block
 block discarded – undo
540 540
     public function insert_default_tickets()
541 541
     {
542 542
         global $wpdb;
543
-        $ticket_table = $wpdb->prefix . "esp_ticket";
543
+        $ticket_table = $wpdb->prefix."esp_ticket";
544 544
         if ($this->_get_table_analysis()->tableExists($ticket_table)) {
545
-            $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table;
545
+            $SQL = 'SELECT COUNT(TKT_ID) FROM '.$ticket_table;
546 546
             $tickets_exist = $wpdb->get_var($SQL);
547
-            if (! $tickets_exist) {
547
+            if ( ! $tickets_exist) {
548 548
                 $user_id = EEH_Activation::get_default_creator_id();
549 549
                 $SQL = "INSERT INTO $ticket_table
550 550
 					( 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
@@ -555,11 +555,11 @@  discard block
 block discarded – undo
555 555
                 $wpdb->query($SQL);
556 556
             }
557 557
         }
558
-        $ticket_price_table = $wpdb->prefix . "esp_ticket_price";
558
+        $ticket_price_table = $wpdb->prefix."esp_ticket_price";
559 559
         if ($this->_get_table_analysis()->tableExists($ticket_price_table)) {
560
-            $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table;
560
+            $SQL = 'SELECT COUNT(TKP_ID) FROM '.$ticket_price_table;
561 561
             $ticket_prc_exist = $wpdb->get_var($SQL);
562
-            if (! $ticket_prc_exist) {
562
+            if ( ! $ticket_prc_exist) {
563 563
                 $SQL = "INSERT INTO $ticket_price_table
564 564
 				( TKP_ID, TKT_ID, PRC_ID ) VALUES
565 565
 				( 1, 1, 1 )
Please login to merge, or discard this patch.
Indentation   +229 added lines, -229 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 $stages = glob(EE_CORE . 'data_migration_scripts/4_5_0_stages/*');
19 19
 $class_to_filepath = array();
20 20
 foreach ($stages as $filepath) {
21
-    $matches = array();
22
-    preg_match('~4_5_0_stages/(.*).dmsstage.php~', $filepath, $matches);
23
-    $class_to_filepath[ $matches[1] ] = $filepath;
21
+	$matches = array();
22
+	preg_match('~4_5_0_stages/(.*).dmsstage.php~', $filepath, $matches);
23
+	$class_to_filepath[ $matches[1] ] = $filepath;
24 24
 }
25 25
 // give addons a chance to autoload their stages too
26 26
 $class_to_filepath = apply_filters('FHEE__EE_DMS_4_5_0__autoloaded_stages', $class_to_filepath);
@@ -30,59 +30,59 @@  discard block
 block discarded – undo
30 30
 
31 31
 class EE_DMS_Core_4_5_0 extends EE_Data_Migration_Script_Base
32 32
 {
33
-    /**
34
-     * EE_DMS_Core_4_5_0 constructor.
35
-     *
36
-     * @param TableManager  $table_manager
37
-     * @param TableAnalysis $table_analysis
38
-     */
39
-    public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null)
40
-    {
41
-        $this->_pretty_name = esc_html__("Data Update to Event Espresso 4.5.0", "event_espresso");
42
-        $this->_priority = 10;
43
-        $this->_migration_stages = array(
44
-            new EE_DMS_4_5_0_update_wp_user_for_tickets(),
45
-            new EE_DMS_4_5_0_update_wp_user_for_prices(),
46
-            new EE_DMS_4_5_0_update_wp_user_for_price_types(),
47
-            new EE_DMS_4_5_0_update_wp_user_for_question_groups(),
48
-            new EE_DMS_4_5_0_invoice_settings(),
49
-        );
50
-        parent::__construct($table_manager, $table_analysis);
51
-    }
33
+	/**
34
+	 * EE_DMS_Core_4_5_0 constructor.
35
+	 *
36
+	 * @param TableManager  $table_manager
37
+	 * @param TableAnalysis $table_analysis
38
+	 */
39
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null)
40
+	{
41
+		$this->_pretty_name = esc_html__("Data Update to Event Espresso 4.5.0", "event_espresso");
42
+		$this->_priority = 10;
43
+		$this->_migration_stages = array(
44
+			new EE_DMS_4_5_0_update_wp_user_for_tickets(),
45
+			new EE_DMS_4_5_0_update_wp_user_for_prices(),
46
+			new EE_DMS_4_5_0_update_wp_user_for_price_types(),
47
+			new EE_DMS_4_5_0_update_wp_user_for_question_groups(),
48
+			new EE_DMS_4_5_0_invoice_settings(),
49
+		);
50
+		parent::__construct($table_manager, $table_analysis);
51
+	}
52 52
 
53 53
 
54 54
 
55
-    public function can_migrate_from_version($version_array)
56
-    {
57
-        $version_string = $version_array['Core'];
58
-        if (version_compare($version_string, '4.5.0.decaf', '<') && version_compare($version_string, '4.3.0.decaf', '>=')) {
55
+	public function can_migrate_from_version($version_array)
56
+	{
57
+		$version_string = $version_array['Core'];
58
+		if (version_compare($version_string, '4.5.0.decaf', '<') && version_compare($version_string, '4.3.0.decaf', '>=')) {
59 59
 //          echo "$version_string can be migrated from";
60
-            return true;
61
-        } elseif (! $version_string) {
60
+			return true;
61
+		} elseif (! $version_string) {
62 62
 //          echo "no version string provided: $version_string";
63
-            // no version string provided... this must be pre 4.3
64
-            return false;// changed mind. dont want people thinking they should migrate yet because they cant
65
-        } else {
63
+			// no version string provided... this must be pre 4.3
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 schema_changes_before_migration()
74
-    {
75
-        // relies on 4.1's EEH_Activation::create_table
76
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
77
-        $table_name = 'esp_answer';
78
-        $sql = "ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
73
+	public function schema_changes_before_migration()
74
+	{
75
+		// relies on 4.1's EEH_Activation::create_table
76
+		require_once(EE_HELPERS . 'EEH_Activation.helper.php');
77
+		$table_name = 'esp_answer';
78
+		$sql = "ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
79 79
 					REG_ID int(10) unsigned NOT NULL,
80 80
 					QST_ID int(10) unsigned NOT NULL,
81 81
 					ANS_value text NOT NULL,
82 82
 					PRIMARY KEY  (ANS_ID)";
83
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
84
-        $table_name = 'esp_attendee_meta';
85
-        $sql = "ATTM_ID int(10) unsigned NOT	NULL AUTO_INCREMENT,
83
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
84
+		$table_name = 'esp_attendee_meta';
85
+		$sql = "ATTM_ID int(10) unsigned NOT	NULL AUTO_INCREMENT,
86 86
 						ATT_ID bigint(20) unsigned NOT NULL,
87 87
 						ATT_fname varchar(45) NOT NULL,
88 88
 						ATT_lname varchar(45) NOT	NULL,
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 								KEY ATT_fname (ATT_fname),
99 99
 								KEY ATT_lname (ATT_lname),
100 100
 								KEY ATT_email (ATT_email(191))";
101
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
102
-        $table_name = 'esp_country';
103
-        $sql = "CNT_ISO varchar(2) COLLATE utf8_bin NOT NULL,
101
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
102
+		$table_name = 'esp_country';
103
+		$sql = "CNT_ISO varchar(2) COLLATE utf8_bin NOT NULL,
104 104
 					  CNT_ISO3 varchar(3) COLLATE utf8_bin NOT NULL,
105 105
 					  RGN_ID tinyint(3) unsigned DEFAULT NULL,
106 106
 					  CNT_name varchar(45) COLLATE utf8_bin NOT NULL,
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 					  CNT_is_EU tinyint(1) DEFAULT '0',
117 117
 					  CNT_active tinyint(1) DEFAULT '0',
118 118
 					  PRIMARY KEY  (CNT_ISO)";
119
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
120
-        $table_name = 'esp_datetime';
121
-        $sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
119
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
120
+		$table_name = 'esp_datetime';
121
+		$sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
122 122
 				  EVT_ID bigint(20) unsigned NOT NULL,
123 123
 				  DTT_name varchar(255) NOT NULL DEFAULT '',
124 124
 				  DTT_description text NOT NULL,
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
 						PRIMARY KEY  (DTT_ID),
134 134
 						KEY EVT_ID (EVT_ID),
135 135
 						KEY DTT_is_primary (DTT_is_primary)";
136
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
137
-        $table_name = 'esp_event_meta';
138
-        $sql = "
136
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
137
+		$table_name = 'esp_event_meta';
138
+		$sql = "
139 139
 			EVTM_ID int(10) NOT NULL AUTO_INCREMENT,
140 140
 			EVT_ID bigint(20) unsigned NOT NULL,
141 141
 			EVT_display_desc tinyint(1) unsigned NOT NULL DEFAULT 1,
@@ -150,31 +150,31 @@  discard block
 block discarded – undo
150 150
 			EVT_external_URL varchar(200) NULL,
151 151
 			EVT_donations tinyint(1) NULL,
152 152
 			PRIMARY KEY  (EVTM_ID)";
153
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
154
-        $table_name = 'esp_event_question_group';
155
-        $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
153
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
154
+		$table_name = 'esp_event_question_group';
155
+		$sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
156 156
 					EVT_ID bigint(20) unsigned NOT NULL,
157 157
 					QSG_ID int(10) unsigned NOT NULL,
158 158
 					EQG_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
159 159
 					PRIMARY KEY  (EQG_ID)";
160
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
161
-        $table_name = 'esp_event_venue';
162
-        $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
160
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
161
+		$table_name = 'esp_event_venue';
162
+		$sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
163 163
 				EVT_ID bigint(20) unsigned NOT NULL,
164 164
 				VNU_ID bigint(20) unsigned NOT NULL,
165 165
 				EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
166 166
 				PRIMARY KEY  (EVV_ID)";
167
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
168
-        $table_name = 'esp_extra_meta';
169
-        $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
167
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
168
+		$table_name = 'esp_extra_meta';
169
+		$sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
170 170
 				OBJ_ID int(11) DEFAULT NULL,
171 171
 				EXM_type varchar(45) DEFAULT NULL,
172 172
 				EXM_key varchar(45) DEFAULT NULL,
173 173
 				EXM_value text,
174 174
 				PRIMARY KEY  (EXM_ID)";
175
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
176
-        $table_name = 'esp_line_item';
177
-        $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
175
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
176
+		$table_name = 'esp_line_item';
177
+		$sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
178 178
 				LIN_code varchar(245) NOT NULL DEFAULT '',
179 179
 				TXN_ID int(11) DEFAULT NULL,
180 180
 				LIN_name varchar(245) NOT NULL DEFAULT '',
@@ -190,19 +190,19 @@  discard block
 block discarded – undo
190 190
 				OBJ_ID int(11) DEFAULT NULL,
191 191
 				OBJ_type varchar(45)DEFAULT NULL,
192 192
 				PRIMARY KEY  (LIN_ID)";
193
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
194
-        $table_name = 'esp_message_template';
195
-        $sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
193
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
194
+		$table_name = 'esp_message_template';
195
+		$sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
196 196
 					GRP_ID int(10) unsigned NOT NULL,
197 197
 					MTP_context varchar(50) NOT NULL,
198 198
 					MTP_template_field varchar(30) NOT NULL,
199 199
 					MTP_content text NOT NULL,
200 200
 					PRIMARY KEY  (MTP_ID),
201 201
 					KEY GRP_ID (GRP_ID)";
202
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
203
-        $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID');
204
-        $table_name = 'esp_message_template_group';
205
-        $sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
202
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
203
+		$this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID');
204
+		$table_name = 'esp_message_template_group';
205
+		$sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
206 206
 					MTP_user_id int(10) NOT NULL DEFAULT '1',
207 207
 					MTP_name varchar(245) NOT NULL DEFAULT '',
208 208
 					MTP_description varchar(245) NOT NULL DEFAULT '',
@@ -214,17 +214,17 @@  discard block
 block discarded – undo
214 214
 					MTP_is_active tinyint(1) NOT NULL DEFAULT '1',
215 215
 					PRIMARY KEY  (GRP_ID),
216 216
 					KEY MTP_user_id (MTP_user_id)";
217
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
218
-        $table_name = 'esp_event_message_template';
219
-        $sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
217
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
218
+		$table_name = 'esp_event_message_template';
219
+		$sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
220 220
 					EVT_ID bigint(20) unsigned NOT NULL DEFAULT 0,
221 221
 					GRP_ID int(10) unsigned NOT NULL DEFAULT 0,
222 222
 					PRIMARY KEY  (EMT_ID),
223 223
 					KEY EVT_ID (EVT_ID),
224 224
 					KEY GRP_ID (GRP_ID)";
225
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
226
-        $table_name = 'esp_payment';
227
-        $sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
225
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
226
+		$table_name = 'esp_payment';
227
+		$sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
228 228
 					TXN_ID int(10) unsigned DEFAULT NULL,
229 229
 					STS_ID varchar(3) COLLATE utf8_bin DEFAULT NULL,
230 230
 					PAY_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -240,28 +240,28 @@  discard block
 block discarded – undo
240 240
 					PRIMARY KEY  (PAY_ID),
241 241
 					KEY TXN_ID (TXN_ID),
242 242
 					KEY PAY_timestamp (PAY_timestamp)";
243
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
244
-        $table_name = "esp_ticket_price";
245
-        $sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
243
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
244
+		$table_name = "esp_ticket_price";
245
+		$sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
246 246
 					  TKT_ID int(10) unsigned NOT NULL,
247 247
 					  PRC_ID int(10) unsigned NOT NULL,
248 248
 					  PRIMARY KEY  (TKP_ID)";
249
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
250
-        $table_name = "esp_datetime_ticket";
251
-        $sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
249
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
250
+		$table_name = "esp_datetime_ticket";
251
+		$sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
252 252
 					  DTT_ID int(10) unsigned NOT NULL,
253 253
 					  TKT_ID int(10) unsigned NOT NULL,
254 254
 					  PRIMARY KEY  (DTK_ID)";
255
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
256
-        $table_name = "esp_ticket_template";
257
-        $sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
255
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
256
+		$table_name = "esp_ticket_template";
257
+		$sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
258 258
 					  TTM_name varchar(45) NOT NULL,
259 259
 					  TTM_description text,
260 260
 					  TTM_file varchar(45),
261 261
 					  PRIMARY KEY  (TTM_ID)";
262
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
263
-        $table_name = 'esp_question';
264
-        $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
262
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
263
+		$table_name = 'esp_question';
264
+		$sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
265 265
 					QST_display_text text NOT NULL,
266 266
 					QST_admin_label varchar(255) NOT NULL,
267 267
 					QST_system varchar(25) DEFAULT NULL,
@@ -273,25 +273,25 @@  discard block
 block discarded – undo
273 273
 					QST_wp_user bigint(20) unsigned NULL,
274 274
 					QST_deleted tinyint(1) unsigned NOT NULL DEFAULT 0,
275 275
 					PRIMARY KEY  (QST_ID)';
276
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
277
-        $table_name = 'esp_question_group_question';
278
-        $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
276
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
277
+		$table_name = 'esp_question_group_question';
278
+		$sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
279 279
 					QSG_ID int(10) unsigned NOT NULL,
280 280
 					QST_ID int(10) unsigned NOT NULL,
281 281
 					QGQ_order int(10) unsigned NOT NULL DEFAULT 0,
282 282
 					PRIMARY KEY  (QGQ_ID) ";
283
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
284
-        $table_name = 'esp_question_option';
285
-        $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
283
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
284
+		$table_name = 'esp_question_option';
285
+		$sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
286 286
 					QSO_value varchar(255) NOT NULL,
287 287
 					QSO_desc text NOT NULL,
288 288
 					QST_ID int(10) unsigned NOT NULL,
289 289
 					QSO_order int(10) unsigned NOT NULL DEFAULT 0,
290 290
 					QSO_deleted tinyint(1) unsigned NOT NULL DEFAULT 0,
291 291
 					PRIMARY KEY  (QSO_ID)";
292
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
293
-        $table_name = 'esp_registration';
294
-        $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
292
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
293
+		$table_name = 'esp_registration';
294
+		$sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
295 295
 					  EVT_ID bigint(20) unsigned NOT NULL,
296 296
 					  ATT_ID bigint(20) unsigned NOT NULL,
297 297
 					  TXN_ID int(10) unsigned NOT NULL,
@@ -314,25 +314,25 @@  discard block
 block discarded – undo
314 314
 					  KEY STS_ID (STS_ID),
315 315
 					  KEY REG_url_link (REG_url_link),
316 316
 					  KEY REG_code (REG_code)";
317
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
318
-        $table_name = 'esp_checkin';
319
-        $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
317
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
318
+		$table_name = 'esp_checkin';
319
+		$sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
320 320
 					REG_ID int(10) unsigned NOT NULL,
321 321
 					DTT_ID int(10) unsigned NOT NULL,
322 322
 					CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1,
323 323
 					CHK_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
324 324
 					PRIMARY KEY  (CHK_ID)";
325
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
326
-        $table_name = 'esp_state';
327
-        $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
325
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
326
+		$table_name = 'esp_state';
327
+		$sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
328 328
 					  CNT_ISO varchar(2) COLLATE utf8_bin NOT NULL,
329 329
 					  STA_abbrev varchar(6) COLLATE utf8_bin NOT NULL,
330 330
 					  STA_name varchar(100) COLLATE utf8_bin NOT NULL,
331 331
 					  STA_active tinyint(1) DEFAULT '1',
332 332
 					  PRIMARY KEY  (STA_ID)";
333
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
334
-        $table_name = 'esp_status';
335
-        $sql = "STS_ID varchar(3) COLLATE utf8_bin NOT NULL,
333
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
334
+		$table_name = 'esp_status';
335
+		$sql = "STS_ID varchar(3) COLLATE utf8_bin NOT NULL,
336 336
 					  STS_code varchar(45) COLLATE utf8_bin NOT NULL,
337 337
 					  STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL,
338 338
 					  STS_can_edit tinyint(1) NOT NULL DEFAULT 0,
@@ -340,9 +340,9 @@  discard block
 block discarded – undo
340 340
 					  STS_open tinyint(1) NOT NULL DEFAULT 1,
341 341
 					  UNIQUE KEY STS_ID_UNIQUE (STS_ID),
342 342
 					  KEY STS_type (STS_type)";
343
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
344
-        $table_name = 'esp_transaction';
345
-        $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
343
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
344
+		$table_name = 'esp_transaction';
345
+		$sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
346 346
 					  TXN_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
347 347
 					  TXN_total decimal(10,3) DEFAULT '0.00',
348 348
 					  TXN_paid decimal(10,3) NOT NULL DEFAULT '0.00',
@@ -353,9 +353,9 @@  discard block
 block discarded – undo
353 353
 					  PRIMARY KEY  (TXN_ID),
354 354
 					  KEY TXN_timestamp (TXN_timestamp),
355 355
 					  KEY STS_ID (STS_ID)";
356
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
357
-        $table_name = 'esp_venue_meta';
358
-        $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
356
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
357
+		$table_name = 'esp_venue_meta';
358
+		$sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
359 359
 			VNU_ID bigint(20) unsigned NOT NULL DEFAULT 0,
360 360
 			VNU_address varchar(255) DEFAULT NULL,
361 361
 			VNU_address2 varchar(255) DEFAULT NULL,
@@ -373,10 +373,10 @@  discard block
 block discarded – undo
373 373
 			PRIMARY KEY  (VNUM_ID),
374 374
 			KEY STA_ID (STA_ID),
375 375
 			KEY CNT_ISO (CNT_ISO)";
376
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
377
-        // modified tables
378
-        $table_name = "esp_price";
379
-        $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
376
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
377
+		// modified tables
378
+		$table_name = "esp_price";
379
+		$sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
380 380
 					  PRT_ID tinyint(3) unsigned NOT NULL,
381 381
 					  PRC_amount decimal(10,3) NOT NULL DEFAULT '0.00',
382 382
 					  PRC_name varchar(245) NOT NULL,
@@ -388,9 +388,9 @@  discard block
 block discarded – undo
388 388
 					  PRC_wp_user bigint(20) unsigned NULL,
389 389
 					  PRC_parent int(10) unsigned DEFAULT 0,
390 390
 					  PRIMARY KEY  (PRC_ID)";
391
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
392
-        $table_name = "esp_price_type";
393
-        $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
391
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
392
+		$table_name = "esp_price_type";
393
+		$sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
394 394
 				  PRT_name varchar(45) NOT NULL,
395 395
 				  PBT_ID tinyint(3) unsigned NOT NULL DEFAULT '1',
396 396
 				  PRT_is_percent tinyint(1) NOT NULL DEFAULT '0',
@@ -399,9 +399,9 @@  discard block
 block discarded – undo
399 399
 				  PRT_deleted tinyint(1) NOT NULL DEFAULT '0',
400 400
 				  UNIQUE KEY PRT_name_UNIQUE (PRT_name),
401 401
 				  PRIMARY KEY  (PRT_ID)";
402
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
403
-        $table_name = "esp_ticket";
404
-        $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
402
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
403
+		$table_name = "esp_ticket";
404
+		$sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
405 405
 					  TTM_ID int(10) unsigned NOT NULL,
406 406
 					  TKT_name varchar(245) NOT NULL DEFAULT '',
407 407
 					  TKT_description text NOT NULL,
@@ -422,10 +422,10 @@  discard block
 block discarded – undo
422 422
 					  TKT_parent int(10) unsigned DEFAULT '0',
423 423
 					  TKT_deleted tinyint(1) NOT NULL DEFAULT '0',
424 424
 					  PRIMARY KEY  (TKT_ID)";
425
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
426
-        $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE');
427
-        $table_name = 'esp_question_group';
428
-        $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
425
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
426
+		$this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE');
427
+		$table_name = 'esp_question_group';
428
+		$sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
429 429
 					QSG_name varchar(255) NOT NULL,
430 430
 					QSG_identifier varchar(100) NOT NULL,
431 431
 					QSG_desc text NULL,
@@ -437,133 +437,133 @@  discard block
 block discarded – undo
437 437
 					QSG_wp_user bigint(20) unsigned NULL,
438 438
 					PRIMARY KEY  (QSG_ID),
439 439
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)';
440
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
441
-        $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
442
-        // (because many need to convert old string states to foreign keys into the states table)
443
-        $script_4_1_defaults->insert_default_states();
444
-        $script_4_1_defaults->insert_default_countries();
445
-        // schema on price, price_types and tickets has changed so use the DEFAULT method in here instead of 4.1's and later.
446
-        $this->insert_default_price_types();
447
-        $this->insert_default_prices();
448
-        $this->insert_default_tickets();
449
-        // setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre
450
-        EE_Config::instance()->update_espresso_config(false, true);
451
-        return true;
452
-    }
440
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
441
+		$script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
442
+		// (because many need to convert old string states to foreign keys into the states table)
443
+		$script_4_1_defaults->insert_default_states();
444
+		$script_4_1_defaults->insert_default_countries();
445
+		// schema on price, price_types and tickets has changed so use the DEFAULT method in here instead of 4.1's and later.
446
+		$this->insert_default_price_types();
447
+		$this->insert_default_prices();
448
+		$this->insert_default_tickets();
449
+		// setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre
450
+		EE_Config::instance()->update_espresso_config(false, true);
451
+		return true;
452
+	}
453 453
 
454 454
 
455 455
 
456
-    /**
457
-     * @return boolean
458
-     */
459
-    public function schema_changes_after_migration()
460
-    {
461
-        return true;
462
-    }
456
+	/**
457
+	 * @return boolean
458
+	 */
459
+	public function schema_changes_after_migration()
460
+	{
461
+		return true;
462
+	}
463 463
 
464 464
 
465 465
 
466
-    public function migration_page_hooks()
467
-    {
468
-    }
466
+	public function migration_page_hooks()
467
+	{
468
+	}
469 469
 
470 470
 
471 471
 
472
-    /**
473
-     * insert_default_price_types
474
-     *
475
-     * @since 4.5.0
476
-     * @return void
477
-     */
478
-    public function insert_default_price_types()
479
-    {
480
-        global $wpdb;
481
-        $price_type_table = $wpdb->prefix . "esp_price_type";
482
-        if ($this->_get_table_analysis()->tableExists($price_type_table)) {
483
-            $SQL = 'SELECT COUNT(PRT_ID) FROM ' . $price_type_table;
484
-            $price_types_exist = $wpdb->get_var($SQL);
485
-            if (! $price_types_exist) {
486
-                $user_id = EEH_Activation::get_default_creator_id();
487
-                $SQL = "INSERT INTO $price_type_table ( PRT_ID, PRT_name, PBT_ID, PRT_is_percent, PRT_order, PRT_wp_user, PRT_deleted ) VALUES
472
+	/**
473
+	 * insert_default_price_types
474
+	 *
475
+	 * @since 4.5.0
476
+	 * @return void
477
+	 */
478
+	public function insert_default_price_types()
479
+	{
480
+		global $wpdb;
481
+		$price_type_table = $wpdb->prefix . "esp_price_type";
482
+		if ($this->_get_table_analysis()->tableExists($price_type_table)) {
483
+			$SQL = 'SELECT COUNT(PRT_ID) FROM ' . $price_type_table;
484
+			$price_types_exist = $wpdb->get_var($SQL);
485
+			if (! $price_types_exist) {
486
+				$user_id = EEH_Activation::get_default_creator_id();
487
+				$SQL = "INSERT INTO $price_type_table ( PRT_ID, PRT_name, PBT_ID, PRT_is_percent, PRT_order, PRT_wp_user, PRT_deleted ) VALUES
488 488
 							(1, '" . esc_html__('Base Price', 'event_espresso') . "', 1,  0, 0, $user_id, 0),
489 489
 							(2, '" . esc_html__('Percent Discount', 'event_espresso') . "', 2,  1, 20, $user_id, 0),
490 490
 							(3, '" . esc_html__('Dollar Discount', 'event_espresso') . "', 2,  0, 30, $user_id, 0),
491 491
 							(4, '" . esc_html__('Percent Surcharge', 'event_espresso') . "', 3,  1, 40, $user_id,  0),
492 492
 							(5, '" . esc_html__('Dollar Surcharge', 'event_espresso') . "', 3,  0, 50, $user_id, 0);";
493
-                $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL);
494
-                $wpdb->query($SQL);
495
-            }
496
-        }
497
-    }
493
+				$SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL);
494
+				$wpdb->query($SQL);
495
+			}
496
+		}
497
+	}
498 498
 
499 499
 
500 500
 
501
-    /**
502
-     * insert DEFAULT prices.
503
-     *  If we're INSTALLING 4.x CAF, then we add a few extra DEFAULT prices
504
-     * when EEH_Activaion's initialize_db_content is called via  ahook in
505
-     * EE_Brewing_regular
506
-     *
507
-     * @since 4.5.0
508
-     * @return void
509
-     */
510
-    public function insert_default_prices()
511
-    {
512
-        global $wpdb;
513
-        $price_table = $wpdb->prefix . "esp_price";
514
-        if ($this->_get_table_analysis()->tableExists($price_table)) {
515
-            $SQL = 'SELECT COUNT(PRC_ID) FROM ' . $price_table;
516
-            $prices_exist = $wpdb->get_var($SQL);
517
-            if (! $prices_exist) {
518
-                $user_id = EEH_Activation::get_default_creator_id();
519
-                $SQL = "INSERT INTO $price_table
501
+	/**
502
+	 * insert DEFAULT prices.
503
+	 *  If we're INSTALLING 4.x CAF, then we add a few extra DEFAULT prices
504
+	 * when EEH_Activaion's initialize_db_content is called via  ahook in
505
+	 * EE_Brewing_regular
506
+	 *
507
+	 * @since 4.5.0
508
+	 * @return void
509
+	 */
510
+	public function insert_default_prices()
511
+	{
512
+		global $wpdb;
513
+		$price_table = $wpdb->prefix . "esp_price";
514
+		if ($this->_get_table_analysis()->tableExists($price_table)) {
515
+			$SQL = 'SELECT COUNT(PRC_ID) FROM ' . $price_table;
516
+			$prices_exist = $wpdb->get_var($SQL);
517
+			if (! $prices_exist) {
518
+				$user_id = EEH_Activation::get_default_creator_id();
519
+				$SQL = "INSERT INTO $price_table
520 520
 							(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
521 521
 							(1, 1, '0.00', 'Admission', '', 1, NULL, $user_id, 0, 0, 0);";
522
-                $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_prices__SQL', $SQL);
523
-                $wpdb->query($SQL);
524
-            }
525
-        }
526
-    }
522
+				$SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_prices__SQL', $SQL);
523
+				$wpdb->query($SQL);
524
+			}
525
+		}
526
+	}
527 527
 
528 528
 
529 529
 
530
-    /**
531
-     * insert DEFAULT ticket
532
-     * Almost identical to EE_DMS_Core_4_3_0::insert_default_tickets, except is aware of the TKT_wp_user field
533
-     *
534
-     * @since 4.5.0
535
-     * @return void
536
-     */
537
-    public function insert_default_tickets()
538
-    {
539
-        global $wpdb;
540
-        $ticket_table = $wpdb->prefix . "esp_ticket";
541
-        if ($this->_get_table_analysis()->tableExists($ticket_table)) {
542
-            $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table;
543
-            $tickets_exist = $wpdb->get_var($SQL);
544
-            if (! $tickets_exist) {
545
-                $user_id = EEH_Activation::get_default_creator_id();
546
-                $SQL = "INSERT INTO $ticket_table
530
+	/**
531
+	 * insert DEFAULT ticket
532
+	 * Almost identical to EE_DMS_Core_4_3_0::insert_default_tickets, except is aware of the TKT_wp_user field
533
+	 *
534
+	 * @since 4.5.0
535
+	 * @return void
536
+	 */
537
+	public function insert_default_tickets()
538
+	{
539
+		global $wpdb;
540
+		$ticket_table = $wpdb->prefix . "esp_ticket";
541
+		if ($this->_get_table_analysis()->tableExists($ticket_table)) {
542
+			$SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table;
543
+			$tickets_exist = $wpdb->get_var($SQL);
544
+			if (! $tickets_exist) {
545
+				$user_id = EEH_Activation::get_default_creator_id();
546
+				$SQL = "INSERT INTO $ticket_table
547 547
 					( 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
548 548
 					( 1, 0, '"
549
-                       . esc_html__("Free Ticket", "event_espresso")
550
-                       . "', '', 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);";
551
-                $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL', $SQL);
552
-                $wpdb->query($SQL);
553
-            }
554
-        }
555
-        $ticket_price_table = $wpdb->prefix . "esp_ticket_price";
556
-        if ($this->_get_table_analysis()->tableExists($ticket_price_table)) {
557
-            $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table;
558
-            $ticket_prc_exist = $wpdb->get_var($SQL);
559
-            if (! $ticket_prc_exist) {
560
-                $SQL = "INSERT INTO $ticket_price_table
549
+					   . esc_html__("Free Ticket", "event_espresso")
550
+					   . "', '', 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);";
551
+				$SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL', $SQL);
552
+				$wpdb->query($SQL);
553
+			}
554
+		}
555
+		$ticket_price_table = $wpdb->prefix . "esp_ticket_price";
556
+		if ($this->_get_table_analysis()->tableExists($ticket_price_table)) {
557
+			$SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table;
558
+			$ticket_prc_exist = $wpdb->get_var($SQL);
559
+			if (! $ticket_prc_exist) {
560
+				$SQL = "INSERT INTO $ticket_price_table
561 561
 				( TKP_ID, TKT_ID, PRC_ID ) VALUES
562 562
 				( 1, 1, 1 )
563 563
 				";
564
-                $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL__ticket_price', $SQL);
565
-                $wpdb->query($SQL);
566
-            }
567
-        }
568
-    }
564
+				$SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL__ticket_price', $SQL);
565
+				$wpdb->query($SQL);
566
+			}
567
+		}
568
+	}
569 569
 }
Please login to merge, or discard this patch.
4_9_0_stages/EE_DMS_4_9_0_Email_System_Question.dmsstage.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     {
24 24
         global $wpdb;
25 25
         $this->_pretty_name = esc_html__('Email - System Question', 'event_espresso');
26
-        $this->_old_table = $wpdb->prefix . 'esp_question';
26
+        $this->_old_table = $wpdb->prefix.'esp_question';
27 27
         $this->_extra_where_sql = "WHERE QST_system = 'email'";
28 28
         parent::__construct();
29 29
     }
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
             global $wpdb;
42 42
             $success = $wpdb->update(
43 43
                 $this->_old_table,
44
-                array( 'QST_type' => 'EMAIL' ),  // data
45
-                array( 'QST_ID' => $question['QST_ID'] ),  // where
46
-                array( '%s' ),   // data format
47
-                array( '%d' )  // where format
44
+                array('QST_type' => 'EMAIL'), // data
45
+                array('QST_ID' => $question['QST_ID']), // where
46
+                array('%s'), // data format
47
+                array('%d')  // where format
48 48
             );
49
-            if (! $success) {
49
+            if ( ! $success) {
50 50
                 $this->add_error(
51 51
                     sprintf(
52 52
                         esc_html__('Could not update question system name "%1$s" for question ID=%2$d because "%3$s"', 'event_espresso'),
Please login to merge, or discard this patch.
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -11,48 +11,48 @@
 block discarded – undo
11 11
  */
12 12
 class EE_DMS_4_9_0_Email_System_Question extends EE_Data_Migration_Script_Stage_Table
13 13
 {
14
-    /**
15
-     * Just initializes the status of the migration
16
-     *
17
-     * @return EE_DMS_4_9_0_Email_System_Question
18
-     */
19
-    public function __construct()
20
-    {
21
-        global $wpdb;
22
-        $this->_pretty_name = esc_html__('Email - System Question', 'event_espresso');
23
-        $this->_old_table = $wpdb->prefix . 'esp_question';
24
-        $this->_extra_where_sql = "WHERE QST_system = 'email'";
25
-        parent::__construct();
26
-    }
14
+	/**
15
+	 * Just initializes the status of the migration
16
+	 *
17
+	 * @return EE_DMS_4_9_0_Email_System_Question
18
+	 */
19
+	public function __construct()
20
+	{
21
+		global $wpdb;
22
+		$this->_pretty_name = esc_html__('Email - System Question', 'event_espresso');
23
+		$this->_old_table = $wpdb->prefix . 'esp_question';
24
+		$this->_extra_where_sql = "WHERE QST_system = 'email'";
25
+		parent::__construct();
26
+	}
27 27
 
28 28
 
29 29
 
30
-    /**
31
-     * updates the question with the new question type
32
-     * @param array $question an associative array where keys are column names and values are their values.
33
-     * @return null
34
-     */
35
-    protected function _migrate_old_row($question)
36
-    {
37
-        if ($question['QST_ID'] && $question['QST_system'] == 'email') {
38
-            global $wpdb;
39
-            $success = $wpdb->update(
40
-                $this->_old_table,
41
-                array( 'QST_type' => 'EMAIL' ),  // data
42
-                array( 'QST_ID' => $question['QST_ID'] ),  // where
43
-                array( '%s' ),   // data format
44
-                array( '%d' )  // where format
45
-            );
46
-            if (! $success) {
47
-                $this->add_error(
48
-                    sprintf(
49
-                        esc_html__('Could not update question system name "%1$s" for question ID=%2$d because "%3$s"', 'event_espresso'),
50
-                        wp_json_encode($question['QST_system']),
51
-                        $question['QST_ID'],
52
-                        $wpdb->last_error
53
-                    )
54
-                );
55
-            }
56
-        }
57
-    }
30
+	/**
31
+	 * updates the question with the new question type
32
+	 * @param array $question an associative array where keys are column names and values are their values.
33
+	 * @return null
34
+	 */
35
+	protected function _migrate_old_row($question)
36
+	{
37
+		if ($question['QST_ID'] && $question['QST_system'] == 'email') {
38
+			global $wpdb;
39
+			$success = $wpdb->update(
40
+				$this->_old_table,
41
+				array( 'QST_type' => 'EMAIL' ),  // data
42
+				array( 'QST_ID' => $question['QST_ID'] ),  // where
43
+				array( '%s' ),   // data format
44
+				array( '%d' )  // where format
45
+			);
46
+			if (! $success) {
47
+				$this->add_error(
48
+					sprintf(
49
+						esc_html__('Could not update question system name "%1$s" for question ID=%2$d because "%3$s"', 'event_espresso'),
50
+						wp_json_encode($question['QST_system']),
51
+						$question['QST_ID'],
52
+						$wpdb->last_error
53
+					)
54
+				);
55
+			}
56
+		}
57
+	}
58 58
 }
Please login to merge, or discard this patch.