// Fixed #PSTEST-453
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12530 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -163,6 +163,9 @@ class AddressCore extends ObjectModel
|
|||||||
$this->country = Country::getNameById($id_lang ? $id_lang : Configuration::get('PS_LANG_DEFAULT'), $this->id_country);
|
$this->country = Country::getNameById($id_lang ? $id_lang : Configuration::get('PS_LANG_DEFAULT'), $this->id_country);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ObjectModel::add()
|
||||||
|
*/
|
||||||
public function add($autodate = true, $null_values = false)
|
public function add($autodate = true, $null_values = false)
|
||||||
{
|
{
|
||||||
if (!parent::add($autodate, $null_values))
|
if (!parent::add($autodate, $null_values))
|
||||||
@@ -173,6 +176,9 @@ class AddressCore extends ObjectModel
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ObjectModel::delete()
|
||||||
|
*/
|
||||||
public function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
if (Validate::isUnsignedId($this->id_customer))
|
if (Validate::isUnsignedId($this->id_customer))
|
||||||
@@ -200,6 +206,9 @@ class AddressCore extends ObjectModel
|
|||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ObjectModel::validateController()
|
||||||
|
*/
|
||||||
public function validateController($htmlentities = true)
|
public function validateController($htmlentities = true)
|
||||||
{
|
{
|
||||||
$errors = parent::validateController($htmlentities);
|
$errors = parent::validateController($htmlentities);
|
||||||
|
|||||||
@@ -407,10 +407,28 @@ class AdminSuppliersControllerCore extends AdminController
|
|||||||
$address = new Address($object->id_address);
|
$address = new Address($object->id_address);
|
||||||
if (Validate::isLoadedObject($address))
|
if (Validate::isLoadedObject($address))
|
||||||
{
|
{
|
||||||
$address->id_supplier = $object->id_address;
|
$address->id_supplier = $object->id;
|
||||||
$address->save();
|
$address->save();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see AdminController::afterUpdate()
|
||||||
|
*/
|
||||||
|
public function afterUpdate($object)
|
||||||
|
{
|
||||||
|
$address = new Address($object->id_address);
|
||||||
|
if (Validate::isLoadedObject($address))
|
||||||
|
{
|
||||||
|
if ($address->id_supplier != $object->id)
|
||||||
|
{
|
||||||
|
$address->id_supplier = $object->id;
|
||||||
|
$address->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user