Subversion Repositories DevTools

Rev

Rev 2365 | Blame | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                       DIFF                        |
'|                                                   |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0   ' always load the page, dont store
%>

<%
'To enable the script timeout to 20 mins
Server.ScriptTimeout=1200
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/common_dbedit.asp"-->
<!--#include file="common/_form_window_common.asp"-->
<!--#include file="common/_rtree_common.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim rsQry
Dim objRelCollectorA
Dim objRelCollectorB
Dim parRtagA
Dim parRtagB
Dim dDiffFilter
Dim colorA, colorB, ChangeTypeIcon
Dim btnMerge, btnRemove
Dim rowId
Dim email
Dim FSO
Dim NewTextFile
Dim pkgA, pkgB, pkgname, delimiter, rsQryA, rsQryB, rsQryCommentsA, rsQryCommentsB, sqlstrA, counterA, sqlstrB, counterB
Dim SSsql, retVal, rsCQ, DEVIiss, TDSEiss, VT5DMiss, VTSUPiss
Dim a, b, c, d, pkgversion, errormsg, source_change, ChangeASource, ChangeAUpdate, ChangeBSource, ChangeBUpdate, pvCollectionA, pvCollectionB
Dim changeType
Dim pendingAdditions

'------------ Constants Declaration -----------
Const LIMG_UPDATED = "<img src='images/i_updated.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='Updated'>"
Const LIMG_RIPPLED = "<img src='images/i_rippled.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='Rippled'>"
Const LIMG_ADDED = "<img src='images/i_added.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='Added'>"
Const LIMG_REMOVED = "<img src='images/i_removed.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='Removed'>"
Const LIMG_FILTER_ON = "<img src='images/i_data_table.gif' border='0' align='absmiddle' hspace='0' title='Filter in use.'>"
Const LIMG_FILTER_OFF = "<img src='images/i_data_table_off.gif' border='0' align='absmiddle' hspace='0' title='Filter not in use.'>"
Const LIMG_DROP_DOWN_ARROW = "<img src='images/i_drop_down_arrow.gif' width='5' height='15' hspace='1' border='0' align='absmiddle'>"
Const LCOLOR_NOT_CHANGED = "#F5F5F5"
Const LCOLOR_CHANGED = "#d2f7c9"
Const LCOLOR_RIPPLED = "#D8F8F8"
Const LCOLOR_BLANK = "#FFFFFF"
Const LIMG_MERGE = "<img src='images/bt_move_all_right.gif' title='Click to merge.' border='0'>"
Const LIMG_MERGE_WARN = "<img src='images/bt_move_warn_right.gif' title='Right hand side version is newer.' border='0'>"
Const LIMG_REMOVE = "<img src='images/bt_remove.gif' title='Remove this version from release.' border='0'>"
Const LIMG_UNDO = "<img src='images/bt_undo.gif' title='Undo merge/remove.' border='0'>"
'------------ Variable Init -------------------
Set rsCQ = Server.CreateObject("ADODB.Recordset")
parRtagA = Request("rtagA")
parRtagB = Request("rtagB")
Set objRelCollectorA = CreateObject("Scripting.Dictionary")
Set objRelCollectorB = CreateObject("Scripting.Dictionary")
Set dDiffFilter = CreateObject("Scripting.Dictionary")
Set pendingAdditions = CreateObject("Scripting.Dictionary")
'----------------------------------------------
If Request("btn") = "Mail Me Report" Then
   email = true
End If
%>
<%
'--------------------------------------------------------------------------------------------------------------------------
Sub GetDiffFilterValues ( outDepFilter )
   Dim FilterVal, aFilterValues

   If Request.Cookies(enum_RELMGR_COOKIE_DOMAIN)(COOKIE_HIDE_DIFF_FILTER) <> "" Then
      aFilterValues = Split( Replace( Request.Cookies(enum_RELMGR_COOKIE_DOMAIN)(COOKIE_HIDE_DIFF_FILTER), " ", ""), ",")

      For Each FilterVal In aFilterValues
         outDepFilter.Item (CStr( FilterVal )) = ""
      Next

   End If

End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub GetFixedIssues(pv_id)
   Set sqlstrA = OraDatabase.DbCreateDynaset("SELECT iss_db, iss_id, iss_state, notes FROM CQ_ISSUES WHERE pv_id="& pv_id &"  AND iss_state = "& enumISSUES_STATE_FIXED, cint(0))

      If sqlstrA.RecordCount <> 0 Then
         NewTextFile.WriteLine()
         NewTextFile.WriteLine("<blockquote><blockquote>Fixed Issues:</blockquote></blockquote>")
      End If

      For counterA=1 to sqlstrA.RecordCount
         DEVIiss = "-1"
         TDSEiss = "-1"
         VT5DMiss = "-1"
         VTSUPiss = "-1"

         If CInt(sqlstrA("iss_db")) = CInt(enumCLEARQUEST_DEVI_ID) Then
            DEVIiss = DEVIiss &","& sqlstrA("iss_id")
         ElseIf CInt(sqlstrA("iss_db")) = CInt(enumCLEARQUEST_TDSE_ID) Then
            TDSEiss = TDSEiss &","& sqlstrA("iss_id")
         ElseIf CInt(sqlstrA("iss_db")) = CInt(enumCLEARQUEST_VT5DM_ID) Then
            VT5DMiss = VT5DMiss &","& sqlstrA("iss_id")
         ElseIf CInt(sqlstrA("iss_db")) = CInt(enumCLEARQUEST_VTSUP_ID) Then
            VTSUPiss = VTSUPiss &","& sqlstrA("iss_id")
         End If

         SSsql = ReadFile( rootPath & "queries\cq_issues.sql" )
         SSsql = Replace( SSsql, "/*enumCLEARQUEST_DEVI_ID*/", enumCLEARQUEST_DEVI_ID)
         SSsql = Replace( SSsql, "/*enumCLEARQUEST_TDSE_ID*/", enumCLEARQUEST_TDSE_ID)
         SSsql = Replace( SSsql, "/*enumCLEARQUEST_VT5DM_ID*/", enumCLEARQUEST_VT5DM_ID)
         SSsql = Replace( SSsql, "/*enumCLEARQUEST_VTSUP_ID*/", enumCLEARQUEST_VTSUP_ID)
         SSsql = Replace( SSsql, "/*DEVIiss*/", DEVIiss)
         SSsql = Replace( SSsql, "/*TDSEiss*/", TDSEiss)
         SSsql = Replace( SSsql, "/*VT5DMiss*/", VT5DMiss)
         SSsql = Replace( SSsql, "/*VTSUPiss*/", VTSUPiss)
         retVal = Get_CQ_Issues ( SSsql, rsCQ )

         If rsCQ("iss_num") <> "" Then
            NewTextFile.Write("<blockquote><blockquote><blockquote>"&rsCQ("iss_num")&": ")
         End If

         If rsCQ("summary") <> "" Then
            NewTextFile.WriteLine(rsCQ("summary")&"</blockquote></blockquote></blockquote>")
         End If

         sqlstrA.MoveNext
      Next
      sqlstrA.Close()
End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub LastPvIdA(a)

   Dim qryA
   Set qryA = OraDatabase.DbCreateDynaset("SELECT LAST_PV_ID FROM PACKAGE_VERSIONS WHERE PV_ID="&a, cint(0))

   'If a <> qryA("last_pv_id") Then
      a = qryA("last_pv_id")
   'Else
   '   errormsg = true
   'End If

   If pvCollectionA.Exists(CStr(a)) Then
      errormsg = true
      Exit Sub
   End If

   qryA.Close()
End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub LastPvIdB(b)
   Dim qryB
   Set qryB = OraDatabase.DbCreateDynaset("SELECT LAST_PV_ID FROM PACKAGE_VERSIONS WHERE PV_ID="&b, cint(0))

   'If b <> qryB("last_pv_id") Then
      b = qryB("last_pv_id")
   'Else
   '   errormsg = true
   'End If

   If pvCollectionB.Exists(CStr(b)) Then
      errormsg = true
      Exit Sub
   End If

   qryB.Close()
End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub pkg_Version(pv)
   Dim qry
   Set qry = OraDatabase.DbCreateDynaset("SELECT PKG_VERSION FROM PACKAGE_VERSIONS WHERE PV_ID="&pv, cint(0))
   pkgversion = qry("pkg_version")
   qry.Close()
End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub LastPvIdAa(a)
   Dim qryA
   Set qryA = OraDatabase.DbCreateDynaset("SELECT LAST_PV_ID FROM PACKAGE_VERSIONS WHERE PV_ID="&a, cint(0))
   c = qryA("last_pv_id")
   qryA.Close()
End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub LastPvIdBb(b)
   Dim qryB
   Set qryB = OraDatabase.DbCreateDynaset("SELECT LAST_PV_ID FROM PACKAGE_VERSIONS WHERE PV_ID="&b, cint(0))
   d = qryB("last_pv_id")
   qryB.Close()
End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub Comments(Pv_Id)
   Dim comments
   Set comments = OraDatabase.DbCreateDynaset("SELECT COMMENTS, PKG_VERSION FROM PACKAGE_VERSIONS WHERE PV_ID="&Pv_id, cint(0))

   If comments("comments") <> "Rippled Build." Then
      NewTextFile.WriteLine("<blockquote><blockquote><font color="&chr(34)&"blue"&chr(34)&">Version: "& comments("pkg_version")&"</font></blockquote></blockquote>")
      If comments("comments") <> "" Then
         NewTextFile.WriteLine("<blockquote><blockquote>Comments: </blockquote></blockquote>")
         NewTextFile.WriteLine("<blockquote><blockquote><blockquote>"& TextToHTML(comments("comments")) &"</blockquote></blockquote></blockquote>")
         source_change = true
      End If
   End If

End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub Release(pvId)
   Dim release
   Set release = OraDatabase.DbCreateDynaset("SELECT INSERT_STAMP FROM RELEASE_CONTENT WHERE PV_ID="&pvId, cint(0))

   If release("insert_stamp") <> "" Then
      NewTextFile.Write(release("insert_stamp"))
   Else
      NewTextFile.Write("Version Not Used.")
   End If

End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub Header()
   NewTextFile.WriteLine("<html>")
End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub Footer()
   NewTextFile.WriteLine("</html>")
End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub Javascript()
   NewTextFile.WriteLine("<script language=""JavaScript"" type=""text/javascript"">")
   NewTextFile.WriteLine("function MM_findObj(n, d) { //v4.0")
   NewTextFile.WriteLine("  var p,i,x;")
   NewTextFile.WriteLine("  if(!d) d=document; ")
   NewTextFile.WriteLine("  if((p=n.indexOf(""?""))>0&&parent.frames.length) {")
   NewTextFile.WriteLine("     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);")
   NewTextFile.WriteLine("  }")
   NewTextFile.WriteLine("  if(!(x=d[n])&&d.all) x=d.all[n]; ")
   NewTextFile.WriteLine("  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];")
   NewTextFile.WriteLine("  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);")
   NewTextFile.WriteLine("  if(!x && document.getElementById) x=document.getElementById(n); ")
   NewTextFile.WriteLine("  return x;")
   NewTextFile.WriteLine("}")
   NewTextFile.WriteLine("function DisplaySPAN(show, x) {")
   NewTextFile.WriteLine("   if (show) {")
   NewTextFile.WriteLine("      MM_findObj(""spanHideDetails"" + x).style.display = ""block"";")
   NewTextFile.WriteLine("      MM_findObj(""spanPkgInfo"" + x).style.display = ""block"";")
   NewTextFile.WriteLine("      MM_findObj(""spanShowDetails"" + x).style.display = ""none"";")
   NewTextFile.WriteLine("   } else {")
   NewTextFile.WriteLine("      MM_findObj(""spanHideDetails"" + x).style.display = ""none"";")
   NewTextFile.WriteLine("      MM_findObj(""spanPkgInfo"" + x).style.display = ""none"";")
   NewTextFile.WriteLine("      MM_findObj(""spanShowDetails"" + x).style.display = ""block"";")
   NewTextFile.WriteLine("   }")
   NewTextFile.WriteLine("}")
   NewTextFile.WriteLine("</script>")
End Sub
'--------------------------------------------------------------------------------------------------------------------------
Function GetIsDiffFilterInUseIcon()
   GetIsDiffFilterInUseIcon = LIMG_FILTER_OFF & LIMG_DROP_DOWN_ARROW

   If dDiffFilter.Count > 0 Then
      GetIsDiffFilterInUseIcon = LIMG_FILTER_ON & LIMG_DROP_DOWN_ARROW
   End If

End Function
'--------------------------------------------------------------------------------------------------------------------------
Function GetIsDiffFilterChecked( nFilterId )

   If dDiffFilter.Exists ( CStr(nFilterId)  ) Then
      GetIsDiffFilterChecked = "checked"
   End If

End Function
'---------------------------------------------------------------------------------------------------------------------------
Function  Get_CQ_Issues ( SSsql, OOrsCQ )

   If OOrsCQ.State = 1 Then
      OOrsCQ.Close
   End If

   On Error Resume Next
   OOrsCQ.ActiveConnection = CQ_conn
   OOrsCQ.Source = SSsql
   OOrsCQ.CursorType = 0
   OOrsCQ.CursorLocation = 2
   OOrsCQ.LockType = 3
   OOrsCQ.Open()
   Get_CQ_Issues = Err.Number

End Function
'--------------------------------------------------------------------------------------------------------------------------
Public Function TextToHTML ( sString )
   Dim mString

   If (sString = "") OR IsNull(sString) Then Exit Function

   mString = Server.HTMLEncode( sString )
   mString = Replace(mString, VBNewLine, "<br>")

   TextToHTML = mString
End Function
'--------------------------------------------------------------------------------------------------------------------------

Sub GetFormDetails ( nSourceRtagId, ByRef outobjDetails )
   Dim rsQry, query

   ' Exit if nSourceRtagId is empty
   If nSourceRtagId = "" Then Exit Sub

   OraDatabase.Parameters.Add "SOURCE_RTAG_ID",    nSourceRtagId,      ORAPARM_INPUT, ORATYPE_NUMBER

   query = _
   " SELECT pr.PROJ_NAME ||' &gt; '|| rt.RTAG_NAME   AS LOCATION, "&_
   "        rt.OFFICIAL, pr.PROJ_ID, rt.RTAG_ID"&_
   "  FROM RELEASE_TAGS rt,"&_
   "         PROJECTS pr"&_
   " WHERE rt.PROJ_ID = pr.PROJ_ID"&_
   "   AND rt.RTAG_ID = :SOURCE_RTAG_ID"

   Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )

   OraDatabase.Parameters.Remove "SOURCE_RTAG_ID"

   If rsQry.RecordCount > 0 Then
      outobjDetails.Item ("location") = rsQry("location")
      outobjDetails.Item ("official") = rsQry("official")
      outobjDetails.Item ("proj_id") = rsQry("proj_id")
      outobjDetails.Item ("rtag_id") = rsQry("rtag_id")
   Else
      Err.Raise 8, "Sub GetFormDetails in "& ScriptName, "Empty record set returned. nSourceRtagId="& nSourceRtagId
   End If

   rsQry.Close
   Set rsQry = Nothing
End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub GetDiffStateIcon( nDiffState, outIcon )

   Select Case nDiffState
      Case "U"
         outIcon  = LIMG_UPDATED
      Case "UW"
         outIcon  = LIMG_UPDATED
      Case "A"
         outIcon = LIMG_ADDED
      Case "R"
         outIcon = LIMG_REMOVED
      Case "UR"
         outIcon = LIMG_RIPPLED
      Case Else
         outIcon = ""
   End Select

End Sub
'--------------------------------------------------------------------------------------------------------------------------
Function Get_Record_Count ( SSsql )
   Dim rsTemp
   Set rsTemp = OraDatabase.DbCreateDynaset( "SELECT COUNT(*) as record_count FROM "& SSsql , cint(0))

   If (NOT rsTemp.BOF) AND (NOT rsTemp.EOF) Then
      Get_Record_Count = rsTemp("record_count")
   Else
      Get_Record_Count = 0
   End If
   rsTemp.Close
   Set rsTemp = nothing
End Function
'--------------------------------------------------------------------------------------------------------------------------
' We need a way of discriminating between versions in the destination release that are pending, and those that are officially
' in the release. This function allows us to do that on the fly within the VBSCRIPT HTML generating code, indicating specifically
' if the given PV_ID reflects a pending additive merge.
Function Is_Pending_Add(NNrtag_id, NNpv_id)
   If IsNull(NNrtag_id) OR IsNull(NNpv_id) Then
      Is_Pending_Add = 0
   Else
      Is_Pending_Add = Get_Record_Count( "PLANNED pl WHERE pl.rtag_id = " & NNrtag_id & " AND pl.pv_id = " & NNpv_id & " AND pl.operation = 'A'" )
   End If
End Function
'--------------------------------------------------------------------------------------------------------------------------
' We need a way of discriminating between versions in the destination release that are pending, and those that are officially
' in the release. This function allows us to do that on the fly within the VBSCRIPT HTML generating code, indicating specifically
' if the given PV_ID reflects a pending subtractive merge.
Function Is_Pending_Sub(NNrtag_id, NNpv_id)
   If IsNull(NNrtag_id) OR IsNull(NNpv_id) Then
      Is_Pending_Sub = 0
   Else
      Is_Pending_Sub = Get_Record_Count( "PLANNED pl WHERE pl.rtag_id = " & NNrtag_id & " AND pl.pv_id = " & NNpv_id & " AND pl.operation = 'S'" )
   End If
End Function

'--------------------------------------------------------------------------------------------------------------------------


Sub MergePackages (releaseMode)
   Dim aFullList, aAddPkgList, aRemovePkgList, dAddPkgList, dRemovePkgList, PvId
   Dim OraParameter
   Dim rc

   ' Business Rules restricting the use of the merge feature...
   ' Bypass merge if the destination release is in closed or archive mode, or if user does not have
   ' merge permissions
   If releaseMode <> enumDB_RELEASE_IN_CLOSED_MODE  AND releaseMode <> enumDB_RELEASE_IN_ARCHIVE_MODE _
   AND (objAccessControl.IsActive("MergeRelease")) THEN

      Set dAddPkgList = CreateObject("Scripting.Dictionary")
      Set dRemovePkgList = CreateObject("Scripting.Dictionary")

      '--- Get Add Packages ---
      ' Get full list of "addpkg" parameter
      aFullList = Split ( Replace( Request("addpkg"), " ", "" ), "," )

      ' Clean empty parameters
      For Each PvId In aFullList
         If PvId <> "" Then
            dAddPkgList.Add CStr( PvId ), Empty
         End If
      Next

      aFullList = NULL
      aAddPkgList = dAddPkgList.Keys

      '--- Get Remove Packages ---
      ' Get full list of "removepkg" parameter
      aFullList = Split ( Replace( Request("removepkg"), " ", "" ), "," )

      ' Clean empty parameters
      For Each PvId In aFullList
         If PvId <> "" Then
            dRemovePkgList.Add CStr( PvId ), Empty
         End If
      Next

      aFullList = NULL
      aRemovePkgList = dRemovePkgList.Keys

      '-- Add package List to release --
      OraDatabase.Parameters.Add "PV_ID",    NULL, ORAPARM_INPUT, ORATYPE_NUMBER
      OraDatabase.Parameters.Add "VIEW_ID",  NULL, ORAPARM_BOTH, ORATYPE_NUMBER
      OraDatabase.Parameters.Add "RTAG_A",   Request("rtagA"), ORAPARM_INPUT, ORATYPE_NUMBER
      OraDatabase.Parameters.Add "RTAG_B",   Request("rtagB"), ORAPARM_INPUT, ORATYPE_NUMBER
      OraDatabase.Parameters.Add "PROJB",    objRelCollectorB.Item("proj_id"), ORAPARM_INPUT, ORATYPE_NUMBER
      OraDatabase.Parameters.Add "COMMENTS", "Merging from "& objRelCollectorA.Item("location") &" to "& objRelCollectorB.Item("location"), ORAPARM_INPUT, ORATYPE_VARCHAR2
      OraDatabase.Parameters.Add "USER_ID",  objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
      OraDatabase.Parameters.Add "OPERATION",NULL, ORAPARM_INPUT, ORATYPE_CHAR

      Set OraParameter = OraDatabase.Parameters


      On Error Resume Next


      ' Begin Database entry
      objEH.TryORA ( OraSession )

      '-- Add Packages --
      OraParameter("OPERATION").Value = "A"
      For Each PvId In aAddPkgList
         OraParameter("PV_ID").Value = PvId
         ' DEVI-45275, Merge into Planned (pending) table instead of release_content table.
         If Err.Number = 0 Then
            OraDatabase.ExecuteSQL _
            "BEGIN  "&_
            "  :VIEW_ID := PK_RELEASE.GET_PACKAGE_VIEW ( :PV_ID, :RTAG_A ); "&_
            "  PK_PLANNED.MERGE_PACKAGE ( :PV_ID, :VIEW_ID, :RTAG_B, :USER_ID, :OPERATION );  "&_
            "END;"
         End If
      Next

      '-- Remove Packages --
      If Err.Number = 0 Then
         OraParameter("OPERATION").Value = "S"
         For Each PvId In aRemovePkgList
            OraParameter("PV_ID").Value = PvId

            If Err.Number = 0 Then
               ' Does this PV_ID exist in the destination release's planned table?
               rc = Get_Record_Count ("PLANNED pl WHERE pl.pv_id = " & PvId & " AND pl.rtag_id = " & Request("rtagB") )
               If  rc > 0 Then
                  ' Given that merging now merges into pending, the merge page may be used to remove items that have
                  ' previously been merged but have not yet been committed to the destination release. For these,
                  ' we cannot call PK_RELEASE.GET_PACKAGE_VIEW(). We have to call PK_PLANNED.GET_PACKAGE_VIEW() instead.
                  OraDatabase.ExecuteSQL _
                  "BEGIN  "&_
                  "  :VIEW_ID := PK_PLANNED.GET_PACKAGE_VIEW ( :PV_ID, :RTAG_B ); "&_
                  "  PK_PLANNED.MERGE_PACKAGE ( :PV_ID, :VIEW_ID, :RTAG_B, :USER_ID, :OPERATION );  "&_
                  "END;"
               Else
                  ' DEVI-45275, Merge into Planned (pending) table instead of release_content table.
                  OraDatabase.ExecuteSQL _
                  "BEGIN  "&_
                  "  :VIEW_ID := PK_RELEASE.GET_PACKAGE_VIEW ( :PV_ID, :RTAG_B ); "&_
                  "  PK_PLANNED.MERGE_PACKAGE ( :PV_ID, :VIEW_ID, :RTAG_B, :USER_ID, :OPERATION );  "&_
                  "END;"
               End If
            End If
         Next

         '-- Log Project Merge Action
         If Err.Number = 0 Then
            OraDatabase.ExecuteSQL _
            "BEGIN  LOG_PROJECT_ACTION ( :PROJB, 'merge_release', :USER_ID, :COMMENTS, :RTAG_B );  END;"
         End If

      End If

      objEH.CatchORA ( OraSession )    ' sets up LastOraFailed as appropriate

      ' NOTE, The Touch_Release stored procedure does a commit itself, so we should not do it unless all the ExecuteSQL's we
      ' have just performed, were successful
      If objEH.LastOraFailed = FALSE Then
         '-- Force package state recalculate
         objEH.TryORA ( OraSession )
         OraDatabase.ExecuteSQL _
            "BEGIN  "&_
            "  TOUCH_RELEASE ( :RTAG_B );  "&_
            "END;"
         objEH.CatchORA ( OraSession )
      End If

      Set OraParameter = Nothing
      OraDatabase.Parameters.Remove "PV_ID"
      OraDatabase.Parameters.Remove "VIEW_ID"
      OraDatabase.Parameters.Remove "RTAG_A"
      OraDatabase.Parameters.Remove "RTAG_B"
      OraDatabase.Parameters.Remove "USER_ID"
      OraDatabase.Parameters.Remove "PROJB"
      OraDatabase.Parameters.Remove "COMMENTS"
      OraDatabase.Parameters.Remove "OPERATION"
      'Response.write "<br>"& sAddPkgList &"-"& dAddPkgList.Count &"-"& UBound( aFullList )
   End If
End Sub
'--------------------------------------------------------------------------------------------------------------------------
Function AddTrailingZeros(byval n, byval count)
   if len(n) >= count then
      AddTrailingZeros = n
      exit function
   end if

   dim c, s, i
   c = count - len(n)

   for i = 1 to c
      s = s & "0"
   next
   s = cstr(n) & s

   AddTrailingZeros = s
End function
'--------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------
If Request("btn") = "Exit" Then
   Call OpenInWindow ( "index.asp" )
End If

' Get release details
Call GetFormDetails ( parRtagA, objRelCollectorA )
Call GetFormDetails ( parRtagB, objRelCollectorB )




If (Request("btn") = "Merge") Then
   Call MergePackages ( objRelCollectorB.Item("official") )
End If

If Request("btn") = "Swap Compare" Then
   Call OpenInWindow ( ScriptName &"?rtagA="& parRtagB &"&rtagB="& parRtagA )
End If

If Request("btn") = "Hide" Then
   ' Store filter in cookie
   Response.Cookies(enum_RELMGR_COOKIE_DOMAIN)(COOKIE_HIDE_DIFF_FILTER) = Request("difilter")
End If


Call GetDiffFilterValues ( dDiffFilter )
'----------------------------------------------
%>
<html>
<head>
<title>Release Manager</title>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
<link rel="stylesheet" href="images/navigation.css" type="text/css">
<script language="JavaScript" src="images/common.js"></script>
<script language="JavaScript" src="scripts/remote_scripting.js"></script>

<!-- TIPS -->
<script language="JavaScript" src="images/tipster.js"></script>
<script language="JavaScript" src="images/_help_tips.js"></script>
<script language="JavaScript" type="text/javascript">
<!--

function RequestReleaseCombo( paramString, rowId )
{
   var requestURL = 'RequestReleaseCombo.asp';

   // Set ajax divname
   ajaxdivname = rowId;

   //Append the name to search for to the requestURL
   var url = requestURL + paramString;

   //Progress
   //alert(MM_findObj( rowId ));

   //MM_findObj( rowId ).options[0] = new Option('Loading...','');
   //MM_findObj( rowId ).selectedIndex = 0;
   rowId.options[0] = new Option('Loading...','');
   rowId.selectedIndex = 0;


   //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(stateComboChangeHandler);

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


function MergePackage ( pkga, pkgb, rowId )
{
   // Set merge hidden field with new value
   MM_findObj( 'ADDPKG_' + rowId ).value = pkga;

   var divA = MM_findObj( 'PVA' + rowId );
   var divB = MM_findObj( 'PVB' + rowId );

   // Set text equal
   divB.innerHTML = divA.innerHTML;

   // Set highlight to blank
   divA.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';
   divB.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';

    // Set Change state icon to blank
   MM_findObj( 'IMGSTATE' + rowId ).style.display = 'none';

   // Remove Merge Button
   MM_findObj( 'IMGMERGE' + rowId ).style.display = 'none';
   MM_findObj( 'IMGREMOVE' + rowId ).style.display = 'none';

   // Show undo button
   MM_findObj( 'IMGUNDO' + rowId ).style.display = 'block';
}


function RemovePackage ( pkga, pkgb, rowId )
{
   // Set remove hidden field with new value
   MM_findObj( 'REMOVEPKG_' + rowId ).value = pkgb;

   var divA = MM_findObj( 'PVA' + rowId );
   var divB = MM_findObj( 'PVB' + rowId );

   // Set text equal
   divB.style.textDecoration = 'line-through';

   // Set highlight to blank
   if (MM_findObj( 'CHANGETYPE_' + rowId ).value != "A")
   {
      divA.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';
   }
   divB.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';

    // Set Change state icon to blank
   MM_findObj( 'IMGSTATE' + rowId ).style.display = 'none';

   // Remove Merge Button
   MM_findObj( 'IMGMERGE' + rowId ).style.display = 'none';
   MM_findObj( 'IMGREMOVE' + rowId ).style.display = 'none';

   // Show undo button
   MM_findObj( 'IMGUNDO' + rowId ).style.display = 'block';
}



function UndoPackage ( rowId )
{
   // Set merge/remove hidden field with new value
   MM_findObj( 'ADDPKG_' + rowId ).value = '';
   MM_findObj( 'REMOVEPKG_' + rowId ).value = '';

   var divA = MM_findObj( 'PVA' + rowId );
   var divB = MM_findObj( 'PVB' + rowId );

   // Set text equal
   divB.innerHTML = MM_findObj( 'UNDOPKG_' + rowId ).value;
   divB.style.textDecoration = 'none';


   // Set highlight to blank
   divA.style.backgroundColor = MM_findObj( 'UNDOCOLORA_' + rowId ).value;
   divB.style.backgroundColor = MM_findObj( 'UNDOCOLORB_' + rowId ).value;

    // Set Change state icon to blank
   MM_findObj( 'IMGSTATE' + rowId ).style.display = 'block';

   // Remove Merge Button
   var cht = MM_findObj( 'CHANGETYPE_' + rowId );

   if (cht.value == "R")
   {
      MM_findObj( 'IMGMERGE' + rowId ).style.display = 'block';
   }
   else if ( (cht.value == "A") || (cht.value == "") )
   {
      MM_findObj( 'IMGREMOVE' + rowId ).style.display = 'block';
   }
   else
   {
      MM_findObj( 'IMGMERGE' + rowId ).style.display = 'block';
      MM_findObj( 'IMGREMOVE' + rowId ).style.display = 'block';
   }

   // Show undo button
   MM_findObj( 'IMGUNDO' + rowId ).style.display = 'none';
}


function MergeAll()
{
   var elem

   if (document.all)
   {
      // Run this for IE
      elem = document.all;
   } else {
      // Run this for other browsers
      elem = document.getElementsByTagName('div');
   }

   for (i in elem)
   {
      if (elem[i].id)
      {
         if (elem[i].id.indexOf('SHORT_') == 0) elem[i].style.display = 'none';
         if (elem[i].id.indexOf('LONG_') == 0) elem[i].style.display = 'block';
      }
   }
}

//-->
</script>

</head>
<!-- TIPS LAYERS -------------------------------------->
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<form name="FormName" method="post" action="<%=ScriptName%>">
   <!-- HEADER -->
   <!--#include file="_header.asp"-->
   <!-- BODY ---->
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
         <td width="1%" background="images/bg_home_orange.gif" valign="top">
            <!-- SELECT RELEASE A ---------------------------------------------->
            <br>
            <table width="100%"  border="0" cellspacing="10" cellpadding="0">
               <tr>
                  <td align="left" class="body_col"><img src="images/i_rtag_open_mode.gif" border="0" align="absmiddle" width="15" height="13">&nbsp;Select Release A<hr size="1px" color="Olive" noshade></td>
               </tr>
               <tr>
                  <td align="left">
                     <select name="projA" class="form_item" onChange="RequestReleaseCombo( '?proj_id='+ this.value, FormName.rtagA );">
                        <option value="">-- Select Project --</option>
                        <%
                        OraDatabase.Parameters.Add "PROJ_ID",    objRelCollectorA.Item("proj_id"),   ORAPARM_INPUT, ORATYPE_NUMBER

                        Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ProjectsCombo.sql"), cint(0))

                        OraDatabase.Parameters.Remove "PROJ_ID"

                        While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
                           <option value="<%=rsQry("proj_id")%>" <%=rsQry("selected")%>><%=rsQry("proj_name")%></option>
                           <%rsQry.MoveNext
                        WEnd

                        rsQry.Close
                        Set rsQry = Nothing
                        %>
                     </select>
                  </td>
               </tr>
               <tr>
                  <td align="left">
                     <select name="rtagA" id="rtagA" class="form_item">
                        <%
                        OraDatabase.Parameters.Add "PROJ_ID",    objRelCollectorA.Item("proj_id"),   ORAPARM_INPUT,  ORATYPE_NUMBER
                        OraDatabase.Parameters.Add "RTAG_ID",    objRelCollectorA.Item("rtag_id"),   ORAPARM_INPUT, ORATYPE_NUMBER

                        Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ReleasesCombo.sql"), cint(0))

                        OraDatabase.Parameters.Remove "PROJ_ID"
                        OraDatabase.Parameters.Remove "RTAG_ID"

                        While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
                              <option value="<%=rsQry("rtag_id")%>" <%=rsQry("selected")%>><%=rsQry("rtag_name")%></option>
                           <%rsQry.MoveNext
                        WEnd

                        rsQry.Close
                        Set rsQry = Nothing
                        %>
                     </select>
                  </td>
               </tr>
               <%If (parRtagA <> "") Then%>
                  <tr>
                     <td align="left"><a href="dependencies.asp?rtag_id=<%=parRtagA%>" class="body_txt_drk">Go To Release A &raquo;</a></td>
                  </tr>
               <%End If%>
            </table>

            <!-- SELECT RELEASE A END ---------------------------------------------->
         </td>

         <td width="1%" valign="top" background="images/bg_lght_gray.gif">&nbsp;</td>

         <td rowspan="2" valign="top" width="100%" background="images/bg_lght_gray.gif" align="center">
            <!-- DIFF -------------------------------------------------------->
            <br>
            <table width="100%" border="0" cellspacing="10" cellpadding="0">
               <tr>
                  <td>
                     <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                           <td width="1%"></td>
                           <td width="100%" align="left" class="form_ttl">DIFF / MERGE RELEASE</td>
                           <td width="1%"></td>
                        </tr>
                        <tr>
                           <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
                           <td background="images/lbox_bg_blue.gif" align="left" class="wform_ttl">&nbsp;</td>
                           <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
                        </tr>
                        <tr>
                           <td width="1%" bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
                           <td bgcolor="#FFFFFF" valign="top" class="form_item">
                              <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                                 <tr>
                                    <td width="100%" bgcolor="#DAD7C8">
                                       <input type="submit" name="btn" value="Compare" class="form_btn_comp" style="margin-right:5px;">
                                       <input type="submit" name="btn" value="Swap Compare" class="form_btn_comp">
                                       <span class="body_txt">
                                          <input name="btn" type="submit" class="form_btn" value="Mail Me Report">
                                       </span>
                                    </td>
                                    <td width="1" align="right" bgcolor="#DAD7C8" nowrap>
                                       <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                          <tr>
                                             <td>
                                                <%If (objRelCollectorB.Item("official") <> "Y" AND objRelCollectorB.Item("official") <> "C" ) AND (objAccessControl.IsActive("MergeRelease")) Then%>
                                                   <input type="submit" name="btn" value="Merge" class="form_btn_comp" style="margin-right:10px;" <%If (parRtagA = "") OR (parRtagB = "")Then%>disabled<%End If%>>
                                                <%End If%>
                                             </td>
                                             <td>
                                                <%If (objRelCollectorB.Item("official") = "C" ) AND (objAccessControl.IsActive("MergeReleaseForCCB")) Then%>
                                                   <input type="submit" name="btn" value="Merge" class="form_btn_comp" style="margin-right:10px;" <%If (parRtagA = "") OR (parRtagB = "")Then%>disabled<%End If%>>
                                                <%End If%>
                                             </td>
                                             <td>
                                                <input type="submit" name="btn" value="Exit" class="form_btn_comp">
                                             </td>
                                          </tr>
                                       </table>
                                    </td>
                                 </tr>
                                 <tr>
                                    <td>
                                       <%If (parRtagA <> "") AND (parRtagB <> "")Then%>
                                          <!-- DIFF FILTER +++++++++++++++++++++++++++++++++++++++++++ -->
                                          <fieldset style="width:150px;">
                                             <legend><a href="javascript:;" class="body_scol" onClick="ToggleDisplay('divDiffFilter');" ><%=GetIsDiffFilterInUseIcon() %>&nbsp;Filter&nbsp;Results...</a></legend>
                                             <div name="divDiffFilter" id="divDiffFilter" class="body_txt" style="display:none;">
                                                <br>
                                                <table width="100%"  border="0" cellspacing="1" cellpadding="3">
                                                   <tr>
                                                      <td width="1" background="images/bg_action_norm.gif"><input name="difilter" type="checkbox" value="<%=enumDB_NUM_DIFF_UPDATED%>" <%=GetIsDiffFilterChecked(enumDB_NUM_DIFF_UPDATED)%>></td>
                                                      <td width="50" nowrap background="images/bg_action_norm.gif" class="form_field"><%=LIMG_UPDATED%>Updated</td>
                                                   </tr>
                                                   <tr>
                                                      <td background="images/bg_action_norm.gif"><input type="checkbox" name="difilter" value="<%=enumDB_NUM_DIFF_NEW%>" <%=GetIsDiffFilterChecked(enumDB_NUM_DIFF_NEW)%>></td>
                                                      <td nowrap background="images/bg_action_norm.gif" class="form_field"><%=LIMG_ADDED%>Added</td>
                                                   </tr>
                                                   <tr>
                                                      <td background="images/bg_action_norm.gif"><input type="checkbox" name="difilter" value="<%=enumDB_NUM_DIFF_REMOVED%>" <%=GetIsDiffFilterChecked(enumDB_NUM_DIFF_REMOVED)%>></td>
                                                      <td nowrap background="images/bg_action_norm.gif" class="form_field"><%=LIMG_REMOVED%>Removed</td>
                                                   </tr>
                                                   <tr>
                                                      <td background="images/bg_action_norm.gif"><input type="checkbox" name="difilter" value="<%=enumDB_NUM_DIFF_RIPPLE%>" <%=GetIsDiffFilterChecked(enumDB_NUM_DIFF_RIPPLE)%>></td>
                                                      <td nowrap background="images/bg_action_norm.gif" class="form_field"><%=LIMG_RIPPLED%>Rippled</td>
                                                   </tr>
                                                   <tr>
                                                      <td background="images/bg_action_norm.gif"><input type="checkbox" name="difilter" value="<%=enumDB_NUM_DIFF_NO_CHANGE%>" <%=GetIsDiffFilterChecked(enumDB_NUM_DIFF_NO_CHANGE)%>></td>
                                                      <td nowrap background="images/bg_action_norm.gif" class="form_field">Unchanged</td>
                                                   </tr>
                                                   <tr>
                                                      <td background="images/bg_action_norm.gif">&nbsp;</td>
                                                      <td background="images/bg_action_norm.gif"><input name="btn" type="submit" class="form_btn" value="Hide"></td>
                                                   </tr>
                                                </table>
                                             </div>
                                          </fieldset>
                                          <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                                       <%End If%>
                                    </td>
                                    <td></td>
                                 </tr>
                              </table>

                              <%
                              ' Successfull Merge
                              If (Request("btn") = "Merge") Then
                                 Call Messenger ( "Merge has completed successfully.", 3, "100%" )
                              End If

                              Set FSO=Server.CreateObject("Scripting.FileSystemObject")
                              Set NewTextFile=FSO.CreateTextFile(Server.MapPath("docs\compareReleases_"&objAccessControl.UserName&".html"), true)

                              Call Header()

                              If (parRtagA <> "") AND (parRtagB <> "")Then%>
                                 <table width="100%"  border="0" cellspacing="1" cellpadding="0">
                                    <tr>
                                       <td width="50%" bgcolor="#E4E9EC" class="body_row" nowrap><%= ReleaseIcon(objRelCollectorA.Item("official")) & objRelCollectorA.Item("location")%> </td>
                                       <td width="1" bgcolor="#E4E9EC"><img src="images/spacer.gif" width="20" height="1"></td>
                                       <td width="1" bgcolor="#E4E9EC"><img src="images/spacer.gif" width="20" height="20"></td>
                                       <td width="1" bgcolor="#E4E9EC"><img src="images/spacer.gif" width="20" height="1"></td>
                                       <td width="50%" bgcolor="#E4E9EC" class="body_row" nowrap><%= ReleaseIcon(objRelCollectorB.Item("official")) & objRelCollectorB.Item("location")%></td>
                                       <td width="1" bgcolor="#E4E9EC"><img src="images/spacer.gif" width="20" height="1"></td>
                                    </tr>
                                    <%
                                    OraDatabase.Parameters.Add "RTAG_A",    parRtagA,   ORAPARM_INPUT, ORATYPE_NUMBER
                                    OraDatabase.Parameters.Add "RTAG_B",    parRtagB,   ORAPARM_INPUT, ORATYPE_NUMBER
                                    OraDatabase.Parameters.Add "NO_CHANGE", GetIsDiffFilterChecked(enumDB_NUM_DIFF_NO_CHANGE), ORAPARM_INPUT, ORATYPE_VARCHAR2
                                    OraDatabase.Parameters.Add "ADDED",     GetIsDiffFilterChecked(enumDB_NUM_DIFF_NEW),       ORAPARM_INPUT, ORATYPE_VARCHAR2
                                    OraDatabase.Parameters.Add "UPDATED",   GetIsDiffFilterChecked(enumDB_NUM_DIFF_UPDATED),   ORAPARM_INPUT, ORATYPE_VARCHAR2
                                    OraDatabase.Parameters.Add "REMOVED",   GetIsDiffFilterChecked(enumDB_NUM_DIFF_REMOVED),   ORAPARM_INPUT, ORATYPE_VARCHAR2

                                    Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ReleaseDiff.sql"), cint(0))

                                    OraDatabase.Parameters.Remove "RTAG_A"
                                    OraDatabase.Parameters.Remove "RTAG_B"
                                    OraDatabase.Parameters.Remove "NO_CHANGE"
                                    OraDatabase.Parameters.Remove "ADDED"
                                    OraDatabase.Parameters.Remove "UPDATED"
                                    OraDatabase.Parameters.Remove "REMOVED"

                                    Set rsQryA = OraDatabase.DbCreateDynaset( "SELECT RT.RTAG_NAME, PRJ.PROJ_NAME FROM RELEASE_TAGS RT, PROJECTS PRJ WHERE RTAG_ID="& parRtagA &" AND RT.PROJ_ID=PRJ.PROJ_ID", cint(0))
                                    Set rsQryB = OraDatabase.DbCreateDynaset( "SELECT RT.RTAG_NAME, PRJ.PROJ_NAME FROM RELEASE_TAGS RT, PROJECTS PRJ WHERE RTAG_ID="& parRtagB &" AND RT.PROJ_ID=PRJ.PROJ_ID", cint(0))

                                    Call Javascript()

                                    NewTextFile.WriteLine("<title>Difference Report Between "&rsQryA("proj_name")&" "&rsQryA("rtag_name")&" and "&rsQryB("proj_name")&" "&rsQryB("rtag_name")&"</title>")
                                    NewTextFile.WriteLine("<div align="&chr(34)&"center"&chr(34)&"><font color="&chr(34)&"red"&chr(34)&" size="&chr(34)&"4"&chr(34)&" face="&chr(34)&"Verdana, Arial, Helvetica, sans-serif"&chr(34)&">Difference Report Between "&rsQryA("proj_name")&" "&rsQryA("rtag_name")&" and "&rsQryB("proj_name")&" "&rsQryB("rtag_name")&"</font></div><br>")
                                    NewTextFile.WriteLine("<b>Key:</b><br><blockquote><font style="&chr(34)&"background-color:red"&chr(34)&"><b> SOURCE CODE CHANGES</b></font><font color="&chr(34)&"red"&chr(34)&"> Indicates Changes to a Package in "& rsQryA("rtag_name") &"</font>. <br><font style="&chr(34)&"background-color:#FF9933"&chr(34)&"><b> SOURCE CODE CHANGES</b></font><font color="&chr(34)&"#FF9933"&chr(34)&"> Indicates Changes to a Package in "& rsQryB("rtag_name") &"</font>. <br><font color="&chr(34)&"#999999"&chr(34)&">Grey Text Indicates No Source Code Changes to a Package in either Release</font>.</blockquote>")

                                    Dim currView_id
                                    currView_id = -1

                                    While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
                                       errormsg = false
                                       rowId = rsQry("pv_id_a") &"_"& rsQry("pv_id_b")

                                       btnMerge = LIMG_MERGE
                                       btnRemove = LIMG_REMOVE
                                       colorA = LCOLOR_NOT_CHANGED
                                       colorB = LCOLOR_NOT_CHANGED

                                       changeType = rsQry("change_type")

                                       Select Case changeType
                                          Case "U"
                                             colorA = LCOLOR_CHANGED
                                             colorB = LCOLOR_CHANGED
                                          Case "UW"
                                             colorA = LCOLOR_CHANGED
                                             colorB = LCOLOR_CHANGED
                                             btnMerge = LIMG_MERGE_WARN
                                          Case "UR"
                                             colorA = LCOLOR_RIPPLED
                                             colorB = LCOLOR_RIPPLED
                                          Case "A"
                                             colorA = LCOLOR_BLANK
                                          Case "R"
                                             colorB = LCOLOR_BLANK
                                       End Select

                                       Call GetDiffStateIcon ( changeType, ChangeTypeIcon )

                                       If changeType = "U" OR changeType = "UW" OR changeType = "UR" Then
                                          Dim MajorA, MajorB, MinorA, MinorB, PatchA, PatchB, BuildA, BuildB, pos, pkgVersionA, pkgVersionB, majMinA, majMinB
                                          MajorA = NULL
                                          MajorB = NULL
                                          MinorA = NULL
                                          MinorB = NULL

                                          pkgVersionA = rsQry("pkg_version_a")
                                          pkgVersionB = rsQry("pkg_version_b")

                                          PatchA = rsQry("patch_number_a")
                                          PatchB = rsQry("patch_number_b")
                                          BuildA = rsQry("build_number_a")
                                          BuildB = rsQry("build_number_b")


                                          ' Find the first occurence of the dot in package version A
                                          pos = InStr(pkgVersionA, ".")
                                          If pos <> 0 Then
                                             ' Extract the Major Version for A
                                             MajorA = Mid(pkgVersionA, 1, pos - 1)
                                             ' Delete the Major Version Value from the string to get the minor and patch version
                                             pkgVersionA = Mid(pkgVersionA, pos + 1, Len(pkgVersionA))
                                             ' Find the second occurence of the dot in package version A
                                             pos = InStr(pkgVersionA, ".")
                                             ' Extract the Minor Version for A
                                             If pos <> 0 Then
                                                MinorA = Mid(pkgVersionA, 1, pos - 1)
                                             End If
                                          End If

                                          ' Find the first occurence of the dot in package version B
                                          pos = InStr(pkgVersionB, ".")
                                          If pos <> 0 Then
                                             ' Extract the Major Version for B
                                             MajorB = Mid(pkgVersionB, 1, pos - 1)
                                             ' Delete the Major Version Value from the string to get the minor and patch version
                                             pkgVersionB = Mid(pkgVersionB, pos + 1, Len(pkgVersionB))
                                             ' Find the second occurence of the dot in package version B
                                             pos = InStr(pkgVersionB, ".")
                                             ' Extract the Minor Version for B
                                             If pos <> 0 Then
                                                MinorB = Mid(pkgVersionB, 1, pos - 1)
                                             End If
                                          End If

                                          If MajorA = MajorB Then
                                             If MinorA = MinorB Then
                                                If IsNumeric(PatchA) AND IsNumeric(PatchB) Then
                                                   If CInt(PatchB) > CInt(PatchA) Then
                                                      btnMerge = LIMG_MERGE_WARN
                                                   Else
                                                      btnMerge = LIMG_MERGE
                                                   End If
                                                End If
                                             Else
                                                If IsNumeric(MinorA) AND IsNumeric(MinorB) Then
                                                   If CInt(MinorB) > CInt(MinorA) Then
                                                      btnMerge = LIMG_MERGE_WARN
                                                   Else
                                                      btnMerge = LIMG_MERGE
                                                   End If
                                                End If
                                             End If
                                          Else
                                             If IsNumeric(MajorA) AND IsNumeric(MajorB) Then
                                                If    CInt(MajorB) > CInt(MajorA) Then
                                                   btnMerge = LIMG_MERGE_WARN
                                                Else
                                                   btnMerge = LIMG_MERGE
                                                End If
                                             End If
                                          End If
                                       End If

                                       ' -------- FILTERS RIPPLE BUILDS WHEN CHECKED -----------------
                                       If NOT (GetIsDiffFilterChecked(enumDB_NUM_DIFF_RIPPLE) = "checked" AND changeType = "UR") THEN

                                          ' -------- GROUP BY BASE VIEW  -----------------
                                          If CDbl(currView_id) <> CDbl(rsQry("view_id")) Then%>
                                             <tr>
                                                <td valign="top" nowrap class="form_ttl"><b><%=rsQry("view_name")%></b></td>
                                                <td class="form_ttl">&nbsp;</td>
                                                <td class="form_ttl">&nbsp;</td>
                                                <td class="form_ttl">&nbsp;</td>
                                                <td class="form_ttl">&nbsp;</td>
                                                <td class="form_ttl">&nbsp;</td>
                                             </tr>
                                             <%
                                             currView_id = CDbl(rsQry("view_id"))
                                          End If
                                          ' -------- END GROUP ------------------------
                                          %>
                                          <%
                                          'Determine if we are dealing with a PV_ID that we have already encountered and displayed as a pending addition
                                          'If we are, we do not need to display anything more about it, so skip the row.
                                          ' NOTE. the result set is sorted by change type (see releasediff.sql) such that if there are multiple entries
                                          '       for the same PV_ID, they are sorted in the following order: unchanged, additions, removals, updates.
                                          '       This is important to the row skip filtering carried out below.
                                          Dim skipRow
                                          If rsQry("pv_id_a") Then
                                             skipRow = pendingAdditions.Exists(CStr(rsQry("pv_id_a")))
                                          Else
                                             skipRow = FALSE
                                          End If
                                          %>
                                          <%If NOT skipRow Then%>
                                             <tr>
                                                <td class="body_row" nowrap>
                                                   <DIV id="PVA<%=rowId%>" style="background:<%=colorA%>; padding:5px;">
                                                      <%=rsQry("pkg_name_a") &" "& rsQry("pkg_version_a")%>
                                                   </DIV>
                                                   <input type="hidden" id="UNDOCOLORA_<%=rowId%>" value="<%=colorA%>">
                                                </td>
                                                <td bgcolor="#F5F5F5">
                                                   <%If objRelCollectorB.Item("official") <> "Y" Then%>
                                                      <DIV id="IMGMERGE<%=rowId%>" <%If (changeType = "A")  OR IsNull( changeType ) Then%>style="display:none;"<%End If%>><a href="javascript:;" onClick="MergePackage( '<%=rsQry("pv_id_a")%>', '<%=rsQry("pv_id_b")%>', '<%=rowId%>' );"><%=btnMerge%></a></DIV>
                                                   <%End If%>
                                                </td>
                                                <td bgcolor="#E4E9EC">
                                                   <DIV id="IMGSTATE<%=rowId%>" ><%=ChangeTypeIcon%></DIV>
                                                   <input type="hidden" id="CHANGETYPE_<%=rowId%>" value="<%=changeType%>">
                                                </td>
                                                <td bgcolor="#F5F5F5">
                                                   <%If objRelCollectorB.Item("official") <> "Y" Then%>
                                                      <DIV id="IMGREMOVE<%=rowId%>" <%If changeType = "R" Then%>style="display:none;"<%End If%>><a href="javascript:;" onClick="RemovePackage( '<%=rsQry("pv_id_a")%>', '<%=rsQry("pv_id_b")%>', '<%=rowId%>' );"><%=btnRemove%></a></DIV>
                                                   <%End If%>
                                                </td>
                                                <td class="body_row" nowrap>
                                                   <DIV id="PVB<%=rowId%>" style="background:<%=colorB%>; padding:5px;">
                                                      <%If IsNull(rsQry("pv_id_b")) Then %>
                                                         <%If Is_Pending_Sub(Request("rtagB"), rsQry("pv_id_a")) Then%>
                                                            (removal pending<%=Quick_Help("RemovalPending")%>)
                                                         <%End If %>
                                                      <%Else%>
                                                         <%=rsQry("pkg_name_b") &" "& rsQry("pkg_version_b")%>
                                                         <%If Is_Pending_Add(Request("rtagB"), rsQry("pv_id_b")) Then%>
                                                            (addition pending<%=Quick_Help("AdditionPending")%>)
                                                            <% 'Add this pending addition to the dictionary so that we can filter out REMOVED entries
                                                               'with identical PV_ID's that we might encounter further on in the result set
                                                            If NOT pendingAdditions.Exists(rsQry("pv_id_b")) Then
                                                               pendingAdditions.Add CStr(rsQry("pv_id_b")), CStr(rsQry("pkg_version_b"))
                                                            End If%>
                                                         <%ElseIf Is_Pending_Sub(Request("rtagB"), rsQry("pv_id_b")) Then%>
                                                            (removal pending<%=Quick_Help("RemovalPending")%>)
                                                         <%End If %>
                                                      <%End If %>
                                                   </DIV>
                                                   <input type="hidden" id="UNDOCOLORB_<%=rowId%>" value="<%=colorB%>">
                                                   <input type="hidden" name="addpkg" id="ADDPKG_<%=rowId%>" value="">
                                                   <input type="hidden" name="removepkg" id="REMOVEPKG_<%=rowId%>" value="">
                                                   <input type="hidden" id="UNDOPKG_<%=rowId%>" value="<%=rsQry("pkg_name_b") &" "& rsQry("pkg_version_b")%>">
                                                </td>
                                                <td bgcolor="#F5F5F5">
                                                   <DIV id="IMGUNDO<%=rowId%>" style="display:none;" >
                                                      <a href="javascript:;" onClick="UndoPackage( '<%=rowId%>' );"><%=LIMG_UNDO%></a>
                                                   </DIV>
                                                </td>
                                             </tr>
                                          <%End If %>

                                          <%
                                          If email AND NOT skipRow  Then
                                             If rsQry("pv_id_a") Then
                                                Set rsQryCommentsA = OraDatabase.DbCreateDynaset( "SELECT COMMENTS FROM PACKAGE_VERSIONS WHERE PV_ID="& rsQry("pv_id_a"), cint(0))
                                             End If

                                             If rsQry("pv_id_b") Then
                                                Set rsQryCommentsB = OraDatabase.DbCreateDynaset( "SELECT COMMENTS FROM PACKAGE_VERSIONS WHERE PV_ID="& rsQry("pv_id_b"), cint(0))
                                             End If

                                             pkgA = rsQry("pkg_name_a")
                                             pkgB = rsQry("pkg_name_b")

                                             If pkgA <> "" then
                                                pkgname = pkgA
                                             Else
                                                pkgname = pkgB
                                             End If

                                             If changeType = "U" OR  changeType = "UW" Then
                                                ChangeASource = false
                                                ChangeAUpdate = false
                                                ChangeBSource = false
                                                ChangeBUpdate = false

                                                'NewTextFile.WriteLine("<br><b><font face="&chr(34)&"arial"&chr(34)&">"&pkgname&"</font></b>")
                                                NewTextFile.Write("<SPAN id=""spanShowDetails"& rowId &""" name=""spanShowDetails""><a href=""javascript:;"" class=""body_scol"" onClick=""DisplaySPAN(true,'"& rowId &"');"">"& pkgname &"</a></SPAN>")
                                                NewTextFile.Write("<SPAN id=""spanHideDetails"& rowId &""" name=""spanHideDetails"" style=""display:none;""><a href=""javascript:;"" class=""body_scol"" onClick=""DisplaySPAN(false,'"& rowId &"');"">"& pkgname &"</a></SPAN>")
                                                NewTextFile.WriteLine("<SPAN id=""spanPkgInfo"& rowId &""" name=""spanPkgInfo"" style=""display:none;"">")
                                                NewTextFile.Write(rsQryA("rtag_name")&" uses: "&rsQry("pkg_version_a")&" (")
                                                Call Release(rsQry("pv_id_a"))
                                                NewTextFile.WriteLine(")<br>")
                                                NewTextFile.Write(rsQryB("rtag_name")&" uses: "&rsQry("pkg_version_b")&" (")
                                                Call Release(rsQry("pv_id_b"))
                                                NewTextFile.WriteLine(")<br>")

                                                a = rsQry("pv_id_a")
                                                b = rsQry("pv_id_b")
                                                c = rsQry("pv_id_a")
                                                d = rsQry("pv_id_b")

                                                Set pvCollectionA = CreateObject("Scripting.Dictionary")
                                                Set pvCollectionB = CreateObject("Scripting.Dictionary")
                                                On Error Resume Next
                                                While CLng(a) <> CLng(b) and NOT errormsg

                                                   'NewTextFile.WriteLine("A: "&a)
                                                   'NewTextFile.WriteLine("B: "&b)
                                                   pvCollectionA.Add CStr(a), Empty
                                                   pvCollectionB.Add CStr(b), Empty
                                                   If CLng(a) > CLng(b) Then
                                                      'NewTextFile.WriteLine("TestA")
                                                      Call LastPvIdA(a)
                                                   ElseIf CLng(b) > CLng(a) Then
                                                      'NewTextFile.WriteLine("TestB")
                                                      Call LastPvIdB(b)
                                                   End If
                                                Wend

                                                Set pvCollectionA = Nothing
                                                Set pvCollectionB = Nothing

                                                Call pkg_Version(a)
                                                NewTextFile.Write("Common PARENT package version: "&pkgversion&" (")
                                                Call Release(a)
                                                NewTextFile.WriteLine(")<br><br>")
                                                NewTextFile.WriteLine()
                                                NewTextFile.WriteLine("<b>"&rsQryA("rtag_name")&"</b>")

                                                If pkgversion <> rsQry("pkg_version_a") Then
                                                   NewTextFile.WriteLine("<blockquote><b><i>Versions between "& pkgversion &" and "& rsQry("pkg_version_a")&"</i></b></blockquote>")

                                                   If errormsg Then
                                                      NewTextFile.WriteLine("Error determining root!<br>")
                                                      NewTextFile.WriteLine()
                                                   End If

                                                   source_change = false

                                                   While CLng(a) <> CLng(c) and NOT errormsg
                                                      Call Comments(c)
                                                      Call GetFixedIssues(c)
                                                      Call LastPvIdAa(c)
                                                      NewTextFile.WriteLine()
                                                   Wend

                                                   If source_change = false Then
                                                      NewTextFile.WriteLine("<blockquote><b><i>No source changes to "& rsQryA("rtag_name")&". Only Rippled Builds.</i></b></blockquote><br>")
                                                      ChangeASource = true
                                                   End If

                                                   Call pkg_Version(b)
                                                   NewTextFile.WriteLine()
                                                   NewTextFile.WriteLine()

                                                ElseIf pkgversion = rsQry("pkg_version_a") Then
                                                   NewTextFile.WriteLine("<blockquote><b><i>No updates to "& rsQryA("rtag_name")&"</i></b></blockquote><br>")
                                                   ChangeAUpdate = true
                                                   NewTextFile.WriteLine()
                                                End If

                                                NewTextFile.WriteLine("<b>"&rsQryB("rtag_name")&"</b>")

                                                If pkgversion <> rsQry("pkg_version_b") Then
                                                   NewTextFile.WriteLine("<blockquote><b><i>Versions between "& pkgversion &" and "& rsQry("pkg_version_b")&"</i></b></blockquote>")

                                                   If errormsg Then
                                                      NewTextFile.WriteLine("Error determining root!<br>")
                                                      NewTextFile.WriteLine()
                                                   End If

                                                   source_change = false

                                                   While CLng(b) <> CLng(d) and NOT errormsg
                                                      Call Comments(d)
                                                      Call GetFixedIssues(d)
                                                      Call LastPvIdBb(d)
                                                      NewTextFile.WriteLine()
                                                   Wend

                                                   If source_change = false Then
                                                      NewTextFIle.WriteLine("<blockquote><b><i>No source changes to "& rsQryB("rtag_name")&". Only Rippled Builds.</i></b></blockquote><br>")
                                                      ChangeBSource = true
                                                   End If

                                                ElseIf pkgversion = rsQry("pkg_version_b") Then
                                                   NewTextFile.WriteLine("<blockquote><b><i>No updates to "& rsQryB("rtag_name")&"</i></b></blockquote><br>")
                                                   ChangeBUpdate = true
                                                   NewTextFile.WriteLine()
                                                End If

                                                NewTextFile.WriteLine("</SPAN>")

                                                If ChangeASource Then
                                                   If ChangeBSource Then
                                                      NewTextFile.WriteLine("<blockquote><table width=""700"" border=""0"">  <tr><td width=""335""><b>"& Ucase(rsQryA("rtag_name")) &": .</b><font color="&chr(34)&"#999999"&chr(34)&"> Ripple Builds Only.</font></td>   <td width=""349""><b>"& Ucase(rsQryB("rtag_name")) &": </b><font color="&chr(34)&"#999999"&chr(34)&"> Ripple Builds Only.</font></td>  </tr></table></blockquote>")
                                                   ElseIf ChangeBUpdate Then
                                                      NewTextFile.WriteLine("<blockquote><table width=""700"" border=""0"">  <tr><td width=""335""><b>"& Ucase(rsQryA("rtag_name")) &": </b><font color="&chr(34)&"#999999"&chr(34)&">Ripple Builds Only.</font></td>   <td width=""349""><b>"& Ucase(rsQryB("rtag_name")) &": </b><font color="&chr(34)&"#999999"&chr(34)&">No Updates.</font></td>  </tr></table></blockquote>")
                                                   ElseIf NOT ChangeBSource AND NOT ChangeBUpdate Then
                                                      NewTextFile.WriteLine("<blockquote><table width=""700"" border=""0"">  <tr><td width=""335""><b>"& Ucase(rsQryA("rtag_name")) &":</b> <font color="&chr(34)&"999999"&chr(34)&">Ripple Builds Only.</font></td>   <td width=""349"">   <b>"& Ucase(rsQryB("rtag_name")) &":</b> <b><font style="&chr(34)&"background-color:#FF9933"&chr(34)&">SOURCE CODE CHANGES.</b></font></td>  </tr></table></blockquote>")
                                                   End If
                                                End If

                                                If ChangeBSource Then
                                                   If NOT ChangeAUpdate Then
                                                      If NOT ChangeASource AND NOT ChangeBUpdate Then
                                                         NewTextFile.WriteLine("<blockquote><table width=""700"" border=""0"">  <tr><td width=""335""><b>"& Ucase(rsQryA("rtag_name")) &": </b><b><font style="&chr(34)&"background-color:red"&chr(34)&"> SOURCE CODE CHANGES</font></b>.</td>   <td width=""349""> <b>"& Ucase(rsQryB("rtag_name")) &":</b> <font color="&chr(34)&"#999999"&chr(34)&">Ripple Builds Only.</font></td>  </tr></table></blockquote>")
                                                      End If
                                                   End If
                                                End If

                                                If NOT ChangeASource Then
                                                   If NOT ChangeAUpdate Then
                                                      If NOT ChangeBSource AND NOT ChangeBUpdate Then
                                                         NewTextFile.WriteLine("<blockquote><table width=""700"" border=""0"">  <tr><td width=""335""><b>"& Ucase(rsQryA("rtag_name")) &": </b><b><font style="&chr(34)&"background-color:red"&chr(34)&"> SOURCE CODE CHANGES</font></b>.</td>   <td width=""349""> <b>"& Ucase(rsQryB("rtag_name")) &":</b> <b><font style="&chr(34)&"background-color:#FF9933"&chr(34)&">SOURCE CODE CHANGES.</b></font></td>  </tr></table></blockquote>")
                                                      ElseIf ChangeBUpdate Then
                                                         NewTextFile.WriteLine("<blockquote><table width=""700"" border=""0"">  <tr><td width=""335""><b>"& Ucase(rsQryA("rtag_name")) &":</b> <b><font style="&chr(34)&"background-color:red"&chr(34)&">SOURCE CODE CHANGES.</font></b></td> <td width=""349""><b>"& Ucase(rsQryB("rtag_name")) &":</b><font color="&chr(34)&"#999999"&chr(34)&">No Updates.</font></td>  </tr></table></blockquote>")
                                                      End If
                                                   ElseIf ChangeAUpdate Then
                                                      If NOT ChangeBSource AND NOT ChangeBUpdate Then
                                                         NewTextFile.WriteLine("<blockquote><table width=""700"" border=""0"">  <tr><td width=""335""><b>"& Ucase(rsQryA("rtag_name")) &":</b> <font color="&chr(34)&"#999999"&chr(34)&">No Updates.</td> <td width=""349"">  <b></font>"& Ucase(rsQryB("rtag_name")) &":</b> <b><font style="&chr(34)&"background-color:#FF9933"&chr(34)&">SOURCE CODE CHANGES.</font></b></td>  </tr></table></blockquote>")
                                                      ElseIf ChangeBSource Then
                                                         NewTextFile.WriteLine("<blockquote><table width=""700"" border=""0"">  <tr><td width=""335""><b>"& Ucase(rsQryA("rtag_name")) &":</b> <font color="&chr(34)&"#999999"&chr(34)&">No Updates.</td> <td width=""349""> </font><b>"& Ucase(rsQryB("rtag_name")) &":</b> <font color="&chr(34)&"#999999"&chr(34)&">Ripple Builds Only.</font></td>  </tr></table></blockquote>")
                                                      End If
                                                   End If
                                                End If

                                             End If  'changeType = "U" OR  changeType = "UW"

                                          End If  'email

                                       End If 'NOT (GetIsDiffFilterChecked(enumDB_NUM_DIFF_RIPPLE) = "checked" AND changeType = "UR")

                                       rsQry.MoveNext
                                    WEnd

                                    rsQry.Close
                                    Set rsQry = Nothing
                                    %>
                                    <%
                                    Call Footer()
                                    NewTextFile.Close
                                    Set NewTextFile=Nothing
                                    %>
                                 </table>
                                 <br>
                              <%Else%>
                                 <br>
                                 <%
                                 If (parRtagB <> "") Then
                                    Call Messenger ( "Select <b>Release A</b> to compare.", 3, "100%" )
                                 ElseIf (parRtagA <> "") Then
                                    Call Messenger ( "Select <b>Release B</b> to compare.", 3, "100%" )
                                 Else
                                    Call Messenger ( "Select <b>Release A</b> and <b>Release B</b> to compare.", 3, "100%" )
                                 End If
                                 %>
                              <%End If%>
                           </td>
                           <td width="1%" background="images/lbox_bgside_white.gif">&nbsp;</td>
                        </tr>
                        <tr>
                           <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
                           <td background="images/lbox_bg_blue.gif"></td>
                           <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
                        </tr>
                     </table>
                  </td>
               </tr>
            </table>
            <!-- DIFF END ---------------------------------------------------->
         </td>
         <td valign="top" width="1%" background="images/bg_home_orange.gif">

            <!-- SELECT RELEASE B ---------------------------------------------->
            <br>
            <table width="100%"  border="0" cellspacing="10" cellpadding="0">
               <tr>
                  <td align="left" class="body_col">
                     <img src="images/i_rtag_open_mode.gif" border="0" align="absmiddle" width="15" height="13">&nbsp;Select Release B<hr size="1px" color="Olive" noshade>
                  </td>
               </tr>
               <tr>
                  <td align="left">
                     <select name="projB" class="form_item" onChange="RequestReleaseCombo( '?proj_id='+ this.value, FormName.rtagB );">
                        <option value="">-- Select Project --</option>
                        <%
                        OraDatabase.Parameters.Add "PROJ_ID",    objRelCollectorB.Item("proj_id"),   ORAPARM_INPUT, ORATYPE_NUMBER

                        Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ProjectsCombo.sql"), cint(0))

                        OraDatabase.Parameters.Remove "PROJ_ID"

                        While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
                           <option value="<%=rsQry("proj_id")%>" <%=rsQry("selected")%>><%=rsQry("proj_name")%></option>
                           <%rsQry.MoveNext
                        WEnd

                        rsQry.Close
                        Set rsQry = Nothing
                        %>
                     </select>
                  </td>
               </tr>
               <tr>
                  <td align="left">
                     <select name="rtagB" id="rtagB" class="form_item">
                        <%
                        OraDatabase.Parameters.Add "PROJ_ID",    objRelCollectorB.Item("proj_id"),   ORAPARM_INPUT,  ORATYPE_NUMBER
                        OraDatabase.Parameters.Add "RTAG_ID",    objRelCollectorB.Item("rtag_id"),   ORAPARM_INPUT, ORATYPE_NUMBER

                        Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ReleasesCombo.sql"), cint(0))

                        OraDatabase.Parameters.Remove "PROJ_ID"
                        OraDatabase.Parameters.Remove "RTAG_ID"

                        While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
                              <option value="<%=rsQry("rtag_id")%>" <%=rsQry("selected")%>><%=rsQry("rtag_name")%></option>
                           <%rsQry.MoveNext
                        WEnd

                        rsQry.Close
                        Set rsQry = Nothing
                        %>
                     </select>
                  </td>
               </tr>
               <%If (parRtagB <> "") Then%>
                  <tr>
                     <td align="left"><a href="dependencies.asp?rtag_id=<%=parRtagB%>" class="body_txt_drk">Go To Release B &raquo;</a></td>
                  </tr>
               <%End If%>
            </table>
            <!-- SELECT RELEASE B END ---------------------------------------------->
         </td>
      </tr>
      <tr>
         <td valign="bottom" align="center" background="images/bg_home_orange.gif">
            <img src="images/img_vtree.gif" width="86" height="99" vspace="20" hspace="30">
         </td>
         <td background="images/bg_lght_gray.gif" valign="top">
            <img src="images/h_trsp_dot.gif" width="1" height="500">
         </td>
         <td valign="bottom" background="images/bg_home_orange.gif" align="center">
            <img src="images/img_vtree.gif" width="86" height="99" vspace="20" hspace="30">
         </td>
      </tr>
   </table>
</form>
<!-- FOOTER -->
<!--#include file="_footer.asp"-->
<%
If email Then
   Dim LocalPath
   LocalPath = Server.MapPath("docs\compareReleases_"&objAccessControl.UserName&".html")

   Send_Email   "Release Manager Notification",_
                adminEmail, _
                objAccessControl.UserEmail,_
                "Release Comparisons from Release Manager", _
                "Your requested report...",_
                LocalPath
End If
%>
</body>
</html>
<%
Call Destroy_All_Objects
%>