Automaticaly insert the "final class" into lists where an external key is pointing to a class that has child classes

SVN:trunk[573]
This commit is contained in:
Romain Quetiez
2010-07-06 11:16:31 +00:00
parent 00b2dbe286
commit c9ec146dff
2 changed files with 114 additions and 51 deletions

View File

@@ -77,7 +77,7 @@ abstract class AttributeDefinition
protected $m_sCode;
private $m_aParams = array();
private $m_sHostClass = '!undefined!';
protected $m_sHostClass = '!undefined!';
protected function Get($sParamName) {return $this->m_aParams[$sParamName];}
protected function IsParam($sParamName) {return (array_key_exists($sParamName, $this->m_aParams));}
@@ -1357,7 +1357,6 @@ class AttributeExternalKey extends AttributeDBFieldVoid
*/
class AttributeExternalField extends AttributeDefinition
{
static protected function ListExpectedParams()
{
return array_merge(parent::ListExpectedParams(), array("extkey_attcode", "target_attcode"));
@@ -1373,6 +1372,25 @@ class AttributeExternalField extends AttributeDefinition
return $oExtAttDef->GetSQLCol();
}
public function GetLabel()
{
$oRemoteAtt = $this->GetExtAttDef();
$sDefault = $oRemoteAtt->GetLabel();
return Dict::S('Class:'.$this->m_sHostClass.'/Attribute:'.$this->m_sCode, $sDefault);
}
public function GetDescription()
{
$oRemoteAtt = $this->GetExtAttDef();
$sDefault = $oRemoteAtt->GetDescription();
return Dict::S('Class:'.$this->m_sHostClass.'/Attribute:'.$this->m_sCode.'+', $sDefault);
}
public function GetHelpOnEdition()
{
$oRemoteAtt = $this->GetExtAttDef();
$sDefault = $oRemoteAtt->GetHelpOnEdition();
return Dict::S('Class:'.$this->m_sHostClass.'/Attribute:'.$this->m_sCode.'?', $sDefault);
}
public function IsExternalKey($iType = EXTKEY_RELATIVE)
{
switch($iType)