mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°2482 Regression on mandatory external field with only 1 value
This commit is contained in:
@@ -2178,11 +2178,14 @@ EOF
|
||||
if ((count($aAllowedValues) == 1) && ($bMandatory == 'true'))
|
||||
{
|
||||
// When there is only once choice, select it by default
|
||||
$oPage->add_ready_script(
|
||||
<<<EOF
|
||||
if($value != $key)
|
||||
{
|
||||
$oPage->add_ready_script(
|
||||
<<<EOF
|
||||
$('#$iId').attr('data-validate','dependencies');
|
||||
EOF
|
||||
);
|
||||
);
|
||||
}
|
||||
$sSelected = ' selected';
|
||||
}
|
||||
else
|
||||
|
||||
@@ -208,11 +208,14 @@ class UIExtKeyWidget
|
||||
{
|
||||
// When there is only once choice, select it by default
|
||||
$sSelected = 'selected';
|
||||
$oPage->add_ready_script(
|
||||
<<<EOF
|
||||
if($value != $key)
|
||||
{
|
||||
$oPage->add_ready_script(
|
||||
<<<EOF
|
||||
$('#$this->iId').attr('data-validate','dependencies');
|
||||
EOF
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user