fix error

This commit is contained in:
BOYA,CHIU 2021-08-03 12:14:55 +08:00
parent 247db7fb3c
commit 106b5db942
1 changed files with 6 additions and 6 deletions

View File

@ -97,7 +97,7 @@ class Admin::TicketsManageController < OrbitAdminController
end end
def changecategory def changecategory
ticket = Ticket.find(params[:ticket_id]) rescue nil ticket = Ticket.find(params[:tickets_manage_id]) rescue nil
category = Category.find(params[:category_id]) rescue nil category = Category.find(params[:category_id]) rescue nil
if !category.nil? if !category.nil?
ticket.category_id = category.id ticket.category_id = category.id
@ -107,7 +107,7 @@ class Admin::TicketsManageController < OrbitAdminController
end end
def start def start
ticket = Ticket.find(params[:ticket_id]) rescue nil ticket = Ticket.find(params[:tickets_manage_id]) rescue nil
ticket.status = "commenced" ticket.status = "commenced"
ticket.taken_by = current_user.id ticket.taken_by = current_user.id
ticket.save ticket.save
@ -115,7 +115,7 @@ class Admin::TicketsManageController < OrbitAdminController
end end
def close def close
ticket = Ticket.find(params[:ticket_id]) rescue nil ticket = Ticket.find(params[:tickets_manage_id]) rescue nil
ticket.status = "closed" ticket.status = "closed"
ticket.urgent = false ticket.urgent = false
ticket.save ticket.save
@ -123,7 +123,7 @@ class Admin::TicketsManageController < OrbitAdminController
end end
def leave def leave
ticket = Ticket.find(params[:ticket_id]) rescue nil ticket = Ticket.find(params[:tickets_manage_id]) rescue nil
ticket.status = "open" ticket.status = "open"
ticket.taken_by = nil ticket.taken_by = nil
ticket.save ticket.save
@ -131,7 +131,7 @@ class Admin::TicketsManageController < OrbitAdminController
end end
def reopen def reopen
ticket = Ticket.find(params[:ticket_id]) rescue nil ticket = Ticket.find(params[:tickets_manage_id]) rescue nil
ticket.status = "open" ticket.status = "open"
ticket.reopened_count = ticket.reopened_count + 1 ticket.reopened_count = ticket.reopened_count + 1
tq = TicketQuery.new tq = TicketQuery.new
@ -154,7 +154,7 @@ class Admin::TicketsManageController < OrbitAdminController
def toggleurgent def toggleurgent
mark_urgent = params[:mark_urgent] mark_urgent = params[:mark_urgent]
if mark_urgent if mark_urgent
ticket = Ticket.find(params[:ticket_id]) rescue nil ticket = Ticket.find(params[:tickets_manage_id]) rescue nil
if !ticket.nil? if !ticket.nil?
if mark_urgent == "true" if mark_urgent == "true"
if can_mark_urgent?(ticket) if can_mark_urgent?(ticket)