diff --git a/library/Director/Web/Table/TemplatesTable.php b/library/Director/Web/Table/TemplatesTable.php index 88717737..7b31f8bf 100644 --- a/library/Director/Web/Table/TemplatesTable.php +++ b/library/Director/Web/Table/TemplatesTable.php @@ -3,6 +3,8 @@ namespace Icinga\Module\Director\Web\Table; use Icinga\Module\Director\Db; +use Icinga\Module\Director\Db\IcingaObjectFilterHelper; +use Icinga\Module\Director\Objects\IcingaObject; use ipl\Html\Html; use ipl\Html\Icon; use ipl\Html\Link; @@ -56,6 +58,20 @@ class TemplatesTable extends ZfQueryBasedTable ]); } + public function filterTemplate( + IcingaObject $template, + $inheritance = IcingaObjectFilterHelper::INHERIT_DIRECT + ) { + IcingaObjectFilterHelper::filterByTemplate( + $this->getQuery(), + $template, + 'o', + $inheritance + ); + + return $this; + } + protected function prepareQuery() { $type = $this->getType();