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

电子政务应用

开发平台:

Java

  1. <%@ taglib uri="/vnex.tld" prefix="vnex" %>
  2. <%@ taglib uri="/vnex_workflow.tld" prefix="vnex_workflow" %>
  3. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  4. <%@ page import="java.util.*" %>
  5. <%@ page import="com.vnex.intranet.util.TimeStamp" %>
  6. <%@ page import="com.vnex.intranet.workflow.document.value.*" %>
  7. <%@ page import="com.vnex.intranet.workflow.util.*" %>
  8. <%@ page import="com.vnex.intranet.workflow.pub.value.WorkflowFileValueBean" %>
  9. <%@ page import="com.vnex.intranet.workflow.pub.value.SubTaskValueBean" %>
  10. <%@ page import="com.vnex.intranet.workflow.loader.WorkflowLoader" %>
  11. <%@ page import="com.vnex.intranet.util.*"%>
  12. <%@ page import="com.vnex.intranet.system.loader.ConfigParaLoader"%>
  13. <%@ page import="com.vnex.intranet.util.FieldUtil" %> 
  14. <jsp:useBean id="BusinessName" scope="session" class="com.vnex.intranet.pub.BusinessSession" />
  15. <jsp:useBean id="dsvb" scope="session" class="com.vnex.intranet.workflow.document.value.DocumentSendValueBean"/>
  16. <jsp:useBean id="routeInfo" scope="session" class="com.vnex.intranet.workflow.pub.value.RouteValueBean" />
  17. <%  
  18.     // this attribute used by FileAttributeTag.java to change encode of chinese file name to view.
  19.     pageContext.setAttribute("encodeFlag" , "false");
  20.     if( request.getParameter("type") == null )
  21.     {        
  22.         dsvb = ( DocumentSendValueBean )session.getAttribute( "document" );
  23.         String root = ConfigParaLoader.getParameter("rootUrl");
  24.     String attachURL =  ConfigParaLoader.getParameter("documentAttachmentUrl");
  25.     
  26.         Collection files = dsvb.getFiles();
  27.         Iterator c = files.iterator();       
  28.         while( c.hasNext() )
  29.         {
  30.             WorkflowFileValueBean wf = ( WorkflowFileValueBean )c.next();
  31.             String ff = wf.getTitle();
  32.             String sTitle = SubPathGenerater.copyFile( root + SubPathGenerater.getSeperator() + ff, SubPathGenerater.getSeperator() + root + SubPathGenerater.getSeperator() + attachURL );
  33.             wf.setTitle( attachURL + "/" + sTitle );                            
  34.         } 
  35.         dsvb.setFiles( files );          
  36.     }  
  37.     if( request.getParameter("type") !=null && Integer.parseInt( request.getParameter("type") ) == 1 ) //上传文件
  38.     {           
  39. %>
  40. <vnex_workflow:docfileupload />     
  41. <% dsvb = ( DocumentSendValueBean )session.getAttribute( "document" ); 
  42.    }
  43.    if( request.getParameter("type") !=null && Integer.parseInt( request.getParameter("type") ) == 2 ) //Delete文件
  44.    {          
  45. %>
  46. <vnex_workflow:docfileremove />     
  47. <%
  48.         dsvb = ( DocumentSendValueBean )session.getAttribute( "document" ); 
  49.     }      
  50.          
  51.     routeInfo = dsvb.getRoute();
  52.     ArrayList subtasks = routeInfo.getSubtaskList();
  53. %>
  54. <jsp:include page="/vnex/head.jsp"/>
  55. <script language="JavaScript" src="/vnex/util/validate.js"></script>
  56. <script language=JavaScript>
  57.  
  58. function createDoc( form, type )
  59. {
  60.    if(checkIt(form))
  61.    {
  62.       checkAll(document.forms[0].attachments);
  63.       form.action="/mainctrl/office/document/sentcreateok?type=" + type;
  64.       form.submit();
  65.    }   
  66. }
  67. function uploadDoc(form)
  68. {      
  69.     form.action="/mainctrl/office/document/sentcreate?type=1";
  70.     form.encoding="multipart/form-data";
  71.     form.submit();     
  72. }
  73. function deleteDoc(form)
  74. {      
  75.     form.action="/mainctrl/office/document/sentcreate?type=2";    
  76.     form.submit();     
  77. }
  78. function saveRoute(form)
  79. {      
  80.     if( checkSequence( form.stepNos ) )
  81.     { 
  82.         form.action="/mainctrl/office/document/routepersonalcreate";    
  83.         form.submit();   
  84.     }  
  85. }
  86. function checkIt(form)
  87. {
  88.    if(isEmpty(stripWhitespace(form.title.value)))
  89.    {
  90.       alert("请输入发文标题");
  91.       form.title.focus();
  92.       return false;
  93.    }
  94.    if( form.title.value.length >64 )
  95.    {
  96.       alert("发文标题长度不能超过64位.");
  97.       form.title.focus();
  98.       return false;
  99.    }  
  100.    
  101.    if( form.description.value.length >400 )
  102.    {
  103.       alert("发文内容的长度不能超过400位.");
  104.       form.description.focus();
  105.       return false;
  106.    } 
  107.    if( form.keyword.value.length >400 )
  108.    {
  109.       alert("发文关键字的长度不能超过400位.");
  110.       form.keyword.focus();
  111.       return false;
  112.    } 
  113.    
  114.    return checkSequence( form.stepNos ); 
  115.       
  116.    return true;
  117. }  
  118. function checkAll( selObj )
  119. {
  120.     for ( var i = 0; i < selObj.options.length; i++ )
  121.        selObj.options[i].selected = true;
  122. }
  123. function addSub( form )
  124. {
  125.     form.action="/mainctrl/office/document/sentsubtaskcreate?isDocCreate=docCreate";
  126.     form.submit();   
  127. }
  128. function deleteSub( myform )
  129. {
  130.    if( confirm( "确定要删除选择的子任务?" ) )
  131.    {  
  132.        myform.action="/mainctrl/office/document/sentsubtaskdelete?isDocCreate=docCreate";
  133.        myform.submit();
  134.    }
  135. }
  136. function modifySubtask(form,id)
  137. {   
  138.    form.action="/mainctrl/office/document/sentsubtaskmodify?subtaskId="+id+"&isDocCreate=docCreate";
  139.    form.submit();      
  140. }
  141. function openAttach( mSelObj )
  142. {    
  143.     for( var i = 0; i < mSelObj.options.length; i++ )
  144.     {
  145.        var oriLen = mSelObj.options.length;
  146.        if ( mSelObj.options[i].selected )
  147.        {
  148.            var eid = mSelObj.options[i].value;
  149.            window.open( "/" + eid );
  150.        }
  151.     }
  152. }
  153. </script>
  154. <script language="JavaScript" src="/vnex/intranet/workflow/util/checkRoute.js"></script>
  155. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  156. <HTML>
  157. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  158. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  159. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
  160. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  161. <SCRIPT>
  162. window.onload=init
  163. </SCRIPT>
  164. <DIV align=center>
  165.   <form name="myform" method="post" >
  166.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  167.      <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  168.     <TR> 
  169.         <TD colSpan=3 align="center">
  170.           <br><!--个人信息开始 -->
  171.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  172.             <tr bgcolor="#fafafa"> 
  173.               <td bgcolor="#fafafa"> 
  174.                 <table class=title width="600" border="0" cellspacing="1" cellpadding="2">
  175.                   <tr bgcolor="#666666" > 
  176.                     <td colspan="2" height="15"><font class="strongw"><a href="/mainctrl/system/main"><font color="#FFFFFF">首页</font></a>&gt;&gt;<a href="/mainctrl/office/main"><font color="#FFFFFF">办公室管理</font></a>&gt;&gt;<a href="/mainctrl/office/document/sentlist"><font color="#FFFFFF">发文管理</font></a>&gt;&gt;新建发文 
  177.                       </font></td>
  178.                   </tr>
  179.                   <tr> 
  180.                     <td width="100" bgcolor="#e0e0e0"> <font class="strong">&nbsp;标题:</font> 
  181.                     </td>
  182.                     <td width="456" bgcolor="#e0e0e0"> 
  183.                       <input type="text" name="title" size="24" class="file" value="<%= FieldUtil.filterQuotTag( dsvb.getTitle() ) %>">
  184.                       * (注:带*为必填内容)</td>
  185.                   </tr>
  186.                   <tr bgcolor="#ffffff"> 
  187.                     <td width="100"> <font  class="strong">&nbsp;紧急程度:</font> </td>
  188.                     <td width="456"> 
  189.                       <select name="instancyType">
  190.                         <%
  191.                             Iterator itypes = InstancyType.getAvailableInstancyTypes().iterator();
  192.                             while ( itypes.hasNext() )
  193.                             {
  194.                                InstancyType itype = ( InstancyType )itypes.next();
  195.                          %>
  196.                          <option value="<%= itype.getId() %>" <% if( dsvb.getInstancyType()!= null && itype.getId()==dsvb.getInstancyType().getId() ) out.print("selected"); %>>
  197.                          <%= itype.getName() %></option>
  198.                          <%
  199.                             }                            
  200.                          %>
  201.                       </select>
  202.                     </td>
  203.                   </tr>
  204.                   <tr> 
  205.                     <td width="100" bgcolor="#e0e0e0"> <font  class="strong">&nbsp;秘密等级:</font> </td>
  206.                     <td width="456" bgcolor="#e0e0e0"> 
  207.                       <select name="securityType">
  208.                        <%
  209.                              Iterator types = SecurityType.getAvailableSecurityTypes().iterator();
  210.                              while ( types.hasNext() )
  211.                              {
  212.                                  SecurityType rtype = ( SecurityType )types.next();
  213.                        %>
  214.                        <option value="<%= rtype.getId() %>" <% if ( dsvb.getSecurityType()!= null && rtype.getId()==dsvb.getSecurityType().getId() ) out.print("selected"); %>>
  215.                        <%= rtype.getName() %></option>
  216.                        <%
  217.                             }                              
  218.                        %>
  219.                       </select>
  220.                     </td>
  221.                   </tr>
  222.                   <tr bgcolor="#fafafa"> 
  223.                     <td width="100"><font class="strong">&nbsp;主题词: </font></td>
  224.                     <td width="456"> 
  225.                       <input type="text" name="keyword" size="24" class="file" value="<%= FieldUtil.filterQuotTag( dsvb.getKeyword() ) %>">
  226.                     </td>
  227.                   </tr>
  228.                   <tr bgcolor="#e0e0e0"> 
  229.                     <td width="100"><font class="strong">&nbsp;发件摘要:</font></td>
  230.                     <td width="456"> 
  231.                       <textarea name="description" cols="59" rows="5"><%= FieldUtil.filterQuotTag( dsvb.getDescription() ) %></textarea>
  232.                     </td>
  233.                   </tr>
  234.                   <tr bgcolor="#fafafa"> 
  235.                     <td rowspan="2"><font  class="strong">&nbsp;上传附件:<br>(注:点击附件名称查看附件内容)</font></td>
  236.                     <td rowspan="2"> 
  237.                       <!--select name="attachments" size="4" multiple style="width:350" onChange="openAttach( document.forms[0].attachments )"-->
  238.                       <select name="attachments" size="4" multiple style="width:350"  >
  239.                           <vnex_workflow:fileList collection="<%= dsvb.getFiles()%>">          
  240.                           <vnex:items>                             
  241.                             <option value = "<vnex_workflow:fileAttribute attribute="workflowfile_Title"/>">
  242.                             <vnex_workflow:fileAttribute attribute="workflowfile_name"/></option>                                         
  243.                           </vnex:items> 
  244.                           </vnex_workflow:fileList>  
  245.                       </select>&nbsp;
  246.                       <input type="button" name="Submit222" value="删除" class="file" onClick="deleteDoc( this.form )">
  247.                       <input type="file" name="file" class="file" size="24">&nbsp;
  248.                       <input type="button" name="Submit22" value="上传" class="file" onClick="uploadDoc( this.form )">
  249.                     </td>
  250.                   </tr>
  251.                   <tr bgcolor="#e0e0e0"> </tr>
  252.                   <!-- 6-28 modify begin --> 
  253.                   <tr bgcolor="#e0e0e0"> 
  254.                     <td colspan =4 ><font  class="strong">&nbsp;发文路径:</font> </td>
  255.                   </tr>
  256.                 </table>
  257.                 <table border="0" cellspacing="1" cellpadding="2" class=title width="600">
  258.                   <tr class="table_row_title"> 
  259.                     <td colspan="6" height="30" bgcolor="#fafafa">&nbsp; 
  260.                       <input type="button" name="Submit3" style="width:70px" value="新建子任务" class="file" onClick="addSub( this.form )">&nbsp;&nbsp;
  261.                       <input type="reset" name="Submit23" value="删除" class="file" onClick="deleteSub( this.form )">
  262.                     </td>
  263.                   </tr>
  264.                   <tr class="table_row_title"> 
  265.                     <td align="center" width="42"><font  class="strong">选择</font> 
  266.                     </td>
  267.                     <td align="center" nowrap width="7%"><font  class="strong">顺序</font></td>
  268.                     <td align="center" nowrap width="112"><font  class="strong">子任务名称</font></td>
  269.                     <td align="center" nowrap width="109"><font  class="strong">执行者</font></td>
  270.                     <td align="center" nowrap width="104"><font  class="strong">子任务类型</font></td>
  271.                     <td align="center" nowrap width="93"><font  class="strong">截止时间</font></td>
  272.                   </tr>
  273. <%
  274.     for( int i = 0; i < subtasks.size(); i++ )
  275.     {
  276.         SubTaskValueBean sub = ( SubTaskValueBean )subtasks.get(i);   
  277.         int jj = 0;                
  278.         if( i%2 == 0) 
  279.         {             
  280. %>
  281.           <tr bgcolor="#fafafa" align="center"> 
  282. <%}else{
  283. %>
  284.           <tr bgcolor="#e0e0e0" align="center"> 
  285. <%}
  286. %>
  287.           <td align="center" width="42"> 
  288.              <input type="checkbox" name="subId" value="<%=sub.getSubtaskId() %>">
  289.           </td>
  290.           <td width="103" align="center"> 
  291.             <select name="stepNos"> 
  292. <%          for( int j = 0; j < subtasks.size(); j++ )
  293.             { 
  294. %>       
  295.               <option value="<%=j+1%>" 
  296.                 <%if( sub.getSubStepNo() == j+1 ) {%>
  297.               selected
  298.               <%jj++;}%>
  299.               ><%=j+1%></option>       
  300. <%    
  301.            }
  302.            if( jj == 0 ) 
  303.            {        
  304. %> 
  305.            <option value="<%=sub.getSubStepNo()%>" selected ><%=sub.getSubStepNo()%></option>
  306. <% 
  307.            }                                     
  308. %>           
  309.           </select></td>
  310.           <td width="112" align="center">
  311.             <a onclick="modifySubtask(myform,'<%= sub.getSubtaskId() %>');return false;"  href="#"><%= sub.getSubTitle() %></a>
  312.           </td>
  313.           <td width="109" align="center">
  314.              <div align="center"><%=sub.getSubExecutorName() %></div>
  315.           </td>
  316.           <td width="104" align="center"> 
  317.              <div align="center"><%= WorkflowLoader.getSubtaskType( sub.getSubTypeId() ) %></div>
  318.           </td>
  319.           <td width="93" align="center"> 
  320.               <div align="center"><%= sub.getSubPlanEndTimeS() %></div>
  321.           </td>                         
  322.          </tr>
  323. <%       
  324.    }
  325.    if( subtasks.size() > 0 )
  326.    {
  327. %>  
  328.          <tr bgcolor="#e0e0e0"> 
  329.           <td align="center" width="42"> 
  330.             <input type="checkbox" name="C1" value="ON" onClick="SelectAll( this.form )">
  331.           </td>
  332.           <td colspan="5" >&nbsp;&nbsp;全选</td>
  333.          </tr>
  334. <% }
  335. %>           
  336.         </table>
  337.                 <table width="600" border="0" cellspacing="0" cellpadding="0">
  338.                   <tr align="center"> 
  339.                     <td height="30"> 
  340.                       <input type="button" name="Submit" value="保存" class="file" onClick="createDoc(this.form, 'false')">&nbsp;&nbsp;
  341.                       <input type="button" style="width:70px" name="Submit" value="保存并发布" class="file" onClick="createDoc( this.form, 'true')">&nbsp;&nbsp;
  342.                       <input type="button" style="width:85px" name="Submit" value="存为个人模板" class="file" onClick="saveRoute(this.form)">&nbsp;&nbsp;
  343.                       <input type="button" name="Submit2" value="放弃" class="file" onClick="location='/mainctrl/office/document/sentlist'">
  344.                     </td>
  345.                   </tr>
  346.                 </table>
  347.               </td>
  348.             </tr>
  349.           </table>
  350. <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  351. </TD>
  352.     </TR>
  353.     <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  354.     </TABLE>
  355.   <BR>
  356.    <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  357. </form></DIV>
  358. </BODY></HTML>