<%@ 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 %> Inbox
<% 'Three cases of what to show here: Buyer, TM, and General Select Case Session("SecurityProfile") Case "Buyer" %> <% If iNumBuyerApprovals > 0 Then For i = 1 to iNumBuyerApprovals %> <% rsBuyerApprovals.MoveNext Next End If %>
Buyer Approvals
Product Name SKU Project
"> <%= rsBuyerApprovals("ProductName") %> "> <%= rsBuyerApprovals("SKU") %> <%= rsBuyerApprovals("TypeDescription") %>
<% 'end of stuff to list for buyer 'now, TM... Case "TM" %> <% If iNumUpdates > 0 Then For i = 1 to iNumUpdates %> <% rsUpdates.MoveNext Next End If %> <% If iNumUnassigned > 0 Then For i = 1 to iNumUnassigned %> <% rsUnassigned.MoveNext Next End If %>
Recent Updates
Product Name SKU Project Type Current Task Step
"> <%= rsUpdates("ProductName") %> "> <%= rsUpdates("SKU") %> <%= rsUpdates("TypeDescription") %> <%= rsUpdates("TaskDescription") %> <% If isNull(rsUpdates("AssignedDateTime")) Then %> Assign <% Else %> Review <% End If %>
Unassigned Projects
Product Name SKU Project Type Current Task Step
"> <%= rsUnassigned("ProductName") %> "> <%= rsUnassigned("SKU") %> <%= rsUnassigned("TypeDescription") %> Unassigned
<% If iNumNewComments > 0 Then For i = 1 to iNumNewComments %> <% rsNewComments.MoveNext Next End If %>
Comments:
Date User Product Name Project Type Comments
<%= 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("Comment") %>
<% 'end of stuff to list for TM 'now, General ... Case "General" %> <% If iNumProjects > 0 Then For i = 1 to iNumProjects %> <% rsProjectInbox.MoveNext Next End If End Select %>
Current Projects
Product Name SKU Project Current Task End
"> <%= rsProjectInbox("ProductName") %> "> <%= rsProjectInbox("SKU") %> <%= rsProjectInbox("TypeDescription") %> <%= rsProjectInbox("TaskDescription") %> <%= rsProjectInbox("TargetEndDate") %>