← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10238: Check validate before to save report as favorite in Tabular report.

 

------------------------------------------------------------
revno: 10238
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-03-15 13:11:20 +0700
message:
  Check validate before to save report as favorite in Tabular report.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.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/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2013-03-14 15:42:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2013-03-15 06:11:20 +0000
@@ -1002,6 +1002,15 @@
 				
 				caseBasedReport:{
 					create: function(fn, isupdate) {
+						// Validation
+						
+						if( !TR.state.caseBasedReport.validation.objects() )
+						{
+							return;
+						}
+						
+						// Save favorite
+						
 						TR.util.mask.showMask(TR.cmp.caseBasedFavorite.window, TR.i18n.saving + '...');
 						var p = TR.state.caseBasedReport.getParams(false);
 						p.name = TR.cmp.caseBasedFavorite.name.getValue();
@@ -1170,6 +1179,15 @@
 				
 				aggregateReport:{
 					create: function(fn, isupdate) {
+						// Validation
+						
+						if( !TR.state.aggregateReport.validation.objects() )
+						{
+							return;
+						}
+						
+						// Save favorite
+						
 						TR.util.mask.showMask(TR.cmp.aggregateFavorite.window, TR.i18n.saving + '...');
 						var p = TR.state.getParams();
 						p.name = TR.cmp.aggregateFavorite.name.getValue();