diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelConfigurationSettingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelConfigurationSettingController.php
index ec3d91c1d..5033928ed 100644
--- a/modules/hotelreservationsystem/controllers/admin/AdminHotelConfigurationSettingController.php
+++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelConfigurationSettingController.php
@@ -27,7 +27,6 @@ class AdminHotelConfigurationSettingController extends ModuleAdminController
'feature_price_setting_link' => $this->context->link->getAdminLink('AdminHotelFeaturePricesSettings'),
'general_setting_link' => $this->context->link->getAdminLink('AdminHotelGeneralSettings'),
'order_restrict_setting_link' => $this->context->link->getAdminLink('AdminOrderRestrictSettings'),
- 'other_module_setting_link' => $this->context->link->getAdminLink('AdminOtherHotelModulesSetting'),
'additional_demand_setting_link' => $this->context->link->getAdminLink('AdminRoomTypeGlobalDemand'),
);
// Reviews setting link if only productcomment module is enabled
diff --git a/modules/hotelreservationsystem/controllers/admin/AdminOtherHotelModulesSettingController.php b/modules/hotelreservationsystem/controllers/admin/AdminOtherHotelModulesSettingController.php
deleted file mode 100644
index daef03f5f..000000000
--- a/modules/hotelreservationsystem/controllers/admin/AdminOtherHotelModulesSettingController.php
+++ /dev/null
@@ -1,13 +0,0 @@
-table = 'configuration';
- $this->className = 'Configuration';
- $this->bootstrap = true;
- $this->fields_options = array();
- Hook::exec('addOtherModuleSetting', array('fields_options' => &$this->fields_options));
- parent::__construct();
- }
-}
diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php
index f6529bb88..3aa64f3fc 100644
--- a/modules/hotelreservationsystem/hotelreservationsystem.php
+++ b/modules/hotelreservationsystem/hotelreservationsystem.php
@@ -597,7 +597,6 @@ class hotelreservationsystem extends Module
//Controllers which are to be used in this modules but we have not to create tab for those ontrollers...
$this->installTab('AdminOrderRestrictSettings', 'order restrict configuration', false, false);
$this->installTab('AdminHotelGeneralSettings', 'Hotel General configuration', false, false);
- $this->installTab('AdminOtherHotelModulesSetting', 'other hotel configuration', false, false);
$this->installTab('AdminHotelFeaturePricesSettings', 'feature pricing configuration', false, false);
$this->installTab('AdminRoomTypeGlobalDemand', 'Additional demand configuration', false, false);
$this->installTab('AdminAssignHotelFeatures', 'Assign Hotel Features', false, false);
diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/view/view.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/view/view.tpl
index b1ac620ee..de4b0fef6 100644
--- a/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/view/view.tpl
+++ b/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/view/view.tpl
@@ -31,15 +31,6 @@
-
diff --git a/modules/wkhotelfilterblock/wkhotelfilterblock.php b/modules/wkhotelfilterblock/wkhotelfilterblock.php
index f64d048bb..46d8dc296 100644
--- a/modules/wkhotelfilterblock/wkhotelfilterblock.php
+++ b/modules/wkhotelfilterblock/wkhotelfilterblock.php
@@ -42,6 +42,128 @@ class wkhotelfilterblock extends Module
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
}
+ public function getContent()
+ {
+ if (Tools::isSubmit('btnConfigSubmit')) {
+ $this->postProcess();
+ } else {
+ $this->html .= '
';
+ }
+
+ $this->html .= $this->renderForm();
+
+ return $this->html;
+ }
+
+ public function renderForm()
+ {
+ $fields_form = array();
+ $fields_form['form'] = array(
+ 'legend' => array(
+ 'icon' => 'icon-cog',
+ 'title' => $this->l('Search Results Filter Configuration'),
+ ),
+ 'input' => array(
+ array(
+ 'type' => 'switch',
+ 'label' => $this->l('Show Guest Rating Filter'),
+ 'name' => 'SHOW_RATTING_FILTER',
+ 'is_bool' => true,
+ 'values' => array(
+ array(
+ 'id' => 'active_on',
+ 'value' => 1,
+ ),
+ array(
+ 'id' => 'active_off',
+ 'value' => 0,
+ ),
+ ),
+ 'hint' => $this->l('If yes, it will display Guest Rating Filter.'),
+ ),
+ array(
+ 'type' => 'switch',
+ 'label' => $this->l('Show Amenities Filter'),
+ 'name' => 'SHOW_AMENITIES_FILTER',
+ 'is_bool' => true,
+ 'values' => array(
+ array(
+ 'id' => 'active_on',
+ 'value' => 1,
+ ),
+ array(
+ 'id' => 'active_off',
+ 'value' => 0,
+ ),
+ ),
+ 'hint' => $this->l('If yes, it will display Amenities Filter.'),
+ ),
+ array(
+ 'type' => 'switch',
+ 'label' => $this->l('Show Price Filter'),
+ 'name' => 'SHOW_PRICE_FILTER',
+ 'is_bool' => true,
+ 'values' => array(
+ array(
+ 'id' => 'active_on',
+ 'value' => 1,
+ ),
+ array(
+ 'id' => 'active_off',
+ 'value' => 0,
+ ),
+ ),
+ 'hint' => $this->l('If yes, it will display price Filter.'),
+ ),
+ ),
+ 'submit' => array(
+ 'title' => $this->l('Save'),
+ 'name' => 'submit_conf_filter',
+ ),
+ );
+
+ $helper = new HelperForm();
+ $helper->show_toolbar = false;
+ $helper->table = $this->table;
+ $lang = new Language((int) Configuration::get('PS_LANG_DEFAULT'));
+ $helper->default_form_language = $lang->id;
+ $this->fields_form = array();
+ $helper->identifier = $this->identifier;
+ $helper->submit_action = 'btnConfigSubmit';
+ $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).
+ '&configure='.$this->name.'&module_name='.$this->name;
+ $helper->token = Tools::getAdminTokenLite('AdminModules');
+
+ $helper->tpl_vars = array(
+ 'fields_value' => $this->getConfigFieldsValues(),
+ 'languages' => $this->context->controller->getLanguages(),
+ 'id_language' => $this->context->language->id,
+ );
+
+ return $helper->generateForm(array($fields_form));
+ }
+
+ public function postProcess()
+ {
+ if (Tools::isSubmit('btnConfigSubmit')) {
+ Configuration::updateValue(
+ 'SHOW_RATTING_FILTER',
+ Tools::getValue('SHOW_RATTING_FILTER')
+ );
+ Configuration::updateValue(
+ 'SHOW_AMENITIES_FILTER',
+ Tools::getValue('SHOW_AMENITIES_FILTER')
+ );
+ Configuration::updateValue('SHOW_PRICE_FILTER', Tools::getValue('SHOW_PRICE_FILTER'));
+
+ // redirect after saving the configuration
+ Tools::redirectAdmin(
+ $this->context->link->getAdminLink('AdminModules').'&configure='.$this->name.'&tab_module='.$this->tab.
+ '&module_name='.$this->name.'&conf=4'
+ );
+ }
+ }
+
public function install()
{
if (!parent::install()
@@ -51,7 +173,7 @@ class wkhotelfilterblock extends Module
return false;
}
- //set default config variable
+ //set default config variable`
Configuration::updateValue('SHOW_RATTING_FILTER', 1);
Configuration::updateValue('SHOW_AMENITIES_FILTER', 1);
Configuration::updateValue('SHOW_PRICE_FILTER', 1);
@@ -59,37 +181,6 @@ class wkhotelfilterblock extends Module
return true;
}
- public function hookAddOtherModuleSetting($params)
- {
- $params['fields_options']['categoryfiltersetting'] = array(
- 'title' => $this->l('Category Filter Configuration'),
- 'fields' => array(
- 'SHOW_RATTING_FILTER' => array(
- 'title' => $this->l('Show Guest Rating Filter'),
- 'hint' => $this->l('If yes, it will display Guest Rating Filter.'),
- 'validation' => 'isBool',
- 'cast' => 'intval',
- 'type' => 'bool',
- ),
- 'SHOW_AMENITIES_FILTER' => array(
- 'title' => $this->l('Show Amenities Filter'),
- 'hint' => $this->l('If yes, it will display Amenities Filter.'),
- 'validation' => 'isBool',
- 'cast' => 'intval',
- 'type' => 'bool',
- ),
- 'SHOW_PRICE_FILTER' => array(
- 'title' => $this->l('Show Price Filter'),
- 'hint' => $this->l('If yes, it will display Price Filter.'),
- 'validation' => 'isBool',
- 'cast' => 'intval',
- 'type' => 'bool',
- ),
- ),
- 'submit' => array('title' => $this->l('Save')),
- );
- }
-
public function hookHeader()
{
$this->context->controller->addJQueryUI('ui.slider');