mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 17:48:43 +02:00
- New implementation of the n-n link edition widget... in progress.
SVN:trunk[654]
This commit is contained in:
@@ -350,6 +350,28 @@ abstract class DBObject
|
||||
return $this->m_aOrigValues[$sAttCode];
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the value of an external field by (re)loading the object
|
||||
* corresponding to the external key and getting the value from it
|
||||
* @param string $sAttCode Attribute code of the external field to update
|
||||
* @return void
|
||||
*/
|
||||
protected function UpdateExternalField($sAttCode)
|
||||
{
|
||||
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode);
|
||||
if ($oAttDef->IsExternalField())
|
||||
{
|
||||
$sTargetClass = $oAttDef->GetTargetClass();
|
||||
$objkey = $this->Get($oAttDef->GetKeyAttCode());
|
||||
$oObj = MetaModel::GetObject($sTargetClass, $objkey);
|
||||
if (is_object($oObj))
|
||||
{
|
||||
$value = $oObj->Get($oAttDef->GetExtAttCode());
|
||||
$this->Set($sAttCode, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Compute scalar attributes that depend on any other type of attribute
|
||||
public function DoComputeValues()
|
||||
{
|
||||
@@ -495,10 +517,14 @@ abstract class DBObject
|
||||
}
|
||||
$this->m_iKey = $iNewKey;
|
||||
}
|
||||
|
||||
public function GetIcon()
|
||||
/**
|
||||
* Get the icon representing this object
|
||||
* @param boolean $bImgTag If true the result is a full IMG tag (or an emtpy string if no icon is defined)
|
||||
* @return string Either the full IMG tag ($bImgTag == true) or just the path to the icon file
|
||||
*/
|
||||
public function GetIcon($bImgTag = true)
|
||||
{
|
||||
return MetaModel::GetClassIcon(get_class($this));
|
||||
return MetaModel::GetClassIcon(get_class($this), $bImgTag);
|
||||
}
|
||||
|
||||
public function GetName()
|
||||
|
||||
@@ -288,7 +288,7 @@ abstract class MetaModel
|
||||
return self::GetClassDescription($sClass);
|
||||
}
|
||||
}
|
||||
final static public function GetClassIcon($sClass)
|
||||
final static public function GetClassIcon($sClass, $bImgTag = true)
|
||||
{
|
||||
self::_check_subclass($sClass);
|
||||
|
||||
@@ -305,6 +305,10 @@ abstract class MetaModel
|
||||
return self::GetClassIcon($sParentClass);
|
||||
}
|
||||
}
|
||||
if ($bImgTag && ($sIcon != ''))
|
||||
{
|
||||
$sIcon = "<img src=\"$sIcon\" style=\"vertical-align:middle;\"/>";
|
||||
}
|
||||
return $sIcon;
|
||||
}
|
||||
final static public function IsAutoIncrementKey($sClass)
|
||||
|
||||
Reference in New Issue
Block a user