DirectorObjectForm: provide check_period element

This commit is contained in:
Thomas Gelf 2016-03-27 23:58:44 +02:00
parent 19d56fc546
commit f2dc9c59e5
2 changed files with 23 additions and 0 deletions

View File

@ -575,6 +575,11 @@ class Db extends DbConnection
return $this->enumIcingaObjects('command');
}
public function enumTimeperiods()
{
return $this->enumIcingaObjects('timeperiod');
}
public function enumCheckcommands()
{
$filters = array(

View File

@ -1153,6 +1153,23 @@ abstract class DirectorObjectForm extends QuickForm
)
);
$periods = $this->db->enumTimeperiods();
if (!empty($periods)) {
$this->addElement(
'select',
'check_period_id',
array(
'label' => $this->translate('Check period'),
'description' => $this->translate(
'The name of a time period which determines when this'
. ' object should be monitored. Not limited by default.'
),
'multiOptions' => $this->optionalEnum($periods),
)
);
}
$this->optionalBoolean(
'enable_active_checks',
$this->translate('Execute active checks'),
@ -1192,6 +1209,7 @@ abstract class DirectorObjectForm extends QuickForm
$elements = array(
'check_interval',
'retry_interval',
'check_period_id',
'enable_active_checks',
'enable_passive_checks',
'enable_notifications',