← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10542: json encoding for jsonProgramStageInstance.vm

 

------------------------------------------------------------
revno: 10542
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-04-13 15:38:25 +0700
message:
  json encoding for jsonProgramStageInstance.vm
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstance.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-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstance.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstance.vm	2013-04-13 08:00:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstance.vm	2013-04-13 08:38:25 +0000
@@ -1,5 +1,5 @@
 {
-    "currentUsername": "$currentUsername",
+    "currentUsername": "$encoder.jsonEncode( $currentUsername )",
     "id": "$!programStageInstance.id",
     "dueDate": "$format.formatDate( $!programStageInstance.dueDate )",
     "executionDate": "$format.formatDate( $!programStageInstance.executionDate )",
@@ -13,7 +13,7 @@
     "comments": [
     #set( $size = $programStageInstance.patientComments.size() )
     #foreach( $comment in $programStageInstance.patientComments )
-{"createdDate": "$format.formatDateTime($comment.createdDate)", "creator": "$comment.creator", "text": "$!comment.commentText"}#if( $velocityCount < $size ),
+{"createdDate": "$format.formatDateTime($comment.createdDate)", "creator": "$encoder.jsonEncode( $comment.creator )", "text": "$encoder.jsonEncode( $!comment.commentText )"}#if( $velocityCount < $size ),
     #end
     #end
 
@@ -23,7 +23,7 @@
     #set( $size = $dataValueMap.keySet().size() )
     #foreach( $key in $dataValueMap.keySet() )
     #set( $value = $dataValueMap.get($key) )
-"$key": {"value": "$!value.value", "timestamp": "$!value.timestamp", "providedElsewhere": "$!value.providedElsewhere", "storedBy": "$!value.storedBy"}#if( $velocityCount < $size ),
+"$key": {"value": "$encoder.jsonEncode( $!value.value )", "timestamp": "$!value.timestamp", "providedElsewhere": "$!value.providedElsewhere", "storedBy": "$!value.storedBy"}#if( $velocityCount < $size ),
     #end
     #end
 
@@ -31,7 +31,7 @@
 
     "program": {
         "id": "$!programStageInstance.programInstance.program.id",
-        "uid": "$!programStageInstance.programInstance.program.uid",
+        "uid": "$encoder.jsonEncode( $!programStageInstance.programInstance.program.uid )",
         "type": "$!programStageInstance.programInstance.program.type",
         "blockEntryForm": "$!programStageInstance.programInstance.program.blockEntryForm",
         "remindCompleted": "$!programStageInstance.programInstance.program.remindCompleted"
@@ -39,7 +39,7 @@
 
     "programStage": {
         "id": "$!programStageInstance.programStage.id",
-        "uid": "$!programStageInstance.programStage.uid",
+        "uid": "$encoder.jsonEncode( $!programStageInstance.programStage.uid )",
         "name": "$!programStageInstance.programStage.displayName",
         "irregular": "$!programStageInstance.programStage.irregular",
         "displayGenerateEventBox": "$!programStageInstance.programStage.displayGenerateEventBox",