?? projmodify.jsp.svn-base
字號(hào):
<%@ page import="java.util.List" %>
<%@ page import="com.nsi.components.util.LoginuserUtil" %>
<%@ page import="com.nsi.components.project.ProjectInfo" %>
<%@ page import="com.nsi.components.web.util.ProjectWebUtil" %>
<%@ page import="com.nsi.components.util.info.ClientInfo" %>
<%@ page import="com.nsi.components.util.info.ProjectStatusInfo" %>
<%
String projectid = ProjectWebUtil.getInstance().getProjectid(request);
String searchtype = ProjectWebUtil.getInstance().getSearchtype(request);
String projecttype = ProjectWebUtil.getInstance().getProjecttype(request);
String earliestentrydate = ProjectWebUtil.getInstance().getEarliestentrydate(projectid);
String latestentrydate = ProjectWebUtil.getInstance().getLatestentrydate(projectid);
ProjectInfo info = ProjectWebUtil.getInstance().getProjectinfo(request);
%>
<html>
<head>
<meta http-equiv="content-style-type" content="text/css">
<meta http-equiv="pragma" content="no-cache">
<title>Achievo-RMS Project Profile Modification </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;
function restart()
{
currentfield.value = monthname[month] + "-" + padout(day) + "-" + y2k(year);
window.focus();
mywindow.close();
}
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_form.projectstatusid.focus();
mywindow = window.open('/rms/project/projcalender.html','Calendar', "resizeable = no,width=345,height=295" );
mywindow.location.href = '/project/projcalender.html';
mywindow.focus();
}
function isnum( inputvalue )
{
if ( ! inputvalue )
{
return false;
}
else
{
inputstr = inputvalue.toString();
for ( var i = 0; i < inputstr.length; i++ )
{
var onechar = inputstr.charAt(i);
if ( onechar < '0' || onechar > '9' )
{
return false;
}
}
}
return true;
}
function submitform( theform, action )
{
if ( validproj(theform))
{
theform.action.value = action;
theform.submit();
}
else
{
return false;
}
}
function cancelform( theform )
{
theform.urlmapping.value = "/project/projprofmenu" ;
theform.submit() ;
}
function validproj(theform)
{
if ( theform.globalind.value == "1")
{
alert("Reminder: This is a global project for all resourcs. Please assign PS department manager to this project.");
}
if ( theform.projectname.value == "" )
{
alert("Project Name is required. Please enter Project Name.");
theform.projectname.focus();
return false;
}
else if ( theform.shortname.value == "" )
{
alert("Short Name is required. Please enter Short Name for the project.");
theform.shortname.focus();
return false;
}
else if ( theform.projectcode.value == "" )
{
alert("Project Code is required. Please enter Project Code for the project.");
theform.projectcode.focus();
return false;
}
else if (!theform.projectcode.value==""&&!isnum(theform.projectcode.value) )
{
alert("Project Code must be number. Please enter valid Project Code for the project.");
theform.projectcode.focus();
return false;
}
else if (!validdates(theform.startdate.value, theform.enddate.value))
{
alert("Start Date can not exceed End Date.");
theform.projectstatusid.focus();
return false;
}
else if (!validdates(theform.startdate.value, theform.earliestentrydate.value))
{
alert("Somebody has already filled in the timesheet at " + theform.earliestentrydate.value + ", you can not change the project start date beyond " + theform.earliestentrydate.value + ".");
theform.projectstatusid.focus();
return false;
}
else if (!validdates(theform.latestentrydate.value, theform.enddate.value))
{
alert("Somebody has already filled in the timesheet at " + theform.latestentrydate.value + ", you can not change the project end date prior to " + theform.latestentrydate.value + ".");
theform.projectstatusid.focus();
return false;
}
else
{
return true;
}
}
function validdates(date1, date2)
{
if(date1=='null'||date2=='null'||date1==''||date2=='')
{
return true;
}
var date1mon;
var date2mon;
for ( var i = 0; i < monthname.length; i++ )
{
if ( monthname[ i ] == date1.substring( 0, 3 ) )
{
date1mon = i;
}
if ( monthname[ i ] == date2.substring( 0, 3 ) )
{
date2mon = i;
}
}
if ( date1mon < 10 )
{
date1mon = "0" + date1mon;
}
if ( date2mon < 10 )
{
date2mon = "0" + date2mon;
}
var newdate1 = date1.substring( 7, 11 ).toString() + date1mon.toString() + date1.substring( 4, 6 ).toString();
var newdate2 = date2.substring( 7, 11 ).toString() + date2mon.toString() + date2.substring( 4, 6 ).toString();
if ( newdate1 > newdate2 )
{
return false;
}
else
{
return true;
}
}
function confirmchange(theform)
{
var checkflag = false;
if( (theform.globalind.value=="0"&&(theform.startdate.value!=theform.startdate0.value||theform.enddate.value!=theform.enddate0.value))
||(theform.projectstatusid0.value=="1"&&theform.projectstatusid.value!="1"))
{
checkflag = confirm('The change on the project effective period or status will be propagated to the resource allocation. The resource allocation period will be changed to be within the project effective period automatically. And if the project is turned from active to any other status, the end date of resource allocation for the project later than today will be set to today as well. Will you continue?');
}
if(theform.globalind0.value=="0"&&theform.globalind.value=="1")
{
checkflag = confirm('Global projects do not require resource allocation. As the project is changed to a Global project, all its resource allocation data will be deleted. Will you continue?');
}
return checkflag;
}
//-->
</script>
</head>
<body>
<form name="project_form" method="post" action="/rms/mainservlet" >
<input type="hidden" name="urlmapping" value="/project/projmodify">
<input type="hidden" name="action" value="">
<input type="hidden" name="projectid" value="<%=projectid%>">
<input type="hidden" name="searchtype" value="<%=searchtype%>">
<input type="hidden" name="projecttype" value="<%=projecttype%>">
<input type="hidden" name="earliestentrydate" value="<%=earliestentrydate%>">
<input type="hidden" name="latestentrydate" value="<%=latestentrydate%>">
<h1>Project Profile Modification </h1>
<table width="837" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="txt"><span class="txtRed">*</span> All fields are required </td>
</tr>
<tr>
<td class="txtHighlight">Project Name</td>
<td class="cell"><input type="text" class="cell" name="projectname" size="40" maxlength="50" value="<%= info.getProjectname()%>"></td>
</tr>
<tr>
<td class="txtHighlight">Short Name</td>
<td class="cell"><input type="text" class="cell" name="shortname" size="15" maxlength="15" value="<%= info.getShortname() %>"></td>
</tr>
<tr>
<td class="txtHighlight">Project Code</td>
<td class="cell">
<select class="cell" name="projectcodeprefix" size="1">
<%
if("FFP".equals(info.getProjectcodeprefix()))
{
%>
<option class="cell" selected value="FFP">FFP</option>
<option class="cell" value="INT">INT</option>
<option class="cell" value="TM">TM</option>
<%
}
else if("INT".equals(info.getProjectcodeprefix()))
{
%>
<option class="cell" value="FFP">FFP</option>
<option class="cell" selected value="INT">INT</option>
<option class="cell" value="TM">TM</option>
<%
}
else if("TM".equals(info.getProjectcodeprefix()))
{
%>
<option class="cell" selected value="FFP">FFP</option>
<option class="cell" value="INT">INT</option>
<option class="cell" selected value="TM">TM</option>
<%
}
%>
</select>
<input type="text" class="cell" name="projectcode" size="8" maxlength="8" value="<%= info.getProjectcode() %>">
</td>
</tr>
<tr>
<td class="txtLabel">Client</td>
<td class="cell">
<%
List<ClientInfo> clientlist = ProjectWebUtil.getInstance().getClientlist();
int clientsize = clientlist.size();
%>
<select class="cell" name="clientid" size="1">
<option class="cell" value="" >--Please Select One Client--</option>
<%
for ( int i =0; i<clientsize;i++)
{
ClientInfo clientinfo = clientlist.get(i);
if( ( info.getClientid() ).equals( clientinfo.getClientid() ) )
{
%><option class="cell" selected value="<%= info.getClientid()%>"><%= clientinfo.getClientname()%></option><%
}
else
{
%><option class="cell" value="<%= clientinfo.getClientid()%>"><%= clientinfo.getClientname()%></option><%
}
}
%>
</select>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td class="txtHighlight">Start Date</td>
<td class="cell">
<input type="text" class="cell" name="startdate" size="12" maxlength="12" value="<%= info.getStartdate() %>" onfocus="javascript:changefocus(this);">
<input type="hidden" name="startsate0" value="<%= info.getStartdate() %>">
<input type="hidden" name="originalstartdate" value="<%= info.getStartdate() %>" >
</td>
</tr>
<tr>
<td class="txtHighlight">End Date</td>
<td class="cell">
<input type="text" class="cell" name="enddate" size="12" maxlength="12" value="<%= info.getEnddate() %>" onfocus="javascript:changefocus(this);">
<input type="hidden" name="enddate0" value="<%= info.getEnddate() %>">
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td class="txtHighlight">Status</td>
<td class="cell">
<%
List<ProjectStatusInfo> statuslist = ProjectWebUtil.getInstance().getStatuslist();
int statussize = statuslist.size();
%><select class="cell" size="1" name="projectstatusid"><%
for( int i=0;i<statussize;i++)
{
ProjectStatusInfo statusinfo = statuslist.get(i);
if( (info.getProjstatusid()).equals( statusinfo.getProjstatusid() ) )
{
%><option class="cell" selected value="<%=info.getProjstatusid()%>"><%=statusinfo.getProjstatus()%></option><%
}
else
{
%><option class="cell" value="<%=statusinfo.getProjstatusid()%>"><%=statusinfo.getProjstatus()%></option><%
}
}
%>
</select>
<input type="hidden" name="projectdtatusid0" value="<%=info.getProjstatusid()%>">
</td>
</tr>
<tr>
<td class="txtHighlight">Global Index</td>
<td class="cell">
<select class="cell" size="1" name="globalind">
<%
if ( ( "0" ).equals( info.getGlobalind() ) )
{
%>
<option class="cell" selected value="0">No</option>
<option class="cell" value="1">Yes</option>
<%
}
else
{
%>
<option class="cell" value="0">No</option>
<option class="cell" selected value="1">Yes</option>
<%
}
%>
</select>
<input type="hidden" name="globalind0" value="<%=info.getGlobalind()%>">
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2">
<input type="button" class="cell" value="Update" onclick="submitform(this.form, 'updateProject');">
<input type="reset" class="cell" value="Reset">
<input type="button" class="cell" value="Cancel" onclick="cancelform(this.form);">
</td>
</tr>
</table>
</form>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -