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