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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <%@ page import="cn.js.fan.module.cms.*"%>
  3. <%@ page import="cn.js.fan.util.*"%>
  4. <%@ page import="com.redmoon.oa.flow.*"%>
  5. <%@ page import="com.redmoon.oa.person.*"%>
  6. <%@ page import="com.redmoon.oa.dept.*"%>
  7. <link href="common.css" rel="stylesheet" type="text/css">
  8. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  9. <%
  10. String priv="read";
  11. if (!privilege.isUserPrivValid(request,priv))
  12. {
  13. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  14. return;
  15. }
  16. int flow_id = ParamUtil.getInt(request, "flowId");
  17. WorkflowMgr wfm = new WorkflowMgr();
  18. WorkflowDb wf = wfm.getWorkflowDb(flow_id);
  19. boolean isStarted = wf.isStarted();
  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 returnBackChecked = "checked";
  27. String op = ParamUtil.get(request, "op");
  28. String flowString = wf.getFlowString();
  29. if (!wf.isReturnBack())
  30. returnBackChecked = "";
  31. if (op.equals("loadPredefinedFlow")) {
  32. int preId = ParamUtil.getInt(request, "preId");
  33. WorkflowPredefineDb wpd = new WorkflowPredefineDb();
  34. wpd = wpd.getWorkflowPredefineDb(preId);
  35. flowString = wpd.getFlowString();
  36. // 替换其中的“本人”、“本部门领导”节点
  37. flowString = wf.regeneratePredefinedFlowString(privilege.getUser(request), flowString);
  38. // System.out.println("flow_initiatte3.jsp preId=" + preId);
  39. if (!wpd.isReturnBack())
  40. returnBackChecked = "";
  41. }
  42. %>
  43. <title>修改流程</title>
  44. <script>
  45. function openWin(url,width,height)
  46. {
  47. 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);
  48. }
  49. function form1_onsubmit() {
  50. form1.flowstring.value = Designer.Workflow;
  51. }
  52. function OpenModifyWin() {
  53. var isActionSelected = Designer.isActionSelected
  54. if (isActionSelected) {
  55. // showModalDialog('flow_action_modify.jsp',window.self,'dialogWidth:480px;dialogHeight:320px;status:no;help:no;')
  56. openWin("flow_action_modify.jsp?flowId=<%=flow_id%>", 480, 320);
  57. }
  58. else
  59. alert("请选择一个动作!");
  60. }
  61. function Operate() {
  62.     var STATE_NOTDO = <%=WorkflowActionDb.STATE_NOTDO%>;
  63.     var STATE_IGNORED = <%=WorkflowActionDb.STATE_IGNORED%>;
  64. var STATE_DOING = <%=WorkflowActionDb.STATE_DOING%>;
  65.     var STATE_RETURN = <%=WorkflowActionDb.STATE_RETURN%>;
  66.     var STATE_FINISHED = <%=WorkflowActionDb.STATE_FINISHED%>;
  67. var checkState = getActionCheckState();
  68. if (checkState==STATE_FINISHED || checkState==STATE_DOING) {
  69. alert("动作已完成或者正在处理中时,不能被编辑!");
  70. return;
  71. }
  72. OpenModifyWin();
  73. }
  74. function ModifyAction(user, title, clrindex, userRealName, jobCode, jobName, proxyJobCode, proxyJobName, proxyUserName, proxyUserRealName, fieldWrite, checkState) {
  75. Designer.ActionUser = user;
  76. Designer.ActionTitle = title;
  77. Designer.ActionColorIndex = clrindex;
  78. Designer.ActionUserRealName = userRealName;
  79. Designer.ActionJobCode = jobCode;
  80. Designer.ActionJobName = jobName;
  81. Designer.ActionProxyJobCode = proxyJobCode;
  82. Designer.ActionProxyJobName = proxyJobName;
  83. Designer.ActionProxyUserName = proxyUserName;
  84. Designer.ActionProxyUserRealName = proxyUserRealName;
  85. Designer.ActionFieldWrite = fieldWrite;
  86. Designer.ActionCheckState = checkState;
  87. Designer.ActionDept = Designer.ActionDept;
  88. Designer.ActionFlag = Designer.ActionFlag; // 如果不获取一次属性,在Designer.ModifyAction()中就不能初始化m_actionFlag的值,ActionDept也是如此
  89. Designer.ModifyAction();
  90. }
  91. function getActionUser() {
  92. return Designer.ActionUser;
  93. }
  94. function getActionTitle() {
  95. return Designer.ActionTitle;
  96. }
  97. function getActionColorIndex() {
  98. return Designer.ActionColorIndex;
  99. }
  100. function getActionUserRealName() {
  101. return Designer.ActionUserRealName;
  102. }
  103. function getActionCheckState() {
  104. return Designer.ActionCheckState;
  105. }
  106. function getActionJobCode() {
  107. return Designer.ActionJobCode;
  108. }
  109. function getActionJobName() {
  110. return Designer.ActionJobName;
  111. }
  112. function getActionProxyJobCode() {
  113. return Designer.ActionProxyJobCode;
  114. }
  115. function getActionProxyJobName() {
  116. return Designer.ActionProxyJobName;
  117. }
  118. function getActionProxyUserName() {
  119. return Designer.ActionProxyUserName;
  120. }
  121. function getActionProxyUserRealName() {
  122. return Designer.ActionProxyUserRealName;
  123. }
  124. function getActionFieldWrite() {
  125. return Designer.ActionFieldWrite;
  126. }
  127. function getActionDept() {
  128. return Designer.ActionDept;
  129. }
  130. function loadPredefinedFlow() {
  131. openWin("flow_sel_predefined_frame.jsp?flowId=<%=flow_id%>", 640, 480);
  132. }
  133. function getFlowId() {
  134. return <%=flow_id%>;
  135. }
  136. function sel(id) {
  137. window.location.href = "flow_modify3.jsp?op=loadPredefinedFlow&preId=" + id + "&flowId=<%=flow_id%>";
  138. }
  139. </script>
  140. <table border="0" align="center" cellpadding="0" cellspacing="0" class="tableframe">
  141.   <tr>
  142.     <td height="23" class="right-title">&nbsp;&nbsp;修改流程</td>
  143.   </tr>
  144.   <tr>
  145.     <td valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
  146.         <tr>
  147.           <td align="center">
  148.     <OBJECT ID="Designer" CLASSID="CLSID:ADF8C3A0-8709-4EC6-A783-DD7BDFC299D7" codebase="<%=request.getContextPath()%>/activex/Designer.CAB" width=740 height=338>
  149.               <param name="Workflow" value="<%=flowString%>">
  150.               <param name="Mode" value="user"><!--debug user initiate complete-->
  151.               <param name="CurrentUser" value="<%=privilege.getUser(request)%>">
  152.   <param name="CurrentUserRealName" value="<%=ud.getRealName()%>">
  153.   <param name="CurrentJobCode" value="<%=pd.getCode()%>">
  154.   <param name="CurrentJobName" value="<%=pd.getName()%>">   
  155.             </OBJECT>          </td>
  156.         </tr>
  157.           <tr>
  158.             <td height="35" align="center">
  159. <%
  160. if (!isStarted) {
  161. WorkflowPredefineDb ftd = new WorkflowPredefineDb();
  162. String sql = "select id from flow_predefined where typeCode=" + StrUtil.sqlstr(wf.getTypeCode());
  163. java.util.Iterator ir = ftd.list(sql).iterator();
  164. com.redmoon.oa.flow.Directory dir = new com.redmoon.oa.flow.Directory();
  165. while (ir.hasNext()) {
  166. ftd = (WorkflowPredefineDb) ir.next();
  167. com.redmoon.oa.flow.Leaf lf = dir.getLeaf(ftd.getTypeCode());
  168. %>
  169.               <table width="100%"  border="0" cellpadding="5" cellspacing="0" class="p14">
  170.                 <tr>
  171.                   <td width="67%" height="31" bgcolor="#EAEAEA" ><%=ftd.getTitle()%></td>
  172.                   <td width="14%" bgcolor="#EAEAEA" ><%=ftd.isDefaultFlow()?"默认流程":""%></td>
  173.                   <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="预览" />
  174.                     &nbsp;&nbsp;
  175.                     <input name="button2" type="button" class="button1" onclick="sel('<%=ftd.getId()%>')" value="选择" /></td>
  176.                 </tr>
  177.               </table>
  178.      <% }
  179.  }%></td>
  180.           </tr>
  181.           <tr>
  182.   <form name=form1 action="flow_modify3_do.jsp" method=post onsubmit="form1_onsubmit()">
  183.             <td height="35" align="center">
  184.   <input type="hidden" name="returnBack" value="true" <%=returnBackChecked%> />
  185. <!--允许打回-->
  186. <%if (!isStarted) {%>
  187.   <input name="button" type="button" class="singleboarder" onclick="loadPredefinedFlow()" value="载入预定义流程" />
  188. <%}%>
  189.   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  190.   <input type=hidden name=flowstring>
  191. <input type=hidden name=flowId value="<%=flow_id%>">
  192. <%
  193. com.redmoon.oa.Config cfg = new com.redmoon.oa.Config();
  194. String canUserModifyFlowForm = cfg.get("canUserModifyFlowForm");
  195. if (canUserModifyFlowForm.equals("true")) {
  196. %>
  197. <input type=button class="singleboarder" onClick="window.location.href='flow_initiate2.jsp?op=edit&id=<%=wf.getDocId()%>&work=modify&flowId=<%=flow_id%>'" value="  上一步(修改表单)  ">
  198. <%}else{%>
  199. <!--<input type=button class="singleboarder" onClick="window.location.href='flow_initiate2_notmodifyform.jsp?op=edit&id=<%=wf.getDocId()%>&work=modify&flowId=<%=flow_id%>'" value="  上一步(添加附件)  ">-->
  200. <%}%>
  201. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  202. <input type=submit class="singleboarder" value="  完  成  "></td>
  203.   </form>
  204.           </tr>
  205.           
  206.     </table></td>
  207.   </tr>
  208. </table>