| 119 |
ghuddy |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
'=====================================================
|
| 129 |
ghuddy |
4 |
' REMOVE Packages
|
| 119 |
ghuddy |
5 |
' --- PROCESS FORM ---
|
|
|
6 |
'=====================================================
|
|
|
7 |
%>
|
|
|
8 |
<%
|
|
|
9 |
Option explicit
|
|
|
10 |
' Good idea to set when using redirect
|
| 129 |
ghuddy |
11 |
Response.Expires = 0 ' always load the page, dont store
|
| 119 |
ghuddy |
12 |
%>
|
|
|
13 |
<!--#include file="common/conf.asp"-->
|
|
|
14 |
<!--#include file="common/globals.asp"-->
|
|
|
15 |
<!--#include file="common/formating.asp"-->
|
|
|
16 |
<!--#include file="common/qstr.asp"-->
|
|
|
17 |
<!--#include file="common/common_subs.asp"-->
|
|
|
18 |
<!--#include file="common/common_dbedit.asp"-->
|
| 153 |
ghuddy |
19 |
<!--#include file="common/daemon_instructions.asp"-->
|
| 165 |
brianf |
20 |
<!--#include file="common/release_changed.asp"-->
|
| 119 |
ghuddy |
21 |
<%
|
|
|
22 |
' Set rfile parameter. This is a return page after Login
|
|
|
23 |
Call objPMod.StoreParameter ( "rfile", "dependencies.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 -------------
|
|
|
31 |
'------------ Constants Declaration -----------
|
|
|
32 |
'------------ Variable Init -------------------
|
|
|
33 |
'----------------------------------------------
|
|
|
34 |
%>
|
|
|
35 |
<%
|
|
|
36 |
'--------------------------------------------------------------------------------------------------------------------------------------
|
|
|
37 |
Sub RemovePackage( )
|
| 129 |
ghuddy |
38 |
Dim ReturnCode
|
| 165 |
brianf |
39 |
Dim nPvId
|
|
|
40 |
nPvId=Request("pv_id")
|
|
|
41 |
|
|
|
42 |
Dim objRC: Set objRC = New ReleaseChanged
|
|
|
43 |
Call objRC.Get_Package_Info (Request("rtag_id"),nPvId)
|
| 167 |
brianf |
44 |
Dim bReleased: bReleased = objRC.IsReleased(Request("rtag_id"),nPvId)
|
|
|
45 |
|
| 165 |
brianf |
46 |
OraDatabase.Parameters.Add "PV_ID", nPvId, ORAPARM_INPUT, ORATYPE_NUMBER
|
| 129 |
ghuddy |
47 |
OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id"), ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
48 |
OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId,ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
49 |
OraDatabase.Parameters.Add "RETURN_CODE", NULL, ORAPARM_OUTPUT, ORATYPE_NUMBER
|
|
|
50 |
|
|
|
51 |
If Request("btn") = "YES" Then
|
|
|
52 |
' Force Remove
|
|
|
53 |
OraDatabase.Parameters.Add "FORCE_REMOVE", "Y", ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
54 |
|
|
|
55 |
Else
|
|
|
56 |
OraDatabase.Parameters.Add "FORCE_REMOVE", "N", ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
57 |
|
|
|
58 |
End If
|
|
|
59 |
|
|
|
60 |
objEH.TryORA ( OraSession )
|
|
|
61 |
On Error Resume Next
|
|
|
62 |
|
|
|
63 |
OraDatabase.ExecuteSQL _
|
| 165 |
brianf |
64 |
"BEGIN "&_
|
| 129 |
ghuddy |
65 |
" :RETURN_CODE := PK_ENVIRONMENT.REMOVE_PACKAGE ( :PV_ID, :RTAG_ID, :USER_ID, :FORCE_REMOVE );"&_
|
|
|
66 |
"END; "
|
|
|
67 |
|
|
|
68 |
objEH.CatchORA ( OraSession )
|
|
|
69 |
|
|
|
70 |
ReturnCode = OraDatabase.Parameters("RETURN_CODE").Value
|
|
|
71 |
|
|
|
72 |
If ( ReturnCode <> 0 ) AND (Request("btn") <> "YES") Then
|
|
|
73 |
Call RaiseMsg ( enum_MSG_PACKAGE_IN_USE, Request("pv_id") &"|"& Request("rtag_id") &"|"& "_remove_package.asp")
|
|
|
74 |
End If
|
|
|
75 |
|
| 5480 |
dpurdie |
76 |
OraDatabase.Parameters.Remove "PV_ID"
|
| 129 |
ghuddy |
77 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
78 |
OraDatabase.Parameters.Remove "USER_ID"
|
|
|
79 |
OraDatabase.Parameters.Remove "FORCE_REMOVE"
|
|
|
80 |
OraDatabase.Parameters.Remove "RETURN_CODE"
|
| 165 |
brianf |
81 |
|
|
|
82 |
If Not objEH.LastOraFailed Then
|
| 167 |
brianf |
83 |
If bReleased Then
|
|
|
84 |
Call objRC.Run_ReleaseChanged(Request("rtag_id"),nPvId,enumRELEASE_CHANGE_MODE_PKG_REMOVED,false)
|
|
|
85 |
End If
|
| 165 |
brianf |
86 |
End If
|
|
|
87 |
|
|
|
88 |
Set objRC = Nothing
|
|
|
89 |
|
| 119 |
ghuddy |
90 |
End Sub
|
|
|
91 |
'--------------------------------------------------------------------------------------------------------------------------------------
|
|
|
92 |
%>
|
|
|
93 |
<%
|
|
|
94 |
'----------------------- MAIN LINE ---------------------------
|
| 129 |
ghuddy |
95 |
On Error Resume Next
|
|
|
96 |
objEH.Try
|
| 119 |
ghuddy |
97 |
'--- Process submition ---
|
|
|
98 |
If (Request("pv_id") <> "") AND (Request("rtag_id") <> "") Then
|
| 129 |
ghuddy |
99 |
|
| 153 |
ghuddy |
100 |
If (DaemonInstructionPreventsEditing(Request("rtag_id"), Request("pv_id"))) Then
|
|
|
101 |
Call RaiseMsg(enum_MSG_ERROR, "This package version has one or more daemon instructions present<br><br>"&_
|
|
|
102 |
"Please delete them or allow them to be consumed before attempting to remove the package version from the release.")
|
|
|
103 |
Else
|
|
|
104 |
Call RemovePackage ()
|
| 129 |
ghuddy |
105 |
|
| 1376 |
dpurdie |
106 |
' All mandatory parameters FOUND
|
| 153 |
ghuddy |
107 |
'If parBtn <> "NO" Then
|
|
|
108 |
'
|
|
|
109 |
' retNOTRemove = -1
|
|
|
110 |
' Call CheckPackageInUse ( Request("pv_id"), QStrPar("rtag_id"), parBtn, retNOTRemove )
|
|
|
111 |
' Call Remove_Pkgs_From_Release( Format_MultiSelect_List( Request("pv_id") ), QStrPar("rtag_id"), retNOTRemove )
|
|
|
112 |
'
|
|
|
113 |
'
|
|
|
114 |
' If ( retNOTRemove <> -1 ) AND ( parBtn <> "YES" ) Then
|
|
|
115 |
' If (UserDetails ( "user_role" ) = "A") OR (UserDetails ( "user_role" ) = "S") Then
|
|
|
116 |
' ' Admin and System Admin users
|
|
|
117 |
' Call RaiseMsg ( enum_MSG_PACKAGE_IN_USE, Request("pv_id") &"|"& Request("rtag_id") &"|"& Request("envtab") &"|"& "_remove_packages.asp")
|
|
|
118 |
'
|
|
|
119 |
' Else
|
|
|
120 |
' ' Other users
|
|
|
121 |
' Call RaiseMsg ( enum_MSG_CANNOT_REMOVE_PACKAGE, Request("pv_id") &"|"& Request("rtag_id") &"|"& Request("envtab") &"|"& "_remove_packages.asp")
|
|
|
122 |
'
|
|
|
123 |
' End If
|
|
|
124 |
'
|
|
|
125 |
' End If
|
|
|
126 |
'
|
|
|
127 |
'End If
|
| 129 |
ghuddy |
128 |
|
|
|
129 |
|
|
|
130 |
|
| 153 |
ghuddy |
131 |
Response.Redirect("dependencies.asp?rtag_id="& Request("rtag_id") )
|
|
|
132 |
End If
|
| 119 |
ghuddy |
133 |
Else
|
| 129 |
ghuddy |
134 |
Err.Raise 8, "Please select the required package to delete."
|
|
|
135 |
'Response.write "Some mandatory parameters are missing!" & "<br>" 'TODO
|
| 4955 |
dpurdie |
136 |
'Response.write QSTR_FullQuery
|
| 119 |
ghuddy |
137 |
End If
|
| 129 |
ghuddy |
138 |
objEH.Catch
|
| 119 |
ghuddy |
139 |
%>
|
|
|
140 |
|
|
|
141 |
<!-- DESTRUCTOR ------->
|
| 129 |
ghuddy |
142 |
<!--#include file="common/destructor.asp"-->
|