⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 projassign.jsp.svn-base

📁 一个timesheet程序,用来统计开发人员的度量衡web在线程序.用于软件行业
💻 SVN-BASE
📖 第 1 页 / 共 2 页
字号:
<%@ page import="java.util.Map" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.Set" %>
<%@ page import="com.nsi.components.util.LoginuserUtil" %>
<%@ page import="com.nsi.components.web.util.ProjAssignWebUtil" %>
<%@ page import="com.nsi.components.util.info.ProjDropInfo" %>
<%@ page import="com.nsi.components.util.info.RsDropInfo" %>
<%@ page import="com.nsi.components.projassign.ProAssignDetail" %>
<%@ page import="com.nsi.util.tsdate.TsDateUtil" %>
<%@ page import="com.nsi.util.ValHelper" %>
<%
String projectid = ProjAssignWebUtil.getInstance().getProjectid(request);
String projecstartdate = ProjAssignWebUtil.getInstance().getStartdate(projectid);
String projectenddate = ProjAssignWebUtil.getInstance().getEnddate(projectid);
String projstatus  = ProjAssignWebUtil.getInstance().getProjectstatus(request);
List<ProAssignDetail> detaillist = ProjAssignWebUtil.getInstance().getDetaillist(request);
int addedrows =ProjAssignWebUtil.getInstance().getAddnum(request);
int rownum = 0;
if ( addedrows > 0  ) 
{
	rownum += addedrows;
}
String hidedetail = ProjAssignWebUtil.getInstance().getHidedetail(request);
%>
<html>
<head>
	<meta http-equiv="content-style-type" content="text/css">
	<meta http-equiv="pragma" content="no-cache">
	<title>Achievo-RMS Project Assignation</title>
	<link href="../theme/master.css" rel="stylesheet" type="text/css">
	<%
		if ( LoginuserUtil.getInstance().isNotLogined(request) ) 
		{
			%><meta http-equiv="refresh" content="0; url=/entrance.jsp"><%
		}
	%>
	<script language="javascript">
	<!--
		var today = new Date();
		var day   = today.getDate();
		var month = today.getMonth();
		var year  = y2k(today.getYear());
		var monthname = new Array('JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC');
		var currentfield;
		var valid = 0;
		function savecheck( theform, action ) 
		{
			if((!isprojectexpired(theform, '<%=projectenddate%>'))&& checkvalid( theform )) 
			{
				submitform( theform, action );
				return true;
			} 
			else 
			{
				return false;
			}
		}
		function checkvalid( theform ) 
		{
			if ( valid == 1 ) 
			{
				valid = 0;
				return false;
			} 
			else 
			{
				if ( ! validass(theform) ) 
				{
					return false;
				} 
				if ( ! validalldates(theform) ) 
				{
					return false;
				} 
				else 
				{
					return true;
				}
			}
		}
		function submitform( theform, action ) 
		{
			theform.action.value = action;
			theform.submit();
		}
		function cancelform( theform ) 
		{
			theform.urlmapping.value = "/project/projassignmenu";
			theform.submit() ;
		}
		function validdates(date1, date2)   
		{   
		    
		  if(date1=='null'||date2=='null'||date1==''||date2=='')
		        return true;
			if ( convertdate(date1) > convertdate(date2) )
			{
				return false;
			} 
			else
			{
				return true;
			}
		}
		function validdatesterm(date1, date2)   
		{   
		  if(date1=='null'||date2=='null'||date1==''||date2=='')
		        return true;
			if ( convertdate(date1) >= convertdate(date2) )
			{
				return false;
			} 
			else
			{
				return true;
			}
		}			
		function convertdate(date)
		{  
			var datemon; 
			for ( var i = 0; i < monthname.length; i++ )
			{
				if ( monthname[ i ] == date.substring( 0, 3 ) )
				{
					datemon = i;
				}	
			}
			if ( datemon < 10 )
			{
				datemon = "0" + datemon;
			}
			return date.substring( 7, 11 ).toString() + datemon.toString() + date.substring( 4, 6 ).toString();
		}
		function setratedefault( thefield )
		{
			if ( thefield.value == "" || ( ! isnumeric( thefield.value ) ) )
			{
				thefield.value = 0;
			}
		}
		function isnumeric( inputvalue )
		{
			onedecimal = false;
			inputstr = inputvalue.toString();
			for ( var i = 0; i < inputstr.length; i++ )
			{
				var onechar = inputstr.charAt(i);
				if ( onechar == '.' && !onedecimal )
				{
					onedecimal = true;
					continue;
				}
				if ( onechar < '0' || onechar > '9' )
				{
					return false;
				}
			}
			return true;
		}
		function restart()
		{
			currentfield.value = monthname[month] + "-" + padout(day) + "-" + y2k(year);
			mywindow.close();
		}
		function isprojectexpired(theform, date1)   
		{    
			if (theform.clickedbutton.value=='A'&& convertdate(monthname[month] + "-" + padout(day) + "-" + y2k(year))>convertdate(date1) )
			{   
				alert('Can not add a resource to expired project!'); 
				return true;
			} 
			else
			{
				return false;
			}
		}
		function y2k(number)
		{
			number = parseInt(number);
			return (number < 1000) ? number + 1900 : number;
		}
		function padout(number)
		{
			number = parseInt(number);
			return (number < 10) ? '0' + number : number;
		}
		function changefocus(thefield)
		{
			currentfield = thefield;
			document.project_assign_form.pbshow.focus() ;
			mywindow = window.open('/rms/project/projcalender.html','Calendar', "resizeable = no,width=345,height=295" );
			mywindow.location.href = '/rms/project/projcalender.html';
			mywindow.focus();
		}
	//-->
	</script>
</head>
<body>
<h1>Project Resource Allocation</h1>
<form name="project_assign_form" method="post" action="/rms/mainservlet" >
<input type="hidden" name="urlmapping" value="/project/projass">
<input type="hidden" name="action" value="displayProAssign">
<input type="hidden" name="hidedetail" value="<%=hidedetail%>">
<table width="837" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="100%">
			<table border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td width="120" class="txtLabel">Project Name</td>
					<td width="400" class="cell">
						<select class="cell" name="projectid" size = 1>
						<%
							List<ProjDropInfo> list = new ArrayList<ProjDropInfo>();
							boolean noactivelist = ProjAssignWebUtil.getInstance().isNoActiveList(request, list);
							list=(List<ProjDropInfo>)request.getAttribute("list");
							if( !list.isEmpty())
							{
								int size=list.size();
								for( int i=0;i<size;i++ )
								{
									ProjDropInfo info = list.get(i);
									if ( projectid.equalsIgnoreCase( info.getProjectid()) ) 
									{
										%><option class="cell" selected value="<%=projectid%>"><%=info.getProjectname()%></option><%
									}
									else
									{
										%><option class="cell" value="<%=info.getProjectid()%>"><%=info.getProjectname()%></option><%
									}
								}
							}
						%>
						</select>
					</td>
					<td width="317" class="cell">
						<input type="button" class="cell" name ="pbshow" value="Display & Modify" onclick="this.form.hidedetail.value ='Y';submitform( this.form, 'displayProAssign');">
					</td>
				 </tr>
				 <tr>
			    <%
			    	if (noactivelist)
			    	{
			    		%><td width="120" ></td><td width="300" class="txtHighlight" colspan="2">You have only projects ended two months ago.</td><%
			    	} 
					else
					{
						%>
						<td width="120" class="txtLabel">Project Status</td>
						<td width="150" class="cell">
						<%
						if (projstatus.equals("A"))
						{
							%>
								<input type="radio" class="cell" name="projectstatus" value="A" checked onclick="this.form.hidedetail.value ='Y';submitform( this.form, 'displayProAssign');">&nbsp;&nbsp;All 
								<input type="radio" class="cell" name="projectstatus" value="" onclick="this.form.hidedetail.value ='Y';submitform( this.form, 'displayProAssign');">&nbsp;&nbsp;All Active
							<%
						}
						else
						{
							%>
								<input type="radio" class="cell" name="projectstatus" value="A" onclick="this.form.hidedetail.value ='Y';submitform( this.form, 'displayProAssign');">&nbsp;&nbsp;All 
								<input type="radio" class="cell" name="projectstatus" value="" checked onclick="this.form.hidedetail.value ='Y';submitform( this.form, 'displayProAssign');">&nbsp;&nbsp;All Active
							<%
                	}
               %>
					</td>
					<td>&nbsp;</td>
				 <%
				 	}
				 %>
				</tr>
				<%
				if ( ProjAssignWebUtil.getInstance().isDisplayDtl(request) ) 
				{
				%>
					<tr>
						<td colspan=2>&nbsp;</td>
					</tr>
					<tr>
			   		<td width="180" class="txtLabel">Project Start Date</td> 
						<td class="cell"><nobr><%=projecstartdate%></nobr></td>
					</tr>
					<tr>
						<td width="180" class="txtLabel">Project End Date</td>
						<td class="cell"><nobr><%=projectenddate%></nobr></td>							
					</tr>
					<tr>
						<td colspan=2>&nbsp;</td>
					</tr>
					<tr>
						<td colspan=2><span class="txtRed">Note:  If the resource does not exist in the Resource dropdown list, please contact RMS Admin to add the resource to the corresponding department through Resource Position Function.</span></td>							
					</tr>
				<%
				}
				%>
			</table>
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
	</tr>
	<%
	if ( ProjAssignWebUtil.getInstance().isDisplayDtl(request) ) 
	{
	%>
		<tr>
			<td>
			<%
			if ( detaillist.isEmpty() && addedrows <= 0 )
			{
			%>
				<table width="837" cellpadding="0" cellspacing="0" align="left" border="0">
					<tr>
						<td class="txtHighlight">There is no resource assigned to this project !</td>
					</tr>
				</table>		
			<%
			}
			else
			{
			%>
				<table width="837" cellpadding="0" cellspacing="0" align="left" border="1">
					<tr>
						<td width="137" class="cellHeader">Resources</td>
						<td width="130" class="cellHeader">Project Role</td>
						<td width="110" class="cellHeader">From Date</td>
						<td width="110" class="cellHeader">End Date</td>
						<td width="70" class="cellHeader">Billable</td>
						<td width="70" class="cellHeader">Charge</td>
						<td width="60" class="cellHeader">% Load</td>
						<td width="70" class="cellHeader">Bdgt. Days</td>
						<td width="80" class="cellHeader">Bdgt. Amt</td>
					</tr>
					<%
						int detailsize = detaillist.size();
						rownum += detailsize;
						for ( int i = 0; i < detailsize; i++ ) 
						{
							ProAssignDetail detail = detaillist.get( i );
							String proassid = detail.getProjassignid();
							String resourceid = detail.getResourceid();
							String resoucename = ProjAssignWebUtil.getInstance().getResourcename(request,resourceid);
							String projroleid = detail.getProjroleid();
							String fromdate = detail.getFromdate();
							String enddate = detail.getEnddate();
							String hiringdate = detail.getHiringdate();
							String termdate = detail.getTermdate();
							String billable = detail.getBillable();
							String chargeid = detail.getChargetypeid();
							String perload = detail.getPercentageload();
							String bdgtdays = detail.getBudgetdays();
							String bdgtamt = detail.getBudgetamount();
						%>
						<tr>
							<td class="cellSmall">
								<input type="hidden" name="proassid<%= i %>" value="<%=proassid%>">
								<input type="hidden" name="earliestentrydate<%= i %>" value="<%=ProjAssignWebUtil.getInstance().getEarliestentrydateByassign(proassid, resourceid)%>">
								<input type="hidden" name="latestentrydate<%= i %>" value="<%=ProjAssignWebUtil.getInstance().getLatestentrydateByassign(proassid, resourceid)%>">
								<input type="hidden" name="hiringdate<%= i %>" value="<%= hiringdate %>">
								<input type="hidden" name="termdate<%= i %>" value="<%= termdate %>">
								<input type="hidden" name="resourceid<%= i %>" value="<%= resourceid %>"><%=resoucename%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -