diff --git a/Layout/default/Linework/Index.php b/Layout/default/Linework/Index.php index 8d1e26f02..ee19bae42 100644 --- a/Layout/default/Linework/Index.php +++ b/Layout/default/Linework/Index.php @@ -337,7 +337,12 @@ - + + + + + +
Dokumente
diff --git a/Layout/default/Pipework/Index.php b/Layout/default/Pipework/Index.php index 3890297c9..c9b22c776 100644 --- a/Layout/default/Pipework/Index.php +++ b/Layout/default/Pipework/Index.php @@ -170,8 +170,13 @@ - + + termination_workflow_comments): ?> + + + +
Dokumente
diff --git a/application/Building/Building.php b/application/Building/Building.php index b62335ebd..2003391b4 100644 --- a/application/Building/Building.php +++ b/application/Building/Building.php @@ -10,6 +10,7 @@ class Building extends mfBaseModel { private $status; private $pipeworker; private $terminations; + private $termination_workflow_comments; private $workflowitems; private $files; private $pipework_enabler; @@ -223,6 +224,17 @@ class Building extends mfBaseModel { return $this->terminations; } + if($name == "termination_workflow_comments") { + $comments = ""; + foreach($this->getProperty("terminations") as $term) { + if($term->workflow_comment) { + $comment .= $term->code.": ".trim($term->workflow_comment)."\n\n"; + } + } + $this->termination_workflow_comments = $comment; + return $this->termination_workflow_comments; + } + if($name == "workflowitems") { $this->loadWorkflowItems(); foreach(WorkflowitemModel::search(["object_type" => "building", "active" => 1]) as $item) { diff --git a/application/Linework/LineworkController.php b/application/Linework/LineworkController.php index b60557386..3a73934b5 100644 --- a/application/Linework/LineworkController.php +++ b/application/Linework/LineworkController.php @@ -214,6 +214,13 @@ class LineworkController extends mfBaseController { $termination->save(); } + if($termination->building->workflow_comment != $r->workflow_comment_building) { + $termination->building->workflow_comment = $r->workflow_comment_building; + $termination->building->workflow_comment_changed = date('U'); + $termination->building->workflow_comment_changed_by = $this->me->id; + $termination->building->save(); + } + $items = []; // get workflow values from request diff --git a/lib/mvcfronk/mfUpload/mfUpload.php b/lib/mvcfronk/mfUpload/mfUpload.php index bd2c440f6..b1a591a30 100644 --- a/lib/mvcfronk/mfUpload/mfUpload.php +++ b/lib/mvcfronk/mfUpload/mfUpload.php @@ -69,23 +69,23 @@ class mfUpload { return false; } - $savepath=MFUPLOAD_FILE_SAVE_PATH; + $savepath = MFUPLOAD_FILE_SAVE_PATH; if(!MFUPLOAD_FILE_SAVE_PATH) { - $savepath="upload/"; + $savepath = "upload/"; } $this->log->debug("dirmode: ".decoct($this->dirmode)); if(!file_exists($savepath)) { - if(!mkdir($savepath,$this->dirmode,true)) { + if(!mkdir($savepath, $this->dirmode,true)) { throw new Exception("Error creating directory $savepath."); } - chmod($savepath,$this->dirmode); + chmod($savepath, $this->dirmode); } if(!is_dir($savepath)) { throw new Exception("Upload save path not a directory!"); } - $this->savepath=$savepath; + $this->savepath = $savepath; return true; } @@ -163,7 +163,7 @@ class mfUpload { } public function setDirmode($mode) { - $this->dirmode=$mode; + $this->dirmode = $mode; } public function getFilemode() { diff --git a/lib/mvcfronk/mfUpload/mfUpload_TmpFile.php b/lib/mvcfronk/mfUpload/mfUpload_TmpFile.php index 1e858fce2..559386682 100644 --- a/lib/mvcfronk/mfUpload/mfUpload_TmpFile.php +++ b/lib/mvcfronk/mfUpload/mfUpload_TmpFile.php @@ -39,14 +39,14 @@ class mfUpload_TmpFile { if(move_uploaded_file($this->tmp_name, $path)) { return true; } else { - $this->errormessage="Cannot move uploaded file to $path."; + $this->errormessage = "Cannot move uploaded file to $path."; } } return false; } public function getFileSize() { - $stat=stat($this->tmp_name); + $stat = stat($this->tmp_name); if(is_array($stat) && count($stat)) { return $stat[7]; } @@ -54,33 +54,33 @@ class mfUpload_TmpFile { } public function getFilename() { - $filename=$this->filename; + $filename = $this->filename; // assume filename contains whole path on users machine and cut it. if(preg_match('#([^/\\\]+$)#',$filename,$match)) { - $filename=$match[1]; + $filename = $match[1]; } else { - $this->errormessage="No file selected."; + $this->errormessage = "No file selected."; return false; // if there is no filename } // remove potentially dangerous characters while(strstr($filename,'..')) { - $filename=str_replace('..',".",$filename); + $filename = str_replace('..',".",$filename); } if(!strlen($filename)) { - $this->errormessage="No file selected."; + $this->errormessage = "No file selected."; return false; } - $filename=preg_replace('/[^a-z0-9$()+%äöüß._-]/i', '_', $filename); + $filename = preg_replace('/[^a-z0-9$()+%äöüß._-]/i', '_', $filename); - $parts=explode(".",$filename); - $ext=strtolower(array_pop($parts)); + $parts = explode(".",$filename); + $ext = strtolower(array_pop($parts)); if(!preg_match('/^'.MFUPLOAD_ALLOWED_EXTENSIONS.'$/i',$ext)) { - $this->errormessage="File type not allowed. Supported file types are ".ALLOWED_EXTENSIONS_STR; + $this->errormessage = "File type not allowed. Supported file types are ".ALLOWED_EXTENSIONS_STR; return false; }