diff --git a/controllers/admin/AdminStockConfigurationController.php b/controllers/admin/AdminStockConfigurationController.php index 81411987f..91b48b5f1 100644 --- a/controllers/admin/AdminStockConfigurationController.php +++ b/controllers/admin/AdminStockConfigurationController.php @@ -137,8 +137,6 @@ class AdminStockConfigurationControllerCore extends AdminController $this->display = 'edit'; } parent::init(); - p($this->display); - p($this->action); } /** diff --git a/controllers/admin/AdminStockInstantStateController.php b/controllers/admin/AdminStockInstantStateController.php index b20ceb1bc..36b7df378 100644 --- a/controllers/admin/AdminStockInstantStateController.php +++ b/controllers/admin/AdminStockInstantStateController.php @@ -272,7 +272,7 @@ class AdminStockInstantStateControllerCore extends AdminController */ public function initToolbar() { - if (Tools::isSubmit('id_warehouse') && (int)Tools::getValue('id_warehouse') != -1) + if (Tools::isSubmit('id_warehouse') && (int)Tools::getValue('id_warehouse') != -1 && count($this->_list) > 0) { $this->toolbar_btn['export-stock-state-quantities-csv'] = array( 'short' => 'Export this list as CSV', diff --git a/controllers/admin/AdminStockMvtController.php b/controllers/admin/AdminStockMvtController.php index 2ad1fad74..647052ac2 100644 --- a/controllers/admin/AdminStockMvtController.php +++ b/controllers/admin/AdminStockMvtController.php @@ -229,11 +229,14 @@ class AdminStockMvtControllerCore extends AdminController */ public function initToolbar() { - $this->toolbar_btn['export-stock-mvt-csv'] = array( - 'short' => 'Export this list as CSV', - 'href' => $this->context->link->getAdminLink('AdminStockMvt').'&csv&id_warehouse='.(int)$this->getCurrentWarehouseId(), - 'desc' => $this->l('Export (CSV)'), - ); + if (count($this->_list) > 0) + { + $this->toolbar_btn['export-stock-mvt-csv'] = array( + 'short' => 'Export this list as CSV', + 'href' => $this->context->link->getAdminLink('AdminStockMvt').'&csv&id_warehouse='.(int)$this->getCurrentWarehouseId(), + 'desc' => $this->l('Export (CSV)'), + ); + } parent::initToolbar(); unset($this->toolbar_btn['new']); }