浏览代码

GetValueLabel is used in some dashboards... make sure that it is available for any attribute

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1615 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 年之前
父节点
当前提交
0f491c045f
共有 1 个文件被更改,包括 15 次插入1 次删除
  1. 15 1
      core/attributedef.class.inc.php

+ 15 - 1
core/attributedef.class.inc.php

@@ -206,6 +206,15 @@ abstract class AttributeDefinition
 		}
 		return $sLabel;
 	}
+	
+	/**
+	 * Get the label corresponding to the given value
+	 * To be overloaded for localized enums
+	 */
+	public function GetValueLabel($sValue)
+	{
+		return GetAsHTML($sValue);
+	}
 
 	public function GetLabel_Obsolete()
 	{
@@ -1333,7 +1342,12 @@ class AttributeFinalClass extends AttributeString
 	{
 		return '=';
 	}
-
+	
+	public function GetValueLabel($sValue)
+	{
+		if (empty($sValue)) return '';
+		return MetaModel::GetName($sValue);
+	}
 }