Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development

This commit is contained in:
vAugagneur
2013-02-15 11:33:06 +01:00
61 changed files with 2397 additions and 1952 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?')));
@@ -64,6 +64,13 @@ class AdminMetaControllerCore extends AdminController
'type' => 'rewriting_settings',
'mod_rewrite' => $mod_rewrite
),
'PS_ALLOW_ACCENTED_CHARS_URL' => array(
'title' => $this->l('Accented URL'),
'desc' => $this->l('Enable if you want to allow accented characters in your friendly URLs.'),
'validation' => 'isBool',
'cast' => 'intval',
'type' => 'bool'
),
'PS_CANONICAL_REDIRECT' => array(
'title' => $this->l('Automatically redirect to the canonical URL.'),
'desc' => $this->l('Recommended, but your theme must be compliant.'),
+7 -1
View File
@@ -1072,6 +1072,12 @@ class AdminModulesControllerCore extends AdminController
unset($object);
}
// Don't display categories without modules
$cleaned_list = array();
foreach ($this->list_modules_categories as $k => $list)
if ($list['nb'] > 0)
$cleaned_list[$k] = $list;
// Actually used for the report of the upgraded errors
if (count($module_errors))
{
@@ -1109,7 +1115,7 @@ class AdminModulesControllerCore extends AdminController
$tpl_vars['nb_modules_uninstalled'] = $tpl_vars['nb_modules'] - $tpl_vars['nb_modules_installed'];
$tpl_vars['nb_modules_activated'] = $this->nb_modules_activated;
$tpl_vars['nb_modules_unactivated'] = $tpl_vars['nb_modules_installed'] - $tpl_vars['nb_modules_activated'];
$tpl_vars['list_modules_categories'] = $this->list_modules_categories;
$tpl_vars['list_modules_categories'] = $cleaned_list;
$tpl_vars['list_modules_authors'] = $this->modules_authors;
$tpl_vars['check_url_fopen'] = (ini_get('allow_url_fopen') ? 'ok' : 'ko');
+1 -1
View File
@@ -35,7 +35,7 @@ class AdminOrdersControllerCore extends AdminController
$this->lang = false;
$this->addRowAction('view');
$this->explicitSelect = true;
$this->allow_export = true;
$this->deleted = false;
$this->context = Context::getContext();
+25 -9
View File
@@ -53,6 +53,8 @@ class AdminProductsControllerCore extends AdminController
protected $position_identifier = 'id_product';
protected $submitted_tabs;
protected $id_current_category;
public function __construct()
{
@@ -71,6 +73,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 (
@@ -121,17 +124,28 @@ class AdminProductsControllerCore extends AdminController
$this->available_tabs_lang['Module'.ucfirst($m['module'])] = Module::getModuleName($m['module']);
}
if (Tools::getValue('reset_filter_category'))
$this->context->cookie->id_category_products_filter = false;
/* Join categories table */
if ($id_category = (int)Tools::getValue('productFilter_cl!name'))
{
$this->_category = new Category((int)$id_category);
$_POST['productFilter_cl!name'] = $this->_category->name[$this->context->language->id];
}
elseif ($id_category = Tools::getvalue('id_category'))
$this->_category = new Category((int)$id_category);
else
$this->_category = new Category();
{
if ($id_category = (int)Tools::getValue('id_category'))
{
$this->id_current_category = $id_category;
$this->context->cookie->id_category_products_filter = $id_category;
}
elseif ($id_category = $this->context->cookie->id_category_products_filter)
$this->id_current_category = $id_category;
if ($this->id_current_category)
$this->_category = new Category((int)$this->id_current_category);
else
$this->_category = new Category();
}
$join_category = false;
if (Validate::isLoadedObject($this->_category) && empty($this->_filter))
@@ -241,7 +255,8 @@ class AdminProductsControllerCore extends AdminController
'type' => 'bool',
'orderby' => false
);
if ((int)Tools::getValue('id_category'))
if ((int)$this->id_current_category)
$this->fields_list['position'] = array(
'title' => $this->l('Position'),
'width' => 70,
@@ -2126,8 +2141,8 @@ class AdminProductsControllerCore extends AdminController
}
else
{
if ($id_category = (int)Tools::getValue('id_category'))
self::$currentIndex .= '&id_category='.(int)$id_category;
if ($id_category = (int)$this->id_current_category)
self::$currentIndex .= '&id_category='.(int)$this->id_current_category;
// If products from all categories are displayed, we don't want to use sorting by position
if (!$id_category)
@@ -2139,8 +2154,9 @@ class AdminProductsControllerCore extends AdminController
unset($this->context->cookie->{$this->table.'Orderway'});
}
}
$id_category = (int)Tools::getValue('id_category', 1);
$this->tpl_list_vars['is_category_filter'] = Tools::getValue('id_category') ? true : false;
if (!$id_category)
$id_category = 1;
$this->tpl_list_vars['is_category_filter'] = (bool)$this->id_current_category;
// Generate category selection tree
$helper = new Helper();
@@ -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';