Subversion Repositories DevTools

Rev

Rev 6610 | Rev 6623 | 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">
6579 dpurdie 94
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
95
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
96
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 97
<!--#include file="_jquery_includes.asp"-->
98
<!-- DROPDOWN MENUS -->
99
<!--#include file="_menu_def.asp"-->
6579 dpurdie 100
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 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>
6612 dpurdie 165
                    <td width="20%" nowrap class="body_col" bgcolor="#E4E9EC" colspan="2">Last Modified</td>
6289 dpurdie 166
                    <td width="1" nowrap class="body_col" bgcolor="#E4E9EC"></td>
5357 dpurdie 167
                  </tr>
6612 dpurdie 168
                  <tr bgcolor="#E4E9EC" class="body_col">
169
                    <td nowrap ></td>
170
                    <td nowrap ><input name="fpkgversion" type="text" class="form_item" size="15" value="<%=parFPkgVersion%>"></td>
171
                    <td nowrap >
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>
6612 dpurdie 182
                    <td nowrap >Who</td>
183
                    <td nowrap >Date</td>
184
                    <td nowrap ></td>
5357 dpurdie 185
                  </tr>
6289 dpurdie 186
                  <%
187
                  ' Descending order
188
                If rsRep.RecordCount = 0 Then
189
 
190
                    With Response
191
                        .write "<tr>"
6612 dpurdie 192
                        .write "<td colspan='6' class='body_row'>Found 0 records."
6289 dpurdie 193
                        .write "&nbsp;Delete Unused Package Name&nbsp;"
194
                        .write "<a href='javascript:;'"&_
195
                               " title='Delete unused package name' "&_
196
                               " onClick=""MM_openVixIFrame('_delete_package_name.asp?pkgId=" & parPkgId & "&bfile=index.asp','Delete Unused Package');"" >" &_
197
                               "<img src='icons/i_destroy_package_sml.gif' width='15' height='15' border='0' ></a>"
198
                        .write "</td>"
199
                        .write "</tr>"
200
                    End With
201
 
202
                Else
203
 
204
                    aVersions = rsRep.GetRows()
205
                    lastRow = UBound( aVersions, 2 )
206
 
207
                    Set objSortHelper = New SortHelper
208
 
209
 
210
                    ' Sort versions
211
                    Call objSortHelper.VersionSort( aVersions, 0, lastRow, rsRep.FieldIndex("pkg_version") )
212
 
213
 
5759 dpurdie 214
                    ' Not in a project context
215
                    ' Only god-like users will have this permission
6289 dpurdie 216
                    CanDestroyProjectPackage = canShowControl( "DestroyPackage" )
217
 
218
                  ' Descending order
219
                  For i = lastRow To 0 Step -1
220
                    imgLock = IMG_NOT_OFFICIAL
221
                    If (aVersions( rsRep.FieldIndex("dlocked"), i ) = "Y")  OR (aVersions( rsRep.FieldIndex("dlocked"), i ) = "A") Then
222
                        imgLock = IMG_OFFICIAL
223
                    End If
224
 
225
                    sLink = "dependencies.asp?pv_id="& aVersions( rsRep.FieldIndex("pv_id"), i )
5759 dpurdie 226
 
227
                    ' User can try to delete package iff
228
                    '   Have suffiecient access (unusual)
229
                    '   They created it or is its owner
230
                    '   The version is not in use by any release (allow to be in pendinf or WIP)
231
                    '   [Not at the moment] The package was created less than xxxx days ago
232
                    '   Is not locked or Approved for Autobuild
5902 dpurdie 233
                    CanDestroyPackage = CanDestroyProjectPackage
5759 dpurdie 234
                    If CanDestroyPackage = false Then
5765 dpurdie 235
                        If  objAccessControl.UserId = aVersions( rsRep.FieldIndex("CREATOR_ID"), i ) OR objAccessControl.UserId = aVersions( rsRep.FieldIndex("OWNER_ID"), i )Then
5759 dpurdie 236
                            If aVersions( rsRep.FieldIndex("inuse"), i ) = 0 Then
237
                                'If aVersions( rsRep.FieldIndex("age") , i ) < 1000 Then
238
                                    If aVersions( rsRep.FieldIndex("dlocked"), i ) <> "Y" Then
5902 dpurdie 239
                                        'If aVersions( rsRep.FieldIndex("dlocked"), i ) <> "A" Then
5759 dpurdie 240
                                            CanDestroyPackage = true
5902 dpurdie 241
                                        'End If
5759 dpurdie 242
                                    End If
243
                                'End If
244
                            End If
245
                        End If
246
                    End If
6289 dpurdie 247
 
248
                    ' Set destroy package action
249
                    If CanDestroyPackage Then
250
                        DestroyPackage = "<a href='javascript:;'"&_
6480 dpurdie 251
                                         " title='Destroy this version of the package.' "&_
5930 dpurdie 252
                                         " 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 253
                                         " <img src='icons/i_destroy_package_sml.gif' width='15' height='15' border='0' ></a>"
5759 dpurdie 254
                    Else
6289 dpurdie 255
                        DestroyPackage = ""
256
                    End If
257
                  %>
6612 dpurdie 258
                      <tr bgcolor="#F5F5F5" valign="top" class="body_row"> 
259
                        <td><%=imgLock%></td>
260
                        <td nowrap><a href="<%=sLink%>" class="body_link"><%=aVersions( rsRep.FieldIndex("pkg_version"), i )%></a></td>
261
                        <td class="body_txt_gray"><%=NewLine_To_BR ( To_HTML( aVersions( rsRep.FieldIndex("comments"), i ) ) )%></td>
262
                        <td nowrap><%=emailField(enum_imgUser & aVersions( rsRep.FieldIndex("full_name"), i ),  aVersions( rsRep.FieldIndex("user_email"), i ))%></td>
263
                        <td nowrap><%=DisplayShortDateTime ( aVersions( rsRep.FieldIndex("modified_stamp"), i ) )%></td>
264
                        <td ><%=DestroyPackage%></td>
6289 dpurdie 265
                      </tr>
266
                  <%  
267
 
268
                  Next
269
 
270
                  rsRep.Close()
271
 
272
                End If
273
                  %>
274
                  <tr> 
6612 dpurdie 275
                    <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
6289 dpurdie 276
                  </tr>
277
 
278
                  </form>
279
                </table>
280
                <br>
281
                <!------------------------------------------------------------>         
282
 
283
 
284
                </td>
285
              <td background="images/lbox_bgside_white.gif">&nbsp;</td>
286
            </tr>
287
          </table>
288
 
289
          </td>
5357 dpurdie 290
        </tr>
291
      </table>
292
    </td>
293
    <td width="11%">&nbsp;</td>
294
  </tr>
295
  <tr> 
296
    <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>
297
    <td>&nbsp;</td>
298
  </tr>
299
</table>
300
<!-- FOOTER -->
301
<!--#include file="_footer.asp"-->
302
</body>
303
</html>