Subversion Repositories DevTools

Rev

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

<%@LANGUAGE="VBSCRIPT"%>
<%
Option explicit
Response.Expires = 0   ' always load the page, dont store
%>
<%
'=====================================================
'               Package Information
'=====================================================
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/common_dbedit.asp"-->
<!--#include file="common/_popup_window_common.asp"-->
<%
' Set rfile parameter. This is a return page after Login
Call objPMod.StoreParameter ( "rfile", "fixed_issues.asp" )
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<!--#include file="_access_control_project.asp"-->
<%
'------------ Variable Definition -------------
Dim parPv_id
Dim query
Dim rsQry, rsTemp
Dim checked
Dim FRdeployableYES, FRdeployableNO
Dim objFormCollector
Dim pageIsEditable, criticalSectionIsEditable
Dim disableCriticalSectionEdit
Dim Query_String
Dim parVCSTag
Dim parBSName
Dim submit_action_url
Dim on_submit_validation
Dim sDefaultLabel, sLabel, sLabelReadOnly
Dim isWIP
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
Set objFormCollector = CreateObject("Scripting.Dictionary")
parPv_id = QStrPar("pv_id")
parVCSTag = QStrPar("vcs_tag")
parBSName = QStrPar("bs_name")
'----------------------------------------------
%>
<%
Sub MessageBox_BM_Exclusivity()
%><script language="Javascript">
alert("You cannot select Generic with other BUILD MACHINE options!")
history.reload()

</script>
<%
End Sub

Sub MessageBox_RequiredFieldsEmpty()
%><script language="Javascript">
alert("One or more required fields are still empty!\nFill in and submit, or cancel.")
history.reload()

</script>
<%
End Sub

Sub MessageBox_Need_A_BuildStandard()
%><script language="Javascript">
alert("This is an auto-build package version, and so a build standard/environment is required!\nFill in and re-submit, or cancel.")
history.reload()

</script>
<%
End Sub


'----------------------------------------------------------------------------------------------------------------------
' Function to get the build standard name (eg. JATS) from a build standard ID
Function bs_name_from_bs_id( nBs_Id )
   Dim rsTemp, Query_String

   bs_name_from_bs_id = "NONE"

   If NOT IsNull(nBs_Id) Then
      Query_String = " SELECT * FROM build_standards WHERE bs_id = "& nBs_Id
      Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
      If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
         bs_name_from_bs_id = rsTemp("bs_name")
      End If
   End If
End Function
'----------------------------------------------------------------------------------------------------------------------
' Function to get the build standard ID from a build standard name (eg. JATS)
Function bs_id_from_bs_name( nBs_Name )
   Dim rsTemp, Query_String

   bs_id_from_bs_name = 0

   Query_String = " SELECT * FROM build_standards WHERE bs_name = '"& nBs_Name &"'"
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
      bs_id_from_bs_name = rsTemp("bs_id")
   End If
End Function
'----------------------------------------------------------------------------------------------------------------------
' Function to get the Version Control System type ID for ClearCase, based on the assumption that the TAG used for
' ClearCase is 'CC'
'Function get_clearcase_vcs_type_id()
'   Dim rsTemp, Query_String
'
'   Query_String = _
'   " SELECT * FROM VCS_TYPE WHERE tag = 'CC'"
'
'   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
'   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
'      get_clearcase_vcs_type_id = rsTemp("vcs_type_id")
'   Else
'      Call RaiseMsg(enum_MSG_ERROR, "Database is missing a VCS setting for Name: ClearCase, Tag: CC")
'   End If
'   rsTemp.Close
'   Set rsTemp = nothing
'End Function

'----------------------------------------------------------------------------------------------------------------------
' Function to get the Version Control System type ID for Subversion, based on the assumption that the TAG used for
' Subversion is 'SVN'
Function get_subversion_vcs_type_id()
   Dim rsTemp, Query_String

   Query_String = _
   " SELECT * FROM VCS_TYPE WHERE tag = 'SVN'"

   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
      get_subversion_vcs_type_id = rsTemp("vcs_type_id")
   Else
      Call RaiseMsg(enum_MSG_ERROR, "Database is missing a VCS setting for Name: Subversion, Tag: SVN")
   End If
   rsTemp.Close
   Set rsTemp = nothing
End Function

'----------------------------------------------------------------------------------------------------------------------
' Function to get the Version Control System type ID for Uncontrolled, based on the assumption that the TAG used for
' ClearCase is 'UC'
Function get_uncontrolled_vcs_type_id()
   Dim rsTemp, Query_String

   Query_String = _
   " SELECT * FROM VCS_TYPE WHERE tag = 'UC'"

   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
      get_uncontrolled_vcs_type_id = rsTemp("vcs_type_id")
   Else
      Call RaiseMsg(enum_MSG_ERROR, "Database is missing a VCS setting for Name: Uncontrolled, Tag: UC")
   End If
   rsTemp.Close
   Set rsTemp = nothing
End Function
'----------------------------------------------------------------------------------------------------------------------
Sub Get_Form_Details( nPv_id, ByRef objDetails )
   Dim rsTemp, Query_String

'   Dim CC_vcs_type_id
   Dim SVN_vcs_type_id
   Dim UC_vcs_type_id

   ' Get VCS type IDs to use when evaluating legacy rows created before the introduction of the VCS tables and logic.
   ' These get uses in the query (see below) in the CASE statement.
'   CC_vcs_type_id = get_clearcase_vcs_type_id()
   SVN_vcs_type_id = get_subversion_vcs_type_id
   UC_vcs_type_id = get_uncontrolled_vcs_type_id()

   Query_String = _
   " SELECT pkg.pkg_name, pv.pkg_version, pv.pkg_label, pv.src_path, pv.pv_description,"&_
   "        pv.pv_overview, pv.v_ext, is_deployable, is_build_env_required, pv.build_type,"&_
   "        pv.bs_id, pv.dlocked,"&_
   "        (CASE WHEN pkg_label = 'N/A' AND pv.vcs_type_id IS NULL THEN "& UC_vcs_type_id &_
   "              WHEN pv.vcs_type_id IS NULL THEN " & SVN_vcs_type_id &_
   "              ELSE pv.vcs_type_id END) AS vcs_type_id "&_
   "   FROM package_versions pv, packages pkg"&_
   "  WHERE pv.pkg_id = pkg.pkg_id"&_
   "    AND pv_id = "& nPv_id


   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
      objDetails.Item("pkg_name")              = rsTemp("pkg_name")
      objDetails.Item("pkg_version")           = rsTemp("pkg_version")
      objDetails.Item("pkg_label")             = rsTemp("pkg_label")
      objDetails.Item("src_path")              = rsTemp("src_path")
      objDetails.Item("pv_description")        = rsTemp("pv_description")
      objDetails.Item("pv_overview")           = rsTemp("pv_overview")
      objDetails.Item("v_ext")                 = rsTemp("v_ext")
      objDetails.Item("is_deployable")         = rsTemp("is_deployable")
      objDetails.Item("is_build_env_required") = rsTemp("is_build_env_required")
      objDetails.Item("build_type")            = rsTemp("build_type")
      objDetails.Item("bs_id")                 = rsTemp("bs_id")
      objDetails.Item("dlocked")               = rsTemp("dlocked")
      objDetails.Item("vcs_type_id")           = rsTemp("vcs_type_id")

      rsTemp.Close

      ' This code allows the form to be altered by the user from the original build std configuration to a new
      ' one without having to update the database - we only want to do that when the user hits the
      ' submit button. The relevant fields in the objDetails are obtained in different ways accordingly.
      If IsNull(parBSName) OR parBSName = "" Then
         objDetails.Item("bs_name") = bs_name_from_bs_id( objDetails.Item("bs_id") )
      Else
         objDetails.Item("bs_id") = bs_id_from_bs_name( parBSName )
         objDetails.Item("bs_name") = parBSName
      End If

      ' Re-evaluate the is_build_env_required flag setting based on the possibly updated bs_name
      If UCase(objDetails.Item("bs_name")) = "NONE" Then
         objDetails.Item("is_build_env_required") = "N"
      Else
         objDetails.Item("is_build_env_required") = "Y"
      End If

      ' This code allows the form to be altered by the user from the original VCS configuration to a new
      ' one without having to update the database - we only want to do that when the user hits the
      ' submit button. The relevant fields in the objDetails are obtained in different ways accordingly.
      If IsNull(parVCSTag) OR parVCSTag = "" Then
         call vcs_info_from_vcs_type_id( objDetails.Item("vcs_type_id"), objDetails )
      Else
         call vcs_info_from_vcs_tag( parVCSTag, objDetails )
      End If

   End If

   rsTemp.Close
   Set rsTemp = Nothing
End Sub
'----------------------------------------------------------------------------------------------------------------------
' Updates the database, specifically the is_build_env_required flag setting in the package_versions table
' The update is only performed if it is needed, ie. if the value is already correct, no update is needed.
Sub UpdateIsBuildEnvRequired( nPv_id, nBs_name )
   Dim rsTemp, Query_String

   Query_String = _
   " SELECT bs_id, is_build_env_required"&_
   " FROM package_versions"&_
   " WHERE pv_id = "& nPv_id

   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))

   If (UCase(nBs_name) = "NONE") AND (IsNull(rsTemp("is_build_env_required")) OR (rsTemp("is_build_env_required") <> "N")) Then
      rsTemp.Edit
      rsTemp.Fields("bs_id").Value = rsTemp("bs_id")
      rsTemp.Fields("is_build_env_required").Value = "N"
      rsTemp.Update
   ElseIf (UCase(nBs_name) <> "NONE") AND (IsNull(rsTemp("is_build_env_required")) OR (rsTemp("is_build_env_required") <> "Y")) Then
      rsTemp.Edit
      rsTemp.Fields("bs_id").Value = rsTemp("bs_id")
      rsTemp.Fields("is_build_env_required").Value = "Y"
      rsTemp.Update
   End If

   rsTemp.Close
   Set rsTemp = nothing
End Sub
'----------------------------------------------------------------------------------------------------------------------
' Deletes the rows belonging to the current PV_ID, from the package_build_info table.
' This is normally done in preparation for updating the package_build_info table based on the latest
' (and possibly updated) build standard for the current PV_ID.
Sub DeletePackageBuildInfo( nPv_id )

   On Error Resume Next
   objEH.TryORA ( OraSession )

   OraDatabase.ExecuteSQL _
   "DELETE  FROM PACKAGE_BUILD_INFO WHERE PV_ID ="& nPv_id

   objEH.CatchORA ( OraSession )

End Sub
'----------------------------------------------------------------------------------------------------------------------
' Updates the vcs_type_id column for the current PV_ID, in the package_versions table.
' The update is only performed if it is necessary, ie. the user has changed the setting via the form, or the existing
' value is not yet assigned.
Sub UpdateVCS ( nPv_id, nVcs_type_id, nVcs_name, nVcs_tag )
   Dim rsTemp, Query_String
   Dim new_bs_id

   Query_String = _
   " SELECT vcs_type_id"&_
   " FROM package_versions"&_
   " WHERE pv_id = "& nPv_id

   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))

   ' compare new bs_id to existing bs_id to see if a change has been requested
   If nVcs_type_id <> rsTemp("vcs_type_id") OR IsNull(rsTemp("vcs_type_id")) Then

      'update fields
      rsTemp.Edit
      rsTemp.Fields("vcs_type_id").Value = nVcs_type_id
      rsTemp.Update

      Call Log_Action ( nPv_id, "vcs_type_id_update", "VCS Type ID Update: " & nVcs_name )
   End If

   rsTemp.Close
   Set rsTemp = nothing
End Sub
'----------------------------------------------------------------------------------------------------------------------
' Updates the bs_id column value for the current PV_ID in the package_versions table.
' The update is only performed if it is necessary, ie. the user has changed the setting via the form, or the existing
' value is not yet assigned.
Sub UpdateBuildStandard ( nPv_id, nBs_name )
   Dim rsTemp, Query_String
   Dim new_bs_id

   ' get the new bs_id from the bs_name parameter
   new_bs_id = bs_id_from_bs_name(nBs_name)

   Query_String = _
   " SELECT bs_id, is_build_env_required"&_
   " FROM package_versions"&_
   " WHERE pv_id = "& nPv_id

   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))

   ' compare new bs_id to existing bs_id to see if a change has been requested
   If new_bs_id <> rsTemp("bs_id") OR IsNull(rsTemp("bs_id")) Then

      'update fields
      rsTemp.Edit
      rsTemp.Fields("bs_id").Value = new_bs_id

      If UCase(nBs_name) = "NONE" Then
         rsTemp.Fields("is_build_env_required").Value = "N"
      Else
         rsTemp.Fields("is_build_env_required").Value = "Y"
      End If
      rsTemp.Update

      ' Clear out the build info table of entries for this PV_ID.
      Call DeletePackageBuildInfo(nPv_id)

      Call Log_Action ( nPv_id, "build_standard_update", "Build Standard Update: " & nBs_name )
   End If

   rsTemp.Close
   Set rsTemp = nothing
End Sub
'----------------------------------------------------------------------------------------------------------------------
' Updates the package_build_info table for the current PV_ID, based on the latest build_standard settings made
' by the user on the form
Sub UpdatePackageBuildInfo( NNpv_id )
   '--- Set Build Types ---
   Dim aBuildEnvList
   Dim OraParameter
   Dim nBuildMachine

   ' Before doing inserts for this PV_ID into the package_build_info table, we need to delete any existing
   ' rows for this PV_ID. This may have already been done if the user has changed the build standard, but
   ' there is no guarantee at this point that they have done that during this forms display.
   Call DeletePackageBuildInfo( NNpv_id )

   OraDatabase.Parameters.Add "PV_ID",  NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "BM_ID",  0,       ORAPARM_INPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "BSA_ID", 0,       ORAPARM_INPUT, ORATYPE_NUMBER

   Set OraParameter = OraDatabase.Parameters

   aBuildEnvList = Split( Replace( Request("be_id_list"), " ", "" ) , ",")

   On Error Resume Next
   objEH.TryORA ( OraSession )

   For Each nBuildMachine In aBuildEnvList

      OraParameter("BM_ID").Value = nBuildMachine
      OraParameter("BSA_ID").Value = Request("build_type_comb_"& nBuildMachine)

      If Err.Number = 0 Then
         OraDatabase.ExecuteSQL("begin INSERT INTO PACKAGE_BUILD_INFO ( PV_ID, BM_ID, BSA_ID ) "&_
                                " VALUES( :PV_ID, :BM_ID, :BSA_ID ); end;")
      End If
   Next

   objEH.CatchORA ( OraSession )

   OraDatabase.Parameters.Remove "PV_ID"
   OraDatabase.Parameters.Remove "BM_ID"
   OraDatabase.Parameters.Remove "BSA_ID"
End Sub
'----------------------------------------------------------------------------------------------------------------------
' This is the overall database update function called when the user hits the submit button on the form.
' It does some minor updates itself, but most of the work is done in subroutines.
' No attempt is made to keep the entire set of updates atomic. There really is no need to do that.
Sub Update_Pkg_Info ( NNpv_id, NNdeployable, SSLabel, SSPath, SSdesc, SSoverview )
   Dim rsTemp, Query_String

   On Error Resume Next

   Query_String = _
   " SELECT pkg_label, src_path, pv_description, pv_overview, is_deployable "&_
   " FROM package_versions"&_
   " WHERE pv_id = "& NNpv_id

   If SSdesc = "" Then SSdesc = NULL
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))

   rsTemp.Edit

   ' Only update build critical sections (label, source path) if allowed
   If criticalSectionIsEditable Then
      rsTemp.Fields("pkg_label").Value = SSLabel
      rsTemp.Fields("src_path").Value = SSPath
   End If

   ' Update non-build critical sections
   rsTemp.Fields("pv_description").Value = SSdesc
   rsTemp.Fields("pv_overview").Value = SSoverview

   If NNdeployable = "1" Then
      rsTemp.Fields("is_deployable").Value = "Y"
   Else
      rsTemp.Fields("is_deployable").Value = NULL
   End If

   rsTemp.Update

   rsTemp.Close
   Set rsTemp = nothing

   ' Only update build critical sections if allowed
   If criticalSectionIsEditable Then

      ' Update the VCS if necessary for this PV_ID
      Call UpdateVCS( NNpv_id, objFormCollector.Item("vcs_type_id"), objFormCollector.Item("vcs_name"), objFormCollector.Item("vcs_tag") )

      ' Update the build standard if necessary for this PV_ID
      Call UpdateBuildStandard( NNpv_id, objFormCollector.Item("bs_name") )

      ' Update the 'is build_env_required' flag for this PV_ID
      Call UpdateIsBuildEnvRequired( NNpv_id, objFormCollector.Item("bs_name") )

      ' Update the package_build_info table for this PV_ID
      Call UpdatePackageBuildInfo( NNpv_id )
   End If
End Sub
'----------------------------------------------------------------------------------------------------------------------
Function ShowHideBuildType( sBuildEnvChecked )

   ShowHideBuildType = "style='display:none;'"

   If (sBuildEnvChecked <> "") Then
      ShowHideBuildType = "style='display:block;'"
   End If

End Function
'----------------------------------------------------------------------------------------------------------------------
' Renders the HTML for the build standard addendum drop down list boxes, ie. Prod, Debug, Prod+Debug, Java 1.4, Java 1.5, etc.
Sub RenderBuildTypeCombo( nBuildAddendum, nBuildMachine, nBuildStandard )

   Query_String = "SELECT * FROM build_standards_addendum WHERE bs_id ="& nBuildStandard & " ORDER BY bsa_id DESC"

   Response.Write "<select name='build_type_comb_"& nBuildMachine &"' class='form_item'"& disableCriticalSectionEdit &">"

   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
   While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)

   If nBuildAddendum = rsTemp.Fields("bsa_id") Then
      Response.write "<option value='"& rsTemp.Fields("bsa_id") &"' selected>"& rsTemp.Fields("bsa_name") &"</option>"
   Else
      Response.write "<option value='"& rsTemp.Fields("bsa_id") &"'>"& rsTemp.Fields("bsa_name") &"</option>"
   End If
   rsTemp.MoveNext
   WEnd
   Response.Write "</select>"

   rsTemp.Close()
   Set rsTemp = nothing
End Sub
'----------------------------------------------------------------------------------------------------------------------
' Renders the HTML for the Version Control Settings drop down list box
Sub RenderVCSCombo(nTag)

   If IsNull(nTag) OR nTag = "" Then
    nTag = enum_VCS_SUBVERSION_TAG
   End If

   Query_String = "SELECT * FROM vcs_type ORDER BY name"

   Response.Write "<select id='vcs_name_combo' name='vcs_name_combo' class='form_item' "& disableCriticalSectionEdit &" onchange='vcs_changed();'>"

   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
   While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)

      If nTag = rsTemp.Fields("tag") Then
         Response.write "<option value='"& rsTemp.Fields("name") &"' selected>"& rsTemp.Fields("name") &"</option>"
      Else
         ' Add item to drop down only if it is not UC (uncontrolled). If it is UC, then only add it if the package
         ' version is a manual build type. It is not valid to allow autobuild packages to be uncontrolled (ie. the
         ' build (daemon) tool needs a label or something doesn't it?)
         If rsTemp.Fields("tag") <> enum_VCS_UNCONTROLLED_TAG OR objFormCollector.Item("build_type") = "M" Then
            Response.write "<option value='"& rsTemp.Fields("name") &"'>"& rsTemp.Fields("name") &"</option>"
         End If
      End If
      rsTemp.MoveNext
   WEnd
   Response.Write "</select>"

   ' Create a hidden combo containing tags instead of names - we can use this to get a tag for a name without
   ' doing a database query
   Response.Write "<td nowrap background='images/bg_form_lightbluedark.gif'><div id='div_vcs_tag_combo' name='div_vcs_tag_combo' style='visibility:hidden'   >"
   Response.Write "<select id='vcs_tag_combo' name='vcs_tag_combo' disabled hidden  class='form_item' "& disableCriticalSectionEdit &">"
   rsTemp.MoveFirst
   While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)
      Response.write "<option value='"& rsTemp.Fields("tag") &"'>"& rsTemp.Fields("tag") &"</option>"
      rsTemp.MoveNext
   WEnd
   Response.Write "</select>"
   Response.Write "</div></td>"

   rsTemp.Close()
   Set rsTemp = nothing
End Sub
'----------------------------------------------------------------------------------------------------------------------
' Renders the HTML for the build standard drop down list box
'
' Typically, this drop down would contain ANT, JATS, and NONE, although ofcoarse this is dependant upon what data is
' present in the build_standards table of the database
Sub RenderBldStdCombo(nBldStdName)

   Query_String = "SELECT * FROM build_standards"

   Response.Write "<select id='bld_std_combo' name='bld_std_combo' class='form_item' "& disableCriticalSectionEdit &" onchange='bld_std_changed();'>"

   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
   While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)

      If nBldStdName = rsTemp.Fields("bs_name") Then
         Response.write "<option value='"& rsTemp.Fields("bs_name") &"' selected>"& rsTemp.Fields("bs_name") &"</option>"
      Else
         Response.write "<option value='"& rsTemp.Fields("bs_name") &"'>"& rsTemp.Fields("bs_name") &"</option>"
      End If
      rsTemp.MoveNext
   WEnd
   Response.Write "</select>"
   Response.Write "<td nowrap background='images/bg_form_lightbluedark.gif'>&nbsp;</td>"

   rsTemp.Close()
   Set rsTemp = nothing
End Sub
'----------------------------------------------------------------------------------------------------------------------
' Figures out what the url should be for when the form is submitted, ensuring that all of the paramters are present if
' need be. Note that the VCS and BSName parameters are optional. They will only be present if the user has made modifications
' to the respective drop down list boxes before submitting the form.
Sub Determine_submit_action_url ()
   ' Work out what the reload url should be for when the user hits the submit button
   If IsNull(parVCSTag) OR parVCSTag = "" Then
      If IsNull(parBSName) OR parBSName = "" Then
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id
      Else
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id & "&bs_name=" & parBSName
      End If
   Else
      If IsNull(parBSName) OR parBSName = "" Then
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id & "&vcs_tag=" & parVCSTag
      Else
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id & "&vcs_tag=" & parVCSTag & "&bs_name=" & parBSName
      End If
   End If
End Sub
'----------------------------------------------------------------------------------------------------------------------
' This subroutine sets up the on_submit_validation string to be used in the form tag to validate certain fields
' in client-side javascript when a user tries to submit the form
Sub Determine_On_Submit_Validation
   on_submit_validation = ""
   Dim args

   If (objFormCollector.Item("vcs_tag") = enum_VCS_CLEARCASE_TAG) Then
      ' Do clearcase path + label validation
      args = "'FRlabel','Label','RisCCLabel','FRpath','Source Path','RisCCPath'"
   ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_SUBVERSION_TAG) Then
      ' Do subversion tag validation
      args = "'FRpath','Source Path','RisSVNPath'"
      args = args & ",'FRlabel','Subversion Tag','RisSVNTag'"
      If (objFormCollector.Item("build_type") = "M" ) Then
          args = args & ",'FRlabel','Subversion Tag','RisSVNPegTag'"
      End If
   End If
   on_submit_validation = "onSubmit=""MM_validateForm(" & args & "); return document.MM_returnValue"""

End Sub
'----------------------------------------------------------------------------------------------------------------------
' This function obtains a BM_ID (build machine ID) from a buidl machine name by querrying the database
Function Get_BM_ID_for_BM_Name(nBm_Name)
   Dim rsTemp, Query_String

   Get_BM_ID_for_BM_Name = ""

   Query_String = "SELECT bm_id FROM build_machines bm WHERE bm.bm_name = '" & nBm_Name & "'"

   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))

   Get_BM_ID_for_BM_Name = ""

   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
      Get_BM_ID_for_BM_Name = rsTemp("bm_id")
   End If

End Function
'----------------------------------------------------------------------------------------------------------------------
Function GetRowColor( sRowColor )
   If sRowColor = "#FFFFFF" Then
      GetRowColor = "#F5F5F5"
   Else
      GetRowColor = "#FFFFFF"
   End If
End Function
'----------------------------------------------------------------------------------------------------------------------
%>
<%
'------------------------------- RUN BEFORE PAGE RENDER ----------------------------

Call LoadFieldRules ( "'FRlabel','FRpath','pv_description','pv_overview','be_id_list'", objForm )      ' Load Validation Rules
Call Get_Form_Details( parPv_id, objFormCollector )



'--- From Validation Rule Changes ----

' Dont need the label if the package version is uncontrolled
If (objFormCollector.Item("vcs_tag") = enum_VCS_UNCONTROLLED_TAG) Then
   objForm.UpdateRules ("id='FRlabel' IsRequired='N'")
End If

' Dont need the path if the package version is uncontrolled
If (objFormCollector.Item("vcs_tag") = enum_VCS_UNCONTROLLED_TAG) Then
   objForm.UpdateRules ("id='FRpath' IsRequired='N'")
End If

' Dont need the build environment if the is_build_env_required is "N"
If objFormCollector.Item("is_build_env_required") = "N" Then
   objForm.UpdateRules ("id='be_id_list' IsRequired='N'")
End If



'--- Access Control Setup ------------
pageIsEditable = Is_Page_Editable ( objFormCollector.Item ("dlocked") )
criticalSectionIsEditable = Is_Critical_Section_Editable ( objFormCollector.Item("dlocked") )
isWIP = PackageExists(parRtag_id,parPv_id,"work_in_progress")

If criticalSectionIsEditable then
   disableCriticalSectionEdit = ""
Else
   disableCriticalSectionEdit = "disabled"
End If

' Disable "Required" warnings for fields that cannot be edited by the current user at this time
If NOT criticalSectionIsEditable Then
   objForm.UpdateRules ("id='FRlabel' IsRequired='N'")
   objForm.UpdateRules ("id='FRpath' IsRequired='N'")
   objForm.UpdateRules ("id='be_id_list' IsRequired='N'")
End If


'--- Process Submission ---------------

If objForm.IsPostBack Then
   ' use of the drop down lists or the submit button gets us in here

   If objForm.IsValidOnPostBack Then
      ' only get here if the form is valid

      ' has the user pressed the submit button?
      If Request("btn") = "Submit" Then

         If objFormCollector.Item("build_type") = "A" AND UCase(objFormCollector.Item("bs_name")) = "NONE" Then

            Call MessageBox_Need_A_BuildStandard()

         Else

            Dim aBuildEnvList, nBuildEnv, display
            display = false

            If UCase(objFormCollector.Item("bs_name")) <> "NONE" Then
               ' Check for mutual exclusivity rules on the build standard addendum items
               aBuildEnvList = Split( Replace( Request("be_id_list"), " ", "" ) , ",")

               ' If >1 build machine items have been selected....
               If UBound(aBuildEnvList) > 0 Then
                  Dim bm_id_generic
                  bm_id_generic = Get_BM_ID_for_BM_Name("Generic")

                  ' If one of the selected build mnachines is "Generic" then we have a mutual exclusivity violation
                  For Each nBuildEnv In aBuildEnvList
                     If nBuildEnv = bm_id_generic Then
                        display = true
                     End If
                  Next
               End If
            End If

            If display then
               Call MessageBox_BM_Exclusivity()
            Else
               Call Update_Pkg_Info ( parPv_id, QStrPar("FRdeployable"), QStrPar("FRlabel"), QStrPar("FRpath"), QStrPar("pv_description"), QStrPar("pv_overview") )
               Call OpenInParentWindow ( "fixed_issues.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id &"&hidenv=true" )
               Call CloseWindow
            End If

         End If


      Else
         ' We come through here when a user modifies the VCS or Build Standard drop down list settings
         ' We must stay in the form. There is nothing to do yet. The user may not have finished making their edits yet.
      End If
   Else
      ' The form is still invalid but we only want to issue the warning message if the user pressed the submit button
      If Request("btn") = "Submit" Then
         Call MessageBox_RequiredFieldsEmpty()
      End If
   End If
End If

' Determine the URL to use when and if this form is refreshed using F5, or when a user changes the
' values in one of the drop down lists and the form is reloaded with additional or changed parameters
' The html form will use the result of this in its action tag.
Call Determine_submit_action_url()

Call Determine_On_Submit_Validation()

'--------------------------------------------------------------------------------------------
%>
<html>
<head>
<title>Release Manager</title>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
<link rel="stylesheet" href="images/navigation.css" type="text/css">
<script language="JavaScript" src="images/common.js"></script>
<!-- TIPS -->
<script language="JavaScript" src="images/tipster.js"></script>
<script language="JavaScript" src="images/_help_tips.js"></script>
<script language="JavaScript" type="text/javascript">
<!--

// This function is the onchange event handler for the Version Control System drop down list box.
// It will re-format the web page URL to pass the vcs_tag paramter reflecting the users choice in the drop down list,
// and submit the form using the updated URL.
function vcs_changed() {
   var f = document.getElementById('pkginfo');
   if (f == null) {
      alert('Javascript Error : Failed to get pkginfo');
   }
   else {

      var nc = document.getElementById('vcs_name_combo');
      if (nc == null) {
         alert('Javascript Error : Failed to get vcs_name_combo');
      }
      else {
         var tc = document.getElementById('vcs_tag_combo');
         if (tc == null) {
            alert('Javascript Error : Failed to get vcs_tag_combo');
         }
         else {
            // Form the new URL with the updated VCS tag passed as a parameter
            var tc2 = document.getElementById('vcs_name_combo');
            if (tc2.options[nc.selectedIndex].value == 'Concurrent Versions System')
            {
               alert('The Concurrent Versions System (CVS) is not fully supported by ERG.\n' +
                     'This means you will have to manually build this package.\n' +
                     'Please ensure you assign the version number manually, if that is not already so.\n');
            }
            <%If IsNull(parBSName) OR parBSName = "" Then%>
               f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&vcs_tag=" + tc.options[nc.selectedIndex].value;
            <%Else%>
               f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&bs_name=<%=parBSName%>&vcs_tag=" + tc.options[nc.selectedIndex].value;
            <%End If%>

            f.submit();
         }
      }
   }
}

// This function is the onchange event handler for the Build Standard drop down list box.
// It will re-format the web page URL to pass the vcs_tag paramter reflecting the users choice in the drop down list,
// and submit the form using the updated URL.
function bld_std_changed() {
   var f = document.getElementById('pkginfo');
   if (f == null) {
      alert('Javascript Error : Failed to get pkginfo');
   }
   else {
      var nc = document.getElementById('bld_std_combo');
      if (nc == null) {
         alert('Javascript Error : Failed to get bld_std_combo');
      }
      else {
         // Form the new URL with the updated build standard name passed as a parameter
         <%If IsNull(parVCSTag) OR parVCSTag = "" Then%>
            f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&bs_name=" + nc.options[nc.selectedIndex].value;
         <%Else%>
            f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&vcs_tag=<%=parVCSTag%>&bs_name=" + nc.options[nc.selectedIndex].value;
         <%End If%>

         f.submit();
      }
   }
}

// This function will replace back slashes with forward slashes and can be used with an onchange event on fields
// where back slashes may be entered
function replace_back_slashes(e) {
   strip_whitespace(e);
   var str = e.value;
   e.value = str.replace(/\\/g,"/");
}

function strip_whitespace(e) {
   var str = e.value;
   str = str.replace(/^\s+/,"");
   e.value =  str.replace(/\s+$/,"");
}

//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
<!-- TIPS LAYERS -------------------------------------->
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
<!----------------------------------------------------->
<form id="pkginfo" name="pkginfo" method="post" <%=on_submit_validation%> action="<%=submit_action_url%>">
   <table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
      <tr>
         <td background="images/lbox_bg_orange.gif" width="1%" height="1%"><img src="images/s_info_off.gif" width="21" height="21" hspace="5" border="0"></td>
         <td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl">&nbsp;Package Information </td>
         <td background="images/lbox_bg_blue.gif" align="right" width="50%">
            <input type="submit" name="btn" value="Submit" <%If pageIsEditable Then%>class="form_btn_comp"<%Else%>disabled class="form_btn_comp_disabled"<%End If%>>
            <input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="self.close()">
         </td>
         <td background="images/lbox_bg_blue.gif" align="right" width="1%" nowrap>
         <img src="images/h_trsp_dot.gif" width="5" height="22"> </td>
      </tr>

      <tr>
         <td height="100%" width="1%">&nbsp;</td>
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
               <tr>
                  <td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
                  <td width="1%" nowrap class="form_group" valign="bottom"></td>
                  <td nowrap width="1%">&nbsp; </td>
                  <td nowrap width="100%">&nbsp;</td>
               </tr>
               <tr>
                  <td>&nbsp;</td>
                  <td nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objFormCollector.Item("pkg_name") &" "& objFormCollector.Item("pkg_version")%></td>
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">&nbsp;</td>
               </tr>
               <tr>
                  <td>&nbsp;</td>
                  <td nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Deployable?<%=Quick_Help ( "deployable" )%></td>
                  <%
                  FRdeployableYES = ""
                  FRdeployableNO = ""

                  If objForm.IsPostBack Then
                     If Request("FRdeployable") = "1" Then
                        FRdeployableYES = "checked"
                     Else
                        FRdeployableNO = "checked"
                     End If

                  Else
                     If objFormCollector.Item("is_deployable") = enumDB_YES Then
                        FRdeployableYES = "checked"
                     Else
                        FRdeployableNO = "checked"
                     End If

                  End If
                  %>
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">Yes<input name="FRdeployable" type="radio" value="1" <%=FRdeployableYES%>>
                  &nbsp;&nbsp;No<input name="FRdeployable" type="radio" value="0" <%=FRdeployableNO%>></td>
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">&nbsp;</td>
               </tr>
               <tr>
                  <td>&nbsp;</td>
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Version Control System</td>
                  <td nowrap background="images/bg_form_lightbluedark.gif">
                     <% Call RenderVCSCombo(objFormCollector.Item("vcs_tag"))%>
                  </td>
               </tr>

               <!--- Source Path ---------------------------------------------->
               <%If (objFormCollector.Item("vcs_tag") = enum_VCS_CLEARCASE_TAG) Then%>

                  <tr>
                     <td>&nbsp;</td>
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "src_path" )%></td>
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
                        <input name="FRpath" type="text" class="form_item" <%=disableCriticalSectionEdit%> id="FRpath" onchange="replace_back_slashes(this);" value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>" size="60" maxlength="2000">
                        <br>&nbsp;Example: /MASS_Dev_Infra/core_cs <br>
                     </td>
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRpath")%></td>
                  </tr>
               
                  <tr>
                     <td>&nbsp;</td>
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Label<%=Quick_Help ( "pkg_label" )%></td>
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
                        <%
                        sLabelReadOnly = ""
                        sDefaultLabel = Default_Label(parPv_id, objFormCollector.Item("build_type"), objFormCollector.Item("pkg_name"), objFormCollector.Item("pkg_version"), objFormCollector.Item("v_ext"))

                        If objFormCollector.Item("build_type") = "A" AND NOT criticalSectionIsEditable Then
                           sLabelReadOnly = "readonly"
                        End If

                        If objForm.IsPostBack Then
                           sLabel = Request("FRlabel")

                           ' If a user has switched the form back and forth between different VCS settings, and the previous one did not utilise a label
                           ' the FRlabel request we just did will return a null/empty, so set sLabel to the default label once more if this is the case.
                           ' Also, we use the SetValueForced() function to force the value of sLabel into the object that does some of our validation for us.
                           ' That function (as opposed to the plain SetValue() function) cares nothing about the setting of the IsPostBack flag in the
                           ' object. If we didnt do this, the field on the visible form would be highlighted with "Required" because SetValue() just does
                           ' a Request() in IsPostBack situations, and so our sLabel value will not be acquired by the object for validation.
                           If IsNull(sLabel) OR sLabel = "" Then
                              sLabel = sDefaultLabel
                              objForm.SetValueForced "FRlabel", sLabel
                           End If
                        Else
                           If (objFormCollector.Item("pkg_label") = "N/A") Then
                              sLabel = "N/A"
                           Else
                              If objFormCollector.Item("pkg_label") = "" OR IsNull(objFormCollector.Item("pkg_label"))  Then
                                 sLabel = sDefaultLabel
                              Else
                                 sLabel = objFormCollector.Item("pkg_label")
                              End If
                              objForm.SetValue "FRlabel", sLabel
                           End If
                        End If
                        %>
                        <input type="text" name="FRlabel" id="FRlabel" maxlength="50" size="60" class="form_item" <%=disableCriticalSectionEdit%> onchange="strip_whitespace(this);" value="<%=sLabel%>" <%=sLabelReadOnly%>>
                        <br>&nbsp;Example: core_cs_1.0.0000.cr<br>
                     </td>
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRlabel")%></td>
                  </tr>

               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_SUBVERSION_TAG) Then%>
                  <tr>
                     <td>&nbsp;</td>
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "svn_source_path" )%></td>
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
                        <input name="FRpath" type="text" class="form_item" <%=disableCriticalSectionEdit%> id="FRpath" onchange="replace_back_slashes(this);" value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>" size="60" maxlength="2000">
                        <br>&nbsp;Example: AUPERASVN01/RepoName/myPackage/trunk<br>
                     </td>
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRpath")%></td>
                  </tr>
                  <tr>
                     <td>&nbsp;</td>
                     <td nowrap valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Tag<%=Quick_Help ( "svn_tag" )%></td>
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
                        <%
                        sLabelReadOnly = ""
                        sDefaultLabel = Default_Label(parPv_id, objFormCollector.Item("build_type"), objFormCollector.Item("pkg_name"), objFormCollector.Item("pkg_version"), objFormCollector.Item("v_ext"))

                        If objFormCollector.Item("build_type") = "A" AND NOT criticalSectionIsEditable Then
                           sLabelReadOnly = "readonly"
                        End If

                        If objForm.IsPostBack Then
                           sLabel = Request("FRlabel")

                           ' If a user has switched the form back and forth between different VCS settings, and the previous one did not utilise a label
                           ' the FRlabel request we just did will return a null/empty, so set sLabel to the default label once more if this is the case.
                           ' Also, we use the SetValueForced() function to force the value of sLabel into the object that does some of our validation for us.
                           ' That function (as opposed to the plain SetValue() function) cares nothing about the setting of the IsPostBack flag in the
                           ' object. If we didnt do this, the field on the visible form would be highlighted with "Required" because SetValue() just does
                           ' a Request() in IsPostBack situations, and so our sLabel value will not be acquired by the object for validation.
                           If IsNull(sLabel) OR sLabel = "" Then
                              sLabel = sDefaultLabel
                              objForm.SetValueForced "FRlabel", sLabel
                           End If
                        Else
                           If (objFormCollector.Item("pkg_label") = "N/A") Then
                              sLabel = "N/A"
                           Else
                              If objFormCollector.Item("pkg_label") = "" OR IsNull(objFormCollector.Item("pkg_label"))  Then
                                 sLabel = sDefaultLabel
                              Else
                                 sLabel = objFormCollector.Item("pkg_label")
                              End If
                              objForm.SetValue "FRlabel", sLabel
                           End If
                        End If
                        %>

                        <input type="text" name="FRlabel" id="FRlabel" maxlength="50" size="60" class="form_item" <%=disableCriticalSectionEdit%> onchange="strip_whitespace(this);" value="<%=sLabel%>" <%=sLabelReadOnly%>>
                        <%
                        If objFormCollector.Item("build_type") = "M" Then
                            %> <br>&nbsp;Example: <%=sDefaultLabel%>@1234<br> <%
                        Else
                            %> <br>&nbsp;Example: <%=sDefaultLabel%>[@1234]<br> <%
                        End If
                        %>
                     </td>
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRlabel")%></td>
                  </tr>

               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_CVS_TAG) Then%>
                  <tr>
                     <td>&nbsp;</td>
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "src_path" )%></td>
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
                        <input name="FRpath" type="text" class="form_item" <%=disableCriticalSectionEdit%> id="FRpath" onchange="replace_back_slashes(this);" value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>" size="60" maxlength="2000">
                        <br>&nbsp;Example: /MASS_Dev_Infra/core_cs<br>
                     </td>
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRpath")%></td>
                  </tr>

                  <tr>
                     <td>&nbsp;</td>
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Label<%=Quick_Help ( "pkg_label" )%></td>
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
                        <input type="text" name="FRlabel" id="FRlabel" maxlength="50" size="60" class="form_item" <%=disableCriticalSectionEdit%> onchange="strip_whitespace(this);" value="<%=objForm.GetValue( "FRlabel", objFormCollector.Item("pkg_label") )%>" >
                     </td>
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRlabel")%></td>
                  </tr>

               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_UNCONTROLLED_TAG) Then%>
                  <input name="FRpath"  type="hidden" id="FRpath"  value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>">
                  <input name="FRlabel" type="hidden" id="FRlabel" value="<%=sLabel%>">
               <%Else%>
                  <tr>
                     <td>&nbsp;</td>
                     <td colspan=3 background="images/bg_form_lightbluedark.gif" class="sublbox_txt">
                        <span class='err_alert'><b>WARNING:</b> Release Manager Website does not currently support the selected Version Control System</span>
                     </td>
                  </tr>
                  <input name="FRpath"  type="hidden" id="FRpath"  value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>">
                  <input name="FRlabel" type="hidden" id="FRlabel" value="<%=sLabel%>">
               <%End If%>

               <tr>
                  <td>&nbsp;</td>
                  <td valign="top" background="images/bg_form_lightbluedark.gif" class="form_field">Short Package Description<%=Quick_Help ( "pkg_info_short_desc" )%></td>
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
                     <textarea name="pv_description" cols="57" rows="5" class="form_item" id="pv_description"><%=objForm.GetValue( "pv_description", objFormCollector.Item("pv_description") )%></textarea>
                  </td>
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("pv_description")%></td>
               </tr>
               <tr>
                  <td>&nbsp;</td>
                  <td valign="top" background="images/bg_form_lightbluedark.gif" class="form_field">Package Overview<%=Quick_Help ( "pkg_info_overview" )%></td>
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
                     <textarea name="pv_overview" cols="57" rows="10" class="form_item" id="pv_overview"><%=objForm.GetValue( "pv_overview", objFormCollector.Item("pv_overview") )%></textarea>
                  </td>
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("pv_overview")%></td>
               </tr>

               <tr>
                  <td>&nbsp;</td>
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Build Standard</td>
                  <td nowrap background="images/bg_form_lightbluedark.gif">
                     <% Call RenderBldStdCombo(objFormCollector.Item("bs_name"))%>
                  </td>
               </tr>

               <tr>
                  <td>&nbsp;</td>
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Build Environment<%=Quick_Help ( "build_environment" )%></td>
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
                     <%If objFormCollector.Item("is_build_env_required") = "N" Then%>
                        &nbsp;Build Environment not applicable
                     <%End If%>

                     <div id="divBuildEnv" name="divBuildEnv" style="width:320px; height:150px; overflow: auto; <%If (objFormCollector.Item("is_build_env_required") = "N") Then%>display:none;<%Else%>display:block;<%End If%>">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                           <tr>
                              <td bgcolor="#FFFFFF">
                                 <table width="100%" border="0" cellspacing="0" cellpadding="3">
                                    <%
                                    OraDatabase.Parameters.Add "PV_ID",    parPv_id,   ORAPARM_INPUT, ORATYPE_NUMBER

                                    query = _
                                    " SELECT DECODE ( pkgbinfo.BM_ID,"&_
                                    "                    bm.BM_ID, 'checked',"&_
                                    "            NULL ) AS checked,"&_
                                    "      bm.BM_ID,"&_
                                    "      bm.BM_NAME, "&_
                                    "      pkgbinfo.BSA_ID"&_
                                    "  FROM BUILD_MACHINES bm,"&_
                                    "        PACKAGE_BUILD_INFO pkgbinfo"&_
                                    " WHERE pkgbinfo.BM_ID (+)= bm.BM_ID"&_
                                    "   AND pkgbinfo.PV_ID (+)= :PV_ID"&_
                                    " ORDER BY UPPER(bm.bm_name) "


                                    Set rsQry = OraDatabase.DbCreateDynaset( query, cint(0))
                                    Dim rowColor

                                    rowColor = "#F5F5F5"

                                    While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
                                       checked = ""
                                       If objForm.IsTicked( "be_id_list", rsQry("bm_id"), rsQry("checked") ) Then
                                          checked = "checked"
                                          objForm.SetValue "be_id_list", checked
                                       End If

                                       rowColor = GetRowColor( rowColor )
                                       %>
                                       <tr>
                                          <td nowrap class="form_txt" bgcolor="<%=rowColor%>"><input type="checkbox" name="be_id_list" onClick="ToggleDisplay('build_type_<%=rsQry("bm_id")%>');" <%=disableCriticalSectionEdit%> value="<%=rsQry("bm_id")%>" <%=checked%>></td>
                                          <td nowrap class="form_txt" bgcolor="<%=rowColor%>"><%=rsQry("bm_name")%></td>
                                          <td nowrap class="form_txt" bgcolor="<%=rowColor%>"><div id="build_type_<%=rsQry("bm_id")%>" <%=ShowHideBuildType( checked )%>><% Call RenderBuildTypeCombo( rsQry("bsa_id"), rsQry("bm_id"), objFormCollector.Item("bs_id") )%></div></td>
                                          <%If checked = "checked" AND rsQry("bsa_id") = 0 Then%>
                                             <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><td background='images/red_dot.gif'><img src='images/spacer.gif' width='1' height='1'></td><td valign='top'><img src='icons/i_bulet_red.gif' width='4' height='4' hspace='3' vspace='4' border='0' align='absmiddle'></td><td class='val_err'>Required</td></td>
                                          <%End If%>
                                       </tr>
                                       <%rsQry.MoveNext
                                    WEnd

                                    rsQry.Close
                                    Set rsQry = Nothing

                                    OraDatabase.Parameters.Remove "PV_ID"
                                    %>
                                    <tr>
                                       <td width="1"></td>
                                       <td width="1"></td>
                                       <td width="100%"></td>
                                    </tr>
                                 </table>
                              </td>
                           </tr>
                        </table>
                     </div>
                  </td>
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate("be_id_list")%></td>
               </tr>
               <tr>
                  <td>&nbsp;</td>
                  <td nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="100" height="10"></td>
                  <td nowrap> <p>&nbsp;</p></td>
                  <td nowrap>&nbsp;</td>
               </tr>
            </table>
         </td>
      </tr>
      <tr>
         <td height="1%" width="1%"><img src="images/h_trsp_dot.gif" width="5" height="5"></td>
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/lbox_bg_blue.gif"></td>
      </tr>
   </table>
   <input type="hidden" name="pv_id"   id="pv_id"   value="<%=parPv_id%>">
   <input type="hidden" name="rtag_id" id="rtag_id" value="<%=parRtag_id%>">
   <input type="hidden" name="vcs_tag" id="vcs_tag" value="<%=parVCSTag%>">
   <input type="hidden" name="bs_name" id="bs_name" value="<%=parBSName%>">
</form>
</body>
</html>
<%
'------------- RUN AFTER PAGE RENDER ---------------
Set objFormCollector = Nothing
'---------------------------------------------------
%>

<!-- DESTRUCTOR ------->
<!--#include file="common/destructor.asp"-->