DirectorObjectForm: provide event command for...

...hosts and services

fixes #12117
fixes #12126
This commit is contained in:
Thomas Gelf 2016-07-20 17:53:19 +02:00
parent 805a7c687c
commit c2f3609cc6
2 changed files with 21 additions and 0 deletions

View File

@ -489,6 +489,15 @@ class Db extends DbConnection
return $this->enumIcingaObjects('command', $filters);
}
public function enumEventcommands()
{
$filters = array(
'methods_execute = ?' => 'PluginEvent',
);
return $this->enumIcingaObjects('command', $filters);
}
public function enumNotificationCommands()
{
$filters = array(

View File

@ -1177,6 +1177,18 @@ abstract class DirectorObjectForm extends QuickForm
));
$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;
}