Clarified the meaning of the attribute 'finalclass'

SVN:trunk[380]
This commit is contained in:
Romain Quetiez
2010-05-01 16:16:43 +00:00
parent 776e6befe6
commit 5a7e59e02f
7 changed files with 136 additions and 90 deletions

View File

@@ -59,7 +59,7 @@ abstract class AttributeDefinition
protected $m_sCode;
private $m_aParams = array();
private $m_sHostClass = array();
private $m_sHostClass = '!undefined!';
protected function Get($sParamName) {return $this->m_aParams[$sParamName];}
protected function IsParam($sParamName) {return (array_key_exists($sParamName, $this->m_aParams));}
@@ -132,7 +132,7 @@ abstract class AttributeDefinition
public function IsNullAllowed() {return true;}
public function GetNullValue() {return null;}
public function GetCode() {return $this->m_sCode;}
public function GetLabel() {return Dict::S('Class:'.$this->m_sHostClass.'/Attribute:'.$this->m_sCode, $this->m_sCode);}
public function GetLabel() {return Dict::S('Class:'.$this->m_sHostClass.'/Attribute:'.$this->m_sCode, $this->m_sCode);}
public function GetLabel_Obsolete()
{
// Written for compatibility with a data model written prior to version 0.9.1
@@ -668,6 +668,36 @@ class AttributeClass extends AttributeString
}
}
/**
* The attribute dedicated to the finalclass automatic attribute
*
* @package iTopORM
* @author Romain Quetiez <romainquetiez@yahoo.fr>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.itop.com
* @since 1.0
* @version $itopversion$
*/
class AttributeFinalClass extends AttributeString
{
public function __construct($sCode, $aParams)
{
$this->m_sCode = $sCode;
$aParams["allowed_values"] = null;
parent::__construct($sCode, $aParams);
}
public function IsWritable()
{
return false;
}
public function GetAsHTML($sValue)
{
return MetaModel::GetName($sValue);
}
}
/**
* Map a varchar column (size < ?) to an attribute that must never be shown to the user
*