diff --git a/admin/themes/default/sass/partials/_tree.sass b/admin/themes/default/sass/partials/_tree.sass index b6cb0ecdf..897c29f85 100644 --- a/admin/themes/default/sass/partials/_tree.sass +++ b/admin/themes/default/sass/partials/_tree.sass @@ -62,4 +62,8 @@ .tree-panel-label-title font-weight: 400 margin: 0 - @include padding(0, 0, 0, 8px) \ No newline at end of file + @include padding(0, 0, 0, 8px) + +.tree.cattree + max-height: 350px + overflow-y: auto diff --git a/admin/themes/default/template/controllers/normal_products/helpers/tree/tree_associated_hotels.tpl b/admin/themes/default/template/controllers/normal_products/helpers/tree/tree_associated_hotels.tpl index 079538e41..4add416b6 100644 --- a/admin/themes/default/template/controllers/normal_products/helpers/tree/tree_associated_hotels.tpl +++ b/admin/themes/default/template/controllers/normal_products/helpers/tree/tree_associated_hotels.tpl @@ -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); diff --git a/classes/helper/HelperTreeHotels.php b/classes/helper/HelperTreeHotels.php index 5849ffb73..dd142943a 100644 --- a/classes/helper/HelperTreeHotels.php +++ b/classes/helper/HelperTreeHotels.php @@ -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()); diff --git a/controllers/admin/AdminNormalProductsController.php b/controllers/admin/AdminNormalProductsController.php index cf78be63c..1c8027412 100644 --- a/controllers/admin/AdminNormalProductsController.php +++ b/controllers/admin/AdminNormalProductsController.php @@ -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());