dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #02182
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 750: Update Excel report module
------------------------------------------------------------
revno: 750
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Mon 2009-09-21 14:40:48 +0700
message:
Update Excel report module
modified:
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/GetInformationAction.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/ImportDataAction.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/ViewDataAction.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/item/action/AddReportExcelItemAction.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/addDataStatus.vm
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompleteReportSelect.vm
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataElementGroup.js
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataSetCompleted.js
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/imports.js
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataElementGroup.vm
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataStatus.vm
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/menu.vm
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reportItems.vm
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/responseReportItemValues.vm
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/style/basic.css
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/updateDataStatus.vm
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/viewAdministrator.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 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/GetInformationAction.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/GetInformationAction.java 2009-09-15 04:00:03 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/GetInformationAction.java 2009-09-21 07:40:48 +0000
@@ -62,7 +62,7 @@
}
// -------------------------------------------------------------
- // Getter and Setter
+ // Getters and Setters
// -------------------------------------------------------------
private OrganisationUnit organisationUnit;
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/ImportDataAction.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/ImportDataAction.java 2009-09-17 07:12:56 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/ImportDataAction.java 2009-09-21 07:40:48 +0000
@@ -56,8 +56,6 @@
import org.hisp.dhis.reportexcel.action.ActionSupport;
import org.hisp.dhis.reportexcel.utils.ExcelUtils;
-;
-
/**
* @author Chau Thu Tran
* @version $Id
@@ -77,13 +75,6 @@
this.dataValueService = dataValueService;
}
- private ReportExcelService reportExcelService;
-
- public void setReportExcelService( ReportExcelService reportExcelService )
- {
- this.reportExcelService = reportExcelService;
- }
-
private OrganisationUnitSelectionManager organisationUnitSelectionManager;
public void setOrganisationUnitSelectionManager( OrganisationUnitSelectionManager organisationUnitSelectionManager )
@@ -127,8 +118,15 @@
this.periodService = periodService;
}
+ private ReportExcelService reportExcelService;
+
+ public void setReportExcelService( ReportExcelService reportExcelService )
+ {
+ this.reportExcelService = reportExcelService;
+ }
+
// --------------------------------------------------------------------
- // Getter and Setter
+ // Getters and Setters
// --------------------------------------------------------------------
private Integer reportId;
@@ -166,7 +164,7 @@
public String execute()
throws Exception
{
- ReportExcel report = reportExcelService.getReportExcel( reportId );
+ ReportExcel report = reportExcelService.getReportExcel( reportId.intValue() );
OrganisationUnit organisationUnit = organisationUnitSelectionManager.getSelectedOrganisationUnit();
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/ViewDataAction.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/ViewDataAction.java 2009-09-15 12:54:35 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/ViewDataAction.java 2009-09-21 07:40:48 +0000
@@ -54,9 +54,9 @@
implements Action
{
// --------------------------------------------------------------------
- // Dependencies
+ // Dependency
// --------------------------------------------------------------------
-
+
private ReportExcelService reportExcelService;
public void setReportExcelService( ReportExcelService reportExcelService )
@@ -105,7 +105,7 @@
Workbook templateWorkbook = Workbook.getWorkbook( upload, ws );
Collection<ReportExcelItem> reportItems = report.getReportExcelItems();
-
+ System.out.println( "reportItems : " + reportItems.size() );
Sheet sheet = templateWorkbook.getSheet( 0 );
reportItemValues = new ArrayList<ReportExcelItemValue>();
@@ -116,13 +116,16 @@
{
String value = ExcelUtils.readValue( reportItem.getRow(), reportItem.getColumn(), sheet );
- if ( value.length() > 0 )
+ ReportExcelItemValue reportItemvalue = new ReportExcelItemValue( reportItem, value );
+
+ if ( value.length() == 0 )
{
- ReportExcelItemValue reportItemvalue = new ReportExcelItemValue( reportItem, value );
-
- reportItemValues.add( reportItemvalue );
+ reportItemvalue.setValue( 0 + "" );
}
+
+ reportItemValues.add( reportItemvalue );
}
+
}
return SUCCESS;
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/item/action/AddReportExcelItemAction.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/item/action/AddReportExcelItemAction.java 2009-09-15 04:00:03 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/item/action/AddReportExcelItemAction.java 2009-09-21 07:40:48 +0000
@@ -142,10 +142,10 @@
ReportExcel reportExcel = reportService.getReportExcel( reportId );
- Set<ReportExcelItem> reportItems = reportExcel.getReportExcelItems();
-
+ Set<ReportExcelItem> reportItems = reportExcel.getReportExcelItems();
+
reportItems.add( reportItem );
-
+
reportExcel.setReportExcelItems( reportItems );
reportService.updateReportExcel( reportExcel );
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2009-09-18 07:09:19 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2009-09-21 07:40:48 +0000
@@ -184,7 +184,7 @@
<property name="reportService" ref="org.hisp.dhis.reportexcel.ReportExcelService" />
<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
</bean>
-
+
<bean
id="org.hisp.dhis.reportexcel.category.action.UpdateSortedDataElementGroupOrderAction"
class="org.hisp.dhis.reportexcel.category.action.UpdateSortedDataElementGroupOrderAction"
@@ -293,11 +293,11 @@
</bean>
<bean
- id="org.hisp.dhis.reportexcel.importing.action.action.ImportDataAction"
- class="org.hisp.dhis.reportexcel.importing.action.action.ImportDataAction"
+ id="org.hisp.dhis.reportexcel.importing.action.ImportDataAction"
+ class="org.hisp.dhis.reportexcel.importing.action.ImportDataAction"
scope="prototype">
+ <property name="reportExcelService" ref="org.hisp.dhis.reportexcel.ReportExcelService" />
<property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService" />
- <property name="reportExcelService" ref="org.hisp.dhis.reportexcel.ReportExcelService" />
<property name="organisationUnitSelectionManager"
ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
<property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
@@ -318,6 +318,12 @@
ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
</bean>
+ <bean id="org.hisp.dhis.reportexcel.importing.action.ViewDataAction"
+ class="org.hisp.dhis.reportexcel.importing.action.ViewDataAction"
+ scope="prototype">
+ <property name="reportExcelService" ref="org.hisp.dhis.reportexcel.ReportExcelService" />
+ </bean>
+
<!-- EXPORT REPORT EXCEL -->
<bean id="org.hisp.dhis.reportexcel.export.action.SelectFormAction"
@@ -423,7 +429,7 @@
<property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
</bean>
-
+
<bean
id="org.hisp.dhis.reportexcel.export.action.GenerateReportExcelPeriodColumnListingAction"
class="org.hisp.dhis.reportexcel.export.action.GenerateReportExcelPeriodColumnListingAction"
@@ -490,7 +496,8 @@
<property name="reportService" ref="org.hisp.dhis.reportexcel.ReportExcelService" />
</bean>
- <bean id="org.hisp.dhis.reportexcel.dataentrystatus.action.DefaultDataEntryStatusAction"
+ <bean
+ id="org.hisp.dhis.reportexcel.dataentrystatus.action.DefaultDataEntryStatusAction"
class="org.hisp.dhis.reportexcel.dataentrystatus.action.DefaultDataEntryStatusAction"
scope="prototype">
<property name="reportService" ref="org.hisp.dhis.reportexcel.ReportExcelService" />
@@ -514,10 +521,11 @@
ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
</bean>
-
+
<!-- DATA SET COMPLETED BEAN -->
-
- <bean id="org.hisp.dhis.reportexcel.datasetcompleted.action.SelectParamsAction"
+
+ <bean
+ id="org.hisp.dhis.reportexcel.datasetcompleted.action.SelectParamsAction"
class="org.hisp.dhis.reportexcel.datasetcompleted.action.SelectParamsAction"
scope="prototype">
<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
@@ -559,5 +567,4 @@
ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
</bean>
-
</beans>
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties 2009-09-18 07:09:19 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties 2009-09-21 07:40:48 +0000
@@ -119,8 +119,11 @@
dataelement_code = Data Element Code
available_dataelementgroups = Available Data Element Groups
selected_dataelementgroups = Selected Data Element Groups
+success = success
+selected_dataelementgroups = Selected Data Element Groups
view_by = View by
preview = Preview
code = Code
update_order = Update Order Sorted
-sort_order_help = Use mouse drap emlement that you want set order and click on Update Order Sorted
\ No newline at end of file
+sort_order_help = Use mouse drap emlement that you want set order and click on Update Order Sorted>>>>>>> MERGE-SOURCE
+select = [Select]
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties 2009-09-18 07:09:19 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties 2009-09-21 07:40:48 +0000
@@ -140,7 +140,10 @@
dataelement_code = M\u00e3 ph\u1ea7n t\u1eed d\u1eef li\u1ec7u
available_dataelementgroups = Nh\u00f3m ph\u1ea7n t\u1eed d\u1eef li\u1ec7u
selected_dataelementgroups = Nh\u00f3m ph\u1ea7n t\u1eed d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c ch\u1ecdn
+success = th\u00e0nh c\u00f4ng
+selected_dataelementgroups = Nh\u00f3m ph\u1ea7n t\u1eed d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c ch\u1ecdn
preview = Xem tr\u01b0\u1edbc
code = M\u00e3 s\u1ed1
update_order = C\u1eadp nh\u1eadt th\u1ee9 t\u1ef1
-sort_order_help = D\u00f9ng chu\u1ed9t k\u00e9o m\u1ee5c mu\u1ed1n s\u1eafp x\u1ebfp t\u1edbi v\u1ecb tr\u00ed c\u1ea7n thi\u1ebft, sau \u0111\u00f3 ch\u1ecdn C\u1eadp nh\u1eadt th\u1ee9 t\u1ef1
\ No newline at end of file
+sort_order_help = D\u00f9ng chu\u1ed9t k\u00e9o m\u1ee5c mu\u1ed1n s\u1eafp x\u1ebfp t\u1edbi v\u1ecb tr\u00ed c\u1ea7n thi\u1ebft, sau \u0111\u00f3 ch\u1ecdn C\u1eadp nh\u1eadt th\u1ee9 t\u1ef1>>>>>>> MERGE-SOURCE
+select = [Ch\u1ecdn]
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/addDataStatus.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/addDataStatus.vm 2009-09-17 15:02:10 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/addDataStatus.vm 2009-09-21 07:40:48 +0000
@@ -17,13 +17,13 @@
<tr>
<td colspan=2 align=center>
<input type="button" value="$i18n.getString( 'ok' )" style="width:100px" onclick="addDataStatus()"/>
- <input type="button" value="$i18n.getString( 'cancel' )" style="width:100px" onclick="window.location = 'listDataEntryStatus.action'"/>
+ <input type="button" value="$i18n.getString( 'cancel' )" style="width:100px" onclick="window.location = 'listDataStatus.action'"/>
</td>
</tr>
</table>
<script language="javascript">
function addDataStatus(){
- window.location = 'addDataEntryStatus.action?dataSetId=' + getFieldValue('dataSetId') + "&makeDefault=" + document.getElementById('makeDefault').checked;
+ window.location = 'addDataStatus.action?dataSetId=' + getFieldValue('dataSetId') + "&makeDefault=" + document.getElementById('makeDefault').checked;
}
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompleteReportSelect.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompleteReportSelect.vm 2009-09-18 07:09:19 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompleteReportSelect.vm 2009-09-21 07:40:48 +0000
@@ -2,10 +2,10 @@
<table>
<tr>
<td><label>$i18n.getString('organisation')<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td width="25em"><input type="text" id="organisation" value="$!organisationUnit.name" #if(!$organisationUnit) disabled #end style="width:20em"></td>
+ <td width="25em"><input type="text" id="organisation" value="$!organisationUnit.name" style="width:20em"></td>
<td>
<label>$i18n.getString('view_by')</label>
- <select type="text" id="viewby" name="viewBy" style="min-width:20em" onchange="changeViewBy()" #if(!$organisationUnit) disabled #end>
+ <select type="text" id="viewby" name="viewBy" style="min-width:20em" onchange="changeViewBy()">
<option value="period">$i18n.getString('period')</period>
<option value="dataset">$i18n.getString('dataset')</period>
</select>
@@ -14,7 +14,7 @@
<tr>
<td><label>$i18n.getString('period_type')<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td>
- <select type="text" id="periodType" name="periodType" style="min-width:20em" onchange="getDataSetAndPeriod()" #if(!$organisationUnit) disabled #end>
+ <select type="text" id="periodType" name="periodType" style="min-width:20em" onchange="getDataSetAndPeriod()">
#foreach($periodType in $periodTypes)
<option value='$periodType.name'>$i18n.getString( $periodType.name )</option>
#end
@@ -28,21 +28,21 @@
<tr>
<th>$i18n.getString('dataset')</th>
<th></th>
- <th>$i18n.getString('selected_dataset')</th>
+ <th>$i18n.getString('selectd_dataset')</th>
</tr>
<tr>
<td>
- <select type="text" size=10 id="dataSet" #if(!$organisationUnit) disabled #end name="dataSets" style="min-width:20em" ondblclick="moveSelectedById('dataSet','selectedDataSets')">
+ <select type="text" size=10 id="dataSet" name="dataSets" style="min-width:20em" ondblclick="moveSelectedById('dataSet','selectedDataSets')">
</select>
</td>
<td>
- <input type="button" value=" > " onclick="moveSelectedById('dataSet','selectedDataSets');" #if(!$organisationUnit) disabled #end/><br>
- <input type="button" value=" < " onclick="moveSelectedById('selectedDataSets','dataSet');" #if(!$organisationUnit) disabled #end/>
+ <input type="button" value=" > " onclick="moveSelectedById('dataSet','selectedDataSets');"/><br>
+ <input type="button" value=" < " onclick="moveSelectedById('selectedDataSets','dataSet');"/>
</td>
<td>
- <select type="text" size=10 id="selectedDataSets" #if(!$organisationUnit) disabled #end name="selectedDataSets" style="min-width:20em" ondblclick="moveSelectedById('selectedDataSets','dataSet')">
+ <select type="text" size=10 id="selectedDataSets" name="selectedDataSets" style="min-width:20em" ondblclick="moveSelectedById('selectedDataSets','dataSet')">
</select>
</td>
@@ -57,26 +57,26 @@
<tr>
<td>
- <select type="text" id="period" #if(!$organisationUnit) disabled #end name="periods" style="min-width:20em" size=10 ondblclick="moveSelectedById('period','selectedPeriods');">
+ <select type="text" id="period" name="periods" style="min-width:20em" size=10 ondblclick="moveSelectedById('period','selectedPeriods');">
</select>
</td>
<td>
- <input type="button" value=" > " onclick="moveSelectedById('period','selectedPeriods');" #if(!$organisationUnit) disabled #end/><br>
- <input type="button" value=" < " onclick="moveSelectedById('selectedPeriods','period');" #if(!$organisationUnit) disabled #end/>
+ <input type="button" value=" > " onclick="moveSelectedById('period','selectedPeriods');"/><br>
+ <input type="button" value=" < " onclick="moveSelectedById('selectedPeriods','period');"/>
</td>
<td>
- <select type="text" id="selectedPeriods" name="selectedPeriods" style="min-width:20em" #if(!$organisationUnit) disabled #end size=10 ondblclick="moveSelectedById('selectedPeriods','period');">
+ <select type="text" id="selectedPeriods" name="selectedPeriods" style="min-width:20em" size=10 ondblclick="moveSelectedById('selectedPeriods','period');">
</select>
</td>
</tr>
</table>
<hr>
-<p><input id="viewButton" type="button" value="$i18n.getString('view')" onclick="viewDataSetCompleted();" #if(!$organisationUnit) disabled #end/><p>
+<p><input id="viewButton" type="button" value="$i18n.getString('view')" onclick="viewDataSetCompleted();"/><p>
<script>
- function viewDataSetCompleted(){
-
+ function viewDataSetCompleted(){
+ //var request = new Request();
var params = "viewBy=" + byId('viewby').value;
var selectedDataSets = document.getElementById( 'selectedDataSets' );
@@ -91,15 +91,22 @@
for ( var i = 0; i < selectedPeriods.options.length; ++i)
{
params += '&selectedPeriods=' + selectedPeriods.options[i].value;
- }
-
+ }
+
+ //request.sendAsPost( params );
+ //request.setResponseTypeXML( 'xmlObject' );
+ //request.setCallbackSuccess( viewDataSetCompletedReceived );
+ //request.send( "viewDataSetCompleted.action" );
var url = "viewDataSetCompleted.action?"+params;
window.open( url , '_blank', 'width='+document.documentElement.clientWidth+',height='+document.documentElement.clientHeight+',scrollbars=yes' );
}
function organisationUnitSelected( orgUnits )
{
- window.location.reload();
+ var request = new Request();
+ request.setResponseTypeXML( 'xmlObject' );
+ request.setCallbackSuccess(organisationUnitSelectedCompleted );
+ request.send( 'getOrganisationUnit.action');
}
function organisationUnitSelectedCompleted(xmlObject){
if(xmlObject.getAttribute('null')=='true'){
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataElementGroup.js'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataElementGroup.js 2009-09-18 07:09:19 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataElementGroup.js 2009-09-21 07:40:48 +0000
@@ -121,17 +121,3 @@
},'xml');
}
-/*
-* Update data element group order
-*/
-
-function updateDataElementGroupOrder(){
- var dataElements = document.getElementsByName('dataElementGroupOrder');
- var url = "updateSortDataElementGroupOrder.action?reportId=" + reportId;
- for(var i=0;i<dataElements.length;i++){
- url += "&dataElementGroupOrderId=" + dataElements.item(i).value;
- }
- window.location = url;
-
-}
-
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataSetCompleted.js'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataSetCompleted.js 2009-09-18 07:09:19 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataSetCompleted.js 2009-09-21 07:40:48 +0000
@@ -1,3 +1,5 @@
+
+
function changeViewBy(){
if(byId('viewby').value=='period'){
byId('period').multiple = true;
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/imports.js'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/imports.js 2009-09-14 03:19:36 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/imports.js 2009-09-21 07:40:48 +0000
@@ -70,4 +70,116 @@
var name = node.getElementsByTagName('name')[0].firstChild.nodeValue;
addOption('period', name, id);
}
-}
\ No newline at end of file
+}
+
+// -----------------------------------------------------------------------------
+// Import data
+// -----------------------------------------------------------------------------
+function importData(){
+
+ var reportId = document.getElementById('reportId').value;
+ var upload = document.getElementById('uploadFileName').value;
+ var periodId = document.getElementById('periodId').value;
+
+ var request = new Request();
+ request.setResponseTypeXML( 'xmlObject' );
+ request.setCallbackSuccess( Completed );
+
+ // URL
+ url = 'importData.action?reportId='+reportId;
+ // USER choose reportItem
+ var preview = byId('showValue').style.display;
+
+ if(preview == 'block'){
+
+ var reportItems = document.getElementsByName('reportItems');
+ for(var i=0;i<reportItems.length;i++){
+ if(reportItems[i].checked ){
+ url +='&reportItemIds=' + reportItems[i].value;
+ }
+ }
+ }
+
+ url += '&uploadFileName='+ upload;
+ url += '&periodId='+ periodId;
+ request.send(url);
+}
+
+function Completed( xmlObject ){
+
+ if(document.getElementById('message') != null){
+ document.getElementById('message').style.display = 'block';
+ document.getElementById('message').innerHTML = xmlObject.firstChild.nodeValue;
+ }
+}
+
+function getPreviewImportData(){
+
+ var request = new Request();
+
+ request.setResponseTypeXML( 'xmlObject' );
+
+ request.setCallbackSuccess( getReportItemValuesReceived );
+
+ var reportId = byId("reportId").value;
+
+ var uploadFileName = byId("uploadFileName").value;
+
+ request.send( "previewData.action?reportId=" + reportId +"&uploadFileName=" + uploadFileName);
+}
+
+function getReportItemValuesReceived( xmlObject ){
+
+ byId('selectAll').checked = false;
+ var availableDiv = byId('showValue');
+ availableDiv.style.display = 'block';
+
+ var availableObjectList = xmlObject.getElementsByTagName('reportItemValue');
+
+ var myTable = document.getElementById('showReportItemValues');
+ var tBody = myTable.getElementsByTagName('tbody')[0];
+
+ for(var i = document.getElementById("showReportItemValues").rows.length; i > 1;i--)
+ {
+ document.getElementById("showReportItemValues").deleteRow(i -1);
+ }
+
+ for(var i=0;i<availableObjectList.length;i++){
+
+ // get values
+ var reportItermValue = availableObjectList.item(i);
+ // add new row
+ var newTR = document.createElement('tr');
+ // create new column
+ var newTD2 = document.createElement('td');
+ newTD2.innerHTML = reportItermValue.getElementsByTagName('name')[0].firstChild.nodeValue;
+ // create new column
+ var newTD3 = document.createElement('td');
+ var value = reportItermValue.getElementsByTagName('value')[0].firstChild.nodeValue;
+ newTD3.innerHTML = value;
+ // create new column
+ var newTD1 = document.createElement('td');
+ var id = reportItermValue.getElementsByTagName('id')[0].firstChild.nodeValue;
+ if(value!=0){
+ newTD1.innerHTML= "<input type='checkbox' name='reportItems' id='reportItems' value='" + id + "'>" ;
+ }
+
+ newTR.appendChild (newTD1);
+ newTR.appendChild (newTD2);
+ newTR.appendChild (newTD3);
+ // add row into the table
+ tBody.appendChild(newTR);
+ }
+}
+
+function selectAll(){
+
+ var select = byId('selectAll').checked;
+
+ var reportItems = document.getElementsByName('reportItems');
+
+ for(var i=0;i<reportItems.length;i++){
+ reportItems[i].checked = select;
+ }
+ }
+
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataElementGroup.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataElementGroup.vm 2009-09-18 07:12:42 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataElementGroup.vm 2009-09-21 07:40:48 +0000
@@ -1,42 +1,28 @@
<h2>$i18n.getString('dataelement_groups')</h2>
-<p></p>
-<table width="800px">
+<p><input type="button" onclick="openAddDataElementGroupOrder()" value="$i18n.getString('add')" style="width:100px"/>
+<input type="button" value="$i18n.getString( "cancel" )" onclick="window.location='listReportExcel.action'" style="width:100px"></p>
+<table width="100%">
<tr>
- <td colspan=2>
- <input type="button" onclick="openAddDataElementGroupOrder()" value="$i18n.getString('add')" style="width:100px"/>
- <input type="button" value="$i18n.getString( "cancel" )" onclick="window.location='listReportExcel.action'" style="width:100px">
- </td>
- <td width="100px">
- <input type="button" value="$i18n.getString( "update_order" )" onclick="updateDataElementGroupOrder()" style="width:150px">
- </td>
+ <th>$i18n.getString('name')</th>
+ <th width="200px">$i18n.getString('operations')</th>
</tr>
- <tr>
- <th>$i18n.getString('name')</th>
- <th width="100px">$i18n.getString('code')</th>
- <th width="100px">$i18n.getString('operations')</th>
- </tr>
+ #set( $mark = false )
+ #foreach($group in $report.dataElementOrders)
+ <tr #alternate( $mark )>
+ <td>$encoder.htmlEncode( $group.name )</td>
+ <td align="left">
+ <a href="javascript:deleteDataElementOrder('$group.id');" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
+ <a href="javascript:openUpdateDataElementOrder( '$group.id' );" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
+ <a href="openSortDataElement.action?id=$group.id" title="$i18n.getString( 'sort_dataelement' )"><img src="../images/sort.png" border="1px"/></a>
+ </td>
+ </tr>
+ #if( $mark )
+ #set( $mark = false )
+ #else
+ #set( $mark = true )
+ #end
+ #end
</table>
-
-
-<ul id="sortable">
-#foreach($group in $report.dataElementOrders)
- <li class="ui-state-default" name="dataElementGroupOrder" value="$group.id" title="$i18n.getString( 'sort_order_help' )">
- <table cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td>$encoder.htmlEncode( $group.name )</td>
- <td width="100px">$encoder.htmlEncode( $group.code )</td>
- <td width="100px">
- <a href="javascript:deleteDataElementOrder('$group.id');" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- <a href="javascript:openUpdateDataElementOrder( '$group.id' );" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <a href="openSortDataElement.action?id=$group.id" title="$i18n.getString( 'sort_dataelement' )"><img src="../images/sort.png" border="1px"/></a>
- </td>
- </tr>
- </table>
-
- </li>
-#end
-</ul>
-
<form name="dataElementGroups" method="post">
<input type="hidden" name="id" value="$report.id"/>
<input type="hidden" name="dataElementGroupOrderId" id="dataElementGroupOrderId"/>
@@ -89,13 +75,5 @@
var i18n_confirm_delete = '$encoder.jsEscape($i18n.getString( 'confirm_delete' ) , "'")';
var i18n_name_is_null = '$encoder.jsEscape($i18n.getString( 'i18n_name_is_null' ) , "'")';
var reportId = $report.id;
- $(function() {
- $("#sortable").sortable({
- placeholder: 'ui-state-highlight'
- });
- $("#sortable").disableSelection();
-
- });
</script>
-
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataStatus.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataStatus.vm 2009-09-17 15:02:10 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataStatus.vm 2009-09-21 07:40:48 +0000
@@ -1,7 +1,7 @@
<h2>$i18n.getString( "data_status" )</h2>
<table width="100%">
<tr><td align="right">
- <input type="button" value="$i18n.getString( 'add' )" style="width:100px" onclick="window.location='openAddDataEntryStatus.action'"/>
+ <input type="button" value="$i18n.getString( 'add' )" style="width:100px" onclick="window.location='openAddDataStatus.action'"/>
</td></tr>
</table>
<table width="100%">
@@ -15,11 +15,11 @@
<tr #alternate( $mark )>
<td>$ds.dataSet.name</td>
<td>
- <input type="checkbox" #if($ds.makeDefault) checked=true #end disabled=true/>
+ <input type="checkbox" #if($ds.frontPage) checked=true #end disabled=true/>
</td>
<td>
<a href="javascript:deleteDataStatus('$ds.id');" title="$i18n.getString( 'delete' )"><img src="../images/delete.png" alt="$i18n.getString( 'delete' )"></a>
- <a href="openUpdateDataEntryStatus.action?id=$ds.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
+ <a href="openUpdateDataStatus.action?id=$ds.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
</td>
</tr>
#if( $mark )
@@ -35,7 +35,7 @@
function deleteDataStatus( id ){
if(window.confirm(i18n_confirm_delete)){
- window.location = "deleteDataEntryStatus.action?dataStatusId=" + id;
+ window.location = "deleteDataStatus.action?dataStatusId=" + id;
}
}
</script>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/menu.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/menu.vm 2009-09-18 07:09:19 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/menu.vm 2009-09-21 07:40:48 +0000
@@ -1,12 +1,12 @@
-<h2><a href="administration.action">$i18n.getString( "administration" ) </a></h2>
-
-<h2><a href="selectExportReportParam.action">$i18n.getString( "generate_report" ) </a></h2>
+<h2>$i18n.getString( "report_design" )</h2>
+<ul>
+ <li><a href="administration.action">$i18n.getString( "administration" ) </a></li>
+</ul>
+<h2>$i18n.getString( "generate_report" )</h2>
<ul>
<li><a href="selectExportReportParam.action">$i18n.getString( "generate_report" ) </a></li>
<li><a href="getInformation.action">$i18n.getString( "import_excel_file_manager" ) </a></li>
<li><a href="selectDataSetCompletedReport.action">$i18n.getString( "dataset_completed_report" ) </a></li>
- <li><a href="viewDataEntryStatus.action">$i18n.getString( "data_status" )</a></li>
-
</ul>
<script type="text/javascript">
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reportItems.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reportItems.vm 2009-09-18 07:09:19 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reportItems.vm 2009-09-21 07:40:48 +0000
@@ -88,10 +88,6 @@
<option value='indicator'>$i18n.getString('indicator')</option>
<option value='serial'>$i18n.getString('serial')</option>
#end
- #if ($!reportExcel.isPeriodColumnListing())
- <option value='dataelement'>$i18n.getString('dataelement')</option>
- <option value='indicator'>$i18n.getString('indicator')</option>
- #end
</select>
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/responseReportItemValues.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/responseReportItemValues.vm 2009-09-15 04:00:03 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/responseReportItemValues.vm 2009-09-21 07:40:48 +0000
@@ -2,8 +2,8 @@
<reportItemValues>
#foreach($reportItemValue in $reportItemValues)
<reportItemValue>
- <id>$encoder.xmlEncode($reportItemValue.reportItem.id)</id>
- <name>$encoder.xmlEncode($reportItemValue.reportItem.name)</name>
+ <id>$encoder.xmlEncode($!reportItemValue.reportExcelItem.id)</id>
+ <name>$encoder.xmlEncode($!reportItemValue.reportExcelItem.name)</name>
<value>$reportItemValue.value</value>
</reportItemValue>
#end
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/style/basic.css'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/style/basic.css 2009-09-18 07:09:19 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/style/basic.css 2009-09-21 07:40:48 +0000
@@ -1,5 +1,5 @@
-#sortable { list-style-type: none; margin: 0; padding: 0; width: 800px; }
-#sortable li { margin: 0 1px 1px 1px; padding: 1px; padding-left: 1.5em; font-size: 12pt;cursor:pointer }
+#sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
+#sortable li { margin: 0 1px 1px 1px; padding: 0.4em; padding-left: 1.5em; font-size: 10pt; height: 15px;cursor:pointer }
#sortable li span { position: absolute; margin-left: -1.3em; }
.ui-state-highlight { height: 1.5em; line-height: 1.2em; }
#sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px;}
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/updateDataStatus.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/updateDataStatus.vm 2009-09-17 15:02:10 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/updateDataStatus.vm 2009-09-21 07:40:48 +0000
@@ -17,15 +17,13 @@
<tr>
<td colspan=2 align=center>
<input type="button" value="$i18n.getString( 'ok' )" style="width:100px" onclick="updateDataStatus()"/>
- <input type="button" value="$i18n.getString( 'cancel' )" style="width:100px" onclick="window.location = 'listDataEntryStatus.action'"/>
+ <input type="button" value="$i18n.getString( 'cancel' )" style="width:100px" onclick="window.location = 'listDataStatus.action'"/>
</td>
</tr>
</table>
<script language="javascript">
function updateDataStatus(){
- var url = "updateDataEntryStatus.action?dataStatusId=" + $dataStatus.id + "&dataSetId=" + getFieldValue('dataSetId') + "&makeDefault=" + document.getElementById('makeDefault').checked;
- alert(url);
- window.location = url;
+ window.location = "updateDataStatus.action?dataStatusId=" + $dataStatus.id + "&dataSetId=" + getFieldValue('dataSetId') + "&makeDefault=" + document.getElementById('makeDefault').checked;
}
var request = new Request();
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/viewAdministrator.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/viewAdministrator.vm 2009-09-17 15:02:10 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/viewAdministrator.vm 2009-09-21 07:40:48 +0000
@@ -1,10 +1,8 @@
<h3>$i18n.getString( "administration" )</h3>
-<ul>
- <li><a href="getConfiguration.action">$i18n.getString( "configuration" ) </a></li>
- <li><a href="getAdminOptions.action">$i18n.getString( "report_roles" ) </a></li>
- <li><a href="listReportExcel.action">$i18n.getString( "reports" ) </a></li>
- <li><a href="listDataEntryStatus.action">$i18n.getString( "data_status" ) </a></li>
-</ul>
+<input type="button" value="$i18n.getString( "configuration" )" onclick="go('getConfiguration.action')" style="width:100px"/>
+<input type="button" value="$i18n.getString( "report_roles" )" onclick="go('getAdminOptions.action')" style="width:100px"/>
+<input type="button" value="$i18n.getString( "reports" )" onclick="go('listReportExcel.action')" style="width:100px"/>
+<input type="button" value="$i18n.getString( "clean_up" )" onclick="cleanUp()" style="width:100px"/>
<script>
function go(action){