added ConstructionConsentController::deleteAction()
This commit is contained in:
@@ -70,7 +70,7 @@ class ConstructionConsentController extends mfBaseController {
|
||||
$pagination['maxItems'] = ConstructionConsent::count($filter);
|
||||
$this->layout()->set("pagination", $pagination);
|
||||
|
||||
$items = ConstructionConsent::search($filter);
|
||||
$items = ConstructionConsent::search($filter, $pagination);
|
||||
$this->layout->set("items", $items);
|
||||
|
||||
if(array_key_exists("project_id", $filter) && $filter["project_id"]) {
|
||||
@@ -320,6 +320,25 @@ class ConstructionConsentController extends mfBaseController {
|
||||
|
||||
}
|
||||
|
||||
protected function deleteAction() {
|
||||
$id = $this->request->id;
|
||||
if(!is_numeric($id) || $id < 1) {
|
||||
$this->layout()->setFlash("Zustimmungserklärung nicht gefunden", "error");
|
||||
$this->redirect("ConstructionConsent");
|
||||
}
|
||||
|
||||
$item = new ConstructionConsent($id);
|
||||
if(!$item->id) {
|
||||
$this->layout()->setFlash("Zustimmungserklärung nicht gefunden", "error");
|
||||
$this->redirect("ConstructionConsent");
|
||||
}
|
||||
|
||||
$item->delete();
|
||||
|
||||
$this->layout()->setFlash("Zustimmungserklärung erfolgreich gelöscht", "success");
|
||||
$this->redirect("ConstructionConsent");
|
||||
}
|
||||
|
||||
protected function saveDate() {
|
||||
$r = $this->request;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user