diff --git a/Layout/default/ConstructionConsent/Index.php b/Layout/default/ConstructionConsent/Index.php index b7b167598..b72257ace 100644 --- a/Layout/default/ConstructionConsent/Index.php +++ b/Layout/default/ConstructionConsent/Index.php @@ -33,7 +33,7 @@ $pagination_entity_name = "Zustimmungserklärungen";
">
-
+
-
- - -
- -
+
+
+ + +
+
+
+ + +
+ +
+ + +
+ +
+
+ +
+ + +
+
" /> @@ -100,9 +130,12 @@ $pagination_entity_name = "Zustimmungserklärungen"; " />
+
+ +
diff --git a/application/ConstructionConsent/ConstructionConsent.php b/application/ConstructionConsent/ConstructionConsent.php index 2c482f44d..70882420b 100644 --- a/application/ConstructionConsent/ConstructionConsent.php +++ b/application/ConstructionConsent/ConstructionConsent.php @@ -548,7 +548,7 @@ class ConstructionConsent extends mfBaseModel { if(array_key_exists("network", $filter)) { $network = FronkDB::singleton()->escape($filter["network"]); if($network) { - $where .= " AND view_hausnummer.netzgebiet_id=$network"; + $where .= " AND vh.netzgebiet_id=$network"; } } diff --git a/application/ConstructionConsent/ConstructionConsentController.php b/application/ConstructionConsent/ConstructionConsentController.php index 0c440caa4..e416c3c19 100644 --- a/application/ConstructionConsent/ConstructionConsentController.php +++ b/application/ConstructionConsent/ConstructionConsentController.php @@ -939,17 +939,25 @@ class ConstructionConsentController extends mfBaseController { } private function generateStats($baseFilter = array()) { - $allCount = ConstructionConsent::count(array_merge(array(), $baseFilter)); - $streetCount = ConstructionConsent::count(array_merge($baseFilter, array("object_type" => "street"))); - $buildingCount = ConstructionConsent::count(array_merge($baseFilter, array("object_type" => "building"))); - $inspection_planner = ConstructionConsent::count(array_merge($baseFilter, array("inspection_planner" => "!NULL"))); - $conduit_installed_building = ConstructionConsent::count(array_merge($baseFilter, array("conduit_installed_building" => "!NULL"))); - $conduit_installed_ftu = ConstructionConsent::count(array_merge($baseFilter, array("conduit_installed_ftu" => "!NULL"))); - $inhouse_cabling = ConstructionConsent::count(array_merge($baseFilter, array("inhouse_cabling" => "!NULL"))); - $status_light_blue = ConstructionConsent::count(array_merge($baseFilter, array("status_light" => "blue"))); - $status_light_red = ConstructionConsent::count(array_merge($baseFilter, array("status_light" => "red"))); - $status_light_yellow = ConstructionConsent::count(array_merge($baseFilter, array("status_light" => "yellow"))); - $status_light_green = ConstructionConsent::count(array_merge($baseFilter, array("status_light" => "green"))); + function getFilteredCount($wantedFilter, $filterValue, $baseFilter) { + if (!empty($baseFilter[$wantedFilter]) && $baseFilter[$wantedFilter] != $filterValue) { + return 0; + } else { + return ConstructionConsent::count(array_merge($baseFilter, [$wantedFilter => $filterValue])); + } + } + + $allCount = ConstructionConsent::count($baseFilter); + $streetCount = getFilteredCount("object_type", "street", $baseFilter); + $buildingCount = getFilteredCount("object_type", "building", $baseFilter); + $inspection_planner = getFilteredCount("inspection_planner", "!NULL", $baseFilter); + $conduit_installed_building = getFilteredCount("conduit_installed_building", "!NULL", $baseFilter); + $conduit_installed_ftu = getFilteredCount("conduit_installed_ftu", "!NULL", $baseFilter); + $inhouse_cabling = getFilteredCount("inhouse_cabling", "!NULL", $baseFilter); + $status_light_blue = getFilteredCount("status_light", "blue", $baseFilter); + $status_light_red = getFilteredCount("status_light", "red", $baseFilter); + $status_light_yellow = getFilteredCount("status_light", "yellow", $baseFilter); + $status_light_green = getFilteredCount("status_light", "green", $baseFilter); return array( "all" => $allCount,