small mods for notification
This commit is contained in:
parent
2256f04683
commit
bdeb70c5fb
|
@ -50,15 +50,20 @@ class Admin::TicketsController < OrbitAdminController
|
||||||
end
|
end
|
||||||
|
|
||||||
def tagged_tickets
|
def tagged_tickets
|
||||||
tqrs = TicketQueryResponse.where(:user_tags.in => [current_user.id.to_s], :read_by.nin => [current_user.id.to_s], :status.ne => "closed")
|
if params[:keywords].present?
|
||||||
|
statuses = ["open","commenced", "closed"]
|
||||||
|
else
|
||||||
|
statuses = ["open","commenced"]
|
||||||
|
end
|
||||||
|
tqrs = TicketQueryResponse.where(:user_tags.in => [current_user.id.to_s], :read_by.nin => [current_user.id.to_s])
|
||||||
@unread_tickets = []
|
@unread_tickets = []
|
||||||
@read_tickets = []
|
@read_tickets = []
|
||||||
tqrs.each do |tqr|
|
tqrs.each do |tqr|
|
||||||
@unread_tickets << tqr.ticket_query.ticket if !tqr.ticket_query.nil? && !tqr.ticket_query.ticket.nil?
|
@unread_tickets << tqr.ticket_query.ticket if !tqr.ticket_query.nil? && !tqr.ticket_query.ticket.nil? && statuses.include?(tqr.ticket_query.ticket.status)
|
||||||
end
|
end
|
||||||
tqrs = TicketQueryResponse.where(:user_tags.in => [current_user.id.to_s], :read_by.in => [current_user.id.to_s], :status.ne => "closed")
|
tqrs = TicketQueryResponse.where(:user_tags.in => [current_user.id.to_s], :read_by.in => [current_user.id.to_s])
|
||||||
tqrs.each do |tqr|
|
tqrs.each do |tqr|
|
||||||
@read_tickets << tqr.ticket_query.ticket if !tqr.ticket_query.nil? && !tqr.ticket_query.ticket.nil?
|
@read_tickets << tqr.ticket_query.ticket if !tqr.ticket_query.nil? && !tqr.ticket_query.ticket.nil? && statuses.include?(tqr.ticket_query.ticket.status)
|
||||||
end
|
end
|
||||||
@read_tickets.uniq!
|
@read_tickets.uniq!
|
||||||
@unread_tickets.uniq!
|
@unread_tickets.uniq!
|
||||||
|
|
|
@ -50,7 +50,7 @@ class Ticket
|
||||||
tqrs = TicketQueryResponse.where(:user_tags.in => [user.id.to_s], :read_by.nin => [user.id.to_s])
|
tqrs = TicketQueryResponse.where(:user_tags.in => [user.id.to_s], :read_by.nin => [user.id.to_s])
|
||||||
unread_tickets = []
|
unread_tickets = []
|
||||||
tqrs.each do |tqr|
|
tqrs.each do |tqr|
|
||||||
unread_tickets << tqr.ticket_query.ticket if !tqr.ticket_query.nil? && !tqr.ticket_query.ticket.nil?
|
unread_tickets << tqr.ticket_query.ticket if !tqr.ticket_query.nil? && !tqr.ticket_query.ticket.nil? && tqr.ticket_query.ticket.status != "closed"
|
||||||
end
|
end
|
||||||
unread_tickets.uniq!
|
unread_tickets.uniq!
|
||||||
unread_tickets.count
|
unread_tickets.count
|
||||||
|
|
Loading…
Reference in New Issue