default.php
1 month ago
default_attachments.php
1 month ago
default_attachments_modal.php
1 month ago
default_details.php
1 month ago
default_options.php
1 month ago
index.html
1 month ago
default_options.php
108 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 | $note = $this->note; |
| 15 | |
| 16 | $vik = VAPApplication::getInstance(); |
| 17 | |
| 18 | ?> |
| 19 | |
| 20 | <!-- ACCESS - Dropdown --> |
| 21 | |
| 22 | <?php |
| 23 | $options = array( |
| 24 | JHtml::fetch('select.option', 0, 'VAPPRIVATE'), |
| 25 | JHtml::fetch('select.option', 1, 'VAPPUBLIC'), |
| 26 | ); |
| 27 | |
| 28 | echo $vik->openControl(JText::translate('VAPVISIBILITY')); ?> |
| 29 | <select name="status" id="vap-access-sel"> |
| 30 | <?php echo JHtml::fetch('select.options', $options, 'value', 'text', $note->status, true); ?> |
| 31 | </select> |
| 32 | <?php echo $vik->closeControl(); ?> |
| 33 | |
| 34 | <!-- NOTIFY CUSTOMER - Checkbox --> |
| 35 | |
| 36 | <?php |
| 37 | $control = array(); |
| 38 | $control['style'] = $note->status ? '' : 'display:none;'; |
| 39 | |
| 40 | // Specify a different ID because this page might be rendered also |
| 41 | // while editing a reservation inside an iframe. |
| 42 | // Since WordPress doesn't support iframes, the page will be retrieved via |
| 43 | // AJAX and appended into the document. For this reason, we need to use |
| 44 | // a unique ID to avoid conflicts with the "notifycust" checkbox used |
| 45 | // by the reservation page. |
| 46 | $yes = $vik->initRadioElement('usernote_notifycust_1', '', false); |
| 47 | $no = $vik->initRadioElement('usernote_notifycust_0', '', true); |
| 48 | |
| 49 | echo $vik->openControl(JText::translate('VAPMANAGERESERVATION24'), 'status-child', $control); |
| 50 | echo $vik->radioYesNo('notifycust', $yes, $no, false); |
| 51 | echo $vik->closeControl(); |
| 52 | ?> |
| 53 | |
| 54 | <!-- TAGS - Dropdown --> |
| 55 | |
| 56 | <?php |
| 57 | $tags = array(); |
| 58 | |
| 59 | foreach (JHtml::fetch('vaphtml.admin.tags', 'usernotes') as $tag) |
| 60 | { |
| 61 | $tags[] = $tag->text; |
| 62 | } |
| 63 | |
| 64 | $help = $vik->createPopover(array( |
| 65 | 'title' => JText::translate('VAPTAGS'), |
| 66 | 'content' => JText::translate('VAPTAGHELP'), |
| 67 | )); |
| 68 | |
| 69 | echo $vik->openControl(JText::translate('VAPTAGS') . $help); ?> |
| 70 | <input type="hidden" name="tags" id="vap-tags-sel" value="<?php echo $this->escape($note->tags); ?>" /> |
| 71 | <?php echo $vik->closeControl(); ?> |
| 72 | |
| 73 | <?php |
| 74 | JText::script('VAPTAGPLACEHOLDER'); |
| 75 | ?> |
| 76 | |
| 77 | <script> |
| 78 | |
| 79 | (function($) { |
| 80 | 'use strict'; |
| 81 | |
| 82 | $(function() { |
| 83 | $('#vap-access-sel').select2({ |
| 84 | minimumResultsForSearch: -1, |
| 85 | allowClear: false, |
| 86 | width: '90%', |
| 87 | }); |
| 88 | |
| 89 | $('#vap-access-sel').on('change', function() { |
| 90 | if ($(this).val() == 1) { |
| 91 | $('.status-child').show(); |
| 92 | } else { |
| 93 | $('.status-child').hide(); |
| 94 | } |
| 95 | }); |
| 96 | |
| 97 | $('#vap-tags-sel').select2({ |
| 98 | placeholder: Joomla.JText._('VAPTAGPLACEHOLDER'), |
| 99 | allowClear: true, |
| 100 | tags: <?php echo json_encode($tags); ?>, |
| 101 | tokenSeparators: [','], |
| 102 | width: '90%', |
| 103 | }); |
| 104 | }); |
| 105 | })(jQuery); |
| 106 | |
| 107 | </script> |
| 108 |