Subversion Repositories DevTools

Rev

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