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

This commit is contained in:
djfm
2013-09-30 16:13:15 +00:00
4 changed files with 46 additions and 26 deletions
+1 -1
View File
@@ -1187,7 +1187,7 @@ class WebserviceRequestCore
else else
{ {
$object = new $this->resourceConfiguration['retrieveData']['className'](); $object = new $this->resourceConfiguration['retrieveData']['className']();
if ($object->isMultiShopField($this->resourceConfiguration['fields'][$fieldName]['sqlId'])) if ($object->isMultiShopField($this->resourceConfiguration['fields'][$fieldName]['sqlId']) || $fieldName == 'id')
$table_alias = 'multi_shop_'.$this->resourceConfiguration['retrieveData']['table']; $table_alias = 'multi_shop_'.$this->resourceConfiguration['retrieveData']['table'];
else else
$table_alias = ''; $table_alias = '';
+28 -18
View File
@@ -30,6 +30,7 @@ class AdminGroupsControllerCore extends AdminController
{ {
$this->table = 'group'; $this->table = 'group';
$this->className = 'Group'; $this->className = 'Group';
$this->list_id = 'group';
$this->lang = true; $this->lang = true;
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('view'); $this->addRowAction('view');
@@ -153,6 +154,16 @@ class AdminGroupsControllerCore extends AdminController
if (Tools::isSubmit('changeShowPricesVal') && $this->id_object) if (Tools::isSubmit('changeShowPricesVal') && $this->id_object)
$this->action = 'change_show_prices_val'; $this->action = 'change_show_prices_val';
if (Tools::getIsset('viewgroup'))
{
$this->list_id = 'customer_group';
if (isset($_POST['submitReset'.$this->list_id]))
$this->processResetFilters();
}
else
$this->list_id = 'group';
parent::initProcess(); parent::initProcess();
} }
@@ -181,30 +192,29 @@ class AdminGroupsControllerCore extends AdminController
$genders_icon[$gender->id] = '../genders/'.(int)$gender->id.'.jpg'; $genders_icon[$gender->id] = '../genders/'.(int)$gender->id.'.jpg';
$genders[$gender->id] = $gender->name; $genders[$gender->id] = $gender->name;
} }
$customer_fields_display = (array( $this->table = 'customer_group';
'id_customer' => array('title' => $this->l('ID'), 'width' => 15, 'align' => 'center'), $this->lang = false;
$this->list_id = 'customer_group';
$this->actions = array();
$this->bulk_actions = false;
$this->no_link = true;
$this->fields_list = (array(
'id_customer' => array('title' => $this->l('ID'), 'width' => 15, 'align' => 'center', 'filter_key' => 'c!id_customer'),
'id_gender' => array('title' => $this->l('Titles'), 'align' => 'center', 'width' => 50,'icon' => $genders_icon, 'list' => $genders), 'id_gender' => array('title' => $this->l('Titles'), 'align' => 'center', 'width' => 50,'icon' => $genders_icon, 'list' => $genders),
'firstname' => array('title' => $this->l('Name'), 'align' => 'center'), 'firstname' => array('title' => $this->l('First name'), 'align' => 'center'),
'lastname' => array('title' => $this->l('Name'), 'align' => 'center'), 'lastname' => array('title' => $this->l('Last name'), 'align' => 'center'),
'email' => array('title' => $this->l('Email address'), 'width' => 150, 'align' => 'center'), 'email' => array('title' => $this->l('Email address'), 'width' => 150, 'align' => 'center', 'filter_key' => 'c!email', 'orderby' => true),
'birthday' => array('title' => $this->l('Birth date'), 'width' => 150, 'align' => 'right', 'type' => 'date'), 'birthday' => array('title' => $this->l('Birth date'), 'width' => 150, 'align' => 'right', 'type' => 'date'),
'date_add' => array('title' => $this->l('Register date'), 'width' => 150, 'align' => 'right', 'type' => 'date'), 'date_add' => array('title' => $this->l('Register date'), 'width' => 150, 'align' => 'right', 'type' => 'date'),
'orders' => array('title' => $this->l('Orders'), 'align' => 'center'),
'active' => array('title' => $this->l('Enabled'),'align' => 'center','width' => 20, 'active' => 'status','type' => 'bool') 'active' => array('title' => $this->l('Enabled'),'align' => 'center','width' => 20, 'active' => 'status','type' => 'bool')
)); ));
$customer_list = $group->getCustomers(false, 0, 100, true); $this->_select = 'c.*';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'customer` c ON (a.`id_customer` = c.`id_customer`)';
$helper = new HelperList(); $this->_where = 'AND a.`id_group` = '.(int)$group->id.' AND c.`deleted` != 1';
$helper->currentIndex = Context::getContext()->link->getAdminLink('AdminCustomers', false); self::$currentIndex = self::$currentIndex.'&viewgroup';
$helper->token = Tools::getAdminTokenLite('AdminCustomers'); $this->processFilter();
$helper->shopLinkType = ''; return parent::renderList();
$helper->table = 'customer';
$helper->identifier = 'id_customer';
$helper->actions = array('edit', 'view');
$helper->show_toolbar = false;
return $helper->generateList($customer_list, $customer_fields_display);
} }
public function renderForm() public function renderForm()
+16 -6
View File
@@ -1067,13 +1067,23 @@ class AdminImportControllerCore extends AdminController
if (Tools::getValue('forceIDs') && isset($info['id']) && (int)$info['id']) if (Tools::getValue('forceIDs') && isset($info['id']) && (int)$info['id'])
$product = new Product((int)$info['id']); $product = new Product((int)$info['id']);
else elseif (Tools::getValue('match_ref') && array_key_exists('reference', $info))
{ {
if (array_key_exists('id', $info) && (int)$info['id'] && Product::existsInDatabase((int)$info['id'], 'product')) $datas = Db::getInstance()->getRow('
$product = new Product((int)$info['id']); SELECT p.`id_product`
else FROM `'._DB_PREFIX_.'product` p
$product = new Product(); '.Shop::addSqlAssociation('product', 'p').'
WHERE p.`reference` = "'.pSQL($info['reference']).'"
');
if (isset($datas['id_product']) && $datas['id_product'])
$product = new Product((int)$datas['id_product']);
else
$product = new Product();
} }
elseif (array_key_exists('id', $info) && (int)$info['id'] && Product::existsInDatabase((int)$info['id'], 'product'))
$product = new Product((int)$info['id']);
else
$product = new Product();
if (array_key_exists('id', $info) && (int)$info['id'] && Product::existsInDatabase((int)$info['id'], 'product')) if (array_key_exists('id', $info) && (int)$info['id'] && Product::existsInDatabase((int)$info['id'], 'product'))
{ {
@@ -1311,7 +1321,7 @@ class AdminImportControllerCore extends AdminController
SELECT product_shop.`date_add`, p.`id_product` SELECT product_shop.`date_add`, p.`id_product`
FROM `'._DB_PREFIX_.'product` p FROM `'._DB_PREFIX_.'product` p
'.Shop::addSqlAssociation('product', 'p').' '.Shop::addSqlAssociation('product', 'p').'
WHERE p.`reference` = "'.$product->reference.'" WHERE p.`reference` = "'.pSQL($product->reference).'"
'); ');
$product->id = (int)$datas['id_product']; $product->id = (int)$datas['id_product'];
$product->date_add = pSQL($datas['date_add']); $product->date_add = pSQL($datas['date_add']);
+1 -1
View File
@@ -35,7 +35,7 @@ class AdminLogsControllerCore extends AdminController
$this->fields_list = array( $this->fields_list = array(
'id_log' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'id_log' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'employee' => array('title' => $this->l('Employee'), 'align' => 'center', 'width' => 100), 'employee' => array('title' => $this->l('Employee'), 'align' => 'center', 'width' => 100, 'havingFilter' => true),
'severity' => array('title' => $this->l('Severity (1-4)'), 'align' => 'center', 'width' => 50), 'severity' => array('title' => $this->l('Severity (1-4)'), 'align' => 'center', 'width' => 50),
'message' => array('title' => $this->l('Message')), 'message' => array('title' => $this->l('Message')),
'object_type' => array('title' => $this->l('Object type'), 'width' => 75), 'object_type' => array('title' => $this->l('Object type'), 'width' => 75),