Subversion Repositories DevTools

Rev

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