Services: fix multiselection for templates

This commit is contained in:
Thomas Gelf 2018-10-25 08:26:09 +02:00
parent 77cbb1040c
commit ef0499918f
2 changed files with 11 additions and 1 deletions

View File

@ -7,6 +7,8 @@ use Icinga\Module\Director\Web\Controller\ObjectsController;
class ServicesController extends ObjectsController
{
protected $multiEdit = array(
'imports',
'groups',
'disabled'
);
}

View File

@ -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);