Subversion Repositories DevTools

Rev

Rev 5590 | Rev 6508 | 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()    
5957 dpurdie 81
            Call Destroy_All_Objects
5590 dpurdie 82
            Response.End
5357 dpurdie 83
		End If
84
	End If
85
End If
86
'----------------------------------------------
87
%>
88
<html>
89
<head>
90
<title>Release Manager <%Response.Write(Request("proj_id"))%>-<%Response.Write(Request("view_id"))%></title>
91
<link rel="shortcut icon" href="<%=FavIcon%>"/>
92
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
93
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
94
<link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
95
<script language="JavaScript" src="scripts/common.js"></script>
96
</head>
97
 
98
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" onLoad="self.focus();">
5590 dpurdie 99
<table border="0" cellspacing="0" cellpadding="10">
5357 dpurdie 100
  <tr>
5590 dpurdie 101
    <td bgcolor="#FFFFFF" class="body_txt">
102
        Search for User or select from the list.
103
    </td>
5357 dpurdie 104
  </tr>
5590 dpurdie 105
  <form class="form_tight" name="FormSearch" method="post" action="<%=ScriptName%>">
5357 dpurdie 106
  <tr>
5590 dpurdie 107
    <td background="images/bg_quicksearch.gif" class="body_txt">
108
        <table width="100" border="0" cellspacing="3" cellpadding="0">
109
            <tr>
110
                <td nowrap class="body_txtw"><strong>User Search</strong> </td>
111
                <td><input name="filter" type="text" class="body_txt" size="20" value="<%=Request("filter")%>"></td>
112
                <td><input name="btn" type="image" src="images/b_search.gif" width="16" height="16" border="0"></td>
113
            </tr>
114
      </table>
115
    </td>
5357 dpurdie 116
  </tr>
117
  <%'=objPMod.ComposeHiddenTags()%>
118
  <input type="hidden" name="view_id" value="<%=Request("view_id")%>">
119
  <input type="hidden" name="proj_id" value="<%=Request("proj_id")%>">
120
  </form>
121
  <form name="FormName" method="post" action="<%=ScriptName%>">
122
  <tr>
123
    <td background="images/bg_drk_bage_pane.gif">
124
	<table width="100%"  border="0" cellspacing="0" cellpadding="0">
125
      <tr>
126
        <td>&nbsp;</td>
127
        <td align="right"><input name="btn" type="submit" class="form_btn" value="Add">
5590 dpurdie 128
          <input name="btn" type="reset" class="form_btn" value="Cancel" onclick="parent.closeIFrame();"></td>
5357 dpurdie 129
      </tr>
130
    </table></td>
131
  </tr>
132
  <tr>
133
    <td>
134
          <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
5590 dpurdie 135
          <!--#include file="messages/_msg_inline.asp"-->
5357 dpurdie 136
          <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
137
<%
138
		Dim startPosition, pageNumber, navigator, totalRecords, lastRecord
139
		Const MAX_ROWS = 50	' Maximum number of rows displayed
140
 
141
		OraDatabase.Parameters.Add "APP_ID", 			Request("app_id"), 			ORAPARM_INPUT, ORATYPE_NUMBER
142
 
143
		'--- Set filters ---
144
		If Request("filter") <> "" Then
145
			OraDatabase.Parameters.Add "FULL_NAME", 	"%"& Request("filter") &"%",	ORAPARM_INPUT, ORATYPE_VARCHAR2
146
			OraDatabase.Parameters.Add "USER_NAME", 	Request("filter") &"%",			ORAPARM_INPUT, ORATYPE_VARCHAR2
147
			OraDatabase.Parameters.Add "DOMAIN_NAME", 	Request("filter") &"%",			ORAPARM_INPUT, ORATYPE_VARCHAR2
148
		Else
149
			OraDatabase.Parameters.Add "FULL_NAME", 	NULL,	ORAPARM_INPUT, ORATYPE_VARCHAR2
150
			OraDatabase.Parameters.Add "USER_NAME", 	NULL,	ORAPARM_INPUT, ORATYPE_VARCHAR2
151
			OraDatabase.Parameters.Add "DOMAIN_NAME", 	NULL,	ORAPARM_INPUT, ORATYPE_VARCHAR2
152
		End If
153
 
154
		OraDatabase.Parameters.Add "VIEW_ID", 	Request("view_id"),	ORAPARM_INPUT, ORATYPE_NUMBER
155
		OraDatabase.Parameters.Add "PROJ_ID", 	Request("proj_id"),	ORAPARM_INPUT, ORATYPE_NUMBER
156
 
157
		Set rsUser = OraDatabase.DbCreateDynaset( GetQuery ("GetApplicationUserList.sql") , ORADYN_DEFAULT )
158
 
159
		OraDatabase.Parameters.Remove "APP_ID"
160
		OraDatabase.Parameters.Remove "FULL_NAME"
161
		OraDatabase.Parameters.Remove "USER_NAME"
162
		OraDatabase.Parameters.Remove "DOMAIN_NAME"
163
		OraDatabase.Parameters.Remove "VIEW_ID"
164
		OraDatabase.Parameters.Remove "PROJ_ID"
165
 
166
 
167
		'--- Get page number ---
168
		pageNumber = 0
169
		If Request("pg") <> "" Then
170
		pageNumber = CInt(Request("pg"))
171
		End If
172
 
173
 
174
		'--- Set Cursor start position ---
175
		startPosition = pageNumber * MAX_ROWS + 1
176
		If (NOT rsUser.BOF) AND (NOT rsUser.EOF) Then
177
			rsUser.MoveTo ( startPosition )		' Set starting cursor point
178
 
179
		End If
180
 
181
 
182
		'--- Construct Navigator
183
		navigator = ""
184
		If (NOT rsUser.BOF) AND (NOT rsUser.EOF) Then
185
			totalRecords = rsUser.RecordCount	' Get total number of records
186
 
187
			'--- Create "Previous" link
188
			If pageNumber > 0 Then
189
				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>"
190
			End If
191
 
192
			'--- Create "Next" link
193
			If ( startPosition + MAX_ROWS ) < totalRecords Then
194
				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>"
195
			End If
196
 
197
		End If
198
 
199
 
200
		'--- Calculate Last Record ---
201
		If totalRecords > 0 Then
202
			lastRecord = ( startPosition - 1 + MAX_ROWS ) _
203
						+ ( CInt( ( startPosition - 1 + MAX_ROWS )/totalRecords > 1) ) * ( ( startPosition - 1 + MAX_ROWS ) - totalRecords )
204
		End If
205
		%>
206
		<table width="100%"  border="0" cellspacing="0" cellpadding="0">
207
          <tr align="left">
208
            <td colspan="2" class="body_row">&nbsp;</td>
209
          </tr>
210
          <tr>
211
            <td align="left" class="body_row">
212
			<%
213
			If totalRecords > 0 Then
214
				Response.write "Showing "& startPosition &" - "& lastRecord &" of "& totalRecords
215
			Else
216
				Response.write "No Results."
217
			End If
218
			%></td>
219
            <td align="right" class="body_scol"><%=navigator%></td>
220
          </tr>
221
        </table>
222
		 <!-- DETAILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
5590 dpurdie 223
        <div style="min-height:300px;max-height:500px;overflow:scroll;">
5357 dpurdie 224
		 <table width="100%"  border="0" cellspacing="3" cellpadding="0">
225
          <tr>
226
		  	<td width="1%" background="images/bg_table_col.gif"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
5590 dpurdie 227
            <td width="30%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Full Name </td>
5357 dpurdie 228
            <td width="30%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">User Name</td>
229
            <td width="40%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Domain</td>
230
          </tr>
231
		  <%
232
		  '--- Render rows ---
233
		  Do While (NOT rsUser.BOF) AND (NOT rsUser.EOF)
234
		  		If rsUser.RowPosition => (startPosition + MAX_ROWS) Then Exit Do	' Limit the number of rows displayed
235
		  %>
236
          <tr>
237
		  	<td align="center"><input type="checkbox" name="user_id_list" value="<%=rsUser("user_id")%>" <%If rsUser("user_id") < 1 Then%>disabled<%End If%>></td>
238
            <td nowrap class="body_row"><%=Eval( rsUser("user_image") )  &  rsUser("full_name")%></td>
239
            <td class="body_rowg"><%=rsUser("user_name")%></td>
240
            <td class="body_rowg"><%=rsUser("domain")%></td>
241
          </tr>
242
		  <%rsUser.MoveNext%>
243
 
244
		  <%If (NOT rsUser.BOF) AND (NOT rsUser.EOF) Then%>
245
          <tr>
246
            <td colspan="4" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
247
          </tr>
248
		  <%End If%>
249
 
250
		  <%
251
		  Loop
252
		  rsUser.Close()
253
		  Set rsUser = Nothing
254
		  %>
255
         </table>
5590 dpurdie 256
         </div>
5357 dpurdie 257
		 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
258
		 <table width="100%"  border="0" cellspacing="0" cellpadding="0">
259
          <tr>
260
            <td align="right" class="body_scol"><%=navigator%></td>
261
          </tr>
262
        </table>
263
	</td>
264
  </tr>
265
  <%=objPMod.ComposeHiddenTags()%>
266
  <input type="hidden" name="view_id" value="<%=Request("view_id")%>">
267
  <input type="hidden" name="action" value="true">
268
  </form>
269
</table>
270
</body>
271
</html>
272
<%
273
'------------ RUN AFTER PAGE RENDER -----------
274
Set objFormCollector = Nothing
275
'----------------------------------------------
276
%>
5957 dpurdie 277
<!-- DESTRUCTOR ------->
5357 dpurdie 278
<!--#include file="common/destructor.asp"-->