Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
141 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
Option explicit
4
Response.Expires = 0   ' always load the page, dont store
5
%>
6
<%
7
'=====================================================
8
'               System Unlock 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_login.asp"-->
21
<!--#include file="_access_control_general.asp"-->
22
<!--#include file="_access_control_project.asp"-->
23
<%
24
'------------ Variable Definition -------------
25
Dim parPv_id
26
Dim QueryString, rsQry
27
'------------ Constants Declaration -----------
28
'------------ Variable Init -------------------
29
parPv_id = QStrPar("pv_id")
30
parRtag_id = QStrPar("rtag_id")
31
'----------------------------------------------
32
%>
33
<%
183 brianf 34
Sub UnlockPackage (bRunAdminTools)
141 ghuddy 35
   Dim objWSH
36
 
37
   OraDatabase.Parameters.Add "PV_ID",   Request("pv_id"),        ORAPARM_INPUT, ORATYPE_NUMBER
38
   OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
39
 
40
   objEH.TryORA ( OraSession )
41
   On Error Resume Next
42
 
43
   OraDatabase.ExecuteSQL _
44
   "BEGIN  Unlock_Package( :PV_ID, :USER_ID );  END;"
45
 
46
   objEH.CatchORA ( OraSession )
47
 
48
   OraDatabase.Parameters.Remove "PV_ID"
49
   OraDatabase.Parameters.Remove "USER_ID"
50
 
183 brianf 51
   If (objEH.LastOraFailed = FALSE) AND (bRunAdminTools) Then
5172 dpurdie 52
       ' Does nothing.
53
       ' Once upon a time it would make the package writable in the package archive
54
       ' but this is no more.
141 ghuddy 55
   End If
56
End Sub
57
%>
58
<%
171 brianf 59
 
141 ghuddy 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") = "Y" Then
183 brianf 78
    Call UnlockPackage (bis_patch)
79
    If bis_patch Then
80
      Response.Redirect ("dependencies.asp?rtag_id="& parRtag_id &"&pv_id="& parPv_id)
81
    Else
82
      Response.Redirect ( "fixed_issues.asp?rtag_id="& parRtag_id &"&pv_id="& parPv_id)
83
    End If
171 brianf 84
  Else
85
    Call RaiseMsg(enum_MSG_ERROR, "Can only unlock a " & spkgtype & " that is currently locked." )
86
  End If
141 ghuddy 87
Else
171 brianf 88
  Call RaiseMsg(enum_MSG_ERROR, "You do not have permissions to lock/unlock " & spkgtype & "." )
141 ghuddy 89
End If
171 brianf 90
 
141 ghuddy 91
rsQry.Close
92
Set rsQry = nothing
171 brianf 93
 
141 ghuddy 94
%>
95
 
96
<!-- DESTRUCTOR ------->
97
<!--#include file="common/destructor.asp"-->