Subversion Repositories DevTools

Rev

Rev 5957 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
' 			 	    Destroy Release
5
'               --- PROCESS FORM ---
6
'=====================================================
7
%>
8
<%
9
Option explicit
10
' Good idea to set when using redirect
11
Response.Expires = 0	' always load the page, dont store
12
%>
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/common_dbedit.asp"-->
153 ghuddy 20
<!--#include file="common/daemon_instructions.asp"-->
119 ghuddy 21
<%
22
' Set rfile parameter. This is a return page after Login
23
Call objPMod.StoreParameter ( "rfile", "rtree.asp" )
24
'------------ ACCESS CONTROL ------------------
25
%>
26
<!--#include file="_access_control_login.asp"-->
27
<!--#include file="_access_control_general.asp"-->
28
<!--#include file="_access_control_project.asp"-->
29
<%
30
'------------ Variable Definition -------------
153 ghuddy 31
Dim csvStr
32
Dim subStrArr
33
Dim subStr
34
 
119 ghuddy 35
'------------ Constants Declaration -----------
36
'------------ Variable Init -------------------
37
'----------------------------------------------
38
%>
39
<%
40
Sub DestroyRelease ( )
153 ghuddy 41
 
119 ghuddy 42
	On Error Resume Next
43
	objEH.ErrorRedirect = TRUE
153 ghuddy 44
 
45
 
46
 
119 ghuddy 47
	OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id_list"), 	ORAPARM_INPUT, ORATYPE_NUMBER
48
	OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, 	ORAPARM_INPUT, ORATYPE_NUMBER
153 ghuddy 49
 
119 ghuddy 50
	objEH.TryORA ( OraSession )
153 ghuddy 51
 
52
 
119 ghuddy 53
	OraDatabase.ExecuteSQL _
54
	"BEGIN "&_
55
	" PK_RELEASE.DESTROY_RELEASE ( :RTAG_ID, :USER_ID ); "&_
56
	"END;"
153 ghuddy 57
 
119 ghuddy 58
	objEH.CatchORA ( OraSession )
153 ghuddy 59
 
60
 
119 ghuddy 61
	OraDatabase.Parameters.Remove "RTAG_ID"
62
	OraDatabase.Parameters.Remove "USER_ID"
63
End Sub
64
%>
65
<%
66
'-----------------------  MAIN LINE  ---------------------------
67
 
68
'--- Process submition ---
69
If (Request("rtag_id_list") <> "") AND (Request("proj_id") <> "")Then
153 ghuddy 70
 
71
   csvStr = Request("rtag_id_list")
72
   subStrArr = Split(csvStr,",")
73
 
74
   For Each subStr In subStrArr
75
      If DaemonInstructionPreventsReleaseDeletion(subStr) Then
76
         Call RaiseMsg(enum_MSG_ERROR, "One or more selected releases contain one or more daemon instructions.<br><br>"&_
77
                                       "Please delete them or allow them to be consumed before attempting to delete the release(s).")
78
      End If
6053 dpurdie 79
 
80
      If NOT releaseIsClosed(GetReleaseMode(subStr)) Then
81
         Call RaiseMsg(enum_MSG_ERROR, "This Release is active.<br><br>"&_
82
                                       "The Release must closed, Preserved or Archived before it can be deleted.")
153 ghuddy 83
      End If
6053 dpurdie 84
 
85
'     If is_daemon_enabled_release(subStr, FALSE) Then
86
'        Call RaiseMsg(enum_MSG_ERROR, "One or more selected releases contain one or more daemon configurations.<br><br>"&_
87
'                                      "Please wait for daemon activity to cease (pause the daemons if necessary), "&_
88
'                                      "delete the build configurations to allow the build daemons to terminate, "&_
89
'                                      "before attempting to delete the release(s).")
90
'     End If
153 ghuddy 91
   Next
92
 
93
   Call DestroyRelease ()
94
 
95
   If objEH.Finally Then
5957 dpurdie 96
        Call Destroy_All_Objects
97
        Response.Redirect("rtree.asp?proj_id="& Request("proj_id") )
153 ghuddy 98
   End If
99
 
119 ghuddy 100
Else
101
	Response.write "Some parameters are missing!" & "<br>" 'TODO
102
End If
103
%>
104
<!-- DESTRUCTOR ------->
153 ghuddy 105
<!--#include file="common/destructor.asp"-->