Subversion Repositories DevTools

Rev

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