← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20371: event-capture: better detection of unsaved form

 

------------------------------------------------------------
revno: 20371
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-09-25 16:43:20 +0200
message:
  event-capture: better detection of unsaved form
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/index.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.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-apps/src/main/webapp/dhis-web-event-capture/index.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/index.html	2015-09-25 13:33:59 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/index.html	2015-09-25 14:43:20 +0000
@@ -1,6 +1,5 @@
 <!DOCTYPE html>
-<html ng-app="eventCapture">
-<!--<html manifest="cacheManifest.action" ng-app="eventCapture">-->
+<html manifest="cacheManifest.action" ng-app="eventCapture">
     <head>
         <title>Event Capture</title>
 
@@ -63,7 +62,7 @@
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.memory.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.contextmenu.js"></script>
-        <!--<script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.appcache.js"></script>-->
+        <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.appcache.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/ouwt/ouwt.js"></script>
         <script type="text/javascript" src="scripts/event-capture.js"></script>
         

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2015-09-25 13:33:59 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2015-09-25 14:43:20 +0000
@@ -874,8 +874,10 @@
         var isChanged = false;
         for(var i=0; i<$scope.selectedProgramStage.programStageDataElements.length && !isChanged; i++){
             var deId = $scope.selectedProgramStage.programStageDataElements[i].dataElement.id;
-            if($scope.currentEventOriginialValue[deId] !== $scope.currentEvent[deId]){
-                isChanged = true;
+            if($scope.currentEventOriginialValue[deId] !== $scope.currentEvent[deId] && 
+                    !$scope.currentEvent[deId] && 
+                    $scope.currentEventOriginialValue[deId] !== ""){                                       
+                isChanged = true;                
             }
         }        
         if(!isChanged){