|
@@ -16,12 +16,8 @@ $core->addBreadcrumb("/locations", __("Locations"));
|
|
|
$user = $core->getUser();
|
|
$user = $core->getUser();
|
|
|
|
|
|
|
|
if(isset($id)) {
|
|
if(isset($id)) {
|
|
|
- $location = Location::get($id);
|
|
|
|
|
- if(!$location) {
|
|
|
|
|
- throw new RuntimeException(__("Location not found."));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $location = Location::require($id);
|
|
|
|
|
|
|
|
- $customer = $location->getCustomer();
|
|
|
|
|
$location->dts_updated = Database::dts();
|
|
$location->dts_updated = Database::dts();
|
|
|
|
|
|
|
|
$core->addBreadcrumb($location->getUrl(), $location->name);
|
|
$core->addBreadcrumb($location->getUrl(), $location->name);
|
|
@@ -31,11 +27,6 @@ if(isset($id)) {
|
|
|
else {
|
|
else {
|
|
|
$customer_id = $request->int("customer_id");
|
|
$customer_id = $request->int("customer_id");
|
|
|
|
|
|
|
|
- $customer = Customer::get($customer_id);
|
|
|
|
|
- if(!$customer) {
|
|
|
|
|
- throw new RuntimeException(__("Customer not found."));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
$location = new Location();
|
|
$location = new Location();
|
|
|
$location->customer_id = $customer_id;
|
|
$location->customer_id = $customer_id;
|
|
|
$location->dts_created = Database::dts();
|
|
$location->dts_created = Database::dts();
|