diff --git a/application/controllers/NotificationController.php b/application/controllers/NotificationController.php index 72f52bbe..6c47c8e0 100644 --- a/application/controllers/NotificationController.php +++ b/application/controllers/NotificationController.php @@ -6,6 +6,7 @@ use Icinga\Module\Director\Web\Controller\ObjectController; use Icinga\Module\Director\Objects\IcingaHost; use Icinga\Module\Director\Objects\IcingaNotification; use Icinga\Module\Director\Objects\IcingaService; +use Icinga\Module\Director\Web\Form\DirectorObjectForm; class NotificationController extends ObjectController { @@ -33,6 +34,18 @@ class NotificationController extends ObjectController } } + /** + * @param DirectorObjectForm $form + */ + protected function beforeHandlingEditRequest($form) + { + if ($this->object->isTemplate()) { + $form->setListUrl('director/notifications/templates'); + } else { + $form->setListUrl('director/notifications/applyrules'); + } + } + protected function loadObject() { if ($this->object === null) {