mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
@@ -6526,11 +6526,13 @@ class AttributeExternalField extends AttributeDefinition
|
||||
}
|
||||
|
||||
/**
|
||||
* @see N°2174
|
||||
*
|
||||
* @param string $sDefault
|
||||
*
|
||||
* @return string dict entry if defined, otherwise the class hierarchy -> field name<br>
|
||||
* @return string dict entry if defined, otherwise :
|
||||
* <ul>
|
||||
* <li>if field is a friendlyname then display the label of the ExternalKey
|
||||
* <li>the class hierarchy -> field name
|
||||
*
|
||||
* <p>For example, having this :
|
||||
*
|
||||
* <pre>
|
||||
@@ -6543,7 +6545,8 @@ class AttributeExternalField extends AttributeDefinition
|
||||
*
|
||||
* <p>The ExternalField foo points to a magical field that is brought by c_id ExternalKey in class B.
|
||||
*
|
||||
* <p>The foo label will be : B -> C -> friendlyname<br>
|
||||
* <p>In the normal case the foo label would be : B -> C -> friendlyname<br>
|
||||
* But as foo is a friendlyname its label will be the same as the one on A.b_id field
|
||||
* This can be overrided with dict key Class:ClassA/Attribute:foo
|
||||
*
|
||||
* @throws \CoreException
|
||||
@@ -6558,6 +6561,19 @@ class AttributeExternalField extends AttributeDefinition
|
||||
return $sLabel;
|
||||
}
|
||||
|
||||
if ($this->IsFriendlyName())
|
||||
{
|
||||
// This will be used even if we are pointing to a friendlyname in a distance > 1
|
||||
// For example we can link to a magic friendlyname (like org_id_friendlyname)
|
||||
// If a specific label is needed, use a Dict key !
|
||||
// See N°2174
|
||||
$sKeyAttCode = $this->Get("extkey_attcode");
|
||||
$oExtKeyAttDef = MetaModel::GetAttributeDef($this->GetHostClass(), $sKeyAttCode);
|
||||
$sLabel = $oExtKeyAttDef->GetLabel($this->m_sCode);
|
||||
|
||||
return $sLabel;
|
||||
}
|
||||
|
||||
$oRemoteAtt = $this->GetExtAttDef();
|
||||
$sLabel = $oRemoteAtt->GetLabel($this->m_sCode);
|
||||
$oKeyAtt = $this->GetKeyAttDef();
|
||||
|
||||
Reference in New Issue
Block a user