default_details.php
| 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 | * Trigger event to display custom HTML. |
| 18 | * In case it is needed to include any additional fields, |
| 19 | * it is possible to create a plugin and attach it to an event |
| 20 | * called "onDisplayViewReservationDetails". |
| 21 | * It is also possible to use "onDisplayViewReservationDetailsSidebar" |
| 22 | * to include any additional fieldsets within the right sidebar. |
| 23 | * The event method receives the view instance as argument. |
| 24 | * |
| 25 | * @since 1.7 |
| 26 | */ |
| 27 | $detailsForms = $this->onDisplayView('Details'); |
| 28 | $sidebarForms = $this->onDisplayView('DetailsSidebar'); |
| 29 | |
| 30 | ?> |
| 31 | |
| 32 | <div class="row-fluid"> |
| 33 | |
| 34 | <!-- MAIN --> |
| 35 | |
| 36 | <div class="span7 full-width"> |
| 37 | |
| 38 | <!-- APPOINTMENTS --> |
| 39 | |
| 40 | <div class="row-fluid"> |
| 41 | <div class="span12"> |
| 42 | <?php |
| 43 | echo $vik->openFieldset(JText::translate('VAPMENUTITLEHEADER2')); |
| 44 | echo $this->loadTemplate('details_appointments'); |
| 45 | echo $vik->closeFieldset(); |
| 46 | ?> |
| 47 | </div> |
| 48 | </div> |
| 49 | |
| 50 | <!-- Define role to detect the supported hook --> |
| 51 | <!-- {"rule":"customizer","event":"onDisplayViewReservationDetails","type":"fieldset"} --> |
| 52 | |
| 53 | <?php |
| 54 | /** |
| 55 | * Iterate remaining forms to be displayed within |
| 56 | * the main panel. |
| 57 | * |
| 58 | * @since 1.7 |
| 59 | */ |
| 60 | foreach ($detailsForms as $formName => $formHtml) |
| 61 | { |
| 62 | $title = JText::translate($formName); |
| 63 | ?> |
| 64 | <div class="row-fluid"> |
| 65 | <div class="span12"> |
| 66 | <?php |
| 67 | echo $vik->openFieldset($title); |
| 68 | echo $formHtml; |
| 69 | echo $vik->closeFieldset(); |
| 70 | ?> |
| 71 | </div> |
| 72 | </div> |
| 73 | <?php |
| 74 | } |
| 75 | ?> |
| 76 | |
| 77 | </div> |
| 78 | |
| 79 | <!-- SIDEBAR --> |
| 80 | |
| 81 | <div class="span5 full-width"> |
| 82 | |
| 83 | <!-- ORDER --> |
| 84 | |
| 85 | <div class="row-fluid"> |
| 86 | <div class="span12"> |
| 87 | <?php |
| 88 | echo $vik->openFieldset(JText::translate('VAPORDER')); |
| 89 | echo $this->loadTemplate('details_order'); |
| 90 | ?> |
| 91 | |
| 92 | <!-- Define role to detect the supported hook --> |
| 93 | <!-- {"rule":"customizer","event":"onDisplayViewReservation","key":"order","type":"field"} --> |
| 94 | |
| 95 | <?php |
| 96 | /** |
| 97 | * Look for any additional fields to be pushed within |
| 98 | * the "Order" fieldset (left-side). |
| 99 | * |
| 100 | * NOTE: retrieved from "onDisplayViewReservation" hook. |
| 101 | * |
| 102 | * @since 1.6.6 |
| 103 | */ |
| 104 | if (isset($this->forms['order'])) |
| 105 | { |
| 106 | echo $this->forms['order']; |
| 107 | |
| 108 | // unset details form to avoid displaying it twice |
| 109 | unset($this->forms['order']); |
| 110 | } |
| 111 | |
| 112 | echo $vik->closeFieldset(); |
| 113 | ?> |
| 114 | </div> |
| 115 | </div> |
| 116 | |
| 117 | <!-- BILLING --> |
| 118 | |
| 119 | <div class="row-fluid"> |
| 120 | <div class="span12"> |
| 121 | <?php |
| 122 | echo $vik->openFieldset(JText::translate('VAPMANAGECUSTOMERTITLE2')); |
| 123 | echo $this->loadTemplate('details_billing'); |
| 124 | ?> |
| 125 | |
| 126 | <!-- Define role to detect the supported hook --> |
| 127 | <!-- {"rule":"customizer","event":"onDisplayViewReservation","key":"billing","type":"field"} --> |
| 128 | |
| 129 | <?php |
| 130 | /** |
| 131 | * Look for any additional fields to be pushed within |
| 132 | * the "Billing" fieldset (left-side). |
| 133 | * |
| 134 | * NOTE: retrieved from "onDisplayViewReservation" hook. |
| 135 | * |
| 136 | * @since 1.6.6 |
| 137 | */ |
| 138 | if (isset($this->forms['billing'])) |
| 139 | { |
| 140 | echo $this->forms['billing']; |
| 141 | |
| 142 | // unset details form to avoid displaying it twice |
| 143 | unset($this->forms['billing']); |
| 144 | } |
| 145 | |
| 146 | echo $vik->closeFieldset(); |
| 147 | ?> |
| 148 | </div> |
| 149 | </div> |
| 150 | |
| 151 | <!-- Define role to detect the supported hook --> |
| 152 | <!-- {"rule":"customizer","event":"onDisplayViewReservationDetailsSidebar","type":"fieldset"} --> |
| 153 | |
| 154 | <?php |
| 155 | /** |
| 156 | * Iterate remaining forms to be displayed within |
| 157 | * the sidebar (below "Billing" fieldset). |
| 158 | * |
| 159 | * @since 1.7 |
| 160 | */ |
| 161 | foreach ($sidebarForms as $formName => $formHtml) |
| 162 | { |
| 163 | $title = JText::translate($formName); |
| 164 | ?> |
| 165 | <div class="row-fluid"> |
| 166 | <div class="span12"> |
| 167 | <?php |
| 168 | echo $vik->openFieldset($title); |
| 169 | echo $formHtml; |
| 170 | echo $vik->closeFieldset(); |
| 171 | ?> |
| 172 | </div> |
| 173 | </div> |
| 174 | <?php |
| 175 | } |
| 176 | ?> |
| 177 | |
| 178 | </div> |
| 179 | |
| 180 | </div> |
| 181 |