default.php
5 days ago
default_details.php
5 days ago
default_details_calendar.php
5 days ago
default_details_calendar_modal.php
5 days ago
default_details_contact.php
5 days ago
default_details_employee.php
5 days ago
default_details_notifications.php
5 days ago
default_details_visibility.php
5 days ago
default_fields.php
5 days ago
default_workdays.php
5 days ago
default_workdays_import.php
5 days ago
default_workdays_import_sample.php
5 days ago
default_workdays_import_upload.php
5 days ago
default_workdays_modal.php
5 days ago
index.html
5 days ago
default_fields.php
95 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 | $vik = VAPApplication::getInstance(); |
| 15 | |
| 16 | ?> |
| 17 | |
| 18 | <div class="row-fluid"> |
| 19 | |
| 20 | <div class="span6 full-width"> |
| 21 | <?php |
| 22 | echo $vik->openEmptyFieldset(); |
| 23 | |
| 24 | /** |
| 25 | * Render the custom fields form by using the apposite helper. |
| 26 | * |
| 27 | * Looking for a way to override the custom fields? Take a look |
| 28 | * at "/layouts/form/fields/" folder, which should contain all |
| 29 | * the supported types of custom fields. |
| 30 | * |
| 31 | * @since 1.7 |
| 32 | */ |
| 33 | echo VAPCustomFieldsRenderer::display($this->customFields, (array) $this->employee, $strict = false); |
| 34 | |
| 35 | echo $vik->closeEmptyFieldset(); |
| 36 | ?> |
| 37 | </div> |
| 38 | |
| 39 | <?php |
| 40 | /** |
| 41 | * Look for any additional fields to be pushed within |
| 42 | * the "Custom Fields" fieldset (right-side). |
| 43 | * |
| 44 | * NOTE: retrieved from "onDisplayViewEmployee" hook. |
| 45 | * |
| 46 | * @since 1.7 |
| 47 | */ |
| 48 | if (isset($this->forms['fields'])) |
| 49 | { |
| 50 | ?> |
| 51 | <div class="span6 full-width"> |
| 52 | <?php |
| 53 | echo $vik->openEmptyFieldset(); |
| 54 | echo $this->forms['fields']; |
| 55 | echo $vik->closeEmptyFieldset(); |
| 56 | ?> |
| 57 | </div> |
| 58 | <?php |
| 59 | |
| 60 | // unset details form to avoid displaying it twice |
| 61 | unset($this->forms['fields']); |
| 62 | } |
| 63 | ?> |
| 64 | |
| 65 | <!-- Define role to detect the supported hook --> |
| 66 | <!-- {"rule":"customizer","event":"onDisplayViewEmployee","type":"field","key":"fields"} --> |
| 67 | |
| 68 | </div> |
| 69 | |
| 70 | <?php |
| 71 | JText::script('JGLOBAL_SELECT_AN_OPTION'); |
| 72 | ?> |
| 73 | |
| 74 | <script> |
| 75 | |
| 76 | jQuery(function($) { |
| 77 | // render select |
| 78 | $('select.custom-field').each(function() { |
| 79 | // check whether the first option is a placeholder |
| 80 | let hasPlaceholder = $(this).find('option').first().text().length == 0; |
| 81 | |
| 82 | $(this).select2({ |
| 83 | // check whether we should specify a placeholder |
| 84 | placeholder: hasPlaceholder ? Joomla.JText._('JGLOBAL_SELECT_AN_OPTION') : '', |
| 85 | // disable search for select with 3 or lower options |
| 86 | minimumResultsForSearch: $(this).find('option').length > 3 ? 0 : -1, |
| 87 | // check whether the field supports empty values |
| 88 | allowClear: !$(this).hasClass('required') && hasPlaceholder ? true : false, |
| 89 | width: '90%', |
| 90 | }); |
| 91 | }); |
| 92 | }); |
| 93 | |
| 94 | </script> |
| 95 |