Added: new configuration for the dimension unit in for the bed types, revert the changes for the ps dimension unit
This commit is contained in:
@@ -436,7 +436,7 @@ class ProductControllerCore extends FrontController
|
||||
'PS_SERVICE_PRODUCT_CATEGORY_FILTER' => Configuration::get('PS_SERVICE_PRODUCT_CATEGORY_FILTER'),
|
||||
'bed_types_info' => $bedTypes,
|
||||
'selected_bed_types' => $selectedBedTypes,
|
||||
'dimension_unit' => Configuration::get('PS_DIMENSION_UNIT'),
|
||||
'dimension_unit' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id),
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="Kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="mi"/>
|
||||
</units>
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -333,7 +333,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -253,7 +253,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -265,7 +265,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="l"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<units>
|
||||
<unit type="weight" value="kg"/>
|
||||
<unit type="volume" value="L"/>
|
||||
<unit type="short_distance" value="ft"/>
|
||||
<unit type="short_distance" value="cm"/>
|
||||
<unit type="base_distance" value="m"/>
|
||||
<unit type="long_distance" value="km"/>
|
||||
</units>
|
||||
|
||||
@@ -1094,16 +1094,26 @@ class HotelHelper
|
||||
'ru' => 'Мы предлагаем элегантные номера, изысканную кухню и внимательное обслуживание для незабываемого отдыха.',
|
||||
'es' => 'Ofrecemos habitaciones elegantes, comidas gourmet y un servicio atento para una estadía inolvidable.',
|
||||
);
|
||||
|
||||
$defaultDimensionUnitLang = array(
|
||||
'en' => 'ft',
|
||||
'nl' => 'ft',
|
||||
'fr' => 'pi',
|
||||
'de' => 'ft',
|
||||
'ru' => 'фут',
|
||||
'es' => 'ft',
|
||||
);
|
||||
$WK_HTL_CHAIN_NAME = array();
|
||||
$WK_HTL_TAG_LINE = array();
|
||||
$WK_HTL_SHORT_DESC = array();
|
||||
$defaultDimensionUnit = array();
|
||||
foreach ($languages as $lang) {
|
||||
if (isset($htlTagLineLang[$lang['iso_code']])) {
|
||||
$WK_HTL_TAG_LINE[$lang['id_lang']] = $htlTagLineLang[$lang['iso_code']];
|
||||
$WK_HTL_SHORT_DESC[$lang['id_lang']] = $htlShortDescLang[$lang['iso_code']];
|
||||
$WK_HTL_CHAIN_NAME[$lang['id_lang']] = $homeBannerTitleLang[$lang['iso_code']];
|
||||
$defaultDimensionUnit[$lang['id_lang']] = $defaultDimensionUnitLang[$lang['iso_code']];
|
||||
} else {
|
||||
$defaultDimensionUnit[$lang['id_lang']] = $defaultDimensionUnitLang['en'];
|
||||
$WK_HTL_CHAIN_NAME[$lang['id_lang']] = $homeBannerTitleLang['en'];
|
||||
$WK_HTL_TAG_LINE[$lang['id_lang']] = $htlTagLineLang['en'];
|
||||
$WK_HTL_SHORT_DESC[$lang['id_lang']] = $htlShortDescLang['en'];
|
||||
@@ -1113,6 +1123,7 @@ class HotelHelper
|
||||
Configuration::updateValue('WK_HTL_CHAIN_NAME', $WK_HTL_CHAIN_NAME);
|
||||
Configuration::updateValue('WK_HTL_TAG_LINE', $WK_HTL_TAG_LINE);
|
||||
Configuration::updateValue('WK_HTL_SHORT_DESC', $WK_HTL_SHORT_DESC);
|
||||
Configuration::updateValue('WK_DIMENSION_UNIT', $defaultDimensionUnit);
|
||||
|
||||
// Search Fields
|
||||
Configuration::updateValue('PS_FRONT_SEARCH_TYPE', HotelBookingDetail::SEARCH_TYPE_OWS);
|
||||
|
||||
@@ -35,24 +35,22 @@ class AdminHotelBedTypesController extends ModuleAdminController
|
||||
parent::__construct();
|
||||
|
||||
$this->_new_list_header_design = true;
|
||||
$this->fields_list = array(
|
||||
'id_bed_type' => array(
|
||||
'title' => $this->l('ID'),
|
||||
'align' => 'center',
|
||||
),
|
||||
'name' => array(
|
||||
'title' => $this->l('Name'),
|
||||
'align' => 'center',
|
||||
),
|
||||
'width' => array(
|
||||
'title' => $this->l('Width'),
|
||||
'align' => 'center',
|
||||
'suffix' => Configuration::get('PS_DIMENSION_UNIT')
|
||||
),
|
||||
'length' => array(
|
||||
'title' => $this->l('Lenght'),
|
||||
'align' => 'center',
|
||||
'suffix' => Configuration::get('PS_DIMENSION_UNIT')
|
||||
// field options for global fields
|
||||
$this->fields_options = array(
|
||||
'global' => array(
|
||||
'title' => $this->l('Dimension Unit Setting'),
|
||||
'icon' => 'icon-cogs',
|
||||
'fields' => array(
|
||||
'WK_DIMENSION_UNIT' => array(
|
||||
'title' => $this->l('Dimension Unit'),
|
||||
'type' => 'textLang',
|
||||
'lang' => true,
|
||||
'required' => true,
|
||||
'validation' => 'isGenericName',
|
||||
'hint' => $this->l('Enter a dimension unit for the bed types.')
|
||||
),
|
||||
),
|
||||
'submit' => array('title' => $this->l('Save'))
|
||||
),
|
||||
);
|
||||
|
||||
@@ -67,6 +65,17 @@ class AdminHotelBedTypesController extends ModuleAdminController
|
||||
);
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
// to customize the view as per our requirements
|
||||
if ($this->display != 'add' && $this->display != 'edit') {
|
||||
$this->content = $this->renderOptions();
|
||||
$this->content .= $this->renderList();
|
||||
$this->context->smarty->assign('content', $this->content);
|
||||
}
|
||||
}
|
||||
|
||||
public function initPageHeaderToolbar()
|
||||
{
|
||||
if (!$this->display || $this->display == 'list') {
|
||||
@@ -80,6 +89,37 @@ class AdminHotelBedTypesController extends ModuleAdminController
|
||||
parent::initPageHeaderToolbar();
|
||||
}
|
||||
|
||||
public function initToolbar()
|
||||
{
|
||||
$this->toolbar_btn = array();
|
||||
}
|
||||
|
||||
public function renderList()
|
||||
{
|
||||
// added here instead of the constructor since the dimension unit will be update in post processs.
|
||||
$this->fields_list = array(
|
||||
'id_bed_type' => array(
|
||||
'title' => $this->l('ID'),
|
||||
'align' => 'center',
|
||||
),
|
||||
'name' => array(
|
||||
'title' => $this->l('Name'),
|
||||
'align' => 'center',
|
||||
),
|
||||
'width' => array(
|
||||
'title' => $this->l('Width'),
|
||||
'align' => 'center',
|
||||
'suffix' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id)
|
||||
),
|
||||
'length' => array(
|
||||
'title' => $this->l('Lenght'),
|
||||
'align' => 'center',
|
||||
'suffix' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id)
|
||||
),
|
||||
);
|
||||
return parent::renderList();
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
if (!$this->loadObject(true)) {
|
||||
@@ -107,8 +147,8 @@ class AdminHotelBedTypesController extends ModuleAdminController
|
||||
'name' => 'width',
|
||||
'required' => true,
|
||||
'col' => 4,
|
||||
'hint' => $this->l('Enter the width of the Bed type in ').Configuration::get('PS_DIMENSION_UNIT'),
|
||||
'suffix' => Configuration::get('PS_DIMENSION_UNIT'),
|
||||
'hint' => $this->l('Enter the width of the Bed type in ').Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id),
|
||||
'suffix' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id),
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
@@ -116,8 +156,8 @@ class AdminHotelBedTypesController extends ModuleAdminController
|
||||
'name' => 'length',
|
||||
'col' => 4,
|
||||
'required' => true,
|
||||
'hint' => $this->l('Enter the length of the Bed type in ').Configuration::get('PS_DIMENSION_UNIT'),
|
||||
'suffix' => Configuration::get('PS_DIMENSION_UNIT'),
|
||||
'hint' => $this->l('Enter the length of the Bed type in ').Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id),
|
||||
'suffix' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id),
|
||||
),
|
||||
),
|
||||
'submit' => array(
|
||||
|
||||
Reference in New Issue
Block a user