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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8"%>
  2. <%@ page import="java.net.URLEncoder"%>
  3. <%@ page import="cn.js.fan.util.*"%>
  4. <%@ page import="com.redmoon.oa.flow.*"%>
  5. <%@ page import="com.redmoon.oa.dept.*"%>
  6. <%@ page import="com.redmoon.oa.person.*"%>
  7. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  8. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  9. <%
  10. int flowId = ParamUtil.getInt(request, "flowId");
  11. String op = ParamUtil.get(request, "op");
  12. String priv="flow.init";
  13. if (!privilege.isUserPrivValid(request, priv))
  14. {
  15. out.println(fchar.makeErrMsg("对不起,您不具有发起流程的权限!"));
  16. return;
  17. }
  18. WorkflowMgr wm = new WorkflowMgr();
  19. WorkflowDb wf = wm.getWorkflowDb(flowId);
  20. PostDb pd = new PostDb();
  21. pd = pd.getPostDbByUserName(privilege.getUser(request));
  22. if (pd==null)
  23. pd = new PostDb();
  24. UserDb ud = new UserDb();
  25. ud = ud.getUserDb(privilege.getUser(request));
  26. String flowString = "";
  27. String returnBackChecked = "checked";
  28. WorkflowPredefineDb wpd = new WorkflowPredefineDb();
  29. if (op.equals("")) {
  30. wpd = wpd.getDefaultPredefineFlow(wf.getTypeCode());
  31. if (wpd!=null && wpd.isLoaded()) {
  32. int preId = wpd.getId();
  33. wpd = wpd.getWorkflowPredefineDb(preId);
  34. flowString = wpd.getFlowString();
  35. // 替换其中的“本人”、“本部门领导”节点
  36. flowString = wf.regeneratePredefinedFlowString(privilege.getUser(request), flowString);
  37. // System.out.println("flow_initiatte3.jsp preId=" + preId);
  38. if (!wpd.isReturnBack())
  39. returnBackChecked = "";
  40. op = "setDefault";
  41. }
  42. else
  43. wpd = new WorkflowPredefineDb();
  44. }
  45. if (op.equals("loadPredefinedFlow")) {
  46. int preId = ParamUtil.getInt(request, "preId");
  47. wpd = wpd.getWorkflowPredefineDb(preId);
  48. flowString = wpd.getFlowString();
  49. // 替换其中的“本人”、“本部门领导”节点
  50. flowString = wf.regeneratePredefinedFlowString(privilege.getUser(request), flowString);
  51. // System.out.println("flow_initiatte3.jsp preId=" + preId);
  52. if (!wpd.isReturnBack())
  53. returnBackChecked = "";
  54. }
  55. %>
  56. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  57. <html>
  58. <head>
  59. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  60. <title>发起流程</title>
  61. <link href="common.css" rel="stylesheet" type="text/css">
  62. <%@ include file="inc/nocache.jsp"%>
  63. <script language="JavaScript" type="text/JavaScript">
  64. <!--
  65. function MM_preloadImages() { //v3.0
  66.   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  67.     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  68.     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
  69. }
  70. //-->
  71. </script>
  72. <script language=javascript>
  73. <!--
  74. function openWin(url,width,height)
  75. {
  76. 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);
  77. }
  78. function ModifyAction(user, title, clrindex, userRealName, jobCode, jobName, proxyJobCode, proxyJobName, proxyUserName, proxyUserRealName, fieldWrite, checkState) {
  79. Designer.ActionUser = user;
  80. Designer.ActionTitle = title;
  81. Designer.ActionColorIndex = clrindex;
  82. Designer.ActionUserRealName = userRealName;
  83. Designer.ActionJobCode = jobCode;
  84. Designer.ActionJobName = jobName;
  85. Designer.ActionProxyJobCode = proxyJobCode;
  86. Designer.ActionProxyJobName = proxyJobName;
  87. Designer.ActionProxyUserName = proxyUserName;
  88. Designer.ActionProxyUserRealName = proxyUserRealName;
  89. Designer.ActionFieldWrite = fieldWrite;
  90. Designer.ActionCheckState = checkState;
  91. Designer.ActionDept = Designer.ActionDept;
  92. Designer.ActionFlag = Designer.ActionFlag; // 如果不获取一次属性,在Designer.ModifyAction()中就不能初始化m_actionFlag的值,ActionDept也是如此
  93. Designer.ModifyAction();
  94. }
  95. function getActionUser() {
  96. return Designer.ActionUser;
  97. }
  98. function getActionTitle() {
  99. return Designer.ActionTitle;
  100. }
  101. function getActionColorIndex() {
  102. return Designer.ActionColorIndex;
  103. }
  104. function getActionUserRealName() {
  105. return Designer.ActionUserRealName;
  106. }
  107. function getActionCheckState() {
  108. return Designer.ActionCheckState;
  109. }
  110. function getActionJobCode() {
  111. return Designer.ActionJobCode;
  112. }
  113. function getActionJobName() {
  114. return Designer.ActionJobName;
  115. }
  116. function getActionProxyJobCode() {
  117. return Designer.ActionProxyJobCode;
  118. }
  119. function getActionProxyJobName() {
  120. return Designer.ActionProxyJobName;
  121. }
  122. function getActionProxyUserName() {
  123. return Designer.ActionProxyUserName;
  124. }
  125. function getActionProxyUserRealName() {
  126. return Designer.ActionProxyUserRealName;
  127. }
  128. function getActionFieldWrite() {
  129. return Designer.ActionFieldWrite;
  130. }
  131. function getActionDept() {
  132. return Designer.ActionDept;
  133. }
  134. function OpenModifyWin() {
  135. var isActionSelected = Designer.isActionSelected
  136. if (isActionSelected) {
  137. // showModalDialog('flow_action_modify.jsp',window.self,'dialogWidth:480px;dialogHeight:400px;status:no;help:no;')
  138. openWin("flow_action_modify.jsp?flowId=<%=flowId%>&hidFieldWrite=" + getActionFieldWrite(), 480, 292);
  139. }
  140. else
  141. alert("请选择一个动作!");
  142. }
  143. function Operate() {
  144. OpenModifyWin();
  145. }
  146. function form1_onsubmit() {
  147. form1.flowString.value =  Designer.Workflow;
  148. }
  149. function loadPredefinedFlow() {
  150. openWin("flow_sel_predefined_frame.jsp", 640, 480);
  151. }
  152. function sel(id) {
  153. window.location.href = "flow_initiate3.jsp?op=loadPredefinedFlow&preId=" + id + "&flowId=<%=flowId%>";
  154. }
  155. function getFlowId() {
  156. return <%=flowId%>;
  157. }
  158. var op = "<%=op%>";
  159. function window_onload() {
  160. if (op=="") {
  161. Designer.New()
  162. }
  163. }
  164. //-->
  165. </script>
  166. <style type="text/css">
  167. <!--
  168. .style1 {color: #FFFFFF}
  169. -->
  170. </style>
  171. </head>
  172. <body background="" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0" onLoad="window_onload()">
  173. <table height="89" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="tableframe">
  174.   <tr> 
  175.     <td height="23" class="right-title">&nbsp;&nbsp;流程向导 (第二步 “<%=wf.getTitle()%>”可视化定义)</td>
  176.   </tr>
  177.   <tr> 
  178.     <td valign="top">
  179. <table width="100%"  border="0" cellspacing="0" cellpadding="0">
  180.       <tr>
  181.         <td align="center">
  182. <div id=divDesigner>
  183. <%
  184. String mode = "initiate";
  185. com.redmoon.oa.Config cfg = new com.redmoon.oa.Config();
  186.     String canUserModifyFlow = cfg.get("canUserModifyFlow");
  187.     if (!canUserModifyFlow.equals("true")) {
  188. mode = "view";
  189. }
  190. %>
  191. <OBJECT ID="Designer" CLASSID="CLSID:ADF8C3A0-8709-4EC6-A783-DD7BDFC299D7" codebase="<%=request.getContextPath()%>/activex/Designer.CAB" width=740 height=338>
  192.     <param name="Workflow" value="<%=flowString%>">
  193. <param name="Mode" value="<%=mode%>"><!--debug user initiate complete view-->
  194. <param name="CurrentUser" value="<%=privilege.getUser(request)%>">
  195. <param name="CurrentUserRealName" value="<%=ud.getRealName()%>">
  196. <param name="CurrentJobCode" value="<%=pd.getCode()%>">
  197. <param name="CurrentJobName" value="<%=pd.getName()%>">
  198. </OBJECT></div></td>
  199.       </tr>
  200.   <form action="flow_initiate3_do.jsp" method="post" id="form1" name="form1" onSubmit="form1_onsubmit()">
  201.       <tr>
  202.         <td height="35" align="center">
  203.   <%
  204. WorkflowPredefineDb ftd = new WorkflowPredefineDb();
  205. String sql = "select id from flow_predefined where typeCode=" + StrUtil.sqlstr(wf.getTypeCode());
  206. java.util.Iterator ir = ftd.list(sql).iterator();
  207. Directory dir = new Directory();
  208. while (ir.hasNext()) {
  209. ftd = (WorkflowPredefineDb) ir.next();
  210. Leaf lf = dir.getLeaf(ftd.getTypeCode());
  211. %>
  212.           <table width="100%"  border="0" cellpadding="5" cellspacing="0" class="p14">
  213.             <tr>
  214.               <td width="69%" height="31" bgcolor="#EAEAEA" ><%=ftd.getTitle()%>   </td>
  215.               <td width="12%" bgcolor="#EAEAEA" >
  216.   <%=ftd.isDefaultFlow()?"默认流程":""%>
  217.   </td>
  218.               <td width="19%" align="center" bgcolor="#EAEAEA" ><input name="button2" type="button" class="button1" onClick="openWin('flow_sel_predefined_preview.jsp?id=<%=ftd.getId()%>', 640, 365)" value="预览">
  219.                 &nbsp;&nbsp;
  220.                 <input name="button" type="button" class="button1" onClick="sel('<%=ftd.getId()%>')" value="选择"></td>
  221.             </tr>
  222.           </table>
  223.           <%}%></td>
  224.       </tr>
  225.       <tr>
  226.         <td height="35" align="center"><input type="hidden" name="returnBack" value="true" <%=returnBackChecked%>>
  227. <!--允许打回&nbsp;&nbsp;
  228. <input name="button3" type="button" class="singleboarder" onClick="loadPredefinedFlow()" value="载入其它预定义流程">
  229. &nbsp;&nbsp;-->
  230. <input type=hidden name="flowString" value="">
  231. <input type=hidden name="flowId" value="<%=flowId%>">
  232. <input name="submit" type="submit" class="singleboarder" value=" 办理流程 " title="办理流程"></td>
  233.       </tr>
  234.   </form>
  235.     </table></td>
  236.   </tr>
  237. </table>
  238. <br>
  239. <br>
  240. </body>
  241. </html>