Subversion Repositories DevTools

Rev

Rev 6876 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                    FIND                           |
'|                                                   |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0            ' always load the page, dont store
Const allowNoPackage = TRUE     ' Allow page display without pvid being present
%>
<!--#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/common_dbedit.asp"-->
<!--#include file="_tabs.asp"-->
<!--#include file="common/_package_common.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login_optional.asp"-->
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim KeyWord
Dim parKeyword
Dim parRtagId
Dim rsRep
Dim imgLock
Dim parSearchType
Dim sLink
Dim   rsQry
Dim sPkgVersion
'------------ Constants Declaration -----------
Const IMG_OFFICIAL = "<img src='images/i_locked.gif' width='7' height='10' hspace='5' vspace='2' alt='Package is official'>"
Const IMG_NOT_OFFICIAL = "<img src='images/spacer.gif' width='7' height='10' hspace='5' vspace='2'>"
Const MaxRows = 100
'------------ Variable Init -------------------
parKeyword = Request("keyword")
parRtagId = Request("rtag_id")
parSearchType = Request("searchtype")
'----------------------------------------------
%>
<%
'==================== MAIN LINE ===============================

' Check for Required parameters
If (parSearchType = "")  OR  (nEnvTab = "") Then
   Call Destroy_All_Objects
   Response.Redirect ("dependencies.asp?rtag_id="& Request("rtag_id"))
End If
'==============================================================
'----------------------------------------------
'
Sub InsertJavaScript%>
<script type="text/javascript" charset="utf-8">
<%If parSearchType = "2" Then%>
    var table;
        $(document).ready(function() {
    /* Init DataTables */

        // Format a search string for DataTables
        // Convert all * into a %
        function formatSearch(str) {
                        return str.replace(/\*/g,'%');
        }

        // Setup - add a text input to each cell within the header row marked with a search class
        // Must be done  before the dataTable is created as the DOM is changed 
        $('#tfiles .search th').each( function (colIdx) {
            var title = $(this).text();
            if ( (title) ) {
                var el = $('<input id=inp_' + title.toLowerCase() + ' type="search" placeholder="Search ' + title + '" />');
                $(this).html(el);
                                el.on('keyup change', function(ev) {
                if (ev.keyCode == 13) { //only on enter keypress (code 13)
                    table
                        .column(colIdx)
                        .search(formatSearch(this.value))
                        .draw();
                    }
                });
            }
        });

        // Add Jason listeners
        $("#tfiles").on('preXhr.dt', function ( e, settings, data ) {
            showGlobalProgress();
         });

        $("#tfiles").on('xhr.dt', function ( e, settings, data ) {
            hideGlobalProgress();
         });

        // Create the DataTable
        $.fn.dataTable.ext.errMode = function ( settings, helpPage, message ) { 
            hideGlobalProgress();
            console.log(message);
        };

        var w = window,
            d = document,
            e = d.documentElement,
            g = d.getElementsByTagName('body')[0],
            x = w.innerWidth || e.clientWidth || g.clientWidth,
            y = w.innerHeight|| e.clientHeight|| g.clientHeight;
                var theight = y - $('#tfiles').offset().top - 120;
//console.log("theight", y , $('#tfiles').offset().top)
        table = $("#tfiles").dataTable({
            serverSide: true,
            deferRender : true,
            xxxprocessing: true,
            ajax : {
                url : "view_by_files_json.asp",
                type : "POST",
                data : function (o){
                           o.filename = formatSearch("<%=parKeyword%>");
                                                   o.rtag_id = "<%=parRtagId%>"; 
                                                   o.envtab = "<%=nEnvTab%>"
                }
            },
            dom: "rti",
            scrollY: theight,
            scrollCollapse: true,
                        paging: true,
            scroller: {
                            loadingIndicator: true,
                displayBuffer: 9,
                    },
            order: [[ 0, "desc" ]],
            info: true,
            columns: [
                { "visible": false },
                { render :  function ( data, type, row, meta ) { 
                                          var sLink = "<%=dpkg_archiveURL%>" + row[3] + "/" +  row[4] + "/" + row[2] + "/" + row[1];
                      sLink = sLink.replace(/\\+/g,'/') ;
                      sLink = sLink.replace(/\/+/g,'/') ;
                      return '<img src="images/rex_images/ext_blank.gif" border="0" hspace="2" align="absmiddle"><a href="'+sLink+'" class=body_link>'+data+'</a>';
                }},
                { render :  function ( data, type, row, meta ) {
                      if ( data  ) {
                          data = data.replace(/\\+/g, '/');
                          data = data.replace(/\/+/g,'\\') ;
                      }
                      return data;
                }},null,
                { render :  function ( data, type, row, meta ) { return '<a href="dependencies.asp?pv_id='+row[0]+'&rtag_id=<%=parRtagId%>" class=body_link>'+data+'</a>';}},
                null
            ],
            columnDefs : [
                {className: "nowrap", targets : '_all' } 
            ],
            orderCellsTop : true,
            initComplete : function () {
            },
        }).api();

        //  Transfer the keyword to the 'file' search item
        $('#inp_file').val('<%=parKeyword%>');
        table.column(1).search( formatSearch("<%=parKeyword%>") );
        });
<%End If%>
</script>
<%End Sub
'----------------------------------------------
%>
<html>
<head>
<title><%=Title(parRtagId)%></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>
<%bJqueryDataTables = TRUE%>
<!--#include file="_jquery_includes.asp"-->
<!-- TIPS -->
<script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
<script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
<!-- DROPDOWN MENUS -->
<!--#include file="_menu_def.asp"-->
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
<%Call InsertJavaScript%>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
<!-- HEADER -->
<!--#include file="_header.asp"-->
<!-- BODY ---->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
      <td class='bg_bage'>
         <!-- LEFT -->
         <!--#include file="_environment.asp"-->
      </td>
      <td width="1" bgcolor="#999999"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
      <td valign="top" width="100%">
         <!-- MIDDLE -->

         <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
               <td width="1%"></td>
               <td width="100%" align="right"><img src="images/h_trsp_dot.gif" width="1" height="20"></td>
               <td width="1%"></td>
            </tr>
            <tr>
               <td width="1%" bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="480"></td>
               <td bgcolor="#FFFFFF" valign="top">
                  <%
                  If InStr( Trim(parKeyword), "*") > 0 Then
                     KeyWord = Replace( Trim(parKeyword), "*", "%" )
                  Else
                     KeyWord = "%"& Trim(parKeyword) &"%"
                  End If

                  If parSearchType = "1" Then
                     ' Package Search
                  OraDatabase.Parameters.Add "KEYWORD",    KeyWord, ORAPARM_INPUT, ORATYPE_VARCHAR2
                  OraDatabase.Parameters.Add "RTAG_ID",    parRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
                  OraDatabase.Parameters.Add "SEARCH_AREA", nEnvTab, ORAPARM_INPUT, ORATYPE_NUMBER
                  OraDatabase.Parameters.Add "RECORD_SET",   NULL,    ORAPARM_OUTPUT,    ORATYPE_CURSOR
                  OraDatabase.Parameters.Add "PAGE_SIZE",    MaxRows, ORAPARM_INPUT, ORATYPE_NUMBER

                     OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.FIND_PACKAGE ( :KEYWORD, :RTAG_ID, :SEARCH_AREA, :RECORD_SET );  END;"

                  Set rsRep = OraDatabase.Parameters("RECORD_SET").Value

                  OraDatabase.Parameters.Remove "KEYWORD"
                  OraDatabase.Parameters.Remove "RTAG_ID"
                  OraDatabase.Parameters.Remove "SEARCH_AREA"
                  OraDatabase.Parameters.Remove "PAGE_SIZE"
                  OraDatabase.Parameters.Remove "RECORD_SET"
                  End If
                  %>

                  <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                     <tr>
                        <td>
                           <%If parSearchType = "1" Then%>
                              <span class="body_sect">Find Package: <%=Trim(parKeyword)%></span>
                           <%ElseIf parSearchType = "2" Then%>
                              <span class="body_sect">Find File: <%=Trim(parKeyword)%>.</span><span class="body_txt"></span>
                           <%End If%>
                        </td>
                     </tr>

                  <%If parSearchType = "1" Then%>
                     <!-- PACKAGE SEARCH ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                     <table width="100%" border="0" cellspacing="1" cellpadding="5" class='stdGrey'>
                           <thead>
                               <tr>
                                  <th width="1" nowrap ></th>
                                  <th width="1" nowrap >Package&nbsp;Name</th>
                                  <th width="1" nowrap >Version</th>
                                  <th width="1" nowrap >Location</th>
                                  <th width="100%" nowrap>
                                     <SPAN id="IMG_EXPAND_ALL_REASONS" name="IMG_EXPAND_ALL_REASONS" style="display:block;" onClick="ExpandAll(); ToggleDisplay('IMG_EXPAND_ALL_REASONS','IMG_COLLAPSE_ALL_REASONS');" title="Show All Reasons for Release.">
                                           <img src="icons/b_expand_all.gif" border="0" align="absmiddle" hspace="3">
                                        Reason&nbsp;for&nbsp;Release
                                     </SPAN>
                                     <SPAN id="IMG_COLLAPSE_ALL_REASONS" name="IMG_COLLAPSE_ALL_REASONS" style="display:none;" onClick="CollapseAll(); ToggleDisplay('IMG_EXPAND_ALL_REASONS','IMG_COLLAPSE_ALL_REASONS');" title="Hide All Reasons for Release.">
                                           <img src="icons/b_collapse_all.gif" border="0" align="absmiddle" hspace="3">
                                        Reason&nbsp;for&nbsp;Release
                                     </SPAN>
                                  </th>
                                  <th colspan=2 width="1" nowrap>Last&nbsp;Modified</th>
                               </tr>
                           </thead>
                            <%If rsRep.RecordCount = 0 Then%>
                                <tr>
                                    <td colspan='6'>Found 0 records.</td> 
                                </tr>
                            <%End If

                           While ((NOT rsRep.BOF) AND (NOT rsRep.EOF))

                              imgLock = IMG_NOT_OFFICIAL
                              If (rsRep("dlocked") = "Y") OR (rsRep("dlocked") = "A") Then
                                 imgLock = IMG_OFFICIAL
                              End If%>
                              <tr>
                                 <td valign="top"><%=imgLock%></td>
                                 <td nowrap valign="top"><%=Highlight_Substring( rsRep("pkg_name"), Trim(parKeyword) )%></td>
                                 <td nowrap valign="top"><a href="dependencies.asp?pv_id=<%=rsRep("pv_id")%>&rtag_id=<%=parRtagId%>" class="body_link"><%=rsRep("pkg_version")%></a></td>
                                 <td nowrap valign="top"><%= GetEnvName(rsRep("env_area")) &"&nbsp;/&nbsp;"& rsRep("view_name")%></td>
                                 <td valign="top" >
                                    <DIV style="display:block;" 
                                         id="SHORT_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>" 
                                         name="SHORT_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>"  
                                         onclick="ToggleDisplay('SHORT_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>','FULL_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>');"
                                         title="Click to see more..."
                                         class=pointer>
                                       Click to see more...
                                    </DIV>
                                    <DIV id="FULL_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>" 
                                         name="FULL_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>" 
                                         style="display:none;" 
                                         onclick="ToggleDisplay('SHORT_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>','FULL_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>');"
                                         title="Click to hide"
                                         class=pointer>
                                       <%=NewLine_To_BR ( To_HTML( rsRep("comments") ) )%>
                                    </DIV>
                                 </td>
                                 <td nowrap valign="top"><%= DisplayDateTimeSecs (rsRep("modified_stamp"))%></td>
                                 <td nowrap valign="top"><%=enum_imgUser%><%=emailField(rsRep("full_name"),rsRep("user_email"))%></td>
                              </tr>
                           <%  rsRep.MoveNext
                           WEnd

                           rsRep.Close()
                           %>
                     </table>
                     <br>

                  <%ElseIf parSearchType = "2" Then%>
                     <!-- FILE SEARCH ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                     <table id=tfiles width="100%" border="0" cellspacing="1" cellpadding="2" class='stdGrey'>
                         <thead>
                            <tr>
                                                           <th>PvId</th>
                               <th width="20%" nowrap>File Name<%=Quick_Help("FindFile")%></th>
                               <th width="20%" nowrap>Path</th>
                               <th width="20%" nowrap>Package&nbsp;Name</th>
                               <th width="20%" nowrap>Version</th>
                               <th width="20%" nowrap>CheckSum&nbsp;(CKSUM)</th>
                            </tr>
                                                        <tr class=search>
                                                                <th></th>
                                                                <th>File</th>
                                                                <th>Path</th>
                                                                <th>Package</th>
                                                                <th>Version</th>
                                                                <th></th>
                                                        </tr>
                         </thead>
                     </table>
                     <br>
                     <!-- END OF SEARCH ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                  <%End If%>
               </td>
           <td width="1%" background="images/lbox_bgside_white.gif">&nbsp;</td>
         </tr>
      </table>
      <!-- END MIDDLE --------></td>
   </tr>
</table>
<!-- FOOTER -->
<!--#include file="_footer.asp"-->
</body>
</html>