← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9690: Encoding in template

 

------------------------------------------------------------
revno: 9690
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-02-02 21:22:58 +0200
message:
  Encoding in template
modified:
  dhis-2/dhis-support/dhis-support-system/src/main/resources/html-report-template.html
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderHtmlReport.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-support/dhis-support-system/src/main/resources/html-report-template.html'
--- dhis-2/dhis-support/dhis-support-system/src/main/resources/html-report-template.html	2013-01-31 14:48:30 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/resources/html-report-template.html	2013-02-02 19:22:58 +0000
@@ -50,7 +50,6 @@
 
 var id = orgUnit.id;
 var name = orgUnit.name;<br>
-var shortName = orgUnit.shortName;<br>
 var code = orgUnit.code;<br><br>
 
 var orgUnitHierarchy = dhis2.report.organisationUnitHierarchy; // An array with org unit objects for the hierarchy (current org unit first)<br><br>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderHtmlReport.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderHtmlReport.vm	2013-01-31 14:48:30 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderHtmlReport.vm	2013-02-02 19:22:58 +0000
@@ -4,10 +4,9 @@
 
 dhis2.report.organisationUnit = {
 #if( $organisationUnit )
-    "id": "$!{organisationUnit.uid}",
-    "name": "$!{organisationUnit.name}",
-    "shortName": "$!{organisationUnit.shortName}",
-    "code": "$!{organisationUnit.code}"
+    "id": "$!encoder.htmlEncode( ${organisationUnit.uid} )",
+    "name": "$!encoder.htmlEncode( ${organisationUnit.name} )",
+    "code": "$!encoder.htmlEncode( ${organisationUnit.code} )"
 #end
 };
 
@@ -16,10 +15,9 @@
 #set( $size = $organisationUnitHierarchy.size() )
 #foreach( $ou in $organisationUnitHierarchy )
 {
-    "id": "${ou.uid}",
-    "name": "${ou.name}",
-    "shortName": "${ou.shortName}",
-    "code": "${ou.code}"
+    "id": "$!encoder.htmlEncode( ${ou.uid} )",
+    "name": "$!encoder.htmlEncode( ${ou.name} )",
+    "code": "$!encoder.htmlEncode( ${ou.code} )"
 }#if( $velocityCount < $size ),#end
 #end
 #end