Subversion Repositories DevTools

Rev

Rev 5814 | Rev 5929 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
129 ghuddy 1
<!-- #INCLUDE FILE="..\common\adovbs.inc" -->
119 ghuddy 2
<%
3
'=============================================================
4
'//
127 ghuddy 5
'//                  Action Button Control
119 ghuddy 6
'//
7
'=============================================================
8
%>
9
<%
10
'--------------- Global Constants ----------------
11
Const enumABTNCTRL_ON_READONLY_HIDE = 1
12
Const enumABTNCTRL_ON_READONLY_DISABLE = 2
13
'-------------------------------------------------
14
 
15
Class ActionButtonControl
127 ghuddy 16
 
17
   Private mArrAbtnDef()
18
   Private mobjNameDefMap        ' Item can be accesed by name. Must be unique within one page
19
   Private mobjIdDefMap          ' Item can be accesed by id. Must be unique within one page. If NULL, ubound is assigned to it
20
   Private mobjSeparator         ' Has a name of item after separator is applied
21
   Private mobjACActionsMap      ' Map of buttons to actions from access control
22
 
23
   Private mnButtonSpacer
24
   Private mnImageHspace
25
 
26
   Private mNumOfProperties
27
   Private mLastPropertyInx
28
 
29
   Private mbDisableAll
30
 
31
   Private mbIsReadonly
4083 dpurdie 32
   Private mbIsClosed
127 ghuddy 33
   Private mReadonlyActionBehaviour
34
 
35
   Private InxID
36
   Private InxName
37
   Private InxTxt
38
   Private InxLink
39
   Private InxEventHandler
40
   Private InxImg
41
   Private InxImgOff
42
   Private InxHint
43
   Private InxVisible
44
   Private InxActive
45
   Private InxIsReadonlyAction
4083 dpurdie 46
   Private InxHideOnClosed
127 ghuddy 47
 
48
 
49
   Public Property Let AllActive ( cActive )
50
      If cActive = enumDB_NO Then
51
         mbDisableAll = TRUE
52
      Else
53
         mbDisableAll = FALSE
54
      End If
55
 
56
   End Property
57
 
58
   Public Property Let ButtonSpacer ( nWidth )
59
      mnButtonSpacer = nWidth
60
   End Property
61
 
62
   Public Property Let ImageHspace ( nWidth )
63
      mnImageHspace = nWidth
64
   End Property
65
 
66
   Public Property Let IsReadonlyAction ( IsReadonly )
67
      If IsReadonly = enumDB_YES Then
68
         mbIsReadonly = TRUE
69
 
70
      ElseIf IsReadonly = enumDB_NO Then
71
         mbIsReadonly = FALSE
72
      Else
73
         mbIsReadonly = IsReadonly
74
      End If
4083 dpurdie 75
   End Property
127 ghuddy 76
 
4083 dpurdie 77
   Public Property Let setClosed ( isClosed )
78
      mbIsClosed = isClosed
127 ghuddy 79
   End Property
4083 dpurdie 80
 
127 ghuddy 81
   Public Property Let ReadonlyActionBehaviour ( nEnum )
82
      mReadonlyActionBehaviour = nEnum
83
   End Property
84
 
85
   '-----------------------------------------------------------------------------------------------------------------
86
   Public Sub SetRelationship ( sButtonName, sActionName )
87
      Call mobjACActionsMap.Add ( sButtonName, sActionName )
88
   End Sub
89
   '-----------------------------------------------------------------------------------------------------------------
90
   Private Sub SetItemPropertyByIndex ( nInx, nProperty, Value )
91
      If nInx = "" Then Exit Sub   ' Exit sub if you don't find defined button
92
 
93
      If nProperty = ""  OR  Value = "" Then Err.Raise 8, "Method SetItemPropertyByIndex", "Empty parameters found. nInx="& nInx &", nProperty="& nProperty &", Value="& Value
94
 
95
      mArrAbtnDef ( nProperty, nInx ) = Value
96
 
97
      'Response.write "mArrAbtnDef ( "& nProperty &", "& nInx &" ) = "& Value &"<br>"
98
   End Sub
99
   '-----------------------------------------------------------------------------------------------------------------
143 ghuddy 100
   Private Function GetItemPropertyByIndex ( nInx, nProperty )
101
      GetItemPropertyByIndex = ""
102
      If nInx = "" Then Exit Function   ' Exit sub if you don't find defined button
103
 
104
      If nProperty = ""  Then Err.Raise 8, "Method GetItemPropertyByIndex", "Empty parameters found. nInx="& nInx &", nProperty="& nProperty
105
 
106
      GetItemPropertyByIndex = Cstr(mArrAbtnDef ( nProperty, nInx ))
107
   End Function
108
   '-----------------------------------------------------------------------------------------------------------------
127 ghuddy 109
   Private Function LastItemInx ()
110
       LastItemInx = UBound ( mArrAbtnDef, 2 )
111
   End Function
112
   '-----------------------------------------------------------------------------------------------------------------
113
   Public Sub AddActionButton ( sItemName, nItemID )
114
      Dim newArrayDim
115
 
116
      If InStr( sItemName, " " ) > 0 Then   Err.Raise 8, "Method AddActionButton", "Item Name '"& sItemName &"' cannot have spaces."
117
 
118
 
119
 
120
      If NOT mobjNameDefMap.Exists (CStr( sItemName )) Then
121
 
122
         newArrayDim = LastItemInx() + 1
123
 
124
         ReDim Preserve mArrAbtnDef( mNumOfProperties, newArrayDim )
125
 
126
         ' Store name
127
         Call SetItemPropertyByIndex ( newArrayDim, InxName, sItemName )
128
         mobjNameDefMap.Add Cstr( sItemName ), CStr( newArrayDim )
129
 
130
         If Not IsNull(nItemID) Then
131
            ' Store ID
132
            Call SetItemPropertyByIndex ( newArrayDim, InxdbID, nItemID )
133
            mobjIdDefMap.Add Cstr( nItemID ), CStr( newArrayDim )
134
         End If
135
 
136
         ' Set Defaults
137
         Call SetItemDefaults ( sItemName )
138
      Else
139
 
140
         Err.Raise 8, "Method AddActionButton", "Item Name '"& sItemName &"' has been already defined."
141
 
142
      End If
143
 
144
   End Sub
145
   '-----------------------------------------------------------------------------------------------------------------
146
   Public Sub Render ( aAbtnList, ByRef oAccessControl )
147
      Dim itemInx, itemName, nLastItemInx, btnImage, ButtonStr, ButtonStrDisabled, bIsVisibleAC, bIsActiveAC
148
      Response.write "<table cellpadding='0' cellspacing='0' width='1'><tr>"
149
 
150
      For Each itemName in aAbtnList
151
         itemInx = mobjNameDefMap.Item (Cstr(itemName))
152
 
153
 
154
         '-- Define Image
155
         btnImage = "<img src='images/spacer.gif' width='"& mnButtonSpacer &"' height='1' align='absmiddle' border='0'>"
156
         If (mArrAbtnDef( InxImg, itemInx ) <> "") Then
157
            btnImage = "<img src='"& mArrAbtnDef( InxImg, itemInx ) &"' hspace='"& mnImageHspace &"' border='0' align='absmiddle'>"
158
         End If
159
 
160
         '-- Define Button
5190 dpurdie 161
         '-- Two forms
162
         '--    Starts with "vixConfirm - Generate confirmation dialog with url
163
         '--    Else 'eval' and use in raw form
164
         Dim uhref,uevent
165
         uhref = Eval( mArrAbtnDef( InxLink, itemInx ) )
166
         uevent = Eval( mArrAbtnDef( InxEventHandler, itemInx ) )
167
         If InStr( uevent, "vixConfirm" ) = 1 Then
168
            uevent = Replace(uevent, "HREF", uhref )
169
            uevent = "onclick=""" & uevent & """"
170
            uhref = "javascript:;"
171
         End If
127 ghuddy 172
         ButtonStr = _
173
            "<td nowrap>"&_
174
            "<a id='"& mArrAbtnDef( InxName, itemInx ) &"' "&_
5190 dpurdie 175
            " name='"& mArrAbtnDef( InxName, itemInx ) &"' href='"& uhref &"' "&_
176
            " "& uevent &" class='menu_link' title='"& mArrAbtnDef( InxHint, itemInx )  &"'>"&_
127 ghuddy 177
            btnImage & mArrAbtnDef( InxTxt, itemInx ) &"</a>"&_
178
            "</td>"
179
 
5814 dpurdie 180
			'-- Define Disabled Button
181
            '   A Null value of '' will use InxImg with the lessOpacity Class
182
            If IsNull(mArrAbtnDef( InxImgOff, itemInx )) Then
183
                ButtonStrDisabled = _
184
                    "<td nowrap>"&_
185
                    "<img src='"& mArrAbtnDef( InxImg, itemInx ) &"' hspace='2' border='0' align='absmiddle' class='lessOpacity'>"&_
186
                    "<label class='menu_txt'>"& mArrAbtnDef( InxTxt, itemInx ) &"</label>"&_
187
                    "</td>"
188
            Else
189
                ButtonStrDisabled = _
190
                    "<td nowrap>"&_
191
                    "<img src='"& mArrAbtnDef( InxImgOff, itemInx ) &"' hspace='2' border='0' align='absmiddle'>"&_
192
                    "<label class='menu_txt'>"& mArrAbtnDef( InxTxt, itemInx ) &"</label>"&_
193
                    "</td>"
194
            End If
127 ghuddy 195
 
196
 
197
         '-- Get Access Control permissions --
198
         bIsVisibleAC = TRUE
199
         bIsActiveAC = TRUE
200
         If NOT IsNull( oAccessControl ) Then
201
            ' Access control object is supplied
202
 
203
            If mobjACActionsMap.Exists ( itemName ) Then
204
               ' Relationship supplied
205
               bIsVisibleAC = oAccessControl.IsVisible ( mobjACActionsMap.Item( itemName ) )
206
               bIsActiveAC = oAccessControl.IsActive ( mobjACActionsMap.Item( itemName ) )
143 ghuddy 207
               'Response.write "<br>" & itemName &":"& bIsVisibleAC &"-"& bIsActiveAC
127 ghuddy 208
            End If
209
 
210
         End If
211
 
4670 dpurdie 212
         ' Hide Buttons on closed (Release is closed, or archived)
4083 dpurdie 213
         If mbIsClosed AND (mArrAbtnDef( InxHideOnClosed, itemInx ) = enumDB_YES) Then
214
            bIsVisibleAC = FALSE
215
         End If
127 ghuddy 216
 
4670 dpurdie 217
         ' Debug
218
         'Response.write "<br>Render["&itemInx &"](V:"&itemName &","&_
219
         '   mArrAbtnDef( InxVisible, itemInx )&":" &bIsVisibleAC & ",A:"&_
220
         '   mArrAbtnDef( InxActive, itemInx ) &":" &bIsActiveAC  & ")"
221
 
222
         ' Button 
223
         '      is visible AND to be shown
224
         ' OR   isa width specification
225
         ' OR   isa height specification
226
         '
127 ghuddy 227
         If (  ( mArrAbtnDef( InxVisible, itemInx ) = enumDB_YES)   AND   bIsVisibleAC   ) _
228
            OR  (InStr( itemName, "width=" ) > 0)  _
229
            OR  (InStr( itemName, "height=" ) > 0) Then
230
            ' --- Display if Visible ---
231
 
232
            'AND  (NOT bIsActiveAC)
233
            '( mbDisableAll OR (  mArrAbtnDef( InxActive, itemInx ) = enumDB_NO )     )   AND ( itemInx <> "" )
234
            'Response.write itemName &":"& mbDisableAll &"-"& Eval( mArrAbtnDef( InxActive, itemInx ) = enumDB_NO ) &"-"& Eval( NOT bIsActiveAC ) &"-"& itemInx &"<br>"
235
            If  ( itemInx <> "" ) AND _
236
               ( mbDisableAll  OR _
237
                  (  ( mArrAbtnDef( InxActive, itemInx ) = enumDB_NO )  OR  (NOT bIsActiveAC)  ) _
238
               ) _
239
            Then
143 ghuddy 240
               'Response.Write "<br>"&itemName&" is disabled," & itemInx & "," & mbDisableAll & "," & mArrAbtnDef( InxActive, itemInx ) & "," & mArrAbtnDef( InxVisible, itemInx )
127 ghuddy 241
 
242
               ' --- Display DISABLED Button Item ---
243
               Response.write ButtonStrDisabled
244
 
245
               If mnButtonSpacer > 0 Then
246
                  Response.write "<td><img src='images/spacer.gif' width='"& mnButtonSpacer &"' height='1' align='absmiddle'></td>"
247
               End If
248
 
249
            Else
250
 
251
               ' --- Display Action Button Item ---
252
               If   ( NOT mbIsReadonly )  OR _
253
                     ( mbIsReadonly  AND  mArrAbtnDef( InxIsReadonlyAction, itemInx ) = enumDB_YES ) Then
254
 
255
                  If InStr( itemName, "width=" ) > 0 Then
256
                     Response.write "<td><img src='images/spacer.gif' "& itemName &" height='1' align='absmiddle'></td>"
257
 
258
                  ElseIf InStr( itemName, "height=" ) > 0 Then
259
                     Response.write "<td><img src='images/bg_bage_2.gif' width='1' "& itemName &" align='absmiddle' hspace='4'></td>"
260
 
261
                  Else
262
                     '/* It is a button, i.e. Display Button */
263
 
264
                     ' Check if button is loaded from Database
265
                     If itemInx = "" Then    Err.Raise 8, "Method Render", "Definition for item name '"& itemName &"' not found."
266
 
267
                     Response.write ButtonStr
143 ghuddy 268
                     'Response.Write "<br>"&itemName&" is enabled"
127 ghuddy 269
 
270
                     If mnButtonSpacer > 0 Then
271
                        Response.write "<td><img src='images/spacer.gif' width='"& mnButtonSpacer &"' height='1' align='absmiddle'></td>"
272
                     End If
273
 
274
                  End If
275
 
276
               ElseIf ( mbIsReadonly  AND  mArrAbtnDef( InxIsReadonlyAction, itemInx ) = enumDB_NO ) Then
277
 
278
                  If mReadonlyActionBehaviour = enumABTNCTRL_ON_READONLY_DISABLE Then
279
                     Response.write ButtonStrDisabled
280
                  End If
281
 
282
               End If
283
 
284
            End If
285
 
286
         End If
287
 
288
         ' --- Separators added manually using  method AddSeparator or AddSeparatorAfter ---
289
         If mobjSeparator.Exists ( Cstr(mArrAbtnDef( InxName, itemInx )) ) Then
290
            Response.write "<td><img src='images/spacer.gif' width='"& mobjSeparator.Item ( Cstr(mArrAbtnDef( InxName, itemInx )) ) &"' height='1'></td>"
291
         End If
292
 
293
 
294
      Next
295
 
296
      Response.write "</tr></table>"
297
   End Sub
143 ghuddy 298
   '-----------------------------------------------------------------------------------------------------------------
127 ghuddy 299
   ' Return true if required_abtnName is one of the strings in the aAbtnList string array, else return false
300
   Private Function isAbtnRequired (aAbtnList, required_abtnName)
301
      Dim this_abtnName
302
 
303
      isAbtnRequired = FALSE
304
 
305
      For Each this_abtnName in aAbtnList
306
         If 0 = StrComp(this_abtnName, required_abtnName) Then
307
            isAbtnRequired = TRUE
308
            Exit Function
309
         End If
310
      Next
311
   End Function
312
   '-----------------------------------------------------------------------------------------------------------------
313
   Public Sub LoadActionButtons ( aAbtnList, ByRef objOraDatabase )
314
 
315
      ' The following code is now used in place of the earlier code to acquire action button records.
316
      '
317
      ' This code exploits the fact that in ADO 2.8 onwards, you can create ADO DB record sets
318
      ' without a connection to an actual database. So, to rid ourselves of the need for a DEF_ACTION_BUTTONS
319
      ' table in the database, we can simply take all of the table's rows and reproduce them here in row
320
      ' creation and field assignment statements. The rest of the website code will be ignorant of the fact
321
      ' that the data has not come from the actual database.
322
      '
323
      ' Complicating factors:
324
      ' 1) Some action button fields (action_link and event_handler) are to be EVAL'ed later on when used
325
      '    to render the HTML page. This can lead to some very complex looking strings that are difficult to
326
      '    understand. EVAL allows things like parRtag_id used in a string to be converted to an actual
327
      '    number (in string form) at time of HTML rendering. We have to use EVAL. There is no other option.
328
      '
329
      ' 2) The strings from the database must also be represented as VBScript strings in the assignments
330
      '    below. This means that where a string needs to have an embedded " char, two such chars must be
331
      '    used, and remember about EVAL mentioned above, meaning that sometimes """" has to be used to
332
      '    give a single " to the resulting string that pops out from EVAL.
333
      '    Remember also that whilst HTML doesn't care whether you use single or double quotes, javascript
334
      '    does (it must use single quotes) and VBScript does (it must use double quotes)
335
      '
336
      ' Possible Future Roadmap
337
      ' 1) Rid the code of ABTN_ID - I dont think we need this field now that we are free of the database
338
      '
339
      '
340
      Dim rsQry
341
      Dim varFields
342
      Dim varValues
343
 
344
      ' Create the object and configure some of its properties
345
      Set rsQry = Server.CreateObject("ADODB.Recordset")
346
      rsQry.CursorLocation = adUseClient
347
      rsQry.CursorType = adOpenKeyset
348
      rsQry.LockType = adLockOptimistic
349
 
350
      ' Based upon the original DEF_ACTION_BUTTONS table DDL, define the fields (ie. table columns) being simulated
351
      rsQry.Fields.Append "ABTN_ID",               adInteger
352
      rsQry.Fields.Append "ABTN_NAME",             adVarChar,   64
353
      rsQry.Fields.Append "TEXT",                  adVarChar,  128, adFldIsNullable
354
      rsQry.Fields.Append "ACTION_LINK",           adVarChar,  512, adFldIsNullable
355
      rsQry.Fields.Append "EVENT_HANDLER",         adVarChar,  512, adFldIsNullable
356
      rsQry.Fields.Append "IMG_ENABLED",           adVarChar,  128, adFldIsNullable
357
      rsQry.Fields.Append "IMG_DISABLED",          adVarChar,  128, adFldIsNullable
358
      rsQry.Fields.Append "HINT",                  adVarChar,  256, adFldIsNullable
359
      rsQry.Fields.Append "VISIBLE",               adChar,       1
360
      rsQry.Fields.Append "ACTIVE",                adChar,       1
361
      rsQry.Fields.Append "IS_READONLY_ACTION",    adChar,       1
4083 dpurdie 362
      rsQry.Fields.Append "HIDE_ON_CLOSED",        adChar,       1
127 ghuddy 363
 
364
      ' open the record set for updating
365
      rsQry.Open
366
 
367
      ' Specify the field order that we are going to use in our row creation statements
368
      varFields = Array("ABTN_ID", "ABTN_NAME", "TEXT",_
369
                        "ACTION_LINK",_
370
                        "EVENT_HANDLER",_
371
                        "IMG_ENABLED",_
372
                        "IMG_DISABLED",_
373
                        "HINT",_
374
                        "VISIBLE",_
375
                        "ACTIVE",_
4083 dpurdie 376
                        "IS_READONLY_ACTION",_
377
                        "HIDE_ON_CLOSED")
127 ghuddy 378
 
379
      ' Add the rows to the record set, but only for buttons specifed in the list supplied by the caller
380
 
381
      ' Remember, Field Ordering is... ID, name, text, link, event handler, en-img, dis-img, hint, visible, active, is readonly action
382
 
383
      If isAbtnRequired(aAbtnList, "btnNewVersion") Then
384
         varValues = Array( 1, "btnNewVersion", null,_
385
                           """form_new_version.asp?""& objPMod.ComposeURL()",_
386
                           null,_
387
                           "images/abtn_new_version.gif",_
4671 dpurdie 388
                           "images/abtn_new_version_off.gif",_
127 ghuddy 389
                           "Create new version of this package.",_
390
                           "Y",_
391
                           "Y",_
4083 dpurdie 392
                           "N",_
127 ghuddy 393
                           "N")
394
         rsQry.AddNew varFields, varValues
395
      End If
396
 
397
      If isAbtnRequired(aAbtnList, "btnVersionHistory") Then
398
         varValues = Array( 2, "btnVersionHistory", null,_
399
                           """javascript:;""",_
5902 dpurdie 400
                           """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() &""#ANC_""& parPv_id &""','History','resizable=yes,scrollbars=yes,width=1000,height='+ ( screen.height - 100 )  );""""""",_
127 ghuddy 401
                           "images/abtn_version_history.gif",_
402
                           null,_
403
                           "Show version history of this package.",_
404
                           "Y",_
405
                           "Y",_
4083 dpurdie 406
                           "Y",_
407
                           "N")
127 ghuddy 408
         rsQry.AddNew varFields, varValues
409
      End If
410
 
411
      If isAbtnRequired(aAbtnList, "btnRemovePackage") Then
412
         varValues = Array( 3, "btnRemovePackage", null,_
413
                           """_remove_package.asp?pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
5190 dpurdie 414
                           """vixConfirm('Remove this package from this release.',{title:'Remove Package', button:'Remove', url: 'HREF'});""",_
127 ghuddy 415
                           "images/abtn_remove_pkg.gif",_
4670 dpurdie 416
                           "images/abtn_remove_pkg_off.gif",_
417
                           "Remove the package-version from this Release.",_
127 ghuddy 418
                           "Y",_
419
                           "Y",_
4083 dpurdie 420
                           "N",_
127 ghuddy 421
                           "N")
422
         rsQry.AddNew varFields, varValues
423
      End If
424
 
425
      If isAbtnRequired(aAbtnList, "btnMakeRelease") Then
426
         varValues = Array( 4, "btnMakeRelease", null,_
427
                           """_make_released.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
5190 dpurdie 428
                           """vixConfirm('Making this package released will prevent any further changes',{title:'Make Release', button:'Release', url: 'HREF'});""""""",_
127 ghuddy 429
                           "icons/i_make_released.gif",_
430
                           "icons/i_make_released_off.gif",_
431
                           "Make this package released, so that other packages can use it.",_
432
                           "Y",_
433
                           "Y",_
4083 dpurdie 434
                           "N",_
127 ghuddy 435
                           "N")
436
         rsQry.AddNew varFields, varValues
437
      End If
438
 
439
      If isAbtnRequired(aAbtnList, "btnMakeUnrelease") Then
440
         varValues = Array( 5, "btnMakeUnrelease", null,_
441
                           """_make_unreleased.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
5190 dpurdie 442
                           """vixConfirm('You are going to unrelease this package.',{title:'Make UnRelease', button:'UnRelease', url: 'HREF'});""""""",_
127 ghuddy 443
                           "icons/i_make_unreleased.gif",_
444
                           "icons/i_make_unreleased_off.gif",_
183 brianf 445
                           "Unrelease this package.",_
127 ghuddy 446
                           "Y",_
447
                           "Y",_
4083 dpurdie 448
                           "N",_
127 ghuddy 449
                           "N")
450
         rsQry.AddNew varFields, varValues
451
      End If
452
 
453
      If isAbtnRequired(aAbtnList, "btnMakePending") Then
454
         varValues = Array( 6, "btnMakePending", null,_
455
                           """_make_pending.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
5190 dpurdie 456
                           """vixConfirm('Making this package pending will prevent any further changes.',{title:'Make Pending', button:'Pending', url: 'HREF'});""""""",_
127 ghuddy 457
                           "icons/i_make_pending.gif",_
458
                           "icons/i_make_pending_off.gif",_
459
                           "Make this package pending for build/release.",_
460
                           "Y",_
461
                           "Y",_
4083 dpurdie 462
                           "N",_
127 ghuddy 463
                           "N")
464
         rsQry.AddNew varFields, varValues
465
      End If
466
 
467
      If isAbtnRequired(aAbtnList, "btnRejectPackage") Then
468
         varValues = Array( 7, "btnRejectPackage", null,_
469
                           """_make_rejected.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
5190 dpurdie 470
                           """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'});""""""",_
127 ghuddy 471
                           "icons/i_reject_pending.gif",_
472
                           "icons/i_reject_pending_off.gif",_
473
                           "Reject this package from Pending.",_
474
                           "Y",_
475
                           "Y",_
4083 dpurdie 476
                           "N",_
127 ghuddy 477
                           "N")
478
         rsQry.AddNew varFields, varValues
479
      End If
480
 
481
      If isAbtnRequired(aAbtnList, "btnMoveToView") Then
482
         varValues = Array( 8, "btnMoveToView", null,_
483
                           """javascript:;""",_
5590 dpurdie 484
                           """onClick=""""MM_openVixIFrame('_wform_change_group.asp?""& objPMod.ComposeURL() &""','Move Package');""""""",_
127 ghuddy 485
                           "images/abtn_move_package.gif",_
4670 dpurdie 486
                           "images/abtn_move_package_off.gif",_
127 ghuddy 487
                           "Move this package to different Base View (Group).",_
488
                           "Y",_
489
                           "Y",_
4083 dpurdie 490
                           "N",_
127 ghuddy 491
                           "N")
492
         rsQry.AddNew varFields, varValues
493
      End If
494
 
495
      If isAbtnRequired(aAbtnList, "btnReversionPackage") Then
496
         varValues = Array( 9, "btnReversionPackage", null,_
497
                           """javascript:;""",_
5590 dpurdie 498
                           """onClick=""""MM_openVixIFrame('_wform_rename_version.asp?renameMode=1&rfile=""& ScriptName & objPMod.ComposeURLWithout(""rfile"") &""','Rename Version Number');""""""",_
127 ghuddy 499
                           "images/abtn_rename_version.gif",_
500
                           "images/abtn_rename_version_off.gif",_
501
                           "Reversion this package.",_
502
                           "Y",_
503
                           "Y",_
4083 dpurdie 504
                           "N",_
4199 dpurdie 505
                           "N")
127 ghuddy 506
         rsQry.AddNew varFields, varValues
507
      End If
508
 
509
      If isAbtnRequired(aAbtnList, "btnStickyNotes") Then
510
         varValues = Array(10, "btnStickyNotes", null,_
511
                           """javascript:;""",_
512
                           """onClick=""""showHideNote();""""""",_
513
                           "notemanager/images/note.gif",_
514
                           null,_
515
                           "Sticky notes",_
516
                           "Y",_
517
                           "Y",_
4083 dpurdie 518
                           "N",_
127 ghuddy 519
                           "N")
520
         rsQry.AddNew varFields, varValues
521
      End If
522
 
523
      If isAbtnRequired(aAbtnList, "btnObsoletePatch") Then
524
         varValues = Array(11, "btnObsoletePatch", null,_
525
                           """javascript:;""",_
5590 dpurdie 526
                           """onClick=""""MM_openVixIFrame('_wform_obsolete_patch.asp?rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Make Patch Obsolete');""""""",_
127 ghuddy 527
                           "images/abtn_obsolete_patch.gif",_
528
                           "images/abtn_obsolete_patch_off.gif",_
529
                           "Make this patch obsolete.",_
530
                           "Y",_
531
                           "Y",_
4083 dpurdie 532
                           "N",_
127 ghuddy 533
                           "N")
534
         rsQry.AddNew varFields, varValues
535
      End If
536
 
537
      If isAbtnRequired(aAbtnList, "btnUnobsoletePatch") Then
538
         varValues = Array(12, "btnUnobsoletePatch", null,_
539
                           """javascript:;""",_
5590 dpurdie 540
                           """onClick=""""MM_openVixIFrame('_wform_obsolete_patch.asp?action=true&unobsolete=true&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','UnObsolete Patch');""""""",_
127 ghuddy 541
                           "images/abtn_unobsolete_patch.gif",_
542
                           null,_
543
                           "Undo patch obsolete.",_
544
                           "Y",_
545
                           "Y",_
4083 dpurdie 546
                           "N",_
127 ghuddy 547
                           "N")
548
         rsQry.AddNew varFields, varValues
549
      End If
550
 
551
      If isAbtnRequired(aAbtnList, "btnApprovePackage") Then
552
         varValues = Array(13, "btnApprovePackage", null,_
553
                           """_make_approved.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
5190 dpurdie 554
                           """vixConfirm('Approve this package for auto-build.',{title:'Approve Package', button:'Approve', url: 'HREF'});""""""",_
3959 dpurdie 555
                           "icons/i_submit_build.gif",_
556
                           "icons/i_submit_build_off.gif",_
127 ghuddy 557
                           "Make this package released for automated build.",_
558
                           "Y",_
559
                           "Y",_
4083 dpurdie 560
                           "N",_
127 ghuddy 561
                           "N")
562
         rsQry.AddNew varFields, varValues
563
      End If
564
 
565
      If isAbtnRequired(aAbtnList, "btnNewRelease") Then
566
         varValues = Array(14, "btnNewRelease", null,_
567
                           """javascript:go_submit( document.FormName, """"btnNewRelease"""" );""",_
568
                           null,_
569
                           "images/abtn_new_release.gif",_
570
                           "images/abtn_new_release_off.gif",_
571
                           "Create new release...",_
572
                           "Y",_
573
                           "Y",_
4083 dpurdie 574
                           "N",_
127 ghuddy 575
                           "N")
576
         rsQry.AddNew varFields, varValues
577
      End If
578
 
579
      If isAbtnRequired(aAbtnList, "btnEditRelease") Then
580
         varValues = Array(15, "btnEditRelease", null,_
581
                           """javascript:go_submit( document.FormName, """"btnEditRelease"""" );""",_
582
                           null,_
583
                           "images/abtn_edit.gif",_
584
                           "images/abtn_edit_off.gif",_
585
                           "Edit selected release details...",_
586
                           "Y",_
587
                           "Y",_
4083 dpurdie 588
                           "N",_
127 ghuddy 589
                           "N")
590
         rsQry.AddNew varFields, varValues
591
      End If
592
 
593
      If isAbtnRequired(aAbtnList, "btnMergeManager") Then
594
         varValues = Array(17, "btnMergeManager", null,_
595
                           """javascript:go_submit( document.FormName, """"btnMergeManager"""" );""",_
596
                           null,_
597
                           "images/abtn_merge_manager.gif",_
598
                           "images/abtn_merge_manager_off.gif",_
5177 dpurdie 599
                           "Run merge manager...",_
127 ghuddy 600
                           "Y",_
601
                           "Y",_
4083 dpurdie 602
                           "N",_
127 ghuddy 603
                           "N")
604
         rsQry.AddNew varFields, varValues
605
      End If
606
 
607
      If isAbtnRequired(aAbtnList, "btnMoveRelease") Then
608
         varValues = Array(18, "btnMoveRelease", null,_
609
                           """javascript:go_submit( document.FormName, """"btnMoveRelease"""" );""",_
610
                           null,_
611
                           "images/abtn_move_release.gif",_
612
                           "images/abtn_move_release_off.gif",_
613
                           "Move selected release vertically...",_
614
                           "Y",_
615
                           "Y",_
4083 dpurdie 616
                           "N",_
127 ghuddy 617
                           "N")
618
         rsQry.AddNew varFields, varValues
619
      End If
620
 
5590 dpurdie 621
      ' NOTE: entries 19 and 20 were not used
622
      '       Index numbers can be reused
127 ghuddy 623
 
624
      If isAbtnRequired(aAbtnList, "btnNewVersion-MASSREF") Then
625
         varValues = Array(21, "btnNewVersion-MASSREF", null,_
626
                           """form_new_version.asp?rtag_id=""& AssocMASSREFValue &""&pv_id=""& Request(""pv_id"")",_
627
                           null,_
628
                           "images/abtn_new_version_MassRef.gif",_
629
                           null,_
630
                           "Create new version of this package in associated MASS REF.",_
631
                           "Y",_
632
                           "Y",_
4083 dpurdie 633
                           "N",_
127 ghuddy 634
                           "N")
635
         rsQry.AddNew varFields, varValues
636
      End If
637
 
638
      If isAbtnRequired(aAbtnList, "btnRecycleBin") Then
639
         varValues = Array(22, "btnRecycleBin", null,_
640
                           """_destroy_package.asp?pv_id=""& pkgInfoHash.Item(""pv_id"") &""&bfile=""& ScriptName &""&pkg_id=""& parPkgId &""&listby=""& parListBy &""""",_
5190 dpurdie 641
                           """vixConfirm('You are about to destroy ""& pkgInfoHash.Item (""pkg_name"") &"" ""& pkgInfoHash.Item (""pkg_version"") &"".<p>You cannot undo this operation.',{title:'Destroy Package Version', button:'Destroy', url: 'HREF'});""""""",_
127 ghuddy 642
                           "icons/i_destroy_package.gif",_
643
                           "i_destroy_package_off",_
644
                           null,_
645
                           "Y",_
646
                           "Y",_
4083 dpurdie 647
                           "N",_
127 ghuddy 648
                           "N")
649
         rsQry.AddNew varFields, varValues
650
      End If
651
 
652
      If isAbtnRequired(aAbtnList, "btnDeprecation") Then
653
         varValues = Array(23, "btnDeprecation", null,_
654
                           """javascript:;""",_
5590 dpurdie 655
                           """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.'""",_
127 ghuddy 656
                           "images/BombBorder.gif",_
5169 dpurdie 657
                           "images/BombBorder_off.gif",_
127 ghuddy 658
                           "Deprecate this package in this release.",_
659
                           "Y",_
660
                           "Y",_
4083 dpurdie 661
                           "N",_
127 ghuddy 662
                           "N")
663
         rsQry.AddNew varFields, varValues
664
      End If
665
 
666
      If isAbtnRequired(aAbtnList, "btnUnDeprecation") Then
667
         varValues = Array(24, "btnUnDeprecation", null,_
5190 dpurdie 668
                           """_wform_undeprecate_package.asp?rfile=""& scriptName &""&pkg_id=""& pkgInfoHash.Item(""pkg_id"") &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id &""""",_
669
                           """vixConfirm('You are about to undeprecate package: ""& pkgInfoHash.Item (""pkg_name"") &"".',{title:'Undeprecate Package', url: 'HREF'});""""""",_
127 ghuddy 670
                           "images/BombBorder.gif",_
671
                           null,_
5190 dpurdie 672
                           "Un Deprecate this package in this release",_
127 ghuddy 673
                           "Y",_
674
                           "Y",_
4083 dpurdie 675
                           "N",_
127 ghuddy 676
                           "N")
677
         rsQry.AddNew varFields, varValues
678
      End If
679
 
680
      If isAbtnRequired(aAbtnList, "btnAdminView") Then
681
         varValues = Array(25, "btnAdminView", null,_
682
                           """javascript:go_submit( document.FormName, """"btnAdminView"""" );""",_
683
                           null,_
684
                           "images/view_admin.gif",_
685
                           null,_
686
                           "Administer the views in the project.",_
687
                           "Y",_
688
                           "Y",_
4083 dpurdie 689
                           "N",_
127 ghuddy 690
                           "N")
691
         rsQry.AddNew varFields, varValues
692
      End If
693
 
694
      ' NOTE: I do not think this one is ever used
695
      If isAbtnRequired(aAbtnList, "btnAddProc") Then
696
         varValues = Array(26, "btnAddProc", "Add Process",_
697
                           """javascript:;""",_
5590 dpurdie 698
                           """onClick=""""MM_openVixIFrame('wAddProc.asp?rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Add Process');""""""",_
127 ghuddy 699
                           "icons/btn_add.gif",_
700
                           null,_
701
                           null,_
702
                           "Y",_
703
                           "Y",_
4083 dpurdie 704
                           "N",_
127 ghuddy 705
                           "N")
706
         rsQry.AddNew varFields, varValues
707
      End If
708
 
709
      If isAbtnRequired(aAbtnList, "btnEditGBE_Machtype") Then
710
         varValues = Array(27, "btnEditGBE_Machtype", null,_
711
                           """javascript:;""",_
5590 dpurdie 712
                           """onClick=""""MM_openVixIFrame('wAddMachtype.asp?type=edit&gbe_id=""& gbe_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Machine Type');""""""",_
127 ghuddy 713
                           "icons/i_edit.gif",_
5814 dpurdie 714
                           null,_
127 ghuddy 715
                           "Edit this GBE MachType value",_
716
                           "Y",_
717
                           "Y",_
4083 dpurdie 718
                           "N",_
127 ghuddy 719
                           "N")
720
         rsQry.AddNew varFields, varValues
721
      End If
722
 
723
      If isAbtnRequired(aAbtnList, "btnDeleteGBE_Machtype") Then
724
         varValues = Array(28, "btnDeleteGBE_Machtype", null,_
725
                           """_DeleteMachtype.asp?rfile=""& SCRIPT_NAME &""&gbe_id=""& gbe_id &""&""& objPMod.ComposeURL()",_
5190 dpurdie 726
                           """vixConfirm('Remove \'""& GBE_VALUE &""\' from this list?',{title:'Remove GBE_MACHTYPE', button:'Remove', url: 'HREF'});""""""",_
127 ghuddy 727
                           "icons/i_remove.gif",_
728
                           null,_
729
                           "Delete this GBE MachType value",_
730
                           "Y",_
731
                           "Y",_
4083 dpurdie 732
                           "N",_
127 ghuddy 733
                           "N")
734
         rsQry.AddNew varFields, varValues
735
      End If
736
 
737
      If isAbtnRequired(aAbtnList, "btnEditDaemon") Then
738
         varValues = Array(29, "btnEditDaemon", null,_
739
                           """javascript:;""",_
5590 dpurdie 740
                           """onClick=""""MM_openVixIFrame('wAddDaemon.asp?type=edit&rcon_id=""& rcon_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Build Daemon');""""""",_
127 ghuddy 741
                           "icons/i_edit.gif",_
742
                           "icons/i_edit_off.gif",_
4295 dpurdie 743
                           "Edit Build Configuration",_
127 ghuddy 744
                           "Y",_
745
                           "Y",_
4083 dpurdie 746
                           "N",_
127 ghuddy 747
                           "N")
748
         rsQry.AddNew varFields, varValues
749
      End If
750
 
751
      If isAbtnRequired(aAbtnList, "btnDeleteDaemon") Then
752
         varValues = Array(30, "btnDeleteDaemon", null,_
4293 dpurdie 753
                           """_DeleteDaemon.asp?rcon_id=""& rcon_id & ""&action=Delete&"" & objPMod.ComposeURL()",_
5190 dpurdie 754
                           """vixConfirm('Delete the \'""& Daemon &""\' Daemon and associated information from this Release?',{title:'Remove Deamon', button:'Remove', url: 'HREF'});""""""",_
4295 dpurdie 755
                           "icons/i_remove.gif",_
4293 dpurdie 756
                           null,_
4295 dpurdie 757
                           "Delete Daemon",_
4293 dpurdie 758
                           "Y",_
759
                           "Y",_
760
                           "N",_
761
                           "N")
762
         rsQry.AddNew varFields, varValues
763
      End If
764
 
765
      If isAbtnRequired(aAbtnList, "btnRemoveDaemon") Then
766
         varValues = Array(47, "btnRemoveDaemon", null,_
767
                           """_DeleteDaemon.asp?rcon_id=""& rcon_id & ""&action=Remove&""& objPMod.ComposeURL()",_
5190 dpurdie 768
                           """vixConfirm('Unlink the \'""& Daemon &""\' Daemon from this Release.<p>Configuration information will be maintained.',{title:'Unlink Deamon', button:'Unlink', url: 'HREF'});""""""",_
4295 dpurdie 769
                           "icons/break_link.gif",_
127 ghuddy 770
                           null,_
4295 dpurdie 771
                           "Unlink Daemon from entry",_
127 ghuddy 772
                           "Y",_
773
                           "Y",_
4083 dpurdie 774
                           "N",_
127 ghuddy 775
                           "N")
776
         rsQry.AddNew varFields, varValues
777
      End If
778
 
161 iaugusti 779
      If isAbtnRequired(aAbtnList, "btnEditBuildMachine") Then
780
         varValues = Array(29, "btnEditBuildMachine", null,_
781
                           """javascript:;""",_
5590 dpurdie 782
                           """onClick=""""MM_openVixIFrame('wAddBuildMachine.asp?type=edit&bmcon_id=""& bmcon_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Build Machine');""""""",_
161 iaugusti 783
                           "icons/i_edit.gif",_
784
                           "icons/i_edit_off.gif",_
785
                           "Edit Build Machine",_
786
                           "Y",_
787
                           "Y",_
4083 dpurdie 788
                           "N",_
161 iaugusti 789
                           "N")
790
         rsQry.AddNew varFields, varValues
791
      End If
792
 
793
      If isAbtnRequired(aAbtnList, "btnDeleteBuildMachine") Then
794
         varValues = Array(30, "btnDeleteBuildMachine", null,_
795
                           """_DeleteBuildMachine.asp?rfile=""& SCRIPT_NAME &""&bmcon_id=""& bmcon_id &""&""& objPMod.ComposeURL()",_
5190 dpurdie 796
                           """vixConfirm('Remove Build Machine \'""& machine_hostname &""\' from this list?',{title:'Delete Build Machine', button:'Delete', url: 'HREF'});""""""",_
161 iaugusti 797
                           "icons/i_remove.gif",_
798
                           null,_
799
                           "Delete Build Machine",_
800
                           "Y",_
801
                           "Y",_
4083 dpurdie 802
                           "N",_
161 iaugusti 803
                           "N")
804
         rsQry.AddNew varFields, varValues
805
      End If
806
 
127 ghuddy 807
      If isAbtnRequired(aAbtnList, "btnPendingIntegration") Then
808
         varValues = Array(32, "btnPendingIntegration", null,_
809
                           """_modify_product_state.asp?state_id=1&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
5190 dpurdie 810
                           """vixConfirm('Do you want to proceed to make this product pending for INTEGRATION?',{title:'Make Pending', button:'Pending', url: 'HREF'});""""""",_
127 ghuddy 811
                           "icons/PendingIntegration.gif",_
812
                           null,_
813
                           "Make this product pending for Integration.",_
814
                           "Y",_
815
                           "Y",_
4083 dpurdie 816
                           "N",_
127 ghuddy 817
                           "N")
818
         rsQry.AddNew varFields, varValues
819
      End If
820
 
821
      If isAbtnRequired(aAbtnList, "btnPendingTest") Then
822
         varValues = Array(33, "btnPendingTest", null,_
823
                           """_modify_product_state.asp?state_id=2&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
5190 dpurdie 824
                           """vixConfirm('Do you want to proceed to make this product pending for Test?',{title:'Make Test', button:'Test', url: 'HREF'});""""""",_
127 ghuddy 825
                           "icons/PendingTest.gif",_
826
                           null,_
827
                           "Make this product pending for Test.",_
828
                           "Y",_
829
                           "Y",_
4083 dpurdie 830
                           "N",_
127 ghuddy 831
                           "N")
832
         rsQry.AddNew varFields, varValues
833
      End If
834
 
835
      If isAbtnRequired(aAbtnList, "btnPendingDeployment") Then
836
         varValues = Array(34, "btnPendingDeployment", null,_
837
                           """_modify_product_state.asp?state_id=3&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
5190 dpurdie 838
                           """vixConfirm('Do you want to proceed to make this product pending for DEPLOYMENT?',{title:'Make Deploy', button:'Deploy', url: 'HREF'});""""""",_
127 ghuddy 839
                           "icons/PendingDeployment.gif",_
840
                           null,_
841
                           "Make this product pending for Deployment.",_
842
                           "Y",_
843
                           "Y",_
4083 dpurdie 844
                           "N",_
127 ghuddy 845
                           "N")
846
         rsQry.AddNew varFields, varValues
847
      End If
848
 
849
      If isAbtnRequired(aAbtnList, "btnRejectProduct") Then
850
         varValues = Array(35, "btnRejectProduct", null,_
851
                           """_modify_product_state.asp?state_id=4&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
5190 dpurdie 852
                           """vixConfirm('Do you want to REJECT this product from DEPLOYMENT?',{title:'Reject Product', button:'Reject', url: 'HREF'});""""""",_
127 ghuddy 853
                           "icons/i_reject_pending.gif",_
854
                           null,_
855
                           "Reject this product from Deployment.",_
856
                           "Y",_
857
                           "Y",_
4083 dpurdie 858
                           "N",_
127 ghuddy 859
                           "N")
860
         rsQry.AddNew varFields, varValues
861
      End If
862
 
863
      If isAbtnRequired(aAbtnList, "btnPendingIntegrateAndDeploy") Then
864
         varValues = Array(36, "btnPendingIntegrateAndDeploy", null,_
865
                           """_modify_product_state.asp?state_id=5&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
5190 dpurdie 866
                           """vixConfirm('Do you want to proceed to make this product pending for INTEGRATION and DEPLOYMENT?',{title:'Pending Product', button:'Confirm', url: 'HREF'});""""""",_
127 ghuddy 867
                           "icons/PendingDeployment.gif",_
868
                           null,_
869
                           "Make this product pending for Integration and Deployment.",_
870
                           "Y",_
871
                           "Y",_
4083 dpurdie 872
                           "N",_
127 ghuddy 873
                           "N")
874
         rsQry.AddNew varFields, varValues
875
      End If
876
 
877
      If isAbtnRequired(aAbtnList, "btnDeleteSchedule") Then
878
         varValues = Array(37, "btnDeleteSchedule", null,_
879
                           """_DeleteSchedule.asp?scheduled_id=""& scheduled_id &""&""& objPMod.ComposeURL()",_
5190 dpurdie 880
                           """vixConfirm('Remove Schedule from this list?',{title:'Remove Schedule', button:'Remove', url: 'HREF'});""""""",_
127 ghuddy 881
                           "icons/i_remove.gif",_
177 brianf 882
                           "icons/i_remove_dis.gif",_
127 ghuddy 883
                           "Delete Schedule",_
884
                           "Y",_
885
                           "Y",_
4083 dpurdie 886
                           "N",_
127 ghuddy 887
                           "N")
888
         rsQry.AddNew varFields, varValues
889
      End If
890
 
891
      If isAbtnRequired(aAbtnList, "btnApproveMerge") Then
892
         varValues = Array(38, "btnApproveMerge", null,_
893
                           """_approve_merge.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
5190 dpurdie 894
                           """vixConfirm('The release will be updated by this merge operation',{title:'Approve Merge', button:'Merge', url: 'HREF'});""""""",_
127 ghuddy 895
                           "icons/i_make_released.gif",_
896
                           "icons/i_make_released_off.gif",_
897
                           "Approve and carry out the pending merge operation",_
898
                           "Y",_
899
                           "Y",_
4083 dpurdie 900
                           "N",_
127 ghuddy 901
                           "N")
902
         rsQry.AddNew varFields, varValues
903
      End If
904
 
143 ghuddy 905
      If isAbtnRequired(aAbtnList, "btnRejectAutobuildPackage") Then
906
         varValues = Array( 39, "btnRejectAutobuildPackage", null,_
907
                           """_make_rejected.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
5190 dpurdie 908
                           """vixConfirm('Rejecting a package already approved for autobuild will set it back to Work-In-Progress',{title:'Reject Package', button:'Reject', url: 'HREF'});""""""",_
143 ghuddy 909
                           "icons/i_reject_pending.gif",_
910
                           "icons/i_reject_pending_off.gif",_
911
                           "Unapprove autobuild, move back to Work-In-Progress.",_
912
                           "Y",_
913
                           "Y",_
4083 dpurdie 914
                           "N",_
143 ghuddy 915
                           "N")
916
         rsQry.AddNew varFields, varValues
917
      End If
918
 
147 ghuddy 919
      If isAbtnRequired(aAbtnList, "btnDeleteDaemonInst") Then
920
         varValues = Array(40, "btnDeleteDaemonInst", null,_
921
                           """_DeleteDaemonInstruction.asp?rfile=""& ScriptName &""&inst_id=""& daemonInstId &""&""& objPMod.ComposeURL()",_
5190 dpurdie 922
                           """vixConfirm('Delete the Daemon Instruction from this list?',{title:'Delete Instruction', button:'Delete', url: 'HREF', width : 350, height : 150});""""""",_
147 ghuddy 923
                           "icons/i_remove.gif",_
924
                           null,_
925
                           "Delete this Daemon Instruction",_
926
                           "Y",_
927
                           "Y",_
4083 dpurdie 928
                           "N",_
147 ghuddy 929
                           "N")
930
         rsQry.AddNew varFields, varValues
931
      End If
932
 
933
      If isAbtnRequired(aAbtnList, "btnEditDaemonInst") Then
934
         varValues = Array(41, "btnEditDaemonInst", null,_
5590 dpurdie 935
                           """javascript:;""",_
936
                           """onClick=""""MM_openVixIFrame('wAddDaemonInstruction.asp?edit=true&inst_id=""& daemonInstId & ""&sort="" & parSortOrder & ""&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Edit Daemon Instruction');""""""",_
147 ghuddy 937
                           "icons/i_edit.gif",_
938
                           "icons/i_edit_off.gif",_
939
                           "Edit this Daemon Instruction",_
940
                           "Y",_
941
                           "Y",_
4083 dpurdie 942
                           "N",_
147 ghuddy 943
                           "N")
944
         rsQry.AddNew varFields, varValues
945
      End If
946
 
947
      If isAbtnRequired(aAbtnList, "btnAddDaemonInstRipplePackage") Then
948
         varValues = Array(42, "btnAddDaemonInstRipplePackage", null,_
5590 dpurdie 949
                           """javascript:;""",_
950
                           """onClick=""""MM_openVixIFrame('wAddDaemonInstructionSimple.asp?op_code=0"" &""&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Ripple or Test Build Package');""""""",_
147 ghuddy 951
                           "images/ripplesquare.gif",_
952
                           "images/ripplesquaregrey.gif",_
953
                           "Request the Build Daemon to ripple this package version",_
954
                           "Y",_
955
                           "Y",_
4083 dpurdie 956
                           "N",_
957
                           "Y")
147 ghuddy 958
         rsQry.AddNew varFields, varValues
959
      End If
960
 
149 ghuddy 961
      If isAbtnRequired(aAbtnList, "btnAddDaemonInstTestBuildPackage") Then
962
         varValues = Array(43, "btnAddDaemonInstTestBuildPackage", null,_
5590 dpurdie 963
                           """javascript:;""",_
964
                           """onClick=""""MM_openVixIFrame('wAddDaemonInstruction.asp?op_code=1"" &""&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Add Daemon Instruction');""""""",_
149 ghuddy 965
                           "images/abtn_test_build.gif",_
966
                           "images/abtn_test_build_off.gif",_
967
                           "Request the Build Daemon to test build this WIP package version",_
968
                           "Y",_
969
                           "Y",_
4083 dpurdie 970
                           "N",_
149 ghuddy 971
                           "N")
972
         rsQry.AddNew varFields, varValues
973
      End If
974
 
157 ghuddy 975
      If isAbtnRequired(aAbtnList, "btnMoveWIPToRelease") Then
976
         varValues = Array( 44, "btnMoveWIPToRelease", null,_
977
                           """javascript:;""",_
5590 dpurdie 978
                           """onClick=""""MM_openVixIFrame('_wform_move_wip.asp"" &""?rfile=""& ScriptName &""&""&  objPMod.ComposeURL() &""','Move WIP');""""""",_
157 ghuddy 979
                           "images/abtn_move_wip_to_release.gif",_
4670 dpurdie 980
                           "images/abtn_move_wip_to_release_off.gif",_
157 ghuddy 981
                           "Move this WIP to another release.",_
982
                           "Y",_
983
                           "Y",_
4083 dpurdie 984
                           "N",_
157 ghuddy 985
                           "N")
986
         rsQry.AddNew varFields, varValues
987
      End If
988
 
183 brianf 989
      If isAbtnRequired(aAbtnList, "btnLockPackage") Then
990
         varValues = Array( 45, "btnLockPackage", null,_
991
                           """_s_lock_package.asp?pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
5190 dpurdie 992
                           """vixConfirm('Lock Package.<p>This will prevent changes to the package.',{title:'Lock Package', button:'Lock', url: 'HREF'});""""""",_
183 brianf 993
                           "icons/i_lock.gif",_
994
                           "icons/i_lock_off.gif",_
995
                           "Lock this package.",_
996
                           "Y",_
997
                           "Y",_
4083 dpurdie 998
                           "N",_
183 brianf 999
                           "N")
1000
         rsQry.AddNew varFields, varValues
1001
      End If
1002
 
1003
      If isAbtnRequired(aAbtnList, "btnUnLockPackage") Then
1004
         varValues = Array( 46, "btnUnLockPackage", null,_
1005
                           """_s_unlock_package.asp?pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
5190 dpurdie 1006
                           """vixConfirm('Unlock Package.<p>This may have serious side effects.',{title:'Unlock Package', button:'Unlock', url: 'HREF'});""""""",_
183 brianf 1007
                           "icons/i_unlock.gif",_
1008
                           "icons/i_unlock_off.gif",_
1009
                           "Unlock this package.",_
1010
                           "Y",_
1011
                           "Y",_
4083 dpurdie 1012
                           "N",_
183 brianf 1013
                           "N")
1014
         rsQry.AddNew varFields, varValues
1015
      End If
1016
 
4293 dpurdie 1017
 
1018
 
3959 dpurdie 1019
      If isAbtnRequired(aAbtnList, "btnEditProjectExtensions") Then
1020
         varValues = Array(29, "btnEditProjectExtensions", null,_
1021
                           """javascript:;""",_
5590 dpurdie 1022
                           """onClick=""""MM_openVixIFrame('wAddProjectExtension.asp?type=edit&ext=""& extName &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Project Extension');""""""",_
3959 dpurdie 1023
                           "icons/i_edit.gif",_
1024
                           "icons/i_edit_off.gif",_
1025
                           "Edit Project Extensions",_
1026
                           "Y",_
1027
                           "Y",_
4083 dpurdie 1028
                           "N",_
3959 dpurdie 1029
                           "N")
1030
         rsQry.AddNew varFields, varValues
1031
      End If
1032
 
1033
      If isAbtnRequired(aAbtnList, "btnDeleteProjectExtension") Then
1034
         varValues = Array(30, "btnDeleteProjectExtension", null,_
1035
                           """_DeleteProjectExtension.asp?rfile=""& SCRIPT_NAME &""&ext=""& extName &""&""& objPMod.ComposeURL()",_
5190 dpurdie 1036
                           """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'});""""""",_
3959 dpurdie 1037
                           "icons/i_remove.gif",_
1038
                           null,_
1039
                           "Delete Project Extension",_
1040
                           "Y",_
1041
                           "Y",_
4083 dpurdie 1042
                           "N",_
3959 dpurdie 1043
                           "N")
1044
         rsQry.AddNew varFields, varValues
1045
      End If
4029 dpurdie 1046
 
1047
      If isAbtnRequired(aAbtnList, "btnEditGBE_Machclass") Then
1048
         varValues = Array(31, "btnEditGBE_Machclass", null,_
1049
                           """javascript:;""",_
5590 dpurdie 1050
                           """onClick=""""MM_openVixIFrame('wAddMachclass.asp?type=edit&bm_id=""& bm_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Machine Class');""""""",_
4029 dpurdie 1051
                           "icons/i_edit.gif",_
1052
                           "icons/i_edit_off.gif",_
1053
                           "Edit this GBE MachClass value",_
1054
                           "Y",_
1055
                           "Y",_
4083 dpurdie 1056
                           "N",_
4029 dpurdie 1057
                           "N")
1058
         rsQry.AddNew varFields, varValues
1059
      End If
1060
 
1061
      If isAbtnRequired(aAbtnList, "btnDeleteGBE_Machclass") Then
1062
         varValues = Array(32, "btnDeleteGBE_Machclass", null,_
4040 dpurdie 1063
                           """wAddMachclass.asp?type=delete&bm_id=""& bm_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL()",_
5190 dpurdie 1064
                           """vixConfirm('Delete the \'""& GBE_VALUE &""\' Machine Class',{title:'Delete Machine Class', button:'Delete', url: 'HREF'});""""""",_
4029 dpurdie 1065
                           "icons/i_remove.gif",_
1066
                           null,_
1067
                           "Delete this GBE MachClass value",_
1068
                           "Y",_
1069
                           "Y",_
4083 dpurdie 1070
                           "N",_
4029 dpurdie 1071
                           "N")
1072
         rsQry.AddNew varFields, varValues
1073
      End If
4670 dpurdie 1074
 
1075
      If isAbtnRequired(aAbtnList, "btnDestroyWip") Then
1076
         varValues = Array(32, "btnDestroyWip", null,_
1077
                           """_destroy_package.asp?pkg_id="& pkgInfoHash.Item("pkg_id") &"&bfile=""& ScriptName &""&""& objPMod.ComposeURL()",_
5190 dpurdie 1078
                           """vixConfirm('Destroy this WIP for \'""& pkgInfoHash.Item(""pkg_name"") &""\'.<p>You cannot undo this operation.',{title : 'Destroy WIP', button:'Destroy', url: 'HREF'});""""""",_
4670 dpurdie 1079
                           "icons/i_destroy_package.gif",_
1080
                           "icons/i_destroy_package_off.gif",_
1081
                           "Destroy this WIP.",_
1082
                           "Y",_
1083
                           "Y",_
1084
                           "N",_
1085
                           "Y")
1086
         rsQry.AddNew varFields, varValues
1087
      End If
1088
 
3959 dpurdie 1089
 
5122 dpurdie 1090
      If isAbtnRequired(aAbtnList, "btnEditGBE_BuildStandard") Then
1091
         varValues = Array(48, "btnEditGBE_BuildStandard", null,_
1092
                           """javascript:;""",_
5590 dpurdie 1093
                           """onClick=""""MM_openVixIFrame('wAddBuildStandard.asp?type=edit&bsa_id=""& bsa_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Build Standard');""""""",_
5122 dpurdie 1094
                           "icons/i_edit.gif",_
1095
                           "icons/i_edit_off.gif",_
1096
                           "Edit this Build Standard",_
1097
                           "Y",_
1098
                           "Y",_
1099
                           "N",_
1100
                           "N")
1101
         rsQry.AddNew varFields, varValues
1102
      End If
1103
 
1104
      If isAbtnRequired(aAbtnList, "btnDeleteGBE_BuildStandard") Then
1105
         varValues = Array(49, "btnDeleteGBE_BuildStandard", null,_
1106
                           """_DeleteBuildStandard.asp?rfile=""& SCRIPT_NAME &""&bsa_id=""& bsa_id &""&""& objPMod.ComposeURL()",_
5190 dpurdie 1107
                           """vixConfirm('Delete the \'""& GBE_VALUE &""\' Build Standard',{title : 'Delete Build Standard', button:'Delete', url: 'HREF'});""""""",_
5122 dpurdie 1108
                           "icons/i_remove.gif",_
1109
                           null,_
1110
                           "Delete this Build Standard",_
1111
                           "Y",_
1112
                           "Y",_
1113
                           "N",_
1114
                           "N")
1115
         rsQry.AddNew varFields, varValues
1116
      End If
4029 dpurdie 1117
 
3959 dpurdie 1118
 
127 ghuddy 1119
      ' Move cursor to the first record
1120
      rsQry.MoveFirst
1121
 
1122
      If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
1123
         Call LoadButtons ( rsQry.GetRows() )
1124
      End If
1125
 
1126
      rsQry.Close
1127
      Set rsQry = Nothing
1128
   End Sub
1129
   '-----------------------------------------------------------------------------------------------------------------
1130
   Public Sub LoadButtons ( aRows )
1131
      Dim nProperty, newArrayDim, LastRow, rowNum
1132
 
1133
      LastRow = UBound( aRows, 2 )
1134
 
1135
      For rowNum = 0 To LastRow
1136
         ' Increase array by 1
1137
         newArrayDim = LastRowInx() + 1
1138
         ReDim Preserve mArrAbtnDef( mNumOfProperties, newArrayDim )
1139
 
1140
 
1141
         mobjNameDefMap.Item ( Cstr( aRows ( InxName, rowNum ) ) ) = newArrayDim
1142
 
1143
         For nProperty = 0 To mLastPropertyInx
1144
            mArrAbtnDef ( nProperty, newArrayDim ) = aRows ( nProperty, rowNum )
1145
 
1146
         Next
1147
 
1148
      Next
1149
 
1150
   End Sub
1151
   '-----------------------------------------------------------------------------------------------------------------
1152
   Private Function LastRowInx ()
1153
       LastRowInx = UBound ( mArrAbtnDef, 2 )
1154
   End Function
1155
   '-----------------------------------------------------------------------------------------------------------------
1156
   Public Sub AddSeparatorAfter ( sItemName, sSeparatorWidth )
1157
      If InStr( sItemName, " " ) > 0 Then   Err.Raise 8, "Method AddSeparatorAfter", "Item Name '"& sItemName &"' cannot have spaces."
1158
      mobjSeparator.Add (Cstr(sItemName)), CStr(sSeparatorWidth)
1159
   End Sub
1160
   '-----------------------------------------------------------------------------------------------------------------
1161
   Public Sub AddSeparator ( sSeparatorWidth )
1162
      mobjSeparator.Add ( Cstr(mArrAbtnDef(InxName, LastItemInx())) ), CStr(sSeparatorWidth)
1163
   End Sub
1164
   '-----------------------------------------------------------------------------------------------------------------
1165
   Private Sub SetItemDefaults ( sItemName )
1166
      ' Additional default setup
1167
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxActive, enumDB_YES )         ' Default Active = enumDB_YES
1168
   End Sub
1169
   '-----------------------------------------------------------------------------------------------------------------
1170
   Public Sub Text ( sItemName, Value )
1171
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxTxt, Value )
1172
   End Sub
1173
   '-----------------------------------------------------------------------------------------------------------------
1174
   Public Sub ItemID ( sItemName, Value )
1175
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxID, Value )
1176
   End Sub
1177
   '-----------------------------------------------------------------------------------------------------------------
1178
   Public Sub Image ( sItemName, Value )
1179
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImg, Value )
1180
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImgOff, Value )         ' Default image disable to be the same as image
1181
   End Sub
1182
   '-----------------------------------------------------------------------------------------------------------------
1183
   Public Sub ImageOff ( sItemName, Value )
1184
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImgOff, Value )
1185
   End Sub
1186
   '-----------------------------------------------------------------------------------------------------------------
1187
   Public Sub Link ( sItemName, Value )
1188
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxLink, Value )
1189
   End Sub
1190
   '-----------------------------------------------------------------------------------------------------------------
1191
   Public Sub EventHandler ( sItemName, Value )
1192
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxEventHandler, Value )
1193
   End Sub
1194
   '-----------------------------------------------------------------------------------------------------------------
1195
   Public Sub Hint ( sItemName, Value )
1196
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxHint, Value )
1197
   End Sub
1198
   '-----------------------------------------------------------------------------------------------------------------
1199
   Public Sub Visible ( sItemName, Value )
1200
      'Response.write sItemName &"here"& mobjNameDefMap.Item (Cstr(sItemName))
1201
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxVisible, Value )
1202
   End Sub
1203
   '-----------------------------------------------------------------------------------------------------------------
143 ghuddy 1204
   Public Function IsVisible ( sItemName )
1205
      'Response.write sItemName &"here"& mobjNameDefMap.Item (Cstr(sItemName))
1206
      IsVisible = GetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxVisible )
1207
   End Function
1208
   '-----------------------------------------------------------------------------------------------------------------
127 ghuddy 1209
   Public Sub Active ( sItemName, Value )
1210
      'Response.write sItemName &"here"& mobjNameDefMap.Item (Cstr(sItemName))
1211
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxActive, Value )
1212
   End Sub
1213
   '-----------------------------------------------------------------------------------------------------------------
143 ghuddy 1214
   Public Function IsActive ( sItemName )
1215
      IsActive = GetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxActive )
1216
   End Function
1217
   '-----------------------------------------------------------------------------------------------------------------
127 ghuddy 1218
   Private Sub Class_Initialize()
1219
      '// Perform action on creation of object. e.g. Set myObj = New ThisClassName
1220
      Set mobjNameDefMap = CreateObject("Scripting.Dictionary")
1221
      Set mobjIdDefMap = CreateObject("Scripting.Dictionary")
1222
      Set mobjSeparator = CreateObject("Scripting.Dictionary")
1223
      Set mobjACActionsMap = CreateObject("Scripting.Dictionary")
1224
 
1225
      'mbIsReadonly = FALSE   ' Tell control that it should use only readonly action buttons (i.e. actions which will not alter database )
1226
      mReadonlyActionBehaviour = enumABTNCTRL_ON_READONLY_HIDE      ' Tell control what to do by default if mbIsReadonly = TRUE
1227
 
1228
      mnButtonSpacer = 0
1229
      mnImageHspace = 4
1230
 
4083 dpurdie 1231
      mNumOfProperties = 12     ' Number of properties in array which define one menu item.
127 ghuddy 1232
      mLastPropertyInx = mNumOfProperties - 1
1233
 
1234
      mbDisableAll = FALSE
1235
 
1236
      ReDim mArrAbtnDef ( mNumOfProperties, -1 )
4083 dpurdie 1237
      InxID                 = 0
127 ghuddy 1238
      InxName               = 1
4083 dpurdie 1239
      InxTxt                = 2
127 ghuddy 1240
      InxLink               = 3
4083 dpurdie 1241
      InxEventHandler       = 4
1242
      InxImg                = 5
1243
      InxImgOff             = 6
127 ghuddy 1244
      InxHint               = 7
1245
      InxVisible            = 8
4083 dpurdie 1246
      InxActive             = 9
1247
      InxIsReadonlyAction   = 10
1248
      InxHideOnClosed       = 11
127 ghuddy 1249
 
1250
   End Sub
1251
   '-----------------------------------------------------------------------------------------------------------------
1252
   Private Sub Class_Terminate()
1253
      '// Perform action on object disposal. e.g. Set myObj = Nothing
1254
      Set mobjNameDefMap = Nothing
1255
      Set mobjIdDefMap = Nothing
1256
      Set mobjSeparator = Nothing
1257
      Set mobjACActionsMap = Nothing
1258
 
1259
 
1260
   End Sub
1261
   '-----------------------------------------------------------------------------------------------------------------
119 ghuddy 1262
End Class
127 ghuddy 1263
%>