From 88e8408a7b4eaab2dbd69eb83d977781147ea473 Mon Sep 17 00:00:00 2001 From: Thomas Gelf <thomas@gelf.net> Date: Thu, 3 Oct 2019 09:44:51 +0200 Subject: [PATCH] GroupMemberTable: allow multi-select for hosts fixes #1973 --- library/Director/Web/Table/GroupMemberTable.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/library/Director/Web/Table/GroupMemberTable.php b/library/Director/Web/Table/GroupMemberTable.php index 98e9fc1b..b0814ada 100644 --- a/library/Director/Web/Table/GroupMemberTable.php +++ b/library/Director/Web/Table/GroupMemberTable.php @@ -2,6 +2,7 @@ namespace Icinga\Module\Director\Web\Table; +use gipfl\IcingaWeb2\Table\Extension\MultiSelect; use Icinga\Data\Filter\Filter; use Icinga\Module\Director\Db; use Icinga\Module\Director\IcingaConfig\AssignRenderer; @@ -13,6 +14,8 @@ use gipfl\IcingaWeb2\Url; class GroupMemberTable extends ZfQueryBasedTable { + use MultiSelect; + protected $searchColumns = [ 'o.object_name', // membership_type @@ -40,6 +43,16 @@ class GroupMemberTable extends ZfQueryBasedTable $table->type = $type; return $table; } + public function assemble() + { + if ($this->type === 'host') { + $this->enableMultiSelect( + 'director/hosts/edit', + 'director/hosts', + ['name'] + ); + } + } public function setGroup(IcingaObjectGroup $group) {