// Controllers: improvement on CSV

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11097 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
bMancone
2011-12-09 16:47:16 +00:00
parent bd402c3514
commit a749dc7ff1
3 changed files with 9 additions and 8 deletions
@@ -137,8 +137,6 @@ class AdminStockConfigurationControllerCore extends AdminController
$this->display = 'edit';
}
parent::init();
p($this->display);
p($this->action);
}
/**
@@ -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',
@@ -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']);
}