Subversion Repositories DevTools

Rev

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