📄 projcontrol.jsp.svn-base
字号:
<%@ page import="java.util.List" %>
<%@ page import="com.nsi.components.util.LoginuserUtil" %>
<%@ page import="com.nsi.components.util.info.ProjDropInfo" %>
<%@ page import="com.nsi.components.proactivity.ProActDetail" %>
<%@ page import="com.nsi.components.proactivity.ActInfo" %>
<%@ page import="com.nsi.components.proactivity.ActCatInfo" %>
<%@ page import="com.nsi.components.web.util.ProjActWebUtil" %>
<%@ page import="com.nsi.util.ValHelper" %>
<%
String projectid = ProjActWebUtil.getInstance().getProjectid(request);
String projstatus = ProjActWebUtil.getInstance().getProjectstatus(request);
int addedrows = ProjActWebUtil.getInstance().getAddnum(request);
int rownum = 0;
if ( addedrows > 0 )
{
rownum += addedrows;
}
List<ProActDetail> detaillist = ProjActWebUtil.getInstance().getDetaillist(request);
String projectcode = ProjActWebUtil.getInstance().getPorjectcode(request);
String isffp = ProjActWebUtil.getInstance().isFFP(request);
String issalessupport =ProjActWebUtil.getInstance().isSalessupport(request);
%>
<html>
<head>
<meta http-equiv="content-style-type" content="text/css">
<meta http-equiv="pragma" content="no-cache">
<title>Achievo-RMS Project Control</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 valid = 0;
function savecheck( theform, action )
{
if ( checkvalid( theform ) )
{
submitform( theform, action );
return true;
}
else
{
return false;
}
}
function addcheck( theform, action )
{
if ( checkvalid( theform ) && checkinserttype(theform) )
{
submitform( theform, action );
return true;
}
else
{
return false;
}
}
function checkvalid( theform )
{
if ( valid == 1 )
{
valid = 0;
return false;
}
else
{
if ( ! validact(theform) )
{
return false;
}
else
{
return true;
}
}
}
function submitform( theform, action )
{
theform.action.value = action;
theform.submit();
}
function cancelform( theform )
{
theform.urlmapping.value = "/project/projctlmenu" ;
theform.submit() ;
}
function checkinserttype(theform)
{
var radiochecked = false;
for ( var i = 0; i < theform.inserttype.length; i++ )
{
if( theform.inserttype[i].checked == true )
{
radiochecked = true;
}
}
if(!radiochecked)
{
alert('Please select activity type to be added!');
}
if(theform.inserttype[0].checked&&theform.actcatid.selectedIndex==0)
{
alert('Please select an activity category!');
radiochecked = false;
}
if(theform.inserttype[0].checked&&theform.actcatid.selectedIndex==1)
{
if(theform.isffp.value=="F")
{
if(confirm("Do you want to add all PS activities to the non-FFP project?"))
{
radiochecked = true;
}
else
{
radiochecked = false;
}
}
}
if(theform.isffp.value=="T"&&theform.inserttype[0].checked&&theform.actcatid.value==4)
{
alert("Not allow to add Internal activities to non-internal project.");
radiochecked = false;
}
if(theform.inserttype[0].checked&&theform.actcatid.value==13)
{
if(theform.issalessupport.value=="F")
{
alert("Not allow to add Marketing activities to non-marketing related project.");
radiochecked = false;
}
}
return radiochecked;
}
//-->
</script>
</head>
<body>
<h1>Project Control</h1>
<form name="project_ctl_form" method="post" action="/rms/mainservlet" >
<input type="hidden" name="urlmapping" value="/project/projact">
<input type="hidden" name="projectcode" value="<%=projectcode%>">
<input type="hidden" name="action" value="displayProAct">
<input type="hidden" name="isffp" value="<%=isffp%>">
<input type="hidden" name="issalessupport" value="<%=issalessupport%>">
<table width="837" border="0" cellpadding="0" cellspacing="0" align="left">
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" align="left">
<tr>
<td width="120" class="txtLabel">Project Name</td>
<td width="400" class="cell">
<select class="cell" name="projectid" size = 1>
<%
List<ProjDropInfo> list = ProjActWebUtil.getInstance().getProjectlist(request);
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 class="cell" value="Display & Modify" type="button" name ="pbshow" onclick="submitform( this.form, 'displayProAct');">
</td>
</tr>
<tr>
<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> All
<input type="radio" class="cell" name="projectstatus" value="" > All Active
<%
}
else
{
%>
<input type="radio" class="cell" name="projectstatus" value="A" > All
<input type="radio" class="cell" name="projectstatus" value="" checked> All Active
<%
}
%>
</td>
<td> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<%
if ( ValHelper.getInstance().isNotNullAndEmpty(projectid) )
{
%>
<tr>
<td width="660">
<%
if ( detaillist.isEmpty() && addedrows <= 0 )
{
%>
<table cellpadding="0" cellspacing="0" align="left" border="0">
<tr>
<td class="txtHighlight">There is no activity assigned to this project !</td>
</tr>
</table>
<%
}
else
{
%>
<table cellpadding="0" cellspacing="0" align="left" border="1">
<tr>
<td width="500" class="cellHeader">Activity</td>
<td width="80" class="cellHeader">Active</td>
<td width="80" class="cellHeader">Billable</td>
</tr>
<%
if ( ! detaillist.isEmpty() )
{
int detailsize = detaillist.size();
rownum += detailsize;
for ( int i = 0; i < detailsize; i++ )
{
ProActDetail actdetail = detaillist.get( i );
String proactid = actdetail.getProactid();
String actid = actdetail.getActid();
String activity = ProjActWebUtil.getInstance().getActdesc(request, actid );
String billable = actdetail.getBillable();
String active = actdetail.getActive();
%>
<tr>
<td class="txt">
<input type="hidden" class="cell" name="proactid<%= i %>" value="<%=proactid%>">
<input type="hidden" class="cell" name="actid<%= i %>" value="<%= actid %>"> <%=activity%>
</td>
<td class="cellCenter">
<select class="cell" name="active<%= i %>" size = 1>
<%
if ( ( "T" ).equalsIgnoreCase( active ) )
{
%>
<option class="cell" selected value="T">Yes</option>
<option class="cell" value="F">No</option>
<%
}
else
{
%>
<option class="cell" selected value="F">No</option>
<option class="cell" value="T">Yes</option>
<%
}
%>
</select>
</td>
<td class="cellCenter">
<select class="cell" name="billable<%= i %>" size = 1>
<%
if ( ( "T" ).equalsIgnoreCase( billable ) )
{
%>
<option class="cell" selected value="T">Yes</option>
<option class="cell" value="F">No</option>
<%
}
else
{
%>
<option class="cell" selected value="F">No</option>
<option class="cell" value="T">Yes</option>
<%
}
%>
</select>
</td>
</tr>
<%
}
}
if ( addedrows > 0 )
{
for ( int i = detaillist.size(); i < ( detaillist.size() + addedrows ); i++ )
{
%>
<tr>
<td class="cell">
<input type="hidden" class="cell" name="proactid<%= i %>" value="">
<select class="cell" name="actid<%= i %>" size = 1>
<option class="cell" value="">- - - - -</option>
<%
List<ActInfo> actlist = ProjActWebUtil.getInstance().getActlist(request);
int actsize = actlist.size();
for ( int j = 0; j < actsize; j++ )
{
ActInfo actinfo = actlist.get( j );
%><option class="cell"value="<%=actinfo.getActid()%>"><%=actinfo.getActdesc()%></option><%
}
%>
</select>
</td>
<td class="cellCenter">
<select class="cell" name="active<%= i %>" size = 1>
<option class="cell" value="">- - - - -</option>
<option class="cell" value="T">Yes</option>
<option class="cell" value="F">No</option>
</select>
</td>
<td class="cellCenter">
<select class="cell" name="billable<%= i %>" size = 1>
<option class="cell" value="">- - - - -</option>
<option class="cell" value="T">Yes</option>
<option class="cell" value="F">No</option>
</select>
</td>
</tr>
<%
}
}
%>
</table>
<%
}
%>
</td>
<td width="177"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2">
<input class="cell" type="hidden" name="rownum" value="<%= rownum %>">
<input class="cell" value="Update" type="button" onclick="savecheck(this.form, 'updateProAct');">
<input class="cell" value="Reset" type="Reset">
<input class="cell" value="Cancel" type="button" onclick="submitform( this.form, 'displayProAct');">
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2">
<hr width="750" size="1" noshade>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" align="left">
<tr>
<td width="20" ><input type="radio" name="inserttype" value="1"></td>
<td width="370" class="txtLabel"> Add Activity Category Group to Project</td>
<td width="80" class="cell">
<select class="cell" name="actcatid" size = 1>
<option class="cell" value="0" selected> -- Select an activity category --</option>
<option class="cell" value="1,2,3,5,6,7,8,9,10,11,12,14" >Professional Services</option>
<option class="cell" value="13">Marketing</option>
<%
List<ActCatInfo> actcatlist = ProjActWebUtil.getInstance().getActcatlist(request);
int actcatsize = actcatlist.size();
for ( int i = 0; i < actcatsize; i++ )
{
ActCatInfo actcatinfo =actcatlist.get( i );
%><option class="cell" value="<%=actcatinfo.getActcatid()%>"><%=actcatinfo.getDesc()%></option><%
}
%>
</select>
</td>
<td width="100" class="cell">
</td>
<td width="307" > </td>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" align="left">
<tr>
<td width="20" ><input type="radio" name="inserttype" value="2"></td>
<td width="370" class="txtLabel"> Add Individual Activity to Project</td>
<td width="150" class="txtHighlight">Number of Lines:</td>
<td width="80" class="cell">
<select class="cell" name="addlines" size="1">
<%
for( int j = 1; j < 11 ; j++ )
{
%><option class="cell" value="<%=j%>"><%=j%></option><%
}
%>
</select>
</td>
<td width="100" class="cell">
</td>
<td width="307" > </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<input class="cell" type="button" name="addact" value="Add" onclick="addcheck(this.form, 'addProAct' )">
</td>
</tr>
<%
}
%>
</table>
</form>
<%
out.print("\n<script language=\"javascript\">\n");
out.print("<!--\n");
out.print(" function validact(theform) {\n");
if ( ! detaillist.isEmpty() )
{
out.print(" if ( theform.actid0.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.actid" + i + ".options[theform.actid" + i + ".selectedIndex].value == theform.actid" + 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.actid" + i + ".options[theform.actid" + i + ".selectedIndex].value == theform.actid" + j + ".options[theform.actid" + j + ".selectedIndex].value\n");
}
}
}
out.print(" ) {\n");
out.print(" alert(\"Duplicate Project/Activity. \");\n");
out.print(" return false;\n");
out.print(" }\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 + -