mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
DirectorObjectForm: provide event command for...
...hosts and services fixes #12117 fixes #12126
This commit is contained in:
parent
805a7c687c
commit
c2f3609cc6
@ -489,6 +489,15 @@ class Db extends DbConnection
|
|||||||
return $this->enumIcingaObjects('command', $filters);
|
return $this->enumIcingaObjects('command', $filters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function enumEventcommands()
|
||||||
|
{
|
||||||
|
$filters = array(
|
||||||
|
'methods_execute = ?' => 'PluginEvent',
|
||||||
|
|
||||||
|
);
|
||||||
|
return $this->enumIcingaObjects('command', $filters);
|
||||||
|
}
|
||||||
|
|
||||||
public function enumNotificationCommands()
|
public function enumNotificationCommands()
|
||||||
{
|
{
|
||||||
$filters = array(
|
$filters = array(
|
||||||
|
@ -1177,6 +1177,18 @@ abstract class DirectorObjectForm extends QuickForm
|
|||||||
));
|
));
|
||||||
$this->addToCheckExecutionDisplayGroup('check_command_id');
|
$this->addToCheckExecutionDisplayGroup('check_command_id');
|
||||||
|
|
||||||
|
$eventCommands = $this->db->enumEventCommands();
|
||||||
|
|
||||||
|
if (! empty($eventCommands)) {
|
||||||
|
$this->addElement('select', 'event_command_id', array(
|
||||||
|
'label' => $this->translate('Event command'),
|
||||||
|
'description' => $this->translate('Event command definition'),
|
||||||
|
'multiOptions' => $this->optionalEnum($eventCommands),
|
||||||
|
'class' => 'autosubmit',
|
||||||
|
));
|
||||||
|
$this->addToCheckExecutionDisplayGroup('event_command_id');
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user