From edf25be971431f25116d5287035ac0fd35cb6d8a Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Fri, 3 Jul 2015 14:20:47 +0200 Subject: [PATCH] DataField: add edit and add methods --- application/controllers/DatafieldController.php | 11 +++++++++++ application/tables/DatafieldTable.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/application/controllers/DatafieldController.php b/application/controllers/DatafieldController.php index fa95fd74..0f6f8acd 100644 --- a/application/controllers/DatafieldController.php +++ b/application/controllers/DatafieldController.php @@ -4,6 +4,16 @@ use Icinga\Module\Director\Web\Controller\ActionController; class Director_DatafieldController extends ActionController { + public function addAction() + { + $this->forward('index', 'datafield', 'director'); + } + + public function editAction() + { + $this->forward('index', 'datafield', 'director'); + } + public function indexAction() { $this->view->title = $this->translate('Add field'); @@ -19,6 +29,7 @@ class Director_DatafieldController extends ActionController if ($id = $this->params->get('id')) { $form->loadObject($id); } + $form->handleRequest(); $this->render('object/form', null, true); diff --git a/application/tables/DatafieldTable.php b/application/tables/DatafieldTable.php index 99c668d1..d043c5be 100644 --- a/application/tables/DatafieldTable.php +++ b/application/tables/DatafieldTable.php @@ -17,7 +17,7 @@ class DatafieldTable extends QuickTable protected function getActionUrl($row) { - return $this->url('director/datafield', array('id' => $row->id)); + return $this->url('director/datafield/edit', array('id' => $row->id)); } public function getTitles()