Subversion Repositories DevTools

Rev

Rev 6048 | Rev 6181 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|				        view by version			     |
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
<!--#include file="class/classSortHelper.asp"-->
20
<%
21
'------------ ACCESS CONTROL ------------------
22
%>
6048 dpurdie 23
<!--#include file="_access_control_login.asp"-->
5357 dpurdie 24
<!--#include file="_access_control_general.asp"-->
25
<%
26
'------------ Variable Definition -------------
27
Dim rsRep
28
Dim parFPkgVersion
29
Dim sLink
30
Dim parPkgId
31
Dim PackageName
32
Dim imgLock
33
Dim DestroyPackage
5902 dpurdie 34
Dim CanDestroyProjectPackage
5357 dpurdie 35
Dim CanDestroyPackage
36
Dim hideRipple
37
Dim rippleFilter
38
'------------ Constants Declaration -----------
39
Const IMG_OFFICIAL = "<img src='images/i_locked.gif' width='7' height='10' hspace='5' vspace='2' alt='Package is official'>"
40
Const IMG_NOT_OFFICIAL = "<img src='images/spacer.gif' width='7' height='10' hspace='5' vspace='2'>"
41
'------------ Variable Init -------------------
42
parFPkgVersion = Request("fpkgversion")
43
If parFPkgVersion = "" Then  parFPkgVersion = "*"
44
 
45
parPkgId = Request("pkg_id")
46
If Request("hideRipple") = "True" Then 
47
	hideRipple = True
48
    rippleFilter = " AND PV.BUILD_TYPE != 'Y'"
49
Else
50
	hideRipple = False
51
    rippleFilter = ""
52
End If
53
 
54
 
55
'----------------------------------------------
56
%>
57
<%
58
'-----------------------------------------------------------------------------------------------------------------------
59
Function GetPackageName ( nPkgId )
60
	Dim rsQry, query
61
 
62
	query = _
63
	" SELECT PKG_NAME  FROM PACKAGES  WHERE PKG_ID = :PKG_ID"
64
 
65
	OraDatabase.Parameters.Add "PKG_ID", nPkgId, ORAPARM_INPUT, ORATYPE_NUMBER
66
 
67
  	Set rsQry = OraDatabase.DbCreateDynaset( query, 0 )
68
 
69
	OraDatabase.Parameters.Remove "PKG_ID"
70
 
71
	GetPackageName = rsQry("pkg_name")
72
 
73
	rsQry.Close()
74
	Set rsQry = nothing
75
End Function
76
'-----------------------------------------------------------------------------------------------------------------------
77
%>
78
<%
79
'==================== MAIN LINE ===============================
5957 dpurdie 80
If (parPkgId = "") Then 
81
    Call Destroy_All_Objects
82
    Response.Redirect ("index.asp")
83
End If
5357 dpurdie 84
 
85
PackageName = GetPackageName ( parPkgId )
86
'==============================================================
87
%>
88
<html>
89
<head>
90
<title>Release Manager</title>
91
<link rel="shortcut icon" href="<%=FavIcon%>"/>
92
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
93
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
94
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
95
<link rel="stylesheet" href="images/navigation.css" type="text/css">
96
<script language="JavaScript" src="images/common.js"></script>
97
<!--#include file="_jquery_includes.asp"-->
98
<!-- DROPDOWN MENUS -->
99
<!--#include file="_menu_def.asp"-->
100
<script language="JavaScript1.2" src="images/popup_menu.js"></script>
101
</head>
102
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
103
<!-- HEADER -->
104
<!--#include file="_header.asp"-->
105
<!-- BODY ---->
106
<table width="100%" border="0" cellspacing="0" cellpadding="0">
107
  <tr> 
108
    <td width="1%" background="images/bg_home_orange.gif" valign="top">
109
      <!--#include file="_front_explorer.asp"-->
110
    </td>
111
    <td rowspan="2" valign="top"> 
112
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
113
        <tr> 
114
          <td >
115
 
116
		  <table width="100%" border="0" cellspacing="0" cellpadding="0">
117
			<tr> 
118
			  <td width="1%"></td>
119
			  <td width="100%" align="right"><img src="images/h_trsp_dot.gif" width="1" height="20"></td>
120
			  <td width="1%"></td>
121
			</tr>
122
			<tr> 
123
			  <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="500"></td>
124
			  <td bgcolor="#FFFFFF" valign="top"> 
125
				<!-- PACKAGE SEARCH ------------------------------------------------>
126
				<%
127
 
128
				Dim aVersions
129
				Dim lastRow
130
				Dim objSortHelper
131
				Dim i
132
 
133
				OraDatabase.Parameters.Add "PKG_VERSION", 	Replace( parFPkgVersion, "*", "%" ), ORAPARM_INPUT, ORATYPE_VARCHAR2
134
				OraDatabase.Parameters.Add "PKG_ID", 	parPkgId, ORAPARM_INPUT, ORATYPE_NUMBER
135
 
136
			  	Set rsRep = OraDatabase.DbCreateDynaset( GetQuery("FindPackageVersion.sql") & rippleFilter, 0 )
137
 
138
				OraDatabase.Parameters.Remove "PKG_ID"
139
				OraDatabase.Parameters.Remove "PKG_VERSION"
140
 
141
 
142
				%>
143
 
144
				<table width="100%"  border="0" cellspacing="0" cellpadding="5">
145
				  <tr>
146
                    <td class="body_sect">Package Versions</td>
147
                  </tr>
148
                  <tr>
149
                    <td nowrap bgcolor="#E4E9EC" class="body_txt">
150
						Results for <b><%=PackageName%></b>
151
					</td>
152
                  </tr>
153
                </table>
154
 
155
 
156
 
157
				<table width="100%" border="0" cellspacing="1" cellpadding="5">
158
				<form name="versions" method="get" action="<%=ScriptName%>">
159
				  <input type="hidden" name="pkg_id" value="<%=parPkgId%>">
160
				  <input type="hidden" name="listby" value="<%=parListBy%>">
161
				 <tr>
162
                    <td width="1" nowrap class="body_col" bgcolor="#E4E9EC"></td>
163
					<td width="20%" nowrap class="body_col" bgcolor="#E4E9EC">Version</td>
164
					<td width="60%" nowrap class="body_col" bgcolor="#E4E9EC">Reason for Release</td>
165
					<td width="20%" nowrap class="body_col" bgcolor="#E4E9EC">Last Modified</td>
166
					<td width="1" nowrap class="body_col" bgcolor="#E4E9EC"></td>
167
                  </tr>
168
				  <tr>
169
                    <td nowrap bgcolor="#E4E9EC"></td>
170
					<td nowrap bgcolor="#E4E9EC"><input name="fpkgversion" type="text" class="form_item" size="15" value="<%=parFPkgVersion%>"></td>
171
					<td nowrap bgcolor="#E4E9EC">
172
                      <%
173
                      Response.write "<a href='"& scriptName &"?"& Persists_Query_String( "hideRipple=" & not hideRipple ) &"'>"
174
                          If hideRipple Then
175
                            Response.write "<img src='images/RippleSquareOff.gif' width='20' height='20' border='0' title='Rippled Versions Hidden. Toggle'>"
176
                          Else
177
                            Response.write "<img src='images/RippleSquare.gif' width='20' height='20' border='0' title='Rippled Versions Shown. Toggle'>"
178
                          End If
179
                      Response.write "</a>"
180
                      %>
181
                    </td>
182
					<td nowrap bgcolor="#E4E9EC"></td>
183
					<td nowrap bgcolor="#E4E9EC"></td>
184
                  </tr>
185
				  <%
186
				  ' Descending order
187
				If rsRep.RecordCount = 0 Then
188
 
189
					With Response
190
						.write "<tr>"
191
						.write "<td colspan='5' class='body_row'>Found 0 records.</td>"
192
						.write "</tr>"
193
					End With
194
 
195
				Else
196
 
197
					aVersions = rsRep.GetRows()
198
					lastRow = UBound( aVersions, 2 )
199
 
200
					Set objSortHelper = New SortHelper
201
 
202
 
203
					' Sort versions
204
					Call objSortHelper.VersionSort( aVersions, 0, lastRow, rsRep.FieldIndex("pkg_version") )
205
 
206
 
5759 dpurdie 207
                    ' Not in a project context
208
                    ' Only god-like users will have this permission
5902 dpurdie 209
					CanDestroyProjectPackage = canShowControl( "DestroyPackage" )
5357 dpurdie 210
 
211
				  ' Descending order
212
				  For i = lastRow To 0 Step -1
213
				  	imgLock = IMG_NOT_OFFICIAL
214
					If (aVersions( rsRep.FieldIndex("dlocked"), i ) = "Y")  OR (aVersions( rsRep.FieldIndex("dlocked"), i ) = "A") Then
215
						imgLock = IMG_OFFICIAL
216
					End If
217
 
218
				  	sLink = "dependencies.asp?pv_id="& aVersions( rsRep.FieldIndex("pv_id"), i )
5759 dpurdie 219
 
220
                    ' User can try to delete package iff
221
                    '   Have suffiecient access (unusual)
222
                    '   They created it or is its owner
223
                    '   The version is not in use by any release (allow to be in pendinf or WIP)
224
                    '   [Not at the moment] The package was created less than xxxx days ago
225
                    '   Is not locked or Approved for Autobuild
5902 dpurdie 226
                    CanDestroyPackage = CanDestroyProjectPackage
5759 dpurdie 227
                    If CanDestroyPackage = false Then
5765 dpurdie 228
                        If  objAccessControl.UserId = aVersions( rsRep.FieldIndex("CREATOR_ID"), i ) OR objAccessControl.UserId = aVersions( rsRep.FieldIndex("OWNER_ID"), i )Then
5759 dpurdie 229
                            If aVersions( rsRep.FieldIndex("inuse"), i ) = 0 Then
230
                                'If aVersions( rsRep.FieldIndex("age") , i ) < 1000 Then
231
                                    If aVersions( rsRep.FieldIndex("dlocked"), i ) <> "Y" Then
5902 dpurdie 232
                                        'If aVersions( rsRep.FieldIndex("dlocked"), i ) <> "A" Then
5759 dpurdie 233
                                            CanDestroyPackage = true
5902 dpurdie 234
                                        'End If
5759 dpurdie 235
                                    End If
236
                                'End If
237
                            End If
238
                        End If
239
                    End If
5357 dpurdie 240
 
241
					' Set destroy package action
242
					If CanDestroyPackage Then
243
						DestroyPackage = "<a href='javascript:;'"&_
244
										 " title='Destroy this package from the database.' "&_
5930 dpurdie 245
                                         " onClick=""MM_openVixIFrame('_destroy_package.asp?pv_id="& aVersions( rsRep.FieldIndex("pv_id"), i )  &"&bfile="& ScriptName &"&pkg_id="& parPkgId &"&listby="& parListBy &"','Destroy Package Version');"" >" &_
5983 dpurdie 246
                                         " <img src='icons/i_destroy_package_sml.gif' width='15' height='15' border='0' ></a>"
5759 dpurdie 247
                    Else
248
					    DestroyPackage = ""
5357 dpurdie 249
					End If
250
				  %>
251
					  <tr> 
252
					    <td valign="top" bgcolor="#F5F5F5"><%=imgLock%></td>
253
						<td nowrap class="body_row" valign="top" bgcolor="#F5F5F5"><a href="<%=sLink%>" class="body_link"><%=aVersions( rsRep.FieldIndex("pkg_version"), i )%></a></td>
254
						<td class="body_txt_gray" valign="top"  bgcolor="#F5F5F5"><%=NewLine_To_BR ( To_HTML( aVersions( rsRep.FieldIndex("comments"), i ) ) )%></td>
5632 dpurdie 255
						<td nowrap class="body_row" valign="top" bgcolor="#F5F5F5"><%= "<a href='mailto:"& aVersions( rsRep.FieldIndex("user_email"), i ) &"' class='txt_linked'><img src='images/i_user.gif' width='10' height='13' hspace='2' border='0' align='absmiddle' alt='"& aVersions( rsRep.FieldIndex("full_name"), i ) &" &lt;"& aVersions( rsRep.FieldIndex("user_email"), i ) &"&gt;'>"& aVersions( rsRep.FieldIndex("full_name"), i ) &"</a> "& DisplayShortDateTime ( aVersions( rsRep.FieldIndex("modified_stamp"), i ) )%></td>
5357 dpurdie 256
						<td valign="top" bgcolor="#F5F5F5"><%=DestroyPackage%></td>
257
					  </tr>
258
				  <%  
259
 
260
				  Next
261
 
262
				  rsRep.Close()
263
 
264
				End If
265
				  %>
266
				  <tr> 
267
					<td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
268
				  </tr>
269
 
270
				  </form>
271
				</table>
272
				<br>
273
				<!------------------------------------------------------------>			
274
 
275
 
276
				</td>
277
			  <td background="images/lbox_bgside_white.gif">&nbsp;</td>
278
			</tr>
279
		  </table>
280
 
281
		  </td>
282
        </tr>
283
      </table>
284
    </td>
285
    <td width="11%">&nbsp;</td>
286
  </tr>
287
  <tr> 
288
    <td valign="bottom" align="center" background="images/bg_home_orange.gif"><img src="images/img_gear.gif" width="107" height="107" vspace="20" hspace="30"></td>
289
    <td>&nbsp;</td>
290
  </tr>
291
</table>
292
<!-- FOOTER -->
293
<!--#include file="_footer.asp"-->
294
</body>
295
</html>