mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-24 08:39:34 -05:00
55 lines
1.4 KiB
PHP
55 lines
1.4 KiB
PHP
<?php
|
|
|
|
use Icinga\Module\Businessprocess\Storage\LegacyStorage;
|
|
|
|
$section = $this->menuSection(N_('Business Processes'), array(
|
|
'url' => 'businessprocess',
|
|
'icon' => 'sitemap',
|
|
'priority' => 46
|
|
));
|
|
|
|
try {
|
|
$storage = new LegacyStorage(
|
|
$this->getConfig()->getSection('global')
|
|
);
|
|
|
|
$prio = 0;
|
|
foreach ($storage->listProcesses() as $name) {
|
|
$prio++;
|
|
|
|
$meta = $storage->loadMetadata($name);
|
|
if ($meta->get('AddToMenu') === 'no') {
|
|
continue;
|
|
}
|
|
|
|
if ($prio > 5) {
|
|
$section->add(N_('Show all'), array(
|
|
'url' => 'businessprocess',
|
|
'priority' => $prio
|
|
));
|
|
|
|
break;
|
|
}
|
|
|
|
$section->add($meta->getTitle(), array(
|
|
'url' => 'businessprocess/process/show',
|
|
'urlParameters' => array('config' => $name),
|
|
'priority' => $prio
|
|
));
|
|
}
|
|
} catch (Exception $e) {
|
|
// Well... there is not much we could do here
|
|
}
|
|
|
|
$this->providePermission(
|
|
'businessprocess/showall',
|
|
$this->translate('Allow to see all available processes, regardless of configured restrictions')
|
|
);
|
|
$this->providePermission(
|
|
'businessprocess/create',
|
|
$this->translate('Allow to create whole new process configuration (files)')
|
|
);
|
|
$this->providePermission(
|
|
'businessprocess/modify',
|
|
$this->translate('Allow to modify process definitions, to add and remove nodes')
|
|
);
|