| 141 |
ghuddy |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
Option explicit
|
|
|
4 |
Response.Expires = 0 ' always load the page, dont store
|
|
|
5 |
%>
|
|
|
6 |
<%
|
|
|
7 |
'=====================================================
|
|
|
8 |
' System Lock Package
|
|
|
9 |
'=====================================================
|
|
|
10 |
%>
|
|
|
11 |
<!--#include file="common/conf.asp"-->
|
|
|
12 |
<!--#include file="common/globals.asp"-->
|
|
|
13 |
<!--#include file="common/formating.asp"-->
|
|
|
14 |
<!--#include file="common/qstr.asp"-->
|
|
|
15 |
<!--#include file="common/common_subs.asp"-->
|
|
|
16 |
<!--#include file="common/common_dbedit.asp"-->
|
|
|
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 |
<%
|
|
|
32 |
Sub LockPackage ()
|
|
|
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"
|
|
|
47 |
End Sub
|
|
|
48 |
|
|
|
49 |
%>
|
|
|
50 |
<%
|
|
|
51 |
'Process submition
|
|
|
52 |
'---------------------------------------
|
|
|
53 |
' THIS IS FOR SYSTEM ADMIN ONLY
|
|
|
54 |
'---------------------------------------
|
|
|
55 |
QueryString = "SELECT pv.DLOCKED, pv.IS_PATCH FROM PACKAGE_VERSIONS pv WHERE pv.PV_ID = "& parPv_id
|
|
|
56 |
Set rsQry = OraDatabase.DbCreateDynaset( QueryString, cint(0))
|
| 171 |
brianf |
57 |
Dim bis_patch: bis_patch = Not IsNull(rsQry("is_patch"))
|
|
|
58 |
Dim spkgtype: spkgtype = iif(bis_patch,"patch","package")
|
|
|
59 |
|
|
|
60 |
If objAccessControl.IsDataActive ("PROJECTS", DB_PROJ_ID, "EditProjects") AND (objAccessControl.IsActive("UnlockPatch") OR objAccessControl.IsActive("UnlockPackage")) Then
|
|
|
61 |
If rsQry("dlocked") = "N" Then
|
|
|
62 |
Call LockPackage ()
|
| 177 |
brianf |
63 |
Response.Redirect ( "fixed_issues.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id )
|
| 171 |
brianf |
64 |
Else
|
|
|
65 |
Call RaiseMsg(enum_MSG_ERROR, "Can only lock a " & spkgtype & " that is currently unlocked." )
|
|
|
66 |
End If
|
| 141 |
ghuddy |
67 |
Else
|
| 171 |
brianf |
68 |
Call RaiseMsg(enum_MSG_ERROR, "You do not have permissions to lock/unlock " & spkgtype & "." )
|
| 141 |
ghuddy |
69 |
End If
|
| 171 |
brianf |
70 |
|
| 141 |
ghuddy |
71 |
rsQry.Close
|
|
|
72 |
Set rsQry = nothing
|
| 171 |
brianf |
73 |
|
| 141 |
ghuddy |
74 |
%>
|
|
|
75 |
|
|
|
76 |
<!-- DESTRUCTOR ------->
|
|
|
77 |
<!--#include file="common/destructor.asp"-->
|