Subversion Repositories DevTools

Rev

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