← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10621: make sure that program list is correct after a page refresh

 

------------------------------------------------------------
revno: 10621
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-04-18 19:50:37 +0700
message:
  make sure that program list is correct after a page refresh
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.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-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2013-04-18 07:03:12 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2013-04-18 12:50:37 +0000
@@ -145,6 +145,7 @@
         $( document ).one( 'dhis2.anonymous.checkOfflineEvents', checkOfflineData );
         $( document ).one( 'dhis2.anonymous.checkOfflineData', function() {
             dhis2.availability.startAvailabilityCheck();
+            selection.responseReceived();
         } );
 
         initalizeProgramStages();

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2013-04-18 12:16:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2013-04-18 12:50:37 +0000
@@ -680,6 +680,8 @@
                 });
             }
 
+            $('#commentInput').attr('disabled', true)
+
             if( always ) always();
         });
     } else {
@@ -691,6 +693,8 @@
             type: 'GET',
             dataType: 'json'
         } ).done(function(data) {
+            $('#commentInput').removeAttr('disabled');
+
             $( "#programStageInstanceId" ).val( data.id );
             $( "#entryFormContainer input[id='programStageInstanceId']" ).val( data.id );
             $( "#entryFormContainer input[id='incidentDate']" ).val( data.programInstance.dateOfIncident );
@@ -755,8 +759,6 @@
             } );
 
             if( always ) always();
-        } ).fail(function() {
-            $('#commentInput').attr('disabled', true)
         } );
     }
 }