Subversion Repositories DevTools

Rev

Rev 5962 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5356 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|                   Bom_Home                        |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
Response.buffer = True
13
%>
14
<%
15
'To enable the script timeout to 10 mins
16
Server.ScriptTimeout=600
17
%>
18
<!--#include file="common/globals.asp"-->
19
<!--#include file="common/config.asp"-->
20
<!--#include file="common/common_subs.asp"-->
21
<!--#include file="common/_bom_common.asp"-->
22
<!--#include file="controls/ERGFormComponent/classFormComponent.asp"-->
23
<%
24
'------------ ACCESS CONTROL ------------------
25
%>
26
<!--#include file="_access_control_general.asp"-->
27
<%
28
'------------ VARIABLE DEFINITION -------------
29
Dim rsQry
30
Dim parProd_id_select
31
Dim parShowall
32
 
33
Dim objFormCollector
34
Dim objFormComponent
35
Dim rsTemp
36
'------------ CONSTANTS DECLARATION -----------
37
Const LIMG_UPDATED = "<img src='icons/i_updated.gif' width='11' height='11' hspace='2' vspace='2' border='0' align='absmiddle' title='Updated'>"
38
Const LIMG_ADDED = "<img src='icons/i_added.gif' width='11' height='11' border='0' hspace='2' vspace='2' align='absmiddle' title='Added'>"
39
Const LIMG_REMOVED = "<img src='icons/i_removed.gif' width='11' height='11' border='0' hspace='2' vspace='2' align='absmiddle' title='Removed'>"
40
Const LIMG_NOTE_NEW = "<img src='icons/i_note_new.gif' width='18' height='18' border='0' align='absmiddle'>"
41
Const LIMG_NOTE_EDIT = "<img src='icons/i_note_edit.gif' width='18' height='18' border='0' align='absmiddle'>"
42
'------------ VARIABLE INIT -------------------
43
Set objFormCollector = CreateObject("Scripting.Dictionary")
44
Set objFormComponent = New FormComponent
45
'------------ CONDITIONS ----------------------
46
'----------------------------------------------
47
%>
48
<%
49
'--------------------------------------------------------------------------------------------------------------------------
50
'Extract the parts of the version string into seperate variables
51
Sub GetMajorMinorPatch( ByVal versionString, ByRef Major, ByRef Minor, ByRef Patch)
52
 
53
   Dim pos
54
 
55
   ' Find the first occurence of the dot in package version A
56
   pos = InStr(versionString, ".")
57
   If pos <> 0 Then
58
      ' Extract the Major Version for A
59
      Major = Mid(versionString, 1, pos - 1)
60
      ' Delete the Major Version Value from the string to get the minor and patch version
61
      versionString = Mid(versionString, pos + 1, Len(versionString))
62
      ' Find the second occurence of the dot in package version A
63
      pos = InStr(versionString, ".")
64
      ' Extract the Minor Version for A
65
      If pos <> 0 Then
66
         Minor = Mid(versionString, 1, pos - 1)
67
         ' Delete the Minor Version value from the string to get the patch version
68
         versionString = Mid(versionString, pos + 1, Len(versionString))
69
         ' Find the last occurence of the dot in package version A
70
         pos = InStr(versionString, ".")
71
         If pos <> 0 Then
72
            ' Extract the Patch Version for A
73
            Patch = Mid(versionString, 1, pos - 1)
74
         End If
75
      End If
76
   End If
77
 
78
End Sub
79
'--------------------------------------------------------------------------------------------------------------------------
80
Sub AdjustPatch(ByRef PatchA, ByRef PatchB)
81
   If NOT isNull(PatchA) AND NOT isNull(PatchB) Then
82
      If isNumeric(PatchA) AND isNumeric(PatchB) Then
83
         If CLng(PatchA) < 1000 Then
84
            PatchA = CLng(PatchA) * 1000
85
         End If
86
         If CLng(PatchB) < 1000 Then
87
            PatchB = CLng(PatchB) * 1000
88
         End If
89
      End If
90
   End If
91
End Sub
92
'--------------------------------------------------------------------------------------------------------------------------
93
' Return True if verA is same or newer than verB, else return false
94
' If for some reason verA cannot be compared to verB, return the defaultReturn value as specified.
95
' This might happen if for example one of the version inputs was null due to one BOM not containing the package
96
' that another BOM did contain.
97
Function Is_VerA_SameOrNewerThan_VerB(ByVal verA, ByVal verB, defaultReturn)
98
 
99
   ' Process the version numbers to see what the difference is
100
   Dim MajorA, MajorB, MinorA, MinorB, PatchA, PatchB
101
 
102
   MajorA = NULL
103
   MajorB = NULL
104
   MinorA = NULL
105
   MinorB = NULL
106
   PatchA = NULL
107
   PatchB = NULL
108
 
109
   Is_VerA_SameOrNewerThan_VerB = defaultReturn
110
 
111
   Call GetMajorMinorPatch(verA, MajorA, MinorA, PatchA)
112
 
113
   Call GetMajorMinorPatch(verB, MajorB, MinorB, PatchB)
114
 
115
   Call AdjustPatch(PatchA, PatchB)
116
 
117
   If MajorA = MajorB Then
118
      If MinorA = MinorB Then
119
         If IsNumeric(PatchA) AND IsNumeric(PatchB) Then
120
 
121
            If CDbl(PatchB) > CDbl(PatchA) Then
122
               Is_VerA_SameOrNewerThan_VerB = False
123
            Else
124
               Is_VerA_SameOrNewerThan_VerB = True
125
            End If
126
         End If
127
      Else
128
         If IsNumeric(MinorA) AND IsNumeric(MinorB) Then
129
            If CInt(MinorB) > CInt(MinorA) Then
130
               Is_VerA_SameOrNewerThan_VerB = False
131
            Else
132
               Is_VerA_SameOrNewerThan_VerB = True
133
            End If
134
         End If
135
      End If
136
   Else
137
      If IsNumeric(MajorA) AND IsNumeric(MajorB) Then
138
         If CInt(MajorB) > CInt(MajorA) Then
139
            Is_VerA_SameOrNewerThan_VerB = False
140
         Else
141
            Is_VerA_SameOrNewerThan_VerB = True
142
         End If
143
      End If
144
   End If
145
 
146
End Function
147
'--------------------------------------------------------------------------------------------------------------------------
148
' Get the product ID, package version, and comments for a specifed package ID in a specified BOM
149
' The specified BOM is always going to be the production BOM, although the actual query used is general. Only
150
' the name of the oracle query parameter (PRODUCTION_BOM) implies that the BOM is expected to be the production BOM.
151
Function GetProductIDandVersionInBOM(bom_id, pkg_id, ByRef prod_id, ByRef pkg_version, ByRef comments)
152
   Dim rsQry
153
 
154
   OraDatabase.Parameters.Remove "PRODUCTION_BOM"
155
   OraDatabase.Parameters.Remove "PKG_ID"
156
   OraDatabase.Parameters.Add    "PRODUCTION_BOM", bom_id, ORAPARM_INPUT, ORATYPE_NUMBER
157
   OraDatabase.Parameters.Add    "PKG_ID",         pkg_id, ORAPARM_INPUT, ORATYPE_NUMBER
158
 
159
   Set rsQry = OraDatabase.DbCreateDynaset(GetQuery("ProdVersion.sql"), ORADYN_DEFAULT)
160
 
161
   If rsQry.RecordCount > 0 Then
162
      prod_id     = rsQry("prod_id")
163
      pkg_version = rsQry("pkg_version")
164
      comments    = rsQry("comments")
165
 
166
      GetProductIDandVersionInBOM = True
167
   Else
168
      ' must set these to NULL so that Is_VerA_SameOrNewerThan_VerB() doesn't do anything
169
      prod_id     = NULL
170
      pkg_version = NULL
171
      comments    = NULL
172
 
173
      GetProductIDandVersionInBOM = False
174
   End If
175
 
176
   rsQry.Close()
177
   Set rsQry = Nothing
178
 
179
   OraDatabase.Parameters.Remove "PRODUCTION_BOM"
180
   OraDatabase.Parameters.Remove "PKG_ID"
181
End Function
182
'--------------------------------------------------------------------------------------------------------------------------
183
' This function returns True if for any package that is in both the comparison and production BOMs, the version in the
184
' comparison BOM is the same or newer than that in the production BOM
185
Function CheckProduction (ProductionBOM, ComparisonBOM)
186
 
187
   Dim PkgIdInComparisonBOM
188
   Dim PkgVersionInComparisonBOM
189
 
190
   Dim ProdIdInProductionBOM
191
   Dim PkgVersionInProductionBOM
192
   Dim Comments
193
 
194
   CheckProduction = False 'Setting it initially to be false
195
 
196
   OraDatabase.Parameters.Remove "PRODUCTION_BOM"
197
   OraDatabase.Parameters.Add    "PRODUCTION_BOM", ProductionBOM, ORAPARM_INPUT, ORATYPE_NUMBER
198
   OraDatabase.Parameters.Add    "CURRENT_BOM",    ComparisonBOM, ORAPARM_INPUT, ORATYPE_NUMBER
199
 
200
   Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery ("BomCheck.sql"), ORADYN_DEFAULT )
201
 
202
   OraDatabase.Parameters.Remove "CURRENT_BOM"
203
 
204
   ' iterate through packages
205
   While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF) AND (CheckProduction = False)
206
 
207
      PkgIdInComparisonBOM      = rsTemp("pkg_id")
208
      PkgVersionInComparisonBOM = rsTemp("pkg_version")
209
 
210
      ' Get the version of this product that is currently in the production BOM
211
      If (GetProductIDandVersionInBOM( ProductionBOM, PkgIdInComparisonBOM, ProdIdInProductionBOM, PkgVersionInProductionBOM, Comments ) = True) Then
212
         'check to see if the comparison BOM has the same or newer version
213
         CheckProduction = Is_VerA_SameOrNewerThan_VerB( PkgVersionInComparisonBOM, PkgVersionInProductionBOM, False )
214
      End If
215
 
216
      rsTemp.MoveNext()
217
   WEnd
218
 
219
   OraDatabase.Parameters.Remove "PRODUCTION_BOM"
220
 
221
   rsTemp.Close()
222
   Set rsTemp = Nothing
223
End Function
224
'--------------------------------------------------------------------------------------------------------------------------
225
Function AddTrailingZeros(byval n, byval count)
226
   if len(n) >= count then
227
      AddTrailingZeros = n
228
      exit function
229
   end if
230
 
231
   dim c, s, i
232
   c = count - len(n)
233
 
234
   for i = 1 to c
235
      s = s & "0"
236
   next
237
   s = cstr(n) & s
238
 
239
   AddTrailingZeros = s
240
End function
241
'--------------------------------------------------------------------------------------------------------------
242
Sub GetProductList ( nBom_id, nComparedBomId, outProductList, Flag )
243
   Dim rsQry, showAll
244
 
245
   '' Use SHOWALL parameter is BOM has old bom
246
   'showAll = "Y"
247
   'If nBom_id <> nComparedBomId Then
248
   '   showAll = parShowall
249
   'End If
250
   OraDatabase.Parameters.Add "BOM_ID",         nBom_id,        ORAPARM_INPUT, ORATYPE_NUMBER
251
   OraDatabase.Parameters.Add "COMPARE_BOM_ID", nComparedBomId, ORAPARM_INPUT, ORATYPE_NUMBER
252
   OraDatabase.Parameters.Add "CURRENT_BOM",    dbPARbom_id,    ORAPARM_INPUT, ORATYPE_NUMBER
253
 
254
   If Flag = TRUE Then
255
      Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("BomCompare.sql"), ORADYN_DEFAULT )
256
   Else
257
      Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("BomCompare_BaseConfig.sql"), ORADYN_DEFAULT )
258
   End If
259
 
260
   If rsQry.RecordCount > 0 Then
261
      outProductList = rsQry.GetRows()
262
   Else
263
      outProductList = NULL
264
   End If
265
 
266
   OraDatabase.Parameters.Remove "COMPARE_BOM_ID"
267
   OraDatabase.Parameters.Remove "BOM_ID"
268
   OraDatabase.Parameters.Remove "CURRENT_BOM"
269
End Sub
270
'--------------------------------------------------------------------------------------------------------------------------
271
Sub GetFormDetails ( nBom_id, ByRef outobjDetails )
272
 
273
   Call GetBomDetails ( nBom_id, outobjDetails )
274
 
275
   outobjDetails.Item("root_version") = GetRootVersion ( outobjDetails.Item("bom_version") )
276
 
277
   '-- Set compare_bom_id
278
   If Request("compare_bom_id") <> "" Then
279
      outobjDetails.Item("compare_bom_id") =  Request("compare_bom_id")
280
   Else
281
      outobjDetails.Item("compare_bom_id") = outobjDetails.Item("parent_bom_id")
282
   End If
283
 
284
End Sub
285
'--------------------------------------------------------------------------------------------------------------
286
Function GetBomTreeList ()
287
   Dim rsQry
288
 
289
   OraDatabase.Parameters.Add "BRANCH_ID", objFormCollector.Item("rtag_id_fk"), ORAPARM_INPUT, ORATYPE_NUMBER
290
   OraDatabase.Parameters.Add "BOM_ID",    objFormCollector.Item("bom_id"),     ORAPARM_INPUT, ORATYPE_NUMBER
291
   OraDatabase.Parameters.Add "BOM_NAME",  objFormCollector.Item("bom_name"),   ORAPARM_INPUT, ORATYPE_NUMBER
292
 
293
   If objFormCollector.Item("rtag_id_fk") = 542 Then'This is because SFO uses Front Office and Back Office
294
      Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ProductionTreeComboSFO.sql"), ORADYN_DEFAULT )
295
   Else
296
      Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ProductionTreeCombo.sql"), ORADYN_DEFAULT )
297
   End If
298
 
299
   If rsQry.RecordCount > 0 Then
300
      GetBomTreeList = rsQry.GetRows()
301
 
302
   Else
303
      GetBomTreeList = NULL
304
 
305
   End If
306
 
307
   OraDatabase.Parameters.Remove "BRANCH_ID"
308
   OraDatabase.Parameters.Remove "BOM_NAME"
309
   OraDatabase.Parameters.Remove "BOM_ID"
310
 
311
   rsQry.Close
312
   Set rsQry = Nothing
313
End Function
314
 
315
'--------------------------------------------------------------------------------------------------------------
316
Function GetCompareBomDetails ( nBomId )
317
   Dim rsQry
318
   OraDatabase.Parameters.Add "BOM_ID",    nBomId,   ORAPARM_INPUT, ORATYPE_NUMBER
319
 
320
   Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("BomLocationDetails.sql"), ORADYN_DEFAULT )
321
 
322
   If rsQry.RecordCount > 0 Then
323
      GetCompareBomDetails = rsQry("proj_name") &"&nbsp;/&nbsp;"& rsQry("branch_name") &"&nbsp;/&nbsp;"& rsQry("bom_name") &"&nbsp;"& rsQry("bom_version") &"."& rsQry("bom_lifecycle")
324
 
325
   Else
326
      GetCompareBomDetails = NULL
327
 
328
   End If
329
 
330
   OraDatabase.Parameters.Remove "BOM_ID"
331
 
332
   rsQry.Close
333
   Set rsQry = Nothing
334
End Function
335
'--------------------------------------------------------------------------------------------------------------
336
%>
337
<%
338
'------------ RUN BEFORE PAGE RENDER ----------
339
objPMod.PersistInQryString ( Array("compare_bom_id") )
340
 
341
Call GetFormDetails ( dbPARbom_id, objFormCollector )
342
'----------------------------------------------
343
%>
344
<html>
345
<head>
346
<title>Production Manager</title>
347
<link rel="shortcut icon" href="<%=FavIcon%>"/>
348
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
349
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6671 dpurdie 350
<link href="scripts/deployment_manager.css?ver=<%=VixVerNum%>" rel="stylesheet" type="text/css">
351
<script language="JavaScript" src="scripts/common.js?ver=<%=VixVerNum%>"></script>
352
<script language="JavaScript" src="scripts/remote_scripting.js?ver=<%=VixVerNum%>"></script>
5356 dpurdie 353
<script language="JavaScript" type="text/javascript">
354
<!--
355
 
356
function RequestProductLocation( paramString, rowId ){
357
   var requestURL;
358
 
359
   // Product is changes, hence can be found in current bom
360
   requestURL = 'RequestBomDiffProductLocation.asp';
361
 
362
 
363
   // Show div
364
   ToggleDisplay( 'PRODUCT_'+ rowId, 'IMG_EXPAND_PRODUCT_' + rowId, 'IMG_COLLAPSE_PRODUCT_' + rowId );
365
 
366
   // Set ajax divname
367
   ajaxdivname = 'PRODUCT_'+ rowId;
368
 
369
   if ( MM_findObj( ajaxdivname ).innerHTML == '<%=enumLOADING%>')
370
   {
371
 
372
      //Append the name to search for to the requestURL
373
      var url = requestURL + paramString;
374
 
375
      //Create the xmlHttp object to use in the request
376
      //stateChangeHandler will fire when the state has changed, i.e. data is received back
377
      // This is non-blocking (asynchronous)
378
      xmlHttp = GetXmlHttpObject(stateChangeHandler);
379
 
380
      //Send the xmlHttp get to the specified url
381
      xmlHttp_Get(xmlHttp, url);
382
 
383
   }
384
 
385
 
386
}
387
 
388
function RequestProductNotes( paramString, rowId ){
389
   var requestURL;
390
 
391
   // Product is changes, hence can be found in current bom
392
   requestURL = 'RequestProductNotes.asp';
393
 
394
 
395
   // Show div
396
   ToggleDisplay( 'PRODNOTES_'+ rowId, 'IMG_EXPAND_PRODNOTES_' + rowId, 'IMG_COLLAPSE_PRODNOTES_' + rowId );
397
 
398
   // Set ajax divname
399
   ajaxdivname = 'PRODNOTES_'+ rowId;
400
 
401
   if ( MM_findObj( ajaxdivname ).innerHTML == '<%=enumLOADING%>')
402
   {
403
 
404
      //Append the name to search for to the requestURL
405
      var url = requestURL + paramString;
406
 
407
      //Create the xmlHttp object to use in the request
408
      //stateChangeHandler will fire when the state has changed, i.e. data is received back
409
      // This is non-blocking (asynchronous)
410
      xmlHttp = GetXmlHttpObject(stateChangeHandler);
411
 
412
      //Send the xmlHttp get to the specified url
413
      xmlHttp_Get(xmlHttp, url);
414
 
415
   }
416
}
417
 
418
function RequestPatches( paramString, rowId ){
419
   var requestURL;
420
 
421
   // Product is changes, hence can be found in current bom
422
   requestURL = 'RequestBomDiffPatches.asp';
423
 
424
 
425
   // Show div
426
   ToggleDisplay( 'PRODUCT_'+ rowId, 'IMG_EXPAND_PRODUCT_' + rowId, 'IMG_COLLAPSE_PRODUCT_' + rowId );
427
 
428
   // Set ajax divname
429
   ajaxdivname = 'PRODUCT_'+ rowId;
430
 
431
   if ( MM_findObj( ajaxdivname ).innerHTML == '<%=enumLOADING%>')
432
   {
433
 
434
      //Append the name to search for to the requestURL
435
      var url = requestURL + paramString;
436
 
437
      //Create the xmlHttp object to use in the request
438
      //stateChangeHandler will fire when the state has changed, i.e. data is received back
439
      // This is non-blocking (asynchronous)
440
      xmlHttp = GetXmlHttpObject(stateChangeHandler);
441
 
442
      //Send the xmlHttp get to the specified url
443
      xmlHttp_Get(xmlHttp, url);
444
 
445
   }
446
 
447
}
448
 
449
 
450
 
451
 
452
//-->
453
</script>
454
</head>
455
<body leftmargin="0" topmargin="0">
456
<!-- HEADER ++++++++++++++++ -->
457
<!--#include file="_header.asp"-->
458
<!-- +++++++++++++++++++++++ -->
459
<!-- MAIN MENU  +  CRUMBS ++++++++++++++++ -->
460
<!--#include file="_main_menu.asp"-->
461
<!-- +++++++++++++++++++++++++++++++++++++ -->
462
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
463
   <tr>
464
      <td width="1%" valign="top" background="images/bg_bage_0.gif">
465
         <!-- NODE BROWSER ++++++++++++++++++++++ -->
466
         <!--#include file="_bom_browser.asp"-->
467
         <!-- END OF NODE BROWSER +++++++++++++++ -->
468
      </td>
469
      <td width="1" background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="600"></td>
470
      <td width="100%" valign="top" bgcolor="#FFFFFF">
471
         <table width="100%"  border="0" cellspacing="0" cellpadding="0">
472
            <tr>
473
               <td valign="top" background="images/bg_green.gif"></td>
474
               <td align="right" valign="bottom" background="images/bg_green.gif" class="body_txtw"><%Call RenderTitleWithoutVersion( objBomCollector )%></td>
475
               <td background="images/bg_green.gif"><img src="images/spacer.gif" width="10" height="20"></td>
476
            </tr>
477
            <tr>
478
               <td width="1%" valign="top" background="images/bg_green.gif"></td>
479
               <td width="100%" valign="bottom" background="images/bg_green.gif">
480
                  <!-- TAB CONTROLS ++++++++++++++++++++++ -->
481
                  <!--#include file="_tabs_definition.asp"-->
482
                  <%
483
                  Set objTabControl = New TabControl
484
                  objTabControl.TemplateDoc = ReadFile( Server.MapPath("controls/ERGTabStyleWinXP/tab_style.html") ) ' Supply tab style definition
485
                  objTabControl.TabStyle = "StyleWinXP"
486
                  objTabControl.AddTabDefnition ( arrBomTabDef )
487
                  objTabControl.Render ()
488
                  %>
489
                  <!-- END OF TAB CONTROLS +++++++++++++++ -->
490
               </td>
491
               <td width="1%" background="images/bg_green.gif"><img src="images/spacer.gif" width="10" height="35"></td>
492
            </tr>
493
            <tr>
494
               <td background="images/bg_bage_0.gif"><img src="images/spacer.gif" width="30" height="10"></td>
495
               <td background="images/bg_bage_0.gif">
496
                  <!-- BUTTONS CONTROL +++++++++++++++++++ -->
497
                  <%
498
                  '-- Define Action buttons on this tab
499
                  aTabBtnsDef = Array("abtnAddPatches")
500
 
501
                  Call LoadTabActionButtons ( aTabBtnsDef, objBtnControl )
502
 
503
                  ' -- Tell control if buttons need to be readonly actions
504
                  objBtnControl.IsReadonlyAction = objBomCollector.Item("is_readonly")
505
 
506
                  ' -- Render Buttons
507
                  Call objBtnControl.Render  ( aTabBtnsDef )
508
                  %>
509
                  <!-- +++++++++++++++++++++++++++++++++++ -->
510
               </td>
511
               <td background="images/bg_green.gif"><img src="images/p_bar_corrner.gif" width="17" height="42"></td>
512
            </tr>
513
            <tr>
514
               <td>&nbsp;</td>
515
               <td>&nbsp;</td>
516
               <td valign="top"><%If Request.Cookies( enumCOOKIE_NAME )( "user_bar" ) = "hide" Then%><a href="<%=SCRIPT_NAME%>?user_bar=<%=enumDEFAULT%>&<%=objPMod.ComposeURL()%>"><img src="icons/b_left.gif" title="Maximize favourits" width="13" height="13" vspace="5" border="0"></a><%End If%></td>
517
            </tr>
518
         </table>
519
 
520
         <!-- PRODUCT REJECTED ------------------------------------------------------------------------------------------ -->
521
         <%If objBomCollector.Item ("is_rejected") = enumDB_YES Then%>
522
            <table width="100%"  border="0" cellspacing="10" cellpadding="0">
523
               <tr>
524
                  <td>
525
                     <%
526
                     OraDatabase.Parameters.Add "ENTITY_ID",        dbPARbom_id,           ORAPARM_INPUT, ORATYPE_NUMBER
527
                     OraDatabase.Parameters.Add "ENUM_ENTITY_TYPE", "enumENTITY_TYPE_BOM", ORAPARM_INPUT, ORATYPE_VARCHAR2
528
 
529
                     Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("RejectionTrail.sql"), ORADYN_DEFAULT )
530
 
531
                     Dim sMessage
532
                     sMessage = "<table width='100%'  border='0' cellspacing='3' cellpadding='0'>"
533
                     sMessage = sMessage &"<tr>"
534
                     sMessage = sMessage &"<td width='100%' class='body_txt'><b>BOM is REJECTED!</b><br><br><br></td>"
535
                     sMessage = sMessage &"<td width='1%' nowrap valign='bottom' align='right'><a href='javascript:;' onClick=""MM_openBrWindow('wBomRejectNote.asp?rfile="& SCRIPT_NAME &"&"& objPMod.ComposeURL() &"','BomRejectNote','scrollbars=yes,resizable=yes,width=600,height=350');""  class='body_smllink' title='Create new note'>Create Note"& LIMG_NOTE_NEW &"</a></td>"
536
                     sMessage = sMessage &"</tr>"
537
 
538
                     While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
539
                        sMessage = sMessage & "<tr><td colspan='2' background='images/bg_table_border.gif'><img src='images/spacer.gif' width='1' height='1'></td></tr>"
540
                        sMessage = sMessage &"<tr>"
541
                        sMessage = sMessage &"<td class='body_txt'>"
542
                        If rsQry("is_rejected") = enumDB_YES Then
543
                           sMessage = sMessage &"BOM is REJECTED!<br>"
544
                        Else
545
                           sMessage = sMessage &"BOM is Accepted!<br>"
546
                        End If
547
                        sMessage = sMessage & objFormater.TextToHTML( rsQry("comments") ) &"<br><SPAN class='body_smltxtg'>"& rsQry("creator") &"</SPAN></td>"
548
                        sMessage = sMessage &"<td nowrap valign='bottom' align='right'><a href='javascript:;' onClick=""MM_openBrWindow('wBomRejectNote.asp?reject_seq="& rsQry("reject_seq") &"&rfile="& SCRIPT_NAME &"&"& objPMod.ComposeURL() &"','BomRejectNote','scrollbars=yes,resizable=yes,width=600,height=350');"" class='body_smllink' title='Edit note'>Edit Note"& LIMG_NOTE_EDIT &"</a></td>"
549
                        sMessage = sMessage &"</tr>"
550
 
551
                        rsQry.MoveNext
552
                     WEnd
553
                     rsQry.Close
554
 
555
                     sMessage = sMessage &"</table>"
556
 
557
                     Call Messenger ( sMessage, "bi_rejected.gif", "100%" )
558
 
559
                     Response.write "<br>"
560
 
561
 
562
                     OraDatabase.Parameters.Remove "ENTITY_ID"
563
                     OraDatabase.Parameters.Remove "ENUM_ENTITY_TYPE"
564
                     %>
565
                  </td>
566
               </tr>
567
            </table>
568
         <%End If%>
569
         <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
570
 
571
         <table width="100%"  border="0" cellspacing="10" cellpadding="0">
572
 
573
            <tr>
574
               <td width="1"><img src="images/spacer.gif" width="1" height="1"></td>
575
               <td width="100%"><img src="images/spacer.gif" width="1" height="1"></td>
576
            </tr>
577
 
578
            <!-- BOM Comments +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
579
            <%If (objBomCollector.Item("bom_comments") <> "") Then%>
580
               <tr>
581
                  <td align="right" valign="top"><img src="icons/i_bom_properties.gif" width="30" height="30" hspace="3"></td>
582
                  <td valign="top" class="body_txt">
583
                     <SPAN class="body_colb">BOM Comments</SPAN>
584
                     <hr width="100%" size="1px" noshade color="#808080">
585
                     <SPAN class="body_txt"><%= objFormater.TextToHTML( objBomCollector.Item("bom_comments") )%></SPAN><br><br><br><br>
586
                  </td>
587
               </tr>
588
            <%End If%>
589
 
590
            <!-- COMPARE BOM +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
591
            <tr>
592
               <td align="right" valign="top"><img src="icons/i_bom_diff.gif" width="37" height="33" hspace="3"></td>
593
               <td valign="top" class="body_txt">
594
                  <%
595
                  '-- FROM START --------------------------------------------------------------------------------------------------------------
596
                  objFormComponent.FormName = "OldVersion"
597
                  objFormComponent.Action = SCRIPT_NAME
598
                  objFormComponent.Method = "get"
599
                  Call objFormComponent.FormStart()
600
 
601
                  Dim numOfBomRows
602
                  Dim rowNumBom
603
 
604
                  If (NOT IsNull(GetBomTreeList())) Then
605
                     numOfBomRows = UBound( GetBomTreeList(), 2 )
606
                  Else
607
                     numOfBomRows = -1
608
                  End If
609
 
610
                  For rowNumBom = 0 To numOfBomRows
611
                     Dim thisBomId
612
                     Dim nextBomId
613
                     thisBomId = GetBomTreeList()( 0, rowNumBom )
614
                     If rowNumBom = numOfBomRows Then
615
                        nextBomId = 0
616
                     Else
617
                        nextBomId = GetBomTreeList()( 0, rowNumBom + 1 )
618
                     End If
619
 
620
                     Call GetFormDetails ( thisBomId, objBomCollector )
621
                     %>
622
                     <SPAN class="body_colb"><br><%= objFormater.TextToHTML( objBomCollector.Item("bom_comments") )%><br><br></SPAN>
623
                     <SPAN class="body_colb">Products/Patches Introduced in <%Call RenderTitle( objBomCollector )%> but not yet deployed in Production BOM<br></SPAN>
624
                     <%If InStr(APP_ROOT, "DEPLOYMAN_WWW") > 0 Then%>
625
                        <a href="downloads\<%Call RenderTitleWithoutBold( objBomCollector )%>.pdf" class="body_link" target="_blank"><b>Click here to Download PDF</b></a>
626
                     <%Else%>
627
                        <a href="../deployment_manager/pdf\<%Call RenderTitleWithoutBold( objBomCollector )%>.pdf" class="body_link" target="_blank"><b>Click here to Download PDF</b></a>
628
                     <%End If%>
629
                     <hr width="100%" size="1px" noshade color="#808080">
630
                     <table width="100%"  border="0" cellspacing="2" cellpadding="0">
631
                        <tr>
632
                           <td width="20%" background="images/bg_table_border.gif">
633
                              <table width="100%"  border="0" cellspacing="1" cellpadding="2">
634
                                 <tr>
635
                                    <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Product</td>
636
                                 </tr>
637
                              </table>
638
                           </td>
639
                           <td width="20%" nowrap align="left" background="images/bg_table_col.gif" class="body_col">Version</td>
640
                           <td width="60%" nowrap align="left" background="images/bg_table_col.gif" class="body_col">Reason For This Version</td>
641
                           <td width="60%" nowrap align="left" background="images/bg_table_col.gif" class="body_col">Approval</td>
642
                        </tr>
643
                        <%
644
                        If NOT CheckProduction( Request("bom_id"), thisBomId) Then
645
                           %>
646
                           <tr>
647
                              <td colspan="4" class="body_txtr"><b>Found Matching BOM or Older Versions...Exiting Comparison</b></td>
648
                           </tr>
649
                           <%
650
                           Exit For
651
                        End If
652
 
653
                        Dim aProductList
654
 
655
                        Call GetProductList ( thisBomId, nextBomId, aProductList, TRUE )
656
 
657
                        If NOT IsNull( aProductList ) Then
658
 
659
                           ' Variable used to prevent multiple entries being rendered for the same package
660
                           Dim LastPkgId
661
                           LastPkgId = -1
662
 
663
                           Dim numOfProdRows
664
                           Dim rowNumProd
665
 
666
                           numOfProdRows = UBound( aProductList, 2 )
667
 
668
                           ' Iterate through the list of products
669
                           For rowNumProd = 0 To numOfProdRows
670
 
671
                              Response.Flush
672
 
673
                              Dim thisProdId
674
                              Dim thisPkgName
675
                              Dim thisPkgVersion
676
                              Dim thisIsPatch
677
                              Dim thisIsRejected
678
                              Dim thisPkgId
679
 
680
                              'Extract values into named variables to make code more readable where the values are used later on
681
                              thisProdId      = aProductList( 0, rowNumProd )
682
                              thisPkgName     = aProductList( 1, rowNumProd )
683
                              thisPkgVersion  = aProductList( 2, rowNumProd )
684
                              thisIsPatch     = aProductList( 3, rowNumProd )
685
                              thisIsRejected  = aProductList( 4, rowNumProd )
686
                              thisPkgId       = aProductList( 5, rowNumProd )
687
 
688
                              ' Get the version of this product that is currently in the production BOM
689
                              Dim ProdIdInProductionBOM
690
                              Dim PkgVersionInProductionBOM
691
                              Dim Comments
692
                              Call GetProductIDandVersionInBOM( dbPARbom_id, thisPkgId, ProdIdInProductionBOM, PkgVersionInProductionBOM, Comments )
693
 
694
                              ' We want to figure out if we have to display this product. We only want to do so if the version of it is the
695
                              ' same or newer than that currently in the production BOM
696
                              Dim IsDisplay
697
                              IsDisplay = True
698
 
699
                              If IsNull(thisIsPatch) Then
700
                                 IsDisplay = Is_VerA_SameOrNewerThan_VerB( thisPkgVersion, PkgVersionInProductionBOM, IsDisplay )
701
                              End If
702
 
703
                              If IsDisplay Then
704
                                 Set rsTemp = OraDatabase.DbCreateDynaset("SELECT * FROM PACKAGE_VERSIONS PV, PRODUCT_DETAILS PD WHERE PD.PROD_ID(+) = PV.PV_ID AND PV.PV_ID ="&thisProdId, ORADYN_DEFAULT )
705
                                 %>
706
                                 <%If IsNull(thisIsPatch) Then
707
                                    If CDbl(LastPkgId) <> CDbl(thisPkgId) Then%>
708
                                       <tr>
709
                                          <td nowrap valign="top">
710
                                             <SPAN id="IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId%>" name="IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId%>" style="display:block;">
711
                                                <a href="javascript:;" class="menu_link" onClick="RequestProductLocation('?new_version=<%=thisPkgVersion%>&new_prod_id=<%=thisProdId%>&prod_id=<%=ProdIdInProductionBOM%>&bom_id=<%=dbPARbom_id%>&compare_bom_id=<%=thisBomId%>&pkg_id=<%=thisPkgId%>&change_type=', '<%=thisBomId%>_<%=thisProdId%>');">
712
                                                   <%=LIMG_EXPAND & GetProductIcon( rsTemp ) & thisPkgName%>
713
                                                </a>
714
                                             </SPAN>
715
                                             <SPAN id="IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId%>" name="IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId%>" style="display:none;">
716
                                                <a href="javascript:;" class="menu_link" onClick="ToggleDisplay( 'PRODUCT_<%=thisBomId%>_<%=thisProdId%>', 'IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId%>', 'IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId%>');">
717
                                                   <%=LIMG_COLLAPSE & GetProductIcon( thisIsRejected ) &  thisPkgName%>
718
                                                </a>
719
                                             </SPAN>
720
                                          </td>
721
                                          <td nowrap class="body_row" valign="top"><%=thisPkgVersion%>         </td>
722
                                          <td class="body_rowlite"><%=rsTemp("comments")%> <!-- <a href="download_version.asp?prod_id=<%=thisProdId%>&bom_id=<%=Request("bom_id")%>&os_id=" class="body_link">Download</a> --></td>
723
                                          <%
724
                                          Dim rsForm, Tester, Manager
725
                                          Tester = False
726
                                          Manager = False
727
                                          If objAccessControl.IsActive("ApprovedByManager") Then
728
                                             Manager = True
729
                                          ElseIf objAccessControl.IsActive("ApprovedByTester") Then
730
                                             Tester = True
731
                                          End If
732
 
733
                                          Set rsForm = OraDatabase.DbCreateDynaset("SELECT * FROM RELEASE_AUTHORISATION WHERE PV_ID="&thisProdId&" AND BOM_ID="&Request("bom_id"), ORADYN_DEFAULT)
734
 
735
                                          %>
736
                                          <%If rsForm.RecordCount = 0 Then%>
737
                                             <%If Tester Then%>
738
                                                <td class="body_rowlite"><a href="_wform_approval.asp?pv_id=<%=thisProdId%>&bom_id=<%=Request("bom_id")%>" onClick="popup = window.open('_wform_approval.asp?pv_id=<%=thisProdId%>&bom_id=<%=Request("bom_id")%>', 'Approval Form', 'height=220,width=600,scrollbars=yes,resizable=yes'); return false" target="_blank" style="text-decoration:none" class="body_txtr">Accept/Reject</a></td>
739
                                             <%ElseIf Manager Then%>
740
                                                <td class="body_txto">Awaiting Tester</td>
741
                                             <%Else%>
742
                                                <td class="body_txto"></td>
743
                                             <%End If%>
744
                                          <%ElseIf IsNull(rsForm("is_official")) Then%>
745
                                             <%If NOT IsNull(rsForm("tester_id")) And Tester   Then %>
746
                                                <td class="body_txto">Awaiting Manager</td>
747
                                             <%ElseIf NOT IsNull(rsForm("tester_id")) And Manager Then%>
748
                                                <td class="body_rowlite"><a href="_wform_approval.asp?pv_id=<%=thisProdId%>&bom_id=<%=Request("bom_id")%>" onClick="popup = window.open('_wform_approval.asp?pv_id=<%=thisProdId%>&bom_id=<%=Request("bom_id")%>', 'Approval Form', 'height=440,width=600,scrollbars=yes,resizable=yes'); return false" target="_blank" style="text-decoration:none" class="body_txtr">Accept</a></td>
749
                                             <%Else%>
750
                                                <td class="body_rowlite"></td>
751
                                             <%End If%>
752
                                          <%Else%>
753
                                             <td class="body_txtg">Accepted</td>
754
                                          <%End If
755
 
756
                                          rsForm.Close()
757
                                          Set rsForm = nothing
758
                                          %>
759
                                       </tr>
760
                                       <tr>
761
                                          <td nowrap valign="top" class="body_row" colspan="3">
762
                                             <DIV id="PRODUCT_<%=thisBomId%>_<%=thisProdId%>" name="PRODUCT_<%=thisBomId%>_<%=thisProdId%>" style="display:none;"><%=enumLOADING%></DIV>
763
                                          </td>
764
                                       </tr>
765
 
766
                                       <%If rowNumProd <> numOfProdRows Then%>
767
                                          <tr>
768
                                             <td colspan="4" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
769
                                          </tr>
770
                                       <%End If%>
771
                                    <%End If%>
772
                                 <%Else
773
                                    If CDbl(LastPkgId) <> CDbl(thisPkgId) Then
774
                                       %>
775
                                       <tr>
776
                                          <%If rowNumBom <> numOfBomRows Then%>
777
                                             <td nowrap valign="top">
778
                                                <SPAN id="IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" name="IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" style="display:block;">
779
                                                   <a href="javascript:;" class="menu_link" onClick="RequestPatches('?pkg_id=<%=thisPkgId%>&bom_id=<%=thisBomId%>&compare_bom_id=<%=nextBomId%>&current_bom_id=<%=dbPARbom_id%>', '<%=thisBomId%>_<%=thisProdId & thisIsPatch%>');">
780
                                                      <%=LIMG_EXPAND & GetProductIcon( rsTemp ) & thisPkgName%>
781
                                                   </a>
782
                                                </SPAN>
783
                                                <SPAN id="IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" name="IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" style="display:none;">
784
                                                   <a href="javascript:;" class="menu_link" onClick="ToggleDisplay( 'PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>', 'IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>', 'IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>');">
785
                                                      <%=LIMG_COLLAPSE & GetProductIcon( rsTemp ) & thisPkgName%>
786
                                                   </a>
787
                                                </SPAN>
788
                                             </td>
789
                                          <%Else%>
790
                                             <td nowrap valign="top">
791
                                                <SPAN id="IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" name="IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" style="display:block;">
792
                                                   <a href="javascript:;" class="menu_link" onClick="RequestPatches('?pkg_id=<%=thisPkgId%>&bom_id=<%=thisBomId%>&compare_bom_id=<%=thisBomId%>&current_bom_id=<%=dbPARbom_id%>', '<%=thisBomId%>_<%=thisProdId & thisIsPatch%>');">
793
                                                      <%=LIMG_EXPAND & GetProductIcon( rsTemp ) & thisPkgName%>
794
                                                   </a>
795
                                                </SPAN>
796
                                                <SPAN id="IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" name="IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" style="display:none;">
797
                                                   <a href="javascript:;" class="menu_link" onClick="ToggleDisplay( 'PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>', 'IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>', 'IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>');">
798
                                                      <%=LIMG_COLLAPSE & GetProductIcon( rsTemp ) & thisPkgName%>
799
                                                   </a>
800
                                                </SPAN>
801
                                             </td>
802
                                          <%End If%>
803
                                          <td nowrap class="body_row" valign="top"></td>
804
                                          <td class="body_rowlite"></td>
805
                                       </tr>
806
 
807
                                       <tr>
808
                                          <td nowrap valign="top" class="body_row" colspan="3">
809
                                             <DIV id="PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" name="PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" style="display:none;"><%=enumLOADING%></DIV>
810
                                          </td>
811
                                       </tr>
812
                                       <%If rowNumProd <> numOfProdRows Then%>
813
                                          <tr>
814
                                             <td colspan="4" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
815
                                          </tr>
816
                                       <%End If%>
817
 
818
                                       <%
819
                                       LastPkgId = CDbl(thisPkgId)
820
                                    End If
821
                                 ' -------- END GROUP ------------------------
822
                                 End If%>
823
 
824
                                 <%
825
                                 rsTemp.Close()
826
                                 Set rsTemp = nothing
827
                              End If
828
                           Next  'For Next Loop End
829
 
830
                        Else%>
831
 
832
                           <tr>
833
                              <td colspan="4" class="body_txtr"><b>No Changes Detected In Comparison</b></td>
834
                           </tr>
835
                        <%End If%>
836
 
837
                        <tr>
838
                           <td colspan="4" background="images/bg_table_border.gif">
839
                              <table width="100%"  border="0" cellspacing="1" cellpadding="2">
840
                                 <tr>
841
                                    <td nowrap background="images/bg_table_col.gif"><img src="images/spacer.gif" width="1" height="1"></td>
842
                                 </tr>
843
                              </table>
844
                           </td>
845
                        </tr>
846
                     </table>
847
                     <br>
848
                     <%
849
                     Response.Flush
850
                  Next
851
                  Call objFormComponent.FormEnd()
852
                  '-- FROM END ----------------------------------------------------------------------------------------------------------------
853
                  %>
854
               </td>
855
            </tr>
856
         </table>
857
      </td>
858
      <td width="1%" valign="top" background="images/bg_favourits.gif">
859
         <%If Request.Cookies( enumCOOKIE_NAME )( "user_bar" ) <> "hide" Then%>
860
 
861
         <%End If%>
862
      </td>
863
   </tr>
864
   <tr>
865
      <td background="images/bg_bage_0a.gif"><img src="images/spacer.gif" width="1" height="15"></td>
866
      <td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
867
      <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
868
      <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
869
   </tr>
870
   <tr>
871
      <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="20"></td>
872
      <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
873
      <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
874
      <td bgcolor="#FFFFFF">&nbsp;</td>
875
   </tr>
876
</table>
877
<!-- FOOTER ++++++++++++++++ -->
878
<!--#include file="_footer.asp"-->
879
<!-- +++++++++++++++++++++++ -->
880
</body>
881
</html>