Building/Form: get gps again, if address changed
This commit is contained in:
@@ -87,6 +87,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row" id="gps-again" style="display:none;">
|
||||
<div class="col-lg-2"></div>
|
||||
<div class="col-lg-10">
|
||||
<label class="text-pink"><input type="checkbox" name="gps_again" value="1" /> GPS-Koordinaten erneut berechnen</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="code">Objekt ID</label>
|
||||
<div class="col-lg-10">
|
||||
@@ -353,6 +360,11 @@
|
||||
$("#edit-gps").remove();
|
||||
}
|
||||
|
||||
function showGpsAgain() {
|
||||
$("#gps-again").show();
|
||||
$("#gps-again input[type=checkbox").prop("checked", true);
|
||||
}
|
||||
|
||||
|
||||
<?php if($building->gps_lat && $building->gps_long): ?>
|
||||
////////////
|
||||
@@ -381,6 +393,10 @@
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
$("#street, #zip, #city").change(function() {
|
||||
showGpsAgain();
|
||||
});
|
||||
|
||||
$("#edit-gps").click( function() {
|
||||
enableGpsInputs();
|
||||
});
|
||||
|
||||
@@ -113,7 +113,7 @@ class BuildingController extends mfBaseController {
|
||||
}
|
||||
|
||||
// get GPS location
|
||||
if(!$building->gps_lat && !$building->gps_long) {
|
||||
if((!$building->gps_lat && !$building->gps_long) || $r->gps_again ) {
|
||||
$search = [
|
||||
'country' => "AT",
|
||||
'city' => $building->city,
|
||||
@@ -134,7 +134,7 @@ class BuildingController extends mfBaseController {
|
||||
$building->code = $building->getNewObjectCode();
|
||||
$building->save();
|
||||
}
|
||||
if(!$building->laea) {
|
||||
if(!$building->laea || $r->gps_again) {
|
||||
$building->laea = $building->getLaeaCoordinates();
|
||||
$building->save();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user