Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|                    FIND                           |
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
Const allowNoPackage = TRUE     ' Allow page display without pvid being present
14
%>
15
<!--#include file="common/conf.asp"-->
16
<!--#include file="common/globals.asp"-->
17
<!--#include file="common/formating.asp"-->
18
<!--#include file="common/qstr.asp"-->
19
<!--#include file="common/common_subs.asp"-->
20
<!--#include file="common/common_dbedit.asp"-->
21
<!--#include file="_tabs.asp"-->
22
<!--#include file="common/_package_common.asp"-->
23
<%
24
'------------ ACCESS CONTROL ------------------
25
%>
6181 dpurdie 26
<!--#include file="_access_control_login_optional.asp"-->
5357 dpurdie 27
<!--#include file="_access_control_general.asp"-->
28
<%
29
'------------ Variable Definition -------------
30
Dim KeyWord
31
Dim parKeyword
32
Dim parRtagId
33
Dim rsRep
34
Dim imgLock
35
Dim parSearchType
36
Dim sLink
37
Dim   rsQry
38
Dim sPkgVersion
39
'------------ Constants Declaration -----------
40
Const IMG_OFFICIAL = "<img src='images/i_locked.gif' width='7' height='10' hspace='5' vspace='2' alt='Package is official'>"
41
Const IMG_NOT_OFFICIAL = "<img src='images/spacer.gif' width='7' height='10' hspace='5' vspace='2'>"
42
Const MaxRows = 100
43
'------------ Variable Init -------------------
44
parKeyword = Request("keyword")
45
parRtagId = Request("rtag_id")
46
parSearchType = Request("searchtype")
47
'----------------------------------------------
48
%>
49
<%
50
'==================== MAIN LINE ===============================
51
 
52
' Check for Required parameters
53
If (parSearchType = "")  OR  (nEnvTab = "") Then
5957 dpurdie 54
   Call Destroy_All_Objects
5357 dpurdie 55
   Response.Redirect ("dependencies.asp?rtag_id="& Request("rtag_id"))
56
End If
57
'==============================================================
7291 dpurdie 58
'----------------------------------------------
59
'
60
Sub InsertJavaScript%>
61
<script type="text/javascript" charset="utf-8">
62
<%If parSearchType = "2" Then%>
63
    var table;
64
	$(document).ready(function() {
65
    /* Init DataTables */
66
 
67
        // Format a search string for DataTables
68
        // Convert all * into a %
69
        function formatSearch(str) {
70
			return str.replace(/\*/g,'%');
71
        }
72
 
73
        // Setup - add a text input to each cell within the header row marked with a search class
74
        // Must be done  before the dataTable is created as the DOM is changed 
75
        $('#tfiles .search th').each( function (colIdx) {
76
            var title = $(this).text();
77
            if ( (title) ) {
78
                var el = $('<input id=inp_' + title.toLowerCase() + ' type="search" placeholder="Search ' + title + '" />');
79
                $(this).html(el);
80
				el.on('keyup change', function(ev) {
81
                if (ev.keyCode == 13) { //only on enter keypress (code 13)
82
                    table
83
                        .column(colIdx)
84
                        .search(formatSearch(this.value))
85
                        .draw();
86
                    }
87
                });
88
            }
89
        });
90
 
91
        // Add Jason listeners
92
        $("#tfiles").on('preXhr.dt', function ( e, settings, data ) {
93
            showGlobalProgress();
94
         });
95
 
96
        $("#tfiles").on('xhr.dt', function ( e, settings, data ) {
97
            hideGlobalProgress();
98
         });
99
 
100
        // Create the DataTable
101
        $.fn.dataTable.ext.errMode = function ( settings, helpPage, message ) { 
102
            hideGlobalProgress();
103
            console.log(message);
104
        };
105
 
106
        var w = window,
107
            d = document,
108
            e = d.documentElement,
109
            g = d.getElementsByTagName('body')[0],
110
            x = w.innerWidth || e.clientWidth || g.clientWidth,
111
            y = w.innerHeight|| e.clientHeight|| g.clientHeight;
112
		var theight = y - $('#tfiles').offset().top - 120;
113
//console.log("theight", y , $('#tfiles').offset().top)
114
        table = $("#tfiles").dataTable({
115
            serverSide: true,
116
            deferRender : true,
117
            xxxprocessing: true,
118
            ajax : {
119
                url : "view_by_files_json.asp",
120
                type : "POST",
121
                data : function (o){
122
                           o.filename = formatSearch("<%=parKeyword%>");
123
						   o.rtag_id = "<%=parRtagId%>"; 
124
						   o.envtab = "<%=nEnvTab%>"
125
                }
126
            },
127
            dom: "rti",
128
            scrollY: theight,
129
            scrollCollapse: true,
130
			paging: true,
131
            scroller: {
132
			    loadingIndicator: true,
133
                displayBuffer: 9,
134
		    },
135
            order: [[ 0, "desc" ]],
136
            info: true,
137
            columns: [
138
                { "visible": false },
139
                { render :  function ( data, type, row, meta ) { 
140
					  var sLink = "<%=dpkg_archiveURL%>" + row[3] + "/" +  row[4] + "/" + row[2] + "/" + row[1];
141
                      sLink = sLink.replace(/\\+/g,'/') ;
142
                      sLink = sLink.replace(/\/+/g,'/') ;
143
                      return '<img src="images/rex_images/ext_blank.gif" border="0" hspace="2" align="absmiddle"><a href="'+sLink+'" class=body_link>'+data+'</a>';
144
                }},
145
                { render :  function ( data, type, row, meta ) {
146
                      if ( data  ) {
147
                          data = data.replace(/\\+/g, '/');
148
                          data = data.replace(/\/+/g,'\\') ;
149
                      }
150
                      return data;
151
                }},null,
152
                { render :  function ( data, type, row, meta ) { return '<a href="dependencies.asp?pv_id='+row[0]+'&rtag_id=<%=parRtagId%>" class=body_link>'+data+'</a>';}},
153
                null
154
            ],
155
            columnDefs : [
156
                {className: "nowrap", targets : '_all' } 
157
            ],
158
            orderCellsTop : true,
159
            initComplete : function () {
160
            },
161
        }).api();
162
 
163
        //  Transfer the keyword to the 'file' search item
164
    	$('#inp_file').val('<%=parKeyword%>');
165
        table.column(1).search( formatSearch("<%=parKeyword%>") );
166
	});
167
<%End If%>
168
</script>
169
<%End Sub
170
'----------------------------------------------
5357 dpurdie 171
%>
172
<html>
173
<head>
174
<title><%=Title(parRtagId)%></title>
175
<link rel="shortcut icon" href="<%=FavIcon%>"/>
176
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
177
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 178
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
179
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
180
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
7291 dpurdie 181
<%bJqueryDataTables = TRUE%>
5357 dpurdie 182
<!--#include file="_jquery_includes.asp"-->
183
<!-- TIPS -->
6579 dpurdie 184
<script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
185
<script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 186
<!-- DROPDOWN MENUS -->
187
<!--#include file="_menu_def.asp"-->
6579 dpurdie 188
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
7291 dpurdie 189
<%Call InsertJavaScript%>
5357 dpurdie 190
</head>
191
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
192
<!-- HEADER -->
193
<!--#include file="_header.asp"-->
194
<!-- BODY ---->
195
<table width="100%" border="0" cellspacing="0" cellpadding="0">
196
   <tr>
6876 dpurdie 197
      <td class='bg_bage'>
5357 dpurdie 198
         <!-- LEFT -->
199
         <!--#include file="_environment.asp"-->
200
      </td>
201
      <td width="1" bgcolor="#999999"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
202
      <td valign="top" width="100%">
203
         <!-- MIDDLE -->
204
 
205
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
206
            <tr>
207
               <td width="1%"></td>
208
               <td width="100%" align="right"><img src="images/h_trsp_dot.gif" width="1" height="20"></td>
209
               <td width="1%"></td>
210
            </tr>
211
            <tr>
212
               <td width="1%" bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="480"></td>
213
               <td bgcolor="#FFFFFF" valign="top">
214
                  <%
215
                  If InStr( Trim(parKeyword), "*") > 0 Then
216
                     KeyWord = Replace( Trim(parKeyword), "*", "%" )
217
                  Else
218
                     KeyWord = "%"& Trim(parKeyword) &"%"
219
                  End If
220
 
7291 dpurdie 221
                  If parSearchType = "1" Then
222
                     ' Package Search
5357 dpurdie 223
                  OraDatabase.Parameters.Add "KEYWORD",    KeyWord, ORAPARM_INPUT, ORATYPE_VARCHAR2
224
                  OraDatabase.Parameters.Add "RTAG_ID",    parRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
225
                  OraDatabase.Parameters.Add "SEARCH_AREA", nEnvTab, ORAPARM_INPUT, ORATYPE_NUMBER
226
                  OraDatabase.Parameters.Add "RECORD_SET",   NULL,    ORAPARM_OUTPUT,    ORATYPE_CURSOR
227
                  OraDatabase.Parameters.Add "PAGE_SIZE",    MaxRows, ORAPARM_INPUT, ORATYPE_NUMBER
228
 
229
                     OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.FIND_PACKAGE ( :KEYWORD, :RTAG_ID, :SEARCH_AREA, :RECORD_SET );  END;"
230
 
231
                  Set rsRep = OraDatabase.Parameters("RECORD_SET").Value
232
 
233
                  OraDatabase.Parameters.Remove "KEYWORD"
234
                  OraDatabase.Parameters.Remove "RTAG_ID"
235
                  OraDatabase.Parameters.Remove "SEARCH_AREA"
236
                  OraDatabase.Parameters.Remove "PAGE_SIZE"
237
                  OraDatabase.Parameters.Remove "RECORD_SET"
7291 dpurdie 238
                  End If
5357 dpurdie 239
                  %>
240
 
241
                  <table width="100%"  border="0" cellspacing="0" cellpadding="5">
242
                     <tr>
243
                        <td>
244
                           <%If parSearchType = "1" Then%>
6790 dpurdie 245
                              <span class="body_sect">Find Package: <%=Trim(parKeyword)%></span>
5357 dpurdie 246
                           <%ElseIf parSearchType = "2" Then%>
7291 dpurdie 247
                              <span class="body_sect">Find File: <%=Trim(parKeyword)%>.</span><span class="body_txt"></span>
5357 dpurdie 248
                           <%End If%>
249
                        </td>
250
                     </tr>
251
 
252
                  <%If parSearchType = "1" Then%>
253
                     <!-- PACKAGE SEARCH ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
6790 dpurdie 254
                     <table width="100%" border="0" cellspacing="1" cellpadding="5" class='stdGrey'>
255
                           <thead>
256
                               <tr>
257
                                  <th width="1" nowrap ></th>
258
                                  <th width="1" nowrap >Package&nbsp;Name</th>
259
                                  <th width="1" nowrap >Version</th>
260
                                  <th width="1" nowrap >Location</th>
261
                                  <th width="100%" nowrap>
6827 dpurdie 262
                                     <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.">
6790 dpurdie 263
                                           <img src="icons/b_expand_all.gif" border="0" align="absmiddle" hspace="3">
6827 dpurdie 264
                                        Reason&nbsp;for&nbsp;Release
6790 dpurdie 265
                                     </SPAN>
6827 dpurdie 266
                                     <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.">
6790 dpurdie 267
                                           <img src="icons/b_collapse_all.gif" border="0" align="absmiddle" hspace="3">
6827 dpurdie 268
                                        Reason&nbsp;for&nbsp;Release
6790 dpurdie 269
                                     </SPAN>
270
                                  </th>
271
                                  <th colspan=2 width="1" nowrap>Last&nbsp;Modified</th>
272
                               </tr>
273
                           </thead>
274
                            <%If rsRep.RecordCount = 0 Then%>
275
                                <tr>
276
                                    <td colspan='6'>Found 0 records.</td> 
277
                                </tr>
278
                            <%End If
5357 dpurdie 279
 
280
                           While ((NOT rsRep.BOF) AND (NOT rsRep.EOF))
281
 
282
                              imgLock = IMG_NOT_OFFICIAL
283
                              If (rsRep("dlocked") = "Y") OR (rsRep("dlocked") = "A") Then
284
                                 imgLock = IMG_OFFICIAL
285
                              End If%>
286
                              <tr>
6790 dpurdie 287
                                 <td valign="top"><%=imgLock%></td>
288
                                 <td nowrap valign="top"><%=Highlight_Substring( rsRep("pkg_name"), Trim(parKeyword) )%></td>
289
                                 <td nowrap valign="top"><a href="dependencies.asp?pv_id=<%=rsRep("pv_id")%>&rtag_id=<%=parRtagId%>" class="body_link"><%=rsRep("pkg_version")%></a></td>
290
                                 <td nowrap valign="top"><%= GetEnvName(rsRep("env_area")) &"&nbsp;/&nbsp;"& rsRep("view_name")%></td>
291
                                 <td valign="top" >
6827 dpurdie 292
                                    <DIV style="display:block;" 
293
                                         id="SHORT_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>" 
294
                                         name="SHORT_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>"  
295
                                         onclick="ToggleDisplay('SHORT_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>','FULL_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>');"
296
                                         title="Click to see more..."
297
                                         class=pointer>
298
                                       Click to see more...
5357 dpurdie 299
                                    </DIV>
6827 dpurdie 300
                                    <DIV id="FULL_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>" 
301
                                         name="FULL_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>" 
302
                                         style="display:none;" 
303
                                         onclick="ToggleDisplay('SHORT_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>','FULL_RFO<%= rsRep("env_area") &"_"& rsRep("pv_id")%>');"
304
                                         title="Click to hide"
305
                                         class=pointer>
306
                                       <%=NewLine_To_BR ( To_HTML( rsRep("comments") ) )%>
5357 dpurdie 307
                                    </DIV>
308
                                 </td>
6790 dpurdie 309
                                 <td nowrap valign="top"><%= DisplayDateTimeSecs (rsRep("modified_stamp"))%></td>
310
                                 <td nowrap valign="top"><%=enum_imgUser%><%=emailField(rsRep("full_name"),rsRep("user_email"))%></td>
5357 dpurdie 311
                              </tr>
312
                           <%  rsRep.MoveNext
313
                           WEnd
314
 
315
                           rsRep.Close()
316
                           %>
317
                     </table>
318
                     <br>
319
 
320
                  <%ElseIf parSearchType = "2" Then%>
321
                     <!-- FILE SEARCH ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
7291 dpurdie 322
                     <table id=tfiles width="100%" border="0" cellspacing="1" cellpadding="2" class='stdGrey'>
6790 dpurdie 323
                         <thead>
324
                            <tr>
7291 dpurdie 325
							   <th>PvId</th>
326
                               <th width="20%" nowrap>File Name<%=Quick_Help("FindFile")%></th>
6790 dpurdie 327
                               <th width="20%" nowrap>Path</th>
328
                               <th width="20%" nowrap>Package&nbsp;Name</th>
329
                               <th width="20%" nowrap>Version</th>
330
                               <th width="20%" nowrap>CheckSum&nbsp;(CKSUM)</th>
331
                            </tr>
7291 dpurdie 332
							<tr class=search>
333
								<th></th>
334
								<th>File</th>
335
								<th>Path</th>
336
								<th>Package</th>
337
								<th>Version</th>
338
								<th></th>
339
							</tr>
6790 dpurdie 340
                         </thead>
5357 dpurdie 341
                     </table>
342
                     <br>
343
                     <!-- END OF SEARCH ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
344
                  <%End If%>
345
               </td>
346
           <td width="1%" background="images/lbox_bgside_white.gif">&nbsp;</td>
347
         </tr>
348
      </table>
349
      <!-- END MIDDLE --------></td>
350
   </tr>
351
</table>
352
<!-- FOOTER -->
353
<!--#include file="_footer.asp"-->
354
</body>
355
</html>