flow_sel_predefined_list.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.util.*"%>
  3. <%@ page import="cn.js.fan.util.*"%>
  4. <%@ page import="cn.js.fan.web.*"%>
  5. <%@ page import="com.redmoon.oa.flow.*"%>
  6. <%@ page import="com.redmoon.oa.pvg.*"%>
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8. <html xmlns="http://www.w3.org/1999/xhtml">
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  11. <link rel="stylesheet" type="text/css" href="common.css">
  12. <title>预定义流程列表</title>
  13. <script>
  14. function findObj(theObj, theDoc)
  15. {
  16.   var p, i, foundObj;
  17.   
  18.   if(!theDoc) theDoc = document;
  19.   if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  20.   {
  21.     theDoc = parent.frames[theObj.substring(p+1)].document;
  22.     theObj = theObj.substring(0,p);
  23.   }
  24.   if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  25.   for (i=0; !foundObj && i < theDoc.forms.length; i++) 
  26.     foundObj = theDoc.forms[i][theObj];
  27.   for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
  28.     foundObj = findObj(theObj,theDoc.layers[i].document);
  29.   if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  30.   
  31.   return foundObj;
  32. }
  33. var GetDate=""; 
  34. function SelectDate(ObjName,FormatDate){
  35. var PostAtt = new Array;
  36. PostAtt[0]= FormatDate;
  37. PostAtt[1]= findObj(ObjName);
  38. GetDate = showModalDialog("util/calendar/calendar.htm", PostAtt ,"dialogWidth:286px;dialogHeight:221px;status:no;help:no;");
  39. }
  40. function SetDate()
  41. findObj(ObjName).value = GetDate; 
  42. }
  43. function sel(id) {
  44. var url = window.parent.opener.location.href;
  45. var p = url.indexOf("?");
  46. url = url.substring(0, p);
  47. var flowId = window.parent.opener.getFlowId();
  48. window.parent.opener.location.href = url + "?op=loadPredefinedFlow&preId=" + id + "&flowId=" + flowId;
  49. window.parent.close();
  50. }
  51. function openWin(url,width,height)
  52. {
  53. 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);
  54. }
  55. </script>
  56. <style type="text/css">
  57. <!--
  58. .STYLE3 {color: #FFFFFF}
  59. -->
  60. </style>
  61. </head>
  62. <body>
  63. <%
  64. String dirCode = ParamUtil.get(request, "dirCode");
  65. if (dirCode.equals("")) {
  66. out.print(StrUtil.p_center("请选择流程类型!"));
  67. return;
  68. }
  69. Leaf lf = new Leaf();
  70. lf = lf.getLeaf(dirCode);
  71. if (lf==null || !lf.isLoaded()) {
  72. out.print(SkinUtil.makeErrMsg(request, "节点不存在!"));
  73. return;
  74. }
  75. WorkflowPredefineDb fd = new WorkflowPredefineDb();
  76. %>
  77. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  78. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  79. <%
  80. String priv = PrivDb.PRIV_ADMIN;
  81. if (!privilege.isUserPrivValid(request, priv))
  82. {
  83. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  84. return;
  85. }
  86. String op = ParamUtil.get(request, "op");
  87. if (op.equals("del")) {
  88. WorkflowPredefineMgr ftm = new WorkflowPredefineMgr();
  89. boolean re = false;
  90. try {
  91. re = ftm.del(request);
  92. }
  93. catch (ErrMsgException e) {
  94. out.print(StrUtil.Alert(e.getMessage()));
  95. }
  96. if (re) {
  97. out.print(StrUtil.Alert("删除成功!"));
  98. }
  99. else {
  100. out.print(StrUtil.Alert("删除失败!"));
  101. }
  102. }
  103. %>
  104. <br />
  105. <table width="100%" cellpadding="0" cellspacing="1">
  106.   <tr>
  107.     <td width="55%" height="25" align="center" bgcolor="#5286BD" ><span class="STYLE3">名称</span></td>
  108.     <td width="29%" align="center" bgcolor="#5286BD" class="STYLE3" >类别</td>
  109.     <td width="16%" height="25" align="center" bgcolor="#5286BD" ><span class="STYLE3">操作</span></td>
  110.   </tr>
  111. </table>
  112. <%
  113. WorkflowPredefineDb ftd = new WorkflowPredefineDb();
  114. String sql = "select id from flow_predefined where typeCode=" + StrUtil.sqlstr(dirCode);
  115. Iterator ir = ftd.list(sql).iterator();
  116. while (ir.hasNext()) {
  117. ftd = (WorkflowPredefineDb) ir.next();
  118. lf = lf.getLeaf(ftd.getTypeCode());
  119. %>
  120. <table width="100%"  border="0" cellpadding="5" cellspacing="1" class="p14">
  121.   <tr>
  122.     <td width="55%" bgcolor="#EAEAEA" ><a href="javascript:openWin('flow_sel_predefined_preview.jsp?id=<%=ftd.getId()%>', 640, 365)"><%=ftd.getTitle()%></a></td>
  123.     <td width="29%" bgcolor="#EAEAEA" ><%=lf.getName()%></td>
  124.     <td width="16%" align="center" bgcolor="#EAEAEA" ><input type="button" value="选择" onclick="sel('<%=ftd.getId()%>')"></td>
  125.   </tr>
  126. </table>
  127. <%}%>
  128. <br />
  129. <br />
  130. </body>
  131. </html>