Added Bauabschnitt Filter
This commit is contained in:
@@ -37,6 +37,22 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_networksection_id">Bauabschnitt</label>
|
||||
<select name="filter[networksection_id]" id="filter_networksection_id" class="form-control">
|
||||
<option></option>
|
||||
<?php foreach($mynetworks as $fnet): ?>
|
||||
<?php if(is_array($fnet->sections) && count($fnet->sections)): ?>
|
||||
<optgroup label="<?=$fnet->name?>">
|
||||
<?php foreach($fnet->sections as $section): ?>
|
||||
<option value="<?=$section->id?>" <?=($filter['networksection_id'] == $section->id) ? "selected='selected'" : ""?>><?=$section->name?></option>
|
||||
<?php endforeach; ?>
|
||||
</optgroup>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
|
||||
@@ -110,6 +110,13 @@ class BuildingModel {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("networksection_id", $filter)) {
|
||||
$networksection_id = $filter['networksection_id'];
|
||||
if(is_numeric($networksection_id)) {
|
||||
$where .= " AND Building.networksection_id=$networksection_id";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("status_id", $filter)) {
|
||||
$status_id = $filter['status_id'];
|
||||
if(is_numeric($status_id)) {
|
||||
|
||||
@@ -106,12 +106,20 @@ class PipeworkController extends mfBaseController {
|
||||
|
||||
private function getPreparedFilter($filter) {
|
||||
$new_filter = [];
|
||||
|
||||
if(is_numeric($filter['networksection_id']) && $filter['networksection_id']) {
|
||||
$section = new Networksection($filter['networksection_id']);
|
||||
if($section->id) {
|
||||
$filter['network_id'] = $section->network_id;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($filter as $name => $value) {
|
||||
/*if($name == 'network_id') {
|
||||
$new_filter['id'] = $value;
|
||||
continue;
|
||||
}*/
|
||||
|
||||
$new_filter[$name] = $value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user