| 141 |
ghuddy |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
| 5293 |
dpurdie |
3 |
'=====================================================
|
|
|
4 |
' _s_lock_package.asp
|
|
|
5 |
' System Lock Package
|
|
|
6 |
'=====================================================
|
| 141 |
ghuddy |
7 |
Option explicit
|
|
|
8 |
Response.Expires = 0 ' always load the page, dont store
|
|
|
9 |
%>
|
|
|
10 |
<!--#include file="common/conf.asp"-->
|
|
|
11 |
<!--#include file="common/globals.asp"-->
|
|
|
12 |
<!--#include file="common/formating.asp"-->
|
|
|
13 |
<!--#include file="common/qstr.asp"-->
|
|
|
14 |
<!--#include file="common/common_subs.asp"-->
|
|
|
15 |
<!--#include file="common/common_dbedit.asp"-->
|
| 5293 |
dpurdie |
16 |
<!--#include file="common/release_changed.asp"-->
|
| 141 |
ghuddy |
17 |
<%
|
|
|
18 |
'------------ ACCESS CONTROL ------------------
|
|
|
19 |
%>
|
|
|
20 |
<!--#include file="_access_control_general.asp"-->
|
|
|
21 |
<%
|
|
|
22 |
'------------ Variable Definition -------------
|
|
|
23 |
Dim parPv_id
|
|
|
24 |
Dim QueryString, rsQry
|
|
|
25 |
'------------ Constants Declaration -----------
|
|
|
26 |
'------------ Variable Init -------------------
|
|
|
27 |
parPv_id = QStrPar("pv_id")
|
|
|
28 |
parRtag_id = QStrPar("rtag_id")
|
|
|
29 |
'----------------------------------------------
|
|
|
30 |
%>
|
|
|
31 |
<%
|
| 5293 |
dpurdie |
32 |
Sub LockPackage (bIsPatch)
|
| 141 |
ghuddy |
33 |
|
|
|
34 |
OraDatabase.Parameters.Add "PV_ID", Request("pv_id"), ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
35 |
OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
36 |
|
|
|
37 |
objEH.TryORA ( OraSession )
|
|
|
38 |
On Error Resume Next
|
|
|
39 |
|
|
|
40 |
OraDatabase.ExecuteSQL _
|
|
|
41 |
"BEGIN Lock_Package( :PV_ID, :USER_ID ); END;"
|
|
|
42 |
|
|
|
43 |
objEH.CatchORA ( OraSession )
|
|
|
44 |
|
|
|
45 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
46 |
OraDatabase.Parameters.Remove "USER_ID"
|
| 5293 |
dpurdie |
47 |
|
|
|
48 |
If (objEH.LastOraFailed = FALSE) AND (bIsPatch) Then
|
|
|
49 |
' If this is a patch, then make the package, in dpkg_archive, writable
|
|
|
50 |
' This is UGLY
|
|
|
51 |
'
|
|
|
52 |
Dim objRC: Set objRC = New ReleaseChanged
|
|
|
53 |
Call objRC.MakeReadOnly(parRtag_id, parPv_id )
|
|
|
54 |
|
|
|
55 |
End If
|
| 141 |
ghuddy |
56 |
End Sub
|
|
|
57 |
|
|
|
58 |
%>
|
|
|
59 |
<%
|
|
|
60 |
'Process submition
|
|
|
61 |
'---------------------------------------
|
|
|
62 |
' THIS IS FOR SYSTEM ADMIN ONLY
|
|
|
63 |
'---------------------------------------
|
|
|
64 |
QueryString = "SELECT pv.DLOCKED, pv.IS_PATCH FROM PACKAGE_VERSIONS pv WHERE pv.PV_ID = "& parPv_id
|
|
|
65 |
Set rsQry = OraDatabase.DbCreateDynaset( QueryString, cint(0))
|
| 171 |
brianf |
66 |
Dim bis_patch: bis_patch = Not IsNull(rsQry("is_patch"))
|
|
|
67 |
Dim spkgtype: spkgtype = iif(bis_patch,"patch","package")
|
| 183 |
brianf |
68 |
Dim bcan_unlock
|
| 171 |
brianf |
69 |
|
| 183 |
brianf |
70 |
If bis_patch Then
|
| 5061 |
dpurdie |
71 |
bcan_unlock = canActionControlInProject("UnlockPatch")
|
| 183 |
brianf |
72 |
Else
|
| 5061 |
dpurdie |
73 |
bcan_unlock = canActionControlInProject("EditCriticalInfoForLockedPackage")
|
| 183 |
brianf |
74 |
End If
|
|
|
75 |
|
|
|
76 |
If bcan_unlock Then
|
| 171 |
brianf |
77 |
If rsQry("dlocked") = "N" Then
|
| 5293 |
dpurdie |
78 |
Call LockPackage (bis_patch)
|
|
|
79 |
Response.Redirect ( "fixed_issues.asp?rtag_id="& parRtag_id &"&pv_id="& parPv_id)
|
| 171 |
brianf |
80 |
Else
|
|
|
81 |
Call RaiseMsg(enum_MSG_ERROR, "Can only lock a " & spkgtype & " that is currently unlocked." )
|
|
|
82 |
End If
|
| 141 |
ghuddy |
83 |
Else
|
| 171 |
brianf |
84 |
Call RaiseMsg(enum_MSG_ERROR, "You do not have permissions to lock/unlock " & spkgtype & "." )
|
| 141 |
ghuddy |
85 |
End If
|
| 171 |
brianf |
86 |
|
| 141 |
ghuddy |
87 |
rsQry.Close
|
|
|
88 |
Set rsQry = nothing
|
| 171 |
brianf |
89 |
|
| 141 |
ghuddy |
90 |
%>
|
|
|
91 |
|
|
|
92 |
<!-- DESTRUCTOR ------->
|
|
|
93 |
<!--#include file="common/destructor.asp"-->
|