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 / managecoupon / tmpl / default.php
vikappointments / admin / views / managecoupon / tmpl Last commit date
default.php 5 days ago default_assoc.php 5 days ago default_details.php 5 days ago default_publishing.php 5 days ago default_usages.php 5 days ago index.html 5 days ago
default.php
262 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('vaphtml.assets.select2');
15 JHtml::fetch('vaphtml.assets.fontawesome');
16
17 $coupon = $this->coupon;
18
19 $vik = VAPApplication::getInstance();
20
21 /**
22 * Trigger event to display custom HTML.
23 * In case it is needed to include any additional fields,
24 * it is possible to create a plugin and attach it to an event
25 * called "onDisplayViewCoupon". The event method receives the
26 * view instance as argument.
27 *
28 * @since 1.7
29 */
30 $forms = $this->onDisplayView();
31
32 ?>
33
34 <form name="adminForm" action="index.php" method="post" id="adminForm">
35
36 <?php echo $vik->openCard(); ?>
37
38 <!-- MAIN -->
39
40 <div class="span7">
41
42 <!-- DETAILS -->
43
44 <div class="row-fluid">
45 <div class="span12">
46 <?php
47 echo $vik->openFieldset(JText::translate('VAPMANAGECOUPONFIELDSET1'));
48 echo $this->loadTemplate('details');
49 ?>
50
51 <!-- Define role to detect the supported hook -->
52 <!-- {"rule":"customizer","event":"onDisplayViewCoupon","key":"details","type":"field"} -->
53
54 <?php
55 /**
56 * Look for any additional fields to be pushed within
57 * the "Details" fieldset (left-side).
58 *
59 * @since 1.7
60 */
61 if (isset($forms['details']))
62 {
63 echo $forms['details'];
64
65 // unset details form to avoid displaying it twice
66 unset($forms['details']);
67 }
68
69 echo $vik->closeFieldset();
70 ?>
71 </div>
72 </div>
73
74 <!-- NOTES -->
75
76 <div class="row-fluid">
77 <div class="span12">
78 <?php echo $vik->openFieldset(JText::translate('VAPMANAGECOUPON16')); ?>
79
80 <textarea name="notes" class="full-width" style="height: 160px; resize: vertical;"><?php echo $coupon->notes; ?></textarea>
81
82 <!-- Define role to detect the supported hook -->
83 <!-- {"rule":"customizer","event":"onDisplayViewCoupon","key":"notes","type":"field"} -->
84
85 <?php
86 /**
87 * Look for any additional fields to be pushed within
88 * the "Notes" fieldset (left-side).
89 *
90 * @since 1.7
91 */
92 if (isset($forms['notes']))
93 {
94 echo $forms['notes'];
95
96 // unset details form to avoid displaying it twice
97 unset($forms['notes']);
98 }
99
100 echo $vik->closeFieldset();
101 ?>
102 </div>
103 </div>
104
105 </div>
106
107 <!-- SIDEBAR -->
108
109 <div class="span5 full-width">
110
111 <!-- USAGES -->
112
113 <div class="row-fluid">
114 <div class="span12">
115 <?php
116 echo $vik->openFieldset(JText::translate('VAPMANAGECOUPONFIELDSET2'));
117 echo $this->loadTemplate('usages');
118 ?>
119
120 <!-- Define role to detect the supported hook -->
121 <!-- {"rule":"customizer","event":"onDisplayViewCoupon","key":"usages","type":"field"} -->
122
123 <?php
124 /**
125 * Look for any additional fields to be pushed within
126 * the "Usages" fieldset (sidebar).
127 *
128 * @since 1.7
129 */
130 if (isset($forms['usages']))
131 {
132 echo $forms['usages'];
133
134 // unset details form to avoid displaying it twice
135 unset($forms['usages']);
136 }
137
138 echo $vik->closeFieldset();
139 ?>
140 </div>
141 </div>
142
143 <!-- PUBLISHING -->
144
145 <div class="row-fluid">
146 <div class="span12">
147 <?php
148 echo $vik->openFieldset(JText::translate('JGLOBAL_FIELDSET_PUBLISHING'));
149 echo $this->loadTemplate('publishing');
150 ?>
151
152 <!-- Define role to detect the supported hook -->
153 <!-- {"rule":"customizer","event":"onDisplayViewCoupon","key":"publishing","type":"field"} -->
154
155 <?php
156 /**
157 * Look for any additional fields to be pushed within
158 * the "Publishing" fieldset (sidebar).
159 *
160 * @since 1.7
161 */
162 if (isset($forms['publishing']))
163 {
164 echo $forms['publishing'];
165
166 // unset details form to avoid displaying it twice
167 unset($forms['publishing']);
168 }
169
170 echo $vik->closeFieldset();
171 ?>
172 </div>
173 </div>
174
175 <!-- ASSIGNMENTS -->
176
177 <div class="row-fluid">
178 <div class="span12">
179 <?php
180 echo $vik->openFieldset(JText::translate('VAPFIELDSETASSOC'));
181 echo $this->loadTemplate('assoc');
182 ?>
183
184 <!-- Define role to detect the supported hook -->
185 <!-- {"rule":"customizer","event":"onDisplayViewCoupon","key":"assoc","type":"field"} -->
186
187 <?php
188 /**
189 * Look for any additional fields to be pushed within
190 * the "Assignments" fieldset (sidebar).
191 *
192 * @since 1.7
193 */
194 if (isset($forms['assoc']))
195 {
196 echo $forms['assoc'];
197
198 // unset details form to avoid displaying it twice
199 unset($forms['assoc']);
200 }
201
202 echo $vik->closeFieldset();
203 ?>
204 </div>
205 </div>
206
207 <!-- Define role to detect the supported hook -->
208 <!-- {"rule":"customizer","event":"onDisplayViewCoupon","type":"fieldset"} -->
209
210 <?php
211 /**
212 * Iterate remaining forms to be displayed
213 * at the end of the sidebar.
214 *
215 * @since 1.7
216 */
217 foreach ($forms as $formName => $formHtml)
218 {
219 $title = JText::translate($formName);
220 ?>
221 <div class="row-fluid">
222 <div class="span12">
223 <?php
224 echo $vik->openFieldset($title);
225 echo $formHtml;
226 echo $vik->closeFieldset();
227 ?>
228 </div>
229 </div>
230 <?php
231 }
232 ?>
233
234 </div>
235
236 <?php echo $vik->closeCard(); ?>
237
238 <?php echo JHtml::fetch('form.token'); ?>
239
240 <input type="hidden" name="id" value="<?php echo $coupon->id; ?>" />
241 <input type="hidden" name="task" value="" />
242 <input type="hidden" name="option" value="com_vikappointments" />
243 </form>
244
245 <script>
246
247 // validate
248
249 var validator = new VikFormValidator('#adminForm');
250
251 Joomla.submitbutton = function(task) {
252 if (task.indexOf('save') !== -1) {
253 if (validator.validate()) {
254 Joomla.submitform(task, document.adminForm);
255 }
256 } else {
257 Joomla.submitform(task, document.adminForm);
258 }
259 }
260
261 </script>
262