dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21439
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10153: Add missing files.
------------------------------------------------------------
revno: 10153
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-03-12 16:27:40 +0700
message:
Add missing files.
added:
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/AddUserGroupAction.java
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/AddUserGroupFormAction.java
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/EditUserGroupFormAction.java
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/GetUserGroupAction.java
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/GetUserGroupListAction.java
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/RemoveUserGroupAction.java
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/UpdateUserGroupAction.java
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/ValidateUserGroupAction.java
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/addUserGroupForm.vm
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/userGroupList.js
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/usergroup.js
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/updateUserGroupForm.vm
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/userGroupList.vm
modified:
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== added directory 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup'
=== added directory 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action'
=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/AddUserGroupAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/AddUserGroupAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/AddUserGroupAction.java 2013-03-12 09:27:40 +0000
@@ -0,0 +1,119 @@
+package org.hisp.dhis.dashboard.usergroup.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<Integer> groupMembersList;
+
+ public void setGroupMembersList( List<Integer> groupMembersList )
+ {
+ this.groupMembersList = groupMembersList;
+ }
+
+ private String name;
+
+ public void setName( String name )
+ {
+ this.name = name;
+ }
+
+ private List<String> jsonAttributeValues;
+
+ public void setJsonAttributeValues( List<String> 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;
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/AddUserGroupFormAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/AddUserGroupFormAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/AddUserGroupFormAction.java 2013-03-12 09:27:40 +0000
@@ -0,0 +1,76 @@
+package org.hisp.dhis.dashboard.usergroup.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<Attribute> attributes;
+
+ public List<Attribute> getAttributes()
+ {
+ return attributes;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action Implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ attributes = new ArrayList<Attribute>( attributeService.getUserGroupAttributes() );
+ Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
+
+ return SUCCESS;
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/EditUserGroupFormAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/EditUserGroupFormAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/EditUserGroupFormAction.java 2013-03-12 09:27:40 +0000
@@ -0,0 +1,128 @@
+package org.hisp.dhis.dashboard.usergroup.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<User> groupMembers = new ArrayList<User>();
+
+ public List<User> getGroupMembers()
+ {
+ return groupMembers;
+ }
+
+ private UserGroup group;
+
+ public UserGroup getGroup()
+ {
+ return group;
+ }
+
+ private List<Attribute> attributes;
+
+ public List<Attribute> getAttributes()
+ {
+ return attributes;
+ }
+
+ public Map<Integer, String> attributeValues = new HashMap<Integer, String>();
+
+ public Map<Integer, String> getAttributeValues()
+ {
+ return attributeValues;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action Implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ group = userGroupService.getUserGroup( userGroupId );
+
+ groupMembers = new ArrayList<User>( group.getMembers() );
+
+ attributes = new ArrayList<Attribute>( attributeService.getUserGroupAttributes() );
+
+ attributeValues = AttributeUtils.getAttributeValueMap( group.getAttributeValues() );
+
+ Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
+
+ return SUCCESS;
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/GetUserGroupAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/GetUserGroupAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/GetUserGroupAction.java 2013-03-12 09:27:40 +0000
@@ -0,0 +1,91 @@
+package org.hisp.dhis.dashboard.usergroup.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;
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/GetUserGroupListAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/GetUserGroupListAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/GetUserGroupListAction.java 2013-03-12 09:27:40 +0000
@@ -0,0 +1,97 @@
+package org.hisp.dhis.dashboard.usergroup.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<UserGroup>
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private UserGroupService userGroupService;
+
+ public void setUserGroupService( UserGroupService userGroupService )
+ {
+ this.userGroupService = userGroupService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Parameters
+ // -------------------------------------------------------------------------
+
+ private List<UserGroup> userGroupList;
+
+ public List<UserGroup> 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<UserGroup>( userGroupService.getUserGroupsBetweenByName( key, paging.getStartPos(), paging.getPageSize() ) );
+ }
+ else
+ {
+ this.paging = createPaging( userGroupService.getUserGroupCount() );
+
+ userGroupList = new ArrayList<UserGroup>( userGroupService.getUserGroupsBetween( paging.getStartPos(), paging.getPageSize() ) );
+ }
+
+ return SUCCESS;
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/RemoveUserGroupAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/RemoveUserGroupAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/RemoveUserGroupAction.java 2013-03-12 09:27:40 +0000
@@ -0,0 +1,102 @@
+package org.hisp.dhis.dashboard.usergroup.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;
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/UpdateUserGroupAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/UpdateUserGroupAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/UpdateUserGroupAction.java 2013-03-12 09:27:40 +0000
@@ -0,0 +1,128 @@
+package org.hisp.dhis.dashboard.usergroup.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<Integer> groupMembersList;
+
+ public void setGroupMembersList( List<Integer> 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<String> jsonAttributeValues;
+
+ public void setJsonAttributeValues( List<String> jsonAttributeValues )
+ {
+ this.jsonAttributeValues = jsonAttributeValues;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action Implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ Set<User> userList = new HashSet<User>();
+
+ 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;
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/ValidateUserGroupAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/ValidateUserGroupAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/ValidateUserGroupAction.java 2013-03-12 09:27:40 +0000
@@ -0,0 +1,105 @@
+package org.hisp.dhis.dashboard.usergroup.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-dashboard-integration/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml 2013-03-12 06:51:28 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml 2013-03-12 09:27:40 +0000
@@ -4,201 +4,247 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
- <include file="dhis-web-commons.xml" />
-
- <package name="dhis-web-dashboard-integration" extends="dhis-web-commons" namespace="/dhis-web-dashboard-integration">
-
- <!-- Dashboard -->
-
- <action name="index" class="org.hisp.dhis.dashboard.action.InitAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-dashboard-integration/mainForm.vm</param>
- <param name="hideMenu">true</param>
- <param name="stylesheets">style/dashboard.css</param>
- <param name="javascripts">javascript/dropdown.js</param>
- </action>
-
- <action name="provideContent" class="org.hisp.dhis.dashboard.action.ProvideContentAction">
- <result name="success" type="velocity">/dhis-web-dashboard-integration/dashboard.vm</result>
- </action>
-
- <action name="setAreaItem" class="org.hisp.dhis.dashboard.action.SetAreaItemAction">
- <result name="success" type="velocity-xml">/dhis-web-dashboard-integration/responseSuccess.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
- <action name="clearArea" class="org.hisp.dhis.dashboard.action.ClearAreaAction">
- <result name="success" type="velocity-xml">/dhis-web-dashboard-integration/responseSuccess.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
- <action name="removeReport" class="org.hisp.dhis.dashboard.action.RemoveReportAction">
- <result name="success" type="redirect">index.action</result>
- </action>
-
- <action name="removeDocument" class="org.hisp.dhis.dashboard.action.RemoveDocumentAction">
- <result name="success" type="redirect">index.action</result>
- </action>
-
- <action name="removeReportTable" class="org.hisp.dhis.dashboard.action.RemoveReportTableAction">
- <result name="success" type="redirect">index.action</result>
- </action>
-
- <action name="removeMap" class="org.hisp.dhis.dashboard.action.RemoveMapViewAction">
- <result name="success" type="redirect">index.action</result>
- </action>
-
- <action name="search" class="org.hisp.dhis.dashboard.action.SearchAction">
- <result name="success" type="velocity">/dhis-web-dashboard-integration/hits.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
- <!-- Message -->
-
- <action name="message" class="org.hisp.dhis.dashboard.message.action.GetMessagesAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-dashboard-integration/message.vm</param>
- <param name="menu">/dhis-web-commons/about/menuDashboard.vm</param>
- <param name="javascripts">javascript/message.js</param>
- <param name="stylesheets">style/dashboard.css</param>
- </action>
-
- <action name="sendMessage" class="org.hisp.dhis.dashboard.message.action.SendMessageAction">
- <result name="success" type="redirect">message.action</result>
- </action>
-
- <action name="sendFeedback" class="org.hisp.dhis.dashboard.message.action.SendFeedbackAction">
- <result name="success" type="redirect">message.action</result>
- </action>
-
- <action name="sendReply" class="org.hisp.dhis.dashboard.message.action.SendReplyAction">
- <result name="success" type="velocity-xml">/dhis-web-dashboard-integration/responseSuccess.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
- <action name="showSendMessage" class="org.hisp.dhis.dashboard.message.action.GetMessageOptionsAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-dashboard-integration/sendMessage.vm</param>
- <param name="menu">/dhis-web-commons/about/menuDashboard.vm</param>
- <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/message.js,../dhis-web-commons/select2/select2.min.js</param>
- <param name="stylesheets">style/dashboard.css,../dhis-web-commons/select2/select2.css</param>
- </action>
-
- <action name="showSendFeedback" class="org.hisp.dhis.dashboard.action.NoAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-dashboard-integration/sendFeedback.vm</param>
- <param name="menu">/dhis-web-commons/about/menuDashboard.vm</param>
- <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/message.js</param>
- <param name="stylesheets">style/dashboard.css</param>
- </action>
-
- <action name="readMessage" class="org.hisp.dhis.dashboard.message.action.ReadMessageAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-dashboard-integration/readMessage.vm</param>
- <param name="menu">/dhis-web-commons/about/menuDashboard.vm</param>
- <param name="javascripts">javascript/message.js</param>
- <param name="stylesheets">style/dashboard.css</param>
- </action>
-
- <action name="unreadMessage" class="org.hisp.dhis.dashboard.message.action.UnreadMessageAction">
- <result name="success" type="redirect">message.action?currentPage=${keyCurrentPage}</result>
- </action>
-
- <action name="removeMessage" class="org.hisp.dhis.dashboard.message.action.RemoveMessageAction">
- <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
- <result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
- <action name="removeMessageRedirect" class="org.hisp.dhis.dashboard.message.action.RemoveMessageAction">
- <result name="success" type="redirect">message.action?currentPage=${keyCurrentPage}</result>
- </action>
-
- <action name="getMessageRecipients" class="org.hisp.dhis.dashboard.message.action.GetMessageRecipientsAction">
- <result name="success" type="velocity-json">/dhis-web-dashboard-integration/jsonMessageRecipients.vm</result>
- <result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
-
- <action name="toggleFollowUp" class="org.hisp.dhis.dashboard.message.action.ToggleFollowUpAction">
- <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
- <!-- Interpretation -->
-
- <action name="interpretation" class="org.hisp.dhis.dashboard.action.NoAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-dashboard-integration/interpretation.vm</param>
- <param name="menu">/dhis-web-commons/about/menuDashboard.vm</param>
- <param name="javascripts">javascript/interpretation.js</param>
- <param name="stylesheets">style/dashboard.css</param>
- </action>
-
- <action name="getInterpretations" class="org.hisp.dhis.dashboard.interpretation.action.GetInterpretationsAction">
- <result name="success" type="velocity">/dhis-web-dashboard-integration/interpretationFeed.vm</result>
- </action>
-
- <!-- Profile -->
-
- <action name="profile" class="org.hisp.dhis.dashboard.profile.action.GetUserAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-dashboard-integration/profile.vm</param>
- <param name="menu">/dhis-web-commons/about/menuDashboard.vm</param>
- <param name="javascripts">javascript/profile.js,javascript/interpretation.js</param>
- <param name="stylesheets">style/dashboard.css</param>
- </action>
-
- <!-- User Group -->
-
- <action name="getAllUserGroups" class="org.hisp.dhis.dashboard.usergroup.action.GetUserGroupListAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-dashboard-integration/userGroupList.vm</param>
- <param name="javascripts">javascript/usergroup.js</param>
- <param name="requiredAuthorities">F_USERGROUP_LIST</param>
- </action>
-
- <action name="getUserGroup" class="org.hisp.dhis.dashboard.usergroup.action.GetUserGroupAction">
- <result name="success" type="velocity-json">
- /dhis-web-commons/ajax/jsonUserGroup.vm</result>
- </action>
-
- <action name="addUserGroupForm" class="org.hisp.dhis.dashboard.usergroup.action.AddUserGroupFormAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-dashboard-integration/addUserGroupForm.vm</param>
- <param name="javascripts">javascript/usergroup.js</param>
- <param name="anyAuthorities">F_USERGROUP_PUBLIC_ADD, F_USERGROUP_PRIVATE_ADD</param>
- </action>
-
- <action name="addUserGroup" class="org.hisp.dhis.dashboard.usergroup.action.AddUserGroupAction">
- <param name="javascripts">javascript/user.js</param>
- <result name="success" type="redirect">getAllUserGroups.action</result>
- <param name="anyAuthorities">F_USERGROUP_PUBLIC_ADD, F_USERGROUP_PRIVATE_ADD</param>
- </action>
-
- <action name="editUserGroupForm" class="org.hisp.dhis.dashboard.usergroup.action.EditUserGroupFormAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-dashboard-integration/updateUserGroupForm.vm</param>
- <param name="requiredAuthorities">F_USERGROUP_UPDATE</param>
- </action>
-
- <action name="updateUserGroup" class="org.hisp.dhis.dashboard.usergroup.action.UpdateUserGroupAction">
- <result name="success" type="redirect">getAllUserGroups.action?currentPage=${keyCurrentPage}</result>
- <param name="requiredAuthorities">F_USERGROUP_UPDATE</param>
- </action>
-
- <action name="removeUserGroup" class="org.hisp.dhis.dashboard.usergroup.action.RemoveUserGroupAction">
- <result name="success" type="velocity">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
- <result name="error" type="velocity">/dhis-web-commons/ajax/jsonResponseError.vm</result>
- <param name="requiredAuthorities">F_USERGROUP_DELETE</param>
- </action>
-
- <action name="validateUserGroup" class="org.hisp.dhis.dashboard.usergroup.action.ValidateUserGroupAction">
- <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
- <result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
- </package>
+ <include file="dhis-web-commons.xml" />
+
+ <package name="dhis-web-dashboard-integration" extends="dhis-web-commons"
+ namespace="/dhis-web-dashboard-integration">
+
+ <!-- Dashboard -->
+
+ <action name="index" class="org.hisp.dhis.dashboard.action.InitAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-dashboard-integration/mainForm.vm</param>
+ <param name="hideMenu">true</param>
+ <param name="stylesheets">style/dashboard.css</param>
+ <param name="javascripts">javascript/dropdown.js</param>
+ </action>
+
+ <action name="provideContent"
+ class="org.hisp.dhis.dashboard.action.ProvideContentAction">
+ <result name="success" type="velocity">/dhis-web-dashboard-integration/dashboard.vm
+ </result>
+ </action>
+
+ <action name="setAreaItem" class="org.hisp.dhis.dashboard.action.SetAreaItemAction">
+ <result name="success" type="velocity-xml">/dhis-web-dashboard-integration/responseSuccess.vm
+ </result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
+
+ <action name="clearArea" class="org.hisp.dhis.dashboard.action.ClearAreaAction">
+ <result name="success" type="velocity-xml">/dhis-web-dashboard-integration/responseSuccess.vm
+ </result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
+
+ <action name="removeReport"
+ class="org.hisp.dhis.dashboard.action.RemoveReportAction">
+ <result name="success" type="redirect">index.action</result>
+ </action>
+
+ <action name="removeDocument"
+ class="org.hisp.dhis.dashboard.action.RemoveDocumentAction">
+ <result name="success" type="redirect">index.action</result>
+ </action>
+
+ <action name="removeReportTable"
+ class="org.hisp.dhis.dashboard.action.RemoveReportTableAction">
+ <result name="success" type="redirect">index.action</result>
+ </action>
+
+ <action name="removeMap"
+ class="org.hisp.dhis.dashboard.action.RemoveMapViewAction">
+ <result name="success" type="redirect">index.action</result>
+ </action>
+
+ <action name="search" class="org.hisp.dhis.dashboard.action.SearchAction">
+ <result name="success" type="velocity">/dhis-web-dashboard-integration/hits.vm
+ </result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
+
+ <!-- Message -->
+
+ <action name="message"
+ class="org.hisp.dhis.dashboard.message.action.GetMessagesAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-dashboard-integration/message.vm</param>
+ <param name="menu">/dhis-web-commons/about/menuDashboard.vm</param>
+ <param name="javascripts">javascript/message.js</param>
+ <param name="stylesheets">style/dashboard.css</param>
+ </action>
+
+ <action name="sendMessage"
+ class="org.hisp.dhis.dashboard.message.action.SendMessageAction">
+ <result name="success" type="redirect">message.action</result>
+ </action>
+
+ <action name="sendFeedback"
+ class="org.hisp.dhis.dashboard.message.action.SendFeedbackAction">
+ <result name="success" type="redirect">message.action</result>
+ </action>
+
+ <action name="sendReply"
+ class="org.hisp.dhis.dashboard.message.action.SendReplyAction">
+ <result name="success" type="velocity-xml">/dhis-web-dashboard-integration/responseSuccess.vm
+ </result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
+
+ <action name="showSendMessage"
+ class="org.hisp.dhis.dashboard.message.action.GetMessageOptionsAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-dashboard-integration/sendMessage.vm</param>
+ <param name="menu">/dhis-web-commons/about/menuDashboard.vm</param>
+ <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/message.js,../dhis-web-commons/select2/select2.min.js</param>
+ <param name="stylesheets">style/dashboard.css,../dhis-web-commons/select2/select2.css</param>
+ </action>
+
+ <action name="showSendFeedback" class="org.hisp.dhis.dashboard.action.NoAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-dashboard-integration/sendFeedback.vm</param>
+ <param name="menu">/dhis-web-commons/about/menuDashboard.vm</param>
+ <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/message.js</param>
+ <param name="stylesheets">style/dashboard.css</param>
+ </action>
+
+ <action name="readMessage"
+ class="org.hisp.dhis.dashboard.message.action.ReadMessageAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-dashboard-integration/readMessage.vm</param>
+ <param name="menu">/dhis-web-commons/about/menuDashboard.vm</param>
+ <param name="javascripts">javascript/message.js</param>
+ <param name="stylesheets">style/dashboard.css</param>
+ </action>
+
+ <action name="unreadMessage"
+ class="org.hisp.dhis.dashboard.message.action.UnreadMessageAction">
+ <result name="success" type="redirect">message.action?currentPage=${keyCurrentPage}
+ </result>
+ </action>
+
+ <action name="removeMessage"
+ class="org.hisp.dhis.dashboard.message.action.RemoveMessageAction">
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm
+ </result>
+ <result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm
+ </result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
+
+ <action name="removeMessageRedirect"
+ class="org.hisp.dhis.dashboard.message.action.RemoveMessageAction">
+ <result name="success" type="redirect">message.action?currentPage=${keyCurrentPage}
+ </result>
+ </action>
+
+ <action name="getMessageRecipients"
+ class="org.hisp.dhis.dashboard.message.action.GetMessageRecipientsAction">
+ <result name="success" type="velocity-json">/dhis-web-dashboard-integration/jsonMessageRecipients.vm
+ </result>
+ <result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm
+ </result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
+
+
+ <action name="toggleFollowUp"
+ class="org.hisp.dhis.dashboard.message.action.ToggleFollowUpAction">
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm
+ </result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
+
+ <!-- Interpretation -->
+
+ <action name="interpretation" class="org.hisp.dhis.dashboard.action.NoAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-dashboard-integration/interpretation.vm</param>
+ <param name="menu">/dhis-web-commons/about/menuDashboard.vm</param>
+ <param name="javascripts">javascript/interpretation.js</param>
+ <param name="stylesheets">style/dashboard.css</param>
+ </action>
+
+ <action name="getInterpretations"
+ class="org.hisp.dhis.dashboard.interpretation.action.GetInterpretationsAction">
+ <result name="success" type="velocity">/dhis-web-dashboard-integration/interpretationFeed.vm
+ </result>
+ </action>
+
+ <!-- Profile -->
+
+ <action name="profile"
+ class="org.hisp.dhis.dashboard.profile.action.GetUserAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-dashboard-integration/profile.vm</param>
+ <param name="menu">/dhis-web-commons/about/menuDashboard.vm</param>
+ <param name="javascripts">javascript/profile.js,javascript/interpretation.js</param>
+ <param name="stylesheets">style/dashboard.css</param>
+ </action>
+
+ <!-- User Group -->
+
+ <action name="getAllUserGroups"
+ class="org.hisp.dhis.dashboard.usergroup.action.GetUserGroupListAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-dashboard-integration/userGroupList.vm</param>
+ <param name="javascripts">javascript/usergroup.js</param>
+ <param name="requiredAuthorities">F_USERGROUP_LIST</param>
+ </action>
+
+ <action name="getUserGroup"
+ class="org.hisp.dhis.dashboard.usergroup.action.GetUserGroupAction">
+ <result name="success" type="velocity-json">
+ /dhis-web-commons/ajax/jsonUserGroup.vm
+ </result>
+ </action>
+
+ <action name="addUserGroupForm"
+ class="org.hisp.dhis.dashboard.usergroup.action.AddUserGroupFormAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-dashboard-integration/addUserGroupForm.vm</param>
+ <param name="javascripts">javascript/usergroup.js</param>
+ <param name="anyAuthorities">F_USERGROUP_PUBLIC_ADD, F_USERGROUP_PRIVATE_ADD</param>
+ </action>
+
+ <action name="addUserGroup"
+ class="org.hisp.dhis.dashboard.usergroup.action.AddUserGroupAction">
+ <param name="javascripts">javascript/usergroup.js</param>
+ <result name="success" type="redirect">getAllUserGroups.action</result>
+ <param name="anyAuthorities">F_USERGROUP_PUBLIC_ADD, F_USERGROUP_PRIVATE_ADD</param>
+ </action>
+
+ <action name="editUserGroupForm"
+ class="org.hisp.dhis.dashboard.usergroup.action.EditUserGroupFormAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-dashboard-integration/updateUserGroupForm.vm</param>
+ <param name="requiredAuthorities">F_USERGROUP_UPDATE</param>
+ </action>
+
+ <action name="updateUserGroup"
+ class="org.hisp.dhis.dashboard.usergroup.action.UpdateUserGroupAction">
+ <result name="success" type="redirect">getAllUserGroups.action?currentPage=${keyCurrentPage}
+ </result>
+ <param name="requiredAuthorities">F_USERGROUP_UPDATE</param>
+ </action>
+
+ <action name="removeUserGroup"
+ class="org.hisp.dhis.dashboard.usergroup.action.RemoveUserGroupAction">
+ <result name="success" type="velocity">/dhis-web-commons/ajax/jsonResponseSuccess.vm
+ </result>
+ <result name="error" type="velocity">/dhis-web-commons/ajax/jsonResponseError.vm
+ </result>
+ <param name="requiredAuthorities">F_USERGROUP_DELETE</param>
+ </action>
+
+ <action name="validateUserGroup"
+ class="org.hisp.dhis.dashboard.usergroup.action.ValidateUserGroupAction">
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm
+ </result>
+ <result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm
+ </result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
+
+ </package>
</struts>
=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/addUserGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/addUserGroupForm.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/addUserGroupForm.vm 2013-03-12 09:27:40 +0000
@@ -0,0 +1,87 @@
+<script type="text/javascript">
+ jQuery(function() {
+ validation2( 'addUserGroupForm', function( form )
+ {
+ form.submit();
+ }, {
+ 'beforeValidateHandler' : function()
+ {
+ #tblDynamicAttributesJavascript()
+ },
+ 'rules' : getValidationRules( "userGroup" )
+ } );
+
+ /* remote validation */
+ // checkValueIsExist( "name", "validateUserGroup.action" );
+
+ jQuery("#availableUsersList").dhisAjaxSelect({
+ source: "../dhis-web-commons-ajax-json/getUsers.action",
+ iterator: "users",
+ connectedTo: 'groupMembersList',
+ handler: function(item) {
+ var option = jQuery("<option />");
+ option.text( item.surname + ", " + item.firstName );
+ option.attr( "value", item.id );
+
+ return option;
+ }
+ });
+ });
+</script>
+
+<h3>$i18n.getString( "add_user_group" )</h3>
+
+<form id="addUserGroupForm" name="addUserGroupForm" action="addUserGroup.action" method="post" class="inputForm">
+
+<table id="detailsList">
+ <col style="width: 120px"/>
+
+ <tr>
+ <th colspan="2">$i18n.getString( "user_group_details" )</th>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input type="text" id="name" name="name"></td>
+ </tr>
+</table>
+
+#tblDynamicAttributes( { "attributes": $attributes } )
+
+<table>
+ <colgroup>
+ <col style="width: 500px;"/>
+ <col/>
+ <col style="width: 500px;"/>
+ </colgroup>
+
+ <tr>
+ <th>$i18n.getString( "available_users" )</th>
+ <th></th>
+ <th>$i18n.getString( "group_members" )</th>
+ </tr>
+
+ <tr>
+ <td>
+ <select id="availableUsersList" name="availableUsersList" multiple="multiple" style="height: 200px; width: 100%;"></select>
+ </td>
+
+ <td style="text-align:center">
+ <input type="button" value=">" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'availableUsersList' );"/><br/>
+ <input type="button" value="<" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'groupMembersList' );"/><br/>
+ <input type="button" value=">>" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableUsersList' );"/><br/>
+ <input type="button" value="<<" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'groupMembersList' );"/>
+ </td>
+
+ <td>
+ <select id="groupMembersList" name="groupMembersList" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px;"></select>
+ </td>
+ </tr>
+</table>
+
+<p>
+ <input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/>
+ <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='getAllUserGroups.action'" style="width:10em"/>
+</p>
+
+</form>
=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/userGroupList.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/userGroupList.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/userGroupList.js 2013-03-12 09:27:40 +0000
@@ -0,0 +1,20 @@
+
+// -----------------------------------------------------------------------------
+// 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' );
+}
=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/usergroup.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/usergroup.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/usergroup.js 2013-03-12 09:27:40 +0000
@@ -0,0 +1,20 @@
+
+// -----------------------------------------------------------------------------
+// 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' );
+}
=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/updateUserGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/updateUserGroupForm.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/updateUserGroupForm.vm 2013-03-12 09:27:40 +0000
@@ -0,0 +1,96 @@
+<script type="text/javascript">
+ jQuery(document).ready(function() {
+ validation2( 'editUserGroupForm', function( form )
+ {
+ form.submit();
+ }, {
+ 'beforeValidateHandler' : function()
+ {
+ #tblDynamicAttributesJavascript();
+ },
+ 'rules' : getValidationRules( "userGroup" )
+ } );
+
+ jQuery("#availableUsersList").dhisAjaxSelect({
+ source: "../dhis-web-commons-ajax-json/getUsers.action",
+ iterator: "users",
+ connectedTo: 'groupMembersList',
+ handler: function(item) {
+ var option = jQuery("<option />");
+ option.text( item.surname + ", " + item.firstName );
+ option.attr( "value", item.id );
+
+ return option;
+ }
+ });
+
+ /* remote validation */
+ /* checkValueIsExist( "name", "validateUserGroup.action", {
+ id : $group.id
+ } ); */
+ });
+</script>
+
+<h3>$i18n.getString( "edit_user_group" )</h3>
+
+<form id="editUserGroupForm" name="editUserGroupForm" action="updateUserGroup.action" method="post" class="inputForm">
+
+<input type="hidden" name="userGroupId" id="userGroupId" value="$group.id" />
+<table id="detailsList">
+ <col style="width: 120px"/>
+ <col style="width: 270px"/>
+
+ <tr>
+ <th colspan="2">$i18n.getString( "user_group_details" )</th>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input type="text" id="name" name="name" value ="$encoder.htmlEncode( $group.name )"></td>
+ </tr>
+
+</table>
+
+#tblDynamicAttributes( { "attributes": $attributes, "attributeValues": $attributeValues } )
+
+<table>
+ <colgroup>
+ <col style="width: 500px;"/>
+ <col/>
+ <col style="width: 500px;"/>
+ </colgroup>
+
+ <tr>
+ <th>$i18n.getString( "available_users" )</th>
+ <th></th>
+ <th>$i18n.getString( "group_members" )</th>
+ </tr>
+
+ <tr>
+ <td>
+ <select id="availableUsersList" name="availableUsersList" multiple="multiple" style="height: 200px; width: 100%;"></select>
+ </td>
+
+ <td style="text-align:center">
+ <input type="button" value=">" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'availableUsersList' );"/><br/>
+ <input type="button" value="<" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'groupMembersList' );"/><br/>
+ <input type="button" value=">>" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableUsersList' );"/><br/>
+ <input type="button" value="<<" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'groupMembersList' );"/>
+ </td>
+
+ <td>
+ <select id="groupMembersList" name="groupMembersList" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px;">
+ #foreach( $user in $groupMembers )
+ <option value="$user.id">$encoder.htmlEncode( $user.surname ), $!encoder.htmlEncode( $user.firstName )</option>
+ #end
+ </select>
+ </td>
+ </tr>
+</table>
+
+<p>
+ <input type="submit" value="$i18n.getString( 'save' )" style="width:10em" />
+ <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='getAllUserGroups.action'" style="width:10em" />
+</p>
+
+</form>
=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/userGroupList.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/userGroupList.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/userGroupList.vm 2013-03-12 09:27:40 +0000
@@ -0,0 +1,81 @@
+
+#sharingDialog()
+
+<script type="text/javascript">
+ var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete" ) , "'" )';
+</script>
+
+<h3>$i18n.getString( "user_group_management" ) #openHelp( "user_group_management" )</h3>
+
+<table class="mainPageTable">
+ <tr>
+ <td style="vertical-align:top">
+ <table width="100%">
+ <tr>
+ <td>#filterDiv( "getAllUserGroups" )</td>
+ <td colspan="9" style="text-align:right">
+ <input type="button" value="$i18n.getString( 'add_new' )" onclick="window.location.href='addUserGroupForm.action'" style="width:80px"/></a>
+ </td>
+ </tr>
+ </table>
+ <table class="listTable" id="listTable">
+ <col/>
+ <col width="120"/>
+ <thead>
+ <tr>
+ <th>$i18n.getString( "name" )</th>
+ <th style="text-align:center" class="{sorter: false}">$i18n.getString( "operations" )</th>
+ </tr>
+ </thead>
+ <tbody id="list">
+ #foreach( $userGroup in $userGroupList )
+ <tr id="tr${userGroup.id}">
+ <td onclick="showUserGroupDetails( $userGroup.id )">$encoder.htmlEncode( $userGroup.name )</td>
+ <td style="text-align:center">
+
+ #if ( $security.canManage( $userGroup ) )
+ <a href="javascript:showSharingDialog('userGroup', '$userGroup.uid');" title="$i18n.getString( 'sharing_settings' )"><img src="../images/relationship.png" alt="$i18n.getString( 'sharing_settings' )"></a>
+ #else
+ <img src="../images/relationship-denied.png">
+ #end
+
+ #if( $security.canUpdate( $userGroup ) )
+ <a href="editUserGroupForm.action?userGroupId=$userGroup.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"/></a>
+ #else
+ <img src="../images/edit-denied.png">
+ #end
+
+ #if( $security.canDelete( $userGroup ) )
+ <a href="javascript:removeUserGroup( '$userGroup.id', '$encoder.jsEncode( $userGroup.name )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></a>
+ #else
+ <img src="../images/delete-denied.png">
+ #end
+
+ <a href="javascript:showUserGroupDetails( $userGroup.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"/></a>
+
+ </td>
+ </tr>
+ #end
+ </tbody>
+ </table>
+ <p></p>
+ #parse( "/dhis-web-commons/paging/paging.vm" )
+ </td>
+ <td style="width:20em; padding-left:2em; vertical-align:top">
+ <div id="detailsArea" style="display:none">
+ <div style="float:right">
+ <a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_details' )"/></a>
+ </div>
+ <p><label>$i18n.getString( "name" ):</label><br/><span id="nameField"></span></p>
+ <p><label>$i18n.getString( "no_of_Users" ):</label><br/><span id="noOfGroupField"></span></p>
+ </div>
+
+ <div id="warningArea" style="position:fixed;right:10px;top:200px;display:none">
+ <div style="float:right">
+ <a href="javascript:hideWarning()" title="$i18n.getString( 'hide_warning' )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_warning' )"/></a>
+ </div>
+ <p><span id="warningField"></span></p>
+ </div>
+ </td>
+ </tr>
+</table>