dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30649
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15574: trigger event when a dataset is completed/uncompleted in dataentry
------------------------------------------------------------
revno: 15574
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-06-06 15:28:07 +0200
message:
trigger event when a dataset is completed/uncompleted in dataentry
modified:
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/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2014-06-02 15:29:13 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2014-06-06 13:28:07 +0000
@@ -1615,9 +1615,11 @@
if ( !confirm( i18n_confirm_complete ) )
{
return false;
- }
+ }
- validate( true, function() {
+ $( document ).trigger('dhis2.de.event.completed');
+
+ validate( true, function() {
var params = dhis2.de.storageManager.getCurrentCompleteDataSetParams();
var cc = dhis2.de.getCurrentCategoryCombo();
@@ -1638,6 +1640,7 @@
type: 'post',
success: function( data, textStatus, xhr )
{
+ $( document ).trigger('dhis2.de.event.completed');
disableCompleteButton();
dhis2.de.storageManager.clearCompleteDataSet( params );
},
@@ -1663,7 +1666,7 @@
{
return false;
}
-
+
var params = dhis2.de.storageManager.getCurrentCompleteDataSetParams();
var cc = dhis2.de.getCurrentCategoryCombo();
@@ -1687,8 +1690,9 @@
type: 'delete',
success: function( data, textStatus, xhr )
{
- disableUndoButton();
- dhis2.de.storageManager.clearCompleteDataSet( params );
+ $( document ).trigger('dhis2.de.event.uncompleted');
+ disableUndoButton();
+ dhis2.de.storageManager.clearCompleteDataSet( params );
},
error: function( xhr, textStatus, errorThrown )
{