?? projassign.jsp.svn-base
字號:
</td>
<td class="cellSmallCenter">
<select class="cellSmall" name="projectroleid<%= i %>" size = 1>
<%
Map<String,String> rolemap = ProjAssignWebUtil.getInstance().getRolemap(request);
Set<String> roleset = rolemap.keySet();
Iterator<String> roleiter = roleset.iterator();
while( roleiter.hasNext() )
{
String projectroleid = roleiter.next();
if ( ( projroleid.trim() ).equalsIgnoreCase( projectroleid.trim() ) )
{
%><option class="cellSmall" selected value="<%=projroleid%>"><%=ValHelper.getInstance().getValue(rolemap,projroleid)%></option><%
}
else
{
%><option class="cellSmall" value="<%=projectroleid%>"><%=ValHelper.getInstance().getValue(rolemap,projectroleid)%></option><%
}
}
%>
</select>
</td>
<td class="cellSmallCenter">
<input type="text" class="cellSmall" name="fromdate<%= i %>" size="11" maxlength="11" value="<%= fromdate %>" onfocus="javascript:changefocus(this);">
</td>
<td class="cellSmallCenter">
<input type="text" class="cellSmall" name="enddate<%= i %>" size="11" maxlength="11" value="<%= enddate %>" onfocus="javascript:changefocus(this);">
</td>
<td class="cellSmallCenter">
<select class="cellSmall" name="billable<%= i %>" size = 1>
<%
if ( ( "T" ).equalsIgnoreCase( billable ) )
{
%>
<option class="cellSmall" selected value="T">Yes</option>
<option class="cellSmall" value="F">No</option>
<%
}
else
{
%>
<option class="cellSmall" selected value="F">No</option>
<option class="cellSmall" value="T">Yes</option>
<%
}
%>
</select>
</td>
<td class="cellSmallCenter">
<select class="cellSmall" name="chargetypeid<%= i %>" size = 1>
<%
Map<String,String> chargetypemap = ProjAssignWebUtil.getInstance().getChargetypemap(request);
Set<String> chargeset = chargetypemap.keySet();
Iterator<String> chargeiter = chargeset.iterator();
while( chargeiter.hasNext() )
{
String chargetypeid = chargeiter.next();
if ( ( chargeid.trim() ).equalsIgnoreCase( chargetypeid.trim() ) )
{
%><option class="cellSmall" selected value="<%=chargeid%>"><%=ValHelper.getInstance().getValue(chargetypemap,chargeid)%></option><%
}
else
{
%><option class="cellSmall" value="<%=chargetypeid%>"><%=ValHelper.getInstance().getValue(chargetypemap,chargetypeid)%></option><%
}
}
%>
</select>
</td>
<td class="cellSmallCenter">
<input type="text" class="cellSmallRight" name="percentageload<%= i %>" size="3" maxlength="3" value="<%= perload %>" onblur="javascript:setratedefault(this);" onfocus="javascript:this.select();">
</td>
<td class="cellSmallCenter">
<input type="text" class="cellSmallRight" name="budgetdays<%= i %>" size="4" maxlength="4" value="<%= bdgtdays %>" onblur="javascript:setratedefault(this);" onfocus="javascript:this.select();">
</td>
<td class="cellSmallCenter">
<input type="text" class="cellSmallRight" name="budgetamount<%= i %>" size="8" maxlength="8" value="<%= bdgtamt %>" onblur="javascript:setratedefault(this);" onfocus="javascript:this.select();">
</td>
</tr>
<%
}
if ( addedrows > 0 )
{
for ( int i = detailsize; i < ( detailsize + addedrows ); i++ )
{
%>
<tr>
<td class="cellSmallCenter">
<input class="cellSmall" type="hidden" name="proassid<%= i %>" value="">
<input type="hidden" name="earliestentrydate<%= i %>" value="">
<input type="hidden" name="latestentrydate<%= i %>" value="">
<input type="hidden" name="hiringdate<%= i %>" value="">
<input type="hidden" name="termdate<%= i %>" value="">
<select class="cellSmall" name="resourceid<%= i %>" size = 1>
<option class="cellSmall" value="">- - - - -</option>
<%
List<RsDropInfo> resourcelist = ProjAssignWebUtil.getInstance().getActiveResourceList(request);
int resourcesize = resourcelist.size();
for( int j = 0; j < resourcesize; j++ )
{
RsDropInfo rinfo = resourcelist.get( j );
%><option class="cellSmall" value="<%=rinfo.getResourceid()%>"><%=rinfo.getName()%></option><%
}
%>
</select>
</td>
<td class="cellSmallCenter">
<select class="cellSmall" name="projectroleid<%= i %>" size = 1>
<option class="cellSmall" value="">- - - - -</option>
<%
Map<String,String> rolemap = ProjAssignWebUtil.getInstance().getRolemap(request);
Set<String> roleset = rolemap.keySet();
Iterator<String> roleiter = roleset.iterator();
while( roleiter.hasNext() )
{
String projectroleid = roleiter.next();
%><option class="cellSmall" value="<%=projectroleid%>"><%=ValHelper.getInstance().getValue(rolemap,projectroleid)%></option><%
}
%>
</select>
</td>
<td class="cellSmallCenter">
<input type="text" class="cellSmall" name="fromdate<%= i %>" size="12" maxlength="12" value="<%= TsDateUtil.getInstance().getDefaultDateStr() %>" onfocus="javascript:changefocus(this);">
</td>
<td class="cellSmallCenter">
<input type="text" class="cellSmall" name="enddate<%= i %>" size="12" maxlength="12" value="<%= projectenddate %>" onfocus="javascript:changefocus(this);">
</td>
<td class="cellSmallCenter">
<select class="cellSmall" name="billable<%= i %>" size = 1>
<option class="cellSmall" value="T">Yes</option>
<option class="cellSmall" value="F" selected>No</option>
</select>
</td>
<td class="cellSmallCenter">
<select class="cellSmall" name="chargetypeid<%= i %>" size = 1>
<%
Map<String,String> chargetypemap = ProjAssignWebUtil.getInstance().getChargetypemap(request);
Set<String> chargeset = chargetypemap.keySet();
Iterator<String> chargeiter = chargeset.iterator();
while( chargeiter.hasNext() )
{
String chargetypeid = chargeiter.next();
%><option class="cellSmall" value="<%=chargetypeid%>"><%=ValHelper.getInstance().getValue(chargetypemap,chargetypeid)%></option><%
}
%>
</select>
</td>
<td class="cellSmallCenter">
<input type="text" class="cellSmallRight" name="percentageload<%= i %>" size="3" maxlength="3" value="0" onblur="javascript:setratedefault(this);" onfocus="javascript:this.select();">
</td>
<td class="cellSmallCenter">
<input type="text" class="cellSmallRight" name="budgetdays<%= i %>" size="4" maxlength="4" value="0" onblur="javascript:setratedefault(this);" onfocus="javascript:this.select();">
</td>
<td class="cellSmallCenter">
<input type="text" class="cellSmallRight" name="budgetamount<%= i %>" size="8" maxlength="8" value="0" onblur="javascript:setratedefault(this);" onfocus="javascript:this.select();">
</td>
</tr>
<%
}
}
%>
</table>
<%
}
%>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<input type="hidden" class="cell" name="clickedbutton" >
<input type="hidden" class="cell" name="rownum" value="<%= rownum %>">
<input type="button" class="cell" value="Update" onclick="this.form.clickedbutton.value='U';savecheck(this.form, 'updateProAssign');">
<input type="Reset" class="cell" value="Reset">
<input type="button" class="cell" value="Cancel" onclick="submitform( this.form, 'displayProAssign');">
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<hr width="750" size="1" noshade>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" align="left">
<tr>
<td width="250" class="txtLabel">Add Resources to Project</td>
<td width="150" class="txtHighlight">Number of Lines:</td>
<td width="80" class="cell">
<select class="cell" name="addlines" size="1">
<option class="cell" selected value="1">1</option>
<option class="cell" value="2">2</option>
<option class="cell" value="3">3</option>
</select>
</td>
<td width="100" class="cell">
<input type="button" class="cell" name="addact" value="Add" onclick="this.form.clickedbutton.value='A';savecheck(this.form, 'addProAssign' )">
</td>
<td width="257"> </td>
</tr>
</table>
</td>
</tr>
<%
}
%>
</table>
</form>
<%
out.print("\n<script language=\"javascript\">\n");
out.print("<!--\n");
out.print(" function validass(theform) {\n");
if ( ! detaillist.isEmpty() )
{
out.print(" if ( theform.resourceid0.value == \"\"\n");
if ( addedrows > 0 )
{
for ( int i = detaillist.size(); i < ( detaillist.size() + addedrows ); i++ )
{
for ( int j = 0; j < detaillist.size(); j++ )
{
out.print(" || theform.resourceid" + i + ".options[theform.resourceid" + i + ".selectedIndex].value == theform.resourceid" + j + ".value\n");
}
}
for ( int i = detaillist.size(); i < ( detaillist.size() + addedrows ); i++ )
{
for ( int j = ( i + 1 ); j < ( detaillist.size() + addedrows ); j++ )
{
out.print(" || theform.resourceid" + i + ".options[theform.resourceid" + i + ".selectedIndex].value == theform.resourceid" + j + ".options[theform.resourceid" + j + ".selectedIndex].value\n");
}
}
}
out.print(" ) {\n");
out.print(" alert(\"Duplicate Project/Resource. \");\n");
out.print(" return false;\n");
out.print(" }\n");
}
out.print(" return true;\n");
out.print(" }\n\n");
//Check has project manager
if ( ValHelper.getInstance().isNotNullAndEmpty(projectid) )
{
out.print(" function hasprojectmanager(theform) {\n");
out.print(" var haspm = false; \n" );
if ( ( detaillist.size() + addedrows ) > 0 )
{
out.print(" haspm = false; \n" );
for ( int i = 0; i < ( detaillist.size() + addedrows ); i++ )
{
out.print(" if ( theform.projectroleid" + i + ".value == 2 ) { \n" );
out.print(" haspm = true;\n");
out.print(" }\n");
}
}
out.print("return haspm;\n");
out.print(" }\n\n");
}
//Check has member end date less than pm end date
if ( ValHelper.getInstance().isNotNullAndEmpty(projectid) )
{
out.print(" function exceedpmenddate(theform) {\n");
out.print(" var exceed = false; \n" );
if ( ( detaillist.size() + addedrows ) > 0 )
{
out.print(" var pmenddate0 ='12345678';\n");
out.print(" var pmenddate ='12345678';\n");
out.print(" var memberenddate ='12345678';\n");
for ( int i = 0; i < ( detaillist.size() + addedrows ); i++ )
{
out.print(" memberenddate = convertdate(theform.enddate" + i + ".value);\n");
out.print(" if(theform.projectroleid" + i + ".value == 2 && memberenddate > pmenddate0 ) { \n" );
out.print(" pmenddate = memberenddate;\n");
out.print(" pmenddate0 = memberenddate;\n");
out.print(" }\n");
}
for ( int i = 0; i < ( detaillist.size() + addedrows ); i++ )
{
out.print(" memberenddate = convertdate(theform.enddate" + i + ".value);\n");
out.print(" memberenddate = convertdate(theform.enddate" + i + ".value);\n");
out.print(" if(memberenddate > pmenddate && theform.projectroleid" + i + ".value != 1) { \n" );
out.print(" alert(\"Assignment End Date can not be beyond Project Manager End Date for Line " + ( i + 1 ) + ".\");\n");
out.print(" exceed = true;\n");
out.print(" }\n");
}
}
out.print("return exceed;\n");
out.print(" }\n\n");
}
if ( ValHelper.getInstance().isNotNullAndEmpty(projectid) )
{
out.print(" function validalldates(theform) {\n");
if ( ( detaillist.size() + addedrows ) > 0 )
{
for ( int i = 0; i < ( detaillist.size() + addedrows ); i++ )
{
out.print(" if ( ! validdates( theform.fromdate" + i + ".value, theform.enddate" + i + ".value ) ) { \n" );
out.print(" alert(\"From Date can not exceed End Date for Line " + ( i + 1 ) + ".\");\n");
out.print(" return false;\n");
out.print(" }\n");
out.print(" if ( ! validdates( '" + projecstartdate + "', theform.fromdate" + i + ".value ) ) { \n" );
out.print(" alert(\"Assignment Start Date can not be prior to Project Start Date for Line " + ( i + 1 ) + ".\");\n");
out.print(" return false;\n");
out.print(" }\n");
out.print(" if ( ! validdates( theform.hiringdate" + i + ".value, theform.fromdate" + i + ".value ) ) { \n" );
out.print(" alert(\"Staff Hiring Date is \" + theform.hiringdate" + i + ".value + \". Project Assignment Start Date prior to the Hiring Date is not allowed in line " + ( i + 1 ) + ".\");\n");
out.print(" return false;\n");
out.print(" }\n");
out.print(" if ( ! validdatesterm( theform.enddate" + i + ".value, theform.termdate" + i + ".value) ) { \n" );
out.print(" alert(\"Staff Terminate Date is \" + theform.termdate" + i + ".value + \". Project Assignment End Date beyond the Terminate Date is not allowed in Line " + ( i + 1 ) + ".\");\n");
out.print(" return false;\n");
out.print(" }\n");
out.print(" if ( ! validdates( theform.enddate" + i + ".value, '" + projectenddate + "') ) { \n" );
out.print(" alert(\"Assignment End Date can not be beyond Project End Date for Line " + ( i + 1 ) + ".\");\n");
out.print(" return false;\n");
out.print(" }\n");
out.print(" if ( ! validdates( theform.fromdate" + i + ".value, theform.earliestentrydate" + i + ".value ) ) { \n" );
out.print(" alert(\'The resource has already filled in the timesheet at ' + theform.earliestentrydate" + i + ".value + ', you can not change the assignment start date beyond ' + theform.earliestentrydate" + i + ".value + ' for Line " + ( i + 1 ) + ".');\n");
out.print(" return false;\n");
out.print(" }\n");
out.print(" if ( ! validdates( theform.latestentrydate" + i + ".value, theform.enddate" + i + ".value ) ) { \n" );
out.print(" alert(\'The resource has already filled in the timesheet at ' + theform.latestentrydate" + i + ".value + ', you can not change the assignment end date prior to ' + theform.latestentrydate" + i + ".value + ' for Line " + ( i + 1 ) + ".');\n");
out.print(" return false;\n");
out.print(" }\n");
}
out.print(" var asssize = 1;\n");
}
else
{
out.print(" var asssize = 0;\n");
}
//Check has project manager
out.print(" if((theform.clickedbutton.value!='A'||asssize!=0)&&!hasprojectmanager(theform)) { \n" );
//out.print(" if(!hasprojectmanager(theform)) { \n" );
out.print(" alert(\'You have to assign at least one project manager.');\n");
out.print(" return false;\n");
out.print(" }\n\n");
//Check has member end date less than pm end date
//out.print(" if(theform.clickedbutton.value!='A'&&exceedpmenddate(theform)) { \n" );
out.print(" if(exceedpmenddate(theform)) { \n" );
out.print(" return false;\n");
out.print(" }\n\n");
out.print(" return true;\n");
out.print(" }\n\n");
}
out.print("// -->\n");
out.print("</script>\n");
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -