mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
- Default value for a drop-down list is not forced if the field is not mandatory
SVN:trunk[522]
This commit is contained in:
@@ -972,14 +972,14 @@ abstract class cmdbAbstractObject extends CMDBObject
|
||||
$sHTMLValue .= "<option value=\"0\">".Dict::S('UI:SelectOne')."</option>\n";
|
||||
foreach($aAllowedValues as $key => $display_value)
|
||||
{
|
||||
if (count($aAllowedValues) == 1)
|
||||
if ((count($aAllowedValues) == 1) && $bMandatory )
|
||||
{
|
||||
// When there is only once choice, select it by default
|
||||
$sSelected = ' selected';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sSelected = ($value == $key) ? ' selected' : '';
|
||||
$sSelected = ($value == $key) ? ' selected' : '';
|
||||
}
|
||||
$sHTMLValue .= "<option value=\"$key\"$sSelected>$display_value</option>\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user