%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'| |
'| RTREE |
'| |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0 ' always load the page, dont store
%>
<%
'------------ ACCESS CONTROL ------------------
%>
<%
'------------ Variable Definition -------------
Dim ViewType
Dim bIsaTreeView
Dim rsQryStr
Dim rsQry
Dim parProjId
Dim parShowFilter
Dim objBtnControl
Dim currLevel, lastLevel
Dim dListFilter
Dim objDmSts
Dim hoverTitle, createdBy, comment, lastMod
Dim bCanMove
Dim bCanDestroy
Dim bCanClone
Dim bCanUnarchive
Dim bCanCloseArchive
Dim bCanOpenToClose
Dim bCanRestrictiveToClose
Dim bCanCloseToClose
Dim bCanPreserveToClose
Dim bCanArchiveToClose
Dim bCanOpenToPreserve
Dim bCanRestrictiveToPreserve
Dim bCanCloseToPreserve
Dim bCanPreserveToPreserve
Dim bCanArchiveToPreserve
Dim bCanOpenToArchive
Dim bCanRestrictiveToArchive
Dim bCanCloseToArchive
Dim bCanPreserveToArchive
Dim bCanArchiveToArchive
'------------ Constants Declaration -----------
Const LIMG_TREE_I_HALF = ""
Const LIMG_TREE_I_NONE = ""
Const LIMG_TREE_I_FULL = ""
Const LIMG_TREE_T = ""
Const LIMG_LIST_VIEW = ""
Const LIMG_TREE_VIEW = ""
Const LCONST_LIST_VIEW = 1
Const LCONST_TREE_VIEW = 2
Const DEFAULT_SHOW_FILTER = "'N','R','C','O'"
'------------ Variable Init -------------------
' Need either proj_id or rtag_id, for which we will calculate a project id
parProjId = Request("proj_id")
If parProjId = "" Then parProjId = DB_PROJ_ID
If parProjId = "" OR parProjId < 0 Then
Call Destroy_All_Objects
Response.Redirect("index.asp")
End If
Call objPMod.StoreParameter("proj_id", parProjId)
' Get show_filter from query string or failing that, from the cookie.
' Make sure that if neither supplies it, use the default
parShowFilter = Request("show_filter")
If NOT IsNull(parShowFilter) AND parShowFilter <> "" Then
Response.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("show_filter") = parShowFilter
Else
parShowFilter = Request.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("show_filter")
If IsNull(parShowFilter) OR parShowFilter = "" Then
parShowFilter = DEFAULT_SHOW_FILTER
Response.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("show_filter") = parShowFilter
End If
End If
Set dListFilter = CreateObject("Scripting.Dictionary")
Set objBtnControl = New ActionButtonControl
' Init access control
bCanMove = canActionControlInProject("ConfigureRelease")
bCanDestroy = canActionControlInProject("DestroyRelease")
bCanClone = canActionControlInProject("CreateNewRelease")
bCanOpenToClose = ReleaseModeAccessCheck(enumDB_RELEASE_IN_OPEN_MODE,enumDB_RELEASE_IN_CLOSED_MODE)
bCanRestrictiveToClose = ReleaseModeAccessCheck(enumDB_RELEASE_IN_RESTRICTIVE_MODE,enumDB_RELEASE_IN_CLOSED_MODE)
bCanCloseToClose = FALSE
bCanPreserveToClose = ReleaseModeAccessCheck(enumDB_RELEASE_IN_PRESERVE_MODE,enumDB_RELEASE_IN_CLOSED_MODE)
bCanArchiveToClose = ReleaseModeAccessCheck(enumDB_RELEASE_IN_ARCHIVE_MODE,enumDB_RELEASE_IN_CLOSED_MODE)
bCanOpenToPreserve = ReleaseModeAccessCheck(enumDB_RELEASE_IN_OPEN_MODE,enumDB_RELEASE_IN_PRESERVE_MODE)
bCanRestrictiveToPreserve = ReleaseModeAccessCheck(enumDB_RELEASE_IN_RESTRICTIVE_MODE,enumDB_RELEASE_IN_PRESERVE_MODE)
bCanCloseToPreserve = ReleaseModeAccessCheck(enumDB_RELEASE_IN_CLOSED_MODE,enumDB_RELEASE_IN_PRESERVE_MODE)
bCanPreserveToPreserve = FALSE
bCanArchiveToPreserve = ReleaseModeAccessCheck(enumDB_RELEASE_IN_ARCHIVE_MODE,enumDB_RELEASE_IN_PRESERVE_MODE)
bCanOpenToArchive = ReleaseModeAccessCheck(enumDB_RELEASE_IN_OPEN_MODE,enumDB_RELEASE_IN_ARCHIVE_MODE)
bCanRestrictiveToArchive = ReleaseModeAccessCheck(enumDB_RELEASE_IN_RESTRICTIVE_MODE,enumDB_RELEASE_IN_ARCHIVE_MODE)
bCanCloseToArchive = ReleaseModeAccessCheck(enumDB_RELEASE_IN_CLOSED_MODE,enumDB_RELEASE_IN_ARCHIVE_MODE)
bCanPreserveToArchive = ReleaseModeAccessCheck(enumDB_RELEASE_IN_PRESERVE_MODE,enumDB_RELEASE_IN_ARCHIVE_MODE)
bCanArchiveToArchive = FALSE
'----------------------------------------------
%>
<%
'--------------------------------------------------------------------------------------------------------------------------
' Determines if the specified filter is on/off and returns a string to use to check the associated checkbox accordingly
Function isListFilterChecked (nFilterId)
isListFilterChecked = dListFilter.Exists ( "'" & CStr(nFilterId) & "'" )
End Function
Function GetIsListFilterChecked( nFilterId )
GetIsListFilterChecked = ""
If bIsaTreeView AND nFilterId <> enumDB_RELEASE_IN_SNAPSHOT_MODE Then
' Disable the control in Tree View
GetIsListFilterChecked = GetIsListFilterChecked & "checked disabled"
Else
If isListFilterChecked (nFilterId) Then
GetIsListFilterChecked = "checked"
End If
End If
End Function
'--------------------------------------------------------------------------------------------------------------------------
' Reads the cookie for the filter and creats a dictionary element for each item therein. the dictionary
' is used by the GetIsListFilterChecked function to determine checkbox state in the filter options
Sub GetListFilterValues ( outDepFilter )
Dim FilterVal, aFilterValues
If parShowFilter <> "" Then
aFilterValues = Split( Replace( parShowFilter, " ", ""), ",")
For Each FilterVal In aFilterValues
outDepFilter.Item (CStr( FilterVal )) = ""
Next
End If
End Sub
'----------------------------------------------------------------------------------------------------------------------------------------------
Sub RenderIndent ( nLastLevel, nCurrLevel )
Dim i
If nCurrLevel <= 1 Then Exit Sub
'-- Render half lines
If nCurrLevel > 2 Then
For i = 1 To nCurrLevel - 2
Response.write LIMG_TREE_I_NONE
Next
End If
'-- Render branch or line
If nLastLevel < nCurrLevel Then
Response.write LIMG_TREE_T
Else
Response.write LIMG_TREE_I_FULL
End If
End Sub
'----------------------------------------------------------------------------------------------------------------------------------------------
Function GetViewType ()
Dim CookieViewType
CookieViewType = Request.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("RELEASE_VIEW")
If CookieViewType <> "" Then
' Get current view type from cookie
GetViewType = CInt(CookieViewType)
Else
' Set current view to list view
Response.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("RELEASE_VIEW") = LCONST_LIST_VIEW
GetViewType = LCONST_LIST_VIEW
End If
End Function
'----------------------------------------------------------------------------------------------------------------------------------------------
Sub SetViewType ()
If Request("viewtype") = "" Then Exit Sub ' Nothing to do
Response.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("RELEASE_VIEW") = Request("viewtype")
End Sub
'----------------------------------------------------------------------------------------------------------------------------------------------
Sub RenderDaemonStatusConfig(nRtagId)%>
<%Call objDmSts.RenderDaemonStatus(nRtagId,16)%>
<%End Sub
'----------------------------------------------------------------------------------------------------------------------------------------------
Sub RenderLxrState()
Response.Write RenderLxrStateString(rsQry("rtag_id"),rsQry("lxr"),rsQry("lxrserver"),rsQry("official"),"")
Response.Write RenderS3ManifestStateString(rsQry("rtag_id"), rsQry("S3MANIFEST"), rsQry("official"), "")
End Sub
'----------------------------------------------------------------------------------------------------------------------------------------------
Function RenderActions(nRtagId, sOfficial, nCanDelete)
Response.Write ""&_
""
End Function
'----------------------------------------------------------------------------------------------------------------------------------------------
Function GetMassRefComments (nRtagId)
Dim UsedBy
Dim rsQryUse
Dim linkB
Dim joiner : joiner = ""
Dim comment : comment = ""
' If parProjId <> 2 Then
' assocMASSREF = rsQry("assoc_mass_ref")
' If assocMASSREF <> "" Then
' Set rsQryAssoc = OraDatabase.DbCreateDynaset("SELECT RTAG_NAME, RTAG_ID FROM RELEASE_TAGS WHERE RTAG_ID="&assocMASSREF , ORADYN_DEFAULT)
' assocMASSREFName = rsQryAssoc("RTAG_NAME")
' link = rsQryAssoc("rtag_id")
' rsQryAssoc.Close
' Set rsQryAssoc = Nothing
' Else
' assocMASSREFName = "None."
' End If
' Else
UsedBy = nRtagId
If UsedBy <> "" Then
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)
While ((NOT rsQryUse.BOF) AND (NOT rsQryUse.EOF))
If rsQryUse("assoc_mass_ref") = UsedBy Then
linkB = "dependencies.asp?rtag_id="&rsQryUse("rtag_id")
comment = joiner & rsQryUse("proj_name") & " -> "& rsQryUse("rtag_name") &""
joiner = " "
rsQryUse.MoveNext
End If
WEnd
rsQryUse.Close
Set rsQryUse = Nothing
End If
GetMassRefComments = comment
End Function
'----------------------------------------------------------------------------------------------------------------------------------------------
Sub SidePanelScript%>
<%End Sub
Sub SidePanel%>
<%End Sub
'----------------------------------------------------------------------------------------------------------------------------------------------
Sub MainPanel%>
<%
If bIsaTreeView Then
Response.write LIMG_TREE_VIEW
Else
Response.write LIMG_LIST_VIEW
End If
%>
<%
Dim aBtnsDef
' Define action buttons
aBtnsDef = Array("btnNewRelease", "width=5", "btnMergeManager", "width=5", "btnAdminView", "width=5", "btnNotificationView","width=5", "btnProjectReplication")
' Load action buttons from database
Call objBtnControl.LoadActionButtons ( aBtnsDef, OraDatabase )
' Set spacing to minimum between buttons
objBtnControl.ButtonSpacer = 0
objBtnControl.ImageHspace = 2
' Access Control
If NOT canActionControlInProject("CreateNewRelease") Then Call objBtnControl.Active ( "btnNewRelease", "N" )
If NOT canActionControlInProject("ConfigureRelease") Then Call objBtnControl.Active ( "btnMoveRelease", "N" )
' -- Render Buttons
Call objBtnControl.Render ( aBtnsDef, objAccessControl )
%>
<%If bIsaTreeView Then%>
Release Name
<%If parProjId <> 2 Then %>
Created
Comments
<%Else%>
Created
Used By
Comments
<%End If%>
Features
Daemon Status
<%
OraDatabase.Parameters.Add "PROJ_ID", parProjId, ORAPARM_INPUT, ORATYPE_NUMBER
OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
Dim treeFilter : treeFilter = ""
If NOT isListFilterChecked(enumDB_RELEASE_IN_SNAPSHOT_MODE) Then
treeFilter = " AND rt.OFFICIAL != 'S'"
End If
rsQryStr = GetQuery ("ReleaseVersionTree.sql")
rsQryStr = Replace(rsQryStr, "/*TREE_FILTER*/", treeFilter )
Set rsQry = OraDatabase.DbCreateDynaset( rsQryStr, ORADYN_DEFAULT )
lastLevel = 0
OraDatabase.Parameters.Remove "USER_ID"
OraDatabase.Parameters.Remove "PROJ_ID"
Dim lastRtagId, parentRtag_id
If rsQry.RecordCount > 0 Then
Set objDmSts = New DaemonStatus
Call objDmSts.GetDaemonStatus(parProjId)
While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
currLevel = CInt(rsQry("hierarchy"))
createdBy = rsQry("created_stamp") & " by " & rsQry("creator")
lastMod = rsQry("lastModified")
hoverTitle = "State Last Change : "& rsQry("OFFICIAL_STAMP") & " by " & rsQry("modifier") & ". " & rsQry("OFFICIAL_STAMP_DAYS")& " Days ago" &_
"
Content Last Modified: " & lastMod & ". " & rsQry("LastModified_DAYS")& " Days ago"
If rsQry("userCanDelete") = 1 Then
createdBy = createdBy & " Creator can delete"
End If
%>
<%
rsQry.MoveNext
WEnd
Set objDmSts = Nothing
End If
rsQry.Close
Set rsQry = Nothing
%>
<%End If%>
<%End Sub
'------------ RUN BEFORE PAGE RENDER ----------
If (Request("action") <> "") Then
If Request("btn") = "Update" Then
' Store filter in cookie
Response.Cookies (COOKIE_RELEASE_MANAGER_MEMORY)("show_filter") = Request("listFilter")
' Redirect to the current page so that a refesh will not ' cause a form re-submit.
Call Destroy_All_Objects
Response.Redirect(ScriptName & "?proj_id=" & parProjId)
End If
End If
' Set view type if required
Call SetViewType ()
' Get current view type
ViewType = GetViewType()
bIsaTreeView = (ViewType = LCONST_TREE_VIEW)
'----------------------------------------------
%>
<%
Set rsQry = OraDatabase.DbCreateDynaset( "SELECT PROJ_NAME FROM PROJECTS WHERE PROJ_ID="& parProjId, ORADYN_DEFAULT )
%>
<%=rsQry("proj_name")%>
<%
rsQry.Close
Set rsQry = Nothing
%>
<%Call SidePanelScript%>
<%Call GetListFilterValues ( dListFilter )%>
<%Call SidePanel%>
<%Call MainPanel%>
Open ...
Edit Properties
title="Change the order in which releases are displayed">Change display order
-
Select for Merge/Diff
Merge/Diff from selected
-
Close Release
Preserve Release
Archive Release
-
title="Create a new Release based on selected Release">Clone Release