Subversion Repositories DevTools

Rev

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