billerGroup_edit.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <%@ include file="../common/header.jsp" %>
  2. <script type="text/javascript" src="./js/autocomplete/jquery.js"></script>
  3. <script type='text/javascript' src='./js/autocomplete/jquery.bgiframe.min.js'></script>
  4. <script type='text/javascript' src='./js/autocomplete/jquery.ajaxQueue.js'></script>
  5. <script type='text/javascript' src='./js/autocomplete/thickbox-compressed.js'></script>
  6. <script type='text/javascript' src='./js/autocomplete/jquery.autocomplete.js'></script>
  7. <script type='text/javascript' src='./js/autocomplete/localdata.js'></script>
  8. <script type="text/javascript" language="javascript">
  9. <!--
  10. function loadPageInit() {
  11. doLoadBillerGroup();
  12. }
  13. function doLoadBillerGroup() {
  14. var form = document.forms.billerGroup;
  15. var code = form.billerCode.value;
  16. loadOneValueAJAX("billerGroup.do?action=generateBillerGroupTree&biller=" +code+ "&ts=" +new Date().getTime(), "billerGroup_div");
  17. }
  18. $(function() {
  19. function format(jsonmap) {
  20. return jsonmap.name+' - '+jsonmap.value;
  21. }
  22. $("#idNhBilCon").autocomplete('billerGroup.do?action=loadCodeBillerName', {
  23. dataType: "json",
  24. parse: function(data) {
  25. return $.map(data, function(row) {
  26. return {
  27. data: row,
  28. value: row.name,
  29. result: row.name
  30. }
  31. });
  32. },
  33. formatItem: function(jsonmap) {
  34. return format(jsonmap);
  35. }
  36. }).result(function(e, jsonmap) {
  37. //after select
  38. $("#idNhBilCon").val(format(jsonmap));
  39. $("#idNameBiller").val(jsonmap.value);
  40. $("#codeNhBilCon").val(jsonmap.name);
  41. });
  42. });
  43. function doCreate(){
  44. var x = window.confirm("<bean:message key="confirm.create" />");
  45. if (x) {
  46. document.forms.billerGroup.action.value="create_ok";
  47. document.forms.billerGroup.post.value = "true";
  48. document.forms.billerGroup.submit();
  49. doDisable(document.forms.billerGroup, "button");
  50. }
  51. }
  52. function doEdit(indexCode){
  53. document.forms.billerGroup.indexCode.value=indexCode;
  54. document.forms.billerGroup.action.value="edit_billerGroup";
  55. document.forms.billerGroup.submit();
  56. }
  57. function doInactivate(indexCode){
  58. var x = window.confirm("<bean:message key="confirm.inactivate"/>");
  59. if (x) {
  60. document.forms.billerGroup.indexCode.value=indexCode;
  61. document.forms.billerGroup.action.value="remove_billerGroup";
  62. document.forms.billerGroup.submit();
  63. doDisable(document.forms.billerGroup, "button");
  64. doDisableImage(document.forms.billerGroup);
  65. }
  66. }
  67. function doActivate(indexCode){
  68. var x = window.confirm("<bean:message key="confirm.activate"/>");
  69. if (x) {
  70. document.forms.billerGroup.indexCode.value=indexCode;
  71. document.forms.billerGroup.action.value="activate_billerGroup";
  72. document.forms.billerGroup.submit();
  73. doDisable(document.forms.billerGroup, "button");
  74. doDisableImage(document.forms.billerGroup);
  75. }
  76. }
  77. function doEditSearch(){
  78. document.forms.billerGroup.action.value="edit_search";
  79. document.forms.billerGroup.clear.value="true";
  80. document.forms.billerGroup.submit();
  81. doDisable(document.forms.billerGroup, "button");
  82. }
  83. function doAddBillerGroup(){
  84. var message = "";
  85. var focus = false;
  86. var form = document.forms.billerGroup;
  87. if (trim(form.code.value).length == 0) {
  88. message = message + ("<bean:message key="error.billerGroup.code"/>\n");
  89. if (!focus) form.code.focus(); focus = true;
  90. }
  91. if (trim(form.name.value).length == 0) {
  92. message = message + ("<bean:message key="error.billerGroup.name"/>\n");
  93. if (!focus) form.name.focus(); focus = true;
  94. }
  95. if (message == "" ) {
  96. var x = window.confirm("<bean:message key="confirm.edit"/>");
  97. if (x) {
  98. document.forms.billerGroup.action.value="add_billerGroup";
  99. document.forms.billerGroup.submit();
  100. doDisable(form, "button");
  101. doDisableImage(form);
  102. }
  103. } else {
  104. alert(message);
  105. }
  106. }
  107. function doBack(){
  108. location.href="billerGroup.do?action=edit&clear=true";
  109. //document.forms.billerGroup.action.value="list";
  110. //document.forms.billerGroup.clear.value="true";
  111. //document.forms.billerGroup.submit();
  112. }
  113. -->
  114. </script>
  115. <!-- CONTENT -->
  116. <FORM name="billerGroup" method="post" action="billerGroup.do">
  117. <input type="hidden" name="action">
  118. <input type="hidden" name="post">
  119. <input type="hidden" name="clear">
  120. <input type="hidden" name="itemFocus">
  121. <input type="hidden" name="redirect" value="edit">
  122. <input type="hidden" name="indexCode">
  123. <input type="hidden" id="codeNhBilCon" name="codeNhBilCon" />
  124. <input type="hidden" name="ts" value="<logic:notEmpty name="ts"><bean:write name="ts" /></logic:notEmpty>">
  125. <input type="hidden" name="billerCode" value="<logic:notEmpty name="billerCode"><bean:write name="billerCode" /></logic:notEmpty>">
  126. <input type="hidden" name="billerName" value="<logic:notEmpty name="billerName"><bean:write name="billerName" /></logic:notEmpty>">
  127. <input type="hidden" name="billerGroupId" value="<logic:notEmpty name="billerGroup_${ts}"><bean:write name="billerGroup_${ts}" property="id" /></logic:notEmpty>">
  128. <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
  129. <tr>
  130. <td class="titleHeader" align="left"><bean:message key="project.billerGroup.key"/> - EDIT</td>
  131. </tr>
  132. </table>
  133. <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
  134. <tr>
  135. <td align="center">
  136. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  137. <tr><td colspan="7"><html:errors/></td></tr>
  138. <logic:notEmpty name="biller">
  139. <logic:empty name="biller" property="code">
  140. <tr align = "left">
  141. <td width="15%"><b><bean:message key="billerData.biller.key" /></b></td>
  142. <td width="1%">:</td>
  143. <td width="34%" valign="top">
  144. <table border="0" cellspacing="0" cellpadding="0">
  145. <tr>
  146. <td><input type="text" name="idNhBillerGroup" size="50" id="idNhBilCon"></td>
  147. </tr>
  148. </table>
  149. </td>
  150. <td width="5%">&nbsp;</td>
  151. <td width="15%">&nbsp;</td>
  152. <td width="10">&nbsp;</td>
  153. <td width="30%">&nbsp;</td>
  154. </tr>
  155. </logic:empty>
  156. </logic:notEmpty>
  157. <logic:notEmpty name="biller">
  158. <logic:notEmpty name="biller" property="code">
  159. <tr align = "left">
  160. <td width="15%"><b><bean:message key="billerGroup.biller.key" /></b></td>
  161. <td width="1&">:</td>
  162. <td width="34%" valign="top">
  163. <logic:notEmpty name="billerName">
  164. <bean:write name="billerCode" />&nbsp;-&nbsp;<bean:write name="billerName" />
  165. </logic:notEmpty>
  166. </td>
  167. <td width="5%">&nbsp;</td>
  168. <td width="15%">&nbsp;</td>
  169. <td width="10">&nbsp;</td>
  170. <td width="30%">&nbsp;</td>
  171. </tr>
  172. <tr align = "left">
  173. <td width="15%"><b><bean:message key="billerGroup.category.key" /></b></td>
  174. <td width="1%">:</td>
  175. <td width="34%" valign="top">
  176. <bean:write name="biller" property="billerCategory.name"/>
  177. </td>
  178. <td width="5%">&nbsp;</td>
  179. <td width="15%">&nbsp;</td>
  180. <td width="10">&nbsp;</td>
  181. <td width="30%">&nbsp;</td>
  182. </tr>
  183. <tr>
  184. <td width="15%"><b><bean:message key="billerGroup.group.key" /></b></td>
  185. <td width="1%">:</td>
  186. <td width="34%" valign="top">
  187. <div id="billerGroup_div" align="left"></div>
  188. </td>
  189. <td width="5%">&nbsp;</td>
  190. <td width="15%">&nbsp;</td>
  191. <td width="10">&nbsp;</td>
  192. <td width="30%">&nbsp;</td>
  193. </tr>
  194. <tr>
  195. <td width="20%" valign="top">&nbsp;</td>
  196. <td width="2%" valign="top">&nbsp;</td>
  197. <td width="78%" valign="top">&nbsp;</td>
  198. </tr>
  199. <tr>
  200. <td width="20%" valign="top">&nbsp;</td>
  201. <td width="2%" valign="top">&nbsp;</td>
  202. <td width="78%" valign="top">
  203. <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
  204. <tr bgcolor="#FFFFFF">
  205. <td valign="top"><b><bean:message key="billerGroup.parent.key" /></b></td>
  206. <td valign="top"><b><bean:message key="billerGroup.code.key" /></b></td>
  207. <td valign="top"><b><bean:message key="billerGroup.name.key" /></b></td>
  208. <td valign="top">&nbsp;</td>
  209. </tr>
  210. <tr bgcolor="#FFFFFF">
  211. <td valign="top">
  212. <select name="parentCode" style="width:130">
  213. <option value="">-- Select Parent --</option>
  214. <logic:notEmpty name="billerGroups">
  215. <logic:notEmpty name="billerGroup_${ts}">
  216. <logic:iterate id="element_parent" name="billerGroups" >
  217. <option value="<bean:write name="element_parent" property="id" />"
  218. <logic:notEmpty name="billerGroup_${ts}" property="parent">
  219. <logic:equal name="billerGroup_${ts}" property="parent.id" value="${element_parent.id}">
  220. selected
  221. </logic:equal>
  222. </logic:notEmpty>
  223. ><bean:write name="element_parent" property="name" /></option>
  224. </logic:iterate>
  225. </logic:notEmpty>
  226. </logic:notEmpty>
  227. </select>
  228. </td>
  229. <td>
  230. <input type="text" name="code" value="<bean:write name="billerGroup_${ts}" property="code" />">
  231. </td>
  232. <td>
  233. <input type="text" name="name" value="<bean:write name="billerGroup_${ts}" property="name" />">
  234. </td>
  235. <td align="left" valign="top">
  236. <input type="button" name="addBillerGroup" value="<bean:message key="button.add"/>" onclick="javascript:doAddBillerGroup();">
  237. </td>
  238. </tr>
  239. </table>
  240. </td>
  241. <td width="21%"></td>
  242. </tr>
  243. </logic:notEmpty>
  244. </logic:notEmpty>
  245. </table>
  246. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  247. <tr>
  248. <td width="10%"></td>
  249. <td width="15%" align="center">
  250. <logic:notEmpty name="biller">
  251. <logic:empty name="biller" property="code">
  252. <input type="button" value="<bean:message key="button.edit" />" onclick="javascript:doEditSearch();">
  253. </logic:empty>
  254. </logic:notEmpty>
  255. </td>
  256. <td colspan="4">&nbsp;</td>
  257. <td width="30%" align="center">
  258. <logic:notEmpty name="biller">
  259. <logic:notEmpty name="biller" property="code">
  260. <input type="button" value="<bean:message key="button.back" />" onclick="javascript:doBack();">
  261. </logic:notEmpty>
  262. </logic:notEmpty>
  263. </td>
  264. <td colspan="4">&nbsp;</td>
  265. </tr>
  266. </table>
  267. </td>
  268. </tr>
  269. </table>
  270. </form>
  271. <logic:notEmpty name="biller">
  272. <logic:notEmpty name="biller" property="code">
  273. <script type="text/javascript" language="javascript">loadPageInit();</script>
  274. </logic:notEmpty>
  275. </logic:notEmpty>
  276. <!-- END CONTENT -->
  277. <%@ include file="../common/footer.jsp"%>