Subversion Repositories DevTools

Rev

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