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