Subversion Repositories DevTools

Rev

Rev 6876 | Rev 6892 | 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);
6697 dpurdie 405
                  this.closeRelease('Close', data.rtagid , 3);
5357 dpurdie 406
             },
407
 
408
             preserve : function (data) {
409
                 //console.log("Preserving:", data.rtagid);
6697 dpurdie 410
                  this.closeRelease('Preserve', data.rtagid , 6);
5357 dpurdie 411
             },
412
 
413
             archive : function (data) {
414
                 //console.log("Archiving:", data.rtagid);
6697 dpurdie 415
                  this.closeRelease('Archive', data.rtagid , 5);
5357 dpurdie 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;
6697 dpurdie 422
                 vixConfirm("This Release will be permanently destroyed.<p>Are you sure?", { 
423
                    deferred : true, 
424
                    title: 'Destroy Release', 
425
                    button : 'Destroy Release',
426
                    icon : 'images/i_critical.gif' }
5357 dpurdie 427
                 ).done(function(){
428
                     that.gotoUrl("_destroy_release.asp", {rtag_id_list : data.rtagid, proj_id : <%=parProjId%>, rfile : "<%=ScriptName%>"});
429
                 }).fail(function(){
430
                     $('#releaseTree .body_row_sel_outline').removeClass('body_row_sel_outline');
431
                 });
432
             },
433
<%End If%>
434
<%If bCanMove Then%>
435
             move : function (data) {
436
                 //console.log("Move:", data.rtagid);
437
                 this.gotoUrl("form_move_release.asp", { rtag_id_list : data.rtagid, proj_id : <%=parProjId%> });
438
             },
439
<%End If%>
440
<%If bCanClone Then%>
441
             clone : function(data) {
442
                 //console.log("Clone:", data.rtagid);
443
                 this.gotoUrl("new_release.asp", { rtag_id_list : data.rtagid, proj_id : <%=parProjId%>, branch : "Y" });
444
             },
445
<%End If%>
446
 
6697 dpurdie 447
             // Confirm Close/Preserve/Archive
448
             closeRelease : function (text, rtag_id, mode) {
449
                  var that = this;
450
                  $.miniMenu.currentRow.addClass('body_row_sel_outline');
451
                  vixConfirm("Are you sure you want to '" + text + "' this Release", { deferred : true } )
452
                    .done(function(){
453
                      that.gotoUrl("_change_release_mode.asp", {rtag_id : rtag_id, mode_code : mode , rfile : "<%=ScriptName%>"});
454
                    })
455
                    .fail(function(){
456
                            $('#releaseTree .body_row_sel_outline').removeClass('body_row_sel_outline');
457
                        });
458
             },
459
 
5357 dpurdie 460
             //
461
             // Internal functions
462
             // Goto url, or open in new tab
463
             gotoUrl: function (url, params)
464
             {
465
                 // Open in new tab - not as simple as it sounds
466
                 // Need to create a form and submit it
467
                 if(this.event.shiftKey){
468
                     var form = $('<form>',{
469
                         action : url,
470
                         target : '_blank',
471
                         //method : 'GET'
472
                         });
473
 
474
                     $.each(params,function(n,v){
475
                         var item = $('<input>',{
476
                             name : n,
477
                             value : v
478
                         });
479
                         form.append(item);
480
                        });
481
 
482
 
483
                     form.appendTo(document.body);
484
                     form.submit();
485
                     form.remove();
486
                 }
487
                 else {
488
                     if (params)
489
                         url += '?' + jQuery.param(params)
490
                     window.location.href = url;
491
                 }
492
             },
493
    };
494
 
495
    // Create and Hide the Menu
496
    $( "#select-menu" ).hide().menu();
497
 
498
    // Register menuselect event handler
499
    $( "#select-menu" ).on( "menuselect", function( event, ui ) {
500
       var opr = ui.item.data('opr');
501
 
502
        // Invoke operation within the menu data structure
503
        if (typeof $.miniMenu[opr] == 'function' ) {
504
            $.miniMenu['event'] = event;
505
            $.miniMenu[opr]($.miniMenu);
506
            return;
507
        }
508
        //console.log ("Menu Operation:", opr, "Not found");
509
    });
510
 
511
 
512
    // Add menu to all require instances
513
   $( ".select-operation" ).click(function(event) {
514
        // When clicked - create and show the menu
515
        // Insert rtag-id
516
 
517
       // In order to have the menu positioing work correctly
518
       //   Create a div that covers the visible screen area
519
       //   Us it within the menu poistioning
520
       //   Then delete it again
521
       var positionDiv = $( "<div></div>" ).css({
522
               position: 'absolute', 
523
               top : $(document).scrollTop(), 
524
               left : $(document).scrollLeft(),
525
               width: '100vw',
526
               height: '100vh',
527
               'z-index' : -1,
528
           });
529
       positionDiv.appendTo(document.body);
530
 
531
        //  Create the menu
532
        var menu = $("#select-menu").show().position({
533
             my: "left top",
534
             at: "center bottom",
535
             of: this,
536
             within : positionDiv,
537
        });
538
 
539
        // Cleanup the poistioning div
540
        positionDiv.remove();
541
 
542
        // Setup global data
543
        $.miniMenu.rtagid = $(this).data('rtag-id');
544
 
545
        // Set initial menu state - merge target
546
        $('#select-menu-merge').toggleClass('ui-state-disabled',!('mergeLeft' in $.miniMenu ));
547
 
548
        // Set initial state close/archive
549
        //
550
        var official = $(this).data('official');
551
        $('#select-menu-close').toggleClass('ui-state-disabled',! $.mode2access.canAccess(official,0));
552
        $('#select-menu-preserve').toggleClass('ui-state-disabled',!$.mode2access.canAccess(official,1));
553
        $('#select-menu-archive').toggleClass('ui-state-disabled',! $.mode2access.canAccess(official,2));
554
 
5394 dpurdie 555
        // Set initial state destroy
556
        var canDestroy = $(this).data('candelete') || <%=iif(bCanDestroy,"1","0")%>
557
        $('#select-menu-destroy').toggleClass('ui-state-disabled',(canDestroy == 0));
558
 
5357 dpurdie 559
        // Highlight the row selected
560
        $('#releaseTree .body_row_sel').removeClass('body_row_sel');
561
        $.miniMenu.currentRow = $(event.target).closest('tr').addClass('body_row_sel');
562
 
563
        // Allow click outside of the menu to close it
564
        $( document ).one( "click", function() {
565
            menu.hide();
566
            $('#releaseTree .body_row_sel').removeClass('body_row_sel');
567
        });
568
 
569
 
570
        // Prevent propagation of event
571
        return false;
572
    });
573
});
574
</script>
575
 
576
</head>
577
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
578
<!-- HEADER -->
579
<!--#include file="_header.asp"-->
580
<!-- BODY ---->
581
<%Call GetListFilterValues ( dListFilter )%>
582
<form name="FormName" method="post" action="<%=ScriptName%>">
583
<table width="100%" border="0" cellspacing="0" cellpadding="0">
584
   <tr>
6876 dpurdie 585
      <td class='bg_panel'>
5357 dpurdie 586
         <!-- ICON STATUS and FILTER -------------------------------------->
587
         <table width="118" border="0" align="left" style="margin-top: 38px;">
588
            <tr>
589
               <td bgcolor="#E4E9EC" width="26"><span class="body_txt">Icon</span></td>
590
               <td bgcolor="#E4E9EC" width="82"><span class="body_txt">Release State </span></td>
591
            </tr>
592
            <tr>
593
               <td bgcolor="#F5F5F5"><img src="images/i_rtag_open_mode.gif" width="15" height="13"></td>
594
               <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>
595
            </tr>
596
            <tr>
597
               <td bgcolor="#F5F5F5"><img src="images/i_rtag_restrictive_mode.gif" width="15" height="15"></td>
598
               <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>
599
            </tr>
600
            <tr>
601
               <td bgcolor="#F5F5F5"><img src="images/i_rtag_ccb_mode.gif" width="15" height="15"></td>
602
               <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>
603
            </tr>
604
            <tr>
605
               <td bgcolor="#F5F5F5"><img src="images/i_rtag_closed_mode.gif" width="15" height="14"></td>
606
               <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>
607
            </tr>
608
            <tr>
609
               <td bgcolor="#F5F5F5"><img src="images/i_rtag_closed_mode_warn.gif" width="15" height="14"></td>
610
               <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>
611
            </tr>
612
            <tr>
613
               <td bgcolor="#F5F5F5"><img src="images/i_rtag_preserve_mode.gif" width="15" height="14"></td>
614
               <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>
615
            </tr>
616
            <tr>
617
               <td bgcolor="#F5F5F5"><img src="images/i_rtag_archive_mode.gif" width="15" height="14"></td>
618
               <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>
619
            </tr>
620
            <%If NOT bIsaTreeView Then%>
621
             <tr>
622
                <td>&nbsp;</td>
623
                <td><input name="btn" type="submit" class="form_btn" value="Update"></td>
624
             </tr>
625
             <%End If%>
626
         </table>
627
      </td>
628
      <td rowspan="2" valign="top" width="100%">
629
         <!-- ACTION BUTTONS ---------------------------------------------->
630
         <table width="100%"  border="0" cellspacing="0" cellpadding="7" style="background-color:#DAD7C8">
631
            <tr>
632
               <td width="1">
633
                  <%
634
                  If bIsaTreeView Then
635
                     Response.write LIMG_TREE_VIEW
636
                  Else
637
                     Response.write LIMG_LIST_VIEW
638
                  End If
639
                  %>
640
               </td>
641
               <td width="100%">
642
                  <%
643
                  Dim aBtnsDef
644
                  ' Define action buttons
6770 dpurdie 645
                  aBtnsDef = Array("btnNewRelease", "width=5", "btnMergeManager", "width=5", "btnAdminView", "width=5", "btnNotificationView","width=5", "btnProjectReplication")
5357 dpurdie 646
 
647
                  ' Load action buttons from database
648
                  Call objBtnControl.LoadActionButtons ( aBtnsDef, OraDatabase )
649
 
650
                  ' Set spacing to minimum between buttons
651
                  objBtnControl.ButtonSpacer = 0
652
                  objBtnControl.ImageHspace = 2
653
 
654
                  ' Access Control
655
                  If NOT canActionControlInProject("CreateNewRelease") Then Call objBtnControl.Active ( "btnNewRelease", "N" )
656
                  If NOT canActionControlInProject("ConfigureRelease") Then Call objBtnControl.Active ( "btnMoveRelease", "N" )
657
 
658
                  ' -- Render Buttons
659
                  Call objBtnControl.Render  ( aBtnsDef, objAccessControl )
660
                  %>
661
               </td>
662
            </tr>
663
         </table>
664
         <!-- ACTION BUTTONS END  ------------------------------------------>
665
         <!-- RELEASE INFORMATION  ----------------------------------------->
666
         <table id=releaseTree width="100%"  border="0" cellspacing="10" cellpadding="0">
667
               <tr>
668
                  <td>
669
                     <!-- TREE VIEW ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
670
                     <%If bIsaTreeView Then%>
6827 dpurdie 671
                        <table width="100%"  border="0" cellspacing="1" cellpadding="1" class=stdGrey>
672
                            <thead>
673
                               <tr class='form_field_bg' style="height:21px">
674
                                  <th width="25%" class="body_txt">Release Name </th>
5357 dpurdie 675
 
6827 dpurdie 676
                                  <%If parProjId <> 2 Then %>
677
                                     <th width="15%" class="body_txt">Created</th>
678
                                     <th width="47%" class="body_txt">Comments</th>
679
                                  <%Else%>
680
                                     <th width="15%" class="body_txt">Created</th>
681
                                     <th width="25%" class="body_txt">Used By </th>
682
                                     <th width="22%" class="body_txt">Comments</th>
683
                                  <%End If%>
684
                               <th width="1%" nowrap class="body_txt">Lxr</th>
685
                               <th width="3%" nowrap class="body_txt">Daemon&nbsp;Status</th>
686
                               </tr>
687
                            </thead>
5357 dpurdie 688
                           <%
689
                           OraDatabase.Parameters.Add "PROJ_ID",  parProjId,  ORAPARM_INPUT, ORATYPE_NUMBER
5394 dpurdie 690
                           OraDatabase.Parameters.Add "USER_ID",  objAccessControl.UserId,  ORAPARM_INPUT, ORATYPE_NUMBER
5357 dpurdie 691
 
692
                           Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ReleaseVersionTree.sql") , ORADYN_DEFAULT )
693
                           lastLevel = 0
694
 
5394 dpurdie 695
                           OraDatabase.Parameters.Remove "USER_ID"
5357 dpurdie 696
                           OraDatabase.Parameters.Remove "PROJ_ID"
697
 
698
                           Dim lastRtagId, parentRtag_id
699
 
700
                           If rsQry.RecordCount > 0 Then
701
 
702
                              Set objDmSts = New DaemonStatus
703
                              Call objDmSts.GetDaemonStatus(parProjId)
704
 
705
                              While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
706
                                 currLevel = CInt(rsQry("hierarchy"))
6576 dpurdie 707
                                 createdBy = rsQry("created_stamp") & " by " & rsQry("creator")
708
                                 lastMod = rsQry("lastModified") 
709
                                 hoverTitle = "State Last Change : "& rsQry("OFFICIAL_STAMP") & " by " & rsQry("modifier") & ". " & rsQry("OFFICIAL_STAMP_DAYS")& " Days ago" &_
710
                                         "&#10;Content Last Modified: " & lastMod & ". " & rsQry("LastModified_DAYS")& " Days ago" 
711
 
5394 dpurdie 712
                                 If rsQry("userCanDelete") = 1 Then
713
                                     createdBy = createdBy & "<br>Creator can delete"
714
                                 End If
5357 dpurdie 715
 
716
                                 %>
6827 dpurdie 717
                                 <tr>
5357 dpurdie 718
                                    <td nowrap>
719
                                       <%Call RenderIndent( lastLevel, currLevel )%>
5394 dpurdie 720
                                       <%Call RenderActions(rsQry("rtag_id"),rsQry("official"),rsQry("userCanDelete"))%>
6576 dpurdie 721
                                       <a href="dependencies.asp?rtag_id=<%=rsQry("rtag_id")%>" class="body_link" >
5357 dpurdie 722
                                       <%=ReleaseIcon( rsQry("official") )%>&nbsp;<%=rsQry("rtag_name")%></a>
723
                                    </td>
6576 dpurdie 724
                                    <td nowrap  valign=top title="<%=hoverTitle%>"><img src="icons/s_note.gif" height="10" width="10" >&nbsp;</img><%=createdBy%>
5357 dpurdie 725
                                    <%
726
                                    If parProjId = 2 Then
727
                                       comment = GetMassRefComments(rsQry("rtag_id"))
728
                                       If comment = "" Then comment = "None."
729
                                       %>
730
                                       <td><%=comment%></td>
731
                                    <%End If%>
732
 
733
                                    <td><%=NewLine_To_BR(rsQry("description"))%></td>
734
                                    <td nowrap valign="top"><%Call RenderLxrState() %></td>
735
                                    <td valign="top"><%Call RenderDaemonStatusConfig(rsQry("rtag_id"))%></td>
736
                                 </tr>
737
                                 <%
738
                                 lastLevel = currLevel
739
                                 rsQry.MoveNext
740
                              WEnd
741
                              Set objDmSts = Nothing
742
                           End If
743
                           rsQry.Close
744
                           Set rsQry = Nothing
745
                           %>
746
                        </table>
747
                     <!-- LIST VIEW ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
748
                     <%Else%>
6827 dpurdie 749
                        <table width="100%"  border="0" cellspacing="1" cellpadding="1" class='stdGrey'>
750
                            <thead>
751
                               <tr'>
752
                                  <th width="1%">&nbsp;</th>
753
                                  <th width="20%" >Release Name </th>
754
                                  <th width="10%" >Created</th>
755
                                  <%If parProjId <> 2 Then %>
756
                                     <th width="47%" >Comments</th>
757
                                  <%Else%>
758
                                     <th width="24%" >Used By </th>
759
                                     <th width="22%" >Comments</th>
760
                                  <%End If%>
761
                                  <th width="1%" title="LXR Support enabled">Lxr</th>
762
                                  <th width="3%">Daemon Status</th>
763
                               </tr>
764
                            </thead>
5357 dpurdie 765
                           <%
5394 dpurdie 766
                              OraDatabase.Parameters.Add "PROJ_ID",  parProjId,                ORAPARM_INPUT, ORATYPE_NUMBER
767
                              OraDatabase.Parameters.Add "USER_ID",  objAccessControl.UserId,  ORAPARM_INPUT, ORATYPE_NUMBER
5357 dpurdie 768
 
769
                              rsQryStr = GetQuery ("ReleaseVersionList.sql")
770
                              rsQryStr = Replace(rsQryStr, "/*SHOW_FILTER*/", parShowFilter)
771
 
772
                              Set rsQry = OraDatabase.DbCreateDynaset( rsQryStr, ORADYN_DEFAULT )
773
 
5394 dpurdie 774
                              OraDatabase.Parameters.Remove "USER_ID"
5357 dpurdie 775
                              OraDatabase.Parameters.Remove "PROJ_ID"
776
 
777
                              If rsQry.RecordCount > 0 Then
778
 
779
                                 Set objDmSts = New DaemonStatus
780
                                 Call objDmSts.GetDaemonStatus(parProjId)
781
 
782
                                 While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
783
                                    createdBy = rsQry("created_stamp") & " by " & rsQry("creator")
6576 dpurdie 784
                                    lastMod = rsQry("LastModified")
785
                                    hoverTitle = "State Last Change : "& rsQry("OFFICIAL_STAMP") & " by " & rsQry("modifier") & ". " & rsQry("OFFICIAL_STAMP_DAYS")& " Days ago" &_
786
                                            "&#10;Content Last Modified: " & lastMod & ". " & rsQry("LastModified_DAYS")& " Days ago" 
5394 dpurdie 787
                                    If rsQry("userCanDelete") = 1 Then
788
                                        createdBy = createdBy & "<br>Creator can delete"
789
                                    End If
5357 dpurdie 790
 
791
                                    %>
6827 dpurdie 792
                                    <tr>
5357 dpurdie 793
                                       <td valign="top">
5394 dpurdie 794
                                          <%Call RenderActions(rsQry("rtag_id"),rsQry("official"),rsQry("userCanDelete"))%>
5357 dpurdie 795
                                       </td>
796
                                       <td nowrap valign="top">
6576 dpurdie 797
                                          <a href="dependencies.asp?rtag_id=<%=rsQry("rtag_id")%>" class="body_link" >
5357 dpurdie 798
                                          <%=ReleaseIcon( rsQry("official"))%>&nbsp;<%=rsQry("rtag_name")%></a>
799
                                       </td>
6576 dpurdie 800
                                       <td nowrap  valign=top title="<%=hoverTitle%>"><img src="icons/s_note.gif" height="10" width="10" >&nbsp;</img><%=createdBy%>
5357 dpurdie 801
                                       <%
802
                                       If parProjId = 2 Then
803
                                          comment = GetMassRefComments(rsQry("rtag_id"))
804
                                          If comment = "" Then comment = "None."
805
                                          %>
806
                                            <td><%=comment%></td>
807
                                       <%End If%>
808
                                       <td><%=NewLine_To_BR(  rsQry("description")   )%></td>
809
                                       <td nowrap valign="top"><%Call RenderLxrState() %></td>
810
                                       <td valign="top"><%Call RenderDaemonStatusConfig(rsQry("rtag_id"))%>
811
                                       </td>
812
                                    </tr>
813
                                    <%
814
                                    rsQry.MoveNext
815
                                 WEnd
816
                                 Set objDmSts = Nothing
817
                              End If
818
                              rsQry.Close
819
                              Set rsQry = Nothing
820
                              %>
821
                        </table>
822
                     <%End If%>
823
                     <!-- LIST VIEW END ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
824
                     <%=objPMod.ComposeHiddenTags()%>
825
                     <input type="hidden" name="action" value="true">
826
                     </form>
827
                     <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
828
                     <!--#include file="messages/_msg_inline.asp"-->
829
                     <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
830
                  </td>
831
               </tr>
832
         </table>
833
      </td>
834
   </tr>
835
</table>
836
<!-- Dropdown Menu -->
837
<div id=testdiv></div>
838
<div >
839
  <ul id="select-menu" style="display:none;">
840
   <li data-opr="open" title="Goto this Release">Open ...</li>
841
    <li data-opr="edit" title="Edit the properties of the Release">Edit Properties</li>
842
    <li <%=iif(bCanMove,"data-opr=move","class=ui-state-disabled")%> title="Change the order in which releases are displayed">Change display order</li>
843
    <li>-</li>
844
    <li data-opr="mergeSelect" title="Select as the source (left side) of a merge or comparison">Select for Merge/Diff</li>
845
    <li id="select-menu-merge" data-opr="merge" title="Merge or Compare from selected release to this release">Merge/Diff from selected</li>
846
    <li>-</li>
847
    <li id="select-menu-close" data-opr="close">Close Release</li>
848
    <li id="select-menu-preserve" data-opr="preserve" >Preserve Release</li>
849
    <li id="select-menu-archive" data-opr="archive" >Archive Release</li>
850
    <li>-</li>
851
    <li <%=iif(bCanClone,"data-opr=clone","class=ui-state-disabled")%> title="Create a new Release based on selected Release">Clone Release</li>
852
    <li>-</li>
5394 dpurdie 853
    <li id="select-menu-destroy" data-opr="delete", title="Delete the selected Release">Destroy Release</li>
5357 dpurdie 854
    <li>-</li>
855
    <li>Close Menu</li>
856
  </ul>
857
</div>
858
<map name="mapviewtype">
859
  <area shape="rect" coords="2,2,69,23" href="<%=ScriptName%>?viewtype=1&<%=objPMod.ComposeURL()%>" title="Switch to List View">
860
  <area shape="rect" coords="73,2,143,23" href="<%=ScriptName%>?viewtype=2&<%=objPMod.ComposeURL()%>" title="Switch to Tree View">
861
</map>
5957 dpurdie 862
<!-- FOOTER -->
863
<!--#include file="_footer.asp"-->
5357 dpurdie 864
</body>
865
</html>