=== added directory 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataapproval' === added directory 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataapproval/action' === added file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataapproval/action/GetDataApprovalOptionsAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataapproval/action/GetDataApprovalOptionsAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataapproval/action/GetDataApprovalOptionsAction.java 2014-04-02 12:33:53 +0000 @@ -0,0 +1,101 @@ +package org.hisp.dhis.reporting.dataapproval.action; + +/* + * Copyright (c) 2004-2014, 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.common.comparator.IdentifiableObjectNameComparator; +import org.hisp.dhis.dataelement.CategoryOptionGroup; +import org.hisp.dhis.dataelement.DataElementCategoryService; +import org.hisp.dhis.dataset.DataSet; +import org.hisp.dhis.dataset.DataSetService; +import org.hisp.dhis.system.util.Filter; +import org.hisp.dhis.system.util.FilterUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import com.opensymphony.xwork2.Action; + +public class GetDataApprovalOptionsAction + implements Action +{ + @Autowired + private DataElementCategoryService categoryService; + + @Autowired + private DataSetService dataSetService; + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private List categoryOptionGroups; + + public List getCategoryOptionGroups() + { + return categoryOptionGroups; + } + + private List dataSets; + + public List getDataSets() + { + return dataSets; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + categoryOptionGroups = new ArrayList( categoryService.getAllCategoryOptionGroups() ); + dataSets = new ArrayList( dataSetService.getAllDataSets() ); + + FilterUtils.filter( dataSets, new DataSetApproveDataFilter() ); + + Collections.sort( categoryOptionGroups, IdentifiableObjectNameComparator.INSTANCE ); + Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE ); + + return SUCCESS; + } + + class DataSetApproveDataFilter + implements Filter + { + @Override + public boolean retain( DataSet dataSet ) + { + return dataSet != null && dataSet.isApproveData(); + } + } +} === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2013-12-25 11:46:47 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2014-04-02 12:33:53 +0000 @@ -109,6 +109,12 @@ + + + + + === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties 2014-03-31 17:22:19 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties 2014-04-02 12:33:53 +0000 @@ -9,6 +9,7 @@ select_organisation_unit=Please select an organisation unit report_organisation_unit= Report organisation unit dataset_report= Data Set Report +data_approval=Data Approval add_selected= Add selected add_all= Add all add=Add === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2013-12-29 15:16:57 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2014-04-02 12:33:53 +0000 @@ -187,6 +187,16 @@ + + + + + /main.vm + /dhis-web-reporting/dataApprovalForm.vm + /dhis-web-reporting/menu.vm + ../dhis-web-commons/oust/oust.js,javascript/dataApproval.js + style/dhis-web-reporting.css + === added file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataApprovalForm.vm' === added file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js' === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/menu.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/menu.vm 2013-05-24 11:59:41 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/menu.vm 2014-04-02 12:33:53 +0000 @@ -6,6 +6,7 @@
  • $i18n.getString( "reporting_rate_summary" ) 
  • $i18n.getString( "resource" ) 
  • $i18n.getString( "organisation_unit_report" ) 
  • +
  • $i18n.getString( "data_approval" ) 
  • $i18n.getString( "report_table" )