Subversion Repositories DevTools

Rev

Rev 5837 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5356 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|			          BomVersionTree			 	 |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
%>
13
<!--#include file="common/globals.asp"-->
14
<!--#include file="common/config.asp"-->
15
<!--#include file="common/common_subs.asp"-->
16
<!--#include file="common/_explorer_common.asp"-->
17
<%
18
'------------ ACCESS CONTROL ------------------
19
%>
20
<!--#include file="_access_control_general.asp"-->
21
<%
22
'------------ VARIABLE DEFINITION -------------
23
Dim rsQry
24
Dim parBom_id_list
25
Dim parBom_name_id
26
Dim parRoot_version
27
Dim currLevel
28
Dim lastLevel
29
Dim aOptionList
30
Dim query
31
Dim objPopupMenuTreeOptions
32
Dim objFormCollector
33
'------------ CONSTANTS DECLARATION -----------
34
Const LIMG_TREE_I_HALF = "<img src='images/spacer.gif' width='27' height='1'><img src='icons/tree_i_half.gif' align='absmiddle'>"
35
Const LIMG_TREE_I_FULL = "<img src='images/spacer.gif' width='27' height='1'><img src='icons/tree_i.gif' align='absmiddle'>"
36
Const LIMG_TREE_T = "<img src='images/spacer.gif' width='27' height='1'><img src='icons/tree_t.gif' align='absmiddle'>"
37
'------------ VARIABLE INIT -------------------
38
parBom_id_list = Request("bom_id_list")
39
parBranch_id = Request("branch_id")
40
parRoot_version = Request("root_version")
41
parBom_name_id = Request("bom_name_id")
42
Set objPopupMenuTreeOptions = New PopupMenuControl
43
Set objFormCollector = CreateObject("Scripting.Dictionary")
44
objPopupMenuTreeOptions.PopupMenuStyle ReadFile( Server.MapPath("scripts/popup_menu_styles.html") ), "StyleWinXP"
45
'------------ CONDITIONS ----------------------
46
If (parBom_id_list <> "") AND (parRoot_version = "") AND (parBom_name_id = "") Then
47
	' Get root version and bom_name_id from bom_id_list
48
	Call GetParameters ( parBom_id_list, parRoot_version, parBom_name_id )
49
 
50
End If
51
'----------------------------------------------
52
%>
53
<%
54
'--------------------------------------------------------------------------------------------------------------------------
55
Sub GetFormDetails ( nBomNameId, ByRef outobjDetails )
56
	Dim rsQry, query
57
	OraDatabase.Parameters.Add "BOM_NAME_ID",	nBomNameId, ORAPARM_INPUT, ORATYPE_NUMBER 
58
 
59
	query = _
60
	" SELECT bn.BOM_NAME FROM BOM_NAMES bn  WHERE bn.BOM_NAME_ID = :BOM_NAME_ID"
61
 
62
	Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
63
 
64
	If rsQry.RecordCount > 0 Then
65
		outobjDetails.Item ("bom_name")  = rsQry("bom_name").Value
66
 
67
	End If
68
 
69
	OraDatabase.Parameters.Remove "BOM_NAME_ID"
70
 
71
	rsQry.Close
72
	Set rsQry = Nothing
73
End Sub
74
'----------------------------------------------------------------------------------------------------------------------------------------------
75
Sub GetParameters ( nBomIdList, ByRef outRootVersion, ByRef outBomNameId )
76
	Dim oBomCollector
77
 
78
	Set oBomCollector = CreateObject("Scripting.Dictionary")
79
 
80
	Call GetBomDetails ( nBomIdList, oBomCollector )
81
 
82
	outRootVersion = GetRootVersion ( oBomCollector.Item("bom_version") )
83
	outBomNameId = oBomCollector.Item("bom_name_id")
84
 
85
	Set oBomCollector = Nothing
86
 
87
End Sub
88
'----------------------------------------------------------------------------------------------------------------------------------------------
89
Function GetLevel ( sBomVersion )
90
	Dim tempArr
91
 
92
	If InStr( sBomVersion, "." ) > 0 Then
93
		'-- Dot separator found --
94
 
95
		'-- Split version --
96
		tempArr = Split( sBomVersion, "." )
97
 
98
		GetLevel = UBound( tempArr ) + 1
99
 
100
	Else
101
		GetLevel = 1
102
 
103
	End If
104
 
105
End Function
106
'----------------------------------------------------------------------------------------------------------------------------------------------
107
Sub RenderRowConnectors ( nLastLevel, nCurrLevel )
108
	Dim i, LastLine
109
 
110
	'-- Initial Draw --
111
	If nLastLevel = 0 Then
112
		nLastLevel = nCurrLevel
113
		Exit Sub
114
	End If
115
 
116
	'-- Calculate number of half lines rendered
117
	If nLastLevel < nCurrLevel Then
118
		LastLine = nLastLevel
119
	Else
120
		LastLine = nCurrLevel
121
	End If
122
 
123
 
124
	'-- Render half lines
125
	For i = 1 To LastLine
126
		Response.write LIMG_TREE_I_HALF
127
	Next
128
 
129
End Sub
130
'----------------------------------------------------------------------------------------------------------------------------------------------
131
Sub RenderIndent ( nLastLevel, nCurrLevel )
132
	Dim i
133
 
134
	If nCurrLevel <= 1 Then Exit Sub
135
 
136
 
137
	'-- Render half lines
138
	If nCurrLevel > 2 Then
139
		For i = 1 To nCurrLevel - 2
140
			Response.write LIMG_TREE_I_FULL
141
		Next
142
	End If
143
 
144
 
145
	'-- Render branch or line
146
	If nLastLevel < nCurrLevel Then
147
		Response.write LIMG_TREE_T
148
	Else
149
		Response.write LIMG_TREE_I_FULL
150
	End If
151
 
152
 
153
 
154
 
155
End Sub
156
'----------------------------------------------------------------------------------------------------------------------------------------------
157
%>
158
<%
159
'------------ RUN BEFORE PAGE RENDER ----------
160
Call objPMod.PersistInQryStringWithValue ( aPersistList(enumPAR_ROOT_VERSION), parRoot_version )
161
Call objPMod.PersistInQryStringWithValue ( aPersistList(enumPAR_BOM_NAME_ID), parBom_name_id )
162
 
163
If (Request("action") <> "") Then
164
	'-- Select Action
165
	Call ActionRedirection ( Request("action") )
166
 
167
End If
168
 
169
Call GetFormDetails ( parBom_name_id, objFormCollector )
170
'----------------------------------------------
171
%>
172
<html>
173
<head>
174
<title>Deployment Manager</title>
175
<link rel="shortcut icon" href="<%=FavIcon%>"/>
176
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
177
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
178
<link href="scripts/deployment_manager.css" rel="stylesheet" type="text/css">
179
<script language="JavaScript" src="scripts/common.js"></script>
180
</head>
181
 
182
<body leftmargin="0" topmargin="0">
183
<!-- HEADER ++++++++++++++++ -->
184
<!--#include file="_header.asp"-->
185
<!-- +++++++++++++++++++++++ -->
186
<!-- MAIN MENU  +  CRUMBS ++++++++++++++++ -->
187
<!--#include file="_main_menu.asp"-->
188
<!-- +++++++++++++++++++++++++++++++++++++ -->
189
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
190
  <tr>
191
    <td width="1%" background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
192
    <td width="100%" background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
193
  </tr>
194
  <tr>
195
    <td background="images/bg_bage_0.gif"><img src="images/spacer.gif" width="17" height="30"></td>
196
    <td background="images/bg_bage_0.gif">&nbsp;</td>
197
  </tr>
198
  <tr>
199
    <td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
200
    <td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
201
  </tr>
202
  <tr>
203
    <td><img src="images/spacer.gif" width="1" height="1"></td>
204
    <td><img src="images/spacer.gif" width="1" height="8"></td>
205
  </tr>
206
  <tr>
207
    <td>&nbsp;</td>
208
    <td class="body_ttl1">Version Tree </td>
209
  </tr>
210
  <tr>
211
    <td><img src="images/spacer.gif" width="1" height="1"></td>
212
    <td><img src="images/spacer.gif" width="1" height="30"><a href="BomStates.asp?BACK=OK<%=objPMod.ComposeURLWithout("state_id")%>" class="body_link"><img src="icons/i_caretone.gif" width="11" height="7" hspace="2" border="0">Release Explorer</a></td>
213
  </tr>
214
</table>
215
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
216
  <tr>
217
    <td width="1%">&nbsp;</td>
218
    <td width="100%" rowspan="2" valign="top">
219
	<!-- PAGE DETAILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
220
	<table width="100%"  border="0" cellspacing="10" cellpadding="0">
221
	<%
222
	'-- FROM START ---------------------------------------------------------------------------------------------------------
223
	objFormComponent.FormName = "FormState"
224
	objFormComponent.Action = SCRIPT_NAME
225
	Call objFormComponent.FormStart()
226
	%> 
227
      <tr>
228
        <td class="body_ttl3">
229
		  <%=objFormCollector.Item("bom_name")%><br><br>
230
          <%
231
		  '/*  Option Menu  */
232
		  	aOptionList = Array( "pmiNewBom", _
233
							   	 "pmiDestroyBom", _
234
							      enumSEPARATOR_LABEL, _
235
							   	 "pmiLockBom", _
236
							   	 "pmiUnlockBom" )
237
 
5837 dpurdie 238
			Response.write "<a href='javascript:;' onClick=""ToggleDisplay('divTreeOption');"" title='Options...' class='body_link'><img src='icons/b_options.gif' width='12' height='10' border='0' vspace='2' hspace='4' align='absmiddle'></a>"
239
			objPopupMenuTreeOptions.RenderInOrder "divTreeOption", aOptionList, objAccessControl, "pmoCreator"
5356 dpurdie 240
		  %>	  
241
 
242
 
243
		  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
244
		  <tr>
245
            <td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
246
          </tr>
247
		  <%
248
		  OraDatabase.Parameters.Add "BOM_NAME_ID", 		parBom_name_id, 	ORAPARM_INPUT, ORATYPE_NUMBER 
249
		  OraDatabase.Parameters.Add "BRANCH_ID", 			parBranch_id, 		ORAPARM_INPUT, ORATYPE_NUMBER 
250
		  OraDatabase.Parameters.Add "BOM_VERSION", 		parRoot_version, 						ORAPARM_INPUT, ORATYPE_VARCHAR2
251
		  OraDatabase.Parameters.Add "LIKE_BOM_VERSION", 	parRoot_version &".%", 					ORAPARM_INPUT, ORATYPE_VARCHAR2 
252
 
253
 
254
		  Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("BomVersionTree.sql") , ORADYN_DEFAULT )
255
		  lastLevel = 0
256
 
257
		  While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
258
		  	currLevel = GetLevel ( rsQry("bom_version") )
259
		  %>
260
		  <tr>
261
            <td class="body_txt"><%Call RenderRowConnectors( lastLevel, currLevel )%></td>
262
          </tr>
263
		  <tr>
264
              <td class="body_txt"><%Call RenderIndent( lastLevel, currLevel )%><input type="checkbox" name="bom_id_list" value="<%=rsQry("bom_id")%>"><a href="Bom_AllProducts.asp?bom_id=<%=rsQry("bom_id")%>" class="menu_link" title="Open BOM..."><%=BomIcon( rsQry("is_readonly"), rsQry("is_rejected") )%><%=rsQry("bom_version") &"."& rsQry("bom_lifecycle")%></a></td>
265
          </tr>
266
 
267
		  <%
268
		  	lastLevel = currLevel
269
		  	rsQry.MoveNext
270
	  	  WEnd
271
 
272
		  rsQry.Close
273
		  Set rsQry = Nothing
274
 
275
		  OraDatabase.Parameters.Remove "BOM_NAME_ID"
276
		  OraDatabase.Parameters.Remove "LIKE_BOM_VERSION"
277
		  OraDatabase.Parameters.Remove "BOM_VERSION"
278
		  OraDatabase.Parameters.Remove "BRANCH_ID"
279
		  %>
280
		  <tr>
281
            <td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
282
          </tr>
283
		  </table>
284
		  <%=objPMod.ComposeHiddenTags()%>
285
    	  <input type="hidden" name="action" value="true">  
286
 
287
	    </td>
288
      </tr>
289
	<%
290
	Call objFormComponent.FormEnd()
291
	'-- FROM END ----------------------------------------------------------------------------------------------------------------
292
	%>	  
293
    </table> 
294
	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
295
	</td>
296
  </tr>
297
  <tr>
298
    <td valign="bottom"><img src="images/ill_bom_version_tree.jpg" width="146" height="300"></td>
299
  </tr>
300
</table>
301
 
302
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
303
  <tr>
304
    <td><img src="images/spacer.gif" width="8" height="20"></td>
305
  </tr>
306
</table>
307
<!-- FOOTER ++++++++++++++++ -->
308
<!--#include file="_footer.asp"-->
309
<!-- +++++++++++++++++++++++ -->
310
</body>
311
</html>