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 Personal 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_personal_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
Dim parPubread
32
'------------ Constants Declaration -----------
33
'------------ Variable Init -------------------
34
parViewName = QStrPar("FRviewname")
35
parPkgInc = QStrPar("FRpkginc")
36
parPubread = QStrPar("FRpubread")
37
'----------------------------------------------
38
%>
39
<%
40
Function Create_New_View ( SSviewname, SSPkgInc, NNpubread )
41
	Dim SEQ_view_id
42
	If NNpubread = "" Then NNpubread = "N"
43
	SEQ_view_id = Get_From_DUAL("SEQ_VIEW_ID.nextval")
44
	' Create new view
45
	OraSession.BeginTrans
46
	OraDatabase.ExecuteSQL _
47
		" INSERT INTO views (view_id, view_name, owner_id, base_view, public_read)"&_
48
		" VALUES ("& SEQ_view_id &", '"& SSviewname &"', "& objAccessControl.UserId &", 'N', '"& NNpubread &"')"
49
  	OraSession.CommitTrans
50
 
51
	' Set view_setting to SHOW new view
52
	OraSession.BeginTrans
53
	OraDatabase.ExecuteSQL _
54
		" INSERT INTO view_settings (user_id, view_id)"&_
55
		" VALUES ("& objAccessControl.UserId &", "& SEQ_view_id &")"
56
  	OraSession.CommitTrans
57
 
58
	' Set view definition
59
	If SSPkgInc <> "" Then
60
		OraSession.BeginTrans
61
		OraDatabase.ExecuteSQL _
62
			" INSERT INTO view_def"&_
63
			" SELECT TO_NUMBER('"& SEQ_view_id &"') AS view_id, pkg_id FROM packages WHERE pkg_id IN ("& SSPkgInc &")"
64
	  	OraSession.CommitTrans
65
	End If
66
End Function
67
 
68
%>
69
<%
70
'-----------------------  MAIN LINE  ---------------------------
71
 
72
'--- Process submition ---
73
If (parViewName <> "") Then
74
	' All mendatory parameters FOUND
75
 
76
	' report errors if found
77
	If View_Name_Exists( parViewName, objAccessControl.UserId ) Then 
78
		Session("reqParam") = ""
79
		Session("ERRlog") = ""
80
		Session("ERRlogFULL") = ""
81
		Session("AdditionalParams") = "$PERSONALVIEWNAME$,"& parViewName
82
		Response.Redirect("message.asp?msg=202-9")
83
	End If
84
 
85
	'COMPLETE THE REQUEST...
86
	Call Create_New_View ( parViewName, parPkgInc, parPubread )
87
 
88
	Response.Redirect("members_personal_view.asp")
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"-->