Added Linework workflow

This commit is contained in:
Frank Schubert
2021-09-09 22:09:07 +02:00
parent af23c18dc6
commit e5acbdba40
22 changed files with 969 additions and 36 deletions

View File

@@ -0,0 +1,42 @@
<?php
class TerminationFileController extends mfBaseController {
protected function init() {
$this->needlogin=true;
$me = new User();
$me->loadMe();
$this->me = $me;
$this->layout()->set("me",$me);
if(!$me->isAdmin()) {
$this->redirect("Dashboard");
}
}
protected function editAction() {
// internal redirect to File::editAction
}
protected function deleteAction() {
$id = $this->request->id;
$termfile = new TerminationFile($id);
if(!$termfile->id || $termfile->id != $id) {
$this->layout()->setFlash("Datei nicht gefunden.", "error");
$this->redirect("Termination");
}
$term_id = $termfile->termination_id;
$building_id = $termfile->termination->building_id;
$termfile->file->delete();
$termfile->delete();
if($this->request->from == "linework") {
$this->redirect("Linework", "Index", false, "object=".$termination_id);
}
$this->redirect("building", "edit", ["id" => $building_id]);
}
}