diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:42:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:42:35 +0000 |
commit | 18db984057b83ca4962c89b6b79bdce6a660b58f (patch) | |
tree | 2c9f23c086b4dfcb3e7eb2ec69210206b0782d3c /configuration.php | |
parent | Initial commit. (diff) | |
download | icingaweb2-module-businessprocess-c317dc6bab668eef621846dc909e6b1af78bf49a.tar.xz icingaweb2-module-businessprocess-c317dc6bab668eef621846dc909e6b1af78bf49a.zip |
Adding upstream version 2.4.0.upstream/2.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | configuration.php | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/configuration.php b/configuration.php new file mode 100644 index 0000000..4615bd4 --- /dev/null +++ b/configuration.php @@ -0,0 +1,61 @@ +<?php + +use Icinga\Module\Businessprocess\Storage\LegacyStorage; + +/** @var \Icinga\Application\Modules\Module $this */ +$section = $this->menuSection(N_('Business Processes'), array( + 'url' => 'businessprocess', + 'icon' => 'sitemap', + 'priority' => 46 +)); + +try { + $storage = LegacyStorage::getInstance(); + + $prio = 0; + foreach ($storage->listProcessNames() as $name) { + $meta = $storage->loadMetadata($name); + if ($meta->get('AddToMenu') === 'no') { + continue; + } + $prio++; + + 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') +); +$this->provideRestriction( + 'businessprocess/prefix', + $this->translate('Restrict access to configurations with the given prefix') +); + +$this->provideJsFile('vendor/Sortable.js'); +$this->provideJsFile('behavior/sortable.js'); +$this->provideJsFile('vendor/jquery.fn.sortable.js'); |