TemplateChoiceForm: add min_required, max_allowed

fixes #1214
This commit is contained in:
Thomas Gelf 2017-10-07 17:22:54 +02:00
parent 5388520551
commit 4db73fdb95
1 changed files with 22 additions and 0 deletions

View File

@ -69,6 +69,28 @@ class IcingaTemplateChoiceForm extends DirectorObjectForm
'multiOptions' => $this->fetchUnboundTemplates()
));
$this->addElement('text', 'min_required', array(
'label' => $this->translate('Minimum required'),
'description' => $this->translate(
'Choosing this many options will be mandatory for this Choice.'
. ' Setting this to zero will leave this Choice optional, setting'
. ' it to one results in a "required" Choice. You can use higher'
. ' numbers to enforce multiple options, this Choice will then turn'
. ' into a multi-selection element.'
),
'value' => 0,
));
$this->addElement('text', 'max_allowed', array(
'label' => $this->translate('Allowed maximum'),
'description' => $this->translate(
'It will not be allowed to choose more than this many options.'
. ' Setting it to one (1) will result in a drop-down box, a'
. ' higher number will turn this into a multi-selection element.'
),
'value' => 1,
));
$this->setButtons();
}