Subversion Repositories DevTools

Rev

Rev 6706 | Rev 6876 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6576 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|          Edit/View Build Configuration            |
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="common/_form_window_common.asp"-->
20
<!--#include file="_action_buttons.asp"-->
21
<!--#include file="class/classActionButtonControl.asp"-->
22
<% '------------ ACCESS CONTROL ------------------ %>
23
<!--#include file="_access_control_login.asp"-->
24
<!--#include file="_access_control_general.asp"-->
25
<!--#include file="_access_control_action_project.asp"-->
26
<%
27
'------------ Variable Definition -------------
28
Dim parRtagId
6579 dpurdie 29
Dim pkgCount : pkgCount= 0
30
Dim pkgTestCount : pkgTestCount= 0
31
Dim testCount: testCount = 0
6576 dpurdie 32
'------------ Constants Declaration -----------
33
'------------ Variable Init -------------------
34
parRtagId = Request("rtag_id")
35
objPMod.PersistInQryString("rtag_id")
36
'----------------------------------------------
37
%>
38
<%
39
'------------ RUN BEFORE PAGE RENDER ----------
6579 dpurdie 40
'
41
'   Generate table data as JSON
42
'   Could generate via AJAX call too, but for the amount of data in the table
43
'
44
Sub GenerateData
45
    Dim rsQry
46
 
47
    OraDatabase.Parameters.Add "RTAG_ID", parRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
48
    Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("release_stats.sql"), 0 )
49
	OraDatabase.Parameters.Remove "RTAG_ID"
50
 
51
    Response.Write "<script type=""text/javascript"" charset=""utf-8"">" + vbCRLF
52
    Response.Write "var dataSet = [" + vbCRLF
53
 
54
    Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
55
        pkgCount = pkgCount + 1
56
        Dim tcount : tcount = NiceInt(rsQry("test_count"), 0)
57
        If tcount > 0 Then
58
            pkgTestCount = pkgTestCount + 1
59
            testCount = testCount + tcount 
60
        End If
61
 
62
        Dim vrefStr, prefStr, crefStr
6582 dpurdie 63
        Dim buildId, buildTime, lastBuild, codeLines, isDeployable, viewName, isSdk
6579 dpurdie 64
 
6580 dpurdie 65
        buildId = rsQry("build_id")
6579 dpurdie 66
        crefStr = "unit_test_log.asp?pv_id=" & rsQry("pv_id") & "&rtag_id=" & parRtagId 
67
        prefStr = "view_by_version.asp?pkg_id=" & rsQry("pkg_id")  & "&listby=1"
68
        vrefStr = "dependencies.asp?pv_id=" & rsQry("pv_id") & "&rtag_id=" & parRtagId
69
        buildTime = rsQry("build_time")
70
        If isNull(buildTime) Then buildTime = ""
71
        lastBuild = rsQry("lastBuild")
72
        If isNull(lastBuild) Then lastBuild = ""
6580 dpurdie 73
        codeLines = rsQry("code_lines")
74
        If isNull(codeLines) Then codeLines = ""
75
        isDeployable = rsQry("is_deployable")
76
        If isNull(isDeployable) Then isDeployable = "N"
77
        viewName = rsQry("view_name")
6582 dpurdie 78
        isSdk = rsQry("isSdk") 
6580 dpurdie 79
        If IsNull(buildId) Then tcount = ""
6579 dpurdie 80
 
81
        Response.Write "["
82
        Response.Write """<a href=" + prefStr + ">" + rsQry("pkg_name") + "</a>"""
83
        Response.Write ",""<a href=" + vrefStr + ">" + rsQry("pkg_version") + "</a>"""
6580 dpurdie 84
        Response.Write ",""<a href=" + crefStr + ">" & tcount & "</a>"""
85
        Response.Write ",""" + codeLines + """"
6579 dpurdie 86
        Response.Write ",""" + buildTime + """"
87
        Response.Write ",""" + lastBuild + """"
6580 dpurdie 88
        Response.Write ",""" + isDeployable + """"
89
        Response.Write ",""" + viewName + """"
6582 dpurdie 90
        Response.Write ",""" + isSdk + """"
6579 dpurdie 91
        Response.Write "],"  + vbCRLF
92
    rsQry.MoveNext
93
    Loop
94
    Response.Write "]"  + vbCRLF
95
    Response.Write "</script>"  + vbCRLF
96
    rsQry.close
97
    Set rsQry = nothing
98
End Sub
99
 
6576 dpurdie 100
'----------------------------------------------------
101
Sub LeftPanelContent
102
%>
6577 dpurdie 103
<fieldset class="body_rowg fset">
104
    <legend>Display</legend>
105
    <input id="noScroll" type="checkbox" name="noScroll" value="1"> No Scroll
6580 dpurdie 106
    <br><input id="noGroups" type="checkbox" name="noGroups" value="1"> No Groups
6579 dpurdie 107
    <br><input id="noCots" type="checkbox" name="noCots" value="1"> Ignore Cots
6580 dpurdie 108
    <br><input id="noDeploy" type="checkbox" name="noDeploy" value="1"> Ignore Deployable
6582 dpurdie 109
    <br><input id="noSdk" type="checkbox" name="noSdk" value="1"> Ignore SDKs
6577 dpurdie 110
</fieldset>
111
<fieldset class="body_rowg fset">
112
    <legend>Export</legend>
6641 dpurdie 113
    <input id="noDetails" type="checkbox" name="noDetails" value="1">  Summary Only
114
    <br><input id="btnExport"  name="btn" type="submit" class="form_btn" value="Test Counts as CSV"><%=Quick_Help("h_export")%>
6577 dpurdie 115
</fieldset>
6576 dpurdie 116
<%
117
End Sub
118
 
119
Sub MainPanelContent
120
%>
121
   <table class="embedded_table" style="margin-bottom:20px">
122
      <tr>
123
         <td>
124
            <!-- Box Title -->
125
            <div class="form_ttl nowrap" align="left">
126
                 Package Unit Tests
127
            </div>
128
         </td>
129
      </tr>
130
      <tr>
131
         <td>
132
            <!-- Box Content -->
133
            <div class="rounded_box">
134
               <div style="background-color: white;border-left: white solid 10px;border-right: white solid 10px;">
135
                    <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
136
                    <!--#include file="messages/_msg_inline.asp"-->
137
                    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
6582 dpurdie 138
                    <div id="packageStatsHolder">
6577 dpurdie 139
                    <table id="packageStats" width="100%" class="embedded_table">
140
                        <thead class="envGroup">
141
                           <tr class="body_col envGroup">
142
                              <td valign="top" nowrap>Package</td>
143
                              <td valign="top" nowrap>Version</td>
6587 dpurdie 144
                              <td valign="top" nowrap>Unit<br>Tests</td>
145
                              <td valign="top" nowrap>Lines<br>of Code</td>
6580 dpurdie 146
                              <td valign="top" nowrap>Build<br>Duration</td>
147
                              <td valign="top" nowrap>Build Date</td>
148
                              <td valign="top" nowrap>Deployable</td>
149
                              <td valign="top" nowrap>View Name</td>
6582 dpurdie 150
                              <td valign="top" nowrap>SDK</td>
6577 dpurdie 151
                           </tr>
152
                        </thead>
6576 dpurdie 153
                  </table>
6582 dpurdie 154
                  </div>
6579 dpurdie 155
                  <table width="100%" class="embedded_table">
6580 dpurdie 156
                  <tr class="body_col envGroup"><th colspan=5>Summary</th></tr>
157
                  <tr class="body_rowg"><td colspan=4>Total Packages</td><td id="pkgCount"></td></tr>
158
                  <tr class="body_rowg"><td colspan=4>Total Packages with Tests</td><td id="pkgTestCount"></td></tr>
159
                  <tr class="body_rowg"><td colspan=4>Total Unit Tests</td><td id="testCount"></td></tr>
6587 dpurdie 160
                  <tr class="body_rowg"><td colspan=4>Total Lines of Code</td><td id="tloc"></td></tr>
6579 dpurdie 161
                  </table>
6576 dpurdie 162
               </div>
163
            </div>
164
         </td>
165
      </tr>
166
   </table>
167
<%
168
End Sub
169
%>
170
<NOSCRIPT LANGUAGE="VBScript" RUNAT=SERVER SRC="common/VarDump.vbs"></NOSCRIPT> 
171
<html>
172
   <head>
173
      <title>Release Manager</title>
174
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
175
      <meta http-equiv="Pragma" content="no-cache">
176
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 177
      <link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
178
      <link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
179
      <script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
6576 dpurdie 180
      <!-- DROPDOWN MENUS -->
6577 dpurdie 181
      <%bJqueryDataTables = TRUE%>
6576 dpurdie 182
      <!--#include file="_jquery_includes.asp"-->
183
      <!--#include file="_menu_def.asp"-->
6579 dpurdie 184
      <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
185
      <script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
186
      <script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
6577 dpurdie 187
      <script language="JavaScript" type="text/JavaScript">
188
      formTips.tips.h_export       = stdTip(300, 'Export Test Count', 'Unit test counts will be copied to the users clipboard is CSV format.' +
189
                                                                  '<p>The data is to be integrated into other reports.' 
190
                                                                  );
191
      </script>
6579 dpurdie 192
      <%Call GenerateData%>
6580 dpurdie 193
      <style type="text/css">
194
          table.dataTable tbody tr.baseGroup{background:#dad7c8;}
195
          table.dataTable tbody tr.baseGroup td{border-bottom:1pt solid black;;border-top:1pt solid black;}
196
          table.dataTable tbody tr td.header{color:black;font-weight:bold;}
197
          table.dataTable tbody tr td.info{color:gray;font-weight:normal;}
198
      </style>
6577 dpurdie 199
      <script type="text/javascript" charset="utf-8">
6579 dpurdie 200
 
6582 dpurdie 201
          // Helper object to contain unit tests stats
202
        function groupStats() {
203
            this.total = 0;
204
            this.withTests = 0;
205
            this.testCount = 0;
6587 dpurdie 206
            this.loc = 0;
6582 dpurdie 207
        };
6580 dpurdie 208
 
6582 dpurdie 209
        var pkgStats = {
210
            // Ref to the current table
211
            table : null ,
212
 
213
            // A copy of the original table body
214
            html : null,
215
 
216
            // Display package groups
217
            noGroup : false,
218
 
219
            // Counters for all and for each groups
220
            info : null,
221
            groupinfo : null,
222
 
223
            // Part of config - with groups
224
            withGroups : [
225
                    { "visible": false, "targets": [6,7,8] },
6587 dpurdie 226
                    { "className" : 'nowrap', targets: [1,2,3,4,5] },
6582 dpurdie 227
                    { "orderData" : [7,0], targets : 0 },
228
                    { "orderData" : [7,1], targets : 1 },
229
                    { "orderData" : [7,2], targets : 2 },
230
                    { "orderData" : [7,3], targets : 3 },
231
                    { "orderData" : [7,4], targets : 4 },
232
                    { "orderData" : [7,5], targets : 5 },
233
                    { "orderData" : [7,0], targets : 7 },
234
                ],
235
 
236
            // Part of config - with out groups
237
            withNoGroups : [
238
                    { "visible": false, "targets": [6,7,8] },
6587 dpurdie 239
                    { "className" : 'nowrap', targets: [1,2,3,4,5] },
6582 dpurdie 240
                ],
241
 
242
            // Basic table config
243
            tableConfig : {
244
                //  Vix Usage
245
                //  Used so that the internal functions can access the rest of the pkgStats data
246
                //  Will be filled in with a function to return the data
247
                parentRef : null,
248
 
249
                // Standard config
250
                //    scrollY and columnDefs will be provided before table is created
251
                dom:            "lfrti",
252
                scrollY:        "65vh",
253
                scrollCollapse: true,
254
                paging:         false,
255
                language : { info: "Showing _TOTAL_ entries" },
256
                columnDefs: null,
257
                order: [[0,'asc']],
258
                drawCallback: function ( settings ) {
259
                    var api = this.api();
260
                    var parentRef = api.init().parentRef();
261
                    if (parentRef.noGroup) {
262
                        return;
6580 dpurdie 263
                    }
6577 dpurdie 264
 
6582 dpurdie 265
                    var groupinfo = parentRef.groupinfo;
266
                    $('#noGroups').prop('checked', false)
267
                    var rows = api.rows( { page: 'current' }).nodes();
268
                    var last=null;
269
                    api.column(7, {page:'current'} ).data().each( function ( group, i ) {
270
                        if ( last !== group ) {
271
                            last = group;
272
                            var gdata = groupinfo[group];
273
                            var gtext = new Array();
274
                            gtext.push('Packages: ' + gdata.total + '.');
275
                            gtext.push('With Tests: ' + gdata.withTests + '.');
276
                            gtext.push('Unit Tests: ' + gdata.testCount + '.');
6587 dpurdie 277
                            gtext.push('LoC: ' + gdata.loc + '.');
6582 dpurdie 278
                            $(rows).eq( i ).before(
6587 dpurdie 279
                                '<tr class="baseGroup"><td class="header" colspan="2">'+group+ '</td><td class="info nowrap" colspan="4">'+gtext.join(' ') + '</td></tr>'
6582 dpurdie 280
                            );
281
                        }
282
                    });
6587 dpurdie 283
                    parentRef.setHeight();
6582 dpurdie 284
                }
285
            },
286
 
287
            // Create a basic DataTable
288
            //  Then populate it
289
            createPkgStatsTable : function(){
290
                 // Save or restore the original HTML of the table
291
                 if ( !this.html ) {
292
                     this.html = $('#packageStatsHolder').html();
293
                 } else {
294
                     //  Basically need to kill of the multi column ordering, but I can't do it programatically
295
                     //  Destroy / rebuild the table
296
                     //  The destoy() function in the 1.10.8 crashes when used with 'false'
297
                     //  Using 'true' removes the html of the table - so we save it and put it back
298
                     this.table.destroy(true);
299
                     $('#packageStatsHolder').html(this.html);
300
                 }
301
 
302
                 this.noGroup = $('#noGroups').get(0).checked;
303
                 this.tableConfig.columnDefs = this.noGroup ? this.withNoGroups : this.withGroups;
6789 dpurdie 304
                 this.tableConfig.scrollY = $('#noScroll').get(0).checked ? '' : '65vh';
6582 dpurdie 305
 
306
                 var that = this;
6587 dpurdie 307
                 var tableConfig = Object.assign({}, this.tableConfig);
308
                 tableConfig.parentRef = function(){return that;};
309
                 this.table = $('#packageStats').DataTable(tableConfig);
6582 dpurdie 310
                 this.insertAllData();
311
            },
312
 
6579 dpurdie 313
            //
314
            //  Filter data and insert into the table
6582 dpurdie 315
            insertAllData : function () {
6580 dpurdie 316
                var noDeploy = $('#noDeploy').get(0).checked; 
6582 dpurdie 317
                var noCots   = $('#noCots').get(0).checked;
318
                var noSdk    = $('#noSdk').get(0).checked;
6580 dpurdie 319
 
6579 dpurdie 320
                var ii;
6582 dpurdie 321
                this.table.clear();
322
                this.info = new groupStats();
323
                this.groupinfo = {};
6579 dpurdie 324
 
325
                for (ii = 0; ii < dataSet.length; ii++) {
6580 dpurdie 326
                    if ( noCots ) {
327
                        var vdata = $(dataSet[ii][1]).text();
328
                        if ( vdata.match(/.cots$/) || vdata.match(/.tool$/) ) {
329
                            continue;
6579 dpurdie 330
                        }
331
                    }
6580 dpurdie 332
 
333
                    if ( noDeploy ) {
334
                        var dData = dataSet[ii][6];
335
                        if ( dData == 'Y' ) {
336
                            continue;
337
                        }
338
                    }
339
 
6582 dpurdie 340
                    if ( noSdk ) {
341
                        var dData = dataSet[ii][8];
342
                        if ( dData == 'Y' ) {
343
                            continue;
344
                        }
345
                    }
346
 
6580 dpurdie 347
                    var group = dataSet[ii][7];
6582 dpurdie 348
                    var gdata = this.groupinfo[group];
349
                    if ( !gdata ) {
350
                        this.groupinfo[group] = new groupStats();
351
                        gdata = this.groupinfo[group];
6580 dpurdie 352
                    }
353
 
6582 dpurdie 354
                    this.table.row.add( dataSet[ii]);
355
                    this.info.total ++;
6580 dpurdie 356
                    gdata.total++;
357
                    var count = parseInt($(dataSet[ii][2]).text());
6587 dpurdie 358
                    var loc = parseInt(dataSet[ii][3]);
6580 dpurdie 359
                    if ( !isNaN(count) && count > 0 ) {
6582 dpurdie 360
                        this.info.withTests++;
6580 dpurdie 361
                        gdata.withTests++;
6582 dpurdie 362
                        this.info.testCount += count;
6580 dpurdie 363
                        gdata.testCount += count;
364
                    }
6587 dpurdie 365
                    if ( !isNaN(loc) && loc > 0 ) {
366
                        this.info.loc += loc;
367
                        gdata.loc += loc;
368
                    }
6579 dpurdie 369
                }
6582 dpurdie 370
                this.table.draw();
6579 dpurdie 371
 
6582 dpurdie 372
                $('#pkgCount').text(this.info.total);
373
                $('#pkgTestCount').text(this.info.withTests);
374
                $('#testCount').text(this.info.testCount);
6587 dpurdie 375
                $('#tloc').text(this.info.loc);
6582 dpurdie 376
            },
6579 dpurdie 377
 
6582 dpurdie 378
            setHeight : function () {
379
                 var noScroll = $('#noScroll').get(0).checked;
380
                 if ( noScroll ) {
381
                     var ScrollBody = $('#packageStats').closest('.dataTables_scrollBody');
382
                     // work on Datatables 1.10.12 ++, but not on 1.10.8, although lots else works better
383
                     ScrollBody.css('max-height', "100%");
384
                     ScrollBody.css('height', "100%");
385
                 }
386
            },
6577 dpurdie 387
 
6582 dpurdie 388
        };
6577 dpurdie 389
 
6582 dpurdie 390
        $(document).ready(function() {
6579 dpurdie 391
 
6582 dpurdie 392
        // Instantiate the table
393
        pkgStats.createPkgStatsTable();
6580 dpurdie 394
 
6582 dpurdie 395
        // Enable / Disable full table display
396
        // Use / Don't use base View groups
397
        $('#noScroll,#noGroups').click(function(e){
398
            pkgStats.createPkgStatsTable();
399
        });
6580 dpurdie 400
 
6582 dpurdie 401
        // Hide / Show the the COTS packages
402
        // Hide / Show the the Deployed packages
403
        // Hide / Show the packages from SDKs
404
        $('#noCots,#noDeploy,#noSdk').click(function(e){
405
            pkgStats.insertAllData();
406
        });
6577 dpurdie 407
 
6587 dpurdie 408
        // Copy multi-line data to the users clipboard
6582 dpurdie 409
        function copyToClipboard(string) {
6587 dpurdie 410
            var $temp = $("<textarea>");
6582 dpurdie 411
            $("body").append($temp);
412
            $temp.val(string).select();
413
            document.execCommand("copy");
414
            $temp.remove();
415
        };
6577 dpurdie 416
 
6582 dpurdie 417
        // Export Data
6706 dpurdie 418
        $('#btnExport').click(function(event){
419
            vixEtableData =  $(this).closest('table');
420
            var menu = '<div class="rex_clm" >&nbsp;Select Operation</div>';
421
            menu += '<div class="mmItem" onClick="statNewWin();">Show&nbsp;in&nbsp;New&nbsp;Window</div>';
422
            menu += '<div class="mmItem" onClick="statDialog();">Show in Dialog</div>';
423
            menu += '<div class="mmItem" onClick="statDownLoad();">Download File</div>';
424
            menu += '<div class="mmItem" onClick="statClip();">Copy to Clipboard</div>';
425
            showmenu(event,menu);
426
            event.stopImmediatePropagation();
427
            event.stopPropagation();
428
            return false;
429
        });
430
    });
6577 dpurdie 431
 
6579 dpurdie 432
 
6706 dpurdie 433
    // Show Stats in a new window
434
    function statNewWin() {
435
        var title = "CSV Stats";
436
        var data = getData();
437
        var generator = PopupCenter('', title, 800, 400);
438
        generator.document.write('<html><head><title>'+title+'</title>');
439
        generator.document.write('</head><body >');
440
        generator.document.write('<textArea style="width:100%; height:100%;" wrap="off" >');
441
        generator.document.write(data.join('\r\n'));
442
        generator.document.write('</textArea>');
443
        generator.document.write('</body></html>');
444
        generator.document.close();
445
    };
6587 dpurdie 446
 
6706 dpurdie 447
    // Show Stats in a new dialog
448
    function statDialog() {
449
        var title = "CSV Stats";
450
        var data = getData();
451
        var newDiv = $(document.createElement('div'));
452
        $(newDiv).html(data.join('<br>'));
453
        $(newDiv).dialog({width: 800, height: 400, modal:true, position: { my: "top", at: "top+100", of: window }, title: title});
454
    };
6587 dpurdie 455
 
6706 dpurdie 456
    // Show Stats in a new dialog
457
    function statDownLoad() {
458
        filename = 'data.csv';
459
        var data = getData().join('\r\n');
460
        var blob = new Blob(['\ufeff'+data], { type: 'text/csv;charset=utf-8;' });
461
        if (navigator.msSaveBlob) { // IE 10+
462
            navigator.msSaveBlob(blob, options.filename);
463
        } else {
464
            var link = document.createElement("a");
465
            var url = URL.createObjectURL(blob);
466
            var isSafari = navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1;
467
            if (isSafari) //if Safari open in new window to save file with random filename.
468
                link.setAttribute("target", "_blank");
469
            link.setAttribute("href", url);
470
            link.setAttribute("download", filename);
471
            link.style = "visibility:hidden";
472
            document.body.appendChild(link);
473
            link.click();
474
            document.body.removeChild(link);
475
        }
476
    };
6614 dpurdie 477
 
6706 dpurdie 478
    // Copy to Clipboard
479
    function statClip(){
480
        var lines = getData(); 
481
        vixTextToClipBoard(lines.join('\r\n'),{note:'CSV Data copied to clipboard'});
482
    };
483
 
484
    // Get the data in CSV form
485
    function getData(){
486
        var csv = [];
487
        var csvHdr = [];
488
        var lines = [];
489
        var linesHdr = '';
490
        var date = new Date();
491
        var tstamp = (date.getFullYear() * 10000) + ((date.getMonth() + 1) * 100) + date.getDate()
492
        var noDetails = $('#noDetails').get(0).checked;
493
 
494
        function createHeader() {
495
            //  Insert DateStamp as YYMMDD
496
            csv.push(tstamp);
497
            csvHdr.push('Date');
498
 
499
            //  Insert Release ID
500
            csv.push(<%=DB_RTAG_ID%>);
501
            csvHdr.push('RtagId');
502
            csv.push("<%=DB_PROJ_NAME%>");
503
            csvHdr.push('Project Name');
504
            csv.push("<%=DB_RTAG_NAME%>");
505
            csvHdr.push('Release Name');
506
        }
507
 
508
        function addInfo(info) {
509
            csv.push(info.total);
510
            csvHdr.push('Total Packages');
511
            csv.push(info.withTests);
512
            csvHdr.push('Packages with Tests');
513
            csv.push(info.testCount);
514
            csvHdr.push('Total Unit Tests');
515
            csv.push(info.loc);
516
            csvHdr.push('Total Lines of Code');
517
        }
518
 
519
        function saveCsv() {
520
            if ( csv.length ) {
521
                lines.push(csv.join(","));
522
                csv = [];
523
 
524
                var nextLineHdr = csvHdr.join(",");
525
                if ( nextLineHdr.length > linesHdr.length ) {
526
                    linesHdr = nextLineHdr 
6587 dpurdie 527
                }
6706 dpurdie 528
 
529
                lines.push();
530
                csvHdr = [];
6587 dpurdie 531
            }
6706 dpurdie 532
        }
6587 dpurdie 533
 
6706 dpurdie 534
        // Generate a CSV representation of the data in the table
535
        // Support two forms - grouped and un grouped
536
        //
537
        if (pkgStats.noGroup) {
538
            // Ungrouped - all packages
539
            createHeader();
540
            csv.push('ALL');
541
            csvHdr.push('Group');
542
            addInfo(pkgStats.info);
543
            if ( !noDetails )
544
            {
545
                pkgStats.table.rows().every(function(rowIdx, tableLoop, rowLoop) {
546
                    var data = this.data();
547
                    csv.push($(data[0]).text(), $(data[2]).text(), data[3] );
548
                    csvHdr.push('Package','Tests','LoC');
549
                });
550
            }
551
            saveCsv();
552
        } else {
553
            // Grouped by package
554
            var lastGroup = null;
555
            pkgStats.table.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
556
                var data = this.data();
557
                var group = data[7];
558
                if ( group != lastGroup ) {
559
                    lastGroup = group;
560
                    saveCsv();
561
                    createHeader();
562
                    csv.push(group);
563
                    csvHdr.push('Group');
564
                    addInfo(pkgStats.groupinfo[group]);
565
                }
6641 dpurdie 566
                if ( !noDetails )
567
                {
6706 dpurdie 568
                    csv.push($(data[0]).text(), $(data[2]).text(), data[3]);
569
                    csvHdr.push('Package','Tests','LoC');
6641 dpurdie 570
                }
6577 dpurdie 571
            });
6706 dpurdie 572
            saveCsv();
573
        }
574
        lines.unshift(linesHdr);
575
        return lines;
576
    };
577
 
6582 dpurdie 578
  </script>
6577 dpurdie 579
 
6576 dpurdie 580
   </head>
581
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
582
      <!-- HEADER -->
583
      <!--#include file="_header.asp"-->
584
      <!-- BODY ---->
585
      <table class="full_table">
586
         <tr>
587
            <td width="146px" class="panel_bg" valign="top">
588
                <%Call LeftPanelContent%>
589
            </td>
6577 dpurdie 590
            <td width="90%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
6576 dpurdie 591
                <%Call MainPanelContent%>
592
            </td>
593
         </tr>
594
         <tr>
595
            <td class="panel_bg" valign="bottom" align="center" height="350">
596
                <img src="images/release_stats.png" vspace="20" hspace="30"></td>
597
         </tr>
598
      </table>
599
      <!-- FOOTER -->
600
      <!--#include file="_footer.asp"-->
601
   </body>
602
</html>
603