Completed
Pull Request — master (#319)
by Darren
16:07
created
modules/ticket_selector/TicketSelectorRowStandard.php 2 patches
Indentation   +363 added lines, -363 removed lines patch added patch discarded remove patch
@@ -21,369 +21,369 @@
 block discarded – undo
21 21
 class TicketSelectorRowStandard extends TicketSelectorRow
22 22
 {
23 23
 
24
-    /**
25
-     * @var TicketDetails $ticket_details
26
-     */
27
-    protected $ticket_details;
28
-
29
-    /**
30
-     * @var \EE_Ticket_Selector_Config $template_settings
31
-     */
32
-    protected $template_settings;
33
-
34
-    /**
35
-     * @var EE_Tax_Config $tax_settings
36
-     */
37
-    protected $tax_settings;
38
-
39
-    /**
40
-     * @var boolean $prices_displayed_including_taxes
41
-     */
42
-    protected $prices_displayed_including_taxes;
43
-
44
-    /**
45
-     * @var int $row
46
-     */
47
-    protected $row;
48
-
49
-    /**
50
-     * @var int $cols
51
-     */
52
-    protected $cols;
53
-
54
-    /**
55
-     * @var boolean $hidden_input_qty
56
-     */
57
-    protected $hidden_input_qty;
58
-
59
-    /**
60
-     * @var string $ticket_datetime_classes
61
-     */
62
-    protected $ticket_datetime_classes;
63
-
64
-
65
-
66
-    /**
67
-     * TicketDetails constructor.
68
-     *
69
-     * @param TicketDetails  $ticket_details
70
-     * @param EE_Tax_Config $tax_settings
71
-     * @param int            $total_tickets
72
-     * @param int            $max_attendees
73
-     * @param int            $row
74
-     * @param int            $cols
75
-     * @param boolean        $required_ticket_sold_out
76
-     * @param string         $event_status
77
-     * @param string         $ticket_datetime_classes
78
-     * @throws EE_Error
79
-     * @throws UnexpectedEntityException
80
-     */
81
-    public function __construct(
82
-        TicketDetails $ticket_details,
83
-        EE_Tax_Config $tax_settings,
84
-        $total_tickets,
85
-        $max_attendees,
86
-        $row,
87
-        $cols,
88
-        $required_ticket_sold_out,
89
-        $event_status,
90
-        $ticket_datetime_classes
91
-    ) {
92
-        $this->ticket_details = $ticket_details;
93
-        $this->template_settings = $ticket_details->getTemplateSettings();
94
-        $this->tax_settings = $tax_settings;
95
-        $this->row = $row;
96
-        $this->cols = $cols;
97
-        $this->ticket_datetime_classes = $ticket_datetime_classes;
98
-        parent::__construct(
99
-            $ticket_details->getTicket(),
100
-            $max_attendees,
101
-            $ticket_details->getDateFormat(),
102
-            $event_status,
103
-            $required_ticket_sold_out,
104
-            $total_tickets
105
-        );
106
-    }
107
-
108
-
109
-
110
-    /**
111
-     * other ticket rows will need to know if a required ticket is sold out,
112
-     * so that they are not offered for sale
113
-     *
114
-     * @return boolean
115
-     */
116
-    public function getRequiredTicketSoldOut()
117
-    {
118
-        return $this->required_ticket_sold_out;
119
-    }
120
-
121
-
122
-
123
-    /**
124
-     * @return int
125
-     */
126
-    public function getCols()
127
-    {
128
-        return $this->cols;
129
-    }
130
-
131
-
132
-
133
-    /**
134
-     * getHtml
135
-     *
136
-     * @return string
137
-     * @throws EE_Error
138
-     */
139
-    public function getHtml()
140
-    {
141
-        $this->min = 0;
142
-        $this->max = $this->ticket->max();
143
-        $remaining = $this->ticket->remaining();
144
-        if ($this->ticket->is_on_sale() && $this->ticket->is_remaining()) {
145
-             $this->setTicketMinAndMax($remaining);
146
-        } else {
147
-            // set flag if ticket is required (flag is set to start date so that future tickets are not blocked)
148
-            $this->required_ticket_sold_out = $this->ticket->required() && ! $remaining
149
-                ? $this->ticket->start_date()
150
-                : $this->required_ticket_sold_out;
151
-        }
152
-        $this->setTicketPriceDetails();
153
-        $this->setTicketStatusClasses($remaining);
154
-        $filtered_row_html = $this->getFilteredRowHtml();
155
-        if ($filtered_row_html !== false) {
156
-            return $filtered_row_html;
157
-        }
158
-        $ticket_selector_row_html = EEH_HTML::tr(
159
-            '', '',
160
-            "tckt-slctr-tbl-tr {$this->status_class}{$this->ticket_datetime_classes} "
161
-            . espresso_get_object_css_class($this->ticket)
162
-        );
163
-        $filtered_row_content = $this->getFilteredRowContents();
164
-        if ($filtered_row_content !== false && $this->max_attendees === 1) {
165
-            return $ticket_selector_row_html
166
-                   . $filtered_row_content
167
-                   . $this->ticketQtyAndIdHiddenInputs()
168
-                   . EEH_HTML::trx();
169
-        }
170
-        if ($filtered_row_content !== false) {
171
-            return $ticket_selector_row_html
172
-                   . $filtered_row_content
173
-                   . EEH_HTML::trx();
174
-        }
175
-        $this->hidden_input_qty = $this->max_attendees > 1;
176
-
177
-        $ticket_selector_row_html .= $this->ticketNameTableCell();
178
-        $ticket_selector_row_html .= $this->ticketPriceTableCell();
179
-        $ticket_selector_row_html .= EEH_HTML::td(
180
-            '', 
181
-            '', 
182
-            'tckt-slctr-tbl-td-qty cntr',
183
-            '',
184
-            'headers="quantity-' . $this->EVT_ID . '"'
185
-        );
186
-        $this->setTicketStatusDisplay($remaining);
187
-        if (empty($this->ticket_status_display)) {
188
-            if ($this->max_attendees === 1) {
189
-                // only ONE attendee is allowed to register at a time
190
-                $ticket_selector_row_html .= $this->onlyOneAttendeeCanRegister();
191
-            } elseif ($this->max > 0) {
192
-                $ticket_selector_row_html .= $this->ticketQuantitySelector();
193
-            }
194
-        }
195
-        $ticket_selector_row_html .= $this->ticket_status_display;
196
-        $ticket_selector_row_html .= $this->ticketQtyAndIdHiddenInputs();
197
-        $ticket_selector_row_html .= $this->ticket_details->display(
198
-            $this->ticket_price,
199
-            $remaining,
200
-            $this->cols
201
-        );
202
-        $ticket_selector_row_html .= EEH_HTML::tdx();
203
-        $ticket_selector_row_html .= EEH_HTML::trx();
204
-
205
-
206
-        $this->row++;
207
-        return $ticket_selector_row_html;
208
-    }
209
-
210
-
211
-
212
-
213
-    /**
214
-     * getTicketPriceDetails
215
-     *
216
-     * @return void
217
-     * @throws EE_Error
218
-     */
219
-    protected function setTicketPriceDetails()
220
-    {
221
-        $this->ticket_price = $this->tax_settings->prices_displayed_including_taxes
222
-            ? $this->ticket->get_ticket_total_with_taxes()
223
-            : $this->ticket->get_ticket_subtotal();
224
-        $this->ticket_bundle = false;
225
-        $ticket_min = $this->ticket->min();
226
-        // for ticket bundles, set min and max qty the same
227
-        if ($ticket_min !== 0 && $ticket_min === $this->ticket->max()) {
228
-            $this->ticket_price *= $ticket_min;
229
-            $this->ticket_bundle = true;
230
-        }
231
-        $this->ticket_price = apply_filters(
232
-            'FHEE__ticket_selector_chart_template__ticket_price',
233
-            $this->ticket_price,
234
-            $this->ticket
235
-        );
236
-    }
237
-
238
-
239
-
240
-
241
-    /**
242
-     * ticketNameTableCell
243
-     *
244
-     * @return string
245
-     * @throws EE_Error
246
-     */
247
-    protected function ticketNameTableCell()
248
-    {
249
-        $html = EEH_HTML::td(
250
-            '', 
251
-            '', 
252
-            'tckt-slctr-tbl-td-name', 
253
-            '', 
254
-            'headers="details-' . $this->EVT_ID . '"'
255
-        );
256
-        $html .= EEH_HTML::strong($this->ticket->get_pretty('TKT_name'));
257
-        $html .= $this->ticket_details->getShowHideLinks();
258
-        if ($this->ticket->required()) {
259
-            $html .= EEH_HTML::p(
260
-                apply_filters(
261
-                        'FHEE__ticket_selector_chart_template__ticket_required_message',
262
-                        esc_html__('This ticket is required and must be purchased.', 'event_espresso')
263
-                ),
264
-                '', 'ticket-required-pg'
265
-            );
266
-        }
267
-        $html .= EEH_HTML::tdx();
268
-        return $html;
269
-    }
270
-
271
-
272
-
273
-    /**
274
-     * ticketPriceTableCell
275
-     *
276
-     * @return string
277
-     * @throws EE_Error
278
-     */
279
-    protected function ticketPriceTableCell()
280
-    {
281
-        $html = '';
282
-        if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) {
283
-            $html .= EEH_HTML::td(
284
-                '', 
285
-                '', 
286
-                'tckt-slctr-tbl-td-price jst-rght', 
287
-                '', 
288
-                'headers="price-' . $this->EVT_ID . '"'
289
-            );
290
-            $html .= \EEH_Template::format_currency($this->ticket_price);
291
-            $html .= $this->ticket->taxable()
292
-                ? EEH_HTML::span( '*', '', 'taxable-tickets-asterisk grey-text' )
293
-                : '';
294
-            $html .= ' ';
295
-            $html .= EEH_HTML::span(
296
-                $this->ticket_bundle
297
-                    ? apply_filters(
298
-                        'FHEE__ticket_selector_chart_template__per_ticket_bundle_text',
299
-                        __(' / bundle', 'event_espresso')
300
-                    )
301
-                    : apply_filters(
302
-                        'FHEE__ticket_selector_chart_template__per_ticket_text',
303
-                        __('', 'event_espresso')
304
-                    ),
305
-                '', 'smaller-text no-bold'
306
-            );
307
-            $html .= ' ';
308
-            $html .= EEH_HTML::tdx();
309
-            $this->cols++;
310
-        }
311
-        return $html;
312
-    }
313
-
314
-
315
-
316
-    /**
317
-     * onlyOneAttendeeCanRegister
318
-     *
319
-     * @return string
320
-     */
321
-    protected function onlyOneAttendeeCanRegister()
322
-    {
323
-        // display submit button since we have tickets available
324
-        add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
325
-        $this->hidden_input_qty = false;
326
-        $id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
327
-        $html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
328
-        $html .= esc_html__('Select this ticket', 'event_espresso') . '</label>';
329
-        $html .= '<input type="radio" name="tkt-slctr-qty-' . $this->EVT_ID . '"';
330
-        $html .= ' id="' . $id . '"';
331
-        $html .= ' class="ticket-selector-tbl-qty-slct" value="' . $this->row . '-1"';
332
-        $html .= $this->total_tickets === 1 ? ' checked="checked"' : '';
333
-        $html .= ' title=""/>';
334
-        return $html;
335
-    }
336
-
337
-
338
-
339
-    /**
340
-     * ticketQuantitySelector
341
-     *
342
-     * @return string
343
-     * @throws EE_Error
344
-     */
345
-    protected function ticketQuantitySelector()
346
-    {
347
-        // display submit button since we have tickets available
348
-        add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
349
-        $this->hidden_input_qty = false;
350
-        $id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
351
-        $html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
352
-        $html .= esc_html__('Quantity', 'event_espresso') . '</label>';
353
-        $html .= '<select name="tkt-slctr-qty-' . $this->EVT_ID . '[]"';
354
-        $html .= ' id="' . $id . '"';
355
-        $html .= ' class="ticket-selector-tbl-qty-slct">';
356
-        // this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
357
-        if ($this->min !== 0 && ! $this->ticket->required()) {
358
-            $html .= '<option value="0">&nbsp;0&nbsp;</option>';
359
-        }
360
-        // offer ticket quantities from the min to the max
361
-        for ($i = $this->min; $i <= $this->max; $i++) {
362
-            $html .= '<option value="' . $i . '">&nbsp;' . $i . '&nbsp;</option>';
363
-        }
364
-        $html .= '</select>';
365
-        return $html;
366
-    }
367
-
368
-
369
-
370
-    /**
371
-     * getHiddenInputs
372
-     *
373
-     * @return string
374
-     * @throws EE_Error
375
-     */
376
-    protected function ticketQtyAndIdHiddenInputs()
377
-    {
378
-        $html = '';
379
-        // depending on group reg we need to change the format for qty
380
-        if ($this->hidden_input_qty) {
381
-            $html .= '<input type="hidden" name="tkt-slctr-qty-' . $this->EVT_ID . '[]" value="0"/>';
382
-        }
383
-        $html .= '<input type="hidden" name="tkt-slctr-ticket-id-' . $this->EVT_ID . '[]"';
384
-        $html .= ' value="' . $this->ticket->ID() . '"/>';
385
-        return $html;
386
-    }
24
+	/**
25
+	 * @var TicketDetails $ticket_details
26
+	 */
27
+	protected $ticket_details;
28
+
29
+	/**
30
+	 * @var \EE_Ticket_Selector_Config $template_settings
31
+	 */
32
+	protected $template_settings;
33
+
34
+	/**
35
+	 * @var EE_Tax_Config $tax_settings
36
+	 */
37
+	protected $tax_settings;
38
+
39
+	/**
40
+	 * @var boolean $prices_displayed_including_taxes
41
+	 */
42
+	protected $prices_displayed_including_taxes;
43
+
44
+	/**
45
+	 * @var int $row
46
+	 */
47
+	protected $row;
48
+
49
+	/**
50
+	 * @var int $cols
51
+	 */
52
+	protected $cols;
53
+
54
+	/**
55
+	 * @var boolean $hidden_input_qty
56
+	 */
57
+	protected $hidden_input_qty;
58
+
59
+	/**
60
+	 * @var string $ticket_datetime_classes
61
+	 */
62
+	protected $ticket_datetime_classes;
63
+
64
+
65
+
66
+	/**
67
+	 * TicketDetails constructor.
68
+	 *
69
+	 * @param TicketDetails  $ticket_details
70
+	 * @param EE_Tax_Config $tax_settings
71
+	 * @param int            $total_tickets
72
+	 * @param int            $max_attendees
73
+	 * @param int            $row
74
+	 * @param int            $cols
75
+	 * @param boolean        $required_ticket_sold_out
76
+	 * @param string         $event_status
77
+	 * @param string         $ticket_datetime_classes
78
+	 * @throws EE_Error
79
+	 * @throws UnexpectedEntityException
80
+	 */
81
+	public function __construct(
82
+		TicketDetails $ticket_details,
83
+		EE_Tax_Config $tax_settings,
84
+		$total_tickets,
85
+		$max_attendees,
86
+		$row,
87
+		$cols,
88
+		$required_ticket_sold_out,
89
+		$event_status,
90
+		$ticket_datetime_classes
91
+	) {
92
+		$this->ticket_details = $ticket_details;
93
+		$this->template_settings = $ticket_details->getTemplateSettings();
94
+		$this->tax_settings = $tax_settings;
95
+		$this->row = $row;
96
+		$this->cols = $cols;
97
+		$this->ticket_datetime_classes = $ticket_datetime_classes;
98
+		parent::__construct(
99
+			$ticket_details->getTicket(),
100
+			$max_attendees,
101
+			$ticket_details->getDateFormat(),
102
+			$event_status,
103
+			$required_ticket_sold_out,
104
+			$total_tickets
105
+		);
106
+	}
107
+
108
+
109
+
110
+	/**
111
+	 * other ticket rows will need to know if a required ticket is sold out,
112
+	 * so that they are not offered for sale
113
+	 *
114
+	 * @return boolean
115
+	 */
116
+	public function getRequiredTicketSoldOut()
117
+	{
118
+		return $this->required_ticket_sold_out;
119
+	}
120
+
121
+
122
+
123
+	/**
124
+	 * @return int
125
+	 */
126
+	public function getCols()
127
+	{
128
+		return $this->cols;
129
+	}
130
+
131
+
132
+
133
+	/**
134
+	 * getHtml
135
+	 *
136
+	 * @return string
137
+	 * @throws EE_Error
138
+	 */
139
+	public function getHtml()
140
+	{
141
+		$this->min = 0;
142
+		$this->max = $this->ticket->max();
143
+		$remaining = $this->ticket->remaining();
144
+		if ($this->ticket->is_on_sale() && $this->ticket->is_remaining()) {
145
+			 $this->setTicketMinAndMax($remaining);
146
+		} else {
147
+			// set flag if ticket is required (flag is set to start date so that future tickets are not blocked)
148
+			$this->required_ticket_sold_out = $this->ticket->required() && ! $remaining
149
+				? $this->ticket->start_date()
150
+				: $this->required_ticket_sold_out;
151
+		}
152
+		$this->setTicketPriceDetails();
153
+		$this->setTicketStatusClasses($remaining);
154
+		$filtered_row_html = $this->getFilteredRowHtml();
155
+		if ($filtered_row_html !== false) {
156
+			return $filtered_row_html;
157
+		}
158
+		$ticket_selector_row_html = EEH_HTML::tr(
159
+			'', '',
160
+			"tckt-slctr-tbl-tr {$this->status_class}{$this->ticket_datetime_classes} "
161
+			. espresso_get_object_css_class($this->ticket)
162
+		);
163
+		$filtered_row_content = $this->getFilteredRowContents();
164
+		if ($filtered_row_content !== false && $this->max_attendees === 1) {
165
+			return $ticket_selector_row_html
166
+				   . $filtered_row_content
167
+				   . $this->ticketQtyAndIdHiddenInputs()
168
+				   . EEH_HTML::trx();
169
+		}
170
+		if ($filtered_row_content !== false) {
171
+			return $ticket_selector_row_html
172
+				   . $filtered_row_content
173
+				   . EEH_HTML::trx();
174
+		}
175
+		$this->hidden_input_qty = $this->max_attendees > 1;
176
+
177
+		$ticket_selector_row_html .= $this->ticketNameTableCell();
178
+		$ticket_selector_row_html .= $this->ticketPriceTableCell();
179
+		$ticket_selector_row_html .= EEH_HTML::td(
180
+			'', 
181
+			'', 
182
+			'tckt-slctr-tbl-td-qty cntr',
183
+			'',
184
+			'headers="quantity-' . $this->EVT_ID . '"'
185
+		);
186
+		$this->setTicketStatusDisplay($remaining);
187
+		if (empty($this->ticket_status_display)) {
188
+			if ($this->max_attendees === 1) {
189
+				// only ONE attendee is allowed to register at a time
190
+				$ticket_selector_row_html .= $this->onlyOneAttendeeCanRegister();
191
+			} elseif ($this->max > 0) {
192
+				$ticket_selector_row_html .= $this->ticketQuantitySelector();
193
+			}
194
+		}
195
+		$ticket_selector_row_html .= $this->ticket_status_display;
196
+		$ticket_selector_row_html .= $this->ticketQtyAndIdHiddenInputs();
197
+		$ticket_selector_row_html .= $this->ticket_details->display(
198
+			$this->ticket_price,
199
+			$remaining,
200
+			$this->cols
201
+		);
202
+		$ticket_selector_row_html .= EEH_HTML::tdx();
203
+		$ticket_selector_row_html .= EEH_HTML::trx();
204
+
205
+
206
+		$this->row++;
207
+		return $ticket_selector_row_html;
208
+	}
209
+
210
+
211
+
212
+
213
+	/**
214
+	 * getTicketPriceDetails
215
+	 *
216
+	 * @return void
217
+	 * @throws EE_Error
218
+	 */
219
+	protected function setTicketPriceDetails()
220
+	{
221
+		$this->ticket_price = $this->tax_settings->prices_displayed_including_taxes
222
+			? $this->ticket->get_ticket_total_with_taxes()
223
+			: $this->ticket->get_ticket_subtotal();
224
+		$this->ticket_bundle = false;
225
+		$ticket_min = $this->ticket->min();
226
+		// for ticket bundles, set min and max qty the same
227
+		if ($ticket_min !== 0 && $ticket_min === $this->ticket->max()) {
228
+			$this->ticket_price *= $ticket_min;
229
+			$this->ticket_bundle = true;
230
+		}
231
+		$this->ticket_price = apply_filters(
232
+			'FHEE__ticket_selector_chart_template__ticket_price',
233
+			$this->ticket_price,
234
+			$this->ticket
235
+		);
236
+	}
237
+
238
+
239
+
240
+
241
+	/**
242
+	 * ticketNameTableCell
243
+	 *
244
+	 * @return string
245
+	 * @throws EE_Error
246
+	 */
247
+	protected function ticketNameTableCell()
248
+	{
249
+		$html = EEH_HTML::td(
250
+			'', 
251
+			'', 
252
+			'tckt-slctr-tbl-td-name', 
253
+			'', 
254
+			'headers="details-' . $this->EVT_ID . '"'
255
+		);
256
+		$html .= EEH_HTML::strong($this->ticket->get_pretty('TKT_name'));
257
+		$html .= $this->ticket_details->getShowHideLinks();
258
+		if ($this->ticket->required()) {
259
+			$html .= EEH_HTML::p(
260
+				apply_filters(
261
+						'FHEE__ticket_selector_chart_template__ticket_required_message',
262
+						esc_html__('This ticket is required and must be purchased.', 'event_espresso')
263
+				),
264
+				'', 'ticket-required-pg'
265
+			);
266
+		}
267
+		$html .= EEH_HTML::tdx();
268
+		return $html;
269
+	}
270
+
271
+
272
+
273
+	/**
274
+	 * ticketPriceTableCell
275
+	 *
276
+	 * @return string
277
+	 * @throws EE_Error
278
+	 */
279
+	protected function ticketPriceTableCell()
280
+	{
281
+		$html = '';
282
+		if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) {
283
+			$html .= EEH_HTML::td(
284
+				'', 
285
+				'', 
286
+				'tckt-slctr-tbl-td-price jst-rght', 
287
+				'', 
288
+				'headers="price-' . $this->EVT_ID . '"'
289
+			);
290
+			$html .= \EEH_Template::format_currency($this->ticket_price);
291
+			$html .= $this->ticket->taxable()
292
+				? EEH_HTML::span( '*', '', 'taxable-tickets-asterisk grey-text' )
293
+				: '';
294
+			$html .= '&nbsp;';
295
+			$html .= EEH_HTML::span(
296
+				$this->ticket_bundle
297
+					? apply_filters(
298
+						'FHEE__ticket_selector_chart_template__per_ticket_bundle_text',
299
+						__(' / bundle', 'event_espresso')
300
+					)
301
+					: apply_filters(
302
+						'FHEE__ticket_selector_chart_template__per_ticket_text',
303
+						__('', 'event_espresso')
304
+					),
305
+				'', 'smaller-text no-bold'
306
+			);
307
+			$html .= '&nbsp;';
308
+			$html .= EEH_HTML::tdx();
309
+			$this->cols++;
310
+		}
311
+		return $html;
312
+	}
313
+
314
+
315
+
316
+	/**
317
+	 * onlyOneAttendeeCanRegister
318
+	 *
319
+	 * @return string
320
+	 */
321
+	protected function onlyOneAttendeeCanRegister()
322
+	{
323
+		// display submit button since we have tickets available
324
+		add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
325
+		$this->hidden_input_qty = false;
326
+		$id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
327
+		$html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
328
+		$html .= esc_html__('Select this ticket', 'event_espresso') . '</label>';
329
+		$html .= '<input type="radio" name="tkt-slctr-qty-' . $this->EVT_ID . '"';
330
+		$html .= ' id="' . $id . '"';
331
+		$html .= ' class="ticket-selector-tbl-qty-slct" value="' . $this->row . '-1"';
332
+		$html .= $this->total_tickets === 1 ? ' checked="checked"' : '';
333
+		$html .= ' title=""/>';
334
+		return $html;
335
+	}
336
+
337
+
338
+
339
+	/**
340
+	 * ticketQuantitySelector
341
+	 *
342
+	 * @return string
343
+	 * @throws EE_Error
344
+	 */
345
+	protected function ticketQuantitySelector()
346
+	{
347
+		// display submit button since we have tickets available
348
+		add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
349
+		$this->hidden_input_qty = false;
350
+		$id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
351
+		$html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
352
+		$html .= esc_html__('Quantity', 'event_espresso') . '</label>';
353
+		$html .= '<select name="tkt-slctr-qty-' . $this->EVT_ID . '[]"';
354
+		$html .= ' id="' . $id . '"';
355
+		$html .= ' class="ticket-selector-tbl-qty-slct">';
356
+		// this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
357
+		if ($this->min !== 0 && ! $this->ticket->required()) {
358
+			$html .= '<option value="0">&nbsp;0&nbsp;</option>';
359
+		}
360
+		// offer ticket quantities from the min to the max
361
+		for ($i = $this->min; $i <= $this->max; $i++) {
362
+			$html .= '<option value="' . $i . '">&nbsp;' . $i . '&nbsp;</option>';
363
+		}
364
+		$html .= '</select>';
365
+		return $html;
366
+	}
367
+
368
+
369
+
370
+	/**
371
+	 * getHiddenInputs
372
+	 *
373
+	 * @return string
374
+	 * @throws EE_Error
375
+	 */
376
+	protected function ticketQtyAndIdHiddenInputs()
377
+	{
378
+		$html = '';
379
+		// depending on group reg we need to change the format for qty
380
+		if ($this->hidden_input_qty) {
381
+			$html .= '<input type="hidden" name="tkt-slctr-qty-' . $this->EVT_ID . '[]" value="0"/>';
382
+		}
383
+		$html .= '<input type="hidden" name="tkt-slctr-ticket-id-' . $this->EVT_ID . '[]"';
384
+		$html .= ' value="' . $this->ticket->ID() . '"/>';
385
+		return $html;
386
+	}
387 387
 
388 388
 }
389 389
 // End of file TicketSelectorRowStandard.php
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             '', 
182 182
             'tckt-slctr-tbl-td-qty cntr',
183 183
             '',
184
-            'headers="quantity-' . $this->EVT_ID . '"'
184
+            'headers="quantity-'.$this->EVT_ID.'"'
185 185
         );
186 186
         $this->setTicketStatusDisplay($remaining);
187 187
         if (empty($this->ticket_status_display)) {
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
             '', 
252 252
             'tckt-slctr-tbl-td-name', 
253 253
             '', 
254
-            'headers="details-' . $this->EVT_ID . '"'
254
+            'headers="details-'.$this->EVT_ID.'"'
255 255
         );
256 256
         $html .= EEH_HTML::strong($this->ticket->get_pretty('TKT_name'));
257 257
         $html .= $this->ticket_details->getShowHideLinks();
@@ -285,11 +285,11 @@  discard block
 block discarded – undo
285 285
                 '', 
286 286
                 'tckt-slctr-tbl-td-price jst-rght', 
287 287
                 '', 
288
-                'headers="price-' . $this->EVT_ID . '"'
288
+                'headers="price-'.$this->EVT_ID.'"'
289 289
             );
290 290
             $html .= \EEH_Template::format_currency($this->ticket_price);
291 291
             $html .= $this->ticket->taxable()
292
-                ? EEH_HTML::span( '*', '', 'taxable-tickets-asterisk grey-text' )
292
+                ? EEH_HTML::span('*', '', 'taxable-tickets-asterisk grey-text')
293 293
                 : '';
294 294
             $html .= '&nbsp;';
295 295
             $html .= EEH_HTML::span(
@@ -323,12 +323,12 @@  discard block
 block discarded – undo
323 323
         // display submit button since we have tickets available
324 324
         add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
325 325
         $this->hidden_input_qty = false;
326
-        $id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
327
-        $html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
328
-        $html .= esc_html__('Select this ticket', 'event_espresso') . '</label>';
329
-        $html .= '<input type="radio" name="tkt-slctr-qty-' . $this->EVT_ID . '"';
330
-        $html .= ' id="' . $id . '"';
331
-        $html .= ' class="ticket-selector-tbl-qty-slct" value="' . $this->row . '-1"';
326
+        $id = 'ticket-selector-tbl-qty-slct-'.$this->EVT_ID.'-'.$this->row;
327
+        $html = '<label class="ee-a11y-screen-reader-text" for="'.$id.'">';
328
+        $html .= esc_html__('Select this ticket', 'event_espresso').'</label>';
329
+        $html .= '<input type="radio" name="tkt-slctr-qty-'.$this->EVT_ID.'"';
330
+        $html .= ' id="'.$id.'"';
331
+        $html .= ' class="ticket-selector-tbl-qty-slct" value="'.$this->row.'-1"';
332 332
         $html .= $this->total_tickets === 1 ? ' checked="checked"' : '';
333 333
         $html .= ' title=""/>';
334 334
         return $html;
@@ -347,11 +347,11 @@  discard block
 block discarded – undo
347 347
         // display submit button since we have tickets available
348 348
         add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
349 349
         $this->hidden_input_qty = false;
350
-        $id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
351
-        $html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
352
-        $html .= esc_html__('Quantity', 'event_espresso') . '</label>';
353
-        $html .= '<select name="tkt-slctr-qty-' . $this->EVT_ID . '[]"';
354
-        $html .= ' id="' . $id . '"';
350
+        $id = 'ticket-selector-tbl-qty-slct-'.$this->EVT_ID.'-'.$this->row;
351
+        $html = '<label class="ee-a11y-screen-reader-text" for="'.$id.'">';
352
+        $html .= esc_html__('Quantity', 'event_espresso').'</label>';
353
+        $html .= '<select name="tkt-slctr-qty-'.$this->EVT_ID.'[]"';
354
+        $html .= ' id="'.$id.'"';
355 355
         $html .= ' class="ticket-selector-tbl-qty-slct">';
356 356
         // this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
357 357
         if ($this->min !== 0 && ! $this->ticket->required()) {
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
         }
360 360
         // offer ticket quantities from the min to the max
361 361
         for ($i = $this->min; $i <= $this->max; $i++) {
362
-            $html .= '<option value="' . $i . '">&nbsp;' . $i . '&nbsp;</option>';
362
+            $html .= '<option value="'.$i.'">&nbsp;'.$i.'&nbsp;</option>';
363 363
         }
364 364
         $html .= '</select>';
365 365
         return $html;
@@ -378,10 +378,10 @@  discard block
 block discarded – undo
378 378
         $html = '';
379 379
         // depending on group reg we need to change the format for qty
380 380
         if ($this->hidden_input_qty) {
381
-            $html .= '<input type="hidden" name="tkt-slctr-qty-' . $this->EVT_ID . '[]" value="0"/>';
381
+            $html .= '<input type="hidden" name="tkt-slctr-qty-'.$this->EVT_ID.'[]" value="0"/>';
382 382
         }
383
-        $html .= '<input type="hidden" name="tkt-slctr-ticket-id-' . $this->EVT_ID . '[]"';
384
-        $html .= ' value="' . $this->ticket->ID() . '"/>';
383
+        $html .= '<input type="hidden" name="tkt-slctr-ticket-id-'.$this->EVT_ID.'[]"';
384
+        $html .= ' value="'.$this->ticket->ID().'"/>';
385 385
         return $html;
386 386
     }
387 387
 
Please login to merge, or discard this patch.
modules/ticket_selector/templates/ticket_details.template.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@  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
-                <h4><?php echo esc_html__( 'Details', 'event_espresso' ); ?></h4>
21
+                <h4><?php echo esc_html__('Details', 'event_espresso'); ?></h4>
22 22
                 <p><?php echo $ticket->description(); ?></p>
23 23
 
24 24
                 <?php
@@ -33,42 +33,42 @@  discard block
 block discarded – undo
33 33
                 <section class="tckt-slctr-tkt-sale-dates-sctn">
34 34
                     <h5><?php echo apply_filters(
35 35
                         'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading',
36
-                        esc_html__( 'Sale Dates', 'event_espresso' )
36
+                        esc_html__('Sale Dates', 'event_espresso')
37 37
                         ); ?>
38 38
                     </h5>
39 39
                     <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
40 40
                         'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message',
41
-                        esc_html__( 'The dates when this option is available for purchase.', 'event_espresso' )
41
+                        esc_html__('The dates when this option is available for purchase.', 'event_espresso')
42 42
                         ); ?></span>
43 43
                     <br/>
44 44
                     <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
45 45
                         'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale',
46
-                        esc_html__( 'Goes On Sale:', 'event_espresso' )
46
+                        esc_html__('Goes On Sale:', 'event_espresso')
47 47
                         ); ?></span>
48 48
                     <span class="dashicons dashicons-calendar"></span>
49
-                    <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format) . ' &nbsp; '; ?>
49
+                    <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format).' &nbsp; '; ?>
50 50
                     <span  class="dashicons dashicons-clock"></span>
51
-                    <?php echo $ticket->get_i18n_datetime('TKT_start_date',$time_format); ?>
51
+                    <?php echo $ticket->get_i18n_datetime('TKT_start_date', $time_format); ?>
52 52
                     <br/>
53 53
                     <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
54 54
                         'FHEE__ticket_selector_chart_template__ticket_details_sales_end',
55
-                        esc_html__( 'Sales End:', 'event_espresso' )
55
+                        esc_html__('Sales End:', 'event_espresso')
56 56
                         ); ?></span>
57 57
                     <span class="dashicons dashicons-calendar"></span>
58
-                    <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format) . ' &nbsp; '; ?>
58
+                    <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format).' &nbsp; '; ?>
59 59
                     <span class="dashicons dashicons-clock"></span>
60 60
                     <?php echo $ticket->get_i18n_datetime('TKT_end_date', $time_format); ?>
61 61
                     <br/>
62 62
                 </section>
63 63
                 <br/>
64 64
 
65
-                <?php do_action( 'AHEE__ticket_selector_chart_template__after_ticket_date', $ticket ); ?>
65
+                <?php do_action('AHEE__ticket_selector_chart_template__after_ticket_date', $ticket); ?>
66 66
 
67
-                <?php if ( $ticket->min() && $ticket->max() ) { ?>
67
+                <?php if ($ticket->min() && $ticket->max()) { ?>
68 68
                     <section class="tckt-slctr-tkt-quantities-sctn">
69 69
                         <h5><?php echo apply_filters(
70 70
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading',
71
-                            esc_html__( 'Purchasable Quantities', 'event_espresso' )
71
+                            esc_html__('Purchasable Quantities', 'event_espresso')
72 72
                             ); ?></h5>
73 73
                         <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
74 74
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message',
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
                             ); ?></span><br/>
80 80
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
81 81
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty',
82
-                            esc_html__( 'Minimum Qty:', 'event_espresso' )
82
+                            esc_html__('Minimum Qty:', 'event_espresso')
83 83
                             ); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?>
84
-                        <?php if ( $ticket->min() > $remaining ) { ?> &nbsp; <span
84
+                        <?php if ($ticket->min() > $remaining) { ?> &nbsp; <span
85 85
                         class="important-notice small-text"><?php echo apply_filters(
86 86
                         'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message',
87 87
                         esc_html__(
@@ -92,18 +92,18 @@  discard block
 block discarded – undo
92 92
                         <?php //$max = min( $max, $max_atndz );?>
93 93
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
94 94
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty',
95
-                            esc_html__( 'Maximum Qty:', 'event_espresso' )
96
-                            ); ?></span><?php echo $ticket->max() === EE_INF ? esc_html__( 'no limit', 'event_espresso' )
97
-                        : max( $ticket->max(), 1 ); ?><br/>
95
+                            esc_html__('Maximum Qty:', 'event_espresso')
96
+                            ); ?></span><?php echo $ticket->max() === EE_INF ? esc_html__('no limit', 'event_espresso')
97
+                        : max($ticket->max(), 1); ?><br/>
98 98
                     </section>
99 99
                     <br/>
100 100
                 <?php } ?>
101 101
 
102
-                <?php if ( ( ! defined( 'EE_DECAF' ) || EE_DECAF !== true ) && $ticket->uses() !== EE_INF ) { ?>
102
+                <?php if (( ! defined('EE_DECAF') || EE_DECAF !== true) && $ticket->uses() !== EE_INF) { ?>
103 103
                     <section class="tckt-slctr-tkt-uses-sctn">
104 104
                         <h5><?php echo apply_filters(
105 105
                                 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading',
106
-                                esc_html__( 'Event Date Ticket Uses', 'event_espresso' )
106
+                                esc_html__('Event Date Ticket Uses', 'event_espresso')
107 107
                             ); ?></h5>
108 108
                         <span class="drk-grey-text small-text no-bold"> - <?php
109 109
                             echo apply_filters(
@@ -121,23 +121,23 @@  discard block
 block discarded – undo
121 121
                             ?></span><br/>
122 122
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
123 123
                             'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes',
124
-                            esc_html__( '# Datetimes:', 'event_espresso' )
124
+                            esc_html__('# Datetimes:', 'event_espresso')
125 125
                             ); ?></span><?php echo $ticket->uses(); ?><br/>
126 126
                     </section>
127 127
                 <?php } ?>
128 128
 
129 129
                 <?php
130
-                $datetimes = $ticket->datetimes_ordered( $event_is_expired, false );
130
+                $datetimes = $ticket->datetimes_ordered($event_is_expired, false);
131 131
                 $chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width';
132
-                if ( ! empty( $datetimes ) ) { ?>
132
+                if ( ! empty($datetimes)) { ?>
133 133
                     <section class="tckt-slctr-tkt-datetimes-sctn">
134 134
                         <h5><?php echo apply_filters(
135 135
                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading',
136
-                            esc_html__( 'Access', 'event_espresso' )
136
+                            esc_html__('Access', 'event_espresso')
137 137
                             ); ?></h5>
138 138
                         <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
139 139
                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_message',
140
-                            esc_html__( 'This option allows access to the following dates and times.', 'event_espresso' )
140
+                            esc_html__('This option allows access to the following dates and times.', 'event_espresso')
141 141
                             ); ?></span>
142 142
                         <div class="tckt-slctr-tkt-details-tbl-wrap-dv">
143 143
                             <table class="tckt-slctr-tkt-details-tbl">
@@ -147,38 +147,38 @@  discard block
 block discarded – undo
147 147
                                         <span class="dashicons dashicons-calendar"></span><span
148 148
                                         class="small-text"><?php echo apply_filters(
149 149
                                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
150
-                                            esc_html__( 'Date ', 'event_espresso' )
150
+                                            esc_html__('Date ', 'event_espresso')
151 151
                                             ); ?></span>
152 152
                                     </th>
153 153
                                     <th class="tckt-slctr-tkt-details-time-th <?php echo $chart_column_width; ?>">
154 154
                                         <span class="dashicons dashicons-clock"></span><span
155
-                                        class="small-text"><?php esc_html_e( 'Time ', 'event_espresso' ); ?></span>
155
+                                        class="small-text"><?php esc_html_e('Time ', 'event_espresso'); ?></span>
156 156
                                     </th>
157
-                                    <?php if ( $show_ticket_sale_columns ) : ?>
157
+                                    <?php if ($show_ticket_sale_columns) : ?>
158 158
                                         <th class="tckt-slctr-tkt-details-this-ticket-sold-th ee-fourth-width cntr">
159 159
                                             <span class="smaller-text"><?php echo apply_filters(
160 160
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
161
-                                                sprintf( esc_html__( 'Sold', 'event_espresso' ), '<br/>' )
161
+                                                sprintf(esc_html__('Sold', 'event_espresso'), '<br/>')
162 162
                                                 ); ?></span>
163 163
                                         </th>
164 164
                                         <th class="tckt-slctr-tkt-details-this-ticket-left-th ee-fourth-width cntr">
165 165
                                             <span class="smaller-text"><?php echo apply_filters(
166 166
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
167
-                                                sprintf( esc_html__( 'Remaining', 'event_espresso' ), '<br/>' )
167
+                                                sprintf(esc_html__('Remaining', 'event_espresso'), '<br/>')
168 168
                                                 ); ?></span>
169 169
                                         </th>
170 170
                                         <th
171 171
                                         class="tckt-slctr-tkt-details-total-tickets-sold-th ee-fourth-width cntr">
172 172
                                             <span class="smaller-text"><?php echo apply_filters(
173 173
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
174
-                                                sprintf( esc_html__( 'Total%sSold', 'event_espresso' ), '<br/>' )
174
+                                                sprintf(esc_html__('Total%sSold', 'event_espresso'), '<br/>')
175 175
                                                 ); ?></span>
176 176
                                         </th>
177 177
                                         <th
178 178
                                         class="tckt-slctr-tkt-details-total-tickets-left-th ee-fourth-width cntr">
179 179
                                             <span class="smaller-text"><?php echo apply_filters(
180 180
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
181
-                                                sprintf( esc_html__( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' )
181
+                                                sprintf(esc_html__('Total Spaces%sLeft', 'event_espresso'), '<br/>')
182 182
                                                 ); ?></span>
183 183
                                         </th>
184 184
                                     <?php endif; //end $show_ticket_sale_columns conditional ?>
@@ -186,62 +186,62 @@  discard block
 block discarded – undo
186 186
                                 </thead>
187 187
                                 <tbody>
188 188
                                 <?php
189
-                                foreach ( $datetimes as $datetime ) {
190
-                                    if ( $datetime instanceof EE_Datetime ) {
189
+                                foreach ($datetimes as $datetime) {
190
+                                    if ($datetime instanceof EE_Datetime) {
191 191
                                         ?>
192 192
 
193 193
                                         <tr>
194 194
                                             <td data-th="<?php echo apply_filters(
195 195
                                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
196
-                                            esc_html__( 'Event Date ', 'event_espresso' )
196
+                                            esc_html__('Event Date ', 'event_espresso')
197 197
                                             ); ?>" class="small-text">
198 198
                                                 <?php $datetime_name = $datetime->name(); ?>
199
-                                                <?php echo ! empty( $datetime_name ) ? '<b>'
199
+                                                <?php echo ! empty($datetime_name) ? '<b>'
200 200
                                                                                        . $datetime_name
201 201
                                                                                        . '</b><br/>' : ''; ?>
202 202
                                                 <?php echo $datetime->date_range(
203 203
                                                 $date_format,
204
-                                                esc_html__( ' to  ', 'event_espresso' )
204
+                                                esc_html__(' to  ', 'event_espresso')
205 205
                                                 ); ?>
206 206
                                             </td>
207
-                                            <td data-th="<?php esc_html_e( 'Time ', 'event_espresso' ); ?>"
207
+                                            <td data-th="<?php esc_html_e('Time ', 'event_espresso'); ?>"
208 208
                                                 class="cntr small-text">
209 209
                                                 <?php echo $datetime->time_range(
210 210
                                                 $time_format,
211
-                                                esc_html__( ' to  ', 'event_espresso' )
211
+                                                esc_html__(' to  ', 'event_espresso')
212 212
                                                 ); ?>
213 213
                                             </td>
214
-                                            <?php if ( $show_ticket_sale_columns ) : ?>
214
+                                            <?php if ($show_ticket_sale_columns) : ?>
215 215
                                                 <td data-th="<?php echo apply_filters(
216 216
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
217
-                                                esc_html__( 'Sold', 'event_espresso' )
217
+                                                esc_html__('Sold', 'event_espresso')
218 218
                                                 ); ?>" class="cntr small-text">
219 219
                                                     <?php echo $ticket->sold(); ?>
220 220
                                                 </td>
221 221
                                                 <td data-th="<?php echo apply_filters(
222 222
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
223
-                                                esc_html__( 'Remaining', 'event_espresso' )
223
+                                                esc_html__('Remaining', 'event_espresso')
224 224
                                                 ); ?>" class="cntr small-text">
225 225
                                                     <?php echo $remaining === EE_INF
226
-                                                    ? '<span class="smaller-text">' . esc_html__(
226
+                                                    ? '<span class="smaller-text">'.esc_html__(
227 227
                                                     'unlimited ',
228 228
                                                     'event_espresso'
229
-                                                    ) . '</span>' : $remaining; ?>
229
+                                                    ).'</span>' : $remaining; ?>
230 230
                                                 </td>
231 231
                                                 <td data-th="<?php echo apply_filters(
232 232
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
233
-                                                esc_html__( 'Total Sold', 'event_espresso' )
233
+                                                esc_html__('Total Sold', 'event_espresso')
234 234
                                                 ); ?>" class="cntr small-text">
235 235
                                                     <?php echo $datetime->sold(); ?>
236 236
                                                 </td>
237 237
                                                 <?php $tkts_left = $datetime->sold_out()
238
-                                                ? '<span class="sold-out smaller-text">' . esc_html__(
238
+                                                ? '<span class="sold-out smaller-text">'.esc_html__(
239 239
                                                 'Sold&nbsp;Out',
240 240
                                                 'event_espresso'
241
-                                                ) . '</span>' : $datetime->spaces_remaining(); ?>
241
+                                                ).'</span>' : $datetime->spaces_remaining(); ?>
242 242
                                                 <td data-th="<?php echo apply_filters(
243 243
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
244
-                                                esc_html__( 'Total Spaces Left', 'event_espresso' )
244
+                                                esc_html__('Total Spaces Left', 'event_espresso')
245 245
                                                 ); ?>" class="cntr small-text">
246 246
                                                     <?php echo $tkts_left === EE_INF ? '<span class="smaller-text">'
247 247
                                                                                        . esc_html__(
@@ -266,4 +266,4 @@  discard block
 block discarded – undo
266 266
         </div>
267 267
     </td>
268 268
 </tr>
269
-<?php endif;  //end template_settings->show_ticket_details check?>
270 269
\ No newline at end of file
270
+<?php endif; //end template_settings->show_ticket_details check?>
271 271
\ 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
@@ -29,12 +29,12 @@  discard block
 block discarded – undo
29 29
 			<tr>
30 30
 				<th id="details-<?php echo $EVT_ID; ?>" scope="col" class="ee-ticket-selector-ticket-details-th">
31 31
 					<?php
32
-                    echo apply_filters(
33
-                        'FHEE__ticket_selector_chart_template__table_header_available_tickets',
34
-                        esc_html__( 'Details', 'event_espresso' ),
35
-                        $EVT_ID
36
-                    );
37
-                    ?>
32
+					echo apply_filters(
33
+						'FHEE__ticket_selector_chart_template__table_header_available_tickets',
34
+						esc_html__( 'Details', 'event_espresso' ),
35
+						$EVT_ID
36
+					);
37
+					?>
38 38
 				</th>
39 39
 				<?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE ) ) { ?>
40 40
 				<th id="price-<?php echo $EVT_ID; ?>" scope="col" class="ee-ticket-selector-ticket-price-th cntr">
@@ -48,28 +48,28 @@  discard block
 block discarded – undo
48 48
 						 * @param int $EVT_ID The Event ID
49 49
 						 */
50 50
 						echo apply_filters(
51
-                            'FHEE__ticket_selector_chart_template__table_header_price',
52
-                            esc_html__( 'Price', 'event_espresso' ),
53
-                            $EVT_ID
54
-                        );
51
+							'FHEE__ticket_selector_chart_template__table_header_price',
52
+							esc_html__( 'Price', 'event_espresso' ),
53
+							$EVT_ID
54
+						);
55 55
 					?>
56 56
 				</th>
57 57
 				<?php } ?>
58 58
 				<th id="quantity-<?php echo $EVT_ID; ?>" scope="col" class="ee-ticket-selector-ticket-qty-th cntr">
59 59
 					<?php
60 60
 						/**
61
-						* Filters the text printed for the header of the quantity column in the ticket selector table
62
-						*
63
-						* @since 4.7.2
64
-						*
65
-						* @param string 'Qty' The translatable text to display in the table header for the Quantity of tickets
66
-						* @param int $EVT_ID The Event ID
67
-						*/
61
+						 * Filters the text printed for the header of the quantity column in the ticket selector table
62
+						 *
63
+						 * @since 4.7.2
64
+						 *
65
+						 * @param string 'Qty' The translatable text to display in the table header for the Quantity of tickets
66
+						 * @param int $EVT_ID The Event ID
67
+						 */
68 68
 						echo apply_filters(
69
-                            'FHEE__ticket_selector_chart_template__table_header_qty',
70
-                            esc_html__( 'Qty', 'event_espresso' ),
71
-                            $EVT_ID
72
-                        );
69
+							'FHEE__ticket_selector_chart_template__table_header_qty',
70
+							esc_html__( 'Qty', 'event_espresso' ),
71
+							$EVT_ID
72
+						);
73 73
 					?>
74 74
 				</th>
75 75
 			</tr>
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 if ( $max_atndz > 0 ) {
97 97
 	echo apply_filters(
98 98
 		'FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote',
99
-        esc_html('')
99
+		esc_html('')
100 100
 	);
101 101
 }
102 102
 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
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 ?>
22 22
 <div id="tkt-slctr-tbl-wrap-dv-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl-wrap-dv">
23 23
 
24
-	<?php do_action( 'AHEE__ticket_selector_chart__template__before_ticket_selector', $event ); ?>
24
+	<?php do_action('AHEE__ticket_selector_chart__template__before_ticket_selector', $event); ?>
25 25
 	<?php echo $datetime_selector; ?>
26 26
 
27 27
 	<table id="tkt-slctr-tbl-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl">
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 					<?php
32 32
                     echo apply_filters(
33 33
                         'FHEE__ticket_selector_chart_template__table_header_available_tickets',
34
-                        esc_html__( 'Details', 'event_espresso' ),
34
+                        esc_html__('Details', 'event_espresso'),
35 35
                         $EVT_ID
36 36
                     );
37 37
                     ?>
38 38
 				</th>
39
-				<?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE ) ) { ?>
39
+				<?php if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?>
40 40
 				<th id="price-<?php echo $EVT_ID; ?>" scope="col" class="ee-ticket-selector-ticket-price-th cntr">
41 41
 					<?php
42 42
 						/**
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 						 */
50 50
 						echo apply_filters(
51 51
                             'FHEE__ticket_selector_chart_template__table_header_price',
52
-                            esc_html__( 'Price', 'event_espresso' ),
52
+                            esc_html__('Price', 'event_espresso'),
53 53
                             $EVT_ID
54 54
                         );
55 55
 					?>
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 						*/
68 68
 						echo apply_filters(
69 69
                             'FHEE__ticket_selector_chart_template__table_header_qty',
70
-                            esc_html__( 'Qty', 'event_espresso' ),
70
+                            esc_html__('Qty', 'event_espresso'),
71 71
                             $EVT_ID
72 72
                         );
73 73
 					?>
@@ -75,17 +75,17 @@  discard block
 block discarded – undo
75 75
 			</tr>
76 76
 		</thead>
77 77
 		<tbody>
78
-			<?php echo $ticket_row_html;?>
78
+			<?php echo $ticket_row_html; ?>
79 79
 		</tbody>
80 80
 	</table>
81 81
 	<?php
82
-	if ( $taxable_tickets && apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', true ) ) {
83
-		if ( $prices_displayed_including_taxes ) {
84
-			$ticket_price_includes_taxes = esc_html__( '* price includes taxes', 'event_espresso' );
82
+	if ($taxable_tickets && apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) {
83
+		if ($prices_displayed_including_taxes) {
84
+			$ticket_price_includes_taxes = esc_html__('* price includes taxes', 'event_espresso');
85 85
 		} else {
86
-			$ticket_price_includes_taxes = esc_html__( '* price does not include taxes', 'event_espresso' );
86
+			$ticket_price_includes_taxes = esc_html__('* price does not include taxes', 'event_espresso');
87 87
 		}
88
-		echo '<p class="small-text lt-grey-text" style="text-align:right; margin: -1em 0 1em;">' . $ticket_price_includes_taxes . '</p>';
88
+		echo '<p class="small-text lt-grey-text" style="text-align:right; margin: -1em 0 1em;">'.$ticket_price_includes_taxes.'</p>';
89 89
 	}
90 90
 	?>
91 91
 
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
 
94 94
 
95 95
 <?php
96
-if ( $max_atndz > 0 ) {
96
+if ($max_atndz > 0) {
97 97
 	echo apply_filters(
98 98
 		'FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote',
99 99
         esc_html('')
100 100
 	);
101 101
 }
102
-if ( ! apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) {
103
-	add_filter( 'FHEE__EE_Ticket_Selector__no_ticket_selector_submit', '__return_true' );
102
+if ( ! apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false)) {
103
+	add_filter('FHEE__EE_Ticket_Selector__no_ticket_selector_submit', '__return_true');
104 104
 }
105
-do_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event );
106 105
\ No newline at end of file
106
+do_action('AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event);
107 107
\ No newline at end of file
Please login to merge, or discard this patch.