← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17505: confirmation dialog for dicarding local data

 

------------------------------------------------------------
revno: 17505
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-11-17 22:08:22 +0700
message:
  confirmation dialog for dicarding local data
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties
  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/select.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-services/dhis-service-core/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties	2014-11-17 15:01:37 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties	2014-11-17 15:08:22 +0000
@@ -125,6 +125,7 @@
 uploading_data_notification=Uploading locally stored data to the server
 sync_now=Upload
 discard=Discard
+remove_local_data=Are you sure you want to remove the locally stored data?
 sync_success=Upload to server was successful
 sync_failed=Upload to server failed, please try again later
 year=Year

=== 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	2014-11-17 15:01:37 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2014-11-17 15:08:22 +0000
@@ -290,8 +290,10 @@
 };
 
 dhis2.de.discardLocalData = function() {
-    dhis2.de.storageManager.clearAllDataValues();
-    hideHeaderMessage();
+    if( confirm( i18n_remove_local_data ) ) {
+        dhis2.de.storageManager.clearAllDataValues();
+        hideHeaderMessage();
+    }
 };
 
 dhis2.de.uploadLocalData = function()

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm	2014-11-17 15:01:37 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm	2014-11-17 15:08:22 +0000
@@ -33,6 +33,7 @@
 var i18n_need_to_sync_notification = '$encoder.jsEscape( $i18n.getString( "need_to_sync_notification" ) , "'")';
 var i18n_sync_now = '$encoder.jsEscape( $i18n.getString( "sync_now" ) , "'")';
 var i18n_discard = '$encoder.jsEscape( $i18n.getString( "discard" ) , "'")';
+var i18n_remove_local_data = '$encoder.jsEscape( $i18n.getString( "remove_local_data" ) , "'")';
 var i18n_sync_success = '$encoder.jsEscape( $i18n.getString( "sync_success" ) , "'")';
 var i18n_sync_failed = '$encoder.jsEscape( $i18n.getString( "sync_failed" ) , "'")';
 var i18n_uploading_data_notification = '$encoder.jsEscape( $i18n.getString( "uploading_data_notification" ) , "'")';