Localization: cleanup in the DataModel + aligned some API (e.g. GetStateLabel)

SVN:trunk[348]
This commit is contained in:
Romain Quetiez
2010-04-20 09:21:46 +00:00
parent 3f9a9424e9
commit 1bdfbbb284
33 changed files with 891 additions and 769 deletions

View File

@@ -454,11 +454,38 @@ abstract class DBObject
}
else
{
$aStates = MetaModel::EnumStates(get_class($this));
return $aStates[$this->Get($sStateAttCode)]['label'];
return $this->Get($sStateAttCode);
return MetaModel::GetStateLabel(get_class($this), $sStateAttCode);
}
}
public function GetStateLabel()
{
$sStateAttCode = MetaModel::GetStateAttributeCode(get_class($this));
if (empty($sStateAttCode))
{
return '';
}
else
{
$sStateValue = $this->Get($sStateAttCode);
return MetaModel::GetStateLabel(get_class($this), $sStateValue);
}
}
public function GetStateDescription()
{
$sStateAttCode = MetaModel::GetStateAttributeCode(get_class($this));
if (empty($sStateAttCode))
{
return '';
}
else
{
$sStateValue = $this->Get($sStateAttCode);
return MetaModel::GetStateDescription(get_class($this), $sStateValue);
}
}
/**
* Returns the set of flags (OPT_ATT_HIDDEN, OPT_ATT_READONLY, OPT_ATT_MANDATORY...)
* for the given attribute in the current state of the object