| @@ -15,8 +15,10 @@ | ||
| 15 | 15 | $busy = $this->busy; |
| 16 | 16 | $customer = $this->customer; |
| 17 | 17 | $payments = $this->payments; |
| 18 | 18 | |
| 19 | +// load registry and history | |
| 20 | +$registry = VBOBookingRegistry::getInstance($this->row, $this->rooms); | |
| 19 | 21 | $history_obj = VikBooking::getBookingHistoryInstance($row['id']); |
| 20 | 22 | |
| 21 | 23 | // availability helper |
| 22 | 24 | $av_helper = VikBooking::getAvailabilityInstance(); |
| @@ -223,9 +225,8 @@ | ||
| 223 | 225 | * @since 1.18.8 (J) - 1.8.8 (WP) |
| 224 | 226 | */ |
| 225 | 227 | $messagingAccountConfigurations = []; |
| 226 | 228 | if (class_exists('VCMMessagingAccountsModel')) { |
| 227 | - $registry = VBOBookingRegistry::getInstance($this->row, $this->rooms); | |
| 228 | 229 | $messagingAccountConfigurations = VCMMessagingAccountsModel::getInstance()->getConfigurationsData( |
| 229 | 230 | new VCMMessagingTemplateDecoratorBooking($registry), |
| 230 | 231 | [ |
| 231 | 232 | 'listings' => $registry->getBookedListingIds(), |
| @@ -1327,8 +1328,15 @@ | ||
| 1327 | 1328 | * @since 1.18.0 (J) - 1.8.0 (WP) |
| 1328 | 1329 | */ |
| 1329 | 1330 | $taskManager = VBOFactory::getTaskManager(); |
| 1330 | 1331 | $bookingTasks = VBOTaskModelTask::getInstance()->filterItems(['id_order' => $row['id']]); |
| 1332 | + | |
| 1333 | + /** | |
| 1334 | + * Check if the booking should have had passcodes generated. | |
| 1335 | + * | |
| 1336 | + * @since 1.18.16 (J) - 1.8.16 (WP) | |
| 1337 | + */ | |
| 1338 | + $shouldHavePasscodes = !$history_obj->hasEvent(['ND', 'MD']) && VBOFactory::getDoorAccessControl()->shouldBookingHavePasscodes($registry); | |
| 1331 | 1339 | ?> |
| 1332 | 1340 | |
| 1333 | 1341 | <div class="vbo-bookingdet-tab-cont" id="vbo-tab-details" style="display: block;"> |
| 1334 | 1342 | <div class="vbo-bookingdet-innercontainer"> |
| @@ -1375,8 +1383,20 @@ | ||
| 1375 | 1383 | </div> |
| 1376 | 1384 | </div> |
| 1377 | 1385 | <?php |
| 1378 | 1386 | } |
| 1387 | + if ($shouldHavePasscodes) { | |
| 1388 | + ?> | |
| 1389 | + <div class="vbo-bookingdet-detcont vbo-bookingdet-detcont-dac vbo-hidein-print"> | |
| 1390 | + <div class="vbo-bookingdet-lblcont"> | |
| 1391 | + <label><?php echo JText::translate('VBO_W_DOORACCESSCONTROL_TITLE'); ?></label> | |
| 1392 | + </div> | |
| 1393 | + <div class="vbo-bookingdet-inpwrap vbo-bookingdet-dac-gen"> | |
| 1394 | + <a href="<?php echo VBOFactory::getPlatform()->getUri()->addCSRF('index.php?option=com_vikbooking&task=bookings.generatePasscodes&bid=' . $row['id']); ?>" class="btn"><?php echo JText::translate('VBO_CREATE_PASSCODE'); ?></a> | |
| 1395 | + </div> | |
| 1396 | + </div> | |
| 1397 | + <?php | |
| 1398 | + } | |
| 1379 | 1399 | ?> |
| 1380 | 1400 | <div class="vbo-bookingdet-detcont<?php echo $row['closure'] > 0 ? ' vbo-bookingdet-closure' : ''; ?>"> |
| 1381 | 1401 | <?php |
| 1382 | 1402 | $custdata_parts = explode("\n", $row['custdata']); |
| @@ -1401,11 +1421,11 @@ | ||
| 1401 | 1421 | } |
| 1402 | 1422 | unset($custdet_parts[0]); |
| 1403 | 1423 | if ((!strcasecmp(trim($custdet_parts[1]), 'http') || !strcasecmp(trim($custdet_parts[1]), 'https')) && !empty($custdet_parts[2]) && strpos($custdet_parts[2], '//') !== false) { |
| 1404 | 1424 | // this is a URI |
| 1405 | - $custd_val = '<a href="' . trim(implode(':', $custdet_parts)) . '" target="_blank"><i class="' . VikBookingIcons::i('external-link') . '"></i></a>'; | |
| 1425 | + $custd_val = '<a href="' . htmlspecialchars(trim(implode(':', $custdet_parts))) . '" target="_blank"><i class="' . VikBookingIcons::i('external-link') . '"></i></a>'; | |
| 1406 | 1426 | } else { |
| 1407 | - $custd_val = trim(implode(':', $custdet_parts)); | |
| 1427 | + $custd_val = htmlspecialchars(trim(implode(':', $custdet_parts))); | |
| 1408 | 1428 | } |
| 1409 | 1429 | } |
| 1410 | 1430 | ?> |
| 1411 | 1431 | <div class="vbo-bookingdet-userdetail"> |
| @@ -1755,9 +1775,36 @@ | ||
| 1755 | 1775 | } |
| 1756 | 1776 | ?> |
| 1757 | 1777 | |
| 1758 | 1778 | </div> |
| 1779 | + <?php | |
| 1780 | + if ($phoneAlias = $registry->getAliasPhoneNumber()) { | |
| 1781 | + ?> | |
| 1782 | + <div class="vbo-bookingdet-detcont vbo-hidein-print"> | |
| 1783 | + <div class="vbo-bookingdet-lblcont"> | |
| 1784 | + <label for="phone_alias"><?php VikBookingIcons::e('user-shield'); ?> <?php echo JText::translate('VBO_PHONE_ALIAS'); ?></label> | |
| 1785 | + </div> | |
| 1786 | + <div class="vbo-bookingdet-inpwrap"> | |
| 1787 | + <div class="vbo-bookingdet-inpcont"> | |
| 1788 | + <input type="text" id="phone_alias" value="<?php echo $this->escape($phoneAlias); ?>" readonly /> | |
| 1789 | + </div> | |
| 1790 | + <span class="vbo-param-setting-comment"><?php echo JText::translate('VBO_PHONE_ALIAS_HELP'); ?></span> | |
| 1791 | + </div> | |
| 1759 | 1792 | |
| 1793 | + <!-- Define role to detect the supported hook --> | |
| 1794 | + <!-- {"rule":"customizer","event":"onDisplayViewVikBookingEditorderSidebar","key":"phone_alias","type":"field"} --> | |
| 1795 | + | |
| 1796 | + <?php | |
| 1797 | + if (isset($bookingSidebarForms['phone_alias'])) { | |
| 1798 | + echo $bookingSidebarForms['phone_alias']; | |
| 1799 | + } | |
| 1800 | + ?> | |
| 1801 | + | |
| 1802 | + </div> | |
| 1803 | + <?php | |
| 1804 | + } | |
| 1805 | + ?> | |
| 1806 | + | |
| 1760 | 1807 | <!-- Define role to detect the supported hook --> |
| 1761 | 1808 | <!-- {"rule":"customizer","event":"onDisplayViewVikBookingEditorderSidebar","type":"fieldset"} --> |
| 1762 | 1809 | |
| 1763 | 1810 | <?php |
| @@ -2713,9 +2760,9 @@ | ||
| 2713 | 2760 | ?> |
| 2714 | 2761 | </div> |
| 2715 | 2762 | <div class="vbo-bookingdet-noteslogs-cont"> |
| 2716 | 2763 | <div id="vbadminnotesdiv" class="vbo-extra-panel" style="display: block;"> |
| 2717 | - <textarea name="adminnotes" class="vbadminnotestarea"><?php echo strip_tags((string)$row['adminnotes']); ?></textarea> | |
| 2764 | + <textarea name="adminnotes" class="vbadminnotestarea"><?php echo JHtml::fetch('esc_textarea', (string) $row['adminnotes']); ?></textarea> | |
| 2718 | 2765 | <input type="submit" name="updadmnotes" value="<?php echo JText::translate('VBADMINNOTESUPD'); ?>" class="btn btn-success" /> |
| 2719 | 2766 | </div> |
| 2720 | 2767 | <?php |
| 2721 | 2768 | if ($takings) { |