← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16340: Fixed bug - n left/right side in Create new program validation rule form, cannot load dataelement...

 

------------------------------------------------------------
revno: 16340
committer: Tran Chau<tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-08-07 20:50:27 +0700
message:
  Fixed bug - n left/right side in Create new program validation rule form, cannot load dataelements of program-stage.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/jsonTrackedEntityDataElements.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/jsonTrackedEntityDataElements.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/jsonTrackedEntityDataElements.vm	2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/jsonTrackedEntityDataElements.vm	2014-08-07 13:50:27 +0000
@@ -6,12 +6,17 @@
 	"name": "$!encoder.jsonEncode( ${dataElement.name} )",
 	"code": "$!encoder.jsonEncode( ${dataElement.code} )",
 	"type": "${dataElement.type}",
-	"optionset": 
-		#if( $!dataElement.optionSet )
-			"$encoder.xmlEncode($!dataElement.optionSet.options.toString())"
-		#else
-			""
-		#end
+	"optionset": #if( $!dataElement.optionSet )
+					[#foreach( $opt in $!dataElement.optionSet.options )
+						{
+							"code" : "$encoder.jsonEncode($opt.code)",
+							"name" : "$encoder.jsonEncode($opt.name)"
+						}#if( $velocityCount < $!dataElement.optionSet.options.size() ),#end
+					#end]
+				#else
+					""
+				#end
+		
   }#if( $velocityCount < $size ),#end
   #end
   ]