← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8984: local vn - Allow the user to print/download the output file after previewed

 

------------------------------------------------------------
revno: 8984
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-11-13 14:04:37 +0700
message:
  local vn - Allow the user to print/download the output file after previewed
modified:
  local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/generateReportForm.vm
  local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/export.js
  local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/preview.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 'local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/generateReportForm.vm'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/generateReportForm.vm	2012-10-02 04:32:52 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/generateReportForm.vm	2012-11-13 07:04:37 +0000
@@ -13,10 +13,6 @@
 
 <h3>$i18n.getString( "generate_export_report" ) #openHelp( "excelReportingExportReport" )</h3>
 
-<div id="showButtonDiv" style="display:none">
-	<input type="button" onclick="showExportDiv();" value="$i18n.getString( 'show_export_params' )"/>
-</div>
-
 <div id="exportReportDiv" class="inputCriteria" style="width:640px;height:300px">
 <table>	
 	<tr>
@@ -55,7 +51,8 @@
 	</tr>
 	<tr>
 		<td>
-			<select type="text" id="exportReport" name="exportReport" style="width:380px" size="8" onchange="reportSelected()"></select>
+			<select type="text" id="exportReport" name="exportReport" style="width:380px" size="8" onchange="reportSelected()"></select><br/>
+			<span id="elementSelect_loader" style="display:none;color:red" >$i18n.getString( "loading" )&nbsp;&nbsp;<img src="../images/ajax-loader-bar.gif" /></span>
 		</td>
 		<td id="periodCol">
 			<select type="text" id="selectedPeriodId" name="selectedPeriodId" style="width:220px" size="6" onchange="getRelativePeriods( this.value )"></select>
@@ -89,9 +86,9 @@
 <hr/>
 
 <p>
+	<input type="button" id="showButtonDiv" onclick="showExportDiv();" value="$i18n.getString( 'show_export_params' )" style="display:none"/>
 	<input type="button" id="previewButton" value='$i18n.getString( "preview_report" )' onclick="validatePreviewReport();" style="width:150px"/>
 	<input type="button" id="generateExportReport" value='$i18n.getString( "generate_export_report" )' onclick="validateGenerateReport();" style="width:150px"/>
-	<input type="button" id="printExcelReportButton" value='$i18n.getString("print")' onclick='printExportReport()' style="width:150px"/>
 </p>
 
 <div id="previewDiv"></div>
\ No newline at end of file

=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/export.js'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/export.js	2012-10-02 04:32:52 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/export.js	2012-11-13 07:04:37 +0000
@@ -33,6 +33,8 @@
 
 		if ( groupId )
 		{
+			showById( "elementSelect_loader" );
+		
 			jQuery.postJSON( 'getExportReportsByGroup.action',
 			{
 				group: groupId
@@ -44,6 +46,8 @@
 					addOptionById( 'exportReport', item.id + '_' + item.periodType + '_' + item.reportType, item.name );
 				});
 
+				hideById( "elementSelect_loader" );
+				
 				currentPeriodOffset = 0;
 
 				reportSelected();

=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/preview.js'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/preview.js	2012-11-02 04:42:01 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/preview.js	2012-11-13 07:04:37 +0000
@@ -14,6 +14,11 @@
 htmlStyle.push( ".ui-widget-content { border: 1px solid #a6c9e2; background: #fcfdfd url(images/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x; color: #222222; }" );
 htmlStyle.push( "</style>" );
 
+htmlPrintDownloadFunc = [ "<div align='right'>" ];
+htmlPrintDownloadFunc.push(	"<a href='javascript:printExportReport();' title='Print'>" );
+htmlPrintDownloadFunc.push( "<img src='../images/printer.png'/></a>&nbsp;&nbsp;" );
+htmlPrintDownloadFunc.push( "<a href='downloadFile.action' title='Download'><img src='images/download.png'/></a></div>" );
+
 // ----------------------------------------------------------------------
 // Methods
 // ----------------------------------------------------------------------
@@ -105,7 +110,7 @@
 	var _cols 		= "";
 	var _sheets		= parentElement.getElementsByTagName( 'sheet' );
 	var _sHTML		= [];
-	var tabsHTML 	= ['<div id="tabs"><ul>'];
+	var tabsHTML 	= [ htmlPrintDownloadFunc.join('') + '<div id="tabs"><ul>' ];
 
 	for (var s = 0 ; s < _sheets.length ; s ++)
 	{
@@ -187,6 +192,7 @@
 	}
 
 	tabsHTML.push( '</ul>', _sHTML.join(''), '</div>' );
+	tabsHTML.push( htmlPrintDownloadFunc.join('') );
 
 	jQuery( '#previewDiv' ).html( tabsHTML.join('') );
 	jQuery( '#tabs' ).tabs({ collapsible : true });