Merge branch 'develop' into gli-1262
This commit is contained in:
@@ -201,7 +201,13 @@ class AdminProductsControllerCore extends AdminController
|
||||
LEFT JOIN `'._DB_PREFIX_.'address` aa ON (aa.`id_hotel` = hb.`id`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'feature_product` fp ON (fp.`id_product` = a.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_demand` hrtd ON (hrtd.`id_product` = a.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product` hrtsp ON ((hrtsp.`element_type` = '.(int) RoomTypeServiceProduct::WK_ELEMENT_TYPE_HOTEL.' AND hrtsp.`id_element` = hrt.`id_hotel`) OR (hrtsp.`element_type` = '.(int) RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE.' AND hrtsp.`id_element` = a.`id_product`))
|
||||
LEFT JOIN (
|
||||
SELECT rsp.*, GROUP_CONCAT(pl.`name`) AS service_products
|
||||
FROM `'._DB_PREFIX_.'htl_room_type_service_product` rsp
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = rsp.`id_product`)
|
||||
WHERE pl.`id_lang`='.$this->context->language->id.'
|
||||
GROUP BY rsp.`id_element`)
|
||||
AS hrtsp ON ((hrtsp.`element_type` = '.(int) RoomTypeServiceProduct::WK_ELEMENT_TYPE_HOTEL.' AND hrtsp.`id_element` = hrt.`id_hotel`) OR (hrtsp.`element_type` = '.(int) RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE.' AND hrtsp.`id_element` = a.`id_product`))
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_advance_payment` hap ON (hap.`id_product` = a.`id_product`)';
|
||||
|
||||
$this->_select .= ' a.`show_at_front`, (SELECT COUNT(hri.`id`) FROM `'._DB_PREFIX_.'htl_room_information` hri WHERE hri.`id_product` = a.`id_product`) as num_rooms, ';
|
||||
@@ -213,7 +219,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
|
||||
if ($join_category) {
|
||||
$this->_join .= ' INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.') ';
|
||||
$this->_select .= ' , cp.`position`, ';
|
||||
$this->_select .= ' , cp.`position` ';
|
||||
}
|
||||
|
||||
// show the list of the product according to the booking or service products
|
||||
@@ -277,6 +283,13 @@ class AdminProductsControllerCore extends AdminController
|
||||
'type' => 'range',
|
||||
'align' => 'center',
|
||||
);
|
||||
$this->fields_list['max_guests'] = array(
|
||||
'title' => $this->l('Maximum Occupancy'),
|
||||
'filter_key' => 'hrt!max_guests',
|
||||
'type' => 'range',
|
||||
'align' => 'center',
|
||||
'optional' => true,
|
||||
);
|
||||
// use it for total rooms
|
||||
$this->fields_list['num_rooms'] = array(
|
||||
'title' => $this->l('Total Rooms'),
|
||||
@@ -290,7 +303,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
'validation' => 'isFloat',
|
||||
'align' => 'text-left',
|
||||
'filter_key' => 'a!price',
|
||||
'callback' => 'displayBasePrice',
|
||||
'callback' => 'displayPrice',
|
||||
);
|
||||
$this->fields_list['price_final'] = array(
|
||||
'title' => $this->l('Final price'),
|
||||
@@ -298,7 +311,8 @@ class AdminProductsControllerCore extends AdminController
|
||||
'align' => 'text-left',
|
||||
'havingFilter' => true,
|
||||
'orderby' => false,
|
||||
'search' => false
|
||||
'search' => false,
|
||||
'callback' => 'displayPrice',
|
||||
);
|
||||
|
||||
$this->fields_list['active'] = array(
|
||||
@@ -307,25 +321,18 @@ class AdminProductsControllerCore extends AdminController
|
||||
'filter_key' => $alias.'!active',
|
||||
'align' => 'text-center',
|
||||
'type' => 'select',
|
||||
'callback' => 'formatStatusAsLabel',
|
||||
'list' => array(1 => $this->l('Yes'), 0 => $this->l('No')),
|
||||
'optional' => true,
|
||||
'visible_default' => true,
|
||||
'orderby' => false
|
||||
);
|
||||
|
||||
$this->fields_list['max_guests'] = array(
|
||||
'title' => $this->l('Maximum Occupancy'),
|
||||
'filter_key' => 'hrt!max_guests',
|
||||
'type' => 'range',
|
||||
'align' => 'center',
|
||||
'optional' => true,
|
||||
);
|
||||
|
||||
$this->fields_list['show_at_front'] = array(
|
||||
'title' => $this->l('Show at front'),
|
||||
'align' => 'text-center',
|
||||
'type' => 'bool',
|
||||
'active' => 'show_at_front',
|
||||
'callback' => 'formatStatusAsLabel',
|
||||
'optional' => true,
|
||||
'havingFilter' => true,
|
||||
'visible_default' => true,
|
||||
@@ -335,7 +342,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
if (Configuration::get('WK_ALLOW_ADVANCED_PAYMENT')) {
|
||||
$this->fields_list['advance_payment'] = array(
|
||||
'title' => $this->l('Advance Payment'),
|
||||
'callback' => 'getAdvancePaymentStatus',
|
||||
'callback' => 'formatStatusAsLabel',
|
||||
'badge_success' => true,
|
||||
'badge_danger' => true,
|
||||
'align' => 'text-center',
|
||||
@@ -446,7 +453,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function getAdvancePaymentStatus($val, $row)
|
||||
public function formatStatusAsLabel($val, $row)
|
||||
{
|
||||
if ($val) {
|
||||
$str_return = $this->l('Yes');
|
||||
@@ -457,7 +464,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
return $str_return;
|
||||
}
|
||||
|
||||
|
||||
private function buildCategoryOptions($category)
|
||||
{
|
||||
$space = str_repeat(' ', 5 * (($category['level_depth'] - $this->objLocationsCategory->level_depth) - 1));
|
||||
@@ -470,7 +476,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public static function displayBasePrice($basePrice, $tr)
|
||||
public static function displayPrice($basePrice, $tr)
|
||||
{
|
||||
return Tools::displayPrice($basePrice, (int) Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
}
|
||||
@@ -629,6 +635,48 @@ class AdminProductsControllerCore extends AdminController
|
||||
$orderBy = 'id_'.$this->table;
|
||||
$orderWay = 'ASC';
|
||||
}
|
||||
if ($this->action == 'export' && empty($this->_listsql)) {
|
||||
$this->_select .= ' , trg.`name` AS `id_tax_rules_group`, `features`, hrtdl.`global_demands`';
|
||||
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'tax_rules_group` trg
|
||||
ON trg.`id_tax_rules_group` = a.`id_tax_rules_group`
|
||||
LEFT JOIN (SELECT GROUP_CONCAT(fpl.`name`) AS features, fp.`id_product`
|
||||
FROM `'._DB_PREFIX_.'feature_lang` fpl
|
||||
LEFT JOIN `'._DB_PREFIX_.'feature_product` fp
|
||||
ON (fp.`id_feature` = fpl.`id_feature`)
|
||||
WHERE fpl.`id_lang`='.(int) $this->context->language->id.'
|
||||
GROUP BY fp.`id_product`
|
||||
) AS fpl ON (a.`id_product` = fpl.`id_product`)';
|
||||
|
||||
$this->_join .= ' LEFT JOIN (SELECT hrtgd.`id_product`, `id_lang`, GROUP_CONCAT(`name`) AS `global_demands`
|
||||
FROM `'._DB_PREFIX_.'htl_room_type_global_demand_lang` hrtgdl
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_demand` hrtgd
|
||||
ON hrtgd.`id_global_demand` = hrtgdl.`id_global_demand`
|
||||
WHERE `id_lang`='.(int) $this->context->language->id.'
|
||||
GROUP BY hrtgd.`id_product`
|
||||
) AS hrtdl ON (hrtdl.`id_product` = a.`id_product`)';
|
||||
|
||||
$this->fields_list = array_merge($this->fields_list, array(
|
||||
'id_tax_rules_group' => array(
|
||||
'title' => $this->l('Id Tax Rules group'),
|
||||
'filter_key' => 'a!id_tax_rules_group',
|
||||
),
|
||||
'features' => array(
|
||||
'title' => $this->l('Features'),
|
||||
),
|
||||
'service_products' => array(
|
||||
'title' => $this->l('Services Products'),
|
||||
),
|
||||
'global_demands' => array(
|
||||
'title' => $this->l('Additional Facilities'),
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
unset($this->fields_list['id_category_default']);
|
||||
unset($this->fields_list['id_global_demand']);
|
||||
unset($this->fields_list['id_feature']);
|
||||
unset($this->fields_list['id_service_product']);
|
||||
}
|
||||
parent::getList($id_lang, $orderBy, $orderWay, $start, $limit, $this->context->shop->id);
|
||||
|
||||
/* update product quantity with attributes ...*/
|
||||
|
||||
Reference in New Issue
Block a user