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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8"%>
  2. <%@ page import="java.util.*" %>
  3. <%@ page import="cn.js.fan.module.cms.*" %>
  4. <%@ page import="cn.js.fan.web.*" %>
  5. <%@ page import="cn.js.fan.util.*" %>
  6. <%@ page import="com.redmoon.oa.person.*" %>
  7. <%@ page import="com.redmoon.oa.ui.*" %>
  8. <%@ page import="com.redmoon.oa.pvg.*" %>
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  12. <LINK href="../common.css" type=text/css rel=stylesheet>
  13. <title>用户桌面设置</title>
  14. <script language=javascript>
  15. <!--
  16. //-->
  17. </script>
  18. <style type="text/css">
  19. <!--
  20. .STYLE1 {
  21. color: #FFFFFF;
  22. font-weight: bold;
  23. }
  24. -->
  25. </style>
  26. </head>
  27. <body style="background-image:url()">
  28. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  29. <%
  30. String priv="read";
  31. if (!privilege.isUserPrivValid(request,priv))
  32. {
  33. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  34. return;
  35. }
  36. String op = ParamUtil.get(request, "op");
  37. if (op.equals("add")) {
  38. String userName = privilege.getUser(request);
  39. String moduleCode = ParamUtil.get(request, "moduleCode");
  40. String moduleItem = ParamUtil.get(request, "moduleItem");
  41. String title = ParamUtil.get(request, "title");
  42. UserDesktopSetupDb udsd = new UserDesktopSetupDb();
  43. udsd.setTitle(title);
  44. udsd.setUserName(userName);
  45. udsd.setModuleCode(moduleCode);
  46. udsd.setModuleItem(moduleItem);
  47. boolean re = udsd.create();
  48. if (re) {
  49. out.print(StrUtil.Alert_Redirect("操作成功!", "desktop_setup.jsp"));
  50. return;
  51. }
  52. else {
  53. out.print(StrUtil.Alert_Back("操作失败!"));
  54. }
  55. }
  56. if (op.equals("edit")) {
  57. int id = ParamUtil.getInt(request, "id");
  58. String title = ParamUtil.get(request, "title");
  59. int count = ParamUtil.getInt(request, "count");
  60. UserDesktopSetupDb udsd = new UserDesktopSetupDb();
  61. udsd = udsd.getUserDesktopSetupDb(id);
  62. udsd.setTitle(title);
  63. udsd.setCount(count);
  64. boolean re = udsd.save();
  65. if (re) {
  66. out.print(StrUtil.Alert_Redirect("操作成功!", "desktop_setup.jsp"));
  67. return;
  68. }
  69. else {
  70. out.print(StrUtil.Alert_Back("操作失败!"));
  71. }
  72. }
  73. if (op.equals("del")) {
  74. int id = ParamUtil.getInt(request, "id");
  75. UserDesktopSetupDb udsd = new UserDesktopSetupDb();
  76. udsd = udsd.getUserDesktopSetupDb(id);
  77. boolean re = udsd.del();
  78. if (re) {
  79. out.print(StrUtil.Alert_Redirect("操作成功!", "desktop_setup.jsp"));
  80. return;
  81. }
  82. else {
  83. out.print(StrUtil.Alert_Back("操作失败!"));
  84. }
  85. }
  86. if (op.equals("copy")) {
  87. if (!privilege.isUserPrivValid(request, PrivDb.PRIV_ADMIN)) {
  88. out.print(StrUtil.Alert_Back("非法操作!"));
  89. return;
  90. }
  91. else {
  92. int id = ParamUtil.getInt(request, "id");
  93. UserDesktopSetupDb udsd = new UserDesktopSetupDb();
  94. udsd = udsd.getUserDesktopSetupDb(id);
  95. udsd.copyToAllOtherUsersDesktop(privilege.getUser(request));
  96. out.print(StrUtil.Alert_Redirect("操作完成!", "desktop_setup.jsp"));
  97. }
  98. }
  99. if (op.equals("init")) {
  100. UserDesktopSetupDb udsd = new UserDesktopSetupDb();
  101. String userName = privilege.getUser(request);
  102. udsd.initDesktopOfUser(userName);
  103. out.print(StrUtil.Alert("操作成功!"));
  104. }
  105. %>
  106. <%@ include file="user_inc_menu_top.jsp" %>
  107. <%
  108. String userName = privilege.getUser(request);
  109. UserDesktopSetupDb udsd = new UserDesktopSetupDb();
  110. String sql = "select id from " + udsd.getTableName() + " where user_name=" + StrUtil.sqlstr(userName);
  111. Vector v = udsd.list(sql);
  112. Iterator ir = v.iterator();
  113. DesktopMgr dm = new DesktopMgr();
  114. %>
  115. <br>
  116. &nbsp;&nbsp;&nbsp;&nbsp;<a href="?op=init">恢复默认界面</a><br>
  117. <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#7E7DA2">
  118. <tr>
  119.   <td bgcolor="#C4DAFF"><strong>模块</strong></td>
  120.   <td bgcolor="#C4DAFF"><strong>属性</strong></td>
  121.   <td bgcolor="#C4DAFF"><strong>操作</strong></td>
  122. </tr>
  123. <%
  124. int k = 0;
  125. while (ir.hasNext()) {
  126. k ++;
  127. udsd = (UserDesktopSetupDb) ir.next();
  128. DesktopUnit du = dm.getDesktopUnit(udsd.getModuleCode());
  129. %>
  130. <form name="form<%=k%>" action="?op=edit" method=post>
  131. <tr><td width="29%" bgcolor="#E6E6E6">
  132. 标题
  133. <input name="title" value="<%=udsd.getTitle()%>">
  134. <input name="id" value="<%=udsd.getId()%>" type="hidden">
  135. </td>
  136.   <td width="48%" bgcolor="#E6E6E6">
  137.   <%if (du.getType().equals(du.TYPE_LIST)) {%>
  138.   行数&nbsp;<input name=count value="<%=udsd.getCount()%>">
  139.   <%}else{%>
  140.   字数&nbsp;<input name=count value="<%=udsd.getCount()%>">
  141.   <%}%>  
  142.   参数:<%=udsd.getModuleItem()%>
  143.   </td>
  144.   <td width="23%" bgcolor="#E6E6E6"><input type="submit" value="修改"/>
  145.   <input value="删除" type="button" onClick="window.location.href='?op=del&id=<%=udsd.getId()%>'">
  146.   <%if (privilege.isUserPrivValid(request, PrivDb.PRIV_ADMIN)) {%>
  147.   <input name="button" type="button" onClick="window.location.href='?op=copy&id=<%=udsd.getId()%>'" title="复制至其它用户桌面" value="复制">
  148.   <%}%>
  149.   </td>
  150. </tr></form>
  151. <%}%>
  152. </table>
  153. <br>
  154. <table width="761" border="0" align="center">
  155.       <tr>
  156.         <td width="249" valign="top"><table width="249" border="0" align="center" cellspacing="1" bgcolor="#D9DCE1" class="frame_gray">
  157.           <form action="?op=add" method="post">
  158.             <tr>
  159.               <td colspan="2" align="center" bgcolor="#5286BD"><span class="STYLE1">公共通知</span></td>
  160.             </tr>
  161.             <tr>
  162.               <td width="45" align="left" bgcolor="#F0F0F0">&nbsp;标题</td>
  163.               <td width="194" align="left" bgcolor="#F0F0F0"><input name="title" value="公共通知">
  164.                 <input type=hidden name="moduleCode" value="fileark">
  165.                 <input type=hidden name="moduleItem" value="notice"></td>
  166.             </tr>
  167.             <tr>
  168.               <td colspan="3" align="center" bgcolor="#F0F0F0"><input name="submit" type=submit value="添加"/>
  169.                 &nbsp;&nbsp;&nbsp;</td>
  170.             </tr>
  171.           </form>
  172.         </table></td>
  173.         <td width="249" valign="top"><table width="249" border="0" align="center" cellspacing="1" bgcolor="#D9DCE1" class="frame_gray">
  174.           <form action="?op=add" method="post">
  175.             <tr>
  176.               <td colspan="2" align="center" bgcolor="#5286BD"><span class="STYLE1">文件柜目录</span></td>
  177.             </tr>
  178.             <tr>
  179.               <td width="41" align="left" bgcolor="#F0F0F0">&nbsp;标题 </td>
  180.               <td width="198" align="left" bgcolor="#F0F0F0"><input name="title" value="文件柜目录">
  181.                   <input type=hidden name="moduleCode" value="fileark">
  182.               </td>
  183.             </tr>
  184.             <tr>
  185.               <td align="left" bgcolor="#F0F0F0">&nbsp;类别</td>
  186.               <td align="left" bgcolor="#F0F0F0"><select name="moduleItem" onChange="if(this.options[this.selectedIndex].value=='not'){alert(this.options[this.selectedIndex].text+' 不能被选择!');return false;}">
  187.                   <option value="not" selected>请选择类别</option>
  188.                   <%
  189. Directory dir = new Directory();
  190. Leaf lf = dir.getLeaf("root");
  191. DirectoryView dv = new DirectoryView(lf);
  192. dv.ShowDirectoryAsOptions(out, lf, lf.getLayer());
  193. %>
  194.               </select></td>
  195.             </tr>
  196.             <tr>
  197.               <td colspan="3" align="center" bgcolor="#F0F0F0"><input name="submit2" type=submit value="添加"/>
  198.                 &nbsp;&nbsp;&nbsp;</td>
  199.             </tr>
  200.           </form>
  201.         </table></td>
  202.         <td width="249" valign="top"><table width="249" border="0" align="center" cellspacing="1" bgcolor="#D9DCE1" class="frame_gray">
  203.           <form action="?op=add" method="post">
  204.             <tr>
  205.               <td colspan="2" align="center" bgcolor="#5286BD"><span class="STYLE1">日程安排</span></td>
  206.             </tr>
  207.             <tr>
  208.               <td width="45" align="left" bgcolor="#F0F0F0">&nbsp;标题</td>
  209.               <td width="194" align="left" bgcolor="#F0F0F0"><input name="title" value="日程安排">
  210.                   <input type=hidden name="moduleCode" value="plan">
  211.                   <input type=hidden name="moduleItem" value=""></td>
  212.             </tr>
  213.             <tr>
  214.               <td colspan="3" align="center" bgcolor="#F0F0F0"><input name="submit3" type=submit value="添加"/>
  215.                 &nbsp;&nbsp;&nbsp;</td>
  216.             </tr>
  217.           </form>
  218.         </table></td>
  219.       </tr>
  220.       <tr>
  221.         <td><table width="249" border="0" align="center" cellspacing="1" bgcolor="#D9DCE1" class="frame_gray">
  222.           <form action="?op=add" method="post">
  223.             <tr>
  224.               <td colspan="2" align="center" bgcolor="#5286BD"><span class="STYLE1">待办工作流</span></td>
  225.             </tr>
  226.             <tr>
  227.               <td width="45" align="left" bgcolor="#F0F0F0">&nbsp;标题</td>
  228.               <td width="194" align="left" bgcolor="#F0F0F0"><input name="title" value="待办工作流">
  229.                   <input type=hidden name="moduleCode" value="flow">
  230.                   <input type=hidden name="moduleItem" value=""></td>
  231.             </tr>
  232.             <tr>
  233.               <td colspan="3" align="center" bgcolor="#F0F0F0"><input name="submit4" type=submit value="添加"/>
  234.                 &nbsp;&nbsp;&nbsp;</td>
  235.             </tr>
  236.           </form>
  237.         </table></td>
  238.         <td><table width="249" border="0" align="center" cellspacing="1" bgcolor="#D9DCE1" class="frame_gray">
  239.           <form action="?op=add" method="post">
  240.             <tr>
  241.               <td colspan="2" align="center" bgcolor="#5286BD"><span class="STYLE1">任务督办</span></td>
  242.             </tr>
  243.             <tr>
  244.               <td width="45" align="left" bgcolor="#F0F0F0">&nbsp;标题</td>
  245.               <td width="194" align="left" bgcolor="#F0F0F0"><input name="title" value="任务督办">
  246.                   <input type=hidden name="moduleCode" value="task">
  247.                   <input type=hidden name="moduleItem" value=""></td>
  248.             </tr>
  249.             <tr>
  250.               <td colspan="3" align="center" bgcolor="#F0F0F0"><input name="submit42" type=submit value="添加"/>
  251.                 &nbsp;&nbsp;&nbsp;</td>
  252.             </tr>
  253.           </form>
  254.         </table></td>
  255.         <td><table width="249" border="0" align="center" cellspacing="1" bgcolor="#D9DCE1" class="frame_gray">
  256.           <form action="?op=add" method="post">
  257.             <tr>
  258.               <td colspan="2" align="center" bgcolor="#5286BD"><span class="STYLE1">短消息</span></td>
  259.             </tr>
  260.             <tr>
  261.               <td width="45" align="left" bgcolor="#F0F0F0">&nbsp;标题</td>
  262.               <td width="194" align="left" bgcolor="#F0F0F0"><input name="title" value="短消息">
  263.                   <input type=hidden name="moduleCode" value="msg">
  264.                   <input type=hidden name="moduleItem" value=""></td>
  265.             </tr>
  266.             <tr>
  267.               <td colspan="3" align="center" bgcolor="#F0F0F0"><input name="submit422" type=submit value="添加"/>
  268.                 &nbsp;&nbsp;&nbsp;</td>
  269.             </tr>
  270.           </form>
  271.         </table></td>
  272.       </tr>
  273.       <tr>
  274.         <td valign="top"><table width="249" border="0" align="center" cellspacing="1" bgcolor="#D9DCE1" class="frame_gray">
  275.           <form action="?op=add" method="post">
  276.             <tr>
  277.               <td colspan="2" align="center" bgcolor="#5286BD"><span class="STYLE1">论坛新贴</span></td>
  278.             </tr>
  279.             <tr>
  280.               <td width="45" align="left" bgcolor="#F0F0F0">&nbsp;标题</td>
  281.               <td width="194" align="left" bgcolor="#F0F0F0"><input name="title" value="论坛新贴">
  282.                   <input type=hidden name="moduleCode" value="forum">
  283.                   <input type=hidden name="moduleItem" value=""></td>
  284.             </tr>
  285.             <tr>
  286.               <td colspan="3" align="center" bgcolor="#F0F0F0"><input name="submit43" type=submit value="添加"/>
  287.                 &nbsp;&nbsp;&nbsp;</td>
  288.             </tr>
  289.           </form>
  290.         </table></td>
  291.         <td valign="top"><table width="249" border="0" align="center" cellspacing="1" bgcolor="#D9DCE1" class="frame_gray">
  292.           <form action="?op=add" method="post">
  293.             <tr>
  294.               <td colspan="2" align="center" bgcolor="#5286BD"><span class="STYLE1">博客新贴</span></td>
  295.             </tr>
  296.             <tr>
  297.               <td width="45" align="left" bgcolor="#F0F0F0">&nbsp;标题</td>
  298.               <td width="194" align="left" bgcolor="#F0F0F0"><input name="title" value="博客新贴">
  299.                   <input type=hidden name="moduleCode" value="blog">
  300.                   <input type=hidden name="moduleItem" value=""></td>
  301.             </tr>
  302.             <tr>
  303.               <td colspan="3" align="center" bgcolor="#F0F0F0"><input name="submit432" type=submit value="添加"/>
  304.                 &nbsp;&nbsp;&nbsp;</td>
  305.             </tr>
  306.           </form>
  307.         </table></td>
  308.         <td><table width="249" border="0" align="center" cellspacing="1" bgcolor="#D9DCE1" class="frame_gray">
  309.           <form name="formDoc" action="?op=add" method="post">
  310.             <tr>
  311.               <td colspan="2" align="center" bgcolor="#5286BD"><span class="STYLE1">文件柜中的文件</span></td>
  312.             </tr>
  313.             <tr>
  314.               <td width="41" align="left" bgcolor="#F0F0F0">&nbsp;标题 </td>
  315.               <td width="198" align="left" bgcolor="#F0F0F0"><input name="title" value="文章">
  316.                   <input type=hidden name="moduleCode" value="document">
  317.               </td>
  318.             </tr>
  319.             <tr>
  320.               <td align="left" bgcolor="#F0F0F0">&nbsp;编号</td>
  321.               <td align="left" bgcolor="#F0F0F0"><input name="moduleItem" value="" readonly size=8>
  322.                 &nbsp;&nbsp;<a href="javascript:showModalDialog('../cms/doc_template_select_frame.jsp?dirCode=root',window.self,'dialogWidth:640px;dialogHeight:480px;status:no;help:no;')">选文章</a></td>
  323.             </tr>
  324.             <tr>
  325.               <td colspan="3" align="center" bgcolor="#F0F0F0"><input name="submit22" type=submit value="添加"/>
  326.                 &nbsp;&nbsp;&nbsp;</td>
  327.             </tr>
  328.           </form>
  329.         </table></td>
  330.       </tr>
  331.     </table>
  332. <br>
  333. <br>
  334. </body>
  335. <script>
  336. function selTemplate(id)
  337. {
  338. formDoc.moduleItem.value = id;
  339. }
  340. </script>
  341. </html>