%@ Language=VBScript %>
<%
Dim msg ' for errors
Dim i, sStyleString 'for looping and positioning
'grab the security profile session variable, and then
'set the PageMode and get the appropriate recordsets
Select Case Session("SecurityProfile")
Case "TM"
Session("PageMode") = "Edit"
Dim rsUpdates, rsUnassigned, rsNewComments
Dim iNumUpdates, iNumUnassigned, iNumNewComments
iNumUpdates = 0
iNumUnassigned = 0
iNumNewComments = 0
Set rsUpdates = Server.CreateObject("ADODB.Recordset")
Set rsUnassigned = Server.CreateObject("ADODB.Recordset")
Set rsNewComments = Server.CreateObject("ADODB.Recordset")
'get list of updated projects if they exist
If oBS.ListProjectsUpdated(rsUpdates) Then
iNumUpdates = rsUpdates.RecordCount
End If
'get list of unassigned projects if they exist
If oBS.ListProjectsUnassigned(rsUnassigned) Then
iNumUnassigned = rsUnassigned.RecordCount
End If
'get list of new comments if they exist
If oBS.ListNewComments(rsNewComments) Then
iNumNewComments = rsNewComments.RecordCount
End If
Case "Buyer"
Session("PageMode") = "Edit"
'write UserID session variable into normal string variable sUserID.
Dim sUserID
sUserID = Session("UserID")
'buyer's assistants see their boss' inbox
Select Case sUserID
Case "Dfay"
sUserID = "Carchard"
Case "Elihzis"
sUserID = "Srubenstein"
Case "Lperry"
sUserID = "Pnowak"
Case "Kbourque"
sUserID = "Lparrella"
Case "Ltheriault"
sUserID = "RWoodard"
End Select 'end buyer's assistant inbox redirects
'get list of buyer approvals, if they exist
Dim rsBuyerApprovals
Dim iNumBuyerApprovals
iNumBuyerApprovals = 0
Set rsBuyerApprovals = Server.CreateObject("ADODB.Recordset")
If oBS.ListBuyerApprovals(rsBuyerApprovals,sUserID) Then
iNumBuyerApprovals = rsBuyerApprovals.RecordCount
End If
Case "General"
Session("PageMode") = "View"
Dim rsProjectInbox
Dim iNumProjects
iNumProjects = 0
Set rsProjectInbox = Server.CreateObject("ADODB.Recordset")
'get the list of current projects for the user's Team
'first need to get TeamID from UserID Session Variable
Dim rsUser
Set rsUser = Server.CreateObject("ADODB.Recordset")
oBS.GetUsers rsUser,Session("UserID")
If oBS.ListProjectInbox(rsProjectInbox,CInt(rsUser("TeamID"))) Then
iNumProjects = rsProjectInbox.RecordCount
End If
End Select
%>
<%
'Three cases of what to show here: Buyer, TM, and General
Select Case Session("SecurityProfile")
Case "Buyer"
%>
<%
'end of stuff to list for buyer
'now, TM...
Case "TM"
%>
| Recent Updates |
|
Product Name |
SKU |
Project Type |
Current Task |
Step |
<%
If iNumUpdates > 0 Then
For i = 1 to iNumUpdates
%>
|
">
<%= rsUpdates("ProductName") %> |
">
<%= rsUpdates("SKU") %> |
<%= rsUpdates("TypeDescription") %> |
<%= rsUpdates("TaskDescription") %> |
<% If isNull(rsUpdates("AssignedDateTime")) Then %>
Assign
<% Else %>
Review
<% End If %>
|
<%
rsUpdates.MoveNext
Next
End If
%>
| Unassigned Projects |
|
Product Name |
SKU |
Project Type |
Current Task |
Step |
<%
If iNumUnassigned > 0 Then
For i = 1 to iNumUnassigned
%>
|
">
<%= rsUnassigned("ProductName") %>
|
">
<%= rsUnassigned("SKU") %>
|
<%= rsUnassigned("TypeDescription") %> |
|
Unassigned |
<%
rsUnassigned.MoveNext
Next
End If
%>
| Comments: |
|
Date |
User |
Product Name |
Project Type |
Comments |
<%
If iNumNewComments > 0 Then
For i = 1 to iNumNewComments
%>
|
<%= dateValue(rsNewComments("DateTime")) %> |
<%= rsNewComments("UserID") %> |
<%
'direct TM to Product Comments page if comment is Product Level...
If rsNewComments("ProjectID") = 0 or _
isNull(rsNewComments("ProjectID")) Then
%>
">
<%= rsNewComments("ProductName") %>
<%
'Else, direct TM to Project Comments page.
Else
%>
">
<%= rsNewComments("ProductName") %>
<%
End If 'end if product/project comments hyperlink choices
%>
|
<% If rsNewComments("ProjectID") <> 0 Then %>
<%= rsNewComments("TypeDescription") %>
<% End If %>
|
<%
rsNewComments.MoveNext
Next
End If
%>
<%
'end of stuff to list for TM
'now, General ...
Case "General"
%>
| Current Projects |
|
Product Name |
SKU |
Project |
Current |
Task End |
<%
If iNumProjects > 0 Then
For i = 1 to iNumProjects
%>
|
">
<%= rsProjectInbox("ProductName") %>
|
">
<%= rsProjectInbox("SKU") %>
|
<%= rsProjectInbox("TypeDescription") %> |
<%= rsProjectInbox("TaskDescription") %> |
<%= rsProjectInbox("TargetEndDate") %> |
<%
rsProjectInbox.MoveNext
Next
End If
End Select
%>