parent
630cf488f1
commit
936145fe46
|
@ -30,6 +30,7 @@ class AssignListSubForm extends QuickSubForm
|
|||
foreach ($this->object->assignments()->getFormValues() as $values) {
|
||||
$idx++;
|
||||
$sub = new AssignmentSubForm();
|
||||
$sub->setObject($this->object);
|
||||
$sub->setup();
|
||||
$sub->populate($values);
|
||||
$this->addSubForm($sub, $idx);
|
||||
|
@ -38,6 +39,7 @@ class AssignListSubForm extends QuickSubForm
|
|||
|
||||
$idx++;
|
||||
$sub = new AssignmentSubForm();
|
||||
$sub->setObject($this->object);
|
||||
$sub->setup();
|
||||
$this->addSubForm($sub, $idx);
|
||||
$this->addElement('submit', 'addmore', array(
|
||||
|
|
|
@ -3,10 +3,13 @@
|
|||
namespace Icinga\Module\Director\Forms;
|
||||
|
||||
use Icinga\Module\Director\Objects\IcingaHost;
|
||||
use Icinga\Module\Director\Objects\IcingaObject;
|
||||
use Icinga\Module\Director\Web\Form\QuickSubForm;
|
||||
|
||||
class AssignmentSubForm extends QuickSubForm
|
||||
{
|
||||
protected $object;
|
||||
|
||||
// @codingStandardsIgnoreStart
|
||||
protected $_disableLoadDefaultDecorators = true;
|
||||
// @codingStandardsIgnoreEnd
|
||||
|
@ -24,7 +27,7 @@ class AssignmentSubForm extends QuickSubForm
|
|||
$this->addElement('select', 'property', array(
|
||||
'label' => $this->translate('Property'),
|
||||
'class' => 'assign-property autosubmit',
|
||||
'multiOptions' => $this->optionalEnum(IcingaHost::enumProperties($this->db, 'host.'))
|
||||
'multiOptions' => $this->optionalEnum(IcingaHost::enumProperties($this->object->getConnection(), 'host.'))
|
||||
));
|
||||
$this->addElement('select', 'operator', array(
|
||||
'label' => $this->translate('Operator'),
|
||||
|
@ -62,6 +65,12 @@ class AssignmentSubForm extends QuickSubForm
|
|||
}
|
||||
}
|
||||
|
||||
public function setObject(IcingaObject $object)
|
||||
{
|
||||
$this->object = $object;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function loadDefaultDecorators()
|
||||
{
|
||||
$this->setDecorators(array(
|
||||
|
|
Loading…
Reference in New Issue