default.php
3 days ago
default_currency.php
3 days ago
default_currency_details.php
3 days ago
default_currency_providers.php
3 days ago
default_email.php
3 days ago
default_email_attachments.php
3 days ago
default_email_mail.php
3 days ago
default_email_notifications.php
3 days ago
default_email_template.php
3 days ago
default_global.php
3 days ago
default_global_calendars.php
3 days ago
default_global_columns.php
3 days ago
default_global_gdpr.php
3 days ago
default_global_sync.php
3 days ago
default_global_system.php
3 days ago
default_global_timezone.php
3 days ago
default_global_zip.php
3 days ago
default_listings.php
3 days ago
default_listings_employees.php
3 days ago
default_listings_services.php
3 days ago
default_shop.php
3 days ago
default_shop_details.php
3 days ago
default_shop_invoice.php
3 days ago
default_shop_packages.php
3 days ago
default_shop_recurrence.php
3 days ago
default_shop_reviews.php
3 days ago
default_shop_subscriptions.php
3 days ago
default_shop_waitlist.php
3 days ago
index.html
3 days ago
default_email_attachments.php
227 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 | /** |
| 19 | * Trigger event to display custom HTML. |
| 20 | * In case it is needed to include any additional fields, |
| 21 | * it is possible to create a plugin and attach it to an event |
| 22 | * called "onDisplayViewConfigEmailAttachments". The event method |
| 23 | * receives the view instance as argument. |
| 24 | * |
| 25 | * @since 1.7 |
| 26 | */ |
| 27 | $forms = $this->onDisplayView('EmailAttachments'); |
| 28 | |
| 29 | ?> |
| 30 | |
| 31 | <!-- MANUAL --> |
| 32 | |
| 33 | <div class="config-fieldset"> |
| 34 | |
| 35 | <div class="config-fieldset-head"> |
| 36 | <h3><?php echo JText::translate('VAPATTACHMENTS'); ?></h3> |
| 37 | </div> |
| 38 | |
| 39 | <div class="config-fieldset-body"> |
| 40 | |
| 41 | <!-- MAIL ATTACHMENT - File --> |
| 42 | |
| 43 | <?php |
| 44 | $help = $vik->createPopover(array( |
| 45 | 'title' => JText::translate('VAPMANAGECONFIG49'), |
| 46 | 'content' => JText::translate('VAPMANAGECONFIG49_DESC'), |
| 47 | )); |
| 48 | |
| 49 | // define media manager options |
| 50 | $options = array( |
| 51 | 'path' => VAPMAIL_ATTACHMENTS, |
| 52 | 'multiple' => true, |
| 53 | 'filter' => false, |
| 54 | 'preview' => false, |
| 55 | 'icon' => 'fas fa-upload', |
| 56 | ); |
| 57 | |
| 58 | if ($params['mailattach']) |
| 59 | { |
| 60 | // try to JSON decode the attachments list |
| 61 | $params['mailattach'] = json_decode($params['mailattach']); |
| 62 | |
| 63 | if ($params['mailattach'] === null) |
| 64 | { |
| 65 | // an error occurred while trying to decode the list, |
| 66 | // we probably have a single uploaded file (B.C.) |
| 67 | $params['mailattach'] = array($params['mailattach']); |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | echo $vik->openControl(JText::translate('VAPMANAGECONFIG49') . $help); |
| 72 | echo JHtml::fetch('vaphtml.mediamanager.field', 'mailattach', $params['mailattach'], 'vap-mail-attach', $options); |
| 73 | echo $vik->closeControl(); |
| 74 | ?> |
| 75 | |
| 76 | <!-- Define role to detect the supported hook --> |
| 77 | <!-- {"rule":"customizer","event":"onDisplayViewConfigEmailAttachments","key":"basic","type":"field"} --> |
| 78 | |
| 79 | <?php |
| 80 | /** |
| 81 | * Look for any additional fields to be pushed within |
| 82 | * the E-mail > Attachments > Attachments fieldset. |
| 83 | * |
| 84 | * @since 1.7 |
| 85 | */ |
| 86 | if (isset($forms['basic'])) |
| 87 | { |
| 88 | echo $forms['basic']; |
| 89 | |
| 90 | // unset details form to avoid displaying it twice |
| 91 | unset($forms['basic']); |
| 92 | } |
| 93 | ?> |
| 94 | |
| 95 | </div> |
| 96 | |
| 97 | </div> |
| 98 | |
| 99 | <!-- ICS --> |
| 100 | |
| 101 | <div class="config-fieldset"> |
| 102 | |
| 103 | <div class="config-fieldset-head"> |
| 104 | <h3>ICS</h3> |
| 105 | </div> |
| 106 | |
| 107 | <div class="config-fieldset-body"> |
| 108 | |
| 109 | <?php echo $vik->alert(JText::translate('VAPMANAGECONFIG65_DESC'), 'info'); ?> |
| 110 | |
| 111 | <!-- ATTACH ICS TO - Checkbox List --> |
| 112 | |
| 113 | <?php |
| 114 | $ics = explode(';', $params['icsattach']); |
| 115 | |
| 116 | for ($i = 0; $i < count($ics); $i++) |
| 117 | { |
| 118 | $yes = $vik->initRadioElement('', '', $ics[$i] == 1); |
| 119 | $no = $vik->initRadioElement('', '', $ics[$i] == 0); |
| 120 | |
| 121 | echo $vik->openControl(JText::translate('VAPCONFIGSMSAPITO' . $i)); |
| 122 | echo $vik->radioYesNo('icsattach' . ($i + 1), $yes, $no); |
| 123 | echo $vik->closeControl(); |
| 124 | } |
| 125 | ?> |
| 126 | |
| 127 | <!-- Define role to detect the supported hook --> |
| 128 | <!-- {"rule":"customizer","event":"onDisplayViewConfigEmailAttachments","key":"ics","type":"field"} --> |
| 129 | |
| 130 | <?php |
| 131 | /** |
| 132 | * Look for any additional fields to be pushed within |
| 133 | * the E-mail > Attachments > ICS fieldset. |
| 134 | * |
| 135 | * @since 1.7 |
| 136 | */ |
| 137 | if (isset($forms['ics'])) |
| 138 | { |
| 139 | echo $forms['ics']; |
| 140 | |
| 141 | // unset details form to avoid displaying it twice |
| 142 | unset($forms['ics']); |
| 143 | } |
| 144 | ?> |
| 145 | |
| 146 | </div> |
| 147 | |
| 148 | </div> |
| 149 | |
| 150 | <!-- CSV --> |
| 151 | |
| 152 | <div class="config-fieldset"> |
| 153 | |
| 154 | <div class="config-fieldset-head"> |
| 155 | <h3>CSV</h3> |
| 156 | </div> |
| 157 | |
| 158 | <div class="config-fieldset-body"> |
| 159 | |
| 160 | <?php echo $vik->alert(JText::translate('VAPMANAGECONFIG66_DESC'), 'info'); ?> |
| 161 | |
| 162 | <!-- ATTACH CSV TO - Checkbox List --> |
| 163 | |
| 164 | <?php |
| 165 | $csv = explode(';', $params['csvattach']); |
| 166 | |
| 167 | for ($i = 0; $i < count($csv); $i++) |
| 168 | { |
| 169 | $yes = $vik->initRadioElement('', '', $csv[$i] == 1); |
| 170 | $no = $vik->initRadioElement('', '', $csv[$i] == 0); |
| 171 | |
| 172 | echo $vik->openControl(JText::translate('VAPCONFIGSMSAPITO' . $i)); |
| 173 | echo $vik->radioYesNo('csvattach' . ($i + 1), $yes, $no); |
| 174 | echo $vik->closeControl(); |
| 175 | } |
| 176 | ?> |
| 177 | |
| 178 | <!-- Define role to detect the supported hook --> |
| 179 | <!-- {"rule":"customizer","event":"onDisplayViewConfigEmailAttachments","key":"csv","type":"field"} --> |
| 180 | |
| 181 | <?php |
| 182 | /** |
| 183 | * Look for any additional fields to be pushed within |
| 184 | * the E-mail > Attachments > CSV fieldset. |
| 185 | * |
| 186 | * @since 1.7 |
| 187 | */ |
| 188 | if (isset($forms['csv'])) |
| 189 | { |
| 190 | echo $forms['csv']; |
| 191 | |
| 192 | // unset details form to avoid displaying it twice |
| 193 | unset($forms['csv']); |
| 194 | } |
| 195 | ?> |
| 196 | |
| 197 | </div> |
| 198 | |
| 199 | </div> |
| 200 | |
| 201 | <!-- Define role to detect the supported hook --> |
| 202 | <!-- {"rule":"customizer","event":"onDisplayViewConfigEmailAttachments","type":"fieldset"} --> |
| 203 | |
| 204 | <?php |
| 205 | /** |
| 206 | * Iterate remaining forms to be displayed as new fieldsets |
| 207 | * within the E-mail > Attachments tab. |
| 208 | * |
| 209 | * @since 1.7 |
| 210 | */ |
| 211 | foreach ($forms as $formTitle => $formHtml) |
| 212 | { |
| 213 | ?> |
| 214 | <div class="config-fieldset"> |
| 215 | |
| 216 | <div class="config-fieldset-head"> |
| 217 | <h3><?php echo JText::translate($formTitle); ?></h3> |
| 218 | </div> |
| 219 | |
| 220 | <div class="config-fieldset-body"> |
| 221 | <?php echo $formHtml; ?> |
| 222 | </div> |
| 223 | |
| 224 | </div> |
| 225 | <?php |
| 226 | } |
| 227 |