Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
' 			  ADD NEW Runtime Dependency
5
'               --- PROCESS FORM ---
6
'=====================================================
7
%>
8
<%
9
Option explicit
10
' Good idea to set when using redirect
11
Response.Expires = 0	' always load the page, dont store
12
%>
13
<%
14
' Page Access Condition
15
%>
16
<!--#include file="common/conf.asp"-->
17
<!--#include file="common/globals.asp"-->
18
<!--#include file="common/formating.asp"-->
19
<!--#include file="common/qstr.asp"-->
20
<!--#include file="common/common_subs.asp"-->
21
<!--#include file="common/common_dbedit.asp"-->
22
<%
23
' Set rfile parameter. This is a return page after Login
24
Call objPMod.StoreParameter ( "rfile", "runtime_dependencies.asp" )
25
'------------ ACCESS CONTROL ------------------
26
%>
27
<!--#include file="_access_control_login.asp"-->
28
<!--#include file="_access_control_general.asp"-->
29
<!--#include file="_access_control_project.asp"-->
30
<%
31
'------------ Variable Definition -------------
32
Dim rtdArray()
33
'------------ Constants Declaration -----------
34
Const COL_pkg_name = 0
35
Const COL_pkg_version = 1
36
'------------ Variable Init -------------------
37
'----------------------------------------------
38
%>
39
<%
40
Sub Add_Runtime_Dependency ( ARRrtd, NNpv_id, NNuser_id )
41
	Dim i
42
 
43
	For i = 0 To UBound( ARRrtd, 2 )
44
		OraDatabase.ExecuteSQL "BEGIN Add_Runtime_Dependency ( "& NNpv_id &", "&_
45
		                                                          "'"& ARRrtd( COL_pkg_name, i ) &"', "&_
46
																  "'"& ARRrtd( COL_pkg_version, i ) &"', "&_
47
																  NNuser_id &" ); END;"
48
	Next
49
 
50
End Sub
51
 
52
Sub Populate_rtdArray ( NNpkg_list, ARRrtd )
53
	Dim depList, lastItem, i, recCnt, pkg_name, pkg_version
54
	Dim rsTemp, Query_String
55
 
56
	Query_String = _
57
	" SELECT pkg_id, pkg_name"&_
58
	"  FROM packages"&_
59
	" WHERE pkg_id IN ("& NNpkg_list &")"
60
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
61
 
62
	recCnt = 0
63
	While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
64
		ReDim Preserve ARRrtd( 1, recCnt )
65
		ARRrtd( COL_pkg_name, recCnt ) = rsTemp("pkg_name")
66
		ARRrtd( COL_pkg_version, recCnt ) =  Trim( Request( "pkgn"& rsTemp("pkg_id") ) )		' Trim extra spaces
67
 
68
		recCnt = recCnt + 1
69
		rsTemp.MoveNext
70
	WEnd
71
 
72
	rsTemp.Close
73
	Set rsTemp = nothing
74
End Sub
75
%>
76
<%
77
'-----------------------  MAIN LINE  ---------------------------
78
 
79
'--- Process submition ---
80
If (Request("pv_id") <> "") AND (Request("rtag_id") <> "") Then
81
	' All mendatory parameters FOUND
82
 
83
	'COMPLETE THE REQUEST...
84
	Call Populate_rtdArray ( Request("pkg_list"), rtdArray )
85
 
86
	Call Add_Runtime_Dependency ( rtdArray, Request("pv_id"), objAccessControl.UserId )
87
 
88
	Response.Redirect("runtime_dependencies.asp?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id"))
89
Else
90
	Response.write "Some mendatory parameters are missing!" & "<br>" 'TODO
91
	Response.write QSTR_All 
92
End If
93
%>
94
 
95
<!-- DESTRUCTOR ------->
96
<!--#include file="common/destructor.asp"-->