// Improve backoffice order

This commit is contained in:
rGaillard
2011-12-29 14:35:03 +00:00
parent e66bc7f4f8
commit e7264d40cf
5 changed files with 23 additions and 12 deletions
+11 -3
View File
@@ -134,10 +134,12 @@ class AdminAddressesControllerCore extends AdminController
'class' => 'button'
)
);
if (Validate::isLoadedObject($this->object))
$id_customer = (int)Tools::getValue('id_customer');
if (!$id_customer && Validate::isLoadedObject($this->object))
$id_customer = $this->object->id_customer;
if ($id_customer)
{
$customer = new Customer($this->object->id_customer);
$customer = new Customer((int)$id_customer);
$tokenCustomer = Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)$this->context->employee->id);
}
@@ -271,6 +273,12 @@ class AdminAddressesControllerCore extends AdminController
}
}
if (!Tools::isSubmit('submit'.strtoupper($this->table)) && Validate::isLoadedObject($customer) && !Validate::isLoadedObject($this->object))
{
$this->fields_value['lastname'] = $customer->lastname;
$this->fields_value['firstname'] = $customer->firstname;
}
// merge address format with the rest of the form
array_splice($this->fields_form['input'], 3, 0, $temp_fields);