mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°962: TagSet Edition in string mode
SVN:b931[6029]
This commit is contained in:
committed by
Pierre Goiffon
parent
cd2ea3793e
commit
ecdc4076d9
@@ -5375,7 +5375,7 @@ class AttributeHierarchicalKey extends AttributeExternalKey
|
||||
|
||||
/*
|
||||
* The target class is the class for which the attribute has been defined first
|
||||
*/
|
||||
*/
|
||||
public function SetHostClass($sHostClass)
|
||||
{
|
||||
if (!isset($this->m_sTargetClass))
|
||||
@@ -5900,7 +5900,23 @@ class AttributeExternalField extends AttributeDefinition
|
||||
*/
|
||||
class AttributeTagSet extends AttributeString
|
||||
{
|
||||
public function GetEditClass() {return "TagSet";}
|
||||
public function GetEditClass() {
|
||||
return "String";
|
||||
}
|
||||
|
||||
public function GetEditValue($value, $oHostObj = null)
|
||||
{
|
||||
if (empty($value))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
if ($value instanceof ormTagSet)
|
||||
{
|
||||
$aValues = $value->GetValue();
|
||||
return implode(' ', $aValues);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
protected function GetSQLCol($bFullSpec = false)
|
||||
{
|
||||
@@ -5921,6 +5937,16 @@ class AttributeTagSet extends AttributeString
|
||||
return ($val1 == $val2);
|
||||
}
|
||||
|
||||
public function GetType()
|
||||
{
|
||||
return Dict::S('Core:TagSetFieldData');
|
||||
}
|
||||
|
||||
public function GetTypeDesc()
|
||||
{
|
||||
return Dict::S('Core:TagSetFieldData+');
|
||||
}
|
||||
|
||||
/**
|
||||
* force an allowed value (type conversion and possibly forces a value as mySQL would do upon writing!
|
||||
*
|
||||
@@ -6110,6 +6136,21 @@ class AttributeTagSet extends AttributeString
|
||||
return $oSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* The part of the current attribute in the object's signature, for the supplied value
|
||||
* @param mixed $value The value of this attribute for the object
|
||||
* @return string The "signature" for this field/attribute
|
||||
*/
|
||||
public function Fingerprint($value)
|
||||
{
|
||||
if ($value instanceof ormTagSet)
|
||||
{
|
||||
$aValues = $value->GetValue();
|
||||
return implode(' ', $aValues);
|
||||
}
|
||||
return parent::Fingerprint($value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user