set building status assigned when Baufreigabe is set

This commit is contained in:
Frank Schubert
2021-08-30 22:51:08 +02:00
parent 609dac71ab
commit 7127593041
3 changed files with 9 additions and 6 deletions

View File

@@ -35,7 +35,7 @@
<th>Netzgebiet</th>
<th>POP</th>
<th>Typ</th>
<th>Objektcode</th>
<th>Objekt ID</th>
<th>OAN ID</th>
<th>Adresse</th>
<th>Einheiten</th>

View File

@@ -37,18 +37,18 @@
</select>
</div>
<div class="col-1">
<div class="col-2">
<label class="form-label" for="filter_status_id">Objektstatus</label>
<select name="filter[status_id]" id="filter_status_id" class="form-control">
<option></option>
<?php foreach(BuildingstatusModel::getAll() as $status): ?>
<option value="<?=$status->id?>" <?=($filter['status_id'] == $status->id) ? "selected='selected'" : ""?>><?=$status->code?> - <?=$status->name?></option>
<option value="<?=$status->id?>" <?=($filter['status_id'] == $status->id) ? "selected='selected'" : ""?>><?=$status->code?> - <?=__($status->name."-b")?></option>
<?php endforeach; ?>
</select>
</div>
<div class="col-1">
<label class="form-label" for="filter_code">Code</label>
<label class="form-label" for="filter_code">Objekt ID</label>
<input type="text" class="form-control" name="filter[code]" id="filter_code" value="<?=$filter['code']?>" />
</div>
@@ -97,12 +97,12 @@
<strong style="white-space: nowrap;"><?=$building->street?></strong><br />
<span class="text-success"><?=$building->code?></span><br />
</div>
<div class="mt-1">
<div class="mt-4">
<?=$building->contact?><br />
<strong><?=$building->phone?></strong><br />
<?=$building->email?>
</div>
<div class="mt-1">
<div class="mt-4">
<label><input type="checkbox" form="wf-building-<?=$building->id?>" name="pipework_enabled" value="1" <?=($building->pipework_enabled==1) ? "checked='checked'" : ""?>> Baufreigabe</label>
</div>
<div>

View File

@@ -138,6 +138,9 @@ class PipeworkController extends mfBaseController {
if($this->me->is(["Admin", "netowner", "pipeplanner"])) {
if($r->pipework_enabled == 1) {
$building->pipework_enabled = 1;
if($building->status_id < 3) {
$building->status_id = 3;
}
} else {
$building->pipework_enabled = 0;
}