From ef0499918f3b4032aebd17bbb8a0b1d09b7d8796 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 25 Oct 2018 08:26:09 +0200 Subject: [PATCH] Services: fix multiselection for templates --- application/controllers/ServicesController.php | 2 ++ library/Director/Web/Controller/ObjectsController.php | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/application/controllers/ServicesController.php b/application/controllers/ServicesController.php index da577422..671bb672 100644 --- a/application/controllers/ServicesController.php +++ b/application/controllers/ServicesController.php @@ -7,6 +7,8 @@ use Icinga\Module\Director\Web\Controller\ObjectsController; class ServicesController extends ObjectsController { protected $multiEdit = array( + 'imports', + 'groups', 'disabled' ); } diff --git a/library/Director/Web/Controller/ObjectsController.php b/library/Director/Web/Controller/ObjectsController.php index 618a4035..fff93700 100644 --- a/library/Director/Web/Controller/ObjectsController.php +++ b/library/Director/Web/Controller/ObjectsController.php @@ -322,7 +322,15 @@ abstract class ObjectsController extends ActionController if ($ex->isExpression()) { if ($col === 'name') { $name = $ex->getExpression(); - $objects[$name] = IcingaObject::loadByType($type, $name, $db); + if ($type === 'service') { + $key = [ + 'object_type' => 'template', + 'object_name' => $name + ]; + } else { + $key = $name; + } + $objects[$name] = IcingaObject::loadByType($type, $key, $db); } elseif ($col === 'id') { $name = $ex->getExpression(); $objects[$name] = IcingaObject::loadByType($type, ['id' => $name], $db);