Subversion Repositories DevTools

Rev

Rev 6892 | Rev 7395 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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