Subversion Repositories DevTools

Rev

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