Fields: Implement "assign field" forms

resolves #9752
This commit is contained in:
Alexander Fuhr 2015-07-28 15:23:52 +02:00
parent 31e2b23d82
commit f58cc3e22c
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,43 @@
<?php
use Icinga\Module\Director\Web\Controller\ActionController;
class Director_FieldController extends ActionController
{
protected function tabs() {
return $this->getTabs()->add('host', array(
'url' => 'director/field/host',
'label' => 'Host',
))->add('service', array(
'url' => 'director/field/service',
'label' => 'Service',
));
}
public function hostAction()
{
$this->tabs()->activate('host');
$form = $this->view->form = $this->loadForm('icingaHostField')
->setSuccessUrl('director/field/host')
->setDb($this->db());
$form->handleRequest();
$this->render('object/form', null, true);
}
public function serviceAction()
{
$this->tabs()->activate('service');
$form = $this->view->form = $this->loadForm('icingaServiceField')
->setSuccessUrl('director/field/service')
->setDb($this->db());
$form->handleRequest();
$this->render('object/form', null, true);
}
}

View File

@ -14,6 +14,7 @@ $section = $this->menuSection(
$section->add($this->translate('Global'))->setUrl('director/commands');
$section->add($this->translate('Hosts'))->setUrl('director/hosts');
$section->add($this->translate('Fields'))->setUrl('director/field/host');
$section->add($this->translate('Services'))->setUrl('director/services');
$section->add($this->translate('Users'))->setUrl('director/users');
$section->add($this->translate('Import / Sync'))