Added new status filter to Pipe- and Linework
This commit is contained in:
@@ -96,6 +96,8 @@
|
||||
>
|
||||
<?=$status->code?> - <?=__($status->name."-t")?></option>
|
||||
<?php endforeach; ?>
|
||||
<option value="">-----</option>
|
||||
<option value="3,4,5,6" <?=(array_key_exists("status_id", $filter) && $filter["status_id"] == "3,4,5,6") ? "selected='selected'" : ""?>>Bauauftrag zugeteilt oder erledigt</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -91,6 +91,8 @@
|
||||
>
|
||||
<?=$status->code?> - <?=__($status->name."-b")?></option>
|
||||
<?php endforeach; ?>
|
||||
<option value="">-----</option>
|
||||
<option value="3,4,5" <?=(array_key_exists("status_id", $filter) && $filter["status_id"] == "3,4,5") ? "selected='selected'" : ""?>>Bauauftrag zugeteilt oder erledigt</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -155,7 +155,9 @@ class BuildingModel {
|
||||
|
||||
if(array_key_exists("status_id", $filter)) {
|
||||
$status_id = $filter['status_id'];
|
||||
if(is_numeric($status_id)) {
|
||||
if(is_array($status_id)) {
|
||||
$where .= " AND Building.status_id IN (".implode(",", $status_id).")";
|
||||
} elseif(is_numeric($status_id)) {
|
||||
$where .= " AND Building.status_id=$status_id";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,9 +105,9 @@ class LineworkController extends mfBaseController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(!!in_array($this->me->id, ["145","62","56"]) && !array_key_exists("status_id", $filter)) {
|
||||
|
||||
|
||||
if(!in_array($this->me->id, ["145","62","56"]) && !array_key_exists("status_id", $filter)) {
|
||||
$termination_search["status_id"] = 3;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ class LineworkController extends mfBaseController {
|
||||
/*if($this->me->is("Admin") && $filter['lineworker_id']) {
|
||||
$termination_search["lineworker_id"] = $filter['lineworker_id'];
|
||||
}*/
|
||||
//var_dump($filter);exit;
|
||||
//var_dump($termination_search);exit;
|
||||
$networks = [];
|
||||
$pagination['maxItems'] = TerminationModel::count($termination_search);
|
||||
foreach(TerminationModel::search($termination_search, $pagination) as $term) {
|
||||
@@ -130,17 +130,16 @@ class LineworkController extends mfBaseController {
|
||||
$networks[$term->building->network->name][$term->id] = $term;
|
||||
}
|
||||
}
|
||||
|
||||
/*if(is_array($networks) && count($networks)) {
|
||||
$term = reset(reset($networks));
|
||||
var_dump($term);exit;
|
||||
}*/
|
||||
|
||||
// get first termination ...
|
||||
if(is_array($networks) && count($networks)) {
|
||||
$network = reset($networks);
|
||||
$term = reset($network);
|
||||
}
|
||||
$item_colspan = 0;
|
||||
$i = 0;
|
||||
|
||||
//var_dump($term);exit;
|
||||
|
||||
// get fields between delimiters for colspan
|
||||
// ... to get count of fields between delimiters for colspan
|
||||
if(is_array($term->workflowitems) && count($term->workflowitems)) {
|
||||
foreach($term->workflowitems as $wfitem) {
|
||||
if($i == 0 && $wfitem->type == "delimiter") continue;
|
||||
@@ -174,6 +173,16 @@ class LineworkController extends mfBaseController {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("status_id", $filter) && $filter["status_id"]) {
|
||||
$status_codes = explode(",", $filter["status_id"]);
|
||||
if(count($status_codes) > 1) {
|
||||
$filter["status_id"] = [];
|
||||
foreach($status_codes as $code) {
|
||||
$filter["status_id"][] = intval($code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($filter as $name => $value) {
|
||||
/*if($name == 'network_id') {
|
||||
$new_filter['id'] = $value;
|
||||
|
||||
@@ -123,15 +123,18 @@ class PipeworkController extends mfBaseController {
|
||||
$networks[$b->network->name][$b->id] = $b;
|
||||
}
|
||||
}
|
||||
|
||||
// get first building ...
|
||||
if(is_array($networks) && count($networks)) {
|
||||
$building = reset(reset($networks));
|
||||
$network = reset($networks);
|
||||
$building = reset($network);
|
||||
} else {
|
||||
$building = [];
|
||||
}
|
||||
$item_colspan = 0;
|
||||
$i = 0;
|
||||
|
||||
// get fields count between delimiters for colspan
|
||||
// ... to get field count between delimiters for colspan
|
||||
foreach($building->workflowitems as $wfitem) {
|
||||
if($i == 0 && $wfitem->type == "delimiter") continue;
|
||||
|
||||
@@ -160,7 +163,17 @@ class PipeworkController extends mfBaseController {
|
||||
$filter['network_id'] = $section->network_id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(array_key_exists("status_id", $filter) && $filter["status_id"]) {
|
||||
$status_codes = explode(",", $filter["status_id"]);
|
||||
if(count($status_codes) > 1) {
|
||||
$filter["status_id"] = [];
|
||||
foreach($status_codes as $code) {
|
||||
$filter["status_id"][] = intval($code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($filter as $name => $value) {
|
||||
/*if($name == 'network_id') {
|
||||
$new_filter['id'] = $value;
|
||||
|
||||
@@ -138,14 +138,15 @@ class TerminationModel {
|
||||
$where .= " AND building_id = $building_id";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("status_id", $filter)) {
|
||||
$status_id = $filter['status_id'];
|
||||
|
||||
if(is_numeric($status_id) && $status_id > 0) {
|
||||
$where .= " AND Termination.status_id = $status_id";
|
||||
|
||||
if(array_key_exists("status_id", $filter)) {
|
||||
$status_id = $filter['status_id'];
|
||||
if(is_array($status_id)) {
|
||||
$where .= " AND Termination.status_id IN (".implode(",", $status_id).")";
|
||||
} elseif(is_numeric($status_id)) {
|
||||
$where .= " AND Termination.status_id=$status_id";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("linework_enabled", $filter)) {
|
||||
$linework_enabled = $filter['linework_enabled'];
|
||||
|
||||
Reference in New Issue
Block a user