Subversion Repositories DevTools

Rev

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

Rev 6 Rev 5354
Line 1... Line 1...
1
<%@LANGUAGE="VBSCRIPT"%>
1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
2
<%
3
'=====================================================
3
'=====================================================
4
'|                                                   |
4
'|                                                   |
5
'|                   wAddToApplication               |
5
'|                   wAddToApplication               |
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 AddToApplication ()
33
Sub AddToApplication ()
34
	On Error Resume Next
34
	On Error Resume Next
35
	
35
	
36
	OraDatabase.Parameters.Add "USER_ID_LIST", 	Request("user_id"), 	ORAPARM_INPUT, ORATYPE_VARCHAR2
36
	OraDatabase.Parameters.Add "USER_ID_LIST", 	Request("user_id"), 	ORAPARM_INPUT, ORATYPE_VARCHAR2
37
	OraDatabase.Parameters.Add "APP_ID", 		Request("new_app_id"), 			ORAPARM_INPUT, ORATYPE_NUMBER
37
	OraDatabase.Parameters.Add "APP_ID", 		Request("new_app_id"), 			ORAPARM_INPUT, ORATYPE_NUMBER
38
	
38
	
39
	objEH.TryORA ( OraSession )
39
	objEH.TryORA ( OraSession )
40
	
40
	
41
		OraDatabase.ExecuteSQL "BEGIN   pk_User.Add_Application_User ( :USER_ID_LIST, :APP_ID, NULL );   END;"
41
		OraDatabase.ExecuteSQL "BEGIN   pk_User.Add_Application_User ( :USER_ID_LIST, :APP_ID, NULL );   END;"
42
	
42
	
43
	objEH.CatchORA ( OraSession )
43
	objEH.CatchORA ( OraSession )
44
	
44
	
45
	OraDatabase.Parameters.Remove "USER_ID_LIST"
45
	OraDatabase.Parameters.Remove "USER_ID_LIST"
46
	OraDatabase.Parameters.Remove "APP_ID"
46
	OraDatabase.Parameters.Remove "APP_ID"
47
	
47
	
48
End Sub
48
End Sub
49
'--------------------------------------------------------------------------------------------------------------------------
49
'--------------------------------------------------------------------------------------------------------------------------
50
Sub DisplayApplicationCombo()
50
Sub DisplayApplicationCombo()
51
	Dim rsQry, sqlStr
51
	Dim rsQry, sqlStr
52
	
52
	
53
	OraDatabase.Parameters.Add "USER_ID", 	Request("user_id"),	ORAPARM_INPUT, ORATYPE_NUMBER
53
	OraDatabase.Parameters.Add "USER_ID", 	Request("user_id"),	ORAPARM_INPUT, ORATYPE_NUMBER
54
	
54
	
55
	sqlStr = "SELECT app_id, application_name FROM applications WHERE app_id NOT IN " &_
55
	sqlStr = "SELECT app_id, application_name FROM applications WHERE app_id NOT IN " &_
56
					 "(SELECT app_id FROM user_applications WHERE user_id = :USER_ID)"
56
					 "(SELECT app_id FROM user_applications WHERE user_id = :USER_ID)"
57
	
57
	
58
	Set rsQry = OraDatabase.DbCreateDynaset( sqlStr, cint(0))
58
	Set rsQry = OraDatabase.DbCreateDynaset( sqlStr, cint(0))
59
	
59
	
60
		If rsQry.BOF OR rsQry.EOF Then
60
		If rsQry.BOF OR rsQry.EOF Then
61
			Response.write "<option value='-1' selected>No Applications Available</option>"& VBNewLine
61
			Response.write "<option value='-1' selected>No Applications Available</option>"& VBNewLine
62
		Else
62
		Else
63
			Response.write "<option class='body_txt' selected value='"& rsQry("app_id") &"'>"& rsQry("application_name") &"</option>"& VBNewLine
63
			Response.write "<option class='body_txt' selected value='"& rsQry("app_id") &"'>"& rsQry("application_name") &"</option>"& VBNewLine
64
			rsQry.MoveNext
64
			rsQry.MoveNext
65
		End If
65
		End If
66
	
66
	
67
    While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
67
    While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
68
		
68
		
69
		Response.write "<option class='body_txt' value='"& rsQry("app_id") &"'>"& rsQry("application_name") &"</option>"& VBNewLine
69
		Response.write "<option class='body_txt' value='"& rsQry("app_id") &"'>"& rsQry("application_name") &"</option>"& VBNewLine
70
		
70
		
71
		rsQry.MoveNext
71
		rsQry.MoveNext
72
    WEnd
72
    WEnd
73
	
73
	
74
	' Clean up
74
	' Clean up
75
	rsQry.Close()
75
	rsQry.Close()
76
	Set rsQry = nothing
76
	Set rsQry = nothing
77
	
77
	
78
	OraDatabase.Parameters.Remove "USER_ID"
78
	OraDatabase.Parameters.Remove "USER_ID"
79
	
79
	
80
End Sub
80
End Sub
81
'--------------------------------------------------------------------------------------------------------------------------
81
'--------------------------------------------------------------------------------------------------------------------------
82
%>
82
%>
83
<%
83
<%
84
'------------ RUN BEFORE PAGE RENDER ----------
84
'------------ RUN BEFORE PAGE RENDER ----------
85
Call GetUserDetails ( parUser_id, objUserCollector )
85
Call GetUserDetails ( parUser_id, objUserCollector )
86
 
86
 
87
If Request("action") <> "" AND Request("new_app_id") <> "-1" Then
87
If Request("action") <> "" AND Request("new_app_id") <> "-1" Then
88
		
88
		
89
		Call AddToApplication()
89
		Call AddToApplication()
90
		
90
		
91
		If objEH.Finally Then
91
		If objEH.Finally Then
92
			Call OpenInParentWindow ( Request("rfile") &"?"& objPMod.ComposeURLWith("user_id,tree") )
92
			Call OpenInParentWindow ( Request("rfile") &"?"& objPMod.ComposeURLWith("user_id,tree") )
93
			Call CloseWindow()
93
			Call CloseWindow()
94
		End If
94
		End If
95
 
95
 
96
End If
96
End If
97
'----------------------------------------------
97
'----------------------------------------------
98
%>
98
%>
99
<html>
99
<html>
100
<head>
100
<head>
101
<title>Access Manager</title>
101
<title>Access Manager</title>
102
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
102
<link rel="shortcut icon" href="<%=FavIcon%>"/>
103
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
103
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
104
<link href="scripts/access_manager.css" rel="stylesheet" type="text/css">
104
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
105
<script language="JavaScript" src="scripts/common.js"></script>
105
<link href="scripts/access_manager.css" rel="stylesheet" type="text/css">
106
</head>
106
<script language="JavaScript" src="scripts/common.js"></script>
107
 
107
</head>
108
<body background="images/bg_bage_pane.gif" leftmargin="0" topmargin="0" onLoad="self.focus();">
108
 
109
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
109
<body background="images/bg_bage_pane.gif" leftmargin="0" topmargin="0" onLoad="self.focus();">
110
  <tr>
110
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
111
    <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="images/i_application_lrg.gif" width="18" height="18" hspace="0" align="absmiddle" border="0" >&nbsp;Add Application User</span> <br>
111
  <tr>
112
    Select application name. 
112
    <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="images/i_application_lrg.gif" width="18" height="18" hspace="0" align="absmiddle" border="0" >&nbsp;Add Application User</span> <br>
113
    </td>
113
    Select application name. 
114
  </tr>
114
    </td>
115
  <form name="FormName" method="post" action="<%=SCRIPT_NAME%>">
115
  </tr>
116
  <tr>
116
  <form name="FormName" method="post" action="<%=SCRIPT_NAME%>">
117
    <td background="images/bg_drk_bage_pane.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
117
  <tr>
118
      <tr>
118
    <td background="images/bg_drk_bage_pane.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
119
        <td>&nbsp;</td>
119
      <tr>
120
        <td align="right"><input name="btn" type="submit" class="form_btn" value="Add">
120
        <td>&nbsp;</td>
121
          <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();"></td>
121
        <td align="right"><input name="btn" type="submit" class="form_btn" value="Add">
122
      </tr>
122
          <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();"></td>
123
    </table></td>
123
      </tr>
124
  </tr>
124
    </table></td>
125
  
125
  </tr>
126
  <tr>
126
  
127
    <td background="images/bg_form.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
127
  <tr>
128
      <tr>
128
    <td background="images/bg_form.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
129
        <td width="1%"><img src="images/spacer.gif" width="60" height="200"></td>
129
      <tr>
130
        <td width="100%"><table width="100%"  border="0" cellspacing="2" cellpadding="0">
130
        <td width="1%"><img src="images/spacer.gif" width="60" height="200"></td>
131
          <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
131
        <td width="100%"><table width="100%"  border="0" cellspacing="2" cellpadding="0">
132
          <%If NOT objEH.Finally Then%>
132
          <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
133
          <tr>
133
          <%If NOT objEH.Finally Then%>
134
            <td class="form_iname">&nbsp;</td>
134
          <tr>
135
            <td>
135
            <td class="form_iname">&nbsp;</td>
136
              <%objEH.DisplayMessage()%>
136
            <td>
137
            </td>
137
              <%objEH.DisplayMessage()%>
138
          </tr>
138
            </td>
139
          <%End If%>
139
          </tr>
140
          <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
140
          <%End If%>
141
          <tr>
141
          <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
142
						<td colspan="2" class="body_ttl3">Add <%=objUserCollector("full_name")%> to Application:</td>
142
          <tr>
143
          </tr>
143
						<td colspan="2" class="body_ttl3">Add <%=objUserCollector("full_name")%> to Application:</td>
144
          <tr>
144
          </tr>
145
						<td><img src="images/spacer.gif" height="10"></td>
145
          <tr>
146
          </tr>
146
						<td><img src="images/spacer.gif" height="10"></td>
147
          <tr>
147
          </tr>
148
						<td nowrap class="form_iname" valign="top">Application Name</td>
148
          <tr>
149
						<td valign="top" align="left">
149
						<td nowrap class="form_iname" valign="top">Application Name</td>
150
							<select name='new_app_id' class='form_iname'>
150
						<td valign="top" align="left">
151
								<%Call DisplayApplicationCombo()%>
151
							<select name='new_app_id' class='form_iname'>
152
							</select>
152
								<%Call DisplayApplicationCombo()%>
153
						</td>
153
							</select>
154
          </tr>
154
						</td>
155
          <tr>
155
          </tr>
156
            <td width="30%" class="form_iname">&nbsp;</td>
156
          <tr>
157
            <td width="70%">&nbsp;</td>
157
            <td width="30%" class="form_iname">&nbsp;</td>
158
          </tr>
158
            <td width="70%">&nbsp;</td>
159
        </table></td>
159
          </tr>
160
      </tr>
160
        </table></td>
161
    </table></td>
161
      </tr>
162
  </tr>
162
    </table></td>
163
  <%=objPMod.ComposeHiddenTags()%>
163
  </tr>
164
  <input type="hidden" name="action" value="true">
164
  <%=objPMod.ComposeHiddenTags()%>
165
  </form>
165
  <input type="hidden" name="action" value="true">
166
</table>
166
  </form>
167
</body>
167
</table>
168
</html>
168
</body>
169
<%
169
</html>
170
'------------ RUN AFTER PAGE RENDER -----------
170
<%
171
Set objFormCollector = Nothing
171
'------------ RUN AFTER PAGE RENDER -----------
172
'----------------------------------------------
172
Set objFormCollector = Nothing
173
%>
173
'----------------------------------------------
174
<!--#include file="common/globals_destructor.asp"-->
174
%>
-
 
175
<!--#include file="common/globals_destructor.asp"-->