Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%
2
'=====================================================
123 ghuddy 3
'               Build Environment
119 ghuddy 4
'=====================================================
5
%>
6
<!--#include file="_tabs_definition_env.asp"-->
7
<!--#include file="common/_form_window_common.asp"-->
8
<%
9
'------------ Variable Definition -------------
123 ghuddy 10
Dim parOLshow     ' show/hide outer-latest
11
Dim parBshow      ' expand/collapse base views
12
Dim parPshow      ' expand/collapse personal views
13
Dim parPview      ' enable/disable all personal views
14
Dim parDview      ' enable/disable   deployment   view.
119 ghuddy 15
Dim IMG_locked
16
Dim rsEnvQry
17
Dim pvIdInList
18
Dim checked
19
Dim disabled
20
Dim pkgType
21
Dim SCRIPT_NAME 'Use this here only as the previous one ScriptName is Already Defined
22
'------------ Constants Declaration -----------
23
Const imgMaximise  = "<IMG src='images/i_maximise.gif' alt='Show view contents.' width=13 height=13 hspace='2' vspace='1' border='0'>"
24
Const imgMinimise  = "<IMG src='images/i_minimise.gif' alt='Hide view contents.' width=13 height=13 hspace='2' vspace='1' border='0'>"
25
Const imgForced    = "<img src='images/s_forced.gif' width='19' height='17' align='absmiddle'>"
26
Const imgLocked    = "<img src='images/i_locked.gif' width='7' height='10' border='0' hspace='2'>"
27
Const hlColor      = "#DDDDDD"
28
Const imgAdded     = "<img src='images/i_added.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='To Be Added'>"
29
Const imgRemoved   = "<img src='images/i_removed.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='To Be Removed'>"
30
'------------ Variable Init -------------------
31
parOLshow = QStrPar("OLshow")
32
parBshow = QStrPar("Bshow")
33
parPshow = QStrPar("Pshow")
34
parPview = QStrPar("Pview")
35
parDview = QStrPar("Dview")
36
'----------------------------------------------
37
%>
38
 
39
<script language="JavaScript" type="text/javascript">
40
<!--
41
var is_ie = (navigator.userAgent.indexOf('MSIE') >= 0) ? 1 : 0;
42
var is_ie5 = (navigator.appVersion.indexOf("MSIE 5.5")!=-1) ? 1 : 0;
43
var is_opera = ((navigator.userAgent.indexOf("Opera6")!=-1)||(navigator.userAgent.indexOf("Opera/6")!=-1)) ? 1 : 0;
44
    //netscape, safari, mozilla behave the same???
45
var is_netscape = (navigator.userAgent.indexOf('Netscape') >= 0) ? 1 : 0;
46
 
4388 dpurdie 47
///////////////////////////////////////////////
48
//  Function:       toggletick    
49
//  Description:    This function will toggle all visible (pending) tick boxes 
50
//  Input:          te  - Controlling element
51
//
52
function toggletick(te)
53
{
54
    // Get the form containing all of the pending items
55
    var f = document.getElementById('pending_PVID_List');
56
    if (f == null) {
57
       alert('Failed To Get pending_PVID_List');   // should never happen unless a coding/rendering mistake is made?
58
    } else {
59
       if (f.pv_id_list != null) {
60
           if (f.length == 1 || typeof f.pv_id_list.length == "undefined") {
61
              if (false == f.pv_id_list.disabled) {
62
                 f.pv_id_list.checked = te.checked;
63
              }
64
           } else {
65
              for (n = 0; n < f.pv_id_list.length; n++) {
66
                 if (false == f.pv_id_list[n].disabled) {
67
                    f.pv_id_list[n].checked = te.checked;
68
                 }
69
              }
70
           }
71
       }
72
    }
73
}
119 ghuddy 74
 
4388 dpurdie 75
///////////////////////////////////////////////
76
//  Function:       countBulkItems
77
//  Description:    Determine the number of bulk ticked items
78
//                  These are suiable and enabled items
79
//  Input:          f - Form element to process
80
//
81
function countBulkItems(f)
82
{
83
    var n;
84
    var numCheckedAndEnabled = 0;
85
    var numUncheckedAndEnabled = 0;
86
 
87
    // Unbelievably, if the form has just one single PV_ID checkbox item, the syntax via which we access it
88
    // has to change. We cannot use array access syntax in such a case.
89
    if (f.length == 1 || typeof f.pv_id_list.length == "undefined")
90
    {
91
       if (f.pv_id_list.value != null)
92
       {
93
          if (false == f.pv_id_list.disabled)
94
          {
95
             if (true == f.pv_id_list.checked)
96
                numCheckedAndEnabled++;
97
             else
98
                numUncheckedAndEnabled++;
99
          }
100
       }
101
    }
102
    else
103
    {
104
       // Here we can and have to use array access syntax.
105
       for (n = 0; n < f.pv_id_list.length; n++)
106
       {
107
          if (false == f.pv_id_list[n].disabled)
108
          {
109
             if (true == f.pv_id_list[n].checked)
110
                numCheckedAndEnabled++;
111
             else
112
                numUncheckedAndEnabled++;
113
          }
114
       }
115
    }
116
    return numCheckedAndEnabled;
117
}
118
 
123 ghuddy 119
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
120
// This function is executed when the Bulk Release action button is pressed. It will do some local
121
// client side checks and then if all is well, it will use the make_bulk_release.asp to initiate
122
// the bulk release process on the server side.
123
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
124
function makeBulkRelease()
125
{
126
   // Get the form containing all of the pending items
127
   var f = document.getElementById('pending_PVID_List');
128
   if (f == null)
129
      alert('Failed To Get pending_PVID_List');   // should never happen unless a coding/rendering mistake is made?
130
   else
131
   {
132
      // When no items exist in the pending tab, the pending_PVID_List form will not contain any
133
      // element called pv_id_list, so it will be null. Check for that and issue an alert as appropriate.
134
      if (f.pv_id_list == null)
135
      {
136
         alert('There are no items pending that can be considered for bulk release.\n\n' +
4388 dpurdie 137
               'Use the Bulk Release button when items with checkboxes are present in the Pending Tab.');
123 ghuddy 138
      }
139
      else
140
      {
141
         var doBulkRelease = true;
4388 dpurdie 142
         var numCheckedAndEnabled = countBulkItems(f);
143
         if (numCheckedAndEnabled == 0)
123 ghuddy 144
         {
4388 dpurdie 145
                alert('Currently, there are no items that can be bulk released.\n\n' +
146
                      'Select items to be released before using the Bulk Release button');
147
                doBulkRelease = false;
148
	     }
123 ghuddy 149
         else
150
         {
4388 dpurdie 151
             doBulkRelease = confirm('Release all ('+numCheckedAndEnabled+') checked items from the Pending List.\n\n' +
152
                                     '\tPress OK to Bulk Release all outstanding items.\n' +
153
                                     '\tPress CANCEL to abort Bulk Release.\n\n' );
123 ghuddy 154
         }
119 ghuddy 155
 
123 ghuddy 156
         if (doBulkRelease == true)
157
         {
158
            // Initiate the bulk release by redirecting the browser to the make_bulk_release.asp page
159
            // which holds the server side VBScript code that actually carries out the release operations.
160
            // Once complete, that code will redirect the browser back to the dependencies.asp page of which
161
            // this _environment.asp file is a part (by direct inclusion)
125 ghuddy 162
            <%If Request("pv_id") Then%>
163
               f.action = "make_bulk_release.asp?pv_id=<%=Request("pv_id")%>&rtag_id=<%=parRtag_id%>";
123 ghuddy 164
            <%Else%>
165
               f.action = "make_bulk_release.asp?rtag_id=<%=parRtag_id%>";
166
            <%End If%>
167
            f.submit();
168
            // TODO : I would like to show progress? Is that even possible? If so, how?
169
         }
170
      }
171
   }
172
}
119 ghuddy 173
 
4358 dpurdie 174
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
175
// This function is executed when the Bulk Remove action button is pressed. It will do some local
176
// client side checks and then if all is well, it will use the make_bulk_remove.asp to initiate
177
// the bulk remove process on the server side.
178
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
179
function makeBulkReject()
180
{
181
   // Get the form containing all of the pending items
182
   var f = document.getElementById('pending_PVID_List');
183
   if (f == null)
184
      alert('Failed To Get pending_PVID_List');   // should never happen unless a coding/rendering mistake is made?
185
   else
186
   {
187
      // When no items exist in the pending tab, the pending_PVID_List form will not contain any
188
      // element called pv_id_list, so it will be null. Check for that and issue an alert as appropriate.
189
      if (f.pv_id_list == null)
190
      {
4388 dpurdie 191
         alert('There are no items pending that can be considered for Bulk Rejection.\n\n' +
192
               'Use the Bulk Reject button when items with checkboxes are present in the Pending Tab.');
4358 dpurdie 193
      }
194
      else
195
      {
196
         var doBulkReject = true;
4388 dpurdie 197
         var numCheckedAndEnabled = countBulkItems(f);
4358 dpurdie 198
         if (numCheckedAndEnabled == 0)
199
         {
4388 dpurdie 200
             alert('Currently, there are no items that can be Bulk Reject.\n\n' +
201
                   'Select items to be released before using the Bulk Reject button');
202
             doBulkReject = false;
4358 dpurdie 203
         }
204
         else
205
         {
4388 dpurdie 206
             doBulkReject = confirm('Reject all ('+numCheckedAndEnabled+') checked items from the Pending List.\n\n' +
207
                                     '\tPress OK to Bulk Reject all outstanding items.\n' +
208
                                     '\tPress CANCEL to abort Bulk Reject.\n\n' );
4358 dpurdie 209
         }
210
 
211
         if (doBulkReject == true)
212
         {
213
            // Initiate the bulk remove by redirecting the browser to the make_bulk_remove.asp page
214
            // which holds the server side VBScript code that actually carries out the remove operations.
215
            // Once complete, that code will redirect the browser back to the dependencies.asp page of which
216
            // this _environment.asp file is a part (by direct inclusion)
217
            <%If Request("pv_id") Then%>
218
               f.action = "make_bulk_reject.asp?pv_id=<%=Request("pv_id")%>&rtag_id=<%=parRtag_id%>";
219
            <%Else%>
220
               f.action = "make_bulk_reject.asp?rtag_id=<%=parRtag_id%>";
221
            <%End If%>
222
            f.submit();
223
            // TODO : I would like to show progress? Is that even possible? If so, how?
224
         }
225
      }
226
   }
227
}
228
 
4388 dpurdie 229
///////////////////////////////////////////////
4395 dpurdie 230
//  Function:    openAllViews
231
//  Description: Open and Populate all Views
232
//               Views are populated via AJAX
233
//               Current scheme allows for one AJAX request to be outstanding
234
//               Have AJAX callback determine if there is more work to be done
235
//
236
var openingAllViews = 0;
237
function openAllViews()
238
{
239
    openingAllViews = 0;
240
    toggleAllViewsIcon(0);
241
 
242
    //if (event.shiftKey==1)
243
    //
244
    //  Locate first/next view to be expanded
245
    var divs = document.getElementsByTagName("div");
246
    for (var i=0;i<divs.length;i++) {
247
        var el = divs[i]; 
248
        var id = el.id;
249
        if (id.indexOf("ENVDIV") == 0)
250
        {
251
            var rowId = id.substr(6);
252
            if (el.innerHTML.indexOf('<%=enumLOADING%>') != -1)
253
            {
254
                openingAllViews = 1;
255
                RequestViewContent('?envtab=<%=nEnvTab%>&rtag_id=<%=parRtag_id%>&view_id=' + rowId,rowId);
256
                return;
257
            } else if (el.style.display == 'none') {
258
               el.style.display = 'block';
259
               UpdateViewHeader(rowId, 0);
260
            }
261
        }
262
    }
263
}
264
 
265
///////////////////////////////////////////////
4388 dpurdie 266
//  Function:       closeAllViews
4395 dpurdie 267
//  Description:    Close and forget about All Populated Views
4388 dpurdie 268
//
269
function closeAllViews()
270
{
4395 dpurdie 271
    openingAllViews = 0;
272
    toggleAllViewsIcon(0);
273
 
4396 dpurdie 274
    //  Get the View cookie and convert it into a hash
275
    var vhash = new Object();
4388 dpurdie 276
    var us = GetCookie('<%=COOKIE_RELMGR_SHOW_VIEW%>');
277
    if (us) {
278
        var aViewList = us.split(',');
279
        for (index=0; index < aViewList.length;++index) {
4396 dpurdie 280
            vhash[aViewList[index]] = 1;
281
        }
282
    }
283
 
284
    //  Locate first/next view to be closed
285
    var divs = document.getElementsByTagName("div");
286
    for (var i=0;i<divs.length;i++) {
287
        var el = divs[i]; 
288
        var id = el.id;
289
        if (id.indexOf("ENVDIV") == 0)
290
        {
291
            var rowId = id.substr(6);
292
            if (el.innerHTML.indexOf('<%=enumLOADING%>') == -1)
293
            {
294
                el.style.display = 'none'
295
                UpdateViewHeader(rowId, 1);
296
                el.innerHTML = '<%=enumLOADING%>';
297
 
298
                // Delete from cookie too
299
                delete vhash[rowId];
4388 dpurdie 300
            }
301
        }
4396 dpurdie 302
    }
303
 
304
    //  Reform the cookie
305
    if (us)
306
    {
307
        us = Object.keys(vhash).join(',');
4388 dpurdie 308
        // Store to cookie
309
        document.cookie = '<%=COOKIE_RELMGR_SHOW_VIEW%>' + '=' + us;
4396 dpurdie 310
    }
4388 dpurdie 311
}
4358 dpurdie 312
 
4388 dpurdie 313
///////////////////////////////////////////////
4395 dpurdie 314
//  Function:    toggleAllViewsIcon
315
//  Description: Update the toogleAllViews Icon
316
//  arg        : mode - 0 min, else max
317
//
318
function toggleAllViewsIcon(mode)
319
{
320
    //  Update image
321
    //      images/btn_min.gif 
322
    var f = document.getElementById('cb_minall');
323
    if (mode ) {
324
        f.src = 'images/btn_max.gif';
325
    } else {
326
        f.src = 'images/btn_min.gif';
327
    }
328
}
329
 
330
 
331
///////////////////////////////////////////////
4388 dpurdie 332
//  Function:    toggleAllViews
333
//  Description: Hide/Show all the expanded views
334
//               Will not change the saved list, just the current display
335
//
336
function toggleAllViews()
337
{
4396 dpurdie 338
    var dmatch, dset;
4395 dpurdie 339
    openingAllViews = 0;
340
 
341
    //  Update the icon image
4388 dpurdie 342
    var f = document.getElementById('cb_minall');
343
    if (f.src.indexOf('min.gif') >= 0) {
344
        f.src = 'images/btn_max.gif';
345
        dmatch = 'block';
346
        dset = 'none';
347
    } else {
348
        f.src = 'images/btn_min.gif';
349
        dmatch = 'none';
350
        dset = 'block';
351
    }
352
 
4396 dpurdie 353
    //  Locate first/next view to be toggled
354
    var divs = document.getElementsByTagName("div");
355
    for (var i=0;i<divs.length;i++) {
356
        var el = divs[i]; 
357
        var id = el.id;
358
        if (id.indexOf("ENVDIV") == 0)
359
        {
360
            if (el.innerHTML.indexOf('<%=enumLOADING%>') == -1) {
361
                var rowId = id.substr(6);
362
                if (el && el.style.display == dmatch ) {
363
                    el.style.display = dset;
364
                }
4388 dpurdie 365
            }
366
        }
367
    }
368
}
369
 
370
function UpdateViewHeader(rowId, show)
371
{
372
    if ( show )
373
    {
374
       // View is currently minimised
375
       MM_findObj( 'ENVIMG'+ rowId ).src = 'images/btn_max.gif';
376
       MM_findObj( 'SPANVIEW'+ rowId ).style.color = '#808080';
377
    }
378
    else
379
    {
380
       // View is currently maximised
381
       MM_findObj( 'ENVIMG'+ rowId ).src = 'images/btn_min.gif';
382
       MM_findObj( 'SPANVIEW'+ rowId ).style.color = '#000000';
383
    }
384
}
385
 
4396 dpurdie 386
///////////////////////////////////////////////
387
//  Function:       RequestViewContent    
388
//  Description:    Maintain view content
389
//                  If View Tab is unpopulated - then populate it
390
//                  if View Tab is populated - then Minimise it
391
//
123 ghuddy 392
function RequestViewContent( paramString, rowId ){
393
   var requestURL = 'RequestViewContent.asp';
119 ghuddy 394
 
123 ghuddy 395
   // Toggle div
396
   ToggleDisplay( 'ENVDIV'+ rowId );
119 ghuddy 397
 
123 ghuddy 398
   // Change display states
399
   if ( (MM_findObj( 'ENVIMG'+ rowId ).src).indexOf('btn_max.gif') == -1 )
400
   {
401
      // View is currently minimised
4388 dpurdie 402
      UpdateViewHeader(rowId, 1);    
119 ghuddy 403
 
123 ghuddy 404
      // Remove from SHow View List
405
      RemoveFromShowView ( rowId );
406
   }
407
   else
408
   {
409
      // View is currently maximised
4388 dpurdie 410
      UpdateViewHeader(rowId, 0);
411
 
123 ghuddy 412
      // Add it to Show view id
413
      AddToShowView ( rowId );
414
   }
119 ghuddy 415
 
123 ghuddy 416
   // Fix div width for ie so it does not overflow
417
   if (is_ie)
418
   {
419
      MM_findObj( 'ENVDIV'+ rowId ).style.width = '100%';
420
   }
119 ghuddy 421
 
123 ghuddy 422
   // Set ajax divname
423
   ajaxdivname = 'ENVDIV'+ rowId;
119 ghuddy 424
 
123 ghuddy 425
   // Request data from server
426
   if ( (MM_findObj( ajaxdivname ).innerHTML).indexOf('<%=enumLOADING%>') != -1 )
427
   {
428
      //Append the name to search for to the requestURL
429
      var url = requestURL + paramString;
119 ghuddy 430
 
123 ghuddy 431
      //Create the xmlHttp object to use in the request
432
      //stateChangeHandler will fire when the state has changed, i.e. data is received back
433
      // This is non-blocking (asynchronous)
434
      xmlHttp = GetXmlHttpObject(stateChangeHandler);
119 ghuddy 435
 
123 ghuddy 436
      //Send the xmlHttp get to the specified url
437
      xmlHttp_Get(xmlHttp, url);
438
   }
439
}
119 ghuddy 440
 
123 ghuddy 441
function GetXmlHttpObject(handler) {
442
   var objXmlHttp = null;    //Holds the local xmlHTTP object instance
119 ghuddy 443
 
123 ghuddy 444
   //Depending on the browser, try to create the xmlHttp object
445
   if (is_ie){
446
      //The object to create depends on version of IE
447
      //If it isn't ie5, then default to the Msxml2.XMLHTTP object
448
      var strObjName = (is_ie5) ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP';
119 ghuddy 449
 
123 ghuddy 450
      //Attempt to create the object
451
      try{
452
         objXmlHttp = new ActiveXObject(strObjName);
453
         objXmlHttp.onreadystatechange = handler;
454
      }
455
      catch(e){
456
      //Object creation errored
457
         alert('IE detected, but object could not be created. Verify that active scripting and activeX controls are enabled');
458
         return;
459
      }
460
   }
461
   else if (is_opera){
462
      //Opera has some issues with xmlHttp object functionality
463
      alert('Opera detected. The page may not behave as expected.');
464
      return;
465
   }
466
   else{
467
      // Mozilla | Netscape | Safari
468
      objXmlHttp = new XMLHttpRequest();
469
      objXmlHttp.onload = handler;
470
      objXmlHttp.onerror = handler;
471
   }
119 ghuddy 472
 
123 ghuddy 473
   //Return the instantiated object
474
   return objXmlHttp;
119 ghuddy 475
}
476
 
123 ghuddy 477
//stateChangeHandler will fire when the state has changed, i.e. data is received back
478
// This is non-blocking (asynchronous)
479
function stateChangeHandler()
480
{
481
   //readyState of 4 or 'complete' represents that data has been returned
482
   if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete'){
483
      //Gather the results from the callback
484
      var str = xmlHttp.responseText;
119 ghuddy 485
 
123 ghuddy 486
      //Populate the innerHTML of the div with the results
487
      document.getElementById(ajaxdivname).innerHTML = str;
488
   }
4395 dpurdie 489
 
490
   //Cascade view opening
491
   if (openingAllViews) {
492
       openAllViews();
493
   }
123 ghuddy 494
}
119 ghuddy 495
 
123 ghuddy 496
// XMLHttp send GET request
497
function xmlHttp_Get(xmlhttp, url) {
498
   //Getting a permissions error here? Check the url string to
499
   // ensure it is accurate (defined above)
500
   xmlhttp.open('GET', url, true);
501
   xmlhttp.send(null);
502
}
119 ghuddy 503
 
504
 
505
 
506
function RemoveFromShowView ( ViewId )
507
{
123 ghuddy 508
   // Get current cookie settings
509
   var us = GetCookie('<%=COOKIE_RELMGR_SHOW_VIEW%>');
510
   var aShowViews = new Array();
119 ghuddy 511
 
123 ghuddy 512
   if (us)
513
   {
514
      // Cookie is not empty, hence just append new value
515
      var aViews = us.split(',');
119 ghuddy 516
 
123 ghuddy 517
      // Make sure that view is not already on the list
518
      for (i=0; i<aViews.length; i++)
519
      {
520
         if (aViews[i] != ViewId)
521
         {
522
            aShowViews.push(aViews[i]);
523
         }
524
      }
119 ghuddy 525
 
123 ghuddy 526
      // Make a new view list to be stored in cookie
527
      us = aShowViews.join(',');
528
   }
529
   else
530
   {
531
      us = '';
532
   }
119 ghuddy 533
 
123 ghuddy 534
   // Store to cookie
535
   document.cookie = '<%=COOKIE_RELMGR_SHOW_VIEW%>' + '=' + us;
119 ghuddy 536
}
537
 
538
function AddToShowView ( ViewId )
539
{
123 ghuddy 540
   // Get current cookie settings
541
   var us = GetCookie('<%=COOKIE_RELMGR_SHOW_VIEW%>');
542
   var aShowViews = new Array();
119 ghuddy 543
 
123 ghuddy 544
   //Release Manager Cookie Available on Show View
545
   if ( us )
546
   {
547
      // Cookie is not empty, hence just append new value
548
      var aViews = us.split(',');
119 ghuddy 549
 
123 ghuddy 550
      // Make sure that view is not already on the list
551
      for (i=0; i<aViews.length; i++)
552
      {
553
         if (aViews[i] != ViewId)
554
         {
555
            aShowViews.push(aViews[i]);
556
         }
557
      }
119 ghuddy 558
 
123 ghuddy 559
      // Make a new view list to be stored in cookie
560
      us = aShowViews.join(',') + ',' + ViewId;
561
   }
562
   else//Release Manager Cookie Not Available on Show View
563
   {
564
      // Cookie is empty, just add this value
565
      us = ViewId;
119 ghuddy 566
 
123 ghuddy 567
   }
119 ghuddy 568
 
123 ghuddy 569
   // Store to cookie
570
   document.cookie = '<%=COOKIE_RELMGR_SHOW_VIEW%>' + '=' + us;
119 ghuddy 571
}
572
 
573
 
574
//-->
575
</script>
576
 
577
<%
578
'------------------------------------------------------------------------------------------------------------------------------------------------
579
Function GetEnvTab ( sEnvTab )
123 ghuddy 580
   If sEnvTab <> "" Then
581
      GetEnvTab = sEnvTab
582
      Response.Cookies(COOKIE_RELEASE_MANAGER_MEMORY)("envtab") = sEnvTab
583
   Else
584
      If Request.Cookies(COOKIE_RELEASE_MANAGER_MEMORY)("envtab") <> "" Then
585
         GetEnvTab = Request.Cookies(COOKIE_RELEASE_MANAGER_MEMORY)("envtab")
586
      Else
587
         GetEnvTab = enumENVTAB_WORK_IN_PROGRESS
588
         Response.Cookies(COOKIE_RELEASE_MANAGER_MEMORY)("envtab") = enumENVTAB_WORK_IN_PROGRESS
589
      End If
590
   End If
119 ghuddy 591
 
592
End Function
593
'------------------------------------------------------------------------------------------------------------------------------------------------
594
Sub Display_Env_BaseView ( NNbase_view_id, SSbase_view, BBviewCollapsed, SScontents )
595
%>
596
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
123 ghuddy 597
   <tr>
598
      <td width="1" align="left" valign="top" bgcolor="#dad7c8"><img src="images/p_ctl.gif" width="3" height="3"></td>
599
      <td width="100%" bgcolor="#dad7c8"><img src="images/spacer.gif" width="1" height="1"></td>
600
      <td width="1" bgcolor="#dad7c8"><img src="images/spacer.gif" width="1" height="1"></td>
601
      <td width="1" align="right" valign="top" bgcolor="#dad7c8"><img src="images/p_ctr.gif" width="3" height="3"></td>
602
   </tr>
603
   <tr>
604
      <td align="left" valign="top" bgcolor="#dad7c8">&nbsp;</td>
605
      <td bgcolor="#dad7c8"><SPAN id="SPANVIEW<%=NNbase_view_id%>" <%If BBviewCollapsed Then%>class="body_scol_thin"<%Else%>class="body_txt"<%End If%>>&nbsp;<b><%=SSbase_view%></b></SPAN></td>
606
      <td align="right" bgcolor="#dad7c8"><a href="javascript:;" onClick="RequestViewContent('?envtab=<%=nEnvTab%>&rtag_id=<%=parRtag_id%>&view_id=<%=NNbase_view_id%>&script_name=<%=ScriptName%>','<%=NNbase_view_id%>');"><img id="ENVIMG<%=NNbase_view_id%>" src="images/<%If BBviewCollapsed Then %>btn_max.gif<%Else%>btn_min.gif<%End If%>" border="0"></a></td>
607
      <td align="right" valign="top" bgcolor="#dad7c8">&nbsp;</td>
608
   </tr>
119 ghuddy 609
</table>
610
<DIV id="ENVDIV<%=NNbase_view_id%>" class="envContent" <%If BBviewCollapsed Then %>style="display:none;"<%Else%>style="display:block;"<%End If%>>
123 ghuddy 611
   <%If NOT BBviewCollapsed Then %>
612
      <%=SScontents%>
613
   <%Else%>
614
      <%=enumLOADING%>
615
   <%End If%>
616
</DIV>
119 ghuddy 617
<br>
618
<%
619
End Sub
620
'------------------------------------------------------------------------------------------------------------------------------------------------
621
Sub Print_View( NNEnvTab, SSviewtype, NNrtag_id, SSshowviews, NNuser_id )
123 ghuddy 622
   Dim rsView, Query_String
623
   'Dim btn1
624
   Dim tmpURL
625
   Dim SSscript
626
   Dim qstrPar
627
   Dim nViewType
628
   Dim nTrueRecordCount
629
   Dim nOperation
630
   Dim relContentsSTR, viewCollapsed, curr_view_id, view_name
119 ghuddy 631
 
123 ghuddy 632
   If scriptName = "find.asp" Then
633
      SSscript = "dependencies.asp"
634
   Else
635
      SSscript = scriptName
636
   End If
119 ghuddy 637
 
123 ghuddy 638
   If SSviewtype = "guest" Then
639
      nViewType = 1
640
      qstrPar = "Bshow"
641
   ElseIf SSviewtype = "personal" Then
642
      nViewType = 2
643
      qstrPar = "Pshow"
644
   End If
119 ghuddy 645
 
123 ghuddy 646
   OraDatabase.Parameters.Add "VIEW_TYPE",           nViewType, ORAPARM_INPUT, ORATYPE_NUMBER
647
   'OraDatabase.Parameters.Add "VIEW_ID_SHOW_LIST",   ShowView( Pipes2Commas( SSshowviews ), SSviewtype ), ORAPARM_INPUT, ORATYPE_VARCHAR2
648
   OraDatabase.Parameters.Add "VIEW_ID_SHOW_LIST",   GetShowViewList(), ORAPARM_INPUT, ORATYPE_VARCHAR2
649
   OraDatabase.Parameters.Add "RTAG_ID",             NNrtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
650
   OraDatabase.Parameters.Add "USER_ID",             NNuser_id, ORAPARM_INPUT, ORATYPE_NUMBER
651
   OraDatabase.Parameters.Add "TRUE_RECORD_COUNT",   NULL, ORAPARM_OUTPUT, ORATYPE_NUMBER
652
   OraDatabase.Parameters.Add "RECORD_SET",          NULL, ORAPARM_OUTPUT, ORATYPE_CURSOR
119 ghuddy 653
 
123 ghuddy 654
   'If it's a Deployment View
655
   If parDview = "enable" Then
656
      ' Decide which environment list is to be displayed to the Integrators/Testers
657
      Select Case CInt( NNEnvTab )
658
         Case enumENVTAB_PRODRELEASE
659
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_PRODRELEASE_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
119 ghuddy 660
 
123 ghuddy 661
         Case enumENVTAB_INTEGRATE
662
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_INTEGRATION_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
119 ghuddy 663
 
123 ghuddy 664
         Case enumENVTAB_TEST
665
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_TEST_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
119 ghuddy 666
 
123 ghuddy 667
         Case enumENVTAB_DEPLOY
668
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_DEPLOY_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
119 ghuddy 669
 
123 ghuddy 670
         Case enumENVTAB_REJECT
671
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_REJECT_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
119 ghuddy 672
 
123 ghuddy 673
      End Select
119 ghuddy 674
 
123 ghuddy 675
   Else
676
      ' Decide which environment list is to be displayed
677
      Select Case CInt( NNEnvTab )
678
         Case enumENVTAB_WORK_IN_PROGRESS
679
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_WORK_IN_PROGRESS_ITEMS ( :VIEW_TYPE, :USER_ID, :RTAG_ID, :VIEW_ID_SHOW_LIST, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
119 ghuddy 680
 
123 ghuddy 681
         Case enumENVTAB_PLANNED
682
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_PENDING_ITEMS ( :VIEW_TYPE, :USER_ID, :RTAG_ID, :VIEW_ID_SHOW_LIST, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
119 ghuddy 683
 
123 ghuddy 684
         Case enumENVTAB_RELEASED
685
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_RELEASED_ITEMS ( :VIEW_TYPE, :USER_ID, :RTAG_ID, :VIEW_ID_SHOW_LIST, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
119 ghuddy 686
 
123 ghuddy 687
         Case Else
688
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_ENVIRONMENT_ITEMS ( :VIEW_TYPE, :USER_ID, :RTAG_ID, :VIEW_ID_SHOW_LIST, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
119 ghuddy 689
 
123 ghuddy 690
      End Select
119 ghuddy 691
 
123 ghuddy 692
   End If
119 ghuddy 693
 
123 ghuddy 694
   ' Get Record set from database
695
   Set rsView = OraDatabase.Parameters("RECORD_SET").Value
696
   nTrueRecordCount = OraDatabase.Parameters("TRUE_RECORD_COUNT").Value
119 ghuddy 697
 
123 ghuddy 698
   OraDatabase.Parameters.Remove "RTAG_ID"
699
   OraDatabase.Parameters.Remove "USER_ID"
700
   OraDatabase.Parameters.Remove "VIEW_TYPE"
701
   OraDatabase.Parameters.Remove "VIEW_ID_SHOW_LIST"
702
   OraDatabase.Parameters.Remove "RECORD_SET"
703
   OraDatabase.Parameters.Remove "TRUE_RECORD_COUNT"
119 ghuddy 704
 
123 ghuddy 705
   ' Initialise variables
706
   If ((NOT rsView.BOF) AND (NOT rsView.EOF)) Then
707
      relContentsSTR = ""
708
      viewCollapsed = FALSE
709
      curr_view_id = rsView("view_id")      ' Set current view
710
      view_name = rsView("view_name")
711
   End If
119 ghuddy 712
 
123 ghuddy 713
   While ((NOT rsView.BOF) AND (NOT rsView.EOF))
714
      '==== Get View Contents ====
715
      If NOT IsNull(rsView.Fields("pv_id")) Then
716
         tmpURL = SSscript &"?pv_id="& rsView.Fields("pv_id") &"&rtag_id="& parRtag_id
717
         IMG_locked = ""
718
         If rsView.Fields("dlocked") = "Y" Then IMG_locked = imgLocked
119 ghuddy 719
 
123 ghuddy 720
         ' DEVI-45275 - Normally, dlocked=Y items are denoted with a padlock icon on the web page. Since we can now merge
721
         ' into the pending tab, the dlocked=Y items that end up there would not give any visual indication to the user
722
         ' as to why they are present. So, instead of the padlock icon, display the added or removed icon to indicate
723
         ' what the intended action is to be, once the pending item is approved.
724
         ' Obviously, this functionality does not apply if we are in the deployment view, and only applies if viewing
725
         ' the PENDING or ALL environment tabs.
726
         ' With regard to the operation value, A = Added, S = Subtracted
727
         nOperation = " "
728
         If parDview <> "enable" AND (CInt( NNEnvTab ) = enumENVTAB_PLANNED OR CInt( NNEnvTab ) = enumENVTAB_ALL) Then
729
            nOperation = rsView.Fields("operation")   ' NB. this field is only availble if earlier query was GET_PENDING_ITEMS or GET_ENVIRONMENT_ITEMS
730
            If nOperation = "A" Then
731
               IMG_locked = imgAdded
732
            ElseIf nOperation = "S" Then
733
               IMG_locked = imgRemoved
734
            End If
735
         End If
119 ghuddy 736
 
123 ghuddy 737
         relContentsSTR = relContentsSTR & "<tr>" & VBNewLine
119 ghuddy 738
 
123 ghuddy 739
         If rsView("pkg_state") = 0 And rsView.Fields("deprecated_state") <> "" Then
740
            relContentsSTR = relContentsSTR & "  <td width='1%'>"& DefineStateIcon ( rsView.Fields("deprecated_state"), rsView("dlocked"), NULL, NULL, pkgInfoHash.Item("build_type"), TRUE ) &"</td>"& VBNewLine
741
         Else
742
            If (parDview <> "enable") AND ( ( CInt(NNEnvTab) = enumENVTAB_PLANNED ) OR ( Request("envtab") = enumENVTAB_PLANNED ) ) Then
119 ghuddy 743
 
123 ghuddy 744
               ' if package version is unlocked, rejected, or pending approval, or is to be added/subtracted to/from the release (DEVI-45275), then
745
               If (rsView("dlocked") = "N") OR (rsView("dlocked") = "R") OR (rsView("dlocked") = "P") OR (nOperation = "A") OR (nOperation = "S") Then
746
                  checked = NULL
747
                  disabled = NULL
748
                  ' disable check box if not logged in, or if not in open mode and user has no permission to approve pending
749
                  If objAccessControl.UserLogedIn Then
750
                     If ( ReleaseMode <> enumDB_RELEASE_IN_OPEN_MODE ) Then
751
                        If NOT objAccessControl.IsActive("ApproveForAutoBuild") Then
752
                           disabled = "disabled"
753
                        End If
754
                     End If
755
                  Else
756
                     disabled = "disabled"
757
                  End If
119 ghuddy 758
 
123 ghuddy 759
               Else ' always check and disable the checkbox
760
                  checked = "checked"
761
                  disabled = "disabled"
762
               End If
119 ghuddy 763
 
123 ghuddy 764
               relContentsSTR = relContentsSTR & " <td width='1%'><input name='pv_id_list' id='pv_id_list' type=checkbox value="&rsView.Fields("pv_id")&" "&checked&" "&disabled&"></td>"& VBNewLine
765
            Else
766
               relContentsSTR = relContentsSTR & " <td width='1%'>"& DefineStateIcon ( rsView("pkg_state"), rsView("dlocked"), NULL, NULL, pkgInfoHash.Item("build_type"), TRUE ) &"</td>"& VBNewLine
767
            End If
768
         End If
119 ghuddy 769
 
123 ghuddy 770
         relContentsSTR = relContentsSTR & "  <td width='100%' nowrap><a href='"& tmpURL &"' class='body_txt_drk' title="""& HTMLEncode( rsView("pv_description") ) &""">"& rsView.Fields("pkg_name") &"</a></td>" & VBNewLine
771
         relContentsSTR = relContentsSTR & "  <td width='1%' nowrap class='envPkg'>"& rsView.Fields("pkg_version") &"</td>" & VBNewLine
772
         relContentsSTR = relContentsSTR & "  <td width='1%'>"& IMG_locked &"</td>"
773
         relContentsSTR = relContentsSTR & "</tr>" & VBNewLine
774
      Else
775
         'relContentsSTR = relContentsSTR & "<tr><td><label class='form_txt' disabled>...</label></td></tr>"      ' Collapsed view displays dots
119 ghuddy 776
 
123 ghuddy 777
         viewCollapsed = TRUE
778
      End If
119 ghuddy 779
 
123 ghuddy 780
      rsView.MoveNext
119 ghuddy 781
 
123 ghuddy 782
      If ((NOT rsView.BOF) AND (NOT rsView.EOF)) Then
783
         ' NOT end of the record set
784
         If curr_view_id <> rsView("view_id") Then
785
            '====== Draw buttons =================================
786
            'If InStrPipes( SSshowviews, curr_view_id ) Then
787
            '   btn1 = "<a href='"& SSscript &"?"& qstrPar &"="& RemoveFromStrPipes( SSshowviews, curr_view_id ) &"&pv_id="& Request("pv_id") &"&rtag_id="& NNrtag_id &"' >"& imgMinimise &"</a>"
788
            'Else
789
            '   btn1 = "<a href='"& SSscript &"?"& qstrPar &"=|"& curr_view_id &"|"& SSshowviews &"&pv_id="& Request("pv_id") &"&rtag_id="& NNrtag_id &"'>"& imgMaximise &"</a>"
790
            'End If
119 ghuddy 791
 
123 ghuddy 792
            '====== Print contents ===============================
793
            relContentsSTR = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>" & relContentsSTR & "</table>"
794
            Call Display_Env_BaseView ( curr_view_id, view_name, viewCollapsed, relContentsSTR )
119 ghuddy 795
 
123 ghuddy 796
            curr_view_id = rsView("view_id")
797
            view_name = rsView("view_name")
798
            relContentsSTR = ""      ' Empty the contents string
799
            viewCollapsed = FALSE
800
         End If
119 ghuddy 801
 
123 ghuddy 802
      Else
803
         ' End of the record set
119 ghuddy 804
 
123 ghuddy 805
         '====== Draw buttons =================================
806
         'If InStrPipes( SSshowviews, curr_view_id ) Then
807
         '   btn1 = "<a href='"& SSscript &"?"& qstrPar &"="& RemoveFromStrPipes( SSshowviews, curr_view_id ) &"&pv_id="& Request("pv_id") &"&rtag_id="& NNrtag_id &"' >"& imgMinimise &"</a>"
808
         'Else
809
         '   btn1 = "<a href='"& SSscript &"?"& qstrPar &"=|"& curr_view_id &"|"& SSshowviews &"&pv_id="& Request("pv_id") &"&rtag_id="& NNrtag_id &"'>"& imgMaximise &"</a>"
810
         'End If
119 ghuddy 811
 
123 ghuddy 812
         '====== Print contents ===============================
813
         relContentsSTR = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>" & relContentsSTR & "</table>"
814
         Call Display_Env_BaseView ( curr_view_id, view_name, viewCollapsed, relContentsSTR )
119 ghuddy 815
 
123 ghuddy 816
      End If
119 ghuddy 817
 
123 ghuddy 818
   WEnd
119 ghuddy 819
 
123 ghuddy 820
   If relContentsSTR <> "" Then
821
      Response.write "<a href='help/icons_F017.asp' target='_blank' class='body_scol'>Icon Legend...</a><br>"
822
   End If
119 ghuddy 823
 
123 ghuddy 824
   If nTrueRecordCount > 0 Then
825
      If rsView.RecordCount < 1 Then
826
         'If qstrPar = "Bshow" Then
827
         '   'Release is empty. Draw default box for Base view
828
         '   Call DisplayInfo ( "EMPTY_RELEASE_CONTENTS", "100%" )
829
         '
830
         'End If
119 ghuddy 831
 
123 ghuddy 832
         If qstrPar = "Pshow"  Then
833
            'Release is empty. Draw default box for Personal view
834
            Call DisplayInfo ( "PERSONAL_VIEW_NOT_SETUP", "100%" )
835
         End If
119 ghuddy 836
 
123 ghuddy 837
      End If
838
   End If
119 ghuddy 839
 
123 ghuddy 840
   ' Destroy
841
   rsView.Close
842
   Set rsView = nothing
119 ghuddy 843
End Sub
844
'------------------------------------------------------------------------------------------------------------------------------------------------
845
Sub PopulateGetShowViews ( ByRef outShowView )
846
 
123 ghuddy 847
   If Session(SESSION_SHOW_BASE_VIEW) <> "" Then
848
      Set outShowView = Session(SESSION_SHOW_BASE_VIEW)
119 ghuddy 849
 
123 ghuddy 850
   End If
119 ghuddy 851
End Sub
852
'------------------------------------------------------------------------------------------------------------------------------------------------
853
Function GetShowViewList ()
123 ghuddy 854
   'If SSparshow <> "" Then
855
   '   ' get list from query string
856
   '   ShowView = SSparshow
857
   'ElseIf Request.Cookies("RELEASEMANAGER_VIEW_SHOW")( SSviewtype ) <> "" Then
858
   '   ' get list from cookie
859
   '   ShowView = Request.Cookies("RELEASEMANAGER_VIEW_SHOW")( SSviewtype )
860
   'Else
861
   '   ' no list i.e. collapse all views
862
   '   ShowView = -1
863
   'End If
119 ghuddy 864
 
123 ghuddy 865
   'If oShowView.Count = 0 Then
866
   '   GetShowViewList = -1
867
   'Else
868
   '   GetShowViewList = Join( oShowView.Keys, "," )
869
   'End If
119 ghuddy 870
 
123 ghuddy 871
   If Request.Cookies(COOKIE_RELMGR_SHOW_VIEW) = "" Then
872
      GetShowViewList = -1
873
   Else
874
      GetShowViewList = Request.Cookies(COOKIE_RELMGR_SHOW_VIEW)
875
   End If
119 ghuddy 876
 
877
End Function
125 ghuddy 878
 
879
 
880
 
119 ghuddy 881
'------------------------------------------------------------------------------------------------------------------------------------------------
125 ghuddy 882
' This function forms a URL to use for refreshing the current dependencies.asp based page using the settings that are in effect at the time.
883
' Most importantly, it filters out the pv_id parameter if it is null (which otherwise would cause the page to be rendered incorreclty for an
884
' as yet, unknown reason).
885
'
886
Function RefreshedURL(NNdview, NNpview, NNpv_id, NNrtag_id)
887
   Dim url
888
 
889
   url = scriptName & "?Dview=" & NNdview & "&Pview=" & NNpview
890
 
891
   If NNpv_id Then
892
      url = url & "&pv_id=" & NNpv_id
893
   End If
894
 
895
   url = url & "&rtag_id=" & NNrtag_id
896
 
897
   RefreshedURL = url
898
End Function
899
 
900
 
901
'------------------------------------------------------------------------------------------------------------------------------------------------
119 ghuddy 902
%>
903
<%
904
 
905
'------------------------- MAIN LINE ---------------------------
906
%>
907
 
908
<%If parRtag_Id <> "" Then%>
909
<!-- RELEASE ACTION BUTTONS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
910
 
123 ghuddy 911
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
912
      <tr>
913
         <td width="1" background="images/bg_action_norm.gif"><img src="images/spacer.gif" width="10" height="35"></td>
914
         <td width="100%" nowrap background="images/bg_action_norm.gif" >
915
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
916
               <tr>
917
                  <%
918
                  Dim rsTest
919
                  Set rsTest = OraDataBase.DbCreateDynaset( "SELECT PROJ_ID   FROM RELEASE_TAGS WHERE RTAG_ID ="&parRtag_id , ORADYN_DEFAULT )
119 ghuddy 920
 
123 ghuddy 921
                  If (((ReleaseMode = enumDB_RELEASE_IN_CCB_MODE) OR (ReleaseMode = enumDB_RELEASE_IN_RESTRICTIVE_MODE)) AND objAccessControl.IsActive("AddDeletePackageInRestrictiveMode") And objAccessControl.IsDataActive("PROJECTS", DB_PROJ_ID, "EditProjects")) OR (ReleaseMode = enumDB_RELEASE_IN_OPEN_MODE ) Then
922
                     Response.write "<td width='1'><a href='form_search_pkgs.asp?rtag_id="& Request("rtag_id") &"&add_type="& enum_ADD_PACKAGES &"' title='Add package to this release'><img src='images/abtn_add_pkg.gif'  width='25' height='25' hspace='1' border='0'></a></td>"
923
                  Else
924
                     Response.write "<td width='1'><img src='images/abtn_add_pkg_off.gif' alt='Add package to this release' width='26' height='26' hspace='1' border='0'></td>"
925
                  End If
119 ghuddy 926
 
123 ghuddy 927
                  If (pkgInfoHash.Item("dlocked") <> "Y") AND (objAccessControl.UserLogedIn) AND (Request("pv_id") <> "") Then
928
                     If ( (objAccessControl.UserName = pkgInfoHash.Item("creator")) OR (objAccessControl.IsActive("DestroyPackageFromRelease")) ) Then
929
                        Response.write "<td width='1'><a href='_destroy_package.asp?rtag_id="& Request("rtag_id") &"&bfile="& ScriptName &"&pkg_id="& pkgInfoHash.Item("pkg_id") &"&pv_id="& Request("pv_id") &"' title='Destroy the selected Package Version' onClick='return confirmAction(""You are about to destroy ["& pkgInfoHash.Item("pkg_name") &" "& pkgInfoHash.Item("pkg_version") &"]. You cannot undo this operation.\nDo you want to proceed?"");'><img src='icons/i_destroy_package.gif' alt='Destroy the selected Package Version' width='26' height='26' hspace='1' border='0'></td>"
930
                     End If
931
                  End If
119 ghuddy 932
 
123 ghuddy 933
                  If objAccessControl.IsActive("CreateNewRelease") Then
934
                     Response.write "<td width='1'><a href='form_edit_release.asp?rtag_id_list="&parRtag_id&"&proj_id="&rsTest("proj_id")&"' title='Release properties'><img src='images/abtn_release_properties.gif'  width='25' height='25' hspace='1' border='0'></a></td>"
935
                  End If
119 ghuddy 936
 
123 ghuddy 937
                  Response.write "<td width='1'><img src='images/spacer.gif' width='7' height='25'></td>"
938
                  If objAccessControl.UserLogedIn Then
939
                     If QStrPar("Pview") = "disable" Then
125 ghuddy 940
                        Response.write "<td width='1'><a href='"& RefreshedURL(QStrPar("Dview"), "", Request("pv_id"), Request("rtag_id")) &"' title='Personal view disabled. Click to enable.'><img src='images/abtn_base_view.gif'  width='25' height='25' hspace='1' border='0'></a></td>"
123 ghuddy 941
                     Else
125 ghuddy 942
                        Response.write "<td width='1'><a href='"& RefreshedURL(QStrPar("Dview"), "disable", Request("pv_id"), Request("rtag_id")) &"' title='Personal view enabled. Click for full view.'><img src='images/abtn_personal_view.gif'  width='25' height='25' hspace='1' border='0'></a></td>"
123 ghuddy 943
                     End If
944
                  Else
945
                     Response.write "<td width='1'><img src='images/abtn_personal_view_off.gif' width='26' height='26' hspace='1' border='0'></td>"
946
                  End If
119 ghuddy 947
 
123 ghuddy 948
                  If QStrPar("Dview") = "enable" Then
125 ghuddy 949
                     Response.write "<td width='1'><a href='"& RefreshedURL("", QStrPar("Pview"), Request("pv_id"), Request("rtag_id")) &"' title='Click to switch to Release View'><img src='icons/ReleaseView.gif'  width='25' height='25' hspace='1' border='0'></a></td>"
123 ghuddy 950
                  Else
125 ghuddy 951
                     Response.write "<td width='1'><a href='"& RefreshedURL("enable", QStrPar("Pview"), Request("pv_id"), Request("rtag_id")) &"' title='Click to switch to Deployment View'><img src='icons/DeploymentView.gif'  width='25' height='25' hspace='1' border='0'></a></td>"
123 ghuddy 952
                  End If
119 ghuddy 953
 
123 ghuddy 954
                  Response.write "<td width='1'><img src='images/spacer.gif' width='7' height='25'></td>"
119 ghuddy 955
 
123 ghuddy 956
                  Response.write "<td width='1'><a href='javascript:;' title='Reference other releases...' onClick='ToggleDisplay(""DIV_RELEASE_REFERENCES"",""SPAN_RELEASE_REFERENCES"",""SPAN_RELEASE_REFERENCES_ON""); ' ><SPAN name='SPAN_RELEASE_REFERENCES' id='SPAN_RELEASE_REFERENCES' style='display:block;'><img src='images/abtn_link_release.gif' width='25' height='25' border='0' hspace='1' ></SPAN><SPAN name='SPAN_RELEASE_REFERENCES_ON' id='SPAN_RELEASE_REFERENCES_ON' style='display:none;'><img src='images/abtn_link_release_on.gif' width='25' height='25' border='0' hspace='1' ></SPAN></a></td>"
119 ghuddy 957
 
123 ghuddy 958
                  Response.write "<td width='1'><img src='images/spacer.gif' width='7' height='25'></td>"
119 ghuddy 959
 
123 ghuddy 960
                  Response.write "<td width='1'><a href='javascript:;' title='Advanced Search...' onClick='ToggleAdvancedSearch(); ' ><SPAN name='SPAN_ADVANCED_SEARCH' id='SPAN_ADVANCED_SEARCH' style='display:block;'><img src='images/abtn_advanced_search.gif' width='25' height='25' border='0' hspace='1' ></SPAN><SPAN name='SPAN_ADVANCED_SEARCH_ON' id='SPAN_ADVANCED_SEARCH_ON' style='display:none;'><img src='images/abtn_advanced_search_on.gif' width='25' height='25' border='0' hspace='1' ></SPAN></a></td>"
119 ghuddy 961
 
123 ghuddy 962
                  If ( (QStrPar("Dview") <> "enable") AND ( (CInt(nEnvTab) = enumENVTAB_PLANNED) OR (Request("envtab") = enumENVTAB_PLANNED) ) ) Then
963
                     If objAccessControl.UserLogedIn Then
964
                        If ( ReleaseMode <> enumDB_RELEASE_IN_OPEN_MODE ) Then
965
                           If objAccessControl.IsActive("ApproveForAutoBuild") OR objAccessControl.IsActive("ApproveForManualBuild") Then
966
                              Response.write "<td width='1'><a href='#' onClick='makeBulkRelease();'><img src='images/abtn_make_release_bulk.gif' title='Make Bulk Release...'></td>"
967
                           End If
968
                        Else
969
                           Response.write "<td width='1'><a href='#' onClick='makeBulkRelease();'><img src='images/abtn_make_release_bulk.gif' title='Make Bulk Release...'></td>"
970
                        End If
971
                     End If
972
                  End If
4358 dpurdie 973
                  Response.write "<td width='1'><img src='images/spacer.gif' width='1' height='25'></td>"
974
                  If ( (QStrPar("Dview") <> "enable") AND ( (CInt(nEnvTab) = enumENVTAB_PLANNED) OR (Request("envtab") = enumENVTAB_PLANNED) ) ) Then
975
                     If objAccessControl.UserLogedIn Then
976
                        If ( ReleaseMode <> enumDB_RELEASE_IN_OPEN_MODE ) Then
977
                           If objAccessControl.IsActive("ApproveForAutoBuild") OR objAccessControl.IsActive("ApproveForManualBuild") Then
978
                              Response.write "<td width='1'><a href='#' onClick='makeBulkReject();'><img src='images/abtn_make_bulk_remove.gif' title='Bulk Reject...'></td>"
979
                           End If
980
                        Else
981
                           Response.write "<td width='1'><a href='#' onClick='makeBulkReject();'><img src='images/abtn_make_bulk_remove.gif' title='Bulk Reject...'></td>"
982
                        End If
983
                     End If
984
                  End If
123 ghuddy 985
                  rsTest.Close()
986
                  Set rsTest = nothing
987
                  %>
988
                  <td width="100%"><img src="images/spacer.gif" width="1" height="1"></td>
989
               </tr>
990
            </table>
991
         </td>
992
         <td width="1" background="images/bg_action_norm.gif"><img src="images/spacer.gif" width="10" height="8"></td>
993
      </tr>
994
   </table>
119 ghuddy 995
 
996
<!-- ADVANCED SEARCH ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
123 ghuddy 997
   <DIV name="DIV_ADVANCED_SEARCH" id="DIV_ADVANCED_SEARCH" style="display:none;">
998
      <table width="100%" border="0" cellspacing="0" cellpadding="10">
999
         <form name="advancedsearch" method="get" action="find.asp">
1000
            <tr>
1001
               <td nowrap  class="form_txt" valign="middle">
1002
                  <%
1003
                  Dim FindPackageCheck, FindFileCheck
119 ghuddy 1004
 
123 ghuddy 1005
                  FindPackageCheck = ""
1006
                  FindFileCheck = ""
119 ghuddy 1007
 
123 ghuddy 1008
                  If Request("searchtype") = "2" Then
1009
                     FindFileCheck = "checked"
1010
                  Else
1011
                     FindPackageCheck = "checked"
1012
                  End If
119 ghuddy 1013
 
123 ghuddy 1014
                  %>
1015
                  <fieldset>
1016
                     <legend class="body_colb"><img src="images/i_mglass.gif" width="17" height="17" border="0" align="absmiddle">&nbsp;Advanced Search</legend>
1017
                     <input name="searchtype" id="searchtype1" type="radio" value="1" <%=FindPackageCheck%>>
1018
                     <a href="javascript:;" onClick="MM_findObj('searchtype1').checked=true;" class="body_txt">Find a Package</a><br>
1019
                     <input name="searchtype" id="searchtype2" type="radio" value="2" <%=FindFileCheck%>>
1020
                     <a href="javascript:;" onClick="MM_findObj('searchtype2').checked=true;" class="body_txt">Find a File</a><br><br>
1021
                     <%If CInt(nEnvTab) = enumENVTAB_WORK_IN_PROGRESS Then%>
1022
                        Find in Work In Progress<br>
1023
                     <%ElseIf CInt(nEnvTab) = enumENVTAB_PLANNED Then%>
1024
                        Find in Pending<br>
1025
                     <%ElseIf  CInt(nEnvTab) = enumENVTAB_RELEASED Then%>
1026
                        Find in Released<br>
1027
                     <%End If%>
1028
                     <input type="text" name="keyword" size="25" class="form_ivaluew" value="<%=Request("keyword")%>">
1029
                     <input type="submit" name="btn" value="Find" class="form_ivalue">
119 ghuddy 1030
 
123 ghuddy 1031
                     <input type="hidden" name="envtab" value="<%=nEnvTab%>">
1032
                     <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
1033
                  </fieldset>
1034
                  <br>
1035
               </td>
1036
            </tr>
1037
         </form>
1038
      </table>
1039
   </DIV>
119 ghuddy 1040
 
123 ghuddy 1041
   <script language="JavaScript" type="text/javascript">
1042
      <!--
1043
      function ToggleAdvancedSearch( )
1044
      {
1045
         if ( MM_findObj("DIV_ADVANCED_SEARCH").style.display == 'none')
1046
         {
1047
            MM_findObj("DIV_ADVANCED_SEARCH").style.display = 'block';
1048
            MM_findObj("SPAN_ADVANCED_SEARCH").style.display = 'none';
1049
            MM_findObj("SPAN_ADVANCED_SEARCH_ON").style.display = 'block';
1050
         }
1051
         else
1052
         {
1053
            MM_findObj("DIV_ADVANCED_SEARCH").style.display = 'none';
1054
            MM_findObj("SPAN_ADVANCED_SEARCH").style.display = 'block';
1055
            MM_findObj("SPAN_ADVANCED_SEARCH_ON").style.display = 'none';
1056
         }
119 ghuddy 1057
 
123 ghuddy 1058
         document.cookie = 'RELMGR_DIV_ADVANCED_SEARCH' + '=' + MM_findObj("DIV_ADVANCED_SEARCH").style.display;
1059
      }
119 ghuddy 1060
 
123 ghuddy 1061
      // Run this on page render for default setting
1062
      if (GetCookie('RELMGR_DIV_ADVANCED_SEARCH') == 'block')
1063
      {
1064
         ToggleAdvancedSearch();
1065
      }
119 ghuddy 1066
 
123 ghuddy 1067
   //-->
1068
   </script>
119 ghuddy 1069
 
1070
<!-- RELEASE REFERENCES  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
123 ghuddy 1071
   <DIV name="DIV_RELEASE_REFERENCES" id="DIV_RELEASE_REFERENCES" style="display:none;">
1072
      <table width="100%" border="0" cellspacing="0" cellpadding="10">
1073
         <form name="relref" method="get" action="_remove_release_reference.asp" onSubmit="ToggleDisplay('RelRefProgressBar');">
1074
            <tr>
1075
               <td width="100%" nowrap class="form_txt">
1076
                  <fieldset>
1077
                     <legend class="body_colb"><img src="images/i_releaseref.gif" border="0" align="absmiddle">&nbsp;Release References</legend>
1078
                     <DIV id="RelRefProgressBar" name="RelRefProgressBar" style="display:none;" class="class="body_scol"">
1079
                        <img src="images/i_processing.gif" width="11" height="17" align="absmiddle" hspace="3">Processing...
1080
                     </DIV>
1081
                     <b>References</b>
1082
                     <hr noshade size="1">
1083
                     <%If (ReleaseMode = enumDB_RELEASE_IN_OPEN_MODE) Then%>
1084
                        <input <%=objAccessControl.IsComponentDisabled("AddReleaseReference")%> type="reset" name="btn" value="Add.." class="form_ivalue" onClick="MM_openBrWindow('_wform_reference_release.asp?ToRtag_id=<%=parRtag_id%>&rfile=<%=ScriptName%>&rtag_id=<%=parRtag_id%>','ReferenceRelease','scrollbars=yes,resizable=yes,width=400,height=200')">
1085
                        &nbsp;<input <%=objAccessControl.IsComponentDisabled("RemoveReleaseReference")%> type="submit" name="btn" value="Remove" class="form_ivalue"><br><br>
1086
                     <%End If%>
119 ghuddy 1087
 
123 ghuddy 1088
                     <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
119 ghuddy 1089
 
123 ghuddy 1090
                     <table width="100%" border="0" cellspacing="0" cellpadding="1">
1091
                        <tr>
1092
                           <td bgcolor="#999999">
119 ghuddy 1093
 
123 ghuddy 1094
                              <table width="100%" border="0" cellspacing="0" cellpadding="1">
1095
                                 <%
1096
                                 OraDatabase.Parameters.Add "RTAG_ID", parRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
119 ghuddy 1097
 
123 ghuddy 1098
                                 Set rsEnvQry = OraDatabase.DbCreateDynaset( GetQuery("ReleaseReferences.sql"), 0 )
119 ghuddy 1099
 
123 ghuddy 1100
                                 OraDatabase.Parameters.Remove "RTAG_ID"
1101
                                 %>
119 ghuddy 1102
 
123 ghuddy 1103
                                 <%If rsEnvQry.RecordCount = 0 Then%>
1104
                                 <tr>
1105
                                    <td colspan="2" bgcolor="#FFFFFF" class="body_txt_gray">
1106
                                       No references used.
1107
                                    </td>
1108
                                 </tr>
1109
                                 <%End If%>
119 ghuddy 1110
 
123 ghuddy 1111
                                 <%While (NOT rsEnvQry.EOF) AND (NOT rsEnvQry.BOF)
1112
                                    If rsEnvQry("official") = "Y" Then
1113
                                       IMG_locked = imgLocked
1114
                                    Else
1115
                                       IMG_locked = ""
1116
                                    End If%>
1117
                                    <tr>
1118
                                       <td bgcolor="#FFFFFF" class="body_txt"><input type="checkbox" name="refrtag_id" value="<%=rsEnvQry("rtag_id")%>"></td>
1119
                                       <td bgcolor="#FFFFFF" class="body_txt" nowrap>
1120
                                          <a href="dependencies.asp?rtag_id=<%=rsEnvQry("rtag_id")%>" class="body_link" title="Go to this release...">
1121
                                          <%=rsEnvQry("proj_name")%> &gt; <%=rsEnvQry("rtag_name")%><%=IMG_locked%></a>&nbsp;
1122
                                       </td>
1123
                                    </tr>
1124
                                    <%rsEnvQry.MoveNext()
1125
                                 WEnd%>
1126
                                 <tr>
1127
                                    <td colspan="2" bgcolor="#FFFFFF" class="body_txt_gray">
1128
                                       <br><br><br>
1129
                                    </td>
1130
                                 </tr>
1131
                              </table>
1132
                           </td>
1133
                        </tr>
1134
                     </table>
1135
                     <br><br>
119 ghuddy 1136
 
123 ghuddy 1137
                     <b>Referenced By</b>
1138
                     <hr noshade size="1">
119 ghuddy 1139
 
123 ghuddy 1140
                     <table width="100%" border="0" cellspacing="0" cellpadding="1">
1141
                        <tr>
1142
                           <td bgcolor="#999999">
119 ghuddy 1143
 
123 ghuddy 1144
                              <table width="100%" border="0" cellspacing="0" cellpadding="1">
1145
                                 <%
1146
                                 OraDatabase.Parameters.Add "RTAG_ID", parRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
119 ghuddy 1147
 
123 ghuddy 1148
                                 Set rsEnvQry = OraDatabase.DbCreateDynaset( GetQuery("ReleaseReferencedBy.sql"), 0 )
119 ghuddy 1149
 
123 ghuddy 1150
                                 OraDatabase.Parameters.Remove "RTAG_ID"
1151
                                 %>
119 ghuddy 1152
 
123 ghuddy 1153
                                 <%If rsEnvQry.RecordCount = 0 Then%>
1154
                                    <tr>
1155
                                       <td colspan="2" bgcolor="#FFFFFF" class="body_txt_gray">
1156
                                          Not referenced anywhere.
1157
                                       </td>
1158
                                    </tr>
1159
                                 <%End If%>
119 ghuddy 1160
 
123 ghuddy 1161
                                 <%While (NOT rsEnvQry.EOF) AND (NOT rsEnvQry.BOF)
1162
                                    If rsEnvQry("official") = "Y" Then
1163
                                       IMG_locked = imgLocked
1164
                                    Else
1165
                                       IMG_locked = ""
1166
                                    End If%>
1167
                                    <tr>
1168
                                       <td bgcolor="#FFFFFF" class="body_txt"><input type="checkbox" name="refrtag_id" value="<%=rsEnvQry("rtag_id")%>" disabled></td>
1169
                                       <td bgcolor="#FFFFFF" class="body_txt" nowrap>
1170
                                          <a href="dependencies.asp?rtag_id=<%=rsEnvQry("rtag_id")%>" class="body_link" title="Go to this release...">
1171
                                          <%=rsEnvQry("proj_name")%> &gt; <%=rsEnvQry("rtag_name")%><%=IMG_locked%></a>&nbsp;
1172
                                       </td>
1173
                                    </tr>
1174
                                    <%rsEnvQry.MoveNext()
1175
                                 WEnd%>
1176
                                 <tr>
1177
                                    <td colspan="2" bgcolor="#FFFFFF" class="body_txt_gray">
1178
                                       <br><br><br>
1179
                                    </td>
1180
                                 </tr>
1181
                              </table>
1182
                           </td>
1183
                        </tr>
1184
                     </table>
1185
                     <br>
1186
                  </fieldset>
1187
                  <br>
1188
               </td>
1189
            </tr>
1190
         </form>
1191
      </table>
1192
   </DIV>
119 ghuddy 1193
<!-- END OF RELEASE REFERENCES  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
1194
 
1195
<!-- PACKAGE LIST ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
4389 dpurdie 1196
   <form id="pending_PVID_List" name="pending_PVID_List" method="post" action="make_bulk_release.asp?pv_id=<%=Request("pv_id")%>&rtag_id=<%=parRtag_id%>", onSubmit="makeBulkRelease();">
123 ghuddy 1197
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
1198
         <tr>
1199
            <td width="1" bgcolor="#999999"><img src="images/spacer.gif" width="10" height="25"></td>
1200
            <td width="100%" bgcolor="#999999" valign="bottom">
1201
               <!-- TAB CONTROLS ++++++++++++++++++++++ -->
1202
               <%
1203
               Set objTabControl = New TabControl
1204
               objTabControl.TemplateDoc = ReadFile( Server.MapPath("controls/ERGTabStyleDreamWeaver/dreamweaver_style.html") ) ' Supply tab style definition
1205
               objTabControl.TabStyle = "StyleDreamWeaver"
1206
               If   QStrPar("Dview") = "enable"   Then
1207
                  objTabControl.AddTabDefnition ( arrProductEnv )   '-   Integration/Test/Deploy
1208
               Else
1209
                  objTabControl.AddTabDefnition ( arrEnv )
1210
               End If
1211
               objTabControl.SelectByIndex ( nEnvTab )
1212
               objTabControl.Render ()
1213
               %>
1214
               <!-- END OF TAB CONTROLS +++++++++++++++ -->
1215
            </td>
1216
            <td width="1" bgcolor="#999999"><img src="images/spacer.gif" width="10" height="1"></td>
1217
         </tr>
1218
         <tr>
1219
            <td></td>
1220
            <td>
4388 dpurdie 1221
                <%Dim cb_selectall_display, cb_disabled
1222
                  If nEnvTab <> 1 Then cb_selectall_display = " style=display:none"
1223
                  If NOT objAccessControl.UserLogedIn Then cb_disabled = " disabled"%>
1224
                <input id="cb_selectall" type="checkbox" title="Toggle all checkboxes" onclick="toggletick(this);"<%=cb_selectall_display%><%=cb_disabled%> style="position: relative;left: 5px;float: left;">
1225
                <a href="javascript:;" title="Minimise/Restore all populated Views" onclick="toggleAllViews();"><img id="cb_minall" src="images/btn_min.gif" style="float: right;position: relative;left: -4;top: 3;"></a>
1226
                <a href="javascript:;" title="Close Populated Views" onclick="closeAllViews();"><img src="images/btn_remove.gif" style="float: right;position: relative;left: -4;"></a>
4395 dpurdie 1227
                <a href="javascript:;" title="Open and Populate all Views" onclick="openAllViews();"><img src="images/btn_expand.gif" style="float: right;position: relative;left: -4; top:2;"></a>
123 ghuddy 1228
               <%
1229
               Dim tempTimer
1230
               tempTimer = Timer
1231
               %>
1232
               <%'Response.write "TOTAL TIME: "&  Timer - tempTimer%>
1233
               <%
119 ghuddy 1234
 
123 ghuddy 1235
               '--- Render Environment ---
1236
               If objAccessControl.UserLogedIn AND (parPview <> "disable") Then
1237
                  'Personal View
1238
                  Call Print_View( nEnvTab, "personal", parRtag_id, parPshow, objAccessControl.UserId )
1239
               Else
1240
                  ' Guest view
1241
                  Call Print_View( nEnvTab, "guest", parRtag_id, parBshow, empty )
1242
               End If
1243
               %>
119 ghuddy 1244
 
123 ghuddy 1245
               <%'Response.write "TOTAL TIME: "&  Timer - tempTimer%>
1246
               <br>
1247
            </td>
1248
            <td></td>
1249
         </tr>
4389 dpurdie 1250
       </table>
1251
   </form>
123 ghuddy 1252
   <!-- <input type="hidden" name="pv_id_list" value=<%=Request("pv_id_list")%>> -->
119 ghuddy 1253
<!--END OF PACKAGE LIST ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
1254
 
1255
<%End If%>