Subversion Repositories DevTools

Rev

Rev 6497 | Rev 6508 | 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">
42
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
43
<link rel="stylesheet" href="images/navigation.css" type="text/css">
44
<script language="JavaScript" src="images/common.js"></script>
45
<script language="JavaScript" src="scripts/remote_scripting.js"></script>
46
<!--#include file="_jquery_includes.asp"-->
6499 dpurdie 47
<!-- TIPS -->
48
<script language="JavaScript" src="images/tipster.js"></script>
49
<script language="JavaScript" src="images/_help_tips.js"></script>
6497 dpurdie 50
<!-- DROPDOWN MENUS -->
51
<!--#include file="_menu_def.asp"-->
52
<script language="JavaScript1.2" src="images/popup_menu.js"></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>
63
 
6497 dpurdie 64
<script language="javascript">
65
$(document).ready(function () {
66
 
67
    //  Add operation to all the delete buttons
68
    $('.btn_delete').on('click', function(){
69
        var el = $(this);
70
        var trel = el.closest("tr");
71
        var proj_id = trel.data("proj_id");
72
        var uid_id = trel.data("user_id");
73
 
74
        vixConfirm("Remove notifications for this package from this user in the project shown", 
75
            {ok     : removeUserNotification, 
76
             data   : { "uid"     : uid_id, 
77
                        "proj_id" : proj_id,
78
                        "element" : trel
79
            }});
80
    });
81
 
82
    //  Delete notifications for this package in selected projects
83
    function removeUserNotification(args)
84
    {
85
        console.log("removeUserNotification", args.data.uid, args.data.proj_id);
86
        $.ajax({
87
            type : 'POST',
88
            url : '_json_Notifications.asp',
89
            data : {Opr : 'RemoveUserFromProject', pkg_id : <%=pkgInfoHash.Item("pkg_id")%>, user_id : args.data.uid, proj_id : args.data.proj_id },
90
            dataType : 'json',
91
        }).fail(function( jqXHR, textStatus, errorThrown ){
92
            vixAlert('Ajax Error. Unexpected result.<p>' + errorThrown);
93
        }).done(function( data, textStatus, jqXHR ){
94
            if (typeof data.result === undefined){
95
                vixAlert('Ajax Error. Unexpected result');
96
            } else if (data.result != 0){
97
                vixAlert('Error Deleting item.<p>' + data.emsgDetails);
98
            } else {
99
            // Delete row associated with this enty
100
                args.data.element.remove();
101
            }
102
        });
103
    }
104
});
105
</script>
106
</head>
107
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
108
<!-- HEADER -->
109
<!--#include file="_header.asp"-->
110
<!-- BODY ---->
111
<table width="100%" border="0" cellspacing="0" cellpadding="0">
112
    <tr> 
113
        <td valign="top" width="1" background="images/bg_bage.gif">
114
        <!-- LEFT -->
115
        <!--#include file="_environment.asp"-->
116
        </td>
117
        <td width="1" bgcolor="#999999"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
118
        <td valign="top" width="100%">
119
        <!-- MIDDLE -->
120
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
121
          <tr>
122
            <td width="1%" background="images/bg_action_norm.gif"><IMG height=35 src="images/spacer.gif" width=15></td>
123
            <td width="100%" background="images/bg_action_norm.gif"><%Call RenderActionBar(parRtag_id,parPv_id)%></td>
124
            <td width="1%" background="images/bg_action_norm.gif"><IMG height=1 src="images/spacer.gif" width=15></td>
125
          </tr>
126
          <tr>
127
            <td background="images/bg_lght_gray.gif"><IMG height="45" src="images/spacer.gif" width=1></td>
128
            <td background="images/bg_lght_gray.gif"><%Call RenderStatus(parRtag_id,parPv_id)%></td>
129
            <td background="images/bg_lght_gray.gif">&nbsp;</td>
130
          </tr>
131
          <tr>
132
            <td background="images/bg_lght_gray.gif">&nbsp;</td>
133
            <td valign="bottom" background="images/bg_lght_gray.gif">
134
              <table width="100" border="0" cellspacing="0" cellpadding="0">
135
                <tr>
136
                  <td><IMG height="1" src="images/spacer.gif" width="0" alt="tab-left-margin" ></td>
137
                  <td>
138
                  <!-- TABS ------------------------------------->
139
                  <%Call Generate_Tab_Menu ( TABarray1, "Notifications", "orange" )%>
140
                  </td>
141
                </tr>
142
              </table>
143
            </td>
144
            <td background="images/bg_lght_gray.gif">&nbsp;</td>
145
          </tr>
146
          <tr>
147
            <td background="images/lbox_bg_orange.gif"><IMG height=35 src="images/spacer.gif" width=1></td>
148
            <td background="images/lbox_bg_orange.gif">
149
            <!-- TAB ACTION BUTTONS ------------------------------------->
150
            </td>
151
            <td background="images/lbox_bg_orange.gif">&nbsp;</td>
152
          </tr>
153
          <tr>
154
            <td></td>
155
            <td valign="top">
156
            <!-- DETAILS ------------------------------------------------->
157
            <br>                      
158
                        <span class="body_colb">Package Notification Details</span><br>
159
                        <table width="100%" border="0" cellspacing="1" cellpadding="3">
160
                          <tr class="form_field_hdr"> 
161
                            <td nowrap width="1%" >Who&nbsp;</td>
6499 dpurdie 162
                            <td nowrap width="1%" >Enabled User<%=Quick_Help("enabledUser")%>&nbsp;</td>
163
                            <td nowrap width="1%">Opr<%=Quick_Help("opr")%>&nbsp;&nbsp;</td>
6497 dpurdie 164
                            <td nowrap width="97%">Project&nbsp;&nbsp;</td>
165
 
166
                          </tr>
167
                          <%
168
 
169
                          OraDatabase.Parameters.Add "PKG_ID", pkgInfoHash.Item("pkg_id"),     ORAPARM_INPUT, ORATYPE_NUMBER 
170
 
171
                          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))
172
                          %>
173
                          <%If rsTemp.RecordCount < 1 Then%>
174
                          <tr class="form_item_grey" > 
175
                            <td nowrap>&nbsp;</td>
176
                            <td nowrap>&nbsp;</td>
177
                            <td nowrap>&nbsp;</td>
178
                            <td nowrap>&nbsp;</td>
179
                          </tr>
180
                          <%End If%>
181
                          <%While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
182
                                Dim userCheck : userCheck = ""
183
                                If isNull(rsTemp("is_DISABLED")) Then
184
                                    userCheck = "checked"
185
                                End If
186
 
187
                                Dim btnDisabled: btnDisabled = "disabled"
188
                                If canDelete OR objAccessControl.UserId = rsTemp("user_id") Then
189
                                    btnDisabled = ""
190
                                End If
191
 
192
                            %>
193
                          <tr class="form_item_grey" data-user_id="<%=rsTemp("user_id")%>" data-proj_id="<%=rsTemp("proj_id")%>" > 
194
                            <td nowrap valign="top"><a href="mailto:<%=rsTemp("user_email")%>" title="<%=rsTemp("user_email")%>" class="txt_linked"><%=rsTemp("FULL_NAME")%></a></td>
195
                            <td nowrap valign="top"><input type="checkbox" <%=userCheck%> disabled></td>
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>