// StockMvt : added the name of the warehouse for the CSV export

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10942 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
bMancone
2011-12-05 16:50:47 +00:00
parent 394aeab269
commit b94606e103
@@ -228,7 +228,7 @@ class AdminStockMvtControllerCore extends AdminController
{
$this->toolbar_btn['export-csv'] = array(
'short' => 'Export this list as CSV',
'href' => $this->context->link->getAdminLink('AdminStockMvt').'&csv',
'href' => $this->context->link->getAdminLink('AdminStockMvt').'&csv&id_warehouse='.(int)$this->getCurrentWarehouseId(),
'desc' => $this->l('Export (CSV)'),
);
parent::initToolbar();
@@ -244,8 +244,8 @@ class AdminStockMvtControllerCore extends AdminController
return;
// header
if ($this->getCurrentWarehouseId() != -1)
$filename = $this->l('stock_mvt').'_'.Warehouse::getWarehouseNameById($this->getCurrentWarehouseId()).'.csv';
if (Tools::getValue('id_warehouse') != -1)
$filename = $this->l('stock_mvt').'_'.Warehouse::getWarehouseNameById((int)Tools::getValue('id_warehouse')).'.csv';
else
$filename = $this->l('stock_mvt').'.csv';
header('Content-type: text/csv');