Subversion Repositories DevTools

Rev

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