Subversion Repositories DevTools

Rev

Rev 5958 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                                BomVersionTree                                 |
'|                                                   |
'=====================================================
%>
<%
Option explicit
Response.Expires = 0
%>
<!--#include file="common/globals.asp"-->
<!--#include file="common/config.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/_explorer_common.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<%
'------------ 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 = "<img src='images/spacer.gif' width='27' height='1'><img src='icons/tree_i_half.gif' align='absmiddle'>"
Const LIMG_TREE_I_FULL = "<img src='images/spacer.gif' width='27' height='1'><img src='icons/tree_i.gif' align='absmiddle'>"
Const LIMG_TREE_T = "<img src='images/spacer.gif' width='27' height='1'><img src='icons/tree_t.gif' align='absmiddle'>"
'------------ 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 )
'----------------------------------------------
%>
<html>
<head>
<title>Deployment Manager</title>
<link rel="shortcut icon" href="<%=FavIcon%>"/>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="scripts/deployment_manager.css?ver=<%=VixVerNum%>" rel="stylesheet" type="text/css">
<script language="JavaScript" src="scripts/common.js?ver=<%=VixVerNum%>"></script>
</head>

<body leftmargin="0" topmargin="0">
<!-- HEADER ++++++++++++++++ -->
<!--#include file="_header.asp"-->
<!-- +++++++++++++++++++++++ -->
<!-- MAIN MENU  +  CRUMBS ++++++++++++++++ -->
<!--#include file="_main_menu.asp"-->
<!-- +++++++++++++++++++++++++++++++++++++ -->
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="1%" background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
    <td width="100%" background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
  </tr>
  <tr>
    <td background="images/bg_bage_0.gif"><img src="images/spacer.gif" width="17" height="30"></td>
    <td background="images/bg_bage_0.gif">&nbsp;</td>
  </tr>
  <tr>
    <td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
    <td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
  </tr>
  <tr>
    <td><img src="images/spacer.gif" width="1" height="1"></td>
    <td><img src="images/spacer.gif" width="1" height="8"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td class="body_ttl1">Version Tree </td>
  </tr>
  <tr>
    <td><img src="images/spacer.gif" width="1" height="1"></td>
    <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>
  </tr>
</table>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="1%">&nbsp;</td>
    <td width="100%" rowspan="2" valign="top">
        <!-- PAGE DETAILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
        <table width="100%"  border="0" cellspacing="10" cellpadding="0">
        <%
        '-- FROM START ---------------------------------------------------------------------------------------------------------
        objFormComponent.FormName = "FormState"
        objFormComponent.Action = SCRIPT_NAME
        Call objFormComponent.FormStart()
        %> 
      <tr>
        <td class="body_ttl3">
                  <%=objFormCollector.Item("bom_name")%><br><br>
          <%
                  '/*  Option Menu  */
                        aOptionList = Array( "pmiNewBom", _
                                                                 "pmiDestroyBom", _
                                                              enumSEPARATOR_LABEL, _
                                                                 "pmiLockBom", _
                                                                 "pmiUnlockBom" )
                        
                        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>"
                        objPopupMenuTreeOptions.RenderInOrder "divTreeOption", aOptionList, objAccessControl, "pmoCreator"
                  %>      
                  
                  
                  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
            <td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
          </tr>
                  <%
                  OraDatabase.Parameters.Add "BOM_NAME_ID",             parBom_name_id,         ORAPARM_INPUT, ORATYPE_NUMBER 
                  OraDatabase.Parameters.Add "BRANCH_ID",                       parBranch_id,           ORAPARM_INPUT, ORATYPE_NUMBER 
                  OraDatabase.Parameters.Add "BOM_VERSION",             parRoot_version,                                                ORAPARM_INPUT, ORATYPE_VARCHAR2
                  OraDatabase.Parameters.Add "LIKE_BOM_VERSION",        parRoot_version &".%",                                  ORAPARM_INPUT, ORATYPE_VARCHAR2 
                  
                  
                  Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("BomVersionTree.sql") , ORADYN_DEFAULT )
                  lastLevel = 0
                  
                  While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
                        currLevel = GetLevel ( rsQry("bom_version") )
                  %>
                  <tr>
            <td class="body_txt"><%Call RenderRowConnectors( lastLevel, currLevel )%></td>
          </tr>
                  <tr>
              <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>
          </tr>
                          
                  <%
                        lastLevel = currLevel
                        rsQry.MoveNext
                  WEnd
                  
                  rsQry.Close
                  Set rsQry = Nothing
                  
                  OraDatabase.Parameters.Remove "BOM_NAME_ID"
                  OraDatabase.Parameters.Remove "LIKE_BOM_VERSION"
                  OraDatabase.Parameters.Remove "BOM_VERSION"
                  OraDatabase.Parameters.Remove "BRANCH_ID"
                  %>
                  <tr>
            <td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
          </tr>
                  </table>
                  <%=objPMod.ComposeHiddenTags()%>
          <input type="hidden" name="action" value="true">  
                  
            </td>
      </tr>
        <%
        Call objFormComponent.FormEnd()
        '-- FROM END ----------------------------------------------------------------------------------------------------------------
        %>        
    </table> 
        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
        </td>
  </tr>
  <tr>
    <td valign="bottom"><img src="images/ill_bom_version_tree.jpg" width="146" height="300"></td>
  </tr>
</table>

<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="images/spacer.gif" width="8" height="20"></td>
  </tr>
</table>
<!-- FOOTER ++++++++++++++++ -->
<!--#include file="_footer.asp"-->
<!-- +++++++++++++++++++++++ -->
</body>
</html>