ObjectController: allow Service Sets in Branches

This commit is contained in:
Thomas Gelf 2022-09-20 12:48:26 +02:00
parent de4b890e8b
commit a684929cf5

View File

@ -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'))) {