default.php
6 days ago
default_details.php
6 days ago
default_details_appointments.php
6 days ago
default_details_appointments_modal.php
6 days ago
default_details_appointments_option_modal.php
6 days ago
default_details_appointments_table.php
6 days ago
default_details_billing.php
6 days ago
default_details_order.php
6 days ago
default_details_order_custmail.php
6 days ago
default_fields.php
6 days ago
default_orderstatus.php
6 days ago
default_orderstatus_history.php
6 days ago
default_orderstatus_manage.php
6 days ago
default_usernotes.php
6 days ago
default_usernotes_main.php
6 days ago
default_usernotes_sidebar.php
6 days ago
index.html
6 days ago
default_usernotes_sidebar.php
67 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 | ?> |
| 15 | |
| 16 | <div class="control-group"> |
| 17 | <a |
| 18 | id="usernotes-link" |
| 19 | class="btn btn-block" |
| 20 | href="index.php?option=com_vikappointments&view=usernotes&id_parent=<?php echo $this->reservation->id; ?>&group=appointments" |
| 21 | > |
| 22 | <?php echo JText::translate('VAP_DISPLAY_ALL_NOTES'); ?> |
| 23 | </a> |
| 24 | </div> |
| 25 | |
| 26 | <?php |
| 27 | JText::script('VAPFORMCHANGEDCONFIRMTEXT'); |
| 28 | ?> |
| 29 | |
| 30 | <script> |
| 31 | |
| 32 | (function($) { |
| 33 | let observer; |
| 34 | |
| 35 | $(function() { |
| 36 | observer = new VikFormObserver('#adminForm'); |
| 37 | // exclude fields linked to intltel, because they auto-fill the |
| 38 | // dial code and the country code when the page loads |
| 39 | observer.exclude('input[name$="_dialcode"]'); |
| 40 | observer.exclude('input[name$="_country"]'); |
| 41 | |
| 42 | // freeze form with a short delay to allow any components to |
| 43 | // fill the form |
| 44 | setTimeout(() => { |
| 45 | observer.freeze(); |
| 46 | }, 256); |
| 47 | |
| 48 | $('#usernotes-link').on('click', (event) => { |
| 49 | if (!observer.isChanged()) { |
| 50 | // nothing has changed, go ahead |
| 51 | return true; |
| 52 | } |
| 53 | |
| 54 | // ask for a confirmation |
| 55 | let r = confirm(Joomla.JText._('VAPFORMCHANGEDCONFIRMTEXT')); |
| 56 | |
| 57 | if (!r) { |
| 58 | // do not leave the page |
| 59 | event.preventDefault(); |
| 60 | event.stopPropagation(); |
| 61 | return false; |
| 62 | } |
| 63 | }); |
| 64 | }); |
| 65 | })(jQuery); |
| 66 | |
| 67 | </script> |