← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10877: minor fix for multiorg data entry, keep dataset/period if selected ou also have children with sam...

 

------------------------------------------------------------
revno: 10877
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-05-18 11:54:10 +0700
message:
  minor fix for multiorg data entry, keep dataset/period if selected ou also have children with same combo
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/cacheManifest.vm
  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-commons-resources/src/main/webapp/cacheManifest.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/cacheManifest.vm	2013-05-02 13:55:39 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/cacheManifest.vm	2013-05-18 04:54:10 +0000
@@ -1,5 +1,5 @@
 CACHE MANIFEST
-# 2.12-SNAPSHOT V1
+# 2.12-SNAPSHOT V2
 NETWORK:
 *
 CACHE:

=== 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-03-15 04:53:19 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2013-05-18 04:54:10 +0000
@@ -835,6 +835,7 @@
     addOptionById( 'selectedDataSetId', '-1', '[ ' + i18n_select_data_set + ' ]' );
 
     var dataSetValid = false;
+    var multiDataSetValid = false;
 
     $.safeEach( dataSetList, function( idx, item ) 
     {
@@ -856,6 +857,11 @@
 
             $.safeEach( childrenDataSets, function( idx, item )
             {
+                if ( dataSetId == item.id && multiOrganisationUnit)
+                {
+                    multiDataSetValid = true;
+                }
+
                 $( '<option />' ).attr( 'data-multiorg', true).attr( 'value', item.id).html(item.name).appendTo( '#selectedDataSetId' );
             } );
 
@@ -863,19 +869,25 @@
         }
     }
 
-    if ( !multiOrganisationUnit && dataSetValid && dataSetId != null )
-    {
-        $( '#selectedDataSetId' ).val( dataSetId );
-
-        if ( periodId && periodId != -1 && dataEntryFormIsLoaded )
-        {
+    if ( !multiOrganisationUnit && dataSetValid && dataSetId != null ) {
+        $( '#selectedDataSetId' ).val( dataSetId );
+
+        if ( periodId && periodId != -1 && dataEntryFormIsLoaded ) {
+            resetSectionFilters();
+            showLoader();
+            loadDataValues();
+        }
+    } else if ( multiOrganisationUnit && multiDataSetValid && dataSetId != null ) {
+        $( '#selectedDataSetId' ).val( dataSetId );
+        dataSetSelected();
+
+        if ( periodId && periodId != -1 && dataEntryFormIsLoaded ) {
             resetSectionFilters();
             showLoader();
             loadDataValues();
         }
     }
-    else
-    {
+    else {
         multiOrganisationUnit = false;
 
         clearSectionFilters();