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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8"%>
  2. <%@ page import="com.redmoon.oa.person.*"%>
  3. <%@ page import="com.redmoon.oa.task.*"%>
  4. <%@ page import="cn.js.fan.util.*"%>
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  8. <title>发起任务</title>
  9. <link href="common.css" rel="stylesheet" type="text/css">
  10. <script>
  11. function openWin(url,width,height)
  12. {
  13.   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);
  14. }
  15. function changeexpression(i)
  16. {
  17. frmAnnounce.expression.value = i;
  18. if (i==0)
  19. {
  20. expressspan.innerHTML = "无";
  21. return;
  22. }
  23. expressspan.innerHTML = "<img align=absmiddle src=sq/forum/images/emot/em"+i+".gif>";
  24. }
  25. function setPerson(deptCode, deptName, user, realName)
  26. {
  27. frmAnnounce.person.value = user;
  28. frmAnnounce.jobCode.value = deptCode;
  29. frmAnnounce.userRealName.value = realName;
  30. }
  31. function frmAnnounce_onsubmit() {
  32. frmAnnounce.content.value = IframeID.document.body.innerHTML;
  33. }
  34. function window_onload() {
  35. cws_Size(320);
  36. }
  37. var attachCount = 1;
  38. function AddAttach() {
  39. updiv.innerHTML += "<table width=100%><tr>附&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;件&nbsp;&nbsp;<input type='file' name='filename" + attachCount + "' size=40><td></td></tr></table>";
  40. attachCount += 1;
  41. }
  42. </script>
  43. </head>
  44. <body leftmargin="0" topmargin="5" onLoad="window_onload()">
  45. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  46. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  47. <%@ include file="task_inc_menu_top.jsp"%>
  48. <br>
  49. <%
  50. String priv = "read";
  51. if (!privilege.isUserPrivValid(request,priv))
  52. {
  53. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  54. return;
  55. }
  56. String op = fchar.getNullStr(request.getParameter("op"));
  57. if (op.equals(""))
  58. {
  59. out.print(fchar.Alert("您未选择操作方式!"));
  60. return;
  61. }
  62. String typedesc = "";//类型描述
  63. int type=0;
  64. if (op.equals("new"))
  65. {
  66. type = 0;
  67. typedesc = "发起新任务";
  68. priv="task";
  69. if (!privilege.isUserPrivValid(request,priv))
  70. {
  71. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  72. return;
  73. }
  74. }
  75. if (op.equals("newsubtask"))
  76. {
  77. type = 1;
  78. typedesc = "发起子任务";
  79. priv="task";
  80. if (!privilege.isUserPrivValid(request,priv))
  81. {
  82. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  83. return;
  84. }
  85. }
  86. if (op.equals("addresult"))
  87. {
  88. type = 2;
  89. typedesc = "汇报办理结果";
  90. }
  91. if (op.equals("hurry"))
  92. {
  93. type = 3;
  94. typedesc = "催办";
  95. }
  96. String parentid = fchar.getNullStr(request.getParameter("parentid"));
  97. // 如果父节点,或者根节点为已完成状态,则不可添加
  98. TaskDb ptd = new TaskDb();
  99. ptd = ptd.getTaskDb(Integer.parseInt(parentid));
  100. if (ptd.getStatus()==ptd.STATUS_FINISHED) {
  101. out.print(StrUtil.Alert_Back("任务已处于完成状态"));
  102. return;
  103. }
  104. if (ptd.getStatus()==ptd.STATUS_DISCARD) {
  105. out.print(StrUtil.Alert_Back("任务已处于作废状态"));
  106. return;
  107. }
  108. TaskDb rootTask = ptd.getTaskDb(ptd.getRootId());
  109. if (rootTask.getStatus()==rootTask.STATUS_FINISHED) {
  110. out.print(StrUtil.Alert_Back("根任务已处于完成状态"));
  111. return;
  112. }
  113. if (rootTask.getStatus()==rootTask.STATUS_DISCARD) {
  114. out.print(StrUtil.Alert_Back("根任务已处于作废状态"));
  115. return;
  116. }
  117. String privurl = ParamUtil.get(request, "privurl");
  118. String person = ParamUtil.get(request, "person");
  119. TaskDb td = null;
  120. if (!op.equals("new")) {
  121. int pid = Integer.parseInt(parentid);
  122. td = new TaskDb();
  123. td = td.getTaskDb(pid);
  124. String icon = "";
  125.    if (td.getType()==0)
  126. icon = "images/task/icon-task.gif";
  127.    else if (td.getType()==1)
  128. icon = "images/task/icon-subtask.gif";
  129.    else if (td.getType()==2)
  130. icon = "images/task/icon-result.gif";
  131.    else if (td.getType()==3)
  132. icon = "images/task/icon-hurry.gif";
  133.    else
  134. icon = "images/task/icon-task.gif";
  135. %>
  136. <table align="center" width="98%"><tr><td width="80"><img src="<%=icon%>" border=0>&nbsp;<strong>父任务</strong>:</td>
  137.   <td>
  138. <%if (td.getExpression()!=0) { %>
  139. <img align="absmiddle" src="forum/images/emot/em<%=td.getExpression()%>.gif" border=0> 
  140. <%}%>  
  141. <a href="task_show.jsp?rootid=<%=td.getRootId()%>&showid=<%=parentid%>"><%=td.getTitle()%></a></td>
  142. </tr></table>
  143. <%}%>
  144. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="0" class="main">
  145.   <form id="frmAnnounce" name=frmAnnounce method="post" action="task_add_do.jsp?op=<%=op%>" enctype="MULTIPART/FORM-DATA" onSubmit="return frmAnnounce_onsubmit()">
  146.     <TBODY>
  147.       <tr> 
  148.         <td class="right-title"> <font color="#FFFFFF">&nbsp; <span id=expressspan></span>&nbsp;<%=typedesc%>  
  149.           <input type=hidden name=type value="<%=type%>">
  150.           <input type=hidden name=op value="<%=op%>">
  151.           
  152.           <input type=hidden name=expression value="0">
  153.           <input type=hidden name=parentid value="<%=parentid%>">
  154.           <input type=hidden name=privurl value="<%=privurl%>">
  155.           </font></td>
  156.       </tr>
  157.     </TBODY>
  158.     <TBODY>
  159.       <tr>
  160.         <td>承&nbsp;&nbsp;办&nbsp;&nbsp;者
  161.           <%if (op.equals("hurry") || op.equals("addresult")) {//如果是催办或汇报办理结果,则不需再选择承办人%>
  162. <input type="text" name="person" readonly size=40 value="<%=person%>">
  163. <%}else{
  164. String userRealName = "";
  165. if (!person.equals("")) {
  166. com.redmoon.oa.person.UserDb ud = new com.redmoon.oa.person.UserDb();
  167. ud = ud.getUserDb(person);
  168. if (ud!=null && ud.isLoaded()) {
  169. userRealName = ud.getRealName();
  170. }
  171. }
  172. %>
  173. <input type="hidden" name="person" size=40 value="<%=person%>">
  174. <input type="text" name="userRealName" readonly size="40" value="<%=userRealName%>">
  175. <a href=# onClick="javascript:showModalDialog('user_sel.jsp',window.self,'dialogWidth:480px;dialogHeight:320px;status:no;help:no;')">选择承办人</a> 
  176. <%}%>   <span class="tablebody1">
  177. <input name="jobCode" type="hidden">
  178. <input type="checkbox" name="isUseMsg" value="true" checked>
  179. 消息提醒&nbsp;
  180. <%
  181. if (com.redmoon.oa.sms.SMSFactory.isUseSMS()) {
  182. %>
  183. <input name="isToMobile" value="true" type="checkbox" checked />
  184. 短讯提醒
  185. <%}%>
  186. </span></td>
  187.       </tr>
  188.       <tr> 
  189.         <td width="100%"> 标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题&nbsp;&nbsp; 
  190.         <input name="title" type="text" id="topic" size="55" maxlength="80" value="<%=(td==null && !op.equals("hurry"))?"":"请完成:" + td.getTitle()%>">        </td>
  191.       </tr>
  192.       <tr>
  193.         <td>表&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;情
  194.           <iframe src="task_iframe_emote.jsp" height="25" width="610" marginwidth="0" marginheight="0" frameborder="0" scrolling="yes"></iframe>
  195.              
  196.         <a href="#" onClick="changeexpression(0)">取消表情&nbsp;</a></td>
  197.       </tr>
  198.       <tr> 
  199.         <td><table width="100%" border=0 cellspacing=0 cellpadding=0>
  200.             <tr> 
  201.               <td class=tablebody1 valign=top height=30> 附&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;件 
  202.                 <input type="file" name="filename" size=40>
  203.                 <input name="content" type="hidden">
  204. <textarea name="content_hid" style="display:none"> </textarea>   <input name="button" type=button onClick="AddAttach()" value="增加附件"></td>
  205.             </tr>
  206.           </table><div id=updiv name=updiv></div></td>
  207.       </tr>
  208.       <tr> 
  209.         <td><%@ include file="editor_full/editor.jsp"%></td>
  210.       </tr>
  211.       <tr> 
  212.         <td align="center">
  213.             <input name="submit" type=submit value=" 确 定 ">
  214.             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  215.           <input name="reset" type=reset value=" 重 写 ">          </td>
  216.       </tr>
  217.     </TBODY>
  218.   </form>
  219. </table>
  220. <script>
  221. IframeID.document.body.innerHTML = frmAnnounce.content_hid.value;
  222. </script>
  223. </body>
  224. </html>