Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
62 rsolanki 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
66 ghuddy 5
'|                   Bom_Home                        |
62 rsolanki 6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
66 ghuddy 12
Response.buffer = True
62 rsolanki 13
%>
64 jtweddle 14
<%
15
'To enable the script timeout to 10 mins
16
Server.ScriptTimeout=600
17
%>
62 rsolanki 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
66 ghuddy 32
 
62 rsolanki 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
'--------------------------------------------------------------------------------------------------------------------------
66 ghuddy 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
62 rsolanki 185
Function CheckProduction (ProductionBOM, ComparisonBOM)
186
 
66 ghuddy 187
   Dim PkgIdInComparisonBOM
188
   Dim PkgVersionInComparisonBOM
62 rsolanki 189
 
66 ghuddy 190
   Dim ProdIdInProductionBOM
191
   Dim PkgVersionInProductionBOM
192
   Dim Comments
62 rsolanki 193
 
66 ghuddy 194
   CheckProduction = False 'Setting it initially to be false
62 rsolanki 195
 
66 ghuddy 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
62 rsolanki 199
 
66 ghuddy 200
   Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery ("BomCheck.sql"), ORADYN_DEFAULT )
62 rsolanki 201
 
66 ghuddy 202
   OraDatabase.Parameters.Remove "CURRENT_BOM"
62 rsolanki 203
 
66 ghuddy 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
62 rsolanki 223
End Function
224
'--------------------------------------------------------------------------------------------------------------------------
225
Function AddTrailingZeros(byval n, byval count)
66 ghuddy 226
   if len(n) >= count then
227
      AddTrailingZeros = n
228
      exit function
229
   end if
62 rsolanki 230
 
66 ghuddy 231
   dim c, s, i
232
   c = count - len(n)
62 rsolanki 233
 
66 ghuddy 234
   for i = 1 to c
235
      s = s & "0"
236
   next
237
   s = cstr(n) & s
62 rsolanki 238
 
66 ghuddy 239
   AddTrailingZeros = s
62 rsolanki 240
End function
241
'--------------------------------------------------------------------------------------------------------------
242
Sub GetProductList ( nBom_id, nComparedBomId, outProductList, Flag )
66 ghuddy 243
   Dim rsQry, showAll
62 rsolanki 244
 
66 ghuddy 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"
62 rsolanki 269
End Sub
270
'--------------------------------------------------------------------------------------------------------------------------
271
Sub GetFormDetails ( nBom_id, ByRef outobjDetails )
66 ghuddy 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
 
62 rsolanki 284
End Sub
285
'--------------------------------------------------------------------------------------------------------------
286
Function GetBomTreeList ()
66 ghuddy 287
   Dim rsQry
62 rsolanki 288
 
66 ghuddy 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
62 rsolanki 313
End Function
314
 
315
'--------------------------------------------------------------------------------------------------------------
316
Function GetCompareBomDetails ( nBomId )
66 ghuddy 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
62 rsolanki 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
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
348
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
349
<link href="scripts/deployment_manager.css" rel="stylesheet" type="text/css">
350
<script language="JavaScript" src="scripts/common.js"></script>
351
<script language="JavaScript" src="scripts/remote_scripting.js"></script>
352
<script language="JavaScript" type="text/javascript">
353
<!--
354
 
355
function RequestProductLocation( paramString, rowId ){
66 ghuddy 356
   var requestURL;
62 rsolanki 357
 
66 ghuddy 358
   // Product is changes, hence can be found in current bom
359
   requestURL = 'RequestBomDiffProductLocation.asp';
360
 
361
 
362
   // Show div
363
   ToggleDisplay( 'PRODUCT_'+ rowId, 'IMG_EXPAND_PRODUCT_' + rowId, 'IMG_COLLAPSE_PRODUCT_' + rowId );
364
 
365
   // Set ajax divname
366
   ajaxdivname = 'PRODUCT_'+ rowId;
367
 
368
   if ( MM_findObj( ajaxdivname ).innerHTML == '<%=enumLOADING%>')
369
   {
370
 
371
      //Append the name to search for to the requestURL
372
      var url = requestURL + paramString;
373
 
374
      //Create the xmlHttp object to use in the request
375
      //stateChangeHandler will fire when the state has changed, i.e. data is received back
376
      // This is non-blocking (asynchronous)
377
      xmlHttp = GetXmlHttpObject(stateChangeHandler);
378
 
379
      //Send the xmlHttp get to the specified url
380
      xmlHttp_Get(xmlHttp, url);
381
 
382
   }
383
 
384
 
62 rsolanki 385
}
386
 
64 jtweddle 387
function RequestProductNotes( paramString, rowId ){
66 ghuddy 388
   var requestURL;
64 jtweddle 389
 
66 ghuddy 390
   // Product is changes, hence can be found in current bom
391
   requestURL = 'RequestProductNotes.asp';
392
 
393
 
394
   // Show div
395
   ToggleDisplay( 'PRODNOTES_'+ rowId, 'IMG_EXPAND_PRODNOTES_' + rowId, 'IMG_COLLAPSE_PRODNOTES_' + rowId );
396
 
397
   // Set ajax divname
398
   ajaxdivname = 'PRODNOTES_'+ rowId;
399
 
400
   if ( MM_findObj( ajaxdivname ).innerHTML == '<%=enumLOADING%>')
401
   {
402
 
403
      //Append the name to search for to the requestURL
404
      var url = requestURL + paramString;
405
 
406
      //Create the xmlHttp object to use in the request
407
      //stateChangeHandler will fire when the state has changed, i.e. data is received back
408
      // This is non-blocking (asynchronous)
409
      xmlHttp = GetXmlHttpObject(stateChangeHandler);
410
 
411
      //Send the xmlHttp get to the specified url
412
      xmlHttp_Get(xmlHttp, url);
413
 
414
   }
64 jtweddle 415
}
66 ghuddy 416
 
62 rsolanki 417
function RequestPatches( paramString, rowId ){
66 ghuddy 418
   var requestURL;
62 rsolanki 419
 
66 ghuddy 420
   // Product is changes, hence can be found in current bom
421
   requestURL = 'RequestBomDiffPatches.asp';
422
 
423
 
424
   // Show div
425
   ToggleDisplay( 'PRODUCT_'+ rowId, 'IMG_EXPAND_PRODUCT_' + rowId, 'IMG_COLLAPSE_PRODUCT_' + rowId );
426
 
427
   // Set ajax divname
428
   ajaxdivname = 'PRODUCT_'+ rowId;
429
 
430
   if ( MM_findObj( ajaxdivname ).innerHTML == '<%=enumLOADING%>')
431
   {
432
 
433
      //Append the name to search for to the requestURL
434
      var url = requestURL + paramString;
435
 
436
      //Create the xmlHttp object to use in the request
437
      //stateChangeHandler will fire when the state has changed, i.e. data is received back
438
      // This is non-blocking (asynchronous)
439
      xmlHttp = GetXmlHttpObject(stateChangeHandler);
440
 
441
      //Send the xmlHttp get to the specified url
442
      xmlHttp_Get(xmlHttp, url);
443
 
444
   }
445
 
62 rsolanki 446
}
447
 
448
 
449
 
450
 
451
//-->
452
</script>
453
</head>
454
<body leftmargin="0" topmargin="0">
455
<!-- HEADER ++++++++++++++++ -->
456
<!--#include file="_header.asp"-->
457
<!-- +++++++++++++++++++++++ -->
458
<!-- MAIN MENU  +  CRUMBS ++++++++++++++++ -->
459
<!--#include file="_main_menu.asp"-->
460
<!-- +++++++++++++++++++++++++++++++++++++ -->
461
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
66 ghuddy 462
   <tr>
463
      <td width="1%" valign="top" background="images/bg_bage_0.gif">
464
         <!-- NODE BROWSER ++++++++++++++++++++++ -->
465
         <!--#include file="_bom_browser.asp"-->
466
         <!-- END OF NODE BROWSER +++++++++++++++ -->
467
      </td>
468
      <td width="1" background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="600"></td>
469
      <td width="100%" valign="top" bgcolor="#FFFFFF">
470
         <table width="100%"  border="0" cellspacing="0" cellpadding="0">
471
            <tr>
472
               <td valign="top" background="images/bg_green.gif"></td>
473
               <td align="right" valign="bottom" background="images/bg_green.gif" class="body_txtw"><%Call RenderTitleWithoutVersion( objBomCollector )%></td>
474
               <td background="images/bg_green.gif"><img src="images/spacer.gif" width="10" height="20"></td>
475
            </tr>
476
            <tr>
477
               <td width="1%" valign="top" background="images/bg_green.gif"></td>
478
               <td width="100%" valign="bottom" background="images/bg_green.gif">
479
                  <!-- TAB CONTROLS ++++++++++++++++++++++ -->
480
                  <!--#include file="_tabs_definition.asp"-->
481
                  <%
482
                  Set objTabControl = New TabControl
483
                  objTabControl.TemplateDoc = ReadFile( Server.MapPath("controls/ERGTabStyleWinXP/tab_style.html") ) ' Supply tab style definition
484
                  objTabControl.TabStyle = "StyleWinXP"
485
                  objTabControl.AddTabDefnition ( arrBomTabDef )
486
                  objTabControl.Render ()
487
                  %>
488
                  <!-- END OF TAB CONTROLS +++++++++++++++ -->
489
               </td>
490
               <td width="1%" background="images/bg_green.gif"><img src="images/spacer.gif" width="10" height="35"></td>
491
            </tr>
492
            <tr>
493
               <td background="images/bg_bage_0.gif"><img src="images/spacer.gif" width="30" height="10"></td>
494
               <td background="images/bg_bage_0.gif">
495
                  <!-- BUTTONS CONTROL +++++++++++++++++++ -->
496
                  <%
497
                  '-- Define Action buttons on this tab
498
                  aTabBtnsDef = Array("abtnAddPatches")
62 rsolanki 499
 
66 ghuddy 500
                  Call LoadTabActionButtons ( aTabBtnsDef, objBtnControl )
62 rsolanki 501
 
66 ghuddy 502
                  ' -- Tell control if buttons need to be readonly actions
503
                  objBtnControl.IsReadonlyAction = objBomCollector.Item("is_readonly")
64 jtweddle 504
 
66 ghuddy 505
                  ' -- Render Buttons
506
                  Call objBtnControl.Render  ( aTabBtnsDef )
507
                  %>
508
                  <!-- +++++++++++++++++++++++++++++++++++ -->
509
               </td>
510
               <td background="images/bg_green.gif"><img src="images/p_bar_corrner.gif" width="17" height="42"></td>
511
            </tr>
512
            <tr>
513
               <td>&nbsp;</td>
514
               <td>&nbsp;</td>
515
               <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>
516
            </tr>
517
         </table>
62 rsolanki 518
 
66 ghuddy 519
         <!-- PRODUCT REJECTED ------------------------------------------------------------------------------------------ -->
520
         <%If objBomCollector.Item ("is_rejected") = enumDB_YES Then%>
521
            <table width="100%"  border="0" cellspacing="10" cellpadding="0">
522
               <tr>
523
                  <td>
524
                     <%
525
                     OraDatabase.Parameters.Add "ENTITY_ID",        dbPARbom_id,           ORAPARM_INPUT, ORATYPE_NUMBER
526
                     OraDatabase.Parameters.Add "ENUM_ENTITY_TYPE", "enumENTITY_TYPE_BOM", ORAPARM_INPUT, ORATYPE_VARCHAR2
62 rsolanki 527
 
66 ghuddy 528
                     Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("RejectionTrail.sql"), ORADYN_DEFAULT )
62 rsolanki 529
 
66 ghuddy 530
                     Dim sMessage
531
                     sMessage = "<table width='100%'  border='0' cellspacing='3' cellpadding='0'>"
532
                     sMessage = sMessage &"<tr>"
533
                     sMessage = sMessage &"<td width='100%' class='body_txt'><b>BOM is REJECTED!</b><br><br><br></td>"
534
                     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>"
535
                     sMessage = sMessage &"</tr>"
62 rsolanki 536
 
66 ghuddy 537
                     While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
538
                        sMessage = sMessage & "<tr><td colspan='2' background='images/bg_table_border.gif'><img src='images/spacer.gif' width='1' height='1'></td></tr>"
539
                        sMessage = sMessage &"<tr>"
540
                        sMessage = sMessage &"<td class='body_txt'>"
541
                        If rsQry("is_rejected") = enumDB_YES Then
542
                           sMessage = sMessage &"BOM is REJECTED!<br>"
543
                        Else
544
                           sMessage = sMessage &"BOM is Accepted!<br>"
545
                        End If
546
                        sMessage = sMessage & objFormater.TextToHTML( rsQry("comments") ) &"<br><SPAN class='body_smltxtg'>"& rsQry("creator") &"</SPAN></td>"
547
                        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>"
548
                        sMessage = sMessage &"</tr>"
549
 
550
                        rsQry.MoveNext
551
                     WEnd
552
                     rsQry.Close
553
 
554
                     sMessage = sMessage &"</table>"
555
 
556
                     Call Messenger ( sMessage, "bi_rejected.gif", "100%" )
557
 
558
                     Response.write "<br>"
559
 
560
 
561
                     OraDatabase.Parameters.Remove "ENTITY_ID"
562
                     OraDatabase.Parameters.Remove "ENUM_ENTITY_TYPE"
563
                     %>
564
                  </td>
565
               </tr>
566
            </table>
567
         <%End If%>
568
         <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
569
 
570
         <table width="100%"  border="0" cellspacing="10" cellpadding="0">
571
 
572
            <tr>
573
               <td width="1"><img src="images/spacer.gif" width="1" height="1"></td>
574
               <td width="100%"><img src="images/spacer.gif" width="1" height="1"></td>
575
            </tr>
576
 
577
            <!-- BOM Comments +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
578
            <%If (objBomCollector.Item("bom_comments") <> "") Then%>
579
               <tr>
580
                  <td align="right" valign="top"><img src="icons/i_bom_properties.gif" width="30" height="30" hspace="3"></td>
581
                  <td valign="top" class="body_txt">
582
                     <SPAN class="body_colb">BOM Comments</SPAN>
583
                     <hr width="100%" size="1px" noshade color="#808080">
584
                     <SPAN class="body_txt"><%= objFormater.TextToHTML( objBomCollector.Item("bom_comments") )%></SPAN><br><br><br><br>
585
                  </td>
586
               </tr>
587
            <%End If%>
588
 
589
            <!-- COMPARE BOM +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
590
            <tr>
591
               <td align="right" valign="top"><img src="icons/i_bom_diff.gif" width="37" height="33" hspace="3"></td>
592
               <td valign="top" class="body_txt">
593
                  <%
594
                  '-- FROM START --------------------------------------------------------------------------------------------------------------
595
                  objFormComponent.FormName = "OldVersion"
596
                  objFormComponent.Action = SCRIPT_NAME
597
                  objFormComponent.Method = "get"
598
                  Call objFormComponent.FormStart()
599
 
600
                  Dim numOfBomRows
601
                  Dim rowNumBom
602
 
603
                  If (NOT IsNull(GetBomTreeList())) Then
604
                     numOfBomRows = UBound( GetBomTreeList(), 2 )
605
                  Else
606
                     numOfBomRows = -1
607
                  End If
608
 
609
                  For rowNumBom = 0 To numOfBomRows
610
                     Dim thisBomId
611
                     Dim nextBomId
612
                     thisBomId = GetBomTreeList()( 0, rowNumBom )
613
                     If rowNumBom = numOfBomRows Then
614
                        nextBomId = 0
615
                     Else
616
                        nextBomId = GetBomTreeList()( 0, rowNumBom + 1 )
617
                     End If
618
 
619
                     Call GetFormDetails ( thisBomId, objBomCollector )
620
                     %>
621
                     <SPAN class="body_colb"><br><%= objFormater.TextToHTML( objBomCollector.Item("bom_comments") )%><br><br></SPAN>
622
                     <SPAN class="body_colb">Products/Patches Introduced in <%Call RenderTitle( objBomCollector )%> but not yet deployed in Production BOM<br></SPAN>
68 ghuddy 623
                     <%If InStr(APP_ROOT, "DEPLOYMAN_WWW") > 0 Then%>
624
                        <a href="downloads\<%Call RenderTitleWithoutBold( objBomCollector )%>.pdf" class="body_link" target="_blank"><b>Click here to Download PDF</b></a>
625
                     <%Else%>
626
                        <a href="../deployment_manager/pdf\<%Call RenderTitleWithoutBold( objBomCollector )%>.pdf" class="body_link" target="_blank"><b>Click here to Download PDF</b></a>
627
                     <%End If%>
66 ghuddy 628
                     <hr width="100%" size="1px" noshade color="#808080">
629
                     <table width="100%"  border="0" cellspacing="2" cellpadding="0">
630
                        <tr>
631
                           <td width="20%" background="images/bg_table_border.gif">
632
                              <table width="100%"  border="0" cellspacing="1" cellpadding="2">
633
                                 <tr>
634
                                    <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Product</td>
635
                                 </tr>
636
                              </table>
637
                           </td>
638
                           <td width="20%" nowrap align="left" background="images/bg_table_col.gif" class="body_col">Version</td>
639
                           <td width="60%" nowrap align="left" background="images/bg_table_col.gif" class="body_col">Reason For This Version</td>
640
                           <td width="60%" nowrap align="left" background="images/bg_table_col.gif" class="body_col">Approval</td>
641
                        </tr>
642
                        <%
643
                        If NOT CheckProduction( Request("bom_id"), thisBomId) Then
644
                           %>
645
                           <tr>
646
                              <td colspan="4" class="body_txtr"><b>Found Matching BOM or Older Versions...Exiting Comparison</b></td>
647
                           </tr>
648
                           <%
649
                           Exit For
650
                        End If
651
 
652
                        Dim aProductList
653
 
654
                        Call GetProductList ( thisBomId, nextBomId, aProductList, TRUE )
655
 
656
                        If NOT IsNull( aProductList ) Then
657
 
658
                           ' Variable used to prevent multiple entries being rendered for the same package
659
                           Dim LastPkgId
660
                           LastPkgId = -1
661
 
662
                           Dim numOfProdRows
663
                           Dim rowNumProd
664
 
665
                           numOfProdRows = UBound( aProductList, 2 )
666
 
667
                           ' Iterate through the list of products
668
                           For rowNumProd = 0 To numOfProdRows
669
 
670
                              Response.Flush
671
 
672
                              Dim thisProdId
673
                              Dim thisPkgName
674
                              Dim thisPkgVersion
675
                              Dim thisIsPatch
676
                              Dim thisIsRejected
677
                              Dim thisPkgId
678
 
679
                              'Extract values into named variables to make code more readable where the values are used later on
680
                              thisProdId      = aProductList( 0, rowNumProd )
681
                              thisPkgName     = aProductList( 1, rowNumProd )
682
                              thisPkgVersion  = aProductList( 2, rowNumProd )
683
                              thisIsPatch     = aProductList( 3, rowNumProd )
684
                              thisIsRejected  = aProductList( 4, rowNumProd )
685
                              thisPkgId       = aProductList( 5, rowNumProd )
686
 
687
                              ' Get the version of this product that is currently in the production BOM
688
                              Dim ProdIdInProductionBOM
689
                              Dim PkgVersionInProductionBOM
690
                              Dim Comments
691
                              Call GetProductIDandVersionInBOM( dbPARbom_id, thisPkgId, ProdIdInProductionBOM, PkgVersionInProductionBOM, Comments )
692
 
693
                              ' 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
694
                              ' same or newer than that currently in the production BOM
695
                              Dim IsDisplay
696
                              IsDisplay = True
697
 
698
                              If IsNull(thisIsPatch) Then
699
                                 IsDisplay = Is_VerA_SameOrNewerThan_VerB( thisPkgVersion, PkgVersionInProductionBOM, IsDisplay )
700
                              End If
701
 
702
                              If IsDisplay Then
703
                                 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 )
704
                                 %>
705
                                 <%If IsNull(thisIsPatch) Then
706
                                    If CDbl(LastPkgId) <> CDbl(thisPkgId) Then%>
707
                                       <tr>
708
                                          <td nowrap valign="top">
709
                                             <SPAN id="IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId%>" name="IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId%>" style="display:block;">
710
                                                <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%>');">
711
                                                   <%=LIMG_EXPAND & GetProductIcon( rsTemp ) & thisPkgName%>
712
                                                </a>
713
                                             </SPAN>
714
                                             <SPAN id="IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId%>" name="IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId%>" style="display:none;">
715
                                                <a href="javascript:;" class="menu_link" onClick="ToggleDisplay( 'PRODUCT_<%=thisBomId%>_<%=thisProdId%>', 'IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId%>', 'IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId%>');">
716
                                                   <%=LIMG_COLLAPSE & GetProductIcon( thisIsRejected ) &  thisPkgName%>
717
                                                </a>
718
                                             </SPAN>
719
                                          </td>
720
                                          <td nowrap class="body_row" valign="top"><%=thisPkgVersion%>         </td>
721
                                          <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>
722
                                          <%
723
                                          Dim rsForm, Tester, Manager
724
                                          Tester = False
725
                                          Manager = False
726
                                          If objAccessControl.IsActive("ApprovedByManager") Then
727
                                             Manager = True
728
                                          ElseIf objAccessControl.IsActive("ApprovedByTester") Then
729
                                             Tester = True
730
                                          End If
731
 
732
                                          Set rsForm = OraDatabase.DbCreateDynaset("SELECT * FROM RELEASE_AUTHORISATION WHERE PV_ID="&thisProdId&" AND BOM_ID="&Request("bom_id"), ORADYN_DEFAULT)
733
 
734
                                          %>
735
                                          <%If rsForm.RecordCount = 0 Then%>
736
                                             <%If Tester Then%>
737
                                                <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>
738
                                             <%ElseIf Manager Then%>
739
                                                <td class="body_txto">Awaiting Tester</td>
740
                                             <%Else%>
741
                                                <td class="body_txto"></td>
742
                                             <%End If%>
743
                                          <%ElseIf IsNull(rsForm("is_official")) Then%>
744
                                             <%If NOT IsNull(rsForm("tester_id")) And Tester   Then %>
745
                                                <td class="body_txto">Awaiting Manager</td>
746
                                             <%ElseIf NOT IsNull(rsForm("tester_id")) And Manager Then%>
747
                                                <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>
748
                                             <%Else%>
749
                                                <td class="body_rowlite"></td>
750
                                             <%End If%>
751
                                          <%Else%>
752
                                             <td class="body_txtg">Accepted</td>
753
                                          <%End If
754
 
755
                                          rsForm.Close()
756
                                          Set rsForm = nothing
757
                                          %>
758
                                       </tr>
759
                                       <tr>
760
                                          <td nowrap valign="top" class="body_row" colspan="3">
761
                                             <DIV id="PRODUCT_<%=thisBomId%>_<%=thisProdId%>" name="PRODUCT_<%=thisBomId%>_<%=thisProdId%>" style="display:none;"><%=enumLOADING%></DIV>
762
                                          </td>
763
                                       </tr>
764
 
765
                                       <%If rowNumProd <> numOfProdRows Then%>
766
                                          <tr>
767
                                             <td colspan="4" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
768
                                          </tr>
769
                                       <%End If%>
770
                                    <%End If%>
771
                                 <%Else
772
                                    If CDbl(LastPkgId) <> CDbl(thisPkgId) Then
773
                                       %>
774
                                       <tr>
775
                                          <%If rowNumBom <> numOfBomRows Then%>
776
                                             <td nowrap valign="top">
777
                                                <SPAN id="IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" name="IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" style="display:block;">
778
                                                   <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%>');">
779
                                                      <%=LIMG_EXPAND & GetProductIcon( rsTemp ) & thisPkgName%>
780
                                                   </a>
781
                                                </SPAN>
782
                                                <SPAN id="IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" name="IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" style="display:none;">
783
                                                   <a href="javascript:;" class="menu_link" onClick="ToggleDisplay( 'PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>', 'IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>', 'IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>');">
784
                                                      <%=LIMG_COLLAPSE & GetProductIcon( rsTemp ) & thisPkgName%>
785
                                                   </a>
786
                                                </SPAN>
787
                                             </td>
788
                                          <%Else%>
789
                                             <td nowrap valign="top">
790
                                                <SPAN id="IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" name="IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" style="display:block;">
791
                                                   <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%>');">
792
                                                      <%=LIMG_EXPAND & GetProductIcon( rsTemp ) & thisPkgName%>
793
                                                   </a>
794
                                                </SPAN>
795
                                                <SPAN id="IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" name="IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" style="display:none;">
796
                                                   <a href="javascript:;" class="menu_link" onClick="ToggleDisplay( 'PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>', 'IMG_EXPAND_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>', 'IMG_COLLAPSE_PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>');">
797
                                                      <%=LIMG_COLLAPSE & GetProductIcon( rsTemp ) & thisPkgName%>
798
                                                   </a>
799
                                                </SPAN>
800
                                             </td>
801
                                          <%End If%>
802
                                          <td nowrap class="body_row" valign="top"></td>
803
                                          <td class="body_rowlite"></td>
804
                                       </tr>
805
 
806
                                       <tr>
807
                                          <td nowrap valign="top" class="body_row" colspan="3">
808
                                             <DIV id="PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" name="PRODUCT_<%=thisBomId%>_<%=thisProdId & thisIsPatch%>" style="display:none;"><%=enumLOADING%></DIV>
809
                                          </td>
810
                                       </tr>
811
                                       <%If rowNumProd <> numOfProdRows Then%>
812
                                          <tr>
813
                                             <td colspan="4" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
814
                                          </tr>
815
                                       <%End If%>
816
 
817
                                       <%
818
                                       LastPkgId = CDbl(thisPkgId)
819
                                    End If
820
                                 ' -------- END GROUP ------------------------
821
                                 End If%>
822
 
823
                                 <%
824
                                 rsTemp.Close()
825
                                 Set rsTemp = nothing
826
                              End If
827
                           Next  'For Next Loop End
828
 
829
                        Else%>
830
 
831
                           <tr>
832
                              <td colspan="4" class="body_txtr"><b>No Changes Detected In Comparison</b></td>
833
                           </tr>
834
                        <%End If%>
835
 
836
                        <tr>
837
                           <td colspan="4" background="images/bg_table_border.gif">
838
                              <table width="100%"  border="0" cellspacing="1" cellpadding="2">
839
                                 <tr>
840
                                    <td nowrap background="images/bg_table_col.gif"><img src="images/spacer.gif" width="1" height="1"></td>
841
                                 </tr>
842
                              </table>
843
                           </td>
844
                        </tr>
845
                     </table>
846
                     <br>
847
                     <%
848
                     Response.Flush
849
                  Next
850
                  Call objFormComponent.FormEnd()
851
                  '-- FROM END ----------------------------------------------------------------------------------------------------------------
852
                  %>
853
               </td>
854
            </tr>
855
         </table>
856
      </td>
857
      <td width="1%" valign="top" background="images/bg_favourits.gif">
858
         <%If Request.Cookies( enumCOOKIE_NAME )( "user_bar" ) <> "hide" Then%>
859
 
860
         <%End If%>
861
      </td>
862
   </tr>
863
   <tr>
864
      <td background="images/bg_bage_0a.gif"><img src="images/spacer.gif" width="1" height="15"></td>
865
      <td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
866
      <td bgcolor="#FFFFFF"><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
   </tr>
869
   <tr>
870
      <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="20"></td>
871
      <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
872
      <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
873
      <td bgcolor="#FFFFFF">&nbsp;</td>
874
   </tr>
62 rsolanki 875
</table>
876
<!-- FOOTER ++++++++++++++++ -->
877
<!--#include file="_footer.asp"-->
878
<!-- +++++++++++++++++++++++ -->
879
</body>
880
</html>
881
<%
882
'------------ RUN AFTER PAGE RENDER -----------
883
Set objPMod = Nothing
884
Set objCrumbs = Nothing
885
Set objTabControl = Nothing
886
'----------------------------------------------
66 ghuddy 887
%><!--#include file="common/globals_destructor.asp"-->