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