Subversion Repositories DevTools

Rev

Rev 5293 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
141 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
5293 dpurdie 3
'=====================================================
4
'   _s_unlock_package.asp
5
'   System Unlock 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_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
<%
5293 dpurdie 34
Sub UnlockPackage (bIsPatch)
141 ghuddy 35
 
36
   OraDatabase.Parameters.Add "PV_ID",   Request("pv_id"),        ORAPARM_INPUT, ORATYPE_NUMBER
37
   OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
38
 
39
   objEH.TryORA ( OraSession )
40
   On Error Resume Next
41
 
42
   OraDatabase.ExecuteSQL _
43
   "BEGIN  Unlock_Package( :PV_ID, :USER_ID );  END;"
44
 
45
   objEH.CatchORA ( OraSession )
46
 
47
   OraDatabase.Parameters.Remove "PV_ID"
48
   OraDatabase.Parameters.Remove "USER_ID"
49
 
5293 dpurdie 50
   If (objEH.LastOraFailed = FALSE) AND (bIsPatch) Then
51
        ' If this is a patch, then make the package, in dpkg_archive, writable
52
        ' This is UGLY
53
        '
54
        Dim objRC: Set objRC = New ReleaseChanged
55
        Call objRC.MakeWritable(parRtag_id, parPv_id )
56
 
141 ghuddy 57
   End If
58
End Sub
59
%>
60
<%
171 brianf 61
 
141 ghuddy 62
'Process submition
63
'---------------------------------------
64
' THIS IS FOR SYSTEM ADMIN ONLY
65
'---------------------------------------
66
QueryString = "SELECT pv.DLOCKED, pv.IS_PATCH FROM PACKAGE_VERSIONS pv WHERE pv.PV_ID = "& parPv_id
67
Set rsQry = OraDatabase.DbCreateDynaset( QueryString, cint(0))
171 brianf 68
Dim bis_patch: bis_patch = Not IsNull(rsQry("is_patch"))
69
Dim spkgtype: spkgtype = iif(bis_patch,"patch","package")
183 brianf 70
Dim bcan_unlock
171 brianf 71
 
183 brianf 72
If bis_patch Then
5061 dpurdie 73
  bcan_unlock = canActionControlInProject("UnlockPatch")
183 brianf 74
Else
5061 dpurdie 75
  bcan_unlock = canActionControlInProject("EditCriticalInfoForLockedPackage")
183 brianf 76
End If
77
 
78
If bcan_unlock  Then
171 brianf 79
  If rsQry("dlocked") = "Y" Then
183 brianf 80
    Call UnlockPackage (bis_patch)
5293 dpurdie 81
    Response.Redirect ( "fixed_issues.asp?rtag_id="& parRtag_id &"&pv_id="& parPv_id)
171 brianf 82
  Else
83
    Call RaiseMsg(enum_MSG_ERROR, "Can only unlock a " & spkgtype & " that is currently locked." )
84
  End If
141 ghuddy 85
Else
171 brianf 86
  Call RaiseMsg(enum_MSG_ERROR, "You do not have permissions to lock/unlock " & spkgtype & "." )
141 ghuddy 87
End If
171 brianf 88
 
141 ghuddy 89
rsQry.Close
90
Set rsQry = nothing
171 brianf 91
 
141 ghuddy 92
%>
93
 
94
<!-- DESTRUCTOR ------->
95
<!--#include file="common/destructor.asp"-->