← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6903: (patient) Add missing files.

 

------------------------------------------------------------
revno: 6903
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-05-10 23:25:05 +0700
message:
  (patient) Add missing files.
added:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportList.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportResult.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
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportList.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportList.vm	2012-05-10 16:25:05 +0000
@@ -0,0 +1,11 @@
+#set( $size = ${tabularReports.size()} )
+{ "tabularReports": [
+  #foreach( ${tabularReport} in $!{tabularReports} )
+  {
+	"id": "${tabularReport.id}",
+	"name": "$!encoder.jsonEncode( ${tabularReport.name} )",
+	"lastUpdated": "${tabularReport.lastUpdated}"
+  }#if( $velocityCount < $size ),#end
+  #end
+  ]
+}
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportResult.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportResult.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportResult.vm	2012-05-10 16:25:05 +0000
@@ -0,0 +1,100 @@
+{
+#if( $grid.getRows().size() > 0)
+	#set( $noHeader = $grid.getHeaders().size() )
+	#set ( $metaData = $noHeader - $valueTypes.size())
+	'total': "$total",
+	'valueTypes':[
+		#foreach( $col in $grid.getHeaders() )
+			#if ($velocityCount <= $metaData + 1)
+				{
+					"valueType": "textfield",
+					"suggestedValues": []
+				},
+			#end
+		#end
+		
+		#set($index = 0)
+		#foreach( $valueType in $valueTypes )
+			{
+				"valueType": 
+					#if( $valueType == 'number' || $valueType == 'NUMBER' )
+						"textfield"
+					#elseif( $valueType == 'bool' || $valueType == 'YES/NO' ||  $valueType =='optionSet' )
+						"combobox"
+					#elseif( $valueType == 'date' || $valueType == 'DATE' )
+						"textfield"
+					#else
+						"textfield"
+					#end,
+				#set( $suggestedValues = $mapSuggestedValues.get($index) )
+				"suggestedValues":[
+					#foreach( $suggestedValue in $suggestedValues )
+						["$!encoder.jsonEncode( ${suggestedValue} )"]
+						#if( $velocityCount < $suggestedValues.size() ),#end
+					#end
+				
+				]
+			}
+			#if( $velocityCount < $valueTypes.size() ),#end
+			#set( $index = $index + 1 )
+		#end
+	],
+	'columns':[
+		"id",
+		#foreach( $colName in $grid.getHeaders() )
+			"$colName.name"
+			#if( $velocityCount < $noHeader ),#end
+		#end
+	],
+	'fields':[
+		"id",
+		#foreach( $col in $grid.getHeaders() )
+			"col$velocityCount"
+			#if( $velocityCount < $noHeader ),#end
+		#end
+	],
+	'hidden':[
+		#set( $index = 2 )
+		#set($col="col" + $index )
+		#foreach( $col in $grid.getHeaders() )
+			{"$col":"$col.hidden"}
+			#if( $velocityCount < $noHeader ),#end
+			#set( $index = $index + 1 )
+		#end
+	],
+	'items':[
+		{
+			"id":"$i18n.getString( 'filter' )",
+			#foreach( $col in $grid.getHeaders() )
+				#if ($velocityCount <= $metaData )
+					"col$velocityCount": "",
+				#end
+			#end
+			
+			#set( $index = $metaData + 1 )
+			#foreach( $value in $values )
+				"col$index": "$value"
+				#if( $velocityCount < $values.size() ),#end
+				#set( $index = $index + 1 )
+			#end
+		},
+		#foreach( $row in $grid.getRows() )
+			{
+				#set( $nr = ( ( $paging.getCurrentPage() - 1  ) * $paging.pageSize ) + $velocityCount )
+				"id":$nr,
+				#foreach( $col in $row )
+					"col$velocityCount": "$!encoder.htmlEncode( $col )"
+					#if( $velocityCount < $noHeader ),#end
+				#end
+			},
+		#end
+		]	
+#else
+	'total': 0,
+	'valueTypes':[],
+	'columns':[],
+	'fields':[],
+	'hidden':[],
+	'items':[]
+#end
+}
\ No newline at end of file