appUser_edit.jsp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <%@ include file="../common/header.jsp"%>
  2. <script type="text/javascript" language="javascript">
  3. <!--
  4. function doEditSearch(){
  5. document.forms.appUser.action.value="edit_search";
  6. document.forms.appUser.submit();
  7. doDisable(document.forms.appUser, "button");
  8. }
  9. function doUpdate(){
  10. var x = window.confirm("Update AppUser?");
  11. var src = document.getElementById("accountNumberRight");
  12. for(var i=0; i<src.options.length; i++) {
  13. src.options[i].selected = true;
  14. }
  15. if(x){
  16. document.forms.appUser.action.value = "edit_ok";
  17. document.forms.appUser.post.value = "true";
  18. document.forms.appUser.submit();
  19. }
  20. }
  21. function doBack(){
  22. document.forms.appUser.action.value="list";
  23. document.forms.appUser.submit();
  24. doDisable(document.forms.appUser, "button");
  25. }
  26. function doUpdateStatus(code,status){
  27. var x = (status == 'ACTIVE' ? window.confirm("<bean:message key="confirm.activate"/>"):window.confirm("<bean:message key="confirm.inactivate"/>"));
  28. if(x){
  29. document.forms.appUser.loginName.value=code;
  30. document.forms.appUser.action.value="update_status";
  31. document.forms.appUser.status.value=status;
  32. document.forms.appUser.submit();
  33. doDisable(document.forms.appUser, "button");
  34. }
  35. }
  36. function doResetPassword(code){
  37. var x = window.confirm("Reset User Password?");
  38. if(x){
  39. document.forms.appUser.loginName.value=code;
  40. document.forms.appUser.action.value="reset_password";
  41. document.forms.appUser.submit();
  42. doDisable(document.forms.appUser, "button");
  43. }
  44. }
  45. function listbox_moveacross(sourceID, destID) {
  46. var src = document.getElementById(sourceID);
  47. var dest = document.getElementById(destID);
  48. for(var count=0; count < src.options.length; count++) {
  49. if(src.options[count].selected == true) {
  50. var option = src.options[count];
  51. var newOption = document.createElement("option");
  52. newOption.value = option.value;
  53. newOption.text = option.text;
  54. newOption.selected = true;
  55. try {
  56. dest.add(newOption, null); //Standard
  57. src.remove(count, null);
  58. }catch(error) {
  59. dest.add(newOption); // IE only
  60. src.remove(count);
  61. }
  62. count--;
  63. }
  64. }
  65. }
  66. function listbox_moveacross_all(sourceID, destID) {
  67. var src = document.getElementById(sourceID);
  68. var dest = document.getElementById(destID);
  69. for(var count=0; count < src.options.length; count++) {
  70. src.options[count].selected == true
  71. var option = src.options[count];
  72. var newOption = document.createElement("option");
  73. newOption.value = option.value;
  74. newOption.text = option.text;
  75. newOption.selected = true;
  76. try {
  77. dest.add(newOption, null); //Standard
  78. src.remove(count, null);
  79. }catch(error) {
  80. dest.add(newOption); // IE only
  81. src.remove(count);
  82. }
  83. count--;
  84. }
  85. }
  86. function listbox_selectall(listID, isSelect) {
  87. var listbox = document.getElementById(listID);
  88. for(var count=0; count < listbox.options.length; count++) {
  89. listbox.options[count].selected = isSelect;
  90. }
  91. }
  92. -->
  93. </script>
  94. <script type="text/javascript" src="./js/autocomplete/jquery.js"></script>
  95. <script type='text/javascript'
  96. src='./js/autocomplete/jquery.bgiframe.min.js'></script>
  97. <script type='text/javascript'
  98. src='./js/autocomplete/jquery.ajaxQueue.js'></script>
  99. <script type='text/javascript'
  100. src='./js/autocomplete/thickbox-compressed.js'></script>
  101. <script type='text/javascript'
  102. src='./js/autocomplete/jquery.autocomplete.js'></script>
  103. <script type='text/javascript' src='./js/autocomplete/localdata.js'></script>
  104. <script type="text/javascript">
  105. $(function() {
  106. function format(jsonmap) {
  107. return jsonmap.value;
  108. }
  109. $("#idSearch").autocomplete('appUser.do?action=getUser', {
  110. dataType: "json",
  111. parse: function(data) {
  112. return $.map(data, function(row) {
  113. return {
  114. data: row,
  115. value: row.loginName,
  116. result: row.loginName
  117. }
  118. });
  119. },
  120. formatItem: function(jsonmap) {
  121. return jsonmap.loginName;
  122. }
  123. }).result(function(e, jsonmap) {
  124. //doEditSearch();
  125. });
  126. function format(jsonmap) {
  127. return jsonmap.name + " - " + jsonmap.value;
  128. }
  129. $("#biller_name").autocomplete('appUser.do?action=getBillers', {
  130. dataType: "json",
  131. parse: function(data) {
  132. return $.map(data, function(row) {
  133. return {
  134. data: row,
  135. value: row.name,
  136. result: row.name
  137. }
  138. });
  139. },
  140. formatItem: function(jsonmap) {
  141. return format(jsonmap);
  142. }
  143. }).result(function(e, jsonmap) {
  144. //after select
  145. $("#biller").val(jsonmap.name);
  146. $("#biller_name").val(jsonmap.name + " - " + jsonmap.value);
  147. $.get("appUser.do", { "action": "getBillerGroups", "biller" : jsonmap.name },
  148. function(data){
  149. options = '';
  150. for (var i = 0; i < data.length; i++) {
  151. options += '<option value="' + data[i].name + '">' + data[i].value + '</option>';
  152. }
  153. $("#billerGroups").html(options);
  154. $('#billerGroups option:first').attr('selected', 'selected');
  155. }, "json");
  156. $.get("appUser.do", { "action": "getAccounts", "billerAccount" : jsonmap.name },
  157. function(data){
  158. optionsLeft = '';
  159. optionsRight = '';
  160. if(data.length > 0) {
  161. for (var i = 0; i < data.length; i++) {
  162. optionsLeft += '<option value="' + data[i].name + '">' + data[i].name + '</option>';
  163. }
  164. }
  165. $("#accountNumberLeft").html(optionsLeft);
  166. $("#accountNumberRight").html(optionsRight);
  167. }, "json");
  168. });
  169. });
  170. </script>
  171. <!-- CONTENT -->
  172. <form name="appUser" method="post" action="appUser.do">
  173. <input type="hidden" name="action" value ="" />
  174. <input type="hidden" name="clear" value ="" />
  175. <input type="hidden" name="status" value ="" />
  176. <input type="hidden" name="post" value ="" />
  177. <input type="hidden" name="redirect" value ="edit" />
  178. <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
  179. <tr>
  180. <td class="titleHeader"><bean:message key="project.appUser.key"/> - EDIT</td>
  181. </tr>
  182. </table>
  183. <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
  184. <tr><td colspan="7"><html:errors/></td></tr>
  185. <tr>
  186. <td align="center">
  187. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  188. <logic:empty name="appUser" >
  189. <tr align = "left">
  190. <td width="15%"><b><bean:message key="appUser.loginName.key" /></b></td>
  191. <td width="10">:</td>
  192. <td width="30%">
  193. <input type="text" name="idSearch" id="idSearch" value="" />
  194. </td>
  195. <td width="5%">&nbsp;</td>
  196. <td width="15%">&nbsp;</td>
  197. <td width="10">&nbsp;</td>
  198. <td width="30%">&nbsp;</td>
  199. </tr>
  200. <tr align = "left">
  201. <td width="15%"></td>
  202. <td width="10"></td>
  203. <td width="30%">
  204. <input type="button" value="<bean:message key="button.search" />" onclick="javascript:doEditSearch();" />
  205. </td>
  206. <td width="5%">&nbsp;</td>
  207. <td width="15%">&nbsp;</td>
  208. <td width="10">&nbsp;</td>
  209. <td width="30%">&nbsp;</td>
  210. </tr>
  211. </logic:empty>
  212. <!-- kalo found data -->
  213. <logic:notEmpty name="appUser" >
  214. <tr>
  215. <td width="15%">
  216. <b><bean:message key="appUser.loginName.key"/><font color="#FF0000">*</font></b>
  217. </td>
  218. <td width="10">:</td>
  219. <td width="30%">
  220. <input type="hidden" name="loginName" value ="<bean:write name="appUser" property="loginName" />" />
  221. <bean:write name="appUser" property="loginName"/>
  222. </td>
  223. <td width="5%">&nbsp;</td>
  224. <td width="15%">&nbsp;</td>
  225. <td width="10">&nbsp;</td>
  226. <td width="30%">&nbsp;</td>
  227. </tr>
  228. <tr>
  229. <td width="15%">
  230. <b><bean:message key="appUser.firstName.key" /><font color="#FF0000">*</font></b>
  231. </td>
  232. <td width="10">:</td>
  233. <td width="30%">
  234. <input type="text" name="firstName" value="<bean:write name="appUser" property="firstName"/>" />
  235. </td>
  236. <td width="5%">&nbsp;</td>
  237. <td width="15%">&nbsp;</td>
  238. <td width="10">&nbsp;</td>
  239. <td width="30%">&nbsp;</td>
  240. </tr>
  241. <tr>
  242. <td width="15%"><b><bean:message key="appUser.lastName.key" /></b></td>
  243. <td width="10">:</td>
  244. <td width="30%">
  245. <input type="text" name="lastName" value="<bean:write name="appUser" property="lastName"/>" />
  246. </td>
  247. <td width="5%">&nbsp;</td>
  248. <td width="15%">&nbsp;</td>
  249. <td width="10">&nbsp;</td>
  250. <td width="30%">&nbsp;</td>
  251. </tr>
  252. <tr>
  253. <td width="15%">
  254. <b><bean:message key="appUser.biller.key" /><font color="#FF0000">*</font></b>
  255. </td>
  256. <td width="10">:</td>
  257. <td width="30%">
  258. <input type="text" id="biller_name" size="50" name="biller_name" value="<bean:write name="biller_name" />" />
  259. <input type="hidden" id="biller" name="biller" value="
  260. <logic:notEmpty name="appUser" property="biller">
  261. <bean:write name="appUser" property="biller.code" />
  262. </logic:notEmpty>
  263. " />
  264. </td>
  265. <td width="5%">&nbsp;</td>
  266. <td width="15%">&nbsp;</td>
  267. <td width="10">&nbsp;</td>
  268. <td width="30%">&nbsp;</td>
  269. </tr>
  270. <tr>
  271. <td width="15%">
  272. <b><bean:message key="appUser.billerGroup.key" /><font color="#FF0000">*</font></b>
  273. </td>
  274. <td width="10">:</td>
  275. <td width="30%">
  276. <select id="billerGroups" name="billerGroups">
  277. <logic:notEmpty name="billerGroupList">
  278. <logic:iterate id="billerGroup" name="billerGroupList">
  279. <option value="<bean:write name="billerGroup" property="id" />"
  280. <logic:notEmpty name="appUser" property="billerGroup">
  281. <logic:equal name="billerGroup" property="id" value="${appUser.billerGroup}">
  282. selected="selected"
  283. </logic:equal>
  284. </logic:notEmpty>
  285. > <bean:write name="billerGroup" property="name" /> </option>
  286. </logic:iterate>
  287. </logic:notEmpty>
  288. </select>
  289. </td>
  290. <td width="5%">&nbsp;</td>
  291. <td width="15%">&nbsp;</td>
  292. <td width="10">&nbsp;</td>
  293. <td width="30%">&nbsp;</td>
  294. </tr>
  295. <tr>
  296. <td valign="top"><b>Roles</b></td>
  297. <td valign="top">:</td>
  298. <td valign="top">
  299. <logic:notEmpty name="roleList">
  300. <logic:iterate id="role" name="roleList">
  301. <input type="checkbox"
  302. <logic:notEmpty name="appUser" property="roles">
  303. <logic:iterate id="element_roles" name="appUser" property="roles" >
  304. <logic:equal name="role" property="code" value="${element_roles.code}">
  305. checked="checked"
  306. </logic:equal>
  307. </logic:iterate>
  308. </logic:notEmpty>
  309. name="roleList" value="<bean:write name="role" property="code"/>" /> <bean:write name="role" property="name"/> <br />
  310. </logic:iterate>
  311. </logic:notEmpty>
  312. </td>
  313. </tr>
  314. </logic:notEmpty>
  315. </table>
  316. <table border="0" width="98%" align="center" cellpadding="2" cellspacing="2">
  317. <logic:notEmpty name="appUser">
  318. <tr>
  319. <td width="15%" valign="top"><b><bean:message key="appUser.accNo.key" /><font color="#FF0000">*</font></b></td>
  320. <td width="1%" valign="top">:</td>
  321. <td width="10%">
  322. <select id="accountNumberLeft" name="accountsLeft" size="10" multiple>
  323. <logic:notEmpty name="accountsList">
  324. <logic:iterate id="element_accountNumber" name="accountsList">
  325. <option value="<bean:write name="element_accountNumber" property="acctno" />">
  326. <bean:write name="element_accountNumber" property="acctno" />
  327. </option>
  328. </logic:iterate>
  329. </logic:notEmpty>
  330. </select>
  331. </td>
  332. <td valign="top">
  333. <a href="#" onclick="listbox_moveacross('accountNumberLeft', 'accountNumberRight')">&gt;</a>
  334. <br/>
  335. <a href="#" onclick="listbox_moveacross_all('accountNumberLeft', 'accountNumberRight')">&gt;&gt;</a>
  336. <br/><br/>
  337. <a href="#" onclick="listbox_moveacross('accountNumberRight', 'accountNumberLeft')">&lt;</a>
  338. <br/>
  339. <a href="#" onclick="listbox_moveacross_all('accountNumberRight', 'accountNumberLeft')">&lt;&lt;</a>
  340. </td>
  341. <td>
  342. <select id="accountNumberRight" name="accountsRight" size="10" multiple>
  343. <logic:notEmpty name="accountList">
  344. <logic:iterate id="account" name="accountList">
  345. <logic:notEmpty name="account" property="acctno">
  346. <option value="<bean:write name="account" property="acctno" />"selected = "selected">
  347. <bean:write name="account" property="acctno" />
  348. </option>
  349. </logic:notEmpty>
  350. </logic:iterate>
  351. </logic:notEmpty>
  352. </select>
  353. </td>
  354. <td width="5%">&nbsp;</td>
  355. <td width="15%">&nbsp;</td>
  356. <td width="10">&nbsp;</td>
  357. <td width="30%">&nbsp;</td>
  358. </tr>
  359. </logic:notEmpty>
  360. </table>
  361. <table border="0" width="98%" align="center" cellpadding="2" cellspacing="2">
  362. <logic:notEmpty name="appUser">
  363. <tr>
  364. <td width="15%"></td>
  365. <td width="1%"></td>
  366. <td colspan="5">
  367. <input type="button" value="<bean:message key="button.back"/>" onclick="javascript:doBack();" />&nbsp;
  368. <input type="button" value="<bean:message key="button.submit"/>" onclick="doUpdate();" />
  369. <input type="button" value="Reset Password" onclick="doResetPassword('<bean:write name="appUser" property="loginName"/>');" />
  370. <logic:equal name="appUser" property="status" value="ACTIVE">
  371. <input type="button" value="<bean:message key="button.inactive" />" onclick="doUpdateStatus('<bean:write name="appUser" property="loginName"/>','INACTIVE');" />
  372. </logic:equal>
  373. <logic:equal name="appUser" property="status" value="INACTIVE">
  374. <input type="button" value="<bean:message key="button.active" />" onclick="doUpdateStatus('<bean:write name="appUser" property="loginName"/>','ACTIVE');" />
  375. </logic:equal>
  376. </td>
  377. </tr>
  378. </logic:notEmpty>
  379. </table>
  380. </td>
  381. </tr>
  382. </table>
  383. </form>
  384. <!-- END CONTENT -->
  385. <%@ include file="../common/footer.jsp"%>