Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
6497 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'   notifications.asp
5
'   Display package notification information
6
'=====================================================
7
%>
8
<%
9
Option explicit
10
' Good idea to set when using redirect
11
Response.Expires = 0    ' always load the page, dont store
12
%>
13
<!--#include file="common/conf.asp"-->
14
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/formating.asp"-->
16
<!--#include file="common/qstr.asp"-->
17
<!--#include file="common/common_subs.asp"-->
18
<!--#include file="common/common_dbedit.asp"-->
19
<!--#include file="_tabs.asp"-->
20
<!--#include file="_action_buttons.asp"-->
21
<!--#include file="common/_package_common.asp"-->
22
<%
23
'------------ ACCESS CONTROL ------------------
24
%>
25
<!--#include file="_access_control_login_optional.asp"-->
26
<!--#include file="_access_control_general.asp"-->
27
<%
28
'------------ Variable Definition -------------
29
Dim rsTemp
30
Dim rsQry
31
Dim canDelete : canDelete = FALSE
32
'------------ Constants Declaration -----------
33
'------------ Variable Init -------------------
34
canDelete = canActionControlInProject("AdminView")
35
'----------------------------------------------
36
%>
37
<html>
38
<title><%=Title(Request("rtag_id"))%></title>
39
<link rel="shortcut icon" href="<%=FavIcon%>"/>
40
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
41
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 42
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
43
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
44
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
45
<script language="JavaScript" src="scripts/remote_scripting.js?ver=<%=VixVerNum%>"></script>
6497 dpurdie 46
<!--#include file="_jquery_includes.asp"-->
6499 dpurdie 47
<!-- TIPS -->
6579 dpurdie 48
<script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
49
<script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
6497 dpurdie 50
<!-- DROPDOWN MENUS -->
51
<!--#include file="_menu_def.asp"-->
6579 dpurdie 52
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
6499 dpurdie 53
<script language="JavaScript">
54
//  Local Tips
55
formTips.tips.enabledUser   = stdTip(200, 'Enabled User', 'Emails will be sent to disabled users.'+
56
                                         '<p>They will not be allowed access to the Manager Suite of applications.' +
57
                                         'This is an indication that the user many not be required to receive notifications.' );
58
formTips.tips.opr           = stdTip(200, 'Operations', 'A user can delete their own notification request' +
59
                                         '<p>A user with "ViewAdmin" permission can delete any users notification request.');
60
 
61
 
62
</script>
6497 dpurdie 63
<script language="javascript">
64
$(document).ready(function () {
65
 
66
    //  Add operation to all the delete buttons
67
    $('.btn_delete').on('click', function(){
68
        var el = $(this);
69
        var trel = el.closest("tr");
70
        var proj_id = trel.data("proj_id");
71
        var uid_id = trel.data("user_id");
72
 
6509 dpurdie 73
        // Get the table row as an array to simplify access
74
        var colData = new Array();
75
        trel.each(function(){
76
            $(this).find('td').each(function(){
77
                colData.push($(this));
78
            })
79
        });
80
        var projName = colData[2].text();
81
        var userName = colData[0].text();
82
 
83
        vixConfirm("Remove notifications from this package<br>for user '"+userName+"'<br>in the '"+projName+"' project", 
6497 dpurdie 84
            {ok     : removeUserNotification, 
85
             data   : { "uid"     : uid_id, 
86
                        "proj_id" : proj_id,
87
                        "element" : trel
88
            }});
89
    });
90
 
91
    //  Delete notifications for this package in selected projects
92
    function removeUserNotification(args)
93
    {
6509 dpurdie 94
        //console.log("removeUserNotification", args.data.uid, args.data.proj_id);
6497 dpurdie 95
        $.ajax({
96
            type : 'POST',
97
            url : '_json_Notifications.asp',
98
            data : {Opr : 'RemoveUserFromProject', pkg_id : <%=pkgInfoHash.Item("pkg_id")%>, user_id : args.data.uid, proj_id : args.data.proj_id },
99
            dataType : 'json',
100
        }).fail(function( jqXHR, textStatus, errorThrown ){
101
            vixAlert('Ajax Error. Unexpected result.<p>' + errorThrown);
102
        }).done(function( data, textStatus, jqXHR ){
103
            if (typeof data.result === undefined){
104
                vixAlert('Ajax Error. Unexpected result');
105
            } else if (data.result != 0){
106
                vixAlert('Error Deleting item.<p>' + data.emsgDetails);
107
            } else {
108
            // Delete row associated with this enty
109
                args.data.element.remove();
110
            }
111
        });
112
    }
113
});
114
</script>
115
</head>
116
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
117
<!-- HEADER -->
118
<!--#include file="_header.asp"-->
119
<!-- BODY ---->
120
<table width="100%" border="0" cellspacing="0" cellpadding="0">
121
    <tr> 
6876 dpurdie 122
        <td class='bg_bage'>
6497 dpurdie 123
        <!-- LEFT -->
124
        <!--#include file="_environment.asp"-->
125
        </td>
126
        <td width="1" bgcolor="#999999"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
127
        <td valign="top" width="100%">
128
        <!-- MIDDLE -->
129
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
130
          <tr>
131
            <td width="1%" background="images/bg_action_norm.gif"><IMG height=35 src="images/spacer.gif" width=15></td>
132
            <td width="100%" background="images/bg_action_norm.gif"><%Call RenderActionBar(parRtag_id,parPv_id)%></td>
133
            <td width="1%" background="images/bg_action_norm.gif"><IMG height=1 src="images/spacer.gif" width=15></td>
134
          </tr>
135
          <tr>
136
            <td background="images/bg_lght_gray.gif"><IMG height="45" src="images/spacer.gif" width=1></td>
137
            <td background="images/bg_lght_gray.gif"><%Call RenderStatus(parRtag_id,parPv_id)%></td>
138
            <td background="images/bg_lght_gray.gif">&nbsp;</td>
139
          </tr>
140
          <tr>
141
            <td background="images/bg_lght_gray.gif">&nbsp;</td>
142
            <td valign="bottom" background="images/bg_lght_gray.gif">
6873 dpurdie 143
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
6497 dpurdie 144
                <tr>
145
                  <td><IMG height="1" src="images/spacer.gif" width="0" alt="tab-left-margin" ></td>
146
                  <td>
147
                  <!-- TABS ------------------------------------->
148
                  <%Call Generate_Tab_Menu ( TABarray1, "Notifications", "orange" )%>
149
                  </td>
150
                </tr>
151
              </table>
152
            </td>
153
            <td background="images/bg_lght_gray.gif">&nbsp;</td>
154
          </tr>
6876 dpurdie 155
          <tr class='bg_panel' style="height:35px;">
6873 dpurdie 156
            <td></td>
157
            <td>
6497 dpurdie 158
            <!-- TAB ACTION BUTTONS ------------------------------------->
159
            </td>
6873 dpurdie 160
            <td></td>
6497 dpurdie 161
          </tr>
162
          <tr>
163
            <td></td>
164
            <td valign="top">
165
            <!-- DETAILS ------------------------------------------------->
166
            <br>                      
167
                        <span class="body_colb">Package Notification Details</span><br>
6790 dpurdie 168
                        <table width="100%" border="0" cellspacing="1" cellpadding="3" class=stdGrey>
169
                            <thead>
170
                              <tr> 
171
                                <th nowrap width="1%" >Who<%=Quick_Help("enabledUser")%>&nbsp;</th>
172
                                <th nowrap width="1%">Opr<%=Quick_Help("opr")%>&nbsp;&nbsp;</th>
173
                                <th nowrap width="97%">Project&nbsp;&nbsp;</th>
174
                            </thead>
6497 dpurdie 175
                          </tr>
176
                          <%
177
 
178
                          OraDatabase.Parameters.Add "PKG_ID", pkgInfoHash.Item("pkg_id"),     ORAPARM_INPUT, ORATYPE_NUMBER 
179
 
180
                          Set rsTemp = OraDatabase.DbCreateDynaset( "select pi.proj_id, p.PROJ_NAME, u.user_id, u.FULL_NAME, u.USER_EMAIL, u.IS_DISABLED from PACKAGE_INTEREST pi, PROJECTS p, USERS u where pi.USER_ID = u.USER_ID and p.PROJ_ID = pi.proj_id and pkg_id = :PKG_ID order by UPPER(PROJ_NAME), UPPER(FULL_NAME)", cint(0))
181
                          %>
182
                          <%If rsTemp.RecordCount < 1 Then%>
6790 dpurdie 183
                          <tr> 
6497 dpurdie 184
                            <td nowrap>&nbsp;</td>
185
                            <td nowrap>&nbsp;</td>
186
                            <td nowrap>&nbsp;</td>
187
                            <td nowrap>&nbsp;</td>
188
                          </tr>
189
                          <%End If%>
190
                          <%While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
6508 dpurdie 191
                                Dim userImage : userImage = LIMG_USER_DISABLED
6497 dpurdie 192
                                If isNull(rsTemp("is_DISABLED")) Then
6508 dpurdie 193
                                    userImage = LIMG_USER
6497 dpurdie 194
                                End If
195
 
6509 dpurdie 196
                                Dim DelUserImage : DelUserImage = LIMG_NDEL_DISABLED
197
                                Dim btnText : btnText = "Operation not available"
198
                                Dim btnClass : btnClass = "" 
6497 dpurdie 199
                                If canDelete OR objAccessControl.UserId = rsTemp("user_id") Then
6509 dpurdie 200
                                    DelUserImage = LIMG_NDEL
201
                                    btnText = "Remove notifications to this user"
202
                                    btnClass = "class=btn_delete"
6497 dpurdie 203
                                End If
204
 
205
                            %>
6790 dpurdie 206
                          <tr data-user_id="<%=rsTemp("user_id")%>" data-proj_id="<%=rsTemp("proj_id")%>" > 
6612 dpurdie 207
                            <td nowrap valign="top"><%=emailField(userImage & rsTemp("FULL_NAME"),rsTemp("user_email"))%></td>
6509 dpurdie 208
                            <td nowrap valign="top" <%=btnClass%> title="<%=btnText%>"><%=DelUserImage%></td>
6497 dpurdie 209
                            <td nowrap valign="top"><a href="rtree.asp?proj_id=<%=rsTemp("PROJ_ID")%>"><%=rsTemp("PROJ_NAME")%></a></td>
210
                          </tr>
211
                          <%rsTemp.MoveNext
212
                          WEnd
213
                          rsTemp.Close
214
                          Set rsTemp = nothing
215
 
216
                          OraDatabase.Parameters.Remove "PKG_ID"
217
                          %>
218
                        </table>
219
                        <!------------------------------------------------------------>
220
           <br>
221
 
222
            <!-- END DETAILS ------------------------------------------------->
223
            </td>
224
            <td>&nbsp;</td>
225
          </tr>
226
        </table>
227
        <!-- END MIDDLE -------->
228
        </td>
229
    </tr>
230
</table>
231
<!-- FOOTER -->
232
<!--#include file="_footer.asp"-->
233
</body>
234
</html>