Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|	           		RequestViewCointent.asp			 |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
12
Response.Expires = 0	' always load the page, dont store
13
%>
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<%
20
'------------ Variable Definition -------------
21
Dim rsView
22
Dim sURL
23
Dim IMG_locked
24
Dim relContentsSTR
25
Dim parScriptName
26
Dim parRtagId
27
Dim nOperation
28
 
29
'------------ Constants Declaration -----------
30
Const LIMG_LOCKED = "<img src='images/i_locked.gif' width='7' height='10' border='0' hspace='2'>"
31
Const imgAdded     = "<img src='images/i_added.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='To Be Added'>"
32
Const imgRemoved   = "<img src='images/i_removed.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='To Be Removed'>"
33
'------------ Variable Init -------------------
34
parScriptName = Request("script_name")
35
parRtagId = Request("rtag_id")
36
'----------------------------------------------
37
%>
38
<%
39
'------------------------------------------------------------------------------------------------------------------------
40
'------------------------------------------------------------------------------------------------------------------------
41
%>
42
<%
43
'------------------------ MAIN LINE ---------------------------------
44
If (Request("envtab") = "")  OR  (Request("rtag_id") = "")  OR  (Request("view_id") = "")  OR  (Request("script_name") = "") Then
45
	Response.write "ERROR: Missing Parameters at "& ScriptName
46
End If
47
'--------------------------------------------------------------------
48
%>
49
 
50
<%
51
OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id"), 	ORAPARM_INPUT, ORATYPE_NUMBER
52
OraDatabase.Parameters.Add "VIEW_ID", Request("view_id"), 	ORAPARM_INPUT, ORATYPE_NUMBER
53
OraDatabase.Parameters.Add "RECORD_SET",			NULL, 	ORAPARM_OUTPUT, 	ORATYPE_CURSOR
54
 
55
 
56
 
57
 
58
' Decide which environment list is to be displayed
59
Select Case CInt( Request("envtab") )
60
	Case enumENVTAB_WORK_IN_PROGRESS
61
		OraDatabase.ExecuteSQL "BEGIN  PK_WORK_IN_PROGRESS.GET_VIEW_CONTENT ( :RTAG_ID, :VIEW_ID, :RECORD_SET );  END;"
62
 
63
	Case enumENVTAB_PLANNED
64
		OraDatabase.ExecuteSQL "BEGIN  PK_PLANNED.GET_VIEW_CONTENT ( :RTAG_ID, :VIEW_ID, :RECORD_SET );  END;"
65
 
66
	Case enumENVTAB_RELEASED
67
		OraDatabase.ExecuteSQL "BEGIN  PK_RELEASE.GET_VIEW_CONTENT ( :RTAG_ID, :VIEW_ID, :RECORD_SET );  END;"
68
 
69
	Case Else
70
		OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_VIEW_CONTENT ( :RTAG_ID, :VIEW_ID, :RECORD_SET );  END;"
71
 
72
End Select
73
 
74
Set rsView = OraDatabase.Parameters("RECORD_SET").Value
75
 
76
OraDatabase.Parameters.Remove "RTAG_ID"
77
OraDatabase.Parameters.Remove "VIEW_ID"
78
OraDatabase.Parameters.Remove "RECORD_SET"
79
 
80
 
81
' Retrun if no records found
82
If rsView.RecordCount < 1 Then
83
	relContentsSTR = "No packages found."
84
End If
85
 
86
' Get view content
87
While ((NOT rsView.BOF) AND (NOT rsView.EOF))
88
 
89
	sURL = parScriptName &"?pv_id="& rsView("pv_id") &"&rtag_id="& parRtagId
90
	IMG_locked = ""
91
 
92
	If rsView.Fields("dlocked") = "Y" Then IMG_locked = LIMG_LOCKED
93
 
94
	' DEVI-45275 - Normally, dlocked=Y items are denoted with a padlock icon on the web page. Since we can now merge
95
	' into the pending tab, the dlocked=Y items that end up there would not give any visual indication to the user
96
	' as to why they are present. So, instead of the padlock icon, display the added or removed icon to indicate
97
	' what the intended action is to be, once the pending item is approved.
98
	' Obviously, this functionality only applies if viewing the PENDING or ALL environment tabs.
99
	' With regard to the operation value, A = Added, S = Subtracted
100
	nOperation = " "
101
	If (CInt(Request("envtab")) = enumENVTAB_PLANNED OR CInt(Request("envtab")) = enumENVTAB_ALL) Then
102
		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
103
		If nOperation = "A" Then
104
			IMG_locked = imgAdded
105
		ElseIf nOperation = "S" Then
106
			IMG_locked = imgRemoved
107
		End If
108
	End If
109
 
110
	relContentsSTR = relContentsSTR & "<tr>" & VBNewLine
111
 
112
	If rsView("pkg_state") = 0 And rsView.Fields("deprecated_state") <> "" Then
113
		relContentsSTR = relContentsSTR & "  <td width='1%'>"& DefineStateIcon ( rsView.Fields("deprecated_state"), rsView("dlocked"), NULL, NULL, rsView("build_type"), TRUE ) &"</td>"& VBNewLine
114
	Else
115
		relContentsSTR = relContentsSTR & "  <td width='1%'>"& DefineStateIcon ( rsView("pkg_state"), rsView("dlocked"), NULL, NULL, rsView("build_type"), TRUE ) &"</td>"& VBNewLine
116
	End If
117
 
118
	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
119
	relContentsSTR = relContentsSTR & "  <td width='1%' nowrap class='envPkg'>"& rsView.Fields("pkg_version") &"</td>" & VBNewLine
120
	relContentsSTR = relContentsSTR & "  <td width='1%'>"& IMG_locked &"</td>"
121
	relContentsSTR = relContentsSTR & "</tr>" & VBNewLine
122
 
123
	rsView.MoveNext
124
WEnd
125
 
126
 
127
rsView.Close
128
Set rsView = nothing
129
 
130
 
131
relContentsSTR = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>" & relContentsSTR & "</table>"
132
 
133
 
134
' Response the content
135
Response.write relContentsSTR
136
 
137
%>
138
 
139
 
140
<%
141
Call Destroy_All_Objects
142
%>