From e0e5f80767f3f49845822307d2d9055e736f6d6c Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Fri, 27 Sep 2013 19:20:46 +0200 Subject: [PATCH 1/4] [-] BO : FixBig #PSCFV-10442 - Members Cutomer Group list --- controllers/admin/AdminGroupsController.php | 46 +++++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/controllers/admin/AdminGroupsController.php b/controllers/admin/AdminGroupsController.php index 007bd38b0..7579370c7 100644 --- a/controllers/admin/AdminGroupsController.php +++ b/controllers/admin/AdminGroupsController.php @@ -30,6 +30,7 @@ class AdminGroupsControllerCore extends AdminController { $this->table = 'group'; $this->className = 'Group'; + $this->list_id = 'group'; $this->lang = true; $this->addRowAction('edit'); $this->addRowAction('view'); @@ -153,6 +154,16 @@ class AdminGroupsControllerCore extends AdminController if (Tools::isSubmit('changeShowPricesVal') && $this->id_object) $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(); } @@ -181,30 +192,29 @@ class AdminGroupsControllerCore extends AdminController $genders_icon[$gender->id] = '../genders/'.(int)$gender->id.'.jpg'; $genders[$gender->id] = $gender->name; } - $customer_fields_display = (array( - 'id_customer' => array('title' => $this->l('ID'), 'width' => 15, 'align' => 'center'), + $this->table = 'customer_group'; + $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), - 'firstname' => array('title' => $this->l('Name'), 'align' => 'center'), - 'lastname' => array('title' => $this->l('Name'), 'align' => 'center'), - 'email' => array('title' => $this->l('Email address'), 'width' => 150, 'align' => 'center'), + 'firstname' => array('title' => $this->l('First name'), 'align' => 'center'), + 'lastname' => array('title' => $this->l('Last name'), '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'), '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') )); - $customer_list = $group->getCustomers(false, 0, 100, true); - - $helper = new HelperList(); - $helper->currentIndex = Context::getContext()->link->getAdminLink('AdminCustomers', false); - $helper->token = Tools::getAdminTokenLite('AdminCustomers'); - $helper->shopLinkType = ''; - $helper->table = 'customer'; - $helper->identifier = 'id_customer'; - $helper->actions = array('edit', 'view'); - $helper->show_toolbar = false; - - return $helper->generateList($customer_list, $customer_fields_display); + $this->_select = 'c.*'; + $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'customer` c ON (a.`id_customer` = c.`id_customer`)'; + $this->_where = 'AND a.`id_group` = '.(int)$group->id.' AND c.`deleted` != 1'; + self::$currentIndex = self::$currentIndex.'&viewgroup'; + $this->processFilter(); + return parent::renderList(); } public function renderForm() From 06b6facc2d9b5320f3b86ed59bb7e9c12fb60b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 30 Sep 2013 09:59:33 +0200 Subject: [PATCH 2/4] [-] BO: Fix #PSCFV-10488 filter by employee on logs tab --- controllers/admin/AdminLogsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminLogsController.php b/controllers/admin/AdminLogsController.php index 5a4dc1255..b9db383c1 100644 --- a/controllers/admin/AdminLogsController.php +++ b/controllers/admin/AdminLogsController.php @@ -35,7 +35,7 @@ class AdminLogsControllerCore extends AdminController $this->fields_list = array( '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), 'message' => array('title' => $this->l('Message')), 'object_type' => array('title' => $this->l('Object type'), 'width' => 75), From b6f13648dbd6396c0bdb0b0c4658bf1435d215fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 30 Sep 2013 10:29:54 +0200 Subject: [PATCH 3/4] [-] WS: Fix order by on id field on multishop entities --- classes/webservice/WebserviceRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/webservice/WebserviceRequest.php b/classes/webservice/WebserviceRequest.php index 2dca1bdb3..5e4ec0b3f 100644 --- a/classes/webservice/WebserviceRequest.php +++ b/classes/webservice/WebserviceRequest.php @@ -1187,7 +1187,7 @@ class WebserviceRequestCore else { $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']; else $table_alias = ''; From 7d764c5ce8e0ccb58f6669804474397217f8eaae Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 30 Sep 2013 11:50:51 +0200 Subject: [PATCH 4/4] [-] BO : AdminImport, not matching by ref for updating --- controllers/admin/AdminImportController.php | 22 +++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index 102f63027..f144a3aaa 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -1067,13 +1067,23 @@ class AdminImportControllerCore extends AdminController if (Tools::getValue('forceIDs') && isset($info['id']) && (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')) - $product = new Product((int)$info['id']); - else - $product = new Product(); + $datas = Db::getInstance()->getRow(' + SELECT p.`id_product` + FROM `'._DB_PREFIX_.'product` p + '.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')) { @@ -1311,7 +1321,7 @@ class AdminImportControllerCore extends AdminController SELECT product_shop.`date_add`, p.`id_product` FROM `'._DB_PREFIX_.'product` p '.Shop::addSqlAssociation('product', 'p').' - WHERE p.`reference` = "'.$product->reference.'" + WHERE p.`reference` = "'.pSQL($product->reference).'" '); $product->id = (int)$datas['id_product']; $product->date_add = pSQL($datas['date_add']);