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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8" %>
  2. <%@ page import="cn.js.fan.util.*"%>
  3. <%@ page import="com.redmoon.oa.person.*"%>
  4. <LINK href="../common.css" type=text/css rel=stylesheet>
  5. <jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
  6. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  7. <%
  8. String name = privilege.getUser(request);
  9. String receiver = ParamUtil.get(request, "receiver");
  10. %>
  11. <html>
  12. <head>
  13. <title>撰写群发消息</title>
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  15. <script language=javascript>
  16. <!--
  17. function form1_onsubmit()
  18. {
  19. errmsg = "";
  20. if (form1.receiver.value=="")
  21. errmsg += "请填写接收者!n"
  22. if (form1.title.value=="")
  23. errmsg += "请填写标题!n"
  24. if (form1.content.value=="")
  25. errmsg += "请填写内容!n"
  26. if (errmsg!="")
  27. {
  28. alert(errmsg);
  29. return false;
  30. }
  31. }
  32. function saveDraft() {
  33. form1.isDraft.value = "true";
  34. form1_onsubmit();
  35. form1.submit();
  36. }
  37. <%
  38. UserSetupDb usd = new UserSetupDb();
  39. usd = usd.getUserSetupDb(name);
  40. %>
  41. function getDept() {
  42. return "<%=usd.getMessageToDept()%>";
  43. }
  44. function getValidUserGroup() {
  45. return "<%=usd.getMessageToUserGroup()%>";
  46. }
  47. function getValidUserRole() {
  48. return "<%=usd.getMessageToUserRole()%>";
  49. }
  50. function setPerson(deptCode, deptName, user, userRealName)
  51. {
  52. form1.receiver.value = user;
  53. form1.userRealName.value = userRealName;
  54. }
  55. function getSelUserNames() {
  56. return form1.receiver.value;
  57. }
  58. function getSelUserRealNames() {
  59. return form1.userRealNames.value;
  60. }
  61. function openWinUsers() {
  62. showModalDialog('../user_multi_sel.jsp',window.self,'dialogWidth:600px;dialogHeight:480px;status:no;help:no;')
  63. }
  64. function openWin(url,width,height)
  65. {
  66.   var newwin=window.open(url,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=50,left=120,width="+width+",height="+height);
  67. }
  68. function openWinUserGroup() {
  69. openWin("../user_usergroup_multi_sel.jsp", 520, 400);
  70. }
  71. function openWinUserRole() {
  72. openWin("../user_role_multi_sel.jsp", 520, 400);
  73. }
  74. <%
  75. int messageToMaxUser = usd.getMessageToMaxUser();
  76. %>
  77. var messageToMaxUser = <%=messageToMaxUser%>;
  78. function setUsers(users, userRealNames) {
  79. var ary = users.split(",");
  80. var len = ary.length;
  81. if (len>messageToMaxUser) {
  82. alert("对不起,您一次最多只能发往" + messageToMaxUser + "个用户!");
  83. return;
  84. }
  85. form1.receiver.value = users;
  86. form1.userRealNames.value = userRealNames;
  87. }
  88. //-->
  89. </script>
  90. </head>
  91. <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  92. <%
  93. if (!privilege.isUserPrivValid(request, "message.group")) {
  94. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  95. return;
  96. }
  97. %>
  98. <table width="320" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#99CCFF" class="9black" height="260">
  99.   <form action="send_do.jsp" method="post" enctype="multipart/form-data" name="form1" onSubmit="return form1_onsubmit()">
  100.   <tr> 
  101.     <td bgcolor="#CEE7FF" height="23">
  102.         <div align="center"> <b>撰 写 群 发 消 息</b></div>
  103.     </td>
  104.   </tr>
  105.   <tr> 
  106.     <td bgcolor="#FFFFFF" height="50"> 
  107.         <table width="300" border="0" cellspacing="0" cellpadding="0" align="center">
  108.           <tr> 
  109.             <td width="75"> 
  110.               <div align="center"><a href="message.jsp?page=1"><img src="images/inboxpm.gif" width="40" height="40" border="0"></a></div>
  111.             </td>
  112.             <td width="75"> 
  113.               <div align="center"><a href="listdraft.jsp"><img src="images/m_draftbox.gif" width="40" height="40" border="0"></a></div>
  114.             </td>
  115.             <td width="75"> 
  116.               <div align="center"><img src="images/newpm.gif" width="40" height="40" border="0"></div>
  117.             </td>
  118.             <td width="75"> 
  119.               <div align="center"> <img src="images/m_delete.gif" width="40" height="40"></div>
  120.             </td>
  121.           </tr>
  122.         </table>
  123.     </td>
  124.   </tr>
  125.   <tr> 
  126.       <td bgcolor="#FFFFFF" height="152" valign="top">
  127.         <table width="300" border="0" cellspacing="0" cellpadding="0" align="center" class="9black" height="6">
  128.           <tr> 
  129.             <td></td>
  130.           </tr>
  131.         </table>
  132.         <table width="300" border="0" cellspacing="1" cellpadding="3" align="center" class="9black">
  133.           <tr> 
  134.             <td width="68" height="27" valign="top"> 
  135.             <div align="center">接 收 者:</div>            </td>
  136.             <td width="217" height="27">
  137.               <textarea name="userRealNames" cols="28" rows="2" readOnly wrap="yes" id="userRealNames"></textarea>
  138.               <input type=hidden name="receiver">
  139.               <input type="hidden" name="isDraft" value="false">
  140.   <input type="button" onClick="openWinUsers()" value="选择用户">
  141.     <input type=button onClick="openWinUserGroup()" value="按用户组"> <input name="button" type=button onClick="openWinUserRole()" value="按角色"></td></tr>
  142.           <tr> 
  143.             <td width="68" height="26"> 
  144.               <div align="center">消息标题:</div>            </td>
  145.             <td width="217" height="26">
  146.               <input type="text" name="title" class="input1" size="30" maxlength="30">            </td>
  147.           </tr>
  148.           <tr> 
  149.             <td width="68" height="26"> 
  150.               <div align="center">消息内容:</div>            </td>
  151.             <td width="217" height="26"> 
  152.               <textarea name="content" cols="28" rows="3"></textarea>            </td>
  153.           </tr>
  154.           <tr>
  155.             <td height="26" align="center">附&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;件:</td>
  156.             <td height="26"><input type="file" name="filename"></td>
  157.           </tr>
  158.           <tr> 
  159.             <td colspan="2" height="26"> 
  160.               <div align="center">
  161.                 <input type="submit" name="Submit" value="发送" class="button1">
  162.                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  163.                 <input type="reset" name="Submit2" value="重写" class="button1">
  164. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  165. <input type="button" name="Submit3" value="存草稿" class="button1" onClick="saveDraft()">
  166. &nbsp;&nbsp;              </div>            </td>
  167.           </tr>
  168.         </table>
  169.         <table width="300" border="0" cellspacing="0" cellpadding="0" align="center" class="9black" height="6">
  170.           <tr> 
  171.             <td></td>
  172.           </tr>
  173.         </table>
  174.       </td>
  175.   </tr>
  176.   <tr> 
  177.     <td bgcolor="#CEE7FF" height="6"></td>
  178.   </tr></form>
  179. </table>
  180. </body>
  181. </html>