From a684929cf508cb93d4659a15f4283f8775c0a3ae Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 20 Sep 2022 12:48:26 +0200 Subject: [PATCH] ObjectController: allow Service Sets in Branches --- .../Director/Web/Controller/ObjectController.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/library/Director/Web/Controller/ObjectController.php b/library/Director/Web/Controller/ObjectController.php index 53fd8bb1..0c06937d 100644 --- a/library/Director/Web/Controller/ObjectController.php +++ b/library/Director/Web/Controller/ObjectController.php @@ -140,13 +140,6 @@ abstract class ObjectController extends ActionController if ($oType = $this->params->get('type', 'object')) { $form->setPreferredObjectType($oType); } - if ($this->getTableName() === 'icinga_service_set' - && $this->showNotInBranch($this->translate('Creating Service Sets')) - ) { - $this->addTitle($this->translate('Create a new Service Set')); - return; - } - if ($oType === 'template') { if ($this->showNotInBranch($this->translate('Creating Templates'))) { $this->addTitle($this->translate('Create a new Template')); @@ -174,7 +167,11 @@ abstract class ObjectController extends ActionController $object = $this->requireObject(); $this->tabs()->activate('modify'); $this->addObjectTitle(); - if ($object->isTemplate() && $this->showNotInBranch($this->translate('Modifying Templates'))) { + // Hint: Service Sets are 'templates' (as long as not being assigned to a host + if ($this->getTableName() !== 'icinga_service_set' + && $object->isTemplate() + && $this->showNotInBranch($this->translate('Modifying Templates')) + ) { return; } if ($object->isApplyRule() && $this->showNotInBranch($this->translate('Modifying Apply Rules'))) {