form_edit.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:4k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8"%>
  2. <%@ page import = "java.net.URLEncoder"%>
  3. <%@ page import = "java.util.*"%>
  4. <%@ page import = "cn.js.fan.util.*"%>
  5. <%@ page import = "cn.js.fan.web.*"%>
  6. <%@ page import = "com.redmoon.oa.flow.*"%>
  7. <%
  8. String rootpath = request.getContextPath();
  9. %>
  10. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  11. <html>
  12. <head>
  13. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  14. <title>编辑表单</title>
  15. <link href="../common.css" rel="stylesheet" type="text/css">
  16. <%@ include file="../inc/nocache.jsp"%>
  17. <style type="text/css">
  18. <!--
  19. .style2 {font-size: 14px}
  20. -->
  21. </style>
  22. <script>
  23. function getFormContent() {
  24. return divContent.innerHTML;
  25. }
  26. function setFormContent(c) {
  27. divContent.innerHTML = c;
  28. }
  29. function form1_onsubmit() {
  30. form1.content.value = getFormContent();
  31. }
  32. function openFormWin() {
  33. var preWin=window.open('../editor_full/flow_form.jsp?op=edit','','left=0,top=0,width=750,height=482,resizable=1,scrollbars=1, status=1, toolbar=0, menubar=0');
  34. }
  35. </script>
  36. </head>
  37. <body background="" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
  38. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  39. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  40. <%
  41. if (!privilege.isUserPrivValid(request, "admin.flow")) {
  42.     out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  43. return;
  44. }
  45. String code = ParamUtil.get(request, "code");
  46. FormDb fd = new FormDb();
  47. fd = fd.getFormDb(code);
  48. if (fd==null || !fd.isLoaded()) {
  49. out.print(SkinUtil.makeErrMsg(request, "类型" + code + "不存在!"));
  50. return;
  51. }
  52. String op = ParamUtil.get(request, "op");
  53. if (op.equals("modify")) {
  54. FormMgr ftm = new FormMgr();
  55. boolean re = false;
  56. try {
  57. re = ftm.modify(request);
  58. fd = fd.getFormDb(code);
  59. if (re) {
  60. out.print(StrUtil.Alert("编辑成功!"));
  61. }
  62. else {
  63. out.print(StrUtil.Alert("编辑失败!请检查是否有重复的编码或者编码使用了数据库的关键字!"));
  64. }
  65. }
  66. catch (ErrMsgException e) {
  67. out.print(StrUtil.Alert(e.getMessage()));
  68. }
  69. }
  70. %>
  71. <table width="622" height="89" border="0" align="center" cellpadding="0" cellspacing="0" class="tableframe">
  72.   <tr> 
  73.     <td height="26" valign="bottom" class="right-title">&nbsp;&nbsp;<span> 编辑表单</span></td>
  74.   </tr>
  75.   <tr> 
  76.     <td valign="top" bgcolor="#FFFFFF">
  77. <table width="100%"  border="0" cellspacing="0" cellpadding="0">
  78. <form action="form_edit_compare.jsp" id="form1" name="form1" method=post onSubmit="return form1_onsubmit()">
  79.       <tr>
  80.         <td height="84" align="center" class="p14">
  81. <table width="98%"  border="0" cellpadding="5" cellspacing="0" class="p14">
  82.           <tr>
  83.             <td width="16%" >编码 </td>
  84.             <td width="84%" ><input type="text" name="code" value="<%=fd.getCode()%>" readonly></td>
  85.           </tr>
  86.           <tr>
  87.             <td >名称</td>
  88.             <td ><input type="text" name="name" value="<%=fd.getName()%>">
  89.               <input type="hidden" name="content" value=''></td>
  90.           </tr>
  91.           <tr>
  92.             <td >流程类型</td>
  93.             <td ><select name="flowTypeCode" onChange="if(this.options[this.selectedIndex].value=='root'){alert(this.options[this.selectedIndex].text+' 不能被选择!'); return false;}">
  94. <option value="-1">无</option> <!---1表示非流程所用的表单-->
  95. <%
  96. Leaf rootlf = new Leaf();
  97. rootlf = rootlf.getLeaf("root");
  98. DirectoryView dv = new DirectoryView(rootlf);
  99. dv.ShowFlowTypeAsOptionsWithCode(out, rootlf, rootlf.getLayer());
  100. %>
  101. </select>
  102. <script>
  103. form1.flowTypeCode.value = "<%=fd.getFlowTypeCode()%>";
  104. </script>
  105. </td>
  106.           </tr>
  107.         </table>
  108.           <br></td>
  109.       </tr>
  110.       <tr>
  111.         <td align="center"><span class="p14">
  112.           <input type="button" name="next2" value="编辑表单" onClick="openFormWin()">
  113.         </span>
  114.           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  115.           <input type="submit" name="next" value=" 提 交 "></td></tr></form>
  116.     </table>
  117. <table width="90%" align="center">
  118.   <tr>
  119.     <td><strong>以下为表单内容:</strong></td>
  120.     </tr>
  121.   <tr><td>
  122.   <div id="divContent" name="divContent">
  123.   <%=fd.getContent()%></div>
  124.     </td></tr></table> </td>
  125.   </tr>
  126. </table>
  127. <br>
  128. <br>
  129. </body>
  130. </html>