=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/DataBrowerAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/DataBrowerAction.java 2011-03-12 10:25:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/DataBrowerAction.java 1970-01-01 00:00:00 +0000 @@ -1,183 +0,0 @@ -package org.hisp.dhis.dataadmin.action.databrowser; - -/* - * Copyright (c) 2004-${year}, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import static org.hisp.dhis.system.util.TextUtils.nullIfEmpty; - -import org.hisp.dhis.period.PeriodType; -import org.hisp.dhis.system.util.DateUtils; -import org.hisp.dhis.util.SessionUtils; - -/** - * @author espenjac, joakibj, briane, eivinhb - * @version $Id DataBrowerAction.java Apr 06, 2010 ddhieu - */ -public class DataBrowerAction - extends ActionSupport -{ - private boolean isZeroAdded = false; - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - { - isZeroAdded = (showZeroCheckBox != null) && showZeroCheckBox.equals( TRUE ); - - // If set, change the current selected unit - if ( selectedUnitChanger != null ) - { - selectionManager.setSelectedOrganisationUnit( this.organisationUnitService.getOrganisationUnit( Integer - .parseInt( selectedUnitChanger.trim() ) ) ); - } - - // Checks if the selected unit is a leaf node of tree then - // We must add parent as the same parameter value - if ( parent == null && mode.equals( "OU" ) && selectionManager.getSelectedOrganisationUnit() != null - && selectionManager.getSelectedOrganisationUnit().getChildren().size() == 0 ) - { - parent = selectionManager.getSelectedOrganisationUnit().getId() + EMPTY; - } - - // Check if the second selected date is later than the first selected - // date - if ( nullIfEmpty( fromDate ) == null && nullIfEmpty( toDate ) == null ) - { - if ( DateUtils.checkDates( fromDate, toDate ) ) - { - return ERROR; - } - } - - PeriodType periodType = periodService.getPeriodTypeByName( periodTypeId ); - - if ( mode.equals( "DS" ) ) - { - if ( parent != null ) - { - // Show DataElement for a given DataSet - Integer parentInt = Integer.parseInt( parent ); - - grid = dataBrowserGridService.getCountDataElementsForDataSetInPeriod( parentInt, fromDate, toDate, - periodType, format, isZeroAdded ); - } - else - { - // Get all DataSets - grid = dataBrowserGridService.getDataSetsInPeriod( fromDate, toDate, periodType, format, isZeroAdded ); - } - - this.setSummary( true ); - } - else if ( mode.equals( "DEG" ) ) - { - // Get all DataElementGroup objects - if ( parent != null ) - { - // Show DataElement - Integer parentInt = Integer.parseInt( parent ); - - grid = dataBrowserGridService.getCountDataElementsForDataElementGroupInPeriod( parentInt, fromDate, - toDate, periodType, format, isZeroAdded ); - } - else - { - grid = dataBrowserGridService.getDataElementGroupsInPeriod( fromDate, toDate, periodType, format, - isZeroAdded ); - } - - this.setSummary( true ); - } - else if ( mode.equals( "OUG" ) ) - { - if ( parent != null ) - { - // Show DataElementGroups - Integer parentInt = Integer.parseInt( parent ); - grid = dataBrowserGridService.getCountDataElementGroupsForOrgUnitGroupInPeriod( parentInt, fromDate, - toDate, periodType, format, isZeroAdded ); - } - else - { - grid = dataBrowserGridService.getOrgUnitGroupsInPeriod( fromDate, toDate, periodType, format, - isZeroAdded ); - } - - this.setSummary( true ); - } - else if ( mode.equals( "OU" ) ) - { - selectedUnit = selectionManager.getSelectedOrganisationUnit(); - - if ( (drillDownCheckBox != null) && drillDownCheckBox.equals( TRUE ) ) - { - parent = String.valueOf( selectedUnit.getId() ); - } - - // This one is used for itself - if ( parent != null ) - { - Integer parentInt = Integer.parseInt( parent ); - - // Show DataElement values entered for this specified unit only - grid = dataBrowserGridService.getRawDataElementsForOrgUnitInPeriod( parentInt, fromDate, toDate, - periodType, format, isZeroAdded ); - - this.setSummary( false ); - } - else if ( selectedUnit != null ) - { - // Show the summary values for the immediate and descendant - // units of the specified unit - grid = dataBrowserGridService.getOrgUnitsInPeriod( selectedUnit.getId(), fromDate, toDate, periodType, - null, format, isZeroAdded ); - - this.setSummary( true ); - } - else - { - return ERROR; - } - } - else - { - return ERROR; - } - - setGridTitle(); - - // Convert column date names - convertColumnNames( grid ); - - // Set DataBrowserTable variable for PDF export - SessionUtils.setSessionVar( KEY_DATABROWSERGRID, grid ); - - return SUCCESS; - } -} === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/DataBrowserAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/DataBrowserAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/DataBrowserAction.java 2011-03-14 05:00:01 +0000 @@ -0,0 +1,183 @@ +package org.hisp.dhis.dataadmin.action.databrowser; + +/* + * Copyright (c) 2004-${year}, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import static org.hisp.dhis.system.util.TextUtils.nullIfEmpty; + +import org.hisp.dhis.period.PeriodType; +import org.hisp.dhis.system.util.DateUtils; +import org.hisp.dhis.util.SessionUtils; + +/** + * @author espenjac, joakibj, briane, eivinhb + * @version $Id DataBrowerAction.java Apr 06, 2010 ddhieu + */ +public class DataBrowserAction + extends ActionSupport +{ + private boolean isZeroAdded = false; + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public String execute() + { + isZeroAdded = (showZeroCheckBox != null) && showZeroCheckBox.equals( TRUE ); + + // If set, change the current selected unit + if ( selectedUnitChanger != null ) + { + selectionManager.setSelectedOrganisationUnit( this.organisationUnitService.getOrganisationUnit( Integer + .parseInt( selectedUnitChanger.trim() ) ) ); + } + + // Checks if the selected unit is a leaf node of tree then + // We must add parent as the same parameter value + if ( parent == null && mode.equals( "OU" ) && selectionManager.getSelectedOrganisationUnit() != null + && selectionManager.getSelectedOrganisationUnit().getChildren().size() == 0 ) + { + parent = selectionManager.getSelectedOrganisationUnit().getId() + EMPTY; + } + + // Check if the second selected date is later than the first selected + // date + if ( nullIfEmpty( fromDate ) == null && nullIfEmpty( toDate ) == null ) + { + if ( DateUtils.checkDates( fromDate, toDate ) ) + { + return ERROR; + } + } + + PeriodType periodType = periodService.getPeriodTypeByName( periodTypeId ); + + if ( mode.equals( "DS" ) ) + { + if ( parent != null ) + { + // Show DataElement for a given DataSet + Integer parentInt = Integer.parseInt( parent ); + + grid = dataBrowserGridService.getCountDataElementsForDataSetInPeriod( parentInt, fromDate, toDate, + periodType, format, isZeroAdded ); + } + else + { + // Get all DataSets + grid = dataBrowserGridService.getDataSetsInPeriod( fromDate, toDate, periodType, format, isZeroAdded ); + } + + this.setSummary( true ); + } + else if ( mode.equals( "DEG" ) ) + { + // Get all DataElementGroup objects + if ( parent != null ) + { + // Show DataElement + Integer parentInt = Integer.parseInt( parent ); + + grid = dataBrowserGridService.getCountDataElementsForDataElementGroupInPeriod( parentInt, fromDate, + toDate, periodType, format, isZeroAdded ); + } + else + { + grid = dataBrowserGridService.getDataElementGroupsInPeriod( fromDate, toDate, periodType, format, + isZeroAdded ); + } + + this.setSummary( true ); + } + else if ( mode.equals( "OUG" ) ) + { + if ( parent != null ) + { + // Show DataElementGroups + Integer parentInt = Integer.parseInt( parent ); + grid = dataBrowserGridService.getCountDataElementGroupsForOrgUnitGroupInPeriod( parentInt, fromDate, + toDate, periodType, format, isZeroAdded ); + } + else + { + grid = dataBrowserGridService.getOrgUnitGroupsInPeriod( fromDate, toDate, periodType, format, + isZeroAdded ); + } + + this.setSummary( true ); + } + else if ( mode.equals( "OU" ) ) + { + selectedUnit = selectionManager.getSelectedOrganisationUnit(); + + if ( (drillDownCheckBox != null) && drillDownCheckBox.equals( TRUE ) ) + { + parent = String.valueOf( selectedUnit.getId() ); + } + + // This one is used for itself + if ( parent != null ) + { + Integer parentInt = Integer.parseInt( parent ); + + // Show DataElement values entered for this specified unit only + grid = dataBrowserGridService.getRawDataElementsForOrgUnitInPeriod( parentInt, fromDate, toDate, + periodType, format, isZeroAdded ); + + this.setSummary( false ); + } + else if ( selectedUnit != null ) + { + // Show the summary values for the immediate and descendant + // units of the specified unit + grid = dataBrowserGridService.getOrgUnitsInPeriod( selectedUnit.getId(), fromDate, toDate, periodType, + null, format, isZeroAdded ); + + this.setSummary( true ); + } + else + { + return ERROR; + } + } + else + { + return ERROR; + } + + setGridTitle(); + + // Convert column date names + convertColumnNames( grid ); + + // Set DataBrowserTable variable for PDF export + SessionUtils.setSessionVar( KEY_DATABROWSERGRID, grid ); + + return SUCCESS; + } +} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties 2011-03-12 10:25:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties 2011-03-14 05:00:01 +0000 @@ -312,4 +312,7 @@ clear_data_mart = Clear data mart rebuild_data_mart_index = Rebuild data mart index allow_show_zero = Allow Zero showed -raw_data = Raw data \ No newline at end of file +raw_data = Raw data +get_report_as_xls = Download as Excel +get_report_as_csv = Download as CSV +get_report_as_pdf = Download as PDF \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module_vi_VN.properties' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module_vi_VN.properties 2011-03-12 10:25:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module_vi_VN.properties 2011-03-14 05:00:01 +0000 @@ -288,4 +288,7 @@ DataSet = T\u1eadp d\u1eef li\u1ec7u DataElementGroup = Nh\u00f3m ph\u1ea7n t\u1eed d\u1eef li\u1ec7u allow_show_zero = Cho ph\u00e9p hi\u1ec3n th\u1ecb gi\u00e1 tr\u1ecb 0 -raw_data = D\u1eef li\u1ec7u \u0111\u01b0\u1ee3c nh\u1eadp v\u00e0o \ No newline at end of file +raw_data = D\u1eef li\u1ec7u \u0111\u01b0\u1ee3c nh\u1eadp v\u00e0o +get_report_as_xls = Xu\u1ea5t t\u1eadp tin Excel +get_report_as_csv = Xu\u1ea5t t\u1eadp tin CSV +get_report_as_pdf = Xu\u1ea5t t\u1eadp tin PDF \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml 2011-03-12 10:25:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml 2011-03-14 05:00:01 +0000 @@ -192,7 +192,7 @@ + class="org.hisp.dhis.dataadmin.action.databrowser.DataBrowserAction"> /main.vm error.action === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserForm.vm 2011-03-12 10:25:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserForm.vm 2011-03-14 05:00:01 +0000 @@ -45,7 +45,10 @@ - + + + + $i18n.getString( "allow_show_zero" ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserGrid.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserGrid.vm 2011-03-12 10:25:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserGrid.vm 2011-03-14 05:00:01 +0000 @@ -44,12 +44,11 @@
-
- - - - -
+
+ + + +
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserResult.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserResult.vm 2011-03-12 10:25:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserResult.vm 2011-03-14 05:00:01 +0000 @@ -80,17 +80,6 @@
#end -
-
- $i18n.getString( "export_to" ): - - -
-

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowser.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowser.js 2011-03-12 10:25:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowser.js 2011-03-14 05:00:01 +0000 @@ -90,7 +90,9 @@ window.location.href = currentUrlLink; } -function changeType( type ) +function exportResult( type ) { - type == "xls" ? disable( "pageLayout" ) : enable( "pageLayout" ); + var url = "exportResult.action?type=" + type; + + window.location.href = url; } \ No newline at end of file