Subversion Repositories DevTools

Rev

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