Subversion Repositories DevTools

Rev

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