mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
Advanced Search: Fix ExternalFields allowed values
SVN:trunk[5668]
This commit is contained in:
@@ -746,10 +746,30 @@ class ScalarExpression extends UnaryExpression
|
||||
{
|
||||
switch (true)
|
||||
{
|
||||
case ($oAttDef instanceof AttributeExternalField):
|
||||
try
|
||||
{
|
||||
if ($this->GetValue() == 0)
|
||||
{
|
||||
$aValue['label'] = Dict::S('UI:UndefinedObject');
|
||||
}
|
||||
else
|
||||
{
|
||||
/** @var AttributeExternalKey $oAttDef */
|
||||
$sTarget = $oAttDef->GetFinalAttDef()->GetTargetClass();
|
||||
$oObj = MetaModel::GetObject($sTarget, $this->GetValue());
|
||||
|
||||
$aValue['label'] = $oObj->Get("friendlyname");
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
IssueLog::Error($e->getMessage());
|
||||
}
|
||||
break;
|
||||
case $oAttDef->IsExternalKey():
|
||||
try
|
||||
{
|
||||
|
||||
if ($this->GetValue() == 0)
|
||||
{
|
||||
$aValue['label'] = Dict::S('UI:UndefinedObject');
|
||||
|
||||
Reference in New Issue
Block a user