| 119 |
ghuddy |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
'=====================================================
|
| 129 |
ghuddy |
4 |
' ADD NEW Personal View
|
| 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"-->
|
|
|
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 )
|
| 129 |
ghuddy |
41 |
Dim SEQ_view_id
|
|
|
42 |
If NNpubread = "" Then NNpubread = "N"
|
|
|
43 |
SEQ_view_id = Get_From_DUAL("SEQ_VIEW_ID.nextval")
|
|
|
44 |
|
|
|
45 |
' Create new view
|
|
|
46 |
On Error Resume Next
|
|
|
47 |
objEH.TryORA ( OraSession )
|
|
|
48 |
OraDatabase.ExecuteSQL _
|
|
|
49 |
" INSERT INTO views (view_id, view_name, owner_id, base_view, public_read)"&_
|
|
|
50 |
" VALUES ("& SEQ_view_id &", '"& SSviewname &"', "& objAccessControl.UserId &", 'N', '"& NNpubread &"')"
|
|
|
51 |
objEH.CatchORA ( OraSession )
|
|
|
52 |
|
|
|
53 |
If objEH.LastOraFailed = FALSE Then
|
|
|
54 |
|
|
|
55 |
objEH.TryORA ( OraSession )
|
|
|
56 |
|
|
|
57 |
' Set view_setting to SHOW new view
|
|
|
58 |
OraDatabase.ExecuteSQL _
|
|
|
59 |
" INSERT INTO view_settings (user_id, view_id)"&_
|
|
|
60 |
" VALUES ("& objAccessControl.UserId &", "& SEQ_view_id &")"
|
|
|
61 |
|
|
|
62 |
' Set view definition
|
|
|
63 |
If SSPkgInc <> "" Then
|
|
|
64 |
OraDatabase.ExecuteSQL _
|
|
|
65 |
" INSERT INTO view_def"&_
|
|
|
66 |
" SELECT TO_NUMBER('"& SEQ_view_id &"') AS view_id, pkg_id FROM packages WHERE pkg_id IN ("& SSPkgInc &")"
|
|
|
67 |
End If
|
|
|
68 |
|
|
|
69 |
objEH.CatchORA ( OraSession )
|
|
|
70 |
End If
|
| 119 |
ghuddy |
71 |
End Function
|
|
|
72 |
|
|
|
73 |
%>
|
|
|
74 |
<%
|
|
|
75 |
'----------------------- MAIN LINE ---------------------------
|
|
|
76 |
|
|
|
77 |
'--- Process submition ---
|
|
|
78 |
If (parViewName <> "") Then
|
| 1376 |
dpurdie |
79 |
' All mandatory parameters FOUND
|
| 129 |
ghuddy |
80 |
|
|
|
81 |
' report errors if found
|
|
|
82 |
If View_Name_Exists( parViewName, objAccessControl.UserId ) Then
|
|
|
83 |
Session("reqParam") = ""
|
|
|
84 |
Session("ERRlog") = ""
|
|
|
85 |
Session("ERRlogFULL") = ""
|
|
|
86 |
Session("AdditionalParams") = "$PERSONALVIEWNAME$,"& parViewName
|
|
|
87 |
Response.Redirect("message.asp?msg=202-9")
|
|
|
88 |
End If
|
|
|
89 |
|
|
|
90 |
'COMPLETE THE REQUEST...
|
|
|
91 |
Call Create_New_View ( parViewName, parPkgInc, parPubread )
|
|
|
92 |
|
|
|
93 |
Response.Redirect("members_personal_view.asp")
|
| 119 |
ghuddy |
94 |
Else
|
| 1376 |
dpurdie |
95 |
Response.write "Some mandatory parameters are missing!" & "<br>" 'TODO
|
| 4955 |
dpurdie |
96 |
Response.write QSTR_FullQuery
|
| 119 |
ghuddy |
97 |
End If
|
|
|
98 |
%>
|
|
|
99 |
|
|
|
100 |
<!-- DESTRUCTOR ------->
|
| 129 |
ghuddy |
101 |
<!--#include file="common/destructor.asp"-->
|