dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #01058
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 310: Impl add orgunit from orgunitgroup in edit user
------------------------------------------------------------
revno: 310
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Wed 2009-05-20 11:47:08 +0200
message:
Impl add orgunit from orgunitgroup in edit user
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/SetupTreeAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/xwork.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allUser.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/SetupTreeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/SetupTreeAction.java 2009-05-05 15:24:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/SetupTreeAction.java 2009-05-20 09:47:08 +0000
@@ -41,6 +41,7 @@
import org.hisp.dhis.user.CurrentUserService;
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserAuthorityGroup;
+import org.hisp.dhis.user.UserCredentials;
import org.hisp.dhis.user.UserStore;
import com.opensymphony.xwork.Action;
@@ -106,6 +107,13 @@
// Output
// -------------------------------------------------------------------------
+ private UserCredentials userCredentials;
+
+ public UserCredentials getUserCredentials()
+ {
+ return userCredentials;
+ }
+
private Collection<UserAuthorityGroup> userAuthorityGroups;
public Collection<UserAuthorityGroup> getUserAuthorityGroups()
@@ -113,11 +121,6 @@
return userAuthorityGroups;
}
- public void setUserAuthorityGroups( Collection<UserAuthorityGroup> userAuthorityGroups )
- {
- this.userAuthorityGroups = userAuthorityGroups;
- }
-
private List<OrganisationUnitGroup> organisationUnitGroups;
public List<OrganisationUnitGroup> getOrganisationUnitGroups()
@@ -144,6 +147,8 @@
selectionTreeManager.clearSelectedOrganisationUnits();
+ userAuthorityGroups = new ArrayList<UserAuthorityGroup>( userStore.getAllUserAuthorityGroups() );
+
if ( id != null )
{
User user = userStore.getUser( id );
@@ -152,6 +157,10 @@
{
selectionTreeManager.setSelectedOrganisationUnits( user.getOrganisationUnits() );
}
+
+ userCredentials = userStore.getUserCredentials( userStore.getUser( id ) );
+
+ userAuthorityGroups.removeAll( userCredentials.getUserAuthorityGroups() );
}
else
{
@@ -161,8 +170,6 @@
}
}
- userAuthorityGroups = userStore.getAllUserAuthorityGroups();
-
organisationUnitGroups = new ArrayList<OrganisationUnitGroup>( organisationUnitGroupService.getAllOrganisationUnitGroups() );
Collections.sort( organisationUnitGroups, new OrganisationUnitGroupNameComparator() );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/xwork.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/xwork.xml 2009-05-11 13:32:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/xwork.xml 2009-05-20 09:47:08 +0000
@@ -65,19 +65,13 @@
</action>
<action name="showUpdateUserForm" class="org.hisp.dhis.user.action.SetupTreeAction">
- <result name="success" type="chain">showUpdateUserFormChain</result>
- <interceptor-ref name="transactionStack"/>
- <param name="requiredAuthorities">F_USER_UPDATE</param>
- </action>
-
- <action name="showUpdateUserFormChain" class="org.hisp.dhis.user.action.GetUserAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-user/updateUserForm.vm</param>
<param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/user.js,javascript/dataElementsList.js</param>
<interceptor-ref name="organisationUnitTreeStack"/>
<param name="requiredAuthorities">F_USER_UPDATE</param>
</action>
-
+
<action name="updateUser" class="org.hisp.dhis.user.action.UpdateUserAction">
<result name="success" type="redirect">alluser.action</result>
<result name="error" type="redirect">showUpdateUserForm.action</result>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allUser.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allUser.vm 2009-03-24 14:45:47 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allUser.vm 2009-05-20 09:47:08 +0000
@@ -1,5 +1,5 @@
-<h3>$i18n.getString( "user_role_management" )</h3>
+<h3>$i18n.getString( "user_management" )</h3>
<table style="width:100%">
<tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm 2009-03-24 14:27:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm 2009-05-20 09:47:08 +0000
@@ -83,8 +83,24 @@
</select>
</td>
</tr>
+ <tr>
+ <td></td>
+ <th colspan="3">$i18n.getString( "organisation_units" )</th>
+ </tr>
+ <tr>
+ <td></td>
+ <td colspan="3">
+ <input type="button" value="$i18n.getString( "select_all_in_group" )" onclick="selectAllInGroup()" style="width:120px">
+ <select id="organisationUnitGroup" style="width:320px">
+ #foreach ( $group in $organisationUnitGroups )
+ <option value="$group.id">$encoder.htmlEncode( $group.name )</option>
+ #end
+ </select>
+ <input type="button" value="$i18n.getString( "remove_all_in_group" )" onclick="removeAllInGroup()" style="width:120px">
+ </td>
+ </tr>
<tr>
- <td><label for="selectionTree">$i18n.getString( "organisation_unit" )</label></td>
+ <td><label for="selectionTree">$i18n.getString( "organisation_unit" )</label></td>
<td colspan="3">
<div id="selectionTree" style="width:47em;height:300px;overflow:auto;border:1px solid #cccccc"></div>
</td>
--
Trunk
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.