=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm 2010-09-17 16:11:27 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm 2010-10-05 06:53:19 +0000 @@ -19,6 +19,7 @@ + === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm 2010-09-27 10:40:07 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm 2010-10-05 06:53:19 +0000 @@ -110,6 +110,7 @@ #else #if( $dataElement.type == "string" ) + #set( $dataEntryId = "value[$dataElement.id].value:value[$optionComboId].value" ) #set( $coun = 0 ) #foreach($customValue in $customValues) #if($dataElement.id == $customValue.dataElement.id && $optionComboId == $customValue.optionCombo.id) @@ -126,7 +127,7 @@ #end #else - + #end #end === added file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/datasetcompleted/action/DataSetCompletedReportFormAction.java' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/datasetcompleted/action/DataSetCompletedReportFormAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/datasetcompleted/action/DataSetCompletedReportFormAction.java 2010-10-05 06:53:19 +0000 @@ -0,0 +1,130 @@ +package org.hisp.dhis.reportexcel.datasetcompleted.action; + +/* + * Copyright (c) 2004-2010, 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 java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.hisp.dhis.dataset.DataSet; +import org.hisp.dhis.dataset.DataSetService; +import org.hisp.dhis.dataset.comparator.DataSetNameComparator; +import org.hisp.dhis.reportexcel.Bookmark; +import org.hisp.dhis.reportexcel.BookmarkService; +import org.hisp.dhis.user.CurrentUserService; +import org.hisp.dhis.user.UserAuthorityGroup; +import org.hisp.dhis.user.UserCredentials; +import org.hisp.dhis.user.UserStore; + +import com.opensymphony.xwork2.Action; + +/** + * @author Tran Thanh Tri + * @version $Id$ + */ + +public class DataSetCompletedReportFormAction + implements Action +{ + // ------------------------------------------- + // Dependency + // ------------------------------------------- + + private BookmarkService bookmarkService; + + public void setBookmarkService( BookmarkService bookmarkService ) + { + this.bookmarkService = bookmarkService; + } + + private DataSetService dataSetService; + + public void setDataSetService( DataSetService dataSetService ) + { + this.dataSetService = dataSetService; + } + + private UserStore userStore; + + public void setUserStore( UserStore userStore ) + { + this.userStore = userStore; + } + + private CurrentUserService currentUserService; + + public void setCurrentUserService( CurrentUserService currentUserService ) + { + this.currentUserService = currentUserService; + } + + // ------------------------------------------- + // Output + // ------------------------------------------- + + private List bookmarks; + + public List getBookmarks() + { + return bookmarks; + } + + private List dataSets; + + public List getDataSets() + { + return dataSets; + } + + @Override + public String execute() + throws Exception + { + bookmarks = new ArrayList( bookmarkService.getAllBookmark( Bookmark.COMPLETED_REPORT ) ); + + dataSets = new ArrayList(); + + if ( currentUserService.currentUserIsSuper() ) + { + dataSets.addAll( dataSetService.getAssignedDataSets() ); + } + else + { + UserCredentials userCredentials = userStore.getUserCredentials( currentUserService.getCurrentUser() ); + + for ( UserAuthorityGroup userAuthorityGroup : userCredentials.getUserAuthorityGroups() ) + { + dataSets.addAll( userAuthorityGroup.getDataSets() ); + } + } + + Collections.sort( dataSets, new DataSetNameComparator() ); + + return SUCCESS; + } + +} === added file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/datasetcompleted/action/ViewByPeriodFormAction.java' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/datasetcompleted/action/ViewByPeriodFormAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/datasetcompleted/action/ViewByPeriodFormAction.java 2010-10-05 06:53:19 +0000 @@ -0,0 +1,106 @@ +package org.hisp.dhis.reportexcel.datasetcompleted.action; + +/* + * Copyright (c) 2004-2010, 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 java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.hisp.dhis.dataset.DataSet; +import org.hisp.dhis.dataset.DataSetService; +import org.hisp.dhis.oust.manager.SelectionTreeManager; +import org.hisp.dhis.period.Period; +import org.hisp.dhis.period.PeriodService; +import org.hisp.dhis.period.comparator.PeriodComparator; + +import com.opensymphony.xwork2.Action; + +/** + * @author Tran Thanh Tri + * @version $Id$ + */ +public class ViewByPeriodFormAction + implements Action +{ + // ------------------------------------------------- + // Dependency + // ------------------------------------------------- + + private DataSetService dataSetService; + + public void setDataSetService( DataSetService dataSetService ) + { + this.dataSetService = dataSetService; + } + + private PeriodService periodService; + + public void setPeriodService( PeriodService periodService ) + { + this.periodService = periodService; + } + + private SelectionTreeManager selectionTreeManager; + + public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager ) + { + this.selectionTreeManager = selectionTreeManager; + } + + // ------------------------------------------------- + // Input + // ------------------------------------------------- + + private Integer id; + + public void setId( Integer id ) + { + this.id = id; + } + + private List periods; + + public List getPeriods() + { + return periods; + } + + public String execute() + throws Exception + { + + DataSet dataSet = dataSetService.getDataSet( id ); + + selectionTreeManager.setSelectedOrganisationUnits( dataSet.getOrganisationUnis() ); + + periods = new ArrayList( periodService.getPeriodsByPeriodType( dataSet.getPeriodType() ) ); + + Collections.sort( periods, new PeriodComparator() ); + + return SUCCESS; + } +} === modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/datasetcompleted/action/ViewCompletedReportByPeriodsAction.java' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/datasetcompleted/action/ViewCompletedReportByPeriodsAction.java 2010-09-07 11:43:00 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/datasetcompleted/action/ViewCompletedReportByPeriodsAction.java 2010-10-05 06:53:19 +0000 @@ -44,6 +44,7 @@ import org.hisp.dhis.datavalue.DataValueService; import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator; +import org.hisp.dhis.oust.manager.SelectionTreeManager; import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager; import org.hisp.dhis.period.Period; import org.hisp.dhis.period.PeriodService; @@ -72,11 +73,11 @@ this.periodService = periodService; } - private OrganisationUnitSelectionManager organisationUnitSelectionManager; + private SelectionTreeManager selectionTreeManager; - public void setOrganisationUnitSelectionManager( OrganisationUnitSelectionManager organisationUnitSelectionManager ) + public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager ) { - this.organisationUnitSelectionManager = organisationUnitSelectionManager; + this.selectionTreeManager = selectionTreeManager; } private DataSetService dataSetService; @@ -157,8 +158,7 @@ { dataSet = dataSetService.getDataSet( id ); - organisationUnits = new ArrayList( organisationUnitSelectionManager - .getSelectedOrganisationUnit().getChildren() ); + organisationUnits = new ArrayList( selectionTreeManager.getSelectedOrganisationUnits() ); periods = new ArrayList(); === 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 2010-10-04 06:27:38 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2010-10-05 06:53:19 +0000 @@ -1338,7 +1338,7 @@ scope="prototype"> - + @@ -1379,17 +1379,39 @@ ref="org.hisp.dhis.reportexcel.state.SelectionManager" /> + + + + + + + + + + + + + + + - + - + @@ -1424,15 +1446,17 @@ scope="prototype"> - - - - === modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml 2010-10-04 06:27:38 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml 2010-10-05 06:53:19 +0000 @@ -601,34 +601,19 @@ - - selectDataSetCompletedReportChain - - - - - + /main.vm - /dhis-web-excel-reporting/dataSetCompleteReportSelect.vm - /dhis-web-excel-reporting/menuWithTree.vm - 400 - - ../dhis-web-commons/ouwt/ouwt.js, - ../dhis-web-commons/util/jquery.jqprint.0.3.js, - ext/adapter/ext/ext-base.js, - ext/ext-all.js, - ext/ux/MultiSelect.js, - ext/ux/ItemSelector.js, - javascript/dataSetCompleted.js - - - ext/resources/css/ext-all.css, - ext/ux/css/MultiSelect.css, - style/dataSetCompleted.css - - + /dhis-web-excel-reporting/dataSetCompleteds.vm + /dhis-web-excel-reporting/menu.vm + + + + ../dhis-web-commons/ajax/jsonPeriods.vm + plainTextError + + @@ -1498,14 +1483,9 @@ class="org.hisp.dhis.reportexcel.jchart.action.UpdateJChartUserRoleAction"> jcharts.action F_EXCEL_REPORT_ADMINISTRATION - + - viewJChartsChain - - - /main.vm /dhis-web-excel-reporting/chart/viewJCharts.vm === added file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/chart/drawJChartParams.vm' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/chart/drawJChartParams.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/chart/drawJChartParams.vm 2010-10-05 06:53:19 +0000 @@ -0,0 +1,170 @@ + + +

$encoder.htmlEncode( $jchart.title )

+
+ + + + + + + + + + + #if( $jchart.isOrganisationUnitCategory() ) + + + + + + + + #end +
$i18n.getString('select_paramater_to_draw_chart')
+
+ #organisationUnitSelectionTree( false, false, true ) +
+
$i18n.getString('period')
+

+ +

+
+ + + +