notification method added for clients and also sorting fixed
This commit is contained in:
parent
f31d43619a
commit
05ff4b488c
|
@ -80,7 +80,7 @@ class Admin::TicketsApiController < ApplicationController
|
||||||
tickets = {}
|
tickets = {}
|
||||||
if !site.nil?
|
if !site.nil?
|
||||||
if params[:type].nil? && params[:query].nil?
|
if params[:type].nil? && params[:query].nil?
|
||||||
site_tickets = site.tickets.desc(:created_at).page(params[:page]).per(5)
|
site_tickets = site.tickets.order_by([:status, :desc],[:created_at, :desc]).page(params[:page]).per(5)
|
||||||
else
|
else
|
||||||
q = params[:query]
|
q = params[:query]
|
||||||
t = params[:type]
|
t = params[:type]
|
||||||
|
|
|
@ -196,6 +196,9 @@ class Admin::TicketsController < OrbitAdminController
|
||||||
response.internal_response = params[:internal_response] if params[:internal_response].present?
|
response.internal_response = params[:internal_response] if params[:internal_response].present?
|
||||||
response.user_tags = params[:user_tags] if params[:user_tags].present?
|
response.user_tags = params[:user_tags] if params[:user_tags].present?
|
||||||
response.save
|
response.save
|
||||||
|
if !response.internal_response
|
||||||
|
notify_response_to_client(tq.ticket) rescue nil
|
||||||
|
end
|
||||||
tq.ticket_query_responses << response
|
tq.ticket_query_responses << response
|
||||||
if params[:user_tags].present?
|
if params[:user_tags].present?
|
||||||
Thread.new do
|
Thread.new do
|
||||||
|
|
|
@ -23,6 +23,11 @@ module TicketsHelper
|
||||||
return html
|
return html
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def notify_response_to_client(ticket)
|
||||||
|
network = ONetwork.new("http://" + ticket.registered_site.site_domain, "post") rescue nil
|
||||||
|
network.request("/store/ticket_response_update",{"ticket_id" => ticket.uid}) if !network.nil?
|
||||||
|
end
|
||||||
|
|
||||||
def send_notification_emails(response, ticket)
|
def send_notification_emails(response, ticket)
|
||||||
response.user_tags.each do |u|
|
response.user_tags.each do |u|
|
||||||
user = User.find(u) rescue nil
|
user = User.find(u) rescue nil
|
||||||
|
|
Loading…
Reference in New Issue