Subversion Repositories DevTools

Rev

Details | 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>"&_
184
            "<img src='"& mArrAbtnDef( InxImgOff, itemInx ) &"' hspace='"& mnImageHspace &"' border='0' align='absmiddle'>"&_
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:;""",_
157 ghuddy 475
                           """onClick=""""MM_openBrWindow('_wform_change_group.asp?""& objPMod.ComposeURL() &""','MovePackage','resizable=yes,width=600,height=200');""""""",_
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:;""",_
4199 dpurdie 489
                           """onClick=""""MM_openBrWindow('_wform_rename_version.asp?renameMode=1&rfile=""& ScriptName & objPMod.ComposeURLWithout(""rfile"") &""','ReversionPackage','resizable=yes,width=650,height=450');""""""",_
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:;""",_
517
                           """onClick=""""MM_openBrWindow('_wform_obsolete_patch.asp?rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','ObsoletePatch','resizable=yes,width=400,height=250');""""""",_
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:;""",_
531
                           """onClick=""""MM_openBrWindow('_wform_obsolete_patch.asp?action=true&unobsolete=true&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','ObsoletePatch','resizable=yes,width=400,height=250');""""""",_
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
 
612
      ' NOTE: I do not think this one is ever used
613
      If isAbtnRequired(aAbtnList, "btnPreviousVersions") Then
614
         varValues = Array(19, "btnPreviousVersions", null,_
615
                           """javascript:;""",_
616
                           """onClick=""""MM_openBrWindow('_wform_previous_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 &""','Previous Versions','resizable=yes,width=850,height='+ ( screen.height - 100 )  );""""""",_
617
                           "images/abtn_version_history.gif",_
618
                           null,_
619
                           null,_
620
                           "Y",_
621
                           "Y",_
4083 dpurdie 622
                           "Y",_
623
                           "N")
127 ghuddy 624
         rsQry.AddNew varFields, varValues
625
      End If
626
 
627
      ' NOTE: I do not think this one is ever used
628
      If isAbtnRequired(aAbtnList, "btnObsoleteAll") Then
629
         varValues = Array(20, "btnObsoleteAll", null,_
630
                           """javascript:go_submit( document.FormName, """"btnObsoleteAll"""" );ShowProgress();""",_
631
                           null,_
632
                           null,_
633
                           null,_
634
                           null,_
635
                           "Y",_
636
                           "Y",_
4083 dpurdie 637
                           "Y",_
638
                           "N")
127 ghuddy 639
         rsQry.AddNew varFields, varValues
640
      End If
641
 
642
      If isAbtnRequired(aAbtnList, "btnNewVersion-MASSREF") Then
643
         varValues = Array(21, "btnNewVersion-MASSREF", null,_
644
                           """form_new_version.asp?rtag_id=""& AssocMASSREFValue &""&pv_id=""& Request(""pv_id"")",_
645
                           null,_
646
                           "images/abtn_new_version_MassRef.gif",_
647
                           null,_
648
                           "Create new version of this package in associated MASS REF.",_
649
                           "Y",_
650
                           "Y",_
4083 dpurdie 651
                           "N",_
127 ghuddy 652
                           "N")
653
         rsQry.AddNew varFields, varValues
654
      End If
655
 
656
      If isAbtnRequired(aAbtnList, "btnRecycleBin") Then
657
         varValues = Array(22, "btnRecycleBin", null,_
658
                           """_destroy_package.asp?pv_id=""& pkgInfoHash.Item(""pv_id"") &""&bfile=""& ScriptName &""&pkg_id=""& parPkgId &""&listby=""& parListBy &""""",_
5190 dpurdie 659
                           """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 660
                           "icons/i_destroy_package.gif",_
661
                           "i_destroy_package_off",_
662
                           null,_
663
                           "Y",_
664
                           "Y",_
4083 dpurdie 665
                           "N",_
127 ghuddy 666
                           "N")
667
         rsQry.AddNew varFields, varValues
668
      End If
669
 
670
      If isAbtnRequired(aAbtnList, "btnDeprecation") Then
671
         varValues = Array(23, "btnDeprecation", null,_
672
                           """javascript:;""",_
673
                           """onClick='MM_openBrWindow(""""_wform_deprecate_package.asp?rfile=""& scriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id &"""""",""""DeprecatePackage"""",""""resizable=yes,width=600,height=300"""")' class='body_txt' title='Deprecate the package.'""",_
674
                           "images/BombBorder.gif",_
5169 dpurdie 675
                           "images/BombBorder_off.gif",_
127 ghuddy 676
                           "Deprecate this package in this release.",_
677
                           "Y",_
678
                           "Y",_
4083 dpurdie 679
                           "N",_
127 ghuddy 680
                           "N")
681
         rsQry.AddNew varFields, varValues
682
      End If
683
 
684
      If isAbtnRequired(aAbtnList, "btnUnDeprecation") Then
685
         varValues = Array(24, "btnUnDeprecation", null,_
5190 dpurdie 686
                           """_wform_undeprecate_package.asp?rfile=""& scriptName &""&pkg_id=""& pkgInfoHash.Item(""pkg_id"") &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id &""""",_
687
                           """vixConfirm('You are about to undeprecate package: ""& pkgInfoHash.Item (""pkg_name"") &"".',{title:'Undeprecate Package', url: 'HREF'});""""""",_
127 ghuddy 688
                           "images/BombBorder.gif",_
689
                           null,_
5190 dpurdie 690
                           "Un Deprecate this package in this release",_
127 ghuddy 691
                           "Y",_
692
                           "Y",_
4083 dpurdie 693
                           "N",_
127 ghuddy 694
                           "N")
695
         rsQry.AddNew varFields, varValues
696
      End If
697
 
698
      If isAbtnRequired(aAbtnList, "btnAdminView") Then
699
         varValues = Array(25, "btnAdminView", null,_
700
                           """javascript:go_submit( document.FormName, """"btnAdminView"""" );""",_
701
                           null,_
702
                           "images/view_admin.gif",_
703
                           null,_
704
                           "Administer the views in the project.",_
705
                           "Y",_
706
                           "Y",_
4083 dpurdie 707
                           "N",_
127 ghuddy 708
                           "N")
709
         rsQry.AddNew varFields, varValues
710
      End If
711
 
712
      ' NOTE: I do not think this one is ever used
713
      If isAbtnRequired(aAbtnList, "btnAddProc") Then
714
         varValues = Array(26, "btnAddProc", "Add Process",_
715
                           """javascript:;""",_
716
                           """onClick=""""MM_openBrWindow('wAddProc.asp?rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','AddProd','scrollbars=yes,resizable=yes,width=800,height=500');""""""",_
717
                           "icons/btn_add.gif",_
718
                           null,_
719
                           null,_
720
                           "Y",_
721
                           "Y",_
4083 dpurdie 722
                           "N",_
127 ghuddy 723
                           "N")
724
         rsQry.AddNew varFields, varValues
725
      End If
726
 
727
      If isAbtnRequired(aAbtnList, "btnEditGBE_Machtype") Then
728
         varValues = Array(27, "btnEditGBE_Machtype", null,_
729
                           """javascript:;""",_
730
                           """onClick=""""MM_openBrWindow('wAddMachtype.asp?type=edit&gbe_id=""& gbe_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','EditProd','scrollbars=yes,resizable=yes,width=600,height=220');""""""",_
731
                           "icons/i_edit.gif",_
732
                           "icons/i_edit_off.gif",_
733
                           "Edit this GBE MachType value",_
734
                           "Y",_
735
                           "Y",_
4083 dpurdie 736
                           "N",_
127 ghuddy 737
                           "N")
738
         rsQry.AddNew varFields, varValues
739
      End If
740
 
741
      If isAbtnRequired(aAbtnList, "btnDeleteGBE_Machtype") Then
742
         varValues = Array(28, "btnDeleteGBE_Machtype", null,_
743
                           """_DeleteMachtype.asp?rfile=""& SCRIPT_NAME &""&gbe_id=""& gbe_id &""&""& objPMod.ComposeURL()",_
5190 dpurdie 744
                           """vixConfirm('Remove \'""& GBE_VALUE &""\' from this list?',{title:'Remove GBE_MACHTYPE', button:'Remove', url: 'HREF'});""""""",_
127 ghuddy 745
                           "icons/i_remove.gif",_
746
                           null,_
747
                           "Delete this GBE MachType value",_
748
                           "Y",_
749
                           "Y",_
4083 dpurdie 750
                           "N",_
127 ghuddy 751
                           "N")
752
         rsQry.AddNew varFields, varValues
753
      End If
754
 
755
      If isAbtnRequired(aAbtnList, "btnEditDaemon") Then
756
         varValues = Array(29, "btnEditDaemon", null,_
757
                           """javascript:;""",_
161 iaugusti 758
                           """onClick=""""MM_openBrWindow('wAddDaemon.asp?type=edit&rcon_id=""& rcon_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','EditProd','scrollbars=yes,resizable=yes,width=860,height=240');""""""",_
127 ghuddy 759
                           "icons/i_edit.gif",_
760
                           "icons/i_edit_off.gif",_
4295 dpurdie 761
                           "Edit Build Configuration",_
127 ghuddy 762
                           "Y",_
763
                           "Y",_
4083 dpurdie 764
                           "N",_
127 ghuddy 765
                           "N")
766
         rsQry.AddNew varFields, varValues
767
      End If
768
 
769
      If isAbtnRequired(aAbtnList, "btnDeleteDaemon") Then
770
         varValues = Array(30, "btnDeleteDaemon", null,_
4293 dpurdie 771
                           """_DeleteDaemon.asp?rcon_id=""& rcon_id & ""&action=Delete&"" & objPMod.ComposeURL()",_
5190 dpurdie 772
                           """vixConfirm('Delete the \'""& Daemon &""\' Daemon and associated information from this Release?',{title:'Remove Deamon', button:'Remove', url: 'HREF'});""""""",_
4295 dpurdie 773
                           "icons/i_remove.gif",_
4293 dpurdie 774
                           null,_
4295 dpurdie 775
                           "Delete Daemon",_
4293 dpurdie 776
                           "Y",_
777
                           "Y",_
778
                           "N",_
779
                           "N")
780
         rsQry.AddNew varFields, varValues
781
      End If
782
 
783
      If isAbtnRequired(aAbtnList, "btnRemoveDaemon") Then
784
         varValues = Array(47, "btnRemoveDaemon", null,_
785
                           """_DeleteDaemon.asp?rcon_id=""& rcon_id & ""&action=Remove&""& objPMod.ComposeURL()",_
5190 dpurdie 786
                           """vixConfirm('Unlink the \'""& Daemon &""\' Daemon from this Release.<p>Configuration information will be maintained.',{title:'Unlink Deamon', button:'Unlink', url: 'HREF'});""""""",_
4295 dpurdie 787
                           "icons/break_link.gif",_
127 ghuddy 788
                           null,_
4295 dpurdie 789
                           "Unlink Daemon from entry",_
127 ghuddy 790
                           "Y",_
791
                           "Y",_
4083 dpurdie 792
                           "N",_
127 ghuddy 793
                           "N")
794
         rsQry.AddNew varFields, varValues
795
      End If
796
 
161 iaugusti 797
      If isAbtnRequired(aAbtnList, "btnEditBuildMachine") Then
798
         varValues = Array(29, "btnEditBuildMachine", null,_
799
                           """javascript:;""",_
800
                           """onClick=""""MM_openBrWindow('wAddBuildMachine.asp?type=edit&bmcon_id=""& bmcon_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','EditProd','scrollbars=yes,resizable=yes,width=600,height=330');""""""",_
801
                           "icons/i_edit.gif",_
802
                           "icons/i_edit_off.gif",_
803
                           "Edit Build Machine",_
804
                           "Y",_
805
                           "Y",_
4083 dpurdie 806
                           "N",_
161 iaugusti 807
                           "N")
808
         rsQry.AddNew varFields, varValues
809
      End If
810
 
811
      If isAbtnRequired(aAbtnList, "btnDeleteBuildMachine") Then
812
         varValues = Array(30, "btnDeleteBuildMachine", null,_
813
                           """_DeleteBuildMachine.asp?rfile=""& SCRIPT_NAME &""&bmcon_id=""& bmcon_id &""&""& objPMod.ComposeURL()",_
5190 dpurdie 814
                           """vixConfirm('Remove Build Machine \'""& machine_hostname &""\' from this list?',{title:'Delete Build Machine', button:'Delete', url: 'HREF'});""""""",_
161 iaugusti 815
                           "icons/i_remove.gif",_
816
                           null,_
817
                           "Delete Build Machine",_
818
                           "Y",_
819
                           "Y",_
4083 dpurdie 820
                           "N",_
161 iaugusti 821
                           "N")
822
         rsQry.AddNew varFields, varValues
823
      End If
824
 
127 ghuddy 825
      If isAbtnRequired(aAbtnList, "btnPendingIntegration") Then
826
         varValues = Array(32, "btnPendingIntegration", null,_
827
                           """_modify_product_state.asp?state_id=1&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
5190 dpurdie 828
                           """vixConfirm('Do you want to proceed to make this product pending for INTEGRATION?',{title:'Make Pending', button:'Pending', url: 'HREF'});""""""",_
127 ghuddy 829
                           "icons/PendingIntegration.gif",_
830
                           null,_
831
                           "Make this product pending for Integration.",_
832
                           "Y",_
833
                           "Y",_
4083 dpurdie 834
                           "N",_
127 ghuddy 835
                           "N")
836
         rsQry.AddNew varFields, varValues
837
      End If
838
 
839
      If isAbtnRequired(aAbtnList, "btnPendingTest") Then
840
         varValues = Array(33, "btnPendingTest", null,_
841
                           """_modify_product_state.asp?state_id=2&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
5190 dpurdie 842
                           """vixConfirm('Do you want to proceed to make this product pending for Test?',{title:'Make Test', button:'Test', url: 'HREF'});""""""",_
127 ghuddy 843
                           "icons/PendingTest.gif",_
844
                           null,_
845
                           "Make this product pending for Test.",_
846
                           "Y",_
847
                           "Y",_
4083 dpurdie 848
                           "N",_
127 ghuddy 849
                           "N")
850
         rsQry.AddNew varFields, varValues
851
      End If
852
 
853
      If isAbtnRequired(aAbtnList, "btnPendingDeployment") Then
854
         varValues = Array(34, "btnPendingDeployment", null,_
855
                           """_modify_product_state.asp?state_id=3&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
5190 dpurdie 856
                           """vixConfirm('Do you want to proceed to make this product pending for DEPLOYMENT?',{title:'Make Deploy', button:'Deploy', url: 'HREF'});""""""",_
127 ghuddy 857
                           "icons/PendingDeployment.gif",_
858
                           null,_
859
                           "Make this product pending for Deployment.",_
860
                           "Y",_
861
                           "Y",_
4083 dpurdie 862
                           "N",_
127 ghuddy 863
                           "N")
864
         rsQry.AddNew varFields, varValues
865
      End If
866
 
867
      If isAbtnRequired(aAbtnList, "btnRejectProduct") Then
868
         varValues = Array(35, "btnRejectProduct", null,_
869
                           """_modify_product_state.asp?state_id=4&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
5190 dpurdie 870
                           """vixConfirm('Do you want to REJECT this product from DEPLOYMENT?',{title:'Reject Product', button:'Reject', url: 'HREF'});""""""",_
127 ghuddy 871
                           "icons/i_reject_pending.gif",_
872
                           null,_
873
                           "Reject this product from Deployment.",_
874
                           "Y",_
875
                           "Y",_
4083 dpurdie 876
                           "N",_
127 ghuddy 877
                           "N")
878
         rsQry.AddNew varFields, varValues
879
      End If
880
 
881
      If isAbtnRequired(aAbtnList, "btnPendingIntegrateAndDeploy") Then
882
         varValues = Array(36, "btnPendingIntegrateAndDeploy", null,_
883
                           """_modify_product_state.asp?state_id=5&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
5190 dpurdie 884
                           """vixConfirm('Do you want to proceed to make this product pending for INTEGRATION and DEPLOYMENT?',{title:'Pending Product', button:'Confirm', url: 'HREF'});""""""",_
127 ghuddy 885
                           "icons/PendingDeployment.gif",_
886
                           null,_
887
                           "Make this product pending for Integration and Deployment.",_
888
                           "Y",_
889
                           "Y",_
4083 dpurdie 890
                           "N",_
127 ghuddy 891
                           "N")
892
         rsQry.AddNew varFields, varValues
893
      End If
894
 
895
      If isAbtnRequired(aAbtnList, "btnDeleteSchedule") Then
896
         varValues = Array(37, "btnDeleteSchedule", null,_
897
                           """_DeleteSchedule.asp?scheduled_id=""& scheduled_id &""&""& objPMod.ComposeURL()",_
5190 dpurdie 898
                           """vixConfirm('Remove Schedule from this list?',{title:'Remove Schedule', button:'Remove', url: 'HREF'});""""""",_
127 ghuddy 899
                           "icons/i_remove.gif",_
177 brianf 900
                           "icons/i_remove_dis.gif",_
127 ghuddy 901
                           "Delete Schedule",_
902
                           "Y",_
903
                           "Y",_
4083 dpurdie 904
                           "N",_
127 ghuddy 905
                           "N")
906
         rsQry.AddNew varFields, varValues
907
      End If
908
 
909
      If isAbtnRequired(aAbtnList, "btnApproveMerge") Then
910
         varValues = Array(38, "btnApproveMerge", null,_
911
                           """_approve_merge.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_
5190 dpurdie 912
                           """vixConfirm('The release will be updated by this merge operation',{title:'Approve Merge', button:'Merge', url: 'HREF'});""""""",_
127 ghuddy 913
                           "icons/i_make_released.gif",_
914
                           "icons/i_make_released_off.gif",_
915
                           "Approve and carry out the pending merge operation",_
916
                           "Y",_
917
                           "Y",_
4083 dpurdie 918
                           "N",_
127 ghuddy 919
                           "N")
920
         rsQry.AddNew varFields, varValues
921
      End If
922
 
143 ghuddy 923
      If isAbtnRequired(aAbtnList, "btnRejectAutobuildPackage") Then
924
         varValues = Array( 39, "btnRejectAutobuildPackage", null,_
925
                           """_make_rejected.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
5190 dpurdie 926
                           """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 927
                           "icons/i_reject_pending.gif",_
928
                           "icons/i_reject_pending_off.gif",_
929
                           "Unapprove autobuild, move back to Work-In-Progress.",_
930
                           "Y",_
931
                           "Y",_
4083 dpurdie 932
                           "N",_
143 ghuddy 933
                           "N")
934
         rsQry.AddNew varFields, varValues
935
      End If
936
 
147 ghuddy 937
      If isAbtnRequired(aAbtnList, "btnDeleteDaemonInst") Then
938
         varValues = Array(40, "btnDeleteDaemonInst", null,_
939
                           """_DeleteDaemonInstruction.asp?rfile=""& ScriptName &""&inst_id=""& daemonInstId &""&""& objPMod.ComposeURL()",_
5190 dpurdie 940
                           """vixConfirm('Delete the Daemon Instruction from this list?',{title:'Delete Instruction', button:'Delete', url: 'HREF', width : 350, height : 150});""""""",_
147 ghuddy 941
                           "icons/i_remove.gif",_
942
                           null,_
943
                           "Delete this Daemon Instruction",_
944
                           "Y",_
945
                           "Y",_
4083 dpurdie 946
                           "N",_
147 ghuddy 947
                           "N")
948
         rsQry.AddNew varFields, varValues
949
      End If
950
 
951
      If isAbtnRequired(aAbtnList, "btnEditDaemonInst") Then
952
         varValues = Array(41, "btnEditDaemonInst", null,_
953
                           """javascript:;""",_
149 ghuddy 954
                           """onClick=""""MM_openBrWindow('wAddDaemonInstruction.asp?edit=true&inst_id=""& daemonInstId & ""&sort="" & parSortOrder & ""&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','EditProd','scrollbars=yes,resizable=yes,width=800,height=350');""""""",_
147 ghuddy 955
                           "icons/i_edit.gif",_
956
                           "icons/i_edit_off.gif",_
957
                           "Edit this Daemon Instruction",_
958
                           "Y",_
959
                           "Y",_
4083 dpurdie 960
                           "N",_
147 ghuddy 961
                           "N")
962
         rsQry.AddNew varFields, varValues
963
      End If
964
 
965
      If isAbtnRequired(aAbtnList, "btnAddDaemonInstRipplePackage") Then
966
         varValues = Array(42, "btnAddDaemonInstRipplePackage", null,_
967
                           """javascript:;""",_
5207 dpurdie 968
                           """onClick=""""MM_openBrWindow('wAddDaemonInstructionSimple.asp?op_code=0"" &""&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','EditProd','scrollbars=yes,resizable=yes,width=550,height=300');""""""",_
147 ghuddy 969
                           "images/ripplesquare.gif",_
970
                           "images/ripplesquaregrey.gif",_
971
                           "Request the Build Daemon to ripple this package version",_
972
                           "Y",_
973
                           "Y",_
4083 dpurdie 974
                           "N",_
975
                           "Y")
147 ghuddy 976
         rsQry.AddNew varFields, varValues
977
      End If
978
 
149 ghuddy 979
      If isAbtnRequired(aAbtnList, "btnAddDaemonInstTestBuildPackage") Then
980
         varValues = Array(43, "btnAddDaemonInstTestBuildPackage", null,_
981
                           """javascript:;""",_
982
                           """onClick=""""MM_openBrWindow('wAddDaemonInstruction.asp?op_code=1"" &""&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','EditProd','scrollbars=yes,resizable=yes,width=800,height=350');""""""",_
983
                           "images/abtn_test_build.gif",_
984
                           "images/abtn_test_build_off.gif",_
985
                           "Request the Build Daemon to test build this WIP package version",_
986
                           "Y",_
987
                           "Y",_
4083 dpurdie 988
                           "N",_
149 ghuddy 989
                           "N")
990
         rsQry.AddNew varFields, varValues
991
      End If
992
 
157 ghuddy 993
      If isAbtnRequired(aAbtnList, "btnMoveWIPToRelease") Then
994
         varValues = Array( 44, "btnMoveWIPToRelease", null,_
995
                           """javascript:;""",_
996
                           """onClick=""""MM_openBrWindow('_wform_move_wip.asp"" &""?rfile=""& ScriptName &""&""&  objPMod.ComposeURL() &""','MoveWIP','resizable=yes,width=800,height=400');""""""",_
997
                           "images/abtn_move_wip_to_release.gif",_
4670 dpurdie 998
                           "images/abtn_move_wip_to_release_off.gif",_
157 ghuddy 999
                           "Move this WIP to another release.",_
1000
                           "Y",_
1001
                           "Y",_
4083 dpurdie 1002
                           "N",_
157 ghuddy 1003
                           "N")
1004
         rsQry.AddNew varFields, varValues
1005
      End If
1006
 
183 brianf 1007
      If isAbtnRequired(aAbtnList, "btnLockPackage") Then
1008
         varValues = Array( 45, "btnLockPackage", null,_
1009
                           """_s_lock_package.asp?pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
5190 dpurdie 1010
                           """vixConfirm('Lock Package.<p>This will prevent changes to the package.',{title:'Lock Package', button:'Lock', url: 'HREF'});""""""",_
183 brianf 1011
                           "icons/i_lock.gif",_
1012
                           "icons/i_lock_off.gif",_
1013
                           "Lock this package.",_
1014
                           "Y",_
1015
                           "Y",_
4083 dpurdie 1016
                           "N",_
183 brianf 1017
                           "N")
1018
         rsQry.AddNew varFields, varValues
1019
      End If
1020
 
1021
      If isAbtnRequired(aAbtnList, "btnUnLockPackage") Then
1022
         varValues = Array( 46, "btnUnLockPackage", null,_
1023
                           """_s_unlock_package.asp?pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_
5190 dpurdie 1024
                           """vixConfirm('Unlock Package.<p>This may have serious side effects.',{title:'Unlock Package', button:'Unlock', url: 'HREF'});""""""",_
183 brianf 1025
                           "icons/i_unlock.gif",_
1026
                           "icons/i_unlock_off.gif",_
1027
                           "Unlock this package.",_
1028
                           "Y",_
1029
                           "Y",_
4083 dpurdie 1030
                           "N",_
183 brianf 1031
                           "N")
1032
         rsQry.AddNew varFields, varValues
1033
      End If
1034
 
4293 dpurdie 1035
 
1036
 
3959 dpurdie 1037
      If isAbtnRequired(aAbtnList, "btnEditProjectExtensions") Then
1038
         varValues = Array(29, "btnEditProjectExtensions", null,_
1039
                           """javascript:;""",_
1040
                           """onClick=""""MM_openBrWindow('wAddProjectExtension.asp?type=edit&ext=""& extName &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','EditProd','scrollbars=yes,resizable=yes,width=600,height=430');""""""",_
1041
                           "icons/i_edit.gif",_
1042
                           "icons/i_edit_off.gif",_
1043
                           "Edit Project Extensions",_
1044
                           "Y",_
1045
                           "Y",_
4083 dpurdie 1046
                           "N",_
3959 dpurdie 1047
                           "N")
1048
         rsQry.AddNew varFields, varValues
1049
      End If
1050
 
1051
      If isAbtnRequired(aAbtnList, "btnDeleteProjectExtension") Then
1052
         varValues = Array(30, "btnDeleteProjectExtension", null,_
1053
                           """_DeleteProjectExtension.asp?rfile=""& SCRIPT_NAME &""&ext=""& extName &""&""& objPMod.ComposeURL()",_
5190 dpurdie 1054
                           """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 1055
                           "icons/i_remove.gif",_
1056
                           null,_
1057
                           "Delete Project Extension",_
1058
                           "Y",_
1059
                           "Y",_
4083 dpurdie 1060
                           "N",_
3959 dpurdie 1061
                           "N")
1062
         rsQry.AddNew varFields, varValues
1063
      End If
4029 dpurdie 1064
 
1065
      If isAbtnRequired(aAbtnList, "btnEditGBE_Machclass") Then
1066
         varValues = Array(31, "btnEditGBE_Machclass", null,_
1067
                           """javascript:;""",_
4040 dpurdie 1068
                           """onClick=""""MM_openBrWindow('wAddMachclass.asp?type=edit&bm_id=""& bm_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','EditProd','scrollbars=yes,resizable=yes,width=600,height=220');""""""",_
4029 dpurdie 1069
                           "icons/i_edit.gif",_
1070
                           "icons/i_edit_off.gif",_
1071
                           "Edit this GBE MachClass value",_
1072
                           "Y",_
1073
                           "Y",_
4083 dpurdie 1074
                           "N",_
4029 dpurdie 1075
                           "N")
1076
         rsQry.AddNew varFields, varValues
1077
      End If
1078
 
1079
      If isAbtnRequired(aAbtnList, "btnDeleteGBE_Machclass") Then
1080
         varValues = Array(32, "btnDeleteGBE_Machclass", null,_
4040 dpurdie 1081
                           """wAddMachclass.asp?type=delete&bm_id=""& bm_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL()",_
5190 dpurdie 1082
                           """vixConfirm('Delete the \'""& GBE_VALUE &""\' Machine Class',{title:'Delete Machine Class', button:'Delete', url: 'HREF'});""""""",_
4029 dpurdie 1083
                           "icons/i_remove.gif",_
1084
                           null,_
1085
                           "Delete this GBE MachClass value",_
1086
                           "Y",_
1087
                           "Y",_
4083 dpurdie 1088
                           "N",_
4029 dpurdie 1089
                           "N")
1090
         rsQry.AddNew varFields, varValues
1091
      End If
4670 dpurdie 1092
 
1093
      If isAbtnRequired(aAbtnList, "btnDestroyWip") Then
1094
         varValues = Array(32, "btnDestroyWip", null,_
1095
                           """_destroy_package.asp?pkg_id="& pkgInfoHash.Item("pkg_id") &"&bfile=""& ScriptName &""&""& objPMod.ComposeURL()",_
5190 dpurdie 1096
                           """vixConfirm('Destroy this WIP for \'""& pkgInfoHash.Item(""pkg_name"") &""\'.<p>You cannot undo this operation.',{title : 'Destroy WIP', button:'Destroy', url: 'HREF'});""""""",_
4670 dpurdie 1097
                           "icons/i_destroy_package.gif",_
1098
                           "icons/i_destroy_package_off.gif",_
1099
                           "Destroy this WIP.",_
1100
                           "Y",_
1101
                           "Y",_
1102
                           "N",_
1103
                           "Y")
1104
         rsQry.AddNew varFields, varValues
1105
      End If
1106
 
3959 dpurdie 1107
 
5122 dpurdie 1108
      If isAbtnRequired(aAbtnList, "btnEditGBE_BuildStandard") Then
1109
         varValues = Array(48, "btnEditGBE_BuildStandard", null,_
1110
                           """javascript:;""",_
1111
                           """onClick=""""MM_openBrWindow('wAddBuildStandard.asp?type=edit&bsa_id=""& bsa_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','EditProd','scrollbars=yes,resizable=yes,width=600,height=220');""""""",_
1112
                           "icons/i_edit.gif",_
1113
                           "icons/i_edit_off.gif",_
1114
                           "Edit this Build Standard",_
1115
                           "Y",_
1116
                           "Y",_
1117
                           "N",_
1118
                           "N")
1119
         rsQry.AddNew varFields, varValues
1120
      End If
1121
 
1122
      If isAbtnRequired(aAbtnList, "btnDeleteGBE_BuildStandard") Then
1123
         varValues = Array(49, "btnDeleteGBE_BuildStandard", null,_
1124
                           """_DeleteBuildStandard.asp?rfile=""& SCRIPT_NAME &""&bsa_id=""& bsa_id &""&""& objPMod.ComposeURL()",_
5190 dpurdie 1125
                           """vixConfirm('Delete the \'""& GBE_VALUE &""\' Build Standard',{title : 'Delete Build Standard', button:'Delete', url: 'HREF'});""""""",_
5122 dpurdie 1126
                           "icons/i_remove.gif",_
1127
                           null,_
1128
                           "Delete this Build Standard",_
1129
                           "Y",_
1130
                           "Y",_
1131
                           "N",_
1132
                           "N")
1133
         rsQry.AddNew varFields, varValues
1134
      End If
4029 dpurdie 1135
 
3959 dpurdie 1136
 
127 ghuddy 1137
      ' Move cursor to the first record
1138
      rsQry.MoveFirst
1139
 
1140
      If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
1141
         Call LoadButtons ( rsQry.GetRows() )
1142
      End If
1143
 
1144
      rsQry.Close
1145
      Set rsQry = Nothing
1146
   End Sub
1147
   '-----------------------------------------------------------------------------------------------------------------
1148
   Public Sub LoadButtons ( aRows )
1149
      Dim nProperty, newArrayDim, LastRow, rowNum
1150
 
1151
      LastRow = UBound( aRows, 2 )
1152
 
1153
      For rowNum = 0 To LastRow
1154
         ' Increase array by 1
1155
         newArrayDim = LastRowInx() + 1
1156
         ReDim Preserve mArrAbtnDef( mNumOfProperties, newArrayDim )
1157
 
1158
 
1159
         mobjNameDefMap.Item ( Cstr( aRows ( InxName, rowNum ) ) ) = newArrayDim
1160
 
1161
         For nProperty = 0 To mLastPropertyInx
1162
            mArrAbtnDef ( nProperty, newArrayDim ) = aRows ( nProperty, rowNum )
1163
 
1164
         Next
1165
 
1166
      Next
1167
 
1168
   End Sub
1169
   '-----------------------------------------------------------------------------------------------------------------
1170
   Private Function LastRowInx ()
1171
       LastRowInx = UBound ( mArrAbtnDef, 2 )
1172
   End Function
1173
   '-----------------------------------------------------------------------------------------------------------------
1174
   Public Sub AddSeparatorAfter ( sItemName, sSeparatorWidth )
1175
      If InStr( sItemName, " " ) > 0 Then   Err.Raise 8, "Method AddSeparatorAfter", "Item Name '"& sItemName &"' cannot have spaces."
1176
      mobjSeparator.Add (Cstr(sItemName)), CStr(sSeparatorWidth)
1177
   End Sub
1178
   '-----------------------------------------------------------------------------------------------------------------
1179
   Public Sub AddSeparator ( sSeparatorWidth )
1180
      mobjSeparator.Add ( Cstr(mArrAbtnDef(InxName, LastItemInx())) ), CStr(sSeparatorWidth)
1181
   End Sub
1182
   '-----------------------------------------------------------------------------------------------------------------
1183
   Private Sub SetItemDefaults ( sItemName )
1184
      ' Additional default setup
1185
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxActive, enumDB_YES )         ' Default Active = enumDB_YES
1186
   End Sub
1187
   '-----------------------------------------------------------------------------------------------------------------
1188
   Public Sub Text ( sItemName, Value )
1189
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxTxt, Value )
1190
   End Sub
1191
   '-----------------------------------------------------------------------------------------------------------------
1192
   Public Sub ItemID ( sItemName, Value )
1193
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxID, Value )
1194
   End Sub
1195
   '-----------------------------------------------------------------------------------------------------------------
1196
   Public Sub Image ( sItemName, Value )
1197
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImg, Value )
1198
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImgOff, Value )         ' Default image disable to be the same as image
1199
   End Sub
1200
   '-----------------------------------------------------------------------------------------------------------------
1201
   Public Sub ImageOff ( sItemName, Value )
1202
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImgOff, Value )
1203
   End Sub
1204
   '-----------------------------------------------------------------------------------------------------------------
1205
   Public Sub Link ( sItemName, Value )
1206
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxLink, Value )
1207
   End Sub
1208
   '-----------------------------------------------------------------------------------------------------------------
1209
   Public Sub EventHandler ( sItemName, Value )
1210
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxEventHandler, Value )
1211
   End Sub
1212
   '-----------------------------------------------------------------------------------------------------------------
1213
   Public Sub Hint ( sItemName, Value )
1214
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxHint, Value )
1215
   End Sub
1216
   '-----------------------------------------------------------------------------------------------------------------
1217
   Public Sub Visible ( sItemName, Value )
1218
      'Response.write sItemName &"here"& mobjNameDefMap.Item (Cstr(sItemName))
1219
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxVisible, Value )
1220
   End Sub
1221
   '-----------------------------------------------------------------------------------------------------------------
143 ghuddy 1222
   Public Function IsVisible ( sItemName )
1223
      'Response.write sItemName &"here"& mobjNameDefMap.Item (Cstr(sItemName))
1224
      IsVisible = GetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxVisible )
1225
   End Function
1226
   '-----------------------------------------------------------------------------------------------------------------
127 ghuddy 1227
   Public Sub Active ( sItemName, Value )
1228
      'Response.write sItemName &"here"& mobjNameDefMap.Item (Cstr(sItemName))
1229
      Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxActive, Value )
1230
   End Sub
1231
   '-----------------------------------------------------------------------------------------------------------------
143 ghuddy 1232
   Public Function IsActive ( sItemName )
1233
      IsActive = GetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxActive )
1234
   End Function
1235
   '-----------------------------------------------------------------------------------------------------------------
127 ghuddy 1236
   Private Sub Class_Initialize()
1237
      '// Perform action on creation of object. e.g. Set myObj = New ThisClassName
1238
      Set mobjNameDefMap = CreateObject("Scripting.Dictionary")
1239
      Set mobjIdDefMap = CreateObject("Scripting.Dictionary")
1240
      Set mobjSeparator = CreateObject("Scripting.Dictionary")
1241
      Set mobjACActionsMap = CreateObject("Scripting.Dictionary")
1242
 
1243
      'mbIsReadonly = FALSE   ' Tell control that it should use only readonly action buttons (i.e. actions which will not alter database )
1244
      mReadonlyActionBehaviour = enumABTNCTRL_ON_READONLY_HIDE      ' Tell control what to do by default if mbIsReadonly = TRUE
1245
 
1246
      mnButtonSpacer = 0
1247
      mnImageHspace = 4
1248
 
4083 dpurdie 1249
      mNumOfProperties = 12     ' Number of properties in array which define one menu item.
127 ghuddy 1250
      mLastPropertyInx = mNumOfProperties - 1
1251
 
1252
      mbDisableAll = FALSE
1253
 
1254
      ReDim mArrAbtnDef ( mNumOfProperties, -1 )
4083 dpurdie 1255
      InxID                 = 0
127 ghuddy 1256
      InxName               = 1
4083 dpurdie 1257
      InxTxt                = 2
127 ghuddy 1258
      InxLink               = 3
4083 dpurdie 1259
      InxEventHandler       = 4
1260
      InxImg                = 5
1261
      InxImgOff             = 6
127 ghuddy 1262
      InxHint               = 7
1263
      InxVisible            = 8
4083 dpurdie 1264
      InxActive             = 9
1265
      InxIsReadonlyAction   = 10
1266
      InxHideOnClosed       = 11
127 ghuddy 1267
 
1268
   End Sub
1269
   '-----------------------------------------------------------------------------------------------------------------
1270
   Private Sub Class_Terminate()
1271
      '// Perform action on object disposal. e.g. Set myObj = Nothing
1272
      Set mobjNameDefMap = Nothing
1273
      Set mobjIdDefMap = Nothing
1274
      Set mobjSeparator = Nothing
1275
      Set mobjACActionsMap = Nothing
1276
 
1277
 
1278
   End Sub
1279
   '-----------------------------------------------------------------------------------------------------------------
119 ghuddy 1280
End Class
127 ghuddy 1281
%>