Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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