Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5354 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|			          wAddRole					 	 |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
%>
13
<!--#include file="common/globals.asp"-->
14
<!--#include file="common/config.asp"-->
15
<!--#include file="common/common_subs.asp"-->
16
<!--#include file="common/_popup_window_common.asp"-->
17
<%
18
'------------ ACCESS CONTROL ------------------
19
%>
20
<!--#include file="_access_control_general.asp"-->
21
<%
22
'------------ VARIABLE DEFINITION -------------
23
Dim objFormCollector
24
'------------ CONSTANTS DECLARATION -----------
25
'------------ VARIABLE INIT -------------------
26
Set objFormCollector = CreateObject("Scripting.Dictionary")
27
'------------ CONDITIONS ----------------------
28
'----------------------------------------------
29
%>
30
<%
31
'--------------------------------------------------------------------------------------------------------------------------
32
Sub AddRole ()
33
	On Error Resume Next
34
 
35
	OraDatabase.Parameters.Add "ROLE_NAME", 	Request("role_name"), 		ORAPARM_INPUT, ORATYPE_STRING 
36
	OraDatabase.Parameters.Add "ROLE_COMMENTS", Request("role_comments"), 	ORAPARM_INPUT, ORATYPE_STRING 
37
	OraDatabase.Parameters.Add "APP_ID", 		Request("app_id"), 			ORAPARM_INPUT, ORATYPE_NUMBER 
38
 
39
 
40
	objEH.TryORA ( OraSession )
41
 
42
	OraDatabase.ExecuteSQL _
43
	"BEGIN pk_Role.Add_Role ( :ROLE_NAME, :ROLE_COMMENTS, :APP_ID ); END;"	
44
 
45
	objEH.CatchORA ( OraSession )
46
 
47
 
48
	OraDatabase.Parameters.Remove "ROLE_NAME"
49
	OraDatabase.Parameters.Remove "ROLE_COMMENTS"
50
	OraDatabase.Parameters.Remove "APP_ID"
51
 
52
End Sub
53
'--------------------------------------------------------------------------------------------------------------------------
54
%>
55
<%
56
'------------ RUN BEFORE PAGE RENDER ----------
57
' --- Get Form details from DB (for edit forms only) ---
58
'-------------------------------------------------------
59
 
60
' --- Load Validation Rules ---
61
Call objForm.LoadValidationRules ( Array("role_name", "role_comments"), OraDatabase )		' Load Validation Rules
62
 
63
 
64
' --- Enter Form Validation Rule Changes here... ----
65
'----------------------------------------------------
66
 
67
If CBool(Request("action")) Then
68
	If objForm.IsValidOnPostBack Then
69
		' --- Form is Valid ---
70
		Call AddRole()
71
 
72
		If objEH.Finally Then
73
			Call OpenInParentWindow ( Request("rfile") &"?"& objPMod.ComposeURL() )
74
			Call CloseWindow()
75
		End If
76
 
77
	End If
78
End If
79
'----------------------------------------------
80
%>
81
<html>
82
<head>
83
<title>Access Manager</title>
84
<link rel="shortcut icon" href="<%=FavIcon%>"/>
85
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
86
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
87
<link href="scripts/access_manager.css" rel="stylesheet" type="text/css">
88
<script language="JavaScript" src="scripts/common.js"></script>
89
</head>
90
 
91
<body background="images/bg_bage_pane.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.role_name.focus();">
92
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
93
  <tr>
94
    <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="images/i_role_lrg.gif" width="13" height="18" hspace="0" align="absmiddle">&nbsp;New Role </span> <br>
95
    Enter Role name and optional description. 
96
    </td>
97
  </tr>
98
  <form name="FormName" method="post" action="<%=SCRIPT_NAME%>">
99
  <tr>
100
    <td background="images/bg_drk_bage_pane.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
101
      <tr>
102
        <td>&nbsp;</td>
103
        <td align="right"><input name="btn" type="submit" class="form_btn" value="Create">
104
          <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();"></td>
105
      </tr>
106
    </table></td>
107
  </tr>
108
  <tr>
109
    <td background="images/bg_form.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
110
      <tr>
111
        <td width="1%"><img src="images/spacer.gif" width="60" height="200"></td>
112
        <td width="100%"><table width="100%"  border="0" cellspacing="2" cellpadding="0">
113
          <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
114
          <%If NOT objEH.Finally Then%>
115
          <tr>
116
            <td class="form_iname">&nbsp;</td>
117
            <td>
118
              <%objEH.DisplayMessage()%>
119
            </td>
120
            <td class="val_err"></td>
121
          </tr>
122
          <%End If%>
123
          <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
124
          <tr>
125
            <td nowrap class="form_iname" valign="top">Role Name </td>
126
            <td valign="top"><input name="role_name" type="text" class="form_ivalue" size="60" value="<%=Request("role_name")%>"></td>
127
            <td valign="top"> <%=objForm.Validate ("role_name")%> </td>
128
          </tr>
129
          <tr>
130
            <td valign="top" nowrap class="form_iname">Description</td>
131
            <td valign="top"><textarea name="role_comments" cols="60" rows="10" class="form_ivalue"><%=Request("role_comments")%></textarea></td>
132
            <td valign="top"> <%=objForm.Validate ("role_comments")%> </td>
133
          </tr>
134
          <tr>
135
            <td width="10%" class="form_iname">&nbsp;</td>
136
            <td width="1%">&nbsp;</td>
137
            <td width="90%" class="val_err"></td>
138
          </tr>
139
        </table></td>
140
      </tr>
141
    </table></td>
142
  </tr>
143
  <%=objPMod.ComposeHiddenTags()%>
144
  <input type="hidden" name="action" value="true">
145
  </form>
146
</table>
147
</body>
148
</html>
149
<%
150
'------------ RUN AFTER PAGE RENDER -----------
151
Set objFormCollector = Nothing
152
'----------------------------------------------
153
%>
154
<!--#include file="common/globals_destructor.asp"-->