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