mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Could not bulk import with the "final class" (interactive import).
SVN:trunk[4348]
This commit is contained in:
@@ -2116,6 +2116,41 @@ class AttributeFinalClass extends AttributeString
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An enum can be localized
|
||||
*/
|
||||
public function MakeValueFromString($sProposedValue, $bLocalizedValue = false, $sSepItem = null, $sSepAttribute = null, $sSepValue = null, $sAttributeQualifier = null)
|
||||
{
|
||||
if ($bLocalizedValue)
|
||||
{
|
||||
// Lookup for the value matching the input
|
||||
//
|
||||
$sFoundValue = null;
|
||||
$aRawValues = self::GetAllowedValues();
|
||||
if (!is_null($aRawValues))
|
||||
{
|
||||
foreach ($aRawValues as $sKey => $sValue)
|
||||
{
|
||||
if ($sProposedValue == $sValue)
|
||||
{
|
||||
$sFoundValue = $sKey;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_null($sFoundValue))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return $this->MakeRealValue($sFoundValue, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
return parent::MakeValueFromString($sProposedValue, $bLocalizedValue, $sSepItem, $sSepAttribute, $sSepValue, $sAttributeQualifier);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Because this is sometimes used to get a localized/string version of an attribute...
|
||||
public function GetEditValue($sValue, $oHostObj = null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user