IcingaUserForm: state/filter prototype, dummy...

...and still subject to changes
This commit is contained in:
Thomas Gelf 2016-02-28 17:02:57 +01:00
parent 7b01082140
commit ea0f58f611
2 changed files with 27 additions and 0 deletions

View File

@ -48,6 +48,21 @@ class IcingaUserForm extends DirectorObjectForm
$this->translate('Send notifications'),
$this->translate('Whether to send notifications for this user')
);
$this->addElement('multiselect', 'states', array(
'label' => $this->translate('States'),
'description' => $this->translate('The host/service states you want to get notifications for'),
'multiOptions' => $this->enumStateFilters(),
'size' => 6,
));
$this->addElement('multiselect', 'types', array(
'label' => $this->translate('Event types'),
'description' => $this->translate('The event types you want to get notifications for'),
'multiOptions' => $this->enumTypeFilters(),
'size' => 6,
));
/*
$this->addElement('text', 'groups', array(
'label' => $this->translate('Usergroups'),

View File

@ -28,4 +28,16 @@ class IcingaUser extends IcingaObject
protected $booleans = array(
'enable_notifications' => 'enable_notifications'
);
protected $states = array();
protected function setStates($value)
{
$states = $value;
sort($states);
if ($this->states !== $states) {
$this->states = $states;
$this->hasBeenModified = true;
}
}
}