diff --git a/admin/themes/default/template/controllers/guest_registration/helpers/view/view.tpl b/admin/themes/default/template/controllers/guest_registration/helpers/view/view.tpl new file mode 100644 index 000000000..91b33e572 --- /dev/null +++ b/admin/themes/default/template/controllers/guest_registration/helpers/view/view.tpl @@ -0,0 +1,68 @@ +{** +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License version 3.0 +* that is bundled with this package in the file LICENSE.md +* It is also available through the world-wide-web at this URL: +* https://opensource.org/license/osl-3-0-php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to support@qloapps.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to a newer +* versions in the future. If you wish to customize this module for your needs +* please refer to https://store.webkul.com/customisation-guidelines for more information. +* +* @author Webkul IN +* @copyright Since 2010 Webkul +* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 +*} + +
+
+ + {l s='Guest Registration Card Information'} +
+ +
+ + +
+ +
+ {$guest_reg_card_info_tree} +
+ +
+ + +
+
+ + diff --git a/admin/themes/default/template/controllers/guest_registration/index.php b/admin/themes/default/template/controllers/guest_registration/index.php new file mode 100644 index 000000000..e7a621e6c --- /dev/null +++ b/admin/themes/default/template/controllers/guest_registration/index.php @@ -0,0 +1,32 @@ +{if $data.num_checkin_documents > 0}{$data.num_checkin_documents}{else}0{/if} +
  • + + {l s='GRC'} + +
  • diff --git a/classes/Address.php b/classes/Address.php index b6b69905b..5e11c50c1 100644 --- a/classes/Address.php +++ b/classes/Address.php @@ -543,14 +543,14 @@ class AddressCore extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'state` s ON s.`id_country` = cl.`id_country` AND s.`id_state` = a.`id_state` WHERE id_customer > 0 AND a.`deleted` = 0 AND - (a.`address1` LIKE \'%'.$query.'%\' OR - a.`postcode` LIKE \'%'.$query.'%\' OR - a.`city` LIKE \'%'.$query.'%\' OR - a.`phone` LIKE \'%'.$query.'%\' OR - a.`company` LIKE \'%'.$query.'%\' OR - a.`alias` LIKE \'%'.$query.'%\' OR - s.`name` LIKE \'%'.$query.'%\' OR - cl.`name` LIKE \'%'.$query.'%\' + (a.`address1` LIKE \'%'.pSQL($query).'%\' OR + a.`postcode` LIKE \'%'.pSQL($query).'%\' OR + a.`city` LIKE \'%'.pSQL($query).'%\' OR + a.`phone` LIKE \'%'.pSQL($query).'%\' OR + a.`company` LIKE \'%'.pSQL($query).'%\' OR + a.`alias` LIKE \'%'.pSQL($query).'%\' OR + s.`name` LIKE \'%'.pSQL($query).'%\' OR + cl.`name` LIKE \'%'.pSQL($query).'%\' ) '); } diff --git a/classes/CustomerMessage.php b/classes/CustomerMessage.php index 21798c993..db0dddded 100644 --- a/classes/CustomerMessage.php +++ b/classes/CustomerMessage.php @@ -146,7 +146,7 @@ class CustomerMessageCore extends ObjectModel ON (ct.`id_customer_thread` = cm.`id_customer_thread`) LEFT JOIN '._DB_PREFIX_.'customer c ON (IFNULL(ct.`id_customer`, ct.`email`) = IFNULL(c.`id_customer`, c.`email`)) - WHERE `message` LIKE \'%'.$query.'%\' + WHERE `message` LIKE \'%'.pSQL($query).'%\' '); } diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index 79d31a788..c382f07c4 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -677,8 +677,14 @@ abstract class PaymentModuleCore extends Module $orderTotals[$order->id]['excl'] -= $used['excl']; $cart_rules[$key]['remaining'] -= $used['excl']; } - - $order->addCartRule($cart_rule['obj']->id, $cart_rule['obj']->name, $values, 0, $cart_rule['obj']->free_shipping); + + $order->addCartRule( + $cart_rule['obj']->id, + $cart_rule['obj']->name, + array('tax_incl' => $used['incl'], 'tax_excl' => $used['excl']), + 0, + $cart_rule['obj']->free_shipping + ); if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && !in_array($cart_rule['obj']->id, $cart_rule_used)) { $cart_rule_used[] = $cart_rule['obj']->id; @@ -691,7 +697,7 @@ abstract class PaymentModuleCore extends Module $cart_rules_list[] = array( 'voucher_name' => $cart_rule['obj']->name, - 'voucher_reduction' => ($values['tax_incl'] != 0.00 ? '-' : '').Tools::displayPrice($values['tax_incl'], $this->context->currency, false) + 'voucher_reduction' => ($used['incl'] != 0.00 ? '-' : '').Tools::displayPrice($used['incl'], $this->context->currency, false) ); } diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 9166f1750..2b6636eef 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -1211,10 +1211,25 @@ class AdminControllerCore extends Controller if (ob_get_level() && ob_get_length() > 0) { ob_clean(); } + $fields_to_export = array(); + if((int)Configuration::get('PS_EXPORT_FIELDS_TYPE') === HelperList::QLO_EXPORT_FIELDS_SELECTED){ + $list_visibility = json_decode($this->context->cookie->{'list_visibility_'.$this->context->controller->controller_name}); + foreach ($this->fields_list as $key => $field) { + if ((!isset($field['displayed']) || $field['displayed']) + && (empty($field['optional']) + || (!is_array($list_visibility) && !empty($field['visible_default'])) + || (is_array($list_visibility) && in_array($key, $list_visibility)) + )) { + $fields_to_export[$key] = $field; + } + } + } + $this->getList($this->context->language->id, null, null, 0, false); if (!count($this->_list)) { return; } + $fields_to_export = (int)Configuration::get('PS_EXPORT_FIELDS_TYPE') === HelperList::QLO_EXPORT_FIELDS_SELECTED ? $fields_to_export : $this->fields_list; header('Content-type: text/csv'); header('Content-Type: application/force-download; charset=UTF-8'); @@ -1223,9 +1238,9 @@ class AdminControllerCore extends Controller $fd = fopen('php://output', 'wb'); $headers = array(); - foreach ($this->fields_list as $key => $datas) { + foreach ($fields_to_export as $key => $datas) { if ('PDF' === $datas['title']) { - unset($this->fields_list[$key]); + unset($fields_to_export[$key]); } else { if ('ID' === $datas['title']) { $headers[] = strtolower(Tools::htmlentitiesDecodeUTF8($datas['title'])); @@ -1239,7 +1254,7 @@ class AdminControllerCore extends Controller foreach ($this->_list as $i => $row) { $content = array(); $path_to_image = false; - foreach ($this->fields_list as $key => $params) { + foreach ($fields_to_export as $key => $params) { $field_value = isset($row[$key]) ? Tools::htmlentitiesDecodeUTF8(Tools::nl2br($row[$key])) : ''; if ($key == 'image') { if ($params['image'] != 'p' || Configuration::get('PS_LEGACY_IMAGES')) { diff --git a/classes/helper/HelperList.php b/classes/helper/HelperList.php index 5e0a4e76f..b5fbd344b 100644 --- a/classes/helper/HelperList.php +++ b/classes/helper/HelperList.php @@ -29,6 +29,8 @@ */ class HelperListCore extends Helper { + const QLO_EXPORT_FIELDS_ALL = 0; + const QLO_EXPORT_FIELDS_SELECTED = 1; /** * @var int|null */ diff --git a/classes/pdf/HTMLTemplateGuestRegistrationForm.php b/classes/pdf/HTMLTemplateGuestRegistrationForm.php new file mode 100644 index 000000000..c5905f6dd --- /dev/null +++ b/classes/pdf/HTMLTemplateGuestRegistrationForm.php @@ -0,0 +1,292 @@ +hotelBookingDetail = new HotelBookingDetail((int)$idHotelBookingDetail); + $this->order = new Order((int)$this->hotelBookingDetail->id_order); + $this->smarty = $smarty; + $this->date = Tools::displayDate($this->order->date_add); + $this->title = $this->order->getUniqReference(); + $this->shop = new Shop((int)$this->order->id_shop); + } + + /** + * Returns the template's HTML header + * + * @return string HTML header + */ + public function getHeader() + { + $this->assignCommonHeaderData(); + $this->smarty->assign(array('header' => HTMLTemplateGuestRegistrationForm::l('Guest Registration Card'))); + + return $this->smarty->fetch($this->getTemplate('header')); + } + + /** + * Returns the template's HTML content + * + * @return string HTML content + */ + public function getContent() + { + $idLang = (int)$this->order->id_lang; + $objHotelBookingDetail = $this->hotelBookingDetail; + $idHotel = (int)$objHotelBookingDetail->id_hotel; + + $objHotelBranchInformation = null; + $hotelCountry = ''; + + if ($idHotel) { + $objHotelBranchInformation = new HotelBranchInformation($idHotel, $idLang); + if (Validate::isLoadedObject($objHotelBranchInformation)) { + if ($objHotelBranchInformation->id_country) { + $objCountry = new Country((int)$objHotelBranchInformation->id_country, $idLang); + if (Validate::isLoadedObject($objCountry)) { + $hotelCountry = (string)$objCountry->name; + } + } + } else { + $objHotelBranchInformation = null; + } + } + + $ratePerNight = ''; + $arrivalDateTime = ''; + $departureDateTime = ''; + + if (Validate::isLoadedObject($objHotelBookingDetail)) { + $nights = (int)HotelHelper::getNumberOfDays($objHotelBookingDetail->date_from, $objHotelBookingDetail->date_to); + if ($nights > 0) { + $currency = new Currency((int)$this->order->id_currency); + $ratePerNight = Tools::displayPrice((float)$objHotelBookingDetail->total_price_tax_incl / $nights, $currency, false); + } + $arrivalDateTime = $objHotelBookingDetail->date_from ? Tools::displayDate($objHotelBookingDetail->date_from) : ''; + $departureDateTime = $objHotelBookingDetail->date_to ? Tools::displayDate($objHotelBookingDetail->date_to) : ''; + if ($arrivalDateTime && $objHotelBranchInformation && $objHotelBranchInformation->check_in && $objHotelBranchInformation->check_in != '00:00:00') { + $arrivalDateTime .= ' '.date('h:i a', strtotime($objHotelBranchInformation->check_in)); + } + if ($departureDateTime && $objHotelBranchInformation && $objHotelBranchInformation->check_out && $objHotelBranchInformation->check_out != '00:00:00') { + $departureDateTime .= ' '.date('h:i a', strtotime($objHotelBranchInformation->check_out)); + } + } + + $additionalGuestsRows = 0; + if (Validate::isLoadedObject($objHotelBookingDetail)) { + $totalGuests = (int)$objHotelBookingDetail->adults + (int)$objHotelBookingDetail->children; + $additionalGuestsRows = ($totalGuests > 1) ? ($totalGuests - 1) : 0; + } + + // Build saved config: [sectionId => [fieldId => true, ...]] + $grcFields = array(); + $grcInfoJson = Configuration::get('QLO_GUEST_REGISTRATION_CARD_INFO'); + if ($grcInfoJson !== false && $grcInfoJson !== '') { + $grcData = Tools::jsonDecode($grcInfoJson, true); + if (is_array($grcData)) { + foreach ($grcData as $sectionId => $fieldIds) { + $fieldIds = array_map('intval', (array)$fieldIds); + if (!empty($fieldIds)) { + $grcFields[(int)$sectionId] = array_flip($fieldIds); + } + } + } + } + + // When nothing saved, show all sections and fields + $allVisible = empty($grcFields); + + // One pass: build false|string label for every field directly. + // false = hidden, non-empty string = visible (used for both visibility check and label text in template). + $grcInfo = $this->hotelBookingDetail->getRegistrationCardInfo(); + $fieldLabels = array(); + foreach ($grcInfo as $sectionId => $section) { + $isSectionEnabled = $allVisible || isset($grcFields[$sectionId]); + $fieldLabels[$sectionId] = array(); + foreach ($section['fields'] as $fieldId => $fieldLabel) { + $isVisible = $isSectionEnabled && ($allVisible || isset($grcFields[$sectionId][$fieldId])); + $fieldLabels[$sectionId][$fieldId] = $isVisible ? $fieldLabel : false; + } + } + + $section1 = HotelBookingDetail::GRC_SECTION_GUEST_INFO; + $section2 = HotelBookingDetail::GRC_SECTION_TRAVEL_INFO; + $section3 = HotelBookingDetail::GRC_SECTION_BOOKING_INFO; + $section4 = HotelBookingDetail::GRC_SECTION_IDENTIFICATION; + $section5 = HotelBookingDetail::GRC_SECTION_ADDITIONAL_GUESTS; + $section6 = HotelBookingDetail::GRC_SECTION_BILLING_CORPORATE; + $section7 = HotelBookingDetail::GRC_SECTION_PAYMENT_DEPOSIT; + $section8 = HotelBookingDetail::GRC_SECTION_GUEST_SIGNATURE; + $section9 = HotelBookingDetail::GRC_SECTION_PROPERTY_REGS; + $section10 = HotelBookingDetail::GRC_SECTION_OFFICE_USE_ONLY; + + // $labels: false = field hidden, label string = field visible. + // Template uses {if $labels.key} for visibility AND {$labels.key} for label — no separate boolean assigns. + $labels = array( + // Section 1: Guest Information + 'title' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_TITLE], + 'full_name' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_FULL_NAME], + 'phone' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_PHONE], + 'email' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_EMAIL], + 'dob' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_DOB], + 'nationality' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_NATIONALITY], + 'city_country' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_CITY_COUNTRY], + 'postal_code' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_POSTAL_CODE], + 'address' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_ADDRESS], + + // Section 2: Travel Information + 'arrived_from' => $fieldLabels[$section2][HotelBookingDetail::GRC_TRAVEL_ARRIVED_FROM], + 'next_dest' => $fieldLabels[$section2][HotelBookingDetail::GRC_TRAVEL_NEXT_DESTINATION], + 'flight' => $fieldLabels[$section2][HotelBookingDetail::GRC_TRAVEL_FLIGHT_TRAIN], + 'vehicle' => $fieldLabels[$section2][HotelBookingDetail::GRC_TRAVEL_VEHICLE_REG], + 'purpose' => $fieldLabels[$section2][HotelBookingDetail::GRC_TRAVEL_PURPOSE_OF_VISIT], + + // Section 3: Booking Information + 'booking_ref' => $fieldLabels[$section3][HotelBookingDetail::GRC_BOOKING_REFERENCE], + 'booking_rate' => $fieldLabels[$section3][HotelBookingDetail::GRC_BOOKING_RATE_PER_NIGHT], + 'booking_arrival' => $fieldLabels[$section3][HotelBookingDetail::GRC_BOOKING_ARRIVAL], + 'booking_departure' => $fieldLabels[$section3][HotelBookingDetail::GRC_BOOKING_DEPARTURE], + 'booking_room_type' => $fieldLabels[$section3][HotelBookingDetail::GRC_BOOKING_ROOM_TYPE], + 'booking_room_number' => $fieldLabels[$section3][HotelBookingDetail::GRC_BOOKING_ROOM_NUMBER], + 'num_guests' => $fieldLabels[$section3][HotelBookingDetail::GRC_BOOKING_NUM_GUESTS], + + // Section 4: Identification Document + 'id_proof' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_IDENTITY_PROOF], + 'id_number' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_NUMBER], + 'passport' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_PASSPORT_NO], + 'place_of_issue' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_PLACE_OF_ISSUE], + 'date_of_issue' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_DATE_OF_ISSUE], + 'date_of_expiry' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_DATE_OF_EXPIRY], + 'visa' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_VISA_NUMBER], + 'valid_until' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_VALID_UNTIL], + 'arrival_in_country' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_ARRIVAL_DATE_IN_COUNTRY], + + // Section 5: Additional Guests + 'addguest_name' => $fieldLabels[$section5][HotelBookingDetail::GRC_ADD_GUEST_NAME], + 'addguest_id_type' => $fieldLabels[$section5][HotelBookingDetail::GRC_ADD_GUEST_ID_TYPE], + 'addguest_id_number' => $fieldLabels[$section5][HotelBookingDetail::GRC_ADD_GUEST_ID_NUMBER], + 'addguest_nationality' => $fieldLabels[$section5][HotelBookingDetail::GRC_ADD_GUEST_NATIONALITY], + + // Section 6: Billing & Corporate + 'company' => $fieldLabels[$section6][HotelBookingDetail::GRC_BILLING_COMPANY], + 'tax_id' => $fieldLabels[$section6][HotelBookingDetail::GRC_BILLING_TAX_ID], + + // Section 7: Payment & Deposit + 'payment_method' => $fieldLabels[$section7][HotelBookingDetail::GRC_PAYMENT_METHOD], + 'card_number' => $fieldLabels[$section7][HotelBookingDetail::GRC_PAYMENT_CARD_NUMBER], + 'security_deposit' => $fieldLabels[$section7][HotelBookingDetail::GRC_PAYMENT_SECURITY_DEPOSIT], + + // Section 8: Guest Signature + 'signature' => $fieldLabels[$section8][HotelBookingDetail::GRC_SIG_SIGNATURE], + 'sig_date' => $fieldLabels[$section8][HotelBookingDetail::GRC_SIG_DATE], + + // Section 9: Property Regulations (checkin/checkout share one visibility flag; two separate PDF sub-labels) + 'checkin_time' => $fieldLabels[$section9][HotelBookingDetail::GRC_PROP_CHECKIN_CHECKOUT_TIME] ? 'Check-in Time' : false, + 'checkout_time' => $fieldLabels[$section9][HotelBookingDetail::GRC_PROP_CHECKIN_CHECKOUT_TIME] ? 'Check-out Time' : false, + 'hotel_policies' => $fieldLabels[$section9][HotelBookingDetail::GRC_PROP_HOTEL_POLICIES], + + // Section 10: For Office Use Only + 'staff_name' => $fieldLabels[$section10][HotelBookingDetail::GRC_OFFICE_STAFF_NAME], + 'office_checkin_time' => $fieldLabels[$section10][HotelBookingDetail::GRC_OFFICE_CHECKIN_TIME], + 'id_verified' => $fieldLabels[$section10][HotelBookingDetail::GRC_OFFICE_ID_VERIFIED], + 'reg_no' => $fieldLabels[$section10][HotelBookingDetail::GRC_OFFICE_REG_NO], + ); + + $showLocalIdGroup = (bool)$labels['id_proof'] || (bool)$labels['id_number']; + $showIntIdGroup = (bool)$labels['passport'] || (bool)$labels['place_of_issue'] || (bool)$labels['date_of_issue'] + || (bool)$labels['date_of_expiry'] || (bool)$labels['visa'] || (bool)$labels['valid_until'] + || (bool)$labels['arrival_in_country']; + + $this->smarty->assign(array( + 'style_tab' => $this->smarty->fetch($this->getTemplate('invoice.style-tab')), + 'hotel' => $objHotelBranchInformation, + 'hotel_country' => $hotelCountry, + 'booking_reference' => $this->order->getUniqReference(), + 'arrival_date_time' => $arrivalDateTime, + 'departure_date_time' => $departureDateTime, + 'room_type' => Validate::isLoadedObject($objHotelBookingDetail) ? $objHotelBookingDetail->room_type_name : '', + 'room_number' => Validate::isLoadedObject($objHotelBookingDetail) ? $objHotelBookingDetail->room_num : '', + 'adults' => Validate::isLoadedObject($objHotelBookingDetail) ? (int)$objHotelBookingDetail->adults : 0, + 'children' => Validate::isLoadedObject($objHotelBookingDetail) ? (int)$objHotelBookingDetail->children : 0, + 'rate_per_night' => $ratePerNight, + 'additional_guests_rows' => $additionalGuestsRows, + + // Section visibility + 'show_section_guest_info' => !empty(array_filter($fieldLabels[$section1])), + 'show_section_travel_info' => !empty(array_filter($fieldLabels[$section2])), + 'show_section_booking_info' => !empty(array_filter($fieldLabels[$section3])), + 'show_section_identification' => !empty(array_filter($fieldLabels[$section4])), + 'show_section_additional_guests' => !empty(array_filter($fieldLabels[$section5])), + 'show_section_billing_corporate' => !empty(array_filter($fieldLabels[$section6])), + 'show_section_payment_deposit' => !empty(array_filter($fieldLabels[$section7])), + 'show_section_guest_signature' => !empty(array_filter($fieldLabels[$section8])), + 'show_section_property_regs' => !empty(array_filter($fieldLabels[$section9])), + 'show_section_office_use' => !empty(array_filter($fieldLabels[$section10])), + + 'section_additional_guests' => $grcInfo[$section5]['name'], + 'section_property_regs' => $grcInfo[$section9]['name'], + + 'local_id' => $showLocalIdGroup, + 'int_id' => $showIntIdGroup, + 'labels' => $labels, + )); + + return $this->smarty->fetch($this->getTemplate('guest-registration-form')); + } + + /** + * Returns the template filename when using bulk rendering + * + * @return string filename + */ + public function getBulkFilename() + { + return 'guest-registration-forms.pdf'; + } + + /** + * Returns the template filename + * + * @return string filename + */ + public function getFilename() + { + $filename = 'guest-registration-form-'.$this->order->reference; + if ($this->hotelBookingDetail->id) { + $filename .= '-room-'.$this->hotelBookingDetail->id; + } + + return $filename.'.pdf'; + } +} diff --git a/classes/pdf/PDF.php b/classes/pdf/PDF.php index 69985fa7f..e6de69011 100644 --- a/classes/pdf/PDF.php +++ b/classes/pdf/PDF.php @@ -37,6 +37,7 @@ class PDFCore protected $smarty; const TEMPLATE_INVOICE = 'Invoice'; + const TEMPLATE_GUEST_REGISTRATION_FORM = 'GuestRegistrationForm'; const TEMPLATE_ORDER_RETURN = 'OrderReturn'; const TEMPLATE_ORDER_SLIP = 'OrderSlip'; const TEMPLATE_DELIVERY_SLIP = 'DeliverySlip'; diff --git a/controllers/admin/AdminAddressesController.php b/controllers/admin/AdminAddressesController.php index 551e9c207..82be1dc94 100644 --- a/controllers/admin/AdminAddressesController.php +++ b/controllers/admin/AdminAddressesController.php @@ -384,13 +384,13 @@ class AdminAddressesControllerCore extends AdminController public function processExport($text_delimiter = '"') { $this->fields_list = array_merge($this->fields_list, array( - 'email' => array('title' => $this->l('Customer Email')), - 'phone' => array('title' => $this->l('Phone'), 'filter_key' => 'a!phone'), - 'phone_mobile' => array('title' => $this->l('Mobile phone')), - 'address1' => array('title' => $this->l('Address (2)')), - 'dni' => array('title' => $this->l('Identification Number')), - 'vat_number' => array('title' => $this->l('VAT number')), - 'other' => array('title' => $this->l('Other')), + 'email' => array('title' => $this->l('Customer Email'), 'displayed' => false), + 'phone' => array('title' => $this->l('Phone'), 'filter_key' => 'a!phone', 'displayed' => false), + 'phone_mobile' => array('title' => $this->l('Mobile phone'), 'displayed' => false), + 'address2' => array('title' => $this->l('Address (2)'), 'displayed' => false), + 'dni' => array('title' => $this->l('Identification Number'), 'displayed' => false), + 'vat_number' => array('title' => $this->l('VAT number'), 'displayed' => false), + 'other' => array('title' => $this->l('Other'), 'displayed' => false), )); return parent::processExport($text_delimiter); diff --git a/controllers/admin/AdminGuestRegistrationController.php b/controllers/admin/AdminGuestRegistrationController.php new file mode 100644 index 000000000..e7347a620 --- /dev/null +++ b/controllers/admin/AdminGuestRegistrationController.php @@ -0,0 +1,123 @@ +bootstrap = true; + $this->table = 'configuration'; + $this->className = 'Configuration'; + $this->identifier = 'id_configuration'; + + parent::__construct(); + } + + public function initContent() + { + $this->display = 'view'; + $this->initToolbar(); + parent::initContent(); + } + + public function renderView() + { + $grcInfoJson = Configuration::get('QLO_GUEST_REGISTRATION_CARD_INFO'); + $savedSections = array(); + if ($grcInfoJson !== false && $grcInfoJson !== '') { + $grcData = Tools::jsonDecode($grcInfoJson, true); + if (is_array($grcData)) { + $savedSections = $grcData; + } + } + + $allSelected = empty($savedSections); + $nodes = array(); + $objHotelBookingDetail = new HotelBookingDetail(); + foreach ($objHotelBookingDetail->getRegistrationCardInfo() as $sectionId => $section) { + $sectionFields = isset($savedSections[$sectionId]) ? $savedSections[$sectionId] : array(); + $fieldNodes = array(); + foreach ($section['fields'] as $fieldId => $fieldName) { + $fieldSelected = $allSelected || in_array($fieldId, $sectionFields); + $fieldNodes[] = array( + 'value' => $fieldId, + 'name' => $fieldName, + 'input_name' => 'grc_field_'.$sectionId, + 'selected' => $fieldSelected, + ); + } + $fieldsSelected = $allSelected || !empty(array_filter($fieldNodes, function ($n) { return $n['selected']; })); + $nodes[] = array( + 'value' => $sectionId, + 'name' => $section['name'], + 'input_name' => 'grc_section', + 'selected' => $fieldsSelected, + 'children' => $fieldNodes, + ); + } + + $tree = new HelperTree('grc-card-info-tree'); + $tree->setData($nodes) + ->setUseCheckBox(true) + ->setAutoSelectChildren(true) + ->setUseBulkActions(true); + + $this->context->smarty->assign(array( + 'guest_reg_card_info_tree' => $tree->render(), + 'guest_reg_card_form_action' => self::$currentIndex.'&token='.$this->token, + 'guest_reg_card_preview_img_url' => $this->context->link->getBaseLink().'img/admin/guest_registration_preview.jpg', + 'guest_reg_card_preview_title' => $this->l('Guest Registration Card Preview'), + )); + + return parent::renderView(); + } + + public function initToolbarTitle() + { + $this->toolbar_title = array($this->l('Guest Registration Card')); + } + + public function postProcess() + { + if (Tools::isSubmit('submitGrcCardInfo')) { + $grcInfo = array(); + $objHotelBookingDetail = new HotelBookingDetail(); + foreach (array_keys($objHotelBookingDetail->getRegistrationCardInfo()) as $sectionId) { + $fields = array_values(array_filter(array_map('intval', (array)Tools::getValue('grc_field_'.$sectionId, array())))); + if (!empty($fields)) { + $grcInfo[$sectionId] = $fields; + } + } + if (empty($grcInfo)) { + $this->errors[] = $this->l('Please select at least one field for the Guest Registration Card.'); + return; + } + Configuration::updateValue('QLO_GUEST_REGISTRATION_CARD_INFO', Tools::jsonEncode($grcInfo)); + Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&conf=4'); + return; + } + + parent::postProcess(); + } +} diff --git a/controllers/admin/AdminPdfController.php b/controllers/admin/AdminPdfController.php index 2b74dad25..4d256dded 100644 --- a/controllers/admin/AdminPdfController.php +++ b/controllers/admin/AdminPdfController.php @@ -64,6 +64,15 @@ class AdminPdfControllerCore extends AdminController } } + public function processGenerateGuestRegistrationFormPDF() + { + if (Tools::isSubmit('id_hotel_booking_detail')) { + $this->generateGuestRegistrationFormPDF((int)Tools::getValue('id_hotel_booking_detail')); + } else { + die(Tools::displayError('The hotel booking detail ID is missing.')); + } + } + public function processGenerateBookingVoucherPDF() { if (Tools::isSubmit('id_order')) { @@ -234,6 +243,17 @@ class AdminPdfControllerCore extends AdminController $this->generatePDF($order_invoice, PDF::TEMPLATE_INVOICE); } + public function generateGuestRegistrationFormPDF($idHotelBookingDetail) + { + $idHotelBookingDetail = (int)$idHotelBookingDetail; + if (!$idHotelBookingDetail || !Validate::isLoadedObject(new HotelBookingDetail($idHotelBookingDetail))) { + die(Tools::displayError('The hotel booking cannot be found within your database.')); + } + + $pdf = new PDF($idHotelBookingDetail, PDF::TEMPLATE_GUEST_REGISTRATION_FORM, Context::getContext()->smarty); + $pdf->render('I'); + } + public function generateBookingVoucherPDFByIdOrder($id_order) { $order = new Order((int)$id_order); diff --git a/controllers/admin/AdminPreferencesController.php b/controllers/admin/AdminPreferencesController.php index a97ec7b54..4ceb3f0f5 100644 --- a/controllers/admin/AdminPreferencesController.php +++ b/controllers/admin/AdminPreferencesController.php @@ -195,6 +195,19 @@ class AdminPreferencesControllerCore extends AdminController 'class' => 'fixed-width-xl', 'desc' => sprintf($this->l('If set to 0, the maximum limit will be %d characters.'), Configuration::PS_SHORT_DESC_LIMIT) ), + 'PS_EXPORT_FIELDS_TYPE' => array( + 'title' => $this->l('CSV export fields'), + 'desc' => $this->l('Choose whether list CSV exports include all fields, or only the fields currently checked in the "Available Fields" selector of the list being exported.'), + 'validation' => 'isInt', + 'cast' => 'intval', + 'type' => 'select', + 'list' => array( + array('id' => HelperList::QLO_EXPORT_FIELDS_ALL, 'name' => $this->l('All Fields')), + array('id' => HelperList::QLO_EXPORT_FIELDS_SELECTED, 'name' => $this->l('Selected Fields')), + ), + 'identifier' => 'id', + 'defaultValue' => HelperList::QLO_EXPORT_FIELDS_ALL, + ), // 'PS_DISPLAY_SUPPLIERS' => array( // 'title' => $this->l('Display suppliers and manufacturers'), // 'desc' => $this->l('Enable suppliers and manufacturers pages on your front office even when their respective modules are disabled.'), diff --git a/controllers/front/CategoryController.php b/controllers/front/CategoryController.php index 582344f7d..bdf716637 100644 --- a/controllers/front/CategoryController.php +++ b/controllers/front/CategoryController.php @@ -92,37 +92,45 @@ class CategoryControllerCore extends FrontController public function init() { // Get category ID - $id_category = (int)Tools::getValue('id_category'); - if (!$id_category || !Validate::isUnsignedId($id_category)) { - $this->errors[] = Tools::displayError('Missing category ID'); - } + $idCategory = (int) Tools::getValue('id_category'); + $this->category = new Category($idCategory, $this->context->language->id); - // validate dates if available $dateFrom = Tools::getValue('date_from'); $dateTo = Tools::getValue('date_to'); - $idHotel = HotelBranchInformation::getHotelIdByIdCategory($id_category); - if (!HotelHelper::validateDateRangeForHotel($dateFrom, $dateTo, $idHotel)) { + $idHotel = HotelBranchInformation::getHotelIdByIdCategory($idCategory); + + if (!$idCategory || !Validate::isUnsignedId($idCategory)) { Tools::redirect($this->context->link->getPageLink('pagenotfound')); - } - - // Instantiate category - $this->category = new Category($id_category, $this->context->language->id); - - parent::init(); - - // Check if the category is active and return 404 error if is disable. - if (!$this->category->active || !Validate::isLoadedObject($this->category) || !$this->category->inShop() || !$this->category->isAssociatedToShop() || in_array($this->category->id, array(Configuration::get('PS_HOME_CATEGORY'), Configuration::get('PS_ROOT_CATEGORY')))) { - header('HTTP/1.1 404 Not Found'); - header('Status: 404 Not Found'); + } elseif (!Validate::isLoadedObject($this->category) || !$this->category->active) { Tools::redirect($this->context->link->getPageLink('pagenotfound')); - } else - // Check if category can be accessible by current customer and return 403 if not - if (!$this->category->checkAccess($this->context->customer->id)) { + } elseif ($idHotel && !(new HotelBranchInformation())->hotelBranchInfoByCategoryId($idCategory)) { + Tools::redirect($this->context->link->getPageLink('pagenotfound')); + } elseif ($idHotel && !HotelHelper::validateDateRangeForHotel($dateFrom, $dateTo, $idHotel)) { + Tools::redirect($this->context->link->getPageLink('pagenotfound')); + } else { + parent::init(); + + if ( + !$this->category->inShop() + || !$this->category->isAssociatedToShop() + || in_array( + $this->category->id, + array( + Configuration::get('PS_HOME_CATEGORY'), + Configuration::get('PS_ROOT_CATEGORY') + ) + ) + ) { + header('HTTP/1.1 404 Not Found'); + header('Status: 404 Not Found'); + Tools::redirect($this->context->link->getPageLink('pagenotfound')); + } elseif (!$this->category->checkAccess($this->context->customer->id)) { header('HTTP/1.1 403 Forbidden'); header('Status: 403 Forbidden'); $this->errors[] = Tools::displayError('You do not have access to this category.'); $this->customer_access = false; } + } } /** @@ -130,14 +138,15 @@ class CategoryControllerCore extends FrontController */ public function initContent() { + if (!$this->customer_access) { + $this->display_column_left = false; + $this->display_column_right = false; + } + parent::initContent(); $this->setTemplate(_PS_THEME_DIR_.'category.tpl'); - if (!$this->customer_access) { - return; - } - $id_category = Tools::getValue('id_category'); $displayAllRoomsTypes = false; diff --git a/controllers/front/ProductController.php b/controllers/front/ProductController.php index ef4f509f7..db3e4c574 100644 --- a/controllers/front/ProductController.php +++ b/controllers/front/ProductController.php @@ -126,6 +126,12 @@ class ProductControllerCore extends FrontController $objHotelRoomType = new HotelRoomType(); if ($hotelRoomInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($this->product->id)) { $idHotel = (int) $hotelRoomInfo['id_hotel']; + + // If the hotel this room type belongs to is disabled, redirect to home page + if (!(new HotelBranchInformation())->hotelBranchesInfo(false, 1, 0, $idHotel)) { + Tools::redirect($this->context->link->getPageLink('pagenotfound')); + } + if (!HotelHelper::validateDateRangeForHotel($dateFrom, $dateTo, $idHotel)) { Tools::redirect($this->context->link->getPageLink('pagenotfound')); } diff --git a/img/admin/guest_registration_preview.jpg b/img/admin/guest_registration_preview.jpg new file mode 100644 index 000000000..a9562ffa6 Binary files /dev/null and b/img/admin/guest_registration_preview.jpg differ diff --git a/install/data/xml/tab.xml b/install/data/xml/tab.xml index 8909ed603..8c8205a9b 100644 --- a/install/data/xml/tab.xml +++ b/install/data/xml/tab.xml @@ -120,6 +120,9 @@ AdminOrderMessage + + AdminGuestRegistration + AdminCustomers diff --git a/install/data/xml/theme_meta.xml b/install/data/xml/theme_meta.xml index 0a23d98fd..506055fa9 100644 --- a/install/data/xml/theme_meta.xml +++ b/install/data/xml/theme_meta.xml @@ -15,7 +15,7 @@ - + @@ -29,9 +29,9 @@ - + - + diff --git a/install/langs/bg/data/tab.xml b/install/langs/bg/data/tab.xml index 4aabd8eb0..e64e85a36 100644 --- a/install/langs/bg/data/tab.xml +++ b/install/langs/bg/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/bn/data/tab.xml b/install/langs/bn/data/tab.xml index a8d950ef5..31b4e9ec8 100644 --- a/install/langs/bn/data/tab.xml +++ b/install/langs/bn/data/tab.xml @@ -39,6 +39,7 @@ + diff --git a/install/langs/br/data/tab.xml b/install/langs/br/data/tab.xml index 805ebb386..332e9b093 100644 --- a/install/langs/br/data/tab.xml +++ b/install/langs/br/data/tab.xml @@ -54,6 +54,7 @@ + diff --git a/install/langs/cs/data/tab.xml b/install/langs/cs/data/tab.xml index 9c0b9d1f0..55f106284 100644 --- a/install/langs/cs/data/tab.xml +++ b/install/langs/cs/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/de/data/tab.xml b/install/langs/de/data/tab.xml index ee0fabd35..560787ede 100644 --- a/install/langs/de/data/tab.xml +++ b/install/langs/de/data/tab.xml @@ -54,6 +54,7 @@ + diff --git a/install/langs/en/data/tab.xml b/install/langs/en/data/tab.xml index 2ccd45418..a47774d51 100644 --- a/install/langs/en/data/tab.xml +++ b/install/langs/en/data/tab.xml @@ -38,6 +38,7 @@ + diff --git a/install/langs/es/data/tab.xml b/install/langs/es/data/tab.xml index 57b3fdacc..8bc3e8062 100644 --- a/install/langs/es/data/tab.xml +++ b/install/langs/es/data/tab.xml @@ -36,6 +36,7 @@ + diff --git a/install/langs/fa/data/tab.xml b/install/langs/fa/data/tab.xml index aaca35d0d..8679f4027 100644 --- a/install/langs/fa/data/tab.xml +++ b/install/langs/fa/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/fr/data/tab.xml b/install/langs/fr/data/tab.xml index dec7e8e9b..9800a1cf6 100644 --- a/install/langs/fr/data/tab.xml +++ b/install/langs/fr/data/tab.xml @@ -54,6 +54,7 @@ + diff --git a/install/langs/he/data/tab.xml b/install/langs/he/data/tab.xml index 1f6a51228..599085de3 100644 --- a/install/langs/he/data/tab.xml +++ b/install/langs/he/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/hr/data/tab.xml b/install/langs/hr/data/tab.xml index 5164a0a52..3cc9d106e 100644 --- a/install/langs/hr/data/tab.xml +++ b/install/langs/hr/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/hu/data/tab.xml b/install/langs/hu/data/tab.xml index 3350dff34..228cb1e6a 100644 --- a/install/langs/hu/data/tab.xml +++ b/install/langs/hu/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/id/data/tab.xml b/install/langs/id/data/tab.xml index 1a4e8d112..bf7d18335 100644 --- a/install/langs/id/data/tab.xml +++ b/install/langs/id/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/it/data/tab.xml b/install/langs/it/data/tab.xml index b9a54ae8a..143d4b614 100644 --- a/install/langs/it/data/tab.xml +++ b/install/langs/it/data/tab.xml @@ -54,6 +54,7 @@ + diff --git a/install/langs/lt/data/tab.xml b/install/langs/lt/data/tab.xml index b11391910..57124e29a 100644 --- a/install/langs/lt/data/tab.xml +++ b/install/langs/lt/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/mk/data/tab.xml b/install/langs/mk/data/tab.xml index 06fbbe8cc..c0ea7d395 100644 --- a/install/langs/mk/data/tab.xml +++ b/install/langs/mk/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/nl/data/tab.xml b/install/langs/nl/data/tab.xml index 4b8107c26..27c6f9992 100644 --- a/install/langs/nl/data/tab.xml +++ b/install/langs/nl/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/no/data/tab.xml b/install/langs/no/data/tab.xml index 5d694eb85..b122490f4 100644 --- a/install/langs/no/data/tab.xml +++ b/install/langs/no/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/pl/data/tab.xml b/install/langs/pl/data/tab.xml index 10d1bed92..bc9b91e58 100644 --- a/install/langs/pl/data/tab.xml +++ b/install/langs/pl/data/tab.xml @@ -54,6 +54,7 @@ + diff --git a/install/langs/pt/data/tab.xml b/install/langs/pt/data/tab.xml index 379cd9823..41609f606 100644 --- a/install/langs/pt/data/tab.xml +++ b/install/langs/pt/data/tab.xml @@ -54,6 +54,7 @@ + diff --git a/install/langs/qc/data/tab.xml b/install/langs/qc/data/tab.xml index 3a8822b69..e323a18e3 100644 --- a/install/langs/qc/data/tab.xml +++ b/install/langs/qc/data/tab.xml @@ -54,6 +54,7 @@ + diff --git a/install/langs/ro/data/tab.xml b/install/langs/ro/data/tab.xml index 30bf5403e..9bcd1cbcf 100644 --- a/install/langs/ro/data/tab.xml +++ b/install/langs/ro/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/ru/data/tab.xml b/install/langs/ru/data/tab.xml index 57aafbcb4..d3cef5002 100644 --- a/install/langs/ru/data/tab.xml +++ b/install/langs/ru/data/tab.xml @@ -56,6 +56,7 @@ + diff --git a/install/langs/si/data/tab.xml b/install/langs/si/data/tab.xml index 265c4ce86..5e8c489a4 100644 --- a/install/langs/si/data/tab.xml +++ b/install/langs/si/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/sr/data/tab.xml b/install/langs/sr/data/tab.xml index a40848ea0..dd8f4ce9a 100644 --- a/install/langs/sr/data/tab.xml +++ b/install/langs/sr/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/sv/data/tab.xml b/install/langs/sv/data/tab.xml index fea2b137f..9c631deaa 100644 --- a/install/langs/sv/data/tab.xml +++ b/install/langs/sv/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/install/langs/tw/data/tab.xml b/install/langs/tw/data/tab.xml index 3da81a133..6bd9c423e 100644 --- a/install/langs/tw/data/tab.xml +++ b/install/langs/tw/data/tab.xml @@ -39,6 +39,7 @@ + diff --git a/install/langs/vn/data/tab.xml b/install/langs/vn/data/tab.xml index e4cea83ac..8e7f4cdf2 100644 --- a/install/langs/vn/data/tab.xml +++ b/install/langs/vn/data/tab.xml @@ -54,6 +54,7 @@ + diff --git a/install/langs/zh/data/tab.xml b/install/langs/zh/data/tab.xml index 525ba4daa..68906c9e1 100644 --- a/install/langs/zh/data/tab.xml +++ b/install/langs/zh/data/tab.xml @@ -37,6 +37,7 @@ + diff --git a/js/admin/orders.js b/js/admin/orders.js index 4fa65de93..0f3a5a38a 100644 --- a/js/admin/orders.js +++ b/js/admin/orders.js @@ -25,7 +25,9 @@ var current_product = null; var ajaxQueries = new Array(); - +if (typeof jQuery !== 'undefined' && jQuery.effects && !jQuery.effects.effect) { + jQuery.effects.effect = {}; +} $(document).ready(function() { // Init all events init(); diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index 60ec3fde2..8a6f7916e 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -23,6 +23,85 @@ class HotelBookingDetail extends ObjectModel { + // Guest Registration Card — Section IDs + const GRC_SECTION_GUEST_INFO = 1; + const GRC_SECTION_TRAVEL_INFO = 2; + const GRC_SECTION_BOOKING_INFO = 3; + const GRC_SECTION_IDENTIFICATION = 4; + const GRC_SECTION_ADDITIONAL_GUESTS = 5; + const GRC_SECTION_BILLING_CORPORATE = 6; + const GRC_SECTION_PAYMENT_DEPOSIT = 7; + const GRC_SECTION_GUEST_SIGNATURE = 8; + const GRC_SECTION_PROPERTY_REGS = 9; + const GRC_SECTION_OFFICE_USE_ONLY = 10; + + // Guest Registration Card — Guest Information fields (section 1) + const GRC_GUEST_TITLE = 1; + const GRC_GUEST_FULL_NAME = 2; + const GRC_GUEST_PHONE = 3; + const GRC_GUEST_EMAIL = 4; + const GRC_GUEST_DOB = 5; + const GRC_GUEST_NATIONALITY = 6; + const GRC_GUEST_CITY_COUNTRY = 7; + const GRC_GUEST_POSTAL_CODE = 8; + const GRC_GUEST_ADDRESS = 9; + + // Guest Registration Card — Travel Information fields (section 2) + const GRC_TRAVEL_ARRIVED_FROM = 1; + const GRC_TRAVEL_NEXT_DESTINATION = 2; + const GRC_TRAVEL_FLIGHT_TRAIN = 3; + const GRC_TRAVEL_VEHICLE_REG = 4; + const GRC_TRAVEL_PURPOSE_OF_VISIT = 5; + + // Guest Registration Card — Booking Information fields (section 3) + const GRC_BOOKING_REFERENCE = 1; + const GRC_BOOKING_RATE_PER_NIGHT = 2; + const GRC_BOOKING_ARRIVAL = 3; + const GRC_BOOKING_DEPARTURE = 4; + const GRC_BOOKING_ROOM_TYPE = 5; + const GRC_BOOKING_ROOM_NUMBER = 6; + const GRC_BOOKING_NUM_GUESTS = 7; + + // Guest Registration Card — Identification Document fields (section 4) + const GRC_ID_IDENTITY_PROOF = 1; + const GRC_ID_NUMBER = 2; + const GRC_ID_PASSPORT_NO = 3; + const GRC_ID_PLACE_OF_ISSUE = 4; + const GRC_ID_DATE_OF_ISSUE = 5; + const GRC_ID_DATE_OF_EXPIRY = 6; + const GRC_ID_VISA_NUMBER = 7; + const GRC_ID_VALID_UNTIL = 8; + const GRC_ID_ARRIVAL_DATE_IN_COUNTRY = 9; + + // Guest Registration Card — Additional Guests fields (section 5) + const GRC_ADD_GUEST_NAME = 1; + const GRC_ADD_GUEST_ID_TYPE = 2; + const GRC_ADD_GUEST_ID_NUMBER = 3; + const GRC_ADD_GUEST_NATIONALITY = 4; + + // Guest Registration Card — Billing & Corporate Details fields (section 6) + const GRC_BILLING_COMPANY = 1; + const GRC_BILLING_TAX_ID = 2; + + // Guest Registration Card — Payment & Deposit fields (section 7) + const GRC_PAYMENT_METHOD = 1; + const GRC_PAYMENT_CARD_NUMBER = 2; + const GRC_PAYMENT_SECURITY_DEPOSIT = 3; + + // Guest Registration Card — Guest Signature fields (section 8) + const GRC_SIG_SIGNATURE = 1; + const GRC_SIG_DATE = 2; + + // Guest Registration Card — Property Regulations fields (section 9) + const GRC_PROP_CHECKIN_CHECKOUT_TIME = 1; + const GRC_PROP_HOTEL_POLICIES = 2; + + // Guest Registration Card — For Office Use Only fields (section 10) + const GRC_OFFICE_STAFF_NAME = 1; + const GRC_OFFICE_CHECKIN_TIME = 2; + const GRC_OFFICE_ID_VERIFIED = 3; + const GRC_OFFICE_REG_NO = 4; + private $allReqDates; private $dltDates; private $partAvaiDates; // used to remove cart rooms from partial available rooms @@ -3814,4 +3893,119 @@ class HotelBookingDetail extends ObjectModel return parent::add($auto_date, $null_values); } + + /** + * Returns all Guest Registration Card sections and their fields. + * Modules may add, remove, or reorder sections/fields via the hook. + * + * @return array sectionId => ['name' => string, 'fields' => [fieldId => string, ...]] + */ + public function getRegistrationCardInfo() + { + $guestRegCardInfo = array( + self::GRC_SECTION_GUEST_INFO => array( + 'name' => $this->moduleInstance->l('Guest Information', 'hotelreservationsystem'), + 'fields' => array( + self::GRC_GUEST_TITLE => $this->moduleInstance->l('Title', 'hotelreservationsystem'), + self::GRC_GUEST_FULL_NAME => $this->moduleInstance->l('Full Name (As per ID)', 'hotelreservationsystem'), + self::GRC_GUEST_PHONE => $this->moduleInstance->l('Phone / Mobile', 'hotelreservationsystem'), + self::GRC_GUEST_EMAIL => $this->moduleInstance->l('Email', 'hotelreservationsystem'), + self::GRC_GUEST_DOB => $this->moduleInstance->l('Date of Birth', 'hotelreservationsystem'), + self::GRC_GUEST_NATIONALITY => $this->moduleInstance->l('Nationality', 'hotelreservationsystem'), + self::GRC_GUEST_CITY_COUNTRY => $this->moduleInstance->l('City / Country', 'hotelreservationsystem'), + self::GRC_GUEST_POSTAL_CODE => $this->moduleInstance->l('Postal Code', 'hotelreservationsystem'), + self::GRC_GUEST_ADDRESS => $this->moduleInstance->l('Address', 'hotelreservationsystem'), + ), + ), + self::GRC_SECTION_TRAVEL_INFO => array( + 'name' => $this->moduleInstance->l('Travel Information', 'hotelreservationsystem'), + 'fields' => array( + self::GRC_TRAVEL_ARRIVED_FROM => $this->moduleInstance->l('Arrived From', 'hotelreservationsystem'), + self::GRC_TRAVEL_NEXT_DESTINATION => $this->moduleInstance->l('Next Destination', 'hotelreservationsystem'), + self::GRC_TRAVEL_FLIGHT_TRAIN => $this->moduleInstance->l('Flight / Train Number', 'hotelreservationsystem'), + self::GRC_TRAVEL_VEHICLE_REG => $this->moduleInstance->l('Vehicle Reg. No.', 'hotelreservationsystem'), + self::GRC_TRAVEL_PURPOSE_OF_VISIT => $this->moduleInstance->l('Purpose of Visit', 'hotelreservationsystem'), + ), + ), + self::GRC_SECTION_BOOKING_INFO => array( + 'name' => $this->moduleInstance->l('Booking Information', 'hotelreservationsystem'), + 'fields' => array( + self::GRC_BOOKING_REFERENCE => $this->moduleInstance->l('Booking Reference No.', 'hotelreservationsystem'), + self::GRC_BOOKING_RATE_PER_NIGHT => $this->moduleInstance->l('Rate per Night', 'hotelreservationsystem'), + self::GRC_BOOKING_ARRIVAL => $this->moduleInstance->l('Arrival Date & Time', 'hotelreservationsystem'), + self::GRC_BOOKING_DEPARTURE => $this->moduleInstance->l('Departure Date & Time', 'hotelreservationsystem'), + self::GRC_BOOKING_ROOM_TYPE => $this->moduleInstance->l('Room Type', 'hotelreservationsystem'), + self::GRC_BOOKING_ROOM_NUMBER => $this->moduleInstance->l('Room Number', 'hotelreservationsystem'), + self::GRC_BOOKING_NUM_GUESTS => $this->moduleInstance->l('Number of Guests', 'hotelreservationsystem'), + ), + ), + self::GRC_SECTION_IDENTIFICATION => array( + 'name' => $this->moduleInstance->l('Identification Document', 'hotelreservationsystem'), + 'fields' => array( + self::GRC_ID_IDENTITY_PROOF => $this->moduleInstance->l('Identity Proof', 'hotelreservationsystem'), + self::GRC_ID_NUMBER => $this->moduleInstance->l('ID Number', 'hotelreservationsystem'), + self::GRC_ID_PASSPORT_NO => $this->moduleInstance->l('Passport No.', 'hotelreservationsystem'), + self::GRC_ID_PLACE_OF_ISSUE => $this->moduleInstance->l('Place of Issue', 'hotelreservationsystem'), + self::GRC_ID_DATE_OF_ISSUE => $this->moduleInstance->l('Date of Issue', 'hotelreservationsystem'), + self::GRC_ID_DATE_OF_EXPIRY => $this->moduleInstance->l('Date of Expiry', 'hotelreservationsystem'), + self::GRC_ID_VISA_NUMBER => $this->moduleInstance->l('Visa Number', 'hotelreservationsystem'), + self::GRC_ID_VALID_UNTIL => $this->moduleInstance->l('Valid Until', 'hotelreservationsystem'), + self::GRC_ID_ARRIVAL_DATE_IN_COUNTRY => $this->moduleInstance->l('Arrival Date in Country', 'hotelreservationsystem'), + ), + ), + self::GRC_SECTION_ADDITIONAL_GUESTS => array( + 'name' => $this->moduleInstance->l('Additional Guests', 'hotelreservationsystem'), + 'fields' => array( + self::GRC_ADD_GUEST_NAME => $this->moduleInstance->l('Guest Name', 'hotelreservationsystem'), + self::GRC_ADD_GUEST_ID_TYPE => $this->moduleInstance->l('ID Type', 'hotelreservationsystem'), + self::GRC_ADD_GUEST_ID_NUMBER => $this->moduleInstance->l('ID Number', 'hotelreservationsystem'), + self::GRC_ADD_GUEST_NATIONALITY => $this->moduleInstance->l('Nationality', 'hotelreservationsystem'), + ), + ), + self::GRC_SECTION_BILLING_CORPORATE => array( + 'name' => $this->moduleInstance->l('Billing & Corporate Details', 'hotelreservationsystem'), + 'fields' => array( + self::GRC_BILLING_COMPANY => $this->moduleInstance->l('Company / Agent', 'hotelreservationsystem'), + self::GRC_BILLING_TAX_ID => $this->moduleInstance->l('Tax ID / VAT No.', 'hotelreservationsystem'), + ), + ), + self::GRC_SECTION_PAYMENT_DEPOSIT => array( + 'name' => $this->moduleInstance->l('Payment & Deposit', 'hotelreservationsystem'), + 'fields' => array( + self::GRC_PAYMENT_METHOD => $this->moduleInstance->l('Payment Method', 'hotelreservationsystem'), + self::GRC_PAYMENT_CARD_NUMBER => $this->moduleInstance->l('Credit Card Number', 'hotelreservationsystem'), + self::GRC_PAYMENT_SECURITY_DEPOSIT => $this->moduleInstance->l('Security Deposit', 'hotelreservationsystem'), + ), + ), + self::GRC_SECTION_GUEST_SIGNATURE => array( + 'name' => $this->moduleInstance->l('Guest Signature', 'hotelreservationsystem'), + 'fields' => array( + self::GRC_SIG_SIGNATURE => $this->moduleInstance->l('Signature', 'hotelreservationsystem'), + self::GRC_SIG_DATE => $this->moduleInstance->l('Date', 'hotelreservationsystem'), + ), + ), + self::GRC_SECTION_PROPERTY_REGS => array( + 'name' => $this->moduleInstance->l('Property Regulations', 'hotelreservationsystem'), + 'fields' => array( + self::GRC_PROP_CHECKIN_CHECKOUT_TIME => $this->moduleInstance->l('Check-in / Check-out Time', 'hotelreservationsystem'), + self::GRC_PROP_HOTEL_POLICIES => $this->moduleInstance->l('Hotel Policies', 'hotelreservationsystem'), + ), + ), + self::GRC_SECTION_OFFICE_USE_ONLY => array( + 'name' => $this->moduleInstance->l('For Office Use Only', 'hotelreservationsystem'), + 'fields' => array( + self::GRC_OFFICE_STAFF_NAME => $this->moduleInstance->l('Staff Name', 'hotelreservationsystem'), + self::GRC_OFFICE_CHECKIN_TIME => $this->moduleInstance->l('Check-in Time', 'hotelreservationsystem'), + self::GRC_OFFICE_ID_VERIFIED => $this->moduleInstance->l('ID Verified', 'hotelreservationsystem'), + self::GRC_OFFICE_REG_NO => $this->moduleInstance->l('Registration No.', 'hotelreservationsystem'), + ), + ), + ); + + Hook::exec('actionGuestRegCardInfoModifier', array( + 'guest_registration_info' => &$guestRegCardInfo, + )); + + return $guestRegCardInfo; + } } diff --git a/modules/hotelreservationsystem/classes/HotelBranchRefundRules.php b/modules/hotelreservationsystem/classes/HotelBranchRefundRules.php index ede3ec95c..865c745eb 100644 --- a/modules/hotelreservationsystem/classes/HotelBranchRefundRules.php +++ b/modules/hotelreservationsystem/classes/HotelBranchRefundRules.php @@ -87,7 +87,7 @@ class HotelBranchRefundRules extends ObjectModel $condition .= ' AND `id_refund_rule` = '.(int)$idRefundRule; } if ($notInVals) { - $condition .= ' AND `id_refund_rule` NOT IN ('.implode(',', $notInVals).')'; + $condition .= ' AND `id_refund_rule` NOT IN ('.implode(',', array_map('intval', $notInVals)).')'; } return Db::getInstance()->delete( 'htl_branch_refund_rules', diff --git a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php index 817b017c4..ef7a22ea8 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php +++ b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php @@ -149,7 +149,7 @@ class HotelRoomTypeFeaturePricing extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'htl_room_type_feature_pricing` rtfp ON (rtfpr.`id_feature_price` = rtfp.`id_feature_price` AND rtfp.`id_product`='.(int) $idRoomType.') LEFT JOIN `'._DB_PREFIX_.'htl_room_type_feature_pricing_group` rtfpg - ON (rtfp.`id_feature_price` = rtfpg.`id_feature_price` '.($groups ? ' AND rtfpg.`id_group` IN ('.pSQL(implode(', ',$groups)).')' : ' ' ).') + ON (rtfp.`id_feature_price` = rtfpg.`id_feature_price` '.($groups ? ' AND rtfpg.`id_group` IN ('.implode(', ', array_map('intval', $groups)).')' : ' ' ).') WHERE 1 '.( !is_null($active) ? ' AND rtfp.`active`= '.(int) $active: ' ').' ' .(!is_null($skipFeaturePriceId) ? ' AND rtfpr.`id_feature_price`!='.(int) $skipFeaturePriceId : ' '); $sqlWhere = ''; if ($restrictions && is_array($restrictions)) { diff --git a/modules/hotelreservationsystem/classes/HotelRoomTypeGlobalDemandAdvanceOption.php b/modules/hotelreservationsystem/classes/HotelRoomTypeGlobalDemandAdvanceOption.php index 145fad433..cb3e88040 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomTypeGlobalDemandAdvanceOption.php +++ b/modules/hotelreservationsystem/classes/HotelRoomTypeGlobalDemandAdvanceOption.php @@ -113,7 +113,7 @@ class HotelRoomTypeGlobalDemandAdvanceOption extends ObjectModel $sql = 'SELECT * FROM `'._DB_PREFIX_.'htl_room_type_global_demand_advance_option` WHERE `id_global_demand` = '.(int)$idGlobalDemand; if (count($skipIds)) { - $sql .= ' AND `id_option` NOT IN ('.pSQL(implode(',', $skipIds)).')' ; + $sql .= ' AND `id_option` NOT IN ('.implode(',', array_map('intval', $skipIds)).')' ; } if ($advOptions = Db::getInstance()->executeS($sql)) { foreach ($advOptions as &$option) { diff --git a/modules/qlohotelreview/controllers/front/default.php b/modules/qlohotelreview/controllers/front/default.php index 0d2ca4f45..193198812 100644 --- a/modules/qlohotelreview/controllers/front/default.php +++ b/modules/qlohotelreview/controllers/front/default.php @@ -61,6 +61,12 @@ class QloHotelReviewDefaultModuleFrontController extends ModuleFrontController $errors['general'][] = $objModule->l('Invalid order ID.', 'default'); } + $submittedSecureKey = Tools::getValue('order_secure_key', ''); + if (!Validate::isLoadedObject($objOrder) || !$submittedSecureKey || $submittedSecureKey !== $objOrder->secure_key ) { + $errors['general'][] = $objModule->l('You are not authorized to submit a review.', 'default'); + $this->ajaxDie(json_encode(array('status' => false, 'errors' => $errors))); + } + if (!$subject) { $errors['by_key']['subject'] = $objModule->l('This field can not be empty.', 'default'); } elseif(!Validate::isGenericName($subject)) { diff --git a/modules/qlohotelreview/qlohotelreview.php b/modules/qlohotelreview/qlohotelreview.php index 086265f15..60ca665b5 100644 --- a/modules/qlohotelreview/qlohotelreview.php +++ b/modules/qlohotelreview/qlohotelreview.php @@ -199,10 +199,12 @@ class QloHotelReview extends Module && !QhrHotelReview::getByIdOrder($idOrder) ) { if ($hotel = QhrHotelReviewHelper::getHotelByOrder($idOrder)) { + $objOrder = new Order((int) $idOrder); $this->smarty->assign(array( 'id_order' => (int) $idOrder, 'id_hotel' => $hotel['id_hotel'], 'hotel_name' => $hotel['hotel_name'], + 'order_secure_key' => $objOrder->secure_key, )); return $this->display(__FILE__, 'booking-action.tpl'); } diff --git a/modules/qlohotelreview/views/js/hook/review.js b/modules/qlohotelreview/views/js/hook/review.js index 2db6b37b9..82d4597cb 100644 --- a/modules/qlohotelreview/views/js/hook/review.js +++ b/modules/qlohotelreview/views/js/hook/review.js @@ -21,10 +21,12 @@ */ var QhrReviewForm = { - init: function(idOrder, idHotel, hotelName) { + orderSecureKey: '', + init: function(idOrder, idHotel, hotelName, secureKey) { $('#add-review-form').find('[name="id_order"]').val(idOrder); $('#add-review-form').find('[name="id_hotel"]').val(idHotel); $('#add-review-popup').find('.hotel-name').html(hotelName); + QhrReviewForm.orderSecureKey = secureKey || ''; QhrReviewImages.init(); }, show: function() { @@ -47,6 +49,7 @@ var QhrReviewForm = { formData.append('ajax', true); formData.append('token', qlo_hotel_review_js_vars.review_ajax_token); formData.append('action', 'AddReview'); + formData.append('order_secure_key', QhrReviewForm.orderSecureKey); $.ajax({ url: qlo_hotel_review_js_vars.review_ajax_link, data: formData, @@ -228,7 +231,8 @@ $(document).on('click', '#add-review-btn', function(e) { var idOrder = parseInt($(this).data('id-order')); var idHotel = parseInt($(this).data('id-hotel')); var hotelName = $(this).data('hotel-name'); - QhrReviewForm.init(idOrder, idHotel, hotelName); + var secureKey = $(this).data('secure-key') || ''; + QhrReviewForm.init(idOrder, idHotel, hotelName, secureKey); QhrReviewForm.show(); }); diff --git a/modules/qlohotelreview/views/templates/hook/booking-action.tpl b/modules/qlohotelreview/views/templates/hook/booking-action.tpl index fb704c1ed..66c64a095 100644 --- a/modules/qlohotelreview/views/templates/hook/booking-action.tpl +++ b/modules/qlohotelreview/views/templates/hook/booking-action.tpl @@ -20,6 +20,6 @@ * @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 *} - + {l s='Write a Review' mod='qlohotelreview'} \ No newline at end of file diff --git a/pdf/guest-registration-form.tpl b/pdf/guest-registration-form.tpl new file mode 100644 index 000000000..7a193936a --- /dev/null +++ b/pdf/guest-registration-form.tpl @@ -0,0 +1,631 @@ +{* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License version 3.0 +* that is bundled with this package in the file LICENSE.txt +* It is also available through the world-wide-web at this URL: +* https://opensource.org/licenses/AFL-3.0 +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to a newer +* versions in the future. If you wish to customize this module for your +* needs please refer to CustomizationPolicy.txt file inside our module for more information. +* +* @author Webkul IN +* @copyright Since 2010 Webkul +* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 +*} + +{$style_tab} + + + + + + + + + + {* ===== SECTION 1: GUEST INFORMATION ===== *} + {if $show_section_guest_info} + + + + + {/if} + + {* ===== SECTION 2: TRAVEL INFORMATION ===== *} + {if $show_section_travel_info} + + + + + {/if} + + {* ===== SECTION 3: BOOKING INFORMATION ===== *} + {if $show_section_booking_info} + + + + + {/if} + + {* ===== SECTION 4: IDENTIFICATION DOCUMENT ===== *} + {if $show_section_identification} + + + + + {/if} + + {* ===== SECTION 5: ADDITIONAL GUESTS ===== *} + {if $show_section_additional_guests} + + + + + {/if} + + {* ===== SECTION 6: BILLING & CORPORATE DETAILS ===== *} + {if $show_section_billing_corporate} + + + + + {/if} + + {* ===== SECTION 7: PAYMENT & DEPOSIT ===== *} + {if $show_section_payment_deposit} + + + + + {/if} + + {* ===== SECTION 8: GUEST SIGNATURE ===== *} + {if $show_section_guest_signature} + + + + + + + {/if} + + {* ===== SECTION 9: PROPERTY REGULATIONS ===== *} + {if $show_section_property_regs} + + + + + {/if} + + {* ===== SECTION 10: FOR OFFICE USE ONLY ===== *} + {if $show_section_office_use} + + + + + {/if} + + {if isset($HOOK_DISPLAY_PDF)} + + + + + + + {/if} +
    + {if $hotel}{$hotel->hotel_name|escape:'html':'UTF-8'}{/if} +
    + {if $hotel && $hotel->city}{$hotel->city|escape:'html':'UTF-8'}{if $hotel_country}, {/if}{/if}{if $hotel_country}{$hotel_country|escape:'html':'UTF-8'}{/if} +
     
    + + + + + + +
    + + {if $labels.title || $labels.full_name} + + {if $labels.title && $labels.full_name} + + + + + {elseif $labels.title} + + + {else} + + + {/if} + + {/if} + {if $labels.phone || $labels.email} + + {if $labels.phone && $labels.email} + + + + + {elseif $labels.phone} + + + {else} + + + {/if} + + {/if} + {if $labels.dob || $labels.nationality} + + {if $labels.dob && $labels.nationality} + + + + + {elseif $labels.dob} + + + {else} + + + {/if} + + {/if} + {if $labels.city_country || $labels.postal_code} + + {if $labels.city_country && $labels.postal_code} + + + + + {elseif $labels.city_country} + + + {else} + + + {/if} + + {/if} + {if $labels.address} + + + + + {/if} +
    {l s=$labels.title pdf='true'}: + □ {l s='Mr.' pdf='true'}   + □ {l s='Ms.' pdf='true'}   + {l s=$labels.full_name pdf='true'}:________________________{l s=$labels.title pdf='true'}: + □ {l s='Mr.' pdf='true'}   + □ {l s='Ms.' pdf='true'}   + {l s=$labels.full_name pdf='true'}:________________________
    {l s=$labels.phone pdf='true'}:________________________{l s=$labels.email pdf='true'}:________________________{l s=$labels.phone pdf='true'}:________________________{l s=$labels.email pdf='true'}:________________________
    {l s=$labels.dob pdf='true'}:____ / ____ / ________{l s=$labels.nationality pdf='true'}:________________________{l s=$labels.dob pdf='true'}:____ / ____ / ________{l s=$labels.nationality pdf='true'}:________________________
    {l s=$labels.city_country pdf='true'}:________________________{l s=$labels.postal_code pdf='true'}:________________________{l s=$labels.city_country pdf='true'}:________________________{l s=$labels.postal_code pdf='true'}:________________________
    {l s=$labels.address pdf='true'}:__________________________________________________________________________________
    +
    +
     
    + + + + + + +
    + + {if $labels.arrived_from || $labels.next_dest} + + {if $labels.arrived_from && $labels.next_dest} + + + + + {elseif $labels.arrived_from} + + + {else} + + + {/if} + + {/if} + {if $labels.flight || $labels.vehicle} + + {if $labels.flight && $labels.vehicle} + + + + + {elseif $labels.flight} + + + {else} + + + {/if} + + {/if} + {if $labels.purpose} + + + + + {/if} +
    {l s=$labels.arrived_from pdf='true'}:________________________{l s=$labels.next_dest pdf='true'}:___________________{l s=$labels.arrived_from pdf='true'}:________________________{l s=$labels.next_dest pdf='true'}:___________________
    {l s=$labels.flight pdf='true'}:________________________{l s=$labels.vehicle pdf='true'}:___________________{l s=$labels.flight pdf='true'}:________________________{l s=$labels.vehicle pdf='true'}:___________________
    {l s=$labels.purpose pdf='true'}:________________________
    +
    +
     
    + + + + + + +
    + + {if $labels.booking_ref || $labels.booking_rate} + + {if $labels.booking_ref && $labels.booking_rate} + + + + + {elseif $labels.booking_ref} + + + {else} + + + {/if} + + {/if} + {if $labels.booking_arrival || $labels.booking_departure} + + {if $labels.booking_arrival && $labels.booking_departure} + + + + + {elseif $labels.booking_arrival} + + + {else} + + + {/if} + + {/if} + {if $labels.booking_room_type || $labels.booking_room_number} + + {if $labels.booking_room_type && $labels.booking_room_number} + + + + + {elseif $labels.booking_room_type} + + + {else} + + + {/if} + + {/if} + {if $labels.num_guests} + + + + + {/if} +
    {l s=$labels.booking_ref pdf='true'}:{$booking_reference|escape:'html':'UTF-8'}{l s=$labels.booking_rate pdf='true'}: + {if $rate_per_night}{$rate_per_night|escape:'html':'UTF-8'}{else}__________{/if} + {l s=$labels.booking_ref pdf='true'}:{$booking_reference|escape:'html':'UTF-8'}{l s=$labels.booking_rate pdf='true'}: + {if $rate_per_night}{$rate_per_night|escape:'html':'UTF-8'}{else}__________{/if} +
    {l s=$labels.booking_arrival pdf='true'}: + {if $arrival_date_time}{$arrival_date_time|escape:'html':'UTF-8'}{else}____ / ____ / ____ ______{/if} + {l s=$labels.booking_departure pdf='true'}: + {if $departure_date_time}{$departure_date_time|escape:'html':'UTF-8'}{else}____ / ____ / ____ ______{/if} + {l s=$labels.booking_arrival pdf='true'}: + {if $arrival_date_time}{$arrival_date_time|escape:'html':'UTF-8'}{else}____ / ____ / ____ ______{/if} + {l s=$labels.booking_departure pdf='true'}: + {if $departure_date_time}{$departure_date_time|escape:'html':'UTF-8'}{else}____ / ____ / ____ ______{/if} +
    {l s=$labels.booking_room_type pdf='true'}:{$room_type|escape:'html':'UTF-8'}{l s=$labels.booking_room_number pdf='true'}:{$room_number|escape:'html':'UTF-8'}{l s=$labels.booking_room_type pdf='true'}:{$room_type|escape:'html':'UTF-8'}{l s=$labels.booking_room_number pdf='true'}:{$room_number|escape:'html':'UTF-8'}
    {l s=$labels.num_guests pdf='true'}: + {l s='Adults:' pdf='true'} {$adults|escape:'html':'UTF-8'}   + {l s='Children:' pdf='true'} {$children|escape:'html':'UTF-8'} +
    +
    +
     
    + + + {if $local_id} + + + + {/if} + {if $int_id} + + + + {/if} + +
    + □ {l s='LOCAL GUEST' pdf='true'}

    + + {if $labels.id_proof} + + + + + {/if} + {if $labels.id_number} + + + + + {/if} +
    {l s=$labels.id_proof pdf='true'}:________________________________
    {l s=$labels.id_number pdf='true'}:________________________________
    +
    + □ {l s='INTERNATIONAL GUEST' pdf='true'}

    + + {if $labels.passport || $labels.place_of_issue} + + {if $labels.passport && $labels.place_of_issue} + + + + + {elseif $labels.passport} + + + {else} + + + {/if} + + {/if} + {if $labels.date_of_issue || $labels.date_of_expiry} + + {if $labels.date_of_issue && $labels.date_of_expiry} + + + + + {elseif $labels.date_of_issue} + + + {else} + + + {/if} + + {/if} + {if $labels.visa || $labels.valid_until} + + {if $labels.visa && $labels.valid_until} + + + + + {elseif $labels.visa} + + + {else} + + + {/if} + + {/if} + {if $labels.arrival_in_country} + + + + + {/if} +
    {l s=$labels.passport pdf='true'}:____________________{l s=$labels.place_of_issue pdf='true'}:____________________{l s=$labels.passport pdf='true'}:____________________{l s=$labels.place_of_issue pdf='true'}:____________________
    {l s=$labels.date_of_issue pdf='true'}:____ / ____ / ____{l s=$labels.date_of_expiry pdf='true'}:____ / ____ / ____{l s=$labels.date_of_issue pdf='true'}:____ / ____ / ____{l s=$labels.date_of_expiry pdf='true'}:____ / ____ / ____
    {l s=$labels.visa pdf='true'}:____________________{l s=$labels.valid_until pdf='true'}:____ / ____ / ____{l s=$labels.visa pdf='true'}:____________________{l s=$labels.valid_until pdf='true'}:____ / ____ / ____
    {l s=$labels.arrival_in_country pdf='true'}:____ / ____ / ____
    +
    +
     
    + + + + + + + + + + + +
    {$section_additional_guests|upper} ({l s='if any' pdf='true'})
    + + + + {if $labels.addguest_name}{/if} + {if $labels.addguest_id_type}{/if} + {if $labels.addguest_id_number}{/if} + {if $labels.addguest_nationality}{/if} + + {section name=ag loop=$additional_guests_rows} + + + {if $labels.addguest_name}{/if} + {if $labels.addguest_id_type}{/if} + {if $labels.addguest_id_number}{/if} + {if $labels.addguest_nationality}{/if} + + {/section} + {if !$additional_guests_rows} + + + {if $labels.addguest_name}{/if} + {if $labels.addguest_id_type}{/if} + {if $labels.addguest_id_number}{/if} + {if $labels.addguest_nationality}{/if} + + {/if} +
    {l s='S.No.' pdf='true'}{l s=$labels.addguest_name pdf='true'}{l s=$labels.addguest_id_type pdf='true'}{l s=$labels.addguest_id_number pdf='true'}{l s=$labels.addguest_nationality pdf='true'}
    {$smarty.section.ag.iteration}__________________________________________________________________________
    1__________________________________________________________________________
    +
    +
     
    + + + + + + +
    + + {if $labels.company} + + + + + {/if} + {if $labels.tax_id} + + + + + {/if} +
    {l s=$labels.company pdf='true'}:______________________________________________
    {l s=$labels.tax_id pdf='true'}:______________________________________________
    +
    +
     
    + + + + + + +
    + + {if $labels.payment_method} + + + + + {/if} + {if $labels.card_number || $labels.security_deposit} + + {if $labels.card_number && $labels.security_deposit} + + + + + {elseif $labels.card_number} + + + {else} + + + {/if} + + {/if} +
    {l s=$labels.payment_method pdf='true'}:________________________________
    {l s=$labels.card_number pdf='true'}:________________________________{l s=$labels.security_deposit pdf='true'}:__________________{l s=$labels.card_number pdf='true'}:________________________________{l s=$labels.security_deposit pdf='true'}:__________________
    +
    +
     
    + + + + + + +
    + + + {if $labels.signature && $labels.sig_date} + + + + + {elseif $labels.signature} + + + {else} + + + {/if} + +
    {l s=$labels.signature pdf='true'}:______________________________________{l s=$labels.sig_date pdf='true'}:____ / ____ / ________{l s=$labels.signature pdf='true'}:______________________________________{l s=$labels.sig_date pdf='true'}:____ / ____ / ________
    +
    +
     
    + + + + + + + + {if $labels.checkin_time} + + + + {/if} + {if $labels.hotel_policies} + + + + {/if} + +
    {$section_property_regs|upper}
    + {l s=$labels.checkin_time pdf='true'}: + {if $hotel && $hotel->check_in && $hotel->check_in != '00:00:00'}{$hotel->check_in|escape:'html':'UTF-8'}{else}__________{/if} +     + {l s=$labels.checkout_time pdf='true'}: + {if $hotel && $hotel->check_out && $hotel->check_out != '00:00:00'}{$hotel->check_out|escape:'html':'UTF-8'}{else}__________{/if} +
    + {l s=$labels.hotel_policies pdf='true'}: + {if $hotel && $hotel->policies && !($hotel->policies|@is_array)} + {$hotel->policies} + {else} + ______________________________
    + ______________________________
    + ______________________________ + {/if} +
    +
     
    + + + + + + +
    + + {if $labels.staff_name || $labels.office_checkin_time} + + {if $labels.staff_name && $labels.office_checkin_time} + + + + + {elseif $labels.staff_name} + + + {else} + + + {/if} + + {/if} + {if $labels.id_verified || $labels.reg_no} + + {if $labels.id_verified && $labels.reg_no} + + + + + {elseif $labels.id_verified} + + + {else} + + + {/if} + + {/if} +
    {l s=$labels.staff_name pdf='true'}:____________________{l s=$labels.office_checkin_time pdf='true'}:____________________{l s=$labels.staff_name pdf='true'}:____________________{l s=$labels.office_checkin_time pdf='true'}:____________________
    {l s=$labels.id_verified pdf='true'}:□ {l s='Yes' pdf='true'}   □ {l s='No' pdf='true'}{l s=$labels.reg_no pdf='true'}:____________________{l s=$labels.id_verified pdf='true'}:□ {l s='Yes' pdf='true'}   □ {l s='No' pdf='true'}{l s=$labels.reg_no pdf='true'}:____________________
    +
    +
     
    + {$HOOK_DISPLAY_PDF} +
    diff --git a/themes/hotel-reservation-theme/category.tpl b/themes/hotel-reservation-theme/category.tpl index 914cd6b87..a8dc9e157 100644 --- a/themes/hotel-reservation-theme/category.tpl +++ b/themes/hotel-reservation-theme/category.tpl @@ -24,6 +24,11 @@ *} {block name='category'} + {block name='errors'} + {include file="$tpl_dir./errors.tpl"} + {/block} + + {if !isset($errors) OR !sizeof($errors)}
    {block name='category_top_left'} @@ -54,6 +59,7 @@
    + {/if} {block name='category_js_vars'} {strip}