Subversion Repositories DevTools

Rev

Rev 5190 | Rev 5930 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%
'=====================================================
'   _environment.asp
'   Build Environment
'   Generate the left-hand panel for pages that show Release Content
'=====================================================
%>
<!--#include file="_tabs_definition_env.asp"-->
<!--#include file="common/_form_window_common.asp"-->
<%
'------------ Variable Definition -------------
Dim parOLshow     ' show/hide outer-latest
Dim parBshow      ' expand/collapse base views
Dim parPshow      ' expand/collapse personal views
Dim parPview      ' enable/disable all personal views
Dim parDview      ' enable/disable   deployment   view.
Dim hasPview      ' Has Personal View
Dim IMG_locked
Dim rsEnvQry
Dim pvIdInList
Dim checked
Dim disabled
Dim pkgType
Dim SCRIPT_NAME 'Use this here only as the previous one ScriptName is Already Defined
'------------ Constants Declaration -----------
Const imgMaximise  = "<IMG src='images/i_maximise.gif' alt='Show view contents.' width=13 height=13 hspace='2' vspace='1' border='0'>"
Const imgMinimise  = "<IMG src='images/i_minimise.gif' alt='Hide view contents.' width=13 height=13 hspace='2' vspace='1' border='0'>"
Const imgForced    = "<img src='images/s_forced.gif' width='19' height='17' align='absmiddle'>"
Const imgLocked    = "<img src='images/i_locked.gif' width='7' height='10' border='0' hspace='2'>"
Const hlColor      = "#DDDDDD"
Const imgAdded     = "<img src='images/i_added.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='To Be Added'>"
Const imgRemoved   = "<img src='images/i_removed.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='To Be Removed'>"
'------------ Variable Init -------------------
parOLshow = QStrPar("OLshow")
parBshow = QStrPar("Bshow")
parPshow = QStrPar("Pshow")
parPview = QStrPar("Pview")
parDview = QStrPar("Dview")
hasPview = hasPersonalViews()
If NOT hasPview  Then parPview = "disable"
'----------------------------------------------
%>
<script language="JavaScript" type="text/javascript">
<!--
var is_ie = (navigator.userAgent.indexOf('MSIE') >= 0) ? 1 : 0;
var is_ie5 = (navigator.appVersion.indexOf("MSIE 5.5")!=-1) ? 1 : 0;
var is_opera = ((navigator.userAgent.indexOf("Opera6")!=-1)||(navigator.userAgent.indexOf("Opera/6")!=-1)) ? 1 : 0;
    //netscape, safari, mozilla behave the same???
var is_netscape = (navigator.userAgent.indexOf('Netscape') >= 0) ? 1 : 0;

///////////////////////////////////////////////
//  Function:       destroyPackageVersion    
//  Description:    This function will display a conformation dialog before
//                  destroying the spacified package-version
//
function destroyPackageVersion()
{
    var message = 'You are about to destroy [<%=pkgInfoHash.Item("pkg_name")%>&nbsp;<%=pkgInfoHash.Item("pkg_version")%>].<p>You cannot undo this operation.<br>Do you want to proceed?';
    var url = '_destroy_package.asp?rtag_id=<%=Request("rtag_id")%>&bfile=<%=ScriptName%>&pkg_id=<%=pkgInfoHash.Item("pkg_id")%>&pv_id=<%=Request("pv_id")%>';
    vixConfirm( message, {title:'Destroy Package Version', 'button' : 'Destroy', url : url, icon : 'images/i_critical.gif'});
    return false;
}

///////////////////////////////////////////////
//  Function:       toggletick    
//  Description:    This function will toggle all visible (pending) tick boxes 
//  Input:          te  - Controlling element
//
function toggletick(te)
{
    // Get the form containing all of the pending items
    var f = document.getElementById('pending_PVID_List');
    if (f == null ) {
       vixAlert('Internal<p>Failed To Get pending_PVID_List');   // should never happen unless a coding/rendering mistake is made?
    } else {
       if (f.pv_id_list != null) {
           if (f.length == 1 || typeof f.pv_id_list.length == "undefined") {
              if (false == f.pv_id_list.disabled) {
                 f.pv_id_list.checked = te.checked;
              }
           } else {
              for (n = 0; n < f.pv_id_list.length; n++) {
                 if (false == f.pv_id_list[n].disabled) {
                    f.pv_id_list[n].checked = te.checked;
                 }
              }
           }
       }
    }
}

///////////////////////////////////////////////
//  Function:       countBulkItems
//  Description:    Determine the number of bulk ticked items
//                  These are suiable and enabled items
//  Input:          f - Form element to process
//
function countBulkItems(f)
{
    var n;
    var numCheckedAndEnabled = 0;
    var numUncheckedAndEnabled = 0;

    // Unbelievably, if the form has just one single PV_ID checkbox item, the syntax via which we access it
    // has to change. We cannot use array access syntax in such a case.
    if (f.length == 1 || typeof f.pv_id_list.length == "undefined")
    {
       if (f.pv_id_list.value != null)
       {
          if (false == f.pv_id_list.disabled)
          {
             if (true == f.pv_id_list.checked)
                numCheckedAndEnabled++;
             else
                numUncheckedAndEnabled++;
          }
       }
    }
    else
    {
       // Here we can and have to use array access syntax.
       for (n = 0; n < f.pv_id_list.length; n++)
       {
          if (false == f.pv_id_list[n].disabled)
          {
             if (true == f.pv_id_list[n].checked)
                numCheckedAndEnabled++;
             else
                numUncheckedAndEnabled++;
          }
       }
    }
    return numCheckedAndEnabled;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This function is executed when the Bulk Release action button is pressed. It will do some local
// client side checks and then if all is well, it will use the make_bulk_release.asp to initiate
// the bulk release process on the server side.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function makeBulkRelease()
{
    // Get the form containing all of the pending items
    var f = document.getElementById('pending_PVID_List');
    if (f == null)
    {
        vixAlert('Internal<p>Failed To Get pending_PVID_List');   // should never happen unless a coding/rendering mistake is made?
        return;
    }
    // When no items exist in the pending tab, the pending_PVID_List form will not contain any
    // element called pv_id_list, so it will be null. Check for that and issue an alert as appropriate.
    if (f.pv_id_list == null)
    {
        vixAlert('There are no items pending that can be considered for bulk release.' +
               '<p>Use the Bulk Release button when items with checkboxes are present in the Pending Tab.');
        return;
    }

    var numCheckedAndEnabled = countBulkItems(f);
    if (numCheckedAndEnabled == 0)
    {
        vixAlert('Currently, there are no items that can be bulk released.' +
                   '<p>Select items to be released before using the Bulk Release button');
        return;
    }

     vixConfirm('Release all ('+numCheckedAndEnabled+') checked items from the Pending List.', {
        title : 'Confirm Bulk Release',
        button : 'Release',
        ok : function(){
            // Initiate the bulk release by redirecting the browser to the make_bulk_release.asp page
            // which holds the server side VBScript code that actually carries out the release operations.
            // Once complete, that code will redirect the browser back to the dependencies.asp page of which
            // this _environment.asp file is a part (by direct inclusion)
            <%If Request("pv_id") Then%>
               f.action = "make_bulk_release.asp?pv_id=<%=Request("pv_id")%>&rtag_id=<%=parRtag_id%>";
            <%Else%>
               f.action = "make_bulk_release.asp?rtag_id=<%=parRtag_id%>";
            <%End If%>
            f.submit();
            // TODO : I would like to show progress? Is that even possible? If so, how?
        }
    });
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This function is executed when the Bulk Remove action button is pressed. It will do some local
// client side checks and then if all is well, it will use the make_bulk_remove.asp to initiate
// the bulk remove process on the server side.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function makeBulkReject()
{
   // Get the form containing all of the pending items
   var f = document.getElementById('pending_PVID_List');
   if (f == null)
   {
       vixAlert('Internal<p>Failed To Get pending_PVID_List');   // should never happen unless a coding/rendering mistake is made?
       return;
   }
    // When no items exist in the pending tab, the pending_PVID_List form will not contain any
    // element called pv_id_list, so it will be null. Check for that and issue an alert as appropriate.
    if (f.pv_id_list == null)
    {
        vixAlert('There are no items pending that can be considered for Bulk Rejection.' +
                   '<p>Use the Bulk Reject button when items with checkboxes are present in the Pending Tab.');
        return;
    }
     var numCheckedAndEnabled = countBulkItems(f);
     if (numCheckedAndEnabled == 0)
     {
         vixAlert('Currently, there are no items that can be Bulk Rejected.' +
               '<p>Select items to be released before using the Bulk Reject button');
         return;
     }

     vixConfirm('Reject all ('+numCheckedAndEnabled+') checked items from the Pending List.',{
        title : 'Confirm Bulk Reject',
        button : 'Reject',
        ok : function(){
                // Initiate the bulk remove by redirecting the browser to the make_bulk_remove.asp page
                // which holds the server side VBScript code that actually carries out the remove operations.
                // Once complete, that code will redirect the browser back to the dependencies.asp page of which
                // this _environment.asp file is a part (by direct inclusion)
                <%If Request("pv_id") Then%>
                   f.action = "make_bulk_reject.asp?pv_id=<%=Request("pv_id")%>&rtag_id=<%=parRtag_id%>";
                <%Else%>
                   f.action = "make_bulk_reject.asp?rtag_id=<%=parRtag_id%>";
                <%End If%>
                f.submit();
                // TODO : I would like to show progress? Is that even possible? If so, how?
            }
        });
}

///////////////////////////////////////////////
//  Function:    openAllViews
//  Description: Open and Populate all Views
//               Views are populated via AJAX
//               Current scheme allows for one AJAX request to be outstanding
//               Have AJAX callback determine if there is more work to be done
//
var openingAllViews = 0;
function openAllViews()
{
    openingAllViews = 0;
    toggleAllViewsIcon(0);

    //if (event.shiftKey==1)
    //
    //  Locate first/next view to be expanded
    var divs = document.getElementsByTagName("div");
    for (var i=0;i<divs.length;i++) {
        var el = divs[i]; 
        var id = el.id;
        if (id.indexOf("ENVDIV") == 0)
        {
            var rowId = id.substr(6);
            if (el.innerHTML.indexOf('<%=enumLOADING%>') != -1)
            {
                openingAllViews = 1;
                RequestViewContent(rowId);
                return;
            } else if (el.style.display == 'none') {
               UpdateViewHeader(rowId, 0);
            }
        }
    }
}

///////////////////////////////////////////////
//  Function:       closeAllViews
//  Description:    Close and forget about All Populated Views
//
function closeAllViews()
{
    openingAllViews = 0;
    toggleAllViewsIcon(0);

    //  Get the View cookie and convert it into a hash
    var vhash = new Object();
    var us = GetCookie('<%=COOKIE_RELMGR_SHOW_VIEW%>');
    if (us) {
        var aViewList = us.split(',');
        for (index=0; index < aViewList.length;++index) {
            vhash[aViewList[index]] = 1;
        }
    }

    //  Locate first/next view to be closed
    var divs = document.getElementsByTagName("div");
    for (var i=0;i<divs.length;i++) {
        var el = divs[i]; 
        var id = el.id;
        if (id.indexOf("ENVDIV") == 0)
        {
            var rowId = id.substr(6);
            if (el.innerHTML.indexOf('<%=enumLOADING%>') == -1)
            {
                UpdateViewHeader(rowId, 1);
                el.innerHTML = '<%=enumLOADING%>';

                // Delete from cookie too
                delete vhash[rowId];
            }
        }
    }

    //  Reform the cookie
    if (us)
    {
        us = Object.keys(vhash).join(',');
        // Store to cookie
        document.cookie = '<%=COOKIE_RELMGR_SHOW_VIEW%>' + '=' + us;
    }
}

///////////////////////////////////////////////
//  Function:    toggleAllViewsIcon
//  Description: Update the toogleAllViews Icon
//  arg        : mode - 0 min, else max
//
function toggleAllViewsIcon(mode)
{
    //  Update image
    //      images/btn_min.gif 
    var f = document.getElementById('cb_minall');
    if (mode ) {
        f.src = 'images/btn_max.gif';
    } else {
        f.src = 'images/btn_min.gif';
    }
}


///////////////////////////////////////////////
//  Function:    toggleAllViews
//  Description: Hide/Show all the expanded views
//               Will not change the saved list, just the current display
//
function toggleAllViews()
{
    var dmatch, dset;
    openingAllViews = 0;

    //  Update the icon image
    var f = document.getElementById('cb_minall');
    if (f.src.indexOf('min.gif') >= 0) {
        f.src = 'images/btn_max.gif';
        dmatch = 'block';
        dset = 'none';
    } else {
        f.src = 'images/btn_min.gif';
        dmatch = 'none';
        dset = 'block';
    }

    //  Locate first/next view to be toggled
    var divs = document.getElementsByTagName("div");
    for (var i=0;i<divs.length;i++) {
        var el = divs[i]; 
        var id = el.id;
        if (id.indexOf("ENVDIV") == 0)
        {
            if (el.innerHTML.indexOf('<%=enumLOADING%>') == -1) {
                var rowId = id.substr(6);
                if (el && el.style.display == dmatch ) {
                    el.style.display = dset;
                }
            }
        }
    }
}

function UpdateViewHeader(rowId, show)
{
    if ( show )
    {
       // View is currently minimised
       MM_findObj( 'ENVIMG'+ rowId ).src = 'images/btn_max.gif';
       MM_findObj( 'SPANVIEW'+ rowId ).style.color = '#808080';
       MM_findObj( 'ENVDIV'+ rowId ).style.display = 'none';
    }
    else
    {
       // View is currently maximised
       MM_findObj( 'ENVIMG'+ rowId ).src = 'images/btn_min.gif';
       MM_findObj( 'SPANVIEW'+ rowId ).style.color = '#000000';
       MM_findObj( 'ENVDIV'+ rowId ).style.display = 'block';
    }
}

///////////////////////////////////////////////
//  Function:       RequestViewContent    
//  Description:    Maintain view content
//                  If View Tab is unpopulated - then populate it
//                  if View Tab is populated - then Minimise it
//  Arguments:      rowId   - Id if Row to Fetch
//
function RequestViewContent( rowId ){
   var requestURL = 'RequestViewContent.asp';
   var paramString = '?envtab=<%=nEnvTab%>&rtag_id=<%=parRtag_id%>&script_name=<%=ScriptName%>&view_id=' + rowId;

   // Change display states
   if ( (MM_findObj( 'ENVIMG'+ rowId ).src).indexOf('btn_max.gif') == -1 )
   {
      // View is currently minimised
      UpdateViewHeader(rowId, 1);    

      // Remove from SHow View List
      RemoveFromShowView ( rowId );
   }
   else
   {
      // View is currently maximised
      UpdateViewHeader(rowId, 0);
      
      // Add it to Show view id
      AddToShowView ( rowId );
   }

   // Fix div width for ie so it does not overflow
   if (is_ie)
   {
      MM_findObj( 'ENVDIV'+ rowId ).style.width = '100%';
   }

   // Set ajax divname
   ajaxdivname = 'ENVDIV'+ rowId;

   // Request data from server
   if ( (MM_findObj( ajaxdivname ).innerHTML).indexOf('<%=enumLOADING%>') != -1 )
   {
      //Append the name to search for to the requestURL
      var url = requestURL + paramString;

      //Create the xmlHttp object to use in the request
      //stateChangeHandler will fire when the state has changed, i.e. data is received back
      // This is non-blocking (asynchronous)
      xmlHttp = GetXmlHttpObject(stateChangeHandler);

      //Send the xmlHttp get to the specified url
      xmlHttp_Get(xmlHttp, url);
   }
}

function GetXmlHttpObject(handler) {
   var objXmlHttp = null;    //Holds the local xmlHTTP object instance

   //Depending on the browser, try to create the xmlHttp object
   if (is_ie){
      //The object to create depends on version of IE
      //If it isn't ie5, then default to the Msxml2.XMLHTTP object
      var strObjName = (is_ie5) ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP';

      //Attempt to create the object
      try{
         objXmlHttp = new ActiveXObject(strObjName);
         objXmlHttp.onreadystatechange = handler;
      }
      catch(e){
      //Object creation errored
         alert('IE detected, but object could not be created. Verify that active scripting and activeX controls are enabled');
         return;
      }
   }
   else if (is_opera){
      //Opera has some issues with xmlHttp object functionality
      alert('Opera detected. The page may not behave as expected.');
      return;
   }
   else{
      // Mozilla | Netscape | Safari
      objXmlHttp = new XMLHttpRequest();
      objXmlHttp.onload = handler;
      objXmlHttp.onerror = handler;
   }

   //Return the instantiated object
   return objXmlHttp;
}

//stateChangeHandler will fire when the state has changed, i.e. data is received back
// This is non-blocking (asynchronous)
function stateChangeHandler()
{
   //readyState of 4 or 'complete' represents that data has been returned
   if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete'){
      //Gather the results from the callback
      var str = xmlHttp.responseText;

      //Populate the innerHTML of the div with the results
      document.getElementById(ajaxdivname).innerHTML = str;
   }

   //Cascade view opening
   if (openingAllViews) {
       openAllViews();
   }
}

// XMLHttp send GET request
function xmlHttp_Get(xmlhttp, url) {
   //Getting a permissions error here? Check the url string to
   // ensure it is accurate (defined above)
   xmlhttp.open('GET', url, true);
   xmlhttp.send(null);
}



function RemoveFromShowView ( ViewId )
{
   // Get current cookie settings
   var us = GetCookie('<%=COOKIE_RELMGR_SHOW_VIEW%>');
   var aShowViews = new Array();

   if (us)
   {
      // Cookie is not empty, hence just append new value
      var aViews = us.split(',');

      // Make sure that view is not already on the list
      for (i=0; i<aViews.length; i++)
      {
         if (aViews[i] != ViewId)
         {
            aShowViews.push(aViews[i]);
         }
      }

      // Make a new view list to be stored in cookie
      us = aShowViews.join(',');
   }
   else
   {
      us = '';
   }

   // Store to cookie
   document.cookie = '<%=COOKIE_RELMGR_SHOW_VIEW%>' + '=' + us;
}

function AddToShowView ( ViewId )
{
   // Get current cookie settings
   var us = GetCookie('<%=COOKIE_RELMGR_SHOW_VIEW%>');
   var aShowViews = new Array();

   //Release Manager Cookie Available on Show View
   if ( us )
   {
      // Cookie is not empty, hence just append new value
      var aViews = us.split(',');

      // Make sure that view is not already on the list
      for (i=0; i<aViews.length; i++)
      {
         if (aViews[i] != ViewId)
         {
            aShowViews.push(aViews[i]);
         }
      }

      // Make a new view list to be stored in cookie
      us = aShowViews.join(',') + ',' + ViewId;
   }
   else//Release Manager Cookie Not Available on Show View
   {
      // Cookie is empty, just add this value
      us = ViewId;

   }

   // Store to cookie
   document.cookie = '<%=COOKIE_RELMGR_SHOW_VIEW%>' + '=' + us;
}
<%If parRtag_id <> "" Then %>
//  Load dialog to add an SDK to the Release
function addSdk()
{
    $('#popmenu').load('_wform_reference_sdk.asp', {rtag_id : <%=parRtag_id%>});
}
<%End If %>

//-->
</script>

<%
'------------------------------------------------------------------------------------------------------------------------------------------------
Function GetEnvTab ( sEnvTab )
'   rmDebug = rmDebug & "Cookie[" & Request.Cookies(COOKIE_RELEASEMANAGER_MEMORY) &"] "
'   rmDebug = rmDebug & ", Arg[" & sEnvTab & "] "
   If sEnvTab <> "" Then
      GetEnvTab = sEnvTab
      Response.Cookies(COOKIE_RELEASEMANAGER_MEMORY)("envtab") = sEnvTab
   Else
      If Request.Cookies(COOKIE_RELEASEMANAGER_MEMORY)("envtab") <> "" Then
         GetEnvTab = Request.Cookies(COOKIE_RELEASEMANAGER_MEMORY)("envtab")
      Else
         GetEnvTab = enumENVTAB_WORK_IN_PROGRESS
         Response.Cookies(COOKIE_RELEASEMANAGER_MEMORY)("envtab") = enumENVTAB_WORK_IN_PROGRESS
      End If
   End If
'   rmDebug = rmDebug & ", GetEnvTab:" & GetEnvTab
End Function
'------------------------------------------------------------------------------------------------------------------------------------------------
Sub Display_Env_BaseView ( NNbase_view_id, SSbase_view, BBviewCollapsed, SScontents )
%>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
   <tr>
      <td width="1" align="left" valign="top" bgcolor="#dad7c8"><img src="images/p_ctl.gif" width="3" height="3"></td>
      <td width="100%" bgcolor="#dad7c8"><img src="images/spacer.gif" width="1" height="1"></td>
      <td width="1" bgcolor="#dad7c8"><img src="images/spacer.gif" width="1" height="1"></td>
      <td width="1" align="right" valign="top" bgcolor="#dad7c8"><img src="images/p_ctr.gif" width="3" height="3"></td>
   </tr>
   <tr>
      <td align="left" valign="top" bgcolor="#dad7c8">&nbsp;</td>
      <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>
      <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>
      <td align="right" valign="top" bgcolor="#dad7c8">&nbsp;</td>
   </tr>
</table>
<DIV id="ENVDIV<%=NNbase_view_id%>" class="envContent" <%If BBviewCollapsed Then %>style="display:none;"<%Else%>style="display:block;"<%End If%>>
   <%If NOT BBviewCollapsed Then %>
      <%=SScontents%>
   <%Else%>
      <%=enumLOADING%>
   <%End If%>
</DIV>
<br>
<%
End Sub
'------------------------------------------------------------------------------------------------------------------------------------------------
' Name: Print_View
' Desc: Generate the Grouped Package list
Sub Print_View( NNEnvTab, SSviewtype, NNrtag_id, SSshowviews, NNuser_id )
   Dim rsView, Query_String
   'Dim btn1
   Dim tmpURL
   Dim SSscript
   Dim qstrPar
   Dim nViewType
   Dim nTrueRecordCount
   Dim nOperation
   Dim relContentsSTR, viewCollapsed, curr_view_id, view_name
   Dim canBeEmpty

   If isDefined("allowNoPackage") Then
      SSscript = "dependencies.asp"
   Else
      SSscript = scriptName
   End If

   If SSviewtype = "guest" Then
      nViewType = 1
      qstrPar = "Bshow"
   ElseIf SSviewtype = "personal" Then
      nViewType = 2
      qstrPar = "Pshow"
   End If
   canBeEmpty = false

'rmDebug = rmDebug & " ,NNEnvTab[" & NNEnvTab & "," & CInt(NNEnvTab) & "]"
   OraDatabase.Parameters.Add "VIEW_TYPE",           nViewType, ORAPARM_INPUT, ORATYPE_NUMBER
   'OraDatabase.Parameters.Add "VIEW_ID_SHOW_LIST",   ShowView( Pipes2Commas( SSshowviews ), SSviewtype ), ORAPARM_INPUT, ORATYPE_VARCHAR2
   OraDatabase.Parameters.Add "VIEW_ID_SHOW_LIST",   GetShowViewList(), ORAPARM_INPUT, ORATYPE_VARCHAR2
   OraDatabase.Parameters.Add "RTAG_ID",             NNrtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "USER_ID",             NNuser_id, ORAPARM_INPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "TRUE_RECORD_COUNT",   NULL, ORAPARM_OUTPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "RECORD_SET",          NULL, ORAPARM_OUTPUT, ORATYPE_CURSOR

   'If it's a Deployment View
   If parDview = "enable" Then
      ' Decide which environment list is to be displayed to the Integrators/Testers
      Select Case CInt( NNEnvTab )
         Case enumENVTAB_PRODRELEASE
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_PRODRELEASE_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"

         Case enumENVTAB_INTEGRATE
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_INTEGRATION_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"

         Case enumENVTAB_TEST
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_TEST_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"

         Case enumENVTAB_DEPLOY
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_DEPLOY_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"

         Case enumENVTAB_REJECT
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_REJECT_ITEMS ( :RTAG_ID, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"

      End Select

   Else
      ' Decide which environment list is to be displayed
      Select Case CInt( NNEnvTab )
         Case enumENVTAB_WORK_IN_PROGRESS
            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;"
            canBeEmpty = true

         Case enumENVTAB_PLANNED
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_PENDING_ITEMS ( :VIEW_TYPE, :USER_ID, :RTAG_ID, :VIEW_ID_SHOW_LIST, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"
            canBeEmpty = true

         Case enumENVTAB_RELEASED
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_RELEASED_ITEMS ( :VIEW_TYPE, :USER_ID, :RTAG_ID, :VIEW_ID_SHOW_LIST, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"

         Case Else
            OraDatabase.ExecuteSQL "BEGIN  PK_ENVIRONMENT.GET_ENVIRONMENT_ITEMS ( :VIEW_TYPE, :USER_ID, :RTAG_ID, :VIEW_ID_SHOW_LIST, :TRUE_RECORD_COUNT, :RECORD_SET );  END;"

      End Select

   End If

   ' Get Record set from database
   Set rsView = OraDatabase.Parameters("RECORD_SET").Value
   nTrueRecordCount = OraDatabase.Parameters("TRUE_RECORD_COUNT").Value

   OraDatabase.Parameters.Remove "RTAG_ID"
   OraDatabase.Parameters.Remove "USER_ID"
   OraDatabase.Parameters.Remove "VIEW_TYPE"
   OraDatabase.Parameters.Remove "VIEW_ID_SHOW_LIST"
   OraDatabase.Parameters.Remove "RECORD_SET"
   OraDatabase.Parameters.Remove "TRUE_RECORD_COUNT"

   ' Initialise variables
   If ((NOT rsView.BOF) AND (NOT rsView.EOF)) Then
      relContentsSTR = ""
      viewCollapsed = FALSE
      curr_view_id = rsView("view_id")      ' Set current view
      view_name = rsView("view_name")
   End If

   While ((NOT rsView.BOF) AND (NOT rsView.EOF))
      '==== Get View Contents ====
      If NOT IsNull(rsView.Fields("pv_id")) Then
         tmpURL = SSscript &"?pv_id="& rsView.Fields("pv_id") &"&rtag_id="& parRtag_id
         IMG_locked = ""
         If rsView.Fields("dlocked") = "Y" Then IMG_locked = imgLocked

         ' DEVI-45275 - Normally, dlocked=Y items are denoted with a padlock icon on the web page. Since we can now merge
         ' into the pending tab, the dlocked=Y items that end up there would not give any visual indication to the user
         ' as to why they are present. So, instead of the padlock icon, display the added or removed icon to indicate
         ' what the intended action is to be, once the pending item is approved.
         ' Obviously, this functionality does not apply if we are in the deployment view, and only applies if viewing
         ' the PENDING or ALL environment tabs.
         ' With regard to the operation value, A = Added, S = Subtracted
         nOperation = " "
         If parDview <> "enable" AND (CInt( NNEnvTab ) = enumENVTAB_PLANNED OR CInt( NNEnvTab ) = enumENVTAB_ALL) Then
            nOperation = rsView.Fields("operation")   ' NB. this field is only availble if earlier query was GET_PENDING_ITEMS or GET_ENVIRONMENT_ITEMS
            If nOperation = "A" Then
               IMG_locked = imgAdded
            ElseIf nOperation = "S" Then
               IMG_locked = imgRemoved
            End If
         End If

         relContentsSTR = relContentsSTR & "<tr>" & VBNewLine

         If rsView("pkg_state") = 0 And rsView.Fields("deprecated_state") <> "" Then
            relContentsSTR = relContentsSTR & "  <td width='1%'>"& DefineStateIcon ( rsView.Fields("deprecated_state"), rsView("dlocked"), NULL, NULL, pkgInfoHash.Item("build_type"), TRUE ) &"</td>"& VBNewLine
         Else
            If (parDview <> "enable") AND ( ( CInt(NNEnvTab) = enumENVTAB_PLANNED ) OR ( Request("envtab") = enumENVTAB_PLANNED ) ) Then

               ' if package version is unlocked, rejected, or pending approval, or is to be added/subtracted to/from the release (DEVI-45275), then
               If (rsView("dlocked") = "N") OR (rsView("dlocked") = "R") OR (rsView("dlocked") = "P") OR (nOperation = "A") OR (nOperation = "S") Then
                  checked = NULL
                  disabled = NULL
                  ' disable check box if not logged in, or if not in open mode and user has no permission to approve pending
                  If objAccessControl.UserLogedIn Then
                     If ( ReleaseMode <> enumDB_RELEASE_IN_OPEN_MODE ) Then
                        If NOT canActionControlInProject("ApproveForAutoBuild") Then
                           disabled = "disabled"
                        End If
                     End If
                  Else
                     disabled = "disabled"
                  End If

               Else ' always check and disable the checkbox
                  checked = "checked"
                  disabled = "disabled"
               End If

               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
            Else
               relContentsSTR = relContentsSTR & " <td width='1%'>" & DefineStateIcon ( rsView("pkg_state"), rsView("dlocked"), NULL, NULL, pkgInfoHash.Item("build_type"), TRUE ) &"</td>"& VBNewLine
            End If
         End If

         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
         relContentsSTR = relContentsSTR & "  <td width='1%' nowrap class='envPkg'>"& rsView.Fields("pkg_version") &"</td>" & VBNewLine
         relContentsSTR = relContentsSTR & "  <td width='1%'>"& IMG_locked &"</td>"
         relContentsSTR = relContentsSTR & "</tr>" & VBNewLine
      Else
         'relContentsSTR = relContentsSTR & "<tr><td><label class='form_txt' disabled>...</label></td></tr>"      ' Collapsed view displays dots

         viewCollapsed = TRUE
      End If

      rsView.MoveNext

      If ((NOT rsView.BOF) AND (NOT rsView.EOF)) Then
         ' NOT end of the record set
         If curr_view_id <> rsView("view_id") Then
            '====== Draw buttons =================================
            'If InStrPipes( SSshowviews, curr_view_id ) Then
            '   btn1 = "<a href='"& SSscript &"?"& qstrPar &"="& RemoveFromStrPipes( SSshowviews, curr_view_id ) &"&pv_id="& Request("pv_id") &"&rtag_id="& NNrtag_id &"' >"& imgMinimise &"</a>"
            'Else
            '   btn1 = "<a href='"& SSscript &"?"& qstrPar &"=|"& curr_view_id &"|"& SSshowviews &"&pv_id="& Request("pv_id") &"&rtag_id="& NNrtag_id &"'>"& imgMaximise &"</a>"
            'End If

            '====== Print contents ===============================
            relContentsSTR = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>" & relContentsSTR & "</table>"
            Call Display_Env_BaseView ( curr_view_id, view_name, viewCollapsed, relContentsSTR )

            curr_view_id = rsView("view_id")
            view_name = rsView("view_name")
            relContentsSTR = ""      ' Empty the contents string
            viewCollapsed = FALSE
         End If

      Else
         ' End of the record set

         '====== Draw buttons =================================
         'If InStrPipes( SSshowviews, curr_view_id ) Then
         '   btn1 = "<a href='"& SSscript &"?"& qstrPar &"="& RemoveFromStrPipes( SSshowviews, curr_view_id ) &"&pv_id="& Request("pv_id") &"&rtag_id="& NNrtag_id &"' >"& imgMinimise &"</a>"
         'Else
         '   btn1 = "<a href='"& SSscript &"?"& qstrPar &"=|"& curr_view_id &"|"& SSshowviews &"&pv_id="& Request("pv_id") &"&rtag_id="& NNrtag_id &"'>"& imgMaximise &"</a>"
         'End If

         '====== Print contents ===============================
         relContentsSTR = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>" & relContentsSTR & "</table>"
         Call Display_Env_BaseView ( curr_view_id, view_name, viewCollapsed, relContentsSTR )

      End If

   WEnd

   If relContentsSTR <> "" Then
      Response.write "<a href='help/icons_F017.asp' target='_blank' class='body_scol'>Icon Legend...</a><br>"
   End If

   If nTrueRecordCount > 0 Then
      If rsView.RecordCount < 1 Then
         'If qstrPar = "Bshow" Then
         '   'Release is empty. Draw default box for Base view
         '   Call DisplayInfo ( "EMPTY_RELEASE_CONTENTS", "100%" )
         '
         'End If

         If qstrPar = "Pshow" AND hasPview AND NOT canBeEmpty Then
            'Release is empty. Draw default box for Personal view
            Call DisplayInfo ( "PERSONAL_VIEW_NOT_SETUP", "100%" )
         End If

      End If
   End If

   ' Destroy
   rsView.Close
   Set rsView = nothing
End Sub
'------------------------------------------------------------------------------------------------------------------------------------------------
' Detect the presence of a Personal View so that the controls can be disabled if the user does
' not have any.
'
Function hasPersonalViews ( )
   Dim rsTemp, Query_String
   hasPersonalViews = false

   If objAccessControl.UserLogedIn Then
       Query_String = "select count(*) from views where owner_id = " & objAccessControl.UserId

       Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
       If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
          If  rsTemp.Fields(0) > 0 Then
              hasPersonalViews = true
          End If
       End If
     
       rsTemp.Close
       Set rsTemp = nothing
   End If
End Function

'------------------------------------------------------------------------------------------------------------------------------------------------
Function GetShowViewList ()
   'If SSparshow <> "" Then
   '   ' get list from query string
   '   ShowView = SSparshow
   'ElseIf Request.Cookies("RELEASEMANAGER_VIEW_SHOW")( SSviewtype ) <> "" Then
   '   ' get list from cookie
   '   ShowView = Request.Cookies("RELEASEMANAGER_VIEW_SHOW")( SSviewtype )
   'Else
   '   ' no list i.e. collapse all views
   '   ShowView = -1
   'End If

   'If oShowView.Count = 0 Then
   '   GetShowViewList = -1
   'Else
   '   GetShowViewList = Join( oShowView.Keys, "," )
   'End If

   If Request.Cookies(COOKIE_RELMGR_SHOW_VIEW) = "" Then
      GetShowViewList = -1
   Else
      GetShowViewList = Request.Cookies(COOKIE_RELMGR_SHOW_VIEW)
   End If

End Function

'------------------------------------------------------------------------------------------------------------------------------------------------
' 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.
' 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
' as yet, unknown reason).
'
Function RefreshedURL(NNdview, NNpview, NNpv_id, NNrtag_id)
   Dim url

   url = scriptName & "?Dview=" & NNdview & "&Pview=" & NNpview

   If NNpv_id Then
      url = url & "&pv_id=" & NNpv_id
   End If

   url = url & "&rtag_id=" & NNrtag_id

   RefreshedURL = url
End Function


'------------------------------------------------------------------------------------------------------------------------------------------------
%>
<%

'------------------------- MAIN LINE ---------------------------
%>

<%If parRtag_Id <> "" Then%>
<!-- RELEASE ACTION BUTTONS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

   <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
         <td width="1" background="images/bg_action_norm.gif"><img src="images/spacer.gif" width="10" height="35"></td>
         <td width="100%" nowrap background="images/bg_action_norm.gif" >
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
               <tr>
                  <%
                  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
                     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>"
                  Else
                     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>"
                  End If

                  If (pkgInfoHash.Item("dlocked") <> "Y") AND (Request("pv_id") <> "") Then
                     If  (objAccessControl.UserLogedIn) AND ( (objAccessControl.UserName = pkgInfoHash.Item("creator")) OR (canActionControlInProject("DestroyPackageFromRelease")) ) Then
                        Response.write "<td width='1'><a href='javascript:;' title='Destroy the selected Package Version' onClick='destroyPackageVersion();'><img src='icons/i_destroy_package.gif' alt='Destroy the selected Package Version' width='26' height='26' hspace='1' border='0'></td>"
                     Else
                        Response.write "<td width='1'><img title='Destroy the selected Package Version' src='icons/i_destroy_package_off.gif' alt='Destroy the selected Package Version' width='26' height='26' hspace='1' border='0'></td>"
                     End If
                  End If

                   ' Anybody can view properties
                   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>"

                  Response.write "<td width='1'><img src='images/spacer.gif' width='7' height='25'></td>"
                  If objAccessControl.UserLogedIn Then
                      If hasPview Then
                         If parPview = "disable" Then
                            Dim ref : ref = RefreshedURL(parDview, "", Request("pv_id"), Request("rtag_id"))
                            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>"
                         Else
                            ref = RefreshedURL(parDview, "disable", Request("pv_id"), Request("rtag_id")) 
                            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>"
                         End If
                      Else
                            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>"
                      End If
                  Else
                     Response.write "<td width='1'><img src='images/abtn_personal_view_off.gif' width='26' height='26' hspace='1' border='0'></td>"
                  End If

                  If parDview = "enable" Then
                     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>"
                  Else
                     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>"
                  End If

                  Response.write "<td width='1'><img src='images/spacer.gif' width='7' height='25'></td>"

                  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>"

                  Response.write "<td width='1'><img src='images/spacer.gif' width='7' height='25'></td>"

                  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>"

                  If ( (parDview <> "enable") AND ( (CInt(nEnvTab) = enumENVTAB_PLANNED) OR (Request("envtab") = enumENVTAB_PLANNED) ) ) Then
                     If objAccessControl.UserLogedIn Then
                        If ( ReleaseMode = enumDB_RELEASE_IN_OPEN_MODE ) OR _
                                canActionControlInProject("ApproveForAutoBuild") OR _
                                canActionControlInProject("ApproveForManualBuild") Then
                              Response.write "<td width='1'><a href='#' onClick='makeBulkRelease();'><img src='images/abtn_make_release_bulk.gif' title='Make Bulk Release...'></td>"
                              Response.write "<td width='1'><img src='images/spacer.gif' width='1' height='25'></td>"
                              Response.write "<td width='1'><a href='#' onClick='makeBulkReject();'><img src='images/abtn_make_bulk_remove.gif' title='Bulk Reject...'></td>"
                        End If
                     End If
                  End If
                  %>
                  <td width="100%"><img src="images/spacer.gif" width="1" height="1"></td>
               </tr>
            </table>
         </td>
         <td width="1" background="images/bg_action_norm.gif"><img src="images/spacer.gif" width="10" height="8"></td>
      </tr>
   </table>

<!-- ADVANCED SEARCH ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
   <DIV name="DIV_ADVANCED_SEARCH" id="DIV_ADVANCED_SEARCH" style="display:none;">
      <table width="100%" border="0" cellspacing="0" cellpadding="10">
         <form name="advancedsearch" method="get" action="find.asp">
            <tr>
               <td nowrap  class="form_txt" valign="middle">
                  <%
                  Dim FindPackageCheck, FindFileCheck

                  FindPackageCheck = ""
                  FindFileCheck = ""

                  If Request("searchtype") = "2" Then
                     FindFileCheck = "checked"
                  Else
                     FindPackageCheck = "checked"
                  End If

                  %>
                  <fieldset>
                     <legend class="body_colb"><img src="images/i_mglass.gif" width="17" height="17" border="0" align="absmiddle">&nbsp;Advanced Search</legend>
                     <input name="searchtype" id="searchtype1" type="radio" value="1" <%=FindPackageCheck%>>
                     <a href="javascript:;" onClick="MM_findObj('searchtype1').checked=true;" class="body_txt">Find a Package</a><br>
                     <input name="searchtype" id="searchtype2" type="radio" value="2" <%=FindFileCheck%>>
                     <a href="javascript:;" onClick="MM_findObj('searchtype2').checked=true;" class="body_txt">Find a File</a><br><br>
                     <%If CInt(nEnvTab) = enumENVTAB_WORK_IN_PROGRESS Then%>
                        Find in Work In Progress<br>
                     <%ElseIf CInt(nEnvTab) = enumENVTAB_PLANNED Then%>
                        Find in Pending<br>
                     <%ElseIf  CInt(nEnvTab) = enumENVTAB_RELEASED Then%>
                        Find in Released<br>
                     <%End If%>
                     <input type="text" name="keyword" size="25" class="form_ivaluew" value="<%=Request("keyword")%>">
                     <input type="submit" name="btn" value="Find" class="form_ivalue">

                     <input type="hidden" name="envtab" value="<%=nEnvTab%>">
                     <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
                  </fieldset>
                  <br>
               </td>
            </tr>
         </form>
      </table>
   </DIV>

   <script language="JavaScript" type="text/javascript">
      <!--
      function ToggleAdvancedSearch( )
      {
         if ( MM_findObj("DIV_ADVANCED_SEARCH").style.display == 'none')
         {
            MM_findObj("DIV_ADVANCED_SEARCH").style.display = 'block';
            MM_findObj("SPAN_ADVANCED_SEARCH").style.display = 'none';
            MM_findObj("SPAN_ADVANCED_SEARCH_ON").style.display = 'block';
         }
         else
         {
            MM_findObj("DIV_ADVANCED_SEARCH").style.display = 'none';
            MM_findObj("SPAN_ADVANCED_SEARCH").style.display = 'block';
            MM_findObj("SPAN_ADVANCED_SEARCH_ON").style.display = 'none';
         }

         document.cookie = 'RELMGR_DIV_ADVANCED_SEARCH' + '=' + MM_findObj("DIV_ADVANCED_SEARCH").style.display;
      }

      // Run this on page render for default setting
      if (GetCookie('RELMGR_DIV_ADVANCED_SEARCH') == 'block')
      {
         ToggleAdvancedSearch();
      }

   //-->
   </script>
<!-- RELEASE SDK  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
   <DIV name="DIV_RELEASE_SDK" id="DIV_RELEASE_SDK" <%=iif(isDefined("showReleaseSdk"),"","style='display:none;'")%>>
      <table width="100%" border="0" cellspacing="0" cellpadding="10">
         <form name="RelSdk" method="get" action="sdk_remove_release.asp" onSubmit="$('#RelSdkProgressBar').toggle()">
            <tr>
               <td width="100%" nowrap class="form_txt">
                  <fieldset>
                     <legend class="body_colb"><img src="images/i_releaseref.gif" border="0" align="absmiddle">&nbsp;Release SDK</legend>
                     <div>
                         <%If (ReleaseMode = enumDB_RELEASE_IN_OPEN_MODE) Then%>
                            <button <%=controlDisabledInProject("AddSdk")%> onClick="addSdk(); return false;" class="rmbutton">Add ...</button>
                            &nbsp;<button  <%=controlDisabledInProject("RemoveSdk")%> class="rmbutton">Remove</button>
                         <%End If%>
                         <span id="RelSdkProgressBar" name="RelRefProgressBar" style="display:none;" class="class="body_scol"">
                            <img src="images/i_processing.gif" width="11" height="17" align="absmiddle" hspace="3">Processing...
                         </span>
                         <p>
                         <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
                     </div>

                     <table width="100%" border="0" cellspacing="0" cellpadding="1">
                        <tr>
                           <td bgcolor="#999999">

                              <table width="100%" border="0" cellspacing="0" cellpadding="1">
                                 <%
                                 OraDatabase.Parameters.Add "RTAG_ID", parRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
                                 Set rsEnvQry = OraDatabase.DbCreateDynaset( GetQuery("ReleaseSdks.sql"), 0 )
                                 OraDatabase.Parameters.Remove "RTAG_ID"
                                 %>
                                 <%If rsEnvQry.RecordCount = 0 Then%>
                                 <tr>
                                    <td colspan="2" bgcolor="#FFFFFF" class="body_txt_gray">
                                       No SDKs used.
                                    </td>
                                 </tr>
                                 <%End If%>

                                 <%While (NOT rsEnvQry.EOF) AND (NOT rsEnvQry.BOF)%>
                                    <tr>
                                       <td bgcolor="#FFFFFF" class="body_txt" width="1%"><input type="checkbox" name="sdktag_id" value="<%=rsEnvQry("SDKTAG_ID")%>"></td>
                                       <td bgcolor="#FFFFFF" class="body_txt" nowrap>
                                        <span title="<%=HTMLEncode(rsEnvQry("SDK_COMMENT"))%>">
                                            <%=rsEnvQry("SDK_NAME")%>
                                        </span>
                                        &nbsp;&gt;&nbsp;
                                        <span title="<%=HTMLEncode(rsEnvQry("DESCRIPTION"))%>">
                                            <%=rsEnvQry("SDKTAG_NAME")%>
                                        </span>
                                        </td>
                                    </tr>
                                    <%rsEnvQry.MoveNext()
                                 WEnd%>
                                 <tr>
                                    <td colspan="2" bgcolor="#FFFFFF" class="body_txt_gray">
                                       <br><br><br>
                                    </td>
                                 </tr>
                              </table>
                           </td>
                        </tr>
                     </table>
                  </fieldset>
                  <br>
               </td>
            </tr>
         </form>
      </table>
   </DIV>
<!-- END OF RELEASE SDK  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<!-- PACKAGE LIST ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
   <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();">
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
            <td width="1" bgcolor="#999999"><img src="images/spacer.gif" width="10" height="25"></td>
            <td width="100%" bgcolor="#999999" valign="bottom">
               <!-- TAB CONTROLS ++++++++++++++++++++++ -->
               <%
               Set objTabControl = New TabControl
               objTabControl.TemplateDoc = ReadFile( Server.MapPath("controls/ERGTabStyleDreamWeaver/dreamweaver_style.html") ) ' Supply tab style definition
               objTabControl.TabStyle = "StyleDreamWeaver"
               If   parDview = "enable"   Then
                  objTabControl.AddTabDefnition ( arrProductEnv )   '-   Integration/Test/Deploy
               Else
                  objTabControl.AddTabDefnition ( arrEnv )
               End If
               objTabControl.SelectByIndex ( nEnvTab )
               objTabControl.Render ()
               %>
               <!-- END OF TAB CONTROLS +++++++++++++++ -->
            </td>
            <td width="1" bgcolor="#999999"><img src="images/spacer.gif" width="10" height="1"></td>
         </tr>
         <tr>
            <td></td>
            <td>
               <!-- BULK OPR CONTROLS ++++++++++++++++++++++ -->
                <%Dim cb_selectall_display, cb_disabled
                  If nEnvTab <> 1 Then cb_selectall_display = " style=display:none"
                  If NOT objAccessControl.UserLogedIn Then cb_disabled = " disabled"%>
                <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;">
                <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>
                <a href="javascript:;" title="Close Populated Views" onclick="closeAllViews();"><img src="images/btn_remove.gif" style="float: right;position: relative;left: -4;"></a>
                <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>
               <!-- END BULK OPR CONTROLS ++++++++++++++++++++++ -->
               <%
               Dim tempTimer
               tempTimer = Timer
               %>
               <%'Response.write "TOTAL TIME: "&  Timer - tempTimer%>
               <%

               '--- Render Environment ---
               If objAccessControl.UserLogedIn AND (parPview <> "disable") Then
                  'Personal View
                  Call Print_View( nEnvTab, "personal", parRtag_id, parPshow, objAccessControl.UserId )
               Else
                  ' Guest view
                  Call Print_View( nEnvTab, "guest", parRtag_id, parBshow, empty )
               End If
               %>

               <%'Response.write "TOTAL TIME: "&  Timer - tempTimer%>
               <br>
            </td>
            <td></td>
         </tr>
       </table>
   </form>
   <!-- <input type="hidden" name="pv_id_list" value=<%=Request("pv_id_list")%>> -->
<!--END OF PACKAGE LIST ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<%End If%>