|
|
@@ -7,6 +7,18 @@ $settings = $core->getSettings();
|
|
|
|
|
|
$products = Product::query([], ["sort" => "name"]);
|
|
|
|
|
|
+$request = Request::fromRequest();
|
|
|
+$default_location_id = $request->int("add_location_id");
|
|
|
+
|
|
|
+$location_options = [];
|
|
|
+
|
|
|
+foreach(Customer::getAll() as $customer) {
|
|
|
+ foreach($customer->getLocations() as $location) {
|
|
|
+ $location_options[$location->id] = $location->getDisplayName();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
?>
|
|
|
<div class="modal fade" role="dialog" tabindex="-1" data-backdrop="static" id="new-document-modal">
|
|
|
<div class="modal-dialog modal-lg">
|
|
|
@@ -47,15 +59,7 @@ $products = Product::query([], ["sort" => "name"]);
|
|
|
<select class="form-select" name="location_id" id="new-document-location-id">
|
|
|
<option value=""><?=htmlspecialchars(__("Select Location"))?></option>
|
|
|
<?php
|
|
|
- foreach(Customer::getAll() as $customer) {
|
|
|
- foreach($customer->getLocations() as $location) {
|
|
|
- ?>
|
|
|
- <option value="<?=$location->id?>">
|
|
|
- <?=htmlspecialchars($location->getDisplayName())?>
|
|
|
- </option>
|
|
|
- <?php
|
|
|
- }
|
|
|
- }
|
|
|
+ HtmlHelper::renderOptions($location_options, $default_location_id);
|
|
|
?>
|
|
|
</select>
|
|
|
</div>
|