Subversion Repositories DevTools

Rev

Go to most recent revision | Details | 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
4389 dpurdie 28
Dim checked
29
Dim disabled
30
Dim ReleaseMode
31
Dim parDview      ' enable/disable   deployment   view.
119 ghuddy 32
 
4389 dpurdie 33
 
119 ghuddy 34
'------------ Constants Declaration -----------
35
Const LIMG_LOCKED = "<img src='images/i_locked.gif' width='7' height='10' border='0' hspace='2'>"
36
Const imgAdded     = "<img src='images/i_added.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='To Be Added'>"
37
Const imgRemoved   = "<img src='images/i_removed.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='To Be Removed'>"
38
'------------ Variable Init -------------------
39
parScriptName = Request("script_name")
40
parRtagId = Request("rtag_id")
4389 dpurdie 41
parDview = "disabled"
119 ghuddy 42
'----------------------------------------------
43
%>
44
<%
45
'------------------------------------------------------------------------------------------------------------------------
46
'------------------------------------------------------------------------------------------------------------------------
47
%>
48
<%
49
'------------------------ MAIN LINE ---------------------------------
50
If (Request("envtab") = "")  OR  (Request("rtag_id") = "")  OR  (Request("view_id") = "")  OR  (Request("script_name") = "") Then
51
	Response.write "ERROR: Missing Parameters at "& ScriptName
52
End If
4389 dpurdie 53
ReleaseMode = GetReleaseMode(parRtagId)
54
 
119 ghuddy 55
'--------------------------------------------------------------------
56
%>
57
 
58
<%
59
OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id"), 	ORAPARM_INPUT, ORATYPE_NUMBER
60
OraDatabase.Parameters.Add "VIEW_ID", Request("view_id"), 	ORAPARM_INPUT, ORATYPE_NUMBER
61
OraDatabase.Parameters.Add "RECORD_SET",			NULL, 	ORAPARM_OUTPUT, 	ORATYPE_CURSOR
62
 
63
 
64
 
65
 
66
' Decide which environment list is to be displayed
67
Select Case CInt( Request("envtab") )
68
	Case enumENVTAB_WORK_IN_PROGRESS
69
		OraDatabase.ExecuteSQL "BEGIN  PK_WORK_IN_PROGRESS.GET_VIEW_CONTENT ( :RTAG_ID, :VIEW_ID, :RECORD_SET );  END;"
70
 
71
	Case enumENVTAB_PLANNED
72
		OraDatabase.ExecuteSQL "BEGIN  PK_PLANNED.GET_VIEW_CONTENT ( :RTAG_ID, :VIEW_ID, :RECORD_SET );  END;"
73
 
74
	Case enumENVTAB_RELEASED
75
		OraDatabase.ExecuteSQL "BEGIN  PK_RELEASE.GET_VIEW_CONTENT ( :RTAG_ID, :VIEW_ID, :RECORD_SET );  END;"
76
 
77
	Case Else
78
		OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_VIEW_CONTENT ( :RTAG_ID, :VIEW_ID, :RECORD_SET );  END;"
79
 
80
End Select
81
 
82
Set rsView = OraDatabase.Parameters("RECORD_SET").Value
83
 
84
OraDatabase.Parameters.Remove "RTAG_ID"
85
OraDatabase.Parameters.Remove "VIEW_ID"
86
OraDatabase.Parameters.Remove "RECORD_SET"
87
 
88
 
89
' Retrun if no records found
90
If rsView.RecordCount < 1 Then
91
	relContentsSTR = "No packages found."
92
End If
93
 
94
' Get view content
95
While ((NOT rsView.BOF) AND (NOT rsView.EOF))
96
 
97
	sURL = parScriptName &"?pv_id="& rsView("pv_id") &"&rtag_id="& parRtagId
98
	IMG_locked = ""
99
 
100
	If rsView.Fields("dlocked") = "Y" Then IMG_locked = LIMG_LOCKED
101
 
102
	' DEVI-45275 - Normally, dlocked=Y items are denoted with a padlock icon on the web page. Since we can now merge
103
	' into the pending tab, the dlocked=Y items that end up there would not give any visual indication to the user
104
	' as to why they are present. So, instead of the padlock icon, display the added or removed icon to indicate
105
	' what the intended action is to be, once the pending item is approved.
106
	' Obviously, this functionality only applies if viewing the PENDING or ALL environment tabs.
107
	' With regard to the operation value, A = Added, S = Subtracted
108
	nOperation = " "
109
	If (CInt(Request("envtab")) = enumENVTAB_PLANNED OR CInt(Request("envtab")) = enumENVTAB_ALL) Then
110
		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
111
		If nOperation = "A" Then
112
			IMG_locked = imgAdded
113
		ElseIf nOperation = "S" Then
114
			IMG_locked = imgRemoved
115
		End If
116
	End If
117
 
118
	relContentsSTR = relContentsSTR & "<tr>" & VBNewLine
119
 
4389 dpurdie 120
         If rsView("pkg_state") = 0 And rsView.Fields("deprecated_state") <> "" Then
121
            relContentsSTR = relContentsSTR & "  <td width='1%'>"& DefineStateIcon ( rsView.Fields("deprecated_state"), rsView("dlocked"), NULL, NULL, pkgInfoHash.Item("build_type"), TRUE ) &"</td>"& VBNewLine
122
         Else
123
            If ((parDview <> "enable") AND CInt(Request("envtab")) = enumENVTAB_PLANNED) Then
119 ghuddy 124
 
4389 dpurdie 125
               ' if package version is unlocked, rejected, or pending approval, or is to be added/subtracted to/from the release (DEVI-45275), then
126
               If (rsView("dlocked") = "N") OR (rsView("dlocked") = "R") OR (rsView("dlocked") = "P") OR (nOperation = "A") OR (nOperation = "S") Then
127
                  checked = NULL
128
                  disabled = NULL
129
                  ' disable check box if not logged in, or if not in open mode and user has no permission to approve pending
130
                  If objAccessControl.UserLogedIn Then
131
                     If ( ReleaseMode <> enumDB_RELEASE_IN_OPEN_MODE ) Then
132
                        If NOT objAccessControl.IsActive("ApproveForAutoBuild") Then
133
                           disabled = "disabled"
134
                        End If
135
                     End If
136
                  Else
137
                     disabled = "disabled"
138
                  End If
139
 
140
               Else ' always check and disable the checkbox
141
                  checked = "checked"
142
                  disabled = "disabled"
143
               End If
144
               relContentsSTR = relContentsSTR & " <td width='1%'><input name='pv_id_list' id='pv_id_list' type=checkbox value="&rsView.Fields("pv_id")&" "&checked&" "&disabled&"></td>"& VBNewLine
145
            Else
146
		       relContentsSTR = relContentsSTR & "  <td width='1%'>"& DefineStateIcon ( rsView("pkg_state"), rsView("dlocked"), NULL, NULL, rsView("build_type"), TRUE ) &"</td>"& VBNewLine
147
            End If
148
         End If
149
 
119 ghuddy 150
	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
151
	relContentsSTR = relContentsSTR & "  <td width='1%' nowrap class='envPkg'>"& rsView.Fields("pkg_version") &"</td>" & VBNewLine
152
	relContentsSTR = relContentsSTR & "  <td width='1%'>"& IMG_locked &"</td>"
153
	relContentsSTR = relContentsSTR & "</tr>" & VBNewLine
154
 
155
	rsView.MoveNext
156
WEnd
157
 
158
 
159
rsView.Close
160
Set rsView = nothing
161
 
162
 
163
relContentsSTR = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>" & relContentsSTR & "</table>"
164
 
165
 
166
' Response the content
167
Response.write relContentsSTR
168
 
169
%>
170
 
171
 
172
<%
173
Call Destroy_All_Objects
174
%>