From 068da6f87c440bdbf78d0a6a53fe8cfaae2d1916 Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Wed, 28 Aug 2013 09:24:16 +0200 Subject: [PATCH] [+] BO : Page header toolbar --- .../admin/AdminOrderMessageController.php | 11 +++++++++++ controllers/admin/AdminOrdersController.php | 12 ++++++++++++ controllers/admin/AdminSlipController.php | 12 ++++++++++++ controllers/admin/AdminStatusesController.php | 17 +++++++++++++++++ 4 files changed, 52 insertions(+) diff --git a/controllers/admin/AdminOrderMessageController.php b/controllers/admin/AdminOrderMessageController.php index 9ed6b6c41..f0203e214 100644 --- a/controllers/admin/AdminOrderMessageController.php +++ b/controllers/admin/AdminOrderMessageController.php @@ -88,6 +88,17 @@ class AdminOrderMessageControllerCore extends AdminController parent::__construct(); } + public function initPageHeaderToolbar() + { + $this->page_header_toolbar_title = $this->l('Order messages'); + $this->page_header_toolbar_btn['new_order_message'] = array( + 'href' => self::$currentIndex.'&addorder_message&token='.$this->token, + 'desc' => $this->l('Add new order message'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } } diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index ab3f3ac5e..855356e84 100755 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -138,6 +138,18 @@ class AdminOrdersControllerCore extends AdminController parent::__construct(); } + public function initPageHeaderToolbar() + { + $this->page_header_toolbar_title = $this->l('Orders'); + $this->page_header_toolbar_btn['new_order'] = array( + 'href' => self::$currentIndex.'&addorder&token='.$this->token, + 'desc' => $this->l('Add new order'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } + public function renderForm() { if (Context::getContext()->shop->getContext() != Shop::CONTEXT_SHOP && Shop::isFeatureActive()) diff --git a/controllers/admin/AdminSlipController.php b/controllers/admin/AdminSlipController.php index dd462b111..f78b6a186 100644 --- a/controllers/admin/AdminSlipController.php +++ b/controllers/admin/AdminSlipController.php @@ -75,6 +75,18 @@ class AdminSlipControllerCore extends AdminController parent::__construct(); } + public function initPageHeaderToolbar() + { + $this->page_header_toolbar_title = $this->l('Slips'); + $this->page_header_toolbar_btn['generate_pdf'] = array( + 'href' => self::$currentIndex.'&token='.$this->token, + 'desc' => $this->l('Generate PDF'), + 'icon' => 'process-icon-save-date' + ); + + parent::initPageHeaderToolbar(); + } + public function renderForm() { $this->fields_form = array( diff --git a/controllers/admin/AdminStatusesController.php b/controllers/admin/AdminStatusesController.php index ffb47b720..a622792d6 100644 --- a/controllers/admin/AdminStatusesController.php +++ b/controllers/admin/AdminStatusesController.php @@ -185,6 +185,23 @@ class AdminStatusesControllerCore extends AdminController $helper->title = $this->l('Edit Order Status'); return $helper; } + + public function initPageHeaderToolbar() + { + $this->page_header_toolbar_title = $this->l('States'); + $this->page_header_toolbar_btn['new_order_state'] = array( + 'href' => self::$currentIndex.'&addorder_state&token='.$this->token, + 'desc' => $this->l('Add new order state'), + 'icon' => 'process-icon-new' + ); + $this->page_header_toolbar_btn['new_order_return_state'] = array( + 'href' => self::$currentIndex.'&addorder_return_state&token='.$this->token, + 'desc' => $this->l('Add new order return state'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } /** * Function used to render the list to display for this controller