Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
129 ghuddy 4
'                 EDIT 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
<!--#include file="common/conf.asp"-->
14
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/formating.asp"-->
16
<!--#include file="common/qstr.asp"-->
17
<!--#include file="common/common_subs.asp"-->
18
<!--#include file="common/common_dbedit.asp"-->
19
<%
20
' Set rfile parameter. This is a return page after Login
21
Call objPMod.StoreParameter ( "rfile", "members_personal_view.asp" )
22
'------------ ACCESS CONTROL ------------------
23
%>
24
<!--#include file="_access_control_login.asp"-->
25
<!--#include file="_access_control_general.asp"-->
26
<%
27
'------------ Variable Definition -------------
28
Dim parView_id
29
Dim parViewName
30
Dim parPkgInc
31
Dim parPubread
32
'------------ Constants Declaration -----------
33
'------------ Variable Init -------------------
34
parView_id = QStrPar("FRview_id")
35
parViewName = QStrPar("FRviewname")
36
parPkgInc = QStrPar("FRpkginc")
37
parPubread = QStrPar("FRpubread")
38
'----------------------------------------------
39
%>
40
<%
41
Sub Update_View ( NNview_id, SSViewName, SSPubread )
129 ghuddy 42
   Dim rsTemp, Query_String
43
   If SSPubread = "" Then SSPubread = "N"
44
   Query_String = _
45
   " SELECT *"&_
46
   " FROM views"&_
47
   " WHERE view_id = "& NNview_id
48
 
49
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
50
 
51
   'update fields
52
   rsTemp.Edit
53
   rsTemp.Fields("view_name").Value = SSViewName
54
   rsTemp.Fields("public_read").Value = SSPubread
55
   rsTemp.Update
56
 
57
   rsTemp.Close
58
   Set rsTemp = nothing
119 ghuddy 59
End Sub
60
 
61
Sub Update_View_Definition ( NNview_id, SSPkgInc )
129 ghuddy 62
   ' Remove current view definition
63
   On Error Resume Next
64
   objEH.TryORA ( OraSession )
65
   OraDatabase.ExecuteSQL "DELETE FROM view_def WHERE view_id = "& NNview_id
66
   objEH.CatchORA ( OraSession )
67
   If objEH.LastOraFailed = FALSE Then
68
      ' Set view definition
69
      If SSPkgInc <> "" Then
70
         objEH.TryORA ( OraSession )
71
         OraDatabase.ExecuteSQL _
72
            " INSERT INTO view_def"&_
73
            " SELECT TO_NUMBER('"& NNview_id &"') AS view_id, pkg_id FROM packages WHERE pkg_id IN ("& SSPkgInc &")"
74
         objEH.CatchORA ( OraSession )
75
      End If
76
   End If
119 ghuddy 77
End Sub
78
%>
79
<%
80
'-----------------------  MAIN LINE  ---------------------------
81
 
82
'--- Process submition ---
83
If (parView_id <> "") AND (parViewName <> "") Then
1376 dpurdie 84
   ' All mandatory parameters FOUND
129 ghuddy 85
 
86
   ' report errors if found
87
   If NOT This_View_Owner( parView_id, objAccessControl.UserId ) Then
88
      Session("reqParam") = ""
89
      Session("ERRlog") = ""
90
      Session("ERRlogFULL") = ""
91
      Response.Redirect("message.asp?msg=401-4")
92
   End If
93
 
94
   'COMPLETE THE REQUEST...
95
   Call Update_View ( parView_id, parViewName, parPubread )
96
   Call Update_View_Definition ( parView_id, parPkgInc )
97
 
98
   Response.Redirect("members_personal_view.asp")
119 ghuddy 99
Else
1376 dpurdie 100
   Response.write "Some mandatory parameters are missing!" & "<br>" 'TODO
4955 dpurdie 101
   Response.write QSTR_FullQuery
119 ghuddy 102
End If
103
%>
104
 
105
<!-- DESTRUCTOR ------->
129 ghuddy 106
<!--#include file="common/destructor.asp"-->