Subversion Repositories DevTools

Rev

Rev 153 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'                                   Destroy Release
'               --- PROCESS FORM ---
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0    ' always load the page, dont store
%>

<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/common_dbedit.asp"-->
<!--#include file="common/daemon_instructions.asp"-->
<%
' Set rfile parameter. This is a return page after Login
Call objPMod.StoreParameter ( "rfile", "rtree.asp" )
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<!--#include file="_access_control_project.asp"-->
<%
'------------ Variable Definition -------------
Dim csvStr
Dim subStrArr
Dim subStr

'------------ Constants Declaration -----------
'------------ Variable Init -------------------
'----------------------------------------------
%>
<%
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.<br><br>"&_
                                       "Please delete them or allow them to be consumed before attempting to delete the release(s).")
      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.<br><br>"&_
                                       "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
                Response.Redirect("rtree.asp?proj_id="& Request("proj_id") )
   End If

Else
        Response.write "Some parameters are missing!" & "<br>" 'TODO
End If
%>

<!-- DESTRUCTOR ------->
<!--#include file="common/destructor.asp"-->