%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
' Destroy Release
' --- PROCESS FORM ---
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0 ' always load the page, dont store
%>
<%
' Set rfile parameter. This is a return page after Login
Call objPMod.StoreParameter ( "rfile", "rtree.asp" )
'------------ ACCESS CONTROL ------------------
%>
<%
'------------ Variable Definition -------------
Dim csvStr
Dim subStrArr
Dim subStr
Dim parRfile
Dim parParentRtag
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parRfile = Request("rfile")
parParentRtag = Request("parentRtag")
'----------------------------------------------
%>
<%
Sub DestroyRelease ( )
On Error Resume Next
objEH.ErrorRedirect = TRUE
OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id_list"), ORAPARM_INPUT, ORATYPE_NUMBER
OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
objEH.TryORA ( OraSession )
OraDatabase.ExecuteSQL _
"BEGIN "&_
" PK_RELEASE.DESTROY_RELEASE ( :RTAG_ID, :USER_ID ); "&_
"END;"
objEH.CatchORA ( OraSession )
OraDatabase.Parameters.Remove "RTAG_ID"
OraDatabase.Parameters.Remove "USER_ID"
End Sub
%>
<%
'----------------------- MAIN LINE ---------------------------
'--- Process submition ---
If (Request("rtag_id_list") <> "") AND (Request("proj_id") <> "")Then
csvStr = Request("rtag_id_list")
subStrArr = Split(csvStr,",")
For Each subStr In subStrArr
If DaemonInstructionPreventsReleaseDeletion(subStr) Then
Call RaiseMsg(enum_MSG_ERROR, "One or more selected releases contain one or more daemon instructions.
"&_
"Please delete them or allow them to be consumed before attempting to delete the release(s).")
End If
If NOT releaseIsClosed(GetReleaseMode(subStr)) Then
Call RaiseMsg(enum_MSG_ERROR, "This Release is active.
"&_
"The Release must closed, Preserved or Archived before it can be deleted.")
End If
' If is_daemon_enabled_release(subStr, FALSE) Then
' Call RaiseMsg(enum_MSG_ERROR, "One or more selected releases contain one or more daemon configurations.
"&_
' "Please wait for daemon activity to cease (pause the daemons if necessary), "&_
' "delete the build configurations to allow the build daemons to terminate, "&_
' "before attempting to delete the release(s).")
' End If
Next
Call DestroyRelease ()
If objEH.Finally Then
Call Destroy_All_Objects
If parRfile <> "" AND parParentRtag <> "" Then
Response.Redirect(parRfile & "?rtag_id=" & parParentRtag )
Else
Response.Redirect("rtree.asp?proj_id="& Request("proj_id") )
End If
End If
Else
Response.write "Some parameters are missing!" & "
" 'TODO
End If
%>