Subversion Repositories DevTools

Rev

Rev 6827 | Rev 6876 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6827 Rev 6873
Line 35... Line 35...
35
Dim CanDestroyProjectPackage
35
Dim CanDestroyProjectPackage
36
Dim CanDestroyPackage
36
Dim CanDestroyPackage
37
Dim hideRipple
37
Dim hideRipple
38
Dim rippleFilter
38
Dim rippleFilter
39
'------------ Constants Declaration -----------
39
'------------ Constants Declaration -----------
40
Const IMG_OFFICIAL = "<img src='images/i_locked.gif' width='7' height='10' hspace='5' vspace='2' alt='Package is official'>"
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'>"
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'>"
42
'------------ Variable Init -------------------
43
'------------ Variable Init -------------------
43
parFPkgVersion = RequestDefault("fpkgversion", "*")
44
parFPkgVersion = RequestDefault("fpkgversion", "*")
44
parPkgId = Request("pkg_id")
45
parPkgId = Request("pkg_id")
45
If Request("hideRipple") = "True" Then 
46
If Request("hideRipple") = "True" Then 
46
    hideRipple = True
47
    hideRipple = True
Line 122... Line 123...
122
         <input type="hidden" name="pkg_id" value="<%=parPkgId%>">
123
         <input type="hidden" name="pkg_id" value="<%=parPkgId%>">
123
         <input type="hidden" name="listby" value="<%=parListBy%>">
124
         <input type="hidden" name="listby" value="<%=parListBy%>">
124
       <table id='versionTable' width="100%"  border="0" cellspacing="1" cellpadding="2">
125
       <table id='versionTable' width="100%"  border="0" cellspacing="1" cellpadding="2">
125
           <thead>
126
           <thead>
126
             <tr>
127
             <tr>
127
               <td class="body_sect" colspan='11'>Package Versions</td>
128
               <td class="body_sect" colspan='12'>Package Versions</td>
128
             </tr>
129
             </tr>
129
             <tr class="form_field_bg">
130
             <tr class="form_field_bg">
130
               <td nowrap" class="body_txt" colspan='11'>
131
               <td nowrap" class="body_txt" colspan='12'>
131
                   Results for <b><%=PackageName%></b>
132
                   Results for <b><%=PackageName%></b>
132
               </td>
133
               </td>
133
             </tr>
134
             </tr>
134
            <tr class="form_field_bg">
135
            <tr class="form_field_bg">
135
               <td width="20px" nowrap class="body_col"></td>
136
               <td width="20px" nowrap class="body_col"></td>
-
 
137
               <td width="20px" nowrap class="body_col"></td>
136
               <td width="10%" nowrap class="body_col">Version</td>
138
               <td width="10%" nowrap class="body_col">Version</td>
137
               <td width="80%" nowrap class="body_col">Reason for Release</td>
139
               <td width="80%" nowrap class="body_col">Reason for Release</td>
138
               <td width="1%" nowrap class="body_col tcenter" rowspan="2">Build<br>Reason</td>
140
               <td width="1%" nowrap class="body_col tcenter" rowspan="2">Build<br>Reason</td>
139
               <td width="1%" nowrap class="body_col tcenter" rowspan="2">Lines of<br>Code</td>
141
               <td width="1%" nowrap class="body_col tcenter" rowspan="2">Lines of<br>Code</td>
140
               <td width="1%" nowrap class="body_col tcenter" rowspan="2">Auto<br>Tests</td>
142
               <td width="1%" nowrap class="body_col tcenter" rowspan="2">Auto<br>Tests</td>
Line 143... Line 145...
143
               <td width="10%" nowrap class="body_col tcenter" colspan="2">Last Modified</td>
145
               <td width="10%" nowrap class="body_col tcenter" colspan="2">Last Modified</td>
144
               <td width="21px" nowrap class="body_col"></td>
146
               <td width="21px" nowrap class="body_col"></td>
145
             </tr>
147
             </tr>
146
             <tr class="body_col form_field_bg">
148
             <tr class="body_col form_field_bg">
147
               <td nowrap ></td>
149
               <td nowrap ></td>
-
 
150
               <td nowrap ></td>
148
               <td nowrap >
151
               <td nowrap >
149
                    <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);">
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);">
150
                    <img class=top src="images/i_go2url.gif" onClick="submitForm(event);" title="Apply Filter">
153
                    <img class=top src="images/i_go2url.gif" onClick="submitForm(event);" title="Apply Filter">
151
               </td>
154
               </td>
152
 
155
 
Line 200... Line 203...
200
               ' Only god-like users will have this permission
203
               ' Only god-like users will have this permission
201
               CanDestroyProjectPackage = canShowControl( "DestroyPackage" )
204
               CanDestroyProjectPackage = canShowControl( "DestroyPackage" )
202
               
205
               
203
             ' Descending order
206
             ' Descending order
204
             For i = lastRow To 0 Step -1
207
             For i = lastRow To 0 Step -1
-
 
208
               If aVersions( rsRep.FieldIndex("build_type"), i ) = "U" Then
205
               imgLock = IMG_NOT_OFFICIAL
209
                imgLock = IMG_NOT_BUILDABLE
206
               imgData = 2
210
                imgData = 3
207
               If (aVersions( rsRep.FieldIndex("dlocked"), i ) = "Y")  OR (aVersions( rsRep.FieldIndex("dlocked"), i ) = "A") Then
211
               ElseIf (aVersions( rsRep.FieldIndex("dlocked"), i ) = "Y")  OR (aVersions( rsRep.FieldIndex("dlocked"), i ) = "A") Then
208
                   imgLock = IMG_OFFICIAL
212
                imgLock = IMG_OFFICIAL
209
               imgData = 1
213
                imgData = 1
-
 
214
               Else
-
 
215
                imgLock = IMG_NOT_OFFICIAL
-
 
216
                imgData = 2
210
               End If
217
               End If
211
               
218
               
212
               sLink = "dependencies.asp?pv_id="& aVersions( rsRep.FieldIndex("pv_id"), i )
219
               sLink = "dependencies.asp?pv_id="& aVersions( rsRep.FieldIndex("pv_id"), i )
213
 
220
 
214
               ' User can try to delete package iff
221
               ' User can try to delete package iff
Line 242... Line 249...
242
 
249
 
243
               Dim testCount
250
               Dim testCount
244
               testCount = aVersions( rsRep.FieldIndex("test_count"), i )
251
               testCount = aVersions( rsRep.FieldIndex("test_count"), i )
245
               If testCount = 0 Then testCount = ""
252
               If testCount = 0 Then testCount = ""
246
 
253
 
-
 
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
 
247
             %>
276
             %>
248
                 <tr valign="top" class="body_row form_field_grey_bg"> 
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>
249
                   <td data-order='<%=imgData%>'><%=imgLock%></td>
279
                   <td data-order='<%=imgData%>'><%=imgLock%></td>
250
                   <td nowrap><a name="<%=aVersions( rsRep.FieldIndex("pv_id"), i )%>" href="<%=sLink%>" class="body_link"><%=aVersions( rsRep.FieldIndex("pkg_version"), i )%></a></td>
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>
251
                   <td class="body_txt_gray"><%=NewLine_To_BR ( To_HTML( aVersions( rsRep.FieldIndex("comments"), i ) ) )%></td>
281
                   <td class="body_txt_gray"><%=NewLine_To_BR ( To_HTML( aVersions( rsRep.FieldIndex("comments"), i ) ) )%></td>
252
                   <td nowrap><%=aVersions( rsRep.FieldIndex("reason"), i )%></td>
282
                   <td nowrap><%=aVersions( rsRep.FieldIndex("reason"), i )%></td>
253
                   <td nowrap class='tright'><%=aVersions( rsRep.FieldIndex("code_lines"), i )%></td>
283
                   <td nowrap class='tright'><%=aVersions( rsRep.FieldIndex("code_lines"), i )%></td>
254
                   <td nowrap class='tright'><%=testCount%></td>
284
                   <td nowrap class='tright'><%=testCount%></td>
255
                   <td nowrap class='tright'><%=aVersions( rsRep.FieldIndex("build_time"), i )%></td>
285
                   <td nowrap class='tright'><%=aVersions( rsRep.FieldIndex("build_time"), i )%></td>
256
                   <td nowrap class='tright'><%=aVersions( rsRep.FieldIndex("licence"), i )%></td>
286
                   <td nowrap class='tright'><%=aVersions( rsRep.FieldIndex("licence"), i )%></td>
257
                   <td nowrap><%=emailField(enum_imgUser & aVersions( rsRep.FieldIndex("full_name"), i ),  aVersions( rsRep.FieldIndex("user_email"), i ))%></td>
287
                   <td nowrap><%=emailField(enum_imgUser & aVersions( rsRep.FieldIndex("full_name"), i ),  aVersions( rsRep.FieldIndex("user_email"), i ))%></td>
258
                   <td nowrap><%=DisplayShortDateTime ( aVersions( rsRep.FieldIndex("modified_stamp"), i ) )%></td>
288
                   <td nowrap><%=DisplayShortDateTime ( aVersions( rsRep.FieldIndex("modified_stamp"), i ) )%></td>
259
                   <td data-pvid='<%=aVersions( rsRep.FieldIndex("pv_id"), i )%>'><%=DestroyPackage%></td>
289
                   <td ><%=DestroyPackage%></td>
260
                 </tr>
290
                 </tr>
261
             <%  
291
             <%  
262
                 
292
                 
263
             Next
293
             Next
264
             
294
             
Line 298... Line 328...
298
 
328
 
299
        $.fn.dataTable.ext.errMode = 'none';
329
        $.fn.dataTable.ext.errMode = 'none';
300
        $('#versionTable').DataTable({
330
        $('#versionTable').DataTable({
301
            "paging":   false,
331
            "paging":   false,
302
            "ordering": true,
332
            "ordering": true,
303
            "info":     true
333
            "info":     true,
-
 
334
            "order" : [[2,"desc"]]
304
            });
335
            });
305
 
336
 
306
        // Add Title to icons
337
        // Add Title to icons
307
        $('.destroyThis').prop('title', 'Destroy this version of the package.');
338
        $('.destroyThis').prop('title', 'Destroy this version of the package.');
308
 
339
 
309
        // Destroy a package version
340
        // Destroy a package version
310
        // 
341
        // 
311
        $( ".destroyThis" ).on( "click", function(event) {
342
        $( ".destroyThis" ).on( "click", function(event) {
312
            var pvid = $(this).closest('td').data('pvid');
343
            var pvid = $(this).closest('tr').data('pvid');
313
            if (pvid) {
344
            if (pvid) {
314
                var data = {
345
                var data = {
315
                    pv_id       : pvid,
346
                    pv_id       : pvid,
316
                    bfile       : "<%=ScriptName%>",
347
                    bfile       : "<%=ScriptName%>",
317
                    pkg_id      : "<%=parPkgId%>",
348
                    pkg_id      : "<%=parPkgId%>",
318
                    listby      : "<%=parListBy%>",
349
                    listby      : "1",
319
                    fpkgversion : "<%=parFPkgVersion%>",
350
                    fpkgversion : "<%=parFPkgVersion%>",
320
                };
351
                };
321
                MM_openVixIFrame('_destroy_package.asp?' + encodeData(data), 'Destroy Package Version')
352
                MM_openVixIFrame('_destroy_package.asp?' + encodeData(data), 'Destroy Package Version');
322
            }
353
            }
323
        });
354
        });
-
 
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
          }
324
      });
372
      });
325
 
373
 
-
 
374
      });
-
 
375
      
326
      //  Encode data into URL
376
      //  Encode data into URL
327
      function encodeData(data) {
377
      function encodeData(data) {
328
          return Object.keys(data).map(function(key) {
378
          return Object.keys(data).map(function(key) {
329
              return [key, data[key]].map(encodeURIComponent).join("=");
379
              return [key, data[key]].map(encodeURIComponent).join("=");
330
          }).join("&");
380
          }).join("&");