|
|
@@ -24,6 +24,8 @@ if(isset($id)) {
|
|
|
$core->addBreadcrumb($customer->getUrl(), $customer->name);
|
|
|
$core->addBreadcrumb($location->getUrl(), $location->name);
|
|
|
|
|
|
+ $address = $location->getAddress();
|
|
|
+
|
|
|
$title = __("Update Location");
|
|
|
}
|
|
|
else {
|
|
|
@@ -33,7 +35,17 @@ else {
|
|
|
if($customer_id) {
|
|
|
$customer = Customer::require($customer_id);
|
|
|
$location->customer_id = $customer_id;
|
|
|
+ $location->name = $customer->name;
|
|
|
+ $location->phone = $customer->phone;
|
|
|
+ $location->fax = $customer->fax;
|
|
|
+ $location->email = $customer->email;
|
|
|
+
|
|
|
$core->addBreadcrumb($customer->getUrl(), $customer->name);
|
|
|
+
|
|
|
+ $address = $customer->getAddress();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $address = $location->getAddress();
|
|
|
}
|
|
|
|
|
|
$location->dts_created = Database::dts();
|
|
|
@@ -63,6 +75,6 @@ View::include("header");
|
|
|
View::include("entity_form", [
|
|
|
"title" => $title,
|
|
|
"model" => $location,
|
|
|
- "address" => $location->getAddress()
|
|
|
+ "address" => $address
|
|
|
]);
|
|
|
View::include("footer");
|