Subversion Repositories DevTools

Rev

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