Subversion Repositories DevTools

Rev

Rev 6579 | Rev 6623 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|                        RTREE                      |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
12
Response.Expires = 0   ' always load the page, dont store
13
%>
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<!--#include file="common/daemon_status.asp"-->
6615 dpurdie 20
<!--#include file="class/classSortHelper.asp"-->
21
<!--#include file="class/classActionButtonControl.asp"-->
5357 dpurdie 22
<%
23
'------------ ACCESS CONTROL ------------------
24
%>
6181 dpurdie 25
<!--#include file="_access_control_login_optional.asp"-->
5357 dpurdie 26
<!--#include file="_access_control_general.asp"-->
27
<%
28
'------------ Variable Definition -------------
29
Dim ViewType
30
Dim bIsaTreeView
31
Dim rsQryStr
32
Dim rsQry
33
Dim parProjId
34
Dim parShowFilter
35
Dim objBtnControl
36
Dim currLevel, lastLevel
37
Dim dListFilter
38
Dim objDmSts
6576 dpurdie 39
Dim hoverTitle, createdBy, comment, lastMod
5357 dpurdie 40
Dim bCanMove
41
Dim bCanDestroy
42
Dim bCanClone
43
Dim bCanUnarchive
44
Dim bCanCloseArchive
45
 
46
Dim bCanOpenToClose
47
Dim bCanRestrictiveToClose
48
Dim bCanCloseToClose
49
Dim bCanPreserveToClose
50
Dim bCanArchiveToClose
51
 
52
Dim bCanOpenToPreserve
53
Dim bCanRestrictiveToPreserve
54
Dim bCanCloseToPreserve
55
Dim bCanPreserveToPreserve
56
Dim bCanArchiveToPreserve
57
 
58
Dim bCanOpenToArchive
59
Dim bCanRestrictiveToArchive
60
Dim bCanCloseToArchive
61
Dim bCanPreserveToArchive
62
Dim bCanArchiveToArchive
63
 
64
 
65
'------------ Constants Declaration -----------
66
Const LIMG_TREE_I_HALF = "<img src='images/spacer.gif' width='20' height='1'>"
67
Const LIMG_TREE_I_NONE = "<img src='images/spacer.gif' width='30' height='15'>"
68
Const LIMG_TREE_I_FULL = "<img src='images/dot1h.gif' width='30' height='15'>"
69
Const LIMG_TREE_T      = "<img src='images/dot1.gif' width='30' height='15'>"
70
Const LIMG_LIST_VIEW   = "<img src='images/abtn_list_view.gif' border='0' align=absmiddle' name='imgviewtype' usemap='#mapviewtype' id='imgviewtype'>"
71
Const LIMG_TREE_VIEW   = "<img src='images/abtn_tree_view.gif' border='0' align=absmiddle' name='imgviewtype' usemap='#mapviewtype' id='imgviewtype'>"
72
 
73
Const LCONST_LIST_VIEW = 1
74
Const LCONST_TREE_VIEW = 2
75
 
76
Const DEFAULT_SHOW_FILTER = "'N','R','C','O'"
77
 
78
'------------ Variable Init -------------------
79
'   Need either proj_id or rtag_id, for which we will calculate a project id
80
parProjId = Request("proj_id")
81
If parProjId = "" Then parProjId = DB_PROJ_ID
82
If parProjId = ""  OR parProjId < 0 Then
5957 dpurdie 83
   Call Destroy_All_Objects
5357 dpurdie 84
   Response.Redirect("index.asp")
85
End If
86
Call objPMod.StoreParameter("proj_id", parProjId)
87
 
88
 
89
' Get show_filter from query string or failing that, from the cookie.
90
' Make sure that if neither supplies it, use the default
91
parShowFilter = Request("show_filter")
92
If NOT IsNull(parShowFilter) AND parShowFilter <> "" Then
93
   Response.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("show_filter") = parShowFilter
94
Else
95
   parShowFilter = Request.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("show_filter")
96
   If IsNull(parShowFilter) OR parShowFilter = "" Then
97
      parShowFilter = DEFAULT_SHOW_FILTER
98
      Response.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("show_filter") = parShowFilter
99
   End If
100
End If
101
 
102
Set dListFilter = CreateObject("Scripting.Dictionary")
103
 
104
Set objBtnControl = New ActionButtonControl
105
 
106
' Init access control
107
bCanMove =  canActionControlInProject("ConfigureRelease") 
108
bCanDestroy = canActionControlInProject("DestroyRelease")
109
bCanClone =  canActionControlInProject("CreateNewRelease")
110
 
111
bCanOpenToClose             =  ReleaseModeAccessCheck(enumDB_RELEASE_IN_OPEN_MODE,enumDB_RELEASE_IN_CLOSED_MODE)
112
bCanRestrictiveToClose      =  ReleaseModeAccessCheck(enumDB_RELEASE_IN_RESTRICTIVE_MODE,enumDB_RELEASE_IN_CLOSED_MODE)
113
bCanCloseToClose            =  FALSE
114
bCanPreserveToClose         =  ReleaseModeAccessCheck(enumDB_RELEASE_IN_PRESERVE_MODE,enumDB_RELEASE_IN_CLOSED_MODE)
115
bCanArchiveToClose          =  ReleaseModeAccessCheck(enumDB_RELEASE_IN_ARCHIVE_MODE,enumDB_RELEASE_IN_CLOSED_MODE)
116
 
117
bCanOpenToPreserve          =  ReleaseModeAccessCheck(enumDB_RELEASE_IN_OPEN_MODE,enumDB_RELEASE_IN_PRESERVE_MODE)
118
bCanRestrictiveToPreserve   =  ReleaseModeAccessCheck(enumDB_RELEASE_IN_RESTRICTIVE_MODE,enumDB_RELEASE_IN_PRESERVE_MODE)
119
bCanCloseToPreserve         =  ReleaseModeAccessCheck(enumDB_RELEASE_IN_CLOSED_MODE,enumDB_RELEASE_IN_PRESERVE_MODE)
120
bCanPreserveToPreserve      =  FALSE
121
bCanArchiveToPreserve       =  ReleaseModeAccessCheck(enumDB_RELEASE_IN_ARCHIVE_MODE,enumDB_RELEASE_IN_PRESERVE_MODE)
122
 
123
bCanOpenToArchive           =  ReleaseModeAccessCheck(enumDB_RELEASE_IN_OPEN_MODE,enumDB_RELEASE_IN_ARCHIVE_MODE)            
124
bCanRestrictiveToArchive    =  ReleaseModeAccessCheck(enumDB_RELEASE_IN_RESTRICTIVE_MODE,enumDB_RELEASE_IN_ARCHIVE_MODE)     
125
bCanCloseToArchive          =  ReleaseModeAccessCheck(enumDB_RELEASE_IN_CLOSED_MODE,enumDB_RELEASE_IN_ARCHIVE_MODE)          
126
bCanPreserveToArchive       =  ReleaseModeAccessCheck(enumDB_RELEASE_IN_PRESERVE_MODE,enumDB_RELEASE_IN_ARCHIVE_MODE)                                                                                          
127
bCanArchiveToArchive        =  FALSE
128
 
129
'----------------------------------------------
130
%>
131
<%
132
'--------------------------------------------------------------------------------------------------------------------------
133
' Determines if the specified filter is on/off and returns a string to use to check the associated checkbox accordingly
134
Function GetIsListFilterChecked( nFilterId )
135
   GetIsListFilterChecked = ""
136
 
137
  If bIsaTreeView Then
138
       ' Disable the control in Tree View
139
       GetIsListFilterChecked = GetIsListFilterChecked & " checked disabled"
140
  Else
141
       If dListFilter.Exists ( "'" & CStr(nFilterId) & "'"  ) Then
142
          GetIsListFilterChecked = "checked"
143
       End If
144
  End If
145
 
146
End Function
147
'--------------------------------------------------------------------------------------------------------------------------
148
' Reads the cookie for the filter and creats a dictionary element for each item therein. the dictionary
149
' is used by the GetIsListFilterChecked function to determine checkbox state in the filter options
150
Sub GetListFilterValues ( outDepFilter )
151
   Dim FilterVal, aFilterValues
152
 
153
   If parShowFilter <> "" Then
154
      aFilterValues = Split( Replace( parShowFilter, " ", ""), ",")
155
 
156
      For Each FilterVal In aFilterValues
157
         outDepFilter.Item (CStr( FilterVal )) = ""
158
      Next
159
   End If
160
End Sub
161
 
162
'----------------------------------------------------------------------------------------------------------------------------------------------
163
Sub RenderIndent ( nLastLevel, nCurrLevel )
164
   Dim i
165
 
166
   If nCurrLevel <= 1 Then Exit Sub
167
 
168
   '-- Render half lines
169
   If nCurrLevel > 2 Then
170
      For i = 1 To nCurrLevel - 2
171
         Response.write LIMG_TREE_I_NONE
172
      Next
173
   End If
174
 
175
 
176
   '-- Render branch or line
177
   If nLastLevel < nCurrLevel Then
178
      Response.write LIMG_TREE_T
179
   Else
180
      Response.write LIMG_TREE_I_FULL
181
   End If
182
 
183
End Sub
184
'----------------------------------------------------------------------------------------------------------------------------------------------
185
Function GetViewType ()
186
   Dim CookieViewType
187
 
188
   CookieViewType = Request.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("RELEASE_VIEW")
189
 
190
   If CookieViewType <> "" Then
191
      ' Get current view type from cookie
192
      GetViewType = CInt(CookieViewType)
193
   Else
194
      ' Set current view to list view
195
      Response.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("RELEASE_VIEW") = LCONST_LIST_VIEW
196
      GetViewType = LCONST_LIST_VIEW
197
   End If
198
 
199
End Function
200
'----------------------------------------------------------------------------------------------------------------------------------------------
201
Sub SetViewType ()
202
   If Request("viewtype") = "" Then Exit Sub    ' Nothing to do
203
 
204
   Response.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("RELEASE_VIEW") = Request("viewtype")
205
End Sub
206
'----------------------------------------------------------------------------------------------------------------------------------------------
207
Sub RenderDaemonStatusConfig(nRtagId) 
208
   %>
209
   <table class="embedded_table">
210
    <tr>
211
     <td>
212
     <%
213
      Response.Write("<img src=""icons/i_edit.gif"" border=0 vspace=0 hspace=0 title='Configure Daemons' onclick='location.href=""release_config.asp?rtag_id="&nRtagId&"""'>")
214
      Response.Write("<img src=""icons/ext_log.gif"" border=0 vspace=0 hspace=0 title='View Build Log'onclick='location.href=""build_release_log.asp?rtag_id="&nRtagId&"""'>")
215
     %>
216
     </td>
217
     <td>
218
   <%
219
    Call objDmSts.RenderDaemonStatus(nRtagId,16)
220
    %>
221
        </td>
222
        </tr>
223
        </table>
224
    <%
225
End Sub
226
 
227
'----------------------------------------------------------------------------------------------------------------------------------------------
228
Sub RenderLxrState()
229
    Response.Write RenderLxrStateString(rsQry("rtag_id"),rsQry("lxr"),rsQry("lxrserver"),rsQry("official"),"")
230
End Sub
231
'----------------------------------------------------------------------------------------------------------------------------------------------
5394 dpurdie 232
Function RenderActions(nRtagId, sOfficial, nCanDelete)
233
    Response.Write "<span title='Select operation from dropdown menu' " &_
234
                       "class='select-operation ui-icon ui-icon-triangle-1-s' " &_
235
                       "data-rtag-id='" & nRtagId &_
236
                       "' data-official='"& sOfficial &_
237
                       "' data-candelete='"& nCanDelete &_
238
                       "' style='display:inline-block'>"&_
239
                   "</span>"
5357 dpurdie 240
End Function
241
'----------------------------------------------------------------------------------------------------------------------------------------------
242
Function GetMassRefComments (nRtagId)
243
   Dim UsedBy
244
   Dim rsQryUse
245
   Dim linkB
246
   Dim joiner : joiner = ""
247
   Dim comment : comment = ""
248
 
249
'   If parProjId <> 2 Then
250
'     assocMASSREF = rsQry("assoc_mass_ref")
251
'     If assocMASSREF <> "" Then
252
'        Set rsQryAssoc = OraDatabase.DbCreateDynaset("SELECT RTAG_NAME, RTAG_ID FROM RELEASE_TAGS WHERE RTAG_ID="&assocMASSREF , ORADYN_DEFAULT)
253
'        assocMASSREFName = rsQryAssoc("RTAG_NAME")
254
'        link = rsQryAssoc("rtag_id")
255
'        rsQryAssoc.Close
256
'        Set rsQryAssoc = Nothing
257
'     Else
258
'        assocMASSREFName = "None."
259
'     End If
260
'   Else
261
      UsedBy = nRtagId
262
      If UsedBy <> "" Then
263
         Set rsQryUse = OraDatabase.DbCreateDynaset("SELECT * FROM RELEASE_TAGS RT, PROJECTS P WHERE RT.ASSOC_MASS_REF=" & nRtagId & " AND RT.PROJ_ID=P.PROJ_ID", ORADYN_DEFAULT)
264
 
265
         While ((NOT rsQryUse.BOF) AND (NOT rsQryUse.EOF))
266
            If rsQryUse("assoc_mass_ref") = UsedBy Then
267
               linkB = "dependencies.asp?rtag_id="&rsQryUse("rtag_id")
268
               comment = joiner & rsQryUse("proj_name") & " -> <a href="&linkB&">"& rsQryUse("rtag_name") &"</a>"
269
               joiner = " <br> "
270
               rsQryUse.MoveNext
271
            End If
272
         WEnd
273
         rsQryUse.Close
274
         Set rsQryUse = Nothing
275
      End If
276
      GetMassRefComments = comment
277
End Function
278
'----------------------------------------------------------------------------------------------------------------------------------------------
279
%>
280
<%
281
'------------ RUN BEFORE PAGE RENDER ----------
282
If (Request("action") <> "") Then
283
 
284
   If Request("btn") = "Update" Then
285
      ' Store filter in cookie
286
      Response.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("show_filter") = Request("listFilter")
287
      parShowFilter = Request("listFilter")
288
      If IsNull(parShowFilter) OR parShowFilter = "" Then parShowFilter = DEFAULT_SHOW_FILTER
289
   End If
290
 
291
End If
292
 
293
' Set view type  if required
294
Call SetViewType ()
295
 
296
' Get current view type
297
ViewType = GetViewType()
298
bIsaTreeView = (ViewType = LCONST_TREE_VIEW)
299
 
300
'----------------------------------------------
301
%>
302
<html>
303
<head>
304
<%
305
   Set rsQry = OraDatabase.DbCreateDynaset( "SELECT PROJ_NAME FROM PROJECTS WHERE PROJ_ID="& parProjId, ORADYN_DEFAULT )
306
%>
307
<title><%=rsQry("proj_name")%></title>
308
<link rel="shortcut icon" href="<%=FavIcon%>"/>
309
<%
310
   rsQry.Close
311
   Set rsQry = Nothing
312
%>
313
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
314
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 315
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
316
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
317
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 318
<!-- DROPDOWN MENUS -->
319
<!--#include file="_menu_def.asp"-->
6579 dpurdie 320
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 321
 
322
<!-- Dropdown action menu scripts -->
323
<style>
324
    .ui-menu { position: absolute; }
325
</style>
326
<!--#include file="_jquery_includes.asp"-->
327
<script>
328
    $(function() {
329
        // Global menu data structure
330
        //  Persist between invocations of the menu
331
        //      Used to mergeLeft rtagid
332
        //      Used to store current menu info
333
        $.acData = {
334
            //  Data
335
            bCanOpenToClose                 : <%=iif(bCanOpenToClose          , "true", "false")%> ,             
336
            bCanRestrictiveToClose          : <%=iif(bCanRestrictiveToClose   , "true", "false")%> ,
337
            bCanCloseToClose                : <%=iif(bCanCloseToClose         , "true", "false")%> ,
338
            bCanPreserveToClose             : <%=iif(bCanPreserveToClose      , "true", "false")%> ,
339
            bCanArchiveToClose              : <%=iif(bCanArchiveToClose       , "true", "false")%> ,
340
 
341
            bCanOpenToPreserve              : <%=iif(bCanOpenToPreserve       , "true", "false")%> ,
342
            bCanRestrictiveToPreserve       : <%=iif(bCanRestrictiveToPreserve, "true", "false")%> ,
343
            bCanCloseToPreserve             : <%=iif(bCanCloseToPreserve      , "true", "false")%> ,
344
            bCanPreserveToPreserve          : <%=iif(bCanPreserveToPreserve   , "true", "false")%> ,
345
            bCanArchiveToPreserve           : <%=iif(bCanArchiveToPreserve    , "true", "false")%> ,
346
 
347
            bCanOpenToArchive               : <%=iif(bCanOpenToArchive        , "true", "false")%> ,
348
            bCanRestrictiveToArchive        : <%=iif(bCanRestrictiveToArchive , "true", "false")%> ,
349
            bCanCloseToArchive              : <%=iif(bCanCloseToArchive       , "true", "false")%> ,
350
            bCanPreserveToArchive           : <%=iif(bCanPreserveToArchive    , "true", "false")%> ,
351
            bCanArchiveToArchive            : <%=iif(bCanArchiveToArchive     , "true", "false")%> ,
352
            };
353
 
354
            // Convert from Release Mode to [canClose, canPreserve, canArchive]
355
        $.mode2access = {
356
 
357
            N: [$.acData.bCanOpenToClose,$.acData.bCanOpenToPreserve,$.acData.bCanOpenToArchive],
358
            R: [$.acData.bCanRestrictiveToClose,$.acData.bCanRestrictiveToPreserve,$.acData.bCanRestrictiveToArchive],
359
            C: [$.acData.bCanRestrictiveToClose,$.acData.bCanRestrictiveToPreserve,$.acData.bCanRestrictiveToArchive],
360
            Y: [$.acData.bCanCloseToClose,$.acData.bCanCloseToPreserve,$.acData.bCanCloseToArchive],
361
            O: [$.acData.bCanCloseToClose,$.acData.bCanCloseToPreserve,$.acData.bCanCloseToArchive],
362
            P: [$.acData.bCanPreserveToClose,$.acData.bCanPreserveToPreserve,$.acData.bCanPreserveToArchive],
363
            A: [$.acData.bCanArchiveToClose,$.acData.bCanArchiveToPreserve,$.acData.bCanArchiveToArchive],
364
 
365
            canAccess : function(state, index) {
366
                if ( this.hasOwnProperty(state)) {
367
                    return this[state][index];
368
                } else {
369
                    return false;
370
                }
371
            },
372
        };
373
 
374
        $.miniMenu = {
375
            //  Data
376
 
377
            //  Menu operations
378
            open : function (data) {
379
                //console.log("Opening:", data.rtagid);
380
                this.gotoUrl("dependencies.asp", {rtag_id : data.rtagid});
381
             },
382
 
383
             edit : function (data) {
384
                 //console.log("Editing:", data.rtagid);
385
                 this.gotoUrl("form_edit_release.asp", {rtag_id : data.rtagid, rfile : "<%=ScriptName%>"});
386
             },
387
 
388
             mergeSelect : function (data) {
389
                 //console.log("Merge from:", data.rtagid );
390
                 $('#releaseTree .body_row_sel2').removeClass('body_row_sel2');
391
                 if (data.mergeLeft != data.rtagid) {
392
                     data.mergeLeft = data.rtagid;
393
                     $.miniMenu.currentRow.addClass('body_row_sel2');
394
                 } else {
395
                     delete(data.mergeLeft);
396
                 }
397
             },
398
 
399
             merge : function (data) {
400
                 //console.log ("Merge:", data.mergeLeft, data.rtagid);
401
                 this.gotoUrl("diff.asp", { rtagA : data.mergeLeft, rtagB : data.rtagid});
402
             },
403
 
404
             close : function (data) {
405
                 //console.log("Closing:", data.rtagid);
406
                 this.gotoUrl("_change_release_mode.asp", {rtag_id : data.rtagid, mode_code : 3 , rfile : "<%=ScriptName%>"});
407
             },
408
 
409
             preserve : function (data) {
410
                 //console.log("Preserving:", data.rtagid);
411
                 this.gotoUrl("_change_release_mode.asp", {rtag_id : data.rtagid, mode_code : 6 , rfile : "<%=ScriptName%>"});
412
             },
413
 
414
             archive : function (data) {
415
                 //console.log("Archiving:", data.rtagid);
416
                 this.gotoUrl("_change_release_mode.asp", {rtag_id : data.rtagid, mode_code : 5 , rfile : "<%=ScriptName%>"});
417
             },
5394 dpurdie 418
<%If objAccessControl.UserLogedIn Then%>
5357 dpurdie 419
             delete : function (data) {
420
                 //console.log("Delete:", data.rtagid);
421
                 $.miniMenu.currentRow.addClass('body_row_sel_outline');
422
                 var that = this;
423
                 var delObject = $.Deferred(that.confirmDelete
424
                 ).done(function(){
425
                     that.gotoUrl("_destroy_release.asp", {rtag_id_list : data.rtagid, proj_id : <%=parProjId%>, rfile : "<%=ScriptName%>"});
426
                 }).fail(function(){
427
                     $('#releaseTree .body_row_sel_outline').removeClass('body_row_sel_outline');
428
                 });
429
             },
430
<%End If%>
431
<%If bCanMove Then%>
432
             move : function (data) {
433
                 //console.log("Move:", data.rtagid);
434
                 this.gotoUrl("form_move_release.asp", { rtag_id_list : data.rtagid, proj_id : <%=parProjId%> });
435
             },
436
<%End If%>
437
<%If bCanClone Then%>
438
             clone : function(data) {
439
                 //console.log("Clone:", data.rtagid);
440
                 this.gotoUrl("new_release.asp", { rtag_id_list : data.rtagid, proj_id : <%=parProjId%>, branch : "Y" });
441
             },
442
<%End If%>
443
 
444
             //
445
             // Internal functions
446
             // Goto url, or open in new tab
447
             gotoUrl: function (url, params)
448
             {
449
                 // Open in new tab - not as simple as it sounds
450
                 // Need to create a form and submit it
451
                 if(this.event.shiftKey){
452
                     var form = $('<form>',{
453
                         action : url,
454
                         target : '_blank',
455
                         //method : 'GET'
456
                         });
457
 
458
                     $.each(params,function(n,v){
459
                         var item = $('<input>',{
460
                             name : n,
461
                             value : v
462
                         });
463
                         form.append(item);
464
                        });
465
 
466
 
467
                     form.appendTo(document.body);
468
                     form.submit();
469
                     form.remove();
470
                 }
471
                 else {
472
                     if (params)
473
                         url += '?' + jQuery.param(params)
474
                     window.location.href = url;
475
                 }
476
             },
477
 
478
             // Confirm action
479
             //     Delegate Object
480
             confirmDelete : function(dbo){
481
                 $( "<div>Are you sure</div>" ).dialog({
482
                    resizable: true,
483
                    height:170,
484
                    width : 300,
485
                    modal: true,
486
                    position: { my: "top", at: "top+100", of: window },
487
                    title:'Destroy Release',
488
                    open: function() {
489
                        $(this).siblings('.ui-dialog-buttonpane').find('button:eq(1)').focus(); 
490
                        var markup = '<p><img src="images/i_critical.gif" style="float:left; margin:0 7px 20px 0;">This Release will be permanently destroyed.<p>Are you sure?';
491
                        $(this).html(markup);
492
                    },
493
                    close : function() {
494
                        $(this).remove();
495
                        dbo.reject();
496
                    },
497
                    buttons: {
498
                        "Destroy Release": function() {
499
                            dbo.resolve();
500
                            $(this).dialog("close");
501
                        },
502
                        Cancel: function() {
503
                            $(this).dialog("close");
504
                        }
505
                    }
506
                 });
507
             },
508
 
509
    };
510
 
511
    // Create and Hide the Menu
512
    $( "#select-menu" ).hide().menu();
513
 
514
    // Register menuselect event handler
515
    $( "#select-menu" ).on( "menuselect", function( event, ui ) {
516
       var opr = ui.item.data('opr');
517
 
518
        // Invoke operation within the menu data structure
519
        if (typeof $.miniMenu[opr] == 'function' ) {
520
            $.miniMenu['event'] = event;
521
            $.miniMenu[opr]($.miniMenu);
522
            return;
523
        }
524
        //console.log ("Menu Operation:", opr, "Not found");
525
    });
526
 
527
 
528
    // Add menu to all require instances
529
   $( ".select-operation" ).click(function(event) {
530
        // When clicked - create and show the menu
531
        // Insert rtag-id
532
 
533
       // In order to have the menu positioing work correctly
534
       //   Create a div that covers the visible screen area
535
       //   Us it within the menu poistioning
536
       //   Then delete it again
537
       var positionDiv = $( "<div></div>" ).css({
538
               position: 'absolute', 
539
               top : $(document).scrollTop(), 
540
               left : $(document).scrollLeft(),
541
               width: '100vw',
542
               height: '100vh',
543
               'z-index' : -1,
544
           });
545
       positionDiv.appendTo(document.body);
546
 
547
        //  Create the menu
548
        var menu = $("#select-menu").show().position({
549
             my: "left top",
550
             at: "center bottom",
551
             of: this,
552
             within : positionDiv,
553
        });
554
 
555
        // Cleanup the poistioning div
556
        positionDiv.remove();
557
 
558
        // Setup global data
559
        $.miniMenu.rtagid = $(this).data('rtag-id');
560
 
561
        // Set initial menu state - merge target
562
        $('#select-menu-merge').toggleClass('ui-state-disabled',!('mergeLeft' in $.miniMenu ));
563
 
564
        // Set initial state close/archive
565
        //
566
        var official = $(this).data('official');
567
        $('#select-menu-close').toggleClass('ui-state-disabled',! $.mode2access.canAccess(official,0));
568
        $('#select-menu-preserve').toggleClass('ui-state-disabled',!$.mode2access.canAccess(official,1));
569
        $('#select-menu-archive').toggleClass('ui-state-disabled',! $.mode2access.canAccess(official,2));
570
 
5394 dpurdie 571
        // Set initial state destroy
572
        var canDestroy = $(this).data('candelete') || <%=iif(bCanDestroy,"1","0")%>
573
        $('#select-menu-destroy').toggleClass('ui-state-disabled',(canDestroy == 0));
574
 
5357 dpurdie 575
        // Highlight the row selected
576
        $('#releaseTree .body_row_sel').removeClass('body_row_sel');
577
        $.miniMenu.currentRow = $(event.target).closest('tr').addClass('body_row_sel');
578
 
579
        // Allow click outside of the menu to close it
580
        $( document ).one( "click", function() {
581
            menu.hide();
582
            $('#releaseTree .body_row_sel').removeClass('body_row_sel');
583
        });
584
 
585
 
586
        // Prevent propagation of event
587
        return false;
588
    });
589
});
590
</script>
591
 
592
</head>
593
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
594
<!-- HEADER -->
595
<!--#include file="_header.asp"-->
596
<!-- BODY ---->
597
<%Call GetListFilterValues ( dListFilter )%>
598
<form name="FormName" method="post" action="<%=ScriptName%>">
599
<table width="100%" border="0" cellspacing="0" cellpadding="0">
600
   <tr>
601
      <td width="1" background="images/bg_home_orange.gif" valign="top">
602
         <!-- ICON STATUS and FILTER -------------------------------------->
603
         <table width="118" border="0" align="left" style="margin-top: 38px;">
604
            <tr>
605
               <td bgcolor="#E4E9EC" width="26"><span class="body_txt">Icon</span></td>
606
               <td bgcolor="#E4E9EC" width="82"><span class="body_txt">Release State </span></td>
607
            </tr>
608
            <tr>
609
               <td bgcolor="#F5F5F5"><img src="images/i_rtag_open_mode.gif" width="15" height="13"></td>
610
               <td bgcolor="#F5F5F5"><span class="body_txt"><input name="listFilter" type="checkbox" value="'<%=enumDB_RELEASE_IN_OPEN_MODE%>'" <%=GetIsListFilterChecked(enumDB_RELEASE_IN_OPEN_MODE)%>>Open Mode</span></td>
611
            </tr>
612
            <tr>
613
               <td bgcolor="#F5F5F5"><img src="images/i_rtag_restrictive_mode.gif" width="15" height="15"></td>
614
               <td nowrap bgcolor="#F5F5F5"><span class="body_txt"><input name="listFilter" type="checkbox" value="'<%=enumDB_RELEASE_IN_RESTRICTIVE_MODE%>'" <%=GetIsListFilterChecked(enumDB_RELEASE_IN_RESTRICTIVE_MODE)%>>Restrictive Mode</span></td>
615
            </tr>
616
            <tr>
617
               <td bgcolor="#F5F5F5"><img src="images/i_rtag_ccb_mode.gif" width="15" height="15"></td>
618
               <td bgcolor="#F5F5F5"><span class="body_txt"><input name="listFilter" type="checkbox" value="'<%=enumDB_RELEASE_IN_CCB_MODE%>'" <%=GetIsListFilterChecked(enumDB_RELEASE_IN_CCB_MODE)%>>CCB Mode</span></td>
619
            </tr>
620
            <tr>
621
               <td bgcolor="#F5F5F5"><img src="images/i_rtag_closed_mode.gif" width="15" height="14"></td>
622
               <td bgcolor="#F5F5F5"><span class="body_txt"><input name="listFilter" type="checkbox" value="'<%=enumDB_RELEASE_IN_CLOSED_MODE%>'" <%=GetIsListFilterChecked(enumDB_RELEASE_IN_CLOSED_MODE)%>>Closed Mode</span></td>
623
            </tr>
624
            <tr>
625
               <td bgcolor="#F5F5F5"><img src="images/i_rtag_closed_mode_warn.gif" width="15" height="14"></td>
626
               <td bgcolor="#F5F5F5"><span class="body_txt"><input name="listFilter" type="checkbox" value="'<%=enumDB_RELEASE_IN_CLOSED_WARN%>'" <%=GetIsListFilterChecked(enumDB_RELEASE_IN_CLOSED_WARN)%>>Closed Aged</span></td>
627
            </tr>
628
            <tr>
629
               <td bgcolor="#F5F5F5"><img src="images/i_rtag_preserve_mode.gif" width="15" height="14"></td>
630
               <td bgcolor="#F5F5F5"><span class="body_txt"><input name="listFilter" type="checkbox" value="'<%=enumDB_RELEASE_IN_PRESERVE_MODE%>'" <%=GetIsListFilterChecked(enumDB_RELEASE_IN_PRESERVE_MODE)%>>Preserve Mode</span></td>
631
            </tr>
632
            <tr>
633
               <td bgcolor="#F5F5F5"><img src="images/i_rtag_archive_mode.gif" width="15" height="14"></td>
634
               <td bgcolor="#F5F5F5"><span class="body_txt"><input name="listFilter" type="checkbox" value="'<%=enumDB_RELEASE_IN_ARCHIVE_MODE%>'" <%=GetIsListFilterChecked(enumDB_RELEASE_IN_ARCHIVE_MODE)%>>Archive Mode</span></td>
635
            </tr>
636
            <%If NOT bIsaTreeView Then%>
637
             <tr>
638
                <td>&nbsp;</td>
639
                <td><input name="btn" type="submit" class="form_btn" value="Update"></td>
640
             </tr>
641
             <%End If%>
642
         </table>
643
      </td>
644
      <td rowspan="2" valign="top" width="100%">
645
         <!-- ACTION BUTTONS ---------------------------------------------->
646
         <table width="100%"  border="0" cellspacing="0" cellpadding="7" style="background-color:#DAD7C8">
647
            <tr>
648
               <td width="1">
649
                  <%
650
                  If bIsaTreeView Then
651
                     Response.write LIMG_TREE_VIEW
652
                  Else
653
                     Response.write LIMG_LIST_VIEW
654
                  End If
655
                  %>
656
               </td>
657
               <td width="100%">
658
                  <%
659
                  Dim aBtnsDef
660
                  ' Define action buttons
6508 dpurdie 661
                  aBtnsDef = Array("btnNewRelease", "width=5", "btnMergeManager", "width=5", "btnAdminView", "width=5", "btnNotificationView")
5357 dpurdie 662
 
663
                  ' Load action buttons from database
664
                  Call objBtnControl.LoadActionButtons ( aBtnsDef, OraDatabase )
665
 
666
                  ' Set spacing to minimum between buttons
667
                  objBtnControl.ButtonSpacer = 0
668
                  objBtnControl.ImageHspace = 2
669
 
670
                  ' Access Control
671
                  If NOT canActionControlInProject("CreateNewRelease") Then Call objBtnControl.Active ( "btnNewRelease", "N" )
672
                  If NOT canActionControlInProject("ConfigureRelease") Then Call objBtnControl.Active ( "btnMoveRelease", "N" )
673
 
674
                  ' -- Render Buttons
675
                  Call objBtnControl.Render  ( aBtnsDef, objAccessControl )
676
                  %>
677
               </td>
678
            </tr>
679
         </table>
680
         <!-- ACTION BUTTONS END  ------------------------------------------>
681
         <!-- RELEASE INFORMATION  ----------------------------------------->
682
         <table id=releaseTree width="100%"  border="0" cellspacing="10" cellpadding="0">
683
               <tr>
684
                  <td>
685
                     <!-- TREE VIEW ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
686
                     <%If bIsaTreeView Then%>
687
                        <table width="100%"  border="0" cellspacing="1" cellpadding="1">
688
                           <tr class='form_field_bg' style="height:21px">
689
                              <td width="25%" class="body_txt">Release Name </td>
690
 
691
                              <%If parProjId <> 2 Then %>
692
                                 <td width="15%" class="body_txt">Created</td>
693
                                 <td width="47%" class="body_txt">Comments</td>
694
                              <%Else%>
695
                                 <td width="15%" class="body_txt">Created</td>
696
                                 <td width="25%" class="body_txt">Used By </td>
697
                                 <td width="22%" class="body_txt">Comments</td>
698
                              <%End If%>
699
                           <td width="1%" nowrap class="body_txt">Lxr</td>
700
                           <td width="3%" nowrap class="body_txt">Daemon&nbsp;Status</td>
701
                           </tr>
702
                           <%
703
                           OraDatabase.Parameters.Add "PROJ_ID",  parProjId,  ORAPARM_INPUT, ORATYPE_NUMBER
5394 dpurdie 704
                           OraDatabase.Parameters.Add "USER_ID",  objAccessControl.UserId,  ORAPARM_INPUT, ORATYPE_NUMBER
5357 dpurdie 705
 
706
                           Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ReleaseVersionTree.sql") , ORADYN_DEFAULT )
707
                           lastLevel = 0
708
 
5394 dpurdie 709
                           OraDatabase.Parameters.Remove "USER_ID"
5357 dpurdie 710
                           OraDatabase.Parameters.Remove "PROJ_ID"
711
 
712
                           Dim lastRtagId, parentRtag_id
713
 
714
                           If rsQry.RecordCount > 0 Then
715
 
716
                              Set objDmSts = New DaemonStatus
717
                              Call objDmSts.GetDaemonStatus(parProjId)
718
 
719
                              While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
720
                                 currLevel = CInt(rsQry("hierarchy"))
6576 dpurdie 721
                                 createdBy = rsQry("created_stamp") & " by " & rsQry("creator")
722
                                 lastMod = rsQry("lastModified") 
723
                                 hoverTitle = "State Last Change : "& rsQry("OFFICIAL_STAMP") & " by " & rsQry("modifier") & ". " & rsQry("OFFICIAL_STAMP_DAYS")& " Days ago" &_
724
                                         "&#10;Content Last Modified: " & lastMod & ". " & rsQry("LastModified_DAYS")& " Days ago" 
725
 
5394 dpurdie 726
                                 If rsQry("userCanDelete") = 1 Then
727
                                     createdBy = createdBy & "<br>Creator can delete"
728
                                 End If
5357 dpurdie 729
 
730
                                 %>
731
                                 <tr class="body_rowg2">
732
                                    <td nowrap>
733
                                       <%Call RenderIndent( lastLevel, currLevel )%>
5394 dpurdie 734
                                       <%Call RenderActions(rsQry("rtag_id"),rsQry("official"),rsQry("userCanDelete"))%>
6576 dpurdie 735
                                       <a href="dependencies.asp?rtag_id=<%=rsQry("rtag_id")%>" class="body_link" >
5357 dpurdie 736
                                       <%=ReleaseIcon( rsQry("official") )%>&nbsp;<%=rsQry("rtag_name")%></a>
737
                                    </td>
6576 dpurdie 738
                                    <td nowrap  valign=top title="<%=hoverTitle%>"><img src="icons/s_note.gif" height="10" width="10" >&nbsp;</img><%=createdBy%>
5357 dpurdie 739
                                    <%
740
                                    If parProjId = 2 Then
741
                                       comment = GetMassRefComments(rsQry("rtag_id"))
742
                                       If comment = "" Then comment = "None."
743
                                       %>
744
                                       <td><%=comment%></td>
745
                                    <%End If%>
746
 
747
                                    <td><%=NewLine_To_BR(rsQry("description"))%></td>
748
                                    <td nowrap valign="top"><%Call RenderLxrState() %></td>
749
                                    <td valign="top"><%Call RenderDaemonStatusConfig(rsQry("rtag_id"))%></td>
750
                                 </tr>
751
                                 <%
752
                                 lastLevel = currLevel
753
                                 rsQry.MoveNext
754
                              WEnd
755
                              Set objDmSts = Nothing
756
                           End If
757
                           rsQry.Close
758
                           Set rsQry = Nothing
759
                           %>
760
                        </table>
761
                     <!-- LIST VIEW ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
762
                     <%Else%>
763
                        <table width="100%"  border="0" cellspacing="1" cellpadding="1">
764
                           <tr class='form_field_bg'>
765
                              <td width="1%">&nbsp;</td>
766
                              <td width="20%" class="body_txt">Release Name </td>
767
                              <td width="10%" class="body_txt">Created</td>
768
                              <%If parProjId <> 2 Then %>
769
                                 <td width="47%" class="body_txt">Comments</td>
770
                              <%Else%>
771
                                 <td width="24%" class="body_txt">Used By </td>
772
                                 <td width="22%" class="body_txt">Comments</td>
773
                              <%End If%>
774
                              <td width="1%" class="body_txt" title="LXR Support enabled">Lxr</td>
775
                              <td width="3%" class="body_txt">Daemon Status</td>
776
                           </tr>
777
                           <%
5394 dpurdie 778
                              OraDatabase.Parameters.Add "PROJ_ID",  parProjId,                ORAPARM_INPUT, ORATYPE_NUMBER
779
                              OraDatabase.Parameters.Add "USER_ID",  objAccessControl.UserId,  ORAPARM_INPUT, ORATYPE_NUMBER
5357 dpurdie 780
 
781
                              rsQryStr = GetQuery ("ReleaseVersionList.sql")
782
                              rsQryStr = Replace(rsQryStr, "/*SHOW_FILTER*/", parShowFilter)
783
 
784
                              Set rsQry = OraDatabase.DbCreateDynaset( rsQryStr, ORADYN_DEFAULT )
785
 
5394 dpurdie 786
                              OraDatabase.Parameters.Remove "USER_ID"
5357 dpurdie 787
                              OraDatabase.Parameters.Remove "PROJ_ID"
788
 
789
                              If rsQry.RecordCount > 0 Then
790
 
791
                                 Set objDmSts = New DaemonStatus
792
                                 Call objDmSts.GetDaemonStatus(parProjId)
793
 
794
                                 While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
795
                                    createdBy = rsQry("created_stamp") & " by " & rsQry("creator")
6576 dpurdie 796
                                    lastMod = rsQry("LastModified")
797
                                    hoverTitle = "State Last Change : "& rsQry("OFFICIAL_STAMP") & " by " & rsQry("modifier") & ". " & rsQry("OFFICIAL_STAMP_DAYS")& " Days ago" &_
798
                                            "&#10;Content Last Modified: " & lastMod & ". " & rsQry("LastModified_DAYS")& " Days ago" 
5394 dpurdie 799
                                    If rsQry("userCanDelete") = 1 Then
800
                                        createdBy = createdBy & "<br>Creator can delete"
801
                                    End If
5357 dpurdie 802
 
803
                                    %>
804
                                    <tr class="body_rowg2">
805
                                       <td valign="top">
5394 dpurdie 806
                                          <%Call RenderActions(rsQry("rtag_id"),rsQry("official"),rsQry("userCanDelete"))%>
5357 dpurdie 807
                                       </td>
808
                                       <td nowrap valign="top">
6576 dpurdie 809
                                          <a href="dependencies.asp?rtag_id=<%=rsQry("rtag_id")%>" class="body_link" >
5357 dpurdie 810
                                          <%=ReleaseIcon( rsQry("official"))%>&nbsp;<%=rsQry("rtag_name")%></a>
811
                                       </td>
6576 dpurdie 812
                                       <td nowrap  valign=top title="<%=hoverTitle%>"><img src="icons/s_note.gif" height="10" width="10" >&nbsp;</img><%=createdBy%>
5357 dpurdie 813
                                       <%
814
                                       If parProjId = 2 Then
815
                                          comment = GetMassRefComments(rsQry("rtag_id"))
816
                                          If comment = "" Then comment = "None."
817
                                          %>
818
                                            <td><%=comment%></td>
819
                                       <%End If%>
820
                                       <td><%=NewLine_To_BR(  rsQry("description")   )%></td>
821
                                       <td nowrap valign="top"><%Call RenderLxrState() %></td>
822
                                       <td valign="top"><%Call RenderDaemonStatusConfig(rsQry("rtag_id"))%>
823
                                       </td>
824
                                    </tr>
825
                                    <%
826
                                    rsQry.MoveNext
827
                                 WEnd
828
                                 Set objDmSts = Nothing
829
                              End If
830
                              rsQry.Close
831
                              Set rsQry = Nothing
832
                              %>
833
                        </table>
834
                     <%End If%>
835
                     <!-- LIST VIEW END ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
836
                     <%=objPMod.ComposeHiddenTags()%>
837
                     <input type="hidden" name="action" value="true">
838
                     </form>
839
                     <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
840
                     <!--#include file="messages/_msg_inline.asp"-->
841
                     <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
842
                  </td>
843
               </tr>
844
         </table>
845
      </td>
846
      <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
847
   </tr>
848
   <tr>
849
      <td valign="bottom" align="center" background="images/bg_home_orange.gif">
850
      </td>
851
   </tr>
852
</table>
853
<!-- Dropdown Menu -->
854
<div id=testdiv></div>
855
<div >
856
  <ul id="select-menu" style="display:none;">
857
   <li data-opr="open" title="Goto this Release">Open ...</li>
858
    <li data-opr="edit" title="Edit the properties of the Release">Edit Properties</li>
859
    <li <%=iif(bCanMove,"data-opr=move","class=ui-state-disabled")%> title="Change the order in which releases are displayed">Change display order</li>
860
    <li>-</li>
861
    <li data-opr="mergeSelect" title="Select as the source (left side) of a merge or comparison">Select for Merge/Diff</li>
862
    <li id="select-menu-merge" data-opr="merge" title="Merge or Compare from selected release to this release">Merge/Diff from selected</li>
863
    <li>-</li>
864
    <li id="select-menu-close" data-opr="close">Close Release</li>
865
    <li id="select-menu-preserve" data-opr="preserve" >Preserve Release</li>
866
    <li id="select-menu-archive" data-opr="archive" >Archive Release</li>
867
    <li>-</li>
868
    <li <%=iif(bCanClone,"data-opr=clone","class=ui-state-disabled")%> title="Create a new Release based on selected Release">Clone Release</li>
869
    <li>-</li>
5394 dpurdie 870
    <li id="select-menu-destroy" data-opr="delete", title="Delete the selected Release">Destroy Release</li>
5357 dpurdie 871
    <li>-</li>
872
    <li>Close Menu</li>
873
  </ul>
874
</div>
875
<map name="mapviewtype">
876
  <area shape="rect" coords="2,2,69,23" href="<%=ScriptName%>?viewtype=1&<%=objPMod.ComposeURL()%>" title="Switch to List View">
877
  <area shape="rect" coords="73,2,143,23" href="<%=ScriptName%>?viewtype=2&<%=objPMod.ComposeURL()%>" title="Switch to Tree View">
878
</map>
5957 dpurdie 879
<!-- FOOTER -->
880
<!--#include file="_footer.asp"-->
5357 dpurdie 881
</body>
882
</html>