dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20882
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9736: Data entry, handling complete data set registrations when localstorage max quota has been exceeded.
------------------------------------------------------------
revno: 9736
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-02-05 17:10:14 +0200
message:
Data entry, handling complete data set registrations when localstorage max quota has been exceeded.
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 2013-02-05 12:34:09 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2013-02-05 15:10:14 +0000
@@ -1925,8 +1925,8 @@
*/
this.saveDataValue = function( dataValue )
{
- var id = this.getDataValueIdentifier( dataValue.dataElementId, dataValue.optionComboId, dataValue.periodId,
- dataValue.organisationUnitId );
+ var id = this.getDataValueIdentifier( dataValue.dataElementId,
+ dataValue.optionComboId, dataValue.periodId, dataValue.organisationUnitId );
var dataValues = {};
@@ -1942,9 +1942,10 @@
localStorage[KEY_DATAVALUES] = JSON.stringify( dataValues );
log( 'Successfully stored data value' );
- } catch ( e )
+ }
+ catch ( e )
{
- log( 'Max local storage quota reached, ignored data value' );
+ log( 'Max local storage quota reached, not storing data value locally' );
}
};
@@ -2083,7 +2084,16 @@
completeDataSets[completeDataSetId] = json;
}
- localStorage[KEY_COMPLETEDATASETS] = JSON.stringify( completeDataSets );
+ try
+ {
+ localStorage[KEY_COMPLETEDATASETS] = JSON.stringify( completeDataSets );
+
+ log( 'Successfully stored complete registration' );
+ }
+ catch ( e )
+ {
+ log( 'Max local storage quota reached, not storing complete registration locally' );
+ }
};
/**