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

📄 tsentry.jsp.svn-base

📁 一个timesheet程序,用来统计开发人员的度量衡web在线程序.用于软件行业
💻 SVN-BASE
📖 第 1 页 / 共 4 页
字号:
				else if ( theform.thutotal.value > 24 )
				{
					alert("You working hours in Thursday should not over 24 hours ");
					theform.thutotal.focus();
					return false;
				} 
				else if ( theform.fritotal.value > 24 )
				{
					alert("You working hours in Friday should not over 24 hours ");
					theform.fritotal.focus();
					return false;
				} 
				else if ( theform.sattotal.value > 24 )
				{
					alert("You working hours in Saturday should not over 24 hours ");
					theform.fritotal.focus();
					return false;
				} 
				else if ( theform.suntotal.value > 24 )
				{
					alert("You working hours in Sunday should not over 24 hours ");
					theform.fritotal.focus();
					return false;
				} 
				else if ( theform.total.value < 40 )
				{
					//alert("The total hours for this week is less than 40 hrs.");
					if ( confirm("Your total working hours in this week is less than the standard hours(40). Do you still want to finalize ?") )
					{
						if ( confirm("Once finalized, you are not allowed to change this timesheet! Do you want to continue? ") )
						{
							submitform(theform, 'UpdateTimeSheet', 'T');
							theform.makefinal.disabled = true;
							return true;
						} 
						else 
						{
							return false;
						}
					} 
					else 
					{
						return false;
					}
				} 
				else 
				{
					if ( confirm("Once finalized, you are not allowed to change this timesheet! Do you want to continue? ") )
					{
						submitform(theform, 'UpdateTimeSheet', 'T');
						theform.makefinal.disabled = true;
						return true;
					} 
					else 
					{
						return false;
					}
				}
			}
		}
		function unfinalizeconfirm(theform)
		{
			if(confirm("Once unfinalized, the timesheet data can be modified. Do you want to continue?"))
			{
				submitform(theform, 'UpdateTimeSheet', 'U');
				return true;
			}
			else
			{
				return false;
			}
		}
		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 sum(theform,thefield)
		{
			if ( ! (isnumeric(thefield.value)))
			{
				if ( valid == 0 ) 
				{
					alert("Hours should be numeric and between 0 and 24.");
					valid = 1;
				}
				thefield.value ="0";
				thefield.focus();
				return false;
			}
			else
			{
				validdouble(thefield);
			}
			if ( eval(thefield.value) < 0 || thefield.value > 24 )
			{
				if ( valid == 0 )
				{
					alert("Hours should be between 0 and 24");
					valid = 1;
				}
				thefield.focus();
				return false;
			}
			if ( (thefield.value.charAt(0) == '.' || thefield.value.charAt(1) == '.' || thefield.value.charAt(2) == '.')
				&& (Math.floor(eval(thefield.value)/0.5)*0.5 != eval(thefield.value)) )
			{
				if ( valid == 0 )
				{
					alert("Hours should to be multiple of 0.5");
					valid = 1;
				}
				thefield.focus();
				return false;
			}
			sumhour(theform);
			valid = 0;
		}
		function validdouble(thefield)
		{
			var currentvalue = thefield.value;
			var doubleflag = 0;
			for ( var i = 0; i < currentvalue.length; i++ )
			{
				if ( currentvalue.charAt(i) == "." )
				{
					doubleflag = 1;
				}
			}
			if ( doubleflag == 0 )
			{
				if ( currentvalue == "" )
				{
					thefield.value = "0.0";
					doubleflag = 1;
				}
				else
				{
					thefield.value = currentvalue + ".0";
					doubleflag = 1;
				}
			}
		}
		function changefocus(theform)
		{
			theform.pbsearch.focus();
			if ( changeflag == 0 )
			{
				newwindow();
			} 
			else 
			{
				if ( confirm("The current timesheet has been changed! To save the changes, click OK. Otherwise, click Cancel.") )
				{
					if ( checkvalid(theform) )
					{
						changeflag = 0;
						submitform(theform, 'UpdateTimeSheet', 'F');
					}
				} 
				else 
				{
					changeflag = 0;
					newwindow();
				}
			}
		}
		function submitform(theform, action, finalstring)
		{
			theform.action.value = action;
			theform.finalize.value = finalstring;
			theform.submit();
		}
		function switchts(theform)
		{
			if ( changeflag == 0 )
			{
				theform.timesheetid.value = "";
				submitform(theform, 'displayTimeSheet', 'F');
			} 
			else 
			{
				if ( confirm("The current timesheet has been changed! To save the changes, click OK. Otherwise, click Cancel.") )
				{
					if ( checkvalid(theform) )
					{
						changeflag = 0;
						submitform(theform, 'UpdateTimeSheet', 'F');
					}
				} 
				else 
				{
					theform.timesheetid.value = "";
					submitform(theform, 'displayTimeSheet', 'F');
				}
			}
		}
	// -->
	</script>
</head>
<body>
<form name="ts_entry_form" method="post" action="/rms/mainservlet">
<h1>Timesheet Entry</h1>
<input type="hidden" name="urlmapping" value="/timesheet/tsentry">
<input type="hidden" name="action" value="DisplayTimeSheet">
<input type="hidden" name="timesheetid" value="<%= timesheetid %>">
<input type="hidden" name="finalize" value="F">
<input type="hidden" name="hidedetail" value="<%= hidedetail %>">
<%
if ( LoginuserUtil.getInstance().isAdmin(request) )	
{							
	%>
		<input type="hidden" name="hiringdate" value="<%=TsWebUtil.getInstance().getHiringdateInadminmode(request)%>"> 
		<input type="hidden" name="termdate" value="<%= TsWebUtil.getInstance().getTermdateInadminmode(request)%>"> 
	<%
}
%>
<table width="837" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="100%">
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td width="100" class="txtLabel">User Name</td>
					<td width="200" class="cell">
					<%
					if ( LoginuserUtil.getInstance().isAdmin(request) )
					{  
						List<RsDropInfo> rslist = TsWebUtil.getInstance().getResourcelist(request);
						int size = rslist.size();						
						%><select class="cell" name="resourceid" size="1"><%
						for ( int i=0;i<size;i++ ) 
						{
							RsDropInfo info = rslist.get(i);
							if( ( resourceid.trim() ).equals(info.getResourceid() ) ) 
							{
								%><option class="cell" selected value="<%= resourceid%>"><%=info.getName()%></option><%
							} 
							else 
							{
								%><option class="cell" value="<%= info.getResourceid()%>"><%=info.getName()%></option><%
							}
						}
						%></select><%
					} 
					else 
					{
						RsDropInfo info = ResourceUtil.getInstance().getSinglerecourd( resourceid );
						%>
							<input type="hidden" name="resourceid" value="<%= resourceid%>"><%=info.getName()%>
							<input type="hidden" name="hiringdate" value="<%= info.getHiringdate()%>">
							<input type="hidden" name="termdate" value="<%= info.getTermdate()%>"> 
						<%
					}
					%>
					</td>
					<td width="120" class="txtLabel">Start Period</td>
					<td width="150" class="cell"><input type="text" class="cell" size="12" maxlength="11" name="startweek" value="<%= startweek %>" onfocus="javascript:changefocus(this.form)"></td>
					<td width="287" class="cell"><input type="button" class="cell" name="pbsearch" value="Show" onclick="javascript:switchts(this.form)"></td>
				</tr>
				<%
				if (  LoginuserUtil.getInstance().isAdmin(request) )
				{
				%>
				<tr>
					<td width="120" class="txtLabel">User Status</td>
					<td width="500" class="cell">
					<%
					if ( ( "A" ).equals(userstatus) )
					{
						%>
							<input type="radio" class="cell" name="userstatus" value="A" checked onclick="javascript:this.form.hidedetail.value ='Y';this.form.submit();">&nbsp;&nbsp;Active 
							<input type="radio" class="cell" name="userstatus" value="I" onclick="javascript:this.form.hidedetail.value ='Y'; switchts(this.form);">&nbsp;&nbsp;Inactive							
						<%
					} 
					else
					{
						%>	
							<input type="radio" class="cell" name="userstatus" value="A" onclick="javascript:this.form.hidedetail.value ='Y';this.form.submit();">&nbsp;&nbsp;Active 
							<input type="radio" class="cell" name="userstatus" value="I" checked onclick="javascript:this.form.hidedetail.value ='Y';switchts(this.form);">&nbsp;&nbsp;Inactive															
						 <%
					}
					%>															    
					</td>
				</tr>								
				<%
				}
				%>	
			</table>
		</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>
		<%
			String weekstr = TsHolidayUtil.getInstance().getHolidayweekdays(startweek);
			if( ValHelper.getInstance().isNotNullAndEmpty(weekstr) )
			{
			%>
				<tr>
					<td><span class="txtRed">*</span> <%=weekstr%> is Netstar holiday. Not required to enter the time except if you work on that day.</td>
				</tr>
			<%
			} 
			if (hidedetail.equals("N") && (ValHelper.getInstance().isNotNullAndEmpty(timesheetid)) )				 
			{
				double p_subTotal = 0.0;
				double p_sun = 0.0;
				double p_mon = 0.0;
				double p_tue = 0.0;
				double p_wed = 0.0;
				double p_thu = 0.0;
				double p_fri = 0.0;
				double p_sat = 0.0;

				double p_sumTotal = 0.0;
				double p_sumSun = 0.0;
				double p_sumMon = 0.0;
				double p_sumTue = 0.0;
				double p_sumWed = 0.0;
				double p_sumThu = 0.0;
				double p_sumFri = 0.0;
				double p_sumSat = 0.0;

				if ( finalized && ! ( LoginuserUtil.getInstance().isAdmin(request) ) )
				{
				%>
					<tr>
						<td>&nbsp;</td>
					</tr>
					<tr>
						<td class="txtHighlight">The timesheet has been finalized.</td>
					</tr>
					<tr>
						<td>&nbsp;</td>
					</tr>
					<tr>
						<td>
							<table width="837" border="1" cellpadding="0" cellspacing="0">
								<tr>

⌨️ 快捷键说明

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