← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4859: fixed bug, dataset information not showing (malformed dataset-json if there was no dataentryform)

 

------------------------------------------------------------
revno: 4859
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-10-06 11:36:47 +0200
message:
  fixed bug, dataset information not showing (malformed dataset-json if there was no dataentryform)
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataSet.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataSet.js


--
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-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataSet.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataSet.vm	2011-09-27 09:10:27 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataSet.vm	2011-10-06 09:36:47 +0000
@@ -5,7 +5,7 @@
     "shortName": "$!encoder.jsonEncode( ${dataSet.shortName} )",
     "periodTypeId": "$!{dataSet.periodTypeId}",
 	"frequency": "$i18n.getString( $!{dataSet.periodType.name} )",
-    "dataElementCount": "$!{dataSet.dataElements.size()}",
-    "dataentryform": #if( $!{dataSet.dataEntryForm} )"$!encoder.jsonEncode( ${dataSet.dataEntryForm.name} )"#end
+    "dataElementCount": "$!{dataSet.dataElements.size()}"
+    #if( $!{dataSet.dataEntryForm} ),"dataentryform": "$!encoder.jsonEncode( ${dataSet.dataEntryForm.name} )"#end
   }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataSet.js	2011-09-27 09:10:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataSet.js	2011-10-06 09:36:47 +0000
@@ -1,19 +1,20 @@
-
 // -----------------------------------------------------------------------------
 // DataSet details form
 // -----------------------------------------------------------------------------
 
 function showDataSetDetails( dataSetId )
 {
-	jQuery.post( '../dhis-web-commons-ajax-json/getDataSet.action', 
-		{ id: dataSetId }, function ( json ) {
-		setInnerHTML( 'nameField', json.dataSet.name );
-		setInnerHTML( 'frequencyField', json.dataSet.frequency );
-		setInnerHTML( 'dataElementCountField', json.dataSet.dataElementCount );
-		setInnerHTML( 'dataEntryFormField', json.dataSet.dataentryform );
+    jQuery.post( '../dhis-web-commons-ajax-json/getDataSet.action', {
+        id : dataSetId
+    }, function( json )
+    {
+        setInnerHTML( 'nameField', json.dataSet.name );
+        setInnerHTML( 'frequencyField', json.dataSet.frequency );
+        setInnerHTML( 'dataElementCountField', json.dataSet.dataElementCount );
+        setInnerHTML( 'dataEntryFormField', json.dataSet.dataentryform );
 
-		showDetails();
-	});
+        showDetails();
+    } );
 }
 
 // -----------------------------------------------------------------------------
@@ -26,7 +27,7 @@
 
 function removeDataSet( dataSetId, dataSetName )
 {
-  removeItem( dataSetId, dataSetName, i18n_confirm_delete, 'delDataSet.action' );
+    removeItem( dataSetId, dataSetName, i18n_confirm_delete, 'delDataSet.action' );
 }
 
 // ----------------------------------------------------------------------
@@ -35,5 +36,5 @@
 
 function viewDataEntryForm( dataSetId )
 {
-	window.location.href = 'viewDataEntryForm.action?dataSetId=' + dataSetId;
+    window.location.href = 'viewDataEntryForm.action?dataSetId=' + dataSetId;
 }