Statistics
| Branch: | Revision:

m2u-upass-admin / WebContent / jsp / ss113_group / ibssIbGroupEdit.jsp @ 7:e68e6402cd84

History | View | Annotate | Download (12.8 KB)

1 0:ea666cc7880e hadi
<%@ taglib uri="/WEB-INF/tld/struts-html-el" prefix="htmlEL" %>
2
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean" %>
3
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic" %>
4
<%@ taglib uri="/WEB-INF/tld/struts-logic-el" prefix="logicEL" %>
5
<%@ taglib uri="/WEB-INF/tld/c" prefix="c" %>
6
7
<bean:define id="detailBean" name="ibssGroupForm" property="ibssGroupDetailBean"/>
8
<bean:define id="viewBean" name="ibssGroupForm" property="ibssGroupView"/>
9
<bean:define id="accessibleArray" name="viewBean" property="accessibleArray"/>
10
<h3 class="title"><strong><c:out value="${sessionScope.displayDesc}"/> - <bean:message key="navigation.details.displayDesc.edit" /></strong></h3>
11
<table id="errorTable">
12
<tr>
13
	<td>
14
		<span id="serverSideError" class="error"><jsp:include flush="true" page="/jsp/errorHandler.jsp"></jsp:include></span>
15
	</td>
16
</tr>
17
</table>
18
<table class="stepTable">
19
<tr>
20
<td>&nbsp;</td>
21
<td><div id="steps"><span><bean:message key="general.title.steps" arg0="1" arg1="2"/></span></div></td>
22
23
</tr>
24
</table>
25
<htmlEL:form action="/ss113/groupEditResult.do">
26
<table class="tabularForm" width="517" height="97" border="1">
27
  <tr>
28
    <td width="69">&nbsp;</td>
29
    <td width="133">&nbsp;</td>
30
    <td colspan="2">&nbsp;</td>
31
    <td width="63">&nbsp;</td>
32
  </tr>
33
  <tr>
34
    <td width="69">&nbsp;</td>
35
    <td><bean:message key="group.id"/>:</td>
36
    <td colspan="2"><strong><c:out value="${detailBean.map.groupID}"/></strong></td>
37
    <td>&nbsp;</td>
38
    </tr>
39
    <tr>
40
    <td width="69">&nbsp;</td>
41
    <td><bean:message key="group.user.type"/>:</td>
42
    <td colspan="2"><strong><c:out value="${detailBean.map.userType}"/></strong></td>
43
    <td>&nbsp;</td>
44
    </tr>
45
  <tr>
46
    <td width="69">&nbsp;</td>
47
    <td><bean:message key="group.name"/>:</td>
48
    <td colspan="2"><strong><htmlEL:text name="ibssGroupForm" property="groupName" autocomplete="off"/></strong></td>
49
    <td>&nbsp;</td>
50
  </tr>
51
  <tr>
52
    <td width="69">&nbsp;</td>
53
    <td><bean:message key="group.description"/>:</td>
54
    <td colspan="2"><strong><htmlEL:textarea name="ibssGroupForm" property="groupDescription"/></strong></td>
55
    <td>&nbsp;</td>
56
  </tr>
57
  <tr>
58
    <td width="69">&nbsp;</td>
59
    <td><bean:message key="group.created.by"/>:</td>
60
    <td colspan="2"><strong>
61
    	<c:choose>
62
    		<c:when test="${not empty detailBean.map.groupCreatedBy}">
63
    			<c:out value="${detailBean.map.groupCreatedBy}"/>
64
    		</c:when>
65
    		<c:otherwise>-</c:otherwise>
66
    	</c:choose>
67
    </strong></td>
68
    <td>&nbsp;</td>
69
  </tr>
70
  <tr>
71
    <td width="69">&nbsp;</td>
72
    <td><bean:message key="group.creation.date"/>:</td>
73
    <td colspan="2"><strong>
74
    	<c:choose>
75
    		<c:when test="${not empty detailBean.map.groupCreationDate}">
76
    			<c:out value="${detailBean.map.groupCreationDate}"/>
77
    		</c:when>
78
    		<c:otherwise>-</c:otherwise>
79
    	</c:choose>
80
    </strong></td>
81
    <td>&nbsp;</td>
82
  </tr>
83
  <tr>
84
    <td width="69">&nbsp;</td>
85
    <td><bean:message key="group.updated.by"/>:</td>
86
    <td colspan="2"><strong>
87
    	<c:choose>
88
    		<c:when test="${not empty detailBean.map.groupUpdatedBy}">
89
    			<c:out value="${detailBean.map.groupUpdatedBy}"/>
90
    		</c:when>
91
    		<c:otherwise>-</c:otherwise>
92
    	</c:choose>
93
    </strong></td>
94
    <td>&nbsp;</td>
95
  </tr>
96
  <tr>
97
    <td width="69">&nbsp;</td>
98
    <td><bean:message key="group.updated.date"/>:</td>
99
    <td colspan="2"><strong>
100
    	<c:choose>
101
    		<c:when test="${not empty detailBean.map.groupUpdatedDate}">
102
    			<c:out value="${detailBean.map.groupUpdatedDate}"/>
103
    		</c:when>
104
    		<c:otherwise>-</c:otherwise>
105
    	</c:choose>
106
    </strong></td>
107
    <td>&nbsp;</td>
108
  </tr>
109
  <tr>
110
    <td>&nbsp;</td>
111
    <td>&nbsp;</td>
112
    <td colspan="2">&nbsp;</td>
113
    <td>&nbsp;</td>
114
  </tr>
115
  <tr>
116
    <td>&nbsp;</td>
117
    <td><strong><bean:message key="group.access"/></strong>:</td>
118
    <td>&nbsp;</td>
119
    <td>&nbsp;</td>
120
    <td>&nbsp;</td>
121
  </tr>
122
  <tr>
123
	  <td>&nbsp;</td>
124
	  <td>&nbsp;</td>
125
	  <td colspan="4">
126
	  <br/>
127
		<ul class="treeHierarchy" class="right">
128
			<c:forEach var="item" items="${viewBean.map.navigationList}" varStatus="index">
129
				<c:set var="css" value=""/>
130
				<c:if test="${index.last}"><c:set var="css" value="lastLine"/></c:if>
131
				<li class="<c:out value="${css}"/>">
132
					<htmlEL:multibox name="viewBean" property="accessibleArray" disabled="false"><c:out value="${item.nodeId}"/></htmlEL:multibox>
133
				  	<bean:message key="general.button.view"/>
134
				  	<htmlEL:multibox name="viewBean" property="editableArray" disabled="false"><c:out value="${item.nodeId}"/></htmlEL:multibox>
135
				  	<bean:message key="general.button.edit"/>&nbsp; &nbsp; &nbsp;
136
					<label class="nodeName"><c:out value="${item.nodeName}"/></label>
137
					(<c:out value="${item.nodeCode}"/>)
138
139
					<c:if test="${not empty item.subNavigations}">
140
					<ul>
141
					<c:forEach var="subItem" items="${item.subNavigations}" varStatus="index1">
142
						<c:set var="css" value=""/>
143
						<c:if test="${index1.last}"><c:set var="css" value="lastLine"/></c:if>
144
						<li class="<c:out value="${css}"/>">
145
							<htmlEL:multibox onclick="SelectChildren(this);" name="viewBean" property="accessibleArray" disabled="false"><c:out value="${subItem.nodeId}"/></htmlEL:multibox>
146
						  	<bean:message key="general.button.view"/>
147
						  	<htmlEL:multibox onclick="SelectChildren(this);" name="viewBean" property="editableArray" disabled="false"><c:out value="${subItem.nodeId}"/></htmlEL:multibox>
148
						  	<bean:message key="general.button.edit"/>&nbsp; &nbsp; &nbsp;
149
							<label class="nodeName"><c:out value="${subItem.nodeName}"/></label>
150
							(<c:out value="${subItem.nodeCode}"/>)
151
152
							<c:if test="${not empty subItem.subNavigations}">
153
							<ul>
154
							<c:forEach var="thirdItem" items="${subItem.subNavigations}" varStatus="index2">
155
								<c:set var="css" value=""/>
156
								<c:if test="${index2.last}"><c:set var="css" value="lastLine"/></c:if>
157
								<li class="<c:out value="${css}"/>">
158
									<htmlEL:multibox onclick="SelectChildren(this);" name="viewBean" property="accessibleArray" disabled="false"><c:out value="${thirdItem.nodeId}"/></htmlEL:multibox>
159
								  	<bean:message key="general.button.view"/>
160
								  	<htmlEL:multibox onclick="SelectChildren(this);" name="viewBean" property="editableArray" disabled="false"><c:out value="${thirdItem.nodeId}"/></htmlEL:multibox>
161
								  	<bean:message key="general.button.edit"/>&nbsp; &nbsp; &nbsp;
162
									<label class="nodeName"><c:out value="${thirdItem.nodeName}"/></label>
163
									(<c:out value="${thirdItem.nodeCode}"/>)
164
165
									<c:if test="${not empty thirdItem.subNavigations}">
166
									<ul>
167
									<c:forEach var="forthItem" items="${thirdItem.subNavigations}" varStatus="index3">
168
										<c:set var="css" value=""/>
169
										<c:if test="${index3.last}"><c:set var="css" value="lastLine"/></c:if>
170
										<li class="<c:out value="${css}"/>">
171
											<htmlEL:multibox onclick="SelectChildren(this);" name="viewBean" property="accessibleArray" disabled="false">
172
											<c:out value="${forthItem.nodeId}"/>
173
											</htmlEL:multibox>
174
											<bean:message key="general.button.view"/>
175
176
											<htmlEL:multibox onclick="SelectChildren(this);" name="viewBean" property="editableArray" disabled="false"><c:out value="${forthItem.nodeId}"/>
177
											</htmlEL:multibox>
178
											<bean:message key="general.button.edit"/>&nbsp; &nbsp; &nbsp;
179
											<label class="nodeName"><c:out value="${forthItem.nodeName}"/></label>
180
											(<c:out value="${forthItem.nodeCode}"/>)
181
182
											<c:if test="${not empty forthItem.subNavigations}">
183
											<ul>
184
											<c:forEach var="fifthItem" items="${forthItem.subNavigations}" varStatus="index4">
185
												<c:set var="css" value=""/>
186
												<c:if test="${index4.last}"><c:set var="css" value="lastLine"/></c:if>
187
												<li class="<c:out value="${css}"/>">
188
													<htmlEL:multibox onclick="SelectChildren(this);" name="viewBean" property="accessibleArray" disabled="false"><c:out value="${fifthItem.nodeId}"/></htmlEL:multibox>
189
												  	<bean:message key="general.button.view"/>
190
												  	<htmlEL:multibox onclick="SelectChildren(this);" name="viewBean" property="editableArray" disabled="false"><c:out value="${fifthItem.nodeId}"/></htmlEL:multibox>
191
												  	<bean:message key="general.button.edit"/>&nbsp; &nbsp; &nbsp;
192
													<label class="nodeName"><c:out value="${fifthItem.nodeName}"/></label>
193
													(<c:out value="${fifthItem.nodeCode}"/>)
194
												</li>
195
											</c:forEach>
196
											</ul>
197
											</c:if>
198
										</li>
199
									</c:forEach>
200
									</ul>
201
									</c:if>
202
								</li>
203
							</c:forEach>
204
							</ul>
205
							</c:if>
206
						</li>
207
					</c:forEach>
208
					</ul>
209
					</c:if>
210
				</li>
211
			</c:forEach>
212
		</ul>
213
	  </td>
214
	</tr>
215
</table>
216
<div class="floatRight">
217
	<htmlEL:submit property="action" styleClass="button" onclick="overlay();">
218
		<bean:message key="general.button.confirm"/>
219
	</htmlEL:submit>
220
	<htmlEL:submit property="action" styleClass="button" onclick="overlay();">
221
		<bean:message key="general.button.back"/>
222
	</htmlEL:submit>
223
</div>
224
</htmlEL:form>
225
226
<script language="javascript">
227
var flag = true;
228
$('.selectAllCheck').click(function(){
229
	if(flag){
230
		$('.treeHierarchy input:checkbox').attr('checked','checked');
231
		flag = false;
232
	}
233
	else{
234
		$(".treeHierarchy input:checkbox").removeAttr("checked");
235
		flag = true;
236
	}
237
});
238
$('.treeHierarchy input:checkbox[name|="editableArray"]').click(function(){
239
	var parentBoxes = $(this).parent().parent().children().children('input[name="editableArray"]');
240
	var isCheck = false;
241
	$(parentBoxes).each(function(){
242
		if($(this).attr('checked') == 'checked'){
243
			isCheck = true;
244
			return;
245
		};
246
	});
247
	if(!isCheck){
248
		$(this).parents().children('input[name="editableArray"]').attr('checked', this.checked);
249
		isCheck = false;
250
	}
251
	else{
252
		$(this).parent().parent().parent().children('input[name="editableArray"]').attr('checked', 'checked');
253
	};
254
255
	var accessibleParentBoxes = $(this).parent().parent().children().children('input[name="accessibleArray"]');
256
	var isAccessibleAvailable = false;
257
	$(accessibleParentBoxes).each(function(){
258
		if($(this).attr('checked') == 'checked'){
259
			isAccessibleAvailable = true;
260
			return;
261
		};
262
	});
263
	if(isAccessibleAvailable){
264
		$(this).parent().parent().parent().children('input[name="accessibleArray"]').attr('checked', 'checked');
265
	}
266
267
	var childrenBoxes = $(this).parent().children().children().children('input[name="editableArray"]');
268
	var isChildChecked = false;
269
	if(childrenBoxes.size() > 0){
270
		$(childrenBoxes).each(function(){
271
			if($(this).attr('checked') == 'checked'){
272
				isChildChecked = true;
273
				return;
274
			};
275
		});
276
		if(isChildChecked){
277
			$(this).attr('checked', 'checked');
278
		}
279
		else{
280
			$(this).removeAttr('checked');
281
		};
282
	};
283
284
	if($(this).prev().is(":checked")){
285
	}
286
	else{
287
		if(childrenBoxes.size() == 0){
288
			$(this).prev().attr('checked','checked');
289
			$(this).prev().parent().parent().parent().children('input[name="accessibleArray"]').attr('checked','checked');
290
		};
291
	};
292
});
293
$('.treeHierarchy input:checkbox[name|="accessibleArray"]').click(function(){
294
	var childrenBoxes = $(this).parent().children().children().children('input[name="accessibleArray"]');
295
	var isChildChecked = false;
296
	if(childrenBoxes.size() > 0){
297
		$(childrenBoxes).each(function(){
298
			if($(this).attr('checked') == 'checked'){
299
				isChildChecked = true;
300
				return;
301
			};
302
		});
303
		if(isChildChecked){
304
			$(this).attr('checked', 'checked');
305
		}
306
		else{
307
			$(this).removeAttr('checked');
308
		};
309
	};
310
	if($(this).next().is(":checked") && !$(this).is(":checked")){
311
		$(this).next().removeAttr("checked");
312
	}
313
314
	var parentBoxes = $(this).parent().parent().children().children('input[name="accessibleArray"]');
315
	var isCheck = false;
316
	$(parentBoxes).each(function(){
317
		if($(this).attr('checked') == 'checked'){
318
			isCheck = true;
319
			return;
320
		};
321
	});
322
	if(!isCheck){
323
		$(this).parents().children('input[name="accessibleArray"]').attr('checked', this.checked);
324
		isCheck = false;
325
	}
326
	else{
327
		$(this).parent().parent().parent().children('input[name="accessibleArray"]').attr('checked', 'checked');
328
	};
329
330
	var editableParentBoxes = $(this).parent().parent().children().children('input[name="editableArray"]');
331
	var isEditableAvailable = false;
332
	$(editableParentBoxes).each(function(){
333
		if($(this).attr('checked') == 'checked'){
334
			isEditableAvailable = true;
335
			return;
336
		};
337
	});
338
	if(isEditableAvailable){
339
		$(this).parent().parent().parent().children('input[name="editableArray"]').attr('checked', 'checked');
340
	}
341
	else{
342
		$(this).parent().parent().parent().children('input[name="editableArray"]').removeAttr('checked');
343
	};
344
});
345
</script>