| 119 |
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 pending_unlock
|
|
|
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 |
|
|
|
38 |
OraSession.BeginTrans
|
|
|
39 |
|
|
|
40 |
OraDatabase.ExecuteSQL _
|
|
|
41 |
"BEGIN Lock_Package( :PV_ID, :USER_ID ); END;"
|
|
|
42 |
|
|
|
43 |
OraSession.CommitTrans
|
|
|
44 |
|
|
|
45 |
|
|
|
46 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
47 |
OraDatabase.Parameters.Remove "USER_ID"
|
|
|
48 |
|
|
|
49 |
End Sub
|
|
|
50 |
Sub DLocked_A ()
|
|
|
51 |
|
|
|
52 |
OraDatabase.Parameters.Add "PV_ID", Request("pv_id"), ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
53 |
OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
OraSession.BeginTrans
|
|
|
57 |
|
|
|
58 |
OraDatabase.ExecuteSQL _
|
|
|
59 |
"BEGIN Pending_Package( :PV_ID, :USER_ID ); END;"
|
|
|
60 |
|
|
|
61 |
OraSession.CommitTrans
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
65 |
OraDatabase.Parameters.Remove "USER_ID"
|
|
|
66 |
|
|
|
67 |
End Sub
|
|
|
68 |
%>
|
|
|
69 |
<%
|
|
|
70 |
Dim sqlstr, rsTemp, rsQry
|
|
|
71 |
sqlstr = "select pkg_label from package_versions where PV_ID ="& parPv_id
|
|
|
72 |
|
|
|
73 |
Set rsTemp = OraDatabase.DbCreateDynaset( sqlstr, cint(0))
|
|
|
74 |
|
|
|
75 |
If instr(rsTemp("pkg_label"),"WIP") <> 0 Then
|
|
|
76 |
pending_unlock = true
|
|
|
77 |
End If
|
|
|
78 |
|
|
|
79 |
rsTemp.Close
|
|
|
80 |
Set rsTemp = nothing
|
|
|
81 |
'Process submition
|
|
|
82 |
'---------------------------------------
|
|
|
83 |
' THIS IS FOR SYSTEM ADMIN ONLY
|
|
|
84 |
'---------------------------------------
|
|
|
85 |
If objAccessControl.IsVisible("UnlockPackage") AND NOT pending_unlock Then
|
|
|
86 |
Call LockPackage ()
|
|
|
87 |
Response.Redirect ( "_generate_release_notes.asp?rfile=dependencies.asp&pv_id="& parPv_id &"&rtag_id="& parRtag_id )
|
|
|
88 |
End If
|
|
|
89 |
If objAccessControl.IsVisible("UnlockPackage") AND pending_unlock Then
|
|
|
90 |
'Check If There Already Exists A WIP Instance Of The Package In The Release
|
|
|
91 |
If Check_Package_WIP_Already_Exists(Request("rtag_id"), Request("pv_id")) > 0 Then
|
|
|
92 |
Call RaiseMsg ( enum_MSG_PACKAGE_WIP_EXISTS&"?rtag_id="& parRtag_id &"&pv_id="& parPv_id &"", parPv_id )
|
|
|
93 |
End If
|
|
|
94 |
Call DLocked_A()
|
|
|
95 |
Response.Redirect ( "dependencies.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id )
|
|
|
96 |
End If
|
|
|
97 |
%>
|
|
|
98 |
|
|
|
99 |
<!-- DESTRUCTOR ------->
|
|
|
100 |
<!--#include file="common/destructor.asp"-->
|