Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

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