%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'| |
'| BomVersionTree |
'| |
'=====================================================
%>
<%
Option explicit
Response.Expires = 0
%>
<%
'------------ ACCESS CONTROL ------------------
%>
<%
'------------ VARIABLE DEFINITION -------------
Dim rsQry
Dim parBom_id_list
Dim parBom_name_id
Dim parRoot_version
Dim currLevel
Dim lastLevel
Dim aOptionList
Dim query
Dim objPopupMenuTreeOptions
Dim objFormCollector
'------------ CONSTANTS DECLARATION -----------
Const LIMG_TREE_I_HALF = "![]()
"
Const LIMG_TREE_I_FULL = "![]()
"
Const LIMG_TREE_T = "![]()
"
'------------ VARIABLE INIT -------------------
parBom_id_list = Request("bom_id_list")
parBranch_id = Request("branch_id")
parRoot_version = Request("root_version")
parBom_name_id = Request("bom_name_id")
Set objPopupMenuTreeOptions = New PopupMenuControl
Set objFormCollector = CreateObject("Scripting.Dictionary")
objPopupMenuTreeOptions.PopupMenuStyle ReadFile( Server.MapPath("scripts/popup_menu_styles.html") ), "StyleWinXP"
'------------ CONDITIONS ----------------------
If (parBom_id_list <> "") AND (parRoot_version = "") AND (parBom_name_id = "") Then
' Get root version and bom_name_id from bom_id_list
Call GetParameters ( parBom_id_list, parRoot_version, parBom_name_id )
End If
'----------------------------------------------
%>
<%
'--------------------------------------------------------------------------------------------------------------------------
Sub GetFormDetails ( nBomNameId, ByRef outobjDetails )
Dim rsQry, query
OraDatabase.Parameters.Add "BOM_NAME_ID", nBomNameId, ORAPARM_INPUT, ORATYPE_NUMBER
query = _
" SELECT bn.BOM_NAME FROM BOM_NAMES bn WHERE bn.BOM_NAME_ID = :BOM_NAME_ID"
Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
If rsQry.RecordCount > 0 Then
outobjDetails.Item ("bom_name") = rsQry("bom_name").Value
End If
OraDatabase.Parameters.Remove "BOM_NAME_ID"
rsQry.Close
Set rsQry = Nothing
End Sub
'----------------------------------------------------------------------------------------------------------------------------------------------
Sub GetParameters ( nBomIdList, ByRef outRootVersion, ByRef outBomNameId )
Dim oBomCollector
Set oBomCollector = CreateObject("Scripting.Dictionary")
Call GetBomDetails ( nBomIdList, oBomCollector )
outRootVersion = GetRootVersion ( oBomCollector.Item("bom_version") )
outBomNameId = oBomCollector.Item("bom_name_id")
Set oBomCollector = Nothing
End Sub
'----------------------------------------------------------------------------------------------------------------------------------------------
Function GetLevel ( sBomVersion )
Dim tempArr
If InStr( sBomVersion, "." ) > 0 Then
'-- Dot separator found --
'-- Split version --
tempArr = Split( sBomVersion, "." )
GetLevel = UBound( tempArr ) + 1
Else
GetLevel = 1
End If
End Function
'----------------------------------------------------------------------------------------------------------------------------------------------
Sub RenderRowConnectors ( nLastLevel, nCurrLevel )
Dim i, LastLine
'-- Initial Draw --
If nLastLevel = 0 Then
nLastLevel = nCurrLevel
Exit Sub
End If
'-- Calculate number of half lines rendered
If nLastLevel < nCurrLevel Then
LastLine = nLastLevel
Else
LastLine = nCurrLevel
End If
'-- Render half lines
For i = 1 To LastLine
Response.write LIMG_TREE_I_HALF
Next
End Sub
'----------------------------------------------------------------------------------------------------------------------------------------------
Sub RenderIndent ( nLastLevel, nCurrLevel )
Dim i
If nCurrLevel <= 1 Then Exit Sub
'-- Render half lines
If nCurrLevel > 2 Then
For i = 1 To nCurrLevel - 2
Response.write LIMG_TREE_I_FULL
Next
End If
'-- Render branch or line
If nLastLevel < nCurrLevel Then
Response.write LIMG_TREE_T
Else
Response.write LIMG_TREE_I_FULL
End If
End Sub
'----------------------------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------
Call objPMod.PersistInQryStringWithValue ( aPersistList(enumPAR_ROOT_VERSION), parRoot_version )
Call objPMod.PersistInQryStringWithValue ( aPersistList(enumPAR_BOM_NAME_ID), parBom_name_id )
If (Request("action") <> "") Then
'-- Select Action
Call ActionRedirection ( Request("action") )
End If
Call GetFormDetails ( parBom_name_id, objFormCollector )
'----------------------------------------------
%>
| Version Tree | |
|
||||||
![]() |