Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

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