=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisPaging.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisPaging.js 2011-05-24 07:32:08 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisPaging.js 2011-05-26 14:44:02 +0000 @@ -33,6 +33,13 @@ // Support functions // ----------------------------------------------- +// Array Remove - By John Resig (MIT Licensed) +Array.remove = function(array, from, to) { + var rest = array.slice((to || from) + 1 || array.length); + array.length = from < 0 ? array.length + from : from; + return array.push.apply(array, rest); +}; + /* perform dblclick action on the sourceId */ function dhisPaging_moveAllSelected(sourceId) { @@ -99,10 +106,11 @@ if( jQuery.isArray(settings[removeArray]) ) { var remove_idx = jQuery.inArray(option_id, settings[removeArray]); - settings[removeArray].splice(remove_idx, remove_idx+1); + Array.remove(settings[removeArray], remove_idx, remove_idx); + //settings[removeArray].splice(remove_idx, remove_idx+1); } }); - + if(settings[removeArray] && settings[removeArray].length > 0) { settings.params[removeArray] = settings[removeArray].join(","); } else { === 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-25 13:17:19 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java 2011-05-26 14:44:02 +0000 @@ -33,6 +33,7 @@ import java.util.List; import org.hisp.dhis.dataelement.DataElementGroup; +import org.hisp.dhis.dataelement.DataElementGroupSet; import org.hisp.dhis.dataelement.DataElementService; import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator; import org.hisp.dhis.paging.ActionPagingSupport; @@ -62,6 +63,13 @@ // Input & output // ------------------------------------------------------------------------- + private Integer includeDataElementGroupId; + + public void setIncludeDataElementGroupId( Integer includeDataElementGroupId ) + { + this.includeDataElementGroupId = includeDataElementGroupId; + } + private String key; public void setKey( String key ) @@ -110,6 +118,12 @@ if ( filterNoGroupSet ) { FilterUtils.filter( dataElementGroups, new DataElementGroupWithoutGroupSetFilter() ); + + if ( includeDataElementGroupId != null ) + { + DataElementGroupSet groupSet = dataElementService.getDataElementGroupSet( includeDataElementGroupId ); + dataElementGroups.addAll( groupSet.getMembers() ); + } } if ( removeDataElementGroups.size() > 0 ) === 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-25 13:19:47 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupsAction.java 2011-05-26 14:44:02 +0000 @@ -33,6 +33,7 @@ import java.util.List; import org.hisp.dhis.indicator.IndicatorGroup; +import org.hisp.dhis.indicator.IndicatorGroupSet; import org.hisp.dhis.indicator.IndicatorService; import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator; import org.hisp.dhis.paging.ActionPagingSupport; @@ -61,6 +62,13 @@ // Input & Output // ------------------------------------------------------------------------- + private Integer includeIndicatorGroupSetId; + + public void setIncludeIndicatorGroupSetId( Integer includeIndicatorGroupId ) + { + this.includeIndicatorGroupSetId = includeIndicatorGroupId; + } + private String key; public void setKey( String key ) @@ -108,6 +116,12 @@ if ( filterNoGroupSet ) { FilterUtils.filter( indicatorGroups, new IndicatorGroupWIthoutGroupSetFilter() ); + + if ( includeIndicatorGroupSetId != null ) + { + IndicatorGroupSet groupSet = indicatorService.getIndicatorGroupSet( includeIndicatorGroupSetId ); + indicatorGroups.addAll( groupSet.getMembers() ); + } } if ( removeIndicatorGroups.size() > 0 ) === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupsAction.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupsAction.java 2011-05-26 12:49:27 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupsAction.java 2011-05-26 14:44:02 +0000 @@ -34,6 +34,7 @@ import org.hisp.dhis.organisationunit.OrganisationUnitGroup; import org.hisp.dhis.organisationunit.OrganisationUnitGroupService; +import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet; import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupNameComparator; import org.hisp.dhis.paging.ActionPagingSupport; import org.hisp.dhis.system.filter.OrganisationUnitGroupWithoutGroupSetFilter; @@ -62,6 +63,13 @@ // Input & output // ------------------------------------------------------------------------- + private Integer includeOrganisationUnitGroupId; + + public void setIncludeOrganisationUnitGroupId( Integer includeOrganisationUnitGroupId ) + { + this.includeOrganisationUnitGroupId = includeOrganisationUnitGroupId; + } + private String key; public void setKey( String key ) @@ -112,6 +120,13 @@ if ( filterNoGroupSet ) { FilterUtils.filter( organisationUnitGroups, new OrganisationUnitGroupWithoutGroupSetFilter() ); + + if ( includeOrganisationUnitGroupId != null ) + { + OrganisationUnitGroupSet groupSet = organisationUnitGroupService + .getOrganisationUnitGroupSet( includeOrganisationUnitGroupId ); + organisationUnitGroups.addAll( groupSet.getOrganisationUnitGroups() ); + } } if ( removeOrganisationUnitGroups.size() > 0 ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupForm.vm 2011-05-24 17:04:43 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupForm.vm 2011-05-26 14:44:02 +0000 @@ -13,9 +13,9 @@ jQuery(function() { jQuery("#availableDataElementsList").dblclick(dhisPaging_availableList_dblclick("availableDataElementsList", "groupMembers", "removeDataElements")); jQuery("#groupMembers").dblclick(dhisPaging_selectedList_dblclick("groupMembers", "availableDataElementsList", "removeDataElements")); - + var removeDataElementsList = getRemoveDataElements(); - + jQuery("#availableDataElementsList").dhisPaging({ source: "../dhis-web-commons-ajax-json/getDataElements.action", iterator: "dataElements", === 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-25 13:17:19 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm 2011-05-26 14:44:02 +0000 @@ -29,6 +29,7 @@ removeDataElementGroups: removeDataElementGroupsList, params: { filterNoGroupSet: true, + includeDataElementGroupId: $dataElementGroupSet.id, removeDataElementGroups: removeDataElementGroupsList.join(",") } }); @@ -38,7 +39,9 @@