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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8"%>
  2. <%@ page import="cn.js.fan.util.*"%>
  3. <%@ page import="java.util.*"%>
  4. <%@ page import="cn.js.fan.web.*"%>
  5. <%@ page import="com.redmoon.oa.flow.*"%>
  6. <%@ page import="com.redmoon.oa.task.TaskDb"%>
  7. <html>
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  10. <title>发起任务</title>
  11. <link href="common.css" rel="stylesheet" type="text/css">
  12. <STYLE>TABLE {
  13. BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 1px
  14. }
  15. TD {
  16. BORDER-RIGHT: 0px; BORDER-TOP: 0px
  17. }
  18. </STYLE>
  19. <script>
  20. function openWin(url,width,height)
  21. {
  22.   var newwin=window.open(url,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=50,left=120,width="+width+",height="+height);
  23. }
  24. function changeexpression(i)
  25. {
  26. frmAnnounce.expression.value = i;
  27. if (i==0)
  28. {
  29. expressspan.innerHTML = "无";
  30. return;
  31. }
  32. expressspan.innerHTML = "<img align=absmiddle src=forum/images/emot/em"+i+".gif>";
  33. }
  34. function setPerson(deptCode, deptName, user)
  35. {
  36. if (frmAnnounce.person.value=="") {
  37. frmAnnounce.person.value = user;
  38. frmAnnounce.jobCode.value = deptCode;
  39. }
  40. else {
  41. frmAnnounce.person.value += "," + user;
  42. frmAnnounce.jobCode.value += "," + deptCode;
  43. }
  44. }
  45. function frmAnnounce_onsubmit() {
  46. frmAnnounce.content.value = IframeID.document.body.innerHTML;
  47. }
  48. function window_onload() {
  49. cws_Size(320);
  50. }
  51. </script>
  52. </head>
  53. <body leftmargin="0" topmargin="5" onLoad="window_onload()">
  54. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  55. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  56. <%
  57. String priv="read";
  58. if (!privilege.isUserPrivValid(request,priv))
  59. {
  60. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  61. return;
  62. }
  63. int flowId = ParamUtil.getInt(request, "flowId");
  64. int actionId = ParamUtil.getInt(request, "actionId");
  65. WorkflowMgr wfm = new WorkflowMgr();
  66. WorkflowDb wf = wfm.getWorkflowDb(flowId);
  67. WorkflowActionDb wa = new WorkflowActionDb();
  68. wa = wa.getWorkflowActionDb(actionId);
  69. int taskId = wa.getTaskId();
  70. // 检查对应于动作的任务是否已存在,如果已存在,则重定向至修改任务
  71. TaskDb td = new TaskDb();
  72. td = td.getTaskDb(taskId);
  73. if (td!=null && td.isLoaded()) {
  74. response.sendRedirect("task_show.jsp?rootid=" + td.getId() + "&showid=" + td.getId());
  75. return;
  76. }
  77. String op = fchar.getNullStr(request.getParameter("op"));
  78. if (op.equals(""))
  79. {
  80. out.print(fchar.Alert("您未选择操作方式!"));
  81. return;
  82. }
  83. String typedesc = "";//类型描述
  84. int type=0;
  85. if (op.equals("newflowtask"))
  86. {
  87. type = 0;
  88. typedesc = "发起新任务";
  89. priv="task";
  90. if (!privilege.isUserPrivValid(request,priv))
  91. {
  92. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  93. return;
  94. }
  95. }
  96. String parentid = fchar.getNullStr(request.getParameter("parentid"));
  97. String privurl=ParamUtil.get(request, "privurl");
  98. String person = ParamUtil.get(request, "person");
  99. %>
  100. <table width="498" border="1" align="center" cellpadding="4" cellspacing="0" class="main">
  101.   <form id="frmAnnounce" name=frmAnnounce method="post" action="task_add_do.jsp" enctype="MULTIPART/FORM-DATA" onSubmit="return frmAnnounce_onsubmit()">
  102.     <TBODY>
  103.       <tr> 
  104.         <td class="right-title"> <font color="#FFFFFF"><%=typedesc%> 
  105.           <input type=hidden name=type value="<%=type%>">
  106.           <input type=hidden name=op value="<%=op%>">
  107.           &nbsp; 表情 <span id=expressspan>无</span> 
  108.           <input type=hidden name=expression value="0">
  109.           <input type=hidden name=parentid value="<%=parentid%>">
  110.           <input type=hidden name=privurl value="<%=privurl%>">
  111.           </font></td>
  112.       </tr>
  113.     </TBODY>
  114.     <TBODY>
  115.       
  116.       <tr> 
  117.         <td width="486"> 任务标题 
  118.           <input name="title" type="text" id="topic" size="55"  title="不得超过 25 个汉字或50个英文字符" maxlength="80">
  119.         <span class="tablebody1">
  120.         <input name="jobCode" type="hidden">
  121.         </span> <span class="tablebody1">
  122.         <input name="person" type="hidden">
  123.         </span></td>
  124.       </tr>
  125.       <tr> 
  126.         <td><table width="100%" border=0 cellspacing=0 cellpadding=0>
  127.             <tr> 
  128.               <td class=tablebody1 valign=top height=30> 附&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;件 
  129.                 <input type="file" name="filename" size=40>
  130.                 限制:200K 
  131. <input name="content" type="hidden"> <input name="actionId" type="hidden" value="<%=actionId%>"></td>
  132.             </tr>
  133.           </table></td>
  134.       </tr>
  135.       <tr>
  136.         <td>流程附件
  137.   <%
  138.   int doc_id = wf.getDocId();
  139.   DocumentMgr dm = new DocumentMgr();
  140.   Document doc = dm.getDocument(doc_id);
  141.   
  142.   java.util.Vector attachments = doc.getAttachments(1);
  143.   java.util.Iterator ir = attachments.iterator();
  144.   
  145.   while (ir.hasNext()) {
  146.    Attachment am = (Attachment) ir.next(); %>
  147.           <table width="61%"  border="0" cellpadding="0" cellspacing="0" bordercolor="#D6D3CE">
  148.             <tr>
  149.               <td width="5%" height="24" align="right"><img src="images/attach.gif" /></td>
  150.               <td width="73%">&nbsp; <a target="_blank" href="<%=am.getVisualPath() + "/" + am.getDiskName()%>"><%=am.getName()%></a><br />
  151.               </td>
  152.               <td width="22%"><input type=checkbox name="attachIds" value="<%=am.getId()%>" checked>
  153.                 附加至任务</td>
  154.             </tr>
  155.           </table>
  156.         <%}%>
  157. </td>
  158.       </tr>
  159.       <tr> 
  160.         <td><%@ include file="editor_full/editor.jsp"%></td>
  161.       </tr>
  162.       <tr align="center" bordercolor="#0078bf">
  163.         <td><b>点击表情图可加入相应的表情</b><br>
  164.             <a href="#" onClick="changeexpression(0)">无&nbsp;</a>
  165.             <%
  166. for (int i=1; i<=71; i++)
  167. {
  168. out.println("<img src="forum/images/emot/em"+i+".gif" border=0 onclick="changeexpression("+i+")" style="CURSOR: hand">&nbsp;");
  169. if (i%14==0)
  170. out.print("<BR>");
  171. }
  172. %>        </td>
  173.       </tr>
  174.       <tr> 
  175.         <td align="center">
  176.             <input name="submit" type=submit value="发起任务">
  177.             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  178.           <input name="reset" type=reset value=" 重 设 ">          </td>
  179.       </tr>
  180.     </TBODY>
  181.   </form>
  182. </table>
  183. </body>
  184. </html>