=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2012-04-20 18:31:48 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2012-04-23 11:43:13 +0000 @@ -38,7 +38,6 @@ import org.hisp.dhis.common.BaseNameableObject; import org.hisp.dhis.common.Dxf2Namespace; import org.hisp.dhis.common.IdentifiableObject; -import org.hisp.dhis.common.annotation.Scanned; import org.hisp.dhis.common.view.DetailedView; import org.hisp.dhis.common.view.ExportView; import org.hisp.dhis.dataset.DataSet; === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/SectionOrderComparator.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/SectionOrderComparator.java 2011-12-26 10:07:59 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/SectionOrderComparator.java 2012-04-23 11:43:13 +0000 @@ -36,6 +36,16 @@ { public int compare( Section o1, Section o2 ) { + if ( o1.getDataSet() != null && o2.getDataSet() != null ) + { + int dataSet = o1.getDataSet().getName().compareTo( o2.getDataSet().getName() ); + + if ( dataSet != 0 ) + { + return dataSet; + } + } + return o1.getSortOrder() - o2.getSortOrder(); } } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SectionListAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SectionListAction.java 2012-01-25 17:11:43 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SectionListAction.java 2012-04-23 11:43:13 +0000 @@ -134,29 +134,23 @@ Collections.sort( datasets, IdentifiableObjectNameComparator.INSTANCE ); - Collection
temp = sectionService.getAllSections(); - - if ( dataSetId == null ) - { - sections = new ArrayList
( temp ); - } - else - { - sections = new ArrayList
(); - + if ( dataSetId != null && dataSetId != -1 ) + { DataSet dataSet = dataSetService.getDataSet( dataSetId ); - Set
dataSetSections = dataSet.getSections(); - sections = new ArrayList
( dataSetSections ); - - dataSet = dataSetService.getDataSet( dataSetId.intValue() ); + + sections = new ArrayList
( dataSet.getSections() ); for ( DataElement de : dataSet.getDataElements() ) { categoryCombos.add( de.getCategoryCombo() ); - } - - Collections.sort( sections, new SectionOrderComparator() ); - } + } + } + else + { + sections = new ArrayList
( sectionService.getAllSections() ); + } + + Collections.sort( sections, new SectionOrderComparator() ); return SUCCESS; } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties 2012-02-24 05:14:52 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties 2012-04-23 11:43:13 +0000 @@ -65,7 +65,7 @@ datasets=DataSets data=Data pivot=Pivot -please_select_dataset_or_categorycombo=Please select a dataset/category combo +please_select_dataset_or_categorycombo=Please select data set and category combination indicator_already_inserted=Indicator already inserted no_indicator_was_selected=No indicator was selected dataelement_already_inserted=Data element already inserted === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/section.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/section.js 2012-03-04 13:46:17 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/section.js 2012-04-23 11:43:13 +0000 @@ -11,44 +11,45 @@ setInnerHTML( 'dataElementCountField', json.section.dataElementCount ); showDetails(); - }); + } ); } function sortOrderSubmit() { - var datasetId = document.getElementById('dataSetId').value; + var dataSetId = $( "#dataSetId" ).val(); - if ( datasetId == "null" ) + if ( dataSetId && dataSetId != -1 ) + { + window.location.href = "showSortSectionForm.action?dataSetId=" + dataSetId; + } + else { window.alert( i18n_please_select_dataset ); - } else - { - window.location.href = "showSortSectionForm.action?dataSetId=" + datasetId; } } -function getSectionByDataSet(dataSetId) +function getSectionByDataSet( dataSetId ) { window.location.href = "section.action?dataSetId=" + dataSetId; } function removeSection(sectionId, sectionName) { - removeItem(sectionId, sectionName, i18n_confirm_delete, "removeSection.action"); + removeItem( sectionId, sectionName, i18n_confirm_delete, "removeSection.action" ); } function addSectionSubmit() { - var dataSetId = document.getElementById('dataSetId').value; - var categoryComboId = document.getElementById('categoryComboId').value; + var dataSetId = $( '#dataSetId' ).val(); + var categoryComboId = $( '#categoryComboId' ).val(); - if ( dataSetId == "null" || dataSetId == "" || categoryComboId == "null" || categoryComboId == "" ) - { - showWarningMessage( i18n_please_select_dataset_categorycombo ); - } - else + if ( dataSetId && dataSetId != "-1" && categoryComboId && categoryComboId != "-1" ) { window.location.href = "getSectionOptions.action?dataSetId=" + dataSetId + "&categoryComboId=" + categoryComboId; + } + else + { + showWarningMessage( i18n_please_select_dataset_categorycombo ); } } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sectionList.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sectionList.vm 2012-04-16 13:41:33 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sectionList.vm 2012-04-23 11:43:13 +0000 @@ -13,7 +13,7 @@
- + #foreach ( $categoryCombo in $categoryCombos ) #end