PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / 1.2.21
VikAppointments Services Booking Calendar v1.2.21
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / admin / views / orderinfo / tmpl / default_details.php
vikappointments / admin / views / orderinfo / tmpl Last commit date
closure.php 3 days ago default.php 3 days ago default_customer.php 3 days ago default_details.php 3 days ago default_fields.php 3 days ago default_options.php 3 days ago default_payment.php 3 days ago index.html 3 days ago list.php 3 days ago
default_details.php
357 lines
1 <?php
2 /**
3 * @package VikAppointments
4 * @subpackage core
5 * @author E4J s.r.l.
6 * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved.
7 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8 * @link https://vikwp.com
9 */
10
11 // No direct access
12 defined('ABSPATH') or die('No script kiddies please!');
13
14 $config = VAPFactory::getConfig();
15
16 // get default user timezone
17 $default_tz = JFactory::getUser()->getTimezone();
18
19 // get first appointment
20 $app = $this->order->appointments[0];
21 ?>
22
23 <h3>
24 <?php
25 echo JText::translate('VAPAPPOINTMENT');
26
27 if ($this->back)
28 {
29 ?>
30 <a href="<?php echo base64_decode($this->back); ?>">
31 <i class="fas fa-sign-out-alt fa-flip-horizontal"></i>
32 </a>
33 <?php
34 }
35 ?>
36 </h3>
37
38 <div class="order-fields">
39
40 <!-- Order ID -->
41
42 <div class="order-field">
43
44 <label>
45 <?php echo JText::translate('VAPMANAGERESERVATION1'); ?>
46 </label>
47
48 <div class="order-field-value">
49 <b><?php echo $this->order->id . '-' . $this->order->sid; ?></b>
50
51 <?php
52 $creation = JText::sprintf(
53 'VAPRESLISTCREATEDTIP',
54 JHtml::fetch('date', $this->order->createdon, JText::translate('DATE_FORMAT_LC3') . ' ' . $config->get('timeformat')),
55 $this->order->author ? $this->order->author->name : JText::translate('VAPRESLISTGUEST')
56 );
57
58 ?>
59 <i class="fas fa-calendar-check hasTooltip" title="<?php echo $this->escape($creation); ?>" style="margin-left:4px;"></i>
60
61 <?php
62 // plugins can use the "details.id" key to introduce custom
63 // HTML next to the order number
64 if (isset($this->addons['details.id']))
65 {
66 echo $this->addons['details.id'];
67
68 // unset details form to avoid displaying it twice
69 unset($this->addons['details.id']);
70 }
71 ?>
72 </div>
73
74 <!-- Define role to detect the supported hook -->
75 <!-- {"rule":"customizer","event":"onDisplayViewOrderinfo","key":"details.id","type":"field"} -->
76
77 </div>
78
79 <!-- Status -->
80
81 <div class="order-field">
82
83 <label><?php echo JText::translate('VAPMANAGERESERVATION12'); ?></label>
84
85 <div class="order-field-value">
86 <?php
87 echo JHtml::fetch('vaphtml.status.display', $this->order->status);
88
89 $comment = '';
90
91 // show remaining time available to accept the reservation
92 if ($this->order->statusRole == 'PENDING')
93 {
94 if ($this->order->locked_until > time())
95 {
96 $comment = JText::sprintf(
97 'VAPRESEXPIRESIN',
98 VikAppointments::formatTimestamp($config->get('timeformat'), $this->order->locked_until)
99 );
100 }
101 }
102 else
103 {
104 // get last status in history
105 $history = $this->order->history;
106 $status = end($history);
107
108 if ($status)
109 {
110 // include status comment
111 $comment = nl2br($status->comment) . '<br /><br />'
112 . JHtml::fetch('date', $status->createdon, JText::translate('DATE_FORMAT_LC6'));
113 }
114 }
115
116 if ($comment)
117 {
118 ?><i class="fas fa-question-circle hasTooltip" title="<?php echo $this->escape($comment); ?>" style="margin-left:4px;"></i><?php
119 }
120
121 // plugins can use the "details.status" key to introduce custom
122 // HTML next to the order status
123 if (isset($this->addons['details.status']))
124 {
125 echo $this->addons['details.status'];
126
127 // unset details form to avoid displaying it twice
128 unset($this->addons['details.status']);
129 }
130 ?>
131 </div>
132
133 <!-- Define role to detect the supported hook -->
134 <!-- {"rule":"customizer","event":"onDisplayViewOrderinfo","key":"details.status","type":"field"} -->
135
136 </div>
137
138 <!-- Service -->
139
140 <div class="order-field">
141
142 <label><?php echo JText::translate('VAPMANAGERESERVATION4'); ?></label>
143
144 <div class="order-field-value">
145 <span class="badge badge-info"><?php echo $app->service->name; ?></span>
146
147 <?php
148 // display the contents of the last modified note
149 if ($this->order->notes && $this->order->notes[0]->content)
150 {
151 $note = $this->order->notes[0];
152
153 // take the contents of the notes by stripping any HTML code
154 $content = strip_tags((string) $note->content);
155 // display at most 200 characters
156 if (mb_strlen($content, 'UTF-8') > 200)
157 {
158 $content = rtrim(mb_substr($content, 0, 200, 'UTF-8'), '. ') . '...';
159 }
160 // append the last modified date
161 $content .= "\n\n" . JHtml::fetch('date', VAPDateHelper::isNull($note->modifiedon) ? $note->createdon : $note->modifiedon, JText::translate('DATE_FORMAT_LC6'));
162 ?>
163 <i class="fas fa-sticky-note hasTooltip" title="<?php echo $this->escape(nl2br($content)); ?>"></i>
164 <?php
165 }
166
167 // plugins can use the "details.service" key to introduce custom
168 // HTML next to the appointment service
169 if (isset($this->addons['details.service']))
170 {
171 echo $this->addons['details.service'];
172
173 // unset details form to avoid displaying it twice
174 unset($this->addons['details.service']);
175 }
176 ?>
177 </div>
178
179 <!-- Define role to detect the supported hook -->
180 <!-- {"rule":"customizer","event":"onDisplayViewOrderinfo","key":"details.service","type":"field"} -->
181
182 </div>
183
184 <!-- Employee -->
185
186 <div class="order-field">
187
188 <label><?php echo JText::translate('VAPMANAGERESERVATION3'); ?></label>
189
190 <div class="order-field-value">
191 <span class="badge badge-important"><?php echo $app->employee->name; ?></span>
192
193 <?php
194 // plugins can use the "details.employee" key to introduce custom
195 // HTML next to the appointment employee
196 if (isset($this->addons['details.employee']))
197 {
198 echo $this->addons['details.employee'];
199
200 // unset details form to avoid displaying it twice
201 unset($this->addons['details.employee']);
202 }
203 ?>
204 </div>
205
206 <!-- Define role to detect the supported hook -->
207 <!-- {"rule":"customizer","event":"onDisplayViewOrderinfo","key":"details.employee","type":"field"} -->
208
209 </div>
210
211 <!-- Check-in -->
212
213 <div class="order-field">
214
215 <label><?php echo JText::translate('VAPMANAGERESERVATION26'); ?></label>
216
217 <div class="order-field-value">
218 <?php
219 if ($app->employee->checkin->timezone && $app->employee->checkin->timezone != $default_tz->getName())
220 {
221 // display time adjusted to the employee timezone
222 $tz_str = str_replace('_', ' ', $app->employee->checkin->timezone) . "<br />"
223 . $app->employee->checkin->lc2;
224 }
225 else
226 {
227 $tz_str = '';
228 }
229 ?>
230
231 <b><?php echo $app->checkin->lc3; ?></b>
232
233 <?php
234 if ($tz_str)
235 {
236 ?><i class="fas fa-globe-americas hasTooltip" title="<?php echo $this->escape($tz_str); ?>" style="margin-left:4px;"></i><?php
237 }
238
239 // plugins can use the "details.checkin" key to introduce custom
240 // HTML next to the appointment check-in
241 if (isset($this->addons['details.checkin']))
242 {
243 echo $this->addons['details.checkin'];
244
245 // unset details form to avoid displaying it twice
246 unset($this->addons['details.checkin']);
247 }
248 ?>
249 </div>
250
251 <!-- Define role to detect the supported hook -->
252 <!-- {"rule":"customizer","event":"onDisplayViewOrderinfo","key":"details.checkin","type":"field"} -->
253
254 </div>
255
256 <!-- Check-out -->
257
258 <div class="order-field">
259
260 <label><?php echo JText::translate('VAPMANAGERESERVATION42'); ?></label>
261
262 <div class="order-field-value">
263 <?php
264 if ($app->employee->checkout->timezone && $app->employee->checkout->timezone != $default_tz->getName())
265 {
266 // display time adjusted to the employee timezone
267 $tz_str = str_replace('_', ' ', $app->employee->checkout->timezone) . "<br />"
268 . $app->employee->checkout->lc2;
269 }
270 else
271 {
272 $tz_str = '';
273 }
274
275 $checkout = JFactory::getDate($app->checkout->utc);
276 $checkout->setTimezone(new DateTimeZone($app->checkout->timezone));
277 ?>
278
279 <b><?php echo $checkout->format($config->get('timeformat'), $local = true); ?></b>
280
281 <?php
282 echo ' (' . VikAppointments::formatMinutesToTime($app->duration) . ')';
283
284 if ($tz_str)
285 {
286 ?><i class="fas fa-globe-americas hasTooltip" title="<?php echo $this->escape($tz_str); ?>" style="margin-left:4px;"></i><?php
287 }
288
289 // plugins can use the "details.checkout" key to introduce custom
290 // HTML next to the appointment check-out
291 if (isset($this->addons['details.checkout']))
292 {
293 echo $this->addons['details.checkout'];
294
295 // unset details form to avoid displaying it twice
296 unset($this->addons['details.checkout']);
297 }
298 ?>
299 </div>
300
301 <!-- Define role to detect the supported hook -->
302 <!-- {"rule":"customizer","event":"onDisplayViewOrderinfo","key":"details.checkout","type":"field"} -->
303
304 </div>
305
306 <?php
307 if ($app->people > 1)
308 {
309 ?>
310 <!-- People -->
311
312 <div class="order-field">
313
314 <label><?php echo JText::translate('VAPMANAGERESERVATION25'); ?></label>
315
316 <div class="order-field-value">
317 <b><?php echo $app->people; ?></b>&nbsp;
318 <i class="fas fa-male" style="margin-right: 1px;"></i><i class="fas fa-male"></i>
319
320 <?php
321 // plugins can use the "details.people" key to introduce custom
322 // HTML next to the number of participants
323 if (isset($this->addons['details.people']))
324 {
325 echo $this->addons['details.people'];
326
327 // unset details form to avoid displaying it twice
328 unset($this->addons['details.people']);
329 }
330 ?>
331 </div>
332
333 <!-- Define role to detect the supported hook -->
334 <!-- {"rule":"customizer","event":"onDisplayViewOrderinfo","key":"details.people","type":"field"} -->
335
336 </div>
337 <?php
338 }
339 ?>
340
341 <!-- Define role to detect the supported hook -->
342 <!-- {"rule":"customizer","event":"onDisplayViewOrderinfo","key":"details.custom","type":"field"} -->
343
344 <?php
345 // plugins can use the "details.custom" key to introduce custom
346 // HTML at the end of the block
347 if (isset($this->addons['details.custom']))
348 {
349 echo $this->addons['details.custom'];
350
351 // unset details form to avoid displaying it twice
352 unset($this->addons['details.custom']);
353 }
354 ?>
355
356 </div>
357