Subversion Repositories DevTools

Rev

Rev 6641 | Rev 6789 | 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;
304
 
305
                 var that = this;
6587 dpurdie 306
                 var tableConfig = Object.assign({}, this.tableConfig);
307
                 tableConfig.parentRef = function(){return that;};
308
                 this.table = $('#packageStats').DataTable(tableConfig);
6582 dpurdie 309
                 this.insertAllData();
310
            },
311
 
6579 dpurdie 312
            //
313
            //  Filter data and insert into the table
6582 dpurdie 314
            insertAllData : function () {
6580 dpurdie 315
                var noDeploy = $('#noDeploy').get(0).checked; 
6582 dpurdie 316
                var noCots   = $('#noCots').get(0).checked;
317
                var noSdk    = $('#noSdk').get(0).checked;
6580 dpurdie 318
 
6579 dpurdie 319
                var ii;
6582 dpurdie 320
                this.table.clear();
321
                this.info = new groupStats();
322
                this.groupinfo = {};
6579 dpurdie 323
 
324
                for (ii = 0; ii < dataSet.length; ii++) {
6580 dpurdie 325
                    if ( noCots ) {
326
                        var vdata = $(dataSet[ii][1]).text();
327
                        if ( vdata.match(/.cots$/) || vdata.match(/.tool$/) ) {
328
                            continue;
6579 dpurdie 329
                        }
330
                    }
6580 dpurdie 331
 
332
                    if ( noDeploy ) {
333
                        var dData = dataSet[ii][6];
334
                        if ( dData == 'Y' ) {
335
                            continue;
336
                        }
337
                    }
338
 
6582 dpurdie 339
                    if ( noSdk ) {
340
                        var dData = dataSet[ii][8];
341
                        if ( dData == 'Y' ) {
342
                            continue;
343
                        }
344
                    }
345
 
6580 dpurdie 346
                    var group = dataSet[ii][7];
6582 dpurdie 347
                    var gdata = this.groupinfo[group];
348
                    if ( !gdata ) {
349
                        this.groupinfo[group] = new groupStats();
350
                        gdata = this.groupinfo[group];
6580 dpurdie 351
                    }
352
 
6582 dpurdie 353
                    this.table.row.add( dataSet[ii]);
354
                    this.info.total ++;
6580 dpurdie 355
                    gdata.total++;
356
                    var count = parseInt($(dataSet[ii][2]).text());
6587 dpurdie 357
                    var loc = parseInt(dataSet[ii][3]);
6580 dpurdie 358
                    if ( !isNaN(count) && count > 0 ) {
6582 dpurdie 359
                        this.info.withTests++;
6580 dpurdie 360
                        gdata.withTests++;
6582 dpurdie 361
                        this.info.testCount += count;
6580 dpurdie 362
                        gdata.testCount += count;
363
                    }
6587 dpurdie 364
                    if ( !isNaN(loc) && loc > 0 ) {
365
                        this.info.loc += loc;
366
                        gdata.loc += loc;
367
                    }
6579 dpurdie 368
                }
6582 dpurdie 369
                this.table.draw();
6579 dpurdie 370
 
6582 dpurdie 371
                $('#pkgCount').text(this.info.total);
372
                $('#pkgTestCount').text(this.info.withTests);
373
                $('#testCount').text(this.info.testCount);
6587 dpurdie 374
                $('#tloc').text(this.info.loc);
6582 dpurdie 375
            },
6579 dpurdie 376
 
6582 dpurdie 377
            setHeight : function () {
378
                 var noScroll = $('#noScroll').get(0).checked;
379
                 if ( noScroll ) {
380
                     var ScrollBody = $('#packageStats').closest('.dataTables_scrollBody');
381
                     // work on Datatables 1.10.12 ++, but not on 1.10.8, although lots else works better
382
                     ScrollBody.css('max-height', "100%");
383
                     ScrollBody.css('height', "100%");
384
                 }
385
            },
6577 dpurdie 386
 
6582 dpurdie 387
        };
6577 dpurdie 388
 
6582 dpurdie 389
        $(document).ready(function() {
6579 dpurdie 390
 
6582 dpurdie 391
        // Instantiate the table
392
        pkgStats.createPkgStatsTable();
6580 dpurdie 393
 
6582 dpurdie 394
        // Enable / Disable full table display
395
        // Use / Don't use base View groups
396
        $('#noScroll,#noGroups').click(function(e){
397
            pkgStats.createPkgStatsTable();
398
        });
6580 dpurdie 399
 
6582 dpurdie 400
        // Hide / Show the the COTS packages
401
        // Hide / Show the the Deployed packages
402
        // Hide / Show the packages from SDKs
403
        $('#noCots,#noDeploy,#noSdk').click(function(e){
404
            pkgStats.insertAllData();
405
        });
6577 dpurdie 406
 
6587 dpurdie 407
        // Copy multi-line data to the users clipboard
6582 dpurdie 408
        function copyToClipboard(string) {
6587 dpurdie 409
            var $temp = $("<textarea>");
6582 dpurdie 410
            $("body").append($temp);
411
            $temp.val(string).select();
412
            document.execCommand("copy");
413
            $temp.remove();
414
        };
6577 dpurdie 415
 
6582 dpurdie 416
        // Export Data
6706 dpurdie 417
        $('#btnExport').click(function(event){
418
            vixEtableData =  $(this).closest('table');
419
            var menu = '<div class="rex_clm" >&nbsp;Select Operation</div>';
420
            menu += '<div class="mmItem" onClick="statNewWin();">Show&nbsp;in&nbsp;New&nbsp;Window</div>';
421
            menu += '<div class="mmItem" onClick="statDialog();">Show in Dialog</div>';
422
            menu += '<div class="mmItem" onClick="statDownLoad();">Download File</div>';
423
            menu += '<div class="mmItem" onClick="statClip();">Copy to Clipboard</div>';
424
            showmenu(event,menu);
425
            event.stopImmediatePropagation();
426
            event.stopPropagation();
427
            return false;
428
        });
429
    });
6577 dpurdie 430
 
6579 dpurdie 431
 
6706 dpurdie 432
    // Show Stats in a new window
433
    function statNewWin() {
434
        var title = "CSV Stats";
435
        var data = getData();
436
        var generator = PopupCenter('', title, 800, 400);
437
        generator.document.write('<html><head><title>'+title+'</title>');
438
        generator.document.write('</head><body >');
439
        generator.document.write('<textArea style="width:100%; height:100%;" wrap="off" >');
440
        generator.document.write(data.join('\r\n'));
441
        generator.document.write('</textArea>');
442
        generator.document.write('</body></html>');
443
        generator.document.close();
444
    };
6587 dpurdie 445
 
6706 dpurdie 446
    // Show Stats in a new dialog
447
    function statDialog() {
448
        var title = "CSV Stats";
449
        var data = getData();
450
        var newDiv = $(document.createElement('div'));
451
        $(newDiv).html(data.join('<br>'));
452
        $(newDiv).dialog({width: 800, height: 400, modal:true, position: { my: "top", at: "top+100", of: window }, title: title});
453
    };
6587 dpurdie 454
 
6706 dpurdie 455
    // Show Stats in a new dialog
456
    function statDownLoad() {
457
        filename = 'data.csv';
458
        var data = getData().join('\r\n');
459
        var blob = new Blob(['\ufeff'+data], { type: 'text/csv;charset=utf-8;' });
460
        if (navigator.msSaveBlob) { // IE 10+
461
            navigator.msSaveBlob(blob, options.filename);
462
        } else {
463
            var link = document.createElement("a");
464
            var url = URL.createObjectURL(blob);
465
            var isSafari = navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1;
466
            if (isSafari) //if Safari open in new window to save file with random filename.
467
                link.setAttribute("target", "_blank");
468
            link.setAttribute("href", url);
469
            link.setAttribute("download", filename);
470
            link.style = "visibility:hidden";
471
            document.body.appendChild(link);
472
            link.click();
473
            document.body.removeChild(link);
474
        }
475
    };
6614 dpurdie 476
 
6706 dpurdie 477
    // Copy to Clipboard
478
    function statClip(){
479
        var lines = getData(); 
480
        vixTextToClipBoard(lines.join('\r\n'),{note:'CSV Data copied to clipboard'});
481
    };
482
 
483
    // Get the data in CSV form
484
    function getData(){
485
        var csv = [];
486
        var csvHdr = [];
487
        var lines = [];
488
        var linesHdr = '';
489
        var date = new Date();
490
        var tstamp = (date.getFullYear() * 10000) + ((date.getMonth() + 1) * 100) + date.getDate()
491
        var noDetails = $('#noDetails').get(0).checked;
492
 
493
        function createHeader() {
494
            //  Insert DateStamp as YYMMDD
495
            csv.push(tstamp);
496
            csvHdr.push('Date');
497
 
498
            //  Insert Release ID
499
            csv.push(<%=DB_RTAG_ID%>);
500
            csvHdr.push('RtagId');
501
            csv.push("<%=DB_PROJ_NAME%>");
502
            csvHdr.push('Project Name');
503
            csv.push("<%=DB_RTAG_NAME%>");
504
            csvHdr.push('Release Name');
505
        }
506
 
507
        function addInfo(info) {
508
            csv.push(info.total);
509
            csvHdr.push('Total Packages');
510
            csv.push(info.withTests);
511
            csvHdr.push('Packages with Tests');
512
            csv.push(info.testCount);
513
            csvHdr.push('Total Unit Tests');
514
            csv.push(info.loc);
515
            csvHdr.push('Total Lines of Code');
516
        }
517
 
518
        function saveCsv() {
519
            if ( csv.length ) {
520
                lines.push(csv.join(","));
521
                csv = [];
522
 
523
                var nextLineHdr = csvHdr.join(",");
524
                if ( nextLineHdr.length > linesHdr.length ) {
525
                    linesHdr = nextLineHdr 
6587 dpurdie 526
                }
6706 dpurdie 527
 
528
                lines.push();
529
                csvHdr = [];
6587 dpurdie 530
            }
6706 dpurdie 531
        }
6587 dpurdie 532
 
6706 dpurdie 533
        // Generate a CSV representation of the data in the table
534
        // Support two forms - grouped and un grouped
535
        //
536
        if (pkgStats.noGroup) {
537
            // Ungrouped - all packages
538
            createHeader();
539
            csv.push('ALL');
540
            csvHdr.push('Group');
541
            addInfo(pkgStats.info);
542
            if ( !noDetails )
543
            {
544
                pkgStats.table.rows().every(function(rowIdx, tableLoop, rowLoop) {
545
                    var data = this.data();
546
                    csv.push($(data[0]).text(), $(data[2]).text(), data[3] );
547
                    csvHdr.push('Package','Tests','LoC');
548
                });
549
            }
550
            saveCsv();
551
        } else {
552
            // Grouped by package
553
            var lastGroup = null;
554
            pkgStats.table.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
555
                var data = this.data();
556
                var group = data[7];
557
                if ( group != lastGroup ) {
558
                    lastGroup = group;
559
                    saveCsv();
560
                    createHeader();
561
                    csv.push(group);
562
                    csvHdr.push('Group');
563
                    addInfo(pkgStats.groupinfo[group]);
564
                }
6641 dpurdie 565
                if ( !noDetails )
566
                {
6706 dpurdie 567
                    csv.push($(data[0]).text(), $(data[2]).text(), data[3]);
568
                    csvHdr.push('Package','Tests','LoC');
6641 dpurdie 569
                }
6577 dpurdie 570
            });
6706 dpurdie 571
            saveCsv();
572
        }
573
        lines.unshift(linesHdr);
574
        return lines;
575
    };
576
 
6582 dpurdie 577
  </script>
6577 dpurdie 578
 
6576 dpurdie 579
   </head>
580
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
581
      <!-- HEADER -->
582
      <!--#include file="_header.asp"-->
583
      <!-- BODY ---->
584
      <table class="full_table">
585
         <tr>
586
            <td width="146px" class="panel_bg" valign="top">
587
                <%Call LeftPanelContent%>
588
            </td>
6577 dpurdie 589
            <td width="90%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
6576 dpurdie 590
                <%Call MainPanelContent%>
591
            </td>
592
         </tr>
593
         <tr>
594
            <td class="panel_bg" valign="bottom" align="center" height="350">
595
                <img src="images/release_stats.png" vspace="20" hspace="30"></td>
596
         </tr>
597
      </table>
598
      <!-- FOOTER -->
599
      <!--#include file="_footer.asp"-->
600
   </body>
601
</html>
602