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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ page import="java.io.InputStream" %>
  3. <%@ page import="java.util.*" %>
  4. <%@ page import="cn.js.fan.db.*" %>
  5. <%@ page import="cn.js.fan.util.*" %>
  6. <%@ page import="com.redmoon.oa.netdisk.*" %>
  7. <%@ page import="com.redmoon.oa.pvg.*" %>
  8. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  12. <title></title>
  13. <LINK href="../admin/default.css" type=text/css rel=stylesheet>
  14. <script>
  15. function form1_onsubmit() {
  16. form1.type.value = form1.seltype.value;
  17. form1.root_code.value = window.parent.dirmainFrame.getRootCode();
  18. }
  19. function selTemplate(id)
  20. {
  21. if (form1.templateId.value!=id) {
  22. form1.templateId.value = id;
  23. }
  24. }
  25. </script>
  26. </head>
  27. <body>
  28. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  29. <%
  30. if (!privilege.isUserLogin(request))
  31. {
  32. //out.println(StrUtil.makeErrMsg(privilege.MSG_INVALID, "red","green"));
  33. //return;
  34. }
  35. %>
  36. <%
  37. String parent_code = ParamUtil.get(request, "parent_code");
  38. if (parent_code.equals(""))
  39. parent_code = privilege.getUser(request);
  40. String parent_name = ParamUtil.get(request, "parent_name");
  41. String code = ParamUtil.get(request, "code");
  42. String name = ParamUtil.get(request, "name");
  43. String description = ParamUtil.get(request, "description");
  44. String op = ParamUtil.get(request, "op");
  45. boolean isHome = false;
  46. int type = 0;
  47. if (op.equals(""))
  48. op = "AddChild";
  49. if (op.equals("AddChild")) {
  50. LeafPriv lp = new LeafPriv();
  51. lp.setDirCode(parent_code);
  52. if (!lp.canUserAppend(privilege.getUser(request))) {
  53. // out.println(StrUtil.makeErrMsg(privilege.MSG_INVALID, "red", "green"));
  54. // return;
  55. }
  56. }
  57. Leaf leaf = null;
  58. if (op.equals("modify")) {
  59. LeafPriv lp = new LeafPriv(code);
  60. if (!lp.canUserModify(privilege.getUser(request))) {
  61. // out.print(StrUtil.makeErrMsg(privilege.MSG_INVALID));
  62. // return;
  63. }
  64. Directory dir = new Directory();
  65. leaf = dir.getLeaf(code);
  66. name = leaf.getName();
  67. description = leaf.getDescription();
  68. type = leaf.getType();
  69. isHome = leaf.getIsHome();
  70. }
  71. %>
  72. <TABLE 
  73. style="BORDER-RIGHT: #a6a398 1px solid; BORDER-TOP: #a6a398 1px solid; BORDER-LEFT: #a6a398 1px solid; BORDER-BOTTOM: #a6a398 1px solid" 
  74. cellSpacing=0 cellPadding=3 width="95%" align=center>
  75.   <!-- Table Head Start-->
  76.   <TBODY>
  77.     <TR>
  78.       <TD class=thead style="PADDING-LEFT: 10px" noWrap width="70%">目录增加或修改</TD>
  79.     </TR>
  80.     <TR class=row style="BACKGROUND-COLOR: #fafafa">
  81.       <TD align="center" style="PADDING-LEFT: 10px"><table class="frame_gray" width="335" border="0" cellpadding="0" cellspacing="1">
  82.         <tr>
  83.           <td width="411" align="center"><table width="98%">
  84.             <form name="form1" method="post" action="dir_top.jsp?op=<%=op%>" target="dirmainFrame" onClick="return form1_onsubmit()">
  85.               
  86.               <tr>
  87.                 <td width="78" rowspan="5" align="left" valign="top"><br>
  88.                   当前结点:<br>
  89.                   <font color=blue><%=parent_name.equals("")?"根结点":parent_name%></font> </td>
  90.                 <td width="243" align="left">名称
  91.                     <input name="name" value="<%=name%>">
  92.                     <input type=hidden name="code" value="<%=op.equals("modify")?code:Leaf.getAutoCode()%>"></td>
  93.               </tr>
  94.               <tr>
  95.                 <td align="left">描述
  96.                     <input name="description" value="<%=description%>">
  97.                     <input type=hidden name=parent_code value="<%=parent_code%>">                    <input name="seltype" type="hidden" value="<%=Leaf.TYPE_DOCUMENT%>">
  98.                     <input type=hidden name=root_code value="">
  99.                     <input type=hidden name="type" value="<%=type%>">
  100.                     <input type=hidden name="templateId" value="-1"></td>
  101.               </tr>
  102.               
  103.               <tr>
  104.                 <td align="left"><span class="unnamed2">
  105.                   <%if (op.equals("modify")) {
  106.    if (!leaf.getParentCode().equals("-1")) {
  107.   %>
  108. <script>
  109. var bcode = "<%=leaf.getCode()%>";
  110. </script>
  111. &nbsp;父结点:
  112. <select name="parentCode">
  113. <%
  114. Leaf rootlf = leaf.getLeaf(privilege.getUser(request));
  115. DirectoryView dv = new DirectoryView(rootlf);
  116. dv.ShowDirectoryAsOptionsWithCode(out, rootlf, rootlf.getLayer());
  117. %>
  118. </select>
  119. <script>
  120. form1.parentCode.value = "<%=leaf.getParentCode()%>";
  121. </script>
  122. <%}else{%>
  123. <input name="parentCode" type="hidden" value="<%=leaf.getParentCode()%>">
  124. <%}%>
  125. <%}%>
  126.                 </span></td>
  127.               </tr>
  128.               <tr>
  129.                 <td align="left">
  130. </td>
  131.               </tr>
  132.               <tr>
  133.                 <td align="center"><input name="Submit" type="submit" class="singleboarder" value="提交">
  134.                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  135.                   <input name="Submit" type="reset" class="singleboarder" value="重置">                </tr>
  136.             </form>
  137.           </table></td>
  138.         </tr>
  139.       </table>
  140.       </TD>
  141.     </TR>
  142.     <!-- Table Body End -->
  143.     <!-- Table Foot -->
  144.     <TR>
  145.       <TD class=tfoot align=right><DIV align=right> </DIV></TD>
  146.     </TR>
  147.     <!-- Table Foot -->
  148.   </TBODY>
  149. </TABLE>
  150. </body>
  151. </html>