Subversion Repositories DevTools

Rev

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

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