瀏覽代碼

Bug fix: the JSON value for an enum should be the raw value, not its translated label.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3077 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 11 年之前
父節點
當前提交
af6a429ba6
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      core/attributedef.class.inc.php

+ 9 - 0
core/attributedef.class.inc.php

@@ -2365,6 +2365,15 @@ class AttributeEnum extends AttributeString
 		}
 	}
 
+	/**
+	 * Helper to get a value that will be JSON encoded
+	 * The operation is the opposite to FromJSONToValue	 
+	 */	 	
+	public function GetForJSON($value)
+	{
+		return $value;
+	}
+
 	public function GetAllowedValues($aArgs = array(), $sContains = '')
 	{
 		$aRawValues = parent::GetAllowedValues($aArgs, $sContains);