mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 10:57:41 +02:00
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(
|
$this->addBoolean('required', array(
|
||||||
'label' => $this->translate('Required'),
|
'label' => $this->translate('Required'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
@ -139,11 +148,9 @@ class IcingaCommandArgumentForm extends DirectorObjectForm
|
|||||||
{
|
{
|
||||||
$object = $this->object();
|
$object = $this->object();
|
||||||
$cmd = $this->commandObject;
|
$cmd = $this->commandObject;
|
||||||
if (! $object->hasBeenLoadedFromDb()) {
|
if ($object->get('argument_name') === null) {
|
||||||
if ($object->get('argument_name') === null) {
|
$object->set('skip_key', true);
|
||||||
$object->set('skip_key', true);
|
$object->set('argument_name', $cmd->getNextSkippableKeyName());
|
||||||
$object->set('argument_name', $cmd->getNextSkippableKeyName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->hasBeenModified()) {
|
if ($object->hasBeenModified()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user