From f00c7c6bc25c69d699fb5a3006e3c6b1849e57d9 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Thu, 29 Sep 2011 09:46:58 +0000 Subject: [PATCH] GetValueLabel is used in some dashboards... make sure that it is available for any attribute SVN:1.2[1617] --- core/attributedef.class.inc.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index 97eca619aa..1b5e17bebc 100644 --- a/core/attributedef.class.inc.php +++ b/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); + } }