Subversion Repositories DevTools

Rev

Rev 5725 | Rev 6070 | 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
 
5725 dpurdie 700
function SetDisplay(name, mode)
701
{
702
	var o;
703
	if (o = MM_findObj(name))
704
	{
705
		o.style.display = mode;
706
	}
707
}
5357 dpurdie 708
 
709
function MergePackage ( pkga, pkgb, rowId )
710
{
711
    // Set merge hidden field with new value
712
    MM_findObj( 'ADDPKG_' + rowId ).value = pkga;
713
 
714
    var divA = MM_findObj( 'PVA' + rowId );
715
    var divB = MM_findObj( 'PVB' + rowId );
716
 
717
    // Set text equal
718
    divB.innerHTML = divA.innerHTML;
719
 
720
    // Set highlight to blank
721
    divA.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';
722
    divB.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';
723
 
724
     // Set Change state icon to blank
5725 dpurdie 725
    SetDisplay( 'IMGSTATE' + rowId, 'none');
5357 dpurdie 726
 
727
    // Remove Merge Button
5725 dpurdie 728
    SetDisplay( 'IMGMERGE' + rowId, 'none');
729
    SetDisplay( 'IMGREMOVE' + rowId, 'none');
5357 dpurdie 730
 
731
    // Show undo button
5725 dpurdie 732
    SetDisplay( 'IMGUNDO' + rowId, 'block');
5357 dpurdie 733
}
734
 
735
 
736
function RemovePackage ( pkga, pkgb, rowId )
737
{
738
    // Set remove hidden field with new value
739
    MM_findObj( 'REMOVEPKG_' + rowId ).value = pkgb;
740
 
741
    var divA = MM_findObj( 'PVA' + rowId );
742
    var divB = MM_findObj( 'PVB' + rowId );
743
 
744
    // Set text equal
745
    divB.style.textDecoration = 'line-through';
746
 
747
    // Set highlight to blank
748
    if (MM_findObj( 'CHANGETYPE_' + rowId ).value != "A")
749
    {
750
        divA.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';
751
    }
752
    divB.style.backgroundColor = '<%=LCOLOR_NOT_CHANGED%>';
753
 
754
     // Set Change state icon to blank
5725 dpurdie 755
    SetDisplay( 'IMGSTATE' + rowId , 'none');
5357 dpurdie 756
 
757
    // Remove Merge Button
5725 dpurdie 758
    SetDisplay( 'IMGMERGE' + rowId , 'none');
759
    SetDisplay( 'IMGREMOVE' + rowId , 'none');
5357 dpurdie 760
 
761
    // Show undo button
5725 dpurdie 762
    SetDisplay( 'IMGUNDO' + rowId ,'block');
5357 dpurdie 763
}
764
 
765
 
766
 
767
function UndoPackage ( rowId )
768
{
769
    // Set merge/remove hidden field with new value
770
    MM_findObj( 'ADDPKG_' + rowId ).value = '';
771
    MM_findObj( 'REMOVEPKG_' + rowId ).value = '';
772
 
773
    var divA = MM_findObj( 'PVA' + rowId );
774
    var divB = MM_findObj( 'PVB' + rowId );
775
 
776
    // Set text equal
777
    divB.innerHTML = MM_findObj( 'UNDOPKG_' + rowId ).value;
778
    divB.style.textDecoration = 'none';
779
 
780
 
781
    // Set highlight to blank
782
    divA.style.backgroundColor = MM_findObj( 'UNDOCOLORA_' + rowId ).value;
783
    divB.style.backgroundColor = MM_findObj( 'UNDOCOLORB_' + rowId ).value;
784
 
785
     // Set Change state icon to blank
5725 dpurdie 786
    SetDisplay( 'IMGSTATE' + rowId, 'block');
5357 dpurdie 787
 
788
    // Remove Merge Button
789
    var cht = MM_findObj( 'CHANGETYPE_' + rowId );
790
 
791
    if (cht.value == "R")
792
    {
5725 dpurdie 793
        SetDisplay( 'IMGMERGE' + rowId, 'block');
5357 dpurdie 794
    }
795
    else if ( (cht.value == "A") || (cht.value == "") )
796
    {
5725 dpurdie 797
        SetDisplay( 'IMGREMOVE' + rowId, 'block');
5357 dpurdie 798
    }
799
    else
800
    {
5725 dpurdie 801
        SetDisplay( 'IMGMERGE' + rowId, 'block');
802
        SetDisplay( 'IMGREMOVE' + rowId,'block');
5357 dpurdie 803
    }
804
 
805
    // Show undo button
5725 dpurdie 806
    SetDisplay( 'IMGUNDO' + rowId, 'none');
5357 dpurdie 807
}
808
 
809
 
810
function MergeAll()
811
{
812
    var elem
813
 
814
    if (document.all)
815
    {
816
        // Run this for IE
817
        elem = document.all;
818
    } else {
819
        // Run this for other browsers
820
        elem = document.getElementsByTagName('div');
821
    }
822
 
823
    for (i in elem)
824
    {
825
        if (elem[i].id)
826
        {
827
            if (elem[i].id.indexOf('SHORT_') == 0) elem[i].style.display = 'none';
828
            if (elem[i].id.indexOf('LONG_') == 0) elem[i].style.display = 'block';
829
        }
830
    }
831
}
832
 
833
//-->
834
</script>
835
 
836
</head>
837
<!-- TIPS LAYERS -------------------------------------->
838
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
839
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
840
<form name="FormName" method="post" action="<%=ScriptName%>">
841
    <!-- HEADER -->
842
    <!--#include file="_header.asp"-->
843
    <!-- BODY ---->
844
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
845
        <tr>
846
            <td width="20%">
847
            <td width="60%">
848
            <td width="20%">
849
        </tr>
850
        <tr>
851
            <td background="images/bg_home_orange.gif" valign="top">
852
                <!-- SELECT RELEASE A ---------------------------------------------->
853
                <br>
854
                <table width="100%"  border="0" cellspacing="10" cellpadding="0">
855
                    <tr>
856
                        <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>
857
                    </tr>
858
                    <tr>
859
                        <td align="left">
860
                            <select name="projA" class="form_item" onChange="RequestReleaseCombo( '?proj_id='+ this.value, FormName.rtagA );">
861
                                <option value="">-- Select Project --</option>
862
                                <%
863
                                OraDatabase.Parameters.Add "PROJ_ID",     objRelCollectorA.Item("proj_id"),    ORAPARM_INPUT, ORATYPE_NUMBER
864
 
865
                                Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ProjectsCombo.sql"), cint(0))
866
 
867
                                OraDatabase.Parameters.Remove "PROJ_ID"
868
 
869
                                While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
870
                                    <option value="<%=rsQry("proj_id")%>" <%=rsQry("selected")%>><%=rsQry("proj_name")%></option>
871
                                    <%rsQry.MoveNext
872
                                WEnd
873
 
874
                                rsQry.Close
875
                                Set rsQry = Nothing
876
                                %>
877
                            </select>
878
                        </td>
879
                    </tr>
880
                    <tr>
881
                        <td align="left">
882
                            <select name="rtagA" id="rtagA" class="form_item">
883
                                <%
884
                                OraDatabase.Parameters.Add "PROJ_ID",     objRelCollectorA.Item("proj_id"),    ORAPARM_INPUT,  ORATYPE_NUMBER
885
                                OraDatabase.Parameters.Add "RTAG_ID",     objRelCollectorA.Item("rtag_id"),    ORAPARM_INPUT, ORATYPE_NUMBER
886
 
887
                                Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ReleasesCombo.sql"), cint(0))
888
 
889
                                OraDatabase.Parameters.Remove "PROJ_ID"
890
                                OraDatabase.Parameters.Remove "RTAG_ID"
891
 
892
                                While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
893
                                        <option value="<%=rsQry("rtag_id")%>" <%=rsQry("selected")%>><%=rsQry("rtag_name")%></option>
894
                                    <%rsQry.MoveNext
895
                                WEnd
896
 
897
                                rsQry.Close
898
                                Set rsQry = Nothing
899
                                %>
900
                            </select>
901
                        </td>
902
                    </tr>
903
                    <%If (parRtagA <> "") Then%>
904
                        <tr>
905
                            <td align="left"><a href="dependencies.asp?rtag_id=<%=parRtagA%>" class="body_txt_drk">Go To Release A &raquo;</a></td>
906
                        </tr>
907
                    <%End If%>
908
                </table>
909
 
910
                <!-- SELECT RELEASE A END ---------------------------------------------->
911
            </td>
912
 
913
            <td rowspan="2" valign="top" background="images/bg_lght_gray.gif" align="center">
914
                <!-- DIFF -------------------------------------------------------->
915
                <br>
916
                <table width="100%" border="0" cellspacing="10" cellpadding="0">
917
                    <tr>
918
                        <td>
919
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
920
                                <tr>
921
                                    <td width="1%"></td>
922
                                    <td width="100%" align="left" class="form_ttl">DIFF / MERGE RELEASE
923
                                        <%If genReport Then%>
924
                                        &nbsp;[Generating Report]
925
                                        <%End If%>
926
                                        </td>
927
                                    <td width="1%"></td>
928
                                </tr>
929
                                <tr>
930
                                    <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
931
                                    <td background="images/lbox_bg_blue.gif" align="left" class="wform_ttl">&nbsp;</td>
932
                                    <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
933
                                </tr>
934
                                <tr>
935
                                    <td width="1%" bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
936
                                    <td bgcolor="#FFFFFF" valign="top" class="form_item">
937
                                        <table width="100%"  border="0" cellspacing="0" cellpadding="5">
938
                                            <tr>
939
                                                <td width="100%" bgcolor="#DAD7C8">
940
                                                    <input type="submit" name="btn" value="Compare" class="form_btn_comp" style="margin-right:5px;">
941
                                                    <input type="submit" name="btn" value="Swap Compare" class="form_btn_comp">
942
                                                    <span class="body_txt">
943
                                                        <input name="btn" type="submit" class="form_btn" value="Mail Me Report">
944
                                                        <% '<input name="btn" type="submit" class="form_btn" value="Show Me Report"> %>
945
                                                    </span>
946
                                                </td>
947
                                                <td width="1" align="right" bgcolor="#DAD7C8" nowrap>
948
                                                    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
949
                                                        <tr>
5684 dpurdie 950
                                                            <%
951
                                                                Dim mergeMessage, mergeDisabled
952
                                                                mergeDisabled = " disabled"
953
                                                                If (parRtagA = "") Then
954
                                                                    mergeMessage = "Select Release A"
955
                                                                ElseIf (parRtagB = "") Then  
956
                                                                    mergeMessage = "Select Release B"
957
                                                                ElseIf NOT isMergable Then  
958
                                                                    mergeMessage = "Release B cannot be modified"
959
                                                                Else
960
                                                                    mergeDisabled = ""
961
                                                                End If
962
                                                            %>
963
                                                            <td class="err_alert nowrap" style="padding-right:1em">
964
                                                                <%=mergeMessage%>
965
                                                            </td>
5357 dpurdie 966
                                                            <td>
5684 dpurdie 967
                                                                <input type="submit" name="btn" value="Merge" class="form_btn_comp" style="margin-right:10px;" <%=mergeDisabled%>>
5357 dpurdie 968
                                                            </td>
969
                                                            <td>
970
                                                                <input type="submit" name="btn" value="Exit" class="form_btn_comp">
971
                                                            </td>
972
                                                        </tr>
973
                                                    </table>
974
                                                </td>
975
                                            </tr>
976
                                            <tr>
977
                                                <td>
978
                                                    <%If (parRtagA <> "") AND (parRtagB <> "")Then%>
979
                                                        <!-- DIFF FILTER +++++++++++++++++++++++++++++++++++++++++++ -->
980
                                                        <fieldset style="width:150px;">
981
                                                            <legend><a href="javascript:;" class="body_scol" onClick="ToggleDisplay('divDiffFilter');" ><%=GetIsDiffFilterInUseIcon() %>&nbsp;Filter&nbsp;Results...</a></legend>
982
                                                            <div name="divDiffFilter" id="divDiffFilter" class="body_txt" style="display:none;">
983
                                                                <br>
984
                                                                <table width="100%"  border="0" cellspacing="1" cellpadding="3">
985
                                                                    <tr>
986
                                                                        <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>
987
                                                                        <td width="50" nowrap background="images/bg_action_norm.gif" class="form_field"><%=LIMG_UPDATED%>Updated</td>
988
                                                                    </tr>
989
                                                                    <tr>
990
                                                                        <td background="images/bg_action_norm.gif"><input type="checkbox" name="difilter" value="<%=enumDB_NUM_DIFF_NEW%>" <%=GetIsDiffFilterChecked(enumDB_NUM_DIFF_NEW)%>></td>
991
                                                                        <td nowrap background="images/bg_action_norm.gif" class="form_field"><%=LIMG_ADDED%>Added</td>
992
                                                                    </tr>
993
                                                                    <tr>
994
                                                                        <td background="images/bg_action_norm.gif"><input type="checkbox" name="difilter" value="<%=enumDB_NUM_DIFF_REMOVED%>" <%=GetIsDiffFilterChecked(enumDB_NUM_DIFF_REMOVED)%>></td>
995
                                                                        <td nowrap background="images/bg_action_norm.gif" class="form_field"><%=LIMG_REMOVED%>Removed</td>
996
                                                                    </tr>
997
                                                                    <tr>
998
                                                                        <td background="images/bg_action_norm.gif"><input type="checkbox" name="difilter" value="<%=enumDB_NUM_DIFF_RIPPLE%>" <%=GetIsDiffFilterChecked(enumDB_NUM_DIFF_RIPPLE)%>></td>
999
                                                                        <td nowrap background="images/bg_action_norm.gif" class="form_field"><%=LIMG_RIPPLED%>Rippled</td>
1000
                                                                    </tr>
1001
                                                                    <tr>
1002
                                                                        <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>
1003
                                                                        <td nowrap background="images/bg_action_norm.gif" class="form_field">Unchanged</td>
1004
                                                                    </tr>
1005
                                                                    <tr>
1006
                                                                        <td background="images/bg_action_norm.gif">&nbsp;</td>
1007
                                                                        <td background="images/bg_action_norm.gif"><input name="btn" type="submit" class="form_btn" value="Hide"></td>
1008
                                                                    </tr>
1009
                                                                </table>
1010
                                                            </div>
1011
                                                        </fieldset>
1012
                                                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
1013
                                                    <%End If%>
1014
                                                </td>
1015
                                                <td></td>
1016
                                            </tr>
1017
                                        </table>
1018
 
1019
                                        <%
1020
                                        ' Successfull Merge
1021
                                        If (Request("btn") = "Merge") Then
1022
                                            Call Messenger ( "Merge has completed successfully.", 3, "100%" )
1023
                                        End If
1024
 
1025
                                        Set FSO=Server.CreateObject("Scripting.FileSystemObject")
1026
                                        Set NewTextFile=FSO.CreateTextFile(Server.MapPath("docs\compareReleases_"&objAccessControl.UserName&".html"), true)
1027
 
1028
                                        Call Header()
1029
 
1030
                                        If (parRtagA <> "") AND (parRtagB <> "")Then%>
1031
                                            <table width="100%"  border="0" cellspacing="1" cellpadding="0">
1032
                                                <tr>
1033
                                                    <td width="50%" bgcolor="#E4E9EC" class="body_row" nowrap><%= ReleaseIcon(objRelCollectorA.Item("official")) & objRelCollectorA.Item("location")%> </td>
1034
                                                    <td width="1" bgcolor="#E4E9EC"><img src="images/spacer.gif" width="20" height="1"></td>
1035
                                                    <td width="1" bgcolor="#E4E9EC"><img src="images/spacer.gif" width="20" height="20"></td>
1036
                                                    <td width="1" bgcolor="#E4E9EC"><img src="images/spacer.gif" width="20" height="1"></td>
1037
                                                    <td width="50%" bgcolor="#E4E9EC" class="body_row" nowrap><%= ReleaseIcon(objRelCollectorB.Item("official")) & objRelCollectorB.Item("location")%></td>
1038
                                                    <td width="1" bgcolor="#E4E9EC"><img src="images/spacer.gif" width="20" height="1"></td>
1039
                                                </tr>
1040
                                                <%
1041
                                                OraDatabase.Parameters.Add "RTAG_A",     parRtagA,    ORAPARM_INPUT, ORATYPE_NUMBER
1042
                                                OraDatabase.Parameters.Add "RTAG_B",     parRtagB,    ORAPARM_INPUT, ORATYPE_NUMBER
1043
                                                OraDatabase.Parameters.Add "NO_CHANGE", GetIsDiffFilterChecked(enumDB_NUM_DIFF_NO_CHANGE), ORAPARM_INPUT, ORATYPE_VARCHAR2
1044
                                                OraDatabase.Parameters.Add "ADDED",      GetIsDiffFilterChecked(enumDB_NUM_DIFF_NEW),         ORAPARM_INPUT, ORATYPE_VARCHAR2
1045
                                                OraDatabase.Parameters.Add "UPDATED",    GetIsDiffFilterChecked(enumDB_NUM_DIFF_UPDATED),    ORAPARM_INPUT, ORATYPE_VARCHAR2
1046
                                                OraDatabase.Parameters.Add "REMOVED",    GetIsDiffFilterChecked(enumDB_NUM_DIFF_REMOVED),    ORAPARM_INPUT, ORATYPE_VARCHAR2
1047
 
1048
                                                Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ReleaseDiff.sql"), cint(0))
1049
 
1050
                                                OraDatabase.Parameters.Remove "RTAG_A"
1051
                                                OraDatabase.Parameters.Remove "RTAG_B"
1052
                                                OraDatabase.Parameters.Remove "NO_CHANGE"
1053
                                                OraDatabase.Parameters.Remove "ADDED"
1054
                                                OraDatabase.Parameters.Remove "UPDATED"
1055
                                                OraDatabase.Parameters.Remove "REMOVED"
1056
 
1057
                                                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))
1058
                                                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))
1059
 
1060
                                                Call Javascript()
1061
                                                Call Styles()
1062
 
1063
                                                NewTextFile.WriteLine("<title>Difference Report Between "&rsQryA("proj_name")&" "&rsQryA("rtag_name")&" and "&rsQryB("proj_name")&" "&rsQryB("rtag_name")&"</title>")
1064
                                                NewTextFile.WriteLine("<div class=""page_title"">Difference Report Between "&rsQryA("proj_name")&" "&rsQryA("rtag_name")&" and "&rsQryB("proj_name")&" "&rsQryB("rtag_name")&"</div><br>")
1065
                                                NewTextFile.WriteLine("<b>Key:</b><br><blockquote>")
1066
                                                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>")
1067
                                                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>")
1068
                                                NewTextFile.WriteLine("<span class=changesnone><b>Grey Text</b></span><span class=textnone> No Source Code Changes to a Package in either Release.</span>")
1069
                                                NewTextFile.WriteLine("</blockquote>")
1070
 
1071
                                                NewTextFile.WriteLine("<b>Toggle Sections:</b><blockquote>")
1072
                                                NewTextFile.WriteLine("<a href=""javascript:;"" onClick=""MM_toggleAll('divPkgInfo','1');"">Expand All</a>")
1073
                                                NewTextFile.WriteLine("<a href=""javascript:;"" onClick=""MM_toggleAll('divPkgInfo','');"">Collapse All</a>")
1074
                                                NewTextFile.WriteLine("</blockquote>")
1075
 
1076
                                                Dim currView_id
1077
                                                currView_id = -1
1078
 
1079
                                                While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
1080
                                                    errormsg = false
1081
                                                    rowId = rsQry("pv_id_a") &"_"& rsQry("pv_id_b")
1082
 
1083
                                                    btnMerge = LIMG_MERGE
1084
                                                    btnRemove = LIMG_REMOVE
1085
                                                    colorA = LCOLOR_NOT_CHANGED
1086
                                                    colorB = LCOLOR_NOT_CHANGED
1087
 
1088
                                                    changeType = rsQry("change_type")
1089
                                                    isaSdk = rsQry("PKG_SDK_B")
1090
 
1091
                                                    Select Case changeType
1092
                                                        Case "U"
1093
                                                            colorA = LCOLOR_CHANGED
1094
                                                            colorB = LCOLOR_CHANGED
1095
                                                        Case "UW"
1096
                                                            colorA = LCOLOR_CHANGED
1097
                                                            colorB = LCOLOR_CHANGED
1098
                                                            btnMerge = LIMG_MERGE_WARN
1099
                                                        Case "UR"
1100
                                                            colorA = LCOLOR_RIPPLED
1101
                                                            colorB = LCOLOR_RIPPLED
1102
                                                        Case "A"
1103
                                                            colorA = LCOLOR_BLANK
1104
                                                        Case "R"
1105
                                                            colorB = LCOLOR_BLANK
1106
                                                    End Select
1107
 
1108
                                                    Call GetDiffStateIcon ( changeType, ChangeTypeIcon )
1109
 
1110
                                                    If changeType = "U" OR changeType = "UW" OR changeType = "UR" Then
1111
                                                        Dim MajorA, MajorB, MinorA, MinorB, PatchA, PatchB, BuildA, BuildB, pos, pkgVersionA, pkgVersionB, majMinA, majMinB
1112
                                                        MajorA = NULL
1113
                                                        MajorB = NULL
1114
                                                        MinorA = NULL
1115
                                                        MinorB = NULL
1116
 
1117
                                                        pkgVersionA = rsQry("pkg_version_a")
1118
                                                        pkgVersionB = rsQry("pkg_version_b")
1119
 
1120
                                                        PatchA = rsQry("patch_number_a")
1121
                                                        PatchB = rsQry("patch_number_b")
1122
                                                        BuildA = rsQry("build_number_a")
1123
                                                        BuildB = rsQry("build_number_b")
1124
 
1125
 
1126
                                                        ' Find the first occurence of the dot in package version A
1127
                                                        pos = InStr(pkgVersionA, ".")
1128
                                                        If pos <> 0 Then
1129
                                                            ' Extract the Major Version for A
1130
                                                            MajorA = Mid(pkgVersionA, 1, pos - 1)
1131
                                                            ' Delete the Major Version Value from the string to get the minor and patch version
1132
                                                            pkgVersionA = Mid(pkgVersionA, pos + 1, Len(pkgVersionA))
1133
                                                            ' Find the second occurence of the dot in package version A
1134
                                                            pos = InStr(pkgVersionA, ".")
1135
                                                            ' Extract the Minor Version for A
1136
                                                            If pos <> 0 Then
1137
                                                                MinorA = Mid(pkgVersionA, 1, pos - 1)
1138
                                                            End If
1139
                                                        End If
1140
 
1141
                                                        ' Find the first occurence of the dot in package version B
1142
                                                        pos = InStr(pkgVersionB, ".")
1143
                                                        If pos <> 0 Then
1144
                                                            ' Extract the Major Version for B
1145
                                                            MajorB = Mid(pkgVersionB, 1, pos - 1)
1146
                                                            ' Delete the Major Version Value from the string to get the minor and patch version
1147
                                                            pkgVersionB = Mid(pkgVersionB, pos + 1, Len(pkgVersionB))
1148
                                                            ' Find the second occurence of the dot in package version B
1149
                                                            pos = InStr(pkgVersionB, ".")
1150
                                                            ' Extract the Minor Version for B
1151
                                                            If pos <> 0 Then
1152
                                                                MinorB = Mid(pkgVersionB, 1, pos - 1)
1153
                                                            End If
1154
                                                        End If
1155
 
1156
                                                        If MajorA = MajorB Then
1157
                                                            If MinorA = MinorB Then
1158
                                                                If IsNumeric(PatchA) AND IsNumeric(PatchB) Then
1159
                                                                    If CInt(PatchB) > CInt(PatchA) Then
1160
                                                                        btnMerge = LIMG_MERGE_WARN
1161
                                                                    Else
1162
                                                                        btnMerge = LIMG_MERGE
1163
                                                                    End If
1164
                                                                End If
1165
                                                            Else
1166
                                                                If IsNumeric(MinorA) AND IsNumeric(MinorB) Then
1167
                                                                    If CInt(MinorB) > CInt(MinorA) Then
1168
                                                                        btnMerge = LIMG_MERGE_WARN
1169
                                                                    Else
1170
                                                                        btnMerge = LIMG_MERGE
1171
                                                                    End If
1172
                                                                End If
1173
                                                            End If
1174
                                                        Else
1175
                                                            If IsNumeric(MajorA) AND IsNumeric(MajorB) Then
1176
                                                                If     CInt(MajorB) > CInt(MajorA) Then
1177
                                                                    btnMerge = LIMG_MERGE_WARN
1178
                                                                Else
1179
                                                                    btnMerge = LIMG_MERGE
1180
                                                                End If
1181
                                                            End If
1182
                                                        End If
1183
                                                    End If
1184
 
1185
                                                    ' -------- FILTERS RIPPLE BUILDS WHEN CHECKED -----------------
1186
                                                    If NOT (GetIsDiffFilterChecked(enumDB_NUM_DIFF_RIPPLE) = "checked" AND changeType = "UR") THEN
1187
 
1188
                                                        ' -------- GROUP BY BASE VIEW  -----------------
1189
                                                        If CDbl(currView_id) <> CDbl(rsQry("view_id")) Then%>
1190
                                                            <tr>
1191
                                                                <td valign="top" nowrap class="form_ttl"><b><%=rsQry("view_name")%></b></td>
1192
                                                                <td class="form_ttl">&nbsp;</td>
1193
                                                                <td class="form_ttl">&nbsp;</td>
1194
                                                                <td class="form_ttl">&nbsp;</td>
1195
                                                                <td class="form_ttl">&nbsp;</td>
1196
                                                                <td class="form_ttl">&nbsp;</td>
1197
                                                            </tr>
1198
                                                            <%
1199
                                                            currView_id = CDbl(rsQry("view_id"))
1200
                                                        End If
1201
                                                        ' -------- END GROUP ------------------------
1202
                                                        %>
1203
                                                        <%
1204
                                                        'Determine if we are dealing with a PV_ID that we have already encountered and displayed as a pending addition
1205
                                                        'If we are, we do not need to display anything more about it, so skip the row.
1206
                                                        ' NOTE. the result set is sorted by change type (see releasediff.sql) such that if there are multiple entries
1207
                                                        '         for the same PV_ID, they are sorted in the following order: unchanged, additions, removals, updates.
1208
                                                        '         This is important to the row skip filtering carried out below.
1209
                                                        Dim skipRow
1210
                                                        If rsQry("pv_id_a") Then
1211
                                                            skipRow = pendingAdditions.Exists(CStr(rsQry("pv_id_a")))
1212
                                                        Else
1213
                                                            skipRow = FALSE
1214
                                                        End If
1215
                                                        %>
1216
                                                        <%If NOT skipRow Then%>
1217
                                                            <tr>
1218
                                                                <td class="body_row" nowrap>
1219
                                                                    <DIV id="PVA<%=rowId%>" style="background:<%=colorA%>; padding:5px;">
1220
                                                                        <%=rsQry("pkg_name_a") &" "& rsQry("pkg_version_a")%>
1221
                                                                    </DIV>
1222
                                                                    <input type="hidden" id="UNDOCOLORA_<%=rowId%>" value="<%=colorA%>">
1223
                                                                </td>
1224
 
1225
                                                                <%
1226
                                                                Dim pkgADisplayControl
1227
                                                                pkgADisplayControl = isMergable
1228
                                                                If IsNull( changeType ) OR (changeType = "A")  OR (changeType = "0") Then pkgADisplayControl = FALSE
1229
                                                                If isaSdk Then pkgADisplayControl = FALSE
1230
                                                                %>
1231
                                                                <td bgcolor="#F5F5F5">
1232
                                                                    <%If pkgADisplayControl Then%>
1233
                                                                        <DIV id="IMGMERGE<%=rowId%>"><a href="javascript:;" onClick="MergePackage( '<%=rsQry("pv_id_a")%>', '<%=rsQry("pv_id_b")%>', '<%=rowId%>' );"><%=btnMerge%></a></DIV>
1234
                                                                    <%End If%>
1235
                                                                </td>
1236
 
1237
                                                                <td bgcolor="#E4E9EC">
1238
                                                                    <DIV id="IMGSTATE<%=rowId%>" ><%=ChangeTypeIcon%></DIV>
1239
                                                                    <input type="hidden" id="CHANGETYPE_<%=rowId%>" value="<%=changeType%>">
1240
                                                                </td>
1241
 
1242
                                                                <%
1243
                                                                Dim pkgBDisplayControl
1244
                                                                pkgBDisplayControl = isMergable
1245
                                                                If changeType = "R" Then pkgBDisplayControl = FALSE
1246
                                                                If isaSdk Then pkgBDisplayControl = FALSE
1247
                                                                %>
1248
                                                                <td bgcolor="#F5F5F5">
1249
                                                                    <%If pkgBDisplayControl Then%>
1250
                                                                        <DIV id="IMGREMOVE<%=rowId%>" ><a href="javascript:;" onClick="RemovePackage( '<%=rsQry("pv_id_a")%>', '<%=rsQry("pv_id_b")%>', '<%=rowId%>' );"><%=btnRemove%></a></DIV>
1251
                                                                    <%ElseIf isaSdk Then %> 
1252
                                                                        <DIV ><%=LIMG_SDK%></DIV>
1253
                                                                    <%End If%>
1254
                                                                </td>
1255
 
1256
                                                                <td class="body_row" nowrap>
1257
                                                                    <DIV id="PVB<%=rowId%>" style="background:<%=colorB%>; padding:5px;">
1258
                                                                        <%If IsNull(rsQry("pv_id_b")) Then %>
1259
                                                                            <%If Is_Pending_Sub(Request("rtagB"), rsQry("pv_id_a")) Then%>
1260
                                                                                (removal pending<%=Quick_Help("RemovalPending")%>)
1261
                                                                            <%End If %>
1262
                                                                        <%Else%>
1263
                                                                            <%=rsQry("pkg_name_b") &" "& rsQry("pkg_version_b")%>
1264
                                                                            <%If Is_Pending_Add(Request("rtagB"), rsQry("pv_id_b")) Then%>
1265
                                                                                (addition pending<%=Quick_Help("AdditionPending")%>)
1266
                                                                                <% 'Add this pending addition to the dictionary so that we can filter out REMOVED entries
1267
                                                                                    'with identical PV_ID's that we might encounter further on in the result set
1268
                                                                                If NOT pendingAdditions.Exists(rsQry("pv_id_b")) Then
1269
                                                                                    pendingAdditions.Add CStr(rsQry("pv_id_b")), CStr(rsQry("pkg_version_b"))
1270
                                                                                End If%>
1271
                                                                            <%ElseIf Is_Pending_Sub(Request("rtagB"), rsQry("pv_id_b")) Then%>
1272
                                                                                (removal pending<%=Quick_Help("RemovalPending")%>)
1273
                                                                            <%End If %>
1274
                                                                        <%End If %>
1275
                                                                    </DIV>
1276
                                                                    <input type="hidden" id="UNDOCOLORB_<%=rowId%>" value="<%=colorB%>">
1277
                                                                    <input type="hidden" name="addpkg" id="ADDPKG_<%=rowId%>" value="">
1278
                                                                    <input type="hidden" name="removepkg" id="REMOVEPKG_<%=rowId%>" value="">
1279
                                                                    <input type="hidden" id="UNDOPKG_<%=rowId%>" value="<%=rsQry("pkg_name_b") &" "& rsQry("pkg_version_b")%>">
1280
                                                                </td>
1281
 
1282
                                                                <td bgcolor="#F5F5F5">
1283
                                                                    <DIV id="IMGUNDO<%=rowId%>" style="display:none;" >
1284
                                                                        <a href="javascript:;" onClick="UndoPackage( '<%=rowId%>' );"><%=LIMG_UNDO%></a>
1285
                                                                    </DIV>
1286
                                                                </td>
1287
                                                            </tr>
1288
                                                        <%End If %>
1289
 
1290
                                                        <%
1291
                                                        If genReport AND NOT skipRow  Then
1292
                                                            If rsQry("pv_id_a") Then
1293
                                                                Set rsQryCommentsA = OraDatabase.DbCreateDynaset( "SELECT COMMENTS FROM PACKAGE_VERSIONS WHERE PV_ID="& rsQry("pv_id_a"), cint(0))
1294
                                                            End If
1295
 
1296
                                                            If rsQry("pv_id_b") Then
1297
                                                                Set rsQryCommentsB = OraDatabase.DbCreateDynaset( "SELECT COMMENTS FROM PACKAGE_VERSIONS WHERE PV_ID="& rsQry("pv_id_b"), cint(0))
1298
                                                            End If
1299
 
1300
                                                            pkgA = rsQry("pkg_name_a")
1301
                                                            pkgB = rsQry("pkg_name_b")
1302
 
1303
                                                            If pkgA <> "" then
1304
                                                                pkgname = pkgA
1305
                                                            Else
1306
                                                                pkgname = pkgB
1307
                                                            End If
1308
 
1309
                                                            If changeType = "U" OR  changeType = "UW" Then
1310
                                                                ChangeASource = false
1311
                                                                ChangeAUpdate = false
1312
                                                                ChangeBSource = false
1313
                                                                ChangeBUpdate = false
1314
 
1315
                                                                'NewTextFile.WriteLine("<br><b><font face="&chr(34)&"arial"&chr(34)&">"&pkgname&"</font></b>")
1316
                                                                NewTextFile.Write("<a href=""javascript:;"" class=""body_scol"" onClick=""toggleSPAN('"& rowId &"');"">"& pkgname &"</a>")
1317
                                                                NewTextFile.WriteLine("<DIV class=divPkgInfo id=""spanPkgInfo"& rowId &""" name=""spanPkgInfo"" style=""display:none;"">")
1318
                                                                NewTextFile.Write(rsQryA("rtag_name")&" uses: "&rsQry("pkg_version_a")&" (")
1319
                                                                Call Release(rsQry("pv_id_a"))
1320
                                                                NewTextFile.WriteLine(")<br>")
1321
                                                                NewTextFile.Write(rsQryB("rtag_name")&" uses: "&rsQry("pkg_version_b")&" (")
1322
                                                                Call Release(rsQry("pv_id_b"))
1323
                                                                NewTextFile.WriteLine(")<br>")
1324
 
1325
                                                                a = rsQry("pv_id_a")
1326
                                                                b = rsQry("pv_id_b")
1327
                                                                c = rsQry("pv_id_a")
1328
                                                                d = rsQry("pv_id_b")
1329
 
1330
                                                                Set pvCollectionA = CreateObject("Scripting.Dictionary")
1331
                                                                Set pvCollectionB = CreateObject("Scripting.Dictionary")
1332
                                                                On Error Resume Next
1333
                                                                While CLng(a) <> CLng(b) and NOT errormsg
1334
 
1335
                                                                    'NewTextFile.WriteLine("A: "&a)
1336
                                                                    'NewTextFile.WriteLine("B: "&b)
1337
                                                                    pvCollectionA.Add CStr(a), Empty
1338
                                                                    pvCollectionB.Add CStr(b), Empty
1339
                                                                    If CLng(a) > CLng(b) Then
1340
                                                                        'NewTextFile.WriteLine("TestA")
1341
                                                                        Call LastPvIdA(a)
1342
                                                                    ElseIf CLng(b) > CLng(a) Then
1343
                                                                        'NewTextFile.WriteLine("TestB")
1344
                                                                        Call LastPvIdB(b)
1345
                                                                    End If
1346
                                                                Wend
1347
 
1348
                                                                Set pvCollectionA = Nothing
1349
                                                                Set pvCollectionB = Nothing
1350
 
1351
                                                                Call pkg_Version(a)
1352
                                                                NewTextFile.Write("Common PARENT package version: "&pkgversion&" (")
1353
                                                                Call Release(a)
1354
                                                                NewTextFile.WriteLine(")<br><br>")
1355
                                                                NewTextFile.WriteLine()
1356
                                                                NewTextFile.WriteLine("<b>"&rsQryA("rtag_name")&"</b>")
1357
 
1358
                                                                If pkgversion <> rsQry("pkg_version_a") Then
1359
                                                                    NewTextFile.WriteLine("<blockquote><b><i>Versions between "& pkgversion &" and "& rsQry("pkg_version_a")&"</i></b></blockquote>")
1360
 
1361
                                                                    If errormsg Then
1362
                                                                        NewTextFile.WriteLine("Error determining root!<br>")
1363
                                                                        NewTextFile.WriteLine()
1364
                                                                    End If
1365
 
1366
                                                                    source_change = false
1367
 
1368
                                                                    While CLng(a) <> CLng(c) and NOT errormsg
1369
                                                                        Call Comments(c)
1370
                                                                        If scFlag = TRUE Then
1371
                                                                            Call GetFixedIssues(c)
1372
                                                                        End If
1373
                                                                        Call LastPvIdAa(c)
1374
                                                                        NewTextFile.WriteLine()
1375
                                                                    Wend
1376
 
1377
                                                                    If source_change = false Then
1378
                                                                        NewTextFile.WriteLine("<blockquote><b><i>No source changes to "& rsQryA("rtag_name")&". Only Rippled Builds.</i></b></blockquote><br>")
1379
                                                                        ChangeASource = true
1380
                                                                    End If
1381
 
1382
                                                                    Call pkg_Version(b)
1383
                                                                    NewTextFile.WriteLine()
1384
                                                                    NewTextFile.WriteLine()
1385
 
1386
                                                                ElseIf pkgversion = rsQry("pkg_version_a") Then
1387
                                                                    NewTextFile.WriteLine("<blockquote><b><i>No updates to "& rsQryA("rtag_name")&"</i></b></blockquote><br>")
1388
                                                                    ChangeAUpdate = true
1389
                                                                    NewTextFile.WriteLine()
1390
                                                                End If
1391
 
1392
                                                                NewTextFile.WriteLine("<b>"&rsQryB("rtag_name")&"</b>")
1393
 
1394
                                                                If pkgversion <> rsQry("pkg_version_b") Then
1395
                                                                    NewTextFile.WriteLine("<blockquote><b><i>Versions between "& pkgversion &" and "& rsQry("pkg_version_b")&"</i></b></blockquote>")
1396
 
1397
                                                                    If errormsg Then
1398
                                                                        NewTextFile.WriteLine("Error determining root!<br>")
1399
                                                                        NewTextFile.WriteLine()
1400
                                                                    End If
1401
 
1402
                                                                    source_change = false
1403
 
1404
                                                                    While CLng(b) <> CLng(d) and NOT errormsg
1405
                                                                        Call Comments(d)
1406
                                                                        If scFlag = TRUE Then
1407
                                                                            Call GetFixedIssues(d)
1408
                                                                        End If
1409
                                                                        Call LastPvIdBb(d)
1410
                                                                        NewTextFile.WriteLine()
1411
                                                                    Wend
1412
 
1413
                                                                    If source_change = false Then
1414
                                                                        NewTextFIle.WriteLine("<blockquote><b><i>No source changes to "& rsQryB("rtag_name")&". Only Rippled Builds.</i></b></blockquote><br>")
1415
                                                                        ChangeBSource = true
1416
                                                                    End If
1417
 
1418
                                                                ElseIf pkgversion = rsQry("pkg_version_b") Then
1419
                                                                    NewTextFile.WriteLine("<blockquote><b><i>No updates to "& rsQryB("rtag_name")&"</i></b></blockquote><br>")
1420
                                                                    ChangeBUpdate = true
1421
                                                                    NewTextFile.WriteLine()
1422
                                                                End If
1423
 
1424
                                                                NewTextFile.WriteLine("</DIV>")
1425
 
1426
                                                                If ChangeASource Then
1427
                                                                    If ChangeBSource Then
1428
                                                                        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>")
1429
                                                                    ElseIf ChangeBUpdate Then
1430
                                                                        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>")
1431
                                                                    ElseIf NOT ChangeBSource AND NOT ChangeBUpdate Then
1432
                                                                        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>")
1433
                                                                    End If
1434
                                                                End If
1435
 
1436
                                                                If ChangeBSource Then
1437
                                                                    If NOT ChangeAUpdate Then
1438
                                                                        If NOT ChangeASource 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> <span class=changesnone> Ripple Builds Only.</span></td>  </tr></table></blockquote>")
1440
                                                                        End If
1441
                                                                    End If
1442
                                                                End If
1443
 
1444
                                                                If NOT ChangeASource Then
1445
                                                                    If NOT ChangeAUpdate Then
1446
                                                                        If NOT ChangeBSource AND NOT ChangeBUpdate Then
1447
                                                                            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>")
1448
                                                                        ElseIf ChangeBUpdate Then
1449
                                                                            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>")
1450
                                                                        End If
1451
                                                                    ElseIf ChangeAUpdate Then
1452
                                                                        If NOT ChangeBSource AND NOT ChangeBUpdate Then
1453
                                                                            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>")
1454
                                                                        ElseIf ChangeBSource Then
1455
                                                                            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>")
1456
                                                                        End If
1457
                                                                    End If
1458
                                                                End If
1459
 
1460
                                                            End If  'changeType = "U" OR  changeType = "UW"
1461
 
1462
                                                        End If  'email
1463
 
1464
                                                    End If 'NOT (GetIsDiffFilterChecked(enumDB_NUM_DIFF_RIPPLE) = "checked" AND changeType = "UR")
1465
 
1466
                                                    rsQry.MoveNext
1467
                                                WEnd
1468
 
1469
                                                rsQry.Close
1470
                                                Set rsQry = Nothing
1471
                                                %>
1472
                                                <%
1473
                                                Call Footer()
1474
                                                NewTextFile.Close
1475
                                                Set NewTextFile=Nothing
1476
                                                %>
1477
                                            </table>
1478
                                            <br>
1479
                                        <%Else%>
1480
                                            <br>
1481
                                            <%
1482
                                            If (parRtagB <> "") Then
1483
                                                Call Messenger ( "Select <b>Release A</b> to compare.", 3, "100%" )
1484
                                            ElseIf (parRtagA <> "") Then
1485
                                                Call Messenger ( "Select <b>Release B</b> to compare.", 3, "100%" )
1486
                                            Else
1487
                                                Call Messenger ( "Select <b>Release A</b> and <b>Release B</b> to compare.", 3, "100%" )
1488
                                            End If
1489
                                            %>
1490
                                        <%End If%>
1491
                                    </td>
1492
                                    <td width="1%" background="images/lbox_bgside_white.gif">&nbsp;</td>
1493
                                </tr>
1494
                                <tr>
1495
                                    <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
1496
                                    <td background="images/lbox_bg_blue.gif"></td>
1497
                                    <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>
1498
                                </tr>
1499
                            </table>
1500
                        </td>
1501
                    </tr>
1502
                </table>
1503
                <!-- DIFF END ---------------------------------------------------->
1504
            </td>
1505
            <td valign="top" background="images/bg_home_orange.gif">
1506
 
1507
                <!-- SELECT RELEASE B ---------------------------------------------->
1508
                <br>
1509
                <table width="100%"  border="0" cellspacing="10" cellpadding="0">
1510
                    <tr>
1511
                        <td align="left" class="body_col">
1512
                            <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>
1513
                        </td>
1514
                    </tr>
1515
                    <tr>
1516
                        <td align="left">
1517
                            <select name="projB" class="form_item" onChange="RequestReleaseCombo( '?proj_id='+ this.value, FormName.rtagB );">
1518
                                <option value="">-- Select Project --</option>
1519
                                <%
1520
                                OraDatabase.Parameters.Add "PROJ_ID",     objRelCollectorB.Item("proj_id"),    ORAPARM_INPUT, ORATYPE_NUMBER
1521
 
1522
                                Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ProjectsCombo.sql"), cint(0))
1523
 
1524
                                OraDatabase.Parameters.Remove "PROJ_ID"
1525
 
1526
                                While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
1527
                                    <option value="<%=rsQry("proj_id")%>" <%=rsQry("selected")%>><%=rsQry("proj_name")%></option>
1528
                                    <%rsQry.MoveNext
1529
                                WEnd
1530
 
1531
                                rsQry.Close
1532
                                Set rsQry = Nothing
1533
                                %>
1534
                            </select>
1535
                        </td>
1536
                    </tr>
1537
                    <tr>
1538
                        <td align="left">
1539
                            <select name="rtagB" id="rtagB" class="form_item">
1540
                                <%
1541
                                OraDatabase.Parameters.Add "PROJ_ID",     objRelCollectorB.Item("proj_id"),    ORAPARM_INPUT,  ORATYPE_NUMBER
1542
                                OraDatabase.Parameters.Add "RTAG_ID",     objRelCollectorB.Item("rtag_id"),    ORAPARM_INPUT, ORATYPE_NUMBER
1543
 
1544
                                Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ReleasesCombo.sql"), cint(0))
1545
 
1546
                                OraDatabase.Parameters.Remove "PROJ_ID"
1547
                                OraDatabase.Parameters.Remove "RTAG_ID"
1548
 
1549
                                While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
1550
                                        <option value="<%=rsQry("rtag_id")%>" <%=rsQry("selected")%>><%=rsQry("rtag_name")%></option>
1551
                                    <%rsQry.MoveNext
1552
                                WEnd
1553
 
1554
                                rsQry.Close
1555
                                Set rsQry = Nothing
1556
                                %>
1557
                            </select>
1558
                        </td>
1559
                    </tr>
1560
                    <%If (parRtagB <> "") Then%>
1561
                        <tr>
1562
                            <td align="left"><a href="dependencies.asp?rtag_id=<%=parRtagB%>" class="body_txt_drk">Go To Release B &raquo;</a></td>
1563
                        </tr>
1564
                    <%End If%>
1565
                </table>
1566
                <!-- SELECT RELEASE B END ---------------------------------------------->
1567
            </td>
1568
        </tr>
1569
        <tr>
1570
            <td valign="bottom" align="center" background="images/bg_home_orange.gif">
1571
                <img src="images/img_vtree.gif" width="86" height="99" vspace="20" hspace="30">
1572
            </td>
1573
            <td valign="bottom" background="images/bg_home_orange.gif" align="center">
1574
                <img src="images/img_vtree.gif" width="86" height="99" vspace="20" hspace="30">
1575
            </td>
1576
      </tr>
1577
    </table>
1578
</form>
1579
<%
1580
If email Then
1581
    Dim LocalPath
1582
    LocalPath = Server.MapPath("docs\compareReleases_"&objAccessControl.UserName&".html")
1583
 
1584
    Send_Email    "Release Manager Notification",_
1585
                     ADMIN_EMAIL, _
1586
                     objAccessControl.UserEmail,_
1587
                     "Release Comparisons from Release Manager", _
1588
                     "Your requested report...",_
1589
                     LocalPath
1590
End If
1591
%>
5957 dpurdie 1592
<!-- FOOTER -->
1593
<!--#include file="_footer.asp"-->
5357 dpurdie 1594
</body>
1595
</html>