← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10545: clear out programStageId, programId on ou change

 

------------------------------------------------------------
revno: 10545
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-04-15 11:23:22 +0700
message:
  clear out programStageId, programId on ou change
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.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-15 04:08:05 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2013-04-15 04:23:22 +0000
@@ -72,13 +72,7 @@
         if ( loggedIn ) {
             setHeaderDelayMessage( i18n_online_notification );
             enableFiltering();
-
-            var search = getFieldValue( 'programStageId' ) != undefined && getFieldValue( 'programStageId' ).length != 0;
-
-            if ( search ) {
-                searchEvents( eval( getFieldValue( 'listAll' ) ) );
-            }
-
+            searchEvents( eval( getFieldValue( 'listAll' ) ) );
             $('#commentInput').removeAttr('disabled');
         }
         else {
@@ -158,6 +152,8 @@
     setFieldValue( "listAll", true );
     setFieldValue( "startDate", '' );
     setFieldValue( "endDate", '' );
+    setFieldValue( "programStageId", '' );
+    setFieldValue( "programId", '' );
     jQuery( '#advancedSearchTB [name=searchText]' ).val( '' );
 
     setFieldValue( 'orgunitId', orgUnits[0] );
@@ -478,6 +474,12 @@
 }
 
 function searchEvents( listAll ) {
+    var search = getFieldValue( 'programStageId' ) != undefined && getFieldValue( 'programStageId' ).length != 0;
+
+    if ( !search ) {
+        return;
+    }
+
     hideById( 'dataEntryInfor' );
     hideById( 'listDiv' );