closure.php
4 years ago
default.php
4 years ago
default_customer.php
1 day ago
default_details.php
3 months ago
default_fields.php
4 years ago
default_options.php
4 years ago
default_payment.php
4 years ago
index.html
4 years ago
list.php
4 years ago
default_fields.php
84 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 | // import custom fields loader |
| 15 | VAPLoader::import('libraries.customfields.loader'); |
| 16 | |
| 17 | // get first appointment |
| 18 | $app = $this->order->appointments[0]; |
| 19 | |
| 20 | // get relevant custom fields only |
| 21 | $fields = VAPCustomFieldsLoader::getInstance() |
| 22 | ->translate() |
| 23 | ->noRequiredCheckbox() |
| 24 | ->noSeparator() |
| 25 | ->forService($app->service->id) |
| 26 | ->ofEmployee($app->employee->id) |
| 27 | ->fetch(); |
| 28 | |
| 29 | ?> |
| 30 | |
| 31 | <h3><?php echo JText::translate('VAPMENUCUSTOMF'); ?></h3> |
| 32 | |
| 33 | <div class="order-fields"> |
| 34 | |
| 35 | <!-- Define role to detect the supported hook --> |
| 36 | <!-- {"rule":"customizer","event":"onDisplayViewOrderinfo","key":"fields.start","type":"field"} --> |
| 37 | |
| 38 | <?php |
| 39 | // plugins can use the "fields.start" key to introduce custom |
| 40 | // HTML before the custom fields |
| 41 | if (isset($this->addons['fields.start'])) |
| 42 | { |
| 43 | echo $this->addons['fields.start']; |
| 44 | |
| 45 | // unset details form to avoid displaying it twice |
| 46 | unset($this->addons['fields.start']); |
| 47 | } |
| 48 | |
| 49 | foreach ($fields as $field) |
| 50 | { |
| 51 | $key = $field['name']; |
| 52 | |
| 53 | if (isset($this->order->fields[$key]) && strlen($this->order->fields[$key])) |
| 54 | { |
| 55 | ?> |
| 56 | <div class="order-field"> |
| 57 | <label><?php echo $field['langname']; ?></label> |
| 58 | |
| 59 | <div class="order-field-value"> |
| 60 | <b><?php echo nl2br($this->order->fields[$key]); ?></b> |
| 61 | </div> |
| 62 | </div> |
| 63 | <?php |
| 64 | } |
| 65 | } |
| 66 | ?> |
| 67 | |
| 68 | <!-- Define role to detect the supported hook --> |
| 69 | <!-- {"rule":"customizer","event":"onDisplayViewOrderinfo","key":"fields.end","type":"field"} --> |
| 70 | |
| 71 | <?php |
| 72 | // plugins can use the "fields.end" key to introduce custom |
| 73 | // HTML next to the specified custom fields |
| 74 | if (isset($this->addons['fields.end'])) |
| 75 | { |
| 76 | echo $this->addons['fields.end']; |
| 77 | |
| 78 | // unset details form to avoid displaying it twice |
| 79 | unset($this->addons['fields.end']); |
| 80 | } |
| 81 | ?> |
| 82 | |
| 83 | </div> |
| 84 |