Subversion Repositories DevTools

Rev

Rev 6952 | 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 ----------
'----------------------------------------------------
' --- RUN onPostBack ---
If Request("action") <> "" AND objAccessControl.UserLogedIn Then

      If objEH.Finally Then
         Call OpenInWindow ( "release_config.asp?rtag_id="& parRtagId )
      End If

End If
'----------------------------------------------
Sub InsertJavaScript %>
      <script language="JavaScript" type="text/JavaScript">
      $(document).ready(function() {

        // Remove the loading image
        $('#loading').remove();

        // Hide the row togglers for rows that do not have any children
        $('.togglerows').each(function(idx, el){
            var v = $(this).closest("tr");
            var pvid = v.data('pvid');
            if ($('.erow_' + pvid).length == 0 ) {
                $(el).css('visibility', 'hidden');
            }
        });

        // Attach a function to toggle multiple displays
        $('.togglerows').click(function(){
            var v = $(this).closest("tr");
            var pvid = v.data('pvid');
            $('.erow_' + pvid).toggleClass('display-none');
            v.find('img.togglerows').toggle();
        });

        // Generate Row Data from JavaScript data
        function getPkgName ( row, type, set, meta ) {
          var vis = 'togglerows';
          if(typeof row[10] === 'undefined') {
            vis = 'invisible'
          }
          var img = "<img src='images/bt_plus.gif' border='0' align='absmiddle' hspace='3' class='pointer "+ vis +"'>"

          var hRef = "view_by_version.asp?pkg_id=" + row[2] + "&hideRipple=True" + "&fpkgversion=*" + row[5]
          return img + "<a href=" + hRef + ">" + row[3] + "</a>"
        }

        function getVersion ( row, type, set, meta ) {
          var hRef = "dependencies.asp?pv_id=" + row[0] + "&rtag_id=" + <%=parRtagId%>
          return "<a href=" + hRef + ">" + row[4] + "</a>"
        }

        function getNewerVersion ( row, type, set, meta ) {
          var hRef = "dependencies.asp?pv_id=" + row[7]
          return "<a href=" + hRef + ">" + row[8] + "</a>"
        }

                /* Init DataTables */
        var nvTable = $('#nvtable').DataTable({
            //bLengthChange : false,
            sDom : "rti",
            data : dataSet,
            columns : [
            { data : getPkgName },
            { data : getVersion },
            { data : [1] },
            { data : [6] },
            { data : getNewerVersion },
            { data : [9] },
            { data : null, defaultContent: '' },
            ], 
            //"bProcessing": true,
            //"bRetrieve":true,
            //"bServerSide": true,
            //"sAjaxSource": 'project_log_json.asp',
            //"sScrollY": $( document ).height()- 200,
            //"bDeferRender": true,

            //"sScrollX": "100%",
            scrollCollapse : true,
            paging : false,
            //"iScrollLoadGap": 5,
            //"oScroller": {
                        //    "loadingIndicator": true
                    //},
            "order": [[0,'asc']],
            "info": true,
            "columnDefs" : [ 
                {className : "dt-nowrap", targets: "_all" },
            ],
        });

        //  Add event listener fro opening closing extended version list
        $('#nvtable tbody').on('click', 'img.togglerows', function () {
            var tr = $(this).closest('tr');
            var row = nvTable.row(tr);

            if ( row.child.isShown() ) {
                // This row is already open - close it
                row.child.hide();
                tr.removeClass('shown');
                $(this).attr('src', 'images/bt_plus.gif');
            }
            else {
                // Open this row
                row.child( format(row.data()) ).show();
                tr.addClass('shown');
                $(this).attr('src', 'images/bt_minus.gif');
            };

        });

        // Format row of data for extended version display
        // Return as a tr node so that the colums can be added to the current table
        // and have them line up with existing columns
        function format(d){
             var rv = [];
             var dd = d[10];

             for (var ii in dd) {
                 row = $('<tr/>');
                 row.append($('<td/>').append( '' ).attr('colspan', '4'));
                 row.append($('<td/>').append( $('<a/>').append( dd[ii][1]).attr('href', 'dependencies.asp?pv_id=' + dd[ii][0]) ));
                 row.append($('<td/>').append( dd[ii][2] ));
                 rv.push(row);
             }
             return rv;
        }
      })
    </script>
<%End Sub
'----------------------------------------------
'   Generate data as JSON so that it can be manipulated by datatables
'   Could do this with an AJAX call, but ...
Sub GenerateData
    Dim rsQry

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

    Response.Write "<script type=""text/javascript"" charset=""utf-8"">" + vbCRLF
    Response.Write "var dataSet = [" + vbCRLF

    Dim endText, startText
    Dim lastPvId : lastPvId = 0
    Dim isNew, pvId

    Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)

        pvId = rsQry("PV_ID") 
        If lastPvid <> pvId Then
            If StartText <> "" Then
                Response.Write "[" & startText
                If endText <> "" Then
                    Response.Write ",[" & endText & "],"
                End If
                Response.Write "]," + vbCRLF
            End If
            endText = ""
            lastPvId = pvId

        ' Capture basic information
        startText =  """" +  pvId + """" &_
                     ",""" +  rsQry("VIEW_NAME") + """" &_
                     ",""" +  rsQry("PKG_ID") + """" &_
                     ",""" +  rsQry("PKG_NAME") + """"&_
                     ",""" +  rsQry("PKG_VERSION") + """" &_
                     ",""" +  rsQry("V_EXT") + """" &_
                     ",""" +  rsQry("CREATED_STAMP") + """" &_
                     ",""" +  rsQry("NEW_PV_ID") + """"  &_
                     ",""" +  rsQry("NEW_PKG_VERSION") + """"  &_
                     ",""" +  rsQry("NEW_CREATED_STAMP") + """"

        Else
            ' Capture optional alternate package_versions
            endText = endText &_
                        "[""" +  rsQry("NEW_PV_ID") + """"  &_
                        ",""" +  rsQry("NEW_PKG_VERSION") + """"  &_
                        ",""" +  rsQry("NEW_CREATED_STAMP") + """"  &_
                       "],"           
        End If

    rsQry.MoveNext
    Loop

    ' Get the last entry as well
    If StartText <> "" Then
        Response.Write "[" & startText
        If endText <> "" Then
            Response.Write ",[" & endText & "],"
        End If
        Response.Write "]," + vbCRLF
    End If

    Response.Write "];"  + vbCRLF
    Response.Write "</script>"  + vbCRLF
    rsQry.close
    Set rsQry = nothing
End Sub
'----------------------------------------------
Sub LeftPanelContent
%>
<fieldset class="fset" align="right" style=" border: 1px groove;">
   <table>
      <tr>
         <td>Left Panel Content</td>
      </tr>
   </table>
</fieldset>
<%
End Sub

Sub MainPanelContent
%>
   <div class=Panel>
    <div class=rounded_box_caption>New Version Report</div>
    <div class="rounded_box">
       <div class=PanelFrame>
            <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
            <!--#include file="messages/_msg_inline.asp"-->
            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
            <div class=textPanel>
                <table id='nvtable' width="100%" class="stdGrey">
                   <thead>
                      <th nowrap >Package Name</th>
                      <th nowrap >Version</th>
                      <th nowrap >Base View</th>
                      <th nowrap >Created</th>
                      <th nowrap >Newer Version</th>
                      <th nowrap >Created</th>
                      <th nowrap ></th>
                   </thead>
                    <tr id='loading' >
                        <td colspan=7 class=tcenter>
                            <img src='images/transparent-background-loading.gif'>
                        </td>
                   </tr>
              </table>
            </div>
       </div>
    </div>
   </div>
<%
End Sub
%>
<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?ver=<%=VixVerNum%>" type="text/css">
      <link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
      <script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
      <!-- DROPDOWN MENUS -->
      <%bJqueryDataTables = TRUE%>
      <!--#include file="_jquery_includes.asp"-->
      <!--#include file="_menu_def.asp"-->
      <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
      <%Call InsertJavaScript %>
      <%Call GenerateData %>
   </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="bg_panel" valign="top">
                <%Call LeftPanelContent%>
            </td>
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
                <%Call MainPanelContent%>
            </td>
         </tr>
         <tr>
            <td class="bg_panel_btm" height="350">
                <img src="images/release_stats.png" vspace="20" hspace="30"></td>
         </tr>
      </table>
      <!-- FOOTER -->
      <!--#include file="_footer.asp"-->
   </body>
</html>