Added Linework workflow
This commit is contained in:
42
application/TerminationFile/TerminationFileController.php
Normal file
42
application/TerminationFile/TerminationFileController.php
Normal 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]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user