Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
129 ghuddy 4
'                  MAKE PENDING
119 ghuddy 5
'               --- PROCESS FORM ---
6
'=====================================================
7
%>
8
<%
9
Option explicit
10
' Good idea to set when using redirect
129 ghuddy 11
Response.Expires = 0   ' always load the page, dont store
119 ghuddy 12
%>
13
 
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<!--#include file="common/common_dbedit.asp"-->
153 ghuddy 20
<!--#include file="common/daemon_instructions.asp"-->
119 ghuddy 21
<%
22
'------------ ACCESS CONTROL ------------------
23
%>
24
<!--#include file="_access_control_login.asp"-->
25
<!--#include file="_access_control_general.asp"-->
26
<!--#include file="_access_control_project.asp"-->
27
<%
28
'------------ Variable Definition -------------
29
Dim parPv_id
30
Dim parRfile
31
Dim retERRmsg
32
Dim retALRTmsg
33
Dim retParameters
34
Dim pkgType
35
'------------ Constants Declaration -----------
36
'------------ Variable Init -------------------
37
parPv_id = Request("pv_id")
38
parRfile = Request("rfile")
39
'------------ Constants Declaration -----------
40
'------------ Variable Init -------------------
41
'----------------------------------------------
42
%>
43
<%
44
Sub MakePending ()
129 ghuddy 45
   Dim objWSH
46
   Set objWSH = Server.CreateObject("WScript.Shell")
121 hknight 47
 
129 ghuddy 48
   OraDatabase.Parameters.Add "PV_ID",    Request("pv_id"),        ORAPARM_INPUT, ORATYPE_NUMBER
49
   OraDatabase.Parameters.Add "RTAG_ID",  Request("rtag_id"),      ORAPARM_INPUT, ORATYPE_NUMBER
50
   OraDatabase.Parameters.Add "USER_ID",  objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
51
 
52
   objEH.TryORA ( OraSession )
53
   On Error Resume Next
54
 
55
   OraDatabase.ExecuteSQL " UPDATE package_versions "&_
56
                     " SET owner_id = :USER_ID"&_
57
                     " WHERE pv_id = :PV_ID"
58
 
59
   OraDatabase.ExecuteSQL _
60
   "BEGIN "&_
61
   " PK_ENVIRONMENT.MAKE_PENDING ( :PV_ID, :RTAG_ID, :USER_ID ); "&_
62
   "END; "
63
 
64
   objEH.CatchORA ( OraSession )
65
 
66
   OraDatabase.Parameters.Remove "PV_ID"
67
   OraDatabase.Parameters.Remove "RTAG_ID"
68
   OraDatabase.Parameters.Remove "USER_ID"
69
 
70
   If objEH.LastOraFailed = FALSE Then
71
      objWSH.Run   "cmd.exe /c cscript.exe //B //NoLogo "& rootPath & SCRIPTS_FOLDER &"\on_Make_Official.wsf //job:GetComponents //job:PostRun "&_
72
                  "/pv_id:"& Request("pv_id") , _
73
                  0, False
74
   End If
75
 
119 ghuddy 76
End Sub
77
%>
78
<%
79
'-----------------------  MAIN LINE  ---------------------------
80
 
81
'--- Process submition ---
82
If ( Request("rtag_id") <> "") AND (Request("pv_id") <> "") Then
129 ghuddy 83
 
84
   Call CheckRequirementsForMakePending ( parPv_id, parRtag_id, pkgType, retERRmsg, retALRTmsg, retParameters )
85
 
86
   If IsNull(retERRmsg) Then
87
      ' All Requirements OK
88
      'COMPLETE THE REQUEST...
89
 
153 ghuddy 90
      If (DaemonInstructionPreventsEditing(Request("rtag_id"), Request("pv_id"))) Then
91
         Call RaiseMsg(enum_MSG_ERROR, "This package version has one or more daemon instructions present.<br><br>"&_
92
                                       "Please delete them or allow them to be consumed before attempting to make the package version pending.")
129 ghuddy 93
      Else
153 ghuddy 94
         Call MakePending ( )
95
 
96
         If Request("rfile") <> "" Then
97
            Response.Redirect ( Request("rfile") &"?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") )
98
         Else
99
            Response.Redirect ( "dependencies?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") )
100
         End If
129 ghuddy 101
      End If
102
 
103
   Else
104
      Call RaiseMsg ( Eval(retERRmsg), parRtag_id &"|"& parPv_id    &"|"& retParameters &"|"& "N" )
105
 
106
   End If
107
 
119 ghuddy 108
Else
129 ghuddy 109
   Response.write "Some mendatory parameters are missing!" & "<br>" 'TODO
110
   Response.write QSTR_All
119 ghuddy 111
End If
112
%>
113
 
114
<!-- DESTRUCTOR ------->
129 ghuddy 115
<!--#include file="common/destructor.asp"-->