Rev 3974 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@LANGUAGE="VBSCRIPT"%><%'====================================================='| |'| DIFF |'| |'=====================================================%><%Option explicit' Good idea to set when using redirectResponse.Expires = 0 ' always load the page, dont store%><%'To enable the script timeout to 20 minsServer.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 rsQryDim objRelCollectorADim objRelCollectorBDim parRtagADim parRtagBDim dDiffFilterDim colorA, colorB, ChangeTypeIconDim btnMerge, btnRemoveDim rowIdDim emailDim genReportDim FSODim NewTextFileDim pkgA, pkgB, pkgname, delimiter, rsQryA, rsQryB, rsQryCommentsA, rsQryCommentsB, sqlstrA, counterA, sqlstrB, counterBDim SSsql, retVal, rsCQ, DEVIissDim a, b, c, d, pkgversion, errormsg, ChangeASource, ChangeAUpdate, ChangeBSource, ChangeBUpdate, pvCollectionA, pvCollectionBDim source_change, scFlagDim changeTypeDim 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" Thenemail = truegenReport = trueEnd IfIf Request("btn") = "Show Me Report" ThengenReport = trueEnd If%><%'--------------------------------------------------------------------------------------------------------------------------Sub GetDiffFilterValues ( outDepFilter )Dim FilterVal, aFilterValuesIf Request.Cookies(enum_RELMGR_COOKIE_DOMAIN)(COOKIE_HIDE_DIFF_FILTER) <> "" ThenaFilterValues = Split( Replace( Request.Cookies(enum_RELMGR_COOKIE_DOMAIN)(COOKIE_HIDE_DIFF_FILTER), " ", ""), ",")For Each FilterVal In aFilterValuesoutDepFilter.Item (CStr( FilterVal )) = ""NextEnd IfEnd 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 toggleSPAN(x) {")NewTextFile.WriteLine(" var el = MM_findObj('spanPkgInfo' + x);")NewTextFile.WriteLine(" if (el.style.display != ""block"") {")NewTextFile.WriteLine(" el.style.display = ""block"";")NewTextFile.WriteLine(" } else {")NewTextFile.WriteLine(" el.style.display = ""none"";")NewTextFile.WriteLine(" }")NewTextFile.WriteLine("}")NewTextFile.WriteLine("function MM_getElementsByClassName(cn) {")NewTextFile.WriteLine(" var allT=document.getElementsByTagName('*'), allCN=[], i=0, a;")NewTextFile.WriteLine(" while(a=allT[i++]) {")NewTextFile.WriteLine(" a.className==cn ? allCN[allCN.length]=a : null;")NewTextFile.WriteLine(" }")NewTextFile.WriteLine(" return allCN")NewTextFile.WriteLine("}")NewTextFile.WriteLine(" function MM_toggleAll(cn, show){")NewTextFile.WriteLine(" var allEl = MM_getElementsByClassName(cn);")NewTextFile.WriteLine(" for (var ii=0; ii<allEl.length;ii++){")NewTextFile.WriteLine(" var el = allEl[ii];")NewTextFile.WriteLine(" if(show) {")NewTextFile.WriteLine(" el.style.display = ""block"";")NewTextFile.WriteLine(" } else {")NewTextFile.WriteLine(" el.style.display = ""none"";")NewTextFile.WriteLine(" }")NewTextFile.WriteLine(" }")NewTextFile.WriteLine(" }")NewTextFile.WriteLine("</script>")End Sub'--------------------------------------------------------------------------------------------------------------------------Sub GetFixedIssues(pv_id)'' Clearcase issues'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 ThenNewTextFile.WriteLine()NewTextFile.WriteLine("<blockquote><blockquote>Fixed ClearQuest Issues:</blockquote></blockquote>")NewTextFile.WriteLine("<blockquote><blockquote><blockquote><table class='fixed_issues' width='100%'>")NewTextFile.WriteLine("<tr>")NewTextFile.WriteLine("<td width='10%' class='form_field'>Issue Id</td>")NewTextFile.WriteLine("<td width='55%' class='form_field'>Summary</td>")NewTextFile.WriteLine("<td width='10%' class='form_field'>Issue Type</td>")NewTextFile.WriteLine("<td width='15%' class='form_field'>Priority</td>")NewTextFile.WriteLine("<td width='10%' class='form_field'>Status</td>")NewTextFile.WriteLine("</tr>")For counterA=1 to sqlstrA.RecordCountDEVIiss = "-1"If CInt(sqlstrA("iss_db")) = CInt(enumCLEARQUEST_DEVI_ID) ThenDEVIiss = DEVIiss &","& sqlstrA("iss_id")End IfSSsql = ReadFile( rootPath & "queries\cq_issues.sql" )SSsql = Replace( SSsql, "/*enumCLEARQUEST_DEVI_ID*/", enumCLEARQUEST_DEVI_ID)SSsql = Replace( SSsql, "/*DEVIiss*/", DEVIiss)retVal = Get_CQ_Issues ( SSsql, rsCQ )NewTextFile.WriteLine("<tr>")NewTextFile.WriteLine("<td nowrap class='form_item'>"&rsCQ("iss_num")&"</td>")NewTextFile.WriteLine("<td class='form_item'>"&NewLine_To_BR ( To_HTML ( rsCQ("summary") ) )&"</td>")NewTextFile.WriteLine("<td class='form_item'>"&rsCQ("issue_type")&"</td>")NewTextFile.WriteLine("<td class='form_item'>"&rsCQ("priority")&"</td>")NewTextFile.WriteLine("<td class='form_item'>"&rsCQ("Status")&"</td>")NewTextFile.WriteLine("</tr>")sqlstrA.MoveNextNextsqlstrA.Close()NewTextFile.WriteLine( " </table></blockquote></blockquote></blockquote> ")End If'' Must also handle Jira Issues'Dim SQLstrretVal = Get_JIRA_Package_Issues ( pv_id, SQLstr )' Debug ... NewTextFile.WriteLine("<blockquote><blockquote>Jira Issues:"&retVal&":"&pv_id&"</blockquote></blockquote>")If retVal > 0 ThenretVal = Get_JIRA_Issues ( SQLstr, rsCQ )If (retVal = 0 AND rsCQ.RecordCount > 0) ThenNewTextFile.WriteLine()NewTextFile.WriteLine("<blockquote><blockquote>Jira Issues:</blockquote></blockquote>")NewTextFile.WriteLine("<blockquote><blockquote><blockquote><table class='fixed_issues' width='100%'>")NewTextFile.WriteLine("<tr>")NewTextFile.WriteLine("<td width='8%' class='form_field'>Issue Id</td>")NewTextFile.WriteLine("<td width='58%' class='form_field'>Summary</td>")NewTextFile.WriteLine("<td width='8%' class='form_field'>Issue Type</td>")NewTextFile.WriteLine("<td width='10%' class='form_field'>Priority</td>")NewTextFile.WriteLine("<td width='8%' class='form_field'>Status</td>")NewTextFile.WriteLine("<td width='8%' class='form_field'>Resolution</td>")NewTextFile.WriteLine("</tr>")While ((NOT rsCQ.BOF) AND (NOT rsCQ.EOF))NewTextFile.WriteLine("<tr>")NewTextFile.WriteLine("<td nowrap class='form_item'>"&rsCQ("iss_num")&"</td>")NewTextFile.WriteLine("<td class='form_item'>"&NewLine_To_BR ( To_HTML ( rsCQ("summary") ) )&"</td>")NewTextFile.WriteLine("<td class='form_item'>"&rsCQ("issue_type")&"</td>")NewTextFile.WriteLine("<td class='form_item'>"&rsCQ("priority")&"</td>")NewTextFile.WriteLine("<td class='form_item'>"&rsCQ("Status")&"</td>")NewTextFile.WriteLine("<td class='form_item'>"&rsCQ("RESOLUTION")&"</td>")NewTextFile.WriteLine("</tr>")rsCQ.MoveNextWendNewTextFile.WriteLine( " </table></blockquote></blockquote></blockquote> ")End IfrsCQ.Close()End IfEnd Sub'--------------------------------------------------------------------------------------------------------------------------Sub LastPvIdA(a)Dim qryASet qryA = OraDatabase.DbCreateDynaset("SELECT LAST_PV_ID FROM PACKAGE_VERSIONS WHERE PV_ID="&a, cint(0))'If a <> qryA("last_pv_id") Thena = qryA("last_pv_id")'Else' errormsg = true'End IfIf pvCollectionA.Exists(CStr(a)) Thenerrormsg = trueExit SubEnd IfqryA.Close()End Sub'--------------------------------------------------------------------------------------------------------------------------Sub LastPvIdB(b)Dim qryBSet qryB = OraDatabase.DbCreateDynaset("SELECT LAST_PV_ID FROM PACKAGE_VERSIONS WHERE PV_ID="&b, cint(0))'If b <> qryB("last_pv_id") Thenb = qryB("last_pv_id")'Else' errormsg = true'End IfIf pvCollectionB.Exists(CStr(b)) Thenerrormsg = trueExit SubEnd IfqryB.Close()End Sub'--------------------------------------------------------------------------------------------------------------------------Sub pkg_Version(pv)Dim qrySet 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 qryASet 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 qryBSet 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 commentsSet comments = OraDatabase.DbCreateDynaset("SELECT COMMENTS, PKG_VERSION FROM PACKAGE_VERSIONS WHERE PV_ID="&Pv_id, cint(0))scFlag = falseIf comments("comments") <> "Rippled Build." ThenNewTextFile.WriteLine("<blockquote><blockquote><font color="&chr(34)&"blue"&chr(34)&">Version: "& comments("pkg_version")&"</font></blockquote></blockquote>")If comments("comments") <> "" ThenNewTextFile.WriteLine("<blockquote><blockquote>Comments: </blockquote></blockquote>")NewTextFile.WriteLine("<blockquote><blockquote><blockquote>"& TextToHTML(comments("comments")) &"</blockquote></blockquote></blockquote>")source_change = truescFlag = trueEnd IfEnd IfEnd Sub'--------------------------------------------------------------------------------------------------------------------------Sub Release(pvId)Dim releaseSet release = OraDatabase.DbCreateDynaset("SELECT INSERT_STAMP FROM RELEASE_CONTENT WHERE PV_ID="&pvId, cint(0))If release("insert_stamp") <> "" ThenNewTextFile.Write(release("insert_stamp"))ElseNewTextFile.Write("Version Not Used.")End IfEnd Sub'--------------------------------------------------------------------------------------------------------------------------Sub Header()NewTextFile.WriteLine("<html>")NewTextFile.WriteLine("<head>")End Sub'--------------------------------------------------------------------------------------------------------------------------Sub Footer()NewTextFile.WriteLine("</body>")NewTextFile.WriteLine("</html>")End Sub'--------------------------------------------------------------------------------------------------------------------------Sub Styles()NewTextFile.WriteLine("<style type="&chr(34)&"text/css"&chr(34)&">")NewTextFile.WriteLine("body { font-family:Verdana,Arial,Helvetica,sans-serif; }")NewTextFile.WriteLine("table { border-collapse:collapse; }")NewTextFile.WriteLine("table.fixed_issues td { border-width:1; border-style:solid; border-color:black; padding:3 5 3 5; }")NewTextFile.WriteLine(".fixed_issues { border-width:1; border-style:solid; border-color:black; }")NewTextFile.WriteLine(".page_title { color:red; font-size:110%; text-align:center; }")NewTextFile.WriteLine(".highlight_text { color:blue; }")NewTextFile.WriteLine(".form_field { background-color:#EAE5D7; font:bold 70% Tahoma,sans-serif; }")NewTextFile.WriteLine(".form_item { background-color:#EAE5D7; color:red; font:bold 70% Tahoma,sans-serif; vertical-align:top; }")NewTextFile.WriteLine(".changesa { background-color:red; }")NewTextFile.WriteLine(".changesb { background-color:#FF9933; }")NewTextFile.WriteLine(".changesnone { color:#999999; }")NewTextFile.WriteLine(".texta { color:red; }")NewTextFile.WriteLine(".textb { color:#FF9933; }")NewTextFile.WriteLine(".textnone { color:#999999; }")NewTextFile.WriteLine("</style>")End Sub'--------------------------------------------------------------------------------------------------------------------------Function GetIsDiffFilterInUseIcon()GetIsDiffFilterInUseIcon = LIMG_FILTER_OFF & LIMG_DROP_DOWN_ARROWIf dDiffFilter.Count > 0 ThenGetIsDiffFilterInUseIcon = LIMG_FILTER_ON & LIMG_DROP_DOWN_ARROWEnd IfEnd Function'--------------------------------------------------------------------------------------------------------------------------Function GetIsDiffFilterChecked( nFilterId )If dDiffFilter.Exists ( CStr(nFilterId) ) ThenGetIsDiffFilterChecked = "checked"End IfEnd Function'---------------------------------------------------------------------------------------------------------------------------Function Get_CQ_Issues ( SSsql, OOrsCQ )If OOrsCQ.State = 1 ThenOOrsCQ.CloseEnd IfOn Error Resume NextOOrsCQ.ActiveConnection = CQ_connOOrsCQ.Source = SSsqlOOrsCQ.CursorType = 0OOrsCQ.CursorLocation = 2OOrsCQ.LockType = 3OOrsCQ.Open()Get_CQ_Issues = Err.NumberEnd Function'--------------------------------------------------------------------------------------------------------------------------Public Function TextToHTML ( sString )Dim mStringIf (sString = "") OR IsNull(sString) Then Exit FunctionmString = Server.HTMLEncode( sString )mString = Replace(mString, VBNewLine, "<br>")TextToHTML = mStringEnd Function'--------------------------------------------------------------------------------------------------------------------------Sub GetFormDetails ( nSourceRtagId, ByRef outobjDetails )Dim rsQry, query' Exit if nSourceRtagId is emptyIf nSourceRtagId = "" Then Exit SubOraDatabase.Parameters.Add "SOURCE_RTAG_ID", nSourceRtagId, ORAPARM_INPUT, ORATYPE_NUMBERquery = _" SELECT pr.PROJ_NAME ||' > '|| 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 ThenoutobjDetails.Item ("location") = rsQry("location")outobjDetails.Item ("official") = rsQry("official")outobjDetails.Item ("proj_id") = rsQry("proj_id")outobjDetails.Item ("rtag_id") = rsQry("rtag_id")ElseErr.Raise 8, "Sub GetFormDetails in "& ScriptName, "Empty record set returned. nSourceRtagId="& nSourceRtagIdEnd IfrsQry.CloseSet rsQry = NothingEnd Sub'--------------------------------------------------------------------------------------------------------------------------Sub GetDiffStateIcon( nDiffState, outIcon )Select Case nDiffStateCase "U"outIcon = LIMG_UPDATEDCase "UW"outIcon = LIMG_UPDATEDCase "A"outIcon = LIMG_ADDEDCase "R"outIcon = LIMG_REMOVEDCase "UR"outIcon = LIMG_RIPPLEDCase ElseoutIcon = ""End SelectEnd Sub'--------------------------------------------------------------------------------------------------------------------------Function Get_Record_Count ( SSsql )Dim rsTempSet rsTemp = OraDatabase.DbCreateDynaset( "SELECT COUNT(*) as record_count FROM "& SSsql , cint(0))If (NOT rsTemp.BOF) AND (NOT rsTemp.EOF) ThenGet_Record_Count = rsTemp("record_count")ElseGet_Record_Count = 0End IfrsTemp.CloseSet rsTemp = nothingEnd 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) ThenIs_Pending_Add = 0ElseIs_Pending_Add = Get_Record_Count( "PLANNED pl WHERE pl.rtag_id = " & NNrtag_id & " AND pl.pv_id = " & NNpv_id & " AND pl.operation = 'A'" )End IfEnd 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) ThenIs_Pending_Sub = 0ElseIs_Pending_Sub = Get_Record_Count( "PLANNED pl WHERE pl.rtag_id = " & NNrtag_id & " AND pl.pv_id = " & NNpv_id & " AND pl.operation = 'S'" )End IfEnd Function'--------------------------------------------------------------------------------------------------------------------------Sub MergePackages (releaseMode)Dim aFullList, aAddPkgList, aRemovePkgList, dAddPkgList, dRemovePkgList, PvIdDim OraParameterDim 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 permissionsIf releaseMode <> enumDB_RELEASE_IN_CLOSED_MODE AND releaseMode <> enumDB_RELEASE_IN_ARCHIVE_MODE _AND (objAccessControl.IsActive("MergeRelease")) THENSet dAddPkgList = CreateObject("Scripting.Dictionary")Set dRemovePkgList = CreateObject("Scripting.Dictionary")'--- Get Add Packages ---' Get full list of "addpkg" parameteraFullList = Split ( Replace( Request("addpkg"), " ", "" ), "," )' Clean empty parametersFor Each PvId In aFullListIf PvId <> "" ThendAddPkgList.Add CStr( PvId ), EmptyEnd IfNextaFullList = NULLaAddPkgList = dAddPkgList.Keys'--- Get Remove Packages ---' Get full list of "removepkg" parameteraFullList = Split ( Replace( Request("removepkg"), " ", "" ), "," )' Clean empty parametersFor Each PvId In aFullListIf PvId <> "" ThendRemovePkgList.Add CStr( PvId ), EmptyEnd IfNextaFullList = NULLaRemovePkgList = dRemovePkgList.Keys'-- Add package List to release --OraDatabase.Parameters.Add "PV_ID", NULL, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "VIEW_ID", NULL, ORAPARM_BOTH, ORATYPE_NUMBEROraDatabase.Parameters.Add "RTAG_A", Request("rtagA"), ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "RTAG_B", Request("rtagB"), ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "PROJB", objRelCollectorB.Item("proj_id"), ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "COMMENTS", "Merging from "& objRelCollectorA.Item("location") &" to "& objRelCollectorB.Item("location"), ORAPARM_INPUT, ORATYPE_VARCHAR2OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "OPERATION",NULL, ORAPARM_INPUT, ORATYPE_CHARSet OraParameter = OraDatabase.ParametersOn Error Resume Next' Begin Database entryobjEH.TryORA ( OraSession )'-- Add Packages --OraParameter("OPERATION").Value = "A"For Each PvId In aAddPkgListOraParameter("PV_ID").Value = PvId' DEVI-45275, Merge into Planned (pending) table instead of release_content table.If Err.Number = 0 ThenOraDatabase.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 IfNext'-- Remove Packages --If Err.Number = 0 ThenOraParameter("OPERATION").Value = "S"For Each PvId In aRemovePkgListOraParameter("PV_ID").Value = PvIdIf 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 IfEnd IfNext'-- Log Project Merge ActionIf Err.Number = 0 ThenOraDatabase.ExecuteSQL _"BEGIN LOG_PROJECT_ACTION ( :PROJB, 'merge_release', :USER_ID, :COMMENTS, :RTAG_B ); END;"End IfEnd IfobjEH.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 successfulIf objEH.LastOraFailed = FALSE Then'-- Force package state recalculateobjEH.TryORA ( OraSession )OraDatabase.ExecuteSQL _"BEGIN "&_" TOUCH_RELEASE ( :RTAG_B ); "&_"END;"objEH.CatchORA ( OraSession )End IfSet OraParameter = NothingOraDatabase.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 IfEnd Sub'--------------------------------------------------------------------------------------------------------------------------Function AddTrailingZeros(byval n, byval count)if len(n) >= count thenAddTrailingZeros = nexit functionend ifdim c, s, ic = count - len(n)for i = 1 to cs = s & "0"nexts = cstr(n) & sAddTrailingZeros = sEnd function'----------------------------------------------------------------------------------------------------------------------------------------' Function returns the number of imported jira issues' and builds a string suitable for querying the jira issues databaseFunction Get_JIRA_Package_Issues ( NNpv_id, SSsql )Dim rsTemp, sqlstr, JIRAIss, retValJIRAIss = "'-1'"sqlstr = "SELECT iss_key FROM JIRA_ISSUES WHERE pv_id="& NNpv_idSet rsTemp = OraDatabase.DbCreateDynaset( sqlstr, cint(0))retVal = rsTemp.RecordCountWhile ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))JIRAIss = JIRAIss &",'"& rsTemp("iss_key")&"'"rsTemp.MoveNextWEndSSsql = "SELECT I.pkey AS iss_num, I.summary, ISS.pname AS Status, IT.pname as issue_type, PR.pname as Priority, R.PNAME as RESOLUTION"&_" FROM jiraissue I, issuestatus ISS, issuetype IT, resolution R, priority PR "&_" WHERE I.pkey IN ("& JIRAIss &") "&_" AND I.issuestatus = ISS.ID "&_" AND I.RESOLUTION = R.ID "&_" AND IT.ID = I.issuetype "&_" AND PR.ID = I.PRIORITY "rsTemp.Close()Set rsTemp = nothingGet_JIRA_Package_Issues = retValEnd Function'----------------------------------------------------------------------------------------------------------------------------------------Function Get_JIRA_Issues ( SSsql, OOrsCQ )If OOrsCQ.State = 1 ThenOOrsCQ.Close()End IfOn Error Resume NextOOrsCQ.ActiveConnection = JIRA_connOOrsCQ.Source = SSsqlOOrsCQ.CursorType = 0OOrsCQ.CursorLocation = 3OOrsCQ.LockType = 3OOrsCQ.Open()Get_JIRA_Issues = Err.NumberEnd Function'--------------------------------------------------------------------------------------------------------------------------%><%'------------ RUN BEFORE PAGE RENDER ----------If Request("btn") = "Exit" ThenCall OpenInWindow ( "index.asp" )End If' Get release detailsCall GetFormDetails ( parRtagA, objRelCollectorA )Call GetFormDetails ( parRtagB, objRelCollectorB )If (Request("btn") = "Merge") ThenCall MergePackages ( objRelCollectorB.Item("official") )End IfIf Request("btn") = "Swap Compare" ThenCall OpenInWindow ( ScriptName &"?rtagA="& parRtagB &"&rtagB="& parRtagA )End IfIf Request("btn") = "Hide" Then' Store filter in cookieResponse.Cookies(enum_RELMGR_COOKIE_DOMAIN)(COOKIE_HIDE_DIFF_FILTER) = Request("difilter")End IfCall 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 divnameajaxdivname = rowId;//Append the name to search for to the requestURLvar 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 urlxmlHttp_Get(xmlHttp, url);}function MergePackage ( pkga, pkgb, rowId ){// Set merge hidden field with new valueMM_findObj( 'ADDPKG_' + rowId ).value = pkga;var divA = MM_findObj( 'PVA' + rowId );var divB = MM_findObj( 'PVB' + rowId );// Set text equaldivB.innerHTML = divA.innerHTML;// Set highlight to blankdivA.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';divB.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';// Set Change state icon to blankMM_findObj( 'IMGSTATE' + rowId ).style.display = 'none';// Remove Merge ButtonMM_findObj( 'IMGMERGE' + rowId ).style.display = 'none';MM_findObj( 'IMGREMOVE' + rowId ).style.display = 'none';// Show undo buttonMM_findObj( 'IMGUNDO' + rowId ).style.display = 'block';}function RemovePackage ( pkga, pkgb, rowId ){// Set remove hidden field with new valueMM_findObj( 'REMOVEPKG_' + rowId ).value = pkgb;var divA = MM_findObj( 'PVA' + rowId );var divB = MM_findObj( 'PVB' + rowId );// Set text equaldivB.style.textDecoration = 'line-through';// Set highlight to blankif (MM_findObj( 'CHANGETYPE_' + rowId ).value != "A"){divA.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';}divB.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';// Set Change state icon to blankMM_findObj( 'IMGSTATE' + rowId ).style.display = 'none';// Remove Merge ButtonMM_findObj( 'IMGMERGE' + rowId ).style.display = 'none';MM_findObj( 'IMGREMOVE' + rowId ).style.display = 'none';// Show undo buttonMM_findObj( 'IMGUNDO' + rowId ).style.display = 'block';}function UndoPackage ( rowId ){// Set merge/remove hidden field with new valueMM_findObj( 'ADDPKG_' + rowId ).value = '';MM_findObj( 'REMOVEPKG_' + rowId ).value = '';var divA = MM_findObj( 'PVA' + rowId );var divB = MM_findObj( 'PVB' + rowId );// Set text equaldivB.innerHTML = MM_findObj( 'UNDOPKG_' + rowId ).value;divB.style.textDecoration = 'none';// Set highlight to blankdivA.style.backgroundColor = MM_findObj( 'UNDOCOLORA_' + rowId ).value;divB.style.backgroundColor = MM_findObj( 'UNDOCOLORB_' + rowId ).value;// Set Change state icon to blankMM_findObj( 'IMGSTATE' + rowId ).style.display = 'block';// Remove Merge Buttonvar 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 buttonMM_findObj( 'IMGUNDO' + rowId ).style.display = 'none';}function MergeAll(){var elemif (document.all){// Run this for IEelem = document.all;} else {// Run this for other browserselem = 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"> </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="20%"><td width="60%"><td width="20%"></tr><tr><td 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"> 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_NUMBERSet 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.MoveNextWEndrsQry.CloseSet 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_NUMBEROraDatabase.Parameters.Add "RTAG_ID", objRelCollectorA.Item("rtag_id"), ORAPARM_INPUT, ORATYPE_NUMBERSet 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.MoveNextWEndrsQry.CloseSet 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 »</a></td></tr><%End If%></table><!-- SELECT RELEASE A END ----------------------------------------------></td><td rowspan="2" valign="top" 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<%If genReport Then%> [Generating Report]<%End If%></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"> </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"><% '<input name="btn" type="submit" class="form_btn" value="Show 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() %> Filter 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"> </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 MergeIf (Request("btn") = "Merge") ThenCall Messenger ( "Merge has completed successfully.", 3, "100%" )End IfSet 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_NUMBEROraDatabase.Parameters.Add "RTAG_B", parRtagB, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "NO_CHANGE", GetIsDiffFilterChecked(enumDB_NUM_DIFF_NO_CHANGE), ORAPARM_INPUT, ORATYPE_VARCHAR2OraDatabase.Parameters.Add "ADDED", GetIsDiffFilterChecked(enumDB_NUM_DIFF_NEW), ORAPARM_INPUT, ORATYPE_VARCHAR2OraDatabase.Parameters.Add "UPDATED", GetIsDiffFilterChecked(enumDB_NUM_DIFF_UPDATED), ORAPARM_INPUT, ORATYPE_VARCHAR2OraDatabase.Parameters.Add "REMOVED", GetIsDiffFilterChecked(enumDB_NUM_DIFF_REMOVED), ORAPARM_INPUT, ORATYPE_VARCHAR2Set 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()Call Styles()NewTextFile.WriteLine("<title>Difference Report Between "&rsQryA("proj_name")&" "&rsQryA("rtag_name")&" and "&rsQryB("proj_name")&" "&rsQryB("rtag_name")&"</title>")NewTextFile.WriteLine("<div class=""page_title"">Difference Report Between "&rsQryA("proj_name")&" "&rsQryA("rtag_name")&" and "&rsQryB("proj_name")&" "&rsQryB("rtag_name")&"</div><br>")NewTextFile.WriteLine("<b>Key:</b><br><blockquote>")NewTextFile.WriteLine("<span class=changesa><b>SOURCE CODE CHANGES</b></span><span class=texta> Indicates Changes to a Package in "& rsQryA("rtag_name") &".</span><br>")NewTextFile.WriteLine("<span class=changesb><b>SOURCE CODE CHANGES</b></span><span class=textb> Indicates Changes to a Package in "& rsQryB("rtag_name") &".</span><br>")NewTextFile.WriteLine("<span class=changesnone><b>Grey Text</b></span><span class=textnone> No Source Code Changes to a Package in either Release.</span>")NewTextFile.WriteLine("</blockquote>")NewTextFile.WriteLine("<b>Toggle Sections:</b><blockquote>")NewTextFile.WriteLine("<a href=""javascript:;"" onClick=""MM_toggleAll('divPkgInfo','1');"">Expand All</a>")NewTextFile.WriteLine("<a href=""javascript:;"" onClick=""MM_toggleAll('divPkgInfo','');"">Collapse All</a>")NewTextFile.WriteLine("</blockquote>")Dim currView_idcurrView_id = -1While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))errormsg = falserowId = rsQry("pv_id_a") &"_"& rsQry("pv_id_b")btnMerge = LIMG_MERGEbtnRemove = LIMG_REMOVEcolorA = LCOLOR_NOT_CHANGEDcolorB = LCOLOR_NOT_CHANGEDchangeType = rsQry("change_type")Select Case changeTypeCase "U"colorA = LCOLOR_CHANGEDcolorB = LCOLOR_CHANGEDCase "UW"colorA = LCOLOR_CHANGEDcolorB = LCOLOR_CHANGEDbtnMerge = LIMG_MERGE_WARNCase "UR"colorA = LCOLOR_RIPPLEDcolorB = LCOLOR_RIPPLEDCase "A"colorA = LCOLOR_BLANKCase "R"colorB = LCOLOR_BLANKEnd SelectCall GetDiffStateIcon ( changeType, ChangeTypeIcon )If changeType = "U" OR changeType = "UW" OR changeType = "UR" ThenDim MajorA, MajorB, MinorA, MinorB, PatchA, PatchB, BuildA, BuildB, pos, pkgVersionA, pkgVersionB, majMinA, majMinBMajorA = NULLMajorB = NULLMinorA = NULLMinorB = NULLpkgVersionA = 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 Apos = InStr(pkgVersionA, ".")If pos <> 0 Then' Extract the Major Version for AMajorA = Mid(pkgVersionA, 1, pos - 1)' Delete the Major Version Value from the string to get the minor and patch versionpkgVersionA = Mid(pkgVersionA, pos + 1, Len(pkgVersionA))' Find the second occurence of the dot in package version Apos = InStr(pkgVersionA, ".")' Extract the Minor Version for AIf pos <> 0 ThenMinorA = Mid(pkgVersionA, 1, pos - 1)End IfEnd If' Find the first occurence of the dot in package version Bpos = InStr(pkgVersionB, ".")If pos <> 0 Then' Extract the Major Version for BMajorB = Mid(pkgVersionB, 1, pos - 1)' Delete the Major Version Value from the string to get the minor and patch versionpkgVersionB = Mid(pkgVersionB, pos + 1, Len(pkgVersionB))' Find the second occurence of the dot in package version Bpos = InStr(pkgVersionB, ".")' Extract the Minor Version for BIf pos <> 0 ThenMinorB = Mid(pkgVersionB, 1, pos - 1)End IfEnd IfIf MajorA = MajorB ThenIf MinorA = MinorB ThenIf IsNumeric(PatchA) AND IsNumeric(PatchB) ThenIf CInt(PatchB) > CInt(PatchA) ThenbtnMerge = LIMG_MERGE_WARNElsebtnMerge = LIMG_MERGEEnd IfEnd IfElseIf IsNumeric(MinorA) AND IsNumeric(MinorB) ThenIf CInt(MinorB) > CInt(MinorA) ThenbtnMerge = LIMG_MERGE_WARNElsebtnMerge = LIMG_MERGEEnd IfEnd IfEnd IfElseIf IsNumeric(MajorA) AND IsNumeric(MajorB) ThenIf CInt(MajorB) > CInt(MajorA) ThenbtnMerge = LIMG_MERGE_WARNElsebtnMerge = LIMG_MERGEEnd IfEnd IfEnd IfEnd 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"> </td><td class="form_ttl"> </td><td class="form_ttl"> </td><td class="form_ttl"> </td><td class="form_ttl"> </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 skipRowIf rsQry("pv_id_a") ThenskipRow = pendingAdditions.Exists(CStr(rsQry("pv_id_a")))ElseskipRow = FALSEEnd 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 setIf NOT pendingAdditions.Exists(rsQry("pv_id_b")) ThenpendingAdditions.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 genReport AND NOT skipRow ThenIf rsQry("pv_id_a") ThenSet rsQryCommentsA = OraDatabase.DbCreateDynaset( "SELECT COMMENTS FROM PACKAGE_VERSIONS WHERE PV_ID="& rsQry("pv_id_a"), cint(0))End IfIf rsQry("pv_id_b") ThenSet rsQryCommentsB = OraDatabase.DbCreateDynaset( "SELECT COMMENTS FROM PACKAGE_VERSIONS WHERE PV_ID="& rsQry("pv_id_b"), cint(0))End IfpkgA = rsQry("pkg_name_a")pkgB = rsQry("pkg_name_b")If pkgA <> "" thenpkgname = pkgAElsepkgname = pkgBEnd IfIf changeType = "U" OR changeType = "UW" ThenChangeASource = falseChangeAUpdate = falseChangeBSource = falseChangeBUpdate = false'NewTextFile.WriteLine("<br><b><font face="&chr(34)&"arial"&chr(34)&">"&pkgname&"</font></b>")NewTextFile.Write("<a href=""javascript:;"" class=""body_scol"" onClick=""toggleSPAN('"& rowId &"');"">"& pkgname &"</a>")NewTextFile.WriteLine("<DIV class=divPkgInfo 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 NextWhile CLng(a) <> CLng(b) and NOT errormsg'NewTextFile.WriteLine("A: "&a)'NewTextFile.WriteLine("B: "&b)pvCollectionA.Add CStr(a), EmptypvCollectionB.Add CStr(b), EmptyIf CLng(a) > CLng(b) Then'NewTextFile.WriteLine("TestA")Call LastPvIdA(a)ElseIf CLng(b) > CLng(a) Then'NewTextFile.WriteLine("TestB")Call LastPvIdB(b)End IfWendSet pvCollectionA = NothingSet pvCollectionB = NothingCall 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") ThenNewTextFile.WriteLine("<blockquote><b><i>Versions between "& pkgversion &" and "& rsQry("pkg_version_a")&"</i></b></blockquote>")If errormsg ThenNewTextFile.WriteLine("Error determining root!<br>")NewTextFile.WriteLine()End Ifsource_change = falseWhile CLng(a) <> CLng(c) and NOT errormsgCall Comments(c)If scFlag = TRUE ThenCall GetFixedIssues(c)End IfCall LastPvIdAa(c)NewTextFile.WriteLine()WendIf source_change = false ThenNewTextFile.WriteLine("<blockquote><b><i>No source changes to "& rsQryA("rtag_name")&". Only Rippled Builds.</i></b></blockquote><br>")ChangeASource = trueEnd IfCall pkg_Version(b)NewTextFile.WriteLine()NewTextFile.WriteLine()ElseIf pkgversion = rsQry("pkg_version_a") ThenNewTextFile.WriteLine("<blockquote><b><i>No updates to "& rsQryA("rtag_name")&"</i></b></blockquote><br>")ChangeAUpdate = trueNewTextFile.WriteLine()End IfNewTextFile.WriteLine("<b>"&rsQryB("rtag_name")&"</b>")If pkgversion <> rsQry("pkg_version_b") ThenNewTextFile.WriteLine("<blockquote><b><i>Versions between "& pkgversion &" and "& rsQry("pkg_version_b")&"</i></b></blockquote>")If errormsg ThenNewTextFile.WriteLine("Error determining root!<br>")NewTextFile.WriteLine()End Ifsource_change = falseWhile CLng(b) <> CLng(d) and NOT errormsgCall Comments(d)If scFlag = TRUE ThenCall GetFixedIssues(d)End IfCall LastPvIdBb(d)NewTextFile.WriteLine()WendIf source_change = false ThenNewTextFIle.WriteLine("<blockquote><b><i>No source changes to "& rsQryB("rtag_name")&". Only Rippled Builds.</i></b></blockquote><br>")ChangeBSource = trueEnd IfElseIf pkgversion = rsQry("pkg_version_b") ThenNewTextFile.WriteLine("<blockquote><b><i>No updates to "& rsQryB("rtag_name")&"</i></b></blockquote><br>")ChangeBUpdate = trueNewTextFile.WriteLine()End IfNewTextFile.WriteLine("</DIV>")If ChangeASource ThenIf ChangeBSource ThenNewTextFile.WriteLine("<blockquote><table width=""100%"" border=""0""> <tr><td width=""50%""><b>"& Ucase(rsQryA("rtag_name")) &": .</b class=changesnone> Ripple Builds Only.</td><td width=""50%""><b>"& Ucase(rsQryB("rtag_name")) &": </b class=changesnone> Ripple Builds Only.</td> </tr></table></blockquote>")ElseIf ChangeBUpdate ThenNewTextFile.WriteLine("<blockquote><table width=""100%"" border=""0""> <tr><td width=""50%""><b>"& Ucase(rsQryA("rtag_name")) &": </b><span class=changesnone>Ripple Builds Only.</span></td><td width=""50%""><b>"& Ucase(rsQryB("rtag_name")) &": </b><span class=changesnone> No Updates.</span></td> </tr></table></blockquote>")ElseIf NOT ChangeBSource AND NOT ChangeBUpdate ThenNewTextFile.WriteLine("<blockquote><table width=""100%"" border=""0""><tr><td width=""50%""><b>"& Ucase(rsQryA("rtag_name")) &":</b> <span class=changesnone>Ripple Builds Only.</span></td> <td width=""50%""> <b>"& Ucase(rsQryB("rtag_name")) &":</b> <b class=changesb> SOURCE CODE CHANGES.</b></td></tr></table></blockquote>")End IfEnd IfIf ChangeBSource ThenIf NOT ChangeAUpdate ThenIf NOT ChangeASource AND NOT ChangeBUpdate ThenNewTextFile.WriteLine("<blockquote><table width=""100%"" border=""0""> <tr><td width=""50%""><b>"& Ucase(rsQryA("rtag_name")) &": </b><b class=changesa> SOURCE CODE CHANGES</b>.</td> <td width=""50%""> <b>"& Ucase(rsQryB("rtag_name")) &":</b> <span class=changesnone> Ripple Builds Only.</span></td> </tr></table></blockquote>")End IfEnd IfEnd IfIf NOT ChangeASource ThenIf NOT ChangeAUpdate ThenIf NOT ChangeBSource AND NOT ChangeBUpdate ThenNewTextFile.WriteLine("<blockquote><table width=""100%"" border=""0""> <tr><td width=""50%""><b>"& Ucase(rsQryA("rtag_name")) &":</b> <b class=changesa> SOURCE CODE CHANGES.</b></td><td width=""50%""><b>"& Ucase(rsQryB("rtag_name")) &":</b><b class=changesb> SOURCE CODE CHANGES.</b></td></tr></table></blockquote>")ElseIf ChangeBUpdate ThenNewTextFile.WriteLine("<blockquote><table width=""100%"" border=""0""> <tr><td width=""50%""><b>"& Ucase(rsQryA("rtag_name")) &":</b> <b class=changesa> SOURCE CODE CHANGES.</b></td> <td width=""50%""><b>"& Ucase(rsQryB("rtag_name")) &":</b><span class=changesnone> No Updates.</span></td> </tr></table></blockquote>")End IfElseIf ChangeAUpdate ThenIf NOT ChangeBSource AND NOT ChangeBUpdate ThenNewTextFile.WriteLine("<blockquote><table width=""100%"" border=""0""> <tr><td width=""50%""><b>"& Ucase(rsQryA("rtag_name")) &":</b> <span class=changesnone>No Updates.</span></td> <td width=""50%""> <b></font>"& Ucase(rsQryB("rtag_name")) &":</b><b class=changesb> SOURCE CODE CHANGES.</b></td></tr></table></blockquote>")ElseIf ChangeBSource ThenNewTextFile.WriteLine("<blockquote><table width=""100%"" border=""0""> <tr><td width=""50%""><b>"& Ucase(rsQryA("rtag_name")) &":</b> <span class=changesnone>No Updates.</span></td> <td width=""50%""> </font><b>"& Ucase(rsQryB("rtag_name")) &":</b> <span class=changesnone> Ripple Builds Only.</span></td> </tr></table></blockquote>")End IfEnd IfEnd IfEnd If 'changeType = "U" OR changeType = "UW"End If 'emailEnd If 'NOT (GetIsDiffFilterChecked(enumDB_NUM_DIFF_RIPPLE) = "checked" AND changeType = "UR")rsQry.MoveNextWEndrsQry.CloseSet rsQry = Nothing%><%Call Footer()NewTextFile.CloseSet NewTextFile=Nothing%></table><br><%Else%><br><%If (parRtagB <> "") ThenCall Messenger ( "Select <b>Release A</b> to compare.", 3, "100%" )ElseIf (parRtagA <> "") ThenCall Messenger ( "Select <b>Release B</b> to compare.", 3, "100%" )ElseCall 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"> </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" 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"> 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_NUMBERSet 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.MoveNextWEndrsQry.CloseSet 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_NUMBEROraDatabase.Parameters.Add "RTAG_ID", objRelCollectorB.Item("rtag_id"), ORAPARM_INPUT, ORATYPE_NUMBERSet 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.MoveNextWEndrsQry.CloseSet 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 »</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 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 ThenDim LocalPathLocalPath = Server.MapPath("docs\compareReleases_"&objAccessControl.UserName&".html")Send_Email "Release Manager Notification",_adminEmail, _objAccessControl.UserEmail,_"Release Comparisons from Release Manager", _"Your requested report...",_LocalPathEnd If%></body></html><%Call Destroy_All_Objects%>