WIP Pipework Workflow
This commit is contained in:
36
application/BuildingFile/BuildingFileController.php
Normal file
36
application/BuildingFile/BuildingFileController.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
class BuildingFileController 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;
|
||||
|
||||
$buildingfile = new BuildingFile($id);
|
||||
if(!$buildingfile->id || $buildingfile->id != $id) {
|
||||
$this->layout()->setFlash("Datei nicht gefunden.", "error");
|
||||
$this->redirect("Building");
|
||||
}
|
||||
|
||||
$building_id = $buildingfile->order_id;
|
||||
|
||||
$buildingfile->file->delete();
|
||||
$buildingfile->delete();
|
||||
$this->redirect("Building", "edit", ["id" => $building_id]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user