[-] BO : fix #PSCFV-4216

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17648 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2012-10-01 14:19:39 +00:00
parent 99decb70f1
commit b7fec2c3e5
3 changed files with 31 additions and 4 deletions
@@ -308,6 +308,7 @@ class AdminImportControllerCore extends AdminController
'alias' => array('label' => $this->l('Alias *')),
'active' => array('label' => $this->l('Active (0/1)')),
'customer_email' => array('label' => $this->l('Customer e-mail')),
'id_customer' => array('label' => $this->l('Customer ID')),
'manufacturer' => array('label' => $this->l('Manufacturer')),
'supplier' => array('label' => $this->l('Supplier')),
'company' => array('label' => $this->l('Company')),
@@ -1972,6 +1973,31 @@ class AdminImportControllerCore extends AdminController
continue;
}
}
elseif (isset($address->id_customer) && !empty($address->id_customer))
{
if (Customer::customerIdExistsStatic((int)$address->id_customer))
{
$customer = new Customer((int)$address->id_customer);
// a customer could exists in different shop
$customer_list = Customer::getCustomersByEmail($customer->email);
if (count($customer_list) == 0)
$this->errors[] = sprintf(
Tools::displayError('%1$s does not exist in database %2$s (ID: %3$s) cannot be saved'),
Db::getInstance()->getMsgError(),
$customer->email,
(int)$address->customer_id
);
}
else
$this->errors[] = sprintf(Tools::displayError('The customer ID n.%d does not exist in database (ID: %d) cannot be saved'), $address->customer_id);
}
else
{
$customer_list = array();
$address->id_customer = 0;
}
if (isset($address->manufacturer) && is_numeric($address->manufacturer) && Manufacturer::manufacturerExists((int)$address->manufacturer))
$address->id_manufacturer = (int)$address->manufacturer;
+4 -4
View File
@@ -1,4 +1,4 @@
id;Alias*;Active (0/1);Customer e-mail;Manufacturer;Supplier;Company;Lastname*;Firstname*;Address 1*;Address 2;Postcode* / Zipcode*;City*;Country*;State;Other;Phone;Mobile Phone;VAT number
1;My Adress;1;johndoe@prestashop.com;;;;Doe;John;16, Main street;2nd floor;75000;PARIS ;France;;;140138844;;
2;My work;1;johndoe@prestashop.com;;;My Company;Doe;John;535, Baker street;;13000;Marseile;France;;;235445588;;
3;My work;0;;Apple Computer, Inc;;;Jobs;Steve;1 Infinite Loop;;95014;CUPERTINO;United States;California;;(800) 275-2273;;
"id";"Alias*";"Active (0/1)";"Customer e-mail";"Customer ID";"Manufacturer";"Supplier";"Company";"Lastname*";"Firstname*";"Address 1*";"Address 2";"Postcode* / Zipcode*";"City*";"Country*";"State";"Other";"Phone";"Mobile Phone";"VAT number"
1;"My Adress";1;"pub@prestashop.com";1;;;;"Doe";"John";"16, Main street";"2nd floor";75000;"PARIS ";"France";;;140138844;;
2;"My work";1;"pub@prestashop.com";1;;;"My Company";"Doe";"John";"535, Baker street";;13000;"Marseile";"France";;;235445588;;
3;"My work";0;;;"Apple Computer, Inc";;;"Jobs";"Steve";"1 Infinite Loop";;95014;"CUPERTINO";"United States";"California";;"(800) 275-2273";;
1 id Alias* Active (0/1) Customer e-mail Customer ID Manufacturer Supplier Company Lastname* Firstname* Address 1* Address 2 Postcode* / Zipcode* City* Country* State Other Phone Mobile Phone VAT number
2 1 My Adress 1 johndoe@prestashop.com pub@prestashop.com 1 Doe John 16, Main street 2nd floor 75000 PARIS France 140138844
3 2 My work 1 johndoe@prestashop.com pub@prestashop.com 1 My Company Doe John 535, Baker street 13000 Marseile France 235445588
4 3 My work 0 Apple Computer, Inc Jobs Steve 1 Infinite Loop 95014 CUPERTINO United States California (800) 275-2273
+1
View File
@@ -1432,6 +1432,7 @@ $_LANGADM['AdminImportca676c9ec4e1ae9fe9df3ac28910e6ef'] = 'Le prix unitaire HT
$_LANGADM['AdminImportcbfb910715c99134a5987630fff104da'] = 'Exemple de fichier de catégories';
$_LANGADM['AdminImportcf7a1f189bbd1f48db0ece1da9cc0802'] = 'Disponible à la commande (0 = Non, 1 = Oui)';
$_LANGADM['AdminImportd1457b72c3fb323a2671125aef3eab5d'] = '?';
$_LANGADM['AdminImportd37c2bf1bd3143847fca087b354f920e'] = 'ID du client';
$_LANGADM['AdminImportd66424c2034991e541dee7face1851fc'] = 'Fichier encodé en ISO-8859-1 ?';
$_LANGADM['AdminImportd7a158f13040edafc30b622d16c8b12d'] = '* Champs requis';
$_LANGADM['AdminImportd7fa0b529a16e87f34d8ef35054c765c'] = 'Importer des produits dans une commande fournisseur va d\'abord effacer les produits contenus dans cette commande.';