role_edit.jsp 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <%@ include file="../common/header.jsp"%>
  2. <script type="text/javascript" language="javascript">
  3. <!--
  4. function doUpdateRole(){
  5. var x = window.confirm("<bean:message key="confirm.edit"/>");
  6. if(x){
  7. document.forms.role.action.value = "edit_ok";
  8. document.forms.role.post.value = "true";
  9. document.forms.role.submit();
  10. }
  11. }
  12. function doEditSearch(){
  13. document.forms.role.action.value="edit_search";
  14. document.forms.role.submit();
  15. doDisable(document.forms.role, "button");
  16. }
  17. function doBack(){
  18. document.forms.role.action.value="edit";
  19. document.forms.role.submit();
  20. doDisable(document.forms.role, "button");
  21. }
  22. function doInactive(id,status){
  23. var x = window.confirm(" Are you sure inactivate this record?")
  24. if (x) {
  25. document.forms.role.id.value=id;
  26. document.forms.role.status.value=status;
  27. document.forms.role.action.value="update_status";
  28. document.forms.role.submit();
  29. }
  30. }
  31. function doActive(id,status){
  32. var x = window.confirm(" Are you sure activate this record?")
  33. if (x) {
  34. document.forms.role.id.value=id;
  35. document.forms.role.status.value=status;
  36. document.forms.role.action.value="update_status";
  37. document.forms.role.submit();
  38. }
  39. }
  40. -->
  41. </script>
  42. <!-- CONTENT -->
  43. <form name="role" method="post" action="role.do">
  44. <input type="hidden" name="action" value ="">
  45. <input type="hidden" name="clear" value ="">
  46. <html:hidden name="role" property="id"/>
  47. <input type="hidden" name="post">
  48. <input type="hidden" name="status" value ="">
  49. <!--td width="80%" valign="top"-->
  50. <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
  51. <tr>
  52. <td class="titleHeader"><bean:message key="project.role.key"/> - EDIT</td>
  53. </tr>
  54. </table>
  55. <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
  56. <tr><td colspan="7"><html:errors/></td></tr>
  57. <tr>
  58. <td align="center">
  59. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  60. <logic:empty name="role" property="id">
  61. <tr align = "left">
  62. <td width="15%"><b><bean:message key="role.id.key" /></b></td>
  63. <td width="1%">:</td>
  64. <td width="84%" colspan="5">
  65. <select name="idSearch">
  66. <option value="">-- Pilih Salah Satu --</option>
  67. <logic:notEmpty name="groupList">
  68. <logic:iterate id="groupElement" name="groupList">
  69. <option value="<bean:write name="groupElement"/>"
  70. <logic:equal name="groupElement" value="${role.id}">
  71. SELECTED
  72. </logic:equal>
  73. >
  74. <bean:write name="groupElement"/></option>
  75. </logic:iterate>
  76. </logic:notEmpty>
  77. </select>
  78. </td>
  79. </tr>
  80. <tr align = "left">
  81. <td width="15%"></td>
  82. <td width="1%"></td>
  83. <td width="84%" colspan="5">
  84. <input type="button" value="<bean:message key="button.edit"/>" onclick="doEditSearch();">
  85. </td>
  86. </tr>
  87. </logic:empty>
  88. <logic:notEmpty name="role" property="id">
  89. <tr>
  90. <td width="15%"><b><bean:message key="role.id.key"/> <font color="#FF0000">*</font></b></td>
  91. <td width="1">:</td>
  92. <td width="84%" colspan="5">
  93. <bean:write name="role" property="id"/>
  94. </td>
  95. </tr>
  96. <tr>
  97. <td width="15%"><b><bean:message key="role.name.key"/></b></td>
  98. <td width="1%">:</td>
  99. <td width="84%" colspan="5">
  100. <html:text name="role" property="name" size="30"/>
  101. </td>
  102. </tr>
  103. <tr align = "left">
  104. <td width="15%"><b><bean:message key="role.type.key" /></b></td>
  105. <td width="1%">:</td>
  106. <td width="84%" colspan="5">
  107. <select name="type">
  108. <option value="">-- Pilih Salah Satu --</option>
  109. <logic:notEmpty name="typeList">
  110. <logic:iterate id="typeElement" name="typeList">
  111. <option value="<bean:write name="typeElement" property="name"/>"
  112. <logic:equal name="role" property="type" value="${typeElement.name}">
  113. selected
  114. </logic:equal>
  115. >
  116. <bean:write name="typeElement" property="name"/></option>
  117. </logic:iterate>
  118. </logic:notEmpty>
  119. </select>
  120. </td>
  121. </tr>
  122. <tr align = "left">
  123. <td valign="top"><b><bean:message key="role.privilege.key"/></b></td>
  124. <td valign="top">:</td>
  125. <td align="left"><div style="overflow:auto;height: 200px; width: 200px;;border:1px solid #336699;padding-left:5px">
  126. <table border="0" width="100%" align="center" cellpadding="2" cellspacing="1">
  127. <logic:notEmpty name="privilegesSetList">
  128. <logic:iterate id="privileges" name="privilegesSetList" >
  129. <tr>
  130. <td width="1%" align="right">
  131. <input type="checkbox" name="<bean:write name="privileges" property="id"/>"
  132. <logic:notEmpty name="role" property="privileges">
  133. <logic:iterate id="element_privileges" name="role" property="privileges" >
  134. <logic:equal name="privileges" property="id" value="${element_privileges.id}">
  135. checked
  136. </logic:equal>
  137. </logic:iterate>
  138. </logic:notEmpty>
  139. >
  140. </td>
  141. <td><bean:write name="privileges" property="name"/></td>
  142. </tr>
  143. </logic:iterate>
  144. </logic:notEmpty>
  145. </table>
  146. </div>
  147. </td>
  148. </tr>
  149. <tr>
  150. <td width="15%"><b><bean:message key="role.status.key"/></b></td>
  151. <td width="1%">:</td>
  152. <td width="84%" colspan="5">
  153. <bean:write name="role" property="status"/>
  154. </td>
  155. </tr>
  156. <tr>
  157. <td width="15%"></td>
  158. <td width="1%"></td>
  159. <td width="84%" colspan="5">
  160. <input type="button" value="<bean:message key="button.back"/>" onclick="javascript:doBack();"/>&nbsp;
  161. <input type="button" value="<bean:message key="button.submit"/>" onclick="doUpdateRole();"/>
  162. <logic:equal name="role" property ="status" value="ACTIVE">
  163. <input type="button" value="<bean:message key="button.inactive"/>" onclick="doInactive('<bean:write name="role" property="id"/>','INACTIVE');">
  164. </logic:equal>
  165. <logic:equal name="role" property ="status" value="INACTIVE">
  166. <input type="button" value="<bean:message key="button.active"/>" onclick="doActive('<bean:write name="role" property="id"/>','ACTIVE');">
  167. </logic:equal>
  168. </td>
  169. </tr>
  170. </logic:notEmpty>
  171. <tr>
  172. <td>&nbsp;</td>
  173. <td>&nbsp;</td>
  174. <td>&nbsp;</td>
  175. <td>&nbsp;</td>
  176. <td>&nbsp;</td>
  177. <td>&nbsp;</td>
  178. <td>&nbsp;</td>
  179. </tr>
  180. </table>
  181. </td>
  182. </tr>
  183. <tr>
  184. <td>&nbsp;</td>
  185. </tr>
  186. </table>
  187. </form>
  188. <!-- END CONTENT -->
  189. <%@ include file="../common/footer.jsp"%>