← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16738: Data entry, providing current data set as argument to triggers

 

------------------------------------------------------------
revno: 16738
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-09-17 13:43:40 +0200
message:
  Data entry, providing current data set as argument to triggers
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js
  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-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js	2014-09-17 11:14:47 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js	2014-09-17 11:43:40 +0000
@@ -360,7 +360,7 @@
     {
     	dhis2.de.storageManager.clearDataValueJSON( dataValue );
         markValue( fieldId, resultColor );
-        $( document ).trigger( dhis2.de.event.dataValueSaved, dataValue );
+        $( document ).trigger( dhis2.de.event.dataValueSaved, [ dhis2.de.currentDataSetId, dataValue ] );
     }
 
     function handleError( xhr, textStatus, errorThrown )

=== 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-09-17 11:14:47 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2014-09-17 11:43:40 +0000
@@ -591,7 +591,7 @@
 	                }
 	
 	                enableSectionFilter();	               
-	                $( document ).trigger( dhis2.de.event.formLoaded );
+	                $( document ).trigger( dhis2.de.event.formLoaded, dhis2.de.currentDataSetId );
 	
 	                loadDataValues();
 	                dhis2.de.insertOptionSets();
@@ -1368,7 +1368,7 @@
         {
             $( '.indicator' ).attr( 'readonly', 'readonly' );
             $( '.dataelementtotal' ).attr( 'readonly', 'readonly' );
-            $( document ).trigger( dhis2.de.event.dataValuesLoaded );
+            $( document ).trigger( dhis2.de.event.dataValuesLoaded, dhis2.de.currentDataSetId );
         }
 	} );
 }
@@ -1525,7 +1525,7 @@
     dhis2.de.dataEntryFormIsLoaded = true;
     hideLoader();
     
-    $( document ).trigger( dhis2.de.event.formReady );
+    $( document ).trigger( dhis2.de.event.formReady, dhis2.de.currentDataSetId );
 }
 
 function valueFocus( e )
@@ -1643,7 +1643,7 @@
 	        type: 'post',
 	    	success: function( data, textStatus, xhr )
 	        {
-                $( document ).trigger( dhis2.de.event.completed, params );
+                $( document ).trigger( dhis2.de.event.completed, [ dhis2.de.currentDataSetId, params ] );
 	    		disableCompleteButton();
 	    		dhis2.de.storageManager.clearCompleteDataSet( params );
 	        },
@@ -1655,7 +1655,7 @@
 	        	}
 	        	else // Offline, keep local value
 	        	{
-                    $( document ).trigger( dhis2.de.event.completed, params );
+                    $( document ).trigger( dhis2.de.event.completed, [ dhis2.de.currentDataSetId, params ] );
 	        		disableCompleteButton();
 	        		setHeaderMessage( i18n_offline_notification );
 	        	}
@@ -1694,7 +1694,7 @@
     	type: 'delete',
     	success: function( data, textStatus, xhr )
         {
-          $( document ).trigger( dhis2.de.event.uncompleted );
+          $( document ).trigger( dhis2.de.event.uncompleted, dhis2.de.currentDataSetId );
           disableUndoButton();
           dhis2.de.storageManager.clearCompleteDataSet( params );
         },
@@ -1706,7 +1706,7 @@
         	}
         	else // Offline, keep local value
         	{
-                $( document ).trigger( dhis2.de.event.uncompleted );
+                $( document ).trigger( dhis2.de.event.uncompleted, dhis2.de.currentDataSetId );
         		disableUndoButton();
         		setHeaderMessage( i18n_offline_notification );
         	}
@@ -1828,11 +1828,11 @@
         
         if ( success )
         {
-        	$( document ).trigger( dhis2.de.event.validationSucces );
+        	$( document ).trigger( dhis2.de.event.validationSucces, dhis2.de.currentDataSetId );
         }
         else
     	{
-        	$( document ).trigger( dhis2.de.event.validationError );
+        	$( document ).trigger( dhis2.de.event.validationError, dhis2.de.currentDataSetId );
     	}
     } );
 }