Subversion Repositories DevTools

Rev

Rev 5983 | Rev 6070 | 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
<!-- MENU LAYERS -------------------------------------->
104
<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)"> 
105
</div>
106
<!-- HEADER -->
107
<!--#include file="_header.asp"-->
108
<!-- BODY ---->
109
<table width="100%" border="0" cellspacing="0" cellpadding="0">
110
  <tr> 
111
    <td width="1%" background="images/bg_home_orange.gif" valign="top">
112
      <!--#include file="_front_explorer.asp"-->
113
    </td>
114
    <td rowspan="2" valign="top"> 
115
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
116
        <tr> 
117
          <td >
118
 
119
		  <table width="100%" border="0" cellspacing="0" cellpadding="0">
120
			<tr> 
121
			  <td width="1%"></td>
122
			  <td width="100%" align="right"><img src="images/h_trsp_dot.gif" width="1" height="20"></td>
123
			  <td width="1%"></td>
124
			</tr>
125
			<tr> 
126
			  <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="500"></td>
127
			  <td bgcolor="#FFFFFF" valign="top"> 
128
				<!-- PACKAGE SEARCH ------------------------------------------------>
129
				<%
130
 
131
				Dim aVersions
132
				Dim lastRow
133
				Dim objSortHelper
134
				Dim i
135
 
136
				OraDatabase.Parameters.Add "PKG_VERSION", 	Replace( parFPkgVersion, "*", "%" ), ORAPARM_INPUT, ORATYPE_VARCHAR2
137
				OraDatabase.Parameters.Add "PKG_ID", 	parPkgId, ORAPARM_INPUT, ORATYPE_NUMBER
138
 
139
			  	Set rsRep = OraDatabase.DbCreateDynaset( GetQuery("FindPackageVersion.sql") & rippleFilter, 0 )
140
 
141
				OraDatabase.Parameters.Remove "PKG_ID"
142
				OraDatabase.Parameters.Remove "PKG_VERSION"
143
 
144
 
145
				%>
146
 
147
				<table width="100%"  border="0" cellspacing="0" cellpadding="5">
148
				  <tr>
149
                    <td class="body_sect">Package Versions</td>
150
                  </tr>
151
                  <tr>
152
                    <td nowrap bgcolor="#E4E9EC" class="body_txt">
153
						Results for <b><%=PackageName%></b>
154
					</td>
155
                  </tr>
156
                </table>
157
 
158
 
159
 
160
				<table width="100%" border="0" cellspacing="1" cellpadding="5">
161
				<form name="versions" method="get" action="<%=ScriptName%>">
162
				  <input type="hidden" name="pkg_id" value="<%=parPkgId%>">
163
				  <input type="hidden" name="listby" value="<%=parListBy%>">
164
				 <tr>
165
                    <td width="1" nowrap class="body_col" bgcolor="#E4E9EC"></td>
166
					<td width="20%" nowrap class="body_col" bgcolor="#E4E9EC">Version</td>
167
					<td width="60%" nowrap class="body_col" bgcolor="#E4E9EC">Reason for Release</td>
168
					<td width="20%" nowrap class="body_col" bgcolor="#E4E9EC">Last Modified</td>
169
					<td width="1" nowrap class="body_col" bgcolor="#E4E9EC"></td>
170
                  </tr>
171
				  <tr>
172
                    <td nowrap bgcolor="#E4E9EC"></td>
173
					<td nowrap bgcolor="#E4E9EC"><input name="fpkgversion" type="text" class="form_item" size="15" value="<%=parFPkgVersion%>"></td>
174
					<td nowrap bgcolor="#E4E9EC">
175
                      <%
176
                      Response.write "<a href='"& scriptName &"?"& Persists_Query_String( "hideRipple=" & not hideRipple ) &"'>"
177
                          If hideRipple Then
178
                            Response.write "<img src='images/RippleSquareOff.gif' width='20' height='20' border='0' title='Rippled Versions Hidden. Toggle'>"
179
                          Else
180
                            Response.write "<img src='images/RippleSquare.gif' width='20' height='20' border='0' title='Rippled Versions Shown. Toggle'>"
181
                          End If
182
                      Response.write "</a>"
183
                      %>
184
                    </td>
185
					<td nowrap bgcolor="#E4E9EC"></td>
186
					<td nowrap bgcolor="#E4E9EC"></td>
187
                  </tr>
188
				  <%
189
				  ' Descending order
190
				If rsRep.RecordCount = 0 Then
191
 
192
					With Response
193
						.write "<tr>"
194
						.write "<td colspan='5' class='body_row'>Found 0 records.</td>"
195
						.write "</tr>"
196
					End With
197
 
198
				Else
199
 
200
					aVersions = rsRep.GetRows()
201
					lastRow = UBound( aVersions, 2 )
202
 
203
					Set objSortHelper = New SortHelper
204
 
205
 
206
					' Sort versions
207
					Call objSortHelper.VersionSort( aVersions, 0, lastRow, rsRep.FieldIndex("pkg_version") )
208
 
209
 
5759 dpurdie 210
                    ' Not in a project context
211
                    ' Only god-like users will have this permission
5902 dpurdie 212
					CanDestroyProjectPackage = canShowControl( "DestroyPackage" )
5357 dpurdie 213
 
214
				  ' Descending order
215
				  For i = lastRow To 0 Step -1
216
				  	imgLock = IMG_NOT_OFFICIAL
217
					If (aVersions( rsRep.FieldIndex("dlocked"), i ) = "Y")  OR (aVersions( rsRep.FieldIndex("dlocked"), i ) = "A") Then
218
						imgLock = IMG_OFFICIAL
219
					End If
220
 
221
				  	sLink = "dependencies.asp?pv_id="& aVersions( rsRep.FieldIndex("pv_id"), i )
5759 dpurdie 222
 
223
                    ' User can try to delete package iff
224
                    '   Have suffiecient access (unusual)
225
                    '   They created it or is its owner
226
                    '   The version is not in use by any release (allow to be in pendinf or WIP)
227
                    '   [Not at the moment] The package was created less than xxxx days ago
228
                    '   Is not locked or Approved for Autobuild
5902 dpurdie 229
                    CanDestroyPackage = CanDestroyProjectPackage
5759 dpurdie 230
                    If CanDestroyPackage = false Then
5765 dpurdie 231
                        If  objAccessControl.UserId = aVersions( rsRep.FieldIndex("CREATOR_ID"), i ) OR objAccessControl.UserId = aVersions( rsRep.FieldIndex("OWNER_ID"), i )Then
5759 dpurdie 232
                            If aVersions( rsRep.FieldIndex("inuse"), i ) = 0 Then
233
                                'If aVersions( rsRep.FieldIndex("age") , i ) < 1000 Then
234
                                    If aVersions( rsRep.FieldIndex("dlocked"), i ) <> "Y" Then
5902 dpurdie 235
                                        'If aVersions( rsRep.FieldIndex("dlocked"), i ) <> "A" Then
5759 dpurdie 236
                                            CanDestroyPackage = true
5902 dpurdie 237
                                        'End If
5759 dpurdie 238
                                    End If
239
                                'End If
240
                            End If
241
                        End If
242
                    End If
5357 dpurdie 243
 
244
					' Set destroy package action
245
					If CanDestroyPackage Then
246
						DestroyPackage = "<a href='javascript:;'"&_
247
										 " title='Destroy this package from the database.' "&_
5930 dpurdie 248
                                         " 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 249
                                         " <img src='icons/i_destroy_package_sml.gif' width='15' height='15' border='0' ></a>"
5759 dpurdie 250
                    Else
251
					    DestroyPackage = ""
5357 dpurdie 252
					End If
253
				  %>
254
					  <tr> 
255
					    <td valign="top" bgcolor="#F5F5F5"><%=imgLock%></td>
256
						<td nowrap class="body_row" valign="top" bgcolor="#F5F5F5"><a href="<%=sLink%>" class="body_link"><%=aVersions( rsRep.FieldIndex("pkg_version"), i )%></a></td>
257
						<td class="body_txt_gray" valign="top"  bgcolor="#F5F5F5"><%=NewLine_To_BR ( To_HTML( aVersions( rsRep.FieldIndex("comments"), i ) ) )%></td>
5632 dpurdie 258
						<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 259
						<td valign="top" bgcolor="#F5F5F5"><%=DestroyPackage%></td>
260
					  </tr>
261
				  <%  
262
 
263
				  Next
264
 
265
				  rsRep.Close()
266
 
267
				End If
268
				  %>
269
				  <tr> 
270
					<td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
271
				  </tr>
272
 
273
				  </form>
274
				</table>
275
				<br>
276
				<!------------------------------------------------------------>			
277
 
278
 
279
				</td>
280
			  <td background="images/lbox_bgside_white.gif">&nbsp;</td>
281
			</tr>
282
		  </table>
283
 
284
		  </td>
285
        </tr>
286
      </table>
287
    </td>
288
    <td width="11%">&nbsp;</td>
289
  </tr>
290
  <tr> 
291
    <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>
292
    <td>&nbsp;</td>
293
  </tr>
294
</table>
295
<!-- FOOTER -->
296
<!--#include file="_footer.asp"-->
297
</body>
298
</html>