TemplateController: link non-template commands

fixes #1544
This commit is contained in:
Thomas Gelf 2018-10-30 19:06:25 +01:00
parent 77f8f7d4ca
commit 280ed4430e
2 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,7 @@ master (will be 1.6.0)
### User Interface
* FIX: link startup log warning even for non-standard package names (#1633)
* FIX: changing an argument type from String to DSL didn't work (#1640)
# FIX: incorrect links from template-tree to non-template commands (#1544)
* FEATURE: allow to filter templates by usage (#1339)
* FEATURE: allow to show SQL used for template tables
* FEATURE: allow to defined Service Groups for Set members and for Services

View File

@ -3,6 +3,7 @@
namespace Icinga\Module\Director\Web\Controller;
use Icinga\Module\Director\DirectorObject\Automation\ExportInterface;
use Icinga\Module\Director\Objects\IcingaCommand;
use Icinga\Module\Director\Objects\IcingaObject;
use Icinga\Module\Director\Web\Controller\Extension\DirectorDb;
use Icinga\Module\Director\Web\Table\ApplyRulesTable;
@ -100,6 +101,9 @@ abstract class TemplateController extends CompatController
public function usageAction()
{
$template = $this->requireTemplate();
if (! $template->isTemplate() && $template instanceof IcingaCommand) {
$this->redirectNow($this->url()->setPath('director/command'));
}
$templateName = $template->getObjectName();
$type = $this->getType();