Subversion Repositories DevTools

Rev

Rev 6 | Details | Compare with Previous | Last modification | View Log | RSS feed

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