Subversion Repositories DevTools

Rev

Rev 6289 | Rev 6579 | 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
'|                                                   |
6289 dpurdie 5
'|                      view by version              |
5357 dpurdie 6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
6289 dpurdie 12
Response.Expires = 0    ' always load the page, dont store
5357 dpurdie 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
%>
6181 dpurdie 23
<!--#include file="_access_control_login_optional.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 
6289 dpurdie 47
    hideRipple = True
5357 dpurdie 48
    rippleFilter = " AND PV.BUILD_TYPE != 'Y'"
49
Else
6289 dpurdie 50
    hideRipple = False
5357 dpurdie 51
    rippleFilter = ""
52
End If
53
 
54
 
55
'----------------------------------------------
56
%>
57
<%
58
'-----------------------------------------------------------------------------------------------------------------------
59
Function GetPackageName ( nPkgId )
6289 dpurdie 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
5357 dpurdie 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 >
6289 dpurdie 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>
5357 dpurdie 146
                    <td class="body_sect">Package Versions</td>
147
                  </tr>
148
                  <tr>
149
                    <td nowrap bgcolor="#E4E9EC" class="body_txt">
6289 dpurdie 150
                        Results for <b><%=PackageName%></b>
151
                    </td>
5357 dpurdie 152
                  </tr>
153
                </table>
6289 dpurdie 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>
5357 dpurdie 162
                    <td width="1" nowrap class="body_col" bgcolor="#E4E9EC"></td>
6289 dpurdie 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>
5357 dpurdie 167
                  </tr>
6289 dpurdie 168
                  <tr>
5357 dpurdie 169
                    <td nowrap bgcolor="#E4E9EC"></td>
6289 dpurdie 170
                    <td nowrap bgcolor="#E4E9EC"><input name="fpkgversion" type="text" class="form_item" size="15" value="<%=parFPkgVersion%>"></td>
171
                    <td nowrap bgcolor="#E4E9EC">
5357 dpurdie 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>
6289 dpurdie 182
                    <td nowrap bgcolor="#E4E9EC"></td>
183
                    <td nowrap bgcolor="#E4E9EC"></td>
5357 dpurdie 184
                  </tr>
6289 dpurdie 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."
192
                        .write "&nbsp;Delete Unused Package Name&nbsp;"
193
                        .write "<a href='javascript:;'"&_
194
                               " title='Delete unused package name' "&_
195
                               " onClick=""MM_openVixIFrame('_delete_package_name.asp?pkgId=" & parPkgId & "&bfile=index.asp','Delete Unused Package');"" >" &_
196
                               "<img src='icons/i_destroy_package_sml.gif' width='15' height='15' border='0' ></a>"
197
                        .write "</td>"
198
                        .write "</tr>"
199
                    End With
200
 
201
                Else
202
 
203
                    aVersions = rsRep.GetRows()
204
                    lastRow = UBound( aVersions, 2 )
205
 
206
                    Set objSortHelper = New SortHelper
207
 
208
 
209
                    ' Sort versions
210
                    Call objSortHelper.VersionSort( aVersions, 0, lastRow, rsRep.FieldIndex("pkg_version") )
211
 
212
 
5759 dpurdie 213
                    ' Not in a project context
214
                    ' Only god-like users will have this permission
6289 dpurdie 215
                    CanDestroyProjectPackage = canShowControl( "DestroyPackage" )
216
 
217
                  ' Descending order
218
                  For i = lastRow To 0 Step -1
219
                    imgLock = IMG_NOT_OFFICIAL
220
                    If (aVersions( rsRep.FieldIndex("dlocked"), i ) = "Y")  OR (aVersions( rsRep.FieldIndex("dlocked"), i ) = "A") Then
221
                        imgLock = IMG_OFFICIAL
222
                    End If
223
 
224
                    sLink = "dependencies.asp?pv_id="& aVersions( rsRep.FieldIndex("pv_id"), i )
5759 dpurdie 225
 
226
                    ' User can try to delete package iff
227
                    '   Have suffiecient access (unusual)
228
                    '   They created it or is its owner
229
                    '   The version is not in use by any release (allow to be in pendinf or WIP)
230
                    '   [Not at the moment] The package was created less than xxxx days ago
231
                    '   Is not locked or Approved for Autobuild
5902 dpurdie 232
                    CanDestroyPackage = CanDestroyProjectPackage
5759 dpurdie 233
                    If CanDestroyPackage = false Then
5765 dpurdie 234
                        If  objAccessControl.UserId = aVersions( rsRep.FieldIndex("CREATOR_ID"), i ) OR objAccessControl.UserId = aVersions( rsRep.FieldIndex("OWNER_ID"), i )Then
5759 dpurdie 235
                            If aVersions( rsRep.FieldIndex("inuse"), i ) = 0 Then
236
                                'If aVersions( rsRep.FieldIndex("age") , i ) < 1000 Then
237
                                    If aVersions( rsRep.FieldIndex("dlocked"), i ) <> "Y" Then
5902 dpurdie 238
                                        'If aVersions( rsRep.FieldIndex("dlocked"), i ) <> "A" Then
5759 dpurdie 239
                                            CanDestroyPackage = true
5902 dpurdie 240
                                        'End If
5759 dpurdie 241
                                    End If
242
                                'End If
243
                            End If
244
                        End If
245
                    End If
6289 dpurdie 246
 
247
                    ' Set destroy package action
248
                    If CanDestroyPackage Then
249
                        DestroyPackage = "<a href='javascript:;'"&_
6480 dpurdie 250
                                         " title='Destroy this version of the package.' "&_
5930 dpurdie 251
                                         " 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 252
                                         " <img src='icons/i_destroy_package_sml.gif' width='15' height='15' border='0' ></a>"
5759 dpurdie 253
                    Else
6289 dpurdie 254
                        DestroyPackage = ""
255
                    End If
256
                  %>
257
                      <tr> 
258
                        <td valign="top" bgcolor="#F5F5F5"><%=imgLock%></td>
259
                        <td nowrap class="body_row" valign="top" bgcolor="#F5F5F5"><a href="<%=sLink%>" class="body_link"><%=aVersions( rsRep.FieldIndex("pkg_version"), i )%></a></td>
260
                        <td class="body_txt_gray" valign="top"  bgcolor="#F5F5F5"><%=NewLine_To_BR ( To_HTML( aVersions( rsRep.FieldIndex("comments"), i ) ) )%></td>
261
                        <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>
262
                        <td valign="top" bgcolor="#F5F5F5"><%=DestroyPackage%></td>
263
                      </tr>
264
                  <%  
265
 
266
                  Next
267
 
268
                  rsRep.Close()
269
 
270
                End If
271
                  %>
272
                  <tr> 
273
                    <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
274
                  </tr>
275
 
276
                  </form>
277
                </table>
278
                <br>
279
                <!------------------------------------------------------------>         
280
 
281
 
282
                </td>
283
              <td background="images/lbox_bgside_white.gif">&nbsp;</td>
284
            </tr>
285
          </table>
286
 
287
          </td>
5357 dpurdie 288
        </tr>
289
      </table>
290
    </td>
291
    <td width="11%">&nbsp;</td>
292
  </tr>
293
  <tr> 
294
    <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>
295
    <td>&nbsp;</td>
296
  </tr>
297
</table>
298
<!-- FOOTER -->
299
<!--#include file="_footer.asp"-->
300
</body>
301
</html>