Subversion Repositories DevTools

Rev

Rev 6827 | Rev 6876 | 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
'|                                                   |
6623 dpurdie 5
'|          Edit/View Build Configuration            |
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
6623 dpurdie 33
Dim imgData
5357 dpurdie 34
Dim DestroyPackage
5902 dpurdie 35
Dim CanDestroyProjectPackage
5357 dpurdie 36
Dim CanDestroyPackage
37
Dim hideRipple
38
Dim rippleFilter
39
'------------ Constants Declaration -----------
6873 dpurdie 40
Const IMG_OFFICIAL = "<img src='images/i_locked.gif' width='7' height='10' hspace='5' vspace='2' title='Package is official'>"
41
Const IMG_NOT_OFFICIAL = "<img src='images/spacer.gif' width='7' height='10' hspace='5' vspace='2' title='Package is locked'>"
42
Const IMG_NOT_BUILDABLE = "<img src='icons/s_unbuildable.png' width='14' height='14' hspace='5' vspace='0' title='Package is not buildable'>"
5357 dpurdie 43
'------------ Variable Init -------------------
6623 dpurdie 44
parFPkgVersion = RequestDefault("fpkgversion", "*")
5357 dpurdie 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
'----------------------------------------------
6623 dpurdie 54
'   Convert PKG_ID into a package name
5357 dpurdie 55
Function GetPackageName ( nPkgId )
6289 dpurdie 56
    Dim rsQry, query
57
 
6623 dpurdie 58
    query = "SELECT PKG_NAME  FROM PACKAGES  WHERE PKG_ID = :PKG_ID"
6289 dpurdie 59
    OraDatabase.Parameters.Add "PKG_ID", nPkgId, ORAPARM_INPUT, ORATYPE_NUMBER
60
    Set rsQry = OraDatabase.DbCreateDynaset( query, 0 )
61
    OraDatabase.Parameters.Remove "PKG_ID"
62
    GetPackageName = rsQry("pkg_name")
63
 
64
    rsQry.Close()
65
    Set rsQry = nothing
5357 dpurdie 66
End Function
6623 dpurdie 67
 
68
'----------------------------------------------
69
'   Determine if a PKG_ID has any package-versions
70
'   If not then it can be deleted
71
Function hasNoVersions ( nPkgId )
72
    Dim rsQry, query
73
 
74
    query = "select count(*) as count from package_versions where pkg_id = :PKG_ID"
75
    OraDatabase.Parameters.Add "PKG_ID", nPkgId, ORAPARM_INPUT, ORATYPE_NUMBER
76
    Set rsQry = OraDatabase.DbCreateDynaset( query, 0 )
77
    OraDatabase.Parameters.Remove "PKG_ID"
78
 
79
    hasNoVersions = NOT rsQry("count") <> 0
80
 
81
    rsQry.Close()
82
    Set rsQry = nothing
83
End Function
84
 
5357 dpurdie 85
'==================== MAIN LINE ===============================
5957 dpurdie 86
If (parPkgId = "") Then 
87
    Call Destroy_All_Objects
88
    Response.Redirect ("index.asp")
89
End If
5357 dpurdie 90
 
91
PackageName = GetPackageName ( parPkgId )
92
'==============================================================
6623 dpurdie 93
Sub MainPanelContent
5357 dpurdie 94
%>
6623 dpurdie 95
<!-- MainPanelContent -->
96
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
97
   <tr> 
98
     <td width="1%"></td>
99
     <td width="100%" align="right"><img src="images/h_trsp_dot.gif" width="1" height="20"></td>
100
     <td width="1%"></td>
101
   </tr>
102
   <tr> 
103
     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="500"></td>
104
     <td bgcolor="#FFFFFF" valign="top"> 
105
       <!-- PACKAGE SEARCH ------------------------------------------------>
106
       <%
107
 
108
       Dim aVersions
109
       Dim lastRow
110
       Dim objSortHelper
111
       Dim i
112
 
113
       OraDatabase.Parameters.Add "PKG_VERSION",   Replace( parFPkgVersion, "*", "%" ), ORAPARM_INPUT, ORATYPE_VARCHAR2
114
       OraDatabase.Parameters.Add "PKG_ID",    parPkgId, ORAPARM_INPUT, ORATYPE_NUMBER
115
 
116
       Set rsRep = OraDatabase.DbCreateDynaset( GetQuery("FindPackageVersion.sql") & rippleFilter, 0 )
117
 
118
       OraDatabase.Parameters.Remove "PKG_ID"
119
       OraDatabase.Parameters.Remove "PKG_VERSION"
120
       %>
121
 
6710 dpurdie 122
       <form name="versions" method="get" action="<%=ScriptName%>">
123
         <input type="hidden" name="pkg_id" value="<%=parPkgId%>">
124
         <input type="hidden" name="listby" value="<%=parListBy%>">
125
       <table id='versionTable' width="100%"  border="0" cellspacing="1" cellpadding="2">
6623 dpurdie 126
           <thead>
127
             <tr>
6873 dpurdie 128
               <td class="body_sect" colspan='12'>Package Versions</td>
6623 dpurdie 129
             </tr>
130
             <tr class="form_field_bg">
6873 dpurdie 131
               <td nowrap" class="body_txt" colspan='12'>
6623 dpurdie 132
                   Results for <b><%=PackageName%></b>
133
               </td>
134
             </tr>
135
            <tr class="form_field_bg">
136
               <td width="20px" nowrap class="body_col"></td>
6873 dpurdie 137
               <td width="20px" nowrap class="body_col"></td>
6623 dpurdie 138
               <td width="10%" nowrap class="body_col">Version</td>
139
               <td width="80%" nowrap class="body_col">Reason for Release</td>
140
               <td width="1%" nowrap class="body_col tcenter" rowspan="2">Build<br>Reason</td>
141
               <td width="1%" nowrap class="body_col tcenter" rowspan="2">Lines of<br>Code</td>
142
               <td width="1%" nowrap class="body_col tcenter" rowspan="2">Auto<br>Tests</td>
143
               <td width="1%" nowrap class="body_col tcenter" rowspan="2">Build<br>Time</td>
6707 dpurdie 144
               <td width="1%" nowrap class="body_col tcenter" rowspan="2">Licence</td>
6623 dpurdie 145
               <td width="10%" nowrap class="body_col tcenter" colspan="2">Last Modified</td>
146
               <td width="21px" nowrap class="body_col"></td>
147
             </tr>
148
             <tr class="body_col form_field_bg">
149
               <td nowrap ></td>
6873 dpurdie 150
               <td nowrap ></td>
6623 dpurdie 151
               <td nowrap >
6710 dpurdie 152
                    <input name="fpkgversion" type="text" class="form_item" size="15" value="<%=parFPkgVersion%>" style="border-right: 0px;" onClick="soakEvent(event);" onKeyPress="if(event.keyCode==13) submitForm(event);">
153
                    <img class=top src="images/i_go2url.gif" onClick="submitForm(event);" title="Apply Filter">
154
               </td>
155
 
156
               <td nowrap >
6623 dpurdie 157
                 <%
158
                 Response.write "<a href='"& scriptName &"?"& Persists_Query_String( "hideRipple=" & not hideRipple ) &"'>"
159
                     If hideRipple Then
160
                       Response.write "<img src='images/RippleSquareOff.gif' width='20' height='20' border='0' title='Rippled Versions Hidden. Toggle'>"
161
                     Else
162
                       Response.write "<img src='images/RippleSquare.gif' width='20' height='20' border='0' title='Rippled Versions Shown. Toggle'>"
163
                     End If
164
                 Response.write "</a>"
165
                 %>
166
               </td>
167
               <td nowrap class="tcenter">Who</td>
168
               <td nowrap class="tcenter">Date</td>
169
               <td nowrap ></td>
170
             </tr>
171
           </thead>
172
           <tbody>
173
 
174
           <%If rsRep.RecordCount = 0 Then%>
175
               <tr>
6707 dpurdie 176
                <td colspan='11' class='body_row'>
6623 dpurdie 177
                <%If hasNoVersions(parPkgId) Then %>
178
                    This package name has no versions.
6827 dpurdie 179
                    <table>
180
                        <tr>
181
                            <%BuildActionButtonClick TRUE, "Delete this package name", "Delete", true, _
182
                                    "src='icons/i_destroy_package_sml.gif' width='15' height='15' border='0' align='absmiddle' hspace='2'", _
183
                                    "MM_openVixIFrame('_delete_package_name.asp?pkgId="&parPkgId&"&bfile=index.asp','Delete Unused Package');"%>
184
                        </tr>
185
                    </table>
6623 dpurdie 186
                <%Else%>
187
                    Found 0 records - with current filters.
188
                <%End If%>
189
                </td>
190
               </tr>
191
 
192
           <%Else
193
 
194
               aVersions = rsRep.GetRows()
195
               lastRow = UBound( aVersions, 2 )
196
 
197
               ' Sort versions
198
               Set objSortHelper = New SortHelper
199
               Call objSortHelper.VersionSort( aVersions, 0, lastRow, rsRep.FieldIndex("pkg_version") )
200
 
201
 
202
               ' Not in a project context
203
               ' Only god-like users will have this permission
204
               CanDestroyProjectPackage = canShowControl( "DestroyPackage" )
205
 
206
             ' Descending order
207
             For i = lastRow To 0 Step -1
6873 dpurdie 208
               If aVersions( rsRep.FieldIndex("build_type"), i ) = "U" Then
209
                imgLock = IMG_NOT_BUILDABLE
210
                imgData = 3
211
               ElseIf (aVersions( rsRep.FieldIndex("dlocked"), i ) = "Y")  OR (aVersions( rsRep.FieldIndex("dlocked"), i ) = "A") Then
212
                imgLock = IMG_OFFICIAL
213
                imgData = 1
214
               Else
215
                imgLock = IMG_NOT_OFFICIAL
216
                imgData = 2
6623 dpurdie 217
               End If
218
 
219
               sLink = "dependencies.asp?pv_id="& aVersions( rsRep.FieldIndex("pv_id"), i )
220
 
221
               ' User can try to delete package iff
222
               '   Have suffiecient access (unusual)
223
               '   They created it or is its owner
224
               '   The version is not in use by any release (allow to be in pending or WIP)
225
               '   [Not at the moment] The package was created less than xxxx days ago
226
               '   Is not locked or Approved for Autobuild
227
               CanDestroyPackage = CanDestroyProjectPackage
228
               If CanDestroyPackage = false Then
229
                   If  objAccessControl.UserId = aVersions( rsRep.FieldIndex("CREATOR_ID"), i ) OR objAccessControl.UserId = aVersions( rsRep.FieldIndex("OWNER_ID"), i )Then
230
                       If aVersions( rsRep.FieldIndex("inuse"), i ) = 0 Then
231
                           'If aVersions( rsRep.FieldIndex("age") , i ) < 1000 Then
232
                               If aVersions( rsRep.FieldIndex("dlocked"), i ) <> "Y" Then
233
                                   'If aVersions( rsRep.FieldIndex("dlocked"), i ) <> "A" Then
234
                                       CanDestroyPackage = true
235
                                   'End If
236
                               End If
237
                           'End If
238
                       End If
239
                   End If
240
               End If
241
 
242
               ' Set destroy package action
243
               ' title will be added by javascript
244
               If CanDestroyPackage Then
245
                    DestroyPackage = "<img src='icons/i_destroy_package_sml.gif' width='15' height='15' border='0' class='destroyThis'>"
246
               Else
247
                    DestroyPackage = ""
248
               End If
249
 
250
               Dim testCount
251
               testCount = aVersions( rsRep.FieldIndex("test_count"), i )
252
               If testCount = 0 Then testCount = ""
253
 
6873 dpurdie 254
               ' Code to support (temp) Pulse import point
255
               Dim pulseTxt : pulseTxt = ""
256
               Dim PulseMark : PulseMark = aVersions( rsRep.FieldIndex("pkg_idext"), i )
257
               Dim pulseImg
258
               If isNull(PulseMark) Then
259
                   pulseImg = "src='images/abtn_sync.gif' width='16' height='16' class=lessOpacity"
260
               ElseIf Instr(PulseMark, "PulseImport.Branch") = 1 Then
261
                   pulseImg = "src='images/bt_new_vtree.gif'"
262
               ElseIf PulseMark = "PulseImport" Then
263
                   pulseImg = "src='images/abtn_sync.gif' width='16' height='16'"
264
               Else
265
                   pulseImg = "src='images/s_warning.gif'"
266
               End If
267
               If pulseImg <> ""  Then
268
                pulseTxt ="<img "&pulseImg&" hspace='2' align='absmiddle' border='0' >"
269
               End If
270
 
271
               Dim PulseMarkStyle : PulseMarkStyle = ""
272
               If CLng(aVersions( rsRep.FieldIndex("pv_id"), i )) > 1150630 Then
273
                   PulseMarkStyle = "style='background-color: #f5d5f7;'"
274
               End If
275
 
6623 dpurdie 276
             %>
6873 dpurdie 277
                 <tr data-pvid='<%=aVersions( rsRep.FieldIndex("pv_id"), i )%>' valign="top" class="body_row form_field_grey_bg"> 
278
                   <td class='pulseInsert' <%=PulseMarkStyle%> ><%=pulseTxt%></td>
6623 dpurdie 279
                   <td data-order='<%=imgData%>'><%=imgLock%></td>
6873 dpurdie 280
                   <td data-order='<%=i%>' nowrap><a name="<%=aVersions( rsRep.FieldIndex("pv_id"), i )%>" href="<%=sLink%>" class="body_link"><%=aVersions( rsRep.FieldIndex("pkg_version"), i )%></a></td>
6623 dpurdie 281
                   <td class="body_txt_gray"><%=NewLine_To_BR ( To_HTML( aVersions( rsRep.FieldIndex("comments"), i ) ) )%></td>
282
                   <td nowrap><%=aVersions( rsRep.FieldIndex("reason"), i )%></td>
283
                   <td nowrap class='tright'><%=aVersions( rsRep.FieldIndex("code_lines"), i )%></td>
284
                   <td nowrap class='tright'><%=testCount%></td>
285
                   <td nowrap class='tright'><%=aVersions( rsRep.FieldIndex("build_time"), i )%></td>
6707 dpurdie 286
                   <td nowrap class='tright'><%=aVersions( rsRep.FieldIndex("licence"), i )%></td>
6623 dpurdie 287
                   <td nowrap><%=emailField(enum_imgUser & aVersions( rsRep.FieldIndex("full_name"), i ),  aVersions( rsRep.FieldIndex("user_email"), i ))%></td>
288
                   <td nowrap><%=DisplayShortDateTime ( aVersions( rsRep.FieldIndex("modified_stamp"), i ) )%></td>
6873 dpurdie 289
                   <td ><%=DestroyPackage%></td>
6623 dpurdie 290
                 </tr>
291
             <%  
292
 
293
             Next
294
 
295
             rsRep.Close()
296
 
297
           End If
298
             %>
299
         </tbody>
300
       </table>
6710 dpurdie 301
       </form>
6623 dpurdie 302
       <br>
303
       <!------------------------------------------------------------>         
304
       </td>
305
     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="500"></td>
306
   </tr>
307
 </table>
308
<%
309
End Sub
310
%>
5357 dpurdie 311
<html>
6623 dpurdie 312
   <head>
313
      <title>Release Manager</title>
314
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
315
      <meta http-equiv="Pragma" content="no-cache">
316
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
317
      <link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
318
      <link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
319
      <script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
320
      <!-- DROPDOWN MENUS -->
321
      <%bJqueryDataTables=true%>
322
      <%sJqueryDataTablesCss="jquery/dataTables.vix.grey.css"%>
323
      <!--#include file="_jquery_includes.asp"-->
324
      <!--#include file="_menu_def.asp"-->
325
      <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
326
      <script language="JavaScript" type="text/JavaScript">
327
      $(document).ready(function() {
6289 dpurdie 328
 
6710 dpurdie 329
        $.fn.dataTable.ext.errMode = 'none';
6623 dpurdie 330
        $('#versionTable').DataTable({
331
            "paging":   false,
332
            "ordering": true,
6873 dpurdie 333
            "info":     true,
334
            "order" : [[2,"desc"]]
6623 dpurdie 335
            });
5759 dpurdie 336
 
6623 dpurdie 337
        // Add Title to icons
338
        $('.destroyThis').prop('title', 'Destroy this version of the package.');
339
 
340
        // Destroy a package version
341
        // 
342
        $( ".destroyThis" ).on( "click", function(event) {
6873 dpurdie 343
            var pvid = $(this).closest('tr').data('pvid');
6623 dpurdie 344
            if (pvid) {
345
                var data = {
346
                    pv_id       : pvid,
347
                    bfile       : "<%=ScriptName%>",
348
                    pkg_id      : "<%=parPkgId%>",
6873 dpurdie 349
                    listby      : "1",
6623 dpurdie 350
                    fpkgversion : "<%=parFPkgVersion%>",
351
                };
6873 dpurdie 352
                MM_openVixIFrame('_destroy_package.asp?' + encodeData(data), 'Destroy Package Version');
6623 dpurdie 353
            }
354
        });
6873 dpurdie 355
 
356
      // (Temp)Pulse package insertion point handling
357
      // Add Title to icons
358
      $('.pulseInsert').prop('title', 'Toggle the Pulse package migration insertion point.');
359
      $('.pulseInsert').on( "click", function(event) {
360
          var pvid = $(this).closest('tr').data('pvid');
361
          if (pvid) {
362
              var data = {
363
                  pv_id       : pvid,
364
                  bfile       : "<%=ScriptName%>",
365
                  pkg_id      : "<%=parPkgId%>",
366
                  listby      : "1",
367
                  fpkgversion : "<%=parFPkgVersion%>",
368
                  hideRipple : "<%=hideRipple%>",
369
              };
370
              MM_openVixIFrame('_pulseImport.asp?' + encodeData(data), 'Toggle Packge Insertion Point');
371
          }
6623 dpurdie 372
      });
373
 
6873 dpurdie 374
      });
375
 
6623 dpurdie 376
      //  Encode data into URL
377
      function encodeData(data) {
378
          return Object.keys(data).map(function(key) {
379
              return [key, data[key]].map(encodeURIComponent).join("=");
380
          }).join("&");
6710 dpurdie 381
      };
382
 
383
      // Functions to support the suffix filter
384
      // Need to work against the dataTables sorting event capture
385
      function submitForm(event) {
386
          soakEvent(event);
387
          document.forms["versions"].submit();
388
      };
6623 dpurdie 389
 
6710 dpurdie 390
      function soakEvent(event) {
391
          event.stopImmediatePropagation();
392
          event.stopPropagation();
393
      }
6827 dpurdie 394
      //# sourceURL=view_by_version.asp
6623 dpurdie 395
      </script>
396
   </head>
397
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
398
      <!-- HEADER -->
399
      <!--#include file="_header.asp"-->
400
      <!-- BODY ---->
401
      <table class="full_table">
402
         <tr>
403
            <td width="146px" class="panel_bg" valign="top">
404
               <!--#include file="_front_explorer.asp"-->
405
            </td>
406
            <td width="100%" rowspan="2" align="center" valign="top">
407
                <%Call MainPanelContent%>
408
            </td>
409
         </tr>
410
         <tr>
411
            <td class="panel_bg" valign="bottom" align="center" height="350">
412
                <img src="images/img_gear.gif" vspace="20" hspace="30"></td>
413
         </tr>
5357 dpurdie 414
      </table>
6623 dpurdie 415
      <!-- FOOTER -->
416
      <!--#include file="_footer.asp"-->
417
   </body>
5357 dpurdie 418
</html>
6623 dpurdie 419