DataField: add edit and add methods

This commit is contained in:
Alexander Fuhr 2015-07-03 14:20:47 +02:00
parent a594116fe5
commit edf25be971
2 changed files with 12 additions and 1 deletions

View File

@ -4,6 +4,16 @@ use Icinga\Module\Director\Web\Controller\ActionController;
class Director_DatafieldController extends 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() public function indexAction()
{ {
$this->view->title = $this->translate('Add field'); $this->view->title = $this->translate('Add field');
@ -19,6 +29,7 @@ class Director_DatafieldController extends ActionController
if ($id = $this->params->get('id')) { if ($id = $this->params->get('id')) {
$form->loadObject($id); $form->loadObject($id);
} }
$form->handleRequest(); $form->handleRequest();
$this->render('object/form', null, true); $this->render('object/form', null, true);

View File

@ -17,7 +17,7 @@ class DatafieldTable extends QuickTable
protected function getActionUrl($row) 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() public function getTitles()