Subversion Repositories DevTools

Rev

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