Subversion Repositories DevTools

Rev

Rev 6878 | Rev 6881 | 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
%>
6827 dpurdie 596
<table width="100%"  border="0" cellspacing="0" cellpadding="0" style="border-radius: 3px;border-style: solid;border-top-width: 3px;border-color: #dad7c8;">
6878 dpurdie 597
   <tr class='bg_dialog'>
598
      <td width="1%" align="left" valign="top">&nbsp;</td>
599
      <td width="100%"><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>
600
      <td width="1%" align="right"><span 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"></span></td>
601
      <td width="1%" align="right" valign="top">&nbsp;</td>
123 ghuddy 602
   </tr>
119 ghuddy 603
</table>
604
<DIV id="ENVDIV<%=NNbase_view_id%>" class="envContent" <%If BBviewCollapsed Then %>style="display:none;"<%Else%>style="display:block;"<%End If%>>
123 ghuddy 605
   <%If NOT BBviewCollapsed Then %>
606
      <%=SScontents%>
607
   <%Else%>
608
      <%=enumLOADING%>
609
   <%End If%>
610
</DIV>
119 ghuddy 611
<br>
612
<%
613
End Sub
614
'------------------------------------------------------------------------------------------------------------------------------------------------
5080 dpurdie 615
' Name: Print_View
616
' Desc: Generate the Grouped Package list
119 ghuddy 617
Sub Print_View( NNEnvTab, SSviewtype, NNrtag_id, SSshowviews, NNuser_id )
123 ghuddy 618
   Dim rsView, Query_String
619
   'Dim btn1
620
   Dim tmpURL
621
   Dim SSscript
622
   Dim qstrPar
623
   Dim nViewType
624
   Dim nTrueRecordCount
625
   Dim nOperation
626
   Dim relContentsSTR, viewCollapsed, curr_view_id, view_name
5167 dpurdie 627
   Dim canBeEmpty
119 ghuddy 628
 
5098 dpurdie 629
   If isDefined("allowNoPackage") Then
123 ghuddy 630
      SSscript = "dependencies.asp"
631
   Else
632
      SSscript = scriptName
633
   End If
119 ghuddy 634
 
123 ghuddy 635
   If SSviewtype = "guest" Then
636
      nViewType = 1
637
      qstrPar = "Bshow"
638
   ElseIf SSviewtype = "personal" Then
639
      nViewType = 2
640
      qstrPar = "Pshow"
641
   End If
5167 dpurdie 642
   canBeEmpty = false
643
 
5061 dpurdie 644
'rmDebug = rmDebug & " ,NNEnvTab[" & NNEnvTab & "," & CInt(NNEnvTab) & "]"
123 ghuddy 645
   OraDatabase.Parameters.Add "VIEW_TYPE",           nViewType, ORAPARM_INPUT, ORATYPE_NUMBER
646
   'OraDatabase.Parameters.Add "VIEW_ID_SHOW_LIST",   ShowView( Pipes2Commas( SSshowviews ), SSviewtype ), ORAPARM_INPUT, ORATYPE_VARCHAR2
647
   OraDatabase.Parameters.Add "VIEW_ID_SHOW_LIST",   GetShowViewList(), ORAPARM_INPUT, ORATYPE_VARCHAR2
648
   OraDatabase.Parameters.Add "RTAG_ID",             NNrtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
649
   OraDatabase.Parameters.Add "USER_ID",             NNuser_id, ORAPARM_INPUT, ORATYPE_NUMBER
650
   OraDatabase.Parameters.Add "TRUE_RECORD_COUNT",   NULL, ORAPARM_OUTPUT, ORATYPE_NUMBER
651
   OraDatabase.Parameters.Add "RECORD_SET",          NULL, ORAPARM_OUTPUT, ORATYPE_CURSOR
119 ghuddy 652
 
123 ghuddy 653
   'If it's a Deployment View
654
   If parDview = "enable" Then
655
      ' Decide which environment list is to be displayed to the Integrators/Testers
656
      Select Case CInt( NNEnvTab )
657
         Case enumENVTAB_PRODRELEASE
658
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_PRODRELEASE_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
119 ghuddy 659
 
123 ghuddy 660
         Case enumENVTAB_INTEGRATE
661
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_INTEGRATION_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
119 ghuddy 662
 
123 ghuddy 663
         Case enumENVTAB_TEST
664
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_TEST_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
119 ghuddy 665
 
123 ghuddy 666
         Case enumENVTAB_DEPLOY
667
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_DEPLOY_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
119 ghuddy 668
 
123 ghuddy 669
         Case enumENVTAB_REJECT
670
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_REJECT_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
119 ghuddy 671
 
123 ghuddy 672
      End Select
119 ghuddy 673
 
123 ghuddy 674
   Else
675
      ' Decide which environment list is to be displayed
676
      Select Case CInt( NNEnvTab )
677
         Case enumENVTAB_WORK_IN_PROGRESS
678
            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 679
            canBeEmpty = true
119 ghuddy 680
 
123 ghuddy 681
         Case enumENVTAB_PLANNED
682
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_PENDING_ITEMS ( :VIEW_TYPE, :USER_ID, :RTAG_ID, :VIEW_ID_SHOW_LIST, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
5167 dpurdie 683
            canBeEmpty = true
119 ghuddy 684
 
123 ghuddy 685
         Case enumENVTAB_RELEASED
686
            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 687
 
123 ghuddy 688
         Case Else
689
            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 690
 
123 ghuddy 691
      End Select
119 ghuddy 692
 
123 ghuddy 693
   End If
119 ghuddy 694
 
123 ghuddy 695
   ' Get Record set from database
696
   Set rsView = OraDatabase.Parameters("RECORD_SET").Value
697
   nTrueRecordCount = OraDatabase.Parameters("TRUE_RECORD_COUNT").Value
119 ghuddy 698
 
123 ghuddy 699
   OraDatabase.Parameters.Remove "RTAG_ID"
700
   OraDatabase.Parameters.Remove "USER_ID"
701
   OraDatabase.Parameters.Remove "VIEW_TYPE"
702
   OraDatabase.Parameters.Remove "VIEW_ID_SHOW_LIST"
703
   OraDatabase.Parameters.Remove "RECORD_SET"
704
   OraDatabase.Parameters.Remove "TRUE_RECORD_COUNT"
119 ghuddy 705
 
123 ghuddy 706
   ' Initialise variables
707
   If ((NOT rsView.BOF) AND (NOT rsView.EOF)) Then
708
      relContentsSTR = ""
709
      viewCollapsed = FALSE
710
      curr_view_id = rsView("view_id")      ' Set current view
711
      view_name = rsView("view_name")
712
   End If
119 ghuddy 713
 
123 ghuddy 714
   While ((NOT rsView.BOF) AND (NOT rsView.EOF))
715
      '==== Get View Contents ====
716
      If NOT IsNull(rsView.Fields("pv_id")) Then
717
         tmpURL = SSscript &"?pv_id="& rsView.Fields("pv_id") &"&rtag_id="& parRtag_id
718
         IMG_locked = ""
719
         If rsView.Fields("dlocked") = "Y" Then IMG_locked = imgLocked
119 ghuddy 720
 
123 ghuddy 721
         ' DEVI-45275 - Normally, dlocked=Y items are denoted with a padlock icon on the web page. Since we can now merge
722
         ' into the pending tab, the dlocked=Y items that end up there would not give any visual indication to the user
723
         ' as to why they are present. So, instead of the padlock icon, display the added or removed icon to indicate
724
         ' what the intended action is to be, once the pending item is approved.
725
         ' Obviously, this functionality does not apply if we are in the deployment view, and only applies if viewing
726
         ' the PENDING or ALL environment tabs.
727
         ' With regard to the operation value, A = Added, S = Subtracted
728
         nOperation = " "
729
         If parDview <> "enable" AND (CInt( NNEnvTab ) = enumENVTAB_PLANNED OR CInt( NNEnvTab ) = enumENVTAB_ALL) Then
730
            nOperation = rsView.Fields("operation")   ' NB. this field is only availble if earlier query was GET_PENDING_ITEMS or GET_ENVIRONMENT_ITEMS
731
            If nOperation = "A" Then
732
               IMG_locked = imgAdded
733
            ElseIf nOperation = "S" Then
734
               IMG_locked = imgRemoved
735
            End If
736
         End If
119 ghuddy 737
 
123 ghuddy 738
         relContentsSTR = relContentsSTR & "<tr>" & VBNewLine
119 ghuddy 739
 
123 ghuddy 740
         If rsView("pkg_state") = 0 And rsView.Fields("deprecated_state") <> "" Then
741
            relContentsSTR = relContentsSTR & "  <td width='1%'>"& DefineStateIcon ( rsView.Fields("deprecated_state"), rsView("dlocked"), NULL, NULL, pkgInfoHash.Item("build_type"), TRUE ) &"</td>"& VBNewLine
742
         Else
743
            If (parDview <> "enable") AND ( ( CInt(NNEnvTab) = enumENVTAB_PLANNED ) OR ( Request("envtab") = enumENVTAB_PLANNED ) ) Then
119 ghuddy 744
 
123 ghuddy 745
               ' if package version is unlocked, rejected, or pending approval, or is to be added/subtracted to/from the release (DEVI-45275), then
746
               If (rsView("dlocked") = "N") OR (rsView("dlocked") = "R") OR (rsView("dlocked") = "P") OR (nOperation = "A") OR (nOperation = "S") Then
747
                  checked = NULL
748
                  disabled = NULL
749
                  ' disable check box if not logged in, or if not in open mode and user has no permission to approve pending
750
                  If objAccessControl.UserLogedIn Then
751
                     If ( ReleaseMode <> enumDB_RELEASE_IN_OPEN_MODE ) Then
5061 dpurdie 752
                        If NOT canActionControlInProject("ApproveForAutoBuild") Then
123 ghuddy 753
                           disabled = "disabled"
754
                        End If
755
                     End If
756
                  Else
757
                     disabled = "disabled"
758
                  End If
119 ghuddy 759
 
123 ghuddy 760
               Else ' always check and disable the checkbox
761
                  checked = "checked"
762
                  disabled = "disabled"
763
               End If
119 ghuddy 764
 
123 ghuddy 765
               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
766
            Else
5080 dpurdie 767
               relContentsSTR = relContentsSTR & " <td width='1%'>" & DefineStateIcon ( rsView("pkg_state"), rsView("dlocked"), NULL, NULL, pkgInfoHash.Item("build_type"), TRUE ) &"</td>"& VBNewLine
123 ghuddy 768
            End If
769
         End If
119 ghuddy 770
 
123 ghuddy 771
         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
772
         relContentsSTR = relContentsSTR & "  <td width='1%' nowrap class='envPkg'>"& rsView.Fields("pkg_version") &"</td>" & VBNewLine
773
         relContentsSTR = relContentsSTR & "  <td width='1%'>"& IMG_locked &"</td>"
774
         relContentsSTR = relContentsSTR & "</tr>" & VBNewLine
775
      Else
776
         'relContentsSTR = relContentsSTR & "<tr><td><label class='form_txt' disabled>...</label></td></tr>"      ' Collapsed view displays dots
119 ghuddy 777
 
123 ghuddy 778
         viewCollapsed = TRUE
779
      End If
119 ghuddy 780
 
123 ghuddy 781
      rsView.MoveNext
119 ghuddy 782
 
123 ghuddy 783
      If ((NOT rsView.BOF) AND (NOT rsView.EOF)) Then
784
         ' NOT end of the record set
785
         If curr_view_id <> rsView("view_id") Then
786
            '====== Draw buttons =================================
787
            'If InStrPipes( SSshowviews, curr_view_id ) Then
788
            '   btn1 = "<a href='"& SSscript &"?"& qstrPar &"="& RemoveFromStrPipes( SSshowviews, curr_view_id ) &"&pv_id="& Request("pv_id") &"&rtag_id="& NNrtag_id &"' >"& imgMinimise &"</a>"
789
            'Else
790
            '   btn1 = "<a href='"& SSscript &"?"& qstrPar &"=|"& curr_view_id &"|"& SSshowviews &"&pv_id="& Request("pv_id") &"&rtag_id="& NNrtag_id &"'>"& imgMaximise &"</a>"
791
            'End If
119 ghuddy 792
 
123 ghuddy 793
            '====== Print contents ===============================
794
            relContentsSTR = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>" & relContentsSTR & "</table>"
795
            Call Display_Env_BaseView ( curr_view_id, view_name, viewCollapsed, relContentsSTR )
119 ghuddy 796
 
123 ghuddy 797
            curr_view_id = rsView("view_id")
798
            view_name = rsView("view_name")
799
            relContentsSTR = ""      ' Empty the contents string
800
            viewCollapsed = FALSE
801
         End If
119 ghuddy 802
 
123 ghuddy 803
      Else
804
         ' End of the record set
119 ghuddy 805
 
123 ghuddy 806
         '====== Draw buttons =================================
807
         'If InStrPipes( SSshowviews, curr_view_id ) Then
808
         '   btn1 = "<a href='"& SSscript &"?"& qstrPar &"="& RemoveFromStrPipes( SSshowviews, curr_view_id ) &"&pv_id="& Request("pv_id") &"&rtag_id="& NNrtag_id &"' >"& imgMinimise &"</a>"
809
         'Else
810
         '   btn1 = "<a href='"& SSscript &"?"& qstrPar &"=|"& curr_view_id &"|"& SSshowviews &"&pv_id="& Request("pv_id") &"&rtag_id="& NNrtag_id &"'>"& imgMaximise &"</a>"
811
         'End If
119 ghuddy 812
 
123 ghuddy 813
         '====== Print contents ===============================
814
         relContentsSTR = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>" & relContentsSTR & "</table>"
815
         Call Display_Env_BaseView ( curr_view_id, view_name, viewCollapsed, relContentsSTR )
119 ghuddy 816
 
123 ghuddy 817
      End If
119 ghuddy 818
 
123 ghuddy 819
   WEnd
119 ghuddy 820
 
123 ghuddy 821
   If relContentsSTR <> "" Then
822
      Response.write "<a href='help/icons_F017.asp' target='_blank' class='body_scol'>Icon Legend...</a><br>"
823
   End If
119 ghuddy 824
 
123 ghuddy 825
   If nTrueRecordCount > 0 Then
826
      If rsView.RecordCount < 1 Then
827
         'If qstrPar = "Bshow" Then
828
         '   'Release is empty. Draw default box for Base view
829
         '   Call DisplayInfo ( "EMPTY_RELEASE_CONTENTS", "100%" )
830
         '
831
         'End If
119 ghuddy 832
 
5167 dpurdie 833
         If qstrPar = "Pshow" AND hasPview AND NOT canBeEmpty Then
123 ghuddy 834
            'Release is empty. Draw default box for Personal view
835
            Call DisplayInfo ( "PERSONAL_VIEW_NOT_SETUP", "100%" )
836
         End If
119 ghuddy 837
 
123 ghuddy 838
      End If
839
   End If
119 ghuddy 840
 
123 ghuddy 841
   ' Destroy
842
   rsView.Close
843
   Set rsView = nothing
119 ghuddy 844
End Sub
845
'------------------------------------------------------------------------------------------------------------------------------------------------
5167 dpurdie 846
' Detect the presence of a Personal View so that the controls can be disabled if the user does
847
' not have any.
848
'
849
Function hasPersonalViews ( )
850
   Dim rsTemp, Query_String
851
   hasPersonalViews = false
119 ghuddy 852
 
5167 dpurdie 853
   If objAccessControl.UserLogedIn Then
854
       Query_String = "select count(*) from views where owner_id = " & objAccessControl.UserId
119 ghuddy 855
 
5167 dpurdie 856
       Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
857
       If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
858
          If  rsTemp.Fields(0) > 0 Then
859
              hasPersonalViews = true
860
          End If
861
       End If
862
 
863
       rsTemp.Close
864
       Set rsTemp = nothing
123 ghuddy 865
   End If
5167 dpurdie 866
End Function
867
 
119 ghuddy 868
'------------------------------------------------------------------------------------------------------------------------------------------------
869
Function GetShowViewList ()
123 ghuddy 870
   'If SSparshow <> "" Then
871
   '   ' get list from query string
872
   '   ShowView = SSparshow
873
   'ElseIf Request.Cookies("RELEASEMANAGER_VIEW_SHOW")( SSviewtype ) <> "" Then
874
   '   ' get list from cookie
875
   '   ShowView = Request.Cookies("RELEASEMANAGER_VIEW_SHOW")( SSviewtype )
876
   'Else
877
   '   ' no list i.e. collapse all views
878
   '   ShowView = -1
879
   'End If
119 ghuddy 880
 
123 ghuddy 881
   'If oShowView.Count = 0 Then
882
   '   GetShowViewList = -1
883
   'Else
884
   '   GetShowViewList = Join( oShowView.Keys, "," )
885
   'End If
119 ghuddy 886
 
123 ghuddy 887
   If Request.Cookies(COOKIE_RELMGR_SHOW_VIEW) = "" Then
888
      GetShowViewList = -1
889
   Else
890
      GetShowViewList = Request.Cookies(COOKIE_RELMGR_SHOW_VIEW)
891
   End If
119 ghuddy 892
 
893
End Function
125 ghuddy 894
 
119 ghuddy 895
'------------------------------------------------------------------------------------------------------------------------------------------------
125 ghuddy 896
' 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.
897
' 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
898
' as yet, unknown reason).
899
'
900
Function RefreshedURL(NNdview, NNpview, NNpv_id, NNrtag_id)
901
   Dim url
902
 
903
   url = scriptName & "?Dview=" & NNdview & "&Pview=" & NNpview
904
 
905
   If NNpv_id Then
906
      url = url & "&pv_id=" & NNpv_id
907
   End If
908
 
909
   url = url & "&rtag_id=" & NNrtag_id
910
 
911
   RefreshedURL = url
912
End Function
913
 
914
 
915
'------------------------------------------------------------------------------------------------------------------------------------------------
119 ghuddy 916
%>
917
<%
918
 
919
'------------------------- MAIN LINE ---------------------------
920
%>
921
 
922
<%If parRtag_Id <> "" Then%>
923
<!-- RELEASE ACTION BUTTONS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
924
 
123 ghuddy 925
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
926
      <tr>
6877 dpurdie 927
         <td width="1" class='bg_dialog'><img src="images/spacer.gif" width="10" height="35"></td>
928
         <td width="100%" nowrap class='bg_dialog' >
123 ghuddy 929
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
930
               <tr>
931
                  <%
5061 dpurdie 932
                  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
6878 dpurdie 933
                     Response.write "<td width='1'><span class=pointer onClick='location.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'></span></td>"
123 ghuddy 934
                  Else
935
                     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>"
936
                  End If
119 ghuddy 937
 
6878 dpurdie 938
                  Call BuildActionButton(false,"","Add a Package to this Release", "src=images/abtn_add_pkg.gif width='25' height='25' hspace='1' border='0'", "form_search_pkgs.asp?rtag_id="& Request("rtag_id") &"&add_type="& enum_ADD_PACKAGES )
939
 
4670 dpurdie 940
                  If (pkgInfoHash.Item("dlocked") <> "Y") AND (Request("pv_id") <> "") Then
5061 dpurdie 941
                     If  (objAccessControl.UserLogedIn) AND ( (objAccessControl.UserName = pkgInfoHash.Item("creator")) OR (canActionControlInProject("DestroyPackageFromRelease")) ) Then
6827 dpurdie 942
                        Response.write "<td width='1' 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');"">"
6878 dpurdie 943
                        Response.Write "<img src='icons/i_destroy_package.gif' width='25' height='25' hspace='1' border='0'></td>"
4670 dpurdie 944
                     Else
5929 dpurdie 945
                        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 946
                     End If
947
                  End If
119 ghuddy 948
 
5061 dpurdie 949
                   ' Anybody can view properties
6878 dpurdie 950
                   Response.write "<td width='1'><span class=pointer onClick='location.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'></span></td>"
119 ghuddy 951
 
123 ghuddy 952
                  Response.write "<td width='1'><img src='images/spacer.gif' width='7' height='25'></td>"
953
                  If objAccessControl.UserLogedIn Then
5167 dpurdie 954
                      If hasPview Then
955
                         If parPview = "disable" Then
956
                            Dim ref : ref = RefreshedURL(parDview, "", Request("pv_id"), Request("rtag_id"))
6878 dpurdie 957
                            Response.write "<td width='1'><span class=pointer onClick='location.href="""&ref&"""' title='Personal view disabled. Click to enable.'><img src='images/abtn_base_view.gif'  width='25' height='25' hspace='1' border='0'></span></td>"
5167 dpurdie 958
                         Else
959
                            ref = RefreshedURL(parDview, "disable", Request("pv_id"), Request("rtag_id")) 
6878 dpurdie 960
                            Response.write "<td width='1'><span class=pointer onClick='location.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'></span></td>"
5167 dpurdie 961
                         End If
962
                      Else
963
                            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>"
964
                      End If
123 ghuddy 965
                  Else
966
                     Response.write "<td width='1'><img src='images/abtn_personal_view_off.gif' width='26' height='26' hspace='1' border='0'></td>"
967
                  End If
119 ghuddy 968
 
5167 dpurdie 969
                  If parDview = "enable" Then
6878 dpurdie 970
                     Response.write "<td width='1'><span class=pointer onClick='location.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'></span></td>"
123 ghuddy 971
                  Else
6878 dpurdie 972
                     Response.write "<td width='1'><span class=pointer onClick='location.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'></span></td>"
123 ghuddy 973
                  End If
119 ghuddy 974
 
123 ghuddy 975
                  Response.write "<td width='1'><img src='images/spacer.gif' width='7' height='25'></td>"
119 ghuddy 976
 
6878 dpurdie 977
                  Response.write "<td width='1' class='pointer' 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></td>"
119 ghuddy 978
 
123 ghuddy 979
                  Response.write "<td width='1'><img src='images/spacer.gif' width='7' height='25'></td>"
119 ghuddy 980
 
6878 dpurdie 981
                  Response.write "<td width='1' class='pointer' 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></td>"
119 ghuddy 982
 
5167 dpurdie 983
                  If ( (parDview <> "enable") AND ( (CInt(nEnvTab) = enumENVTAB_PLANNED) OR (Request("envtab") = enumENVTAB_PLANNED) ) ) Then
123 ghuddy 984
                     If objAccessControl.UserLogedIn Then
4687 dpurdie 985
                        If ( ReleaseMode = enumDB_RELEASE_IN_OPEN_MODE ) OR _
5061 dpurdie 986
                                canActionControlInProject("ApproveForAutoBuild") OR _
987
                                canActionControlInProject("ApproveForManualBuild") Then
6878 dpurdie 988
                              Response.write "<td width='1'><span class='pointer' onClick='makeBulkRelease();'><img src='images/abtn_make_release_bulk.gif' title='Make Bulk Release...'></span></td>"
4687 dpurdie 989
                              Response.write "<td width='1'><img src='images/spacer.gif' width='1' height='25'></td>"
6878 dpurdie 990
                              Response.write "<td width='1'><span class='pointer' onClick='makeBulkReject();'><img src='images/abtn_make_bulk_remove.gif' title='Bulk Reject...'></span></td>"
4358 dpurdie 991
                        End If
992
                     End If
993
                  End If
123 ghuddy 994
                  %>
995
                  <td width="100%"><img src="images/spacer.gif" width="1" height="1"></td>
996
               </tr>
997
            </table>
998
         </td>
6877 dpurdie 999
         <td width="1" class='bg_dialog'><img src="images/spacer.gif" width="10" height="8"></td>
123 ghuddy 1000
      </tr>
1001
   </table>
119 ghuddy 1002
 
1003
<!-- ADVANCED SEARCH ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
123 ghuddy 1004
   <DIV name="DIV_ADVANCED_SEARCH" id="DIV_ADVANCED_SEARCH" style="display:none;">
1005
      <table width="100%" border="0" cellspacing="0" cellpadding="10">
1006
         <form name="advancedsearch" method="get" action="find.asp">
1007
            <tr>
1008
               <td nowrap  class="form_txt" valign="middle">
1009
                  <%
1010
                  Dim FindPackageCheck, FindFileCheck
119 ghuddy 1011
 
123 ghuddy 1012
                  FindPackageCheck = ""
1013
                  FindFileCheck = ""
119 ghuddy 1014
 
123 ghuddy 1015
                  If Request("searchtype") = "2" Then
1016
                     FindFileCheck = "checked"
1017
                  Else
1018
                     FindPackageCheck = "checked"
1019
                  End If
119 ghuddy 1020
 
123 ghuddy 1021
                  %>
1022
                  <fieldset>
1023
                     <legend class="body_colb"><img src="images/i_mglass.gif" width="17" height="17" border="0" align="absmiddle">&nbsp;Advanced Search</legend>
1024
                     <input name="searchtype" id="searchtype1" type="radio" value="1" <%=FindPackageCheck%>>
6827 dpurdie 1025
                     <span onClick="MM_findObj('searchtype1').checked=true;" class="body_txt">Find a Package</span><br>
123 ghuddy 1026
                     <input name="searchtype" id="searchtype2" type="radio" value="2" <%=FindFileCheck%>>
6827 dpurdie 1027
                     <span onClick="MM_findObj('searchtype2').checked=true;" class="body_txt">Find a File</span><br><br>
123 ghuddy 1028
                     <%If CInt(nEnvTab) = enumENVTAB_WORK_IN_PROGRESS Then%>
1029
                        Find in Work In Progress<br>
1030
                     <%ElseIf CInt(nEnvTab) = enumENVTAB_PLANNED Then%>
1031
                        Find in Pending<br>
1032
                     <%ElseIf  CInt(nEnvTab) = enumENVTAB_RELEASED Then%>
1033
                        Find in Released<br>
1034
                     <%End If%>
1035
                     <input type="text" name="keyword" size="25" class="form_ivaluew" value="<%=Request("keyword")%>">
1036
                     <input type="submit" name="btn" value="Find" class="form_ivalue">
119 ghuddy 1037
 
123 ghuddy 1038
                     <input type="hidden" name="envtab" value="<%=nEnvTab%>">
1039
                     <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
1040
                  </fieldset>
1041
                  <br>
1042
               </td>
1043
            </tr>
1044
         </form>
1045
      </table>
1046
   </DIV>
119 ghuddy 1047
 
123 ghuddy 1048
   <script language="JavaScript" type="text/javascript">
1049
      <!--
1050
      function ToggleAdvancedSearch( )
1051
      {
1052
         if ( MM_findObj("DIV_ADVANCED_SEARCH").style.display == 'none')
1053
         {
1054
            MM_findObj("DIV_ADVANCED_SEARCH").style.display = 'block';
1055
            MM_findObj("SPAN_ADVANCED_SEARCH").style.display = 'none';
1056
            MM_findObj("SPAN_ADVANCED_SEARCH_ON").style.display = 'block';
1057
         }
1058
         else
1059
         {
1060
            MM_findObj("DIV_ADVANCED_SEARCH").style.display = 'none';
1061
            MM_findObj("SPAN_ADVANCED_SEARCH").style.display = 'block';
1062
            MM_findObj("SPAN_ADVANCED_SEARCH_ON").style.display = 'none';
1063
         }
119 ghuddy 1064
 
123 ghuddy 1065
         document.cookie = 'RELMGR_DIV_ADVANCED_SEARCH' + '=' + MM_findObj("DIV_ADVANCED_SEARCH").style.display;
1066
      }
119 ghuddy 1067
 
123 ghuddy 1068
      // Run this on page render for default setting
1069
      if (GetCookie('RELMGR_DIV_ADVANCED_SEARCH') == 'block')
1070
      {
1071
         ToggleAdvancedSearch();
1072
      }
119 ghuddy 1073
 
123 ghuddy 1074
   //-->
1075
   </script>
5071 dpurdie 1076
<!-- RELEASE SDK  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
5098 dpurdie 1077
   <DIV name="DIV_RELEASE_SDK" id="DIV_RELEASE_SDK" <%=iif(isDefined("showReleaseSdk"),"","style='display:none;'")%>>
5071 dpurdie 1078
      <table width="100%" border="0" cellspacing="0" cellpadding="10">
5097 dpurdie 1079
         <form name="RelSdk" method="get" action="sdk_remove_release.asp" onSubmit="$('#RelSdkProgressBar').toggle()">
5071 dpurdie 1080
            <tr>
1081
               <td width="100%" nowrap class="form_txt">
1082
                  <fieldset>
1083
                     <legend class="body_colb"><img src="images/i_releaseref.gif" border="0" align="absmiddle">&nbsp;Release SDK</legend>
5097 dpurdie 1084
                     <div>
1085
                         <%If (ReleaseMode = enumDB_RELEASE_IN_OPEN_MODE) Then%>
1086
                            <button <%=controlDisabledInProject("AddSdk")%> onClick="addSdk(); return false;" class="rmbutton">Add ...</button>
1087
                            &nbsp;<button  <%=controlDisabledInProject("RemoveSdk")%> class="rmbutton">Remove</button>
1088
                         <%End If%>
1089
                         <span id="RelSdkProgressBar" name="RelRefProgressBar" style="display:none;" class="class="body_scol"">
1090
                            <img src="images/i_processing.gif" width="11" height="17" align="absmiddle" hspace="3">Processing...
1091
                         </span>
1092
                         <p>
1093
                         <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
1094
                     </div>
5071 dpurdie 1095
 
1096
                     <table width="100%" border="0" cellspacing="0" cellpadding="1">
1097
                        <tr>
1098
                           <td bgcolor="#999999">
1099
 
1100
                              <table width="100%" border="0" cellspacing="0" cellpadding="1">
1101
                                 <%
1102
                                 OraDatabase.Parameters.Add "RTAG_ID", parRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
1103
                                 Set rsEnvQry = OraDatabase.DbCreateDynaset( GetQuery("ReleaseSdks.sql"), 0 )
1104
                                 OraDatabase.Parameters.Remove "RTAG_ID"
1105
                                 %>
1106
                                 <%If rsEnvQry.RecordCount = 0 Then%>
1107
                                 <tr>
1108
                                    <td colspan="2" bgcolor="#FFFFFF" class="body_txt_gray">
1109
                                       No SDKs used.
1110
                                    </td>
1111
                                 </tr>
1112
                                 <%End If%>
1113
 
1114
                                 <%While (NOT rsEnvQry.EOF) AND (NOT rsEnvQry.BOF)%>
1115
                                    <tr>
5080 dpurdie 1116
                                       <td bgcolor="#FFFFFF" class="body_txt" width="1%"><input type="checkbox" name="sdktag_id" value="<%=rsEnvQry("SDKTAG_ID")%>"></td>
5098 dpurdie 1117
                                       <td bgcolor="#FFFFFF" class="body_txt" nowrap>
1118
                                        <span title="<%=HTMLEncode(rsEnvQry("SDK_COMMENT"))%>">
1119
                                            <%=rsEnvQry("SDK_NAME")%>
1120
                                        </span>
1121
                                        &nbsp;&gt;&nbsp;
1122
                                        <span title="<%=HTMLEncode(rsEnvQry("DESCRIPTION"))%>">
1123
                                            <%=rsEnvQry("SDKTAG_NAME")%>
1124
                                        </span>
1125
                                        </td>
5071 dpurdie 1126
                                    </tr>
1127
                                    <%rsEnvQry.MoveNext()
1128
                                 WEnd%>
1129
                                 <tr>
1130
                                    <td colspan="2" bgcolor="#FFFFFF" class="body_txt_gray">
1131
                                       <br><br><br>
1132
                                    </td>
1133
                                 </tr>
1134
                              </table>
1135
                           </td>
1136
                        </tr>
1137
                     </table>
1138
                  </fieldset>
1139
                  <br>
1140
               </td>
1141
            </tr>
1142
         </form>
1143
      </table>
1144
   </DIV>
1145
<!-- END OF RELEASE SDK  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
1146
 
119 ghuddy 1147
<!-- PACKAGE LIST ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
4389 dpurdie 1148
   <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 1149
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
6879 dpurdie 1150
         <tr bgcolor="#999999">
1151
            <td style='min-width:10px;min-height:25px;height:25px;'></td>
1152
            <td width="100%" valign="bottom">
123 ghuddy 1153
               <!-- TAB CONTROLS ++++++++++++++++++++++ -->
1154
               <%
5167 dpurdie 1155
               If   parDview = "enable"   Then
6879 dpurdie 1156
                  Call Generate_Tab_Menu ( arrProductEnv, nEnvTab, "grey" )   '-   Integration/Test/Deploy
123 ghuddy 1157
               Else
6879 dpurdie 1158
                  Call Generate_Tab_Menu ( arrEnv, nEnvTab , "grey" )
123 ghuddy 1159
               End If
1160
               %>
1161
               <!-- END OF TAB CONTROLS +++++++++++++++ -->
1162
            </td>
6879 dpurdie 1163
            <td style='min-width:10px;min-height:25px;height:25px;'></td>
123 ghuddy 1164
         </tr>
6879 dpurdie 1165
 
123 ghuddy 1166
         <tr>
1167
            <td></td>
1168
            <td>
5080 dpurdie 1169
               <!-- BULK OPR CONTROLS ++++++++++++++++++++++ -->
4388 dpurdie 1170
                <%Dim cb_selectall_display, cb_disabled
1171
                  If nEnvTab <> 1 Then cb_selectall_display = " style=display:none"
1172
                  If NOT objAccessControl.UserLogedIn Then cb_disabled = " disabled"%>
1173
                <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;">
6827 dpurdie 1174
                <span 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;"></span>
1175
                <span title="Close Populated Views" onclick="closeAllViews();"><img src="images/btn_remove.gif" style="float: right;position: relative;left: -4;"></span>
1176
                <span title="Open and Populate all Views" onclick="openAllViews();"><img src="images/btn_expand.gif" style="float: right;position: relative;left: -4; top:2;"></span>
5080 dpurdie 1177
               <!-- END BULK OPR CONTROLS ++++++++++++++++++++++ -->
123 ghuddy 1178
               <%
1179
               Dim tempTimer
1180
               tempTimer = Timer
1181
               %>
1182
               <%'Response.write "TOTAL TIME: "&  Timer - tempTimer%>
1183
               <%
119 ghuddy 1184
 
123 ghuddy 1185
               '--- Render Environment ---
1186
               If objAccessControl.UserLogedIn AND (parPview <> "disable") Then
1187
                  'Personal View
1188
                  Call Print_View( nEnvTab, "personal", parRtag_id, parPshow, objAccessControl.UserId )
1189
               Else
1190
                  ' Guest view
1191
                  Call Print_View( nEnvTab, "guest", parRtag_id, parBshow, empty )
1192
               End If
1193
               %>
119 ghuddy 1194
 
123 ghuddy 1195
               <%'Response.write "TOTAL TIME: "&  Timer - tempTimer%>
1196
               <br>
1197
            </td>
1198
            <td></td>
1199
         </tr>
4389 dpurdie 1200
       </table>
1201
   </form>
123 ghuddy 1202
   <!-- <input type="hidden" name="pv_id_list" value=<%=Request("pv_id_list")%>> -->
119 ghuddy 1203
<!--END OF PACKAGE LIST ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
1204
 
1205
<%End If%>