← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6994: Added validation for jasper design

 

------------------------------------------------------------
revno: 6994
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-05-21 11:33:12 +0200
message:
  Added validation for jasper design
modified:
  dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addReportForm.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.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-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties	2012-05-08 15:55:59 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties	2012-05-21 09:33:12 +0000
@@ -212,4 +212,6 @@
 this_financial_year=This financial year
 last_financial_year=Last financial year
 last_5_financial_years=Last 5 financial years
-financial_yearly=Financial Yearly 
\ No newline at end of file
+financial_yearly=Financial Yearly
+please_specify_file=Please specify a design file
+jasper_design=Jasper design
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addReportForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addReportForm.vm	2011-11-10 18:46:58 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addReportForm.vm	2012-05-21 09:33:12 +0000
@@ -1,3 +1,6 @@
+<script type="text/javascript">
+	var i18n_please_specify_file = '$encoder.jsEscape( $i18n.getString( "please_specify_file" ) , "'")';
+</script>
 
 <h3>$i18n.getString( 'create_new_report' )</h3>
 
@@ -15,7 +18,7 @@
         <td><input type="text" id="name" name="name" style="width:95%" value="$!report.name"></td>
     </tr>
 	<tr>
-		<td><label for="upload">$i18n.getString( "design" )</label></td>
+		<td><label for="upload">$i18n.getString( "jasper_design" )</label></td>
 		<td><input type="file" id="upload" name="upload" size="35" /></td>
 	</tr>
 	<tr>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js	2011-11-10 18:46:58 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js	2012-05-21 09:33:12 +0000
@@ -1,5 +1,11 @@
 function addReport()
 {
+	if ( !hasText( "upload" ) )
+	{
+		setMessage( i18n_please_specify_file );
+		return false;
+	}
+	
 	$.postJSON( "validateReport.action", { id:$( "#id" ).val(), "name":$( "#name" ).val() }, function( json )
 	{
 		if ( json.response == "input" )