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