WorkflowRoute_Modify.jsp
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:15k
源码类别:

电子政务应用

开发平台:

Java

  1. <%
  2. /**
  3.  *  $ RCSfile: WorkflowRoute_Modify.jsp,v $
  4.  *  $ Revision: 1.0 $
  5.  *  $ Date: 2001/05/018 20:18:46 ,created by Shiyong Jian $
  6.  *  $ /mainctrl/template/modifyRoute $
  7.  *
  8.  *  This is the workflow template  modify page.
  9.  *  @author Copyright (c) May. 2001, by VisionNex  Technologies Inc., All Right Reversed.
  10.  */
  11. %>
  12. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  13. <%@ page import="com.vnex.intranet.workflow.pub.value.*" %>
  14. <%@ page import="com.vnex.intranet.system.loader.ConfigParaLoader"%> 
  15. <%@ page import="com.vnex.intranet.util.SubPathGenerater" %> 
  16. <%@ page import="com.vnex.intranet.upload.*"%> 
  17. <%@ page import="com.vnex.intranet.workflow.loader.*" %>
  18. <%@ page import="com.vnex.intranet.workflow.util.WorkFlowType" %>
  19. <%@ page import="com.vnex.intranet.util.FieldUtil" %>
  20. <%@ taglib uri="/vnex_workflow.tld" prefix="workflow" %>
  21. <%@ taglib uri="/vnex.tld" prefix="vnex" %>
  22. <jsp:useBean id="mySmartUpload" scope="page" class="com.vnex.intranet.upload.SmartUpload" /> 
  23. <jsp:useBean id="routeValueBean" scope="session" class="com.vnex.intranet.workflow.pub.value.RouteValueBean" />
  24. <jsp:useBean id="routeProxy" scope="Application" class="com.vnex.intranet.workflow.route.proxy.RouteProxyBean" />
  25. <jsp:useBean id="BusinessName" scope="session" class="com.vnex.intranet.pub.BusinessSession" />
  26. <jsp:useBean id="subtaskValueBean" scope="page" class="com.vnex.intranet.workflow.pub.value.SubTaskValueBean" />
  27. <jsp:setProperty name="subtaskValueBean" property="*" />
  28. <%@ include file= "/vnex/intranet/workflow/template/WorkflowRoute_Navibar_Head.jsp" %>
  29. <%
  30.      String attachURL = "";
  31.     if( Integer.parseInt( (String)session.getAttribute( "routeType") )== WorkFlowType.TEMPLATE_TYPE_PERSONAL )
  32.          attachURL = ConfigParaLoader.getParameter("personalTemplateAttachmentUrl");
  33.     if( Integer.parseInt( (String)session.getAttribute( "routeType") ) == WorkFlowType.TEMPLATE_TYPE_COMMON )    
  34.          attachURL = ConfigParaLoader.getParameter("commonTemplateAttachmentUrl");
  35.     String flag = request.getParameter("flag");
  36.     if( flag != null && flag.equals("modifyRoute") )
  37.     { 
  38.          int pathId = Integer.parseInt( request.getParameter( "routeId" ) );
  39.          routeValueBean = routeProxy.getRouteDetails( pathId );
  40.          session.setAttribute( "routeValueBean" , routeValueBean);
  41.         
  42.     }
  43.     if( flag != null && flag.equals("addSubtask") )
  44.     {
  45.         routeValueBean.addSubtask( subtaskValueBean );
  46.         session.setAttribute( "routeValueBean" , routeValueBean);
  47.     }
  48.     if( flag != null && flag.equals("modifySubtask") )
  49.     {
  50.         int subtaskId = Integer.parseInt(request.getParameter("subtaskId" ));
  51.         routeValueBean.setSubtask( subtaskId , subtaskValueBean );
  52.         session.setAttribute("routeValueBean",routeValueBean);      
  53.     }
  54. %>
  55. <%@ include file= "/vnex/intranet/workflow/util/routeFilesUpload.jsp" %>
  56. <HTML>
  57. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  58. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  59. <script language=JavaScript> 
  60. function uploadDoc(form)
  61. {      
  62.     form.action="/mainctrl/template/modifyRoute?type=1"; 
  63.    form.encoding="multipart/form-data"; 
  64.     form.submit();     
  65. function deleteDoc(form) 
  66. {      
  67.     if ( confirm("确定删除?") )
  68.       {
  69.          form.action="/mainctrl/template/modifyRoute?type=2"; 
  70.          form.submit();
  71.       }     
  72. function saveRoute( myform )
  73. {
  74.     if ( !checkRoute( myform.routeName.value , 'routeName')  )
  75.     {
  76.         myform.textValue.focus();
  77.         return false; 
  78.     }
  79.     if ( myform.workflowTypeId.value == '-1' ) 
  80.     {
  81.         alert('请选择工作流模板的类型!');
  82.         myform.workflowTypeId.focus();
  83.         return false;
  84.     }            
  85.     if ( !checkRoute( myform.description.value , 'description') )
  86.     {
  87.         myform.description.focus();
  88.         return false; 
  89.     }  
  90.              
  91.     if( !checkSequence( myform.stepNos ) )
  92.         return false;
  93.     
  94.     myform.action= "/mainctrl/template/saveModifyRoute?routeType=<%=routeType%>";
  95.     myform.submit();
  96. }
  97. function createSubtask( myform )
  98. {
  99.     myform.action="/mainctrl/template/createRouteSubtask?flag=routeModify&keepStepNo=true";
  100.     myform.submit();
  101. }
  102. function deleteSubtask( myform )
  103. {  
  104.     if ( !isChecked( document.forms[0].subtaskIds )  ) 
  105.     {
  106.         alert('请选择要删除的任务!');
  107.         return false;
  108.     } 
  109.     if ( confirm("确定删除?") )
  110.     {  
  111.       myform.action="/mainctrl/template/deleteRouteSubtask2?flag=deleteSubtask";
  112.       myform.submit();
  113.     }
  114. }
  115. function cancleCreate( myform )
  116. {
  117.    myform.action="/mainctrl/template/maintainRoute?routeType=<%=routeType%>";
  118.    myform.submit();
  119. function modifySubtask( myform, subId )
  120. {
  121.    myform.action="/mainctrl/template/modifyRouteSubtask?flag=routeModify"+"&subtaskId="+subId;
  122.    myform.submit();
  123. }
  124. </script> 
  125. </script>
  126. <script language="JavaScript" src="/vnex/util/validate.js"></script>
  127. <script language="JavaScript" src="/vnex/intranet/workflow/util/checkRoute.js"></script>
  128.  
  129. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  130. <DIV align=center>
  131.   <form name="form1" method="post"  >  
  132.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  133.       <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  134.     <TR> 
  135.         <TD colSpan=3 align="center">
  136.           <br>
  137.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  138.             <tr bgcolor="#fafafa"> 
  139.               <td bgcolor="#fafafa"> 
  140.                 <table class=title width="600" border="0" cellspacing="1" cellpadding="2">
  141.                   <tr> 
  142.                     <td colspan="2" height="15" bgcolor="#666666">
  143.                    <font class="strongw"><a href="/mainctrl/home/index">
  144.                     <font color="#FFFFFF">首页</font></a>&gt;&gt;
  145.                     <a href="<%=firstLevelLink%>"><font color="#FFFFFF"><%=firstLevelText%></font></a>&gt;&gt;
  146.                     <a href="<%=secondLevelLink%>"><font color="#FFFFFF"><%=secondLevelText%></font></a>&gt;&gt;
  147.                     <font color="#fafafa">修改工作流模板</font>
  148.                       </td>
  149.                   </tr>
  150.                   <tr> 
  151.                     <td width="100" bgcolor="#e0e0e0"> <font class="strong" >&nbsp;工作流标题:</font> 
  152.                     </td>
  153.                     <td width="456" bgcolor="#e0e0e0"> 
  154.                       <input type="text" name="routeName" value="<%=FieldUtil.filterQuotTag( routeValueBean.getRouteName() ) %>" size="24" class="file">&nbsp;*&nbsp;(注:带*为必填内容)</td>    
  155.                   </tr>
  156.                   <tr bgcolor="#fafafa"> 
  157.                     <td width="100"> <font  class="strong">&nbsp;类型: </font></td>
  158.                     <td width="456"> 
  159.                       <select name="workflowTypeId">
  160.                       <option value="-1" > 请选择</option> 
  161.                          <% 
  162.                          int typeId = routeValueBean.getWorkflowTypeId();
  163.                          Hashtable hash = WorkflowLoader.getAllWorkflowType();
  164.                          Enumeration enum = hash.keys();
  165.                          if(enum != null)
  166.                          {
  167.                             while(enum.hasMoreElements())
  168.                             {
  169.                                 String key = (String)enum.nextElement();
  170.                                 String s = (String)hash.get(key);
  171.                                 if( Integer.parseInt( key ) == WorkFlowType.CONFERENCE )
  172.                                     continue;
  173.                          %>
  174.                              <option value="<%= key%>" <% if ( typeId == Integer.parseInt( key ) ) out.println("selected"); %>><%= s%> 
  175.                          <%}}%>
  176.                       </select>&nbsp;*
  177.                     </td>
  178.                   </tr>
  179.                   <tr bgcolor="#e0e0e0"> 
  180.                     <td width="100"> <font  class="strong">&nbsp;创建人: </font> 
  181.                     </td>
  182.                     <td width="456"><%= FieldUtil.filterScriptTag( BusinessName.getEmpName() ) %> </td>
  183.                   </tr>
  184.                   <tr bgcolor="#fafafa"> 
  185.                     <td width="100" > <font  class="strong">&nbsp;创建时间: </font> 
  186.                     </td>
  187.                     <td width="456"><script language="javascript">
  188.                         AfineDate=new Date();
  189.                         Month=AfineDate.getMonth()+1;
  190.                         document.write ( AfineDate.getYear()+"-"+Month+"-"+AfineDate.getDate() );
  191.                       </script>
  192.                       </td>
  193.                   </tr>
  194.                   <tr bgcolor="#fafafa"> 
  195.                     <td width="100" bgcolor="#e0e0e0"><font  class="strong">&nbsp;工作流描述: 
  196.                       </font></td>
  197.                     <td width="456" bgcolor="#e0e0e0"> 
  198.                       <textarea name="description" cols="59" rows="5"><%=FieldUtil.filterQuotTag( routeValueBean.getDescription() ) %></textarea>
  199.                     </td>
  200.                   </tr>
  201.                   <tr bgcolor="#fafafa"> 
  202.                     <td rowspan="2"><font  class="strong">&nbsp;上传附件:</font></td>
  203.                     <td rowspan="2"> 
  204.                       <select size="5" name="attachments" style="width:300" class="text">                      
  205.                         <workflow:fileList collection="<%=routeValueBean.getRouteFiles()%>"> 
  206.                         <workflow:items> 
  207.                         <option value="<workflow:fileAttribute attribute='workflowfile_title' />" > 
  208.                         <workflow:fileAttribute attribute="workflowfile_name"/> 
  209.                         </option>
  210.                         </workflow:items>
  211.                         </workflow:fileList> 
  212.                       </select>
  213.                       &nbsp;&nbsp;<input type="button" name="delete" value="删除" class="file" onClick="deleteDoc( this.form )">
  214.                       <input type="file" name="file" class="file" size="24">
  215.                       &nbsp;&nbsp;<input type="button" name="post" value="上传" class="file" onClick="uploadDoc( this.form )">
  216.                     </td>
  217.                   </tr>
  218.                   <tr bgcolor="#e0e0e0"> </tr>
  219.                   <!-- 6-28 modify begin --> 
  220.                   <tr bgcolor="#e0e0e0"> 
  221.                     <td colspan =3 ><font  class="strong">&nbsp;子任务:</font>&nbsp;* </td>
  222.                   </tr>
  223.                 </table>
  224.                 <table border="0" cellspacing="1" cellpadding="2" width="600" bgcolor="#e0e0e0" class=title>
  225.                   <tr class="table_row_title"> 
  226.                     <td colspan="5" height="30" bgcolor="#fafafa">
  227.                       &nbsp;&nbsp;<input type="button" name="newSubtask" style="width:70px" value="新建子任务" class="file" onClick="createSubtask( this.form )" >&nbsp;&nbsp;
  228.                       <input type="button" name="delete" value="删除" class="file" onClick="deleteSubtask( this.form )">
  229.                     </td>
  230.                   </tr>
  231.                   <tr class="table_row_title"> 
  232.                     <td align="center" width="7%"><font  class="strong">选择</font> </td>
  233.                     <td width="14%" align="center" nowrap><font  class="strong">顺序</font></td>
  234.                     <td width="33%" align="center" nowrap><font  class="strong">名称</font></td>
  235.                     <td width="27%" align="center" nowrap><font  class="strong">执行者</font></td>
  236.                     <td width="19%" align="center" nowrap><font  class="strong">子任务类型</font></td>
  237.                   </tr>  
  238.                   
  239.                    <workflow:subtaskList routevalue="<%=routeValueBean %>"> 
  240.                       <% 
  241.                          int subtaskNum = routeValueBean.getSubtaskNum(); 
  242.                          int jj = 0;   
  243.                       %>
  244.                      <workflow:items>                             
  245.                   <tr bgcolor="<vnex:itemsColor />"> 
  246.                     <td align="center" width="7%"> 
  247.                       <input type="checkbox" name="subtaskIds" value="<workflow:subtaskAttribute attribute='subtask_id' />">
  248.                     </td>
  249.                     <td width="14%" align="center"> 
  250.                       <select name="stepNos">
  251.                       <workflow:subtaskAttribute attribute="subtask_stepNo"/>
  252.                       <%   jj = 0;
  253.                            String stepNo= (String)pageContext.getAttribute("stepNo");
  254.                            int  num = Integer.parseInt( stepNo );
  255.                            for( int i= 1 ; i <= subtaskNum ; i++ ) 
  256.                            {    
  257.                       %>
  258.                       <option value="<%=i%>"
  259.                       <%   if( i == num )
  260.                            {
  261.                               jj++;
  262.                          %>  selected 
  263.                          <%}                             
  264.                          %>
  265.                         > <%=i%>
  266.                         </option>
  267.                         <% 
  268.                            }
  269.                            if( jj == 0 ) 
  270.                            {        
  271.                         %> 
  272.                            <option value="<%=num%>" selected ><%=num%></option>
  273.                         <% 
  274.                            }                                     
  275.                         %> 
  276.                       </select>
  277.                     </td>
  278.                     <td width="33%" align="center">
  279.                     
  280.                     <a onClick=" modifySubtask(  document.forms[0], '<%=pageContext.getAttribute("subId")%>');return false;" href="#" >
  281.                        <workflow:subtaskAttribute attribute="subtask_name" />
  282.                        </a></td>
  283.                     <td width="27%" > 
  284.                       <div align="center"><workflow:subtaskAttribute attribute="executor_names" /> </div>
  285.                     </td>
  286.                     <td width="19%"> 
  287.                       <div align="center"><workflow:subtaskAttribute attribute="subtask_type" /> </div>
  288.                     </td>
  289.                   </tr>                  
  290.                   
  291.                    </workflow:items>
  292.                    
  293.                    <tr bgcolor="#e0e0e0"> 
  294.                     <td align="center" width="7%"> 
  295.                       <input type="checkbox" name="myAll" onClick="checkAll(this.form.subtaskIds, this.form.myAll)">
  296.                     </td>
  297.                     <td colspan="4" >全选</td>
  298.                   </tr> 
  299.                    </workflow:subtaskList>        
  300.                 </table>
  301.                 <table width="600" border="0" cellspacing="0" cellpadding="0">
  302.                   <tr align="center"> 
  303.                     <td height="30">   
  304.                       <input type="button" name="save" value="保存" class="file" onClick=" saveRoute( this.form )" >&nbsp;&nbsp;
  305.                       <input type="button" name="cut" value="放弃" class="file" onClick=" cancleCreate( this.form )" >
  306.                     </td>
  307.                   </tr>
  308.                 </table>
  309.               </td>
  310.             </tr>
  311.           </table>
  312. <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  313. </TD>
  314.     </TR>
  315.     <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  316.     </TABLE>
  317.   <BR>
  318.    <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  319. </form></DIV>
  320. </BODY></HTML>