Subversion Repositories DevTools

Rev

Rev 6510 | Go to most recent revision | Details | Last modification | View Log | RSS feed

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