Subversion Repositories DevTools

Rev

Rev 5506 | Rev 5957 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|			          wAddApplicationUser		 	 |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
%>
13
 
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<!--#include file="common/common_dbedit.asp"-->
20
<!--#include file="common/_form_window_common.asp"-->
21
<!--#include file="common/_rtree_common.asp"-->
22
 
23
<%
24
'------------ ACCESS CONTROL ------------------
25
%>
26
 
27
<%
28
'------------ VARIABLE DEFINITION -------------
29
Dim rsUser
30
Dim FRview_id
31
'Dim objFormCollector
32
'------------ CONSTANTS DECLARATION -----------
33
Const LIMG_USER = "<img src='images/i_user.gif' width='16' height='16' hspace='2' border='0' align='absmiddle'>"
34
Const LIMG_USER_DISABLED = "<img src='images/i_user_disabled.gif' width='16' height='16' hspace='2' border='0' align='absmiddle'>"
35
Const LIMG_ROLE = "<img src='images/i_role.gif' width='16' height='16' hspace='2' border='0' align='absmiddle'>"
36
'------------ VARIABLE INIT -------------------
37
Set objFormCollector = CreateObject("Scripting.Dictionary")
38
 
39
'------------ CONDITIONS ----------------------
40
'----------------------------------------------
41
%>
42
<%
43
'--------------------------------------------------------------------------------------------------------------------------
44
Sub AddViewUser ()
45
	On Error Resume Next
46
 
47
	OraDatabase.Parameters.Add "USER_ID_LIST", 		Request("user_id_list"), 	ORAPARM_INPUT, ORATYPE_VARCHAR2
5590 dpurdie 48
	OraDatabase.Parameters.Add "PROJ_ID", 			Request("proj_id"), 		ORAPARM_INPUT, ORATYPE_NUMBER
5357 dpurdie 49
	OraDatabase.Parameters.Add "VIEW_ID", 			Request("view_id"), 		ORAPARM_INPUT, ORATYPE_NUMBER
50
 
51
	objEH.TryORA ( OraSession )
5590 dpurdie 52
    objEH.ErrorRedirect = FALSE
5357 dpurdie 53
 
54
	OraDatabase.ExecuteSQL _
55
	"BEGIN ADD_AUTOBUILD_FAILURE_INFO ( :PROJ_ID, :VIEW_ID, :USER_ID_LIST ); END;"
56
 
57
	objEH.CatchORA ( OraSession )
58
 
59
	OraDatabase.Parameters.Remove "USER_ID_LIST"
60
	OraDatabase.Parameters.Remove "PROJ_ID"
61
	OraDatabase.Parameters.Remove "VIEW_ID"
62
 
63
End Sub
64
'--------------------------------------------------------------------------------------------------------------------------
65
%>
66
<%
67
'------------ RUN BEFORE PAGE RENDER ----------
68
' --- Get Form details from DB (for edit forms only) ---
69
'-------------------------------------------------------
70
 
71
' --- Load Validation Rules ---
72
 
73
 
74
' --- Enter Form Validation Rule Changes here... ----
75
'----------------------------------------------------
76
If CBool(Request("action")) Then
77
	If objForm.IsValidOnPostBack Then
78
		Call AddViewUser()
79
		If objEH.Finally Then
5590 dpurdie 80
            Call ReloadParentWindow()    
81
            Response.End
5357 dpurdie 82
		End If
83
	End If
84
End If
85
'----------------------------------------------
86
%>
87
<html>
88
<head>
89
<title>Release Manager <%Response.Write(Request("proj_id"))%>-<%Response.Write(Request("view_id"))%></title>
90
<link rel="shortcut icon" href="<%=FavIcon%>"/>
91
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
92
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
93
<link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
94
<script language="JavaScript" src="scripts/common.js"></script>
95
</head>
96
 
97
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" onLoad="self.focus();">
5590 dpurdie 98
<table border="0" cellspacing="0" cellpadding="10">
5357 dpurdie 99
  <tr>
5590 dpurdie 100
    <td bgcolor="#FFFFFF" class="body_txt">
101
        Search for User or select from the list.
102
    </td>
5357 dpurdie 103
  </tr>
5590 dpurdie 104
  <form class="form_tight" name="FormSearch" method="post" action="<%=ScriptName%>">
5357 dpurdie 105
  <tr>
5590 dpurdie 106
    <td background="images/bg_quicksearch.gif" class="body_txt">
107
        <table width="100" border="0" cellspacing="3" cellpadding="0">
108
            <tr>
109
                <td nowrap class="body_txtw"><strong>User Search</strong> </td>
110
                <td><input name="filter" type="text" class="body_txt" size="20" value="<%=Request("filter")%>"></td>
111
                <td><input name="btn" type="image" src="images/b_search.gif" width="16" height="16" border="0"></td>
112
            </tr>
113
      </table>
114
    </td>
5357 dpurdie 115
  </tr>
116
  <%'=objPMod.ComposeHiddenTags()%>
117
  <input type="hidden" name="view_id" value="<%=Request("view_id")%>">
118
  <input type="hidden" name="proj_id" value="<%=Request("proj_id")%>">
119
  </form>
120
  <form name="FormName" method="post" action="<%=ScriptName%>">
121
  <tr>
122
    <td background="images/bg_drk_bage_pane.gif">
123
	<table width="100%"  border="0" cellspacing="0" cellpadding="0">
124
      <tr>
125
        <td>&nbsp;</td>
126
        <td align="right"><input name="btn" type="submit" class="form_btn" value="Add">
5590 dpurdie 127
          <input name="btn" type="reset" class="form_btn" value="Cancel" onclick="parent.closeIFrame();"></td>
5357 dpurdie 128
      </tr>
129
    </table></td>
130
  </tr>
131
  <tr>
132
    <td>
133
          <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
5590 dpurdie 134
          <!--#include file="messages/_msg_inline.asp"-->
5357 dpurdie 135
          <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
136
<%
137
		Dim startPosition, pageNumber, navigator, totalRecords, lastRecord
138
		Const MAX_ROWS = 50	' Maximum number of rows displayed
139
 
140
		OraDatabase.Parameters.Add "APP_ID", 			Request("app_id"), 			ORAPARM_INPUT, ORATYPE_NUMBER
141
 
142
		'--- Set filters ---
143
		If Request("filter") <> "" Then
144
			OraDatabase.Parameters.Add "FULL_NAME", 	"%"& Request("filter") &"%",	ORAPARM_INPUT, ORATYPE_VARCHAR2
145
			OraDatabase.Parameters.Add "USER_NAME", 	Request("filter") &"%",			ORAPARM_INPUT, ORATYPE_VARCHAR2
146
			OraDatabase.Parameters.Add "DOMAIN_NAME", 	Request("filter") &"%",			ORAPARM_INPUT, ORATYPE_VARCHAR2
147
		Else
148
			OraDatabase.Parameters.Add "FULL_NAME", 	NULL,	ORAPARM_INPUT, ORATYPE_VARCHAR2
149
			OraDatabase.Parameters.Add "USER_NAME", 	NULL,	ORAPARM_INPUT, ORATYPE_VARCHAR2
150
			OraDatabase.Parameters.Add "DOMAIN_NAME", 	NULL,	ORAPARM_INPUT, ORATYPE_VARCHAR2
151
		End If
152
 
153
		OraDatabase.Parameters.Add "VIEW_ID", 	Request("view_id"),	ORAPARM_INPUT, ORATYPE_NUMBER
154
		OraDatabase.Parameters.Add "PROJ_ID", 	Request("proj_id"),	ORAPARM_INPUT, ORATYPE_NUMBER
155
 
156
		Set rsUser = OraDatabase.DbCreateDynaset( GetQuery ("GetApplicationUserList.sql") , ORADYN_DEFAULT )
157
 
158
		OraDatabase.Parameters.Remove "APP_ID"
159
		OraDatabase.Parameters.Remove "FULL_NAME"
160
		OraDatabase.Parameters.Remove "USER_NAME"
161
		OraDatabase.Parameters.Remove "DOMAIN_NAME"
162
		OraDatabase.Parameters.Remove "VIEW_ID"
163
		OraDatabase.Parameters.Remove "PROJ_ID"
164
 
165
 
166
		'--- Get page number ---
167
		pageNumber = 0
168
		If Request("pg") <> "" Then
169
		pageNumber = CInt(Request("pg"))
170
		End If
171
 
172
 
173
		'--- Set Cursor start position ---
174
		startPosition = pageNumber * MAX_ROWS + 1
175
		If (NOT rsUser.BOF) AND (NOT rsUser.EOF) Then
176
			rsUser.MoveTo ( startPosition )		' Set starting cursor point
177
 
178
		End If
179
 
180
 
181
		'--- Construct Navigator
182
		navigator = ""
183
		If (NOT rsUser.BOF) AND (NOT rsUser.EOF) Then
184
			totalRecords = rsUser.RecordCount	' Get total number of records
185
 
186
			'--- Create "Previous" link
187
			If pageNumber > 0 Then
188
				navigator = navigator &"<a href='"& ScriptName &"?view_id="&Request("view_id")&"&pg="& pageNumber - 1 &"&"& objPMod.ComposeURL &"' class='body_link' title='Show Previous Page'>&laquo; Previous</a>"
189
			End If
190
 
191
			'--- Create "Next" link
192
			If ( startPosition + MAX_ROWS ) < totalRecords Then
193
				navigator = navigator &"&nbsp;&nbsp;<a href='"& ScriptName &"?view_id="&Request("view_id")&"&pg="& pageNumber + 1 &"&"& objPMod.ComposeURL &"' class='body_link' title='Show Next Page'>Next &raquo;</a>"
194
			End If
195
 
196
		End If
197
 
198
 
199
		'--- Calculate Last Record ---
200
		If totalRecords > 0 Then
201
			lastRecord = ( startPosition - 1 + MAX_ROWS ) _
202
						+ ( CInt( ( startPosition - 1 + MAX_ROWS )/totalRecords > 1) ) * ( ( startPosition - 1 + MAX_ROWS ) - totalRecords )
203
		End If
204
		%>
205
		<table width="100%"  border="0" cellspacing="0" cellpadding="0">
206
          <tr align="left">
207
            <td colspan="2" class="body_row">&nbsp;</td>
208
          </tr>
209
          <tr>
210
            <td align="left" class="body_row">
211
			<%
212
			If totalRecords > 0 Then
213
				Response.write "Showing "& startPosition &" - "& lastRecord &" of "& totalRecords
214
			Else
215
				Response.write "No Results."
216
			End If
217
			%></td>
218
            <td align="right" class="body_scol"><%=navigator%></td>
219
          </tr>
220
        </table>
221
		 <!-- DETAILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
5590 dpurdie 222
        <div style="min-height:300px;max-height:500px;overflow:scroll;">
5357 dpurdie 223
		 <table width="100%"  border="0" cellspacing="3" cellpadding="0">
224
          <tr>
225
		  	<td width="1%" background="images/bg_table_col.gif"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
5590 dpurdie 226
            <td width="30%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Full Name </td>
5357 dpurdie 227
            <td width="30%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">User Name</td>
228
            <td width="40%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Domain</td>
229
          </tr>
230
		  <%
231
		  '--- Render rows ---
232
		  Do While (NOT rsUser.BOF) AND (NOT rsUser.EOF)
233
		  		If rsUser.RowPosition => (startPosition + MAX_ROWS) Then Exit Do	' Limit the number of rows displayed
234
		  %>
235
          <tr>
236
		  	<td align="center"><input type="checkbox" name="user_id_list" value="<%=rsUser("user_id")%>" <%If rsUser("user_id") < 1 Then%>disabled<%End If%>></td>
237
            <td nowrap class="body_row"><%=Eval( rsUser("user_image") )  &  rsUser("full_name")%></td>
238
            <td class="body_rowg"><%=rsUser("user_name")%></td>
239
            <td class="body_rowg"><%=rsUser("domain")%></td>
240
          </tr>
241
		  <%rsUser.MoveNext%>
242
 
243
		  <%If (NOT rsUser.BOF) AND (NOT rsUser.EOF) Then%>
244
          <tr>
245
            <td colspan="4" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
246
          </tr>
247
		  <%End If%>
248
 
249
		  <%
250
		  Loop
251
		  rsUser.Close()
252
		  Set rsUser = Nothing
253
		  %>
254
         </table>
5590 dpurdie 255
         </div>
5357 dpurdie 256
		 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
257
		 <table width="100%"  border="0" cellspacing="0" cellpadding="0">
258
          <tr>
259
            <td align="right" class="body_scol"><%=navigator%></td>
260
          </tr>
261
        </table>
262
	</td>
263
  </tr>
264
  <%=objPMod.ComposeHiddenTags()%>
265
  <input type="hidden" name="view_id" value="<%=Request("view_id")%>">
266
  <input type="hidden" name="action" value="true">
267
  </form>
268
</table>
269
</body>
270
</html>
271
<%
272
'------------ RUN AFTER PAGE RENDER -----------
273
Set objFormCollector = Nothing
274
'----------------------------------------------
275
%>
276
<!--#include file="common/destructor.asp"-->