=== removed file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/UserAuthorityGroupController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/UserAuthorityGroupController.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/UserAuthorityGroupController.java 1970-01-01 00:00:00 +0000 @@ -1,45 +0,0 @@ -package org.hisp.dhis.api.controller.user; - -/* - * Copyright (c) 2004-2014, 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.api.controller.AbstractCrudController; -import org.hisp.dhis.user.UserAuthorityGroup; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -/** - * @author Morten Olav Hansen - */ -@Controller -@RequestMapping( value = UserAuthorityGroupController.RESOURCE_PATH ) -public class UserAuthorityGroupController - extends AbstractCrudController -{ - public static final String RESOURCE_PATH = "/userRoles"; -} === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2014-02-19 04:23:03 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2014-04-06 12:57:33 +0000 @@ -42,7 +42,7 @@ "phoneNumber" : { "rangelength" : [ 0, 80 ] }, - "roleValidator" : { + "urValidator" : { "required" : true } }, === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm 2014-01-05 18:03:32 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm 2014-04-06 12:57:33 +0000 @@ -1,3 +1,4 @@ + #macro( objectList $objectName $objects ) @@ -405,3 +406,60 @@ #end #end + +#************************************************************************************ + * Args: + * prefix: prefix to add before Available/Selected identifiers + * required: true/false (default false), selection is required + * i18n_available: i18n string for available part + * i18n_selected: i18n string for selected part + * objects: objects to add to selected, uses value=uid and name=displayName + ************************************************************************************# +#macro( jqSelected $args ) +#if( "$!args.required" == "" ) #set( $required = false ) #else #set( $required = true ) #end + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
$i18n.getString( $args.i18n_available )$i18n.getString( $args.i18n_selected ) + #if( $required ) + * + + #end +
+ +
+
+
+
+
+ +
+#end === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserAction.java 2014-04-05 20:08:37 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserAction.java 2014-04-06 12:57:33 +0000 @@ -28,12 +28,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - +import com.google.common.collect.Lists; +import com.opensymphony.xwork2.Action; import org.apache.struts2.ServletActionContext; import org.hisp.dhis.api.utils.ContextUtils; import org.hisp.dhis.attribute.AttributeService; @@ -56,8 +52,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; -import com.google.common.collect.Lists; -import com.opensymphony.xwork2.Action; +import java.util.HashSet; +import java.util.List; +import java.util.Set; /** * @author Torgeir Lorange Ostby @@ -216,11 +213,11 @@ this.localeDb = localeDb; } - private Collection selectedList = new ArrayList(); + private List urSelected = Lists.newArrayList(); - public void setSelectedList( Collection selectedList ) + public void setUrSelected( List urSelected ) { - this.selectedList = selectedList; + this.urSelected = urSelected; } private List ugSelected = Lists.newArrayList(); @@ -298,8 +295,8 @@ // --------------------------------------------------------------------- Set dataCaptureOrgUnits = new HashSet( selectionManager.getSelectedOrganisationUnits() ); - user.updateOrganisationUnits( dataCaptureOrgUnits ); - + user.updateOrganisationUnits( dataCaptureOrgUnits ); + Set dataViewOrgUnits = new HashSet( selectionTreeManager.getReloadedSelectedOrganisationUnits() ); user.setDataViewOrganisationUnits( dataViewOrgUnits ); @@ -309,9 +306,9 @@ Set userAuthorityGroups = new HashSet(); - for ( String id : selectedList ) + for ( String id : urSelected ) { - userAuthorityGroups.add( userService.getUserAuthorityGroup( Integer.parseInt( id ) ) ); + userAuthorityGroups.add( userService.getUserAuthorityGroup( id ) ); } userService.canIssueFilter( userAuthorityGroups ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java 2014-04-05 20:08:37 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java 2014-04-06 12:57:33 +0000 @@ -28,12 +28,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - +import com.google.common.collect.Lists; +import com.opensymphony.xwork2.Action; import org.hisp.dhis.attribute.AttributeService; import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.oust.manager.SelectionTreeManager; @@ -53,8 +49,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; -import com.google.common.collect.Lists; -import com.opensymphony.xwork2.Action; +import java.util.HashSet; +import java.util.List; +import java.util.Set; /** * @author Torgeir Lorange Ostby @@ -178,11 +175,11 @@ this.localeDb = localeDb; } - private Collection selectedList = new ArrayList(); + private List urSelected = Lists.newArrayList(); - public void setSelectedList( Collection selectedList ) + public void setUrSelected( List urSelected ) { - this.selectedList = selectedList; + this.urSelected = urSelected; } private List ugSelected = Lists.newArrayList(); @@ -253,8 +250,8 @@ // --------------------------------------------------------------------- Set dataCaptureOrgUnits = new HashSet( selectionManager.getSelectedOrganisationUnits() ); - user.updateOrganisationUnits( dataCaptureOrgUnits ); - + user.updateOrganisationUnits( dataCaptureOrgUnits ); + Set dataViewOrgUnits = new HashSet( selectionTreeManager.getReloadedSelectedOrganisationUnits() ); user.setDataViewOrganisationUnits( dataViewOrgUnits ); @@ -264,9 +261,9 @@ Set userAuthorityGroups = new HashSet(); - for ( String id : selectedList ) + for ( String id : urSelected ) { - userAuthorityGroups.add( userService.getUserAuthorityGroup( Integer.parseInt( id ) ) ); + userAuthorityGroups.add( userService.getUserAuthorityGroup( id ) ); } userService.canIssueFilter( userAuthorityGroups ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserForm.vm 2014-04-05 20:08:37 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserForm.vm 2014-04-06 12:57:33 +0000 @@ -1,47 +1,44 @@