|
@@ -10,7 +10,7 @@ Core::addBreadcrumb("/account/locations", "Locations");
|
|
|
Core::addBreadcrumb("/account/locations?customer_id=$customer->id", "$customer->name Locations");
|
|
Core::addBreadcrumb("/account/locations?customer_id=$customer->id", "$customer->name Locations");
|
|
|
Core::addBreadcrumb("/account/locations/add", $page_title);
|
|
Core::addBreadcrumb("/account/locations/add", $page_title);
|
|
|
|
|
|
|
|
-$location = new Location;
|
|
|
|
|
|
|
+$location = new Location();
|
|
|
$location->customer_id = $customer->id;
|
|
$location->customer_id = $customer->id;
|
|
|
$location->country = DEFAULT_COUNTRY;
|
|
$location->country = DEFAULT_COUNTRY;
|
|
|
|
|
|
|
@@ -84,10 +84,18 @@ if($submit) {
|
|
|
$form_exception->addError("Failed to get latitude/longitude from address.");
|
|
$form_exception->addError("Failed to get latitude/longitude from address.");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if($form_exception->hasErrors()) throw $form_exception;
|
|
|
|
|
|
|
+ if($form_exception->hasErrors()) {
|
|
|
|
|
+ throw $form_exception;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $modified_fields = $location->getModifiedFields();
|
|
|
|
|
|
|
|
$success = $location->commit();
|
|
$success = $location->commit();
|
|
|
- if(!$success) throw new Exception("Failed to add location at this time. Please try again later.");
|
|
|
|
|
|
|
+ if(!$success) {
|
|
|
|
|
+ throw new RuntimeException("Failed to add location at this time. Please try again later.");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $location->logUpdate((object) [], $modified_fields);
|
|
|
|
|
|
|
|
// Venue types
|
|
// Venue types
|
|
|
$venue_type_ids = http::value("venue_type_ids", "int");
|
|
$venue_type_ids = http::value("venue_type_ids", "int");
|