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 Public View
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
<!--#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"-->
20
<%
21
' Set rfile parameter. This is a return page after Login
22
Call objPMod.StoreParameter ( "rfile", "members_public_view.asp" )
23
'------------ ACCESS CONTROL ------------------
24
%>
25
<!--#include file="_access_control_login.asp"-->
26
<!--#include file="_access_control_general.asp"-->
27
<%
28
'------------ Variable Definition -------------
29
Dim parViewName
30
Dim parPkgInc
31
'------------ Constants Declaration -----------
32
'------------ Variable Init -------------------
33
parViewName = QStrPar("FRviewname")
34
parPkgInc = QStrPar("FRpkginc")
35
'----------------------------------------------
36
%>
37
<%
38
Function Create_New_View ( SSviewname, SSPkgInc )
39
	Dim SEQ_view_id
40
	SEQ_view_id = Get_From_DUAL("SEQ_VIEW_ID.nextval")
41
	' Create new view
42
	OraSession.BeginTrans
43
	OraDatabase.ExecuteSQL _
44
		" INSERT INTO views (view_id, view_name, owner_id, base_view, public_read)"&_
45
		" VALUES ("& SEQ_view_id &", '"& SSviewname &"', 0, 'N', 'Y')"
46
  	OraSession.CommitTrans
47
 
48
	' Set view_setting to SHOW new view
49
	OraSession.BeginTrans
50
	OraDatabase.ExecuteSQL _
51
		" INSERT INTO view_settings (user_id, view_id)"&_
52
		" VALUES ( 0, "& SEQ_view_id &")"
53
  	OraSession.CommitTrans
54
 
55
	' Set view definition
56
	If SSPkgInc <> "" Then
57
		OraSession.BeginTrans
58
		OraDatabase.ExecuteSQL _
59
			" INSERT INTO view_def"&_
60
			" SELECT TO_NUMBER('"& SEQ_view_id &"') AS view_id, pkg_id FROM packages WHERE pkg_id IN ("& SSPkgInc &")"
61
	  	OraSession.CommitTrans
62
	End If
63
End Function
64
 
65
%>
66
<%
67
'-----------------------  MAIN LINE  ---------------------------
68
 
69
'--- Process submition ---
70
If (parViewName <> "") Then
71
	' All mendatory parameters FOUND
72
 
73
	' report errors if found
74
	If View_Name_Exists( parViewName, 0 ) Then 
75
		Session("reqParam") = ""
76
		Session("ERRlog") = ""
77
		Session("ERRlogFULL") = ""
78
		Session("AdditionalParams") = "$PUBLICVIEWNAME$,"& parViewName
79
		Response.Redirect("message.asp?msg=202-13")
80
	End If
81
 
82
	'COMPLETE THE REQUEST...
83
	Call Create_New_View ( parViewName, parPkgInc)
84
 
85
	Response.Redirect("members_public_view.asp")
86
Else
87
	Response.write "Some mendatory parameters are missing!" & "<br>" 'TODO
88
	Response.write QSTR_All 
89
End If
90
%>
91
 
92
<!-- DESTRUCTOR ------->
93
<!--#include file="common/destructor.asp"-->