Subversion Repositories DevTools

Rev

Rev 5506 | Rev 5725 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|
5
'|  diff.asp
6
'|
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
12
Response.Expires = 0    ' always load the page, dont store
13
%>
14
<%
15
'To enable the script timeout to 20 mins
16
Server.ScriptTimeout=1200
17
%>
18
<!--#include file="common/conf.asp"-->
19
<!--#include file="common/globals.asp"-->
20
<!--#include file="common/formating.asp"-->
21
<!--#include file="common/qstr.asp"-->
22
<!--#include file="common/common_subs.asp"-->
23
<!--#include file="common/common_dbedit.asp"-->
24
<!--#include file="common/_form_window_common.asp"-->
25
<!--#include file="common/_rtree_common.asp"-->
26
<%
27
'------------ ACCESS CONTROL ------------------
28
%>
29
<!--#include file="_access_control_login.asp"-->
30
<!--#include file="_access_control_general.asp"-->
31
<SCRIPT LANGUAGE="VBScript" RUNAT=SERVER SRC="class/classaspJSON.vbs"></SCRIPT>
32
<SCRIPT LANGUAGE="VBScript" RUNAT=SERVER SRC="common/base64encode.vbs"></SCRIPT> 
33
<SCRIPT LANGUAGE="VBScript" RUNAT=SERVER SRC="common/jiraIssues.vbs"></SCRIPT> 
34
<%
35
'------------ Variable Definition -------------
36
Dim rsQry
37
Dim objRelCollectorA
38
Dim objRelCollectorB
39
Dim parRtagA
40
Dim parRtagB
41
Dim dDiffFilter
42
Dim colorA, colorB, ChangeTypeIcon
43
Dim btnMerge, btnRemove
44
Dim rowId
45
Dim email
46
Dim genReport
47
Dim FSO
48
Dim NewTextFile
49
Dim pkgA, pkgB, pkgname, delimiter, rsQryA, rsQryB, rsQryCommentsA, rsQryCommentsB, sqlstrA, counterA, sqlstrB, counterB
50
Dim SSsql, retVal, rsCQ, DEVIiss
51
Dim a, b, c, d, pkgversion, errormsg, ChangeASource, ChangeAUpdate, ChangeBSource, ChangeBUpdate, pvCollectionA, pvCollectionB
52
Dim source_change, scFlag
53
Dim changeType
54
Dim pendingAdditions
55
Dim isaSdk                  ' Target is an SDK based package
56
Dim isMergable              ' Target package can be modified
57
 
58
'------------ Constants Declaration -----------
59
Const LIMG_UPDATED = "<img src='images/i_updated.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='Updated'>"
60
Const LIMG_RIPPLED = "<img src='images/i_rippled.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='Rippled'>"
61
Const LIMG_ADDED = "<img src='images/i_added.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='Added'>"
62
Const LIMG_REMOVED = "<img src='images/i_removed.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='Removed'>"
63
Const LIMG_FILTER_ON = "<img src='images/i_data_table.gif' border='0' align='absmiddle' hspace='0' title='Filter in use.'>"
64
Const LIMG_FILTER_OFF = "<img src='images/i_data_table_off.gif' border='0' align='absmiddle' hspace='0' title='Filter not in use.'>"
65
Const LIMG_DROP_DOWN_ARROW = "<img src='images/i_drop_down_arrow.gif' width='5' height='15' hspace='1' border='0' align='absmiddle'>"
66
Const LCOLOR_NOT_CHANGED = "#F5F5F5"
67
Const LCOLOR_CHANGED = "#d2f7c9"
68
Const LCOLOR_RIPPLED = "#D8F8F8"
69
Const LCOLOR_BLANK = "#FFFFFF"
70
Const LIMG_MERGE = "<img src='images/bt_move_all_right.gif' title='Click to merge.' border='0'>"
71
Const LIMG_MERGE_WARN = "<img src='images/bt_move_warn_right.gif' title='Right hand side version is newer.' border='0'>"
72
Const LIMG_REMOVE = "<img src='images/bt_remove.gif' title='Remove this version from release.' border='0'>"
73
Const LIMG_UNDO = "<img src='images/bt_undo.gif' title='Undo merge/remove.' border='0'>"
74
Const LIMG_SDK = "<img src='images/i_sdkpkg.png' width='18' height='18' border='0' title='Package is imported from an SDK and cannot be modified'>"
75
'------------ Variable Init -------------------
76
parRtagA = Request("rtagA")
77
parRtagB = Request("rtagB")
78
Set objRelCollectorA = CreateObject("Scripting.Dictionary")
79
Set objRelCollectorB = CreateObject("Scripting.Dictionary")
80
Set dDiffFilter = CreateObject("Scripting.Dictionary")
81
Set pendingAdditions = CreateObject("Scripting.Dictionary")
82
'----------------------------------------------
83
If Request("btn") = "Mail Me Report" Then
84
    email = true
85
    genReport = true
86
End If
87
If Request("btn") = "Show Me Report" Then
88
    genReport = true
89
End If
90
'--------------------------------------------------------------------------------------------------------------------------
91
Sub GetDiffFilterValues ( outDepFilter )
92
    Dim FilterVal, aFilterValues
93
 
94
    If Request.Cookies(enum_RELMGR_COOKIE_DOMAIN)(COOKIE_HIDE_DIFF_FILTER) <> "" Then
95
        aFilterValues = Split( Replace( Request.Cookies(enum_RELMGR_COOKIE_DOMAIN)(COOKIE_HIDE_DIFF_FILTER), " ", ""), ",")
96
 
97
        For Each FilterVal In aFilterValues
98
            outDepFilter.Item (CStr( FilterVal )) = ""
99
        Next
100
 
101
    End If
102
 
103
End Sub
104
'--------------------------------------------------------------------------------------------------------------------------
105
Sub Javascript()
106
    NewTextFile.WriteLine("<script language=""JavaScript"" type=""text/javascript"">")
107
    NewTextFile.WriteLine("function MM_findObj(n, d) { //v4.0")
108
    NewTextFile.WriteLine("  var p,i,x;")
109
    NewTextFile.WriteLine("  if(!d) d=document; ")
110
    NewTextFile.WriteLine("  if((p=n.indexOf(""?""))>0&&parent.frames.length) {")
111
    NewTextFile.WriteLine("  	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);")
112
    NewTextFile.WriteLine("  }")
113
    NewTextFile.WriteLine("  if(!(x=d[n])&&d.all) x=d.all[n]; ")
114
    NewTextFile.WriteLine("  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];")
115
    NewTextFile.WriteLine("  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);")
116
    NewTextFile.WriteLine("  if(!x && document.getElementById) x=document.getElementById(n); ")
117
    NewTextFile.WriteLine("  return x;")
118
    NewTextFile.WriteLine("}")
119
 
120
    NewTextFile.WriteLine("function toggleSPAN(x) {")
121
    NewTextFile.WriteLine("    var el = MM_findObj('spanPkgInfo' + x);")
122
    NewTextFile.WriteLine("    if (el.style.display != ""block"") {")
123
    NewTextFile.WriteLine("        el.style.display = ""block"";")
124
    NewTextFile.WriteLine("    } else {")
125
    NewTextFile.WriteLine("        el.style.display = ""none"";")
126
    NewTextFile.WriteLine("    }")
127
    NewTextFile.WriteLine("}")
128
 
129
    NewTextFile.WriteLine("function MM_getElementsByClassName(cn) {")
130
    NewTextFile.WriteLine("    var allT=document.getElementsByTagName('*'), allCN=[], i=0, a;")
131
    NewTextFile.WriteLine("    while(a=allT[i++]) {")
132
    NewTextFile.WriteLine("        a.className==cn ? allCN[allCN.length]=a : null;")
133
    NewTextFile.WriteLine("    }")
134
    NewTextFile.WriteLine("    return allCN")
135
    NewTextFile.WriteLine("}")
136
 
137
    NewTextFile.WriteLine("    function MM_toggleAll(cn, show){")
138
    NewTextFile.WriteLine("        var allEl = MM_getElementsByClassName(cn);")
139
    NewTextFile.WriteLine("        for (var ii=0; ii<allEl.length;ii++){")
140
    NewTextFile.WriteLine("            var el = allEl[ii];")
141
    NewTextFile.WriteLine("            if(show) {")
142
    NewTextFile.WriteLine("                el.style.display = ""block"";")
143
    NewTextFile.WriteLine("            } else {")
144
    NewTextFile.WriteLine("                el.style.display = ""none"";")
145
    NewTextFile.WriteLine("            }")
146
    NewTextFile.WriteLine("        }")
147
    NewTextFile.WriteLine("    }")
148
 
149
    NewTextFile.WriteLine("</script>")
150
End Sub
151
'--------------------------------------------------------------------------------------------------------------------------
152
Sub GetFixedIssues(pv_id)
153
    '
154
    ' Clearcase issues
155
    '
156
    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))
157
 
158
    If sqlstrA.RecordCount <> 0 Then
159
        NewTextFile.WriteLine()
160
        NewTextFile.WriteLine("<blockquote><blockquote>Fixed ClearQuest Issues:</blockquote></blockquote>")
161
        NewTextFile.WriteLine("<blockquote><blockquote><blockquote><table class='fixed_issues' width='100%'>")
162
        NewTextFile.WriteLine("<tr>")
163
        NewTextFile.WriteLine("<td width='10%' class='form_field'>Issue Id</td>")
164
        NewTextFile.WriteLine("<td width='55%' class='form_field'>Summary</td>")
165
        NewTextFile.WriteLine("<td width='10%' class='form_field'>Issue Type</td>")
166
        NewTextFile.WriteLine("<td width='15%' class='form_field'>Priority</td>")
167
        NewTextFile.WriteLine("<td width='10%' class='form_field'>Status</td>")
168
        NewTextFile.WriteLine("</tr>")
169
 
170
        For counterA=1 to sqlstrA.RecordCount
171
            DEVIiss = "-1"
172
 
173
            If CInt(sqlstrA("iss_db")) = CInt(enumCLEARQUEST_DEVI_ID) Then
174
                DEVIiss = DEVIiss &","& sqlstrA("iss_id")
175
            End If
176
 
177
            SSsql = ReadFile( rootPath & "queries\cq_issues.sql" )
178
            SSsql = Replace( SSsql, "/*enumCLEARQUEST_DEVI_ID*/", enumCLEARQUEST_DEVI_ID)
179
            SSsql = Replace( SSsql, "/*DEVIiss*/", DEVIiss)
180
            retVal = Get_CQ_Issues ( SSsql, rsCQ )
181
 
182
            NewTextFile.WriteLine("<tr>")
183
            NewTextFile.WriteLine("<td nowrap class='form_item'>"&rsCQ("iss_num")&"</td>")
184
 
185
            NewTextFile.WriteLine("<td class='form_item'>"&NewLine_To_BR ( To_HTML ( rsCQ("summary") ) )&"</td>")
186
            NewTextFile.WriteLine("<td class='form_item'>"&rsCQ("issue_type")&"</td>")
187
            NewTextFile.WriteLine("<td class='form_item'>"&rsCQ("priority")&"</td>")
188
            NewTextFile.WriteLine("<td class='form_item'>"&rsCQ("Status")&"</td>")
189
            NewTextFile.WriteLine("</tr>")
190
 
191
            sqlstrA.MoveNext
192
        Next
193
        sqlstrA.Close()
194
        NewTextFile.WriteLine( "                        </table></blockquote></blockquote></blockquote> 		")
195
    End If
196
 
197
    ' Must also handle Jira Issues
198
    On Error Resume Next
199
 
200
    Dim issueInfo, el, key
201
    Set issueInfo = CreateObject( "Scripting.Dictionary" )
202
    Call getJiraIssueDetails(pv_id, issueInfo, 1)
203
    If issueInfo.Count > 0 Then
204
        ' Table Header
205
        NewTextFile.WriteLine()
206
        NewTextFile.WriteLine("<blockquote><blockquote>Jira Issues:</blockquote></blockquote>")
207
        NewTextFile.WriteLine("<blockquote><blockquote><blockquote><table class='fixed_issues' width='100%'>")
208
        NewTextFile.WriteLine("<tr>")
209
        NewTextFile.WriteLine("<td width='8%' class='form_field'>Issue Id</td>")
210
        NewTextFile.WriteLine("<td width='58%' class='form_field'>Summary</td>")
211
        NewTextFile.WriteLine("<td width='8%' class='form_field'>Issue Type</td>")
212
        NewTextFile.WriteLine("<td width='10%' class='form_field'>Priority</td>")
213
        NewTextFile.WriteLine("<td width='8%' class='form_field'>Status</td>")
214
        NewTextFile.WriteLine("<td width='8%' class='form_field'>Resolution</td>")
215
        NewTextFile.WriteLine("</tr>")
216
 
217
        ' Table Body
218
        For Each key In issueInfo
219
            Set el = issueInfo.item(key)
220
 
221
            NewTextFile.WriteLine("<tr>")
222
            NewTextFile.WriteLine("<td nowrap class='form_item'>"&key&"</td>")
223
            NewTextFile.WriteLine("<td class='form_item'>"&NewLine_To_BR ( To_HTML ( el.item("summary") ) )&"</td>")
224
            NewTextFile.WriteLine("<td class='form_item'>"&el.item("issuetype")&"</td>")
225
            NewTextFile.WriteLine("<td class='form_item'>"&el.item("priority")&"</td>")
226
            NewTextFile.WriteLine("<td class='form_item'>"&el.item("status")&"</td>")
227
            NewTextFile.WriteLine("<td class='form_item'>"&el.item("resolution")&"</td>")
228
            NewTextFile.WriteLine("</tr>")
229
        Next
230
        NewTextFile.WriteLine( "                        </table></blockquote></blockquote></blockquote> 		")
231
    Set issueInfo = nothing
232
    End If
233
End Sub
234
'--------------------------------------------------------------------------------------------------------------------------
235
Sub LastPvIdA(a)
236
 
237
    Dim qryA
238
    Set qryA = OraDatabase.DbCreateDynaset("SELECT LAST_PV_ID FROM PACKAGE_VERSIONS WHERE PV_ID="&a, cint(0))
239
 
240
    'If a <> qryA("last_pv_id") Then
241
        a = qryA("last_pv_id")
242
    'Else
243
    '    errormsg = true
244
    'End If
245
 
246
    If pvCollectionA.Exists(CStr(a)) Then
247
        errormsg = true
248
        Exit Sub
249
    End If
250
 
251
    qryA.Close()
252
End Sub
253
'--------------------------------------------------------------------------------------------------------------------------
254
Sub LastPvIdB(b)
255
    Dim qryB
256
    Set qryB = OraDatabase.DbCreateDynaset("SELECT LAST_PV_ID FROM PACKAGE_VERSIONS WHERE PV_ID="&b, cint(0))
257
 
258
    'If b <> qryB("last_pv_id") Then
259
        b = qryB("last_pv_id")
260
    'Else
261
    '    errormsg = true
262
    'End If
263
 
264
    If pvCollectionB.Exists(CStr(b)) Then
265
        errormsg = true
266
        Exit Sub
267
    End If
268
 
269
    qryB.Close()
270
End Sub
271
'--------------------------------------------------------------------------------------------------------------------------
272
Sub pkg_Version(pv)
273
    Dim qry
274
    Set qry = OraDatabase.DbCreateDynaset("SELECT PKG_VERSION FROM PACKAGE_VERSIONS WHERE PV_ID="&pv, cint(0))
275
    pkgversion = qry("pkg_version")
276
    qry.Close()
277
End Sub
278
'--------------------------------------------------------------------------------------------------------------------------
279
Sub LastPvIdAa(a)
280
    Dim qryA
281
    Set qryA = OraDatabase.DbCreateDynaset("SELECT LAST_PV_ID FROM PACKAGE_VERSIONS WHERE PV_ID="&a, cint(0))
282
    c = qryA("last_pv_id")
283
    qryA.Close()
284
End Sub
285
'--------------------------------------------------------------------------------------------------------------------------
286
Sub LastPvIdBb(b)
287
    Dim qryB
288
    Set qryB = OraDatabase.DbCreateDynaset("SELECT LAST_PV_ID FROM PACKAGE_VERSIONS WHERE PV_ID="&b, cint(0))
289
    d = qryB("last_pv_id")
290
    qryB.Close()
291
End Sub
292
'--------------------------------------------------------------------------------------------------------------------------
293
Sub Comments(Pv_Id)
294
    Dim comments
295
    Set comments = OraDatabase.DbCreateDynaset("SELECT COMMENTS, PKG_VERSION FROM PACKAGE_VERSIONS WHERE PV_ID="&Pv_id, cint(0))
296
 
297
    scFlag = false
298
    If comments("comments") <> "Rippled Build." Then
299
        NewTextFile.WriteLine("<blockquote><blockquote><font color="&chr(34)&"blue"&chr(34)&">Version: "& comments("pkg_version")&"</font></blockquote></blockquote>")
300
        If comments("comments") <> "" Then
301
            NewTextFile.WriteLine("<blockquote><blockquote>Comments: </blockquote></blockquote>")
302
            NewTextFile.WriteLine("<blockquote><blockquote><blockquote>"& TextToHTML(comments("comments")) &"</blockquote></blockquote></blockquote>")
303
            source_change = true
304
            scFlag = true
305
        End If
306
    End If
307
 
308
End Sub
309
'--------------------------------------------------------------------------------------------------------------------------
310
Sub Release(pvId)
311
    Dim release
312
    Set release = OraDatabase.DbCreateDynaset("SELECT INSERT_STAMP FROM RELEASE_CONTENT WHERE PV_ID="&pvId, cint(0))
313
 
314
    If release("insert_stamp") <> "" Then
315
        NewTextFile.Write(release("insert_stamp"))
316
    Else
317
        NewTextFile.Write("Version Not Used.")
318
    End If
319
 
320
End Sub
321
'--------------------------------------------------------------------------------------------------------------------------
322
Sub Header()
323
    NewTextFile.WriteLine("<html>")
324
    NewTextFile.WriteLine("<head>")
325
End Sub
326
'--------------------------------------------------------------------------------------------------------------------------
327
Sub Footer()
328
    NewTextFile.WriteLine("</body>")
329
    NewTextFile.WriteLine("</html>")
330
End Sub
331
'--------------------------------------------------------------------------------------------------------------------------
332
Sub Styles()
333
  NewTextFile.WriteLine("<style type="&chr(34)&"text/css"&chr(34)&">")
334
  NewTextFile.WriteLine("body { font-family:Verdana,Arial,Helvetica,sans-serif; }")
335
  NewTextFile.WriteLine("table { border-collapse:collapse; }")
336
  NewTextFile.WriteLine("table.fixed_issues td { border-width:1; border-style:solid; border-color:black; padding:3 5 3 5; }")
337
  NewTextFile.WriteLine(".fixed_issues { border-width:1; border-style:solid; border-color:black; }")
338
  NewTextFile.WriteLine(".page_title { color:red; font-size:110%; text-align:center; }")
339
  NewTextFile.WriteLine(".highlight_text { color:blue; }")
340
  NewTextFile.WriteLine(".form_field { background-color:#EAE5D7; font:bold 70% Tahoma,sans-serif; }")
341
  NewTextFile.WriteLine(".form_item { background-color:#EAE5D7; color:red; font:bold 70% Tahoma,sans-serif; vertical-align:top; }")
342
 
343
  NewTextFile.WriteLine(".changesa { background-color:red; }")
344
  NewTextFile.WriteLine(".changesb { background-color:#FF9933; }")
345
  NewTextFile.WriteLine(".changesnone { color:#999999; }")
346
 
347
  NewTextFile.WriteLine(".texta { color:red; }")
348
  NewTextFile.WriteLine(".textb { color:#FF9933; }")
349
  NewTextFile.WriteLine(".textnone { color:#999999; }")
350
 
351
  NewTextFile.WriteLine("</style>")
352
End Sub
353
'--------------------------------------------------------------------------------------------------------------------------
354
Function GetIsDiffFilterInUseIcon()
355
    GetIsDiffFilterInUseIcon = LIMG_FILTER_OFF & LIMG_DROP_DOWN_ARROW
356
 
357
    If dDiffFilter.Count > 0 Then
358
        GetIsDiffFilterInUseIcon = LIMG_FILTER_ON & LIMG_DROP_DOWN_ARROW
359
    End If
360
 
361
End Function
362
'--------------------------------------------------------------------------------------------------------------------------
363
Function GetIsDiffFilterChecked( nFilterId )
364
 
365
    If dDiffFilter.Exists ( CStr(nFilterId)  ) Then
366
        GetIsDiffFilterChecked = "checked"
367
    End If
368
 
369
End Function
370
'---------------------------------------------------------------------------------------------------------------------------
371
Function  Get_CQ_Issues ( SSsql, OOrsCQ )
372
 
373
    On Error Resume Next
374
    Set OOrsCQ = OraDatabase.DbCreateDynaset( SSsql, cint(0))
375
    Get_CQ_Issues = Err.Number
376
 
377
End Function
378
'--------------------------------------------------------------------------------------------------------------------------
379
Public Function TextToHTML ( sString )
380
    Dim mString
381
 
382
    If (sString = "") OR IsNull(sString) Then Exit Function
383
 
384
    mString = Server.HTMLEncode( sString )
385
    mString = Replace(mString, VBNewLine, "<br>")
386
 
387
    TextToHTML = mString
388
End Function
389
'--------------------------------------------------------------------------------------------------------------------------
390
 
391
Sub GetFormDetails ( nSourceRtagId, ByRef outobjDetails )
392
    Dim rsQry, query
393
 
394
    ' Exit if nSourceRtagId is empty
395
    If nSourceRtagId = "" Then Exit Sub
396
 
397
    OraDatabase.Parameters.Add "SOURCE_RTAG_ID",     nSourceRtagId,        ORAPARM_INPUT, ORATYPE_NUMBER
398
 
399
    query = _
400
    " SELECT pr.PROJ_NAME ||' &gt; '|| rt.RTAG_NAME    AS LOCATION, "&_
401
    "          rt.OFFICIAL, pr.PROJ_ID, rt.RTAG_ID"&_
402
    "  FROM RELEASE_TAGS rt,"&_
403
    "            PROJECTS pr"&_
404
    " WHERE rt.PROJ_ID = pr.PROJ_ID"&_
405
    "    AND rt.RTAG_ID = :SOURCE_RTAG_ID"
406
 
407
    Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
408
 
409
    OraDatabase.Parameters.Remove "SOURCE_RTAG_ID"
410
 
411
    If rsQry.RecordCount > 0 Then
412
        outobjDetails.Item ("location") = rsQry("location")
413
        outobjDetails.Item ("official") = rsQry("official")
414
        outobjDetails.Item ("proj_id") = rsQry("proj_id")
415
        outobjDetails.Item ("rtag_id") = rsQry("rtag_id")
416
    Else
417
        Err.Raise 8, "Sub GetFormDetails in "& ScriptName, "Empty record set returned. nSourceRtagId="& nSourceRtagId
418
    End If
419
 
420
    rsQry.Close
421
    Set rsQry = Nothing
422
End Sub
423
'--------------------------------------------------------------------------------------------------------------------------
424
Sub GetDiffStateIcon( nDiffState, outIcon )
425
 
426
    Select Case nDiffState
427
        Case "U"
428
            outIcon  = LIMG_UPDATED
429
        Case "UW"
430
            outIcon  = LIMG_UPDATED
431
        Case "A"
432
            outIcon = LIMG_ADDED
433
        Case "R"
434
            outIcon = LIMG_REMOVED
435
        Case "UR"
436
            outIcon = LIMG_RIPPLED
437
        Case Else
438
            outIcon = ""
439
    End Select
440
 
441
End Sub
442
'--------------------------------------------------------------------------------------------------------------------------
443
Function Get_Record_Count ( SSsql )
444
    Dim rsTemp
445
    Set rsTemp = OraDatabase.DbCreateDynaset( "SELECT COUNT(*) as record_count FROM "& SSsql , cint(0))
446
 
447
    If (NOT rsTemp.BOF) AND (NOT rsTemp.EOF) Then
448
        Get_Record_Count = rsTemp("record_count")
449
    Else
450
        Get_Record_Count = 0
451
    End If
452
    rsTemp.Close
453
    Set rsTemp = nothing
454
End Function
455
'--------------------------------------------------------------------------------------------------------------------------
456
' We need a way of discriminating between versions in the destination release that are pending, and those that are officially
457
' in the release. This function allows us to do that on the fly within the VBSCRIPT HTML generating code, indicating specifically
458
' if the given PV_ID reflects a pending additive merge.
459
Function Is_Pending_Add(NNrtag_id, NNpv_id)
460
    If IsNull(NNrtag_id) OR IsNull(NNpv_id) Then
461
        Is_Pending_Add = 0
462
    Else
463
        Is_Pending_Add = Get_Record_Count( "PLANNED pl WHERE pl.rtag_id = " & NNrtag_id & " AND pl.pv_id = " & NNpv_id & " AND pl.operation = 'A'" )
464
    End If
465
End Function
466
'--------------------------------------------------------------------------------------------------------------------------
467
' We need a way of discriminating between versions in the destination release that are pending, and those that are officially
468
' in the release. This function allows us to do that on the fly within the VBSCRIPT HTML generating code, indicating specifically
469
' if the given PV_ID reflects a pending subtractive merge.
470
Function Is_Pending_Sub(NNrtag_id, NNpv_id)
471
    If IsNull(NNrtag_id) OR IsNull(NNpv_id) Then
472
        Is_Pending_Sub = 0
473
    Else
474
        Is_Pending_Sub = Get_Record_Count( "PLANNED pl WHERE pl.rtag_id = " & NNrtag_id & " AND pl.pv_id = " & NNpv_id & " AND pl.operation = 'S'" )
475
    End If
476
End Function
477
 
478
'--------------------------------------------------------------------------------------------------------------------------
479
Sub MergePackages ()
480
    Dim aFullList, aAddPkgList, aRemovePkgList, dAddPkgList, dRemovePkgList, PvId
481
    Dim OraParameter
482
    Dim rc
483
 
484
    Set dAddPkgList = CreateObject("Scripting.Dictionary")
485
    Set dRemovePkgList = CreateObject("Scripting.Dictionary")
486
 
487
    '--- Get Add Packages ---
488
    ' Get full list of "addpkg" parameter
489
    aFullList = Split ( Replace( Request("addpkg"), " ", "" ), "," )
490
 
491
    ' Clean empty parameters
492
    For Each PvId In aFullList
493
        If PvId <> "" Then
494
            dAddPkgList.Add CStr( PvId ), Empty
495
        End If
496
    Next
497
 
498
    aFullList = NULL
499
    aAddPkgList = dAddPkgList.Keys
500
 
501
    '--- Get Remove Packages ---
502
    ' Get full list of "removepkg" parameter
503
    aFullList = Split ( Replace( Request("removepkg"), " ", "" ), "," )
504
 
505
    ' Clean empty parameters
506
    For Each PvId In aFullList
507
        If PvId <> "" Then
508
            dRemovePkgList.Add CStr( PvId ), Empty
509
        End If
510
    Next
511
 
512
    aFullList = NULL
513
    aRemovePkgList = dRemovePkgList.Keys
514
 
515
    '-- Add package List to release --
516
    OraDatabase.Parameters.Add "PV_ID",     NULL, ORAPARM_INPUT, ORATYPE_NUMBER
517
    OraDatabase.Parameters.Add "VIEW_ID",  NULL, ORAPARM_BOTH, ORATYPE_NUMBER
518
    OraDatabase.Parameters.Add "RTAG_A",    Request("rtagA"), ORAPARM_INPUT, ORATYPE_NUMBER
519
    OraDatabase.Parameters.Add "RTAG_B",    Request("rtagB"), ORAPARM_INPUT, ORATYPE_NUMBER
520
    OraDatabase.Parameters.Add "PROJB",     objRelCollectorB.Item("proj_id"), ORAPARM_INPUT, ORATYPE_NUMBER
521
    OraDatabase.Parameters.Add "COMMENTS", "Merging from "& objRelCollectorA.Item("location") &" to "& objRelCollectorB.Item("location"), ORAPARM_INPUT, ORATYPE_VARCHAR2
522
    OraDatabase.Parameters.Add "USER_ID",  objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
523
    OraDatabase.Parameters.Add "OPERATION",NULL, ORAPARM_INPUT, ORATYPE_CHAR
524
 
525
    Set OraParameter = OraDatabase.Parameters
526
 
527
 
528
    On Error Resume Next
529
 
530
 
531
    ' Begin Database entry
532
    objEH.TryORA ( OraSession )
533
 
534
    '-- Add Packages --
535
    OraParameter("OPERATION").Value = "A"
536
    For Each PvId In aAddPkgList
537
        OraParameter("PV_ID").Value = PvId
538
        ' DEVI-45275, Merge into Planned (pending) table instead of release_content table.
539
        If Err.Number = 0 Then
540
            OraDatabase.ExecuteSQL _
541
            "BEGIN  "&_
542
            "  :VIEW_ID := PK_RELEASE.GET_PACKAGE_VIEW ( :PV_ID, :RTAG_A ); "&_
543
            "  PK_PLANNED.MERGE_PACKAGE ( :PV_ID, :VIEW_ID, :RTAG_B, :USER_ID, :OPERATION );  "&_
544
            "END;"
545
        End If
546
    Next
547
 
548
    '-- Remove Packages --
549
    If Err.Number = 0 Then
550
        OraParameter("OPERATION").Value = "S"
551
        For Each PvId In aRemovePkgList
552
            OraParameter("PV_ID").Value = PvId
553
 
554
            If Err.Number = 0 Then
555
                ' Does this PV_ID exist in the destination release's planned table?
556
                rc = Get_Record_Count ("PLANNED pl WHERE pl.pv_id = " & PvId & " AND pl.rtag_id = " & Request("rtagB") )
557
                If  rc > 0 Then
558
                    ' Given that merging now merges into pending, the merge page may be used to remove items that have
559
                    ' previously been merged but have not yet been committed to the destination release. For these,
560
                    ' we cannot call PK_RELEASE.GET_PACKAGE_VIEW(). We have to call PK_PLANNED.GET_PACKAGE_VIEW() instead.
561
                    OraDatabase.ExecuteSQL _
562
                    "BEGIN  "&_
563
                    "  :VIEW_ID := PK_PLANNED.GET_PACKAGE_VIEW ( :PV_ID, :RTAG_B ); "&_
564
                    "  PK_PLANNED.MERGE_PACKAGE ( :PV_ID, :VIEW_ID, :RTAG_B, :USER_ID, :OPERATION );  "&_
565
                    "END;"
566
                Else
567
                    ' DEVI-45275, Merge into Planned (pending) table instead of release_content table.
568
                    OraDatabase.ExecuteSQL _
569
                    "BEGIN  "&_
570
                    "  :VIEW_ID := PK_RELEASE.GET_PACKAGE_VIEW ( :PV_ID, :RTAG_B ); "&_
571
                    "  PK_PLANNED.MERGE_PACKAGE ( :PV_ID, :VIEW_ID, :RTAG_B, :USER_ID, :OPERATION );  "&_
572
                    "END;"
573
                End If
574
            End If
575
        Next
576
 
577
        '-- Log Project Merge Action
578
        If Err.Number = 0 Then
579
            OraDatabase.ExecuteSQL _
580
            "BEGIN  LOG_PROJECT_ACTION ( :PROJB, 'merge_release', :USER_ID, :COMMENTS, :RTAG_B );  END;"
581
        End If
582
 
583
    End If
584
 
585
    objEH.CatchORA ( OraSession )     ' sets up LastOraFailed as appropriate
586
 
587
    ' NOTE, The Touch_Release stored procedure does a commit itself, so we should not do it unless all the ExecuteSQL's we
588
    ' have just performed, were successful
589
    If objEH.LastOraFailed = FALSE Then
590
        '-- Force package state recalculate
591
        objEH.TryORA ( OraSession )
592
        OraDatabase.ExecuteSQL _
593
            "BEGIN  "&_
594
            "  TOUCH_RELEASE ( :RTAG_B );  "&_
595
            "END;"
596
        objEH.CatchORA ( OraSession )
597
    End If
598
 
599
    Set OraParameter = Nothing
600
    OraDatabase.Parameters.Remove "PV_ID"
601
    OraDatabase.Parameters.Remove "VIEW_ID"
602
    OraDatabase.Parameters.Remove "RTAG_A"
603
    OraDatabase.Parameters.Remove "RTAG_B"
604
    OraDatabase.Parameters.Remove "USER_ID"
605
    OraDatabase.Parameters.Remove "PROJB"
606
    OraDatabase.Parameters.Remove "COMMENTS"
607
    OraDatabase.Parameters.Remove "OPERATION"
608
    'Response.write "<br>"& sAddPkgList &"-"& dAddPkgList.Count &"-"& UBound( aFullList )
609
End Sub
610
'--------------------------------------------------------------------------------------------------------------------------
611
Function AddTrailingZeros(byval n, byval count)
612
    if len(n) >= count then
613
        AddTrailingZeros = n
614
        exit function
615
    end if
616
 
617
    dim c, s, i
618
    c = count - len(n)
619
 
620
    for i = 1 to c
621
        s = s & "0"
622
    next
623
    s = cstr(n) & s
624
 
625
    AddTrailingZeros = s
626
End function
627
'--------------------------------------------------------------------------------------------------------------------------
628
'------------ RUN BEFORE PAGE RENDER ----------
629
If Request("btn") = "Exit" Then
630
    Call OpenInWindow ( "index.asp" )
631
End If
632
 
633
' Get release details
634
Call GetFormDetails ( parRtagA, objRelCollectorA )
635
Call GetFormDetails ( parRtagB, objRelCollectorB )
636
setActiveProject (objRelCollectorB.Item("proj_id"))
637
isMergable = releaseIsMergable(objRelCollectorB.Item("official"))
638
 
639
If (Request("btn") = "Merge") AND isMergable Then
640
    Call MergePackages ()
641
End If
642
 
643
If Request("btn") = "Swap Compare" Then
644
    Call OpenInWindow ( ScriptName &"?rtagA="& parRtagB &"&rtagB="& parRtagA )
645
End If
646
 
647
If Request("btn") = "Hide" Then
648
    ' Store filter in cookie
649
    Response.Cookies(enum_RELMGR_COOKIE_DOMAIN)(COOKIE_HIDE_DIFF_FILTER) = Request("difilter")
650
End If
651
 
652
Call GetDiffFilterValues ( dDiffFilter )
653
'----------------------------------------------
654
%>
655
<html>
656
<head>
657
<title>Release Manager</title>
658
<link rel="shortcut icon" href="<%=FavIcon%>"/>
659
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
660
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
661
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
662
<link rel="stylesheet" href="images/navigation.css" type="text/css">
663
<script language="JavaScript" src="images/common.js"></script>
664
<script language="JavaScript" src="scripts/remote_scripting.js"></script>
665
 
666
<!-- TIPS -->
667
<script language="JavaScript" src="images/tipster.js"></script>
668
<script language="JavaScript" src="images/_help_tips.js"></script>
669
<script language="JavaScript" type="text/javascript">
670
<!--
671
 
672
function RequestReleaseCombo( paramString, rowId )
673
{
674
    var requestURL = 'RequestReleaseCombo.asp';
675
 
676
    // Set ajax divname
677
    ajaxdivname = rowId;
678
 
679
    //Append the name to search for to the requestURL
680
    var url = requestURL + paramString;
681
 
682
    //Progress
683
    //alert(MM_findObj( rowId ));
684
 
685
    //MM_findObj( rowId ).options[0] = new Option('Loading...','');
686
    //MM_findObj( rowId ).selectedIndex = 0;
687
    rowId.options[0] = new Option('Loading...','');
688
    rowId.selectedIndex = 0;
689
 
690
 
691
    //Create the xmlHttp object to use in the request
692
    //stateChangeHandler will fire when the state has changed, i.e. data is received back
693
    // This is non-blocking (asynchronous)
694
    xmlHttp = GetXmlHttpObject(stateComboChangeHandler);
695
 
696
    //Send the xmlHttp get to the specified url
697
    xmlHttp_Get(xmlHttp, url);
698
}
699
 
700
 
701
function MergePackage ( pkga, pkgb, rowId )
702
{
703
    // Set merge hidden field with new value
704
    MM_findObj( 'ADDPKG_' + rowId ).value = pkga;
705
 
706
    var divA = MM_findObj( 'PVA' + rowId );
707
    var divB = MM_findObj( 'PVB' + rowId );
708
 
709
    // Set text equal
710
    divB.innerHTML = divA.innerHTML;
711
 
712
    // Set highlight to blank
713
    divA.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';
714
    divB.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';
715
 
716
     // Set Change state icon to blank
717
    MM_findObj( 'IMGSTATE' + rowId ).style.display = 'none';
718
 
719
    // Remove Merge Button
720
    MM_findObj( 'IMGMERGE' + rowId ).style.display = 'none';
721
    MM_findObj( 'IMGREMOVE' + rowId ).style.display = 'none';
722
 
723
    // Show undo button
724
    MM_findObj( 'IMGUNDO' + rowId ).style.display = 'block';
725
}
726
 
727
 
728
function RemovePackage ( pkga, pkgb, rowId )
729
{
730
    // Set remove hidden field with new value
731
    MM_findObj( 'REMOVEPKG_' + rowId ).value = pkgb;
732
 
733
    var divA = MM_findObj( 'PVA' + rowId );
734
    var divB = MM_findObj( 'PVB' + rowId );
735
 
736
    // Set text equal
737
    divB.style.textDecoration = 'line-through';
738
 
739
    // Set highlight to blank
740
    if (MM_findObj( 'CHANGETYPE_' + rowId ).value != "A")
741
    {
742
        divA.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';
743
    }
744
    divB.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';
745
 
746
     // Set Change state icon to blank
747
    MM_findObj( 'IMGSTATE' + rowId ).style.display = 'none';
748
 
749
    // Remove Merge Button
750
    MM_findObj( 'IMGMERGE' + rowId ).style.display = 'none';
751
    MM_findObj( 'IMGREMOVE' + rowId ).style.display = 'none';
752
 
753
    // Show undo button
754
    MM_findObj( 'IMGUNDO' + rowId ).style.display = 'block';
755
}
756
 
757
 
758
 
759
function UndoPackage ( rowId )
760
{
761
    // Set merge/remove hidden field with new value
762
    MM_findObj( 'ADDPKG_' + rowId ).value = '';
763
    MM_findObj( 'REMOVEPKG_' + rowId ).value = '';
764
 
765
    var divA = MM_findObj( 'PVA' + rowId );
766
    var divB = MM_findObj( 'PVB' + rowId );
767
 
768
    // Set text equal
769
    divB.innerHTML = MM_findObj( 'UNDOPKG_' + rowId ).value;
770
    divB.style.textDecoration = 'none';
771
 
772
 
773
    // Set highlight to blank
774
    divA.style.backgroundColor = MM_findObj( 'UNDOCOLORA_' + rowId ).value;
775
    divB.style.backgroundColor = MM_findObj( 'UNDOCOLORB_' + rowId ).value;
776
 
777
     // Set Change state icon to blank
778
    MM_findObj( 'IMGSTATE' + rowId ).style.display = 'block';
779
 
780
    // Remove Merge Button
781
    var cht = MM_findObj( 'CHANGETYPE_' + rowId );
782
 
783
    if (cht.value == "R")
784
    {
785
        MM_findObj( 'IMGMERGE' + rowId ).style.display = 'block';
786
    }
787
    else if ( (cht.value == "A") || (cht.value == "") )
788
    {
789
        MM_findObj( 'IMGREMOVE' + rowId ).style.display = 'block';
790
    }
791
    else
792
    {
793
        MM_findObj( 'IMGMERGE' + rowId ).style.display = 'block';
794
        MM_findObj( 'IMGREMOVE' + rowId ).style.display = 'block';
795
    }
796
 
797
    // Show undo button
798
    MM_findObj( 'IMGUNDO' + rowId ).style.display = 'none';
799
}
800
 
801
 
802
function MergeAll()
803
{
804
    var elem
805
 
806
    if (document.all)
807
    {
808
        // Run this for IE
809
        elem = document.all;
810
    } else {
811
        // Run this for other browsers
812
        elem = document.getElementsByTagName('div');
813
    }
814
 
815
    for (i in elem)
816
    {
817
        if (elem[i].id)
818
        {
819
            if (elem[i].id.indexOf('SHORT_') == 0) elem[i].style.display = 'none';
820
            if (elem[i].id.indexOf('LONG_') == 0) elem[i].style.display = 'block';
821
        }
822
    }
823
}
824
 
825
//-->
826
</script>
827
 
828
</head>
829
<!-- TIPS LAYERS -------------------------------------->
830
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
831
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
832
<form name="FormName" method="post" action="<%=ScriptName%>">
833
    <!-- HEADER -->
834
    <!--#include file="_header.asp"-->
835
    <!-- BODY ---->
836
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
837
        <tr>
838
            <td width="20%">
839
            <td width="60%">
840
            <td width="20%">
841
        </tr>
842
        <tr>
843
            <td background="images/bg_home_orange.gif" valign="top">
844
                <!-- SELECT RELEASE A ---------------------------------------------->
845
                <br>
846
                <table width="100%"  border="0" cellspacing="10" cellpadding="0">
847
                    <tr>
848
                        <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>
849
                    </tr>
850
                    <tr>
851
                        <td align="left">
852
                            <select name="projA" class="form_item" onChange="RequestReleaseCombo( '?proj_id='+ this.value, FormName.rtagA );">
853
                                <option value="">-- Select Project --</option>
854
                                <%
855
                                OraDatabase.Parameters.Add "PROJ_ID",     objRelCollectorA.Item("proj_id"),    ORAPARM_INPUT, ORATYPE_NUMBER
856
 
857
                                Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ProjectsCombo.sql"), cint(0))
858
 
859
                                OraDatabase.Parameters.Remove "PROJ_ID"
860
 
861
                                While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
862
                                    <option value="<%=rsQry("proj_id")%>" <%=rsQry("selected")%>><%=rsQry("proj_name")%></option>
863
                                    <%rsQry.MoveNext
864
                                WEnd
865
 
866
                                rsQry.Close
867
                                Set rsQry = Nothing
868
                                %>
869
                            </select>
870
                        </td>
871
                    </tr>
872
                    <tr>
873
                        <td align="left">
874
                            <select name="rtagA" id="rtagA" class="form_item">
875
                                <%
876
                                OraDatabase.Parameters.Add "PROJ_ID",     objRelCollectorA.Item("proj_id"),    ORAPARM_INPUT,  ORATYPE_NUMBER
877
                                OraDatabase.Parameters.Add "RTAG_ID",     objRelCollectorA.Item("rtag_id"),    ORAPARM_INPUT, ORATYPE_NUMBER
878
 
879
                                Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ReleasesCombo.sql"), cint(0))
880
 
881
                                OraDatabase.Parameters.Remove "PROJ_ID"
882
                                OraDatabase.Parameters.Remove "RTAG_ID"
883
 
884
                                While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
885
                                        <option value="<%=rsQry("rtag_id")%>" <%=rsQry("selected")%>><%=rsQry("rtag_name")%></option>
886
                                    <%rsQry.MoveNext
887
                                WEnd
888
 
889
                                rsQry.Close
890
                                Set rsQry = Nothing
891
                                %>
892
                            </select>
893
                        </td>
894
                    </tr>
895
                    <%If (parRtagA <> "") Then%>
896
                        <tr>
897
                            <td align="left"><a href="dependencies.asp?rtag_id=<%=parRtagA%>" class="body_txt_drk">Go To Release A &raquo;</a></td>
898
                        </tr>
899
                    <%End If%>
900
                </table>
901
 
902
                <!-- SELECT RELEASE A END ---------------------------------------------->
903
            </td>
904
 
905
            <td rowspan="2" valign="top" background="images/bg_lght_gray.gif" align="center">
906
                <!-- DIFF -------------------------------------------------------->
907
                <br>
908
                <table width="100%" border="0" cellspacing="10" cellpadding="0">
909
                    <tr>
910
                        <td>
911
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
912
                                <tr>
913
                                    <td width="1%"></td>
914
                                    <td width="100%" align="left" class="form_ttl">DIFF / MERGE RELEASE
915
                                        <%If genReport Then%>
916
                                        &nbsp;[Generating Report]
917
                                        <%End If%>
918
                                        </td>
919
                                    <td width="1%"></td>
920
                                </tr>
921
                                <tr>
922
                                    <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
923
                                    <td background="images/lbox_bg_blue.gif" align="left" class="wform_ttl">&nbsp;</td>
924
                                    <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
925
                                </tr>
926
                                <tr>
927
                                    <td width="1%" bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
928
                                    <td bgcolor="#FFFFFF" valign="top" class="form_item">
929
                                        <table width="100%"  border="0" cellspacing="0" cellpadding="5">
930
                                            <tr>
931
                                                <td width="100%" bgcolor="#DAD7C8">
932
                                                    <input type="submit" name="btn" value="Compare" class="form_btn_comp" style="margin-right:5px;">
933
                                                    <input type="submit" name="btn" value="Swap Compare" class="form_btn_comp">
934
                                                    <span class="body_txt">
935
                                                        <input name="btn" type="submit" class="form_btn" value="Mail Me Report">
936
                                                        <% '<input name="btn" type="submit" class="form_btn" value="Show Me Report"> %>
937
                                                    </span>
938
                                                </td>
939
                                                <td width="1" align="right" bgcolor="#DAD7C8" nowrap>
940
                                                    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
941
                                                        <tr>
5684 dpurdie 942
                                                            <%
943
                                                                Dim mergeMessage, mergeDisabled
944
                                                                mergeDisabled = " disabled"
945
                                                                If (parRtagA = "") Then
946
                                                                    mergeMessage = "Select Release A"
947
                                                                ElseIf (parRtagB = "") Then  
948
                                                                    mergeMessage = "Select Release B"
949
                                                                ElseIf NOT isMergable Then  
950
                                                                    mergeMessage = "Release B cannot be modified"
951
                                                                Else
952
                                                                    mergeDisabled = ""
953
                                                                End If
954
                                                            %>
955
                                                            <td class="err_alert nowrap" style="padding-right:1em">
956
                                                                <%=mergeMessage%>
957
                                                            </td>
5357 dpurdie 958
                                                            <td>
5684 dpurdie 959
                                                                <input type="submit" name="btn" value="Merge" class="form_btn_comp" style="margin-right:10px;" <%=mergeDisabled%>>
5357 dpurdie 960
                                                            </td>
961
                                                            <td>
962
                                                                <input type="submit" name="btn" value="Exit" class="form_btn_comp">
963
                                                            </td>
964
                                                        </tr>
965
                                                    </table>
966
                                                </td>
967
                                            </tr>
968
                                            <tr>
969
                                                <td>
970
                                                    <%If (parRtagA <> "") AND (parRtagB <> "")Then%>
971
                                                        <!-- DIFF FILTER +++++++++++++++++++++++++++++++++++++++++++ -->
972
                                                        <fieldset style="width:150px;">
973
                                                            <legend><a href="javascript:;" class="body_scol" onClick="ToggleDisplay('divDiffFilter');" ><%=GetIsDiffFilterInUseIcon() %>&nbsp;Filter&nbsp;Results...</a></legend>
974
                                                            <div name="divDiffFilter" id="divDiffFilter" class="body_txt" style="display:none;">
975
                                                                <br>
976
                                                                <table width="100%"  border="0" cellspacing="1" cellpadding="3">
977
                                                                    <tr>
978
                                                                        <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>
979
                                                                        <td width="50" nowrap background="images/bg_action_norm.gif" class="form_field"><%=LIMG_UPDATED%>Updated</td>
980
                                                                    </tr>
981
                                                                    <tr>
982
                                                                        <td background="images/bg_action_norm.gif"><input type="checkbox" name="difilter" value="<%=enumDB_NUM_DIFF_NEW%>" <%=GetIsDiffFilterChecked(enumDB_NUM_DIFF_NEW)%>></td>
983
                                                                        <td nowrap background="images/bg_action_norm.gif" class="form_field"><%=LIMG_ADDED%>Added</td>
984
                                                                    </tr>
985
                                                                    <tr>
986
                                                                        <td background="images/bg_action_norm.gif"><input type="checkbox" name="difilter" value="<%=enumDB_NUM_DIFF_REMOVED%>" <%=GetIsDiffFilterChecked(enumDB_NUM_DIFF_REMOVED)%>></td>
987
                                                                        <td nowrap background="images/bg_action_norm.gif" class="form_field"><%=LIMG_REMOVED%>Removed</td>
988
                                                                    </tr>
989
                                                                    <tr>
990
                                                                        <td background="images/bg_action_norm.gif"><input type="checkbox" name="difilter" value="<%=enumDB_NUM_DIFF_RIPPLE%>" <%=GetIsDiffFilterChecked(enumDB_NUM_DIFF_RIPPLE)%>></td>
991
                                                                        <td nowrap background="images/bg_action_norm.gif" class="form_field"><%=LIMG_RIPPLED%>Rippled</td>
992
                                                                    </tr>
993
                                                                    <tr>
994
                                                                        <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>
995
                                                                        <td nowrap background="images/bg_action_norm.gif" class="form_field">Unchanged</td>
996
                                                                    </tr>
997
                                                                    <tr>
998
                                                                        <td background="images/bg_action_norm.gif">&nbsp;</td>
999
                                                                        <td background="images/bg_action_norm.gif"><input name="btn" type="submit" class="form_btn" value="Hide"></td>
1000
                                                                    </tr>
1001
                                                                </table>
1002
                                                            </div>
1003
                                                        </fieldset>
1004
                                                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
1005
                                                    <%End If%>
1006
                                                </td>
1007
                                                <td></td>
1008
                                            </tr>
1009
                                        </table>
1010
 
1011
                                        <%
1012
                                        ' Successfull Merge
1013
                                        If (Request("btn") = "Merge") Then
1014
                                            Call Messenger ( "Merge has completed successfully.", 3, "100%" )
1015
                                        End If
1016
 
1017
                                        Set FSO=Server.CreateObject("Scripting.FileSystemObject")
1018
                                        Set NewTextFile=FSO.CreateTextFile(Server.MapPath("docs\compareReleases_"&objAccessControl.UserName&".html"), true)
1019
 
1020
                                        Call Header()
1021
 
1022
                                        If (parRtagA <> "") AND (parRtagB <> "")Then%>
1023
                                            <table width="100%"  border="0" cellspacing="1" cellpadding="0">
1024
                                                <tr>
1025
                                                    <td width="50%" bgcolor="#E4E9EC" class="body_row" nowrap><%= ReleaseIcon(objRelCollectorA.Item("official")) & objRelCollectorA.Item("location")%> </td>
1026
                                                    <td width="1" bgcolor="#E4E9EC"><img src="images/spacer.gif" width="20" height="1"></td>
1027
                                                    <td width="1" bgcolor="#E4E9EC"><img src="images/spacer.gif" width="20" height="20"></td>
1028
                                                    <td width="1" bgcolor="#E4E9EC"><img src="images/spacer.gif" width="20" height="1"></td>
1029
                                                    <td width="50%" bgcolor="#E4E9EC" class="body_row" nowrap><%= ReleaseIcon(objRelCollectorB.Item("official")) & objRelCollectorB.Item("location")%></td>
1030
                                                    <td width="1" bgcolor="#E4E9EC"><img src="images/spacer.gif" width="20" height="1"></td>
1031
                                                </tr>
1032
                                                <%
1033
                                                OraDatabase.Parameters.Add "RTAG_A",     parRtagA,    ORAPARM_INPUT, ORATYPE_NUMBER
1034
                                                OraDatabase.Parameters.Add "RTAG_B",     parRtagB,    ORAPARM_INPUT, ORATYPE_NUMBER
1035
                                                OraDatabase.Parameters.Add "NO_CHANGE", GetIsDiffFilterChecked(enumDB_NUM_DIFF_NO_CHANGE), ORAPARM_INPUT, ORATYPE_VARCHAR2
1036
                                                OraDatabase.Parameters.Add "ADDED",      GetIsDiffFilterChecked(enumDB_NUM_DIFF_NEW),         ORAPARM_INPUT, ORATYPE_VARCHAR2
1037
                                                OraDatabase.Parameters.Add "UPDATED",    GetIsDiffFilterChecked(enumDB_NUM_DIFF_UPDATED),    ORAPARM_INPUT, ORATYPE_VARCHAR2
1038
                                                OraDatabase.Parameters.Add "REMOVED",    GetIsDiffFilterChecked(enumDB_NUM_DIFF_REMOVED),    ORAPARM_INPUT, ORATYPE_VARCHAR2
1039
 
1040
                                                Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ReleaseDiff.sql"), cint(0))
1041
 
1042
                                                OraDatabase.Parameters.Remove "RTAG_A"
1043
                                                OraDatabase.Parameters.Remove "RTAG_B"
1044
                                                OraDatabase.Parameters.Remove "NO_CHANGE"
1045
                                                OraDatabase.Parameters.Remove "ADDED"
1046
                                                OraDatabase.Parameters.Remove "UPDATED"
1047
                                                OraDatabase.Parameters.Remove "REMOVED"
1048
 
1049
                                                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))
1050
                                                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))
1051
 
1052
                                                Call Javascript()
1053
                                                Call Styles()
1054
 
1055
                                                NewTextFile.WriteLine("<title>Difference Report Between "&rsQryA("proj_name")&" "&rsQryA("rtag_name")&" and "&rsQryB("proj_name")&" "&rsQryB("rtag_name")&"</title>")
1056
                                                NewTextFile.WriteLine("<div class=""page_title"">Difference Report Between "&rsQryA("proj_name")&" "&rsQryA("rtag_name")&" and "&rsQryB("proj_name")&" "&rsQryB("rtag_name")&"</div><br>")
1057
                                                NewTextFile.WriteLine("<b>Key:</b><br><blockquote>")
1058
                                                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>")
1059
                                                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>")
1060
                                                NewTextFile.WriteLine("<span class=changesnone><b>Grey Text</b></span><span class=textnone> No Source Code Changes to a Package in either Release.</span>")
1061
                                                NewTextFile.WriteLine("</blockquote>")
1062
 
1063
                                                NewTextFile.WriteLine("<b>Toggle Sections:</b><blockquote>")
1064
                                                NewTextFile.WriteLine("<a href=""javascript:;"" onClick=""MM_toggleAll('divPkgInfo','1');"">Expand All</a>")
1065
                                                NewTextFile.WriteLine("<a href=""javascript:;"" onClick=""MM_toggleAll('divPkgInfo','');"">Collapse All</a>")
1066
                                                NewTextFile.WriteLine("</blockquote>")
1067
 
1068
                                                Dim currView_id
1069
                                                currView_id = -1
1070
 
1071
                                                While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
1072
                                                    errormsg = false
1073
                                                    rowId = rsQry("pv_id_a") &"_"& rsQry("pv_id_b")
1074
 
1075
                                                    btnMerge = LIMG_MERGE
1076
                                                    btnRemove = LIMG_REMOVE
1077
                                                    colorA = LCOLOR_NOT_CHANGED
1078
                                                    colorB = LCOLOR_NOT_CHANGED
1079
 
1080
                                                    changeType = rsQry("change_type")
1081
                                                    isaSdk = rsQry("PKG_SDK_B")
1082
 
1083
                                                    Select Case changeType
1084
                                                        Case "U"
1085
                                                            colorA = LCOLOR_CHANGED
1086
                                                            colorB = LCOLOR_CHANGED
1087
                                                        Case "UW"
1088
                                                            colorA = LCOLOR_CHANGED
1089
                                                            colorB = LCOLOR_CHANGED
1090
                                                            btnMerge = LIMG_MERGE_WARN
1091
                                                        Case "UR"
1092
                                                            colorA = LCOLOR_RIPPLED
1093
                                                            colorB = LCOLOR_RIPPLED
1094
                                                        Case "A"
1095
                                                            colorA = LCOLOR_BLANK
1096
                                                        Case "R"
1097
                                                            colorB = LCOLOR_BLANK
1098
                                                    End Select
1099
 
1100
                                                    Call GetDiffStateIcon ( changeType, ChangeTypeIcon )
1101
 
1102
                                                    If changeType = "U" OR changeType = "UW" OR changeType = "UR" Then
1103
                                                        Dim MajorA, MajorB, MinorA, MinorB, PatchA, PatchB, BuildA, BuildB, pos, pkgVersionA, pkgVersionB, majMinA, majMinB
1104
                                                        MajorA = NULL
1105
                                                        MajorB = NULL
1106
                                                        MinorA = NULL
1107
                                                        MinorB = NULL
1108
 
1109
                                                        pkgVersionA = rsQry("pkg_version_a")
1110
                                                        pkgVersionB = rsQry("pkg_version_b")
1111
 
1112
                                                        PatchA = rsQry("patch_number_a")
1113
                                                        PatchB = rsQry("patch_number_b")
1114
                                                        BuildA = rsQry("build_number_a")
1115
                                                        BuildB = rsQry("build_number_b")
1116
 
1117
 
1118
                                                        ' Find the first occurence of the dot in package version A
1119
                                                        pos = InStr(pkgVersionA, ".")
1120
                                                        If pos <> 0 Then
1121
                                                            ' Extract the Major Version for A
1122
                                                            MajorA = Mid(pkgVersionA, 1, pos - 1)
1123
                                                            ' Delete the Major Version Value from the string to get the minor and patch version
1124
                                                            pkgVersionA = Mid(pkgVersionA, pos + 1, Len(pkgVersionA))
1125
                                                            ' Find the second occurence of the dot in package version A
1126
                                                            pos = InStr(pkgVersionA, ".")
1127
                                                            ' Extract the Minor Version for A
1128
                                                            If pos <> 0 Then
1129
                                                                MinorA = Mid(pkgVersionA, 1, pos - 1)
1130
                                                            End If
1131
                                                        End If
1132
 
1133
                                                        ' Find the first occurence of the dot in package version B
1134
                                                        pos = InStr(pkgVersionB, ".")
1135
                                                        If pos <> 0 Then
1136
                                                            ' Extract the Major Version for B
1137
                                                            MajorB = Mid(pkgVersionB, 1, pos - 1)
1138
                                                            ' Delete the Major Version Value from the string to get the minor and patch version
1139
                                                            pkgVersionB = Mid(pkgVersionB, pos + 1, Len(pkgVersionB))
1140
                                                            ' Find the second occurence of the dot in package version B
1141
                                                            pos = InStr(pkgVersionB, ".")
1142
                                                            ' Extract the Minor Version for B
1143
                                                            If pos <> 0 Then
1144
                                                                MinorB = Mid(pkgVersionB, 1, pos - 1)
1145
                                                            End If
1146
                                                        End If
1147
 
1148
                                                        If MajorA = MajorB Then
1149
                                                            If MinorA = MinorB Then
1150
                                                                If IsNumeric(PatchA) AND IsNumeric(PatchB) Then
1151
                                                                    If CInt(PatchB) > CInt(PatchA) Then
1152
                                                                        btnMerge = LIMG_MERGE_WARN
1153
                                                                    Else
1154
                                                                        btnMerge = LIMG_MERGE
1155
                                                                    End If
1156
                                                                End If
1157
                                                            Else
1158
                                                                If IsNumeric(MinorA) AND IsNumeric(MinorB) Then
1159
                                                                    If CInt(MinorB) > CInt(MinorA) Then
1160
                                                                        btnMerge = LIMG_MERGE_WARN
1161
                                                                    Else
1162
                                                                        btnMerge = LIMG_MERGE
1163
                                                                    End If
1164
                                                                End If
1165
                                                            End If
1166
                                                        Else
1167
                                                            If IsNumeric(MajorA) AND IsNumeric(MajorB) Then
1168
                                                                If     CInt(MajorB) > CInt(MajorA) Then
1169
                                                                    btnMerge = LIMG_MERGE_WARN
1170
                                                                Else
1171
                                                                    btnMerge = LIMG_MERGE
1172
                                                                End If
1173
                                                            End If
1174
                                                        End If
1175
                                                    End If
1176
 
1177
                                                    ' -------- FILTERS RIPPLE BUILDS WHEN CHECKED -----------------
1178
                                                    If NOT (GetIsDiffFilterChecked(enumDB_NUM_DIFF_RIPPLE) = "checked" AND changeType = "UR") THEN
1179
 
1180
                                                        ' -------- GROUP BY BASE VIEW  -----------------
1181
                                                        If CDbl(currView_id) <> CDbl(rsQry("view_id")) Then%>
1182
                                                            <tr>
1183
                                                                <td valign="top" nowrap class="form_ttl"><b><%=rsQry("view_name")%></b></td>
1184
                                                                <td class="form_ttl">&nbsp;</td>
1185
                                                                <td class="form_ttl">&nbsp;</td>
1186
                                                                <td class="form_ttl">&nbsp;</td>
1187
                                                                <td class="form_ttl">&nbsp;</td>
1188
                                                                <td class="form_ttl">&nbsp;</td>
1189
                                                            </tr>
1190
                                                            <%
1191
                                                            currView_id = CDbl(rsQry("view_id"))
1192
                                                        End If
1193
                                                        ' -------- END GROUP ------------------------
1194
                                                        %>
1195
                                                        <%
1196
                                                        'Determine if we are dealing with a PV_ID that we have already encountered and displayed as a pending addition
1197
                                                        'If we are, we do not need to display anything more about it, so skip the row.
1198
                                                        ' NOTE. the result set is sorted by change type (see releasediff.sql) such that if there are multiple entries
1199
                                                        '         for the same PV_ID, they are sorted in the following order: unchanged, additions, removals, updates.
1200
                                                        '         This is important to the row skip filtering carried out below.
1201
                                                        Dim skipRow
1202
                                                        If rsQry("pv_id_a") Then
1203
                                                            skipRow = pendingAdditions.Exists(CStr(rsQry("pv_id_a")))
1204
                                                        Else
1205
                                                            skipRow = FALSE
1206
                                                        End If
1207
                                                        %>
1208
                                                        <%If NOT skipRow Then%>
1209
                                                            <tr>
1210
                                                                <td class="body_row" nowrap>
1211
                                                                    <DIV id="PVA<%=rowId%>" style="background:<%=colorA%>; padding:5px;">
1212
                                                                        <%=rsQry("pkg_name_a") &" "& rsQry("pkg_version_a")%>
1213
                                                                    </DIV>
1214
                                                                    <input type="hidden" id="UNDOCOLORA_<%=rowId%>" value="<%=colorA%>">
1215
                                                                </td>
1216
 
1217
                                                                <%
1218
                                                                Dim pkgADisplayControl
1219
                                                                pkgADisplayControl = isMergable
1220
                                                                If IsNull( changeType ) OR (changeType = "A")  OR (changeType = "0") Then pkgADisplayControl = FALSE
1221
                                                                If isaSdk Then pkgADisplayControl = FALSE
1222
                                                                %>
1223
                                                                <td bgcolor="#F5F5F5">
1224
                                                                    <%If pkgADisplayControl Then%>
1225
                                                                        <DIV id="IMGMERGE<%=rowId%>"><a href="javascript:;" onClick="MergePackage( '<%=rsQry("pv_id_a")%>', '<%=rsQry("pv_id_b")%>', '<%=rowId%>' );"><%=btnMerge%></a></DIV>
1226
                                                                    <%End If%>
1227
                                                                </td>
1228
 
1229
                                                                <td bgcolor="#E4E9EC">
1230
                                                                    <DIV id="IMGSTATE<%=rowId%>" ><%=ChangeTypeIcon%></DIV>
1231
                                                                    <input type="hidden" id="CHANGETYPE_<%=rowId%>" value="<%=changeType%>">
1232
                                                                </td>
1233
 
1234
                                                                <%
1235
                                                                Dim pkgBDisplayControl
1236
                                                                pkgBDisplayControl = isMergable
1237
                                                                If changeType = "R" Then pkgBDisplayControl = FALSE
1238
                                                                If isaSdk Then pkgBDisplayControl = FALSE
1239
                                                                %>
1240
                                                                <td bgcolor="#F5F5F5">
1241
                                                                    <%If pkgBDisplayControl Then%>
1242
                                                                        <DIV id="IMGREMOVE<%=rowId%>" ><a href="javascript:;" onClick="RemovePackage( '<%=rsQry("pv_id_a")%>', '<%=rsQry("pv_id_b")%>', '<%=rowId%>' );"><%=btnRemove%></a></DIV>
1243
                                                                    <%ElseIf isaSdk Then %> 
1244
                                                                        <DIV ><%=LIMG_SDK%></DIV>
1245
                                                                    <%End If%>
1246
                                                                </td>
1247
 
1248
                                                                <td class="body_row" nowrap>
1249
                                                                    <DIV id="PVB<%=rowId%>" style="background:<%=colorB%>; padding:5px;">
1250
                                                                        <%If IsNull(rsQry("pv_id_b")) Then %>
1251
                                                                            <%If Is_Pending_Sub(Request("rtagB"), rsQry("pv_id_a")) Then%>
1252
                                                                                (removal pending<%=Quick_Help("RemovalPending")%>)
1253
                                                                            <%End If %>
1254
                                                                        <%Else%>
1255
                                                                            <%=rsQry("pkg_name_b") &" "& rsQry("pkg_version_b")%>
1256
                                                                            <%If Is_Pending_Add(Request("rtagB"), rsQry("pv_id_b")) Then%>
1257
                                                                                (addition pending<%=Quick_Help("AdditionPending")%>)
1258
                                                                                <% 'Add this pending addition to the dictionary so that we can filter out REMOVED entries
1259
                                                                                    'with identical PV_ID's that we might encounter further on in the result set
1260
                                                                                If NOT pendingAdditions.Exists(rsQry("pv_id_b")) Then
1261
                                                                                    pendingAdditions.Add CStr(rsQry("pv_id_b")), CStr(rsQry("pkg_version_b"))
1262
                                                                                End If%>
1263
                                                                            <%ElseIf Is_Pending_Sub(Request("rtagB"), rsQry("pv_id_b")) Then%>
1264
                                                                                (removal pending<%=Quick_Help("RemovalPending")%>)
1265
                                                                            <%End If %>
1266
                                                                        <%End If %>
1267
                                                                    </DIV>
1268
                                                                    <input type="hidden" id="UNDOCOLORB_<%=rowId%>" value="<%=colorB%>">
1269
                                                                    <input type="hidden" name="addpkg" id="ADDPKG_<%=rowId%>" value="">
1270
                                                                    <input type="hidden" name="removepkg" id="REMOVEPKG_<%=rowId%>" value="">
1271
                                                                    <input type="hidden" id="UNDOPKG_<%=rowId%>" value="<%=rsQry("pkg_name_b") &" "& rsQry("pkg_version_b")%>">
1272
                                                                </td>
1273
 
1274
                                                                <td bgcolor="#F5F5F5">
1275
                                                                    <DIV id="IMGUNDO<%=rowId%>" style="display:none;" >
1276
                                                                        <a href="javascript:;" onClick="UndoPackage( '<%=rowId%>' );"><%=LIMG_UNDO%></a>
1277
                                                                    </DIV>
1278
                                                                </td>
1279
                                                            </tr>
1280
                                                        <%End If %>
1281
 
1282
                                                        <%
1283
                                                        If genReport AND NOT skipRow  Then
1284
                                                            If rsQry("pv_id_a") Then
1285
                                                                Set rsQryCommentsA = OraDatabase.DbCreateDynaset( "SELECT COMMENTS FROM PACKAGE_VERSIONS WHERE PV_ID="& rsQry("pv_id_a"), cint(0))
1286
                                                            End If
1287
 
1288
                                                            If rsQry("pv_id_b") Then
1289
                                                                Set rsQryCommentsB = OraDatabase.DbCreateDynaset( "SELECT COMMENTS FROM PACKAGE_VERSIONS WHERE PV_ID="& rsQry("pv_id_b"), cint(0))
1290
                                                            End If
1291
 
1292
                                                            pkgA = rsQry("pkg_name_a")
1293
                                                            pkgB = rsQry("pkg_name_b")
1294
 
1295
                                                            If pkgA <> "" then
1296
                                                                pkgname = pkgA
1297
                                                            Else
1298
                                                                pkgname = pkgB
1299
                                                            End If
1300
 
1301
                                                            If changeType = "U" OR  changeType = "UW" Then
1302
                                                                ChangeASource = false
1303
                                                                ChangeAUpdate = false
1304
                                                                ChangeBSource = false
1305
                                                                ChangeBUpdate = false
1306
 
1307
                                                                'NewTextFile.WriteLine("<br><b><font face="&chr(34)&"arial"&chr(34)&">"&pkgname&"</font></b>")
1308
                                                                NewTextFile.Write("<a href=""javascript:;"" class=""body_scol"" onClick=""toggleSPAN('"& rowId &"');"">"& pkgname &"</a>")
1309
                                                                NewTextFile.WriteLine("<DIV class=divPkgInfo id=""spanPkgInfo"& rowId &""" name=""spanPkgInfo"" style=""display:none;"">")
1310
                                                                NewTextFile.Write(rsQryA("rtag_name")&" uses: "&rsQry("pkg_version_a")&" (")
1311
                                                                Call Release(rsQry("pv_id_a"))
1312
                                                                NewTextFile.WriteLine(")<br>")
1313
                                                                NewTextFile.Write(rsQryB("rtag_name")&" uses: "&rsQry("pkg_version_b")&" (")
1314
                                                                Call Release(rsQry("pv_id_b"))
1315
                                                                NewTextFile.WriteLine(")<br>")
1316
 
1317
                                                                a = rsQry("pv_id_a")
1318
                                                                b = rsQry("pv_id_b")
1319
                                                                c = rsQry("pv_id_a")
1320
                                                                d = rsQry("pv_id_b")
1321
 
1322
                                                                Set pvCollectionA = CreateObject("Scripting.Dictionary")
1323
                                                                Set pvCollectionB = CreateObject("Scripting.Dictionary")
1324
                                                                On Error Resume Next
1325
                                                                While CLng(a) <> CLng(b) and NOT errormsg
1326
 
1327
                                                                    'NewTextFile.WriteLine("A: "&a)
1328
                                                                    'NewTextFile.WriteLine("B: "&b)
1329
                                                                    pvCollectionA.Add CStr(a), Empty
1330
                                                                    pvCollectionB.Add CStr(b), Empty
1331
                                                                    If CLng(a) > CLng(b) Then
1332
                                                                        'NewTextFile.WriteLine("TestA")
1333
                                                                        Call LastPvIdA(a)
1334
                                                                    ElseIf CLng(b) > CLng(a) Then
1335
                                                                        'NewTextFile.WriteLine("TestB")
1336
                                                                        Call LastPvIdB(b)
1337
                                                                    End If
1338
                                                                Wend
1339
 
1340
                                                                Set pvCollectionA = Nothing
1341
                                                                Set pvCollectionB = Nothing
1342
 
1343
                                                                Call pkg_Version(a)
1344
                                                                NewTextFile.Write("Common PARENT package version: "&pkgversion&" (")
1345
                                                                Call Release(a)
1346
                                                                NewTextFile.WriteLine(")<br><br>")
1347
                                                                NewTextFile.WriteLine()
1348
                                                                NewTextFile.WriteLine("<b>"&rsQryA("rtag_name")&"</b>")
1349
 
1350
                                                                If pkgversion <> rsQry("pkg_version_a") Then
1351
                                                                    NewTextFile.WriteLine("<blockquote><b><i>Versions between "& pkgversion &" and "& rsQry("pkg_version_a")&"</i></b></blockquote>")
1352
 
1353
                                                                    If errormsg Then
1354
                                                                        NewTextFile.WriteLine("Error determining root!<br>")
1355
                                                                        NewTextFile.WriteLine()
1356
                                                                    End If
1357
 
1358
                                                                    source_change = false
1359
 
1360
                                                                    While CLng(a) <> CLng(c) and NOT errormsg
1361
                                                                        Call Comments(c)
1362
                                                                        If scFlag = TRUE Then
1363
                                                                            Call GetFixedIssues(c)
1364
                                                                        End If
1365
                                                                        Call LastPvIdAa(c)
1366
                                                                        NewTextFile.WriteLine()
1367
                                                                    Wend
1368
 
1369
                                                                    If source_change = false Then
1370
                                                                        NewTextFile.WriteLine("<blockquote><b><i>No source changes to "& rsQryA("rtag_name")&". Only Rippled Builds.</i></b></blockquote><br>")
1371
                                                                        ChangeASource = true
1372
                                                                    End If
1373
 
1374
                                                                    Call pkg_Version(b)
1375
                                                                    NewTextFile.WriteLine()
1376
                                                                    NewTextFile.WriteLine()
1377
 
1378
                                                                ElseIf pkgversion = rsQry("pkg_version_a") Then
1379
                                                                    NewTextFile.WriteLine("<blockquote><b><i>No updates to "& rsQryA("rtag_name")&"</i></b></blockquote><br>")
1380
                                                                    ChangeAUpdate = true
1381
                                                                    NewTextFile.WriteLine()
1382
                                                                End If
1383
 
1384
                                                                NewTextFile.WriteLine("<b>"&rsQryB("rtag_name")&"</b>")
1385
 
1386
                                                                If pkgversion <> rsQry("pkg_version_b") Then
1387
                                                                    NewTextFile.WriteLine("<blockquote><b><i>Versions between "& pkgversion &" and "& rsQry("pkg_version_b")&"</i></b></blockquote>")
1388
 
1389
                                                                    If errormsg Then
1390
                                                                        NewTextFile.WriteLine("Error determining root!<br>")
1391
                                                                        NewTextFile.WriteLine()
1392
                                                                    End If
1393
 
1394
                                                                    source_change = false
1395
 
1396
                                                                    While CLng(b) <> CLng(d) and NOT errormsg
1397
                                                                        Call Comments(d)
1398
                                                                        If scFlag = TRUE Then
1399
                                                                            Call GetFixedIssues(d)
1400
                                                                        End If
1401
                                                                        Call LastPvIdBb(d)
1402
                                                                        NewTextFile.WriteLine()
1403
                                                                    Wend
1404
 
1405
                                                                    If source_change = false Then
1406
                                                                        NewTextFIle.WriteLine("<blockquote><b><i>No source changes to "& rsQryB("rtag_name")&". Only Rippled Builds.</i></b></blockquote><br>")
1407
                                                                        ChangeBSource = true
1408
                                                                    End If
1409
 
1410
                                                                ElseIf pkgversion = rsQry("pkg_version_b") Then
1411
                                                                    NewTextFile.WriteLine("<blockquote><b><i>No updates to "& rsQryB("rtag_name")&"</i></b></blockquote><br>")
1412
                                                                    ChangeBUpdate = true
1413
                                                                    NewTextFile.WriteLine()
1414
                                                                End If
1415
 
1416
                                                                NewTextFile.WriteLine("</DIV>")
1417
 
1418
                                                                If ChangeASource Then
1419
                                                                    If ChangeBSource Then
1420
                                                                        NewTextFile.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>")
1421
                                                                    ElseIf ChangeBUpdate Then
1422
                                                                        NewTextFile.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>")
1423
                                                                    ElseIf NOT ChangeBSource AND NOT ChangeBUpdate Then
1424
                                                                        NewTextFile.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>")
1425
                                                                    End If
1426
                                                                End If
1427
 
1428
                                                                If ChangeBSource Then
1429
                                                                    If NOT ChangeAUpdate Then
1430
                                                                        If NOT ChangeASource AND NOT ChangeBUpdate Then
1431
                                                                            NewTextFile.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>")
1432
                                                                        End If
1433
                                                                    End If
1434
                                                                End If
1435
 
1436
                                                                If NOT ChangeASource Then
1437
                                                                    If NOT ChangeAUpdate Then
1438
                                                                        If NOT ChangeBSource AND NOT ChangeBUpdate Then
1439
                                                                            NewTextFile.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>")
1440
                                                                        ElseIf ChangeBUpdate Then
1441
                                                                            NewTextFile.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>")
1442
                                                                        End If
1443
                                                                    ElseIf ChangeAUpdate Then
1444
                                                                        If NOT ChangeBSource AND NOT ChangeBUpdate Then
1445
                                                                            NewTextFile.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>")
1446
                                                                        ElseIf ChangeBSource Then
1447
                                                                            NewTextFile.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>")
1448
                                                                        End If
1449
                                                                    End If
1450
                                                                End If
1451
 
1452
                                                            End If  'changeType = "U" OR  changeType = "UW"
1453
 
1454
                                                        End If  'email
1455
 
1456
                                                    End If 'NOT (GetIsDiffFilterChecked(enumDB_NUM_DIFF_RIPPLE) = "checked" AND changeType = "UR")
1457
 
1458
                                                    rsQry.MoveNext
1459
                                                WEnd
1460
 
1461
                                                rsQry.Close
1462
                                                Set rsQry = Nothing
1463
                                                %>
1464
                                                <%
1465
                                                Call Footer()
1466
                                                NewTextFile.Close
1467
                                                Set NewTextFile=Nothing
1468
                                                %>
1469
                                            </table>
1470
                                            <br>
1471
                                        <%Else%>
1472
                                            <br>
1473
                                            <%
1474
                                            If (parRtagB <> "") Then
1475
                                                Call Messenger ( "Select <b>Release A</b> to compare.", 3, "100%" )
1476
                                            ElseIf (parRtagA <> "") Then
1477
                                                Call Messenger ( "Select <b>Release B</b> to compare.", 3, "100%" )
1478
                                            Else
1479
                                                Call Messenger ( "Select <b>Release A</b> and <b>Release B</b> to compare.", 3, "100%" )
1480
                                            End If
1481
                                            %>
1482
                                        <%End If%>
1483
                                    </td>
1484
                                    <td width="1%" background="images/lbox_bgside_white.gif">&nbsp;</td>
1485
                                </tr>
1486
                                <tr>
1487
                                    <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
1488
                                    <td background="images/lbox_bg_blue.gif"></td>
1489
                                    <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>
1490
                                </tr>
1491
                            </table>
1492
                        </td>
1493
                    </tr>
1494
                </table>
1495
                <!-- DIFF END ---------------------------------------------------->
1496
            </td>
1497
            <td valign="top" background="images/bg_home_orange.gif">
1498
 
1499
                <!-- SELECT RELEASE B ---------------------------------------------->
1500
                <br>
1501
                <table width="100%"  border="0" cellspacing="10" cellpadding="0">
1502
                    <tr>
1503
                        <td align="left" class="body_col">
1504
                            <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>
1505
                        </td>
1506
                    </tr>
1507
                    <tr>
1508
                        <td align="left">
1509
                            <select name="projB" class="form_item" onChange="RequestReleaseCombo( '?proj_id='+ this.value, FormName.rtagB );">
1510
                                <option value="">-- Select Project --</option>
1511
                                <%
1512
                                OraDatabase.Parameters.Add "PROJ_ID",     objRelCollectorB.Item("proj_id"),    ORAPARM_INPUT, ORATYPE_NUMBER
1513
 
1514
                                Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ProjectsCombo.sql"), cint(0))
1515
 
1516
                                OraDatabase.Parameters.Remove "PROJ_ID"
1517
 
1518
                                While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
1519
                                    <option value="<%=rsQry("proj_id")%>" <%=rsQry("selected")%>><%=rsQry("proj_name")%></option>
1520
                                    <%rsQry.MoveNext
1521
                                WEnd
1522
 
1523
                                rsQry.Close
1524
                                Set rsQry = Nothing
1525
                                %>
1526
                            </select>
1527
                        </td>
1528
                    </tr>
1529
                    <tr>
1530
                        <td align="left">
1531
                            <select name="rtagB" id="rtagB" class="form_item">
1532
                                <%
1533
                                OraDatabase.Parameters.Add "PROJ_ID",     objRelCollectorB.Item("proj_id"),    ORAPARM_INPUT,  ORATYPE_NUMBER
1534
                                OraDatabase.Parameters.Add "RTAG_ID",     objRelCollectorB.Item("rtag_id"),    ORAPARM_INPUT, ORATYPE_NUMBER
1535
 
1536
                                Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ReleasesCombo.sql"), cint(0))
1537
 
1538
                                OraDatabase.Parameters.Remove "PROJ_ID"
1539
                                OraDatabase.Parameters.Remove "RTAG_ID"
1540
 
1541
                                While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
1542
                                        <option value="<%=rsQry("rtag_id")%>" <%=rsQry("selected")%>><%=rsQry("rtag_name")%></option>
1543
                                    <%rsQry.MoveNext
1544
                                WEnd
1545
 
1546
                                rsQry.Close
1547
                                Set rsQry = Nothing
1548
                                %>
1549
                            </select>
1550
                        </td>
1551
                    </tr>
1552
                    <%If (parRtagB <> "") Then%>
1553
                        <tr>
1554
                            <td align="left"><a href="dependencies.asp?rtag_id=<%=parRtagB%>" class="body_txt_drk">Go To Release B &raquo;</a></td>
1555
                        </tr>
1556
                    <%End If%>
1557
                </table>
1558
                <!-- SELECT RELEASE B END ---------------------------------------------->
1559
            </td>
1560
        </tr>
1561
        <tr>
1562
            <td valign="bottom" align="center" background="images/bg_home_orange.gif">
1563
                <img src="images/img_vtree.gif" width="86" height="99" vspace="20" hspace="30">
1564
            </td>
1565
            <td valign="bottom" background="images/bg_home_orange.gif" align="center">
1566
                <img src="images/img_vtree.gif" width="86" height="99" vspace="20" hspace="30">
1567
            </td>
1568
      </tr>
1569
    </table>
1570
</form>
1571
<!-- FOOTER -->
1572
<!--#include file="_footer.asp"-->
1573
<%
1574
If email Then
1575
    Dim LocalPath
1576
    LocalPath = Server.MapPath("docs\compareReleases_"&objAccessControl.UserName&".html")
1577
 
1578
    Send_Email    "Release Manager Notification",_
1579
                     ADMIN_EMAIL, _
1580
                     objAccessControl.UserEmail,_
1581
                     "Release Comparisons from Release Manager", _
1582
                     "Your requested report...",_
1583
                     LocalPath
1584
End If
1585
%>
1586
</body>
1587
</html>
1588
<%
1589
Call Destroy_All_Objects
1590
%>