Revision 46:2fc702f02f0e

View differences:

WebContent/jsp/ss102_user_admin/ibssUserDetails.jsp
101 101
    </strong></td>
102 102
    <td colspan="2">&nbsp;</td>
103 103
  </tr>
104
    <c:choose>
104
    <%-- <c:choose>
105 105
  	<c:when test="${accessBean ne 3 and not empty detailBean.map.userGroupName}">
106 106
  		<tr>
107 107
  		    <td>&nbsp;</td>
......
118 118
    		<td rowspan="2">&nbsp;</td>
119 119
  		</tr>
120 120
  	</c:when>
121
  </c:choose>
121
  </c:choose> --%>
122 122
  <tr>
123 123
    <td>&nbsp;</td>
124 124
    <td><bean:message key="user.status"/>:</td>
......
217 217
    <td>&nbsp;</td>
218 218
    <td>&nbsp;</td>
219 219
  </tr>
220
  <tr>
220
 <%--  <tr>
221 221
    <td>&nbsp;</td>
222 222
    <td><strong><bean:message key="user.access"/>:</strong></td>
223 223
    <td>&nbsp;</td>
......
298 298
					</td>
299 299
				</tr>
300 300
			</c:when>
301
		</c:choose>
301
		</c:choose> --%>
302 302
  </table>
303 303
  <div class="floatRight">
304 304
  	<htmlEL:cancel property="action" styleClass="button" onclick="overlay();">
WebContent/jsp/ss102_user_admin/ibssUserEdit.jsp
77 77
    <td>&nbsp;</td>
78 78
    <td><bean:message key="user.group"/>:</td>
79 79
    <td colspan="2">
80
    	<htmlEL:select property="userGroup" name="ibssUserForm" onchange="this.form.submit();overlay();">
80
    	<htmlEL:select property="userGroup" name="ibssUserForm" >
81 81
    		<htmlEL:option value=""><bean:message key="general.select.option0"/></htmlEL:option>
82 82
    		<logicEL:iterate id="element" name="viewBean" property="userGroupMap">
83 83
				<bean:define id="value" name="element" property="value"/>
84 84
				<bean:define id="key" name="element" property="key"  />
85
					<htmlEL:option value="${key}">
85
					<htmlEL:option value="${value}">
86 86
						<bean:write name="element" property="value"/>
87 87
					</htmlEL:option>
88 88
			</logicEL:iterate>
......
90 90
    </td>
91 91
    <td colspan="2">&nbsp;</td>
92 92
  </tr>
93
  <c:choose>
93
  <%-- <c:choose>
94 94
  	<c:when test="${ibssUserForm.map.ibssUserAccessView.map.modeType ne 3 and not empty ibssUserForm.map.ibssUserAccessView.map.actionList}">
95 95
  		<tr>
96 96
  		    <td>&nbsp;</td>
......
101 101
    		<td rowspan="2">&nbsp;</td>
102 102
  		</tr>
103 103
  	</c:when>
104
  </c:choose>
104
  </c:choose> --%>
105 105
  <tr>
106 106
    <td>&nbsp;</td>
107 107
    <td><bean:message key="user.created.by"/>:</td>
......
161 161
    <td>&nbsp;</td>
162 162
    <td>&nbsp;</td>
163 163
  </tr>
164
  <tr>
164
 <%--  <tr>
165 165
    <td>&nbsp;</td>
166 166
    <td><c:if test="${not empty ibssUserForm.map.userGroup}"><strong><bean:message key="user.access"/></strong>:</c:if></td>
167 167
    <td>&nbsp;</td>
......
242 242
					</td>
243 243
				</tr>
244 244
			</c:when>
245
		</c:choose>
245
		</c:choose> --%>
246 246
</table>
247 247
<div id="buttons">
248 248
<htmlEL:submit property="action" styleClass="button" onclick="overlay();">
WebContent/jsp/ss102_user_admin/ibssUserEditConfirm.jsp
86 86
  <tr>
87 87
    <td>&nbsp;</td>
88 88
    <td><bean:message key="user.group"/>:</td>
89
    <td colspan="2">
90
    	<htmlEL:select property="userGroup" name="ibssUserForm" onchange="this.form.submit()" disabled="true">
91
    		<htmlEL:option value=""><bean:message key="general.select.option0" /></htmlEL:option>
92
    		<logicEL:iterate id="element" name="viewBean" property="userGroupMap">
93
				<bean:define id="value" name="element" property="value"/>
94
				<bean:define id="key" name="element" property="key"  />
95
					<htmlEL:option value="${key}">
96
						<bean:write name="element" property="value"/>
97
					</htmlEL:option>
98
			</logicEL:iterate>
99
    	</htmlEL:select>
100
    </td>
101
    <td colspan="2">&nbsp;</td>
89
    <td colspan="2"><strong><bean:write property="userGroup" name="ibssUserForm" /></strong></td>
90
    <td>&nbsp;</td>
102 91
  </tr>
103
  <c:choose>
92
 <%--  <c:choose>
104 93
  	<c:when test="${ibssUserForm.map.ibssUserAccessView.map.modeType ne 3 }">
105 94
  		<tr>
106 95
  		    <td width="69">&nbsp;</td>
......
111 100
    		<td colspan="2">&nbsp;</td>
112 101
  		</tr>
113 102
  	</c:when>
114
  </c:choose>
103
  </c:choose> --%>
115 104
  <tr>
116 105
    <td>&nbsp;</td>
117 106
    <td><bean:message key="user.created.by"/>:</td>
......
171 160
    <td>&nbsp;</td>
172 161
    <td>&nbsp;</td>
173 162
  </tr>
174
  <tr>
163
  <%-- <tr>
175 164
    <td>&nbsp;</td>
176 165
    <td>&nbsp;</td>
177 166
    <td>&nbsp;</td>
......
252 241
					</td>
253 242
				</tr>
254 243
			</c:when>
255
		</c:choose>
244
		</c:choose> --%>
256 245
</table>
257 246
<div id="buttons">
258 247
<htmlEL:submit property="action" styleClass="button" onclick="overlay();">
......
264 253
</div>
265 254
</htmlEL:form>
266 255

  
267
<script type="text/javascript">
256
<!-- <script type="text/javascript">
268 257
$(".checkAll").change(function() {
269 258
	var singleValues = $(this).val();
270 259
	var selected = "."+singleValues;
......
276 265
	var selected = "."+singleValues;
277 266
	$(selected).find("input[type=checkbox]").prop("checked",this.checked);
278 267
	});
279
</script>
268
</script> -->
src/com/ib/ibss/controller/actions/ss102_user_admin/IBSSUserEnquiryEditConfirmAction.java
63 63
		}
64 64
		else if ("next".equalsIgnoreCase(m_sAction))
65 65
		{	
66
			//Check modeType. If 2, change validation with user role required.
67
			String modeType = "1";
68
			IBSSDynaBean m_oIBDynaBean = IBSSDynaBeanManager.createIBSSDynaBean (p_oForm, p_oMapping);
69
			String userGroup = (String) m_oIBDynaBean.get(IBSSUserConstants.USER_GROUP);
70
			if(!DataValidator.isEmptyString(userGroup)){
71
				try{
72
					IBSSDynaBean m_oIBViewBean = (IBSSDynaBean) m_oIBDynaBean.get(IBSSUserConstants.IBSS_USER_ACCESS_VIEW);
73
					modeType = (String) m_oIBViewBean.get(IBSSUserConstants.ACCESS_VIEW_MODE_TYPE);	
74
					String[] groupAccessStr = p_oRequest.getParameterValues (IBSSUserConstants.USER_SELECTED_ACCESSES);
75
					
76
					if(!ModeType.OBSERVATION.getModeIdentifier().equalsIgnoreCase(modeType) && groupAccessStr == null){
77
						throw IBSSErrorHandler.createBusinessException("group.access.error.", "2", new String[] {""});
78
					}
79
					
80
					int arraySize = groupAccessStr == null ? 0 : groupAccessStr.length;
81
					Long[] groupAccessLong = new Long[arraySize];
82
					if(groupAccessStr != null){
83
						groupAccessLong = new Long[groupAccessStr.length];  
84
						for (int i = 0; i < groupAccessStr.length; i++) {  
85
							groupAccessLong[i] = Long.valueOf(groupAccessStr[i]);  
86
						}  				
87
					}
88
					m_oIBDynaBean.set(IBSSUserConstants.USER_SELECTED_ACCESSES, groupAccessLong);
89
				}catch (IBSSGenericException e)
90
				{
91
					errorHandling(p_oRequest, p_oMapping, e);
92
				}
93
			}
94
			
95
			String validator = ModeType.OBSERVATION.getModeIdentifier().equalsIgnoreCase(modeType) ?  JSPValidator.EDIT_ADMIN_VALIDATION : JSPValidator.EDIT_ADMIN_VALIDATION_WITH_ROLE;
66
			String validator = JSPValidator.EDIT_ADMIN_VALIDATION_WITH_ROLE;
96 67
			
97 68
			ActionErrors m_oError = p_oForm.validate(createNewActionMapping(p_oMapping, validator), p_oRequest);
98 69
		
src/com/ib/ibss/enterprise/services/ss102_user_admin/IBSSUserEnquiryDetailsServices.java
83 83
		{
84 84
			/* Set information into detail bean */
85 85
			setIntoDetails();
86
			/* Set available action to array */
87
			setAvailableActionForDisplay();
86
//			/* Set available action to array */
87
//			setAvailableActionForDisplay();
88 88
		}
89 89
		catch (Exception e)
90 90
		{
src/com/ib/ibss/enterprise/services/ss102_user_admin/IBSSUserEnquiryEditResultServices.java
12 12
package com.ib.ibss.enterprise.services.ss102_user_admin;
13 13

  
14 14
import java.util.Date;
15
import java.util.LinkedHashSet;
16 15
import java.util.LinkedList;
17 16
import java.util.List;
17
import java.util.Map;
18 18
import java.util.Set;
19 19

  
20 20
import net.penril.ibss.audit.log.AuditLogConstants;
21 21
import net.penril.ibss.audit.log.USER_ACTIVITY_TYTPE;
22 22
import net.penril.ibss.core.hibernate.AdminPermission;
23
import net.penril.ibss.core.hibernate.AdminPermissionId;
24 23
import net.penril.ibss.core.hibernate.AdminUserProfile;
25 24

  
26
import org.apache.commons.beanutils.DynaBean;
27

  
28
import com.ib.ibss.common.constant.AdminNavigationModeType.ModeType;
29
import com.ib.ibss.common.constant.AdminPermissionModeType.IBAMPermission;
30 25
import com.ib.ibss.common.utils.IBSSLogger;
31 26
import com.ib.ibss.common.utils.ResourcesUtils;
32 27
import com.ib.ibss.enterprise.services.IBSSEnterpriseServicesWorkspace;
......
67 62
		super(sessionObjects);
68 63
	}
69 64
	
65
	@SuppressWarnings("unchecked")
70 66
	public void updateEditedProfile () throws IBSSGenericException
71 67
	{
72 68
		IBSSLogger.debug (c_oClass, "Entering updateEditedProfile");
......
82 78
		String c_sEditUserMobileNo 		= getBeanMessage (IBSSUserConstants.USER_MOBILE_NO);
83 79
		String c_sEditUserGroup			= getBeanMessage (IBSSUserConstants.USER_GROUP);
84 80
		
85
		//AdminUserProfile userProfileBeforeChange = null;
86 81
		AdminUserProfile m_oUser = null;
87 82
		AdminUserProfile m_oClone= null;
88
		String userAdminRole	 = null;
89 83
		List<AdminPermission> permissionList = new LinkedList<AdminPermission>();
90 84
		try
91 85
		{
86
			IBSSDynaBean m_oUserViewbean 	= (IBSSDynaBean) getIBSSDynaBean().get(IBSSUserConstants.IBSS_USER_VIEW);
87
			Map<Long, String>m_mUserGroupMap = (Map<Long, String>) m_oUserViewbean.get (IBSSUserConstants.USER_GROUP_MAP);
88
			
89
			for(Long key : m_mUserGroupMap.keySet())
90
			{
91
				if(m_mUserGroupMap.get(key).equals(c_sEditUserGroup))
92
				{
93
					c_sEditUserGroup = key.toString();
94
					break;
95
				}
96
			}
97
			
92 98
			m_oUser = getAdminUserProfileDAO ().getProfileAndPermissionByID (c_oDetailUserID);
93 99
			m_oClone = getAdminUserProfileDAO ().getProfileAndPermissionByID (c_oDetailUserID);
94 100
			if(m_oUser != null)
......
112 118
				m_oUser.setUpdatedBy (getIBSSessionObjects ().getSessionUser ().getUserId ());
113 119
				
114 120
				/* Set admin permission */ 
115
				DynaBean viewBean = (DynaBean) getIBSSDynaBean().get(IBSSUserConstants.IBSS_USER_ACCESS_VIEW);
116
				String groupMode = (String) viewBean.get(IBSSUserConstants.ACCESS_VIEW_MODE_TYPE);
117
				Long[] actionIdList = (Long[]) getIBSSDynaBean().get(IBSSUserConstants.USER_SELECTED_ACCESSES);
118
				String userAccessRole = (String) getIBSSDynaBean().get(IBSSUserConstants.USER_ACCESS_ROLE);
119
				Boolean isChecker = "c".equalsIgnoreCase(userAccessRole)? true : false;
120
				Set<AdminPermission> permissionSet = new LinkedHashSet<AdminPermission>();
121 121
				Set<AdminPermission> retrievedSet = m_oUser.getAdminPermissions();
122 122
				m_oUser.getAdminPermissions().removeAll(retrievedSet);
123 123
				
124
				/* Set user admin role to admin profile for Customer Interaction Group only*/
125
				if(!ModeType.OBSERVATION.getModeIdentifier().equalsIgnoreCase(groupMode)){
126
					userAdminRole = isChecker ? "Checker" : "Maker";
127
				}
128
				m_oUser.setUserAdminRole(userAdminRole);
129
				
130
				//Test Observation no actionId
131
				if(!ModeType.OBSERVATION.getModeIdentifier().equalsIgnoreCase(groupMode)){
132
					if(actionIdList != null){
133
						for(int i = 0; i<actionIdList.length; i++){
134
							AdminPermission permission = new AdminPermission();
135
							permission.setApprover(isChecker);
136
							permission.setAdminAuthPermissionId(new AdminPermissionId(m_oUser.getUserId(), actionIdList[i]));
137
							permissionSet.add(permission);
138
//					m_oUser.getAdminPermissions().add(permission);
139
						}
140
						m_oUser.getAdminPermissions().addAll(permissionSet);						
141
					}
142
				}
143
				
144
				/* This service to be shared among admin features and MK features */
145
				AdminSharedServices m_oAdminService = new AdminSharedServices ();
146
				/* Get maker checker settings */
147
				Long actionId = IBAMPermission.EDIT_IBAM_USER.getActionId();
148

  
149 124
				/* Update profile */
150 125
				getAdminUserProfileDAO ().updateUser (m_oUser);
151 126
				/* Update session Permission List if userId same with current session userId*/

Also available in: Unified diff