Subversion Repositories DevTools

Rev

Rev 119 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                              RequestViewCointent.asp                  |
'|                                                   |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0    ' always load the page, dont store
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<%
'------------ Variable Definition -------------
Dim rsView
Dim sURL
Dim IMG_locked
Dim relContentsSTR
Dim parScriptName
Dim parRtagId
Dim nOperation

'------------ Constants Declaration -----------
Const LIMG_LOCKED = "<img src='images/i_locked.gif' width='7' height='10' border='0' hspace='2'>"
Const imgAdded     = "<img src='images/i_added.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='To Be Added'>"
Const imgRemoved   = "<img src='images/i_removed.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='To Be Removed'>"
'------------ Variable Init -------------------
parScriptName = Request("script_name")
parRtagId = Request("rtag_id")
'----------------------------------------------
%>
<%
'------------------------------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------------------ MAIN LINE ---------------------------------
If (Request("envtab") = "")  OR  (Request("rtag_id") = "")  OR  (Request("view_id") = "")  OR  (Request("script_name") = "") Then
        Response.write "ERROR: Missing Parameters at "& ScriptName
End If
'--------------------------------------------------------------------
%>

<%
OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id"),       ORAPARM_INPUT, ORATYPE_NUMBER
OraDatabase.Parameters.Add "VIEW_ID", Request("view_id"),       ORAPARM_INPUT, ORATYPE_NUMBER
OraDatabase.Parameters.Add "RECORD_SET",                        NULL,   ORAPARM_OUTPUT,         ORATYPE_CURSOR




' Decide which environment list is to be displayed
Select Case CInt( Request("envtab") )
        Case enumENVTAB_WORK_IN_PROGRESS
                OraDatabase.ExecuteSQL "BEGIN  PK_WORK_IN_PROGRESS.GET_VIEW_CONTENT ( :RTAG_ID, :VIEW_ID, :RECORD_SET );  END;"

        Case enumENVTAB_PLANNED
                OraDatabase.ExecuteSQL "BEGIN  PK_PLANNED.GET_VIEW_CONTENT ( :RTAG_ID, :VIEW_ID, :RECORD_SET );  END;"

        Case enumENVTAB_RELEASED
                OraDatabase.ExecuteSQL "BEGIN  PK_RELEASE.GET_VIEW_CONTENT ( :RTAG_ID, :VIEW_ID, :RECORD_SET );  END;"

        Case Else
                OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_VIEW_CONTENT ( :RTAG_ID, :VIEW_ID, :RECORD_SET );  END;"

End Select

Set rsView = OraDatabase.Parameters("RECORD_SET").Value

OraDatabase.Parameters.Remove "RTAG_ID"
OraDatabase.Parameters.Remove "VIEW_ID"
OraDatabase.Parameters.Remove "RECORD_SET"


' Retrun if no records found
If rsView.RecordCount < 1 Then
        relContentsSTR = "No packages found."
End If

' Get view content
While ((NOT rsView.BOF) AND (NOT rsView.EOF))

        sURL = parScriptName &"?pv_id="& rsView("pv_id") &"&rtag_id="& parRtagId
        IMG_locked = ""

        If rsView.Fields("dlocked") = "Y" Then IMG_locked = LIMG_LOCKED

        ' DEVI-45275 - Normally, dlocked=Y items are denoted with a padlock icon on the web page. Since we can now merge
        ' into the pending tab, the dlocked=Y items that end up there would not give any visual indication to the user
        ' as to why they are present. So, instead of the padlock icon, display the added or removed icon to indicate
        ' what the intended action is to be, once the pending item is approved.
        ' Obviously, this functionality only applies if viewing the PENDING or ALL environment tabs.
        ' With regard to the operation value, A = Added, S = Subtracted
        nOperation = " "
        If (CInt(Request("envtab")) = enumENVTAB_PLANNED OR CInt(Request("envtab")) = enumENVTAB_ALL) Then
                nOperation = rsView.Fields("operation") ' NB. this field is only availble if earlier query was PK_PLANNED.GET_VIEW_CONTENT or PK_ENVIRONMENT.GET_VIEW_CONTENT
                If nOperation = "A" Then
                        IMG_locked = imgAdded
                ElseIf nOperation = "S" Then
                        IMG_locked = imgRemoved
                End If
        End If

        relContentsSTR = relContentsSTR & "<tr>" & VBNewLine

        If rsView("pkg_state") = 0 And rsView.Fields("deprecated_state") <> "" Then
                relContentsSTR = relContentsSTR & "  <td width='1%'>"& DefineStateIcon ( rsView.Fields("deprecated_state"), rsView("dlocked"), NULL, NULL, rsView("build_type"), TRUE ) &"</td>"& VBNewLine
        Else
                relContentsSTR = relContentsSTR & "  <td width='1%'>"& DefineStateIcon ( rsView("pkg_state"), rsView("dlocked"), NULL, NULL, rsView("build_type"), TRUE ) &"</td>"& VBNewLine
        End If

        relContentsSTR = relContentsSTR & "  <td width='100%' nowrap><a href='"& sURL &"' class='body_txt_drk' title="""& HTMLEncode( rsView("pv_description") ) &""">"& rsView.Fields("pkg_name") &"</a></td>" & VBNewLine
        relContentsSTR = relContentsSTR & "  <td width='1%' nowrap class='envPkg'>"& rsView.Fields("pkg_version") &"</td>" & VBNewLine
        relContentsSTR = relContentsSTR & "  <td width='1%'>"& IMG_locked &"</td>"
        relContentsSTR = relContentsSTR & "</tr>" & VBNewLine

        rsView.MoveNext
WEnd


rsView.Close
Set rsView = nothing


relContentsSTR = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>" & relContentsSTR & "</table>"


' Response the content
Response.write relContentsSTR

%>


<%
Call Destroy_All_Objects
%>