Subversion Repositories DevTools

Rev

Rev 6576 | Rev 6579 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|          Edit/View Build Configuration            |
'|                                                   |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0   ' always load the page, dont store
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/_form_window_common.asp"-->
<!--#include file="_action_buttons.asp"-->
<!--#include file="class/classActionButtonControl.asp"-->
<% '------------ ACCESS CONTROL ------------------ %>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<!--#include file="_access_control_action_project.asp"-->
<%
'------------ Variable Definition -------------
Dim parRtagId
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parRtagId = Request("rtag_id")
objPMod.PersistInQryString("rtag_id")
'----------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------
'----------------------------------------------------
Sub LeftPanelContent
%>
<fieldset class="body_rowg fset">
    <legend>Display</legend>
    <input id="noScroll" type="checkbox" name="noScroll" value="1"> No Scroll
</fieldset>
<fieldset class="body_rowg fset">
    <legend>Export</legend>
    <input id="btnExport"  name="btn" type="submit" class="form_btn" value="Test Counts as CSV"><%=Quick_Help("h_export")%>
</fieldset>
<%
End Sub

Sub MainPanelContent
    Dim pkgCount : pkgCount= 0
    Dim pkgTestCount : pkgTestCount= 0
    Dim testCount: testCount = 0
    Dim rsQry

    OraDatabase.Parameters.Add "RTAG_ID", parRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
    Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("release_stats.sql"), 0 )
        OraDatabase.Parameters.Remove "RTAG_ID"

%>
   <table class="embedded_table" style="margin-bottom:20px">
      <tr>
         <td>
            <!-- Box Title -->
            <div class="form_ttl nowrap" align="left">
                 Package Unit Tests
            </div>
         </td>
      </tr>
      <tr>
         <td>
            <!-- Box Content -->
            <div class="rounded_box">
               <div style="background-color: white;border-left: white solid 10px;border-right: white solid 10px;">
                    <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                    <!--#include file="messages/_msg_inline.asp"-->
                    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                    <table id="packageStats" width="100%" class="embedded_table">
                        <thead class="envGroup">
                           <tr class="body_col envGroup">
                              <td valign="top" nowrap>Package</td>
                              <td valign="top" nowrap>Version</td>
                              <td valign="top" nowrap>Test&nbsp;Count</td>
                              <td valign="top" nowrap>Build&nbsp;Duration</td>
                              <td valign="top" nowrap>Build&nbsp;Date</td>
                           </tr>
                        </thead>
                        <tbody>
                        <%
                        Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
                            pkgCount = pkgCount + 1
                            Dim tcount : tcount = NiceInt(rsQry("test_count"), 0)
                            If tcount > 0 Then
                                pkgTestCount = pkgTestCount + 1
                                testCount = testCount + tcount 
                            End If

                            Dim vrefStr, prefStr, crefStr
                            crefStr = "unit_test_log.asp?pv_id=" & rsQry("pv_id") & "&rtag_id=" & parRtagId 
                            prefStr = "view_by_version.asp?pkg_id=" & rsQry("pkg_id")  & "&listby=1"
                            vrefStr = "dependencies.asp?pv_id=" & rsQry("pv_id") & "&rtag_id=" & parRtagId 
                        %>
                       <tr>
                        <td nowrap class="body_rowg"><a href=<%=prefStr%>><%=rsQry("pkg_name")%></a></td>
                        <td nowrap class="body_rowg"><a href=<%=vrefStr%>><%=rsQry("pkg_version")%></a></td>
                        <td nowrap class="body_rowg"><a href=<%=crefStr%>><%=rsQry("test_count")%></a></td>
                        <td nowrap class="body_rowg"><a href=<%=crefStr%>><%=rsQry("build_time")%></a></td>
                        <td nowrap class="body_rowg"><%=rsQry("lastBuild")%></td>
                       </tr>
                       <%
                       rsQry.MoveNext
                       Loop
                       %>
                        <tbody>
                        <tfoot>
                            <tr class="body_col envGroup"><th colspan=4>Summary</th></tr>
                            <tr class="body_rowg"><td colspan=3>Total Packages</td><td><%=pkgCount%></td></tr>
                            <tr class="body_rowg"><td colspan=3>Total Packages with Tests</td><td><%=pkgTestCount%></td></tr>
                            <tr class="body_rowg"><td colspan=3>Total Unit Tests</td><td><%=testCount%></td></tr>
                       </td></tr>
                        </tfoot>
                  </table>
               </div>
            </div>
         </td>
      </tr>
   </table>
<%
    rsQry.close
    Set rsQry = nothing
End Sub
%>
<NOSCRIPT LANGUAGE="VBScript" RUNAT=SERVER SRC="common/VarDump.vbs"></NOSCRIPT> 
<html>
   <head>
      <title>Release Manager</title>
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
      <meta http-equiv="Pragma" content="no-cache">
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      <link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
      <link rel="stylesheet" href="images/navigation.css" type="text/css">
      <script language="JavaScript" src="images/common.js"></script>
      <!-- DROPDOWN MENUS -->
      <%bJqueryDataTables = TRUE%>
      <!--#include file="_jquery_includes.asp"-->
      <!--#include file="_menu_def.asp"-->
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
      <script language="JavaScript" src="images/tipster.js"></script>
      <script language="JavaScript" src="images/_help_tips.js"></script>
      <script language="JavaScript" type="text/JavaScript">
      formTips.tips.h_export       = stdTip(300, 'Export Test Count', 'Unit test counts will be copied to the users clipboard is CSV format.' +
                                                                  '<p>The data is to be integrated into other reports.' 
                                                                  );
      </script>
      <script type="text/javascript" charset="utf-8">
        var pkgStats = {};
        var pkgStatsScrollBody;
        var pkgStatsHeight = 0;
        var pkgStatsCurHeight = 0;

        $(document).ready(function() {
            // Create a basic DataTable

            pkgStats.table = $('#packageStats').DataTable( {
                    scrollY:        "65vh",
                    scrollCollapse: true,
                    paging:         false,
                });

            // Enable / disable full table display
            $('#noScroll').click(function(e){
                if ( pkgStats.Height === undefined ) {
                    pkgStats.ScrollBody = $('#packageStats').closest('.dataTables_scrollBody'); 
                    pkgStats.Height = pkgStats.ScrollBody.height();
                    pkgStats.CurHeight = pkgStatsHeight; 
                }

                if ( this.checked  ){
                    pkgStats.CurHeight = "100%";
                } else {
                    pkgStats.CurHeight = pkgStats.Height;
                }
                pkgStats.ScrollBody.css('max-height', pkgStats.CurHeight);
            });

            function copyToClipboard(string) {
                var $temp = $("<input>");
                $("body").append($temp);
                $temp.val(string).select();
                document.execCommand("copy");
                $temp.remove();
            }

            // Export Data
            $('#btnExport').click(function(e){
                var csv = [];

                //  Insert DateStamp as YYMMDD
                var date = new Date();
                var tstamp = (date.getFullYear() * 10000) + ((date.getMonth() + 1) * 100) + date.getDate()
                csv.push(tstamp);

                //  Insert Release ID
                csv.push(<%=DB_RTAG_ID%>);
                csv.push("<%=DB_PROJ_NAME%>::<%=DB_RTAG_NAME%>");

                // Generate a CSV representation of the data inthe table
                pkgStats.table.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
                    var data = this.data();
                    csv.push($(data[0]).text(), $(data[2]).text());
                    });
                var csvString = csv.join(",");
                //console.log(csvString);
                copyToClipboard(csvString);
                vixConfirm("Data copied to Clipboard", {
                    title: "Notification",
                    icon : "images/i_info.png", 
                    cancel: false, 
                    button: null,
                    timeout : 100,
                    position : 'center', 
                    modal : false,
                    minHeight: 10, 
                    hide: {
                            effect: 'fade',
                            duration: 2000
                          }
                });
            });
        });
      </script>

   </head>
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
      <!-- HEADER -->
      <!--#include file="_header.asp"-->
      <!-- BODY ---->
      <table class="full_table">
         <tr>
            <td width="146px" class="panel_bg" valign="top">
                <%Call LeftPanelContent%>
            </td>
            <td width="90%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
                <%Call MainPanelContent%>
            </td>
         </tr>
         <tr>
            <td class="panel_bg" valign="bottom" align="center" height="350">
                <img src="images/release_stats.png" vspace="20" hspace="30"></td>
         </tr>
      </table>
      <!-- FOOTER -->
      <!--#include file="_footer.asp"-->
   </body>
</html>