Subversion Repositories DevTools

Rev

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