Completed
Branch 973/fix-visible-recaptcha (0580c7)
by
unknown
03:03 queued 30s
created
line_item_display/EE_Default_Line_Item_Display_Strategy.strategy.php 2 patches
Indentation   +218 added lines, -218 removed lines patch added patch discarded remove patch
@@ -1,225 +1,225 @@
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- *
4
- * Class EE_Default_Line_Item_Display_Strategy
5
- *
6
- * Description
7
- *
8
- * @package         Event Espresso
9
- * @subpackage    core
10
- * @author              Brent Christensen
11
- *
12
- *
13
- */
3
+  *
4
+  * Class EE_Default_Line_Item_Display_Strategy
5
+  *
6
+  * Description
7
+  *
8
+  * @package         Event Espresso
9
+  * @subpackage    core
10
+  * @author              Brent Christensen
11
+  *
12
+  *
13
+  */
14 14
 
15 15
 class EE_Default_Line_Item_Display_Strategy implements EEI_Line_Item_Display
16 16
 {
17 17
 
18
-    /**
19
-     * total amount of tax to apply
20
-     * @type float $_tax_rate
21
-     */
22
-    private $_tax_rate = 0;
23
-
24
-    /**
25
-     * total amount including tax we can bill for at this time
26
-     * @type float $_grand_total
27
-     */
28
-    private $_grand_total = 0.00;
29
-
30
-    /**
31
-     * total number of items being billed for
32
-     * @type int $_total_items
33
-     */
34
-    private $_total_items = 0;
35
-
36
-
37
-
38
-    /**
39
-     * @return float
40
-     */
41
-    public function grand_total()
42
-    {
43
-        return $this->_grand_total;
44
-    }
45
-
46
-
47
-
48
-    /**
49
-     * @return int
50
-     */
51
-    public function total_items()
52
-    {
53
-        return $this->_total_items;
54
-    }
55
-
56
-
57
-
58
-    /**
59
-     * @param EE_Line_Item $line_item
60
-     * @param array        $options
61
-     * @return mixed
62
-     */
63
-    public function display_line_item(EE_Line_Item $line_item, $options = array())
64
-    {
65
-
66
-        $html = '';
67
-        // set some default options and merge with incoming
68
-        $default_options = array(
69
-            'show_desc' => true,  //    TRUE        FALSE
70
-            'odd' => false
71
-        );
72
-        $options = array_merge($default_options, (array) $options);
73
-
74
-        switch ($line_item->type()) {
75
-            case EEM_Line_Item::type_line_item:
76
-                // item row
77
-                $html .= $this->_item_row($line_item, $options);
78
-                // got any kids?
79
-                foreach ($line_item->children() as $child_line_item) {
80
-                    $this->display_line_item($child_line_item, $options);
81
-                }
82
-                break;
83
-
84
-            case EEM_Line_Item::type_sub_line_item:
85
-                $html .= $this->_sub_item_row($line_item, $options);
86
-                break;
87
-
88
-            case EEM_Line_Item::type_sub_total:
89
-                break;
90
-
91
-            case EEM_Line_Item::type_tax:
92
-                $this->_tax_rate += $line_item->percent();
93
-                break;
94
-
95
-            case EEM_Line_Item::type_tax_sub_total:
96
-                foreach ($line_item->children() as $child_line_item) {
97
-                    if ($child_line_item->type() == EEM_Line_Item::type_tax) {
98
-                        // recursively feed children back into this method
99
-                        $this->display_line_item($child_line_item, $options);
100
-                    }
101
-                }
102
-                break;
103
-
104
-            case EEM_Line_Item::type_total:
105
-                // get all child line items
106
-                $children = $line_item->children();
107
-                if ($options['set_tax_rate'] === true) {
108
-                    // loop thru tax child line items just to determine tax rate
109
-                    foreach ($children as $child_line_item) {
110
-                        if ($child_line_item->type() == EEM_Line_Item::type_tax_sub_total) {
111
-                            // recursively feed children back into this method
112
-                            $this->display_line_item($child_line_item, $options);
113
-                        }
114
-                    }
115
-                } else {
116
-                    // now loop thru all non-tax child line items
117
-                    foreach ($children as $child_line_item) {
118
-                        if ($child_line_item->type() != EEM_Line_Item::type_tax_sub_total) {
119
-                            // recursively feed children back into this method
120
-                            $html .= $this->display_line_item($child_line_item, $options);
121
-                        }
122
-                    }
123
-                }
124
-                break;
125
-        }
126
-
127
-        return $html;
128
-    }
129
-
130
-
131
-
132
-    /**
133
-     *  _total_row
134
-     *
135
-     * @param EE_Line_Item $line_item
136
-     * @param array        $options
137
-     * @return mixed
138
-     */
139
-    private function _item_row(EE_Line_Item $line_item, $options = array())
140
-    {
141
-        // start of row
142
-        $row_class = $options['odd'] ? 'item odd' : 'item';
143
-        $html = EEH_HTML::tr('', '', $row_class);
144
-        // name && desc
145
-        $name_and_desc = apply_filters(
146
-            'FHEE__EE_Default_Line_Item_Display_Strategy__item_row__name',
147
-            $line_item->name(),
148
-            $line_item
149
-        );
150
-        $name_and_desc .= apply_filters(
151
-            'FHEE__EE_Default_Line_Item_Display_Strategy__item_row__desc',
152
-            ( $options['show_desc'] ? '<span class="line-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '' ),
153
-            $line_item,
154
-            $options
155
-        );
156
-        if ($line_item->is_taxable()) {
157
-            $ticket_price_includes_taxes = EE_Registry::instance()->CFG->tax_settings->prices_displayed_including_taxes
158
-                ? esc_html__('* price includes taxes', 'event_espresso')
159
-                : esc_html__('* price does not include taxes', 'event_espresso');
160
-            $name_and_desc .= '<span class="smaller-text lt-grey-text" style="margin:0 0 0 2em;">'
161
-                  . $ticket_price_includes_taxes
162
-                  . '</span>';
163
-        }
164
-
165
-        // name td
166
-        $html .= EEH_HTML::td($name_and_desc, '', 'item_l');
167
-        // quantity td
168
-        $html .= EEH_HTML::td($line_item->quantity(), '', 'item_l jst-rght');
169
-        $tax_rate = $line_item->is_taxable()
170
-                    && EE_Registry::instance()->CFG->tax_settings->prices_displayed_including_taxes
171
-            ? 1 + ( $this->_tax_rate / 100 )
172
-            : 1;
173
-        // price td
174
-        $unit_price = apply_filters(
175
-            'FHEE__EE_Default_Line_Item_Display_Strategy___item_row__unit_price',
176
-            EEH_Template::format_currency($line_item->unit_price() * $tax_rate, false, false),
177
-            $line_item,
178
-            $tax_rate
179
-        );
180
-        $html .= EEH_HTML::td($unit_price, '', 'item_c jst-rght');
181
-        // total td
182
-        $total = apply_filters(
183
-            'FHEE__EE_Default_Line_Item_Display_Strategy___item_row__total',
184
-            EEH_Template::format_currency($line_item->unit_price() * $line_item->quantity() * $tax_rate, false, false),
185
-            $line_item,
186
-            $tax_rate
187
-        );
188
-        $html .= EEH_HTML::td($total, '', 'item_r jst-rght');
189
-        // end of row
190
-        $html .= EEH_HTML::trx();
191
-
192
-        return $html;
193
-    }
194
-
195
-
196
-
197
-    /**
198
-     *  _sub_item_row
199
-     *
200
-     * @param EE_Line_Item $line_item
201
-     * @param array        $options
202
-     * @return mixed
203
-     */
204
-    private function _sub_item_row(EE_Line_Item $line_item, $options = array())
205
-    {
206
-        // start of row
207
-        $html = EEH_HTML::tr('', 'item sub-item-row');
208
-        // name && desc
209
-        $name_and_desc = $line_item->name();
210
-        $name_and_desc .= $options['show_desc'] ? '<span class="line-sub-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '';
211
-        // name td
212
-        $html .= EEH_HTML::td(/*__FUNCTION__ .*/ $name_and_desc, '', 'item_l sub-item');
213
-        // discount/surcharge td
214
-        if ($line_item->is_percent()) {
215
-            $html .= EEH_HTML::td($line_item->percent() . '%', '', 'item_c');
216
-        } else {
217
-            $html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c jst-rght');
218
-        }
219
-        // total td
220
-        $html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'item_r jst-rght');
221
-        // end of row
222
-        $html .= EEH_HTML::trx();
223
-        return $html;
224
-    }
18
+	/**
19
+	 * total amount of tax to apply
20
+	 * @type float $_tax_rate
21
+	 */
22
+	private $_tax_rate = 0;
23
+
24
+	/**
25
+	 * total amount including tax we can bill for at this time
26
+	 * @type float $_grand_total
27
+	 */
28
+	private $_grand_total = 0.00;
29
+
30
+	/**
31
+	 * total number of items being billed for
32
+	 * @type int $_total_items
33
+	 */
34
+	private $_total_items = 0;
35
+
36
+
37
+
38
+	/**
39
+	 * @return float
40
+	 */
41
+	public function grand_total()
42
+	{
43
+		return $this->_grand_total;
44
+	}
45
+
46
+
47
+
48
+	/**
49
+	 * @return int
50
+	 */
51
+	public function total_items()
52
+	{
53
+		return $this->_total_items;
54
+	}
55
+
56
+
57
+
58
+	/**
59
+	 * @param EE_Line_Item $line_item
60
+	 * @param array        $options
61
+	 * @return mixed
62
+	 */
63
+	public function display_line_item(EE_Line_Item $line_item, $options = array())
64
+	{
65
+
66
+		$html = '';
67
+		// set some default options and merge with incoming
68
+		$default_options = array(
69
+			'show_desc' => true,  //    TRUE        FALSE
70
+			'odd' => false
71
+		);
72
+		$options = array_merge($default_options, (array) $options);
73
+
74
+		switch ($line_item->type()) {
75
+			case EEM_Line_Item::type_line_item:
76
+				// item row
77
+				$html .= $this->_item_row($line_item, $options);
78
+				// got any kids?
79
+				foreach ($line_item->children() as $child_line_item) {
80
+					$this->display_line_item($child_line_item, $options);
81
+				}
82
+				break;
83
+
84
+			case EEM_Line_Item::type_sub_line_item:
85
+				$html .= $this->_sub_item_row($line_item, $options);
86
+				break;
87
+
88
+			case EEM_Line_Item::type_sub_total:
89
+				break;
90
+
91
+			case EEM_Line_Item::type_tax:
92
+				$this->_tax_rate += $line_item->percent();
93
+				break;
94
+
95
+			case EEM_Line_Item::type_tax_sub_total:
96
+				foreach ($line_item->children() as $child_line_item) {
97
+					if ($child_line_item->type() == EEM_Line_Item::type_tax) {
98
+						// recursively feed children back into this method
99
+						$this->display_line_item($child_line_item, $options);
100
+					}
101
+				}
102
+				break;
103
+
104
+			case EEM_Line_Item::type_total:
105
+				// get all child line items
106
+				$children = $line_item->children();
107
+				if ($options['set_tax_rate'] === true) {
108
+					// loop thru tax child line items just to determine tax rate
109
+					foreach ($children as $child_line_item) {
110
+						if ($child_line_item->type() == EEM_Line_Item::type_tax_sub_total) {
111
+							// recursively feed children back into this method
112
+							$this->display_line_item($child_line_item, $options);
113
+						}
114
+					}
115
+				} else {
116
+					// now loop thru all non-tax child line items
117
+					foreach ($children as $child_line_item) {
118
+						if ($child_line_item->type() != EEM_Line_Item::type_tax_sub_total) {
119
+							// recursively feed children back into this method
120
+							$html .= $this->display_line_item($child_line_item, $options);
121
+						}
122
+					}
123
+				}
124
+				break;
125
+		}
126
+
127
+		return $html;
128
+	}
129
+
130
+
131
+
132
+	/**
133
+	 *  _total_row
134
+	 *
135
+	 * @param EE_Line_Item $line_item
136
+	 * @param array        $options
137
+	 * @return mixed
138
+	 */
139
+	private function _item_row(EE_Line_Item $line_item, $options = array())
140
+	{
141
+		// start of row
142
+		$row_class = $options['odd'] ? 'item odd' : 'item';
143
+		$html = EEH_HTML::tr('', '', $row_class);
144
+		// name && desc
145
+		$name_and_desc = apply_filters(
146
+			'FHEE__EE_Default_Line_Item_Display_Strategy__item_row__name',
147
+			$line_item->name(),
148
+			$line_item
149
+		);
150
+		$name_and_desc .= apply_filters(
151
+			'FHEE__EE_Default_Line_Item_Display_Strategy__item_row__desc',
152
+			( $options['show_desc'] ? '<span class="line-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '' ),
153
+			$line_item,
154
+			$options
155
+		);
156
+		if ($line_item->is_taxable()) {
157
+			$ticket_price_includes_taxes = EE_Registry::instance()->CFG->tax_settings->prices_displayed_including_taxes
158
+				? esc_html__('* price includes taxes', 'event_espresso')
159
+				: esc_html__('* price does not include taxes', 'event_espresso');
160
+			$name_and_desc .= '<span class="smaller-text lt-grey-text" style="margin:0 0 0 2em;">'
161
+				  . $ticket_price_includes_taxes
162
+				  . '</span>';
163
+		}
164
+
165
+		// name td
166
+		$html .= EEH_HTML::td($name_and_desc, '', 'item_l');
167
+		// quantity td
168
+		$html .= EEH_HTML::td($line_item->quantity(), '', 'item_l jst-rght');
169
+		$tax_rate = $line_item->is_taxable()
170
+					&& EE_Registry::instance()->CFG->tax_settings->prices_displayed_including_taxes
171
+			? 1 + ( $this->_tax_rate / 100 )
172
+			: 1;
173
+		// price td
174
+		$unit_price = apply_filters(
175
+			'FHEE__EE_Default_Line_Item_Display_Strategy___item_row__unit_price',
176
+			EEH_Template::format_currency($line_item->unit_price() * $tax_rate, false, false),
177
+			$line_item,
178
+			$tax_rate
179
+		);
180
+		$html .= EEH_HTML::td($unit_price, '', 'item_c jst-rght');
181
+		// total td
182
+		$total = apply_filters(
183
+			'FHEE__EE_Default_Line_Item_Display_Strategy___item_row__total',
184
+			EEH_Template::format_currency($line_item->unit_price() * $line_item->quantity() * $tax_rate, false, false),
185
+			$line_item,
186
+			$tax_rate
187
+		);
188
+		$html .= EEH_HTML::td($total, '', 'item_r jst-rght');
189
+		// end of row
190
+		$html .= EEH_HTML::trx();
191
+
192
+		return $html;
193
+	}
194
+
195
+
196
+
197
+	/**
198
+	 *  _sub_item_row
199
+	 *
200
+	 * @param EE_Line_Item $line_item
201
+	 * @param array        $options
202
+	 * @return mixed
203
+	 */
204
+	private function _sub_item_row(EE_Line_Item $line_item, $options = array())
205
+	{
206
+		// start of row
207
+		$html = EEH_HTML::tr('', 'item sub-item-row');
208
+		// name && desc
209
+		$name_and_desc = $line_item->name();
210
+		$name_and_desc .= $options['show_desc'] ? '<span class="line-sub-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '';
211
+		// name td
212
+		$html .= EEH_HTML::td(/*__FUNCTION__ .*/ $name_and_desc, '', 'item_l sub-item');
213
+		// discount/surcharge td
214
+		if ($line_item->is_percent()) {
215
+			$html .= EEH_HTML::td($line_item->percent() . '%', '', 'item_c');
216
+		} else {
217
+			$html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c jst-rght');
218
+		}
219
+		// total td
220
+		$html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'item_r jst-rght');
221
+		// end of row
222
+		$html .= EEH_HTML::trx();
223
+		return $html;
224
+	}
225 225
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         $html = '';
67 67
         // set some default options and merge with incoming
68 68
         $default_options = array(
69
-            'show_desc' => true,  //    TRUE        FALSE
69
+            'show_desc' => true, //    TRUE        FALSE
70 70
             'odd' => false
71 71
         );
72 72
         $options = array_merge($default_options, (array) $options);
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         );
150 150
         $name_and_desc .= apply_filters(
151 151
             'FHEE__EE_Default_Line_Item_Display_Strategy__item_row__desc',
152
-            ( $options['show_desc'] ? '<span class="line-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '' ),
152
+            ($options['show_desc'] ? '<span class="line-item-desc-spn smaller-text">: '.$line_item->desc().'</span>' : ''),
153 153
             $line_item,
154 154
             $options
155 155
         );
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         $html .= EEH_HTML::td($line_item->quantity(), '', 'item_l jst-rght');
169 169
         $tax_rate = $line_item->is_taxable()
170 170
                     && EE_Registry::instance()->CFG->tax_settings->prices_displayed_including_taxes
171
-            ? 1 + ( $this->_tax_rate / 100 )
171
+            ? 1 + ($this->_tax_rate / 100)
172 172
             : 1;
173 173
         // price td
174 174
         $unit_price = apply_filters(
@@ -207,12 +207,12 @@  discard block
 block discarded – undo
207 207
         $html = EEH_HTML::tr('', 'item sub-item-row');
208 208
         // name && desc
209 209
         $name_and_desc = $line_item->name();
210
-        $name_and_desc .= $options['show_desc'] ? '<span class="line-sub-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '';
210
+        $name_and_desc .= $options['show_desc'] ? '<span class="line-sub-item-desc-spn smaller-text">: '.$line_item->desc().'</span>' : '';
211 211
         // name td
212 212
         $html .= EEH_HTML::td(/*__FUNCTION__ .*/ $name_and_desc, '', 'item_l sub-item');
213 213
         // discount/surcharge td
214 214
         if ($line_item->is_percent()) {
215
-            $html .= EEH_HTML::td($line_item->percent() . '%', '', 'item_c');
215
+            $html .= EEH_HTML::td($line_item->percent().'%', '', 'item_c');
216 216
         } else {
217 217
             $html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c jst-rght');
218 218
         }
Please login to merge, or discard this patch.
core/domain/services/pue/StatsGatherer.php 2 patches
Indentation   +288 added lines, -288 removed lines patch added patch discarded remove patch
@@ -16,314 +16,314 @@
 block discarded – undo
16 16
 class StatsGatherer
17 17
 {
18 18
 
19
-    const COUNT_ALL_EVENTS = 'event';
20
-    const COUNT_ACTIVE_EVENTS = 'active_event';
21
-    const COUNT_DATETIMES = 'datetime';
22
-    const COUNT_TICKETS = 'ticket';
23
-    const COUNT_DATETIMES_SOLD = 'datetime_sold';
24
-    const COUNT_TICKETS_FREE = 'free_ticket';
25
-    const COUNT_TICKETS_PAID = 'paid_ticket';
26
-    const COUNT_TICKETS_SOLD = 'ticket_sold';
27
-    const COUNT_REGISTRATIONS_APPROVED = 'registrations_approved';
28
-    const COUNT_REGISTRATIONS_NOT_APPROVED = 'registrations_not_approved';
29
-    const COUNT_REGISTRATIONS_PENDING = 'registrations_pending';
30
-    const COUNT_REGISTRATIONS_INCOMPLETE = 'registrations_incomplete';
31
-    const COUNT_REGISTRATIONS_ALL = 'registrations_all';
32
-    const COUNT_REGISTRATIONS_CANCELLED = 'registrations_cancelled';
33
-    const COUNT_REGISTRATIONS_DECLINED = 'registrations_declined';
34
-    const SUM_TRANSACTIONS_COMPLETE_TOTAL = 'transactions_complete_total_sum';
35
-    const SUM_TRANSACTIONS_ALL_PAID = 'transactions_all_paid';
36
-    const INFO_SITE_CURRENCY = 'site_currency';
19
+	const COUNT_ALL_EVENTS = 'event';
20
+	const COUNT_ACTIVE_EVENTS = 'active_event';
21
+	const COUNT_DATETIMES = 'datetime';
22
+	const COUNT_TICKETS = 'ticket';
23
+	const COUNT_DATETIMES_SOLD = 'datetime_sold';
24
+	const COUNT_TICKETS_FREE = 'free_ticket';
25
+	const COUNT_TICKETS_PAID = 'paid_ticket';
26
+	const COUNT_TICKETS_SOLD = 'ticket_sold';
27
+	const COUNT_REGISTRATIONS_APPROVED = 'registrations_approved';
28
+	const COUNT_REGISTRATIONS_NOT_APPROVED = 'registrations_not_approved';
29
+	const COUNT_REGISTRATIONS_PENDING = 'registrations_pending';
30
+	const COUNT_REGISTRATIONS_INCOMPLETE = 'registrations_incomplete';
31
+	const COUNT_REGISTRATIONS_ALL = 'registrations_all';
32
+	const COUNT_REGISTRATIONS_CANCELLED = 'registrations_cancelled';
33
+	const COUNT_REGISTRATIONS_DECLINED = 'registrations_declined';
34
+	const SUM_TRANSACTIONS_COMPLETE_TOTAL = 'transactions_complete_total_sum';
35
+	const SUM_TRANSACTIONS_ALL_PAID = 'transactions_all_paid';
36
+	const INFO_SITE_CURRENCY = 'site_currency';
37 37
 
38 38
 
39
-    /**
40
-     * @var EEM_Payment_Method
41
-     */
42
-    private $payment_method_model;
39
+	/**
40
+	 * @var EEM_Payment_Method
41
+	 */
42
+	private $payment_method_model;
43 43
 
44 44
 
45
-    /**
46
-     * @var EEM_Event
47
-     */
48
-    private $event_model;
45
+	/**
46
+	 * @var EEM_Event
47
+	 */
48
+	private $event_model;
49 49
 
50
-    /**
51
-     * @var EEM_Datetime
52
-     */
53
-    private $datetime_model;
50
+	/**
51
+	 * @var EEM_Datetime
52
+	 */
53
+	private $datetime_model;
54 54
 
55 55
 
56
-    /**
57
-     * @var EEM_Ticket
58
-     */
59
-    private $ticket_model;
56
+	/**
57
+	 * @var EEM_Ticket
58
+	 */
59
+	private $ticket_model;
60 60
 
61 61
 
62
-    /**
63
-     * @var EEM_Registration
64
-     */
65
-    private $registration_model;
62
+	/**
63
+	 * @var EEM_Registration
64
+	 */
65
+	private $registration_model;
66 66
 
67 67
 
68
-    /**
69
-     * @var EEM_Transaction
70
-     */
71
-    private $transaction_model;
68
+	/**
69
+	 * @var EEM_Transaction
70
+	 */
71
+	private $transaction_model;
72 72
 
73 73
 
74
-    /**
75
-     * @var EE_Config
76
-     */
77
-    private $config;
74
+	/**
75
+	 * @var EE_Config
76
+	 */
77
+	private $config;
78 78
 
79 79
 
80
-    /**
81
-     * StatsGatherer constructor.
82
-     *
83
-     * @param EEM_Payment_Method $payment_method_model
84
-     * @param EEM_Event          $event_model
85
-     * @param EEM_Datetime       $datetime_model
86
-     * @param EEM_Ticket         $ticket_model
87
-     * @param EEM_Registration   $registration_model
88
-     * @param EEM_Transaction    $transaction_model
89
-     * @param EE_Config          $config
90
-     */
91
-    public function __construct(
92
-        EEM_Payment_Method $payment_method_model,
93
-        EEM_Event $event_model,
94
-        EEM_Datetime $datetime_model,
95
-        EEM_Ticket $ticket_model,
96
-        EEM_Registration $registration_model,
97
-        EEM_Transaction $transaction_model,
98
-        EE_Config $config
99
-    ) {
100
-        $this->payment_method_model = $payment_method_model;
101
-        $this->event_model = $event_model;
102
-        $this->datetime_model = $datetime_model;
103
-        $this->ticket_model = $ticket_model;
104
-        $this->registration_model = $registration_model;
105
-        $this->transaction_model = $transaction_model;
106
-        $this->config = $config;
107
-    }
80
+	/**
81
+	 * StatsGatherer constructor.
82
+	 *
83
+	 * @param EEM_Payment_Method $payment_method_model
84
+	 * @param EEM_Event          $event_model
85
+	 * @param EEM_Datetime       $datetime_model
86
+	 * @param EEM_Ticket         $ticket_model
87
+	 * @param EEM_Registration   $registration_model
88
+	 * @param EEM_Transaction    $transaction_model
89
+	 * @param EE_Config          $config
90
+	 */
91
+	public function __construct(
92
+		EEM_Payment_Method $payment_method_model,
93
+		EEM_Event $event_model,
94
+		EEM_Datetime $datetime_model,
95
+		EEM_Ticket $ticket_model,
96
+		EEM_Registration $registration_model,
97
+		EEM_Transaction $transaction_model,
98
+		EE_Config $config
99
+	) {
100
+		$this->payment_method_model = $payment_method_model;
101
+		$this->event_model = $event_model;
102
+		$this->datetime_model = $datetime_model;
103
+		$this->ticket_model = $ticket_model;
104
+		$this->registration_model = $registration_model;
105
+		$this->transaction_model = $transaction_model;
106
+		$this->config = $config;
107
+	}
108 108
 
109 109
 
110
-    /**
111
-     * Return the stats array for PUE UXIP stats.
112
-     *
113
-     * @return array
114
-     */
115
-    public function stats()
116
-    {
117
-        global $wp_version;
118
-        $stats = $this->paymentMethodStats();
119
-        // a-ok so let's setup our stats.
120
-        $stats = array_merge($stats, array(
121
-            'is_multisite'                    => is_multisite() && is_main_site(),
122
-            'active_theme'                    => $this->getActiveThemeStat(),
123
-            'ee4_all_events_count'            => $this->getCountFor(self::COUNT_ALL_EVENTS),
124
-            'ee4_active_events_count'         => $this->getCountFor(self::COUNT_ACTIVE_EVENTS),
125
-            'all_dtts_count'                  => $this->getCountFor(self::COUNT_DATETIMES),
126
-            'dtt_sold'                        => $this->getCountFor(self::COUNT_DATETIMES_SOLD),
127
-            'all_tkt_count'                   => $this->getCountFor(self::COUNT_TICKETS),
128
-            'free_tkt_count'                  => $this->getCountFor(self::COUNT_TICKETS_FREE),
129
-            'paid_tkt_count'                  => $this->getCountFor(self::COUNT_TICKETS_PAID),
130
-            'tkt_sold'                        => $this->getCountFor(self::COUNT_TICKETS_SOLD),
131
-            'approve_registration_count'      => $this->getCountFor(self::COUNT_REGISTRATIONS_APPROVED),
132
-            'pending_registration_count'      => $this->getCountFor(self::COUNT_REGISTRATIONS_PENDING),
133
-            'not_approved_registration_count' => $this->getCountFor(self::COUNT_REGISTRATIONS_NOT_APPROVED),
134
-            'incomplete_registration_count'   => $this->getCountFor(self::COUNT_REGISTRATIONS_INCOMPLETE),
135
-            'cancelled_registration_count'    => $this->getCountFor(self::COUNT_REGISTRATIONS_CANCELLED),
136
-            'declined_registration_count'     => $this->getCountFor(self::COUNT_REGISTRATIONS_DECLINED),
137
-            'all_registration_count'          => $this->getCountFor(self::COUNT_REGISTRATIONS_ALL),
138
-            'completed_transaction_total_sum' => $this->getCountFor(self::SUM_TRANSACTIONS_COMPLETE_TOTAL),
139
-            'all_transaction_paid_sum'        => $this->getCountFor(self::SUM_TRANSACTIONS_ALL_PAID),
140
-            self::INFO_SITE_CURRENCY          => $this->config->currency instanceof EE_Currency_Config
141
-                ? $this->config->currency->code
142
-                : 'unknown',
143
-            'phpversion'                      => implode(
144
-                '.',
145
-                array(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION)
146
-            ),
147
-            'wpversion'                       => $wp_version,
148
-            'active_addons'                   => $this->getActiveAddons(),
149
-        ));
150
-        // remove any values that equal null.  This ensures any stats that weren't retrieved successfully are excluded.
151
-        return array_filter($stats, function ($value) {
152
-            return $value !== null;
153
-        });
154
-    }
110
+	/**
111
+	 * Return the stats array for PUE UXIP stats.
112
+	 *
113
+	 * @return array
114
+	 */
115
+	public function stats()
116
+	{
117
+		global $wp_version;
118
+		$stats = $this->paymentMethodStats();
119
+		// a-ok so let's setup our stats.
120
+		$stats = array_merge($stats, array(
121
+			'is_multisite'                    => is_multisite() && is_main_site(),
122
+			'active_theme'                    => $this->getActiveThemeStat(),
123
+			'ee4_all_events_count'            => $this->getCountFor(self::COUNT_ALL_EVENTS),
124
+			'ee4_active_events_count'         => $this->getCountFor(self::COUNT_ACTIVE_EVENTS),
125
+			'all_dtts_count'                  => $this->getCountFor(self::COUNT_DATETIMES),
126
+			'dtt_sold'                        => $this->getCountFor(self::COUNT_DATETIMES_SOLD),
127
+			'all_tkt_count'                   => $this->getCountFor(self::COUNT_TICKETS),
128
+			'free_tkt_count'                  => $this->getCountFor(self::COUNT_TICKETS_FREE),
129
+			'paid_tkt_count'                  => $this->getCountFor(self::COUNT_TICKETS_PAID),
130
+			'tkt_sold'                        => $this->getCountFor(self::COUNT_TICKETS_SOLD),
131
+			'approve_registration_count'      => $this->getCountFor(self::COUNT_REGISTRATIONS_APPROVED),
132
+			'pending_registration_count'      => $this->getCountFor(self::COUNT_REGISTRATIONS_PENDING),
133
+			'not_approved_registration_count' => $this->getCountFor(self::COUNT_REGISTRATIONS_NOT_APPROVED),
134
+			'incomplete_registration_count'   => $this->getCountFor(self::COUNT_REGISTRATIONS_INCOMPLETE),
135
+			'cancelled_registration_count'    => $this->getCountFor(self::COUNT_REGISTRATIONS_CANCELLED),
136
+			'declined_registration_count'     => $this->getCountFor(self::COUNT_REGISTRATIONS_DECLINED),
137
+			'all_registration_count'          => $this->getCountFor(self::COUNT_REGISTRATIONS_ALL),
138
+			'completed_transaction_total_sum' => $this->getCountFor(self::SUM_TRANSACTIONS_COMPLETE_TOTAL),
139
+			'all_transaction_paid_sum'        => $this->getCountFor(self::SUM_TRANSACTIONS_ALL_PAID),
140
+			self::INFO_SITE_CURRENCY          => $this->config->currency instanceof EE_Currency_Config
141
+				? $this->config->currency->code
142
+				: 'unknown',
143
+			'phpversion'                      => implode(
144
+				'.',
145
+				array(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION)
146
+			),
147
+			'wpversion'                       => $wp_version,
148
+			'active_addons'                   => $this->getActiveAddons(),
149
+		));
150
+		// remove any values that equal null.  This ensures any stats that weren't retrieved successfully are excluded.
151
+		return array_filter($stats, function ($value) {
152
+			return $value !== null;
153
+		});
154
+	}
155 155
 
156
-    /**
157
-     * @param string $which enum (@see constants prefixed with COUNT)
158
-     * @return int|null
159
-     */
160
-    private function getCountFor($which)
161
-    {
162
-        try {
163
-            switch ($which) {
164
-                case self::COUNT_ALL_EVENTS:
165
-                    $count = $this->event_model->count();
166
-                    break;
167
-                case self::COUNT_TICKETS:
168
-                    $count = $this->ticket_model->count();
169
-                    break;
170
-                case self::COUNT_DATETIMES:
171
-                    $count = $this->datetime_model->count();
172
-                    break;
173
-                case self::COUNT_ACTIVE_EVENTS:
174
-                    $count = $this->event_model->get_active_events(array(), true);
175
-                    break;
176
-                case self::COUNT_DATETIMES_SOLD:
177
-                    $count = $this->datetime_model->sum(array(), 'DTT_sold');
178
-                    break;
179
-                case self::COUNT_TICKETS_FREE:
180
-                    $count = $this->ticket_model->count(array(
181
-                        array(
182
-                            'TKT_price' => 0,
183
-                        ),
184
-                    ));
185
-                    break;
186
-                case self::COUNT_TICKETS_PAID:
187
-                    $count = $this->ticket_model->count(array(
188
-                        array(
189
-                            'TKT_price' => array('>', 0),
190
-                        ),
191
-                    ));
192
-                    break;
193
-                case self::COUNT_TICKETS_SOLD:
194
-                    $count = $this->ticket_model->sum(array(), 'TKT_sold');
195
-                    break;
196
-                case self::COUNT_REGISTRATIONS_ALL:
197
-                    $count = $this->registration_model->count();
198
-                    break;
199
-                case self::COUNT_REGISTRATIONS_CANCELLED:
200
-                    $count = $this->registration_model->count(
201
-                        array(
202
-                            array(
203
-                                'STS_ID' => EEM_Registration::status_id_cancelled,
204
-                            ),
205
-                        )
206
-                    );
207
-                    break;
208
-                case self::COUNT_REGISTRATIONS_INCOMPLETE:
209
-                    $count = $this->registration_model->count(
210
-                        array(
211
-                            array(
212
-                                'STS_ID' => EEM_Registration::status_id_incomplete,
213
-                            ),
214
-                        )
215
-                    );
216
-                    break;
217
-                case self::COUNT_REGISTRATIONS_NOT_APPROVED:
218
-                    $count = $this->registration_model->count(
219
-                        array(
220
-                            array(
221
-                                'STS_ID' => EEM_Registration::status_id_not_approved,
222
-                            ),
223
-                        )
224
-                    );
225
-                    break;
226
-                case self::COUNT_REGISTRATIONS_DECLINED:
227
-                    $count = $this->registration_model->count(
228
-                        array(
229
-                            array(
230
-                                'STS_ID' => EEM_Registration::status_id_declined,
231
-                            ),
232
-                        )
233
-                    );
234
-                    break;
235
-                case self::COUNT_REGISTRATIONS_PENDING:
236
-                    $count = $this->registration_model->count(
237
-                        array(
238
-                            array(
239
-                                'STS_ID' => EEM_Registration::status_id_pending_payment,
240
-                            ),
241
-                        )
242
-                    );
243
-                    break;
244
-                case self::COUNT_REGISTRATIONS_APPROVED:
245
-                    $count = $this->registration_model->count(
246
-                        array(
247
-                            array(
248
-                                'STS_ID' => EEM_Registration::status_id_approved,
249
-                            ),
250
-                        )
251
-                    );
252
-                    break;
253
-                case self::SUM_TRANSACTIONS_COMPLETE_TOTAL:
254
-                    $count = $this->transaction_model->sum(
255
-                        array(
256
-                            array(
257
-                                'STS_ID' => EEM_Transaction::complete_status_code,
258
-                            ),
259
-                        ),
260
-                        'TXN_total'
261
-                    );
262
-                    break;
263
-                case self::SUM_TRANSACTIONS_ALL_PAID:
264
-                    $count = $this->transaction_model->sum(
265
-                        array(),
266
-                        'TXN_paid'
267
-                    );
268
-                    break;
269
-                default:
270
-                    $count = null;
271
-                    break;
272
-            }
273
-        } catch (Exception $e) {
274
-            $count = null;
275
-        }
276
-        return $count;
277
-    }
156
+	/**
157
+	 * @param string $which enum (@see constants prefixed with COUNT)
158
+	 * @return int|null
159
+	 */
160
+	private function getCountFor($which)
161
+	{
162
+		try {
163
+			switch ($which) {
164
+				case self::COUNT_ALL_EVENTS:
165
+					$count = $this->event_model->count();
166
+					break;
167
+				case self::COUNT_TICKETS:
168
+					$count = $this->ticket_model->count();
169
+					break;
170
+				case self::COUNT_DATETIMES:
171
+					$count = $this->datetime_model->count();
172
+					break;
173
+				case self::COUNT_ACTIVE_EVENTS:
174
+					$count = $this->event_model->get_active_events(array(), true);
175
+					break;
176
+				case self::COUNT_DATETIMES_SOLD:
177
+					$count = $this->datetime_model->sum(array(), 'DTT_sold');
178
+					break;
179
+				case self::COUNT_TICKETS_FREE:
180
+					$count = $this->ticket_model->count(array(
181
+						array(
182
+							'TKT_price' => 0,
183
+						),
184
+					));
185
+					break;
186
+				case self::COUNT_TICKETS_PAID:
187
+					$count = $this->ticket_model->count(array(
188
+						array(
189
+							'TKT_price' => array('>', 0),
190
+						),
191
+					));
192
+					break;
193
+				case self::COUNT_TICKETS_SOLD:
194
+					$count = $this->ticket_model->sum(array(), 'TKT_sold');
195
+					break;
196
+				case self::COUNT_REGISTRATIONS_ALL:
197
+					$count = $this->registration_model->count();
198
+					break;
199
+				case self::COUNT_REGISTRATIONS_CANCELLED:
200
+					$count = $this->registration_model->count(
201
+						array(
202
+							array(
203
+								'STS_ID' => EEM_Registration::status_id_cancelled,
204
+							),
205
+						)
206
+					);
207
+					break;
208
+				case self::COUNT_REGISTRATIONS_INCOMPLETE:
209
+					$count = $this->registration_model->count(
210
+						array(
211
+							array(
212
+								'STS_ID' => EEM_Registration::status_id_incomplete,
213
+							),
214
+						)
215
+					);
216
+					break;
217
+				case self::COUNT_REGISTRATIONS_NOT_APPROVED:
218
+					$count = $this->registration_model->count(
219
+						array(
220
+							array(
221
+								'STS_ID' => EEM_Registration::status_id_not_approved,
222
+							),
223
+						)
224
+					);
225
+					break;
226
+				case self::COUNT_REGISTRATIONS_DECLINED:
227
+					$count = $this->registration_model->count(
228
+						array(
229
+							array(
230
+								'STS_ID' => EEM_Registration::status_id_declined,
231
+							),
232
+						)
233
+					);
234
+					break;
235
+				case self::COUNT_REGISTRATIONS_PENDING:
236
+					$count = $this->registration_model->count(
237
+						array(
238
+							array(
239
+								'STS_ID' => EEM_Registration::status_id_pending_payment,
240
+							),
241
+						)
242
+					);
243
+					break;
244
+				case self::COUNT_REGISTRATIONS_APPROVED:
245
+					$count = $this->registration_model->count(
246
+						array(
247
+							array(
248
+								'STS_ID' => EEM_Registration::status_id_approved,
249
+							),
250
+						)
251
+					);
252
+					break;
253
+				case self::SUM_TRANSACTIONS_COMPLETE_TOTAL:
254
+					$count = $this->transaction_model->sum(
255
+						array(
256
+							array(
257
+								'STS_ID' => EEM_Transaction::complete_status_code,
258
+							),
259
+						),
260
+						'TXN_total'
261
+					);
262
+					break;
263
+				case self::SUM_TRANSACTIONS_ALL_PAID:
264
+					$count = $this->transaction_model->sum(
265
+						array(),
266
+						'TXN_paid'
267
+					);
268
+					break;
269
+				default:
270
+					$count = null;
271
+					break;
272
+			}
273
+		} catch (Exception $e) {
274
+			$count = null;
275
+		}
276
+		return $count;
277
+	}
278 278
 
279
-    /**
280
-     * Return the active theme.
281
-     *
282
-     * @return false|string
283
-     */
284
-    private function getActiveThemeStat()
285
-    {
286
-        $theme = wp_get_theme();
287
-        return $theme->get('Name');
288
-    }
279
+	/**
280
+	 * Return the active theme.
281
+	 *
282
+	 * @return false|string
283
+	 */
284
+	private function getActiveThemeStat()
285
+	{
286
+		$theme = wp_get_theme();
287
+		return $theme->get('Name');
288
+	}
289 289
 
290
-    /**
291
-     * @return array
292
-     */
293
-    private function paymentMethodStats()
294
-    {
295
-        $payment_method_stats = array();
296
-        try {
297
-            $active_payment_methods = $this->payment_method_model->get_all_active(
298
-                null,
299
-                array('group_by' => 'PMD_type')
300
-            );
301
-            if ($active_payment_methods) {
302
-                foreach ($active_payment_methods as $payment_method) {
303
-                    $payment_method_stats[ $payment_method->name() . '_active_payment_method' ] = 1;
304
-                }
305
-            }
306
-        } catch (Exception $e) {
307
-            // do nothing just prevents fatals.
308
-        }
309
-        return $payment_method_stats;
310
-    }
290
+	/**
291
+	 * @return array
292
+	 */
293
+	private function paymentMethodStats()
294
+	{
295
+		$payment_method_stats = array();
296
+		try {
297
+			$active_payment_methods = $this->payment_method_model->get_all_active(
298
+				null,
299
+				array('group_by' => 'PMD_type')
300
+			);
301
+			if ($active_payment_methods) {
302
+				foreach ($active_payment_methods as $payment_method) {
303
+					$payment_method_stats[ $payment_method->name() . '_active_payment_method' ] = 1;
304
+				}
305
+			}
306
+		} catch (Exception $e) {
307
+			// do nothing just prevents fatals.
308
+		}
309
+		return $payment_method_stats;
310
+	}
311 311
 
312 312
 
313
-    /**
314
-     * Return a list of active EE add-ons and their versions.
315
-     *
316
-     * @return string
317
-     */
318
-    private function getActiveAddons()
319
-    {
320
-        $activeAddons = [];
321
-        $addOns = EE_Registry::instance()->addons;
322
-        if (! empty($addOns)) {
323
-            foreach ($addOns as $addon) {
324
-                $activeAddons[] = $addon->name() . '@' . $addon->version();
325
-            }
326
-        }
327
-        return implode(',', $activeAddons);
328
-    }
313
+	/**
314
+	 * Return a list of active EE add-ons and their versions.
315
+	 *
316
+	 * @return string
317
+	 */
318
+	private function getActiveAddons()
319
+	{
320
+		$activeAddons = [];
321
+		$addOns = EE_Registry::instance()->addons;
322
+		if (! empty($addOns)) {
323
+			foreach ($addOns as $addon) {
324
+				$activeAddons[] = $addon->name() . '@' . $addon->version();
325
+			}
326
+		}
327
+		return implode(',', $activeAddons);
328
+	}
329 329
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             'active_addons'                   => $this->getActiveAddons(),
149 149
         ));
150 150
         // remove any values that equal null.  This ensures any stats that weren't retrieved successfully are excluded.
151
-        return array_filter($stats, function ($value) {
151
+        return array_filter($stats, function($value) {
152 152
             return $value !== null;
153 153
         });
154 154
     }
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
             );
301 301
             if ($active_payment_methods) {
302 302
                 foreach ($active_payment_methods as $payment_method) {
303
-                    $payment_method_stats[ $payment_method->name() . '_active_payment_method' ] = 1;
303
+                    $payment_method_stats[$payment_method->name().'_active_payment_method'] = 1;
304 304
                 }
305 305
             }
306 306
         } catch (Exception $e) {
@@ -319,9 +319,9 @@  discard block
 block discarded – undo
319 319
     {
320 320
         $activeAddons = [];
321 321
         $addOns = EE_Registry::instance()->addons;
322
-        if (! empty($addOns)) {
322
+        if ( ! empty($addOns)) {
323 323
             foreach ($addOns as $addon) {
324
-                $activeAddons[] = $addon->name() . '@' . $addon->version();
324
+                $activeAddons[] = $addon->name().'@'.$addon->version();
325 325
             }
326 326
         }
327 327
         return implode(',', $activeAddons);
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_8_0.dms.php 2 patches
Indentation   +357 added lines, -357 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 $stages = glob(EE_CORE . 'data_migration_scripts/4_8_0_stages/*');
18 18
 $class_to_filepath = array();
19 19
 foreach ($stages as $filepath) {
20
-    $matches = array();
21
-    preg_match('~4_8_0_stages/(.*).dmsstage.php~', $filepath, $matches);
22
-    $class_to_filepath[ $matches[1] ] = $filepath;
20
+	$matches = array();
21
+	preg_match('~4_8_0_stages/(.*).dmsstage.php~', $filepath, $matches);
22
+	$class_to_filepath[ $matches[1] ] = $filepath;
23 23
 }
24 24
 // give addons a chance to autoload their stages too
25 25
 $class_to_filepath = apply_filters('FHEE__EE_DMS_4_8_0__autoloaded_stages', $class_to_filepath);
@@ -38,71 +38,71 @@  discard block
 block discarded – undo
38 38
 class EE_DMS_Core_4_8_0 extends EE_Data_Migration_Script_Base
39 39
 {
40 40
 
41
-    /**
42
-     * return EE_DMS_Core_4_8_0
43
-     *
44
-     * @param TableManager  $table_manager
45
-     * @param TableAnalysis $table_analysis
46
-     */
47
-    public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null)
48
-    {
49
-        $this->_pretty_name = esc_html__("Data Update to Event Espresso 4.8.0", "event_espresso");
50
-        $this->_priority = 10;
51
-        $this->_migration_stages = array(
52
-            new EE_DMS_4_8_0_pretax_totals(),
53
-            new EE_DMS_4_8_0_event_subtotals(),
54
-        );
55
-        parent::__construct($table_manager, $table_analysis);
56
-    }
41
+	/**
42
+	 * return EE_DMS_Core_4_8_0
43
+	 *
44
+	 * @param TableManager  $table_manager
45
+	 * @param TableAnalysis $table_analysis
46
+	 */
47
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null)
48
+	{
49
+		$this->_pretty_name = esc_html__("Data Update to Event Espresso 4.8.0", "event_espresso");
50
+		$this->_priority = 10;
51
+		$this->_migration_stages = array(
52
+			new EE_DMS_4_8_0_pretax_totals(),
53
+			new EE_DMS_4_8_0_event_subtotals(),
54
+		);
55
+		parent::__construct($table_manager, $table_analysis);
56
+	}
57 57
 
58 58
 
59 59
 
60
-    /**
61
-     * Because this is being done at basically the same time as the MER-ready branch
62
-     * of core, it's possible people might have installed MEr-ready branch first,
63
-     * and then this one, in which case we still want to perform this migration,
64
-     * even though the version might not have increased
65
-     *
66
-     * @param array $version_array
67
-     * @return bool
68
-     */
69
-    public function can_migrate_from_version($version_array)
70
-    {
71
-        $version_string = $version_array['Core'];
72
-        if (version_compare($version_string, '4.8.0.decaf', '<') && version_compare($version_string, '4.7.0.decaf', '>=')) {
60
+	/**
61
+	 * Because this is being done at basically the same time as the MER-ready branch
62
+	 * of core, it's possible people might have installed MEr-ready branch first,
63
+	 * and then this one, in which case we still want to perform this migration,
64
+	 * even though the version might not have increased
65
+	 *
66
+	 * @param array $version_array
67
+	 * @return bool
68
+	 */
69
+	public function can_migrate_from_version($version_array)
70
+	{
71
+		$version_string = $version_array['Core'];
72
+		if (version_compare($version_string, '4.8.0.decaf', '<') && version_compare($version_string, '4.7.0.decaf', '>=')) {
73 73
 //          echo "$version_string can be migrated from";
74
-            return true;
75
-        } elseif (! $version_string) {
74
+			return true;
75
+		} elseif (! $version_string) {
76 76
 //          echo "no version string provided: $version_string";
77
-            // no version string provided... this must be pre 4.3
78
-            return false;// changed mind. dont want people thinking they should migrate yet because they cant
79
-        } else {
77
+			// no version string provided... this must be pre 4.3
78
+			return false;// changed mind. dont want people thinking they should migrate yet because they cant
79
+		} else {
80 80
 //          echo "$version_string doesnt apply";
81
-            return false;
82
-        }
83
-    }
81
+			return false;
82
+		}
83
+	}
84 84
 
85 85
 
86 86
 
87
-    /**
88
-     * @return bool
89
-     */
90
-    public function schema_changes_before_migration()
91
-    {
92
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
93
-        $now_in_mysql = current_time('mysql', true);
94
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
95
-        $table_name = 'esp_answer';
96
-        $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
87
+	/**
88
+	 * @return bool
89
+	 */
90
+	public function schema_changes_before_migration()
91
+	{
92
+		require_once(EE_HELPERS . 'EEH_Activation.helper.php');
93
+		$now_in_mysql = current_time('mysql', true);
94
+		require_once(EE_HELPERS . 'EEH_Activation.helper.php');
95
+		$table_name = 'esp_answer';
96
+		$sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
97 97
 					REG_ID int(10) unsigned NOT NULL,
98 98
 					QST_ID int(10) unsigned NOT NULL,
99 99
 					ANS_value text NOT NULL,
100 100
 					PRIMARY KEY  (ANS_ID),
101 101
 					KEY REG_ID (REG_ID),
102 102
 					KEY QST_ID (QST_ID)";
103
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
104
-        $table_name = 'esp_attendee_meta';
105
-        $sql = "ATTM_ID int(10) unsigned NOT	NULL AUTO_INCREMENT,
103
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
104
+		$table_name = 'esp_attendee_meta';
105
+		$sql = "ATTM_ID int(10) unsigned NOT	NULL AUTO_INCREMENT,
106 106
 						ATT_ID bigint(20) unsigned NOT NULL,
107 107
 						ATT_fname varchar(45) NOT NULL,
108 108
 						ATT_lname varchar(45) NOT	NULL,
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
 							PRIMARY KEY  (ATTM_ID),
118 118
 								KEY ATT_ID (ATT_ID),
119 119
 								KEY ATT_email (ATT_email(191))";
120
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
121
-        $table_name = 'esp_country';
122
-        $sql = "CNT_ISO varchar(2) collate utf8_bin NOT NULL,
120
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
121
+		$table_name = 'esp_country';
122
+		$sql = "CNT_ISO varchar(2) collate utf8_bin NOT NULL,
123 123
 					  CNT_ISO3 varchar(3) collate utf8_bin NOT NULL,
124 124
 					  RGN_ID tinyint(3) unsigned DEFAULT NULL,
125 125
 					  CNT_name varchar(45) collate utf8_bin NOT NULL,
@@ -135,25 +135,25 @@  discard block
 block discarded – undo
135 135
 					  CNT_is_EU tinyint(1) DEFAULT '0',
136 136
 					  CNT_active tinyint(1) DEFAULT '0',
137 137
 					  PRIMARY KEY  (CNT_ISO)";
138
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
139
-        $table_name = 'esp_currency';
140
-        $sql = "CUR_code varchar(6) collate utf8_bin NOT NULL,
138
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
139
+		$table_name = 'esp_currency';
140
+		$sql = "CUR_code varchar(6) collate utf8_bin NOT NULL,
141 141
 				CUR_single varchar(45) collate utf8_bin DEFAULT 'dollar',
142 142
 				CUR_plural varchar(45) collate utf8_bin DEFAULT 'dollars',
143 143
 				CUR_sign varchar(45) collate utf8_bin DEFAULT '$',
144 144
 				CUR_dec_plc varchar(1) collate utf8_bin NOT NULL DEFAULT '2',
145 145
 				CUR_active tinyint(1) DEFAULT '0',
146 146
 				PRIMARY KEY  (CUR_code)";
147
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
148
-        $table_name = 'esp_currency_payment_method';
149
-        $sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT,
147
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
148
+		$table_name = 'esp_currency_payment_method';
149
+		$sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT,
150 150
 				CUR_code varchar(6) collate utf8_bin NOT NULL,
151 151
 				PMD_ID int(11) NOT NULL,
152 152
 				PRIMARY KEY  (CPM_ID),
153 153
 				KEY PMD_ID (PMD_ID)";
154
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
155
-        $table_name = 'esp_datetime';
156
-        $sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
154
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
155
+		$table_name = 'esp_datetime';
156
+		$sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
157 157
 				  EVT_ID bigint(20) unsigned NOT NULL,
158 158
 				  DTT_name varchar(255) NOT NULL DEFAULT '',
159 159
 				  DTT_description text NOT NULL,
@@ -169,9 +169,9 @@  discard block
 block discarded – undo
169 169
 						KEY DTT_EVT_start (DTT_EVT_start),
170 170
 						KEY EVT_ID (EVT_ID),
171 171
 						KEY DTT_is_primary (DTT_is_primary)";
172
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
173
-        $table_name = 'esp_event_meta';
174
-        $sql = "
172
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
173
+		$table_name = 'esp_event_meta';
174
+		$sql = "
175 175
 			EVTM_ID int(10) NOT NULL AUTO_INCREMENT,
176 176
 			EVT_ID bigint(20) unsigned NOT NULL,
177 177
 			EVT_display_desc tinyint(1) unsigned NOT NULL DEFAULT 1,
@@ -187,34 +187,34 @@  discard block
 block discarded – undo
187 187
 			EVT_donations tinyint(1) NULL,
188 188
 			PRIMARY KEY  (EVTM_ID),
189 189
 			KEY EVT_ID (EVT_ID)";
190
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
191
-        $table_name = 'esp_event_question_group';
192
-        $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
190
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
191
+		$table_name = 'esp_event_question_group';
192
+		$sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
193 193
 					EVT_ID bigint(20) unsigned NOT NULL,
194 194
 					QSG_ID int(10) unsigned NOT NULL,
195 195
 					EQG_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
196 196
 					PRIMARY KEY  (EQG_ID),
197 197
 					KEY EVT_ID (EVT_ID),
198 198
 					KEY QSG_ID (QSG_ID)";
199
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
200
-        $table_name = 'esp_event_venue';
201
-        $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
199
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
200
+		$table_name = 'esp_event_venue';
201
+		$sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
202 202
 				EVT_ID bigint(20) unsigned NOT NULL,
203 203
 				VNU_ID bigint(20) unsigned NOT NULL,
204 204
 				EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
205 205
 				PRIMARY KEY  (EVV_ID)";
206
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
207
-        $table_name = 'esp_extra_meta';
208
-        $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
206
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
207
+		$table_name = 'esp_extra_meta';
208
+		$sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
209 209
 				OBJ_ID int(11) DEFAULT NULL,
210 210
 				EXM_type varchar(45) DEFAULT NULL,
211 211
 				EXM_key varchar(45) DEFAULT NULL,
212 212
 				EXM_value text,
213 213
 				PRIMARY KEY  (EXM_ID),
214 214
 				KEY EXM_type (EXM_type,OBJ_ID,EXM_key)";
215
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
216
-        $table_name = 'esp_extra_join';
217
-        $sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT,
215
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
216
+		$table_name = 'esp_extra_join';
217
+		$sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT,
218 218
 				EXJ_first_model_id varchar(6) NOT NULL,
219 219
 				EXJ_first_model_name varchar(20) NOT NULL,
220 220
 				EXJ_second_model_id varchar(6) NOT NULL,
@@ -222,9 +222,9 @@  discard block
 block discarded – undo
222 222
 				PRIMARY KEY  (EXJ_ID),
223 223
 				KEY first_model (EXJ_first_model_name,EXJ_first_model_id),
224 224
 				KEY second_model (EXJ_second_model_name,EXJ_second_model_id)";
225
-        $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
226
-        $table_name = 'esp_line_item';
227
-        $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
225
+		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
226
+		$table_name = 'esp_line_item';
227
+		$sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
228 228
 				LIN_code varchar(245) NOT NULL DEFAULT '',
229 229
 				TXN_ID int(11) DEFAULT NULL,
230 230
 				LIN_name varchar(245) NOT NULL DEFAULT '',
@@ -243,9 +243,9 @@  discard block
 block discarded – undo
243 243
 				PRIMARY KEY  (LIN_ID),
244 244
 				KEY LIN_code (LIN_code(191)),
245 245
 				KEY TXN_ID (TXN_ID)";
246
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
247
-        $table_name = 'esp_log';
248
-        $sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT,
246
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
247
+		$table_name = 'esp_log';
248
+		$sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT,
249 249
 				LOG_time datetime DEFAULT NULL,
250 250
 				OBJ_ID varchar(45) DEFAULT NULL,
251 251
 				OBJ_type varchar(45) DEFAULT NULL,
@@ -256,18 +256,18 @@  discard block
 block discarded – undo
256 256
 				KEY LOG_time (LOG_time),
257 257
 				KEY OBJ (OBJ_type,OBJ_ID),
258 258
 				KEY LOG_type (LOG_type)";
259
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
260
-        $table_name = 'esp_message_template';
261
-        $sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
259
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
260
+		$table_name = 'esp_message_template';
261
+		$sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
262 262
 					GRP_ID int(10) unsigned NOT NULL,
263 263
 					MTP_context varchar(50) NOT NULL,
264 264
 					MTP_template_field varchar(30) NOT NULL,
265 265
 					MTP_content text NOT NULL,
266 266
 					PRIMARY KEY  (MTP_ID),
267 267
 					KEY GRP_ID (GRP_ID)";
268
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
269
-        $table_name = 'esp_message_template_group';
270
-        $sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
268
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
269
+		$table_name = 'esp_message_template_group';
270
+		$sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
271 271
 					MTP_user_id int(10) NOT NULL DEFAULT '1',
272 272
 					MTP_name varchar(245) NOT NULL DEFAULT '',
273 273
 					MTP_description varchar(245) NOT NULL DEFAULT '',
@@ -279,17 +279,17 @@  discard block
 block discarded – undo
279 279
 					MTP_is_active tinyint(1) NOT NULL DEFAULT '1',
280 280
 					PRIMARY KEY  (GRP_ID),
281 281
 					KEY MTP_user_id (MTP_user_id)";
282
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
283
-        $table_name = 'esp_event_message_template';
284
-        $sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
282
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
283
+		$table_name = 'esp_event_message_template';
284
+		$sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
285 285
 					EVT_ID bigint(20) unsigned NOT NULL DEFAULT 0,
286 286
 					GRP_ID int(10) unsigned NOT NULL DEFAULT 0,
287 287
 					PRIMARY KEY  (EMT_ID),
288 288
 					KEY EVT_ID (EVT_ID),
289 289
 					KEY GRP_ID (GRP_ID)";
290
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
291
-        $table_name = 'esp_payment';
292
-        $sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
290
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
291
+		$table_name = 'esp_payment';
292
+		$sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
293 293
 					TXN_ID int(10) unsigned DEFAULT NULL,
294 294
 					STS_ID varchar(3) collate utf8_bin DEFAULT NULL,
295 295
 					PAY_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
 					PRIMARY KEY  (PAY_ID),
307 307
 					KEY PAY_timestamp (PAY_timestamp),
308 308
 					KEY TXN_ID (TXN_ID)";
309
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
310
-        $table_name = 'esp_payment_method';
311
-        $sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT,
309
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
310
+		$table_name = 'esp_payment_method';
311
+		$sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT,
312 312
 				PMD_type varchar(124) DEFAULT NULL,
313 313
 				PMD_name varchar(255) DEFAULT NULL,
314 314
 				PMD_desc text,
@@ -324,32 +324,32 @@  discard block
 block discarded – undo
324 324
 				PRIMARY KEY  (PMD_ID),
325 325
 				UNIQUE KEY PMD_slug_UNIQUE (PMD_slug),
326 326
 				KEY PMD_type (PMD_type)";
327
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
328
-        $table_name = "esp_ticket_price";
329
-        $sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
327
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
328
+		$table_name = "esp_ticket_price";
329
+		$sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
330 330
 					  TKT_ID int(10) unsigned NOT NULL,
331 331
 					  PRC_ID int(10) unsigned NOT NULL,
332 332
 					  PRIMARY KEY  (TKP_ID),
333 333
 					  KEY TKT_ID (TKT_ID),
334 334
 					  KEY PRC_ID (PRC_ID)";
335
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
336
-        $table_name = "esp_datetime_ticket";
337
-        $sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
335
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
336
+		$table_name = "esp_datetime_ticket";
337
+		$sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
338 338
 					  DTT_ID int(10) unsigned NOT NULL,
339 339
 					  TKT_ID int(10) unsigned NOT NULL,
340 340
 					  PRIMARY KEY  (DTK_ID),
341 341
 					  KEY DTT_ID (DTT_ID),
342 342
 					  KEY TKT_ID (TKT_ID)";
343
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
344
-        $table_name = "esp_ticket_template";
345
-        $sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
343
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
344
+		$table_name = "esp_ticket_template";
345
+		$sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
346 346
 					  TTM_name varchar(45) NOT NULL,
347 347
 					  TTM_description text,
348 348
 					  TTM_file varchar(45),
349 349
 					  PRIMARY KEY  (TTM_ID)";
350
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
351
-        $table_name = 'esp_question';
352
-        $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
350
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
351
+		$table_name = 'esp_question';
352
+		$sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
353 353
 					QST_display_text text NOT NULL,
354 354
 					QST_admin_label varchar(255) NOT NULL,
355 355
 					QST_system varchar(25) NOT NULL DEFAULT "",
@@ -363,18 +363,18 @@  discard block
 block discarded – undo
363 363
 					QST_deleted tinyint(2) unsigned NOT NULL DEFAULT 0,
364 364
 					PRIMARY KEY  (QST_ID),
365 365
 					KEY QST_order (QST_order)';
366
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
367
-        $table_name = 'esp_question_group_question';
368
-        $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
366
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
367
+		$table_name = 'esp_question_group_question';
368
+		$sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
369 369
 					QSG_ID int(10) unsigned NOT NULL,
370 370
 					QST_ID int(10) unsigned NOT NULL,
371 371
 					QGQ_order int(10) unsigned NOT NULL DEFAULT 0,
372 372
 					PRIMARY KEY  (QGQ_ID),
373 373
 					KEY QST_ID (QST_ID),
374 374
 					KEY QSG_ID_order (QSG_ID,QGQ_order)";
375
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
376
-        $table_name = 'esp_question_option';
377
-        $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
375
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
376
+		$table_name = 'esp_question_option';
377
+		$sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
378 378
 					QSO_value varchar(255) NOT NULL,
379 379
 					QSO_desc text NOT NULL,
380 380
 					QST_ID int(10) unsigned NOT NULL,
@@ -384,9 +384,9 @@  discard block
 block discarded – undo
384 384
 					PRIMARY KEY  (QSO_ID),
385 385
 					KEY QST_ID (QST_ID),
386 386
 					KEY QSO_order (QSO_order)";
387
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
388
-        $table_name = 'esp_registration';
389
-        $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
387
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
388
+		$table_name = 'esp_registration';
389
+		$sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
390 390
 					  EVT_ID bigint(20) unsigned NOT NULL,
391 391
 					  ATT_ID bigint(20) unsigned NOT NULL,
392 392
 					  TXN_ID int(10) unsigned NOT NULL,
@@ -410,18 +410,18 @@  discard block
 block discarded – undo
410 410
 					  KEY TKT_ID (TKT_ID),
411 411
 					  KEY EVT_ID (EVT_ID),
412 412
 					  KEY STS_ID (STS_ID)";
413
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
414
-        $table_name = 'esp_registration_payment';
415
-        $sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
413
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
414
+		$table_name = 'esp_registration_payment';
415
+		$sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
416 416
 					  REG_ID int(10) unsigned NOT NULL,
417 417
 					  PAY_ID int(10) unsigned NULL,
418 418
 					  RPY_amount decimal(10,3) NOT NULL DEFAULT '0.00',
419 419
 					  PRIMARY KEY  (RPY_ID),
420 420
 					  KEY REG_ID (REG_ID),
421 421
 					  KEY PAY_ID (PAY_ID)";
422
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
423
-        $table_name = 'esp_checkin';
424
-        $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
422
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
423
+		$table_name = 'esp_checkin';
424
+		$sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
425 425
 					REG_ID int(10) unsigned NOT NULL,
426 426
 					DTT_ID int(10) unsigned NOT NULL,
427 427
 					CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1,
@@ -429,9 +429,9 @@  discard block
 block discarded – undo
429 429
 					PRIMARY KEY  (CHK_ID),
430 430
 					KEY REG_ID (REG_ID),
431 431
 					KEY DTT_ID (DTT_ID)";
432
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
433
-        $table_name = 'esp_state';
434
-        $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
432
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
433
+		$table_name = 'esp_state';
434
+		$sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
435 435
 					  CNT_ISO varchar(2) collate utf8_bin NOT NULL,
436 436
 					  STA_abbrev varchar(24) collate utf8_bin NOT NULL,
437 437
 					  STA_name varchar(100) collate utf8_bin NOT NULL,
@@ -439,9 +439,9 @@  discard block
 block discarded – undo
439 439
 					  PRIMARY KEY  (STA_ID),
440 440
 					  KEY STA_abbrev (STA_abbrev),
441 441
 					  KEY CNT_ISO (CNT_ISO)";
442
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
443
-        $table_name = 'esp_status';
444
-        $sql = "STS_ID varchar(3) NOT NULL,
442
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
443
+		$table_name = 'esp_status';
444
+		$sql = "STS_ID varchar(3) NOT NULL,
445 445
 					  STS_code varchar(45) NOT NULL,
446 446
 					  STS_type varchar(45) NOT NULL,
447 447
 					  STS_can_edit tinyint(1) NOT NULL DEFAULT 0,
@@ -449,9 +449,9 @@  discard block
 block discarded – undo
449 449
 					  STS_open tinyint(1) NOT NULL DEFAULT 1,
450 450
 					  UNIQUE KEY STS_ID_UNIQUE (STS_ID),
451 451
 					  KEY STS_type (STS_type)";
452
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
453
-        $table_name = 'esp_transaction';
454
-        $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
452
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
453
+		$table_name = 'esp_transaction';
454
+		$sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
455 455
 					  TXN_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
456 456
 					  TXN_total decimal(10,3) DEFAULT '0.00',
457 457
 					  TXN_paid decimal(10,3) NOT NULL DEFAULT '0.00',
@@ -463,9 +463,9 @@  discard block
 block discarded – undo
463 463
 					  PRIMARY KEY  (TXN_ID),
464 464
 					  KEY TXN_timestamp (TXN_timestamp),
465 465
 					  KEY STS_ID (STS_ID)";
466
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
467
-        $table_name = 'esp_venue_meta';
468
-        $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
466
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
467
+		$table_name = 'esp_venue_meta';
468
+		$sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
469 469
 			VNU_ID bigint(20) unsigned NOT NULL DEFAULT 0,
470 470
 			VNU_address varchar(255) DEFAULT NULL,
471 471
 			VNU_address2 varchar(255) DEFAULT NULL,
@@ -484,10 +484,10 @@  discard block
 block discarded – undo
484 484
 			KEY VNU_ID (VNU_ID),
485 485
 			KEY STA_ID (STA_ID),
486 486
 			KEY CNT_ISO (CNT_ISO)";
487
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
488
-        // modified tables
489
-        $table_name = "esp_price";
490
-        $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
487
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
488
+		// modified tables
489
+		$table_name = "esp_price";
490
+		$sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
491 491
 					  PRT_ID tinyint(3) unsigned NOT NULL,
492 492
 					  PRC_amount decimal(10,3) NOT NULL DEFAULT '0.00',
493 493
 					  PRC_name varchar(245) NOT NULL,
@@ -500,9 +500,9 @@  discard block
 block discarded – undo
500 500
 					  PRC_parent int(10) unsigned DEFAULT 0,
501 501
 					  PRIMARY KEY  (PRC_ID),
502 502
 					  KEY PRT_ID (PRT_ID)";
503
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
504
-        $table_name = "esp_price_type";
505
-        $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
503
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
504
+		$table_name = "esp_price_type";
505
+		$sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
506 506
 				  PRT_name varchar(45) NOT NULL,
507 507
 				  PBT_ID tinyint(3) unsigned NOT NULL DEFAULT '1',
508 508
 				  PRT_is_percent tinyint(1) NOT NULL DEFAULT '0',
@@ -511,9 +511,9 @@  discard block
 block discarded – undo
511 511
 				  PRT_deleted tinyint(1) NOT NULL DEFAULT '0',
512 512
 				  UNIQUE KEY PRT_name_UNIQUE (PRT_name),
513 513
 				  PRIMARY KEY  (PRT_ID)";
514
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
515
-        $table_name = "esp_ticket";
516
-        $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
514
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
515
+		$table_name = "esp_ticket";
516
+		$sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
517 517
 					  TTM_ID int(10) unsigned NOT NULL,
518 518
 					  TKT_name varchar(245) NOT NULL DEFAULT '',
519 519
 					  TKT_description text NOT NULL,
@@ -535,9 +535,9 @@  discard block
 block discarded – undo
535 535
 					  TKT_deleted tinyint(1) NOT NULL DEFAULT '0',
536 536
 					  PRIMARY KEY  (TKT_ID),
537 537
 					  KEY TKT_start_date (TKT_start_date)";
538
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
539
-        $table_name = 'esp_question_group';
540
-        $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
538
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
539
+		$table_name = 'esp_question_group';
540
+		$sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
541 541
 					QSG_name varchar(255) NOT NULL,
542 542
 					QSG_identifier varchar(100) NOT NULL,
543 543
 					QSG_desc text NULL,
@@ -550,223 +550,223 @@  discard block
 block discarded – undo
550 550
 					PRIMARY KEY  (QSG_ID),
551 551
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier),
552 552
 					KEY QSG_order (QSG_order)';
553
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
554
-        /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */
555
-        $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
556
-        // (because many need to convert old string states to foreign keys into the states table)
557
-        $script_4_1_defaults->insert_default_states();
558
-        $script_4_1_defaults->insert_default_countries();
559
-        /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */
560
-        $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0');
561
-        $script_4_5_defaults->insert_default_price_types();
562
-        $script_4_5_defaults->insert_default_prices();
563
-        $script_4_5_defaults->insert_default_tickets();
564
-        /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */
565
-        $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0');
566
-        $script_4_6_defaults->add_default_admin_only_payments();
567
-        $script_4_6_defaults->insert_default_currencies();
568
-        $this->verify_new_countries();
569
-        $this->verify_new_currencies();
570
-        return true;
571
-    }
553
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
554
+		/** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */
555
+		$script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
556
+		// (because many need to convert old string states to foreign keys into the states table)
557
+		$script_4_1_defaults->insert_default_states();
558
+		$script_4_1_defaults->insert_default_countries();
559
+		/** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */
560
+		$script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0');
561
+		$script_4_5_defaults->insert_default_price_types();
562
+		$script_4_5_defaults->insert_default_prices();
563
+		$script_4_5_defaults->insert_default_tickets();
564
+		/** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */
565
+		$script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0');
566
+		$script_4_6_defaults->add_default_admin_only_payments();
567
+		$script_4_6_defaults->insert_default_currencies();
568
+		$this->verify_new_countries();
569
+		$this->verify_new_currencies();
570
+		return true;
571
+	}
572 572
 
573 573
 
574 574
 
575
-    /**
576
-     * @return boolean
577
-     */
578
-    public function schema_changes_after_migration()
579
-    {
580
-        $this->fix_non_default_taxes();
581
-        // this is actually the same as the last DMS
582
-        /** @var EE_DMS_Core_4_7_0 $script_4_7_defaults */
583
-        $script_4_7_defaults = EE_Registry::instance()->load_dms('Core_4_7_0');
584
-        return $script_4_7_defaults->schema_changes_after_migration();
585
-    }
575
+	/**
576
+	 * @return boolean
577
+	 */
578
+	public function schema_changes_after_migration()
579
+	{
580
+		$this->fix_non_default_taxes();
581
+		// this is actually the same as the last DMS
582
+		/** @var EE_DMS_Core_4_7_0 $script_4_7_defaults */
583
+		$script_4_7_defaults = EE_Registry::instance()->load_dms('Core_4_7_0');
584
+		return $script_4_7_defaults->schema_changes_after_migration();
585
+	}
586 586
 
587 587
 
588 588
 
589
-    public function migration_page_hooks()
590
-    {
591
-    }
589
+	public function migration_page_hooks()
590
+	{
591
+	}
592 592
 
593 593
 
594 594
 
595
-    /**
596
-     * verifies each of the new countries exists that somehow we missed in 4.1
597
-     */
598
-    public function verify_new_countries()
599
-    {
600
-        // a list of countries (and specifically some which were missed in another list):https://gist.github.com/adhipg/1600028
601
-        // how many decimal places? https://en.wikipedia.org/wiki/ISO_4217
602
-        // currency symbols: http://www.xe.com/symbols.php
603
-        // CNT_ISO, CNT_ISO3, RGN_ID, CNT_name, CNT_cur_code, CNT_cur_single, CNT_cur_plural, CNT_cur_sign, CNT_cur_sign_b4, CNT_cur_dec_plc, CNT_tel_code, CNT_is_EU, CNT_active
604
-        // ('AD', 'AND', 0, 'Andorra', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+376', 0, 0),
605
-        $newer_countries = array(
606
-            array('AX', 'ALA', 0, 'Åland Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0),
607
-            array('BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0),
608
-            array('CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0),
609
-            array('GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0),
610
-            array('IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0),
611
-            array('JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0),
612
-            array('MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0),
613
-            array('ME', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+382', 0, 0),
614
-            array('RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+381', 1, 0),
615
-            array('SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0),
616
-            array('SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0),
617
-            array('XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+383', 0, 0),
618
-            array('YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0),
619
-            array(
620
-                'BQ',
621
-                'BES',
622
-                0,
623
-                'Bonaire, Saint Eustatius and Saba',
624
-                'USD',
625
-                'Dollar',
626
-                'Dollars',
627
-                '$',
628
-                1,
629
-                2,
630
-                '+599',
631
-                0,
632
-                0,
633
-            ),
634
-            array('BV', 'BVT', 0, 'Bouvet Island', 'NOK', 'Krone', 'Krones', 'kr', 1, 2, '+47', 0, 0),
635
-            array('IO', 'IOT', 0, 'British Indian Ocean Territory', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+246', 0, 0),
636
-            array('CX', 'CXR', 0, 'Christmas Island', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+61', 0, 0),
637
-            array('CC', 'CCK', 0, 'Cocos (Keeling) Islands', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+891', 0, 0),
638
-            array(
639
-                'HM',
640
-                'HMD',
641
-                0,
642
-                'Heard Island and McDonald Islands',
643
-                'AUD',
644
-                'Dollar',
645
-                'Dollars',
646
-                '$',
647
-                1,
648
-                2,
649
-                '+891',
650
-                0,
651
-                0,
652
-            ),
653
-            array('PS', 'PSE', 0, 'Palestinian Territory', 'ILS', 'Shekel', 'Shekels', '₪', 1, 2, '+970', 0, 0),
654
-            array(
655
-                'GS',
656
-                'SGS',
657
-                0,
658
-                'South Georgia and the South Sandwich Islands',
659
-                'GBP',
660
-                'Pound',
661
-                'Pounds',
662
-                '£',
663
-                1,
664
-                2,
665
-                '+500',
666
-                0,
667
-                0,
668
-            ),
669
-            array('TL', 'TLS', 0, 'Timor-Leste', 'USD', 'Dollar', 'Dollars', '$', 1, 2, '+670', 0, 0),
670
-            array('TF', 'ATF', 0, 'French Southern Territories', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+262', 0, 0),
671
-            array(
672
-                'UM',
673
-                'UMI',
674
-                0,
675
-                'United States Minor Outlying Islands',
676
-                'USD',
677
-                'Dollar',
678
-                'Dollars',
679
-                '$',
680
-                1,
681
-                2,
682
-                '+1',
683
-                0,
684
-                0,
685
-            ),
686
-        );
687
-        global $wpdb;
688
-        $country_table = $wpdb->prefix . "esp_country";
689
-        $country_format = array(
690
-            "CNT_ISO"         => '%s',
691
-            "CNT_ISO3"        => '%s',
692
-            "RGN_ID"          => '%d',
693
-            "CNT_name"        => '%s',
694
-            "CNT_cur_code"    => '%s',
695
-            "CNT_cur_single"  => '%s',
696
-            "CNT_cur_plural"  => '%s',
697
-            "CNT_cur_sign"    => '%s',
698
-            "CNT_cur_sign_b4" => '%d',
699
-            "CNT_cur_dec_plc" => '%d',
700
-            "CNT_tel_code"    => '%s',
701
-            "CNT_is_EU"       => '%d',
702
-            "CNT_active"      => '%d',
703
-        );
704
-        if ($this->_get_table_analysis()->tableExists($country_table)) {
705
-            foreach ($newer_countries as $country) {
706
-                $SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1";
707
-                $countries = $wpdb->get_var($SQL);
708
-                if (! $countries) {
709
-                    $wpdb->insert(
710
-                        $country_table,
711
-                        array_combine(array_keys($country_format), $country),
712
-                        $country_format
713
-                    );
714
-                }
715
-            }
716
-        }
717
-    }
595
+	/**
596
+	 * verifies each of the new countries exists that somehow we missed in 4.1
597
+	 */
598
+	public function verify_new_countries()
599
+	{
600
+		// a list of countries (and specifically some which were missed in another list):https://gist.github.com/adhipg/1600028
601
+		// how many decimal places? https://en.wikipedia.org/wiki/ISO_4217
602
+		// currency symbols: http://www.xe.com/symbols.php
603
+		// CNT_ISO, CNT_ISO3, RGN_ID, CNT_name, CNT_cur_code, CNT_cur_single, CNT_cur_plural, CNT_cur_sign, CNT_cur_sign_b4, CNT_cur_dec_plc, CNT_tel_code, CNT_is_EU, CNT_active
604
+		// ('AD', 'AND', 0, 'Andorra', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+376', 0, 0),
605
+		$newer_countries = array(
606
+			array('AX', 'ALA', 0, 'Åland Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0),
607
+			array('BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0),
608
+			array('CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0),
609
+			array('GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0),
610
+			array('IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0),
611
+			array('JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0),
612
+			array('MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0),
613
+			array('ME', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+382', 0, 0),
614
+			array('RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+381', 1, 0),
615
+			array('SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0),
616
+			array('SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0),
617
+			array('XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+383', 0, 0),
618
+			array('YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0),
619
+			array(
620
+				'BQ',
621
+				'BES',
622
+				0,
623
+				'Bonaire, Saint Eustatius and Saba',
624
+				'USD',
625
+				'Dollar',
626
+				'Dollars',
627
+				'$',
628
+				1,
629
+				2,
630
+				'+599',
631
+				0,
632
+				0,
633
+			),
634
+			array('BV', 'BVT', 0, 'Bouvet Island', 'NOK', 'Krone', 'Krones', 'kr', 1, 2, '+47', 0, 0),
635
+			array('IO', 'IOT', 0, 'British Indian Ocean Territory', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+246', 0, 0),
636
+			array('CX', 'CXR', 0, 'Christmas Island', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+61', 0, 0),
637
+			array('CC', 'CCK', 0, 'Cocos (Keeling) Islands', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+891', 0, 0),
638
+			array(
639
+				'HM',
640
+				'HMD',
641
+				0,
642
+				'Heard Island and McDonald Islands',
643
+				'AUD',
644
+				'Dollar',
645
+				'Dollars',
646
+				'$',
647
+				1,
648
+				2,
649
+				'+891',
650
+				0,
651
+				0,
652
+			),
653
+			array('PS', 'PSE', 0, 'Palestinian Territory', 'ILS', 'Shekel', 'Shekels', '₪', 1, 2, '+970', 0, 0),
654
+			array(
655
+				'GS',
656
+				'SGS',
657
+				0,
658
+				'South Georgia and the South Sandwich Islands',
659
+				'GBP',
660
+				'Pound',
661
+				'Pounds',
662
+				'£',
663
+				1,
664
+				2,
665
+				'+500',
666
+				0,
667
+				0,
668
+			),
669
+			array('TL', 'TLS', 0, 'Timor-Leste', 'USD', 'Dollar', 'Dollars', '$', 1, 2, '+670', 0, 0),
670
+			array('TF', 'ATF', 0, 'French Southern Territories', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+262', 0, 0),
671
+			array(
672
+				'UM',
673
+				'UMI',
674
+				0,
675
+				'United States Minor Outlying Islands',
676
+				'USD',
677
+				'Dollar',
678
+				'Dollars',
679
+				'$',
680
+				1,
681
+				2,
682
+				'+1',
683
+				0,
684
+				0,
685
+			),
686
+		);
687
+		global $wpdb;
688
+		$country_table = $wpdb->prefix . "esp_country";
689
+		$country_format = array(
690
+			"CNT_ISO"         => '%s',
691
+			"CNT_ISO3"        => '%s',
692
+			"RGN_ID"          => '%d',
693
+			"CNT_name"        => '%s',
694
+			"CNT_cur_code"    => '%s',
695
+			"CNT_cur_single"  => '%s',
696
+			"CNT_cur_plural"  => '%s',
697
+			"CNT_cur_sign"    => '%s',
698
+			"CNT_cur_sign_b4" => '%d',
699
+			"CNT_cur_dec_plc" => '%d',
700
+			"CNT_tel_code"    => '%s',
701
+			"CNT_is_EU"       => '%d',
702
+			"CNT_active"      => '%d',
703
+		);
704
+		if ($this->_get_table_analysis()->tableExists($country_table)) {
705
+			foreach ($newer_countries as $country) {
706
+				$SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1";
707
+				$countries = $wpdb->get_var($SQL);
708
+				if (! $countries) {
709
+					$wpdb->insert(
710
+						$country_table,
711
+						array_combine(array_keys($country_format), $country),
712
+						$country_format
713
+					);
714
+				}
715
+			}
716
+		}
717
+	}
718 718
 
719 719
 
720 720
 
721
-    /**
722
-     * verifies each of the new currencies exists that somehow we missed in 4.6
723
-     */
724
-    public function verify_new_currencies()
725
-    {
726
-        // a list of countries (and specifically some which were missed in another list):https://gist.github.com/adhipg/1600028
727
-        // how many decimal places? https://en.wikipedia.org/wiki/ISO_4217
728
-        // currency symbols: http://www.xe.com/symbols.php
729
-        // CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active
730
-        // ( 'EUR',  'Euro',  'Euros',  '€',  2,1),
731
-        $newer_currencies = array(
732
-            array('RSD', 'Dinar', 'Dinars', '', 3, 1),
733
-        );
734
-        global $wpdb;
735
-        $currency_table = $wpdb->prefix . "esp_currency";
736
-        $currency_format = array(
737
-            "CUR_code"    => '%s',
738
-            "CUR_single"  => '%s',
739
-            "CUR_plural"  => '%s',
740
-            "CUR_sign"    => '%s',
741
-            "CUR_dec_plc" => '%d',
742
-            "CUR_active"  => '%d',
743
-        );
744
-        if ($this->_get_table_analysis()->tableExists($currency_table)) {
745
-            foreach ($newer_currencies as $currency) {
746
-                $SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1";
747
-                $countries = $wpdb->get_var($SQL);
748
-                if (! $countries) {
749
-                    $wpdb->insert(
750
-                        $currency_table,
751
-                        array_combine(array_keys($currency_format), $currency),
752
-                        $currency_format
753
-                    );
754
-                }
755
-            }
756
-        }
757
-    }
721
+	/**
722
+	 * verifies each of the new currencies exists that somehow we missed in 4.6
723
+	 */
724
+	public function verify_new_currencies()
725
+	{
726
+		// a list of countries (and specifically some which were missed in another list):https://gist.github.com/adhipg/1600028
727
+		// how many decimal places? https://en.wikipedia.org/wiki/ISO_4217
728
+		// currency symbols: http://www.xe.com/symbols.php
729
+		// CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active
730
+		// ( 'EUR',  'Euro',  'Euros',  '€',  2,1),
731
+		$newer_currencies = array(
732
+			array('RSD', 'Dinar', 'Dinars', '', 3, 1),
733
+		);
734
+		global $wpdb;
735
+		$currency_table = $wpdb->prefix . "esp_currency";
736
+		$currency_format = array(
737
+			"CUR_code"    => '%s',
738
+			"CUR_single"  => '%s',
739
+			"CUR_plural"  => '%s',
740
+			"CUR_sign"    => '%s',
741
+			"CUR_dec_plc" => '%d',
742
+			"CUR_active"  => '%d',
743
+		);
744
+		if ($this->_get_table_analysis()->tableExists($currency_table)) {
745
+			foreach ($newer_currencies as $currency) {
746
+				$SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1";
747
+				$countries = $wpdb->get_var($SQL);
748
+				if (! $countries) {
749
+					$wpdb->insert(
750
+						$currency_table,
751
+						array_combine(array_keys($currency_format), $currency),
752
+						$currency_format
753
+					);
754
+				}
755
+			}
756
+		}
757
+	}
758 758
 
759 759
 
760 760
 
761
-    /**
762
-     * addresses https://events.codebasehq.com/projects/event-espresso/tickets/8731
763
-     * which should just be a temporary issue for folks who installed 4.8.0-4.8.5;
764
-     * we should be able to stop doing this in 4.9
765
-     */
766
-    public function fix_non_default_taxes()
767
-    {
768
-        global $wpdb;
769
-        $query = $wpdb->prepare("UPDATE
761
+	/**
762
+	 * addresses https://events.codebasehq.com/projects/event-espresso/tickets/8731
763
+	 * which should just be a temporary issue for folks who installed 4.8.0-4.8.5;
764
+	 * we should be able to stop doing this in 4.9
765
+	 */
766
+	public function fix_non_default_taxes()
767
+	{
768
+		global $wpdb;
769
+		$query = $wpdb->prepare("UPDATE
770 770
 				{$wpdb->prefix}esp_price p INNER JOIN
771 771
 				{$wpdb->prefix}esp_price_type pt ON p.PRT_ID = pt.PRT_ID
772 772
 			SET
@@ -775,6 +775,6 @@  discard block
 block discarded – undo
775 775
 				p.PRC_is_default = 0 AND
776 776
 				pt.PBT_ID = %d
777 777
 					", EEM_Price_Type::base_type_tax);
778
-        $wpdb->query($query);
779
-    }
778
+		$wpdb->query($query);
779
+	}
780 780
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,12 +14,12 @@  discard block
 block discarded – undo
14 14
 // unfortunately, this needs to be done upon INCLUSION of this file,
15 15
 // instead of construction, because it only gets constructed on first page load
16 16
 // (all other times it gets resurrected from a wordpress option)
17
-$stages = glob(EE_CORE . 'data_migration_scripts/4_8_0_stages/*');
17
+$stages = glob(EE_CORE.'data_migration_scripts/4_8_0_stages/*');
18 18
 $class_to_filepath = array();
19 19
 foreach ($stages as $filepath) {
20 20
     $matches = array();
21 21
     preg_match('~4_8_0_stages/(.*).dmsstage.php~', $filepath, $matches);
22
-    $class_to_filepath[ $matches[1] ] = $filepath;
22
+    $class_to_filepath[$matches[1]] = $filepath;
23 23
 }
24 24
 // give addons a chance to autoload their stages too
25 25
 $class_to_filepath = apply_filters('FHEE__EE_DMS_4_8_0__autoloaded_stages', $class_to_filepath);
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
         if (version_compare($version_string, '4.8.0.decaf', '<') && version_compare($version_string, '4.7.0.decaf', '>=')) {
73 73
 //          echo "$version_string can be migrated from";
74 74
             return true;
75
-        } elseif (! $version_string) {
75
+        } elseif ( ! $version_string) {
76 76
 //          echo "no version string provided: $version_string";
77 77
             // no version string provided... this must be pre 4.3
78
-            return false;// changed mind. dont want people thinking they should migrate yet because they cant
78
+            return false; // changed mind. dont want people thinking they should migrate yet because they cant
79 79
         } else {
80 80
 //          echo "$version_string doesnt apply";
81 81
             return false;
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
      */
90 90
     public function schema_changes_before_migration()
91 91
     {
92
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
92
+        require_once(EE_HELPERS.'EEH_Activation.helper.php');
93 93
         $now_in_mysql = current_time('mysql', true);
94
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
94
+        require_once(EE_HELPERS.'EEH_Activation.helper.php');
95 95
         $table_name = 'esp_answer';
96 96
         $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
97 97
 					REG_ID int(10) unsigned NOT NULL,
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
             ),
686 686
         );
687 687
         global $wpdb;
688
-        $country_table = $wpdb->prefix . "esp_country";
688
+        $country_table = $wpdb->prefix."esp_country";
689 689
         $country_format = array(
690 690
             "CNT_ISO"         => '%s',
691 691
             "CNT_ISO3"        => '%s',
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
             foreach ($newer_countries as $country) {
706 706
                 $SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1";
707 707
                 $countries = $wpdb->get_var($SQL);
708
-                if (! $countries) {
708
+                if ( ! $countries) {
709 709
                     $wpdb->insert(
710 710
                         $country_table,
711 711
                         array_combine(array_keys($country_format), $country),
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
             array('RSD', 'Dinar', 'Dinars', '', 3, 1),
733 733
         );
734 734
         global $wpdb;
735
-        $currency_table = $wpdb->prefix . "esp_currency";
735
+        $currency_table = $wpdb->prefix."esp_currency";
736 736
         $currency_format = array(
737 737
             "CUR_code"    => '%s',
738 738
             "CUR_single"  => '%s',
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
             foreach ($newer_currencies as $currency) {
746 746
                 $SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1";
747 747
                 $countries = $wpdb->get_var($SQL);
748
-                if (! $countries) {
748
+                if ( ! $countries) {
749 749
                     $wpdb->insert(
750 750
                         $currency_table,
751 751
                         array_combine(array_keys($currency_format), $currency),
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_3_0.dms.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@  discard block
 block discarded – undo
11 11
 // unfortunately, this needs to be done upon INCLUSION of this file,
12 12
 // instead of construction, because it only gets constructed on first page load
13 13
 // (all other times it gets resurrected from a wordpress option)
14
-$stages = glob(EE_CORE . 'data_migration_scripts/4_3_0_stages/*');
14
+$stages = glob(EE_CORE.'data_migration_scripts/4_3_0_stages/*');
15 15
 $class_to_filepath = array();
16
-if (! empty($stages)) {
16
+if ( ! empty($stages)) {
17 17
     foreach ($stages as $filepath) {
18 18
         $matches = array();
19 19
         preg_match('~4_3_0_stages/(.*).dmsstage.php~', $filepath, $matches);
20
-        $class_to_filepath[ $matches[1] ] = $filepath;
20
+        $class_to_filepath[$matches[1]] = $filepath;
21 21
     }
22 22
 }
23 23
 // give addons a chance to autoload their stages too
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
         if (version_compare($version_string, '4.3.0.decaf', '<') && version_compare($version_string, '4.2.0.decaf', '>=')) {
57 57
 //          echo "$version_string can be migrated fro";
58 58
             return true;
59
-        } elseif (! $version_string) {
59
+        } elseif ( ! $version_string) {
60 60
 //          echo "no version string provided: $version_string";
61 61
             // no version string provided... this must be pre 4.2
62
-            return false;// changed mind. dont want people thinking they should migrate yet because they cant
62
+            return false; // changed mind. dont want people thinking they should migrate yet because they cant
63 63
         } else {
64 64
 //          echo "$version_string doesnt apply";
65 65
             return false;
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     public function schema_changes_before_migration()
72 72
     {
73 73
         // relies on 4.1's EEH_Activation::create_table
74
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
74
+        require_once(EE_HELPERS.'EEH_Activation.helper.php');
75 75
         $table_name = 'esp_answer';
76 76
         $sql = "ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
77 77
 					REG_ID int(10) unsigned NOT NULL,
@@ -474,11 +474,11 @@  discard block
 block discarded – undo
474 474
     public function insert_default_tickets()
475 475
     {
476 476
         global $wpdb;
477
-        $ticket_table = $wpdb->prefix . "esp_ticket";
477
+        $ticket_table = $wpdb->prefix."esp_ticket";
478 478
         if ($this->_get_table_analysis()->tableExists($ticket_table)) {
479
-            $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table;
479
+            $SQL = 'SELECT COUNT(TKT_ID) FROM '.$ticket_table;
480 480
             $tickets_exist = $wpdb->get_var($SQL);
481
-            if (! $tickets_exist) {
481
+            if ( ! $tickets_exist) {
482 482
                 $SQL = "INSERT INTO $ticket_table
483 483
 					( TKT_ID, TTM_ID, TKT_name, TKT_description, TKT_qty, TKT_sold, TKT_uses, TKT_required, TKT_min, TKT_max, TKT_price, TKT_start_date, TKT_end_date, TKT_taxable, TKT_order, TKT_row, TKT_is_default, TKT_parent, TKT_deleted ) VALUES
484 484
 					( 1, 0, '"
@@ -488,11 +488,11 @@  discard block
 block discarded – undo
488 488
                 $wpdb->query($SQL);
489 489
             }
490 490
         }
491
-        $ticket_price_table = $wpdb->prefix . "esp_ticket_price";
491
+        $ticket_price_table = $wpdb->prefix."esp_ticket_price";
492 492
         if ($this->_get_table_analysis()->tableExists($ticket_price_table)) {
493
-            $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table;
493
+            $SQL = 'SELECT COUNT(TKP_ID) FROM '.$ticket_price_table;
494 494
             $ticket_prc_exist = $wpdb->get_var($SQL);
495
-            if (! $ticket_prc_exist) {
495
+            if ( ! $ticket_prc_exist) {
496 496
                 $SQL = "INSERT INTO $ticket_price_table
497 497
 				( TKP_ID, TKT_ID, PRC_ID ) VALUES
498 498
 				( 1, 1, 1 )
Please login to merge, or discard this patch.
Indentation   +184 added lines, -184 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
 $stages = glob(EE_CORE . 'data_migration_scripts/4_3_0_stages/*');
17 17
 $class_to_filepath = array();
18 18
 if (! empty($stages)) {
19
-    foreach ($stages as $filepath) {
20
-        $matches = array();
21
-        preg_match('~4_3_0_stages/(.*).dmsstage.php~', $filepath, $matches);
22
-        $class_to_filepath[ $matches[1] ] = $filepath;
23
-    }
19
+	foreach ($stages as $filepath) {
20
+		$matches = array();
21
+		preg_match('~4_3_0_stages/(.*).dmsstage.php~', $filepath, $matches);
22
+		$class_to_filepath[ $matches[1] ] = $filepath;
23
+	}
24 24
 }
25 25
 // give addons a chance to autoload their stages too
26 26
 $class_to_filepath = apply_filters('FHEE__EE_DMS_4_3_0__autoloaded_stages', $class_to_filepath);
@@ -33,56 +33,56 @@  discard block
 block discarded – undo
33 33
 
34 34
 
35 35
 
36
-    /**
37
-     * EE_DMS_Core_4_3_0 constructor.
38
-     *
39
-     * @param TableManager  $table_manager
40
-     * @param TableAnalysis $table_analysis
41
-     */
42
-    public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null)
43
-    {
44
-        $this->_pretty_name = esc_html__("Data Update to Event Espresso 4.3.0", "event_espresso");
45
-        $this->_priority = 10;
46
-        $this->_migration_stages = array(
47
-            new EE_DMS_4_3_0_question_option_order(),
48
-            new EE_DMS_4_3_0_event_message_templates(),
49
-        );
50
-        parent::__construct($table_manager, $table_analysis);
51
-    }
36
+	/**
37
+	 * EE_DMS_Core_4_3_0 constructor.
38
+	 *
39
+	 * @param TableManager  $table_manager
40
+	 * @param TableAnalysis $table_analysis
41
+	 */
42
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null)
43
+	{
44
+		$this->_pretty_name = esc_html__("Data Update to Event Espresso 4.3.0", "event_espresso");
45
+		$this->_priority = 10;
46
+		$this->_migration_stages = array(
47
+			new EE_DMS_4_3_0_question_option_order(),
48
+			new EE_DMS_4_3_0_event_message_templates(),
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.3.0.decaf', '<') && version_compare($version_string, '4.2.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.3.0.decaf', '<') && version_compare($version_string, '4.2.0.decaf', '>=')) {
59 59
 //          echo "$version_string can be migrated fro";
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.2
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.2
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_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
226
-        $table_name = 'esp_payment';
227
-        $sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
225
+		$this->_table_is_new_in_this_version($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,9 +240,9 @@  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";
245
-        $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
243
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
244
+		$table_name = "esp_ticket";
245
+		$sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
246 246
 					  TTM_ID int(10) unsigned NOT NULL,
247 247
 					  TKT_name varchar(245) NOT NULL DEFAULT '',
248 248
 					  TKT_description text NOT NULL,
@@ -262,28 +262,28 @@  discard block
 block discarded – undo
262 262
 					  TKT_parent int(10) unsigned DEFAULT '0',
263 263
 					  TKT_deleted tinyint(1) NOT NULL DEFAULT '0',
264 264
 					  PRIMARY KEY  (TKT_ID)";
265
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
266
-        $table_name = "esp_ticket_price";
267
-        $sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
265
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
266
+		$table_name = "esp_ticket_price";
267
+		$sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
268 268
 					  TKT_ID int(10) unsigned NOT NULL,
269 269
 					  PRC_ID int(10) unsigned NOT NULL,
270 270
 					  PRIMARY KEY  (TKP_ID)";
271
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
272
-        $table_name = "esp_datetime_ticket";
273
-        $sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
271
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
272
+		$table_name = "esp_datetime_ticket";
273
+		$sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
274 274
 					  DTT_ID int(10) unsigned NOT NULL,
275 275
 					  TKT_ID int(10) unsigned NOT NULL,
276 276
 					  PRIMARY KEY  (DTK_ID)";
277
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
278
-        $table_name = "esp_ticket_template";
279
-        $sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
277
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
278
+		$table_name = "esp_ticket_template";
279
+		$sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
280 280
 					  TTM_name varchar(45) NOT NULL,
281 281
 					  TTM_description text,
282 282
 					  TTM_file varchar(45),
283 283
 					  PRIMARY KEY  (TTM_ID)";
284
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
285
-        $table_name = "esp_price";
286
-        $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
284
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
285
+		$table_name = "esp_price";
286
+		$sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
287 287
 					  PRT_ID tinyint(3) unsigned NOT NULL,
288 288
 					  PRC_amount decimal(10,3) NOT NULL DEFAULT '0.00',
289 289
 					  PRC_name varchar(245) NOT NULL,
@@ -294,9 +294,9 @@  discard block
 block discarded – undo
294 294
 					  PRC_order tinyint(3) unsigned NOT NULL DEFAULT '0',
295 295
 					  PRC_parent int(10) unsigned DEFAULT 0,
296 296
 					  PRIMARY KEY  (PRC_ID)";
297
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
298
-        $table_name = "esp_price_type";
299
-        $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
297
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
298
+		$table_name = "esp_price_type";
299
+		$sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
300 300
 				  PRT_name varchar(45) NOT NULL,
301 301
 				  PBT_ID tinyint(3) unsigned NOT NULL DEFAULT '1',
302 302
 				  PRT_is_percent tinyint(1) NOT NULL DEFAULT '0',
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
 				  PRT_deleted tinyint(1) NOT NULL DEFAULT '0',
305 305
 				  UNIQUE KEY PRT_name_UNIQUE (PRT_name),
306 306
 				  PRIMARY KEY  (PRT_ID)";
307
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
308
-        $table_name = 'esp_question';
309
-        $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
307
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
308
+		$table_name = 'esp_question';
309
+		$sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
310 310
 					QST_display_text text NOT NULL,
311 311
 					QST_admin_label varchar(255) NOT NULL,
312 312
 					QST_system varchar(25) DEFAULT NULL,
@@ -318,10 +318,10 @@  discard block
 block discarded – undo
318 318
 					QST_wp_user bigint(20) unsigned NULL,
319 319
 					QST_deleted tinyint(1) unsigned NOT NULL DEFAULT 0,
320 320
 					PRIMARY KEY  (QST_ID)';
321
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
322
-        $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE');
323
-        $table_name = 'esp_question_group';
324
-        $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
321
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
322
+		$this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE');
323
+		$table_name = 'esp_question_group';
324
+		$sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
325 325
 					QSG_name varchar(255) NOT NULL,
326 326
 					QSG_identifier varchar(100) NOT NULL,
327 327
 					QSG_desc text NULL,
@@ -332,25 +332,25 @@  discard block
 block discarded – undo
332 332
 					QSG_deleted tinyint(1) unsigned NOT NULL DEFAULT 0,
333 333
 					PRIMARY KEY  (QSG_ID),
334 334
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)';
335
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
336
-        $table_name = 'esp_question_group_question';
337
-        $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
335
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
336
+		$table_name = 'esp_question_group_question';
337
+		$sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
338 338
 					QSG_ID int(10) unsigned NOT NULL,
339 339
 					QST_ID int(10) unsigned NOT NULL,
340 340
 					QGQ_order int(10) unsigned NOT NULL DEFAULT 0,
341 341
 					PRIMARY KEY  (QGQ_ID) ";
342
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
343
-        $table_name = 'esp_question_option';
344
-        $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
342
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
343
+		$table_name = 'esp_question_option';
344
+		$sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
345 345
 					QSO_value varchar(255) NOT NULL,
346 346
 					QSO_desc text NOT NULL,
347 347
 					QST_ID int(10) unsigned NOT NULL,
348 348
 					QSO_order int(10) unsigned NOT NULL DEFAULT 0,
349 349
 					QSO_deleted tinyint(1) unsigned NOT NULL DEFAULT 0,
350 350
 					PRIMARY KEY  (QSO_ID)";
351
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
352
-        $table_name = 'esp_registration';
353
-        $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
351
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
352
+		$table_name = 'esp_registration';
353
+		$sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
354 354
 					  EVT_ID bigint(20) unsigned NOT NULL,
355 355
 					  ATT_ID bigint(20) unsigned NOT NULL,
356 356
 					  TXN_ID int(10) unsigned NOT NULL,
@@ -373,25 +373,25 @@  discard block
 block discarded – undo
373 373
 					  KEY STS_ID (STS_ID),
374 374
 					  KEY REG_url_link (REG_url_link),
375 375
 					  KEY REG_code (REG_code)";
376
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
377
-        $table_name = 'esp_checkin';
378
-        $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
376
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
377
+		$table_name = 'esp_checkin';
378
+		$sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
379 379
 					REG_ID int(10) unsigned NOT NULL,
380 380
 					DTT_ID int(10) unsigned NOT NULL,
381 381
 					CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1,
382 382
 					CHK_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
383 383
 					PRIMARY KEY  (CHK_ID)";
384
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
385
-        $table_name = 'esp_state';
386
-        $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
384
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
385
+		$table_name = 'esp_state';
386
+		$sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
387 387
 					  CNT_ISO varchar(2) COLLATE utf8_bin NOT NULL,
388 388
 					  STA_abbrev varchar(6) COLLATE utf8_bin NOT NULL,
389 389
 					  STA_name varchar(100) COLLATE utf8_bin NOT NULL,
390 390
 					  STA_active tinyint(1) DEFAULT '1',
391 391
 					  PRIMARY KEY  (STA_ID)";
392
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
393
-        $table_name = 'esp_status';
394
-        $sql = "STS_ID varchar(3) COLLATE utf8_bin NOT NULL,
392
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
393
+		$table_name = 'esp_status';
394
+		$sql = "STS_ID varchar(3) COLLATE utf8_bin NOT NULL,
395 395
 					  STS_code varchar(45) COLLATE utf8_bin NOT NULL,
396 396
 					  STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL,
397 397
 					  STS_can_edit tinyint(1) NOT NULL DEFAULT 0,
@@ -399,9 +399,9 @@  discard block
 block discarded – undo
399 399
 					  STS_open tinyint(1) NOT NULL DEFAULT 1,
400 400
 					  UNIQUE KEY STS_ID_UNIQUE (STS_ID),
401 401
 					  KEY STS_type (STS_type)";
402
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
403
-        $table_name = 'esp_transaction';
404
-        $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
402
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
403
+		$table_name = 'esp_transaction';
404
+		$sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
405 405
 					  TXN_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
406 406
 					  TXN_total decimal(10,3) DEFAULT '0.00',
407 407
 					  TXN_paid decimal(10,3) NOT NULL DEFAULT '0.00',
@@ -411,9 +411,9 @@  discard block
 block discarded – undo
411 411
 					  PRIMARY KEY  (TXN_ID),
412 412
 					  KEY TXN_timestamp (TXN_timestamp),
413 413
 					  KEY STS_ID (STS_ID)";
414
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
415
-        $table_name = 'esp_venue_meta';
416
-        $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
414
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
415
+		$table_name = 'esp_venue_meta';
416
+		$sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
417 417
 			VNU_ID bigint(20) unsigned NOT NULL DEFAULT 0,
418 418
 			VNU_address varchar(255) DEFAULT NULL,
419 419
 			VNU_address2 varchar(255) DEFAULT NULL,
@@ -431,77 +431,77 @@  discard block
 block discarded – undo
431 431
 			PRIMARY KEY  (VNUM_ID),
432 432
 			KEY STA_ID (STA_ID),
433 433
 			KEY CNT_ISO (CNT_ISO)";
434
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
435
-        $script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
436
-        // setting up the DEFAULT stats and countries is also essential for the data migrations to run
437
-        // (because many need to convert old string states to foreign keys into the states table)
438
-        $script_with_defaults->insert_default_states();
439
-        $script_with_defaults->insert_default_countries();
440
-        // setting up DEFAULT prices, price types, and tickets is also essential for the price migrations
441
-        $script_with_defaults->insert_default_price_types();
442
-        $script_with_defaults->insert_default_prices();
443
-        // but the schema on the tickets table has changed since 4.1, so use our DEFAULT ticket method instead of 4.1's
444
-        $this->insert_default_tickets();
445
-        // setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre
446
-        EE_Config::instance()->update_espresso_config(false, true);
447
-        return true;
448
-    }
434
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
435
+		$script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
436
+		// setting up the DEFAULT stats and countries is also essential for the data migrations to run
437
+		// (because many need to convert old string states to foreign keys into the states table)
438
+		$script_with_defaults->insert_default_states();
439
+		$script_with_defaults->insert_default_countries();
440
+		// setting up DEFAULT prices, price types, and tickets is also essential for the price migrations
441
+		$script_with_defaults->insert_default_price_types();
442
+		$script_with_defaults->insert_default_prices();
443
+		// but the schema on the tickets table has changed since 4.1, so use our DEFAULT ticket method instead of 4.1's
444
+		$this->insert_default_tickets();
445
+		// setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre
446
+		EE_Config::instance()->update_espresso_config(false, true);
447
+		return true;
448
+	}
449 449
 
450 450
 
451 451
 
452
-    /**
453
-     * @return boolean
454
-     */
455
-    public function schema_changes_after_migration()
456
-    {
457
-        return true;
458
-    }
452
+	/**
453
+	 * @return boolean
454
+	 */
455
+	public function schema_changes_after_migration()
456
+	{
457
+		return true;
458
+	}
459 459
 
460 460
 
461 461
 
462
-    public function migration_page_hooks()
463
-    {
464
-    }
462
+	public function migration_page_hooks()
463
+	{
464
+	}
465 465
 
466 466
 
467 467
 
468
-    /**
469
-     * insert DEFAULT ticket
470
-     * Almost identical to EE_DMS_Core_4_1_0::insert_default_tickets, except is aware of the TKT_required field
471
-     *
472
-     * @access public
473
-     * @static
474
-     * @return void
475
-     */
476
-    public function insert_default_tickets()
477
-    {
478
-        global $wpdb;
479
-        $ticket_table = $wpdb->prefix . "esp_ticket";
480
-        if ($this->_get_table_analysis()->tableExists($ticket_table)) {
481
-            $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table;
482
-            $tickets_exist = $wpdb->get_var($SQL);
483
-            if (! $tickets_exist) {
484
-                $SQL = "INSERT INTO $ticket_table
468
+	/**
469
+	 * insert DEFAULT ticket
470
+	 * Almost identical to EE_DMS_Core_4_1_0::insert_default_tickets, except is aware of the TKT_required field
471
+	 *
472
+	 * @access public
473
+	 * @static
474
+	 * @return void
475
+	 */
476
+	public function insert_default_tickets()
477
+	{
478
+		global $wpdb;
479
+		$ticket_table = $wpdb->prefix . "esp_ticket";
480
+		if ($this->_get_table_analysis()->tableExists($ticket_table)) {
481
+			$SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table;
482
+			$tickets_exist = $wpdb->get_var($SQL);
483
+			if (! $tickets_exist) {
484
+				$SQL = "INSERT INTO $ticket_table
485 485
 					( TKT_ID, TTM_ID, TKT_name, TKT_description, TKT_qty, TKT_sold, TKT_uses, TKT_required, TKT_min, TKT_max, TKT_price, TKT_start_date, TKT_end_date, TKT_taxable, TKT_order, TKT_row, TKT_is_default, TKT_parent, TKT_deleted ) VALUES
486 486
 					( 1, 0, '"
487
-                       . esc_html__("Free Ticket", "event_espresso")
488
-                       . "', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, 0);";
489
-                $SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL', $SQL);
490
-                $wpdb->query($SQL);
491
-            }
492
-        }
493
-        $ticket_price_table = $wpdb->prefix . "esp_ticket_price";
494
-        if ($this->_get_table_analysis()->tableExists($ticket_price_table)) {
495
-            $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table;
496
-            $ticket_prc_exist = $wpdb->get_var($SQL);
497
-            if (! $ticket_prc_exist) {
498
-                $SQL = "INSERT INTO $ticket_price_table
487
+					   . esc_html__("Free Ticket", "event_espresso")
488
+					   . "', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, 0);";
489
+				$SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL', $SQL);
490
+				$wpdb->query($SQL);
491
+			}
492
+		}
493
+		$ticket_price_table = $wpdb->prefix . "esp_ticket_price";
494
+		if ($this->_get_table_analysis()->tableExists($ticket_price_table)) {
495
+			$SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table;
496
+			$ticket_prc_exist = $wpdb->get_var($SQL);
497
+			if (! $ticket_prc_exist) {
498
+				$SQL = "INSERT INTO $ticket_price_table
499 499
 				( TKP_ID, TKT_ID, PRC_ID ) VALUES
500 500
 				( 1, 1, 1 )
501 501
 				";
502
-                $SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL__ticket_price', $SQL);
503
-                $wpdb->query($SQL);
504
-            }
505
-        }
506
-    }
502
+				$SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL__ticket_price', $SQL);
503
+				$wpdb->query($SQL);
504
+			}
505
+		}
506
+	}
507 507
 }
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_2_0.dms.php 2 patches
Indentation   +148 added lines, -148 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@  discard block
 block discarded – undo
15 15
 $stages = glob(EE_CORE . 'data_migration_scripts/4_2_0_stages/*');
16 16
 $class_to_filepath = array();
17 17
 if (! empty($stages)) {
18
-    foreach ($stages as $filepath) {
19
-        $matches = array();
20
-        preg_match('~4_2_0_stages/(.*).dmsstage.php~', $filepath, $matches);
21
-        $class_to_filepath[ $matches[1] ] = $filepath;
22
-    }
18
+	foreach ($stages as $filepath) {
19
+		$matches = array();
20
+		preg_match('~4_2_0_stages/(.*).dmsstage.php~', $filepath, $matches);
21
+		$class_to_filepath[ $matches[1] ] = $filepath;
22
+	}
23 23
 }
24 24
 // give addons a chance to autoload their stages too
25 25
 $class_to_filepath = apply_filters('FHEE__EE_DMS_4_2_0__autoloaded_stages', $class_to_filepath);
@@ -32,57 +32,57 @@  discard block
 block discarded – undo
32 32
 
33 33
 
34 34
 
35
-    /**
36
-     * EE_DMS_Core_4_2_0 constructor.
37
-     *
38
-     * @param TableManager  $table_manager
39
-     * @param TableAnalysis $table_analysis
40
-     */
41
-    public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null)
42
-    {
43
-        $this->_pretty_name = esc_html__("Data Update to Event Espresso 4.2.0", "event_espresso");
44
-        $this->_priority = 10;
45
-        $this->_migration_stages = array(
46
-            new EE_DMS_4_2_0_question_group_questions(),
47
-            new EE_DMS_4_2_0_datetime_fields(),
48
-        );
49
-        parent::__construct($table_manager, $table_analysis);
50
-    }
35
+	/**
36
+	 * EE_DMS_Core_4_2_0 constructor.
37
+	 *
38
+	 * @param TableManager  $table_manager
39
+	 * @param TableAnalysis $table_analysis
40
+	 */
41
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null)
42
+	{
43
+		$this->_pretty_name = esc_html__("Data Update to Event Espresso 4.2.0", "event_espresso");
44
+		$this->_priority = 10;
45
+		$this->_migration_stages = array(
46
+			new EE_DMS_4_2_0_question_group_questions(),
47
+			new EE_DMS_4_2_0_datetime_fields(),
48
+		);
49
+		parent::__construct($table_manager, $table_analysis);
50
+	}
51 51
 
52 52
 
53 53
 
54
-    public function can_migrate_from_version($version_array)
55
-    {
56
-        $version_string = $version_array['Core'];
57
-        if (version_compare($version_string, '4.2.0.decaf', '<') && version_compare($version_string, '4.1.0.decaf', '>=')) {
54
+	public function can_migrate_from_version($version_array)
55
+	{
56
+		$version_string = $version_array['Core'];
57
+		if (version_compare($version_string, '4.2.0.decaf', '<') && version_compare($version_string, '4.1.0.decaf', '>=')) {
58 58
 //          echo "$version_string can be migrated fro";
59
-            return true;
60
-        } elseif (! $version_string) {
59
+			return true;
60
+		} elseif (! $version_string) {
61 61
 //          echo "no version string provided: $version_string";
62
-            // no version string provided... this must be pre 4.1
63
-            // because since 4.1 we're
64
-            return false;// changed mind. dont want people thinking they should migrate yet because they cant
65
-        } else {
62
+			// no version string provided... this must be pre 4.1
63
+			// because since 4.1 we're
64
+			return false;// changed mind. dont want people thinking they should migrate yet because they cant
65
+		} else {
66 66
 //          echo "$version_string doesnt apply";
67
-            return false;
68
-        }
69
-    }
67
+			return false;
68
+		}
69
+	}
70 70
 
71 71
 
72 72
 
73
-    public function 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,18 +190,18 @@  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
-        $table_name = 'esp_message_template_group';
204
-        $sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
202
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
203
+		$table_name = 'esp_message_template_group';
204
+		$sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
205 205
 					EVT_ID bigint(20) unsigned DEFAULT NULL,
206 206
 					MTP_user_id int(10) NOT NULL DEFAULT '1',
207 207
 					MTP_messenger varchar(30) NOT NULL,
@@ -213,9 +213,9 @@  discard block
 block discarded – undo
213 213
 					PRIMARY KEY  (GRP_ID),
214 214
 					KEY EVT_ID (EVT_ID),
215 215
 					KEY MTP_user_id (MTP_user_id)";
216
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
217
-        $table_name = 'esp_payment';
218
-        $sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
216
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
217
+		$table_name = 'esp_payment';
218
+		$sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
219 219
 					TXN_ID int(10) unsigned DEFAULT NULL,
220 220
 					STS_ID varchar(3) COLLATE utf8_bin DEFAULT NULL,
221 221
 					PAY_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -231,9 +231,9 @@  discard block
 block discarded – undo
231 231
 					PRIMARY KEY  (PAY_ID),
232 232
 					KEY TXN_ID (TXN_ID),
233 233
 					KEY PAY_timestamp (PAY_timestamp)";
234
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
235
-        $table_name = "esp_ticket";
236
-        $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
234
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
235
+		$table_name = "esp_ticket";
236
+		$sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
237 237
 					  TTM_ID int(10) unsigned NOT NULL,
238 238
 					  TKT_name varchar(245) NOT NULL DEFAULT '',
239 239
 					  TKT_description text NOT NULL,
@@ -252,28 +252,28 @@  discard block
 block discarded – undo
252 252
 					  TKT_parent int(10) unsigned DEFAULT '0',
253 253
 					  TKT_deleted tinyint(1) NOT NULL DEFAULT '0',
254 254
 					  PRIMARY KEY  (TKT_ID)";
255
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
256
-        $table_name = "esp_ticket_price";
257
-        $sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
255
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
256
+		$table_name = "esp_ticket_price";
257
+		$sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
258 258
 					  TKT_ID int(10) unsigned NOT NULL,
259 259
 					  PRC_ID int(10) unsigned NOT NULL,
260 260
 					  PRIMARY KEY  (TKP_ID)";
261
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
262
-        $table_name = "esp_datetime_ticket";
263
-        $sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
261
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
262
+		$table_name = "esp_datetime_ticket";
263
+		$sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
264 264
 					  DTT_ID int(10) unsigned NOT NULL,
265 265
 					  TKT_ID int(10) unsigned NOT NULL,
266 266
 					  PRIMARY KEY  (DTK_ID)";
267
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
268
-        $table_name = "esp_ticket_template";
269
-        $sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
267
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
268
+		$table_name = "esp_ticket_template";
269
+		$sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
270 270
 					  TTM_name varchar(45) NOT NULL,
271 271
 					  TTM_description text,
272 272
 					  TTM_file varchar(45),
273 273
 					  PRIMARY KEY  (TTM_ID)";
274
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
275
-        $table_name = "esp_price";
276
-        $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
274
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
275
+		$table_name = "esp_price";
276
+		$sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
277 277
 					  PRT_ID tinyint(3) unsigned NOT NULL,
278 278
 					  PRC_amount decimal(10,3) NOT NULL DEFAULT '0.00',
279 279
 					  PRC_name varchar(245) NOT NULL,
@@ -284,9 +284,9 @@  discard block
 block discarded – undo
284 284
 					  PRC_order tinyint(3) unsigned NOT NULL DEFAULT '0',
285 285
 					  PRC_parent int(10) unsigned DEFAULT 0,
286 286
 					  PRIMARY KEY  (PRC_ID)";
287
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
288
-        $table_name = "esp_price_type";
289
-        $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
287
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
288
+		$table_name = "esp_price_type";
289
+		$sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
290 290
 				  PRT_name varchar(45) NOT NULL,
291 291
 				  PBT_ID tinyint(3) unsigned NOT NULL DEFAULT '1',
292 292
 				  PRT_is_percent tinyint(1) NOT NULL DEFAULT '0',
@@ -294,9 +294,9 @@  discard block
 block discarded – undo
294 294
 				  PRT_deleted tinyint(1) NOT NULL DEFAULT '0',
295 295
 				  UNIQUE KEY PRT_name_UNIQUE (PRT_name),
296 296
 				  PRIMARY KEY  (PRT_ID)";
297
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
298
-        $table_name = 'esp_question';
299
-        $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
297
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
298
+		$table_name = 'esp_question';
299
+		$sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
300 300
 					QST_display_text text NOT NULL,
301 301
 					QST_admin_label varchar(255) NOT NULL,
302 302
 					QST_system varchar(25) DEFAULT NULL,
@@ -308,10 +308,10 @@  discard block
 block discarded – undo
308 308
 					QST_wp_user bigint(20) unsigned NULL,
309 309
 					QST_deleted tinyint(1) unsigned NOT NULL DEFAULT 0,
310 310
 					PRIMARY KEY  (QST_ID)';
311
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
312
-        $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE');
313
-        $table_name = 'esp_question_group';
314
-        $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
311
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
312
+		$this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE');
313
+		$table_name = 'esp_question_group';
314
+		$sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
315 315
 					QSG_name varchar(255) NOT NULL,
316 316
 					QSG_identifier varchar(100) NOT NULL,
317 317
 					QSG_desc text NULL,
@@ -322,24 +322,24 @@  discard block
 block discarded – undo
322 322
 					QSG_deleted tinyint(1) unsigned NOT NULL DEFAULT 0,
323 323
 					PRIMARY KEY  (QSG_ID),
324 324
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)';
325
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
326
-        $table_name = 'esp_question_group_question';
327
-        $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
325
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
326
+		$table_name = 'esp_question_group_question';
327
+		$sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
328 328
 					QSG_ID int(10) unsigned NOT NULL,
329 329
 					QST_ID int(10) unsigned NOT NULL,
330 330
 					QGQ_order int(10) unsigned NOT NULL DEFAULT 0,
331 331
 					PRIMARY KEY  (QGQ_ID) ";
332
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
333
-        $table_name = 'esp_question_option';
334
-        $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
332
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
333
+		$table_name = 'esp_question_option';
334
+		$sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
335 335
 					QSO_value varchar(255) NOT NULL,
336 336
 					QSO_desc text NOT NULL,
337 337
 					QST_ID int(10) unsigned NOT NULL,
338 338
 					QSO_deleted tinyint(1) unsigned NOT NULL DEFAULT 0,
339 339
 					PRIMARY KEY  (QSO_ID)";
340
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
341
-        $table_name = 'esp_registration';
342
-        $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
340
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
341
+		$table_name = 'esp_registration';
342
+		$sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
343 343
 					  EVT_ID bigint(20) unsigned NOT NULL,
344 344
 					  ATT_ID bigint(20) unsigned NOT NULL,
345 345
 					  TXN_ID int(10) unsigned NOT NULL,
@@ -362,25 +362,25 @@  discard block
 block discarded – undo
362 362
 					  KEY STS_ID (STS_ID),
363 363
 					  KEY REG_url_link (REG_url_link),
364 364
 					  KEY REG_code (REG_code)";
365
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
366
-        $table_name = 'esp_checkin';
367
-        $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
365
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB ');
366
+		$table_name = 'esp_checkin';
367
+		$sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
368 368
 					REG_ID int(10) unsigned NOT NULL,
369 369
 					DTT_ID int(10) unsigned NOT NULL,
370 370
 					CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1,
371 371
 					CHK_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
372 372
 					PRIMARY KEY  (CHK_ID)";
373
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
374
-        $table_name = 'esp_state';
375
-        $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
373
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
374
+		$table_name = 'esp_state';
375
+		$sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
376 376
 					  CNT_ISO varchar(2) COLLATE utf8_bin NOT NULL,
377 377
 					  STA_abbrev varchar(6) COLLATE utf8_bin NOT NULL,
378 378
 					  STA_name varchar(100) COLLATE utf8_bin NOT NULL,
379 379
 					  STA_active tinyint(1) DEFAULT '1',
380 380
 					  PRIMARY KEY  (STA_ID)";
381
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
382
-        $table_name = 'esp_status';
383
-        $sql = "STS_ID varchar(3) COLLATE utf8_bin NOT NULL,
381
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
382
+		$table_name = 'esp_status';
383
+		$sql = "STS_ID varchar(3) COLLATE utf8_bin NOT NULL,
384 384
 					  STS_code varchar(45) COLLATE utf8_bin NOT NULL,
385 385
 					  STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL,
386 386
 					  STS_can_edit tinyint(1) NOT NULL DEFAULT 0,
@@ -388,9 +388,9 @@  discard block
 block discarded – undo
388 388
 					  STS_open tinyint(1) NOT NULL DEFAULT 1,
389 389
 					  UNIQUE KEY STS_ID_UNIQUE (STS_ID),
390 390
 					  KEY STS_type (STS_type)";
391
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
392
-        $table_name = 'esp_transaction';
393
-        $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
391
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
392
+		$table_name = 'esp_transaction';
393
+		$sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
394 394
 					  TXN_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
395 395
 					  TXN_total decimal(10,3) DEFAULT '0.00',
396 396
 					  TXN_paid decimal(10,3) NOT NULL DEFAULT '0.00',
@@ -400,9 +400,9 @@  discard block
 block discarded – undo
400 400
 					  PRIMARY KEY  (TXN_ID),
401 401
 					  KEY TXN_timestamp (TXN_timestamp),
402 402
 					  KEY STS_ID (STS_ID)";
403
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
404
-        $table_name = 'esp_venue_meta';
405
-        $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
403
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
404
+		$table_name = 'esp_venue_meta';
405
+		$sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
406 406
 			VNU_ID bigint(20) unsigned NOT NULL DEFAULT 0,
407 407
 			VNU_address varchar(255) DEFAULT NULL,
408 408
 			VNU_address2 varchar(255) DEFAULT NULL,
@@ -420,36 +420,36 @@  discard block
 block discarded – undo
420 420
 			PRIMARY KEY  (VNUM_ID),
421 421
 			KEY STA_ID (STA_ID),
422 422
 			KEY CNT_ISO (CNT_ISO)";
423
-        $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
424
-        $script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
425
-        // setting up the DEFAULT stats and countries is also essential for the data migrations to run
426
-        // (because many need to convert old string states to foreign keys into the states table)
427
-        $script_with_defaults->insert_default_states();
428
-        $script_with_defaults->insert_default_countries();
429
-        // setting up DEFAULT prices, price types, and tickets is also essential for the price migrations
430
-        $script_with_defaults->insert_default_price_types();
431
-        $script_with_defaults->insert_default_prices();
432
-        $script_with_defaults->insert_default_tickets();
433
-        // setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre
434
-        EE_Config::instance()->update_espresso_config(false, true);
435
-        return true;
436
-    }
423
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
424
+		$script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
425
+		// setting up the DEFAULT stats and countries is also essential for the data migrations to run
426
+		// (because many need to convert old string states to foreign keys into the states table)
427
+		$script_with_defaults->insert_default_states();
428
+		$script_with_defaults->insert_default_countries();
429
+		// setting up DEFAULT prices, price types, and tickets is also essential for the price migrations
430
+		$script_with_defaults->insert_default_price_types();
431
+		$script_with_defaults->insert_default_prices();
432
+		$script_with_defaults->insert_default_tickets();
433
+		// setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre
434
+		EE_Config::instance()->update_espresso_config(false, true);
435
+		return true;
436
+	}
437 437
 
438 438
 
439 439
 
440
-    /**
441
-     * We COULD clean up the esp_question.QST_order field here. We'll leave it for now
442
-     *
443
-     * @return boolean
444
-     */
445
-    public function schema_changes_after_migration()
446
-    {
447
-        return true;
448
-    }
440
+	/**
441
+	 * We COULD clean up the esp_question.QST_order field here. We'll leave it for now
442
+	 *
443
+	 * @return boolean
444
+	 */
445
+	public function schema_changes_after_migration()
446
+	{
447
+		return true;
448
+	}
449 449
 
450 450
 
451 451
 
452
-    public function migration_page_hooks()
453
-    {
454
-    }
452
+	public function migration_page_hooks()
453
+	{
454
+	}
455 455
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@  discard block
 block discarded – undo
12 12
 // unfortunately, this needs to be done upon INCLUSION of this file,
13 13
 // instead of construction, because it only gets constructed on first page load
14 14
 // (all other times it gets resurrected from a wordpress option)
15
-$stages = glob(EE_CORE . 'data_migration_scripts/4_2_0_stages/*');
15
+$stages = glob(EE_CORE.'data_migration_scripts/4_2_0_stages/*');
16 16
 $class_to_filepath = array();
17
-if (! empty($stages)) {
17
+if ( ! empty($stages)) {
18 18
     foreach ($stages as $filepath) {
19 19
         $matches = array();
20 20
         preg_match('~4_2_0_stages/(.*).dmsstage.php~', $filepath, $matches);
21
-        $class_to_filepath[ $matches[1] ] = $filepath;
21
+        $class_to_filepath[$matches[1]] = $filepath;
22 22
     }
23 23
 }
24 24
 // give addons a chance to autoload their stages too
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
         if (version_compare($version_string, '4.2.0.decaf', '<') && version_compare($version_string, '4.1.0.decaf', '>=')) {
58 58
 //          echo "$version_string can be migrated fro";
59 59
             return true;
60
-        } elseif (! $version_string) {
60
+        } elseif ( ! $version_string) {
61 61
 //          echo "no version string provided: $version_string";
62 62
             // no version string provided... this must be pre 4.1
63 63
             // because since 4.1 we're
64
-            return false;// changed mind. dont want people thinking they should migrate yet because they cant
64
+            return false; // changed mind. dont want people thinking they should migrate yet because they cant
65 65
         } else {
66 66
 //          echo "$version_string doesnt apply";
67 67
             return false;
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     public function schema_changes_before_migration()
74 74
     {
75 75
         // relies on 4.1's EEH_Activation::create_table
76
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
76
+        require_once(EE_HELPERS.'EEH_Activation.helper.php');
77 77
         $table_name = 'esp_answer';
78 78
         $sql = "ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
79 79
 					REG_ID int(10) unsigned NOT NULL,
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Recipient_List_Shortcodes.lib.php 2 patches
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     {
80 80
         // first get registrations just for this attendee.
81 81
         $att = $data->att_obj;
82
-        $registrations_on_attendee = $att instanceof EE_Attendee ? $data->attendees[ $att->ID() ]['reg_objs'] : array();
82
+        $registrations_on_attendee = $att instanceof EE_Attendee ? $data->attendees[$att->ID()]['reg_objs'] : array();
83 83
         $registrations_on_attendee = empty($registrations_on_attendee) && $data->reg_obj instanceof EE_Registration
84 84
             ? array($data->reg_obj) : $registrations_on_attendee;
85 85
         $tkts = array();
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
101 101
             // tickets will be tickets for all registrations on this attendee.
102 102
             foreach ($registrations_on_attendee as $reg) {
103 103
                 if ($reg instanceof EE_Registration) {
104
-                    $ticket = isset($data->registrations[ $reg->ID() ]) && is_array(
105
-                        $data->registrations[ $reg->ID() ]
106
-                    ) && isset($data->registrations[ $reg->ID() ]['tkt_obj']) ? $data->registrations[ $reg->ID(
107
-                    ) ]['tkt_obj'] : null;
104
+                    $ticket = isset($data->registrations[$reg->ID()]) && is_array(
105
+                        $data->registrations[$reg->ID()]
106
+                    ) && isset($data->registrations[$reg->ID()]['tkt_obj']) ? $data->registrations[$reg->ID(
107
+                    )]['tkt_obj'] : null;
108 108
                     if ($ticket instanceof EE_Ticket) {
109
-                        $tkts[ $ticket->ID() ] = $ticket;
109
+                        $tkts[$ticket->ID()] = $ticket;
110 110
                     }
111 111
                 }
112 112
             }
@@ -123,12 +123,12 @@  discard block
 block discarded – undo
123 123
             // data will be tickets for this event for this recipient.
124 124
             foreach ($registrations_on_attendee as $reg) {
125 125
                 if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) {
126
-                    $ticket = isset($data->registrations[ $reg->ID() ]) && is_array(
127
-                        $data->registrations[ $reg->ID() ]
128
-                    ) && isset($data->registrations[ $reg->ID() ]['tkt_obj']) ? $data->registrations[ $reg->ID(
129
-                    ) ]['tkt_obj'] : null;
126
+                    $ticket = isset($data->registrations[$reg->ID()]) && is_array(
127
+                        $data->registrations[$reg->ID()]
128
+                    ) && isset($data->registrations[$reg->ID()]['tkt_obj']) ? $data->registrations[$reg->ID(
129
+                    )]['tkt_obj'] : null;
130 130
                     if ($ticket instanceof EE_Ticket) {
131
-                        $tkts[ $ticket->ID() ] = $ticket;
131
+                        $tkts[$ticket->ID()] = $ticket;
132 132
                     }
133 133
                 }
134 134
             }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     {
171 171
         // first get registrations just for this attendee.
172 172
         $att = $data->att_obj;
173
-        $registrations_on_attendee = $att instanceof EE_Attendee ? $data->attendees[ $att->ID() ]['reg_objs'] : array();
173
+        $registrations_on_attendee = $att instanceof EE_Attendee ? $data->attendees[$att->ID()]['reg_objs'] : array();
174 174
         $registrations_on_attendee = empty($registrations_on_attendee) && $data->reg_obj instanceof EE_Registration
175 175
             ? array($data->reg_obj)
176 176
             : $registrations_on_attendee;
@@ -185,14 +185,14 @@  discard block
 block discarded – undo
185 185
             // dtts will be datetimes for all registrations on this attendee
186 186
             foreach ($registrations_on_attendee as $reg) {
187 187
                 if ($reg instanceof EE_Registration) {
188
-                    $dtt_objs = isset($data->registrations[ $reg->ID() ]) && is_array(
189
-                        $data->registrations[ $reg->ID() ]
190
-                    ) && isset($data->registrations[ $reg->ID() ]['dtt_objs']) ? $data->registrations[ $reg->ID(
191
-                    ) ]['dtt_objs'] : array();
188
+                    $dtt_objs = isset($data->registrations[$reg->ID()]) && is_array(
189
+                        $data->registrations[$reg->ID()]
190
+                    ) && isset($data->registrations[$reg->ID()]['dtt_objs']) ? $data->registrations[$reg->ID(
191
+                    )]['dtt_objs'] : array();
192 192
                     $dtt_objs = (array) $dtt_objs;
193 193
                     foreach ($dtt_objs as $dtt_obj) {
194 194
                         if ($dtt_obj instanceof EE_Datetime) {
195
-                            $dtts[ $dtt_obj->ID() ] = $dtt_obj;
195
+                            $dtts[$dtt_obj->ID()] = $dtt_obj;
196 196
                         }
197 197
                     }
198 198
                 }
@@ -208,19 +208,19 @@  discard block
 block discarded – undo
208 208
             // data will be datetimes for this event for this recipient
209 209
             foreach ($registrations_on_attendee as $reg) {
210 210
                 if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) {
211
-                    $ticket = isset($data->registrations[ $reg->ID() ]) && is_array(
212
-                        $data->registrations[ $reg->ID() ]
213
-                    ) && isset($data->registrations[ $reg->ID() ]['tkt_obj']) ? $data->registrations[ $reg->ID(
214
-                    ) ]['tkt_obj'] : null;
211
+                    $ticket = isset($data->registrations[$reg->ID()]) && is_array(
212
+                        $data->registrations[$reg->ID()]
213
+                    ) && isset($data->registrations[$reg->ID()]['tkt_obj']) ? $data->registrations[$reg->ID(
214
+                    )]['tkt_obj'] : null;
215 215
                     if ($ticket instanceof EE_Ticket) {
216
-                        $dtt_objs = isset($data->tickets[ $ticket->ID() ]) && is_array(
217
-                            $data->tickets[ $ticket->ID() ]
218
-                        ) && isset($data->tickets[ $ticket->ID() ]['dtt_objs']) ? $data->tickets[ $ticket->ID(
219
-                        ) ]['dtt_objs'] : array();
216
+                        $dtt_objs = isset($data->tickets[$ticket->ID()]) && is_array(
217
+                            $data->tickets[$ticket->ID()]
218
+                        ) && isset($data->tickets[$ticket->ID()]['dtt_objs']) ? $data->tickets[$ticket->ID(
219
+                        )]['dtt_objs'] : array();
220 220
                         $dtt_objs = (array) $dtt_objs;
221 221
                         foreach ($dtt_objs as $dtt_obj) {
222 222
                             if ($dtt_obj instanceof EE_Datetime) {
223
-                                $dtts[ $dtt_obj->ID() ] = $dtt_obj;
223
+                                $dtts[$dtt_obj->ID()] = $dtt_obj;
224 224
                             }
225 225
                         }
226 226
                     }
Please login to merge, or discard this patch.
Indentation   +221 added lines, -221 removed lines patch added patch discarded remove patch
@@ -19,225 +19,225 @@
 block discarded – undo
19 19
 class EE_Recipient_List_Shortcodes extends EE_Shortcodes
20 20
 {
21 21
 
22
-    public function __construct()
23
-    {
24
-        parent::__construct();
25
-    }
26
-
27
-
28
-    protected function _init_props()
29
-    {
30
-        $this->label = esc_html__('Recipient List Shortcodes', 'event_espresso');
31
-        $this->description = esc_html__('All shortcodes specific to registrant recipients list type data.', 'event_espresso');
32
-        $this->_shortcodes = array(
33
-            '[RECIPIENT_TICKET_LIST]' => esc_html__(
34
-                'Will output a list of tickets for the recipient of the email. Note, if the recipient is the Event Author, then this is blank.',
35
-                'event_espresso'
36
-            ),
37
-            '[RECIPIENT_DATETIME_LIST]' => esc_html__(
38
-                'Will output a list of datetimes that the person receiving this message has been registered for.',
39
-                'event_espresso'
40
-            ),
41
-        );
42
-    }
43
-
44
-
45
-    protected function _parser($shortcode)
46
-    {
47
-        switch ($shortcode) {
48
-            case '[RECIPIENT_TICKET_LIST]':
49
-                return $this->_get_recipient_ticket_list();
50
-                break;
51
-
52
-            case '[RECIPIENT_DATETIME_LIST]':
53
-                return $this->_get_recipient_datetime_list();
54
-                break;
55
-        }
56
-        return '';
57
-    }
58
-
59
-
60
-    /**
61
-     * figure out what the incoming data is and then return the appropriate parsed value
62
-     *
63
-     * @return string
64
-     */
65
-    private function _get_recipient_ticket_list()
66
-    {
67
-        $this->_validate_list_requirements();
68
-
69
-        if ($this->_data['data'] instanceof EE_Messages_Addressee) {
70
-            return $this->_get_recipient_ticket_list_parsed($this->_data['data']);
71
-        } elseif ($this->_extra_data['data'] instanceof EE_Messages_Addressee) {
72
-            return $this->_get_recipient_ticket_list_parsed($this->_extra_data['data']);
73
-        } else {
74
-            return '';
75
-        }
76
-    }
77
-
78
-
79
-    private function _get_recipient_ticket_list_parsed(EE_Messages_Addressee $data)
80
-    {
81
-        // first get registrations just for this attendee.
82
-        $att = $data->att_obj;
83
-        $registrations_on_attendee = $att instanceof EE_Attendee ? $data->attendees[ $att->ID() ]['reg_objs'] : array();
84
-        $registrations_on_attendee = empty($registrations_on_attendee) && $data->reg_obj instanceof EE_Registration
85
-            ? array($data->reg_obj) : $registrations_on_attendee;
86
-        $tkts = array();
87
-
88
-        // if we're coming in from the main content then $this->_data['data'] is instanceof EE_Messages_Addressee.
89
-        // which means we want to get tickets for all events this addressee is a part of.
90
-        if ($this->_data['data'] instanceof EE_Messages_Addressee) {
91
-            $valid_shortcodes = array(
92
-                'ticket',
93
-                'event_list',
94
-                'attendee_list',
95
-                'datetime_list',
96
-                'registration_details',
97
-                'attendee',
98
-                'recipient_details',
99
-            );
100
-            $template = $this->_data['template'];
101
-
102
-            // tickets will be tickets for all registrations on this attendee.
103
-            foreach ($registrations_on_attendee as $reg) {
104
-                if ($reg instanceof EE_Registration) {
105
-                    $ticket = isset($data->registrations[ $reg->ID() ]) && is_array(
106
-                        $data->registrations[ $reg->ID() ]
107
-                    ) && isset($data->registrations[ $reg->ID() ]['tkt_obj']) ? $data->registrations[ $reg->ID(
108
-                    ) ]['tkt_obj'] : null;
109
-                    if ($ticket instanceof EE_Ticket) {
110
-                        $tkts[ $ticket->ID() ] = $ticket;
111
-                    }
112
-                }
113
-            }
114
-        }
115
-
116
-        // if coming from the context of the event list parser, then let's return just the tickets for that event.
117
-        $event = $this->_data['data'];
118
-        if ($event instanceof EE_Event) {
119
-            $valid_shortcodes = array('ticket', 'attendee_list', 'datetime_list', 'attendee', 'recipient_details');
120
-            $template = is_array($this->_data['template']) && isset($this->_data['template']['ticket_list'])
121
-                ? $this->_data['template']['ticket_list'] : $this->_extra_data['template']['ticket_list'];
122
-            // let's remove any existing [EVENT_LIST] shortcode from the ticket list template so that we don't get recursion.
123
-            $template = str_replace('[EVENT_LIST]', '', $template);
124
-            // data will be tickets for this event for this recipient.
125
-            foreach ($registrations_on_attendee as $reg) {
126
-                if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) {
127
-                    $ticket = isset($data->registrations[ $reg->ID() ]) && is_array(
128
-                        $data->registrations[ $reg->ID() ]
129
-                    ) && isset($data->registrations[ $reg->ID() ]['tkt_obj']) ? $data->registrations[ $reg->ID(
130
-                    ) ]['tkt_obj'] : null;
131
-                    if ($ticket instanceof EE_Ticket) {
132
-                        $tkts[ $ticket->ID() ] = $ticket;
133
-                    }
134
-                }
135
-            }
136
-        }
137
-
138
-        $tkt_parsed = '';
139
-        foreach ($tkts as $ticket) {
140
-            $tkt_parsed .= $this->_shortcode_helper->parse_ticket_list_template(
141
-                $template,
142
-                $ticket,
143
-                $valid_shortcodes,
144
-                $this->_extra_data
145
-            );
146
-        }
147
-        return $tkt_parsed;
148
-    }
149
-
150
-
151
-    /**
152
-     * figure out what the incoming data is and then return the appropriate parsed value
153
-     *
154
-     * @return string
155
-     */
156
-    private function _get_recipient_datetime_list()
157
-    {
158
-        $this->_validate_list_requirements();
159
-
160
-        if ($this->_data['data'] instanceof EE_Messages_Addressee) {
161
-            return $this->_get_recipient_datetime_list_parsed($this->_data['data']);
162
-        } elseif ($this->_extra_data['data'] instanceof EE_Messages_Addressee) {
163
-            return $this->_get_recipient_datetime_list_parsed($this->_extra_data['data']);
164
-        } else {
165
-            return '';
166
-        }
167
-    }
168
-
169
-
170
-    private function _get_recipient_datetime_list_parsed(EE_Messages_Addressee $data)
171
-    {
172
-        // first get registrations just for this attendee.
173
-        $att = $data->att_obj;
174
-        $registrations_on_attendee = $att instanceof EE_Attendee ? $data->attendees[ $att->ID() ]['reg_objs'] : array();
175
-        $registrations_on_attendee = empty($registrations_on_attendee) && $data->reg_obj instanceof EE_Registration
176
-            ? array($data->reg_obj)
177
-            : $registrations_on_attendee;
178
-        $valid_shortcodes = array('datetime', 'attendee', 'recipient_details');
179
-        $template = '';
180
-        $dtts = array();
181
-
182
-        // setup valid shortcodes depending on what the status of the $this->_data property is
183
-        if ($this->_data['data'] instanceof EE_Messages_Addressee) {
184
-            $template = $this->_data['template'];
185
-
186
-            // dtts will be datetimes for all registrations on this attendee
187
-            foreach ($registrations_on_attendee as $reg) {
188
-                if ($reg instanceof EE_Registration) {
189
-                    $dtt_objs = isset($data->registrations[ $reg->ID() ]) && is_array(
190
-                        $data->registrations[ $reg->ID() ]
191
-                    ) && isset($data->registrations[ $reg->ID() ]['dtt_objs']) ? $data->registrations[ $reg->ID(
192
-                    ) ]['dtt_objs'] : array();
193
-                    $dtt_objs = (array) $dtt_objs;
194
-                    foreach ($dtt_objs as $dtt_obj) {
195
-                        if ($dtt_obj instanceof EE_Datetime) {
196
-                            $dtts[ $dtt_obj->ID() ] = $dtt_obj;
197
-                        }
198
-                    }
199
-                }
200
-            }
201
-        }
202
-
203
-        // if coming from the context of the event list parser, then let's just return the datetimes for the specific event.
204
-        $event = $this->_data['data'];
205
-        if ($event instanceof EE_Event) {
206
-            $template = is_array($this->_data['template']) && isset($this->_data['template']['datetime_list'])
207
-                ? $this->_data['template']['datetime_list'] : $this->_extra_data['template']['datetime_list'];
208
-
209
-            // data will be datetimes for this event for this recipient
210
-            foreach ($registrations_on_attendee as $reg) {
211
-                if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) {
212
-                    $ticket = isset($data->registrations[ $reg->ID() ]) && is_array(
213
-                        $data->registrations[ $reg->ID() ]
214
-                    ) && isset($data->registrations[ $reg->ID() ]['tkt_obj']) ? $data->registrations[ $reg->ID(
215
-                    ) ]['tkt_obj'] : null;
216
-                    if ($ticket instanceof EE_Ticket) {
217
-                        $dtt_objs = isset($data->tickets[ $ticket->ID() ]) && is_array(
218
-                            $data->tickets[ $ticket->ID() ]
219
-                        ) && isset($data->tickets[ $ticket->ID() ]['dtt_objs']) ? $data->tickets[ $ticket->ID(
220
-                        ) ]['dtt_objs'] : array();
221
-                        $dtt_objs = (array) $dtt_objs;
222
-                        foreach ($dtt_objs as $dtt_obj) {
223
-                            if ($dtt_obj instanceof EE_Datetime) {
224
-                                $dtts[ $dtt_obj->ID() ] = $dtt_obj;
225
-                            }
226
-                        }
227
-                    }
228
-                }
229
-            }
230
-        }
231
-
232
-        $dtt_parsed = '';
233
-        foreach ($dtts as $datetime) {
234
-            $dtt_parsed .= $this->_shortcode_helper->parse_datetime_list_template(
235
-                $template,
236
-                $datetime,
237
-                $valid_shortcodes,
238
-                $this->_extra_data
239
-            );
240
-        }
241
-        return $dtt_parsed;
242
-    }
22
+	public function __construct()
23
+	{
24
+		parent::__construct();
25
+	}
26
+
27
+
28
+	protected function _init_props()
29
+	{
30
+		$this->label = esc_html__('Recipient List Shortcodes', 'event_espresso');
31
+		$this->description = esc_html__('All shortcodes specific to registrant recipients list type data.', 'event_espresso');
32
+		$this->_shortcodes = array(
33
+			'[RECIPIENT_TICKET_LIST]' => esc_html__(
34
+				'Will output a list of tickets for the recipient of the email. Note, if the recipient is the Event Author, then this is blank.',
35
+				'event_espresso'
36
+			),
37
+			'[RECIPIENT_DATETIME_LIST]' => esc_html__(
38
+				'Will output a list of datetimes that the person receiving this message has been registered for.',
39
+				'event_espresso'
40
+			),
41
+		);
42
+	}
43
+
44
+
45
+	protected function _parser($shortcode)
46
+	{
47
+		switch ($shortcode) {
48
+			case '[RECIPIENT_TICKET_LIST]':
49
+				return $this->_get_recipient_ticket_list();
50
+				break;
51
+
52
+			case '[RECIPIENT_DATETIME_LIST]':
53
+				return $this->_get_recipient_datetime_list();
54
+				break;
55
+		}
56
+		return '';
57
+	}
58
+
59
+
60
+	/**
61
+	 * figure out what the incoming data is and then return the appropriate parsed value
62
+	 *
63
+	 * @return string
64
+	 */
65
+	private function _get_recipient_ticket_list()
66
+	{
67
+		$this->_validate_list_requirements();
68
+
69
+		if ($this->_data['data'] instanceof EE_Messages_Addressee) {
70
+			return $this->_get_recipient_ticket_list_parsed($this->_data['data']);
71
+		} elseif ($this->_extra_data['data'] instanceof EE_Messages_Addressee) {
72
+			return $this->_get_recipient_ticket_list_parsed($this->_extra_data['data']);
73
+		} else {
74
+			return '';
75
+		}
76
+	}
77
+
78
+
79
+	private function _get_recipient_ticket_list_parsed(EE_Messages_Addressee $data)
80
+	{
81
+		// first get registrations just for this attendee.
82
+		$att = $data->att_obj;
83
+		$registrations_on_attendee = $att instanceof EE_Attendee ? $data->attendees[ $att->ID() ]['reg_objs'] : array();
84
+		$registrations_on_attendee = empty($registrations_on_attendee) && $data->reg_obj instanceof EE_Registration
85
+			? array($data->reg_obj) : $registrations_on_attendee;
86
+		$tkts = array();
87
+
88
+		// if we're coming in from the main content then $this->_data['data'] is instanceof EE_Messages_Addressee.
89
+		// which means we want to get tickets for all events this addressee is a part of.
90
+		if ($this->_data['data'] instanceof EE_Messages_Addressee) {
91
+			$valid_shortcodes = array(
92
+				'ticket',
93
+				'event_list',
94
+				'attendee_list',
95
+				'datetime_list',
96
+				'registration_details',
97
+				'attendee',
98
+				'recipient_details',
99
+			);
100
+			$template = $this->_data['template'];
101
+
102
+			// tickets will be tickets for all registrations on this attendee.
103
+			foreach ($registrations_on_attendee as $reg) {
104
+				if ($reg instanceof EE_Registration) {
105
+					$ticket = isset($data->registrations[ $reg->ID() ]) && is_array(
106
+						$data->registrations[ $reg->ID() ]
107
+					) && isset($data->registrations[ $reg->ID() ]['tkt_obj']) ? $data->registrations[ $reg->ID(
108
+					) ]['tkt_obj'] : null;
109
+					if ($ticket instanceof EE_Ticket) {
110
+						$tkts[ $ticket->ID() ] = $ticket;
111
+					}
112
+				}
113
+			}
114
+		}
115
+
116
+		// if coming from the context of the event list parser, then let's return just the tickets for that event.
117
+		$event = $this->_data['data'];
118
+		if ($event instanceof EE_Event) {
119
+			$valid_shortcodes = array('ticket', 'attendee_list', 'datetime_list', 'attendee', 'recipient_details');
120
+			$template = is_array($this->_data['template']) && isset($this->_data['template']['ticket_list'])
121
+				? $this->_data['template']['ticket_list'] : $this->_extra_data['template']['ticket_list'];
122
+			// let's remove any existing [EVENT_LIST] shortcode from the ticket list template so that we don't get recursion.
123
+			$template = str_replace('[EVENT_LIST]', '', $template);
124
+			// data will be tickets for this event for this recipient.
125
+			foreach ($registrations_on_attendee as $reg) {
126
+				if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) {
127
+					$ticket = isset($data->registrations[ $reg->ID() ]) && is_array(
128
+						$data->registrations[ $reg->ID() ]
129
+					) && isset($data->registrations[ $reg->ID() ]['tkt_obj']) ? $data->registrations[ $reg->ID(
130
+					) ]['tkt_obj'] : null;
131
+					if ($ticket instanceof EE_Ticket) {
132
+						$tkts[ $ticket->ID() ] = $ticket;
133
+					}
134
+				}
135
+			}
136
+		}
137
+
138
+		$tkt_parsed = '';
139
+		foreach ($tkts as $ticket) {
140
+			$tkt_parsed .= $this->_shortcode_helper->parse_ticket_list_template(
141
+				$template,
142
+				$ticket,
143
+				$valid_shortcodes,
144
+				$this->_extra_data
145
+			);
146
+		}
147
+		return $tkt_parsed;
148
+	}
149
+
150
+
151
+	/**
152
+	 * figure out what the incoming data is and then return the appropriate parsed value
153
+	 *
154
+	 * @return string
155
+	 */
156
+	private function _get_recipient_datetime_list()
157
+	{
158
+		$this->_validate_list_requirements();
159
+
160
+		if ($this->_data['data'] instanceof EE_Messages_Addressee) {
161
+			return $this->_get_recipient_datetime_list_parsed($this->_data['data']);
162
+		} elseif ($this->_extra_data['data'] instanceof EE_Messages_Addressee) {
163
+			return $this->_get_recipient_datetime_list_parsed($this->_extra_data['data']);
164
+		} else {
165
+			return '';
166
+		}
167
+	}
168
+
169
+
170
+	private function _get_recipient_datetime_list_parsed(EE_Messages_Addressee $data)
171
+	{
172
+		// first get registrations just for this attendee.
173
+		$att = $data->att_obj;
174
+		$registrations_on_attendee = $att instanceof EE_Attendee ? $data->attendees[ $att->ID() ]['reg_objs'] : array();
175
+		$registrations_on_attendee = empty($registrations_on_attendee) && $data->reg_obj instanceof EE_Registration
176
+			? array($data->reg_obj)
177
+			: $registrations_on_attendee;
178
+		$valid_shortcodes = array('datetime', 'attendee', 'recipient_details');
179
+		$template = '';
180
+		$dtts = array();
181
+
182
+		// setup valid shortcodes depending on what the status of the $this->_data property is
183
+		if ($this->_data['data'] instanceof EE_Messages_Addressee) {
184
+			$template = $this->_data['template'];
185
+
186
+			// dtts will be datetimes for all registrations on this attendee
187
+			foreach ($registrations_on_attendee as $reg) {
188
+				if ($reg instanceof EE_Registration) {
189
+					$dtt_objs = isset($data->registrations[ $reg->ID() ]) && is_array(
190
+						$data->registrations[ $reg->ID() ]
191
+					) && isset($data->registrations[ $reg->ID() ]['dtt_objs']) ? $data->registrations[ $reg->ID(
192
+					) ]['dtt_objs'] : array();
193
+					$dtt_objs = (array) $dtt_objs;
194
+					foreach ($dtt_objs as $dtt_obj) {
195
+						if ($dtt_obj instanceof EE_Datetime) {
196
+							$dtts[ $dtt_obj->ID() ] = $dtt_obj;
197
+						}
198
+					}
199
+				}
200
+			}
201
+		}
202
+
203
+		// if coming from the context of the event list parser, then let's just return the datetimes for the specific event.
204
+		$event = $this->_data['data'];
205
+		if ($event instanceof EE_Event) {
206
+			$template = is_array($this->_data['template']) && isset($this->_data['template']['datetime_list'])
207
+				? $this->_data['template']['datetime_list'] : $this->_extra_data['template']['datetime_list'];
208
+
209
+			// data will be datetimes for this event for this recipient
210
+			foreach ($registrations_on_attendee as $reg) {
211
+				if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) {
212
+					$ticket = isset($data->registrations[ $reg->ID() ]) && is_array(
213
+						$data->registrations[ $reg->ID() ]
214
+					) && isset($data->registrations[ $reg->ID() ]['tkt_obj']) ? $data->registrations[ $reg->ID(
215
+					) ]['tkt_obj'] : null;
216
+					if ($ticket instanceof EE_Ticket) {
217
+						$dtt_objs = isset($data->tickets[ $ticket->ID() ]) && is_array(
218
+							$data->tickets[ $ticket->ID() ]
219
+						) && isset($data->tickets[ $ticket->ID() ]['dtt_objs']) ? $data->tickets[ $ticket->ID(
220
+						) ]['dtt_objs'] : array();
221
+						$dtt_objs = (array) $dtt_objs;
222
+						foreach ($dtt_objs as $dtt_obj) {
223
+							if ($dtt_obj instanceof EE_Datetime) {
224
+								$dtts[ $dtt_obj->ID() ] = $dtt_obj;
225
+							}
226
+						}
227
+					}
228
+				}
229
+			}
230
+		}
231
+
232
+		$dtt_parsed = '';
233
+		foreach ($dtts as $datetime) {
234
+			$dtt_parsed .= $this->_shortcode_helper->parse_datetime_list_template(
235
+				$template,
236
+				$datetime,
237
+				$valid_shortcodes,
238
+				$this->_extra_data
239
+			);
240
+		}
241
+		return $dtt_parsed;
242
+	}
243 243
 }
Please login to merge, or discard this patch.
services/admin/registrations/list_table/page_header/DateFilterHeader.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
                 $text .= '<span class="drk-grey-text">';
71 71
                 $text .= '<span class="dashicons dashicons-calendar"></span>';
72 72
                 $text .= $datetime->name();
73
-                $text .= ' ( ' . $datetime->start_date() . ' )';
73
+                $text .= ' ( '.$datetime->start_date().' )';
74 74
                 $text .= '</span></h3>';
75 75
             }
76 76
         }
Please login to merge, or discard this patch.
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -23,57 +23,57 @@
 block discarded – undo
23 23
 class DateFilterHeader extends AdminPageHeaderDecorator
24 24
 {
25 25
 
26
-    /**
27
-     * @var EEM_Datetime $datetime_model
28
-     */
29
-    private $datetime_model;
26
+	/**
27
+	 * @var EEM_Datetime $datetime_model
28
+	 */
29
+	private $datetime_model;
30 30
 
31 31
 
32
-    /**
33
-     * DateFilterHeader constructor.
34
-     *
35
-     * @param RequestInterface $request
36
-     * @param EEM_Datetime     $datetime_model
37
-     */
38
-    public function __construct(RequestInterface $request, EEM_Datetime $datetime_model)
39
-    {
40
-        parent::__construct($request);
41
-        $this->datetime_model = $datetime_model;
42
-    }
32
+	/**
33
+	 * DateFilterHeader constructor.
34
+	 *
35
+	 * @param RequestInterface $request
36
+	 * @param EEM_Datetime     $datetime_model
37
+	 */
38
+	public function __construct(RequestInterface $request, EEM_Datetime $datetime_model)
39
+	{
40
+		parent::__construct($request);
41
+		$this->datetime_model = $datetime_model;
42
+	}
43 43
 
44 44
 
45
-    /**
46
-     * @param string $text
47
-     * @return string
48
-     * @throws EE_Error
49
-     * @throws InvalidDataTypeException
50
-     * @throws InvalidInterfaceException
51
-     * @throws InvalidArgumentException
52
-     * @throws ReflectionException
53
-     * @since 4.10.2.p
54
-     */
55
-    public function getHeaderText($text = '')
56
-    {
57
-        $DTT_ID = $this->request->getRequestParam('DTT_ID');
58
-        $DTT_ID = $this->request->getRequestParam('datetime_id', $DTT_ID, 'int');
59
-        if ($DTT_ID) {
60
-            $datetime = $this->datetime_model->get_one_by_ID($DTT_ID);
61
-            if ($datetime instanceof EE_Datetime && $text !== '') {
62
-                // remove the closing h3 heading tag if it exists
63
-                $text = str_replace(
64
-                    '</h3>',
65
-                    '',
66
-                    $text
67
-                );
68
-                $text .= '&nbsp; &nbsp; ';
69
-                $text .= '<span class="drk-grey-text">';
70
-                $text .= '<span class="dashicons dashicons-calendar"></span>';
71
-                $text .= $datetime->name();
72
-                $text .= ' ( ' . $datetime->start_date() . ' )';
73
-                $text .= '</span></h3>';
74
-            }
75
-        }
45
+	/**
46
+	 * @param string $text
47
+	 * @return string
48
+	 * @throws EE_Error
49
+	 * @throws InvalidDataTypeException
50
+	 * @throws InvalidInterfaceException
51
+	 * @throws InvalidArgumentException
52
+	 * @throws ReflectionException
53
+	 * @since 4.10.2.p
54
+	 */
55
+	public function getHeaderText($text = '')
56
+	{
57
+		$DTT_ID = $this->request->getRequestParam('DTT_ID');
58
+		$DTT_ID = $this->request->getRequestParam('datetime_id', $DTT_ID, 'int');
59
+		if ($DTT_ID) {
60
+			$datetime = $this->datetime_model->get_one_by_ID($DTT_ID);
61
+			if ($datetime instanceof EE_Datetime && $text !== '') {
62
+				// remove the closing h3 heading tag if it exists
63
+				$text = str_replace(
64
+					'</h3>',
65
+					'',
66
+					$text
67
+				);
68
+				$text .= '&nbsp; &nbsp; ';
69
+				$text .= '<span class="drk-grey-text">';
70
+				$text .= '<span class="dashicons dashicons-calendar"></span>';
71
+				$text .= $datetime->name();
72
+				$text .= ' ( ' . $datetime->start_date() . ' )';
73
+				$text .= '</span></h3>';
74
+			}
75
+		}
76 76
 
77
-        return $text;
78
-    }
77
+		return $text;
78
+	}
79 79
 }
Please login to merge, or discard this patch.
admin/registrations/list_table/page_header/AttendeeFilterHeader.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,13 +59,13 @@
 block discarded – undo
59 59
                         'event_espresso'
60 60
                     ),
61 61
                     '<h3 style="line-height:1.5em;">',
62
-                    '<a href="' . EE_Admin_Page::add_query_args_and_nonce(
62
+                    '<a href="'.EE_Admin_Page::add_query_args_and_nonce(
63 63
                         array(
64 64
                             'action' => 'edit_attendee',
65 65
                             'post'   => $ATT_ID,
66 66
                         ),
67 67
                         REG_ADMIN_URL
68
-                    ) . '">' . $attendee->full_name() . '</a>',
68
+                    ).'">'.$attendee->full_name().'</a>',
69 69
                     '</h3>'
70 70
                 );
71 71
             }
Please login to merge, or discard this patch.
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -20,55 +20,55 @@
 block discarded – undo
20 20
 class AttendeeFilterHeader extends AdminPageHeaderDecorator
21 21
 {
22 22
 
23
-    /**
24
-     * @var EEM_Attendee $attendee_model
25
-     */
26
-    private $attendee_model;
23
+	/**
24
+	 * @var EEM_Attendee $attendee_model
25
+	 */
26
+	private $attendee_model;
27 27
 
28 28
 
29
-    /**
30
-     * AttendeeFilterHeader constructor.
31
-     *
32
-     * @param RequestInterface $request
33
-     * @param EEM_Attendee     $attendee_model
34
-     */
35
-    public function __construct(RequestInterface $request, EEM_Attendee $attendee_model)
36
-    {
37
-        parent::__construct($request);
38
-        $this->attendee_model = $attendee_model;
39
-    }
29
+	/**
30
+	 * AttendeeFilterHeader constructor.
31
+	 *
32
+	 * @param RequestInterface $request
33
+	 * @param EEM_Attendee     $attendee_model
34
+	 */
35
+	public function __construct(RequestInterface $request, EEM_Attendee $attendee_model)
36
+	{
37
+		parent::__construct($request);
38
+		$this->attendee_model = $attendee_model;
39
+	}
40 40
 
41 41
 
42
-    /**
43
-     * @param string $text
44
-     * @return string
45
-     * @throws EE_Error
46
-     * @since 4.10.2.p
47
-     */
48
-    public function getHeaderText($text = '')
49
-    {
50
-        $ATT_ID = $this->request->getRequestParam('ATT_ID');
51
-        $ATT_ID = $this->request->getRequestParam('attendee_id', $ATT_ID, 'int');
52
-        if ($ATT_ID) {
53
-            $attendee = $this->attendee_model->get_one_by_ID($ATT_ID);
54
-            if ($attendee instanceof EE_Attendee) {
55
-                $text .= sprintf(
56
-                    esc_html__(
57
-                        '%1$s Viewing registrations for %2$s%3$s',
58
-                        'event_espresso'
59
-                    ),
60
-                    '<h3 style="line-height:1.5em;">',
61
-                    '<a href="' . EE_Admin_Page::add_query_args_and_nonce(
62
-                        array(
63
-                            'action' => 'edit_attendee',
64
-                            'post'   => $ATT_ID,
65
-                        ),
66
-                        REG_ADMIN_URL
67
-                    ) . '">' . $attendee->full_name() . '</a>',
68
-                    '</h3>'
69
-                );
70
-            }
71
-        }
72
-        return $text;
73
-    }
42
+	/**
43
+	 * @param string $text
44
+	 * @return string
45
+	 * @throws EE_Error
46
+	 * @since 4.10.2.p
47
+	 */
48
+	public function getHeaderText($text = '')
49
+	{
50
+		$ATT_ID = $this->request->getRequestParam('ATT_ID');
51
+		$ATT_ID = $this->request->getRequestParam('attendee_id', $ATT_ID, 'int');
52
+		if ($ATT_ID) {
53
+			$attendee = $this->attendee_model->get_one_by_ID($ATT_ID);
54
+			if ($attendee instanceof EE_Attendee) {
55
+				$text .= sprintf(
56
+					esc_html__(
57
+						'%1$s Viewing registrations for %2$s%3$s',
58
+						'event_espresso'
59
+					),
60
+					'<h3 style="line-height:1.5em;">',
61
+					'<a href="' . EE_Admin_Page::add_query_args_and_nonce(
62
+						array(
63
+							'action' => 'edit_attendee',
64
+							'post'   => $ATT_ID,
65
+						),
66
+						REG_ADMIN_URL
67
+					) . '">' . $attendee->full_name() . '</a>',
68
+					'</h3>'
69
+				);
70
+			}
71
+		}
72
+		return $text;
73
+	}
74 74
 }
Please login to merge, or discard this patch.
core/services/admin/AdminPageHeaderDecorator.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -16,19 +16,19 @@
 block discarded – undo
16 16
 abstract class AdminPageHeaderDecorator implements AdminPageHeaderDecoratorInterface
17 17
 {
18 18
 
19
-    /**
20
-     * @var RequestInterface $request
21
-     */
22
-    protected $request;
19
+	/**
20
+	 * @var RequestInterface $request
21
+	 */
22
+	protected $request;
23 23
 
24 24
 
25
-    /**
26
-     * AdminPageHeader constructor.
27
-     *
28
-     * @param RequestInterface $request
29
-     */
30
-    public function __construct(RequestInterface $request)
31
-    {
32
-        $this->request = $request;
33
-    }
25
+	/**
26
+	 * AdminPageHeader constructor.
27
+	 *
28
+	 * @param RequestInterface $request
29
+	 */
30
+	public function __construct(RequestInterface $request)
31
+	{
32
+		$this->request = $request;
33
+	}
34 34
 }
Please login to merge, or discard this patch.