| 6509 |
dpurdie |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
'=====================================================
|
|
|
4 |
' View Release Notification Details
|
|
|
5 |
' form_view_release_notifications.asp
|
|
|
6 |
'=====================================================
|
|
|
7 |
Option explicit
|
|
|
8 |
' Good idea to set when using redirect
|
|
|
9 |
Response.Expires = 0 ' always load the page, dont store
|
|
|
10 |
%>
|
|
|
11 |
<!--#include file="common/conf.asp"-->
|
|
|
12 |
<!--#include file="common/globals.asp"-->
|
|
|
13 |
<!--#include file="common/formating.asp"-->
|
|
|
14 |
<!--#include file="common/qstr.asp"-->
|
|
|
15 |
<!--#include file="common/common_subs.asp"-->
|
|
|
16 |
<!--#include file="common/_form_window_common.asp"-->
|
|
|
17 |
<%
|
|
|
18 |
' Make sure rtag_id is always present
|
|
|
19 |
If Request("proj_id") = "" Then
|
|
|
20 |
Call Destroy_All_Objects
|
|
|
21 |
Response.Redirect("index.asp")
|
|
|
22 |
End If
|
|
|
23 |
|
|
|
24 |
' Set rfile parameter. This is a return page after Login
|
|
|
25 |
Call objPMod.StoreParameter ( "rfile", "dependencies.asp" )
|
|
|
26 |
'------------ ACCESS CONTROL ------------------
|
|
|
27 |
%>
|
|
|
28 |
<!--#include file="_access_control_login.asp"-->
|
|
|
29 |
<!--#include file="_access_control_general.asp"-->
|
|
|
30 |
<%
|
|
|
31 |
'------------ Variable Definition -------------
|
|
|
32 |
Dim sPrevPage
|
|
|
33 |
Dim parProjId
|
|
|
34 |
Dim canDelete
|
|
|
35 |
'------------ Constants Declaration -----------
|
|
|
36 |
Const LIMG_USER = "<img src='images/i_user.gif' width='16' height='16' hspace='2' border='0' align='absmiddle'>"
|
|
|
37 |
Const LIMG_USER_DISABLED = "<img src='images/i_user_disabled.gif' width='16' height='16' hspace='2' border='0' align='absmiddle'>"
|
|
|
38 |
|
|
|
39 |
Const LIMG_NDEL = "<img src='icons/i_remove.gif' width='16' height='16' hspace='2' border='0' align='absmiddle'>"
|
|
|
40 |
Const LIMG_NDEL_DISABLED = "<img src='icons/i_remove_dis.gif' width='16' height='16' hspace='2' border='0' align='absmiddle' class='lessOpacity'>"
|
|
|
41 |
|
|
|
42 |
'------------ Variable Init -------------------
|
|
|
43 |
parProjId = Request("proj_id")
|
|
|
44 |
sPrevPage = QStrParDefault("prevPage", Request.ServerVariables("HTTP_REFERER"))
|
|
|
45 |
canDelete = canActionControlInProject("AdminView")
|
|
|
46 |
|
|
|
47 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
48 |
' notifications_query_string
|
|
|
49 |
'
|
|
|
50 |
' DESCRIPTION
|
|
|
51 |
' Constructs a query string using the provided notification information
|
|
|
52 |
'
|
|
|
53 |
Function notifications_query_string()
|
|
|
54 |
|
|
|
55 |
notifications_query_string = _
|
|
|
56 |
"SELECT p.PKG_NAME, " & _
|
|
|
57 |
" p.pkg_id, " & _
|
|
|
58 |
" u.user_id, " & _
|
|
|
59 |
" u.FULL_NAME, " & _
|
|
|
60 |
" u.USER_EMAIL, " & _
|
|
|
61 |
" u.IS_DISABLED " & _
|
|
|
62 |
"FROM PACKAGE_INTEREST pi, " & _
|
|
|
63 |
" USERS u, " & _
|
|
|
64 |
" PACKAGES p " & _
|
|
|
65 |
"WHERE pi.USER_ID = u.USER_ID " & _
|
|
|
66 |
"AND pi.PROJ_ID = :PROJ_ID " & _
|
|
|
67 |
"AND p.PKG_ID = pi.PKG_ID " & _
|
|
|
68 |
"ORDER BY UPPER(PKG_NAME), " & _
|
|
|
69 |
" UPPER(FULL_NAME)"
|
|
|
70 |
|
|
|
71 |
End Function
|
|
|
72 |
|
|
|
73 |
|
|
|
74 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
75 |
' PV_ID_ListHTML
|
|
|
76 |
'
|
|
|
77 |
' DESCRIPTION
|
|
|
78 |
' Constructs the HTML to render the rows of package names, and other information
|
|
|
79 |
'
|
|
|
80 |
Function PV_ID_ListHTML
|
|
|
81 |
Dim rsQry
|
|
|
82 |
Dim html_string
|
|
|
83 |
Dim lastPkgId : lastPkgId = 0
|
|
|
84 |
Dim thisPkgId
|
|
|
85 |
|
|
|
86 |
OraDatabase.Parameters.Add "PROJ_ID", parProjId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
87 |
Set rsQry = OraDatabase.DbCreateDynaset( notifications_query_string(), cint(0) )
|
|
|
88 |
OraDatabase.Parameters.Remove "PROJ_ID"
|
|
|
89 |
|
|
|
90 |
'--- Render rows ---
|
|
|
91 |
Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
|
|
|
92 |
|
|
|
93 |
|
|
|
94 |
' BEGIN ROW
|
|
|
95 |
html_string = html_string & "<tr data-user_id=""" & rsQry("user_id") & """ data-pkg_id=""" & rsQry("pkg_id") & """>"
|
|
|
96 |
|
|
|
97 |
' PACKAGE NAME
|
|
|
98 |
thisPkgId = rsQry("pkg_id")
|
|
|
99 |
Dim eClass : eClass = ""
|
|
|
100 |
Dim pName : pName = rsQry("pkg_name")
|
|
|
101 |
|
|
|
102 |
If lastPkgId <> thisPkgId Then
|
|
|
103 |
lastPkgId = thisPkgId
|
|
|
104 |
Else
|
|
|
105 |
eClass = " invisible"
|
|
|
106 |
End If
|
|
|
107 |
html_string = html_string & "<td nowrap class='body_rowg" & eClass &"'>" & rsQry("pkg_name") & "</td>"
|
|
|
108 |
|
|
|
109 |
|
|
|
110 |
' User Name, with email as hyperlink
|
|
|
111 |
Dim userImage : userImage = LIMG_USER_DISABLED
|
|
|
112 |
If isNull(rsQry("is_DISABLED")) Then
|
|
|
113 |
userImage = LIMG_USER
|
|
|
114 |
End If
|
|
|
115 |
|
| 6610 |
dpurdie |
116 |
html_string = html_string & "<td nowrap class='body_rowg'><span data-email='" & rsQry("user_email") & "' class='mailto txt_linked'>" & userImage & rsQry("FULL_NAME") & "</span></td>"
|
| 6509 |
dpurdie |
117 |
|
|
|
118 |
' Operation
|
|
|
119 |
Dim DelUserImage : DelUserImage = LIMG_NDEL_DISABLED
|
|
|
120 |
Dim btnText : btnText = "Operation not available"
|
|
|
121 |
Dim btnClass : btnClass = ""
|
|
|
122 |
If canDelete OR objAccessControl.UserId = rsQry("user_id") Then
|
|
|
123 |
DelUserImage = LIMG_NDEL
|
|
|
124 |
btnText = "Remove notifications to this user"
|
|
|
125 |
btnClass = "class=btn_delete"
|
|
|
126 |
End If
|
|
|
127 |
|
|
|
128 |
html_string = html_string & "<td nowrap valign='top' " & btnClass & " title='" & btnText & "'>" & DelUserImage & "</td>"
|
|
|
129 |
|
|
|
130 |
' END ROW
|
|
|
131 |
html_string = html_string & "</tr>"
|
|
|
132 |
|
|
|
133 |
rsQry.MoveNext
|
|
|
134 |
|
|
|
135 |
' ROW SEPERATOR
|
|
|
136 |
If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
|
|
|
137 |
html_string = html_string & "<tr><td colspan='8' background='images/bg_table_border.gif'><img src='images/spacer.gif' width='1' height='1'></td></tr>"
|
|
|
138 |
End If
|
|
|
139 |
Loop
|
|
|
140 |
|
|
|
141 |
' destroy objects
|
|
|
142 |
rsQry.Close()
|
|
|
143 |
Set rsQry = nothing
|
|
|
144 |
|
|
|
145 |
' return result
|
|
|
146 |
PV_ID_ListHTML = html_string
|
|
|
147 |
End Function
|
|
|
148 |
|
|
|
149 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
150 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
151 |
'------------ RUN BEFORE PAGE RENDER ----------
|
|
|
152 |
'----------------------------------------------
|
|
|
153 |
%>
|
|
|
154 |
<html>
|
|
|
155 |
|
|
|
156 |
<head>
|
|
|
157 |
<title>Release Manager</title>
|
|
|
158 |
<link rel="shortcut icon" href="<%=FavIcon%>"/>
|
|
|
159 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
160 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
| 6579 |
dpurdie |
161 |
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
|
|
|
162 |
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
|
|
|
163 |
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
|
|
|
164 |
<script language="JavaScript" src="scripts/remote_scripting.js?ver=<%=VixVerNum%>"></script>
|
| 6509 |
dpurdie |
165 |
<!-- DROPDOWN MENUS -->
|
|
|
166 |
<!--#include file="_jquery_includes.asp"-->
|
|
|
167 |
<!--#include file="_menu_def.asp"-->
|
| 6579 |
dpurdie |
168 |
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
|
| 6509 |
dpurdie |
169 |
<!-- TIPS -->
|
| 6579 |
dpurdie |
170 |
<script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
|
|
|
171 |
<script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
|
| 6509 |
dpurdie |
172 |
<script language="JavaScript" type="text/javascript">
|
|
|
173 |
<!--
|
|
|
174 |
formTips.tips.enabledUser = stdTip(200, 'Enabled User', 'Emails will be sent to disabled users.'+
|
|
|
175 |
'<p>They will not be allowed access to the Manager Suite of applications.' +
|
|
|
176 |
'This is an indication that the user many not be required to receive notifications.' );
|
|
|
177 |
formTips.tips.opr = stdTip(200, 'Operations', 'A user can delete their own notification request' +
|
|
|
178 |
'<p>A user with "ViewAdmin" permission can delete any users notification request.');
|
|
|
179 |
</script>
|
|
|
180 |
<script language="javascript">
|
|
|
181 |
$(document).ready(function () {
|
|
|
182 |
|
|
|
183 |
// Add operation to all the delete buttons
|
|
|
184 |
$('.btn_delete').on('click', function(){
|
|
|
185 |
var el = $(this);
|
|
|
186 |
var trel = el.closest("tr");
|
|
|
187 |
var proj_id = <%=parProjId%>;
|
|
|
188 |
var uid_id = trel.data("user_id");
|
|
|
189 |
var pkg_id = trel.data("pkg_id");
|
|
|
190 |
|
|
|
191 |
var colData = new Array();
|
|
|
192 |
trel.each(function(){
|
|
|
193 |
$(this).find('td').each(function(){
|
|
|
194 |
colData.push($(this));
|
|
|
195 |
})
|
|
|
196 |
});
|
|
|
197 |
var pkgName = colData[0].text();
|
|
|
198 |
var userName = colData[1].text();
|
|
|
199 |
|
|
|
200 |
vixConfirm("Remove notifications from the '"+pkgName+"' package<br>for user '"+userName+"'<br>in the current project",
|
|
|
201 |
{ok : removeUserNotification,
|
|
|
202 |
data : { uid : uid_id,
|
|
|
203 |
proj_id : proj_id,
|
|
|
204 |
pkg_id : pkg_id,
|
|
|
205 |
element : trel,
|
|
|
206 |
colData : colData
|
|
|
207 |
}});
|
|
|
208 |
});
|
|
|
209 |
|
|
|
210 |
// Delete notifications for this package in selected projects
|
|
|
211 |
function removeUserNotification(args)
|
|
|
212 |
{
|
|
|
213 |
//console.log("removeUserNotification", args.data.pkg_id, args.data.uid, args.data.proj_id);
|
|
|
214 |
$.ajax({
|
|
|
215 |
type : 'POST',
|
|
|
216 |
url : '_json_Notifications.asp',
|
|
|
217 |
data : {Opr : 'RemoveUserFromProject', pkg_id : args.data.pkg_id, user_id : args.data.uid, proj_id : args.data.proj_id },
|
|
|
218 |
dataType : 'json',
|
|
|
219 |
}).fail(function( jqXHR, textStatus, errorThrown ){
|
|
|
220 |
vixAlert('Ajax Error. Unexpected result.<p>' + errorThrown);
|
|
|
221 |
}).done(function( data, textStatus, jqXHR ){
|
|
|
222 |
if (typeof data.result === undefined){
|
|
|
223 |
vixAlert('Ajax Error. Unexpected result');
|
|
|
224 |
} else if (data.result != 0){
|
|
|
225 |
vixAlert('Error Deleting item.<p>' + data.emsgDetails);
|
|
|
226 |
} else {
|
|
|
227 |
// Process individual items to show that an action has been taken
|
|
|
228 |
//
|
|
|
229 |
args.data.colData[1].addClass("strike");
|
|
|
230 |
args.data.colData[2].remove();
|
|
|
231 |
}
|
|
|
232 |
});
|
|
|
233 |
}
|
|
|
234 |
});
|
|
|
235 |
</script>
|
|
|
236 |
</head>
|
|
|
237 |
<!-- HEADER -->
|
|
|
238 |
<!--#include file="_header.asp"-->
|
|
|
239 |
<!-- BODY ---->
|
|
|
240 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
241 |
<tr>
|
|
|
242 |
<td width="1" background="images/bg_home_orange.gif" valign="top"></td>
|
|
|
243 |
<td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
|
|
|
244 |
<table width="95%" border="0" cellspacing="0" cellpadding="0">
|
|
|
245 |
<tr>
|
|
|
246 |
<td width="1%"></td>
|
|
|
247 |
<td width="100%">
|
|
|
248 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
249 |
<tr>
|
|
|
250 |
<td nowrap class="body_txt"></td>
|
|
|
251 |
</tr>
|
|
|
252 |
</table>
|
|
|
253 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
254 |
<tr>
|
|
|
255 |
<td nowrap class="form_ttl"><p> </p>
|
|
|
256 |
<p>VIEW PROJECT NOTIFICATION DETAILS</p>
|
|
|
257 |
</td>
|
|
|
258 |
<td align="right" valign="bottom"></td>
|
|
|
259 |
</tr>
|
|
|
260 |
</table>
|
|
|
261 |
</td>
|
|
|
262 |
<td width="1%"></td>
|
|
|
263 |
</tr>
|
|
|
264 |
<tr>
|
|
|
265 |
<td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
|
|
|
266 |
<td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
|
|
|
267 |
<td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
|
|
|
268 |
</tr>
|
|
|
269 |
<tr>
|
|
|
270 |
<td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
|
|
|
271 |
<td bgcolor="#FFFFFF" valign="top">
|
|
|
272 |
<%
|
|
|
273 |
%>
|
|
|
274 |
<!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
275 |
<!--#include file="messages/_msg_inline.asp"-->
|
|
|
276 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
277 |
<br>
|
|
|
278 |
<table width="100%" border="0" cellspacing="2" cellpadding="0">
|
|
|
279 |
<tr><td colspan="3" class="body_row"> Notifications apply to all Releases in a Project<p></td></tr>
|
|
|
280 |
<tr>
|
|
|
281 |
<td valign="top"></td>
|
|
|
282 |
</tr>
|
|
|
283 |
<tr>
|
|
|
284 |
<td width="1%" valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package Name</td>
|
|
|
285 |
<td width="1%" valign="top" nowrap background="images/bg_table_col.gif" class="body_col">User<%=Quick_Help("enabledUser")%></td>
|
|
|
286 |
<td width="1%" valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Opr<%=Quick_Help("opr")%></td>
|
|
|
287 |
<td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">
|
|
|
288 |
</tr>
|
|
|
289 |
<%=PV_ID_ListHTML()%>
|
|
|
290 |
</table>
|
|
|
291 |
</td>
|
|
|
292 |
<td background="images/lbox_bgside_white.gif"> </td>
|
|
|
293 |
</tr>
|
|
|
294 |
<tr>
|
|
|
295 |
<td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
|
|
|
296 |
<td background="images/lbox_bg_blue.gif"></td>
|
|
|
297 |
<td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
|
|
|
298 |
</tr>
|
|
|
299 |
</table>
|
|
|
300 |
</td>
|
|
|
301 |
<td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
|
|
|
302 |
</tr>
|
|
|
303 |
<tr>
|
|
|
304 |
<td valign="bottom" align="center" background="images/bg_home_orange.gif"><img src="images/img_vtree.gif" width="86" height="99" vspace="20" hspace="30"></td>
|
|
|
305 |
<td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="500"></td>
|
|
|
306 |
</tr>
|
|
|
307 |
</table>
|
|
|
308 |
<!-- FOOTER -->
|
|
|
309 |
<!--#include file="_footer.asp"-->
|
|
|
310 |
</body>
|
|
|
311 |
</html>
|