diff --git a/Layout/default/Pipework/Index.php b/Layout/default/Pipework/Index.php index f6f08982f..fa4df1efb 100644 --- a/Layout/default/Pipework/Index.php +++ b/Layout/default/Pipework/Index.php @@ -26,99 +26,116 @@

Auftragsliste nach Netzgebiet

- - $buildings): ?> - -

- - - workflowitems as $item) { - if($item->type == "delimiter") { - $rowspan++; - } - } - ?> - "> - - + + + + + +
-
- street?>
- code?>
-
-
- contact?>
- phone?>
- email?> -
-
- -
-
- -
-
-
" enctype="multipart/form-data" > - - - workflowitems as $item): ?> - - type == "delimiter"): ?> - - - - - - type == "delimiter"): ?> - - - - - - - - - - - - - -
label?>
label?>
- - -
Dokumente
- - files as $file): ?> - - - + + $buildings): ?> + +

+
$file->file->id])?>"> type?>
+ + workflowitems as $item) { + if($item->type == "delimiter") { + $rowspan++; + } + } + ?> + "> + + - -
+
+ street?>
+ code?>
+
+
+ contact?>
+ phone?>
+ email?> +
+
+ +
+
+ +
+
+ " enctype="multipart/form-data" > + + + workflowitems as $item): ?> + + type == "delimiter"): ?> + + + + - - + type == "delimiter"): ?> + + + + - " : ""?> - - - - -
label?>
$file->file->id])?>"> type?>
label?>
- Dokument hochladen - - Erlaubte Dateiendungen: - -
-
- -
- +
+ + +
Dokumente
+ + files as $file): ?> + + + + + + + + + " : ""?> + + + + +
+ $file->id, "from" => "pipework"])?>" onclick="if(!confirm('Dokument wirklich löschen?')) return false;" class="text-danger mr-1" title="Dokument löschen"> + + + $file->file->id])?>"> + type?> + + + $file->id, "from" => "pipework"])?>" onclick="if(!confirm('Dokument wirklich löschen?')) return false;" class="text-danger mr-1" title="Dokument löschen"> + + + $file->file->id])?>"> + type?> + +
+ Dokument hochladen + + Erlaubte Dateiendungen: + +
+
+ + + + + + + + Keine Bauaufträge gefunden + @@ -129,7 +146,16 @@ diff --git a/Layout/default/Workflow/form.php b/Layout/default/Workflow/form.php index 7eb8905cf..84e3ebde2 100644 --- a/Layout/default/Workflow/form.php +++ b/Layout/default/Workflow/form.php @@ -46,5 +46,14 @@ include(realpath(dirname(__FILE__)."/items/")."/string.php"); } ?> - + value->changed): ?> + title="Geändert: value->changed)?> von value->changer->name?> (value->changer->address->getCompanyOrName(true)?>)" + + > + value->changed): ?> + value->changed)?>
(value->changer->name?>) + +
\ No newline at end of file diff --git a/application/Address/Address.php b/application/Address/Address.php index 3e1a7ff86..8e73b5347 100644 --- a/application/Address/Address.php +++ b/application/Address/Address.php @@ -24,12 +24,17 @@ class Address extends mfBaseModel { } - public function getCompanyOrName() { + public function getCompanyOrName($returnParent = false) { + if($returnParent && $this->parent_id) { + return $this->getProperty("parent")->getCompanyOrName(true); + } + if($this->company) { return $this->company; } return $this->getFullName(); } + public function loadAddresstypes() { diff --git a/application/Building/BuildingModel.php b/application/Building/BuildingModel.php index 4ba952f14..63add4620 100644 --- a/application/Building/BuildingModel.php +++ b/application/Building/BuildingModel.php @@ -153,7 +153,7 @@ class BuildingModel { if(array_key_exists("code", $filter)) { $code = FronkDB::singleton()->escape($filter['code']); if($code) { - $where .= "AND Building.`code`='$code'"; + $where .= " AND Building.`code`='$code'"; } } diff --git a/application/BuildingFile/BuildingFileController.php b/application/BuildingFile/BuildingFileController.php index b5ac5b955..056da6710 100644 --- a/application/BuildingFile/BuildingFileController.php +++ b/application/BuildingFile/BuildingFileController.php @@ -27,10 +27,15 @@ class BuildingFileController extends mfBaseController { $this->redirect("Building"); } - $building_id = $buildingfile->order_id; + $building_id = $buildingfile->building_id; $buildingfile->file->delete(); $buildingfile->delete(); + + if($this->request->from == "pipework") { + $this->redirect("Pipework", "Index", false, "object=".$building_id); + } + $this->redirect("Building", "edit", ["id" => $building_id]); } } \ No newline at end of file diff --git a/application/Pipework/PipeworkController.php b/application/Pipework/PipeworkController.php index 4d5082030..8eb844b2d 100644 --- a/application/Pipework/PipeworkController.php +++ b/application/Pipework/PipeworkController.php @@ -17,6 +17,10 @@ class PipeworkController extends mfBaseController { protected function indexAction() { $this->layout()->setTemplate("Pipework/Index"); + if($this->request->filter) { + $filter = $this->getPreparedFilter($this->request->filter); + } + // get allowed networks if($this->me->is("Admin")) { $my_networks = NetworkModel::getAll(); @@ -35,6 +39,12 @@ class PipeworkController extends mfBaseController { "network_id" => $network->id, "workflow_finished" => 0 ]; + if(is_array($filter) && count($filter)) { + $building_search = array_merge($building_search, $filter); + } + + $this->log->debug(print_r($building_search, true)); + foreach(BuildingModel::search($building_search) as $b) { if(!array_key_exists($b->id, $networks[$network->name])) { @@ -66,6 +76,10 @@ class PipeworkController extends mfBaseController { } + private function getPreparedFilter($filter) { + + return $filter; + } protected function saveAction() { $r = $this->request; @@ -182,7 +196,7 @@ class PipeworkController extends mfBaseController { } $this->layout->setFlash("Workflow Eintrag erfolgreich gespeichert.", "success"); - $this->redirect("Pipework","Index", false, "wf-building-".$building_id); + $this->redirect("Pipework","Index", false, "object=".$building_id); diff --git a/application/Workflowvalue/Workflowvalue.php b/application/Workflowvalue/Workflowvalue.php index 8ad2c7329..4835181af 100644 --- a/application/Workflowvalue/Workflowvalue.php +++ b/application/Workflowvalue/Workflowvalue.php @@ -2,6 +2,7 @@ class Workflowvalue extends mfBaseModel { private $item; + private $changer; public function setValue($value, $items) { $this->item = $this->getProperty("item"); @@ -43,18 +44,33 @@ class Workflowvalue extends mfBaseModel { } + if($this->item->type == "gps") { if(is_array($value) && count($value) == 2) { $lat = $value['lat']; $long = $value['long']; $value = "$lat;$long"; + if($lat == null && $long == null) { + $value = null; + } } else { - $value = ""; + $value = null; } } + + if($this->item->type == "bool" && $this->{"value_".$value_type} = null && $value == 0) { + return true; + } + + if($value == null && $this->{"value_".$value_type} == null) { + return true; + } + $me = new User(); $me->loadMe(); + + if($this->{"value_".$value_type} != $value) { $this->{"value_".$value_type} = $value; @@ -77,6 +93,15 @@ class Workflowvalue extends mfBaseModel { return $this->item; } + if($name == "changer") { + if($this->changed && $this->changed_by) { + $this->changer = new User($this->changed_by); + return $this->changer; + } else { + return new Address(); + } + } + $classname = ucfirst($name); $idfield = $name."_id"; $this->$name = new $classname($this->$idfield); diff --git a/public/assets/css/thetool.css b/public/assets/css/thetool.css index 568c48b52..66c1ef6b0 100644 --- a/public/assets/css/thetool.css +++ b/public/assets/css/thetool.css @@ -130,3 +130,7 @@ td.controls { color: red; } +.flash-bg { + background-color: yellow !important; + color: yellow; +} \ No newline at end of file