Subversion Repositories DevTools

Rev

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