%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
' View Release Notification Details
' form_view_release_notifications.asp
'=====================================================
Option explicit
' Good idea to set when using redirect
Response.Expires = 0 ' always load the page, dont store
%>
<%
' Make sure rtag_id is always present
If Request("proj_id") = "" Then
Call Destroy_All_Objects
Response.Redirect("index.asp")
End If
' Set rfile parameter. This is a return page after Login
Call objPMod.StoreParameter ( "rfile", "dependencies.asp" )
'------------ ACCESS CONTROL ------------------
%>
<%
'------------ Variable Definition -------------
Dim sPrevPage
Dim parProjId
Dim canDelete
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parProjId = Request("proj_id")
sPrevPage = QStrParDefault("prevPage", Request.ServerVariables("HTTP_REFERER"))
canDelete = canActionControlInProject("AdminView")
'--------------------------------------------------------------------------------------------------------------------------
' notifications_query_string
'
' DESCRIPTION
' Constructs a query string using the provided notification information
'
Function notifications_query_string()
notifications_query_string = _
"SELECT p.PKG_NAME, " & _
" p.pkg_id, " & _
" u.user_id, " & _
" u.FULL_NAME, " & _
" u.USER_EMAIL, " & _
" u.IS_DISABLED " & _
"FROM PACKAGE_INTEREST pi, " & _
" USERS u, " & _
" PACKAGES p " & _
"WHERE pi.USER_ID = u.USER_ID " & _
"AND pi.PROJ_ID = :PROJ_ID " & _
"AND p.PKG_ID = pi.PKG_ID " & _
"ORDER BY UPPER(PKG_NAME), " & _
" UPPER(FULL_NAME)"
End Function
'--------------------------------------------------------------------------------------------------------------------------
' PV_ID_ListHTML
'
' DESCRIPTION
' Constructs the HTML to render the rows of package names, and other information
'
Function PV_ID_ListHTML
Dim rsQry
Dim html_string
Dim lastPkgId : lastPkgId = 0
Dim thisPkgId
OraDatabase.Parameters.Add "PROJ_ID", parProjId, ORAPARM_INPUT, ORATYPE_NUMBER
Set rsQry = OraDatabase.DbCreateDynaset( notifications_query_string(), cint(0) )
OraDatabase.Parameters.Remove "PROJ_ID"
'--- Render rows ---
Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
' BEGIN ROW
html_string = html_string & "
"
' PACKAGE NAME
thisPkgId = rsQry("pkg_id")
Dim eClass : eClass = ""
Dim pName : pName = rsQry("pkg_name")
If lastPkgId <> thisPkgId Then
lastPkgId = thisPkgId
Else
eClass = " invisible"
End If
html_string = html_string & "
" & rsQry("pkg_name") & "
"
' User Name, with email as hyperlink
Dim userImage : userImage = LIMG_USER_DISABLED
If isNull(rsQry("is_DISABLED")) Then
userImage = LIMG_USER
End If
html_string = html_string & "
"
' Operation
Dim DelUserImage : DelUserImage = LIMG_NDEL_DISABLED
Dim btnText : btnText = "Operation not available"
Dim btnClass : btnClass = ""
If canDelete OR objAccessControl.UserId = rsQry("user_id") Then
DelUserImage = LIMG_NDEL
btnText = "Remove notifications to this user"
btnClass = "class=btn_delete"
End If
html_string = html_string & "
" & DelUserImage & "
"
' END ROW
html_string = html_string & "
"
rsQry.MoveNext
' ROW SEPERATOR
If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
html_string = html_string & "
"
End If
Loop
' destroy objects
rsQry.Close()
Set rsQry = nothing
' return result
PV_ID_ListHTML = html_string
End Function
'--------------------------------------------------------------------------------------------------------------------------
'--------------------------------------------------------------------------------------------------------------------------
'------------ RUN BEFORE PAGE RENDER ----------
'----------------------------------------------
%>
Release Manager