=== 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 2013-03-01 05:14:56 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2013-03-12 06:51:28 +0000 @@ -63,7 +63,7 @@ "rangelength" : [ 2, 210 ], "alphanumericwithbasicpuncspaces" : true }, - "memberValidator" : { + "groupMembersList" : { "required" : true } }, === modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml 2012-12-14 13:46:47 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml 2013-03-12 06:51:28 +0000 @@ -115,5 +115,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + === modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties 2013-01-09 06:50:45 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties 2013-03-12 06:51:28 +0000 @@ -91,4 +91,14 @@ to_org_unit=To org unit to_user=To user update_profile=update profile! -or=or \ No newline at end of file +or=or +intro_user_group=Create user groups for functionality that should work on a group of users, like notifications. +user_group_management=User group management +confirm_delete=Are you sure you want to delete this user group ? +edit_user_group=Edit user group +user_group_details=User group details +available_users=Available users +group_members=Group members +add_user_group=Add user group +no_of_Users=Number of users +user_group=User Group \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml 2012-11-14 12:39:53 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml 2013-03-12 06:51:28 +0000 @@ -149,6 +149,56 @@ javascript/profile.js,javascript/interpretation.js style/dashboard.css + + + + + /main.vm + /dhis-web-dashboard-integration/userGroupList.vm + javascript/usergroup.js + F_USERGROUP_LIST + + + + + /dhis-web-commons/ajax/jsonUserGroup.vm + + + + /main.vm + /dhis-web-dashboard-integration/addUserGroupForm.vm + javascript/usergroup.js + F_USERGROUP_PUBLIC_ADD, F_USERGROUP_PRIVATE_ADD + + + + javascript/user.js + getAllUserGroups.action + F_USERGROUP_PUBLIC_ADD, F_USERGROUP_PRIVATE_ADD + + + + /main.vm + /dhis-web-dashboard-integration/updateUserGroupForm.vm + F_USERGROUP_UPDATE + + + + getAllUserGroups.action?currentPage=${keyCurrentPage} + F_USERGROUP_UPDATE + + + + /dhis-web-commons/ajax/jsonResponseSuccess.vm + /dhis-web-commons/ajax/jsonResponseError.vm + F_USERGROUP_DELETE + + + + /dhis-web-commons/ajax/jsonResponseSuccess.vm + /dhis-web-commons/ajax/jsonResponseError.vm + plainTextError + === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserGroupAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserGroupAction.java 2012-07-01 11:33:07 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserGroupAction.java 1970-01-01 00:00:00 +0000 @@ -1,119 +0,0 @@ -package org.hisp.dhis.user.action; - -/* - * Copyright (c) 2004-2012, 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 java.util.List; - -import org.hisp.dhis.attribute.AttributeService; -import org.hisp.dhis.system.util.AttributeUtils; -import org.hisp.dhis.user.User; -import org.hisp.dhis.user.UserGroup; -import org.hisp.dhis.user.UserGroupService; -import org.hisp.dhis.user.UserService; - -import com.opensymphony.xwork2.Action; - -public class AddUserGroupAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private UserService userService; - - public void setUserService( UserService userService ) - { - this.userService = userService; - } - - private UserGroupService userGroupService; - - public void setUserGroupService( UserGroupService userGroupService ) - { - this.userGroupService = userGroupService; - } - - private AttributeService attributeService; - - public void setAttributeService( AttributeService attributeService ) - { - this.attributeService = attributeService; - } - - // ------------------------------------------------------------------------- - // Parameters - // ------------------------------------------------------------------------- - - private List groupMembersList; - - public void setGroupMembersList( List groupMembersList ) - { - this.groupMembersList = groupMembersList; - } - - private String name; - - public void setName( String name ) - { - this.name = name; - } - - private List jsonAttributeValues; - - public void setJsonAttributeValues( List jsonAttributeValues ) - { - this.jsonAttributeValues = jsonAttributeValues; - } - - // ------------------------------------------------------------------------- - // Action Implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - UserGroup userGroup = new UserGroup( name ); - - for ( Integer groupMember : groupMembersList ) - { - User user = userService.getUser( groupMember ); - userGroup.addUser( user ); - } - - if ( jsonAttributeValues != null ) - { - AttributeUtils.updateAttributeValuesFromJson( userGroup.getAttributeValues(), jsonAttributeValues, - attributeService ); - } - - userGroupService.addUserGroup( userGroup ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserGroupFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserGroupFormAction.java 2012-06-01 13:19:25 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserGroupFormAction.java 1970-01-01 00:00:00 +0000 @@ -1,76 +0,0 @@ -package org.hisp.dhis.user.action; - -/* - * Copyright (c) 2004-2012, 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 com.opensymphony.xwork2.Action; -import org.hisp.dhis.attribute.Attribute; -import org.hisp.dhis.attribute.AttributeService; -import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class AddUserGroupFormAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private AttributeService attributeService; - - public void setAttributeService( AttributeService attributeService ) - { - this.attributeService = attributeService; - } - - // ------------------------------------------------------------------------- - // Parameters - // ------------------------------------------------------------------------- - - private List attributes; - - public List getAttributes() - { - return attributes; - } - - // ------------------------------------------------------------------------- - // Action Implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - attributes = new ArrayList( attributeService.getUserGroupAttributes() ); - Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/EditUserGroupFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/EditUserGroupFormAction.java 2012-11-08 12:35:18 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/EditUserGroupFormAction.java 1970-01-01 00:00:00 +0000 @@ -1,128 +0,0 @@ -package org.hisp.dhis.user.action; - -/* - * Copyright (c) 2004-2012, 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 com.opensymphony.xwork2.Action; -import org.hisp.dhis.attribute.Attribute; -import org.hisp.dhis.attribute.AttributeService; -import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; -import org.hisp.dhis.system.util.AttributeUtils; -import org.hisp.dhis.user.User; -import org.hisp.dhis.user.UserGroup; -import org.hisp.dhis.user.UserGroupService; - -import java.util.*; - -/** - * @author Lars Helge Overland - */ -public class EditUserGroupFormAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private UserGroupService userGroupService; - - public void setUserGroupService( UserGroupService userGroupService ) - { - this.userGroupService = userGroupService; - } - - private AttributeService attributeService; - - public void setAttributeService( AttributeService attributeService ) - { - this.attributeService = attributeService; - } - - // ------------------------------------------------------------------------- - // Parameters - // ------------------------------------------------------------------------- - - private Integer userGroupId; - - public void setUserGroupId( Integer userGroupId ) - { - this.userGroupId = userGroupId; - } - - public Integer getUserGroupId() - { - return userGroupId; - } - - private List groupMembers = new ArrayList(); - - public List getGroupMembers() - { - return groupMembers; - } - - private UserGroup group; - - public UserGroup getGroup() - { - return group; - } - - private List attributes; - - public List getAttributes() - { - return attributes; - } - - public Map attributeValues = new HashMap(); - - public Map getAttributeValues() - { - return attributeValues; - } - - // ------------------------------------------------------------------------- - // Action Implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - group = userGroupService.getUserGroup( userGroupId ); - - groupMembers = new ArrayList( group.getMembers() ); - - attributes = new ArrayList( attributeService.getUserGroupAttributes() ); - - attributeValues = AttributeUtils.getAttributeValueMap( group.getAttributeValues() ); - - Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/GetUserGroupAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/GetUserGroupAction.java 2011-12-26 10:07:59 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/GetUserGroupAction.java 1970-01-01 00:00:00 +0000 @@ -1,91 +0,0 @@ -package org.hisp.dhis.user.action; - -/* - * Copyright (c) 2004-2012, 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.user.UserGroup; -import org.hisp.dhis.user.UserGroupService; - -import com.opensymphony.xwork2.Action; - -public class GetUserGroupAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private UserGroupService userGroupService; - - public void setUserGroupService( UserGroupService userGroupService ) - { - this.userGroupService = userGroupService; - } - - // ------------------------------------------------------------------------- - // Input/output - // ------------------------------------------------------------------------- - - private Integer userGroupId; - - public void setUserGroupId( Integer userGroupId ) - { - this.userGroupId = userGroupId; - } - - public Integer getUserGroupId() - { - return userGroupId; - } - - private UserGroup group ; - - public UserGroup getGroup() - { - return group; - } - - private int memberCount; - - public int getMemberCount() - { - return memberCount; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - { - group = userGroupService.getUserGroup(userGroupId ); - - memberCount =group.getMembers().size(); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/GetUserGroupListAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/GetUserGroupListAction.java 2011-12-26 10:07:59 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/GetUserGroupListAction.java 1970-01-01 00:00:00 +0000 @@ -1,97 +0,0 @@ -package org.hisp.dhis.user.action; - -/* - * Copyright (c) 2004-2012, 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 static org.apache.commons.lang.StringUtils.isNotBlank; - -import java.util.ArrayList; -import java.util.List; - -import org.hisp.dhis.paging.ActionPagingSupport; -import org.hisp.dhis.user.UserGroup; -import org.hisp.dhis.user.UserGroupService; - -public class GetUserGroupListAction - extends ActionPagingSupport -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private UserGroupService userGroupService; - - public void setUserGroupService( UserGroupService userGroupService ) - { - this.userGroupService = userGroupService; - } - - // ------------------------------------------------------------------------- - // Parameters - // ------------------------------------------------------------------------- - - private List userGroupList; - - public List getUserGroupList() - { - return userGroupList; - } - - private String key; - - public String getKey() - { - return key; - } - - public void setKey( String key ) - { - this.key = key; - } - // ------------------------------------------------------------------------- - // Action Implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - if ( isNotBlank( key ) ) // Filter on key only if set - { - this.paging = createPaging( userGroupService.getUserGroupCountByName( key ) ); - - userGroupList = new ArrayList( userGroupService.getUserGroupsBetweenByName( key, paging.getStartPos(), paging.getPageSize() ) ); - } - else - { - this.paging = createPaging( userGroupService.getUserGroupCount() ); - - userGroupList = new ArrayList( userGroupService.getUserGroupsBetween( paging.getStartPos(), paging.getPageSize() ) ); - } - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/RemoveUserGroupAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/RemoveUserGroupAction.java 2011-12-26 10:07:59 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/RemoveUserGroupAction.java 1970-01-01 00:00:00 +0000 @@ -1,102 +0,0 @@ -package org.hisp.dhis.user.action; - -/* - * Copyright (c) 2004-2012, 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.common.DeleteNotAllowedException; -import org.hisp.dhis.i18n.I18n; -import org.hisp.dhis.user.UserGroupService; - -import com.opensymphony.xwork2.Action; - -public class RemoveUserGroupAction - implements Action -{ - - private UserGroupService userGroupService; - - public void setUserGroupService( UserGroupService userGroupService ) - { - this.userGroupService = userGroupService; - } - - // ------------------------------------------------------------------------- - // I18n - // ------------------------------------------------------------------------- - - private I18n i18n; - - public void setI18n( I18n i18n ) - { - this.i18n = i18n; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Integer id; - - public void setId( Integer id ) - { - this.id = id; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private String message; - - public String getMessage() - { - return message; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - { - try - { - userGroupService.deleteUserGroup( userGroupService.getUserGroup( id ) ); - } - catch ( DeleteNotAllowedException ex ) - { - if ( ex.getErrorCode().equals( DeleteNotAllowedException.ERROR_ASSOCIATED_BY_OTHER_OBJECTS ) ) - { - message = i18n.getString( "object_not_deleted_associated_by_objects" ) + " " + ex.getMessage(); - - return ERROR; - } - } - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserGroupAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserGroupAction.java 2012-07-01 11:33:07 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserGroupAction.java 1970-01-01 00:00:00 +0000 @@ -1,128 +0,0 @@ -package org.hisp.dhis.user.action; - -/* - * Copyright (c) 2004-2012, 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 com.opensymphony.xwork2.Action; -import org.hisp.dhis.attribute.AttributeService; -import org.hisp.dhis.system.util.AttributeUtils; -import org.hisp.dhis.user.User; -import org.hisp.dhis.user.UserGroup; -import org.hisp.dhis.user.UserGroupService; -import org.hisp.dhis.user.UserService; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -public class UpdateUserGroupAction - implements Action -{ - private UserService userService; - - public void setUserService( UserService userService ) - { - this.userService = userService; - } - - private UserGroupService userGroupService; - - public void setUserGroupService( UserGroupService userGroupService ) - { - this.userGroupService = userGroupService; - } - - private AttributeService attributeService; - - public void setAttributeService( AttributeService attributeService ) - { - this.attributeService = attributeService; - } - - // ------------------------------------------------------------------------- - // Parameters - // ------------------------------------------------------------------------- - - private List groupMembersList; - - public void setGroupMembersList( List groupMembersList ) - { - this.groupMembersList = groupMembersList; - } - - private String name; - - public void setName( String name ) - { - this.name = name; - } - - private Integer userGroupId; - - public void setUserGroupId( Integer userGroupId ) - { - this.userGroupId = userGroupId; - } - - private List jsonAttributeValues; - - public void setJsonAttributeValues( List jsonAttributeValues ) - { - this.jsonAttributeValues = jsonAttributeValues; - } - - // ------------------------------------------------------------------------- - // Action Implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - Set userList = new HashSet(); - - for ( Integer groupMember : groupMembersList ) - { - User user = userService.getUser( groupMember ); - userList.add( user ); - } - - UserGroup userGroup = userGroupService.getUserGroup( userGroupId ); - - userGroup.setName( name ); - userGroup.updateUsers( userList ); - - if ( jsonAttributeValues != null ) - { - AttributeUtils.updateAttributeValuesFromJson( userGroup.getAttributeValues(), jsonAttributeValues, - attributeService ); - } - - userGroupService.updateUserGroup( userGroup ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/ValidateUserGroupAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/ValidateUserGroupAction.java 2013-02-12 06:55:14 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/ValidateUserGroupAction.java 1970-01-01 00:00:00 +0000 @@ -1,105 +0,0 @@ -package org.hisp.dhis.user.action; - -/* - * Copyright (c) 2004-2012, 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 com.opensymphony.xwork2.Action; -import org.hisp.dhis.i18n.I18n; -import org.hisp.dhis.user.UserGroup; -import org.hisp.dhis.user.UserGroupService; - -public class ValidateUserGroupAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private UserGroupService userGroupService; - - public void setUserGroupService( UserGroupService userGroupService ) - { - this.userGroupService = userGroupService; - } - - private I18n i18n; - - public void setI18n( I18n i18n ) - { - this.i18n = i18n; - } - - // ------------------------------------------------------------------------- - // Parameters - // ------------------------------------------------------------------------- - - private Integer id; - - public void setId( Integer id ) - { - this.id = id; - } - - private String name; - - public void setName( String name ) - { - this.name = name; - } - - private String message; - - public String getMessage() - { - return message; - } - - // ------------------------------------------------------------------------- - // Action Implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - - if ( name != null ) - { - UserGroup match = userGroupService.getUserGroupByName( name ).get( 0 ); - - if ( match != null && (id == null || match.getId() != id) ) - { - message = i18n.getString( "name_in_use" ); - - return ERROR; - } - } - - message = i18n.getString( "everything_is_ok" ); - - return SUCCESS; - } -} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/META-INF/dhis/beans.xml 2012-12-14 13:46:47 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/META-INF/dhis/beans.xml 2013-03-12 06:51:28 +0000 @@ -111,53 +111,7 @@ scope="prototype"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties 2013-03-07 20:07:23 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties 2013-03-12 06:51:28 +0000 @@ -293,16 +293,6 @@ can_not_remove_last_super_user=Can not remove the last super user. can_not_remove_last_super_user_role=Can not remove the last super user role. delete_current_user=Delete Current User -user_group=User Group -intro_user_group=Create user groups for functionality that should work on a group of users, like notifications. -user_group_management=User group management -edit_user_group=Edit user group -user_group_details=User group details -confirm_delete=Confirm delete -add_user_group=Add user group -available_users=Available users -group_members=Group members -no_of_Users=Number of users last_login=Last login inactive_for=Inactive for month=month === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserGroupForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserGroupForm.vm 2013-02-12 06:55:14 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserGroupForm.vm 1970-01-01 00:00:00 +0000 @@ -1,90 +0,0 @@ - - -

$i18n.getString( "add_user_group" )

- -
- - - - - - - - - - - - -
$i18n.getString( "user_group_details" )
- -#tblDynamicAttributes( { "attributes": $attributes } ) - - - - - - - - - - - - - - - - - - - - - -
$i18n.getString( "available_users" )$i18n.getString( "group_members" ) -
- - -
-
-
- -
- -
- -

- - -

- -
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/index.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/index.vm 2012-11-08 19:17:16 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/index.vm 2013-03-12 06:51:28 +0000 @@ -12,5 +12,4 @@ #introListImgItem( "alluser.action" "user" "user" ) #introListImgItem( "alluser.action?selfRegistered=true" "self_registered_user" "user" ) #introListImgItem( "allRole.action" "user_role" "user" ) - #introListImgItem( "getAllUserGroups.action" "user_group" "user" ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/user.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/user.js 2012-11-08 13:26:59 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/user.js 2013-03-12 06:51:28 +0000 @@ -127,23 +127,3 @@ } ); } } - -// ----------------------------------------------------------------------------- -// Usergroup functionality -// ----------------------------------------------------------------------------- - -function showUserGroupDetails( userGroupId ) -{ - jQuery.post( 'getUserGroup.action', { userGroupId: userGroupId }, - function ( json ) { - setInnerHTML( 'nameField', json.userGroup.name ); - setInnerHTML( 'noOfGroupField', json.userGroup.noOfUsers ); - - showDetails(); - }); -} - -function removeUserGroup( userGroupId, userGroupName ) -{ - removeItem( userGroupId, userGroupName, i18n_confirm_delete, 'removeUserGroup.action' ); -} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/menu.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/menu.vm 2012-11-08 09:46:51 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/menu.vm 2013-03-12 06:51:28 +0000 @@ -5,5 +5,4 @@
  • $i18n.getString( "self_registered_user" ) 
  • $i18n.getString( "user_role" ) 
  • $i18n.getString( "delete_current_user" )
  • -
  • $i18n.getString( "user_group" )
  • === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserGroupForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserGroupForm.vm 2013-02-12 06:55:14 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserGroupForm.vm 1970-01-01 00:00:00 +0000 @@ -1,99 +0,0 @@ - - -

    $i18n.getString( "edit_user_group" )

    - -
    - - - - - - - - - - - - - - - -
    $i18n.getString( "user_group_details" )
    - -#tblDynamicAttributes( { "attributes": $attributes, "attributeValues": $attributeValues } ) - - - - - - - - - - - - - - - - - - - - - -
    $i18n.getString( "available_users" )$i18n.getString( "group_members" ) -
    - - -
    -
    -
    - -
    - -
    - -

    - - -

    - -
    === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/userGroupList.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/userGroupList.vm 2013-01-30 08:25:19 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/userGroupList.vm 1970-01-01 00:00:00 +0000 @@ -1,82 +0,0 @@ - -#sharingDialog() - - - - -

    $i18n.getString( "user_group_management" ) #openHelp( "user_group_management" )

    - - - - - - -
    - - - - - -
    #filterDiv( "getAllUserGroups" ) - -
    - - - - - - - - - - - #foreach( $userGroup in $userGroupList ) - - - - - #end - -
    $i18n.getString( "name" )$i18n.getString( "operations" )
    $encoder.htmlEncode( $userGroup.name ) - - #if ( $security.canManage( $userGroup ) ) - $i18n.getString( 'sharing_settings' ) - #else - - #end - - #if( $security.canUpdate( $userGroup ) ) - $i18n.getString( 'edit' ) - #else - - #end - - #if( $security.canDelete( $userGroup ) ) - $i18n.getString( 'remove' ) - #else - - #end - - $i18n.getString( 'show_details' ) - -
    -

    - #parse( "/dhis-web-commons/paging/paging.vm" ) -
    - - - -