Enhancement / bug fix: allow the overload of the GetName method for building the short name of an object. This is also used when the object appears in a drop-down list.

SVN:trunk[325]
This commit is contained in:
Denis Flaven
2010-04-12 12:22:00 +00:00
parent 37ccd94828
commit 128f048800
2 changed files with 11 additions and 8 deletions

View File

@@ -96,15 +96,17 @@ class ValueSetObjects extends ValueSetDefinition
$oFilter = DBObjectSearch::FromSibusQL($this->m_sFilterExpr, $aArgs);
if (!$oFilter) return false;
if (empty($this->m_sValueAttCode))
{
$this->m_sValueAttCode = MetaModel::GetNameAttributeCode($oFilter->GetClass());
}
$oObjects = new DBObjectSet($oFilter, $this->m_aOrderBy, $aArgs);
while ($oObject = $oObjects->Fetch())
{
$this->m_aValues[$oObject->GetKey()] = $oObject->GetAsHTML($this->m_sValueAttCode);
if (empty($this->m_sValueAttCode))
{
$this->m_aValues[$oObject->GetKey()] = $oObject->GetName();
}
else
{
$this->m_aValues[$oObject->GetKey()] = $oObject->GetAsHTML($this->m_sValueAttCode);
}
}
return true;
}