?? projcreate.jsp.svn-base
字號:
<%@ page import="java.util.List" %>
<%@ page import="com.nsi.components.util.LoginuserUtil" %>
<%@ page import="com.nsi.components.web.util.ProjectWebUtil" %>
<%@ page import="com.nsi.components.util.info.ClientInfo" %>
<%@ page import="com.nsi.components.util.info.ProjectStatusInfo" %>
<%@ page import="com.nsi.util.tsdate.TsDateUtil" %>
<%
String searchtype = ProjectWebUtil.getInstance().getSearchtype(request);
String projecttype = ProjectWebUtil.getInstance().getProjecttype(request);
String clientid = ProjectWebUtil.getInstance().getClientid(request);
%>
<html>
<head>
<meta http-equiv="content-style-type" content="text/css">
<meta http-equiv="pragma" content="no-cache">
<link href="../theme/master.css" rel="stylesheet" type="text/css">
<title>Achievo-RMS Project Profile Creation</title>
<%
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);
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.pro_create_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 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("From Date can not exceeds End Date.");
theform.projectstatusid.focus();
return false;
}
else if ( theform.clientid.value == "" )
{
alert("Please Select one client.");
theform.clientid.focus();
return false;
}
else
{
return true;
}
}
function validdates(date1, date2)
{
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 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;
}
//-->
</script>
</head>
<body onload="javascript:document.pro_create_form.projectname.focus()">
<h1>Project Profile Creation</h1>
<form name="pro_create_form" method="post" action="/rms/mainservlet">
<input type="hidden" name="urlmapping" value="/project/projmodify">
<input type="hidden" name="action" value="createProject">
<input type="hidden" name="searchtype" value="<%=searchtype%>">
<input type="hidden" name="projecttype" value="<%=projecttype%>">
<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" ></td>
</tr>
<tr>
<td class="txtHighlight">Short Name</td>
<td class="cell"><input type="text" class="cell" name="shortname" size="15" maxlength="15"></td>
</tr>
<tr>
<td class="txtHighlight">Project Code</td>
<td class="cell">
<select class="cell" name="projectcodeprefix" size="1">
<option class="cell" selected value="FFP">FFP</option>
<option class="cell" value="INT">INT</option>
<option class="cell" value="TM">TM</option>
</select>
<input type="text" class="cell" name="projectcode" size="8" maxlength="8">
</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( clientid.equals( clientinfo.getClientid() ) )
{
%><option class="cell" selected value="<%= clientid%>"><%= 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="<%= TsDateUtil.getInstance().getDefaultDateStr() %>" onfocus="javascript:changefocus(this);">
</td>
</tr>
<tr>
<td class="txtHighlight">End Date</td>
<td class="cell">
<input type="text" class="cell" name="enddate" size="12" maxlength="12" value="<%= TsDateUtil.getInstance().getDefaultEndDateStr() %>" onfocus="javascript:changefocus(this);">
</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);
%><option class="cell" value="<%=statusinfo.getProjstatusid()%>"><%=statusinfo.getProjstatus()%></option><%
}
%>
</select>
</td>
</tr>
<tr>
<td class="txtHighlight">Global Index</td>
<td class="cell">
<select class="cell" size="1" name="globalind">
<option class="cell" value="0">No</option>
<option class="cell" value="1">Yes</option>
</select>
</td>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" class="cell">
<input name="create" type="button" class="cell" value="Create" onclick="submitform(this.form, 'createProject');">
<input name="reset" type="reset" class="cell" value="Reset">
<input name="cancel" type="button" class="cell" value="Cancel" onclick="cancelform(this.form);">
</td>
</tr>
</table>
</form>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -