From 5e8ed1e7f0c1f10999ceec33fdc7c954ebd71f17 Mon Sep 17 00:00:00 2001 From: Adam R Claxton Date: Thu, 20 Apr 2017 15:46:01 -0400 Subject: [PATCH] Ticket rejection emails have been implemented. Client email notification system finished? Could definitely use polishing, but the functionality is there. Now for admin emails... --- .../webpages/redirect/ticketAdminRedirect.jsp | 10 +- src/database/TicketQueries.java | 11 ++- src/utilities/Mail.java | 95 ++++++++++++++----- src/utilities/NotificationQueue.java | 57 +++++++---- src/utilities/ticketConfirmation.html | 13 +++ 5 files changed, 141 insertions(+), 45 deletions(-) create mode 100644 src/utilities/ticketConfirmation.html diff --git a/WebContent/html/webpages/redirect/ticketAdminRedirect.jsp b/WebContent/html/webpages/redirect/ticketAdminRedirect.jsp index 7a23711..e85a30f 100644 --- a/WebContent/html/webpages/redirect/ticketAdminRedirect.jsp +++ b/WebContent/html/webpages/redirect/ticketAdminRedirect.jsp @@ -37,11 +37,10 @@ int locationid = Integer.parseInt(locationidstr); //approve form was submitted if(request.getParameter("approve") != null){ - //TODO include in time of action so that the status fields can be updated in the ticket TicketQueries.acceptTicket(ticketid,deviceid,locationid,Integer.parseInt(navsso)); User client = EmployeeQueries.getEmployeeByID(TicketQueries.getUserID(ticketid)); boolean notificationPreferences = (Math.floor(client.getNotificationPreferences()/2)%2==1); - //The second least significant bit of notificationPreferences - the 4's place - is used for ticket approval notifications. + //The second least significant bit of notificationPreferences - the 2's place - is used for ticket approval notifications. if(notificationPreferences){ NotificationQueue q = new NotificationQueue(client,"ticketConfirmations"); q.start(); @@ -50,6 +49,13 @@ if(request.getParameter("approve") != null){ //reject form was submitted if(request.getParameter("reject") != null){ TicketQueries.rejectTicket(ticketid); + User client = EmployeeQueries.getEmployeeByID(TicketQueries.getUserID(ticketid)); + boolean notificationPreferences = (Math.floor(client.getNotificationPreferences()/4)%2==1); + //The third least significantbit of notificationPreferences - te 4's place - is used for ticket rejection notifications. + if(notificationPreferences){ + NotificationQueue q = new NotificationQueue(client, "ticketRejections"); + q.start(); + } } %>