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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import="com.redmoon.oa.emailpop3.*"%>
  3. <%@ page import="cn.js.fan.web.*"%>
  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 form1_onsubmit() {
  12. form1.content.value = getHtml();
  13. if (form1.content.value.length>3000) {
  14. // alert("您输入的数据太长,不允许超过3000字!");
  15. // return false;
  16. }
  17. }
  18. function saveDrafe() {
  19. form1.action = "pop3_draft_save.jsp";
  20. form1.content.value = getHtml();
  21. if (form1.content.value.length>3000) {
  22. // alert("您输入的数据太长,不允许超过3000字!");
  23. // return false;
  24. }
  25. form1.submit();
  26. }
  27. </script>
  28. </head>
  29. <body leftmargin="0" topmargin="5">
  30. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  31. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  32. <%
  33. String op = ParamUtil.get(request, "op");
  34. MailMsgMgr mmm = new MailMsgMgr();
  35. if (op.equals("modify")) {
  36. boolean re = false;
  37. try {
  38. re = mmm.modify(application, request);
  39. }
  40. catch (ErrMsgException e) {
  41. out.print(SkinUtil.makeErrMsg(request, e.getMessage()));
  42. return;
  43. }
  44. if (re)
  45. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
  46. }
  47. if (op.equals("delattach")) {
  48. boolean re = false;
  49. try {
  50. re = mmm.delAttachment(request);
  51. }
  52. catch (ErrMsgException e) {
  53. out.print(SkinUtil.makeErrMsg(request, e.getMessage()));
  54. return;
  55. }
  56. if (re)
  57. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
  58. }
  59. int id = ParamUtil.getInt(request, "id");
  60. MailMsgDb mmd = null;
  61. try {
  62. mmd = mmm.getMailMsgDb(request, id);
  63. }
  64. catch (ErrMsgException e) {
  65. out.print(SkinUtil.makeErrMsg(request, e.getMessage()));
  66. return;
  67. }
  68. %>
  69. <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="tableframe">
  70.   <tr> 
  71.     <td width="74%" height="23" class="right-title">&nbsp;&nbsp;编 辑 
  72.       邮 件</td>
  73.     <td width="26%" class="right-title">&nbsp;</td>
  74.   </tr>
  75.   <tr>
  76.     <td colspan="2" valign="top">
  77. <table width="98%" border="0" align="center" cellpadding="0" cellspacing="2">
  78.         <form id=form1 enctype="MULTIPART/FORM-DATA" name="form1" action="?op=modify&id=<%=mmd.getId()%>" method="post" onSubmit="return form1_onsubmit()">
  79.           <tr> 
  80.             <td align="right">邮 箱:</td>
  81.             <td>
  82. <jsp:useBean id="userpop3setup" scope="page" class="com.redmoon.oa.emailpop3.UserPop3Setup"/>
  83. <%
  84. String[] emails = userpop3setup.getUserEmails(privilege.getUser(request));
  85. String options = "";
  86. int len = 0;
  87. if (emails!=null)
  88. len = emails.length;
  89. for (int i=0; i<len; i++) {
  90. options += "<option value='"+emails[i]+"'>"+emails[i]+"</option>";
  91. }
  92. %>
  93. <select name="email">
  94. <%=options%>
  95.             </select>
  96.   <input name=username type="hidden" value="<%=privilege.getUser(request)%>">
  97.   <script language="JavaScript">
  98.   form1.email.value = "<%=mmd.getSender()%>"
  99.   </script>
  100.        <input name="id" type="hidden" value="<%=mmd.getId()%>"></td>
  101.           </tr>
  102.           <tr> 
  103.             <td width="11%" align="right">收件人:</td>
  104.             <td width="89%"><input class="p1" size="40" name="to" value="<%=mmd.getReceiver()%>"></td>
  105.           </tr>
  106.           <tr> 
  107.             <td align="right">主 题:</td>
  108.             <td><input class="p1" size="40" name="subject" value="<%=mmd.getSubject()%>"></td>
  109.           </tr>
  110.           <tr> 
  111.             <td align="right">附 件:</td>
  112.             <td><input id="filename1" type=file size=40 name=filename2></td>
  113.           </tr>
  114.           <tr> 
  115.             <td align="right">&nbsp;</td>
  116.             <td><input id="filename2" type=file size=40 name=filename22></td>
  117.           </tr>
  118.           <tr> 
  119.             <td align="right">&nbsp;</td>
  120.             <td><input id="filename3" type=file size=40 name=filename23></td>
  121.           </tr>
  122.           <tr> 
  123.             <td align="right">正&nbsp;&nbsp;&nbsp;&nbsp;文:</td>
  124.             <td>&nbsp;</td>
  125.           </tr>
  126.           <tr> 
  127.             <td colspan="2"><textarea class="p1" id="content" name="content" rows="20" wrap="physical" cols="65" style="display:none"><%=mmd.getContent()%></textarea>
  128. <%
  129. String rpath = request.getContextPath();
  130. %>
  131.             <link rel="stylesheet" href="<%=rpath%>/editor/edit.css">
  132.             <script src="<%=rpath%>/editor/DhtmlEdit.js"></script>
  133.             <script src="<%=rpath%>/editor/editjs.jsp"></script>
  134.             <script src="<%=rpath%>/editor/editor_s.jsp"></script>
  135.             <script>
  136. setHtml(form1.content);
  137. </script> </td>
  138.           </tr>
  139.           <tr align="center">
  140.             <td colspan="2" align="left">附件:
  141.               <%
  142.   java.util.Iterator attir = mmd.getAttachments().iterator();
  143.   while (attir.hasNext()) {
  144.    Attachment att = (Attachment)attir.next();
  145.   %>
  146.                 <li><img src="../images/attach.gif" width="17" height="17">&nbsp;<a target="_blank" href="email_getfile.jsp?id=<%=mmd.getId()%>&attachId=<%=att.getId()%>"><%=att.getName()%></a>&nbsp;&nbsp;&nbsp;<a href="?op=delattach&id=<%=mmd.getId()%>&attachId=<%=att.getId()%>">删除</a></li>
  147.             <%}%></td>
  148.           </tr>
  149.           <tr align="center"> 
  150.             <td colspan="2"> 
  151.               <input type="submit" class="button1" value=" 保 存 ">
  152.               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  153.               <input type="reset" class="button1" value=" 重 写 ">
  154.               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  155.               <input name="button" type="button" class="button1" onClick="window.location.href='mail_send_do.jsp?op=send&id=<%=mmd.getId()%>'" value=" 发 送 "></td>
  156.           </tr>
  157.         </form>
  158.       </table> 
  159.       </td>
  160.   </tr>
  161. </table>
  162. </body>
  163. </html>