[*] BO: you can now export listing of some tabs in CSV

This commit is contained in:
Rémi Gaillard
2013-02-13 16:15:37 +01:00
parent cc1ff8ef0f
commit e3e38b19e1
8 changed files with 63 additions and 13 deletions
+10 -13
View File
@@ -44,6 +44,8 @@ class AdminAddressesControllerCore extends AdminController
$this->addRowAction('delete');
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->allow_export = true;
if (!Tools::getValue('realedit'))
$this->deleted = true;
@@ -61,8 +63,15 @@ class AdminAddressesControllerCore extends AdminController
'country' => array('title' => $this->l('Country'), 'width' => 100, 'type' => 'select', 'list' => $this->countries_array, 'filter_key' => 'cl!id_country'));
parent::__construct();
$this->_select = 'cl.`name` as country';
$this->_join = '
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (cl.`id_country` = a.`id_country` AND cl.`id_lang` = '.(int)$this->context->language->id.')
LEFT JOIN `'._DB_PREFIX_.'customer` c ON a.id_customer = c.id_customer
';
$this->_where = 'AND a.id_customer != 0 '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER, 'c');
}
public function initToolbar()
{
parent::initToolbar();
@@ -71,18 +80,6 @@ class AdminAddressesControllerCore extends AdminController
'desc' => $this->l('Import')
);
}
public function renderList()
{
$this->_select = 'cl.`name` as country';
$this->_join = '
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (cl.`id_country` = a.`id_country` AND cl.`id_lang` = '.(int)$this->context->language->id.')
LEFT JOIN `'._DB_PREFIX_.'customer` c ON a.id_customer = c.id_customer
';
$this->_where = 'AND a.id_customer != 0 '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER, 'c');
return parent::renderList();
}
public function renderForm()
{
@@ -35,6 +35,7 @@ class AdminCartsControllerCore extends AdminController
$this->addRowAction('view');
$this->addRowAction('delete');
$this->allow_export = true;
$this->_select = 'CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) `customer`, a.id_cart total, ca.name carrier, o.id_order, IF(co.id_guest, 1, 0) id_guest';
$this->_join = 'LEFT JOIN '._DB_PREFIX_.'customer c ON (c.id_customer = a.id_customer)
@@ -45,6 +45,7 @@ class AdminCategoriesControllerCore extends AdminController
$this->lang = true;
$this->deleted = false;
$this->explicitSelect = true;
$this->allow_export = true;
$this->context = Context::getContext();
@@ -42,6 +42,8 @@ class AdminCustomersControllerCore extends AdminController
$this->deleted = true;
$this->explicitSelect = true;
$this->allow_export = true;
$this->addRowAction('edit');
$this->addRowAction('view');
$this->addRowAction('delete');
@@ -35,6 +35,7 @@ class AdminManufacturersControllerCore extends AdminController
$this->className = 'Manufacturer';
$this->lang = false;
$this->deleted = false;
$this->allow_export = true;
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
@@ -71,6 +71,7 @@ class AdminProductsControllerCore extends AdminController
$this->_defaultOrderBy = 'position';
$this->max_file_size = (int)(Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE') * 1000000);
$this->max_image_size = (int)Configuration::get('PS_PRODUCT_PICTURE_MAX_SIZE');
$this->allow_export = true;
// @since 1.5 : translations for tabs
$this->available_tabs_lang = array (
@@ -34,6 +34,8 @@ class AdminSuppliersControllerCore extends AdminController
$this->addRowAction('view');
$this->addRowAction('edit');
$this->addRowAction('delete');
$this->allow_export = true;
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->_select = 'COUNT(DISTINCT ps.`id_product`) AS products';