Added: check all and uncheck all option in the tree for normal products and scroll bar for the rendered tree
This commit is contained in:
@@ -62,4 +62,8 @@
|
||||
.tree-panel-label-title
|
||||
font-weight: 400
|
||||
margin: 0
|
||||
@include padding(0, 0, 0, 8px)
|
||||
@include padding(0, 0, 0, 8px)
|
||||
|
||||
.tree.cattree
|
||||
max-height: 350px
|
||||
overflow-y: auto
|
||||
|
||||
@@ -48,17 +48,15 @@
|
||||
}
|
||||
|
||||
{if isset($use_checkbox) && $use_checkbox == true}
|
||||
function checkAllAssociatedCategories($tree)
|
||||
function checkAllAssociatedHotels($tree)
|
||||
{
|
||||
$tree.find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', true);
|
||||
|
||||
addDefaultCategory($(this));
|
||||
$(this).parent().addClass('tree-selected');
|
||||
});
|
||||
}
|
||||
|
||||
function uncheckAllAssociatedCategories($tree)
|
||||
function uncheckAllAssociatedHotels($tree)
|
||||
{
|
||||
$tree.find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', false);
|
||||
|
||||
@@ -382,6 +382,23 @@ class HelperTreeHotelsCore extends TreeCore
|
||||
$this->addAction($expand_all);
|
||||
|
||||
if ($this->useCheckBox()) {
|
||||
if ($this->useBulkActions()) {
|
||||
$check_all = new TreeToolbarLink(
|
||||
'Check All',
|
||||
'#',
|
||||
'checkAllAssociatedHotels($(\'#'.$this->getId().'\'));return false;',
|
||||
'icon-check-sign');
|
||||
$check_all->setAttribute('id', 'check-all-'.$this->getId());
|
||||
$uncheck_all = new TreeToolbarLink(
|
||||
'Uncheck All',
|
||||
'#',
|
||||
'uncheckAllAssociatedHotels($(\'#'.$this->getId().'\'));return false;',
|
||||
'icon-check-empty');
|
||||
$uncheck_all->setAttribute('id', 'uncheck-all-'.$this->getId());
|
||||
$this->addAction($check_all);
|
||||
$this->addAction($uncheck_all);
|
||||
}
|
||||
|
||||
$this->setNodeFolderTemplate('tree_node_hotel_folder_checkbox.tpl');
|
||||
$this->setNodeItemTemplate('tree_node_hotel_item_checkbox.tpl');
|
||||
$this->setAttribute('use_checkbox', $this->useCheckBox());
|
||||
|
||||
@@ -526,7 +526,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
// convert price with the currency from context
|
||||
$this->_list[$i]['price'] = Tools::convertPrice($this->_list[$i]['price'], $this->context->currency, true, $this->context);
|
||||
$this->_list[$i]['price_tmp'] = Product::getPriceStatic($this->_list[$i]['id_product'], true, null,
|
||||
(int)Configuration::get('PS_PRICE_DISPLAY_PRECISION'), null, false, true, 1, true, null, null, null, $nothing, true, true,
|
||||
(int)Configuration::get('PS_PRICE_DISPLAY_PRECISION'), null, false, true, 1, true, null, null, null, null, true, true,
|
||||
$context);
|
||||
}
|
||||
}
|
||||
@@ -2994,7 +2994,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
->setUseSearch(false)
|
||||
->setFullTree(0)
|
||||
->setSelectedCategories($categories)
|
||||
->setUseBulkActions(false);
|
||||
->setUseBulkActions(true);
|
||||
|
||||
$data->assign(array('default_category' => $default_category,
|
||||
'selected_cat_ids' => implode(',', array_keys($selected_cat)),
|
||||
@@ -3510,7 +3510,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
->setRoomsOnly(false)
|
||||
->setSelectedHotels($selectedElements['hotels'])
|
||||
->setSelectedRoomTypes($selectedElements['room_types'])
|
||||
->setUseBulkActions(false)
|
||||
->setUseBulkActions(true)
|
||||
->setAccessedHotels(HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 0));
|
||||
|
||||
$data->assign('hotel_tree', $tree->render());
|
||||
|
||||
Reference in New Issue
Block a user