Subversion Repositories DevTools

Rev

Rev 6882 | Rev 6916 | 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>
6892 dpurdie 210
     <td class=nowrap>
211
      <img src='icons/i_edit.gif' border=0 vspace=0 hspace=0 title='Configure Daemons' onclick='location.href="release_config.asp?rtag_id=<%=nRtagId%>"'>
212
      <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%>"'>
5357 dpurdie 213
     </td>
214
     <td>
215
   <%
216
    Call objDmSts.RenderDaemonStatus(nRtagId,16)
217
    %>
218
        </td>
219
        </tr>
220
        </table>
221
    <%
222
End Sub
223
 
224
'----------------------------------------------------------------------------------------------------------------------------------------------
225
Sub RenderLxrState()
226
    Response.Write RenderLxrStateString(rsQry("rtag_id"),rsQry("lxr"),rsQry("lxrserver"),rsQry("official"),"")
227
End Sub
228
'----------------------------------------------------------------------------------------------------------------------------------------------
5394 dpurdie 229
Function RenderActions(nRtagId, sOfficial, nCanDelete)
230
    Response.Write "<span title='Select operation from dropdown menu' " &_
231
                       "class='select-operation ui-icon ui-icon-triangle-1-s' " &_
232
                       "data-rtag-id='" & nRtagId &_
233
                       "' data-official='"& sOfficial &_
234
                       "' data-candelete='"& nCanDelete &_
235
                       "' style='display:inline-block'>"&_
236
                   "</span>"
5357 dpurdie 237
End Function
238
'----------------------------------------------------------------------------------------------------------------------------------------------
239
Function GetMassRefComments (nRtagId)
240
   Dim UsedBy
241
   Dim rsQryUse
242
   Dim linkB
243
   Dim joiner : joiner = ""
244
   Dim comment : comment = ""
245
 
246
'   If parProjId <> 2 Then
247
'     assocMASSREF = rsQry("assoc_mass_ref")
248
'     If assocMASSREF <> "" Then
249
'        Set rsQryAssoc = OraDatabase.DbCreateDynaset("SELECT RTAG_NAME, RTAG_ID FROM RELEASE_TAGS WHERE RTAG_ID="&assocMASSREF , ORADYN_DEFAULT)
250
'        assocMASSREFName = rsQryAssoc("RTAG_NAME")
251
'        link = rsQryAssoc("rtag_id")
252
'        rsQryAssoc.Close
253
'        Set rsQryAssoc = Nothing
254
'     Else
255
'        assocMASSREFName = "None."
256
'     End If
257
'   Else
258
      UsedBy = nRtagId
259
      If UsedBy <> "" Then
260
         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)
261
 
262
         While ((NOT rsQryUse.BOF) AND (NOT rsQryUse.EOF))
263
            If rsQryUse("assoc_mass_ref") = UsedBy Then
264
               linkB = "dependencies.asp?rtag_id="&rsQryUse("rtag_id")
265
               comment = joiner & rsQryUse("proj_name") & " -> <a href="&linkB&">"& rsQryUse("rtag_name") &"</a>"
266
               joiner = " <br> "
267
               rsQryUse.MoveNext
268
            End If
269
         WEnd
270
         rsQryUse.Close
271
         Set rsQryUse = Nothing
272
      End If
273
      GetMassRefComments = comment
274
End Function
275
'----------------------------------------------------------------------------------------------------------------------------------------------
276
%>
277
<%
278
'------------ RUN BEFORE PAGE RENDER ----------
279
If (Request("action") <> "") Then
280
 
281
   If Request("btn") = "Update" Then
282
      ' Store filter in cookie
283
      Response.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("show_filter") = Request("listFilter")
284
      parShowFilter = Request("listFilter")
285
      If IsNull(parShowFilter) OR parShowFilter = "" Then parShowFilter = DEFAULT_SHOW_FILTER
286
   End If
287
 
288
End If
289
 
290
' Set view type  if required
291
Call SetViewType ()
292
 
293
' Get current view type
294
ViewType = GetViewType()
295
bIsaTreeView = (ViewType = LCONST_TREE_VIEW)
296
 
297
'----------------------------------------------
298
%>
299
<html>
300
<head>
301
<%
302
   Set rsQry = OraDatabase.DbCreateDynaset( "SELECT PROJ_NAME FROM PROJECTS WHERE PROJ_ID="& parProjId, ORADYN_DEFAULT )
303
%>
304
<title><%=rsQry("proj_name")%></title>
305
<link rel="shortcut icon" href="<%=FavIcon%>"/>
306
<%
307
   rsQry.Close
308
   Set rsQry = Nothing
309
%>
310
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
311
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 312
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
313
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
314
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 315
<!-- DROPDOWN MENUS -->
316
<!--#include file="_menu_def.asp"-->
6579 dpurdie 317
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 318
 
319
<!-- Dropdown action menu scripts -->
320
<style>
321
    .ui-menu { position: absolute; }
322
</style>
323
<!--#include file="_jquery_includes.asp"-->
324
<script>
325
    $(function() {
326
        // Global menu data structure
327
        //  Persist between invocations of the menu
328
        //      Used to mergeLeft rtagid
329
        //      Used to store current menu info
330
        $.acData = {
331
            //  Data
332
            bCanOpenToClose                 : <%=iif(bCanOpenToClose          , "true", "false")%> ,             
333
            bCanRestrictiveToClose          : <%=iif(bCanRestrictiveToClose   , "true", "false")%> ,
334
            bCanCloseToClose                : <%=iif(bCanCloseToClose         , "true", "false")%> ,
335
            bCanPreserveToClose             : <%=iif(bCanPreserveToClose      , "true", "false")%> ,
336
            bCanArchiveToClose              : <%=iif(bCanArchiveToClose       , "true", "false")%> ,
337
 
338
            bCanOpenToPreserve              : <%=iif(bCanOpenToPreserve       , "true", "false")%> ,
339
            bCanRestrictiveToPreserve       : <%=iif(bCanRestrictiveToPreserve, "true", "false")%> ,
340
            bCanCloseToPreserve             : <%=iif(bCanCloseToPreserve      , "true", "false")%> ,
341
            bCanPreserveToPreserve          : <%=iif(bCanPreserveToPreserve   , "true", "false")%> ,
342
            bCanArchiveToPreserve           : <%=iif(bCanArchiveToPreserve    , "true", "false")%> ,
343
 
344
            bCanOpenToArchive               : <%=iif(bCanOpenToArchive        , "true", "false")%> ,
345
            bCanRestrictiveToArchive        : <%=iif(bCanRestrictiveToArchive , "true", "false")%> ,
346
            bCanCloseToArchive              : <%=iif(bCanCloseToArchive       , "true", "false")%> ,
347
            bCanPreserveToArchive           : <%=iif(bCanPreserveToArchive    , "true", "false")%> ,
348
            bCanArchiveToArchive            : <%=iif(bCanArchiveToArchive     , "true", "false")%> ,
349
            };
350
 
351
            // Convert from Release Mode to [canClose, canPreserve, canArchive]
352
        $.mode2access = {
353
 
354
            N: [$.acData.bCanOpenToClose,$.acData.bCanOpenToPreserve,$.acData.bCanOpenToArchive],
355
            R: [$.acData.bCanRestrictiveToClose,$.acData.bCanRestrictiveToPreserve,$.acData.bCanRestrictiveToArchive],
356
            C: [$.acData.bCanRestrictiveToClose,$.acData.bCanRestrictiveToPreserve,$.acData.bCanRestrictiveToArchive],
357
            Y: [$.acData.bCanCloseToClose,$.acData.bCanCloseToPreserve,$.acData.bCanCloseToArchive],
358
            O: [$.acData.bCanCloseToClose,$.acData.bCanCloseToPreserve,$.acData.bCanCloseToArchive],
359
            P: [$.acData.bCanPreserveToClose,$.acData.bCanPreserveToPreserve,$.acData.bCanPreserveToArchive],
360
            A: [$.acData.bCanArchiveToClose,$.acData.bCanArchiveToPreserve,$.acData.bCanArchiveToArchive],
361
 
362
            canAccess : function(state, index) {
363
                if ( this.hasOwnProperty(state)) {
364
                    return this[state][index];
365
                } else {
366
                    return false;
367
                }
368
            },
369
        };
370
 
371
        $.miniMenu = {
372
            //  Data
373
 
374
            //  Menu operations
375
            open : function (data) {
376
                //console.log("Opening:", data.rtagid);
377
                this.gotoUrl("dependencies.asp", {rtag_id : data.rtagid});
378
             },
379
 
380
             edit : function (data) {
381
                 //console.log("Editing:", data.rtagid);
382
                 this.gotoUrl("form_edit_release.asp", {rtag_id : data.rtagid, rfile : "<%=ScriptName%>"});
383
             },
384
 
385
             mergeSelect : function (data) {
386
                 //console.log("Merge from:", data.rtagid );
387
                 $('#releaseTree .body_row_sel2').removeClass('body_row_sel2');
388
                 if (data.mergeLeft != data.rtagid) {
389
                     data.mergeLeft = data.rtagid;
390
                     $.miniMenu.currentRow.addClass('body_row_sel2');
391
                 } else {
392
                     delete(data.mergeLeft);
393
                 }
394
             },
395
 
396
             merge : function (data) {
397
                 //console.log ("Merge:", data.mergeLeft, data.rtagid);
398
                 this.gotoUrl("diff.asp", { rtagA : data.mergeLeft, rtagB : data.rtagid});
399
             },
400
 
401
             close : function (data) {
402
                 //console.log("Closing:", data.rtagid);
6697 dpurdie 403
                  this.closeRelease('Close', data.rtagid , 3);
5357 dpurdie 404
             },
405
 
406
             preserve : function (data) {
407
                 //console.log("Preserving:", data.rtagid);
6697 dpurdie 408
                  this.closeRelease('Preserve', data.rtagid , 6);
5357 dpurdie 409
             },
410
 
411
             archive : function (data) {
412
                 //console.log("Archiving:", data.rtagid);
6697 dpurdie 413
                  this.closeRelease('Archive', data.rtagid , 5);
5357 dpurdie 414
             },
5394 dpurdie 415
<%If objAccessControl.UserLogedIn Then%>
5357 dpurdie 416
             delete : function (data) {
417
                 //console.log("Delete:", data.rtagid);
418
                 $.miniMenu.currentRow.addClass('body_row_sel_outline');
419
                 var that = this;
6697 dpurdie 420
                 vixConfirm("This Release will be permanently destroyed.<p>Are you sure?", { 
421
                    deferred : true, 
422
                    title: 'Destroy Release', 
423
                    button : 'Destroy Release',
424
                    icon : 'images/i_critical.gif' }
5357 dpurdie 425
                 ).done(function(){
426
                     that.gotoUrl("_destroy_release.asp", {rtag_id_list : data.rtagid, proj_id : <%=parProjId%>, rfile : "<%=ScriptName%>"});
427
                 }).fail(function(){
428
                     $('#releaseTree .body_row_sel_outline').removeClass('body_row_sel_outline');
429
                 });
430
             },
431
<%End If%>
432
<%If bCanMove Then%>
433
             move : function (data) {
434
                 //console.log("Move:", data.rtagid);
435
                 this.gotoUrl("form_move_release.asp", { rtag_id_list : data.rtagid, proj_id : <%=parProjId%> });
436
             },
437
<%End If%>
438
<%If bCanClone Then%>
439
             clone : function(data) {
440
                 //console.log("Clone:", data.rtagid);
441
                 this.gotoUrl("new_release.asp", { rtag_id_list : data.rtagid, proj_id : <%=parProjId%>, branch : "Y" });
442
             },
443
<%End If%>
444
 
6697 dpurdie 445
             // Confirm Close/Preserve/Archive
446
             closeRelease : function (text, rtag_id, mode) {
447
                  var that = this;
448
                  $.miniMenu.currentRow.addClass('body_row_sel_outline');
449
                  vixConfirm("Are you sure you want to '" + text + "' this Release", { deferred : true } )
450
                    .done(function(){
451
                      that.gotoUrl("_change_release_mode.asp", {rtag_id : rtag_id, mode_code : mode , rfile : "<%=ScriptName%>"});
452
                    })
453
                    .fail(function(){
454
                            $('#releaseTree .body_row_sel_outline').removeClass('body_row_sel_outline');
455
                        });
456
             },
457
 
5357 dpurdie 458
             //
459
             // Internal functions
460
             // Goto url, or open in new tab
461
             gotoUrl: function (url, params)
462
             {
463
                 // Open in new tab - not as simple as it sounds
464
                 // Need to create a form and submit it
465
                 if(this.event.shiftKey){
466
                     var form = $('<form>',{
467
                         action : url,
468
                         target : '_blank',
469
                         //method : 'GET'
470
                         });
471
 
472
                     $.each(params,function(n,v){
473
                         var item = $('<input>',{
474
                             name : n,
475
                             value : v
476
                         });
477
                         form.append(item);
478
                        });
479
 
480
 
481
                     form.appendTo(document.body);
482
                     form.submit();
483
                     form.remove();
484
                 }
485
                 else {
486
                     if (params)
487
                         url += '?' + jQuery.param(params)
488
                     window.location.href = url;
489
                 }
490
             },
491
    };
492
 
493
    // Create and Hide the Menu
494
    $( "#select-menu" ).hide().menu();
495
 
496
    // Register menuselect event handler
497
    $( "#select-menu" ).on( "menuselect", function( event, ui ) {
498
       var opr = ui.item.data('opr');
499
 
500
        // Invoke operation within the menu data structure
501
        if (typeof $.miniMenu[opr] == 'function' ) {
502
            $.miniMenu['event'] = event;
503
            $.miniMenu[opr]($.miniMenu);
504
            return;
505
        }
506
        //console.log ("Menu Operation:", opr, "Not found");
507
    });
508
 
509
 
510
    // Add menu to all require instances
511
   $( ".select-operation" ).click(function(event) {
512
        // When clicked - create and show the menu
513
        // Insert rtag-id
514
 
515
       // In order to have the menu positioing work correctly
516
       //   Create a div that covers the visible screen area
517
       //   Us it within the menu poistioning
518
       //   Then delete it again
519
       var positionDiv = $( "<div></div>" ).css({
520
               position: 'absolute', 
521
               top : $(document).scrollTop(), 
522
               left : $(document).scrollLeft(),
523
               width: '100vw',
524
               height: '100vh',
525
               'z-index' : -1,
526
           });
527
       positionDiv.appendTo(document.body);
528
 
529
        //  Create the menu
530
        var menu = $("#select-menu").show().position({
531
             my: "left top",
532
             at: "center bottom",
533
             of: this,
534
             within : positionDiv,
535
        });
536
 
537
        // Cleanup the poistioning div
538
        positionDiv.remove();
539
 
540
        // Setup global data
541
        $.miniMenu.rtagid = $(this).data('rtag-id');
542
 
543
        // Set initial menu state - merge target
544
        $('#select-menu-merge').toggleClass('ui-state-disabled',!('mergeLeft' in $.miniMenu ));
545
 
546
        // Set initial state close/archive
547
        //
548
        var official = $(this).data('official');
549
        $('#select-menu-close').toggleClass('ui-state-disabled',! $.mode2access.canAccess(official,0));
550
        $('#select-menu-preserve').toggleClass('ui-state-disabled',!$.mode2access.canAccess(official,1));
551
        $('#select-menu-archive').toggleClass('ui-state-disabled',! $.mode2access.canAccess(official,2));
552
 
5394 dpurdie 553
        // Set initial state destroy
554
        var canDestroy = $(this).data('candelete') || <%=iif(bCanDestroy,"1","0")%>
555
        $('#select-menu-destroy').toggleClass('ui-state-disabled',(canDestroy == 0));
556
 
5357 dpurdie 557
        // Highlight the row selected
558
        $('#releaseTree .body_row_sel').removeClass('body_row_sel');
559
        $.miniMenu.currentRow = $(event.target).closest('tr').addClass('body_row_sel');
560
 
561
        // Allow click outside of the menu to close it
562
        $( document ).one( "click", function() {
563
            menu.hide();
564
            $('#releaseTree .body_row_sel').removeClass('body_row_sel');
565
        });
566
 
567
 
568
        // Prevent propagation of event
569
        return false;
570
    });
571
});
572
</script>
573
 
574
</head>
575
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
576
<!-- HEADER -->
577
<!--#include file="_header.asp"-->
578
<!-- BODY ---->
579
<%Call GetListFilterValues ( dListFilter )%>
580
<form name="FormName" method="post" action="<%=ScriptName%>">
581
<table width="100%" border="0" cellspacing="0" cellpadding="0">
582
   <tr>
6876 dpurdie 583
      <td class='bg_panel'>
5357 dpurdie 584
         <!-- ICON STATUS and FILTER -------------------------------------->
585
         <table width="118" border="0" align="left" style="margin-top: 38px;">
6892 dpurdie 586
            <tr class=form_field_bg>
587
               <td width="26"><span class="body_txt">Icon</span></td>
588
               <td width="82"><span class="body_txt">Release State </span></td>
5357 dpurdie 589
            </tr>
6892 dpurdie 590
            <tr class=form_field_grey_bg>
591
               <td><img src="images/i_rtag_open_mode.gif" width="15" height="13"></td>
592
               <td><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>
5357 dpurdie 593
            </tr>
6892 dpurdie 594
            <tr class=form_field_grey_bg>
595
               <td><img src="images/i_rtag_restrictive_mode.gif" width="15" height="15"></td>
596
               <td nowrap><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>
5357 dpurdie 597
            </tr>
6892 dpurdie 598
            <tr class=form_field_grey_bg>
599
               <td><img src="images/i_rtag_ccb_mode.gif" width="15" height="15"></td>
600
               <td><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>
5357 dpurdie 601
            </tr>
6892 dpurdie 602
            <tr class=form_field_grey_bg>
603
               <td><img src="images/i_rtag_closed_mode.gif" width="15" height="14"></td>
604
               <td><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>
5357 dpurdie 605
            </tr>
6892 dpurdie 606
            <tr class=form_field_grey_bg>
607
               <td><img src="images/i_rtag_closed_mode_warn.gif" width="15" height="14"></td>
608
               <td><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>
5357 dpurdie 609
            </tr>
6892 dpurdie 610
            <tr class=form_field_grey_bg>
611
               <td><img src="images/i_rtag_preserve_mode.gif" width="15" height="14"></td>
612
               <td><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>
5357 dpurdie 613
            </tr>
6892 dpurdie 614
            <tr class=form_field_grey_bg>
615
               <td><img src="images/i_rtag_archive_mode.gif" width="15" height="14"></td>
616
               <td><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>
5357 dpurdie 617
            </tr>
618
            <%If NOT bIsaTreeView Then%>
619
             <tr>
620
                <td>&nbsp;</td>
621
                <td><input name="btn" type="submit" class="form_btn" value="Update"></td>
622
             </tr>
623
             <%End If%>
624
         </table>
625
      </td>
626
      <td rowspan="2" valign="top" width="100%">
627
         <!-- ACTION BUTTONS ---------------------------------------------->
628
         <table width="100%"  border="0" cellspacing="0" cellpadding="7" style="background-color:#DAD7C8">
629
            <tr>
630
               <td width="1">
631
                  <%
632
                  If bIsaTreeView Then
633
                     Response.write LIMG_TREE_VIEW
634
                  Else
635
                     Response.write LIMG_LIST_VIEW
636
                  End If
637
                  %>
638
               </td>
639
               <td width="100%">
640
                  <%
641
                  Dim aBtnsDef
642
                  ' Define action buttons
6770 dpurdie 643
                  aBtnsDef = Array("btnNewRelease", "width=5", "btnMergeManager", "width=5", "btnAdminView", "width=5", "btnNotificationView","width=5", "btnProjectReplication")
5357 dpurdie 644
 
645
                  ' Load action buttons from database
646
                  Call objBtnControl.LoadActionButtons ( aBtnsDef, OraDatabase )
647
 
648
                  ' Set spacing to minimum between buttons
649
                  objBtnControl.ButtonSpacer = 0
650
                  objBtnControl.ImageHspace = 2
651
 
652
                  ' Access Control
653
                  If NOT canActionControlInProject("CreateNewRelease") Then Call objBtnControl.Active ( "btnNewRelease", "N" )
654
                  If NOT canActionControlInProject("ConfigureRelease") Then Call objBtnControl.Active ( "btnMoveRelease", "N" )
655
 
656
                  ' -- Render Buttons
657
                  Call objBtnControl.Render  ( aBtnsDef, objAccessControl )
658
                  %>
659
               </td>
660
            </tr>
661
         </table>
662
         <!-- ACTION BUTTONS END  ------------------------------------------>
663
         <!-- RELEASE INFORMATION  ----------------------------------------->
664
         <table id=releaseTree width="100%"  border="0" cellspacing="10" cellpadding="0">
665
               <tr>
666
                  <td>
667
                     <!-- TREE VIEW ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
668
                     <%If bIsaTreeView Then%>
6827 dpurdie 669
                        <table width="100%"  border="0" cellspacing="1" cellpadding="1" class=stdGrey>
670
                            <thead>
671
                               <tr class='form_field_bg' style="height:21px">
672
                                  <th width="25%" class="body_txt">Release Name </th>
5357 dpurdie 673
 
6827 dpurdie 674
                                  <%If parProjId <> 2 Then %>
675
                                     <th width="15%" class="body_txt">Created</th>
676
                                     <th width="47%" class="body_txt">Comments</th>
677
                                  <%Else%>
678
                                     <th width="15%" class="body_txt">Created</th>
679
                                     <th width="25%" class="body_txt">Used By </th>
680
                                     <th width="22%" class="body_txt">Comments</th>
681
                                  <%End If%>
682
                               <th width="1%" nowrap class="body_txt">Lxr</th>
683
                               <th width="3%" nowrap class="body_txt">Daemon&nbsp;Status</th>
684
                               </tr>
685
                            </thead>
5357 dpurdie 686
                           <%
687
                           OraDatabase.Parameters.Add "PROJ_ID",  parProjId,  ORAPARM_INPUT, ORATYPE_NUMBER
5394 dpurdie 688
                           OraDatabase.Parameters.Add "USER_ID",  objAccessControl.UserId,  ORAPARM_INPUT, ORATYPE_NUMBER
5357 dpurdie 689
 
690
                           Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ReleaseVersionTree.sql") , ORADYN_DEFAULT )
691
                           lastLevel = 0
692
 
5394 dpurdie 693
                           OraDatabase.Parameters.Remove "USER_ID"
5357 dpurdie 694
                           OraDatabase.Parameters.Remove "PROJ_ID"
695
 
696
                           Dim lastRtagId, parentRtag_id
697
 
698
                           If rsQry.RecordCount > 0 Then
699
 
700
                              Set objDmSts = New DaemonStatus
701
                              Call objDmSts.GetDaemonStatus(parProjId)
702
 
703
                              While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
704
                                 currLevel = CInt(rsQry("hierarchy"))
6576 dpurdie 705
                                 createdBy = rsQry("created_stamp") & " by " & rsQry("creator")
706
                                 lastMod = rsQry("lastModified") 
707
                                 hoverTitle = "State Last Change : "& rsQry("OFFICIAL_STAMP") & " by " & rsQry("modifier") & ". " & rsQry("OFFICIAL_STAMP_DAYS")& " Days ago" &_
708
                                         "&#10;Content Last Modified: " & lastMod & ". " & rsQry("LastModified_DAYS")& " Days ago" 
709
 
5394 dpurdie 710
                                 If rsQry("userCanDelete") = 1 Then
711
                                     createdBy = createdBy & "<br>Creator can delete"
712
                                 End If
5357 dpurdie 713
 
714
                                 %>
6827 dpurdie 715
                                 <tr>
5357 dpurdie 716
                                    <td nowrap>
717
                                       <%Call RenderIndent( lastLevel, currLevel )%>
5394 dpurdie 718
                                       <%Call RenderActions(rsQry("rtag_id"),rsQry("official"),rsQry("userCanDelete"))%>
6576 dpurdie 719
                                       <a href="dependencies.asp?rtag_id=<%=rsQry("rtag_id")%>" class="body_link" >
5357 dpurdie 720
                                       <%=ReleaseIcon( rsQry("official") )%>&nbsp;<%=rsQry("rtag_name")%></a>
721
                                    </td>
6576 dpurdie 722
                                    <td nowrap  valign=top title="<%=hoverTitle%>"><img src="icons/s_note.gif" height="10" width="10" >&nbsp;</img><%=createdBy%>
5357 dpurdie 723
                                    <%
724
                                    If parProjId = 2 Then
725
                                       comment = GetMassRefComments(rsQry("rtag_id"))
726
                                       If comment = "" Then comment = "None."
727
                                       %>
728
                                       <td><%=comment%></td>
729
                                    <%End If%>
730
 
731
                                    <td><%=NewLine_To_BR(rsQry("description"))%></td>
732
                                    <td nowrap valign="top"><%Call RenderLxrState() %></td>
733
                                    <td valign="top"><%Call RenderDaemonStatusConfig(rsQry("rtag_id"))%></td>
734
                                 </tr>
735
                                 <%
736
                                 lastLevel = currLevel
737
                                 rsQry.MoveNext
738
                              WEnd
739
                              Set objDmSts = Nothing
740
                           End If
741
                           rsQry.Close
742
                           Set rsQry = Nothing
743
                           %>
744
                        </table>
745
                     <!-- LIST VIEW ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
746
                     <%Else%>
6827 dpurdie 747
                        <table width="100%"  border="0" cellspacing="1" cellpadding="1" class='stdGrey'>
748
                            <thead>
749
                               <tr'>
750
                                  <th width="1%">&nbsp;</th>
751
                                  <th width="20%" >Release Name </th>
752
                                  <th width="10%" >Created</th>
753
                                  <%If parProjId <> 2 Then %>
754
                                     <th width="47%" >Comments</th>
755
                                  <%Else%>
756
                                     <th width="24%" >Used By </th>
757
                                     <th width="22%" >Comments</th>
758
                                  <%End If%>
759
                                  <th width="1%" title="LXR Support enabled">Lxr</th>
760
                                  <th width="3%">Daemon Status</th>
761
                               </tr>
762
                            </thead>
5357 dpurdie 763
                           <%
5394 dpurdie 764
                              OraDatabase.Parameters.Add "PROJ_ID",  parProjId,                ORAPARM_INPUT, ORATYPE_NUMBER
765
                              OraDatabase.Parameters.Add "USER_ID",  objAccessControl.UserId,  ORAPARM_INPUT, ORATYPE_NUMBER
5357 dpurdie 766
 
767
                              rsQryStr = GetQuery ("ReleaseVersionList.sql")
768
                              rsQryStr = Replace(rsQryStr, "/*SHOW_FILTER*/", parShowFilter)
769
 
770
                              Set rsQry = OraDatabase.DbCreateDynaset( rsQryStr, ORADYN_DEFAULT )
771
 
5394 dpurdie 772
                              OraDatabase.Parameters.Remove "USER_ID"
5357 dpurdie 773
                              OraDatabase.Parameters.Remove "PROJ_ID"
774
 
775
                              If rsQry.RecordCount > 0 Then
776
 
777
                                 Set objDmSts = New DaemonStatus
778
                                 Call objDmSts.GetDaemonStatus(parProjId)
779
 
780
                                 While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
781
                                    createdBy = rsQry("created_stamp") & " by " & rsQry("creator")
6576 dpurdie 782
                                    lastMod = rsQry("LastModified")
783
                                    hoverTitle = "State Last Change : "& rsQry("OFFICIAL_STAMP") & " by " & rsQry("modifier") & ". " & rsQry("OFFICIAL_STAMP_DAYS")& " Days ago" &_
784
                                            "&#10;Content Last Modified: " & lastMod & ". " & rsQry("LastModified_DAYS")& " Days ago" 
5394 dpurdie 785
                                    If rsQry("userCanDelete") = 1 Then
786
                                        createdBy = createdBy & "<br>Creator can delete"
787
                                    End If
5357 dpurdie 788
 
789
                                    %>
6827 dpurdie 790
                                    <tr>
5357 dpurdie 791
                                       <td valign="top">
5394 dpurdie 792
                                          <%Call RenderActions(rsQry("rtag_id"),rsQry("official"),rsQry("userCanDelete"))%>
5357 dpurdie 793
                                       </td>
794
                                       <td nowrap valign="top">
6576 dpurdie 795
                                          <a href="dependencies.asp?rtag_id=<%=rsQry("rtag_id")%>" class="body_link" >
5357 dpurdie 796
                                          <%=ReleaseIcon( rsQry("official"))%>&nbsp;<%=rsQry("rtag_name")%></a>
797
                                       </td>
6576 dpurdie 798
                                       <td nowrap  valign=top title="<%=hoverTitle%>"><img src="icons/s_note.gif" height="10" width="10" >&nbsp;</img><%=createdBy%>
5357 dpurdie 799
                                       <%
800
                                       If parProjId = 2 Then
801
                                          comment = GetMassRefComments(rsQry("rtag_id"))
802
                                          If comment = "" Then comment = "None."
803
                                          %>
804
                                            <td><%=comment%></td>
805
                                       <%End If%>
806
                                       <td><%=NewLine_To_BR(  rsQry("description")   )%></td>
807
                                       <td nowrap valign="top"><%Call RenderLxrState() %></td>
808
                                       <td valign="top"><%Call RenderDaemonStatusConfig(rsQry("rtag_id"))%>
809
                                       </td>
810
                                    </tr>
811
                                    <%
812
                                    rsQry.MoveNext
813
                                 WEnd
814
                                 Set objDmSts = Nothing
815
                              End If
816
                              rsQry.Close
817
                              Set rsQry = Nothing
818
                              %>
819
                        </table>
820
                     <%End If%>
821
                     <!-- LIST VIEW END ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
822
                     <%=objPMod.ComposeHiddenTags()%>
823
                     <input type="hidden" name="action" value="true">
824
                     </form>
825
                     <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
826
                     <!--#include file="messages/_msg_inline.asp"-->
827
                     <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
828
                  </td>
829
               </tr>
830
         </table>
831
      </td>
832
   </tr>
833
</table>
834
<!-- Dropdown Menu -->
835
<div id=testdiv></div>
836
<div >
837
  <ul id="select-menu" style="display:none;">
838
   <li data-opr="open" title="Goto this Release">Open ...</li>
839
    <li data-opr="edit" title="Edit the properties of the Release">Edit Properties</li>
840
    <li <%=iif(bCanMove,"data-opr=move","class=ui-state-disabled")%> title="Change the order in which releases are displayed">Change display order</li>
841
    <li>-</li>
842
    <li data-opr="mergeSelect" title="Select as the source (left side) of a merge or comparison">Select for Merge/Diff</li>
843
    <li id="select-menu-merge" data-opr="merge" title="Merge or Compare from selected release to this release">Merge/Diff from selected</li>
844
    <li>-</li>
845
    <li id="select-menu-close" data-opr="close">Close Release</li>
846
    <li id="select-menu-preserve" data-opr="preserve" >Preserve Release</li>
847
    <li id="select-menu-archive" data-opr="archive" >Archive Release</li>
848
    <li>-</li>
849
    <li <%=iif(bCanClone,"data-opr=clone","class=ui-state-disabled")%> title="Create a new Release based on selected Release">Clone Release</li>
850
    <li>-</li>
5394 dpurdie 851
    <li id="select-menu-destroy" data-opr="delete", title="Delete the selected Release">Destroy Release</li>
5357 dpurdie 852
    <li>-</li>
853
    <li>Close Menu</li>
854
  </ul>
855
</div>
856
<map name="mapviewtype">
857
  <area shape="rect" coords="2,2,69,23" href="<%=ScriptName%>?viewtype=1&<%=objPMod.ComposeURL()%>" title="Switch to List View">
858
  <area shape="rect" coords="73,2,143,23" href="<%=ScriptName%>?viewtype=2&<%=objPMod.ComposeURL()%>" title="Switch to Tree View">
859
</map>
5957 dpurdie 860
<!-- FOOTER -->
861
<!--#include file="_footer.asp"-->
5357 dpurdie 862
</body>
863
</html>