Service: links, actions

This commit is contained in:
Thomas Gelf 2017-07-20 17:00:03 +02:00
parent 9dc50beee5
commit 53a9624db6

View File

@ -8,6 +8,7 @@ use Icinga\Module\Director\Web\Controller\ObjectController;
use Icinga\Module\Director\Objects\IcingaServiceSet; use Icinga\Module\Director\Objects\IcingaServiceSet;
use Icinga\Module\Director\Objects\IcingaService; use Icinga\Module\Director\Objects\IcingaService;
use Icinga\Module\Director\Objects\IcingaHost; use Icinga\Module\Director\Objects\IcingaHost;
use ipl\Html\Link;
class ServiceController extends ObjectController class ServiceController extends ObjectController
{ {
@ -110,19 +111,18 @@ class ServiceController extends ObjectController
/** @var IcingaService $object */ /** @var IcingaService $object */
$object = $this->object; $object = $this->object;
$this->addTitle($object->getObjectName());
if ($this->host) { if ($this->host) {
$this->view->actionLinks = $this->view->qlink( $this->actions()->add(Link::create(
$this->translate('back'), $this->translate('back'),
'director/host/services', 'director/host/services',
array('name' => $this->host->object_name), ['name' => $this->host->getObjectName()],
array('class' => 'icon-left-big') ['class' => 'icon-left-big']
); ));
} }
$form = $this $form = IcingaServiceForm::load()->setDb($this->db());
->loadForm('icingaService')
->setDb($this->db());
if ($this->host && $object->usesVarOverrides()) { if ($this->host && $object->usesVarOverrides()) {
$fake = IcingaService::create(array( $fake = IcingaService::create(array(
@ -142,7 +142,6 @@ class ServiceController extends ObjectController
$form->handleRequest(); $form->handleRequest();
$this->actions()->add($this->createCloneLink()); $this->actions()->add($this->createCloneLink());
$this->view->title = $object->object_name;
if ($this->host) { if ($this->host) {
$this->view->subtitle = sprintf( $this->view->subtitle = sprintf(
$this->translate('(on %s)'), $this->translate('(on %s)'),