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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8"%>
  2. <%@ page import="cn.js.fan.util.*"%>
  3. <%@ page import="cn.js.fan.db.*"%>
  4. <%@ page import="java.util.*"%>
  5. <%@ page import="cn.js.fan.web.*"%>
  6. <%@ page import="com.redmoon.oa.task.*"%>
  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>
  13. TABLE {
  14. BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 1px
  15. }
  16. TD {
  17. BORDER-RIGHT: 0px; BORDER-TOP: 0px
  18. }
  19. </STYLE>
  20. <script>
  21. function openWin(url,width,height)
  22. {
  23.   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);
  24. }
  25. function changeexpression(i)
  26. {
  27. frmAnnounce.expression.value = i;
  28. if (i==0)
  29. {
  30. expressspan.innerHTML = "";
  31. return;
  32. }
  33. expressspan.innerHTML = "<img align=absmiddle src=forum/images/emot/em"+i+".gif>";
  34. }
  35. function setPerson(deptCode, deptName, user)
  36. {
  37. frmAnnounce.person.value = user;
  38. frmAnnounce.jobCode.value = deptCode;
  39. }
  40. function frmAnnounce_onsubmit() {
  41. frmAnnounce.content.value = IframeID.document.body.innerHTML;
  42. }
  43. function window_onload() {
  44. setHTML(frmAnnounce.content.value);
  45. cws_Size(320);
  46. }
  47. var attachCount = 1;
  48. function AddAttach() {
  49. updiv.insertAdjacentHTML("BeforeEnd", "<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>");
  50. attachCount += 1;
  51. }
  52. function OfficeOperate() {
  53. alert(frmAnnounce.redmoonoffice.ReturnMessage.substr(0, 4));
  54. }
  55. // 编辑文件
  56. function editdoc(id, attachId)
  57. {
  58. rmofficeTable.style.display = "";
  59. frmAnnounce.redmoonoffice.AddField("taskId", id);
  60. frmAnnounce.redmoonoffice.AddField("attachId", attachId);
  61. frmAnnounce.redmoonoffice.Open("<%=Global.getRootPath()%>/task_getfile.jsp?taskId=" + id + "&attachId=" + attachId);
  62. }
  63. </script>
  64. </head>
  65. <body leftmargin="0" topmargin="5" onLoad="window_onload()">
  66. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  67. <%@ include file="task_inc_menu_top.jsp"%>
  68. <br>
  69. <%
  70. int i=0;
  71. int editid = ParamUtil.getInt(request, "editid");
  72. String privurl = request.getParameter("privurl");
  73. String title="",content="",filename="",extname="",person="";
  74. int expression=0;
  75. int type=0;
  76. TaskDb task = new TaskDb();
  77. task = task.getTaskDb(editid);
  78. String op = ParamUtil.get(request, "op");
  79. if (op.equals("delattach")) {
  80. int attId = ParamUtil.getInt(request, "attachId");
  81. boolean re = task.delAttachment(attId);
  82. if (re)
  83. out.print(StrUtil.Alert("删除成功!"));
  84. else
  85. out.print(StrUtil.Alert("删除失败!"));
  86. task = task.getTaskDb(editid);
  87. }
  88. int rootid = task.getRootId();
  89. title = task.getTitle();
  90. content = task.getContent();
  91. expression = task.getExpression();
  92. filename = task.getFileName();
  93. extname = task.getExt();
  94. person = task.getPerson();
  95. type = task.getType();
  96. TaskDb rootTask = task.getTaskDb(rootid);
  97. %>
  98. <table width="100%" border="0">
  99.   <tr>
  100.     <td height="24"><strong>&nbsp;&nbsp;<img src=images/task/icon-task.gif align="absmiddle">&nbsp;根任务:
  101.       <%if (rootTask.getExpression()!=0) { %>
  102.       <img align="absmiddle" src="forum/images/emot/em<%=rootTask.getExpression()%>.gif" border=0>
  103.       <%}%>
  104.     <a href="task_show.jsp?rootid=<%=rootid%>&showid=<%=rootid%>"><%=task.getTaskDb(rootid).getTitle()%></a></strong></td>
  105.   </tr>
  106. </table>
  107. <table width="98%" border="1" align="center" cellpadding="4" cellspacing="0" class="main">
  108.   <form  name=frmAnnounce method="post" action="task_edit_do.jsp" enctype="MULTIPART/FORM-DATA" onSubmit="return frmAnnounce_onsubmit()">
  109.     <TBODY>
  110.       <tr> 
  111.         <td width="100%" class="right-title"><span id=expressspan> 
  112.           <%if (expression!=0) {%><img align="absmiddle" src="forum/images/emot/em<%=expression%>.gif" border=0><%}%>
  113.           </span>&nbsp;编辑:<font color="#FFFFFF"><input type=hidden name=expression value="<%=expression%>">
  114.           <input type=hidden name=type value="<%=type%>">
  115.         </font><a class="title_white" href="task_show.jsp?rootid=<%=rootid%>&showid=<%=editid%>""><%=title%></a></td>
  116.       </tr>
  117.     </TBODY>
  118.     <TBODY>
  119. <%if (task.getParentId()!=task.NOPARENT) {%>
  120.       <tr>
  121.         <td>承&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;办 
  122.           <input type="text" name="person" readonly size=40 value="<%=person%>">
  123.           <a href=# onClick="javascript:showModalDialog('user_sel.jsp',window.self,'dialogWidth:480px;dialogHeight:320px;status:no;help:no;')">选择承办人</a>
  124.   <input type="checkbox" name="isUseMsg" value="true" checked>消息提醒
  125. &nbsp;
  126. <%
  127. if (com.redmoon.oa.sms.SMSFactory.isUseSMS()) {
  128. %>
  129.         <input name="isToMobile" value="true" type="checkbox" checked />
  130. 短讯提醒
  131. <%}%></td>
  132.       </tr>
  133. <%}%>
  134.       <tr> 
  135.         <td> 标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题 
  136.           <input name="title" type="text" id="title" size="55" value="<%=title%>" title="不得超过 25 个汉字或50个英文字符" maxlength="80"> 
  137.           <font color="#FFFFFF"> 
  138.           <input type=hidden name=privurl value="<%=privurl%>">
  139.           <input type=hidden name="editid" value="<%=editid%>">
  140.           </font> <span class="tablebody1">
  141.           <input name="jobCode" type="hidden" value="<%=task.getJobCode()%>">
  142.           </span>
  143.   <%if (task.getParentId()==task.NOPARENT) {%>
  144.           <input type="hidden" name="person" value="<%=person%>">
  145.   <%}%></td>
  146.       </tr>
  147.       <tr>
  148.         <td>表&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;情
  149.           <iframe src="task_iframe_emote.jsp?expression=<%=expression%>" height="25" width="610" marginwidth="0" marginheight="0" frameborder="0" scrolling="yes"></iframe>
  150.              
  151.           <a href="#" onClick="changeexpression(0)">取消表情&nbsp;</a></td>
  152.       </tr>
  153.       <tr> 
  154.         <td><table width="100%" border=0 cellspacing=0 cellpadding=0>
  155.             <tr> 
  156.               <td class=tablebody1 valign=top height=30> 附&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;件 
  157.                 <input type="file" name="filename" size=40>
  158.                 <input name="button" type=button onClick="AddAttach()" value="增加附件"></td>
  159.             </tr>
  160.           </table><div id=updiv name=updiv></div></td>
  161.       </tr>
  162.       <tr>
  163.         <td>附件:
  164.           <%
  165.   java.util.Iterator attir = task.getAttachments().iterator();
  166.   while (attir.hasNext()) {
  167.    Attachment att = (Attachment)attir.next();
  168. String ext = StrUtil.getFileExt(att.getDiskName());
  169.   %>
  170.             <table width=100%><tr><td style="height: 150%">
  171. <img src="images/attach.gif" align="absmiddle"><a target="_blank" href="task_getfile.jsp?taskId=<%=task.getId()%>&attachId=<%=att.getId()%>"><%=att.getName()%></a>&nbsp;&nbsp;[<a href="?op=delattach&editid=<%=editid%>&attachId=<%=att.getId()%>&privurl=<%=StrUtil.UrlEncode(privurl)%>">删除</a>]&nbsp;
  172.               <%if (ext.equals("doc") || ext.equals("xls")) {%>
  173.               <a href="javascript:editdoc('<%=task.getId()%>', '<%=att.getId()%>')" title="编辑Office文件">
  174.   <img src="netdisk/images/btn_edit_office.gif" border="0" align="absmiddle">
  175.   </a>
  176.               <%}%>
  177.             </td></tr></table>
  178.             <%}%>
  179.   <table id="rmofficeTable" name="rmofficeTable" style="display:none" width="29%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  180.             <tr>
  181.               <td height="22" align="center" bgcolor="#E3E3E3"><strong>&nbsp;编辑Office文件</strong></td>
  182.             </tr>
  183.             <tr>
  184.               <td align="center" bgcolor="#FFFFFF"><object id="redmoonoffice" classid="CLSID:D01B1EDF-E803-46FB-B4DC-90F585BC7EEE" 
  185. codebase="<%=request.getContextPath()%>/activex/rmoffice.cab#version=2,0,0,1" width="316" height="43" viewastext="viewastext">
  186.                   <param name="Encode" value="utf-8" />
  187.                   <param name="BackColor" value="0000ff00" />
  188.                   <param name="Server" value="<%=Global.server%>" />
  189.                   <param name="Port" value="<%=Global.port%>" />
  190.                   <!--设置是否自动上传-->
  191.                   <param name="isAutoUpload" value="1" />
  192.                   <!--设置文件大小不超过1M-->
  193.                   <param name="MaxSize" value="1024000" />
  194.                   <!--设置自动上传前出现提示对话框-->
  195.                   <param name="isConfirmUpload" value="1" />
  196.                   <!--设置IE状态栏是否显示信息-->
  197.                   <param name="isShowStatus" value="0" />
  198.                   <param name="PostScript" value="<%=Global.virtualPath%>/task_office_upload.jsp" />
  199.                 </object>
  200.                   <!--<input name="remsg" type="button" onclick='alert(frmAnnounce.redmoonoffice.ReturnMessage)' value="查看上传后的返回信息" />--></td>
  201.             </tr>
  202.           </table>
  203. </td>
  204.       </tr>
  205.       <tr> 
  206.         <td><%@ include file="editor_full/editor.jsp"%></td>
  207.       </tr>
  208.       <tr> 
  209.         <td><div align="center"> 
  210.             <textarea cols="75" name="content" rows="12" wrap="VIRTUAL" title="可以使用Ctrl+Enter直接提交贴子" onkeydown=ctlent() style="display: none"><%=content%></textarea>
  211.             <br>
  212.             <input name="submit" type=submit value=" 发 出 ">
  213.             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  214.             <input name="reset" type=reset value=" 重 写 ">
  215.           </div></td>
  216.       </tr>
  217.     </TBODY>
  218.   </form>
  219. </table>
  220. </body>
  221. </html>