Building/Form: GPS editing can be enabled
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title mb-2"><?=($network->id) ? "Objekt bearbeiten" : "Neues Objekt"?></h4>
|
||||
<h4 class="header-title mb-2"><?=($building->id) ? "Objekt bearbeiten" : "Neues Objekt"?></h4>
|
||||
|
||||
<form class="form-horizontal" method="post" action="<?=self::getUrl("Building", "save")?>">
|
||||
<div class="card">
|
||||
@@ -122,16 +122,25 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-4 col-form-label" for="gps_lat">GPS Länge (N)</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" name="gps_lat" id="gps_lat" value="<?=$building->gps_lat?>" readonly='readonly' />
|
||||
<input type="text" class="form-control" name="gps_lat" id="gps_lat" value="<?=$building->gps_lat?>" <?=($building->id) ? "readonly='readonly'" : ""?> />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-4 col-form-label" for="gps_long">GPS Breite (E)</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" name="gps_long" id="gps_long" value="<?=$building->gps_long?>" readonly='readonly' />
|
||||
<input type="text" class="form-control" name="gps_long" id="gps_long" value="<?=$building->gps_long?>" <?=($building->id) ? "readonly='readonly'" : ""?> />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($building->gps_lat && $building->gps_long): ?>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-4"></div>
|
||||
<div class="col-lg-8">
|
||||
<button type="button" id="edit-gps" class="btn btn-sm btn-outline-pink"><i class="fas fa-edit"></i> GPS-Koordinaten ändern</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<?php if($building->gps_lat && $building->gps_long): ?>
|
||||
@@ -338,6 +347,10 @@
|
||||
);
|
||||
}
|
||||
|
||||
function enableGpsInputs() {
|
||||
$("#gps_lat").removeAttr("readonly");
|
||||
$("#gps_long").removeAttr("readonly");
|
||||
}
|
||||
|
||||
|
||||
<?php if($building->gps_lat && $building->gps_long): ?>
|
||||
@@ -367,6 +380,10 @@
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
$("#edit-gps").click( function() {
|
||||
enableGpsInputs();
|
||||
});
|
||||
|
||||
$("#network_id").change(function() {
|
||||
updatePops();
|
||||
updatePermissions();
|
||||
|
||||
Reference in New Issue
Block a user