Subversion Repositories DevTools

Rev

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