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 / usernotes / tmpl / default.php
vikappointments / admin / views / usernotes / tmpl Last commit date
default.php 3 days ago index.html 3 days ago modal.php 3 days ago
default.php
359 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('formbehavior.chosen');
16 JHtml::fetch('vaphtml.assets.fontawesome');
17
18 $rows = $this->rows;
19
20 $filters = $this->filters;
21
22 $vik = VAPApplication::getInstance();
23
24 $user = JFactory::getUser();
25
26 $canEdit = $user->authorise('core.edit', 'com_vikappointments');
27
28 $is_searching = $this->hasFilters();
29
30 /**
31 * Trigger event to display custom HTML.
32 * In case it is needed to include any additional fields,
33 * it is possible to create a plugin and attach it to an event
34 * called "onDisplayViewUsernotesList". The event method receives the
35 * view instance as argument.
36 *
37 * @since 1.7
38 */
39 $forms = $this->onDisplayListView($is_searching);
40
41 ?>
42
43 <form action="index.php?option=com_vikappointments" method="post" name="adminForm" id="adminForm">
44
45 <div class="btn-toolbar" style="height: 32px;">
46
47 <div class="btn-group pull-left input-append">
48 <input type="text" name="keys" id="vapkeysearch" size="32"
49 value="<?php echo $this->escape($filters['keys']); ?>" placeholder="<?php echo $this->escape(JText::translate('JSEARCH_FILTER_SUBMIT')); ?>" />
50
51 <button type="submit" class="btn">
52 <i class="fas fa-search"></i>
53 </button>
54 </div>
55
56 <!-- Define role to detect the supported hook -->
57 <!-- {"rule":"customizer","event":"onDisplayViewUsernotesList","type":"search","key":"search"} -->
58
59 <?php
60 // plugins can use the "search" key to introduce custom
61 // filters within the search bar
62 if (isset($forms['search']))
63 {
64 echo $forms['search'];
65 }
66 ?>
67
68 <div class="btn-group pull-left">
69 <button type="button" class="btn <?php echo ($is_searching ? 'btn-primary' : ''); ?>" onclick="vapToggleSearchToolsButton(this);">
70 <?php echo JText::translate('JSEARCH_TOOLS'); ?>&nbsp;<i class="fas fa-caret-<?php echo ($is_searching ? 'up' : 'down'); ?>" id="vap-tools-caret"></i>
71 </button>
72 </div>
73
74 <div class="btn-group pull-left">
75 <button type="button" class="btn" onclick="clearFilters();">
76 <?php echo JText::translate('JSEARCH_FILTER_CLEAR'); ?>
77 </button>
78 </div>
79
80 <div class="btn-group pull-right hidden-phone">
81 <a href="index.php?option=com_vikappointments&amp;view=tags&amp;group=usernotes" class="btn">
82 <?php echo JText::translate('VAPMANAGETAGS'); ?>
83 </a>
84 </div>
85
86 </div>
87
88 <div class="btn-toolbar" id="vap-search-tools" style="height: 32px;<?php echo ($is_searching ? '' : 'display: none;'); ?>">
89
90 <?php
91 $options = array(
92 JHtml::fetch('select.option', '', JText::translate('VAPFILTERSELECTSTATUS')),
93 JHtml::fetch('select.option', 1, JText::translate('VAPPUBLIC')),
94 JHtml::fetch('select.option', 0, JText::translate('VAPPRIVATE')),
95 );
96 ?>
97 <div class="btn-group pull-left">
98 <select name="status" id="vap-status-sel" class="<?php echo (strlen($filters['status']) ? 'active' : ''); ?>" onchange="document.adminForm.submit();">
99 <?php echo JHtml::fetch('select.options', $options, 'value', 'text', $filters['status']); ?>
100 </select>
101 </div>
102
103 <?php
104 $tags = JHtml::fetch('vaphtml.admin.tags', 'usernotes', $blank = JText::translate('VAPFILTERSELECTTAG'));
105
106 if ($tags)
107 {
108 ?>
109 <div class="btn-group pull-left">
110 <select name="tag" id="vap-tag-sel" class="<?php echo ($filters['tag'] ? 'active' : ''); ?>" onchange="document.adminForm.submit();">
111 <?php echo JHtml::fetch('select.options', $tags, 'value', 'text', $filters['tag']); ?>
112 </select>
113 </div>
114 <?php
115 }
116 ?>
117
118 <!-- Define role to detect the supported hook -->
119 <!-- {"rule":"customizer","event":"onDisplayViewUsernotesList","type":"search","key":"filters"} -->
120
121 <?php
122 // plugins can use the "filters" key to introduce custom
123 // filters within the search bar
124 if (isset($forms['filters']))
125 {
126 echo $forms['filters'];
127 }
128 ?>
129
130 </div>
131
132 <?php
133 if (count($rows) == 0)
134 {
135 echo $vik->alert(JText::translate('JGLOBAL_NO_MATCHING_RESULTS'));
136 }
137 else
138 {
139 /**
140 * Trigger event to display custom columns.
141 *
142 * @since 1.7
143 */
144 $columns = $this->onDisplayTableColumns();
145 ?>
146
147 <!-- Define role to detect the supported hook -->
148 <!-- {"rule":"customizer","event":"onDisplayUsernotesTableTH","type":"th"} -->
149
150 <!-- Define role to detect the supported hook -->
151 <!-- {"rule":"customizer","event":"onDisplayUsernotesTableTD","type":"td"} -->
152
153 <table cellpadding="4" cellspacing="0" border="0" width="100%" class="<?php echo $vik->getAdminTableClass(); ?>">
154
155 <?php echo $vik->openTableHead(); ?>
156 <tr>
157
158 <th width="1%">
159 <?php echo $vik->getAdminToggle(count($rows)); ?>
160 </th>
161
162 <!-- ID -->
163
164 <th class="<?php echo $vik->getAdminThClass('left hidden-phone nowrap'); ?>" width="1%" style="text-align: left;">
165 <?php echo JHtml::fetch('vaphtml.admin.sort', 'VAPMANAGESERVICE1', 'n.id', $this->orderDir, $this->ordering); ?>
166 </th>
167
168 <!-- TITLE -->
169
170 <th class="<?php echo $vik->getAdminThClass('left'); ?>" width="25%" style="text-align: left;">
171 <?php echo JHtml::fetch('vaphtml.admin.sort', 'VAPMANAGEREVIEW2', 'n.title', $this->orderDir, $this->ordering); ?>
172 </th>
173
174 <!-- VISIBILITY -->
175
176 <th class="<?php echo $vik->getAdminThClass(); ?>" width="8%" style="text-align: center;">
177 <?php echo JText::translate('VAPPUBLIC'); ?>
178 </th>
179
180 <!-- CUSTOM -->
181
182 <?php
183 foreach ($columns as $k => $col)
184 {
185 ?>
186 <th data-id="<?php echo $this->escape($k); ?>" class="<?php echo $vik->getAdminThClass('left hidden-phone'); ?>">
187 <?php echo $col->th; ?>
188 </th>
189 <?php
190 }
191 ?>
192
193 <!-- AUTHOR -->
194
195 <th class="<?php echo $vik->getAdminThClass('hidden-phone left'); ?>" width="10%" style="text-align: left;">
196 <?php echo JText::translate('VAPMANAGERESERVATION41'); ?>
197 </th>
198
199 <!-- CREATION DATE -->
200
201 <th class="<?php echo $vik->getAdminThClass('hidden-phone left'); ?>" width="10%" style="text-align: left;">
202 <?php echo JHtml::fetch('vaphtml.admin.sort', JText::translate('VAPMANAGEMEDIA14'), 'n.createdon', $this->orderDir, $this->ordering); ?>
203 </th>
204
205 <!-- MODIFICATION DATE -->
206
207 <th class="<?php echo $vik->getAdminThClass('hidden-phone left'); ?>" width="10%" style="text-align: left;">
208 <?php echo JHtml::fetch('vaphtml.admin.sort', JText::translate('VAPMANAGEMEDIA19'), 'n.modifiedon', $this->orderDir, $this->ordering); ?>
209 </th>
210
211 </tr>
212 <?php echo $vik->closeTableHead(); ?>
213
214 <?php
215 for ($i = 0, $n = count($rows); $i < $n; $i++)
216 {
217 $row = $rows[$i];
218 ?>
219 <tr class="row<?php echo ($i % 2); ?>">
220
221 <td>
222 <input type="checkbox" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $row['id']; ?>" onClick="<?php echo $vik->checkboxOnClick(); ?>">
223 </td>
224
225 <!-- ID -->
226
227 <td class="hidden-phone">
228 <?php echo $row['id']; ?>
229 </td>
230
231 <!-- TITLE -->
232
233 <td>
234 <div class="td-primary td-pull-left">
235 <?php
236 if ($canEdit)
237 {
238 ?>
239 <a href="index.php?option=com_vikappointments&amp;task=usernote.edit&amp;cid[]=<?php echo $row['id']; ?>">
240 <?php echo $row['title']; ?>
241 </a>
242 <?php
243 }
244 else
245 {
246 echo $row['title'];
247 }
248 ?>
249 </div>
250
251 <div class="td-pull-right">
252 <?php
253 // load tag details
254 $tags = $this->tagModel->readTags($row['tags'], '*');
255
256 foreach ($tags as $tag)
257 {
258 // render tag
259 echo JHtml::fetch('vikappointments.tag', $tag, 'icon', array('class' => 'big', 'style' => 'margin-left: 2px;'));
260 }
261 ?>
262 </div>
263 </td>
264
265 <!-- VISIBILITY -->
266
267 <td style="text-align: center;">
268 <?php
269 if ($row['status'])
270 {
271 ?><i class="fas fa-eye ok big hasTooltip" title="<?php echo $this->escape(JText::translate('VAPPUBLIC')); ?>"></i><?php
272 }
273 else
274 {
275 ?><i class="fas fa-low-vision no big hasTooltip" title="<?php echo $this->escape(JText::translate('VAPPRIVATE')); ?>"></i><?php
276 }
277 ?>
278 </td>
279
280 <!-- CUSTOM -->
281
282 <?php
283 foreach ($columns as $k => $col)
284 {
285 ?>
286 <td data-id="<?php echo $this->escape($k); ?>" class="hidden-phone">
287 <?php echo isset($col->td[$i]) ? $col->td[$i] : ''; ?>
288 </td>
289 <?php
290 }
291 ?>
292
293 <!-- AUTHOR -->
294
295 <td class="hidden-phone">
296 <?php echo $row['author_name']; ?>
297 </td>
298
299 <!-- CREATION DATE -->
300
301 <td class="hidden-phone">
302 <?php echo JHtml::fetch('date', $row['createdon'], JText::translate('DATE_FORMAT_LC5')); ?>
303 </td>
304
305 <!-- MODIFICATION DATE -->
306
307 <td class="hidden-phone">
308 <?php
309 if (!VAPDateHelper::isNull($row['modifiedon']))
310 {
311 echo JHtml::fetch('date', $row['modifiedon'], JText::translate('DATE_FORMAT_LC5'));
312 }
313 else
314 {
315 echo '--';
316 }
317 ?>
318 </td>
319
320 </tr>
321 <?php
322 }
323 ?>
324 </table>
325 <?php
326 }
327 ?>
328
329 <input type="hidden" name="boxchecked" value="0" />
330 <input type="hidden" name="task" value="" />
331 <input type="hidden" name="view" value="usernotes" />
332
333 <input type="hidden" name="id_user" value="<?php echo $filters['id_user']; ?>" />
334 <input type="hidden" name="id_parent" value="<?php echo $filters['id_parent']; ?>" />
335 <input type="hidden" name="group" value="<?php echo $this->escape($filters['group']); ?>" />
336
337 <input type="hidden" name="filter_order" value="<?php echo $this->ordering; ?>" />
338 <input type="hidden" name="filter_order_Dir" value="<?php echo $this->orderDir; ?>" />
339
340 <?php echo JHtml::fetch('form.token'); ?>
341 <?php echo $this->navbut; ?>
342 </form>
343
344 <script>
345
346 jQuery(function($) {
347 VikRenderer.chosen('.btn-toolbar');
348 });
349
350 function clearFilters() {
351 jQuery('#vapkeysearch').val('');
352 jQuery('#vap-status-sel').updateChosen('');
353 jQuery('#vap-tag-sel').updateChosen('');
354
355 document.adminForm.submit();
356 }
357
358 </script>
359