default.php
2 days ago
default_currency.php
2 days ago
default_currency_details.php
2 days ago
default_currency_providers.php
2 days ago
default_email.php
2 days ago
default_email_attachments.php
2 days ago
default_email_mail.php
2 days ago
default_email_notifications.php
2 days ago
default_email_template.php
2 days ago
default_global.php
2 days ago
default_global_calendars.php
2 days ago
default_global_columns.php
2 days ago
default_global_gdpr.php
2 days ago
default_global_sync.php
2 days ago
default_global_system.php
2 days ago
default_global_timezone.php
2 days ago
default_global_zip.php
2 days ago
default_listings.php
2 days ago
default_listings_employees.php
2 days ago
default_listings_services.php
2 days ago
default_shop.php
2 days ago
default_shop_details.php
2 days ago
default_shop_invoice.php
2 days ago
default_shop_packages.php
2 days ago
default_shop_recurrence.php
2 days ago
default_shop_reviews.php
2 days ago
default_shop_subscriptions.php
2 days ago
default_shop_waitlist.php
2 days ago
index.html
2 days ago
default_email_notifications.php
159 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 | $params = $this->params; |
| 15 | |
| 16 | $vik = VAPApplication::getInstance(); |
| 17 | |
| 18 | $options = JHtml::fetch('vaphtml.admin.statuscodes', $group = ''); |
| 19 | |
| 20 | /** |
| 21 | * Trigger event to display custom HTML. |
| 22 | * In case it is needed to include any additional fields, |
| 23 | * it is possible to create a plugin and attach it to an event |
| 24 | * called "onDisplayViewConfigEmailNotifications". The event method |
| 25 | * receives the view instance as argument. |
| 26 | * |
| 27 | * @since 1.7 |
| 28 | */ |
| 29 | $forms = $this->onDisplayView('EmailNotifications'); |
| 30 | |
| 31 | ?> |
| 32 | |
| 33 | <div class="config-fieldset"> |
| 34 | |
| 35 | <div class="config-fieldset-head"> |
| 36 | <h3><?php echo JText::translate('VAPCONFIGBOOKINGNOTIF'); ?></h3> |
| 37 | </div> |
| 38 | |
| 39 | <div class="config-fieldset-body"> |
| 40 | |
| 41 | <?php echo $vik->alert(JText::translate('VAPCONFIGBOOKINGNOTIF_HELP'), 'info'); ?> |
| 42 | |
| 43 | <!-- SEND TO CUSTOMER WHEN - Dropdown --> |
| 44 | |
| 45 | <?php |
| 46 | $params['mailcustwhen'] = (array) json_decode($params['mailcustwhen']); |
| 47 | |
| 48 | echo $vik->openControl(JText::translate('VAPMANAGECONFIG71')); ?> |
| 49 | <select name="mailcustwhen[]" multiple> |
| 50 | <?php echo JHtml::fetch('select.options', $options, 'value', 'text', $params['mailcustwhen']); ?> |
| 51 | </select> |
| 52 | <?php echo $vik->closeControl(); ?> |
| 53 | |
| 54 | <!-- SEND TO EMPLOYEE WHEN - Dropdown --> |
| 55 | |
| 56 | <?php |
| 57 | $params['mailempwhen'] = (array) json_decode($params['mailempwhen']); |
| 58 | |
| 59 | echo $vik->openControl(JText::translate('VAPMANAGECONFIG72')); ?> |
| 60 | <select name="mailempwhen[]" multiple> |
| 61 | <?php echo JHtml::fetch('select.options', $options, 'value', 'text', $params['mailempwhen']); ?> |
| 62 | </select> |
| 63 | <?php echo $vik->closeControl(); ?> |
| 64 | |
| 65 | <!-- SEND TO ADMIN WHEN - Dropdown --> |
| 66 | |
| 67 | <?php |
| 68 | $params['mailadminwhen'] = (array) json_decode($params['mailadminwhen']); |
| 69 | |
| 70 | echo $vik->openControl(JText::translate("VAPMANAGECONFIG73")); ?> |
| 71 | <select name="mailadminwhen[]" multiple> |
| 72 | <?php echo JHtml::fetch('select.options', $options, 'value', 'text', $params['mailadminwhen']); ?> |
| 73 | </select> |
| 74 | <?php echo $vik->closeControl(); ?> |
| 75 | |
| 76 | <!-- OBSERVE STATUS CHANGE - Checkbox --> |
| 77 | |
| 78 | <?php |
| 79 | $yes = $vik->initRadioElement('', '', $params['notifyonstatuschange'] == 1); |
| 80 | $no = $vik->initRadioElement('', '', $params['notifyonstatuschange'] == 0); |
| 81 | |
| 82 | $help = $vik->createPopover([ |
| 83 | 'title' => JText::translate('VAPMANAGECONFIG130'), |
| 84 | 'content' => JText::translate('VAPMANAGECONFIG130_DESC'), |
| 85 | ]); |
| 86 | |
| 87 | echo $vik->openControl(JText::translate('VAPMANAGECONFIG130') . $help); |
| 88 | echo $vik->radioYesNo('notifyonstatuschange', $yes, $no); |
| 89 | echo $vik->closeControl(); |
| 90 | ?> |
| 91 | |
| 92 | <!-- Define role to detect the supported hook --> |
| 93 | <!-- {"rule":"customizer","event":"onDisplayViewConfigEmailNotifications","key":"booking","type":"field"} --> |
| 94 | |
| 95 | <?php |
| 96 | /** |
| 97 | * Look for any additional fields to be pushed within |
| 98 | * the E-mail > Notifications > Booking fieldset. |
| 99 | * |
| 100 | * @since 1.7 |
| 101 | */ |
| 102 | if (isset($forms['booking'])) |
| 103 | { |
| 104 | echo $forms['booking']; |
| 105 | |
| 106 | // unset details form to avoid displaying it twice |
| 107 | unset($forms['booking']); |
| 108 | } |
| 109 | ?> |
| 110 | |
| 111 | </div> |
| 112 | |
| 113 | </div> |
| 114 | |
| 115 | <!-- Define role to detect the supported hook --> |
| 116 | <!-- {"rule":"customizer","event":"onDisplayViewConfigEmailNotifications","type":"fieldset"} --> |
| 117 | |
| 118 | <?php |
| 119 | /** |
| 120 | * Iterate remaining forms to be displayed as new fieldsets |
| 121 | * within the E-mail > Notifications tab. |
| 122 | * |
| 123 | * @since 1.7 |
| 124 | */ |
| 125 | foreach ($forms as $formTitle => $formHtml) |
| 126 | { |
| 127 | ?> |
| 128 | <div class="config-fieldset"> |
| 129 | |
| 130 | <div class="config-fieldset-head"> |
| 131 | <h3><?php echo JText::translate($formTitle); ?></h3> |
| 132 | </div> |
| 133 | |
| 134 | <div class="config-fieldset-body"> |
| 135 | <?php echo $formHtml; ?> |
| 136 | </div> |
| 137 | |
| 138 | </div> |
| 139 | <?php |
| 140 | } |
| 141 | |
| 142 | JText::script('VAPFILTERSELECTSTATUS'); |
| 143 | ?> |
| 144 | |
| 145 | <script> |
| 146 | |
| 147 | jQuery(function($) { |
| 148 | $('select[name="mailcustwhen[]"]') |
| 149 | .add('select[name="mailempwhen[]"]') |
| 150 | .add('select[name="mailadminwhen[]"]') |
| 151 | .select2({ |
| 152 | placeholder: Joomla.JText._('VAPFILTERSELECTSTATUS'), |
| 153 | allowClear: true, |
| 154 | width: '100%', |
| 155 | }); |
| 156 | }); |
| 157 | |
| 158 | </script> |
| 159 |