=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java 2011-09-21 12:46:20 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java 2011-09-21 15:41:25 +0000 @@ -55,10 +55,12 @@ private boolean userAttribute; + private Integer sortOrder; + private Set attributeOptions = new HashSet(); - + private Set attributeValues = new HashSet(); - + public Attribute() { @@ -120,6 +122,16 @@ this.organisationUnitAttribute = organisationUnitAttribute; } + public void setAttributeValues( Set attributeValues ) + { + this.attributeValues = attributeValues; + } + + public void setSortOrder( Integer sortOrder ) + { + this.sortOrder = sortOrder; + } + public boolean isUserAttribute() { return userAttribute; @@ -144,12 +156,7 @@ { return attributeValues; } - - public void setAttributeValues( Set attributeValues ) - { - this.attributeValues = attributeValues; - } - + // ------------------------------------------------------------------------- // Helpers // ------------------------------------------------------------------------- @@ -165,4 +172,9 @@ attributeOption.getAttributes().remove( this ); attributeOptions.remove( attributeOption ); } + + public Integer getSortOrder() + { + return sortOrder; + } } === added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/comparator/AttributeSortOrderComparator.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/comparator/AttributeSortOrderComparator.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/comparator/AttributeSortOrderComparator.java 2011-09-21 15:41:25 +0000 @@ -0,0 +1,54 @@ +/* + * 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. + */ + +package org.hisp.dhis.attribute.comparator; + +import java.util.Comparator; + +import org.hisp.dhis.attribute.Attribute; + +/** + * @author mortenoh + */ +public class AttributeSortOrderComparator + implements Comparator +{ + @Override + public int compare( Attribute attribute0, Attribute attribute1 ) + { + if ( attribute0.getSortOrder() == null || attribute0.getSortOrder() == 0 ) + { + return attribute0.getName().compareTo( attribute1.getName() ); + } + if ( attribute1.getSortOrder() == null || attribute1.getSortOrder() == 0 ) + { + return attribute0.getName().compareTo( attribute1.getName() ); + } + + return attribute0.getSortOrder() - attribute1.getSortOrder(); + } +} === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml' --- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml 2011-09-21 12:46:20 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml 2011-09-21 15:41:25 +0000 @@ -26,6 +26,8 @@ + + === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeListSortOrderAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeListSortOrderAction.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/attribute/GetAttributeListSortOrderAction.java 2011-09-21 15:41:25 +0000 @@ -0,0 +1,82 @@ +/* + * 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. + */ + +package org.hisp.dhis.dataadmin.action.attribute; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.hisp.dhis.attribute.Attribute; +import org.hisp.dhis.attribute.AttributeService; +import org.hisp.dhis.attribute.comparator.AttributeNameComparator; +import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator; + +import com.opensymphony.xwork2.Action; + +/** + * @author mortenoh + */ +public class GetAttributeListSortOrderAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private AttributeService attributeService; + + public void setAttributeService( AttributeService attributeService ) + { + this.attributeService = attributeService; + } + + // ------------------------------------------------------------------------- + // Input & Output + // ------------------------------------------------------------------------- + + private List attributes; + + public List getAttributes() + { + return attributes; + } + + // ------------------------------------------------------------------------- + // Action Implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + { + attributes = new ArrayList( attributeService.getAllAttributes() ); + + Collections.sort( attributes, new AttributeSortOrderComparator() ); + + return SUCCESS; + } +} === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/SaveAttributeSortOrderAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/SaveAttributeSortOrderAction.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/attribute/SaveAttributeSortOrderAction.java 2011-09-21 15:41:25 +0000 @@ -0,0 +1,82 @@ +/* + * 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. + */ + +package org.hisp.dhis.dataadmin.action.attribute; + +import java.util.List; + +import org.hisp.dhis.attribute.Attribute; +import org.hisp.dhis.attribute.AttributeService; + +import com.opensymphony.xwork2.Action; + +public class SaveAttributeSortOrderAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private AttributeService attributeService; + + public void setAttributeService( AttributeService attributeService ) + { + this.attributeService = attributeService; + } + + // ------------------------------------------------------------------------- + // Input & Output + // ------------------------------------------------------------------------- + + private List attributes; + + public void setAttributes( List attributes ) + { + this.attributes = attributes; + } + + // ------------------------------------------------------------------------- + // Action Implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + { + int sortOrder = 1; + + for ( Integer id : attributes ) + { + Attribute attribute = attributeService.getAttribute( id ); + + attribute.setSortOrder( sortOrder++ ); + + attributeService.updateAttribute( attribute ); + } + + return SUCCESS; + } +} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml 2011-09-11 10:39:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml 2011-09-21 15:41:25 +0000 @@ -79,7 +79,7 @@ scope="prototype"> - + + + + + @@ -323,6 +328,11 @@ + + + + === 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-09-21 12:46:20 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties 2011-09-21 15:41:25 +0000 @@ -354,8 +354,9 @@ edit_attribute = Edit Attribute create_new_attribute_option = Add Attribute Option edit_attribute_option = Edit Attribute Option -assigned_to = Assigned To +assigned_to = Assigned to available_attribute_options = Available Attribute Options selected_attribute_options = Selected Attribute Options +attribute_sort_order = Attribute sort order data_element_does_not_exist = Data element does not exist category_option_combo_does_not_exist = Category option combo does not exist === 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-09-08 19:37:59 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml 2011-09-21 15:41:25 +0000 @@ -523,6 +523,11 @@ F_DATAELEMENT_UPDATE + + /main.vm + /dhis-web-maintenance-dataadmin/sortAttributeForm.vm + + attribute.action index.action @@ -535,6 +540,11 @@ F_DATAELEMENT_ADD + + attribute.action + F_DATAELEMENT_UPDATE + + attribute.action index.action === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/attribute.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/attribute.vm 2011-09-09 08:14:38 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/attribute.vm 2011-09-21 15:41:25 +0000 @@ -36,6 +36,7 @@ #filterDiv( "attribute" ) + === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/sortAttributeForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/sortAttributeForm.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/sortAttributeForm.vm 2011-09-21 15:41:25 +0000 @@ -0,0 +1,33 @@ + + +

$i18n.getString( "attribute_sort_order" )

+ +
+ +

+ + + + +

+ +

+ +

+ +

+ + +

+ +
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementListSortOrderAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementListSortOrderAction.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementListSortOrderAction.java 2011-09-21 15:41:25 +0000 @@ -85,11 +85,11 @@ public String execute() { dataElements = new ArrayList( dataElementService.getAllDataElements() ); - + Collections.sort( dataElements, new DataElementSortOrderComparator() ); - + displayPropertyHandler.handle( dataElements ); - + return SUCCESS; } } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java 2011-09-16 09:29:21 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java 2011-09-21 15:41:25 +0000 @@ -35,6 +35,7 @@ import org.hisp.dhis.attribute.Attribute; import org.hisp.dhis.attribute.AttributeService; import org.hisp.dhis.attribute.comparator.AttributeNameComparator; +import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator; import org.hisp.dhis.dataelement.DataElementCategoryCombo; import org.hisp.dhis.dataelement.DataElementCategoryService; import org.hisp.dhis.dataelement.DataElementGroup; @@ -143,7 +144,7 @@ attributes = new ArrayList( attributeService.getDataElementAttributes() ); - Collections.sort( attributes, new AttributeNameComparator() ); + Collections.sort( attributes, new AttributeSortOrderComparator() ); return SUCCESS; } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowUpdateDataElementFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowUpdateDataElementFormAction.java 2011-09-21 12:46:20 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowUpdateDataElementFormAction.java 2011-09-21 15:41:25 +0000 @@ -37,6 +37,7 @@ import org.hisp.dhis.attribute.Attribute; import org.hisp.dhis.attribute.AttributeService; import org.hisp.dhis.attribute.comparator.AttributeNameComparator; +import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator; import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataelement.DataElementCategoryCombo; import org.hisp.dhis.dataelement.DataElementCategoryService; @@ -184,7 +185,7 @@ attributes = new ArrayList( attributeService.getDataElementAttributes() ); - Collections.sort( attributes, new AttributeNameComparator() ); + Collections.sort( attributes, new AttributeSortOrderComparator() ); attributeValues = AttributeUtils.getAttributeValueMap( dataElement.getAttributeValues() ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ShowUpdateIndicatorFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ShowUpdateIndicatorFormAction.java 2011-09-21 12:46:20 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ShowUpdateIndicatorFormAction.java 2011-09-21 15:41:25 +0000 @@ -37,6 +37,7 @@ import org.hisp.dhis.attribute.AttributeService; import org.hisp.dhis.attribute.AttributeValue; import org.hisp.dhis.attribute.comparator.AttributeNameComparator; +import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator; import org.hisp.dhis.indicator.Indicator; import org.hisp.dhis.indicator.IndicatorService; import org.hisp.dhis.indicator.IndicatorType; @@ -145,7 +146,7 @@ attributes = new ArrayList( attributeService.getIndicatorAttributes() ); - Collections.sort( attributes, new AttributeNameComparator() ); + Collections.sort( attributes, new AttributeSortOrderComparator() ); attributeValues = AttributeUtils.getAttributeValueMap( indicator.getAttributeValues() ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatortype/GetIndicatorTypeListAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatortype/GetIndicatorTypeListAction.java 2011-09-21 12:46:20 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatortype/GetIndicatorTypeListAction.java 2011-09-21 15:41:25 +0000 @@ -36,6 +36,7 @@ import org.hisp.dhis.attribute.Attribute; import org.hisp.dhis.attribute.AttributeService; import org.hisp.dhis.attribute.comparator.AttributeNameComparator; +import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator; import org.hisp.dhis.indicator.IndicatorService; import org.hisp.dhis.indicator.IndicatorType; import org.hisp.dhis.indicator.comparator.IndicatorTypeNameComparator; @@ -125,7 +126,7 @@ attributes = new ArrayList( attributeService.getIndicatorAttributes() ); - Collections.sort( attributes, new AttributeNameComparator() ); + Collections.sort( attributes, new AttributeSortOrderComparator() ); return SUCCESS; } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/GetOrganisationUnitAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/GetOrganisationUnitAction.java 2011-09-21 12:46:20 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/GetOrganisationUnitAction.java 2011-09-21 15:41:25 +0000 @@ -36,6 +36,7 @@ import org.hisp.dhis.attribute.Attribute; import org.hisp.dhis.attribute.AttributeService; import org.hisp.dhis.attribute.comparator.AttributeNameComparator; +import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator; import org.hisp.dhis.dataset.DataSet; import org.hisp.dhis.dataset.DataSetService; import org.hisp.dhis.dataset.comparator.DataSetNameComparator; @@ -167,7 +168,7 @@ attributes = new ArrayList( attributeService.getDataElementAttributes() ); - Collections.sort( attributes, new AttributeNameComparator() ); + Collections.sort( attributes, new AttributeSortOrderComparator() ); attributeValues = AttributeUtils.getAttributeValueMap( organisationUnit.getAttributeValues() ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/PrepareAddOrganisationUnitAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/PrepareAddOrganisationUnitAction.java 2011-09-21 12:46:20 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/PrepareAddOrganisationUnitAction.java 2011-09-21 15:41:25 +0000 @@ -35,6 +35,7 @@ import org.hisp.dhis.attribute.Attribute; import org.hisp.dhis.attribute.AttributeService; import org.hisp.dhis.attribute.comparator.AttributeNameComparator; +import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator; import org.hisp.dhis.dataset.DataSet; import org.hisp.dhis.dataset.DataSetService; import org.hisp.dhis.dataset.comparator.DataSetNameComparator; @@ -126,7 +127,7 @@ Collections.sort( dataSets, new DataSetNameComparator() ); Collections.sort( groupSets, new OrganisationUnitGroupSetNameComparator() ); - Collections.sort( attributes, new AttributeNameComparator() ); + Collections.sort( attributes, new AttributeSortOrderComparator() ); return SUCCESS; } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/SetupTreeAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/SetupTreeAction.java 2011-09-21 12:46:20 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/SetupTreeAction.java 2011-09-21 15:41:25 +0000 @@ -37,6 +37,7 @@ import org.hisp.dhis.attribute.Attribute; import org.hisp.dhis.attribute.AttributeService; import org.hisp.dhis.attribute.comparator.AttributeNameComparator; +import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator; import org.hisp.dhis.organisationunit.OrganisationUnitGroup; import org.hisp.dhis.oust.manager.SelectionTreeManager; import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager; @@ -180,7 +181,7 @@ attributes = new ArrayList( attributeService.getDataElementAttributes() ); - Collections.sort( attributes, new AttributeNameComparator() ); + Collections.sort( attributes, new AttributeSortOrderComparator() ); return SUCCESS; }