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