=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetAllChartsAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetAllChartsAction.java 2011-11-12 18:43:35 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetAllChartsAction.java 1970-01-01 00:00:00 +0000 @@ -1,105 +0,0 @@ -package org.hisp.dhis.reporting.chart.action; - -/* - * Copyright (c) 2004-2011, 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.apache.commons.lang.StringUtils.isNotBlank; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.hisp.dhis.chart.Chart; -import org.hisp.dhis.chart.ChartService; -import org.hisp.dhis.chart.comparator.ChartNameComparator; -import org.hisp.dhis.paging.ActionPagingSupport; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class GetAllChartsAction - extends ActionPagingSupport -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ChartService chartService; - - public void setChartService( ChartService chartService ) - { - this.chartService = chartService; - } - - // ------------------------------------------------------------------------- - // Input & Output - // ------------------------------------------------------------------------- - - private String key; - - public String getKey() - { - return key; - } - - public void setKey( String key ) - { - this.key = key; - } - - private List charts; - - public List getCharts() - { - return charts; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - { - if ( isNotBlank( key ) ) - { - this.paging = createPaging( chartService.getChartCountByName( key ) ); - - charts = new ArrayList( chartService.getChartsBetweenByName( key, paging.getStartPos(), paging.getPageSize() ) ); - } - else - { - this.paging = createPaging( chartService.getChartCount() ); - - charts = new ArrayList( chartService.getChartsBetween( paging.getStartPos(), paging.getPageSize() ) ); - } - - Collections.sort( charts, new ChartNameComparator() ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartAction.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartAction.java 1970-01-01 00:00:00 +0000 @@ -1,88 +0,0 @@ -package org.hisp.dhis.reporting.chart.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 org.hisp.dhis.chart.Chart; -import org.hisp.dhis.chart.ChartService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class GetChartAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ChartService chartService; - - public void setChartService( ChartService chartService ) - { - this.chartService = chartService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Integer id; - - public void setId( Integer id ) - { - this.id = id; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private Chart chart; - - public Chart getChart() - { - return chart; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - { - if ( id != null ) - { - chart = chartService.getChart( id ); - } - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartOptionsAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartOptionsAction.java 2011-12-22 13:09:31 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartOptionsAction.java 1970-01-01 00:00:00 +0000 @@ -1,312 +0,0 @@ -package org.hisp.dhis.reporting.chart.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.Comparator; -import java.util.List; - -import org.hisp.dhis.chart.Chart; -import org.hisp.dhis.chart.ChartService; -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementGroup; -import org.hisp.dhis.dataelement.DataElementService; -import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator; -import org.hisp.dhis.dataset.DataSet; -import org.hisp.dhis.dataset.DataSetService; -import org.hisp.dhis.indicator.Indicator; -import org.hisp.dhis.indicator.IndicatorGroup; -import org.hisp.dhis.indicator.IndicatorService; -import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator; -import org.hisp.dhis.options.displayproperty.DisplayPropertyHandler; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitLevel; -import org.hisp.dhis.organisationunit.OrganisationUnitService; -import org.hisp.dhis.organisationunit.comparator.OrganisationUnitLevelComparator; -import org.hisp.dhis.period.PeriodType; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - */ -public class GetChartOptionsAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ChartService chartService; - - public void setChartService( ChartService chartService ) - { - this.chartService = chartService; - } - - private IndicatorService indicatorService; - - public void setIndicatorService( IndicatorService indicatorService ) - { - this.indicatorService = indicatorService; - } - - private DataElementService dataElementService; - - public void setDataElementService( DataElementService dataElementService ) - { - this.dataElementService = dataElementService; - } - - private DataSetService dataSetService; - - public void setDataSetService( DataSetService dataSetService ) - { - this.dataSetService = dataSetService; - } - - private OrganisationUnitService organisationUnitService; - - public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) - { - this.organisationUnitService = organisationUnitService; - } - - private DisplayPropertyHandler displayPropertyHandler; - - public void setDisplayPropertyHandler( DisplayPropertyHandler displayPropertyHandler ) - { - this.displayPropertyHandler = displayPropertyHandler; - } - - private Comparator indicatorComparator; - - public void setIndicatorComparator( Comparator indicatorComparator ) - { - this.indicatorComparator = indicatorComparator; - } - - private Comparator dataElementComparator; - - public void setDataElementComparator( Comparator dataElementComparator ) - { - this.dataElementComparator = dataElementComparator; - } - - private Comparator dataSetComparator; - - public void setDataSetComparator( Comparator dataSetComparator ) - { - this.dataSetComparator = dataSetComparator; - } - - private Comparator organisationUnitComparator; - - public void setOrganisationUnitComparator( Comparator organisationUnitComparator ) - { - this.organisationUnitComparator = organisationUnitComparator; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Integer id; - - public void setId( Integer id ) - { - this.id = id; - } - - private String dimension; - - public String getDimension() - { - return dimension; - } - - public void setDimension( String dimension ) - { - this.dimension = dimension; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private Chart chart; - - public Chart getChart() - { - return chart; - } - - private List indicatorGroups = new ArrayList(); - - public List getIndicatorGroups() - { - return indicatorGroups; - } - - private List dataElementGroups = new ArrayList(); - - public List getDataElementGroups() - { - return dataElementGroups; - } - - private List availableIndicators; - - public List getAvailableIndicators() - { - return availableIndicators; - } - - private List availableDataElements; - - public List getAvailableDataElements() - { - return availableDataElements; - } - - private List availableDataSets; - - public List getAvailableDataSets() - { - return availableDataSets; - } - - private List selectedIndicators; - - public List getSelectedIndicators() - { - return selectedIndicators; - } - - private List selectedDataElements; - - public List getSelectedDataElements() - { - return selectedDataElements; - } - - private List selectedDataSets; - - public List getSelectedDataSets() - { - return selectedDataSets; - } - - private List periodTypes = new ArrayList(); - - public List getPeriodTypes() - { - return periodTypes; - } - - private List levels = new ArrayList(); - - public List getLevels() - { - return levels; - } - - private List availableOrganisationUnits; - - public List getAvailableOrganisationUnits() - { - return availableOrganisationUnits; - } - - private List selectedOrganisationUnits; - - public List getSelectedOrganisationUnits() - { - return selectedOrganisationUnits; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - { - indicatorGroups = new ArrayList( indicatorService.getAllIndicatorGroups() ); - - dataElementGroups = new ArrayList( dataElementService.getAllDataElementGroups() ); - - availableIndicators = new ArrayList( indicatorService.getAllIndicators() ); - - availableDataElements = new ArrayList( dataElementService.getAllDataElements() ); - - availableDataSets = new ArrayList( dataSetService.getAllDataSets() ); - - levels = organisationUnitService.getOrganisationUnitLevels(); - - availableOrganisationUnits = new ArrayList( - organisationUnitService.getOrganisationUnitsAtLevel( 1 ) ); - - Collections.sort( indicatorGroups, new IndicatorGroupNameComparator() ); - Collections.sort( dataElementGroups, new DataElementGroupNameComparator() ); - Collections.sort( availableIndicators, indicatorComparator ); - Collections.sort( availableDataElements, dataElementComparator ); - Collections.sort( availableDataSets, dataSetComparator ); - Collections.sort( levels, new OrganisationUnitLevelComparator() ); - Collections.sort( availableOrganisationUnits, organisationUnitComparator ); - - displayPropertyHandler.handle( availableIndicators ); - displayPropertyHandler.handle( availableDataElements ); - displayPropertyHandler.handle( availableDataSets ); - displayPropertyHandler.handle( availableOrganisationUnits ); - - if ( id != null ) - { - chart = chartService.getChart( id ); - - selectedIndicators = chart.getIndicators(); - availableIndicators.removeAll( selectedIndicators ); - - selectedDataElements = chart.getDataElements(); - availableDataElements.removeAll( selectedDataElements ); - - selectedDataSets = chart.getDataSets(); - availableDataSets.removeAll( selectedDataSets ); - - selectedOrganisationUnits = chart.getOrganisationUnits(); - availableOrganisationUnits.removeAll( selectedOrganisationUnits ); - - displayPropertyHandler.handle( selectedIndicators ); - displayPropertyHandler.handle( selectedDataElements ); - displayPropertyHandler.handle( selectedDataSets ); - displayPropertyHandler.handle( selectedOrganisationUnits ); - } - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/RemoveChartAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/RemoveChartAction.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/RemoveChartAction.java 1970-01-01 00:00:00 +0000 @@ -1,79 +0,0 @@ -package org.hisp.dhis.reporting.chart.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 org.hisp.dhis.chart.Chart; -import org.hisp.dhis.chart.ChartService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class RemoveChartAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ChartService chartService; - - public void setChartService( ChartService chartService ) - { - this.chartService = chartService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Integer id; - - public void setId( Integer id ) - { - this.id = id; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - { - if ( id != null ) - { - Chart chart = chartService.getChart( id ); - - chartService.deleteChart( chart ); - } - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java 2011-12-22 18:14:45 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java 1970-01-01 00:00:00 +0000 @@ -1,357 +0,0 @@ -package org.hisp.dhis.reporting.chart.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 static org.hisp.dhis.system.util.ConversionUtils.getIntegerCollection; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang.StringUtils; -import org.hisp.dhis.chart.Chart; -import org.hisp.dhis.chart.ChartService; -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementService; -import org.hisp.dhis.dataset.DataSet; -import org.hisp.dhis.dataset.DataSetService; -import org.hisp.dhis.indicator.Indicator; -import org.hisp.dhis.indicator.IndicatorService; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitService; -import org.hisp.dhis.period.RelativePeriods; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - * @version $Id: UploadDesignAction.java 5207 2008-05-22 12:16:36Z larshelg $ - */ -public class SaveChartAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ChartService chartService; - - public void setChartService( ChartService chartService ) - { - this.chartService = chartService; - } - - private IndicatorService indicatorService; - - public void setIndicatorService( IndicatorService indicatorService ) - { - this.indicatorService = indicatorService; - } - - private DataElementService dataElementService; - - public void setDataElementService( DataElementService dataElementService ) - { - this.dataElementService = dataElementService; - } - - private DataSetService dataSetService; - - public void setDataSetService( DataSetService dataSetService ) - { - this.dataSetService = dataSetService; - } - - private OrganisationUnitService organisationUnitService; - - public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) - { - this.organisationUnitService = organisationUnitService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Integer id; - - public void setId( Integer id ) - { - this.id = id; - } - - private String domainAxisLabel; - - public void setDomainAxisLabel( String domainAxisLabel ) - { - this.domainAxisLabel = domainAxisLabel; - } - - private String rangeAxisLabel; - - public void setRangeAxisLabel( String rangeAxisLabel ) - { - this.rangeAxisLabel = rangeAxisLabel; - } - - private String name; - - public void setName( String name ) - { - this.name = name; - } - - private boolean hideSubtitle; - - public void setHideSubtitle( boolean hideSubtitle ) - { - this.hideSubtitle = hideSubtitle; - } - - private String type; - - public void setType( String type ) - { - this.type = type; - } - - private String series; - - public void setSeries( String series ) - { - this.series = series; - } - - private String category; - - public void setCategory( String category ) - { - this.category = category; - } - - private String filter; - - public void setFilter( String filter ) - { - this.filter = filter; - } - - private boolean hideLegend; - - public void setHideLegend( boolean hideLegend ) - { - this.hideLegend = hideLegend; - } - - private boolean regression; - - public void setRegression( boolean regression ) - { - this.regression = regression; - } - - private boolean targetLine; - - public void setTargetLine( boolean targetLine ) - { - this.targetLine = targetLine; - } - - private Double targetLineValue; - - public void setTargetLineValue( Double targetLineValue ) - { - this.targetLineValue = targetLineValue; - } - - private String targetLineLabel; - - public void setTargetLineLabel( String targetLineLabel ) - { - this.targetLineLabel = targetLineLabel; - } - - private boolean userOrganisationUnit; - - public void setUserOrganisationUnit( boolean userOrganisationUnit ) - { - this.userOrganisationUnit = userOrganisationUnit; - } - - private List selectedIndicators = new ArrayList(); - - public void setSelectedIndicators( List selectedIndicators ) - { - this.selectedIndicators = selectedIndicators; - } - - private List selectedDataElements = new ArrayList(); - - public void setSelectedDataElements( List selectedDataElements ) - { - this.selectedDataElements = selectedDataElements; - } - - private List selectedOrganisationUnits = new ArrayList(); - - public void setSelectedOrganisationUnits( List selectedOrganisationUnits ) - { - this.selectedOrganisationUnits = selectedOrganisationUnits; - } - - private List selectedDataSets = new ArrayList(); - - public void setSelectedDataSets( List selectedDataSets ) - { - this.selectedDataSets = selectedDataSets; - } - - private boolean lastMonth; - - public void setLastMonth( boolean lastMonth ) - { - this.lastMonth = lastMonth; - } - - private boolean last12Months; - - public void setLast12Months( boolean last12Months ) - { - this.last12Months = last12Months; - } - - private boolean lastQuarter; - - public void setLastQuarter( boolean lastQuarter ) - { - this.lastQuarter = lastQuarter; - } - - private boolean last4Quarters; - - public void setLast4Quarters( boolean last4Quarters ) - { - this.last4Quarters = last4Quarters; - } - - private boolean lastSixMonth; - - public void setLastSixMonth( boolean lastSixMonth ) - { - this.lastSixMonth = lastSixMonth; - } - - private boolean last2SixMonths; - - public void setLast2SixMonths( boolean last2SixMonths ) - { - this.last2SixMonths = last2SixMonths; - } - - private boolean thisYear; - - public void setThisYear( boolean thisYear ) - { - this.thisYear = thisYear; - } - - private boolean last5Years; - - public void setLast5Years( boolean last5Years ) - { - this.last5Years = last5Years; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - { - Chart chart = id == null ? new Chart() : chartService.getChart( id ); - - List indicators = new ArrayList(); - List dataElements = new ArrayList(); - List organisationUnits = new ArrayList(); - List dataSets = new ArrayList(); - - for ( Integer id : getIntegerCollection( selectedIndicators ) ) - { - indicators.add( indicatorService.getIndicator( id ) ); - } - - for ( Integer id : getIntegerCollection( selectedDataElements ) ) - { - dataElements.add( dataElementService.getDataElement( id ) ); - } - - for ( Integer id : getIntegerCollection( selectedDataSets ) ) - { - dataSets.add( dataSetService.getDataSet( id ) ); - } - - for ( Integer id : getIntegerCollection( selectedOrganisationUnits ) ) - { - organisationUnits.add( organisationUnitService.getOrganisationUnit( id ) ); - } - - chart.setName( name ); - chart.setDomainAxisLabel( StringUtils.trimToNull( domainAxisLabel ) ); - chart.setRangeAxisLabel( StringUtils.trimToNull( rangeAxisLabel ) ); - chart.setHideSubtitle( hideSubtitle ); - chart.setType( type ); - chart.setSeries( series ); - chart.setCategory( category ); - chart.setFilter( filter ); - chart.setHideLegend( hideLegend ); - chart.setRegression( regression ); - chart.setTargetLine( targetLine ); - chart.setTargetLineValue( targetLineValue ); - chart.setTargetLineLabel( StringUtils.trimToNull( targetLineLabel ) ); - chart.setUserOrganisationUnit( userOrganisationUnit ); - chart.setIndicators( indicators ); - chart.setDataElements( dataElements ); - chart.setDataSets( dataSets ); - chart.setOrganisationUnits( organisationUnits ); - - RelativePeriods rp = new RelativePeriods(); - rp.setReportingMonth( lastMonth ); - rp.setLast12Months( last12Months ); - rp.setReportingQuarter( lastQuarter ); - rp.setLast4Quarters( last4Quarters ); - rp.setLastSixMonth( lastSixMonth ); - rp.setLast2SixMonths( last2SixMonths ); - rp.setThisYear( thisYear ); - rp.setLast5Years( last5Years ); - - chart.setRelatives( rp ); - - chartService.saveChart( chart ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/ValidateChartAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/ValidateChartAction.java 2011-11-12 18:43:35 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/ValidateChartAction.java 1970-01-01 00:00:00 +0000 @@ -1,127 +0,0 @@ -package org.hisp.dhis.reporting.chart.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 org.hisp.dhis.chart.Chart; -import org.hisp.dhis.chart.ChartService; -import org.hisp.dhis.i18n.I18n; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class ValidateChartAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ChartService chartService; - - public void setChartService( ChartService chartService ) - { - this.chartService = chartService; - } - - private I18n i18n; - - public void setI18n( I18n i18n ) - { - this.i18n = i18n; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Integer id; - - public void setId( Integer id ) - { - this.id = id; - } - - private String name; - - public void setName( String name ) - { - this.name = name; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private String message; - - public String getMessage() - { - return message; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - { - if ( name == null ) - { - message = i18n.getString( "specify_title" ); - - return INPUT; - } - else - { - name = name.trim(); - - if ( name.length() == 0 ) - { - message = i18n.getString( "specify_title" ); - - return INPUT; - } - - Chart match = chartService.getChartByName( name ); - - if ( match != null && (id == null || match.getId() != id) ) - { - message = i18n.getString( "title_in_use" ); - - return INPUT; - } - } - - message = i18n.getString( "ok" ); - - return SUCCESS; - } -} === 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 2011-12-22 17:28:35 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2011-12-22 21:17:05 +0000 @@ -57,44 +57,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - displayViewChartForm.action - F_CHART_ADD - - - - /dhis-web-commons/ajax/jsonResponseSuccess.vm - F_CHART_DELETE - plainTextError - - - - /main.vm - /dhis-web-reporting/addChartForm.vm - /dhis-web-reporting/menu.vm - javascript/lists.js,javascript/chart.js - F_CHART_ADD - - - - /main.vm - /dhis-web-reporting/viewChartForm.vm - /dhis-web-reporting/menu.vm - javascript/chart.js - ../dhis-web-commons/paging/paging.css - - @@ -97,22 +70,6 @@ - - - /dhis-web-reporting/jsonChart.vm - plainTextError - - - - /dhis-web-reporting/jsonCharts.vm - plainTextError - - - - /dhis-web-commons/ajax/jsonResponseSuccess.vm - /dhis-web-commons/ajax/jsonResponseInput.vm - plainTextError - === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartDataElementModeForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartDataElementModeForm.vm 2011-12-22 13:09:31 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartDataElementModeForm.vm 1970-01-01 00:00:00 +0000 @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$i18n.getString( "relative_periods" )
- -   - -   - -   - -
- - -   - -   - - - - -
$i18n.getString( "value_x_available_dataelements" )
- -
- -
- - - - -
$i18n.getString( "value_x_selected_dataelements" )
- - -

- -
$i18n.getString( "filter_available_organisationunits" ) - $i18n.getString( 'clear' )
- -
- -
=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartDataElementOrgunitOrPeriodForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartDataElementOrgunitOrPeriodForm.vm 2011-06-07 16:12:23 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartDataElementOrgunitOrPeriodForm.vm 1970-01-01 00:00:00 +0000 @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #if ( $dimension == "period_dataElement" ) - #parse( "dhis-web-reporting/addChartPeriodModeForm.vm" ) - #else - #parse( "dhis-web-reporting/addChartOrganisationUnitModeForm.vm" ) - #end - - - - - -
$i18n.getString( "value_y_available_dataelements" )
- -
- -
- - - - -
$i18n.getString( "value_y_selected_dataelements" )
- - -

- -
- - === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartForm.vm 2011-12-22 13:59:37 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartForm.vm 1970-01-01 00:00:00 +0000 @@ -1,155 +0,0 @@ - - -#macro ( getHeader ) - #if ( $dimension == "period" ) - $i18n.getString( "create_period_by_indicator_chart" ) - #elseif( $dimension == "period_dataElement" ) - $i18n.getString( "create_period_by_dataelement_chart" ) - #elseif ( $dimension == "organisationUnit" ) - $i18n.getString( "create_indicator_by_organisation_unit_chart" ) - #elseif ( $dimension == "organisationUnit_dataElement" ) - $i18n.getString( "create_dataelement_by_organisation_unit_chart" ) - #elseif ( $dimension == "indicator" ) - $i18n.getString( "create_indicator_by_period_chart" ) - #elseif ( $dimension == "dataElement_period" ) - $i18n.getString( "create_dataelement_by_period_chart" ) - #end -#end - -

#getHeader()

- -
- - - - -#if ( $dimension == "period" || $dimension == "period_dataElement" ) - - - -#elseif ( $dimension == "indicator" || $dimension == "dataElement_period" ) - - - -#elseif ( $dimension == "organisationUnit" || $dimension == "organisationUnit_dataElement" ) - - - -#end - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #if ( $currentUser && $currentUser.hasOrganisationUnit() ) - - - - - #end - - - -
$i18n.getString( "chart" )
- -
- -#if ( $dimension == "period" ) - #parse( "dhis-web-reporting/addChartOrgunitOrPeriodForm.vm" ) -#elseif( $dimension == "period_dataElement" ) - #parse( "dhis-web-reporting/addChartDataElementOrgunitOrPeriodForm.vm" ) -#elseif ( $dimension == "organisationUnit" ) - #parse( "dhis-web-reporting/addChartOrgunitOrPeriodForm.vm" ) -#elseif ( $dimension == "organisationUnit_dataElement" ) - #parse( "dhis-web-reporting/addChartDataElementOrgunitOrPeriodForm.vm" ) -#elseif ( $dimension == "indicator" ) - #parse( "dhis-web-reporting/addChartIndicatorModeForm.vm" ) -#elseif ( $dimension == "dataElement_period" ) - #parse( "dhis-web-reporting/addChartDataElementModeForm.vm" ) -#end - - - - - - -
- - -
- -
- - === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartIndicatorModeForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartIndicatorModeForm.vm 2011-12-22 13:09:31 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartIndicatorModeForm.vm 1970-01-01 00:00:00 +0000 @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$i18n.getString( "relative_periods" )
- -   - -   - -   - -
- - -   - -   - - - - -
$i18n.getString( "value_x_available_indicators" )
- -
- -
- - - - -
$i18n.getString( "value_x_selected_indicators" )
- - -

- -
$i18n.getString( "filter_available_organisationunits" ) - $i18n.getString( 'clear' )
- -
- -
=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartOrganisationUnitModeForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartOrganisationUnitModeForm.vm 2011-12-22 13:09:31 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartOrganisationUnitModeForm.vm 1970-01-01 00:00:00 +0000 @@ -1,77 +0,0 @@ - - - - - $i18n.getString( "category_x_available_organisationunits" ) - - - - - - - - - - - - - - - - - - - - - - - $i18n.getString( "category_x_selected_organisationunits" ) - - - - - - - -

- - - - - - - - - - - $i18n.getString( "filter_available_periods" ) - - - - -   - -   - -   - - - - \ No newline at end of file === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartOrgunitOrPeriodForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartOrgunitOrPeriodForm.vm 2011-06-23 14:27:06 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartOrgunitOrPeriodForm.vm 1970-01-01 00:00:00 +0000 @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #if ( $dimension == "period" ) - #parse( "dhis-web-reporting/addChartPeriodModeForm.vm" ) - #else - #parse( "dhis-web-reporting/addChartOrganisationUnitModeForm.vm" ) - #end - - - - - -
$i18n.getString( "value_y_available_indicators" )
- -
- -
- - - - -
$i18n.getString( "value_y_selected_indicators" )
- - -

- -
- - === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartPeriodModeForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartPeriodModeForm.vm 2011-12-22 13:09:31 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartPeriodModeForm.vm 1970-01-01 00:00:00 +0000 @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -
$i18n.getString( "relative_periods" )
- -   - -   - -   - -
- - -   - -   - - - - -
$i18n.getString( "filter_available_organisationunits" ) - $i18n.getString( 'clear' )
- -
- -
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/index.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/index.vm 2011-12-09 20:44:59 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/index.vm 2011-12-22 21:17:05 +0000 @@ -15,6 +15,5 @@ #introListImgItem( "displayOrgUnitDistribution.action" "orgunit_distribution_report" "distribution" ) #introListImgItem( "tallySheetGenerator.action" "tally_sheet_generator" "tallysheetgenerator" ) #introListImgItem( "displayManageTableForm.action" "report_table" "reporttable" ) - #introListImgItem( "displayViewChartForm.action" "chart" "chart" ) #introListImgItem( "displayPivotTableForm.action" "pivot_table" "pivottable" ) === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/addChartGroupForm.js' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/addChartGroupForm.js 2011-08-19 21:33:57 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/addChartGroupForm.js 1970-01-01 00:00:00 +0000 @@ -1,19 +0,0 @@ -jQuery( document ).ready( function() -{ - validation2( 'addChartGroupForm', function( form ) - { - form.submit(); - }, { - 'beforeValidateHandler' : function() - { - listValidator( 'memberValidator', 'groupMembers' ); - }, - 'rules' : getValidationRules( "chartGroup" ) - } ); - - checkValueIsExist( "name", "validateChartGroup.action" ); - - var nameField = document.getElementById( 'name' ); - nameField.select(); - nameField.focus(); -} ); === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/addReportGroupForm.js' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/addReportGroupForm.js 2011-08-19 21:33:57 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/addReportGroupForm.js 1970-01-01 00:00:00 +0000 @@ -1,19 +0,0 @@ -jQuery( document ).ready( function() -{ - validation2( 'addReportGroupForm', function( form ) - { - form.submit(); - }, { - 'beforeValidateHandler' : function() - { - listValidator( 'memberValidator', 'groupMembers' ); - }, - 'rules' : getValidationRules( "reportGroup" ) - } ); - - checkValueIsExist( "name", "validateReportGroup.action" ); - - var nameField = document.getElementById( 'name' ); - nameField.select(); - nameField.focus(); -} ); === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/addReportTableGroupForm.js' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/addReportTableGroupForm.js 2011-08-19 21:33:57 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/addReportTableGroupForm.js 1970-01-01 00:00:00 +0000 @@ -1,19 +0,0 @@ -jQuery( document ).ready( function() -{ - validation2( 'addReportTableGroupForm', function( form ) - { - form.submit(); - }, { - 'beforeValidateHandler' : function() - { - listValidator( 'memberValidator', 'groupMembers' ); - }, - 'rules' : getValidationRules( "reportTableGroup" ) - } ); - - checkValueIsExist( "name", "validateReportTableGroup.action" ); - - var nameField = document.getElementById( 'name' ); - nameField.select(); - nameField.focus(); -} ); === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js 2011-12-22 13:09:31 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js 1970-01-01 00:00:00 +0000 @@ -1,202 +0,0 @@ -// ----------------------------------------------------------------------------- -// View chart -// ----------------------------------------------------------------------------- - -function viewChart( url ) -{ - $( '#chartImage' ).attr( 'src', url ); - $( '#chartView' ).dialog( { - autoOpen : true, - modal : true, - height : 565, - width : 745, - resizable : false, - title : 'Viewing Chart' - } ); -} - -// ----------------------------------------------------------------------------- -// Remove chart -// ----------------------------------------------------------------------------- - -function removeChart( chartId, chartTitle ) -{ - removeItem( chartId, chartTitle, i18n_confirm_delete, "removeChart.action" ); -} - -// ----------------------------------------------------------------------------- -// Show chart details -// ----------------------------------------------------------------------------- - -function showChartDetails( chartId ) -{ - jQuery.post( 'getChart.action', { - id : chartId - }, function( json ) - { - var indicators = parseInt( json.chart.indicators ); - var dataElements = parseInt( json.chart.dataElements ); - var dataSets = parseInt( json.chart.dataSets ); - - setInnerHTML( 'nameField', json.chart.name ); - setInnerHTML( 'dimensionField', json.chart.dimension ); - - if ( isIndicatorChart( json.chart.dimension ) ) - { - $( '#dataElementsView' ).hide(); - $( '#dataSetsView' ).hide(); - $( '#indicatorsView' ).show(); - - $( '#indicatorsField' ).text( indicators ); - } - else if ( isDataElementChart( json.chart.dimension ) ) - { - $( '#indicatorsView' ).hide(); - $( '#dataSetsView' ).hide(); - $( '#dataElementsView' ).show(); - - $( '#dataElementsField' ).text( dataElements ); - } - - setInnerHTML( 'periodsField', json.chart.periods ); - setInnerHTML( 'organisationUnitsField', json.chart.organisationUnits ); - - showDetails(); - } ); -} - -// ----------------------------------------------------------------------------- -// Validate and save -// ----------------------------------------------------------------------------- - -function saveChart( dimension ) -{ - if ( validateTargetLine() && validateCollections( dimension ) ) - { - $.postJSON( "validateChart.action", { - id : getFieldValue( "id" ), - name : getFieldValue( "name" ) - }, function( json ) - { - if ( json.response == "input" ) - { - setMessage( json.message ); - return false; - } - else if ( json.response == "success" ) - { - if ( $( "#selectedIndicators" ).attr( 'multiple' ) !== undefined ) - { - $( "#selectedIndicators" ).children().attr( "selected", true ); - } - - if ( $( "#selectedDataElements" ).attr( 'multiple' ) !== undefined ) - { - $( "#selectedDataElements" ).children().attr( "selected", true ); - } - - if ( $( "#selectedDataSets" ).attr( 'multiple' ) !== undefined ) - { - $( "#selectedDataSets" ).children().attr( "selected", true ); - } - - if ( $( "#selectedOrganisationUnits" ).attr( 'multiple' ) !== undefined ) - { - $( "#selectedOrganisationUnits" ).children().attr( "selected", true ); - } - - $( "#chartForm" ).submit(); - } - } ); - } -} - -function selectedChartType() -{ - return $( "#type" ).val(); -} - -function selectedIndicatorsCount() -{ - return $( "#selectedIndicators option" ).length; -} - -function validateTargetLine() -{ - var targetLine = $( "#targetLine" ).attr( "checked" ); - - if ( targetLine ) - { - var targetLineValue = $( "#targetLineValue" ).val(); - - if ( targetLineValue.length == 0 ) - { - setMessage( i18n_target_line_value_must_be_provided ); - - return false; - } - - if ( isNaN( targetLineValue ) ) - { - setMessage( i18n_target_line_value_must_be_number ); - - return false; - } - } - - return true; -} - -function isIndicatorChart( dimension ) -{ - if ( dimension == "period" || dimension == "organisationUnit" || dimension == "indicator" ) - { - return true; - } - - return false; -} - -function isDataElementChart( dimension ) -{ - if ( dimension == "period_dataElement" || dimension == "organisationUnit_dataElement" - || dimension == "dataElement_period" ) - { - return true; - } - - return false; -} - -function validateCollections( dimension ) -{ - if ( isIndicatorChart( dimension ) && !hasElements( "selectedIndicators" ) ) - { - setMessage( i18n_must_select_at_least_one_indicator ); - - return false; - } - - if ( isDataElementChart( dimension ) && !hasElements( "selectedDataElements" ) ) - { - setMessage( i18n_must_select_at_least_one_dataelement ); - - return false; - } - - if ( !hasElements( "selectedOrganisationUnits" ) && !isChecked( "userOrganisationUnit" ) ) - { - setMessage( i18n_must_select_at_least_one_unit ); - - return false; - } - - if ( !relativePeriodsChecked() ) - { - setMessage( i18n_must_select_at_least_one_period ); - - return false; - } - - return true; -} === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chartGroup.js' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chartGroup.js 2011-09-29 06:40:09 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chartGroup.js 1970-01-01 00:00:00 +0000 @@ -1,18 +0,0 @@ -function showChartGroupDetails( chartGroupId ) -{ - jQuery.post( 'getChartGroup.action', { id: chartGroupId }, function ( json ) { - setInnerHTML( 'nameField', json.chartGroup.name ); - setInnerHTML( 'memberCountField', json.chartGroup.memberCount ); - - showDetails(); - }); -} - -// ----------------------------------------------------------------------------- -// Remove chart group -// ----------------------------------------------------------------------------- - -function removeChartGroup( chartGroupId, chartGroupName ) -{ - removeItem( chartGroupId, chartGroupName, i18n_confirm_delete, 'removeChartGroup.action' ); -} === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/reportGroup.js' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/reportGroup.js 2011-09-29 06:40:09 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/reportGroup.js 1970-01-01 00:00:00 +0000 @@ -1,18 +0,0 @@ -function showReportGroupDetails( reportGroupId ) -{ - jQuery.post( 'getReportGroup.action', { id: reportGroupId }, function ( json ) { - setInnerHTML( 'nameField', json.reportGroup.name ); - setInnerHTML( 'memberCountField', json.reportGroup.memberCount ); - - showDetails(); - }); -} - -// ----------------------------------------------------------------------------- -// Remove report group -// ----------------------------------------------------------------------------- - -function removeReportGroup( reportGroupId, reportGroupName ) -{ - removeItem( reportGroupId, reportGroupName, i18n_confirm_delete, 'removeReportGroup.action' ); -} === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/reportTableGroup.js' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/reportTableGroup.js 2011-09-29 06:40:09 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/reportTableGroup.js 1970-01-01 00:00:00 +0000 @@ -1,19 +0,0 @@ -function showReportTableGroupDetails( reportTableGroupId ) -{ - jQuery.post( 'getReportTableGroup.action', { id: reportTableGroupId }, - function ( json ) { - setInnerHTML( 'nameField', json.reportTableGroup.name ); - setInnerHTML( 'memberCountField', json.reportTableGroup.memberCount ); - - showDetails(); - }); -} - -// ----------------------------------------------------------------------------- -// Remove report table group -// ----------------------------------------------------------------------------- - -function removeReportTableGroup( reportTableGroupId, reportTableGroupName ) -{ - removeItem( reportTableGroupId, reportTableGroupName, i18n_confirm_delete, 'removeReportTableGroup.action' ); -} === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/updateChartGroupForm.js' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/updateChartGroupForm.js 2011-08-19 21:33:57 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/updateChartGroupForm.js 1970-01-01 00:00:00 +0000 @@ -1,17 +0,0 @@ -jQuery( document ).ready( function() -{ - validation2( 'updateChartGroupForm', function( form ) - { - form.submit(); - }, { - 'beforeValidateHandler' : function() - { - listValidator( 'memberValidator', 'groupMembers' ); - }, - 'rules' : getValidationRules( "chartGroup" ) - } ); - - checkValueIsExist( "name", "validateChartGroup.action", { - id : getFieldValue( "id" ) - } ); -} ); === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/updateReportGroupForm.js' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/updateReportGroupForm.js 2011-08-19 21:33:57 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/updateReportGroupForm.js 1970-01-01 00:00:00 +0000 @@ -1,17 +0,0 @@ -jQuery( document ).ready( function() -{ - validation2( 'updateReportGroupForm', function( form ) - { - form.submit(); - }, { - 'beforeValidateHandler' : function() - { - listValidator( 'memberValidator', 'groupMembers' ); - }, - 'rules' : getValidationRules( "reportGroup" ) - } ); - - checkValueIsExist( "name", "validateReportGroup.action", { - id : getFieldValue( "id" ) - } ); -} ); === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/updateReportTableGroupForm.js' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/updateReportTableGroupForm.js 2011-08-19 21:33:57 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/updateReportTableGroupForm.js 1970-01-01 00:00:00 +0000 @@ -1,18 +0,0 @@ -jQuery( document ).ready( function() -{ - validation2( 'updateReportTableGroupForm', function( form ) - { - form.submit(); - }, { - 'beforeValidateHandler' : function() - { - listValidator( 'memberValidator', 'groupMembers' ); - }, - 'rules' : getValidationRules( "reportTableGroup" ) - } ); - - checkValueIsExist( "name", "validateReportTableGroup.action", { - id : getFieldValue( "id" ) - } ); - -} ); === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/jsonChart.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/jsonChart.vm 2011-11-21 12:44:20 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/jsonChart.vm 1970-01-01 00:00:00 +0000 @@ -1,12 +0,0 @@ -{ "chart": - { - "id": "$!{chart.id}", - "name": "$!encoder.jsonEncode( ${chart.name} )", - "dimension": "$!encoder.jsonEncode( ${chart.dimension} )", - "indicators": "$!{chart.indicators.size()}", - "dataElements": "$!{chart.dataElements.size()}", - "dataSets": "$!{chart.dataSets.size()}", - "periods": "$!{chart.periods.size()}", - "organisationUnits": "$!{chart.organisationUnits.size()}" - } -} === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/jsonCharts.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/jsonCharts.vm 2011-11-12 18:43:35 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/jsonCharts.vm 1970-01-01 00:00:00 +0000 @@ -1,20 +0,0 @@ -#set( $size = $charts.size() ) -{ "charts": [ -#foreach( $chart in $charts ) -#set( $groups = $chart.groups ) - { - "id": $!{chart.id}, - "name": "$!encoder.jsonEncode( ${chart.name} )", - "dimension": "$!encoder.jsonEncode( ${chart.dimension} )", - "indicators": "$!encoder.jsonEncode( ${chart.indicators.size()} )", - "dataElements": "$!encoder.jsonEncode( ${chart.dataElements.size()} )", - "periods": "${chart.periods.size()}", - "organisationUnits": $!{chart.organisationUnits.size()}, - "groups": [ #foreach( $group in $groups )${group.id}#if( $velocityCount < $groups.size() ),#end#end ] - }#if( $velocityCount < $size ),#end -#end -] -#if( $usePaging ), - "paging":#parse( "/dhis-web-commons/ajax/jsonPaging.vm" ) -#end -} \ No newline at end of file === 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 2011-12-09 20:44:59 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/menu.vm 2011-12-22 21:17:05 +0000 @@ -10,11 +10,6 @@
  • $i18n.getString( "report_table" ) 
  • -

    $i18n.getString( "chart" ) 

    - -

    $i18n.getString( "pivot_table" ) 

    • $i18n.getString( "pivot_table" ) 
    • === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm 2011-12-21 22:11:29 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm 1970-01-01 00:00:00 +0000 @@ -1,92 +0,0 @@ - - -

      $i18n.getString( "chart" )

      - -
    - - - - -
    - - - - - -
    #filterDiv( "displayViewChartForm" ) - - -
    - - - - - - - - - - - #foreach ( $chart in $charts ) - - - - - #end - -
    $i18n.getString( "title" )$i18n.getString( "operations" )
    $encoder.htmlEncode( $chart.name ) - $i18n.getString( - $i18n.getString( - #if( $auth.hasAccess( "dhis-web-reporting", "removeChart" ) ) - $i18n.getString( - #else #end - $i18n.getString( -
    -

    - #parse( "/dhis-web-commons/paging/paging.vm" ) -
    - - - -
    - - === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewGroups.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewGroups.vm 2011-07-29 03:29:05 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewGroups.vm 1970-01-01 00:00:00 +0000 @@ -1,14 +0,0 @@ - - -

    $i18n.getString( "groups" )

    - -
      - #introListImgItem( "chartGroup.action" "chart_groups" "groups") - #introListImgItem( "reportGroup.action" "report_groups" "groups") - #introListImgItem( "reportTableGroup.action" "report_table_groups" "groups" ) -
    \ No newline at end of file