From fb66b1817a0a08b20f62cf79077cd2c3b7f47bf7 Mon Sep 17 00:00:00 2001 From: fBrignoli Date: Wed, 6 Jun 2012 09:41:13 +0000 Subject: [PATCH] [-] BO : Bug Fixed #2676 - Missing button in group shop tab git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15871 b9a71923-0436-4b27-9f14-aed3839534dd --- .../admin/AdminShopGroupController.php | 40 ++++++++++++++----- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/controllers/admin/AdminShopGroupController.php b/controllers/admin/AdminShopGroupController.php index 769539a8f..40ae9bdff 100644 --- a/controllers/admin/AdminShopGroupController.php +++ b/controllers/admin/AdminShopGroupController.php @@ -42,6 +42,8 @@ class AdminShopGroupControllerCore extends AdminController if (!Tools::getValue('realedit')) $this->deleted = false; + $this->show_toolbar = false; + $this->fields_list = array( 'id_shop_group' => array( 'title' => $this->l('ID'), @@ -84,20 +86,21 @@ class AdminShopGroupControllerCore extends AdminController parent::__construct(); } - public function initToolbar() - { - parent::initToolbar(); - - $this->show_toolbar = false; - if (isset($this->toolbar_btn['new'])) - $this->toolbar_btn['new']['desc'] = $this->l('Add new shop group'); - } - public function initContent() { $this->list_simple_header = true; parent::initContent(); + unset($this->toolbar_btn); + $this->toolbar_btn['new'] = array( + 'desc' => $this->l('Add new shop group'), + 'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token, ); + $this->toolbar_btn['new_2'] = array( + 'desc' => $this->l('Add new shop'), + 'href' => $this->context->link->getAdminLink('AdminShop').'&addshop', + 'imgclass' => 'new' + ); + $this->addJqueryPlugin('cooki'); $this->addJqueryPlugin('jstree'); $this->addCSS(_PS_JS_DIR_.'jquery/plugins/jstree/themes/classic/style.css'); @@ -288,6 +291,25 @@ class AdminShopGroupControllerCore extends AdminController //Reset available quantitites StockAvailable::resetProductFromStockAvailableByShopGroup($new_shop_group); } + + public function renderOptions() + { + if ($this->fields_options && is_array($this->fields_options)) + { + $this->display = 'options'; + $this->show_toolbar = true; + + unset($this->toolbar_btn); + $this->initToolbar(); + $helper = new HelperOptions($this); + $this->setHelperDisplay($helper); + $helper->id = $this->id; + $helper->tpl_vars = $this->tpl_option_vars; + $options = $helper->generateOptions($this->fields_options); + + return $options; + } + } }