diff --git a/controllers/admin/AdminPPreferencesController.php b/controllers/admin/AdminPPreferencesController.php index f021fa9d7..479aaae67 100644 --- a/controllers/admin/AdminPPreferencesController.php +++ b/controllers/admin/AdminPPreferencesController.php @@ -194,6 +194,15 @@ class AdminPPreferencesControllerCore extends AdminController 'required' => false, 'type' => 'bool' ), + 'WK_ROOM_LEFT_WARNING_NUMBER' => array( + 'title' => $this->l('Display remaining Number of rooms when the rooms are lower than or equal to'), + 'hint' => $this->l('Mention the minimum quantity of rooms after which alert message of remaining rooms will get displayed to users.'), + 'validation' => 'isInt', + 'cast' => 'intval', + 'type' => 'text', + 'class' => 'fixed-width-xxl', + 'visibility' => Shop::CONTEXT_ALL, + ), ), 'submit' => array('title' => $this->l('Save')) ), diff --git a/controllers/admin/AdminThemesController.php b/controllers/admin/AdminThemesController.php index ce428e008..df1f46d29 100644 --- a/controllers/admin/AdminThemesController.php +++ b/controllers/admin/AdminThemesController.php @@ -2111,7 +2111,6 @@ class AdminThemesControllerCore extends AdminController 'blockcart', 'blockcurrencies', 'blocklanguages', - 'qloblockcontact', 'blockmyaccount', 'blocknewsletter', 'blocksocial', diff --git a/install/models/install.php b/install/models/install.php index 3e166f2ee..533bfd233 100644 --- a/install/models/install.php +++ b/install/models/install.php @@ -659,7 +659,6 @@ class InstallModelInstall extends InstallAbstractModel 'bankwire', 'cheque', 'blockmyaccount', - 'qloblockcontact', 'blockcurrencies', 'blocklanguages', 'qlohotelreview', diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index a204a2857..c1e001f2c 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -208,6 +208,8 @@ class HotelHelper ); Configuration::updateValue('WK_HOTEL_GLOBAL_CONTACT_NUMBER', '0987654321'); Configuration::updateValue('WK_HOTEL_GLOBAL_CONTACT_EMAIL', 'hotelprime@htl.com'); + Configuration::updateValue('WK_CUSTOMER_SUPPORT_PHONE_NUMBER', '0987654321'); + Configuration::updateValue('WK_CUSTOMER_SUPPORT_EMAIL', 'hotelprime@htl.com'); Configuration::updateValue('WK_TITLE_HEADER_BLOCK', $home_banner_default_title); Configuration::updateValue('WK_CONTENT_HEADER_BLOCK', $home_banner_default_content); diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php index 74e120141..30b34ea38 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php @@ -43,7 +43,7 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController $this->fields_options = array( 'hotelsearchpanel' => array( 'icon' => 'icon-search', - 'title' => $this->l('Hotel Search Setting'), + 'title' => $this->l('Search Panel Setting'), 'fields' => array( 'WK_HOTEL_LOCATION_ENABLE' => array( 'title' => $this->l('Enable Hotel Location'), @@ -86,72 +86,9 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'title' => $this->l('Save'), ), ), - 'occupancypanel' => array( - 'icon' => 'icon-users', - 'title' => $this->l('Occupancy Setting'), - 'fields' => array( - // max age of child - 'WK_GLOBAL_CHILD_MAX_AGE' => array( - 'title' => $this->l('Consider guest as child below age'), - 'type' => 'text', - 'required' => true, - 'validation' => 'isUnsignedInt', - 'hint' => $this->l('Enter the age of the guest, which that guest will be considered as child.'), - ), - 'WK_GLOBAL_MAX_CHILD_IN_ROOM' => array( - 'title' => $this->l('Maximum children allowed in a room'), - 'type' => 'text', - 'required' => true, - 'validation' => 'isUnsignedInt', - 'hint' => $this->l('Enter number of the child allowed in a room.'), - 'desc' => $this->l('Set as 0 if you do not want to limit children in a room.') - ), - ), - 'submit' => array( - 'title' => $this->l('Save'), - ), - ), 'generalsetting' => array( - 'title' => $this->l('Configuration'), + 'title' => $this->l('Website Configuration'), 'fields' => array( - 'WK_ROOM_LEFT_WARNING_NUMBER' => array( - 'title' => $this->l('Display remaining Number of rooms when the rooms are lower than or equal to'), - 'hint' => $this->l('Mention the minimum quantity of rooms after which alert message of remaining rooms will get displayed to users.'), - 'validation' => 'isInt', - 'cast' => 'intval', - 'type' => 'text', - 'visibility' => Shop::CONTEXT_ALL, - ), - 'WK_HOTEL_GLOBAL_ADDRESS' => array( - 'title' => $this->l('Global Address'), - 'hint' => $this->l('Hotel global address which you want to show to your customers. It will be - shown at contact us page.'), - 'type' => 'text', - 'isCleanHtml' => true, - ), - 'WK_HOTEL_GLOBAL_CONTACT_EMAIL' => array( - 'title' => $this->l('Global Email'), - 'hint' => $this->l('Email which you want to show a customer to email you.'), - 'type' => 'text', - ), - 'WK_HOTEL_GLOBAL_CONTACT_NUMBER' => array( - 'title' => $this->l('Global Contact Number'), - 'hint' => $this->l('Phone Number which you want to show a customer to contact you.'), - 'type' => 'text', - 'validation' => 'isPhoneNumber', - ), - 'WK_HTL_ESTABLISHMENT_YEAR' => array( - 'title' => $this->l('Website Launch Year'), - 'hint' => $this->l('The year when your hotel site was launched.'), - 'type' => 'text', - ), - 'WK_PRIMARY_HOTEL' => array( - 'title' => $this->l('Primary hotel'), - 'hint' => $this->l('Primary hotel is used to default address for your business. The hotel address will be considered as your registered business address.'), - 'type' => 'select', - 'identifier' => 'id', - 'list' => $hotelsInfo, - ), 'WK_HTL_CHAIN_NAME' => array( 'title' => $this->l('Hotel Name'), 'type' => 'textLang', @@ -178,6 +115,19 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'validation' => 'isGenericName', 'hint' => $this->l('This will display hotel short description in footer. Note: number of letters must be less than 220.'), ), + 'WK_PRIMARY_HOTEL' => array( + 'title' => $this->l('Primary hotel'), + 'hint' => $this->l('Primary hotel is used to default address for your business. The hotel address will be considered as your registered business address.'), + 'type' => 'select', + 'identifier' => 'id', + 'list' => $hotelsInfo, + ), + 'WK_HTL_ESTABLISHMENT_YEAR' => array( + 'title' => $this->l('Website Launch Year'), + 'hint' => $this->l('The year when your hotel site was launched.'), + 'type' => 'text', + 'class' => 'fixed-width-xxl', + ), 'WK_HTL_HEADER_IMAGE' => array( 'title' => $this->l('Header Background Image'), 'type' => 'file', @@ -189,6 +139,50 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController ), 'submit' => array('title' => $this->l('Save')), ), + 'contactdetail' => array( + 'icon' => 'icon-phone', + 'title' => $this->l('Website Contact Details'), + 'fields' => array( + 'WK_HOTEL_GLOBAL_ADDRESS' => array( + 'title' => $this->l('Main Branch Address'), + 'hint' => $this->l('The address of the main branch. It will be shown on Contact Us page.'), + 'type' => 'text', + 'isCleanHtml' => true, + 'class' => 'fixed-width-xxl', + 'required' => true, + ), + 'WK_HOTEL_GLOBAL_CONTACT_NUMBER' => array( + 'title' => $this->l('Main Branch Phone Number'), + 'hint' => $this->l('The phone number of the main branch. It will be shown on Contact Us page.'), + 'type' => 'text', + 'validation' => 'isPhoneNumber', + 'class' => 'fixed-width-xxl', + 'required' => true, + ), + 'WK_HOTEL_GLOBAL_CONTACT_EMAIL' => array( + 'title' => $this->l('Main Branch Email'), + 'hint' => $this->l('The email address of the main branch. It will be shown on Contact Us page.'), + 'type' => 'text', + 'class' => 'fixed-width-xxl', + 'required' => true, + ), + 'WK_CUSTOMER_SUPPORT_PHONE_NUMBER' => array( + 'title' => $this->l('Support Phone Number'), + 'type' => 'text', + 'hint' => $this->l('The phone number used for customer service. It will be shown on navigation bar.'), + 'class' => 'fixed-width-xxl', + ), + 'WK_CUSTOMER_SUPPORT_EMAIL' => array( + 'title' => $this->l('Support Email'), + 'type' => 'text', + 'hint' => $this->l('The email used for customer service. It will be shown on navigation bar.'), + 'class' => 'fixed-width-xxl', + ), + ), + 'submit' => array( + 'title' => $this->l('Save'), + ), + ), 'advancedPayment' => array( 'title' => $this->l('Advance Payment Global Setting'), 'fields' => array( @@ -215,6 +209,7 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'type' => 'text', 'validation' => 'isUnsignedFloat', 'suffix' => $this->l('%'), + 'class' => 'fixed-width-xxl', ), 'WK_ADVANCED_PAYMENT_INC_TAX' => array( 'title' => $this->l('Global Booking Amount Include Tax'), @@ -236,6 +231,33 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController ), 'submit' => array('title' => $this->l('Save')), ), + 'occupancypanel' => array( + 'icon' => 'icon-users', + 'title' => $this->l('Occupancy Settings'), + 'fields' => array( + // max age of child + 'WK_GLOBAL_CHILD_MAX_AGE' => array( + 'title' => $this->l('Consider guest as child below age'), + 'type' => 'text', + 'required' => true, + 'validation' => 'isUnsignedInt', + 'hint' => $this->l('Enter the age of the guest, which that guest will be considered as child.'), + 'class' => 'fixed-width-xxl', + ), + 'WK_GLOBAL_MAX_CHILD_IN_ROOM' => array( + 'title' => $this->l('Maximum children allowed in a room'), + 'type' => 'text', + 'required' => true, + 'validation' => 'isUnsignedInt', + 'hint' => $this->l('Enter number of the child allowed in a room.'), + 'desc' => $this->l('Set as 0 if you do not want to limit children in a room.'), + 'class' => 'fixed-width-xxl', + ), + ), + 'submit' => array( + 'title' => $this->l('Save'), + ), + ), 'googleMap' => array( 'title' => $this->l('Google Maps Settings'), 'fields' => array( @@ -377,6 +399,16 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController } elseif (!Validate::isEmail(Tools::getValue('WK_HOTEL_GLOBAL_CONTACT_EMAIL'))) { $this->errors[] = $this->l('Hotel global contact email field is invalid'); } + if (trim(Tools::getValue('WK_CUSTOMER_SUPPORT_PHONE_NUMBER')) != '') { + if (!Validate::isPhoneNumber(trim(Tools::getValue('WK_CUSTOMER_SUPPORT_PHONE_NUMBER')))) { + $this->errors[] = $this->l('Support Phone Number is invalid.'); + } + } + if (trim(Tools::getValue('WK_CUSTOMER_SUPPORT_EMAIL')) != '') { + if (!Validate::isEmail(trim(Tools::getValue('WK_CUSTOMER_SUPPORT_EMAIL')))) { + $this->errors[] = $this->l('Support Email is invalid.'); + } + } if (!count($this->errors)) { $objHotelInfo = new HotelBranchInformation(); diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php index 8e6a12da2..a511179d3 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -101,6 +101,36 @@ class HotelReservationSystem extends Module $this->context->controller->addJS($this->_path.'/views/js/HotelReservationFront.js'); } + public function hookActionFrontControllerSetMedia() + { + if (Configuration::get('WK_CUSTOMER_SUPPORT_PHONE_NUMBER') != '' + || Configuration::get('WK_CUSTOMER_SUPPORT_EMAIL') != '' + ) { + $this->context->controller->addCSS($this->getPathUri().'views/css/hook/display-nav.css'); + } + + } + + public function hookDisplayNav() + { + $this->smarty->assign(array( + 'phone' => Configuration::get('WK_CUSTOMER_SUPPORT_PHONE_NUMBER'), + 'email' => Configuration::get('WK_CUSTOMER_SUPPORT_EMAIL'), + )); + + return $this->display(__FILE__, 'display-nav.tpl'); + } + + public function hookDisplayExternalNavigationHook() + { + $this->smarty->assign(array( + 'phone' => Configuration::get('WK_CUSTOMER_SUPPORT_PHONE_NUMBER'), + 'email' => Configuration::get('WK_CUSTOMER_SUPPORT_EMAIL'), + )); + + return $this->display(__FILE__, 'external-navigation-hook.tpl'); + } + public function cartBookingDataForMail($order) { $result = array(); @@ -635,6 +665,9 @@ class HotelReservationSystem extends Module 'actionOrderStatusPostUpdate', 'displayLeftColumn', 'actionCartSummary', + 'actionFrontControllerSetMedia', + 'displayNav', + 'displayExternalNavigationHook', ) ); } @@ -669,7 +702,9 @@ class HotelReservationSystem extends Module 'WK_ADVANCED_PAYMENT_INC_TAX', 'WK_GOOGLE_ACTIVE_MAP', 'WK_MAP_HOTEL_ACTIVE_ONLY', - 'WK_HOTEL_NAME_ENABLE' + 'WK_HOTEL_NAME_ENABLE', + 'WK_CUSTOMER_SUPPORT_PHONE_NUMBER', + 'WK_CUSTOMER_SUPPORT_EMAIL', ); foreach ($configKeys as $key) { if (!Configuration::deleteByName($key)) { diff --git a/modules/qloblockcontact/views/css/hook/display-nav.css b/modules/hotelreservationsystem/views/css/hook/display-nav.css similarity index 100% rename from modules/qloblockcontact/views/css/hook/display-nav.css rename to modules/hotelreservationsystem/views/css/hook/display-nav.css diff --git a/modules/hotelreservationsystem/views/css/hook/index.php b/modules/hotelreservationsystem/views/css/hook/index.php new file mode 100644 index 000000000..257bc22f9 --- /dev/null +++ b/modules/hotelreservationsystem/views/css/hook/index.php @@ -0,0 +1,29 @@ + {$email} {/if} -{if $phone} +{if $phone != ''}