← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4346: Renabled check for total form size during form download

 

------------------------------------------------------------
revno: 4346
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-08-18 11:04:06 +0200
message:
  Renabled check for total form size during form download
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.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-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-08-18 08:31:15 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-08-18 09:04:06 +0000
@@ -654,7 +654,7 @@
 // Data completeness
 // -----------------------------------------------------------------------------
 
-var KEY_COMPLETEDATASETS = "completedatasets";
+var KEY_COMPLETEDATASETS = 'completedatasets';
 
 function getCompleteDataSetId(json)
 {
@@ -663,9 +663,9 @@
 
 function getCurrentCompleteDataSetParams() {
     var params = {
-            "periodId": $( '#selectedPeriodId' ).val(),
-            "dataSetId": $( '#selectedDataSetId' ).val(),
-            "organisationUnitId": currentOrganisationUnitId
+            'periodId': $( '#selectedPeriodId' ).val(),
+            'dataSetId': $( '#selectedDataSetId' ).val(),
+            'organisationUnitId': currentOrganisationUnitId
     };
     
     return params;
@@ -675,11 +675,11 @@
 {
     var completeDataSets;
 
-    if(localStorage[KEY_COMPLETEDATASETS] == null)
+    if( localStorage[KEY_COMPLETEDATASETS] == null )
     {
         completeDataSets = {};
     } else {
-        completeDataSets = JSON.parse(localStorage[KEY_COMPLETEDATASETS]);
+        completeDataSets = JSON.parse( localStorage[KEY_COMPLETEDATASETS] );
     }
 
     return completeDataSets;
@@ -715,16 +715,13 @@
         
         disableCompleteButton();
 
-        $.getJSON( 'getValidationViolations.action', params).success(function(data) {
-            registerCompleteDataSet(data);
-        }).error( function() {
-            // no response from server, fake a positive result and save it anyways
+        $.getJSON( 'getValidationViolations.action', params).success( function( data ) {
+            registerCompleteDataSet( data );
+        } ).error( function() {
+            // no response from server, fake a positive result and save it anyway
             registerCompleteDataSet({
-                "response": "success"
+                'response': 'success'
             });
-
-//            disableUndoButton();
-//            window.alert( i18n_no_response_from_server );
         } );
     }
 }
@@ -739,7 +736,7 @@
 
         $.getJSON( 'registerCompleteDataSet.action', params).success(function() {
             clearCompleteDataSetLocally(params);
-        }).error( function() {
+        } ).error( function() {
         } );
     }
     else
@@ -761,7 +758,7 @@
 
         $.getJSON( 'undoCompleteDataSet.action', params).success(function() {
             clearCompleteDataSetLocally(params);
-        }).error( function()
+        } ).error( function()
         {
             clearCompleteDataSetLocally(params);
         } );
@@ -937,8 +934,7 @@
 function StorageManager()
 {
 	var MAX_SIZE = new Number( 2600000 );
-//	var MAX_SIZE_FORMS = new Number( 1600000 );
-//	var MAX_SIZE_DATA_VALUES = new Number( 500000 );
+	var MAX_SIZE_FORMS = new Number( 1600000 );
 
 	var KEY_FORM_PREFIX = 'form-';
 	var KEY_FORM_VERSIONS = 'formversions';
@@ -1024,7 +1020,6 @@
 			return false;
 		}
 		
-		/*
 		if ( MAX_SIZE_FORMS < this.totalFormSize() )
 		{
 			this.deleteForm( dataSetId );
@@ -1032,7 +1027,6 @@
 			console.log( 'Max local storage quota for forms reached, ignored form: ' + dataSetId );
 			return false;
 		}
-		* */
 		
 		return true;
 	};