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

电子政务应用

开发平台:

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