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

View File

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