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

电子政务应用

开发平台:

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.*" %>
  6. <%@ page import="com.vnex.intranet.system.loader.*"%> 
  7. <%@ page import="com.vnex.intranet.upload.*"%> 
  8. <%@ page import="com.vnex.intranet.workflow.pub.value.*"%>
  9. <%@ page import="com.vnex.intranet.workflow.util.*"%>
  10. <%@ page import="com.vnex.intranet.workflow.projectmanagement.value.PmValueBean"%>
  11. <%@ page import="com.vnex.intranet.workflow.loader.WorkflowLoader" %>
  12. <jsp:useBean id="mySmartUpload" scope="page" class="com.vnex.intranet.upload.SmartUpload" />
  13. <jsp:useBean id="pvb" scope="session" class="com.vnex.intranet.workflow.projectmanagement.value.PmValueBean"/>
  14. <jsp:useBean id="routeValueBean" scope="page" class="com.vnex.intranet.workflow.pub.value.RouteValueBean"/>
  15. <jsp:useBean id="pmProxy" scope="application" class="com.vnex.intranet.workflow.projectmanagement.proxy.PmProxyBean" />
  16. <jsp:useBean id="BusinessName" scope="session" class="com.vnex.intranet.pub.BusinessSession" />
  17. <%
  18.     
  19.     // this attribute used by FileAttributeTag to change encode of chinese file name to view.
  20.     pageContext.setAttribute("encodeFlag" , "false");
  21.     
  22.     String current = new java.sql.Date(System.currentTimeMillis()).toString();         
  23.     if( request.getParameter("type") == null && request.getParameter("comeback") == null )
  24.     {
  25.         pvb = pmProxy.getProjectDetail(Integer.parseInt(request.getParameter("workflowId")));    
  26.         session.setAttribute("pvb",pvb);
  27.     }
  28.     pvb = ( PmValueBean )session.getAttribute( "pvb" );
  29.     
  30.     int workflowId = pvb.getWorkflowId();
  31.     routeValueBean = pvb.getRoute();   
  32.     ArrayList subtasks = routeValueBean.getSubtaskList();    
  33. %>
  34. <%@ include file= "project_create_upload.jsp" %>
  35. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  36. <HTML>
  37. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  38. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  39. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_person.js"></script>
  40. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  41. <script Language="JavaScript" src="/vnex/intranet/calendar/Popup.js"></script>
  42. <script language="JavaScript" src="/vnex/util/validate.js"></script>
  43. <script language="JavaScript" src="/vnex/intranet/workflow/util/checkRoute.js"></script>
  44. <script language=JavaScript>
  45. function checkIt(form)
  46. {   
  47.    if ( !stripWhitespace(form.title.value) || isEmpty(form.title.value) )
  48.    {
  49.       alert("请输入项目标题");
  50.       return false;
  51.    }
  52.    if(form.title.value.length>100)
  53.    {
  54.       alert("项目标题过长,最多100字");
  55.       return false;
  56.    }  
  57.    if(form.description.value.length>500)
  58.    {
  59.       alert("项目描述过长,最多500字");
  60.       return false;
  61.    } 
  62.    if( !isEmpty(form.planBeginDateS.value) )
  63.    {            
  64.       if(!isVNEXDate(form.planBeginDateS.value))
  65.       {
  66.         alert("计划开始日期非法");
  67.         return false;
  68.       }  
  69.       if( "<%=current%>" > form.planBeginDateS.value)
  70.       {
  71.         alert("计划开始日期必须在本日之后");
  72.         return false;
  73.       }
  74.    } 
  75.    if( !isEmpty(form.planEndDateS.value) )
  76.    {            
  77.       if(!isVNEXDate(form.planEndDateS.value))
  78.       {
  79.         alert("计划结束日期非法");
  80.         return false;
  81.       }      
  82.       if("<%=current%>" > form.planEndDateS.value)
  83.       {
  84.         alert("计划结束日期必须在本日之后");
  85.         return false;
  86.       }
  87.    }     
  88.    if( !isEmpty(form.planEndDateS.value) && !isEmpty(form.planBeginDateS.value) )
  89.    {         
  90.       if(form.planBeginDateS.value > form.planEndDateS.value)
  91.       {
  92.         alert("计划结束日期必须在计划开始日期之后");
  93.         return false;
  94.       }
  95.    }  
  96.    if( !checkSequence( form.stepNos ) )
  97.    {
  98.       return false;   
  99.    }
  100.    
  101.    return true;
  102. }
  103. function modifyProjectSuccess(form, type)
  104. {
  105.    if(checkIt(form))
  106.    {
  107.       checkAll( document.forms[0].attachments );
  108.       form.action="/mainctrl/projectmanagement/modifyprojectsuccess?type=" + type;
  109.       form.submit();
  110.    }
  111. }
  112. function saveTemplate(form)
  113. {      
  114.     if(checkIt(form))
  115.     {
  116.         form.action="/mainctrl/projectmanagement/createtemplate";    
  117.         form.submit();     
  118.     }
  119. }
  120. function deleteProject(form)
  121. {
  122.     if( confirm( "确定要删除该项目?" ) )
  123.     { 
  124.         form.action="/mainctrl/projectmanagement/deleteproject";
  125.         form.submit();
  126.     }
  127. }
  128. function startProject(form)
  129. {
  130.    form.action="/mainctrl/projectmanagement/startproject";
  131.    form.submit();      
  132. }
  133. function uploadDoc(form)
  134. {          
  135.     form.action="/mainctrl/projectmanagement/modifyproject?type=1";
  136.     form.encoding="multipart/form-data";
  137.     form.submit();         
  138. }
  139. function deleteDoc(form)
  140. {          
  141.     form.action="/mainctrl/projectmanagement/modifyproject?type=2";    
  142.     form.submit();         
  143. }
  144. function checkAll( selObj )
  145. {
  146.     for ( var i = 0; i < selObj.options.length; i++ )
  147.        selObj.options[i].selected = true;
  148. }
  149. function SelectAll(form)
  150. {
  151.   for (var i=0;i<form.elements.length;i++)
  152.   {
  153.     var e = form.elements[i];
  154.     if (e.name != 'C1')
  155.        e.checked = form.C1.checked;
  156.   }
  157. }
  158. function openTemplateWin()
  159. {
  160.     window.open("/mainctrl/projectmanagement/createtemplate","win","titlebar=no,toolbar=no,Width=700,height=300");
  161. }
  162. function submitForm(act)
  163.     myform = document.forms[0];
  164.     var subtaskId = myform.subtaskList.value;
  165.     if ( act == 'addBefore' )
  166.     {
  167.         if ( !checkSelected() )  return false;
  168.         if ( ! noMultiSelect() ) return false;
  169.         myform.action= '/mainctrl/projectmanagement/addsubtask?workflowId=<%=workflowId%>&flag=addBeforeSubtask&subtaskId='+subtaskId;
  170.         myform.submit();
  171.     }
  172.     if ( act == 'addAfter' )
  173.     {
  174.           if ( !checkSelected() )  return false;
  175.           if ( ! noMultiSelect() ) return false;
  176.          myform.action= '/mainctrl/projectmanagement/addsubtask?workflowId=<%=workflowId%>&flag=addAfterSubtask&subtaskId='+subtaskId;
  177.          myform.submit();
  178.     } 
  179.     if ( act == 'Edit' )
  180.     {  
  181.         if ( !checkSelected() )  return false;
  182.         if ( ! noMultiSelect() ) return false;
  183.         myform.action= '/mainctrl/projectmanagement/updatesubtask?workflowId=<%=workflowId%>&flag=updateSubtask&subtaskId='+subtaskId;                                                  
  184.         myform.submit();
  185.     } 
  186.     if ( act == 'Delete' ) 
  187.     {
  188.         if ( !checkSelected() )  return false;
  189.         if ( !onlyOne() ) return false;
  190.         myform.action= '/mainctrl/projectmanagement/sortsubtask?workflowId=<%=workflowId%>&flag=deleteSubtask&subtaskId='+subtaskId;
  191.         myform.submit();
  192.     }
  193.     if( act == 'sort' )
  194.     {   
  195.         selectAll(myform.subtaskList);
  196.         if ( myform.subtaskList.value == '' )
  197.         {
  198.            alert('无子任务!');
  199.            return false;
  200.         }
  201.         if ( !onlyOne() ) return false;
  202.         myform.action="/mainctrl/projectmanagement/sortsubtask?workflowId=<%=workflowId%>&flag=sortSubtask";
  203.         myform.submit();
  204.     }
  205.  }
  206.  function addSub( form )
  207.  {
  208.     form.action="/mainctrl/projectmanagement/subtaskcreate?flag=docModify";
  209.     form.submit();   
  210.  }
  211.  function deleteSub( myform )
  212.  {
  213.     if ( !myform.subId ) 
  214.     {
  215.         alert('没有要删除的子任务!');
  216.         return false;
  217.     } 
  218.     if ( !isChecked( myform.subId )  ) 
  219.     {
  220.         alert('请选择要删除的任务!');
  221.         return false;
  222.     }
  223.     if( confirm( "确定要删除选择的子任务?" ) )
  224.     {  
  225.        myform.action="/mainctrl/projectmanagement/subtaskdelete?flag=docModify";
  226.        myform.submit();
  227.     }
  228.  }
  229.  
  230.  function modifySubtask(form,id)
  231.  {   
  232.    form.action="/mainctrl/projectmanagement/subtaskmodify?subtaskId="+id+"&isDocCreate=docModify&flag=docModify";
  233.    form.submit();      
  234.  }
  235. </script> 
  236. <DIV align=center>
  237.   <form name="myform" method="post" >
  238.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  239.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  240.     <TR> 
  241.         <TD colSpan=3 align="center">
  242.           <br><!--个人信息开始 -->
  243.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  244.             <tr bgcolor="#fafafa"> 
  245.               <td bgcolor="#fafafa"> 
  246.                 <table class=title width="600" border="0" cellspacing="1" cellpadding="2">
  247.                   <tr> 
  248.                     <td colspan="2" height="15" bgcolor="#666666">&nbsp;<font class="strongw"><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/projectmanagement/projectlist"><font color="#FFFFFF">工程项目管理</font></a>&gt;&gt;<font color="#FFFFFF">修改项目内容</font>
  249.                       </font></td>
  250.                   </tr>
  251.                   <tr  bgcolor="#e0e0e0"> 
  252.                     <td width="100"> <font class="strong" >&nbsp;项目名称:</font> </td>
  253.                     <td width="456"> 
  254.                       <input type="hidden" name="workflowId" value= "<%= pvb.getWorkflowId() %>">
  255.                       <input type="text" name="title" value="<%= FieldUtil.filterQuotTag(FieldUtil.filterScriptTag(pvb.getTitle())) %>" class="file">
  256.                       *(注:带*的为必填内容)</td>
  257.                   </tr>
  258.                    <tr bgcolor="#fafafa"> 
  259.                     <td width="100"><font class="strong">&nbsp;计划开始时间:</font></td>
  260.                     <td width="456"> 
  261.                       <input type="text" name="planBeginDateS" readonly size="24" class="file" value="<%= pvb.getPlanBeginDateS() %>">
  262.                       &nbsp;<img src="/vnex/intranet/calendar/datetime.gif" style="cursor:hand;" align="absmiddle" alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(planBeginDateS);return false">
  263.                     </td>
  264.                   </tr>
  265.                   <tr> 
  266.                     <td width="100" bgcolor="#e0e0e0"> <font  class="strong">&nbsp;计划结束时间:</font> 
  267.                     </td>
  268.                     <td width="456" bgcolor="#e0e0e0"> 
  269.                       <input type="text" name="planEndDateS" readonly size="24" class="file" value="<%= pvb.getPlanEndDateS() %>">
  270.                       &nbsp;<img src="/vnex/intranet/calendar/datetime.gif" style="cursor:hand;" align="absmiddle" alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(planEndDateS);return false">
  271.                     </td>
  272.                   </tr>                  
  273.                   <tr bgcolor="#fafafa"> 
  274.                     <td width="100"><font  class="strong">&nbsp;项目描述:</font></td>
  275.                     <td width="456"> 
  276.                       <textarea name="description" cols="59" rows="5"><%= FieldUtil.filterQuotTag(FieldUtil.filterScriptTag(pvb.getDescription())) %></textarea>
  277.                     </td>
  278.                   </tr>
  279.                   <tr bgcolor="#e0e0e0"> 
  280.                     <td rowspan="2"><font  class="strong">&nbsp;上传附件:</font></td>
  281.                     <td rowspan="2"> 
  282.                       <select name="attachments" size="6" multiple style="width:350">
  283.                          <vnex_workflow:fileList collection="<%=pvb.getFiles()%>">          
  284.                           <vnex:items>                             
  285.                             <option value = "<vnex_workflow:fileAttribute attribute="workflowfile_title"/>">
  286.                             <vnex_workflow:fileAttribute attribute="workflowfile_name"/></option>                                         
  287.                           </vnex:items> 
  288.                          </vnex_workflow:fileList>  
  289.                       </select>
  290.                       <input type="button" name="Button22" value="删除" onClick="deleteDoc( this.form )" class="file">
  291.                       
  292.                       <input type="file" name="file" class="file" size="24">&nbsp;
  293.                       <input type="button" name="Submit22" value="上传" class="file" onClick="uploadDoc(this.form)">
  294.                     </td>
  295.                   </tr>
  296.                   <tr bgcolor="#fafafa"> </tr>
  297.                   <!-- 6-28 modify begin --> 
  298.                   <tr bgcolor="#fafafa"> 
  299.                     <td colspan =3 > <font  class="strong">&nbsp;项目执行路径</font></td>
  300.                   </tr>
  301.                 </table>  
  302.                 <table border="0" cellspacing="1" cellpadding="2" class=title width="600">
  303.                   <tr class="table_row_title" > 
  304.                     <td height="30" colspan="6" bgcolor="#fafafa">&nbsp; 
  305.                        <input type="button" name="Submit3" style="width:70px" value="新建子任务" class="file" onClick="addSub( this.form )" >&nbsp;&nbsp;
  306.                        <input type="button" name="Submit23" value="删除" class="file" onClick="deleteSub( this.form )" >
  307.                     </td>
  308.                   </tr>
  309.                   <tr class="table_row_title" bgcolor="#e0e0e0"> 
  310.                     <td align="center" width="42"><font  class="strong"></font></td>
  311.                     <td width="85" align="center" nowrap><font  class="strong">顺序</font></td>
  312.                     <td width="167" align="center" nowrap><font  class="strong">子任务名称</font></td>
  313.                     <td width="87" align="center" nowrap><font  class="strong">执行者</font></td>
  314.                     <td width="59" align="center" nowrap><font  class="strong">类型</font></td>
  315.                     <td width="147" align="center" nowrap><font  class="strong">截止时间</font></td>
  316.                   </tr>   
  317.                   
  318. <%
  319.     for( int i = 0; i < subtasks.size(); i++ )
  320.     {
  321.         SubTaskValueBean sub = ( SubTaskValueBean )subtasks.get(i);                
  322.         if( i%2 == 0) 
  323.         {             
  324. %>
  325.                   <tr bgcolor="#fafafa" align="center"> 
  326. <%}else{
  327. %>
  328.                   <tr bgcolor="#e0e0e0" align="center"> 
  329. <%}
  330. %>
  331.           <td align="center" width="42"> 
  332.              <input type="checkbox" name="subId" value="<%=sub.getSubtaskId() %>">
  333.           </td>
  334.           <td width="103" align="center"> 
  335.             <select name="stepNos"> 
  336. <%          for( int j = 0; j < subtasks.size(); j++)
  337.             { 
  338. %>       
  339.               <option value="<%=j+1%>" 
  340.                 <%if( sub.getSubStepNo() == j+1 ) {%>
  341.               selected
  342.               <%}%>
  343.               ><%=j+1%></option>       
  344. <%       
  345.            }
  346. %>            
  347.           </select></td>
  348.           <td width="112" align="center">
  349.             <a onclick="modifySubtask(myform,'<%= sub.getSubtaskId() %>');return false;" href="#"><%= sub.getSubTitle() %></a>
  350.           </td>
  351.           <td width="109" align="center">
  352.              <div align="center"><%=sub.getSubExecutorName() %></div>
  353.           </td>
  354.           <td width="104" align="center"> 
  355.              <div align="center"><%= WorkflowLoader.getSubtaskType( sub.getSubTypeId() ) %></div>
  356.           </td>
  357.           <td width="93" align="center"> 
  358.               <div align="center"><%= sub.getSubPlanEndTimeS() %></div>
  359.           </td>                         
  360.          </tr>
  361. <%       
  362.    }
  363. %>          
  364.          <tr> 
  365.           <td align="center" bgcolor="#e0e0e0" width="42"> 
  366.             <input type="checkbox" name="C1" value="ON"  onClick="SelectAll( this.form )" >
  367.           </td>
  368.           <td colspan="5" bgcolor="#e0e0e0">&nbsp;&nbsp;全选</td>
  369.          </tr>
  370.         </table>
  371.                 <table width="600" border="0" cellspacing="0" cellpadding="0">
  372.                   <tr align="center"> 
  373.                     <td height="30"> 
  374.                       <input type="button" name="Submit" value="保存" class="file" onClick="modifyProjectSuccess(this.form, 'false')">&nbsp;&nbsp;
  375.                       <input type="button" style="width:70px" name="Submit" value="保存并启动" class="file" onClick="modifyProjectSuccess( this.form, 'true')">&nbsp;&nbsp;
  376.                       <input type="button" style="width:85px" name="Submit" value="存为个人模板" class="file" onClick="saveTemplate(this.form)">&nbsp;&nbsp;
  377.                       <input type="reset" name="Submit2" value="放弃" class="file" onclick="location='/mainctrl/projectmanagement/projectlist'">
  378.                     </td>
  379.                   </tr>
  380.                 </table>
  381.               </td>
  382.             </tr>
  383.           </table>          
  384.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  385.        </TD>
  386.     </TR>
  387.     <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  388.     </TABLE>
  389.   <BR>
  390.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  391. </form></DIV>
  392. </BODY></HTML>