Subversion Repositories DevTools

Rev

Rev 6827 | Rev 7003 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<!-- #INCLUDE FILE="..\common\adovbs.inc" -->
<%
'=============================================================
'//
'//                  Action Button Control
'//
'=============================================================
%>
<%
'--------------- Global Constants ----------------
Const enumABTNCTRL_ON_READONLY_HIDE = 1
Const enumABTNCTRL_ON_READONLY_DISABLE = 2
'-------------------------------------------------

Class ActionButtonControl

   Private mArrAbtnDef()
   Private mobjNameDefMap        ' Item can be accesed by name. Must be unique within one page
   Private mobjIdDefMap          ' Item can be accesed by id. Must be unique within one page. If NULL, ubound is assigned to it
   Private mobjSeparator         ' Has a name of item after separator is applied
   Private mobjACActionsMap      ' Map of buttons to actions from access control

   Private mnButtonSpacer
   Private mnImageHspace

   Private mNumOfProperties
   Private mLastPropertyInx

   Private mbDisableAll

   Private mbIsReadonly
   Private mbIsClosed
   Private mReadonlyActionBehaviour

   Private InxID
   Private InxName
   Private InxTxt
   Private InxLink
   Private InxEventHandler
   Private InxImg
   Private InxImgOff
   Private InxHint
   Private InxVisible
   Private InxActive
   Private InxIsReadonlyAction
   Private InxHideOnClosed


   Public Property Let AllActive ( cActive )
      If cActive = enumDB_NO Then
         mbDisableAll = TRUE
      Else
         mbDisableAll = FALSE
      End If

   End Property

   Public Property Let ButtonSpacer ( nWidth )
      mnButtonSpacer = nWidth
   End Property

   Public Property Let ImageHspace ( nWidth )
      mnImageHspace = nWidth
   End Property

   Public Property Let IsReadonlyAction ( IsReadonly )
      If IsReadonly = enumDB_YES Then
         mbIsReadonly = TRUE

      ElseIf IsReadonly = enumDB_NO Then
         mbIsReadonly = FALSE
      Else
         mbIsReadonly = IsReadonly
      End If
   End Property

   Public Property Let setClosed ( isClosed )
      mbIsClosed = isClosed
   End Property
   
   Public Property Let ReadonlyActionBehaviour ( nEnum )
      mReadonlyActionBehaviour = nEnum
   End Property

   '-----------------------------------------------------------------------------------------------------------------
   Public Sub SetRelationship ( sButtonName, sActionName )
      Call mobjACActionsMap.Add ( sButtonName, sActionName )
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Private Sub SetItemPropertyByIndex ( nInx, nProperty, Value )
      If nInx = "" Then Exit Sub   ' Exit sub if you don't find defined button

      If nProperty = ""  OR  Value = "" Then Err.Raise 8, "Method SetItemPropertyByIndex", "Empty parameters found. nInx="& nInx &", nProperty="& nProperty &", Value="& Value

      mArrAbtnDef ( nProperty, nInx ) = Value

      'Response.write "mArrAbtnDef ( "& nProperty &", "& nInx &" ) = "& Value &"<br>"
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Private Function GetItemPropertyByIndex ( nInx, nProperty )
      GetItemPropertyByIndex = ""
      If nInx = "" Then Exit Function   ' Exit sub if you don't find defined button

      If nProperty = ""  Then Err.Raise 8, "Method GetItemPropertyByIndex", "Empty parameters found. nInx="& nInx &", nProperty="& nProperty

      GetItemPropertyByIndex = Cstr(mArrAbtnDef ( nProperty, nInx ))
   End Function
   '-----------------------------------------------------------------------------------------------------------------
   Private Function LastItemInx ()
       LastItemInx = UBound ( mArrAbtnDef, 2 )
   End Function
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub AddActionButton ( sItemName, nItemID )
      Dim newArrayDim

      If InStr( sItemName, " " ) > 0 Then   Err.Raise 8, "Method AddActionButton", "Item Name '"& sItemName &"' cannot have spaces."



      If NOT mobjNameDefMap.Exists (CStr( sItemName )) Then

         newArrayDim = LastItemInx() + 1

         ReDim Preserve mArrAbtnDef( mNumOfProperties, newArrayDim )

         ' Store name
         Call SetItemPropertyByIndex ( newArrayDim, InxName, sItemName )
         mobjNameDefMap.Add Cstr( sItemName ), CStr( newArrayDim )

         If Not IsNull(nItemID) Then
            ' Store ID
            Call SetItemPropertyByIndex ( newArrayDim, InxdbID, nItemID )
            mobjIdDefMap.Add Cstr( nItemID ), CStr( newArrayDim )
         End If

         ' Set Defaults
         Call SetItemDefaults ( sItemName )
      Else

         Err.Raise 8, "Method AddActionButton", "Item Name '"& sItemName &"' has been already defined."

      End If

   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub Render ( aAbtnList, ByRef oAccessControl )
      Dim itemInx, itemName, nLastItemInx, btnImage, ButtonStr, ButtonStrDisabled, bIsVisibleAC, bIsActiveAC
      Response.write "<table cellpadding='0' cellspacing='0' width='1' ><tr>"

      For Each itemName in aAbtnList
         itemInx = mobjNameDefMap.Item (Cstr(itemName))

         '-- Define Image
         btnImage = "<img src='images/spacer.gif' width='"& mnButtonSpacer &"' height='1' align='absmiddle' border='0'>"
         If (mArrAbtnDef( InxImg, itemInx ) <> "") Then
            btnImage = "<img src='"& mArrAbtnDef( InxImg, itemInx ) &"' hspace='"& mnImageHspace &"' border='0' align='absmiddle'>"
         End If

         '-- Define Button
         '-- Two forms
         '--    Starts with "vixConfirm - Generate confirmation dialog with url
         '--    Else 'eval' and use in raw form
         Dim uhref,uevent
         uhref = Eval( mArrAbtnDef( InxLink, itemInx ) )
         uevent = Eval( mArrAbtnDef( InxEventHandler, itemInx ) )
         If InStr( uevent, "vixConfirm" ) = 1 Then
            uevent = Replace(uevent, "HREF", uhref )
            uevent = "onclick=""" & uevent & """"
            uhref = "javascript:;"
         End If
         Dim hint: hint = mArrAbtnDef( InxHint, itemInx )
         If uhref = "javascript:;" Then
             ButtonStr = _
                "<td nowrap>"&_
                "<span id='"& mArrAbtnDef( InxName, itemInx ) &"' "&_
                " "& uevent &" class='menu_link' title='"& hint &"'>" &_
                btnImage & mArrAbtnDef( InxTxt, itemInx ) &"<span>"&_
                "</td>"
         Else
             ButtonStr = _
                "<td nowrap>"&_
                "<a id='"& mArrAbtnDef( InxName, itemInx ) &"' "&_
                " name='"& mArrAbtnDef( InxName, itemInx ) &"' href='"& uhref &"' "&_
                " "& uevent &" class='menu_link' title='"& hint &"'>"&_
                btnImage & mArrAbtnDef( InxTxt, itemInx ) &"</a>"&_
                "</td>"
         End If

                        '-- Define Disabled Button
            '   A Null value of '' will use InxImg with the lessOpacity Class
            hint = hint & " [Disabled]" 
            If IsNull(mArrAbtnDef( InxImgOff, itemInx )) Then
                ButtonStrDisabled = _
                    "<td nowrap>"&_
                    "<img src='"& mArrAbtnDef( InxImg, itemInx ) &"' hspace='2' border='0' align='absmiddle' class='lessOpacity' title='"&hint&"'>"&_
                    "<label class='menu_txt'>"& mArrAbtnDef( InxTxt, itemInx ) &"</label>"&_
                    "</td>"
            Else
                ButtonStrDisabled = _
                    "<td nowrap>"&_
                    "<img src='"& mArrAbtnDef( InxImgOff, itemInx ) &"' hspace='2' border='0' align='absmiddle' title='"&hint&"'>"&_
                    "<label class='menu_txt'>"& mArrAbtnDef( InxTxt, itemInx ) &"</label>"&_
                    "</td>"
            End If


         '-- Get Access Control permissions --
         bIsVisibleAC = TRUE
         bIsActiveAC = TRUE
         If NOT IsNull( oAccessControl ) Then
            ' Access control object is supplied

            If mobjACActionsMap.Exists ( itemName ) Then
               ' Relationship supplied
               bIsVisibleAC = oAccessControl.IsVisible ( mobjACActionsMap.Item( itemName ) )
               bIsActiveAC = oAccessControl.IsActive ( mobjACActionsMap.Item( itemName ) )
               'Response.write "<br>" & itemName &":"& bIsVisibleAC &"-"& bIsActiveAC
            End If

         End If

         ' Hide Buttons on closed (Release is closed, or archived)
         If mbIsClosed AND (mArrAbtnDef( InxHideOnClosed, itemInx ) = enumDB_YES) Then
            bIsVisibleAC = FALSE
         End If

         ' Debug
         'Response.write "<br>Render["&itemInx &"](V:"&itemName &","&_
         '   mArrAbtnDef( InxVisible, itemInx )&":" &bIsVisibleAC & ",A:"&_
         '   mArrAbtnDef( InxActive, itemInx ) &":" &bIsActiveAC  & ")"

         ' Button 
         '      is visible AND to be shown
         ' OR   isa width specification
         ' OR   isa height specification
         '
         If (  ( mArrAbtnDef( InxVisible, itemInx ) = enumDB_YES)   AND   bIsVisibleAC   ) _
            OR  (InStr( itemName, "width=" ) > 0)  _
            OR  (InStr( itemName, "height=" ) > 0) Then
            ' --- Display if Visible ---

            'AND  (NOT bIsActiveAC)
            '( mbDisableAll OR (  mArrAbtnDef( InxActive, itemInx ) = enumDB_NO )     )   AND ( itemInx <> "" )
            'Response.write itemName &":"& mbDisableAll &"-"& Eval( mArrAbtnDef( InxActive, itemInx ) = enumDB_NO ) &"-"& Eval( NOT bIsActiveAC ) &"-"& itemInx &"<br>"
            If  ( itemInx <> "" ) AND _
               ( mbDisableAll  OR _
                  (  ( mArrAbtnDef( InxActive, itemInx ) = enumDB_NO )  OR  (NOT bIsActiveAC)  ) _
               ) _
            Then
               'Response.Write "<br>"&itemName&" is disabled," & itemInx & "," & mbDisableAll & "," & mArrAbtnDef( InxActive, itemInx ) & "," & mArrAbtnDef( InxVisible, itemInx )

               ' --- Display DISABLED Button Item ---
               Response.write ButtonStrDisabled

               If mnButtonSpacer > 0 Then
                  Response.write "<td><img src='images/spacer.gif' width='"& mnButtonSpacer &"' height='1' align='absmiddle'></td>"
               End If

            Else

               ' --- Display Action Button Item ---
               If   ( NOT mbIsReadonly )  OR _
                     ( mbIsReadonly  AND  mArrAbtnDef( InxIsReadonlyAction, itemInx ) = enumDB_YES ) Then

                  If InStr( itemName, "width=" ) > 0 Then
                     Response.write "<td><img src='images/spacer.gif' "& itemName &" height='1' align='absmiddle'></td>"

                  ElseIf InStr( itemName, "height=" ) > 0 Then
                     Response.write "<td><img src='images/bg_bage_2.gif' width='1' "& itemName &" align='absmiddle' hspace='4'></td>"

                  Else
                     '/* It is a button, i.e. Display Button */

                     ' Check if button is loaded from Database
                     If itemInx = "" Then    Err.Raise 8, "Method Render", "Definition for item name '"& itemName &"' not found."

                     Response.write ButtonStr
                     'Response.Write "<br>"&itemName&" is enabled"

                     If mnButtonSpacer > 0 Then
                        Response.write "<td><img src='images/spacer.gif' width='"& mnButtonSpacer &"' height='1' align='absmiddle'></td>"
                     End If

                  End If

               ElseIf ( mbIsReadonly  AND  mArrAbtnDef( InxIsReadonlyAction, itemInx ) = enumDB_NO ) Then

                  If mReadonlyActionBehaviour = enumABTNCTRL_ON_READONLY_DISABLE Then
                     Response.write ButtonStrDisabled
                  End If

               End If

            End If

         End If

         ' --- Separators added manually using  method AddSeparator or AddSeparatorAfter ---
         If mobjSeparator.Exists ( Cstr(mArrAbtnDef( InxName, itemInx )) ) Then
            Response.write "<td><img src='images/spacer.gif' width='"& mobjSeparator.Item ( Cstr(mArrAbtnDef( InxName, itemInx )) ) &"' height='1'></td>"
         End If


      Next

      Response.write "</tr></table>"
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   ' Return true if required_abtnName is one of the strings in the aAbtnList string array, else return false
   Private Function isAbtnRequired (aAbtnList, required_abtnName)
      Dim this_abtnName

      isAbtnRequired = FALSE

      For Each this_abtnName in aAbtnList
         If 0 = StrComp(this_abtnName, required_abtnName) Then
            isAbtnRequired = TRUE
            Exit Function
         End If
      Next
   End Function
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub LoadActionButtons ( aAbtnList, ByRef objOraDatabase )

      ' The following code is now used in place of the earlier code to acquire action button records.
      '
      ' This code exploits the fact that in ADO 2.8 onwards, you can create ADO DB record sets
      ' without a connection to an actual database. So, to rid ourselves of the need for a DEF_ACTION_BUTTONS
      ' table in the database, we can simply take all of the table's rows and reproduce them here in row
      ' creation and field assignment statements. The rest of the website code will be ignorant of the fact
      ' that the data has not come from the actual database.
      '
      ' Complicating factors:
      ' 1) Some action button fields (action_link and event_handler) are to be EVAL'ed later on when used
      '    to render the HTML page. This can lead to some very complex looking strings that are difficult to
      '    understand. EVAL allows things like parRtag_id used in a string to be converted to an actual
      '    number (in string form) at time of HTML rendering. We have to use EVAL. There is no other option.
      '
      ' 2) The strings from the database must also be represented as VBScript strings in the assignments
      '    below. This means that where a string needs to have an embedded " char, two such chars must be
      '    used, and remember about EVAL mentioned above, meaning that sometimes """" has to be used to
      '    give a single " to the resulting string that pops out from EVAL.
      '    Remember also that whilst HTML doesn't care whether you use single or double quotes, javascript
      '    does (it must use single quotes) and VBScript does (it must use double quotes)
      '
      ' Possible Future Roadmap
      ' 1) Rid the code of ABTN_ID - I dont think we need this field now that we are free of the database
      '
      '
      Dim rsQry
      Dim varFields
      Dim varValues

      ' Create the object and configure some of its properties
      Set rsQry = Server.CreateObject("ADODB.Recordset")
      rsQry.CursorLocation = adUseClient
      rsQry.CursorType = adOpenKeyset
      rsQry.LockType = adLockOptimistic

      ' Based upon the original DEF_ACTION_BUTTONS table DDL, define the fields (ie. table columns) being simulated
      rsQry.Fields.Append "ABTN_ID",               adInteger
      rsQry.Fields.Append "ABTN_NAME",             adVarChar,   64
      rsQry.Fields.Append "TEXT",                  adVarChar,  128, adFldIsNullable
      rsQry.Fields.Append "ACTION_LINK",           adVarChar,  512, adFldIsNullable
      rsQry.Fields.Append "EVENT_HANDLER",         adVarChar,  512, adFldIsNullable
      rsQry.Fields.Append "IMG_ENABLED",           adVarChar,  128, adFldIsNullable
      rsQry.Fields.Append "IMG_DISABLED",          adVarChar,  128, adFldIsNullable
      rsQry.Fields.Append "HINT",                  adVarChar,  256, adFldIsNullable
      rsQry.Fields.Append "VISIBLE",               adChar,       1
      rsQry.Fields.Append "ACTIVE",                adChar,       1
      rsQry.Fields.Append "IS_READONLY_ACTION",    adChar,       1
      rsQry.Fields.Append "HIDE_ON_CLOSED",        adChar,       1

      ' open the record set for updating
      rsQry.Open

      ' Specify the field order that we are going to use in our row creation statements
      varFields = Array("ABTN_ID", "ABTN_NAME", "TEXT",_
                        "ACTION_LINK",_
                        "EVENT_HANDLER",_
                        "IMG_ENABLED",_
                        "IMG_DISABLED",_
                        "HINT",_
                        "VISIBLE",_
                        "ACTIVE",_
                        "IS_READONLY_ACTION",_
                        "HIDE_ON_CLOSED")

      ' Add the rows to the record set, but only for buttons specifed in the list supplied by the caller

      ' Remember, Field Ordering is... ID, name, text, link, event handler, en-img, dis-img, hint, visible, active, is readonly action

      If isAbtnRequired(aAbtnList, "btnNewVersion") Then
         varValues = Array( 1, "btnNewVersion", null,_
                           """form_new_version.asp?""& objPMod.ComposeURL()",_
                           null,_
                           "images/abtn_new_version.gif",_
                           "images/abtn_new_version_off.gif",_
                           "Create new version of this package.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnVersionHistory") Then
         varValues = Array( 2, "btnVersionHistory", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openBrWindow('_wform_versions_history_release_notes.asp?OLDpv_id=""& parPv_id &""&pkg_id=""& pkgInfoHash.Item (""pkg_id"") &""&FLpkg_version=*""& pkgInfoHash.Item(""v_ext"") &""&FLuser_name=*&rfile=""& scriptName &""&""& objPMod.ComposeURL() &""','History','resizable=yes,scrollbars=yes,width=1000,height='+ ( screen.height - 100 )  );""""""",_
                           "images/abtn_version_history.gif",_
                           null,_
                           "Show version history of this package.",_
                           "Y",_
                           "Y",_
                           "Y",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnRemovePackage") Then
         varValues = Array( 3, "btnRemovePackage", null,_
                           """_remove_package.asp?pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
                           """vixConfirm('Remove this package from this release.',{title:'Remove Package', button:'Remove', url: 'HREF'});""",_
                           "images/abtn_remove_pkg.gif",_
                           "images/abtn_remove_pkg_off.gif",_
                           "Remove the package-version from this Release.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnMakeRelease") Then
         varValues = Array( 4, "btnMakeRelease", null,_
                           """_make_released.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
                           """vixConfirm('Making this package released will prevent any further changes',{title:'Make Release', button:'Release', url: 'HREF'});""""""",_
                           "icons/i_make_released.gif",_
                           "icons/i_make_released_off.gif",_
                           "Make this package released, so that other packages can use it.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnMakeUnrelease") Then
         varValues = Array( 5, "btnMakeUnrelease", null,_
                           """_make_unreleased.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
                           """vixConfirm('You are going to unrelease this package.',{title:'Make UnRelease', button:'UnRelease', url: 'HREF'});""""""",_
                           "icons/i_make_unreleased.gif",_
                           "icons/i_make_unreleased_off.gif",_
                           "Unrelease this package.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnMakePending") Then
         varValues = Array( 6, "btnMakePending", null,_
                           """_make_pending.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
                           """vixConfirm('Making this package pending will prevent any further changes.',{title:'Make Pending', button:'Pending', url: 'HREF'});""""""",_
                           "icons/i_make_pending.gif",_
                           "icons/i_make_pending_off.gif",_
                           "Make this package pending for build/release.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnRejectPackage") Then
         varValues = Array( 7, "btnRejectPackage", null,_
                           """_make_rejected.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
                           """vixConfirm('Rejecting a new package version will move it to Work-In-Progress.<br>Rejecting a merge package version will simply remove it from pending.',{title:'Reject Package', button:'Reject', url: 'HREF'});""""""",_
                           "icons/i_reject_pending.gif",_
                           "icons/i_reject_pending_off.gif",_
                           "Reject this package from Pending.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnMoveToView") Then
         varValues = Array( 8, "btnMoveToView", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('_wform_change_group.asp?""& objPMod.ComposeURL() &""','Set Package Base View');""""""",_
                           "images/abtn_move_package.gif",_
                           "images/abtn_move_package_off.gif",_
                           "Move this package to different Base View (Group).",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnReversionPackage") Then
         varValues = Array( 9, "btnReversionPackage", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('_wform_rename_version.asp?renameMode=1&rfile=""& ScriptName & objPMod.ComposeURLWithout(""rfile"") &""','Rename Version Number');""""""",_
                           "images/abtn_rename_version.gif",_
                           "images/abtn_rename_version_off.gif",_
                           "Reversion this package.",_
                           "Y",_
                           "Y",_
                           "Y",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnStickyNotes") Then
         varValues = Array(10, "btnStickyNotes", null,_
                           """javascript:;""",_
                           """onClick=""""showHideNote();""""""",_
                           "notemanager/images/note.gif",_
                           null,_
                           "Sticky notes",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnObsoletePatch") Then
         varValues = Array(11, "btnObsoletePatch", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('_wform_obsolete_patch.asp?rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Make Patch Obsolete');""""""",_
                           "images/abtn_obsolete_patch.gif",_
                           "images/abtn_obsolete_patch_off.gif",_
                           "Make this patch obsolete.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnUnobsoletePatch") Then
         varValues = Array(12, "btnUnobsoletePatch", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('_wform_obsolete_patch.asp?action=true&unobsolete=true&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','UnObsolete Patch');""""""",_
                           "images/abtn_unobsolete_patch.gif",_
                           null,_
                           "Undo patch obsolete.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnApprovePackage") Then
         varValues = Array(13, "btnApprovePackage", null,_
                           """_make_approved.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
                           """vixConfirm('Approve this package for auto-build.',{title:'Approve Package', button:'Approve', url: 'HREF'});""""""",_
                           "icons/i_submit_build.gif",_
                           "icons/i_submit_build_off.gif",_
                           "Make this package released for automated build.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnNewRelease") Then
         varValues = Array(14, "btnNewRelease", null,_
                           """new_release.asp?" & objPMod.ComposeURL() &"""",_
                           null,_
                           "images/abtn_new_release.gif",_
                           "images/abtn_new_release_off.gif",_
                           "Create new release...",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnEditRelease") Then
         varValues = Array(15, "btnEditRelease", null,_
                           """javascript:go_submit( document.FormName, """"btnEditRelease"""" );""",_
                           null,_
                           "images/abtn_edit.gif",_
                           "images/abtn_edit_off.gif",_
                           "Edit selected release details...",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnMergeManager") Then
         varValues = Array(17, "btnMergeManager", null,_
                           """diff.asp""",_
                           null,_
                           "images/abtn_merge_manager.gif",_
                           "images/abtn_merge_manager_off.gif",_
                           "Run merge manager...",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnMoveRelease") Then
         varValues = Array(18, "btnMoveRelease", null,_
                           """javascript:go_submit( document.FormName, """"btnMoveRelease"""" );""",_
                           null,_
                           "images/abtn_move_release.gif",_
                           "images/abtn_move_release_off.gif",_
                           "Move selected release vertically...",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      ' NOTE: entries 19 and 20 were not used
      '       Index numbers can be reused

      If isAbtnRequired(aAbtnList, "btnNewVersion-MASSREF") Then
         varValues = Array(21, "btnNewVersion-MASSREF", null,_
                           """form_new_version.asp?rtag_id=""& AssocMASSREFValue &""&pv_id=""& Request(""pv_id"")",_
                           null,_
                           "images/abtn_new_version_MassRef.gif",_
                           null,_
                           "Create new version of this package in associated MASS REF.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnDestroyWip") Then
         varValues = Array(34, "btnDestroyWip", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('_destroy_package.asp?bfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Destroy WIP');""""""",_
                           "icons/i_destroy_package.gif",_
                           "icons/i_destroy_package_off.gif",_
                           "Destroy this WIP",_
                           "Y",_
                           "Y",_
                           "Y",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnRecycleBin") Then
         varValues = Array(22, "btnRecycleBin", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('_destroy_package.asp?&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Destroy Package Version');""""""",_
                           "icons/i_destroy_package.gif",_
                           "icons/i_destroy_package_off.gif",_
                           "Destroy this package version",_
                           "Y",_
                           "Y",_
                           "Y",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnDeprecation") Then
         varValues = Array(23, "btnDeprecation", null,_
                           """javascript:;""",_
                           """onClick='MM_openVixIFrame(""""_wform_deprecate_package.asp?rfile=""& scriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id &"""""",""""Deprecate Package"""")' class='body_txt' title='Deprecate the package.'""",_
                           "images/BombBorder.gif",_
                           "images/BombBorder_off.gif",_
                           "Deprecate this package in this release.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnUnDeprecation") Then
         varValues = Array(24, "btnUnDeprecation", null,_
                           """_wform_undeprecate_package.asp?rfile=""& scriptName &""&pkg_id=""& pkgInfoHash.Item(""pkg_id"") &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id &""""",_
                           """vixConfirm('You are about to undeprecate package: ""& pkgInfoHash.Item (""pkg_name"") &"".',{title:'Undeprecate Package', url: 'HREF'});""""""",_
                           "images/BombBorder.gif",_
                           null,_
                           "Un Deprecate this package in this release",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnAdminView") Then
         varValues = Array(25, "btnAdminView", null,_
                           """form_edit_project_view.asp?proj_id=""& parProjId &""""",_
                           null,_
                           "images/view_admin.gif",_
                           null,_
                           "Administer the views in the project.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnNotificationView") Then
         varValues = Array(25, "btnNotificationView", null,_
                           """form_view_release_notifications.asp?proj_id=""& parProjId &""""",_
                           null,_
                           "images/view_notifications.gif",_
                           null,_
                           "Display the package notification information in this project .",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnProjectReplication") Then
         varValues = Array(25, "btnProjectReplication", null,_
                           """form_project_replication.asp?proj_id=""& parProjId &""""",_
                           null,_
                           "images/project_replication.gif",_
                           null,_
                           "Display the project replication information.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      ' NOTE: I do not think this one is ever used
      If isAbtnRequired(aAbtnList, "btnAddProc") Then
         varValues = Array(26, "btnAddProc", "Add Process",_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('wAddProc.asp?rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Add Process');""""""",_
                           "icons/btn_add.gif",_
                           null,_
                           null,_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnEditGBE_Machtype") Then
         varValues = Array(27, "btnEditGBE_Machtype", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('wAddMachtype.asp?type=edit&gbe_id=""& gbe_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Machine Type');""""""",_
                           "icons/i_edit.gif",_
                           null,_
                           "Edit this GBE MachType value",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnDeleteGBE_Machtype") Then
         varValues = Array(28, "btnDeleteGBE_Machtype", null,_
                           """_DeleteMachtype.asp?rfile=""& SCRIPT_NAME &""&gbe_id=""& gbe_id &""&""& objPMod.ComposeURL()",_
                           """vixConfirm('Remove \'""& GBE_VALUE &""\' from this list?',{title:'Remove GBE_MACHTYPE', button:'Remove', url: 'HREF'});""""""",_
                           "icons/i_remove.gif",_
                           null,_
                           "Delete this GBE MachType value",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnEditDaemon") Then
         varValues = Array(29, "btnEditDaemon", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('wAddDaemon.asp?type=edit&rcon_id=""& rcon_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Build Daemon');""""""",_
                           "icons/i_edit.gif",_
                           NULL,_
                           "Edit Build Configuration",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnDeleteDaemon") Then
         varValues = Array(30, "btnDeleteDaemon", null,_
                           """_DeleteDaemon.asp?rcon_id=""& rcon_id & ""&action=Delete&"" & objPMod.ComposeURL()",_
                           """vixConfirm('Delete the \'""& Daemon &""\' Daemon and associated information from this Release?',{title:'Remove Deamon', button:'Remove', url: 'HREF'});""""""",_
                           "icons/i_remove.gif",_
                           null,_
                           "Delete Daemon",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnRemoveDaemon") Then
         varValues = Array(47, "btnRemoveDaemon", null,_
                           """_DeleteDaemon.asp?rcon_id=""& rcon_id & ""&action=Remove&""& objPMod.ComposeURL()",_
                           """vixConfirm('Unlink the \'""& Daemon &""\' Daemon from this Release.<p>Configuration information will be maintained.',{title:'Unlink Deamon', button:'Unlink', url: 'HREF'});""""""",_
                           "icons/break_link.gif",_
                           null,_
                           "Unlink Daemon from entry",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnEditBuildMachine") Then
         varValues = Array(29, "btnEditBuildMachine", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('wAddBuildMachine.asp?type=edit&bmcon_id=""& bmcon_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Build Machine');""""""",_
                           "icons/i_edit.gif",_
                           NULL,_
                           "Edit Build Machine",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnDeleteBuildMachine") Then
         varValues = Array(30, "btnDeleteBuildMachine", null,_
                           """_DeleteBuildMachine.asp?rfile=""& SCRIPT_NAME &""&bmcon_id=""& bmcon_id &""&""& objPMod.ComposeURL()",_
                           """vixConfirm('Remove Build Machine \'""& machine_hostname &""\' from this list?',{title:'Delete Build Machine', button:'Delete', url: 'HREF'});""""""",_
                           "icons/i_remove.gif",_
                           null,_
                           "Delete Build Machine",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnEditBlatMachine") Then
         varValues = Array(29, "btnEditBlatMachine", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('wAddPkgReplica.asp?type=edit&server_id=""& server_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Package Replica');""""""",_
                           "icons/i_edit.gif",_
                           NULL,_
                           "Edit Package Replica",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnDeleteBlatMachine") Then
         varValues = Array(30, "btnDeleteBlatMachine", null,_
                           """_DeletePkgReplica.asp?rfile=""& SCRIPT_NAME &""&server_id=""& server_id &""&""& objPMod.ComposeURL()",_
                           """vixConfirm('Remove Package Replica \'""& display_name &""\' from this list?',{title:'Delete Package Replica', button:'Delete', url: 'HREF'});""""""",_
                           "icons/i_remove.gif",_
                           null,_
                           "Delete Package Replica",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnPendingIntegration") Then
         varValues = Array(32, "btnPendingIntegration", null,_
                           """_modify_product_state.asp?state_id=1&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
                           """vixConfirm('Do you want to proceed to make this product pending for INTEGRATION?',{title:'Make Pending', button:'Pending', url: 'HREF'});""""""",_
                           "icons/PendingIntegration.gif",_
                           null,_
                           "Make this product pending for Integration.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnPendingTest") Then
         varValues = Array(33, "btnPendingTest", null,_
                           """_modify_product_state.asp?state_id=2&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
                           """vixConfirm('Do you want to proceed to make this product pending for Test?',{title:'Make Test', button:'Test', url: 'HREF'});""""""",_
                           "icons/PendingTest.gif",_
                           null,_
                           "Make this product pending for Test.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnPendingDeployment") Then
         varValues = Array(34, "btnPendingDeployment", null,_
                           """_modify_product_state.asp?state_id=3&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
                           """vixConfirm('Do you want to proceed to make this product pending for DEPLOYMENT?',{title:'Make Deploy', button:'Deploy', url: 'HREF'});""""""",_
                           "icons/PendingDeployment.gif",_
                           null,_
                           "Make this product pending for Deployment.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnRejectProduct") Then
         varValues = Array(35, "btnRejectProduct", null,_
                           """_modify_product_state.asp?state_id=4&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
                           """vixConfirm('Do you want to REJECT this product from DEPLOYMENT?',{title:'Reject Product', button:'Reject', url: 'HREF'});""""""",_
                           "icons/i_reject_pending.gif",_
                           null,_
                           "Reject this product from Deployment.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnPendingIntegrateAndDeploy") Then
         varValues = Array(36, "btnPendingIntegrateAndDeploy", null,_
                           """_modify_product_state.asp?state_id=5&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
                           """vixConfirm('Do you want to proceed to make this product pending for INTEGRATION and DEPLOYMENT?',{title:'Pending Product', button:'Confirm', url: 'HREF'});""""""",_
                           "icons/PendingDeployment.gif",_
                           null,_
                           "Make this product pending for Integration and Deployment.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnDeleteSchedule") Then
         varValues = Array(37, "btnDeleteSchedule", null,_
                           """_DeleteSchedule.asp?scheduled_id=""& scheduled_id &""&""& objPMod.ComposeURL()",_
                           """vixConfirm('Remove Schedule from this list?',{title:'Remove Schedule', button:'Remove', url: 'HREF'});""""""",_
                           "icons/i_remove.gif",_
                           "icons/i_remove_dis.gif",_
                           "Delete Schedule",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnApproveMerge") Then
         varValues = Array(38, "btnApproveMerge", null,_
                           """_approve_merge.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
                           """vixConfirm('The release will be updated by this merge operation',{title:'Approve Merge', button:'Merge', url: 'HREF'});""""""",_
                           "icons/i_make_released.gif",_
                           "icons/i_make_released_off.gif",_
                           "Approve and carry out the pending merge operation",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnRejectAutobuildPackage") Then
         varValues = Array( 39, "btnRejectAutobuildPackage", null,_
                           """_make_rejected.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
                           """vixConfirm('Rejecting a package already approved for autobuild will set it back to Work-In-Progress',{title:'Reject Package', button:'Reject', url: 'HREF'});""""""",_
                           "icons/i_reject_pending.gif",_
                           "icons/i_reject_pending_off.gif",_
                           "Unapprove autobuild, move back to Work-In-Progress.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnDeleteDaemonInst") Then
         varValues = Array(40, "btnDeleteDaemonInst", null,_
                           """_DeleteDaemonInstruction.asp?rfile=""& ScriptName &""&inst_id=""& daemonInstId &""&""& objPMod.ComposeURL()",_
                           """vixConfirm('Delete the Daemon Instruction from this list?',{title:'Delete Instruction', button:'Delete', url: 'HREF', width : 350, height : 150});""""""",_
                           "icons/i_remove.gif",_
                           null,_
                           "Delete this Daemon Instruction",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnEditDaemonInst") Then
         varValues = Array(41, "btnEditDaemonInst", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('wAddDaemonInstruction.asp?edit=true&inst_id=""& daemonInstId & ""&sort="" & parSortOrder & ""&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Edit Daemon Instruction');""""""",_
                           "icons/i_edit.gif",_
                           NULL,_
                           "Edit this Daemon Instruction",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnAddDaemonInstRipplePackage") Then
         varValues = Array(42, "btnAddDaemonInstRipplePackage", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('wAddDaemonInstructionSimple.asp?op_code=0"" &""&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Ripple or Test Build Package');""""""",_
                           "images/ripplesquare.gif",_
                           NULL,_
                           "Request the Build Daemon to ripple this package version",_
                           "Y",_
                           "Y",_
                           "N",_
                           "Y")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnDelDaemonInstRipplePackage") Then
         varValues = Array(42, "btnDelDaemonInstRipplePackage", null,_
                           """_DeleteDaemonInstruction.asp?rfile=""& ScriptName &""&opCode="" & OP_CODE_0_RIPPLE_BUILD_PACKAGE & ""&""& objPMod.ComposeURL()",_
                           """vixConfirm('Delete the Ripple Request?',{title:'Delete Ripple Request', button:'Delete', url: 'HREF', width : 350, height : 150});""""""",_
                           "images/CascadeSquareDel.gif",_
                           NULL,_
                           "Delete the Ripple Request",_
                           "Y",_
                           "Y",_
                           "N",_
                           "Y")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnDelDaemonInstTestPackage") Then
         varValues = Array(42, "btnDelDaemonInstTestPackage", null,_
                           """_DeleteDaemonInstruction.asp?rfile=""& ScriptName &""&opCode="" & OP_CODE_1_TEST_BUILD_PACKAGE & ""&""& objPMod.ComposeURL()",_
                           """vixConfirm('Delete the Test Build Request?',{title:'Delete Test Build Request', button:'Delete', url: 'HREF', width : 350, height : 150});""""""",_
                           "images/testSquareDel.gif",_
                           NULL,_
                           "Delete the Test Build Request",_
                           "Y",_
                           "Y",_
                           "N",_
                           "Y")
         rsQry.AddNew varFields, varValues
      End If


      If isAbtnRequired(aAbtnList, "btnAddDaemonInstTestBuildPackage") Then
         varValues = Array(43, "btnAddDaemonInstTestBuildPackage", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('wAddDaemonInstruction.asp?op_code=1"" &""&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Add Daemon Instruction');""""""",_
                           "images/abtn_test_build.gif",_
                           NULL,_
                           "Request the Build Daemon to test build this WIP package version",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnMoveWIPToRelease") Then
         varValues = Array( 44, "btnMoveWIPToRelease", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('_wform_move_wip.asp"" &""?rfile=""& ScriptName &""&""&  objPMod.ComposeURL() &""','Move WIP');""""""",_
                           "images/abtn_move_wip_to_release.gif",_
                           "images/abtn_move_wip_to_release_off.gif",_
                           "Move this WIP to another release.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnLockPackage") Then
         varValues = Array( 45, "btnLockPackage", null,_
                           """_s_lock_package.asp?pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
                           """vixConfirm('Lock Package.<p>This will prevent changes to the package.',{title:'Lock Package', button:'Lock', url: 'HREF'});""""""",_
                           "icons/i_lock.gif",_
                           "icons/i_lock_off.gif",_
                           "Lock this package.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnUnLockPackage") Then
         varValues = Array( 46, "btnUnLockPackage", null,_
                           """_s_unlock_package.asp?pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
                           """vixConfirm('Unlock Package.<p>This may have serious side effects.',{title:'Unlock Package', button:'Unlock', url: 'HREF'});""""""",_
                           "icons/i_unlock.gif",_
                           "icons/i_unlock_off.gif",_
                           "Unlock this package.",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If



      If isAbtnRequired(aAbtnList, "btnEditProjectExtensions") Then
         varValues = Array(29, "btnEditProjectExtensions", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('wAddProjectExtension.asp?type=edit&ext=""& extName &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Project Extension');""""""",_
                           "icons/i_edit.gif",_
                           NULL,_
                           "Edit Project Extensions",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnDeleteProjectExtension") Then
         varValues = Array(30, "btnDeleteProjectExtension", null,_
                           """_DeleteProjectExtension.asp?rfile=""& SCRIPT_NAME &""&ext=""& extName &""&""& objPMod.ComposeURL()",_
                           """vixConfirm('Remove Project Extension:  \'""& extName &""\' from this list?<p>This will prevent it from being used in new package versions.',{title:'Remove Project Extension', button:'Remove', url: 'HREF'});""""""",_
                           "icons/i_remove.gif",_
                           null,_
                           "Delete Project Extension",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnEditGBE_Machclass") Then
         varValues = Array(31, "btnEditGBE_Machclass", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('wAddMachclass.asp?type=edit&bm_id=""& bm_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Machine Class');""""""",_
                           "icons/i_edit.gif",_
                           NULL,_
                           "Edit this GBE MachClass value",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnDeleteGBE_Machclass") Then
         varValues = Array(32, "btnDeleteGBE_Machclass", null,_
                           """wAddMachclass.asp?type=delete&bm_id=""& bm_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL()",_
                           """vixConfirm('Delete the \'""& GBE_VALUE &""\' Machine Class',{title:'Delete Machine Class', button:'Delete', url: 'HREF'});""""""",_
                           "icons/i_remove.gif",_
                           null,_
                           "Delete this GBE MachClass value",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnEditGBE_BuildStandard") Then
         varValues = Array(48, "btnEditGBE_BuildStandard", null,_
                           """javascript:;""",_
                           """onClick=""""MM_openVixIFrame('wAddBuildStandard.asp?type=edit&bsa_id=""& bsa_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Build Standard');""""""",_
                           "icons/i_edit.gif",_
                           NULL,_
                           "Edit this Build Standard",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If

      If isAbtnRequired(aAbtnList, "btnDeleteGBE_BuildStandard") Then
         varValues = Array(49, "btnDeleteGBE_BuildStandard", null,_
                           """_DeleteBuildStandard.asp?rfile=""& SCRIPT_NAME &""&bsa_id=""& bsa_id &""&""& objPMod.ComposeURL()",_
                           """vixConfirm('Delete the \'""& GBE_VALUE &""\' Build Standard',{title : 'Delete Build Standard', button:'Delete', url: 'HREF'});""""""",_
                           "icons/i_remove.gif",_
                           null,_
                           "Delete this Build Standard",_
                           "Y",_
                           "Y",_
                           "N",_
                           "N")
         rsQry.AddNew varFields, varValues
      End If
      

      ' Move cursor to the first record
      rsQry.MoveFirst

      If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
         Call LoadButtons ( rsQry.GetRows() )
      End If

      rsQry.Close
      Set rsQry = Nothing
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub LoadButtons ( aRows )
      Dim nProperty, newArrayDim, LastRow, rowNum

      LastRow = UBound( aRows, 2 )

      For rowNum = 0 To LastRow
         ' Increase array by 1
         newArrayDim = LastRowInx() + 1
         ReDim Preserve mArrAbtnDef( mNumOfProperties, newArrayDim )


         mobjNameDefMap.Item ( Cstr( aRows ( InxName, rowNum ) ) ) = newArrayDim

         For nProperty = 0 To mLastPropertyInx
            mArrAbtnDef ( nProperty, newArrayDim ) = aRows ( nProperty, rowNum )

         Next

      Next

   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Private Function LastRowInx ()
       LastRowInx = UBound ( mArrAbtnDef, 2 )
   End Function
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub AddSeparatorAfter ( sItemName, sSeparatorWidth )
      If InStr( sItemName, " " ) > 0 Then   Err.Raise 8, "Method AddSeparatorAfter", "Item Name '"& sItemName &"' cannot have spaces."
      mobjSeparator.Add (Cstr(sItemName)), CStr(sSeparatorWidth)
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub AddSeparator ( sSeparatorWidth )
      mobjSeparator.Add ( Cstr(mArrAbtnDef(InxName, LastItemInx())) ), CStr(sSeparatorWidth)
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Private Sub SetItemDefaults ( sItemName )
      ' Additional default setup
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxActive, enumDB_YES )         ' Default Active = enumDB_YES
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub Text ( sItemName, Value )
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxTxt, Value )
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub ItemID ( sItemName, Value )
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxID, Value )
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub Image ( sItemName, Value )
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImg, Value )
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImgOff, Value )         ' Default image disable to be the same as image
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub ImageOff ( sItemName, Value )
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImgOff, Value )
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub Link ( sItemName, Value )
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxLink, Value )
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub EventHandler ( sItemName, Value )
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxEventHandler, Value )
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub Hint ( sItemName, Value )
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxHint, Value )
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub Visible ( sItemName, Value )
      'Response.write sItemName &"here"& mobjNameDefMap.Item (Cstr(sItemName))
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxVisible, Value )
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub ReadOnly ( sItemName, Value )
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxIsReadonlyAction, Value )
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Public Function IsVisible ( sItemName )
      'Response.write sItemName &"here"& mobjNameDefMap.Item (Cstr(sItemName))
      IsVisible = GetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxVisible )
   End Function
   '-----------------------------------------------------------------------------------------------------------------
   Public Sub Active ( sItemName, Value )
      'Response.write sItemName &"here"& mobjNameDefMap.Item (Cstr(sItemName))
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxActive, Value )
   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Public Function IsActive ( sItemName )
      IsActive = GetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxActive )
   End Function
   '-----------------------------------------------------------------------------------------------------------------
   Private Sub Class_Initialize()
      '// Perform action on creation of object. e.g. Set myObj = New ThisClassName
      Set mobjNameDefMap = CreateObject("Scripting.Dictionary")
      Set mobjIdDefMap = CreateObject("Scripting.Dictionary")
      Set mobjSeparator = CreateObject("Scripting.Dictionary")
      Set mobjACActionsMap = CreateObject("Scripting.Dictionary")

      'mbIsReadonly = FALSE   ' Tell control that it should use only readonly action buttons (i.e. actions which will not alter database )
      mReadonlyActionBehaviour = enumABTNCTRL_ON_READONLY_HIDE      ' Tell control what to do by default if mbIsReadonly = TRUE

      mnButtonSpacer = 0
      mnImageHspace = 4

      mNumOfProperties = 12     ' Number of properties in array which define one menu item.
      mLastPropertyInx = mNumOfProperties - 1

      mbDisableAll = FALSE

      ReDim mArrAbtnDef ( mNumOfProperties, -1 )
      InxID                 = 0
      InxName               = 1
      InxTxt                = 2
      InxLink               = 3
      InxEventHandler       = 4
      InxImg                = 5
      InxImgOff             = 6
      InxHint               = 7
      InxVisible            = 8
      InxActive             = 9
      InxIsReadonlyAction   = 10
      InxHideOnClosed       = 11

   End Sub
   '-----------------------------------------------------------------------------------------------------------------
   Private Sub Class_Terminate()
      '// Perform action on object disposal. e.g. Set myObj = Nothing
      Set mobjNameDefMap = Nothing
      Set mobjIdDefMap = Nothing
      Set mobjSeparator = Nothing
      Set mobjACActionsMap = Nothing


   End Sub
   '-----------------------------------------------------------------------------------------------------------------
End Class
%>