| 62 |
rsolanki |
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 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
176 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
177 |
<link href="scripts/deployment_manager.css" rel="stylesheet" type="text/css">
|
|
|
178 |
<script language="JavaScript" src="scripts/common.js"></script>
|
|
|
179 |
</head>
|
|
|
180 |
|
|
|
181 |
<body leftmargin="0" topmargin="0">
|
|
|
182 |
<!-- HEADER ++++++++++++++++ -->
|
|
|
183 |
<!--#include file="_header.asp"-->
|
|
|
184 |
<!-- +++++++++++++++++++++++ -->
|
|
|
185 |
<!-- MAIN MENU + CRUMBS ++++++++++++++++ -->
|
|
|
186 |
<!--#include file="_main_menu.asp"-->
|
|
|
187 |
<!-- +++++++++++++++++++++++++++++++++++++ -->
|
|
|
188 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
189 |
<tr>
|
|
|
190 |
<td width="1%" background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
|
|
|
191 |
<td width="100%" background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
|
|
|
192 |
</tr>
|
|
|
193 |
<tr>
|
|
|
194 |
<td background="images/bg_bage_0.gif"><img src="images/spacer.gif" width="17" height="30"></td>
|
|
|
195 |
<td background="images/bg_bage_0.gif"> </td>
|
|
|
196 |
</tr>
|
|
|
197 |
<tr>
|
|
|
198 |
<td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
|
|
|
199 |
<td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
|
|
|
200 |
</tr>
|
|
|
201 |
<tr>
|
|
|
202 |
<td><img src="images/spacer.gif" width="1" height="1"></td>
|
|
|
203 |
<td><img src="images/spacer.gif" width="1" height="8"></td>
|
|
|
204 |
</tr>
|
|
|
205 |
<tr>
|
|
|
206 |
<td> </td>
|
|
|
207 |
<td class="body_ttl1">Version Tree </td>
|
|
|
208 |
</tr>
|
|
|
209 |
<tr>
|
|
|
210 |
<td><img src="images/spacer.gif" width="1" height="1"></td>
|
|
|
211 |
<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>
|
|
|
212 |
</tr>
|
|
|
213 |
</table>
|
|
|
214 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
215 |
<tr>
|
|
|
216 |
<td width="1%"> </td>
|
|
|
217 |
<td width="100%" rowspan="2" valign="top">
|
|
|
218 |
<!-- PAGE DETAILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
219 |
<table width="100%" border="0" cellspacing="10" cellpadding="0">
|
|
|
220 |
<%
|
|
|
221 |
'-- FROM START ---------------------------------------------------------------------------------------------------------
|
|
|
222 |
objFormComponent.FormName = "FormState"
|
|
|
223 |
objFormComponent.Action = SCRIPT_NAME
|
|
|
224 |
Call objFormComponent.FormStart()
|
|
|
225 |
%>
|
|
|
226 |
<tr>
|
|
|
227 |
<td class="body_ttl3">
|
|
|
228 |
<%=objFormCollector.Item("bom_name")%><br><br>
|
|
|
229 |
<%
|
|
|
230 |
'/* Option Menu */
|
|
|
231 |
aOptionList = Array( "pmiNewBom", _
|
|
|
232 |
"pmiDestroyBom", _
|
|
|
233 |
enumSEPARATOR_LABEL, _
|
|
|
234 |
"pmiLockBom", _
|
|
|
235 |
"pmiUnlockBom" )
|
|
|
236 |
|
|
|
237 |
query = GetQuery ("PopupMenuItemsList.sql")
|
|
|
238 |
query = Replace ( query, "%ITEM_LIST%", Join( aOptionList, "','") )
|
|
|
239 |
|
|
|
240 |
Set rsQry = OraDatabase.DbCreateDynaset( query , ORADYN_DEFAULT )
|
|
|
241 |
|
|
|
242 |
'--- Render Option Menus
|
|
|
243 |
If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
|
|
|
244 |
|
|
|
245 |
With objPopupMenuTreeOptions
|
|
|
246 |
.LoadRows rsQry.GetRows()
|
|
|
247 |
|
|
|
248 |
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>"
|
|
|
249 |
|
|
|
250 |
.RenderInOrder "divTreeOption", aOptionList, objAccessControl, "pmoCreator"
|
|
|
251 |
End With
|
|
|
252 |
|
|
|
253 |
End If
|
|
|
254 |
rsQry.Close
|
|
|
255 |
|
|
|
256 |
%>
|
|
|
257 |
|
|
|
258 |
|
|
|
259 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
260 |
<tr>
|
|
|
261 |
<td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
|
|
|
262 |
</tr>
|
|
|
263 |
<%
|
|
|
264 |
OraDatabase.Parameters.Add "BOM_NAME_ID", parBom_name_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
265 |
OraDatabase.Parameters.Add "BRANCH_ID", parBranch_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
266 |
OraDatabase.Parameters.Add "BOM_VERSION", parRoot_version, ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
267 |
OraDatabase.Parameters.Add "LIKE_BOM_VERSION", parRoot_version &".%", ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
268 |
|
|
|
269 |
|
|
|
270 |
Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("BomVersionTree.sql") , ORADYN_DEFAULT )
|
|
|
271 |
lastLevel = 0
|
|
|
272 |
|
|
|
273 |
While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
|
|
|
274 |
currLevel = GetLevel ( rsQry("bom_version") )
|
|
|
275 |
%>
|
|
|
276 |
<tr>
|
|
|
277 |
<td class="body_txt"><%Call RenderRowConnectors( lastLevel, currLevel )%></td>
|
|
|
278 |
</tr>
|
|
|
279 |
<tr>
|
|
|
280 |
<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>
|
|
|
281 |
</tr>
|
|
|
282 |
|
|
|
283 |
<%
|
|
|
284 |
lastLevel = currLevel
|
|
|
285 |
rsQry.MoveNext
|
|
|
286 |
WEnd
|
|
|
287 |
|
|
|
288 |
rsQry.Close
|
|
|
289 |
Set rsQry = Nothing
|
|
|
290 |
|
|
|
291 |
OraDatabase.Parameters.Remove "BOM_NAME_ID"
|
|
|
292 |
OraDatabase.Parameters.Remove "LIKE_BOM_VERSION"
|
|
|
293 |
OraDatabase.Parameters.Remove "BOM_VERSION"
|
|
|
294 |
OraDatabase.Parameters.Remove "BRANCH_ID"
|
|
|
295 |
%>
|
|
|
296 |
<tr>
|
|
|
297 |
<td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
|
|
|
298 |
</tr>
|
|
|
299 |
</table>
|
|
|
300 |
<%=objPMod.ComposeHiddenTags()%>
|
|
|
301 |
<input type="hidden" name="action" value="true">
|
|
|
302 |
|
|
|
303 |
</td>
|
|
|
304 |
</tr>
|
|
|
305 |
<%
|
|
|
306 |
Call objFormComponent.FormEnd()
|
|
|
307 |
'-- FROM END ----------------------------------------------------------------------------------------------------------------
|
|
|
308 |
%>
|
|
|
309 |
</table>
|
|
|
310 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
311 |
</td>
|
|
|
312 |
</tr>
|
|
|
313 |
<tr>
|
|
|
314 |
<td valign="bottom"><img src="images/ill_bom_version_tree.jpg" width="146" height="300"></td>
|
|
|
315 |
</tr>
|
|
|
316 |
</table>
|
|
|
317 |
|
|
|
318 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
319 |
<tr>
|
|
|
320 |
<td><img src="images/spacer.gif" width="8" height="20"></td>
|
|
|
321 |
</tr>
|
|
|
322 |
</table>
|
|
|
323 |
<!-- FOOTER ++++++++++++++++ -->
|
|
|
324 |
<!--#include file="_footer.asp"-->
|
|
|
325 |
<!-- +++++++++++++++++++++++ -->
|
|
|
326 |
</body>
|
|
|
327 |
</html>
|
|
|
328 |
<%
|
|
|
329 |
'------------ RUN AFTER PAGE RENDER -----------
|
|
|
330 |
Set objPMod = Nothing
|
|
|
331 |
Set objCrumbs = Nothing
|
|
|
332 |
'----------------------------------------------
|
|
|
333 |
%><!--#include file="common/globals_destructor.asp"-->
|