dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #07541
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2163: Form Validation Added in Physical Output Report Form and Fixed Bug in Data Set Lock Report
------------------------------------------------------------
revno: 2163
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: trunk
timestamp: Sat 2010-09-18 18:37:13 +0530
message:
Form Validation Added in Physical Output Report Form and Fixed Bug in Data Set Lock Report
modified:
local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/csreview/action/GenerateCSReviewReportResultAction.java
local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/physical/action/GeneratePhysicalReportResultAction.java
local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml
local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/csReviewReportFront.vm
local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/javascript/datasetLockReport.js
local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/physicalReportform.vm
--
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/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/csreview/action/GenerateCSReviewReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/csreview/action/GenerateCSReviewReportResultAction.java 2010-09-13 10:03:14 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/csreview/action/GenerateCSReviewReportResultAction.java 2010-09-18 13:07:13 +0000
@@ -461,7 +461,8 @@
outputReportWorkbook.close();
- fileName = reportFileNameTB.replace( ".xls", "" );
+ //fileName = reportFileNameTB.replace( ".xls", "" );
+ fileName = reportFileNameTB;
File outputReportFile = new File( outputReportPath );
inputStream = new BufferedInputStream( new FileInputStream( outputReportFile ) );
=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/physical/action/GeneratePhysicalReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/physical/action/GeneratePhysicalReportResultAction.java 2010-09-13 10:03:14 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/physical/action/GeneratePhysicalReportResultAction.java 2010-09-18 13:07:13 +0000
@@ -31,6 +31,7 @@
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
+import org.amplecode.quick.StatementManager;
import org.hisp.dhis.aggregation.AggregationService;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
@@ -70,6 +71,13 @@
// Dependencies
// -------------------------------------------------------------------------
+ private StatementManager statementManager;
+
+ public void setStatementManager( StatementManager statementManager )
+ {
+ this.statementManager = statementManager;
+ }
+
private DataSetService dataSetService;
public void setDataSetService( DataSetService dataSetService )
@@ -208,7 +216,7 @@
{
// Intialisation
-
+ statementManager.initialise();
deCodeType = new ArrayList<String>();
serviceType = new ArrayList<String>();
sheetList = new ArrayList<Integer>();
@@ -343,12 +351,15 @@
outputReportWorkbook.close();
fileName = reportFileNameTB.replace( ".xls", "" );
+ fileName += periodNameList + ".xls";
+ //fileName = reportFileNameTB;
File outputReportFile = new File( outputReportPath );
inputStream = new BufferedInputStream( new FileInputStream( outputReportFile ) );
System.out.println( "Report Generation End Time is : \t" + new Date() );
outputReportFile.deleteOnExit();
+ statementManager.destroy();
return SUCCESS;
}
=== modified file 'local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml 2010-09-18 12:30:36 +0000
+++ local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml 2010-09-18 13:07:13 +0000
@@ -1697,11 +1697,21 @@
</property>
</bean>
- <bean id="org.hisp.dhis.reports.physical.action.GeneratePhysicalReportResultAction"
- class="org.hisp.dhis.reports.physical.action.GeneratePhysicalReportResultAction" scope="prototype">
+ <bean id="org.hisp.dhis.reports.physical.action.GeneratePhysicalReportResultAction"
+ class="org.hisp.dhis.reports.physical.action.GeneratePhysicalReportResultAction" scope="prototype">
- <property name="reportService">
- <ref bean="statementManager"/></property>
+
+
+
+ <!--<property name="reportService">
+ <ref bean="statementManager"/></property>-->
+
+ <property name="statementManager" ref="statementManager">
+ </property>
+
+ <property name="reportService">
+ <ref bean="org.hisp.dhis.reports.ReportService"/>
+ </property>
<property name="dataSetService">
<ref bean="org.hisp.dhis.dataset.DataSetService"/>
@@ -1721,7 +1731,7 @@
<property name="dataValueService">
<ref bean="org.hisp.dhis.datavalue.DataValueService"/>
</property>
- <property name="currentUserService">
+ <property name="currentUserService">
<ref bean="org.hisp.dhis.user.CurrentUserService"/>
</property>
=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/csReviewReportFront.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/csReviewReportFront.vm 2010-09-13 10:03:14 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/csReviewReportFront.vm 2010-09-18 13:07:13 +0000
@@ -117,8 +117,9 @@
<td> </td>
</tr>
- <tr>
- <td><input type="submit" name="generate" value='Generate Report'/></td>
+ <tr>
+ <td><input type="submit" id= "generate" name="generate" title= "Generate report" value="$i18n.getString( "generate" )" style="width:6em" #if( $!reportList.size() == 0 ) disabled #end > </td>
+ <!-- <td><input type="submit" name="generate" value='Generate Report'/></td> -->
<td>
<!-- <input type="submit" name="generate" value='Generate Report'/>
<input type="hidden" name="autogen" id="autogen" value="0" >
=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/javascript/datasetLockReport.js'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/javascript/datasetLockReport.js 2010-09-15 08:50:45 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/javascript/datasetLockReport.js 2010-09-18 13:07:13 +0000
@@ -23,16 +23,18 @@
document.reportForm.ouNameTB.value=element[0].getElementsByTagName("OugUnitName")[0].firstChild.nodeValue;
}
-function getAllPeriods() {
- var periodTypeList = document.getElementById("periodTypeId");
- var periodTypeId = periodTypeList.options[periodTypeList.selectedIndex].value;
-
- if (periodTypeId != null) {
- var url = "getPeriodsForLock.action?name=" + periodTypeId;
- $.ajax( {
- url :url,
- cache :false,
- success : function(response) {
+
+
+//function getAllPeriods() {
+ //var periodTypeList = document.getElementById("periodTypeId");
+// var periodTypeId = periodTypeList.options[periodTypeList.selectedIndex].value;
+
+// if (periodTypeId != null) {
+ // var url = "getPeriodsForLock.action?name=" + periodTypeId;
+ // $.ajax( {
+ // url :url,
+ // cache :false,
+ // success : function(response) {
/* dom = parseXML(response);
$('#periodIds >option').remove();
$(dom).find('period').each(
@@ -45,15 +47,17 @@
});
enable("periodIds"); */
- getAllPeriodsReceived( response );
+ // getAllPeriodsReceived( response );
- getDataSets();
- }
- });
- }
-}
-
-
+ // getDataSets();
+ // }
+ // });
+ //}
+//}
+
+
+
+/*
function getAllPeriodsReceived(xmlObject) {
var periodList = byId("periodIds");
@@ -70,9 +74,32 @@
option.text = name;
reportsList.add(option, null); */
- $("#periodIds").append("<option value='"+ id +"'>" + name + "</option>");
- }
- $("#periodIds").attr('disabled', false);
+ // $("#periodIds").append("<option value='"+ id +"'>" + name + "</option>");
+ //}
+ //$("#periodIds").attr('disabled', false);
+//}
+
+// Functions for get availabe periods
+function getAllPeriods() {
+ var periodTypeList = document.getElementById( "periodTypeId" );
+ var periodTypeId = periodTypeList.options[ periodTypeList.selectedIndex ].value;
+
+ if ( periodTypeId != null ) {
+ var url = "getPeriodsForLock.action?name=" + periodTypeId;
+ $.ajax({
+ url: url,
+ cache: false,
+ success: function(response){
+ dom = parseXML(response);
+ $( '#periodIds >option' ).remove();
+ $(dom).find('period').each(function(){
+ $('#periodIds').append("<option value="+$(this).find('id').text()+">" +$(this).find('name').text()+ "</option>");
+ });
+ enable( "periodIds" );
+ getDataSets();
+ }
+ });
+ }
}
@@ -87,6 +114,7 @@
throw new Error('No XML parser available');
}
+// functions for get all corresponding dataSets
function getDataSets() {
var periodTypeList = document.getElementById("periodTypeId");
var periodType = periodTypeList.options[periodTypeList.selectedIndex].value;
=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/physicalReportform.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/physicalReportform.vm 2010-09-13 10:03:14 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/physicalReportform.vm 2010-09-18 13:07:13 +0000
@@ -53,16 +53,17 @@
<td> </td>
</tr>
<tr>
- <td>
- <input type="submit" id="Generate" name ="Generate" title= "Generate report" value="$i18n.getString( "generate" )" style="width:6em" disable="false">
+
+ <!-- <input type="submit" id="Generate" name ="Generate" title= "Generate report" value="$i18n.getString( "generate" )" style="width:6em" disable="false"> -->
+ <td><input type="submit" id= "generate" name="generate" title= "Generate report" value="$i18n.getString( "generate" )" style="width:6em" #if( $!reportList.size() == 0 ) disabled #end >
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="hidden" name="reportModelTB" id="reportModelTB">
- <input type="hidden" name="reportFileNameTB" id="reportFileNameTB">
- <input type="hidden" name="reportListFileNameTB" id="reportListFileNameTB" value="">
+ <input type="hidden" name="reportFileNameTB" id="reportFileNameTB">
+ <input type="hidden" name="reportListFileNameTB" id="reportListFileNameTB" value="">
</td>
</tr>
</table>