mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
_ Fixed Trac #46: when a mandatory field has no valid value, an empty drop-down list is displayed, this prevents the user from validating the from.
SVN:trunk[215]
This commit is contained in:
@@ -681,11 +681,12 @@ abstract class cmdbAbstractObject extends CMDBObject
|
||||
if ($aAllowedValues !== null)
|
||||
{
|
||||
//Enum field or external key, display a combo
|
||||
if (count($aAllowedValues) == 0)
|
||||
{
|
||||
$sHTMLValue = "<input count=\"0\" type=\"text\" size=\"30\" value=\"\" name=\"attr_{$sAttCode}{$sNameSuffix}\" id=\"$iInputId\"{$sCSSClasses}/>";
|
||||
}
|
||||
else if (count($aAllowedValues) > 50)
|
||||
//if (count($aAllowedValues) == 0)
|
||||
//{
|
||||
// $sHTMLValue = "<input count=\"0\" type=\"text\" size=\"30\" value=\"\" name=\"attr_{$sAttCode}{$sNameSuffix}\" id=\"$iInputId\"{$sCSSClasses}/>";
|
||||
//}
|
||||
//else if (count($aAllowedValues) > 50)
|
||||
if (count($aAllowedValues) > 50)
|
||||
{
|
||||
// too many choices, use an autocomplete
|
||||
// The input for the auto complete
|
||||
@@ -698,6 +699,7 @@ abstract class cmdbAbstractObject extends CMDBObject
|
||||
else
|
||||
{
|
||||
// Few choices, use a normal 'select'
|
||||
// In case there are no valid values, the select will be empty, thus blocking the user from validating the form
|
||||
$sHTMLValue = "<select name=\"attr_{$sAttCode}{$sNameSuffix}\" id=\"$iInputId\"{$sCSSClasses}>\n";
|
||||
$sHTMLValue .= "<option value=\"0\">-- select one --</option>\n";
|
||||
foreach($aAllowedValues as $key => $display_value)
|
||||
|
||||
Reference in New Issue
Block a user