CommandArgument: always show and handle skip_key
This also allows to wipe the argument_name on modification fixes #682
This commit is contained in:
parent
c55d147ff0
commit
54e17237e3
|
@ -106,6 +106,15 @@ class IcingaCommandArgumentForm extends DirectorObjectForm
|
|||
)
|
||||
));
|
||||
|
||||
$this->addBoolean('skip_key', array(
|
||||
'label' => $this->translate('Skip key'),
|
||||
'description' => $this->translate(
|
||||
'Whether the parameter name should not be passed to the command.'
|
||||
. ' Per default, the parameter name (e.g. -H) will be appended,'
|
||||
. ' so no need to explicitly set this to "No".'
|
||||
)
|
||||
));
|
||||
|
||||
$this->addBoolean('required', array(
|
||||
'label' => $this->translate('Required'),
|
||||
'required' => false,
|
||||
|
@ -139,11 +148,9 @@ class IcingaCommandArgumentForm extends DirectorObjectForm
|
|||
{
|
||||
$object = $this->object();
|
||||
$cmd = $this->commandObject;
|
||||
if (! $object->hasBeenLoadedFromDb()) {
|
||||
if ($object->get('argument_name') === null) {
|
||||
$object->set('skip_key', true);
|
||||
$object->set('argument_name', $cmd->getNextSkippableKeyName());
|
||||
}
|
||||
if ($object->get('argument_name') === null) {
|
||||
$object->set('skip_key', true);
|
||||
$object->set('argument_name', $cmd->getNextSkippableKeyName());
|
||||
}
|
||||
|
||||
if ($object->hasBeenModified()) {
|
||||
|
|
Loading…
Reference in New Issue