IcingaNotificationForm: do not show timeperiods...

...if no such is available
This commit is contained in:
Thomas Gelf 2016-04-03 21:36:41 +02:00
parent 32009ce458
commit eb1fbcdca2
1 changed files with 7 additions and 1 deletions

View File

@ -125,6 +125,11 @@ class IcingaNotificationForm extends DirectorObjectForm
protected function addPeriodElement()
{
$periods = $this->db->enumTimeperiods();
if (empty($periods)) {
return $this;
}
$this->addElement(
'select',
'period',
@ -133,7 +138,8 @@ class IcingaNotificationForm extends DirectorObjectForm
'description' => $this->translate(
'The name of a time period which determines when this'
. ' notification should be triggered. Not set by default.'
)
),
'multiOptions' => $this->optionalEnum($periods),
)
);