Completed
Branch FET-8385-datetime-ticket-selec... (dbda12)
by
unknown
194:55 queued 183:27
created
modules/ticket_selector/TicketSelectorRowStandard.php 1 patch
Indentation   +452 added lines, -452 removed lines patch added patch discarded remove patch
@@ -16,458 +16,458 @@
 block discarded – undo
16 16
 class TicketSelectorRowStandard extends TicketSelectorRow
17 17
 {
18 18
 
19
-    /**
20
-     * @var TicketDetails $ticket_details
21
-     */
22
-    protected $ticket_details;
23
-
24
-    /**
25
-     * @var \EE_Ticket_Selector_Config $template_settings
26
-     */
27
-    protected $template_settings;
28
-
29
-    /**
30
-     * @var \EE_Tax_Config $tax_settings
31
-     */
32
-    protected $tax_settings;
33
-
34
-    /**
35
-     * @var boolean $required_ticket_sold_out
36
-     */
37
-    protected $required_ticket_sold_out;
38
-
39
-    /**
40
-     * @var boolean $prices_displayed_including_taxes
41
-     */
42
-    protected $prices_displayed_including_taxes;
43
-
44
-    /**
45
-     * @var string $event_status
46
-     */
47
-    protected $event_status;
48
-
49
-    /**
50
-     * @var int $row
51
-     */
52
-    protected $row;
53
-
54
-    /**
55
-     * @var int $cols
56
-     */
57
-    protected $cols;
58
-
59
-    /**
60
-     * @var boolean $hidden_input_qty
61
-     */
62
-    protected $hidden_input_qty;
63
-
64
-    /**
65
-     * @var string $ticket_datetime_classes
66
-     */
67
-    protected $ticket_datetime_classes;
68
-
69
-
70
-
71
-    /**
72
-     * TicketDetails constructor.
73
-     *
74
-     * @param \EE_Ticket $ticket
75
-     * @param TicketDetails              $ticket_details
76
-     * @param \EE_Ticket_Selector_Config $template_settings
77
-     * @param \EE_Tax_Config             $tax_settings
78
-     * @param int                        $max_atndz
79
-     * @param int                        $row
80
-     * @param int                        $cols
81
-     * @param boolean                    $required_ticket_sold_out
82
-     * @param string                     $event_status
83
-     * @param string                     $date_format
84
-     * @param string                     $ticket_datetime_classes
85
-     */
86
-    public function __construct(
87
-        \EE_Ticket $ticket,
88
-        TicketDetails $ticket_details,
89
-        \EE_Ticket_Selector_Config $template_settings,
90
-        \EE_Tax_Config $tax_settings,
91
-        $max_atndz,
92
-        $row,
93
-        $cols,
94
-        $required_ticket_sold_out,
95
-        $event_status,
96
-        $date_format,
97
-        $ticket_datetime_classes
98
-    ) {
99
-        $this->ticket = $ticket;
100
-        $this->ticket_details = $ticket_details;
101
-        $this->template_settings = $template_settings;
102
-        $this->tax_settings = $tax_settings;
103
-        $this->max_atndz = $max_atndz;
104
-        $this->row = $row;
105
-        $this->cols = $cols;
106
-        $this->required_ticket_sold_out = $required_ticket_sold_out;
107
-        $this->event_status = $event_status;
108
-        $this->date_format = $date_format;
109
-        $this->ticket_datetime_classes = $ticket_datetime_classes;
110
-        parent::__construct($ticket, $max_atndz, $date_format);
111
-    }
112
-
113
-
114
-
115
-    /**
116
-     * other ticket rows will need to know if a required ticket is sold out,
117
-     * so that they are not offered for sale
118
-     *
119
-     * @return boolean
120
-     */
121
-    public function getRequiredTicketSoldOut()
122
-    {
123
-        return $this->required_ticket_sold_out;
124
-    }
125
-
126
-
127
-
128
-    /**
129
-     * @return int
130
-     */
131
-    public function getCols()
132
-    {
133
-        return $this->cols;
134
-    }
135
-
136
-
137
-
138
-    /**
139
-     * getHtml
140
-     *
141
-     * @return string
142
-     * @throws \EE_Error
143
-     */
144
-    public function getHtml()
145
-    {
146
-        $min = 0;
147
-        $max = $this->ticket->max();
148
-        $remaining = $this->ticket->remaining();
149
-        if ($this->ticket->is_on_sale() && $this->ticket->is_remaining()) {
150
-            list($min, $max) = $this->setTicketMinAndMax($remaining);
151
-        } else {
152
-            // set flag if ticket is required (flag is set to start date so that future tickets are not blocked)
153
-            $this->required_ticket_sold_out = $this->ticket->required() && ! $remaining
154
-                ? $this->ticket->start_date()
155
-                : $this->required_ticket_sold_out;
156
-        }
157
-        list($ticket_price, $ticket_bundle) = $this->getTicketPriceDetails();
158
-        list($tkt_status, $ticket_status, $status_class) = $this->getTicketStatusClasses($remaining);
159
-        /**
160
-         * Allow plugins to hook in and abort the generation and display of this row to do
161
-         * something else if they want.
162
-         * For an addon to abort things, all they have to do is register a filter with this hook, and
163
-         * return a value that is NOT false.  Whatever is returned gets echoed instead of the
164
-         * current row.
165
-         *
166
-         * @var string|bool
167
-         */
168
-        $ticket_selector_row_html = apply_filters(
169
-            'FHEE__ticket_selector_chart_template__do_ticket_entire_row',
170
-            false,
171
-            $this->ticket,
172
-            $max,
173
-            $min,
174
-            $this->required_ticket_sold_out,
175
-            $ticket_price,
176
-            $ticket_bundle,
177
-            $ticket_status,
178
-            $status_class
179
-        );
180
-        if ($ticket_selector_row_html !== false) {
181
-            return $ticket_selector_row_html;
182
-        }
183
-        $ticket_selector_row_html = \EEH_HTML::tr(
184
-            '', '',
185
-            "tckt-slctr-tbl-tr {$status_class}{$this->ticket_datetime_classes} " . espresso_get_object_css_class($this->ticket)
186
-        );
187
-        /**
188
-         * Allow plugins to hook in and abort the generation and display of the contents of this
189
-         * row to do something else if they want.
190
-         * For an addon to abort things, all they have to do is register a filter with this hook, and
191
-         * return a value that is NOT false.  Whatever is returned gets echoed instead of the
192
-         * current row.
193
-         *
194
-         * @var string|bool
195
-         */
196
-        $new_row_cells_content = apply_filters(
197
-            'FHEE__ticket_selector_chart_template__do_ticket_inside_row',
198
-            false,
199
-            $this->ticket,
200
-            $max,
201
-            $min,
202
-            $this->required_ticket_sold_out,
203
-            $ticket_price,
204
-            $ticket_bundle,
205
-            $ticket_status,
206
-            $status_class
207
-        );
208
-        if ($new_row_cells_content !== false) {
209
-            return $ticket_selector_row_html . $new_row_cells_content . \EEH_HTML::trx();
210
-        }
211
-        $this->hidden_input_qty = $this->max_atndz > 1 ? true : false;
212
-
213
-        $ticket_selector_row_html .= $this->ticketNameTableCell();
214
-        $ticket_selector_row_html .= $this->ticketPriceTableCell($ticket_price, $ticket_bundle);
215
-        $ticket_selector_row_html .= \EEH_HTML::td('', '', 'tckt-slctr-tbl-td-qty cntr');
216
-        $this->setTicketStatusDisplay($tkt_status, $ticket_status, $remaining);
217
-        if (empty($this->ticket_status_display)) {
218
-            if ($this->max_atndz === 1) {
219
-                // only ONE attendee is allowed to register at a time
220
-                $ticket_selector_row_html .= $this->onlyOneAttendeeCanRegister();
221
-            } else if ($max > 0) {
222
-                $ticket_selector_row_html .= $this->ticketQuantitySelector($min, $max);
223
-            }
224
-        }
225
-        $ticket_selector_row_html .= $this->ticket_status_display;
226
-        $ticket_selector_row_html .= $this->ticketQtyAndIdHiddenInputs();
227
-        $ticket_selector_row_html .= $this->ticket_details->display($ticket_price, $remaining, $this->cols);
228
-        $ticket_selector_row_html .= \EEH_HTML::tdx();
229
-        $ticket_selector_row_html .= \EEH_HTML::trx();
230
-
231
-
232
-        $this->row++;
233
-        return $ticket_selector_row_html;
234
-    }
235
-
236
-
237
-
238
-    /**
239
-     * setTicketMinAndMax
240
-     *
241
-     * @param int $remaining
242
-     * @return array
243
-     */
244
-    protected function setTicketMinAndMax($remaining)
245
-    {
246
-        // offer the number of $tickets_remaining or $this->max_atndz, whichever is smaller
247
-        $max = min($remaining, $this->max_atndz);
248
-        // but... we also want to restrict the number of tickets by the ticket max setting,
249
-        // however, the max still can't be higher than what was just set above
250
-        $max = $this->ticket->max() > 0 ? min($this->ticket->max(), $max) : $max;
251
-        // and we also want to restrict the minimum number of tickets by the ticket min setting
252
-        $min = $this->ticket->min() > 0 ? $this->ticket->min() : 0;
253
-        // and if the ticket is required, then make sure that min qty is at least 1
254
-        $min = $this->ticket->required() ? max($min, 1) : $min;
255
-        return array($min, $max);
256
-    }
257
-
258
-
259
-    /**
260
-     * getTicketPriceDetails
261
-     *
262
-     * @return array
263
-     */
264
-    protected function getTicketPriceDetails()
265
-    {
266
-        $ticket_price = $this->tax_settings->prices_displayed_including_taxes
267
-            ? $this->ticket->get_ticket_total_with_taxes()
268
-            : $this->ticket->get_ticket_subtotal();
269
-        $ticket_bundle = false;
270
-        $ticket_min = $this->ticket->min();
271
-        // for ticket bundles, set min and max qty the same
272
-        if ($ticket_min !== 0 && $ticket_min === $this->ticket->max()) {
273
-            $ticket_price *= $ticket_min;
274
-            $ticket_bundle = true;
275
-        }
276
-        $ticket_price = apply_filters(
277
-            'FHEE__ticket_selector_chart_template__ticket_price',
278
-            $ticket_price,
279
-            $this->ticket
280
-        );
281
-        return array($ticket_price, $ticket_bundle);
282
-    }
283
-
284
-
285
-
286
-    /**
287
-     * getTicketStatusClasses
288
-     *
289
-     * @param int $remaining
290
-     * @return array
291
-     * @throws \EE_Error
292
-     */
293
-    protected function getTicketStatusClasses($remaining = 0)
294
-    {
295
-        // if a previous required ticket with the same sale start date is sold out,
296
-        // then mark this ticket as sold out as well.
297
-        // tickets that go on sale at a later date than the required ticket  will NOT be affected
298
-        $tkt_status = $this->required_ticket_sold_out !== false
299
-                      && $this->required_ticket_sold_out === $this->ticket->start_date()
300
-            ? \EE_Ticket::sold_out
301
-            : $this->ticket->ticket_status();
302
-        $tkt_status = $this->event_status === \EE_Datetime::sold_out
303
-            ? \EE_Ticket::sold_out
304
-            : $tkt_status;
305
-        // check ticket status
306
-        switch ($tkt_status) {
307
-            // sold_out
308
-            case \EE_Ticket::sold_out :
309
-                $ticket_status = 'ticket-sales-sold-out';
310
-                $status_class = 'ticket-sales-sold-out lt-grey-text';
311
-                break;
312
-            // expired
313
-            case \EE_Ticket::expired :
314
-                $ticket_status = 'ticket-sales-expired';
315
-                $status_class = 'ticket-sales-expired lt-grey-text';
316
-                break;
317
-            // archived
318
-            case \EE_Ticket::archived :
319
-                $ticket_status = 'archived-ticket';
320
-                $status_class = 'archived-ticket hidden';
321
-                break;
322
-            // pending
323
-            case \EE_Ticket::pending :
324
-                $ticket_status = 'ticket-pending';
325
-                $status_class = 'ticket-pending';
326
-                break;
327
-            // onsale
328
-            case \EE_Ticket::onsale :
329
-            default :
330
-                $ticket_status = 'ticket-on-sale';
331
-                $status_class = 'ticket-on-sale';
332
-                break;
333
-        }
334
-        $ticket_status = \EEH_HTML::span($this->ticket->ticket_status(true, ($remaining > 0)), '', $ticket_status);
335
-        return array($tkt_status, $ticket_status, $status_class);
336
-    }
337
-
338
-
339
-
340
-    /**
341
-     * ticketNameTableCell
342
-     *
343
-     * @return string
344
-     * @throws \EE_Error
345
-     */
346
-    protected function ticketNameTableCell()
347
-    {
348
-        $html = \EEH_HTML::td('', '', 'tckt-slctr-tbl-td-name');
349
-        $html .= \EEH_HTML::strong($this->ticket->get_pretty('TKT_name'));
350
-        $html .= $this->ticket_details->getShowHideLinks();
351
-        if ($this->ticket->required()) {
352
-            $html .= \EEH_HTML::p(
353
-                    apply_filters(
354
-                            'FHEE__ticket_selector_chart_template__ticket_required_message',
355
-                            esc_html__('This ticket is required and must be purchased.', 'event_espresso')
356
-                    ),
357
-                    '', 'ticket-required-pg'
358
-            );
359
-        }
360
-        $html .= \EEH_HTML::tdx();
361
-        return $html;
362
-    }
363
-
364
-
365
-
366
-    /**
367
-     * ticketPriceTableCell
368
-     *
369
-     * @param float $ticket_price
370
-     * @param bool  $ticket_bundle
371
-     * @return string
372
-     * @throws \EE_Error
373
-     */
374
-    protected function ticketPriceTableCell($ticket_price, $ticket_bundle)
375
-    {
376
-        $html = '';
377
-        if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) {
378
-            $html .= \EEH_HTML::td('', '', 'tckt-slctr-tbl-td-price jst-rght');
379
-            $html .= \EEH_Template::format_currency($ticket_price);
380
-            $html .= $this->ticket->taxable()
381
-                ? \EEH_HTML::span( '*', '', 'taxable-tickets-asterisk grey-text' )
382
-                : '';
383
-            $html .= ' ';
384
-            $html .= \EEH_HTML::span(
385
-                $ticket_bundle
386
-                    ? apply_filters(
387
-                        'FHEE__ticket_selector_chart_template__per_ticket_bundle_text',
388
-                        __(' / bundle', 'event_espresso')
389
-                    )
390
-                    : apply_filters(
391
-                        'FHEE__ticket_selector_chart_template__per_ticket_text',
392
-                        __('', 'event_espresso')
393
-                    ),
394
-                '', 'smaller-text no-bold'
395
-            );
396
-            $html .= ' ';
397
-            $html .= \EEH_HTML::tdx();
398
-            $this->cols++;
399
-        }
400
-        return $html;
401
-    }
402
-
403
-
404
-
405
-    /**
406
-     * onlyOneAttendeeCanRegister
407
-     *
408
-     * @return string
409
-     */
410
-    protected function onlyOneAttendeeCanRegister()
411
-    {
412
-        // display submit button since we have tickets available
413
-        add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
414
-        $this->hidden_input_qty = false;
415
-        $html = '<input type="radio" name="tkt-slctr-qty-' . $this->EVT_ID . '"';
416
-        $html .= ' id="ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row . '"';
417
-        $html .= ' class="ticket-selector-tbl-qty-slct" value="' . $this->row . '-1"';
418
-        $html .= $this->row === 1 ? ' checked="checked"' : '';
419
-        $html .= ' title=""/>';
420
-        return $html;
421
-    }
422
-
423
-
424
-
425
-    /**
426
-     * ticketQuantitySelector
427
-     *
428
-     * @param int $min
429
-     * @param int $max
430
-     * @return string
431
-     */
432
-    protected function ticketQuantitySelector($min = 0, $max = 0)
433
-    {
434
-        // display submit button since we have tickets available
435
-        add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
436
-        $this->hidden_input_qty = false;
437
-        $html = '<select name="tkt-slctr-qty-' . $this->EVT_ID . '[]"';
438
-        $html .= ' id="ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row . '"';
439
-        $html .= ' class="ticket-selector-tbl-qty-slct">';
440
-        // this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
441
-        if ($min !== 0 && ! $this->ticket->required()) {
442
-            $html .= '<option value="0">&nbsp;0&nbsp;</option>';
443
-        }
444
-        // offer ticket quantities from the min to the max
445
-        for ($i = $min; $i <= $max; $i++) {
446
-            $html .= '<option value="' . $i . '">&nbsp;' . $i . '&nbsp;</option>';
447
-        }
448
-        $html .= '</select>';
449
-        return $html;
450
-    }
451
-
452
-
453
-
454
-    /**
455
-     * getHiddenInputs
456
-     *
457
-     * @return string
458
-     * @throws \EE_Error
459
-     */
460
-    protected function ticketQtyAndIdHiddenInputs()
461
-    {
462
-        $html = '';
463
-        // depending on group reg we need to change the format for qty
464
-        if ($this->hidden_input_qty) {
465
-            $html .= '<input type="hidden" name="tkt-slctr-qty-' . $this->EVT_ID . '[]" value="0"/>';
466
-        }
467
-        $html .= '<input type="hidden" name="tkt-slctr-ticket-id-' . $this->EVT_ID . '[]"';
468
-        $html .= ' value="' . $this->ticket->ID() . '"/>';
469
-        return $html;
470
-    }
19
+	/**
20
+	 * @var TicketDetails $ticket_details
21
+	 */
22
+	protected $ticket_details;
23
+
24
+	/**
25
+	 * @var \EE_Ticket_Selector_Config $template_settings
26
+	 */
27
+	protected $template_settings;
28
+
29
+	/**
30
+	 * @var \EE_Tax_Config $tax_settings
31
+	 */
32
+	protected $tax_settings;
33
+
34
+	/**
35
+	 * @var boolean $required_ticket_sold_out
36
+	 */
37
+	protected $required_ticket_sold_out;
38
+
39
+	/**
40
+	 * @var boolean $prices_displayed_including_taxes
41
+	 */
42
+	protected $prices_displayed_including_taxes;
43
+
44
+	/**
45
+	 * @var string $event_status
46
+	 */
47
+	protected $event_status;
48
+
49
+	/**
50
+	 * @var int $row
51
+	 */
52
+	protected $row;
53
+
54
+	/**
55
+	 * @var int $cols
56
+	 */
57
+	protected $cols;
58
+
59
+	/**
60
+	 * @var boolean $hidden_input_qty
61
+	 */
62
+	protected $hidden_input_qty;
63
+
64
+	/**
65
+	 * @var string $ticket_datetime_classes
66
+	 */
67
+	protected $ticket_datetime_classes;
68
+
69
+
70
+
71
+	/**
72
+	 * TicketDetails constructor.
73
+	 *
74
+	 * @param \EE_Ticket $ticket
75
+	 * @param TicketDetails              $ticket_details
76
+	 * @param \EE_Ticket_Selector_Config $template_settings
77
+	 * @param \EE_Tax_Config             $tax_settings
78
+	 * @param int                        $max_atndz
79
+	 * @param int                        $row
80
+	 * @param int                        $cols
81
+	 * @param boolean                    $required_ticket_sold_out
82
+	 * @param string                     $event_status
83
+	 * @param string                     $date_format
84
+	 * @param string                     $ticket_datetime_classes
85
+	 */
86
+	public function __construct(
87
+		\EE_Ticket $ticket,
88
+		TicketDetails $ticket_details,
89
+		\EE_Ticket_Selector_Config $template_settings,
90
+		\EE_Tax_Config $tax_settings,
91
+		$max_atndz,
92
+		$row,
93
+		$cols,
94
+		$required_ticket_sold_out,
95
+		$event_status,
96
+		$date_format,
97
+		$ticket_datetime_classes
98
+	) {
99
+		$this->ticket = $ticket;
100
+		$this->ticket_details = $ticket_details;
101
+		$this->template_settings = $template_settings;
102
+		$this->tax_settings = $tax_settings;
103
+		$this->max_atndz = $max_atndz;
104
+		$this->row = $row;
105
+		$this->cols = $cols;
106
+		$this->required_ticket_sold_out = $required_ticket_sold_out;
107
+		$this->event_status = $event_status;
108
+		$this->date_format = $date_format;
109
+		$this->ticket_datetime_classes = $ticket_datetime_classes;
110
+		parent::__construct($ticket, $max_atndz, $date_format);
111
+	}
112
+
113
+
114
+
115
+	/**
116
+	 * other ticket rows will need to know if a required ticket is sold out,
117
+	 * so that they are not offered for sale
118
+	 *
119
+	 * @return boolean
120
+	 */
121
+	public function getRequiredTicketSoldOut()
122
+	{
123
+		return $this->required_ticket_sold_out;
124
+	}
125
+
126
+
127
+
128
+	/**
129
+	 * @return int
130
+	 */
131
+	public function getCols()
132
+	{
133
+		return $this->cols;
134
+	}
135
+
136
+
137
+
138
+	/**
139
+	 * getHtml
140
+	 *
141
+	 * @return string
142
+	 * @throws \EE_Error
143
+	 */
144
+	public function getHtml()
145
+	{
146
+		$min = 0;
147
+		$max = $this->ticket->max();
148
+		$remaining = $this->ticket->remaining();
149
+		if ($this->ticket->is_on_sale() && $this->ticket->is_remaining()) {
150
+			list($min, $max) = $this->setTicketMinAndMax($remaining);
151
+		} else {
152
+			// set flag if ticket is required (flag is set to start date so that future tickets are not blocked)
153
+			$this->required_ticket_sold_out = $this->ticket->required() && ! $remaining
154
+				? $this->ticket->start_date()
155
+				: $this->required_ticket_sold_out;
156
+		}
157
+		list($ticket_price, $ticket_bundle) = $this->getTicketPriceDetails();
158
+		list($tkt_status, $ticket_status, $status_class) = $this->getTicketStatusClasses($remaining);
159
+		/**
160
+		 * Allow plugins to hook in and abort the generation and display of this row to do
161
+		 * something else if they want.
162
+		 * For an addon to abort things, all they have to do is register a filter with this hook, and
163
+		 * return a value that is NOT false.  Whatever is returned gets echoed instead of the
164
+		 * current row.
165
+		 *
166
+		 * @var string|bool
167
+		 */
168
+		$ticket_selector_row_html = apply_filters(
169
+			'FHEE__ticket_selector_chart_template__do_ticket_entire_row',
170
+			false,
171
+			$this->ticket,
172
+			$max,
173
+			$min,
174
+			$this->required_ticket_sold_out,
175
+			$ticket_price,
176
+			$ticket_bundle,
177
+			$ticket_status,
178
+			$status_class
179
+		);
180
+		if ($ticket_selector_row_html !== false) {
181
+			return $ticket_selector_row_html;
182
+		}
183
+		$ticket_selector_row_html = \EEH_HTML::tr(
184
+			'', '',
185
+			"tckt-slctr-tbl-tr {$status_class}{$this->ticket_datetime_classes} " . espresso_get_object_css_class($this->ticket)
186
+		);
187
+		/**
188
+		 * Allow plugins to hook in and abort the generation and display of the contents of this
189
+		 * row to do something else if they want.
190
+		 * For an addon to abort things, all they have to do is register a filter with this hook, and
191
+		 * return a value that is NOT false.  Whatever is returned gets echoed instead of the
192
+		 * current row.
193
+		 *
194
+		 * @var string|bool
195
+		 */
196
+		$new_row_cells_content = apply_filters(
197
+			'FHEE__ticket_selector_chart_template__do_ticket_inside_row',
198
+			false,
199
+			$this->ticket,
200
+			$max,
201
+			$min,
202
+			$this->required_ticket_sold_out,
203
+			$ticket_price,
204
+			$ticket_bundle,
205
+			$ticket_status,
206
+			$status_class
207
+		);
208
+		if ($new_row_cells_content !== false) {
209
+			return $ticket_selector_row_html . $new_row_cells_content . \EEH_HTML::trx();
210
+		}
211
+		$this->hidden_input_qty = $this->max_atndz > 1 ? true : false;
212
+
213
+		$ticket_selector_row_html .= $this->ticketNameTableCell();
214
+		$ticket_selector_row_html .= $this->ticketPriceTableCell($ticket_price, $ticket_bundle);
215
+		$ticket_selector_row_html .= \EEH_HTML::td('', '', 'tckt-slctr-tbl-td-qty cntr');
216
+		$this->setTicketStatusDisplay($tkt_status, $ticket_status, $remaining);
217
+		if (empty($this->ticket_status_display)) {
218
+			if ($this->max_atndz === 1) {
219
+				// only ONE attendee is allowed to register at a time
220
+				$ticket_selector_row_html .= $this->onlyOneAttendeeCanRegister();
221
+			} else if ($max > 0) {
222
+				$ticket_selector_row_html .= $this->ticketQuantitySelector($min, $max);
223
+			}
224
+		}
225
+		$ticket_selector_row_html .= $this->ticket_status_display;
226
+		$ticket_selector_row_html .= $this->ticketQtyAndIdHiddenInputs();
227
+		$ticket_selector_row_html .= $this->ticket_details->display($ticket_price, $remaining, $this->cols);
228
+		$ticket_selector_row_html .= \EEH_HTML::tdx();
229
+		$ticket_selector_row_html .= \EEH_HTML::trx();
230
+
231
+
232
+		$this->row++;
233
+		return $ticket_selector_row_html;
234
+	}
235
+
236
+
237
+
238
+	/**
239
+	 * setTicketMinAndMax
240
+	 *
241
+	 * @param int $remaining
242
+	 * @return array
243
+	 */
244
+	protected function setTicketMinAndMax($remaining)
245
+	{
246
+		// offer the number of $tickets_remaining or $this->max_atndz, whichever is smaller
247
+		$max = min($remaining, $this->max_atndz);
248
+		// but... we also want to restrict the number of tickets by the ticket max setting,
249
+		// however, the max still can't be higher than what was just set above
250
+		$max = $this->ticket->max() > 0 ? min($this->ticket->max(), $max) : $max;
251
+		// and we also want to restrict the minimum number of tickets by the ticket min setting
252
+		$min = $this->ticket->min() > 0 ? $this->ticket->min() : 0;
253
+		// and if the ticket is required, then make sure that min qty is at least 1
254
+		$min = $this->ticket->required() ? max($min, 1) : $min;
255
+		return array($min, $max);
256
+	}
257
+
258
+
259
+	/**
260
+	 * getTicketPriceDetails
261
+	 *
262
+	 * @return array
263
+	 */
264
+	protected function getTicketPriceDetails()
265
+	{
266
+		$ticket_price = $this->tax_settings->prices_displayed_including_taxes
267
+			? $this->ticket->get_ticket_total_with_taxes()
268
+			: $this->ticket->get_ticket_subtotal();
269
+		$ticket_bundle = false;
270
+		$ticket_min = $this->ticket->min();
271
+		// for ticket bundles, set min and max qty the same
272
+		if ($ticket_min !== 0 && $ticket_min === $this->ticket->max()) {
273
+			$ticket_price *= $ticket_min;
274
+			$ticket_bundle = true;
275
+		}
276
+		$ticket_price = apply_filters(
277
+			'FHEE__ticket_selector_chart_template__ticket_price',
278
+			$ticket_price,
279
+			$this->ticket
280
+		);
281
+		return array($ticket_price, $ticket_bundle);
282
+	}
283
+
284
+
285
+
286
+	/**
287
+	 * getTicketStatusClasses
288
+	 *
289
+	 * @param int $remaining
290
+	 * @return array
291
+	 * @throws \EE_Error
292
+	 */
293
+	protected function getTicketStatusClasses($remaining = 0)
294
+	{
295
+		// if a previous required ticket with the same sale start date is sold out,
296
+		// then mark this ticket as sold out as well.
297
+		// tickets that go on sale at a later date than the required ticket  will NOT be affected
298
+		$tkt_status = $this->required_ticket_sold_out !== false
299
+					  && $this->required_ticket_sold_out === $this->ticket->start_date()
300
+			? \EE_Ticket::sold_out
301
+			: $this->ticket->ticket_status();
302
+		$tkt_status = $this->event_status === \EE_Datetime::sold_out
303
+			? \EE_Ticket::sold_out
304
+			: $tkt_status;
305
+		// check ticket status
306
+		switch ($tkt_status) {
307
+			// sold_out
308
+			case \EE_Ticket::sold_out :
309
+				$ticket_status = 'ticket-sales-sold-out';
310
+				$status_class = 'ticket-sales-sold-out lt-grey-text';
311
+				break;
312
+			// expired
313
+			case \EE_Ticket::expired :
314
+				$ticket_status = 'ticket-sales-expired';
315
+				$status_class = 'ticket-sales-expired lt-grey-text';
316
+				break;
317
+			// archived
318
+			case \EE_Ticket::archived :
319
+				$ticket_status = 'archived-ticket';
320
+				$status_class = 'archived-ticket hidden';
321
+				break;
322
+			// pending
323
+			case \EE_Ticket::pending :
324
+				$ticket_status = 'ticket-pending';
325
+				$status_class = 'ticket-pending';
326
+				break;
327
+			// onsale
328
+			case \EE_Ticket::onsale :
329
+			default :
330
+				$ticket_status = 'ticket-on-sale';
331
+				$status_class = 'ticket-on-sale';
332
+				break;
333
+		}
334
+		$ticket_status = \EEH_HTML::span($this->ticket->ticket_status(true, ($remaining > 0)), '', $ticket_status);
335
+		return array($tkt_status, $ticket_status, $status_class);
336
+	}
337
+
338
+
339
+
340
+	/**
341
+	 * ticketNameTableCell
342
+	 *
343
+	 * @return string
344
+	 * @throws \EE_Error
345
+	 */
346
+	protected function ticketNameTableCell()
347
+	{
348
+		$html = \EEH_HTML::td('', '', 'tckt-slctr-tbl-td-name');
349
+		$html .= \EEH_HTML::strong($this->ticket->get_pretty('TKT_name'));
350
+		$html .= $this->ticket_details->getShowHideLinks();
351
+		if ($this->ticket->required()) {
352
+			$html .= \EEH_HTML::p(
353
+					apply_filters(
354
+							'FHEE__ticket_selector_chart_template__ticket_required_message',
355
+							esc_html__('This ticket is required and must be purchased.', 'event_espresso')
356
+					),
357
+					'', 'ticket-required-pg'
358
+			);
359
+		}
360
+		$html .= \EEH_HTML::tdx();
361
+		return $html;
362
+	}
363
+
364
+
365
+
366
+	/**
367
+	 * ticketPriceTableCell
368
+	 *
369
+	 * @param float $ticket_price
370
+	 * @param bool  $ticket_bundle
371
+	 * @return string
372
+	 * @throws \EE_Error
373
+	 */
374
+	protected function ticketPriceTableCell($ticket_price, $ticket_bundle)
375
+	{
376
+		$html = '';
377
+		if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) {
378
+			$html .= \EEH_HTML::td('', '', 'tckt-slctr-tbl-td-price jst-rght');
379
+			$html .= \EEH_Template::format_currency($ticket_price);
380
+			$html .= $this->ticket->taxable()
381
+				? \EEH_HTML::span( '*', '', 'taxable-tickets-asterisk grey-text' )
382
+				: '';
383
+			$html .= '&nbsp;';
384
+			$html .= \EEH_HTML::span(
385
+				$ticket_bundle
386
+					? apply_filters(
387
+						'FHEE__ticket_selector_chart_template__per_ticket_bundle_text',
388
+						__(' / bundle', 'event_espresso')
389
+					)
390
+					: apply_filters(
391
+						'FHEE__ticket_selector_chart_template__per_ticket_text',
392
+						__('', 'event_espresso')
393
+					),
394
+				'', 'smaller-text no-bold'
395
+			);
396
+			$html .= '&nbsp;';
397
+			$html .= \EEH_HTML::tdx();
398
+			$this->cols++;
399
+		}
400
+		return $html;
401
+	}
402
+
403
+
404
+
405
+	/**
406
+	 * onlyOneAttendeeCanRegister
407
+	 *
408
+	 * @return string
409
+	 */
410
+	protected function onlyOneAttendeeCanRegister()
411
+	{
412
+		// display submit button since we have tickets available
413
+		add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
414
+		$this->hidden_input_qty = false;
415
+		$html = '<input type="radio" name="tkt-slctr-qty-' . $this->EVT_ID . '"';
416
+		$html .= ' id="ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row . '"';
417
+		$html .= ' class="ticket-selector-tbl-qty-slct" value="' . $this->row . '-1"';
418
+		$html .= $this->row === 1 ? ' checked="checked"' : '';
419
+		$html .= ' title=""/>';
420
+		return $html;
421
+	}
422
+
423
+
424
+
425
+	/**
426
+	 * ticketQuantitySelector
427
+	 *
428
+	 * @param int $min
429
+	 * @param int $max
430
+	 * @return string
431
+	 */
432
+	protected function ticketQuantitySelector($min = 0, $max = 0)
433
+	{
434
+		// display submit button since we have tickets available
435
+		add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
436
+		$this->hidden_input_qty = false;
437
+		$html = '<select name="tkt-slctr-qty-' . $this->EVT_ID . '[]"';
438
+		$html .= ' id="ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row . '"';
439
+		$html .= ' class="ticket-selector-tbl-qty-slct">';
440
+		// this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
441
+		if ($min !== 0 && ! $this->ticket->required()) {
442
+			$html .= '<option value="0">&nbsp;0&nbsp;</option>';
443
+		}
444
+		// offer ticket quantities from the min to the max
445
+		for ($i = $min; $i <= $max; $i++) {
446
+			$html .= '<option value="' . $i . '">&nbsp;' . $i . '&nbsp;</option>';
447
+		}
448
+		$html .= '</select>';
449
+		return $html;
450
+	}
451
+
452
+
453
+
454
+	/**
455
+	 * getHiddenInputs
456
+	 *
457
+	 * @return string
458
+	 * @throws \EE_Error
459
+	 */
460
+	protected function ticketQtyAndIdHiddenInputs()
461
+	{
462
+		$html = '';
463
+		// depending on group reg we need to change the format for qty
464
+		if ($this->hidden_input_qty) {
465
+			$html .= '<input type="hidden" name="tkt-slctr-qty-' . $this->EVT_ID . '[]" value="0"/>';
466
+		}
467
+		$html .= '<input type="hidden" name="tkt-slctr-ticket-id-' . $this->EVT_ID . '[]"';
468
+		$html .= ' value="' . $this->ticket->ID() . '"/>';
469
+		return $html;
470
+	}
471 471
 
472 472
 }
473 473
 // End of file TicketSelectorRowStandard.php
Please login to merge, or discard this patch.
modules/ticket_selector/templates/ticket_details.template.php 2 patches
Indentation   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
                                     </td>
54 54
                                 </tr>
55 55
                                 <?php
56
-                                $running_total = $ticket->base_price()->amount();
57
-                            } else {
58
-                                $running_total = 0;
59
-                            }
60
-                            // now add price modifiers
61
-                            foreach ( $ticket->price_modifiers() as $price_mod ) { ?>
56
+								$running_total = $ticket->base_price()->amount();
57
+							} else {
58
+								$running_total = 0;
59
+							}
60
+							// now add price modifiers
61
+							foreach ( $ticket->price_modifiers() as $price_mod ) { ?>
62 62
                                 <tr>
63 63
                                     <td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="jst-rght small-text">
64 64
                                         <?php echo $price_mod->name(); ?>
@@ -68,19 +68,19 @@  discard block
 block discarded – undo
68 68
                                             <?php echo $price_mod->desc(); ?> <?php echo $price_mod->amount(); ?>%
69 69
                                         </td>
70 70
                                         <?php
71
-                                        $new_sub_total = $running_total * ( $price_mod->amount() / 100 );
72
-                                        $new_sub_total = $price_mod->is_discount()
73
-                                            ? $new_sub_total * -1
74
-                                            : $new_sub_total;
75
-                                        ?>
71
+										$new_sub_total = $running_total * ( $price_mod->amount() / 100 );
72
+										$new_sub_total = $price_mod->is_discount()
73
+											? $new_sub_total * -1
74
+											: $new_sub_total;
75
+										?>
76 76
                                     <?php } else { ?>
77 77
                                         <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>"
78 78
                                             class="small-text"><?php echo $price_mod->desc(); ?></td>
79 79
                                         <?php
80
-                                            $new_sub_total = $price_mod->is_discount()
81
-                                                ? $price_mod->amount() * -1
82
-                                                : $price_mod->amount();
83
-                                        ?>
80
+											$new_sub_total = $price_mod->is_discount()
81
+												? $price_mod->amount() * -1
82
+												: $price_mod->amount();
83
+										?>
84 84
                                     <?php } ?>
85 85
                                     <td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text">
86 86
                                         <?php echo EEH_Template::format_currency($new_sub_total); ?>
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
                                     <?php $tax_amount = $running_total * ( $tax->amount() / 100 ); ?>
109 109
                                     <td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>"
110 110
                                         class="jst-rght small-text"><?php echo EEH_Template::format_currency(
111
-                                        $tax_amount
112
-                                        ); ?></td>
111
+										$tax_amount
112
+										); ?></td>
113 113
                                     <?php $running_total += $tax_amount; ?>
114 114
                                 </tr>
115 115
                             <?php } ?>
@@ -117,15 +117,15 @@  discard block
 block discarded – undo
117 117
                                 <tr>
118 118
                                     <td colspan="2" class="jst-rght small-text ttl-lbl-td">
119 119
                                         <b><?php echo apply_filters(
120
-                                            'FHEE__ticket_selector_chart_template__ticket_details_total_price',
121
-                                            __( 'Total', 'event_espresso' )
122
-                                            ); ?></b></td>
120
+											'FHEE__ticket_selector_chart_template__ticket_details_total_price',
121
+											__( 'Total', 'event_espresso' )
122
+											); ?></b></td>
123 123
                                     <td data-th="<?php echo apply_filters(
124
-                                    'FHEE__ticket_selector_chart_template__ticket_details_total_price',
125
-                                    __( 'Total', 'event_espresso' )
126
-                                    ); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency(
127
-                                            $running_total
128
-                                            ); ?></b></td>
124
+									'FHEE__ticket_selector_chart_template__ticket_details_total_price',
125
+									__( 'Total', 'event_espresso' )
126
+									); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency(
127
+											$running_total
128
+											); ?></b></td>
129 129
                                 </tr>
130 130
                             </tbody>
131 131
                         </table>
@@ -136,28 +136,28 @@  discard block
 block discarded – undo
136 136
 
137 137
                 <section class="tckt-slctr-tkt-sale-dates-sctn">
138 138
                     <h5><?php echo apply_filters(
139
-                        'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading',
140
-                        __( 'Sale Dates', 'event_espresso' )
141
-                        ); ?>
139
+						'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading',
140
+						__( 'Sale Dates', 'event_espresso' )
141
+						); ?>
142 142
                     </h5>
143 143
                     <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
144
-                        'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message',
145
-                        __( 'The dates when this option is available for purchase.', 'event_espresso' )
146
-                        ); ?></span>
144
+						'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message',
145
+						__( 'The dates when this option is available for purchase.', 'event_espresso' )
146
+						); ?></span>
147 147
                     <br/>
148 148
                     <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
149
-                        'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale',
150
-                        __( 'Goes On Sale:', 'event_espresso' )
151
-                        ); ?></span>
149
+						'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale',
150
+						__( 'Goes On Sale:', 'event_espresso' )
151
+						); ?></span>
152 152
                     <span class="dashicons dashicons-calendar"></span>
153 153
                     <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format) . ' &nbsp; '; ?>
154 154
                     <span  class="dashicons dashicons-clock"></span>
155 155
                     <?php echo $ticket->get_i18n_datetime('TKT_start_date',$time_format); ?>
156 156
                     <br/>
157 157
                     <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
158
-                        'FHEE__ticket_selector_chart_template__ticket_details_sales_end',
159
-                        __( 'Sales End:', 'event_espresso' )
160
-                        ); ?></span>
158
+						'FHEE__ticket_selector_chart_template__ticket_details_sales_end',
159
+						__( 'Sales End:', 'event_espresso' )
160
+						); ?></span>
161 161
                     <span class="dashicons dashicons-calendar"></span>
162 162
                     <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format) . ' &nbsp; '; ?>
163 163
                     <span class="dashicons dashicons-clock"></span>
@@ -171,34 +171,34 @@  discard block
 block discarded – undo
171 171
                 <?php if ( $ticket->min() && $ticket->max() ) { ?>
172 172
                     <section class="tckt-slctr-tkt-quantities-sctn">
173 173
                         <h5><?php echo apply_filters(
174
-                            'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading',
175
-                            __( 'Purchasable Quantities', 'event_espresso' )
176
-                            ); ?></h5>
174
+							'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading',
175
+							__( 'Purchasable Quantities', 'event_espresso' )
176
+							); ?></h5>
177 177
                         <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
178
-                            'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message',
179
-                            __(
180
-                            'The number of tickets that can be purchased per transaction (if available).',
181
-                            'event_espresso'
182
-                            )
183
-                            ); ?></span><br/>
178
+							'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message',
179
+							__(
180
+							'The number of tickets that can be purchased per transaction (if available).',
181
+							'event_espresso'
182
+							)
183
+							); ?></span><br/>
184 184
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
185
-                            'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty',
186
-                            __( 'Minimum Qty:', 'event_espresso' )
187
-                            ); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?>
185
+							'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty',
186
+							__( 'Minimum Qty:', 'event_espresso' )
187
+							); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?>
188 188
                         <?php if ( $ticket->min() > $remaining ) { ?> &nbsp; <span
189 189
                         class="important-notice small-text"><?php echo apply_filters(
190
-                        'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message',
191
-                        __(
192
-                        'The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining',
193
-                        'event_espresso'
194
-                        )
195
-                        ); ?></span><?php } ?><br/>
190
+						'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message',
191
+						__(
192
+						'The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining',
193
+						'event_espresso'
194
+						)
195
+						); ?></span><?php } ?><br/>
196 196
                         <?php //$max = min( $max, $max_atndz );?>
197 197
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
198
-                            'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty',
199
-                            __( 'Maximum Qty:', 'event_espresso' )
200
-                            ); ?></span><?php echo $ticket->max() === EE_INF ? __( 'no limit', 'event_espresso' )
201
-                        : max( $ticket->max(), 1 ); ?><br/>
198
+							'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty',
199
+							__( 'Maximum Qty:', 'event_espresso' )
200
+							); ?></span><?php echo $ticket->max() === EE_INF ? __( 'no limit', 'event_espresso' )
201
+						: max( $ticket->max(), 1 ); ?><br/>
202 202
                     </section>
203 203
                     <br/>
204 204
                 <?php } ?>
@@ -206,43 +206,43 @@  discard block
 block discarded – undo
206 206
                 <?php if ( ( ! defined( 'EE_DECAF' ) || EE_DECAF !== true ) && $ticket->uses() !== EE_INF ) { ?>
207 207
                     <section class="tckt-slctr-tkt-uses-sctn">
208 208
                         <h5><?php echo apply_filters(
209
-                                'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading',
210
-                                __( 'Event Date Ticket Uses', 'event_espresso' )
211
-                            ); ?></h5>
209
+								'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading',
210
+								__( 'Event Date Ticket Uses', 'event_espresso' )
211
+							); ?></h5>
212 212
                         <span class="drk-grey-text small-text no-bold"> - <?php
213
-                            echo apply_filters(
214
-                            'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_message',
215
-                            sprintf(
216
-                                __(
217
-                                    'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s',
218
-                                    'event_espresso'
219
-                                ),
220
-                                '<br/>',
221
-                                '<strong>',
222
-                                '</strong>'
223
-                                )
224
-                            );
225
-                            ?></span><br/>
213
+							echo apply_filters(
214
+							'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_message',
215
+							sprintf(
216
+								__(
217
+									'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s',
218
+									'event_espresso'
219
+								),
220
+								'<br/>',
221
+								'<strong>',
222
+								'</strong>'
223
+								)
224
+							);
225
+							?></span><br/>
226 226
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
227
-                            'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes',
228
-                            __( '# Datetimes:', 'event_espresso' )
229
-                            ); ?></span><?php echo $ticket->uses(); ?><br/>
227
+							'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes',
228
+							__( '# Datetimes:', 'event_espresso' )
229
+							); ?></span><?php echo $ticket->uses(); ?><br/>
230 230
                     </section>
231 231
                 <?php } ?>
232 232
 
233 233
                 <?php
234
-                $datetimes = $ticket->datetimes_ordered( $event_is_expired, false );
235
-                $chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width';
236
-                if ( ! empty( $datetimes ) ) { ?>
234
+				$datetimes = $ticket->datetimes_ordered( $event_is_expired, false );
235
+				$chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width';
236
+				if ( ! empty( $datetimes ) ) { ?>
237 237
                     <section class="tckt-slctr-tkt-datetimes-sctn">
238 238
                         <h5><?php echo apply_filters(
239
-                            'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading',
240
-                            __( 'Access', 'event_espresso' )
241
-                            ); ?></h5>
239
+							'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading',
240
+							__( 'Access', 'event_espresso' )
241
+							); ?></h5>
242 242
                         <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
243
-                            'FHEE__ticket_selector_chart_template__ticket_details_event_access_message',
244
-                            __( 'This option allows access to the following dates and times.', 'event_espresso' )
245
-                            ); ?></span>
243
+							'FHEE__ticket_selector_chart_template__ticket_details_event_access_message',
244
+							__( 'This option allows access to the following dates and times.', 'event_espresso' )
245
+							); ?></span>
246 246
                         <div class="tckt-slctr-tkt-details-tbl-wrap-dv">
247 247
                             <table class="tckt-slctr-tkt-details-tbl">
248 248
                                 <thead>
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
                                     <th class="tckt-slctr-tkt-details-date-th">
251 251
                                         <span class="dashicons dashicons-calendar"></span><span
252 252
                                         class="small-text"><?php echo apply_filters(
253
-                                            'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
254
-                                            __( 'Date ', 'event_espresso' )
255
-                                            ); ?></span>
253
+											'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
254
+											__( 'Date ', 'event_espresso' )
255
+											); ?></span>
256 256
                                     </th>
257 257
                                     <th class="tckt-slctr-tkt-details-time-th <?php echo $chart_column_width; ?>">
258 258
                                         <span class="dashicons dashicons-clock"></span><span
@@ -261,98 +261,98 @@  discard block
 block discarded – undo
261 261
                                     <?php if ( $show_ticket_sale_columns ) : ?>
262 262
                                         <th class="tckt-slctr-tkt-details-this-ticket-sold-th ee-fourth-width cntr">
263 263
                                             <span class="smaller-text"><?php echo apply_filters(
264
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
265
-                                                sprintf( __( 'Sold', 'event_espresso' ), '<br/>' )
266
-                                                ); ?></span>
264
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
265
+												sprintf( __( 'Sold', 'event_espresso' ), '<br/>' )
266
+												); ?></span>
267 267
                                         </th>
268 268
                                         <th class="tckt-slctr-tkt-details-this-ticket-left-th ee-fourth-width cntr">
269 269
                                             <span class="smaller-text"><?php echo apply_filters(
270
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
271
-                                                sprintf( __( 'Remaining', 'event_espresso' ), '<br/>' )
272
-                                                ); ?></span>
270
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
271
+												sprintf( __( 'Remaining', 'event_espresso' ), '<br/>' )
272
+												); ?></span>
273 273
                                         </th>
274 274
                                         <th
275 275
                                         class="tckt-slctr-tkt-details-total-tickets-sold-th ee-fourth-width cntr">
276 276
                                             <span class="smaller-text"><?php echo apply_filters(
277
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
278
-                                                sprintf( __( 'Total%sSold', 'event_espresso' ), '<br/>' )
279
-                                                ); ?></span>
277
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
278
+												sprintf( __( 'Total%sSold', 'event_espresso' ), '<br/>' )
279
+												); ?></span>
280 280
                                         </th>
281 281
                                         <th
282 282
                                         class="tckt-slctr-tkt-details-total-tickets-left-th ee-fourth-width cntr">
283 283
                                             <span class="smaller-text"><?php echo apply_filters(
284
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
285
-                                                sprintf( __( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' )
286
-                                                ); ?></span>
284
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
285
+												sprintf( __( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' )
286
+												); ?></span>
287 287
                                         </th>
288 288
                                     <?php endif; //end $show_ticket_sale_columns conditional ?>
289 289
                                 </tr>
290 290
                                 </thead>
291 291
                                 <tbody>
292 292
                                 <?php
293
-                                foreach ( $datetimes as $datetime ) {
294
-                                    if ( $datetime instanceof EE_Datetime ) {
295
-                                        ?>
293
+								foreach ( $datetimes as $datetime ) {
294
+									if ( $datetime instanceof EE_Datetime ) {
295
+										?>
296 296
 
297 297
                                         <tr>
298 298
                                             <td data-th="<?php echo apply_filters(
299
-                                            'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
300
-                                            __( 'Event Date ', 'event_espresso' )
301
-                                            ); ?>" class="small-text">
299
+											'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
300
+											__( 'Event Date ', 'event_espresso' )
301
+											); ?>" class="small-text">
302 302
                                                 <?php $datetime_name = $datetime->name(); ?>
303 303
                                                 <?php echo ! empty( $datetime_name ) ? '<b>'
304
-                                                                                       . $datetime_name
305
-                                                                                       . '</b><br/>' : ''; ?>
304
+																					   . $datetime_name
305
+																					   . '</b><br/>' : ''; ?>
306 306
                                                 <?php echo $datetime->date_range(
307
-                                                $date_format,
308
-                                                __( ' to  ', 'event_espresso' )
309
-                                                ); ?>
307
+												$date_format,
308
+												__( ' to  ', 'event_espresso' )
309
+												); ?>
310 310
                                             </td>
311 311
                                             <td data-th="<?php _e( 'Time ', 'event_espresso' ); ?>"
312 312
                                                 class="cntr small-text">
313 313
                                                 <?php echo $datetime->time_range(
314
-                                                $time_format,
315
-                                                __( ' to  ', 'event_espresso' )
316
-                                                ); ?>
314
+												$time_format,
315
+												__( ' to  ', 'event_espresso' )
316
+												); ?>
317 317
                                             </td>
318 318
                                             <?php if ( $show_ticket_sale_columns ) : ?>
319 319
                                                 <td data-th="<?php echo apply_filters(
320
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
321
-                                                __( 'Sold', 'event_espresso' )
322
-                                                ); ?>" class="cntr small-text">
320
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
321
+												__( 'Sold', 'event_espresso' )
322
+												); ?>" class="cntr small-text">
323 323
                                                     <?php echo $ticket->sold(); ?>
324 324
                                                 </td>
325 325
                                                 <td data-th="<?php echo apply_filters(
326
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
327
-                                                __( 'Remaining', 'event_espresso' )
328
-                                                ); ?>" class="cntr small-text">
326
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
327
+												__( 'Remaining', 'event_espresso' )
328
+												); ?>" class="cntr small-text">
329 329
                                                     <?php echo $remaining === EE_INF
330
-                                                    ? '<span class="smaller-text">' . __(
331
-                                                    'unlimited ',
332
-                                                    'event_espresso'
333
-                                                    ) . '</span>' : $remaining; ?>
330
+													? '<span class="smaller-text">' . __(
331
+													'unlimited ',
332
+													'event_espresso'
333
+													) . '</span>' : $remaining; ?>
334 334
                                                 </td>
335 335
                                                 <td data-th="<?php echo apply_filters(
336
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
337
-                                                __( 'Total Sold', 'event_espresso' )
338
-                                                ); ?>" class="cntr small-text">
336
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
337
+												__( 'Total Sold', 'event_espresso' )
338
+												); ?>" class="cntr small-text">
339 339
                                                     <?php echo $datetime->sold(); ?>
340 340
                                                 </td>
341 341
                                                 <?php $tkts_left = $datetime->sold_out()
342
-                                                ? '<span class="sold-out smaller-text">' . __(
343
-                                                'Sold&nbsp;Out',
344
-                                                'event_espresso'
345
-                                                ) . '</span>' : $datetime->spaces_remaining(); ?>
342
+												? '<span class="sold-out smaller-text">' . __(
343
+												'Sold&nbsp;Out',
344
+												'event_espresso'
345
+												) . '</span>' : $datetime->spaces_remaining(); ?>
346 346
                                                 <td data-th="<?php echo apply_filters(
347
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
348
-                                                __( 'Total Spaces Left', 'event_espresso' )
349
-                                                ); ?>" class="cntr small-text">
347
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
348
+												__( 'Total Spaces Left', 'event_espresso' )
349
+												); ?>" class="cntr small-text">
350 350
                                                     <?php echo $tkts_left === EE_INF ? '<span class="smaller-text">'
351
-                                                                                       . __(
352
-                                                                                       'unlimited ',
353
-                                                                                       'event_espresso'
354
-                                                                                       )
355
-                                                                                       . '</span>' : $tkts_left; ?>
351
+																					   . __(
352
+																					   'unlimited ',
353
+																					   'event_espresso'
354
+																					   )
355
+																					   . '</span>' : $tkts_left; ?>
356 356
                                                 </td>
357 357
                                             <?php endif; //end $show_ticket_sale_columns conditional ?>
358 358
                                         </tr>
Please login to merge, or discard this patch.
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -12,16 +12,16 @@  discard block
 block discarded – undo
12 12
 /** @var string $price_breakdown_heading */
13 13
 /** @var \EventEspresso\modules\ticket_selector\TicketDetails $ticket_details */
14 14
 ?>
15
-<?php if ( $show_ticket_details ) : ?>
15
+<?php if ($show_ticket_details) : ?>
16 16
 <tr class="tckt-slctr-tkt-details-tr <?php echo $ticket_details_row_class; ?>">
17 17
     <td class="tckt-slctr-tkt-details-td" colspan="<?php echo $cols; ?>">
18 18
         <div id="<?php echo $ticket_details_css_id; ?>-dv" class="tckt-slctr-tkt-details-dv" style="display: none;">
19 19
 
20 20
             <section class="tckt-slctr-tkt-details-sctn">
21
-                <h3><?php echo esc_html__( 'Details', 'event_espresso' ); ?></h3>
21
+                <h3><?php echo esc_html__('Details', 'event_espresso'); ?></h3>
22 22
                 <p><?php echo $ticket->description(); ?></p>
23 23
 
24
-            <?php if ( $display_ticket_price ) { ?>
24
+            <?php if ($display_ticket_price) { ?>
25 25
                 <section class="tckt-slctr-tkt-price-sctn">
26 26
                     <h5><?php echo $price_breakdown_heading; ?></h5>
27 27
                     <div class="tckt-slctr-tkt-details-tbl-wrap-dv">
@@ -40,15 +40,15 @@  discard block
 block discarded – undo
40 40
                                 </tr>
41 41
                             </thead>
42 42
                             <tbody>
43
-                            <?php if ( $ticket->base_price() instanceof EE_Price ) { ?>
43
+                            <?php if ($ticket->base_price() instanceof EE_Price) { ?>
44 44
                                 <tr>
45
-                                    <td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="small-text">
45
+                                    <td data-th="<?php _e('Name', 'event_espresso'); ?>" class="small-text">
46 46
                                         <b><?php echo $ticket->base_price()->name(); ?></b>
47 47
                                     </td>
48
-                                    <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>"
48
+                                    <td data-th="<?php _e('Description', 'event_espresso'); ?>"
49 49
                                         class="small-text"><?php echo $ticket->base_price()->desc(); ?>
50 50
                                     </td>
51
-                                    <td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text">
51
+                                    <td data-th="<?php _e('Amount', 'event_espresso'); ?>" class="jst-rght small-text">
52 52
                                         <?php echo $ticket->base_price()->pretty_price(); ?>
53 53
                                     </td>
54 54
                                 </tr>
@@ -58,23 +58,23 @@  discard block
 block discarded – undo
58 58
                                 $running_total = 0;
59 59
                             }
60 60
                             // now add price modifiers
61
-                            foreach ( $ticket->price_modifiers() as $price_mod ) { ?>
61
+                            foreach ($ticket->price_modifiers() as $price_mod) { ?>
62 62
                                 <tr>
63
-                                    <td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="jst-rght small-text">
63
+                                    <td data-th="<?php _e('Name', 'event_espresso'); ?>" class="jst-rght small-text">
64 64
                                         <?php echo $price_mod->name(); ?>
65 65
                                     </td>
66
-                                    <?php if ( $price_mod->is_percent() ) { ?>
67
-                                        <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="small-text">
66
+                                    <?php if ($price_mod->is_percent()) { ?>
67
+                                        <td data-th="<?php _e('Description', 'event_espresso'); ?>" class="small-text">
68 68
                                             <?php echo $price_mod->desc(); ?> <?php echo $price_mod->amount(); ?>%
69 69
                                         </td>
70 70
                                         <?php
71
-                                        $new_sub_total = $running_total * ( $price_mod->amount() / 100 );
71
+                                        $new_sub_total = $running_total * ($price_mod->amount() / 100);
72 72
                                         $new_sub_total = $price_mod->is_discount()
73 73
                                             ? $new_sub_total * -1
74 74
                                             : $new_sub_total;
75 75
                                         ?>
76 76
                                     <?php } else { ?>
77
-                                        <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>"
77
+                                        <td data-th="<?php _e('Description', 'event_espresso'); ?>"
78 78
                                             class="small-text"><?php echo $price_mod->desc(); ?></td>
79 79
                                         <?php
80 80
                                             $new_sub_total = $price_mod->is_discount()
@@ -82,31 +82,31 @@  discard block
 block discarded – undo
82 82
                                                 : $price_mod->amount();
83 83
                                         ?>
84 84
                                     <?php } ?>
85
-                                    <td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text">
85
+                                    <td data-th="<?php _e('Amount', 'event_espresso'); ?>" class="jst-rght small-text">
86 86
                                         <?php echo EEH_Template::format_currency($new_sub_total); ?>
87 87
                                     </td>
88 88
                                     <?php $running_total += $new_sub_total; ?>
89 89
                                 </tr>
90 90
                             <?php } ?>
91
-                            <?php if ( $ticket->taxable() ) { ?>
91
+                            <?php if ($ticket->taxable()) { ?>
92 92
                                 <tr>
93 93
                                     <td colspan="2" class="jst-rght small-text sbttl">
94 94
                                         <b><?php _e('subtotal', 'event_espresso'); ?></b>
95 95
                                     </td>
96
-                                    <td data-th="<?php _e( 'subtotal', 'event_espresso' ); ?>" class="jst-rght small-text">
96
+                                    <td data-th="<?php _e('subtotal', 'event_espresso'); ?>" class="jst-rght small-text">
97 97
                                         <b><?php echo EEH_Template::format_currency($running_total); ?></b>
98 98
                                     </td>
99 99
                                 </tr>
100 100
 
101
-                            <?php foreach ( $ticket->get_ticket_taxes_for_admin() as $tax ) { ?>
101
+                            <?php foreach ($ticket->get_ticket_taxes_for_admin() as $tax) { ?>
102 102
                                 <tr>
103
-                                    <td data-th="<?php _e( 'Name', 'event_espresso' ); ?>"
103
+                                    <td data-th="<?php _e('Name', 'event_espresso'); ?>"
104 104
                                         class="jst-rght small-text"><?php echo $tax->name(); ?></td>
105
-                                    <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>"
105
+                                    <td data-th="<?php _e('Description', 'event_espresso'); ?>"
106 106
                                         class="jst-rght small-text"><?php echo $tax->amount(); ?>%
107 107
                                     </td>
108
-                                    <?php $tax_amount = $running_total * ( $tax->amount() / 100 ); ?>
109
-                                    <td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>"
108
+                                    <?php $tax_amount = $running_total * ($tax->amount() / 100); ?>
109
+                                    <td data-th="<?php _e('Amount', 'event_espresso'); ?>"
110 110
                                         class="jst-rght small-text"><?php echo EEH_Template::format_currency(
111 111
                                         $tax_amount
112 112
                                         ); ?></td>
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
                                     <td colspan="2" class="jst-rght small-text ttl-lbl-td">
119 119
                                         <b><?php echo apply_filters(
120 120
                                             'FHEE__ticket_selector_chart_template__ticket_details_total_price',
121
-                                            __( 'Total', 'event_espresso' )
121
+                                            __('Total', 'event_espresso')
122 122
                                             ); ?></b></td>
123 123
                                     <td data-th="<?php echo apply_filters(
124 124
                                     'FHEE__ticket_selector_chart_template__ticket_details_total_price',
125
-                                    __( 'Total', 'event_espresso' )
125
+                                    __('Total', 'event_espresso')
126 126
                                     ); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency(
127 127
                                             $running_total
128 128
                                             ); ?></b></td>
@@ -137,42 +137,42 @@  discard block
 block discarded – undo
137 137
                 <section class="tckt-slctr-tkt-sale-dates-sctn">
138 138
                     <h5><?php echo apply_filters(
139 139
                         'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading',
140
-                        __( 'Sale Dates', 'event_espresso' )
140
+                        __('Sale Dates', 'event_espresso')
141 141
                         ); ?>
142 142
                     </h5>
143 143
                     <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
144 144
                         'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message',
145
-                        __( 'The dates when this option is available for purchase.', 'event_espresso' )
145
+                        __('The dates when this option is available for purchase.', 'event_espresso')
146 146
                         ); ?></span>
147 147
                     <br/>
148 148
                     <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
149 149
                         'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale',
150
-                        __( 'Goes On Sale:', 'event_espresso' )
150
+                        __('Goes On Sale:', 'event_espresso')
151 151
                         ); ?></span>
152 152
                     <span class="dashicons dashicons-calendar"></span>
153
-                    <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format) . ' &nbsp; '; ?>
153
+                    <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format).' &nbsp; '; ?>
154 154
                     <span  class="dashicons dashicons-clock"></span>
155
-                    <?php echo $ticket->get_i18n_datetime('TKT_start_date',$time_format); ?>
155
+                    <?php echo $ticket->get_i18n_datetime('TKT_start_date', $time_format); ?>
156 156
                     <br/>
157 157
                     <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
158 158
                         'FHEE__ticket_selector_chart_template__ticket_details_sales_end',
159
-                        __( 'Sales End:', 'event_espresso' )
159
+                        __('Sales End:', 'event_espresso')
160 160
                         ); ?></span>
161 161
                     <span class="dashicons dashicons-calendar"></span>
162
-                    <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format) . ' &nbsp; '; ?>
162
+                    <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format).' &nbsp; '; ?>
163 163
                     <span class="dashicons dashicons-clock"></span>
164 164
                     <?php echo $ticket->get_i18n_datetime('TKT_end_date', $time_format); ?>
165 165
                     <br/>
166 166
                 </section>
167 167
                 <br/>
168 168
 
169
-                <?php do_action( 'AHEE__ticket_selector_chart_template__after_ticket_date', $ticket ); ?>
169
+                <?php do_action('AHEE__ticket_selector_chart_template__after_ticket_date', $ticket); ?>
170 170
 
171
-                <?php if ( $ticket->min() && $ticket->max() ) { ?>
171
+                <?php if ($ticket->min() && $ticket->max()) { ?>
172 172
                     <section class="tckt-slctr-tkt-quantities-sctn">
173 173
                         <h5><?php echo apply_filters(
174 174
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading',
175
-                            __( 'Purchasable Quantities', 'event_espresso' )
175
+                            __('Purchasable Quantities', 'event_espresso')
176 176
                             ); ?></h5>
177 177
                         <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
178 178
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message',
@@ -183,9 +183,9 @@  discard block
 block discarded – undo
183 183
                             ); ?></span><br/>
184 184
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
185 185
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty',
186
-                            __( 'Minimum Qty:', 'event_espresso' )
186
+                            __('Minimum Qty:', 'event_espresso')
187 187
                             ); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?>
188
-                        <?php if ( $ticket->min() > $remaining ) { ?> &nbsp; <span
188
+                        <?php if ($ticket->min() > $remaining) { ?> &nbsp; <span
189 189
                         class="important-notice small-text"><?php echo apply_filters(
190 190
                         'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message',
191 191
                         __(
@@ -196,18 +196,18 @@  discard block
 block discarded – undo
196 196
                         <?php //$max = min( $max, $max_atndz );?>
197 197
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
198 198
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty',
199
-                            __( 'Maximum Qty:', 'event_espresso' )
200
-                            ); ?></span><?php echo $ticket->max() === EE_INF ? __( 'no limit', 'event_espresso' )
201
-                        : max( $ticket->max(), 1 ); ?><br/>
199
+                            __('Maximum Qty:', 'event_espresso')
200
+                            ); ?></span><?php echo $ticket->max() === EE_INF ? __('no limit', 'event_espresso')
201
+                        : max($ticket->max(), 1); ?><br/>
202 202
                     </section>
203 203
                     <br/>
204 204
                 <?php } ?>
205 205
 
206
-                <?php if ( ( ! defined( 'EE_DECAF' ) || EE_DECAF !== true ) && $ticket->uses() !== EE_INF ) { ?>
206
+                <?php if (( ! defined('EE_DECAF') || EE_DECAF !== true) && $ticket->uses() !== EE_INF) { ?>
207 207
                     <section class="tckt-slctr-tkt-uses-sctn">
208 208
                         <h5><?php echo apply_filters(
209 209
                                 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading',
210
-                                __( 'Event Date Ticket Uses', 'event_espresso' )
210
+                                __('Event Date Ticket Uses', 'event_espresso')
211 211
                             ); ?></h5>
212 212
                         <span class="drk-grey-text small-text no-bold"> - <?php
213 213
                             echo apply_filters(
@@ -225,23 +225,23 @@  discard block
 block discarded – undo
225 225
                             ?></span><br/>
226 226
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
227 227
                             'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes',
228
-                            __( '# Datetimes:', 'event_espresso' )
228
+                            __('# Datetimes:', 'event_espresso')
229 229
                             ); ?></span><?php echo $ticket->uses(); ?><br/>
230 230
                     </section>
231 231
                 <?php } ?>
232 232
 
233 233
                 <?php
234
-                $datetimes = $ticket->datetimes_ordered( $event_is_expired, false );
234
+                $datetimes = $ticket->datetimes_ordered($event_is_expired, false);
235 235
                 $chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width';
236
-                if ( ! empty( $datetimes ) ) { ?>
236
+                if ( ! empty($datetimes)) { ?>
237 237
                     <section class="tckt-slctr-tkt-datetimes-sctn">
238 238
                         <h5><?php echo apply_filters(
239 239
                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading',
240
-                            __( 'Access', 'event_espresso' )
240
+                            __('Access', 'event_espresso')
241 241
                             ); ?></h5>
242 242
                         <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
243 243
                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_message',
244
-                            __( 'This option allows access to the following dates and times.', 'event_espresso' )
244
+                            __('This option allows access to the following dates and times.', 'event_espresso')
245 245
                             ); ?></span>
246 246
                         <div class="tckt-slctr-tkt-details-tbl-wrap-dv">
247 247
                             <table class="tckt-slctr-tkt-details-tbl">
@@ -251,38 +251,38 @@  discard block
 block discarded – undo
251 251
                                         <span class="dashicons dashicons-calendar"></span><span
252 252
                                         class="small-text"><?php echo apply_filters(
253 253
                                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
254
-                                            __( 'Date ', 'event_espresso' )
254
+                                            __('Date ', 'event_espresso')
255 255
                                             ); ?></span>
256 256
                                     </th>
257 257
                                     <th class="tckt-slctr-tkt-details-time-th <?php echo $chart_column_width; ?>">
258 258
                                         <span class="dashicons dashicons-clock"></span><span
259
-                                        class="small-text"><?php _e( 'Time ', 'event_espresso' ); ?></span>
259
+                                        class="small-text"><?php _e('Time ', 'event_espresso'); ?></span>
260 260
                                     </th>
261
-                                    <?php if ( $show_ticket_sale_columns ) : ?>
261
+                                    <?php if ($show_ticket_sale_columns) : ?>
262 262
                                         <th class="tckt-slctr-tkt-details-this-ticket-sold-th ee-fourth-width cntr">
263 263
                                             <span class="smaller-text"><?php echo apply_filters(
264 264
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
265
-                                                sprintf( __( 'Sold', 'event_espresso' ), '<br/>' )
265
+                                                sprintf(__('Sold', 'event_espresso'), '<br/>')
266 266
                                                 ); ?></span>
267 267
                                         </th>
268 268
                                         <th class="tckt-slctr-tkt-details-this-ticket-left-th ee-fourth-width cntr">
269 269
                                             <span class="smaller-text"><?php echo apply_filters(
270 270
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
271
-                                                sprintf( __( 'Remaining', 'event_espresso' ), '<br/>' )
271
+                                                sprintf(__('Remaining', 'event_espresso'), '<br/>')
272 272
                                                 ); ?></span>
273 273
                                         </th>
274 274
                                         <th
275 275
                                         class="tckt-slctr-tkt-details-total-tickets-sold-th ee-fourth-width cntr">
276 276
                                             <span class="smaller-text"><?php echo apply_filters(
277 277
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
278
-                                                sprintf( __( 'Total%sSold', 'event_espresso' ), '<br/>' )
278
+                                                sprintf(__('Total%sSold', 'event_espresso'), '<br/>')
279 279
                                                 ); ?></span>
280 280
                                         </th>
281 281
                                         <th
282 282
                                         class="tckt-slctr-tkt-details-total-tickets-left-th ee-fourth-width cntr">
283 283
                                             <span class="smaller-text"><?php echo apply_filters(
284 284
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
285
-                                                sprintf( __( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' )
285
+                                                sprintf(__('Total Spaces%sLeft', 'event_espresso'), '<br/>')
286 286
                                                 ); ?></span>
287 287
                                         </th>
288 288
                                     <?php endif; //end $show_ticket_sale_columns conditional ?>
@@ -290,62 +290,62 @@  discard block
 block discarded – undo
290 290
                                 </thead>
291 291
                                 <tbody>
292 292
                                 <?php
293
-                                foreach ( $datetimes as $datetime ) {
294
-                                    if ( $datetime instanceof EE_Datetime ) {
293
+                                foreach ($datetimes as $datetime) {
294
+                                    if ($datetime instanceof EE_Datetime) {
295 295
                                         ?>
296 296
 
297 297
                                         <tr>
298 298
                                             <td data-th="<?php echo apply_filters(
299 299
                                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
300
-                                            __( 'Event Date ', 'event_espresso' )
300
+                                            __('Event Date ', 'event_espresso')
301 301
                                             ); ?>" class="small-text">
302 302
                                                 <?php $datetime_name = $datetime->name(); ?>
303
-                                                <?php echo ! empty( $datetime_name ) ? '<b>'
303
+                                                <?php echo ! empty($datetime_name) ? '<b>'
304 304
                                                                                        . $datetime_name
305 305
                                                                                        . '</b><br/>' : ''; ?>
306 306
                                                 <?php echo $datetime->date_range(
307 307
                                                 $date_format,
308
-                                                __( ' to  ', 'event_espresso' )
308
+                                                __(' to  ', 'event_espresso')
309 309
                                                 ); ?>
310 310
                                             </td>
311
-                                            <td data-th="<?php _e( 'Time ', 'event_espresso' ); ?>"
311
+                                            <td data-th="<?php _e('Time ', 'event_espresso'); ?>"
312 312
                                                 class="cntr small-text">
313 313
                                                 <?php echo $datetime->time_range(
314 314
                                                 $time_format,
315
-                                                __( ' to  ', 'event_espresso' )
315
+                                                __(' to  ', 'event_espresso')
316 316
                                                 ); ?>
317 317
                                             </td>
318
-                                            <?php if ( $show_ticket_sale_columns ) : ?>
318
+                                            <?php if ($show_ticket_sale_columns) : ?>
319 319
                                                 <td data-th="<?php echo apply_filters(
320 320
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
321
-                                                __( 'Sold', 'event_espresso' )
321
+                                                __('Sold', 'event_espresso')
322 322
                                                 ); ?>" class="cntr small-text">
323 323
                                                     <?php echo $ticket->sold(); ?>
324 324
                                                 </td>
325 325
                                                 <td data-th="<?php echo apply_filters(
326 326
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
327
-                                                __( 'Remaining', 'event_espresso' )
327
+                                                __('Remaining', 'event_espresso')
328 328
                                                 ); ?>" class="cntr small-text">
329 329
                                                     <?php echo $remaining === EE_INF
330
-                                                    ? '<span class="smaller-text">' . __(
330
+                                                    ? '<span class="smaller-text">'.__(
331 331
                                                     'unlimited ',
332 332
                                                     'event_espresso'
333
-                                                    ) . '</span>' : $remaining; ?>
333
+                                                    ).'</span>' : $remaining; ?>
334 334
                                                 </td>
335 335
                                                 <td data-th="<?php echo apply_filters(
336 336
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
337
-                                                __( 'Total Sold', 'event_espresso' )
337
+                                                __('Total Sold', 'event_espresso')
338 338
                                                 ); ?>" class="cntr small-text">
339 339
                                                     <?php echo $datetime->sold(); ?>
340 340
                                                 </td>
341 341
                                                 <?php $tkts_left = $datetime->sold_out()
342
-                                                ? '<span class="sold-out smaller-text">' . __(
342
+                                                ? '<span class="sold-out smaller-text">'.__(
343 343
                                                 'Sold&nbsp;Out',
344 344
                                                 'event_espresso'
345
-                                                ) . '</span>' : $datetime->spaces_remaining(); ?>
345
+                                                ).'</span>' : $datetime->spaces_remaining(); ?>
346 346
                                                 <td data-th="<?php echo apply_filters(
347 347
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
348
-                                                __( 'Total Spaces Left', 'event_espresso' )
348
+                                                __('Total Spaces Left', 'event_espresso')
349 349
                                                 ); ?>" class="cntr small-text">
350 350
                                                     <?php echo $tkts_left === EE_INF ? '<span class="smaller-text">'
351 351
                                                                                        . __(
@@ -370,4 +370,4 @@  discard block
 block discarded – undo
370 370
         </div>
371 371
     </td>
372 372
 </tr>
373
-<?php endif;  //end template_settings->show_ticket_details check?>
374 373
\ No newline at end of file
374
+<?php endif; //end template_settings->show_ticket_details check?>
375 375
\ No newline at end of file
Please login to merge, or discard this patch.
modules/ticket_selector/templates/standard_ticket_selector.template.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 			<tr>
29 29
 				<th scope="col" class="ee-ticket-selector-ticket-details-th">
30 30
 					<?php
31
-                    echo apply_filters(
32
-                        'FHEE__ticket_selector_chart_template__table_header_available_tickets',
33
-                        esc_html(''),
34
-                        $EVT_ID
35
-                    );
36
-                    ?>
31
+					echo apply_filters(
32
+						'FHEE__ticket_selector_chart_template__table_header_available_tickets',
33
+						esc_html(''),
34
+						$EVT_ID
35
+					);
36
+					?>
37 37
 				</th>
38 38
 				<?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE ) ) { ?>
39 39
 				<th scope="col" class="ee-ticket-selector-ticket-price-th cntr">
@@ -47,28 +47,28 @@  discard block
 block discarded – undo
47 47
 						 * @param int $EVT_ID The Event ID
48 48
 						 */
49 49
 						echo apply_filters(
50
-                            'FHEE__ticket_selector_chart_template__table_header_price',
51
-                            esc_html__( 'Price', 'event_espresso' ),
52
-                            $EVT_ID
53
-                        );
50
+							'FHEE__ticket_selector_chart_template__table_header_price',
51
+							esc_html__( 'Price', 'event_espresso' ),
52
+							$EVT_ID
53
+						);
54 54
 					?>
55 55
 				</th>
56 56
 				<?php } ?>
57 57
 				<th scope="col" class="ee-ticket-selector-ticket-qty-th cntr">
58 58
 					<?php
59 59
 						/**
60
-						* Filters the text printed for the header of the quantity column in the ticket selector table
61
-						*
62
-						* @since 4.7.2
63
-						*
64
-						* @param string 'Qty' The translatable text to display in the table header for the Quantity of tickets
65
-						* @param int $EVT_ID The Event ID
66
-						*/
60
+						 * Filters the text printed for the header of the quantity column in the ticket selector table
61
+						 *
62
+						 * @since 4.7.2
63
+						 *
64
+						 * @param string 'Qty' The translatable text to display in the table header for the Quantity of tickets
65
+						 * @param int $EVT_ID The Event ID
66
+						 */
67 67
 						echo apply_filters(
68
-                            'FHEE__ticket_selector_chart_template__table_header_qty',
69
-                            esc_html__( 'Qty', 'event_espresso' ),
70
-                            $EVT_ID
71
-                        );
68
+							'FHEE__ticket_selector_chart_template__table_header_qty',
69
+							esc_html__( 'Qty', 'event_espresso' ),
70
+							$EVT_ID
71
+						);
72 72
 					?>
73 73
 				</th>
74 74
 			</tr>
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 if ( $max_atndz > 0 ) {
99 99
 	echo apply_filters(
100 100
 		'FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote',
101
-        esc_html('')
101
+		esc_html('')
102 102
 	);
103 103
 }
104 104
 if ( ! apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) {
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 ?>
21 21
 <div id="tkt-slctr-tbl-wrap-dv-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl-wrap-dv">
22 22
 
23
-	<?php do_action( 'AHEE__ticket_selector_chart__template__before_ticket_selector', $event ); ?>
23
+	<?php do_action('AHEE__ticket_selector_chart__template__before_ticket_selector', $event); ?>
24 24
 	<?php echo $datetime_selector; ?>
25 25
 
26 26
 	<table id="tkt-slctr-tbl-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl">
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
                     );
36 36
                     ?>
37 37
 				</th>
38
-				<?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE ) ) { ?>
38
+				<?php if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?>
39 39
 				<th scope="col" class="ee-ticket-selector-ticket-price-th cntr">
40 40
 					<?php
41 41
 						/**
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 						 */
49 49
 						echo apply_filters(
50 50
                             'FHEE__ticket_selector_chart_template__table_header_price',
51
-                            esc_html__( 'Price', 'event_espresso' ),
51
+                            esc_html__('Price', 'event_espresso'),
52 52
                             $EVT_ID
53 53
                         );
54 54
 					?>
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 						*/
67 67
 						echo apply_filters(
68 68
                             'FHEE__ticket_selector_chart_template__table_header_qty',
69
-                            esc_html__( 'Qty', 'event_espresso' ),
69
+                            esc_html__('Qty', 'event_espresso'),
70 70
                             $EVT_ID
71 71
                         );
72 72
 					?>
@@ -74,34 +74,34 @@  discard block
 block discarded – undo
74 74
 			</tr>
75 75
 		</thead>
76 76
 		<tbody>
77
-			<?php echo $ticket_row_html;?>
77
+			<?php echo $ticket_row_html; ?>
78 78
 		</tbody>
79 79
 	</table>
80 80
 	<?php
81
-	if ( $taxable_tickets && apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', true ) ) {
82
-		if ( $prices_displayed_including_taxes ) {
83
-			$ticket_price_includes_taxes = esc_html__( '* price includes taxes', 'event_espresso' );
81
+	if ($taxable_tickets && apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) {
82
+		if ($prices_displayed_including_taxes) {
83
+			$ticket_price_includes_taxes = esc_html__('* price includes taxes', 'event_espresso');
84 84
 		} else {
85
-			$ticket_price_includes_taxes = esc_html__( '* price does not include taxes', 'event_espresso' );
85
+			$ticket_price_includes_taxes = esc_html__('* price does not include taxes', 'event_espresso');
86 86
 		}
87
-		echo '<p class="small-text lt-grey-text" style="text-align:right; margin: -1em 0 1em;">' . $ticket_price_includes_taxes . '</p>';
87
+		echo '<p class="small-text lt-grey-text" style="text-align:right; margin: -1em 0 1em;">'.$ticket_price_includes_taxes.'</p>';
88 88
 	}
89 89
 	?>
90 90
 
91 91
 	<input type="hidden" name="noheader" value="true" />
92
-	<input type="hidden" name="tkt-slctr-return-url-<?php echo $EVT_ID ?>" value="<?php echo EEH_URL::current_url() . $anchor_id; ?>" />
92
+	<input type="hidden" name="tkt-slctr-return-url-<?php echo $EVT_ID ?>" value="<?php echo EEH_URL::current_url().$anchor_id; ?>" />
93 93
 	<input type="hidden" name="tkt-slctr-rows-<?php echo $EVT_ID; ?>" value="<?php echo $row - 1; ?>" />
94 94
 	<input type="hidden" name="tkt-slctr-max-atndz-<?php echo $EVT_ID; ?>" value="<?php echo $max_atndz; ?>" />
95 95
 	<input type="hidden" name="tkt-slctr-event-id" value="<?php echo $EVT_ID; ?>" />
96 96
 
97 97
 <?php
98
-if ( $max_atndz > 0 ) {
98
+if ($max_atndz > 0) {
99 99
 	echo apply_filters(
100 100
 		'FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote',
101 101
         esc_html('')
102 102
 	);
103 103
 }
104
-if ( ! apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) {
105
-	add_filter( 'FHEE__EE_Ticket_Selector__no_ticket_selector_submit', '__return_true' );
104
+if ( ! apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false)) {
105
+	add_filter('FHEE__EE_Ticket_Selector__no_ticket_selector_submit', '__return_true');
106 106
 }
107
-do_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event );
108 107
\ No newline at end of file
108
+do_action('AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event);
109 109
\ No newline at end of file
Please login to merge, or discard this patch.
espresso.php 1 patch
Indentation   +219 added lines, -219 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('ABSPATH')) {
2
-    exit('No direct script access allowed');
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /*
5 5
   Plugin Name:		Event Espresso
@@ -40,243 +40,243 @@  discard block
 block discarded – undo
40 40
  * @since            4.0
41 41
  */
42 42
 if (function_exists('espresso_version')) {
43
-    /**
44
-     *    espresso_duplicate_plugin_error
45
-     *    displays if more than one version of EE is activated at the same time
46
-     */
47
-    function espresso_duplicate_plugin_error()
48
-    {
49
-        ?>
43
+	/**
44
+	 *    espresso_duplicate_plugin_error
45
+	 *    displays if more than one version of EE is activated at the same time
46
+	 */
47
+	function espresso_duplicate_plugin_error()
48
+	{
49
+		?>
50 50
         <div class="error">
51 51
             <p>
52 52
                 <?php echo esc_html__(
53
-                        'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.',
54
-                        'event_espresso'
55
-                ); ?>
53
+						'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.',
54
+						'event_espresso'
55
+				); ?>
56 56
             </p>
57 57
         </div>
58 58
         <?php
59
-        espresso_deactivate_plugin(plugin_basename(__FILE__));
60
-    }
59
+		espresso_deactivate_plugin(plugin_basename(__FILE__));
60
+	}
61 61
 
62
-    add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
62
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
63 63
 } else {
64
-    define('EE_MIN_PHP_VER_REQUIRED', '5.3.9');
65
-    if ( ! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
66
-        /**
67
-         * espresso_minimum_php_version_error
68
-         *
69
-         * @return void
70
-         */
71
-        function espresso_minimum_php_version_error()
72
-        {
73
-            ?>
64
+	define('EE_MIN_PHP_VER_REQUIRED', '5.3.9');
65
+	if ( ! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
66
+		/**
67
+		 * espresso_minimum_php_version_error
68
+		 *
69
+		 * @return void
70
+		 */
71
+		function espresso_minimum_php_version_error()
72
+		{
73
+			?>
74 74
             <div class="error">
75 75
                 <p>
76 76
                     <?php
77
-                    printf(
78
-                            esc_html__(
79
-                                    'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
80
-                                    'event_espresso'
81
-                            ),
82
-                            EE_MIN_PHP_VER_REQUIRED,
83
-                            PHP_VERSION,
84
-                            '<br/>',
85
-                            '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
86
-                    );
87
-                    ?>
77
+					printf(
78
+							esc_html__(
79
+									'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
80
+									'event_espresso'
81
+							),
82
+							EE_MIN_PHP_VER_REQUIRED,
83
+							PHP_VERSION,
84
+							'<br/>',
85
+							'<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
86
+					);
87
+					?>
88 88
                 </p>
89 89
             </div>
90 90
             <?php
91
-            espresso_deactivate_plugin(plugin_basename(__FILE__));
92
-        }
91
+			espresso_deactivate_plugin(plugin_basename(__FILE__));
92
+		}
93 93
 
94
-        add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
-    } else {
96
-        /**
97
-         * espresso_version
98
-         * Returns the plugin version
99
-         *
100
-         * @return string
101
-         */
102
-        function espresso_version()
103
-        {
104
-            return apply_filters('FHEE__espresso__espresso_version', '4.9.27.rc.002');
105
-        }
94
+		add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
+	} else {
96
+		/**
97
+		 * espresso_version
98
+		 * Returns the plugin version
99
+		 *
100
+		 * @return string
101
+		 */
102
+		function espresso_version()
103
+		{
104
+			return apply_filters('FHEE__espresso__espresso_version', '4.9.27.rc.002');
105
+		}
106 106
 
107
-        // define versions
108
-        define('EVENT_ESPRESSO_VERSION', espresso_version());
109
-        define('EE_MIN_WP_VER_REQUIRED', '4.1');
110
-        define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2');
111
-        define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44');
112
-        define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
113
-        //used to be DIRECTORY_SEPARATOR, but that caused issues on windows
114
-        if ( ! defined('DS')) {
115
-            define('DS', '/');
116
-        }
117
-        if ( ! defined('PS')) {
118
-            define('PS', PATH_SEPARATOR);
119
-        }
120
-        if ( ! defined('SP')) {
121
-            define('SP', ' ');
122
-        }
123
-        if ( ! defined('EENL')) {
124
-            define('EENL', "\n");
125
-        }
126
-        define('EE_SUPPORT_EMAIL', '[email protected]');
127
-        // define the plugin directory and URL
128
-        define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE));
129
-        define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE));
130
-        define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE));
131
-        // main root folder paths
132
-        define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS);
133
-        define('EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS);
134
-        define('EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS);
135
-        define('EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS);
136
-        define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS);
137
-        define('EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS);
138
-        define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS);
139
-        define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS);
140
-        // core system paths
141
-        define('EE_ADMIN', EE_CORE . 'admin' . DS);
142
-        define('EE_CPTS', EE_CORE . 'CPTs' . DS);
143
-        define('EE_CLASSES', EE_CORE . 'db_classes' . DS);
144
-        define('EE_INTERFACES', EE_CORE . 'interfaces' . DS);
145
-        define('EE_BUSINESS', EE_CORE . 'business' . DS);
146
-        define('EE_MODELS', EE_CORE . 'db_models' . DS);
147
-        define('EE_HELPERS', EE_CORE . 'helpers' . DS);
148
-        define('EE_LIBRARIES', EE_CORE . 'libraries' . DS);
149
-        define('EE_TEMPLATES', EE_CORE . 'templates' . DS);
150
-        define('EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS);
151
-        define('EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS);
152
-        define('EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS);
153
-        // gateways
154
-        define('EE_GATEWAYS', EE_MODULES . 'gateways' . DS);
155
-        define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS);
156
-        // asset URL paths
157
-        define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS);
158
-        define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS);
159
-        define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS);
160
-        define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS);
161
-        define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/');
162
-        define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/');
163
-        // define upload paths
164
-        $uploads = wp_upload_dir();
165
-        // define the uploads directory and URL
166
-        define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'] . DS . 'espresso' . DS);
167
-        define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'] . DS . 'espresso' . DS);
168
-        // define the templates directory and URL
169
-        define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'templates' . DS);
170
-        define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'templates' . DS);
171
-        // define the gateway directory and URL
172
-        define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'gateways' . DS);
173
-        define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'gateways' . DS);
174
-        // languages folder/path
175
-        define('EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS);
176
-        define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS);
177
-        //check for dompdf fonts in uploads
178
-        if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS)) {
179
-            define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS);
180
-        }
181
-        //ajax constants
182
-        define(
183
-                'EE_FRONT_AJAX',
184
-                isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false
185
-        );
186
-        define(
187
-                'EE_ADMIN_AJAX',
188
-                isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false
189
-        );
190
-        //just a handy constant occasionally needed for finding values representing infinity in the DB
191
-        //you're better to use this than its straight value (currently -1) in case you ever
192
-        //want to change its default value! or find when -1 means infinity
193
-        define('EE_INF_IN_DB', -1);
194
-        define('EE_INF', INF > (float)PHP_INT_MAX ? INF : PHP_INT_MAX);
195
-        define('EE_DEBUG', false);
196
-        // for older WP versions
197
-        if ( ! defined('MONTH_IN_SECONDS')) {
198
-            define('MONTH_IN_SECONDS', DAY_IN_SECONDS * 30);
199
-        }
200
-        /**
201
-         *    espresso_plugin_activation
202
-         *    adds a wp-option to indicate that EE has been activated via the WP admin plugins page
203
-         */
204
-        function espresso_plugin_activation()
205
-        {
206
-            update_option('ee_espresso_activation', true);
207
-        }
107
+		// define versions
108
+		define('EVENT_ESPRESSO_VERSION', espresso_version());
109
+		define('EE_MIN_WP_VER_REQUIRED', '4.1');
110
+		define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2');
111
+		define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44');
112
+		define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
113
+		//used to be DIRECTORY_SEPARATOR, but that caused issues on windows
114
+		if ( ! defined('DS')) {
115
+			define('DS', '/');
116
+		}
117
+		if ( ! defined('PS')) {
118
+			define('PS', PATH_SEPARATOR);
119
+		}
120
+		if ( ! defined('SP')) {
121
+			define('SP', ' ');
122
+		}
123
+		if ( ! defined('EENL')) {
124
+			define('EENL', "\n");
125
+		}
126
+		define('EE_SUPPORT_EMAIL', '[email protected]');
127
+		// define the plugin directory and URL
128
+		define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE));
129
+		define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE));
130
+		define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE));
131
+		// main root folder paths
132
+		define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS);
133
+		define('EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS);
134
+		define('EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS);
135
+		define('EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS);
136
+		define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS);
137
+		define('EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS);
138
+		define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS);
139
+		define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS);
140
+		// core system paths
141
+		define('EE_ADMIN', EE_CORE . 'admin' . DS);
142
+		define('EE_CPTS', EE_CORE . 'CPTs' . DS);
143
+		define('EE_CLASSES', EE_CORE . 'db_classes' . DS);
144
+		define('EE_INTERFACES', EE_CORE . 'interfaces' . DS);
145
+		define('EE_BUSINESS', EE_CORE . 'business' . DS);
146
+		define('EE_MODELS', EE_CORE . 'db_models' . DS);
147
+		define('EE_HELPERS', EE_CORE . 'helpers' . DS);
148
+		define('EE_LIBRARIES', EE_CORE . 'libraries' . DS);
149
+		define('EE_TEMPLATES', EE_CORE . 'templates' . DS);
150
+		define('EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS);
151
+		define('EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS);
152
+		define('EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS);
153
+		// gateways
154
+		define('EE_GATEWAYS', EE_MODULES . 'gateways' . DS);
155
+		define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS);
156
+		// asset URL paths
157
+		define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS);
158
+		define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS);
159
+		define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS);
160
+		define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS);
161
+		define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/');
162
+		define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/');
163
+		// define upload paths
164
+		$uploads = wp_upload_dir();
165
+		// define the uploads directory and URL
166
+		define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'] . DS . 'espresso' . DS);
167
+		define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'] . DS . 'espresso' . DS);
168
+		// define the templates directory and URL
169
+		define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'templates' . DS);
170
+		define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'templates' . DS);
171
+		// define the gateway directory and URL
172
+		define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'gateways' . DS);
173
+		define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'gateways' . DS);
174
+		// languages folder/path
175
+		define('EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS);
176
+		define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS);
177
+		//check for dompdf fonts in uploads
178
+		if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS)) {
179
+			define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS);
180
+		}
181
+		//ajax constants
182
+		define(
183
+				'EE_FRONT_AJAX',
184
+				isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false
185
+		);
186
+		define(
187
+				'EE_ADMIN_AJAX',
188
+				isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false
189
+		);
190
+		//just a handy constant occasionally needed for finding values representing infinity in the DB
191
+		//you're better to use this than its straight value (currently -1) in case you ever
192
+		//want to change its default value! or find when -1 means infinity
193
+		define('EE_INF_IN_DB', -1);
194
+		define('EE_INF', INF > (float)PHP_INT_MAX ? INF : PHP_INT_MAX);
195
+		define('EE_DEBUG', false);
196
+		// for older WP versions
197
+		if ( ! defined('MONTH_IN_SECONDS')) {
198
+			define('MONTH_IN_SECONDS', DAY_IN_SECONDS * 30);
199
+		}
200
+		/**
201
+		 *    espresso_plugin_activation
202
+		 *    adds a wp-option to indicate that EE has been activated via the WP admin plugins page
203
+		 */
204
+		function espresso_plugin_activation()
205
+		{
206
+			update_option('ee_espresso_activation', true);
207
+		}
208 208
 
209
-        register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
210
-        /**
211
-         *    espresso_load_error_handling
212
-         *    this function loads EE's class for handling exceptions and errors
213
-         */
214
-        function espresso_load_error_handling()
215
-        {
216
-            // load debugging tools
217
-            if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) {
218
-                require_once(EE_HELPERS . 'EEH_Debug_Tools.helper.php');
219
-                EEH_Debug_Tools::instance();
220
-            }
221
-            // load error handling
222
-            if (is_readable(EE_CORE . 'EE_Error.core.php')) {
223
-                require_once(EE_CORE . 'EE_Error.core.php');
224
-            } else {
225
-                wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso'));
226
-            }
227
-        }
209
+		register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
210
+		/**
211
+		 *    espresso_load_error_handling
212
+		 *    this function loads EE's class for handling exceptions and errors
213
+		 */
214
+		function espresso_load_error_handling()
215
+		{
216
+			// load debugging tools
217
+			if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) {
218
+				require_once(EE_HELPERS . 'EEH_Debug_Tools.helper.php');
219
+				EEH_Debug_Tools::instance();
220
+			}
221
+			// load error handling
222
+			if (is_readable(EE_CORE . 'EE_Error.core.php')) {
223
+				require_once(EE_CORE . 'EE_Error.core.php');
224
+			} else {
225
+				wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso'));
226
+			}
227
+		}
228 228
 
229
-        /**
230
-         *    espresso_load_required
231
-         *    given a class name and path, this function will load that file or throw an exception
232
-         *
233
-         * @param    string $classname
234
-         * @param    string $full_path_to_file
235
-         * @throws    EE_Error
236
-         */
237
-        function espresso_load_required($classname, $full_path_to_file)
238
-        {
239
-            static $error_handling_loaded = false;
240
-            if ( ! $error_handling_loaded) {
241
-                espresso_load_error_handling();
242
-                $error_handling_loaded = true;
243
-            }
244
-            if (is_readable($full_path_to_file)) {
245
-                require_once($full_path_to_file);
246
-            } else {
247
-                throw new EE_Error (
248
-                        sprintf(
249
-                                esc_html__(
250
-                                        'The %s class file could not be located or is not readable due to file permissions.',
251
-                                        'event_espresso'
252
-                                ),
253
-                                $classname
254
-                        )
255
-                );
256
-            }
257
-        }
229
+		/**
230
+		 *    espresso_load_required
231
+		 *    given a class name and path, this function will load that file or throw an exception
232
+		 *
233
+		 * @param    string $classname
234
+		 * @param    string $full_path_to_file
235
+		 * @throws    EE_Error
236
+		 */
237
+		function espresso_load_required($classname, $full_path_to_file)
238
+		{
239
+			static $error_handling_loaded = false;
240
+			if ( ! $error_handling_loaded) {
241
+				espresso_load_error_handling();
242
+				$error_handling_loaded = true;
243
+			}
244
+			if (is_readable($full_path_to_file)) {
245
+				require_once($full_path_to_file);
246
+			} else {
247
+				throw new EE_Error (
248
+						sprintf(
249
+								esc_html__(
250
+										'The %s class file could not be located or is not readable due to file permissions.',
251
+										'event_espresso'
252
+								),
253
+								$classname
254
+						)
255
+				);
256
+			}
257
+		}
258 258
 
259
-        espresso_load_required('EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php');
260
-        espresso_load_required('EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php');
261
-        espresso_load_required('EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php');
262
-        new EE_Bootstrap();
263
-    }
259
+		espresso_load_required('EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php');
260
+		espresso_load_required('EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php');
261
+		espresso_load_required('EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php');
262
+		new EE_Bootstrap();
263
+	}
264 264
 }
265 265
 if ( ! function_exists('espresso_deactivate_plugin')) {
266
-    /**
267
-     *    deactivate_plugin
268
-     * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
269
-     *
270
-     * @access public
271
-     * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
272
-     * @return    void
273
-     */
274
-    function espresso_deactivate_plugin($plugin_basename = '')
275
-    {
276
-        if ( ! function_exists('deactivate_plugins')) {
277
-            require_once(ABSPATH . 'wp-admin/includes/plugin.php');
278
-        }
279
-        unset($_GET['activate'], $_REQUEST['activate']);
280
-        deactivate_plugins($plugin_basename);
281
-    }
266
+	/**
267
+	 *    deactivate_plugin
268
+	 * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
269
+	 *
270
+	 * @access public
271
+	 * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
272
+	 * @return    void
273
+	 */
274
+	function espresso_deactivate_plugin($plugin_basename = '')
275
+	{
276
+		if ( ! function_exists('deactivate_plugins')) {
277
+			require_once(ABSPATH . 'wp-admin/includes/plugin.php');
278
+		}
279
+		unset($_GET['activate'], $_REQUEST['activate']);
280
+		deactivate_plugins($plugin_basename);
281
+	}
282 282
 }
Please login to merge, or discard this patch.