PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / trunk
VikAppointments Services Booking Calendar vtrunk
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / admin / views / orderinfo / tmpl / default.php
vikappointments / admin / views / orderinfo / tmpl Last commit date
closure.php 4 years ago default.php 4 years ago default_customer.php 23 hours ago default_details.php 3 months ago default_fields.php 4 years ago default_options.php 4 years ago default_payment.php 4 years ago index.html 4 years ago list.php 4 years ago
default.php
181 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 JHtml::fetch('bootstrap.tooltip', '.hasTooltip');
15 JHtml::fetch('vaphtml.assets.fontawesome');
16
17 /**
18 * Trigger event to display custom HTML.
19 * In case it is needed to include any additional fields,
20 * it is possible to create a plugin and attach it to an event
21 * called "onDisplayViewOrderinfo". The event method receives the
22 * view instance as argument.
23 *
24 * @since 1.6.6
25 * @since 1.7 Changed hook from onDisplayViewPurchaserinfo.
26 */
27 $this->addons = $this->onDisplayView();
28
29 // get first appointment
30 $app = $this->order->appointments[0];
31
32 ?>
33
34 <style>
35
36 /* modal content pane */
37
38 .contentpane.component {
39 padding: 0 10px;
40 height: 100%;
41 /* do not scroll */
42 overflow: hidden;
43 }
44
45 </style>
46
47 <!-- container -->
48
49 <div class="order-container appointment">
50
51 <!-- left box : order details, customer info, order items -->
52
53 <div class="order-left-box">
54
55 <!-- top box : order details, customer info -->
56
57 <div class="order-left-top-box">
58
59 <!-- left box : order details -->
60
61 <div class="order-global-details">
62 <?php echo $this->loadTemplate('details'); ?>
63 </div>
64
65 <!-- right box : customer indo -->
66
67 <div class="order-customer-details">
68 <?php
69 echo $this->loadTemplate('customer');
70
71 // display custom fields toggle only in case
72 // the customer purchased at least an option
73 if ($app->options && $this->order->hasFields)
74 {
75 ?>
76 <!-- Custom Fields Toggle Button -->
77
78 <button type="button" class="btn" id="custom-fields-btn"><?php echo JText::translate('VAPSHOWCUSTFIELDS'); ?></button>
79 <?php
80 }
81 ?>
82 </div>
83
84 </div>
85
86 <!-- bottom box: order options, custom fields -->
87
88 <div class="order-left-bottom-box">
89
90 <?php
91 if ($app->options)
92 {
93 ?>
94 <!-- left box : order options -->
95
96 <div class="order-options-list">
97 <?php echo $this->loadTemplate('options'); ?>
98 </div>
99 <?php
100 }
101
102 if ($this->order->hasFields)
103 {
104 ?>
105 <!-- right box : custom fields -->
106
107 <div class="order-custom-fields" style="<?php echo ($app->options ? 'display: none;' : ''); ?>">
108 <?php echo $this->loadTemplate('fields'); ?>
109 </div>
110 <?php
111 }
112 ?>
113
114 </div>
115
116 <!-- Define role to detect the supported hook -->
117 <!-- {"rule":"customizer","event":"onDisplayViewOrderinfo","key":"main.bottom","type":"field"} -->
118
119 <?php
120 // plugins can use the "main.bottom" key to introduce custom
121 // HTML at the bottom of the page
122 if (isset($this->addons['main.bottom']))
123 {
124 echo $this->addons['main.bottom'];
125
126 // unset details form to avoid displaying it twice
127 unset($this->addons['main.bottom']);
128 }
129 ?>
130
131 </div>
132
133 <!-- right box : payment details, invoices -->
134
135 <div class="order-right-box">
136
137 <!-- top box : payment details -->
138
139 <div class="order-payment-details">
140 <?php echo $this->loadTemplate('payment'); ?>
141 </div>
142
143 </div>
144
145 </div>
146
147 <?php
148 JText::script('VAPSHOWCUSTFIELDS');
149 JText::script('VAPHIDECUSTFIELDS');
150 ?>
151
152 <script>
153
154 jQuery(function($) {
155 $('#custom-fields-btn').on('click', function() {
156 var fields = $('.order-custom-fields');
157
158 if (fields.is(':visible')) {
159 fields.hide();
160
161 $(this).text(Joomla.JText._('VAPSHOWCUSTFIELDS'));
162 } else {
163 fields.show();
164
165 $(this).text(Joomla.JText._('VAPHIDECUSTFIELDS'));
166 }
167 });
168 });
169
170 /**
171 * Check whether the parent window provides the function
172 * to update the footer buttons (edit, delete) of the modal.
173 *
174 * @since 1.6.6
175 */
176 if (window.parent.vapUpdateModalButtons) {
177 window.parent.vapUpdateModalButtons(<?php echo $this->order->id; ?>);
178 }
179
180 </script>
181