Subversion Repositories DevTools

Rev

Rev 119 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 119 Rev 129
Line 1... Line 1...
1
<%@LANGUAGE="VBSCRIPT"%>
1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
2
<%
3
'=====================================================
3
'=====================================================
4
' 			 	   ADD NEW Personal View
4
'                 ADD NEW Personal View
5
'               --- PROCESS FORM ---
5
'               --- PROCESS FORM ---
6
'=====================================================
6
'=====================================================
7
%>
7
%>
8
<%
8
<%
9
Option explicit
9
Option explicit
10
' Good idea to set when using redirect
10
' Good idea to set when using redirect
11
Response.Expires = 0	' always load the page, dont store
11
Response.Expires = 0   ' always load the page, dont store
12
%>
12
%>
13
 
13
 
14
<!--#include file="common/conf.asp"-->
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
16
<!--#include file="common/formating.asp"-->
Line 36... Line 36...
36
parPubread = QStrPar("FRpubread")
36
parPubread = QStrPar("FRpubread")
37
'----------------------------------------------
37
'----------------------------------------------
38
%>
38
%>
39
<%
39
<%
40
Function Create_New_View ( SSviewname, SSPkgInc, NNpubread )
40
Function Create_New_View ( SSviewname, SSPkgInc, NNpubread )
41
	Dim SEQ_view_id
41
   Dim SEQ_view_id
42
	If NNpubread = "" Then NNpubread = "N"
42
   If NNpubread = "" Then NNpubread = "N"
43
	SEQ_view_id = Get_From_DUAL("SEQ_VIEW_ID.nextval")
43
   SEQ_view_id = Get_From_DUAL("SEQ_VIEW_ID.nextval")
-
 
44
 
44
	' Create new view
45
   ' Create new view
45
	OraSession.BeginTrans
46
   On Error Resume Next
-
 
47
   objEH.TryORA ( OraSession )
46
	OraDatabase.ExecuteSQL _
48
   OraDatabase.ExecuteSQL _
47
		" INSERT INTO views (view_id, view_name, owner_id, base_view, public_read)"&_
49
      " INSERT INTO views (view_id, view_name, owner_id, base_view, public_read)"&_
48
		" VALUES ("& SEQ_view_id &", '"& SSviewname &"', "& objAccessControl.UserId &", 'N', '"& NNpubread &"')"
50
      " VALUES ("& SEQ_view_id &", '"& SSviewname &"', "& objAccessControl.UserId &", 'N', '"& NNpubread &"')"
49
  	OraSession.CommitTrans
51
   objEH.CatchORA ( OraSession )
-
 
52
 
-
 
53
   If objEH.LastOraFailed = FALSE Then
-
 
54
 
-
 
55
      objEH.TryORA ( OraSession )
50
	
56
 
51
	' Set view_setting to SHOW new view
57
      ' Set view_setting to SHOW new view
52
	OraSession.BeginTrans
-
 
53
	OraDatabase.ExecuteSQL _
58
      OraDatabase.ExecuteSQL _
54
		" INSERT INTO view_settings (user_id, view_id)"&_
59
         " INSERT INTO view_settings (user_id, view_id)"&_
55
		" VALUES ("& objAccessControl.UserId &", "& SEQ_view_id &")"
60
         " VALUES ("& objAccessControl.UserId &", "& SEQ_view_id &")"
56
  	OraSession.CommitTrans
-
 
57
	
61
 
58
	' Set view definition
62
      ' Set view definition
59
	If SSPkgInc <> "" Then
63
      If SSPkgInc <> "" Then
60
		OraSession.BeginTrans
-
 
61
		OraDatabase.ExecuteSQL _
64
         OraDatabase.ExecuteSQL _
62
			" INSERT INTO view_def"&_
65
            " INSERT INTO view_def"&_
63
			" SELECT TO_NUMBER('"& SEQ_view_id &"') AS view_id, pkg_id FROM packages WHERE pkg_id IN ("& SSPkgInc &")"
66
            " SELECT TO_NUMBER('"& SEQ_view_id &"') AS view_id, pkg_id FROM packages WHERE pkg_id IN ("& SSPkgInc &")"
-
 
67
      End If
-
 
68
 
64
	  	OraSession.CommitTrans
69
      objEH.CatchORA ( OraSession )
65
	End If
70
   End If
66
End Function
71
End Function
67
 
72
 
68
%>
73
%>
69
<%
74
<%
70
'-----------------------  MAIN LINE  ---------------------------
75
'-----------------------  MAIN LINE  ---------------------------
71
 
76
 
72
'--- Process submition ---
77
'--- Process submition ---
73
If (parViewName <> "") Then
78
If (parViewName <> "") Then
74
	' All mendatory parameters FOUND
79
   ' All mendatory parameters FOUND
75
	
80
 
76
	' report errors if found
81
   ' report errors if found
77
	If View_Name_Exists( parViewName, objAccessControl.UserId ) Then 
82
   If View_Name_Exists( parViewName, objAccessControl.UserId ) Then
78
		Session("reqParam") = ""
83
      Session("reqParam") = ""
79
		Session("ERRlog") = ""
84
      Session("ERRlog") = ""
80
		Session("ERRlogFULL") = ""
85
      Session("ERRlogFULL") = ""
81
		Session("AdditionalParams") = "$PERSONALVIEWNAME$,"& parViewName
86
      Session("AdditionalParams") = "$PERSONALVIEWNAME$,"& parViewName
82
		Response.Redirect("message.asp?msg=202-9")
87
      Response.Redirect("message.asp?msg=202-9")
83
	End If
88
   End If
84
	
89
 
85
	'COMPLETE THE REQUEST...
90
   'COMPLETE THE REQUEST...
86
	Call Create_New_View ( parViewName, parPkgInc, parPubread )
91
   Call Create_New_View ( parViewName, parPkgInc, parPubread )
87
	
92
 
88
	Response.Redirect("members_personal_view.asp")
93
   Response.Redirect("members_personal_view.asp")
89
Else
94
Else
90
	Response.write "Some mendatory parameters are missing!" & "<br>" 'TODO
95
   Response.write "Some mendatory parameters are missing!" & "<br>" 'TODO
91
	Response.write QSTR_All 
96
   Response.write QSTR_All
92
End If
97
End If
93
%>
98
%>
94
 
99
 
95
<!-- DESTRUCTOR ------->
100
<!-- DESTRUCTOR ------->
96
<!--#include file="common/destructor.asp"-->
-
 
97
101
<!--#include file="common/destructor.asp"-->
-
 
102