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

电子政务应用

开发平台:

Java

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