=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java 2011-05-24 20:20:45 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java 2011-05-25 13:17:19 +0000 @@ -36,6 +36,8 @@ import org.hisp.dhis.dataelement.DataElementService; import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator; import org.hisp.dhis.paging.ActionPagingSupport; +import org.hisp.dhis.system.filter.DataElementGroupWithoutGroupSetFilter; +import org.hisp.dhis.system.util.FilterUtils; import org.hisp.dhis.system.util.IdentifiableObjectUtils; /** @@ -67,6 +69,13 @@ this.key = key; } + public boolean filterNoGroupSet; + + public void setFilterNoGroupSet( boolean filterNoGroupSet ) + { + this.filterNoGroupSet = filterNoGroupSet; + } + private List removeDataElementGroups = new ArrayList(); public void setRemoveDataElementGroups( String removeDataElementGroups ) @@ -98,6 +107,11 @@ { dataElementGroups = new ArrayList( dataElementService.getAllDataElementGroups() ); + if ( filterNoGroupSet ) + { + FilterUtils.filter( dataElementGroups, new DataElementGroupWithoutGroupSetFilter() ); + } + if ( removeDataElementGroups.size() > 0 ) { for ( Integer id : removeDataElementGroups ) === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupsAction.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupsAction.java 2011-05-24 09:42:48 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupsAction.java 2011-05-25 13:17:19 +0000 @@ -28,13 +28,17 @@ */ import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; +import org.hisp.dhis.dataelement.DataElementGroup; import org.hisp.dhis.indicator.IndicatorGroup; import org.hisp.dhis.indicator.IndicatorService; import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator; import org.hisp.dhis.paging.ActionPagingSupport; +import org.hisp.dhis.system.filter.IndicatorGroupWIthoutGroupSetFilter; +import org.hisp.dhis.system.util.FilterUtils; import org.hisp.dhis.system.util.IdentifiableObjectUtils; /** @@ -65,6 +69,28 @@ this.key = key; } + public boolean filterNoGroupSet = false; + + public void setFilterNoGroupSet( boolean filterNoGroupSet ) + { + this.filterNoGroupSet = filterNoGroupSet; + } + + private List removeIndicatorGroups = new ArrayList(); + + public void setRemoveIndicatorGroups( String removeIndicatorGroups ) + { + if ( removeIndicatorGroups.length() > 0 ) + { + List stringList = Arrays.asList( removeIndicatorGroups.split( "," ) ); + + for ( String s : stringList ) + { + this.removeIndicatorGroups.add( Integer.parseInt( s ) ); + } + } + } + private List indicatorGroups; public List getIndicatorGroups() @@ -80,6 +106,20 @@ { indicatorGroups = new ArrayList( indicatorService.getAllIndicatorGroups() ); + if ( filterNoGroupSet ) + { + FilterUtils.filter( indicatorGroups, new IndicatorGroupWIthoutGroupSetFilter() ); + } + + if ( removeIndicatorGroups.size() > 0 ) + { + for ( Integer id : removeIndicatorGroups ) + { + IndicatorGroup indicatorGroup = indicatorService.getIndicatorGroup( id ); + indicatorGroups.remove( indicatorGroup ); + } + } + if ( key != null ) { indicatorGroups = IdentifiableObjectUtils.filterNameByKey( indicatorGroups, key, true ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementGroupSet.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementGroupSet.vm 2011-05-24 20:20:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementGroupSet.vm 2011-05-25 13:17:19 +0000 @@ -13,6 +13,9 @@ option.attr( "value", item.id ); return option; + }, + params: { + filterNoGroupSet: true } }); }); @@ -52,11 +55,11 @@ - + -
+

-
+
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupSet.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupSet.vm 2011-03-31 13:13:10 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupSet.vm 2011-05-25 13:17:19 +0000 @@ -1,4 +1,25 @@ +

$i18n.getString( "add_indicatorgroupset" )

@@ -18,43 +39,39 @@ + + + + - - - - - - - + + + + + - + - - -
$i18n.getString( "available_indicatorgroup" )$i18n.getString( "group_members" ) -
< $i18n.getString( "filters" ) >
$i18n.getString( "available_indicatorgroup" )$i18n.getString( "group_members" ) +
- + -
-
-
- +
+
+
+
- - - $i18n.getString( 'move_up' ) -
- $i18n.getString( 'move_up' ) + +
+
-

+

+ + +

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm 2011-05-24 20:20:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm 2011-05-25 13:17:19 +0000 @@ -28,6 +28,7 @@ }, removeDataElementGroups: removeDataElementGroupsList, params: { + filterNoGroupSet: true, removeDataElementGroups: removeDataElementGroupsList.join(",") } }); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.vm 2011-03-31 13:13:10 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.vm 2011-05-25 13:17:19 +0000 @@ -1,6 +1,38 @@ @@ -23,47 +55,43 @@ + + + + - - - - - - - + + + + + - + - + - -
$i18n.getString( "available_indicatorgroup" )$i18n.getString( "group_members" ) -
< $i18n.getString( "filters" ) >
$i18n.getString( "available_indicatorgroup" )$i18n.getString( "group_members" ) +
- + -
-
-
- +
+
+
+
- #foreach( $indicatorGroup in $selectedGroups ) #end - $i18n.getString( 'move_up' ) -
- $i18n.getString( 'move_up' ) -
-

+

+ + +