2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2020-02-20 13:34:03 +00:00
|
|
|
module HasTicketCreateScreenImpact
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
after_commit :push_ticket_create_screen
|
|
|
|
end
|
|
|
|
|
|
|
|
def push_ticket_create_screen?
|
|
|
|
return true if destroyed?
|
|
|
|
|
2021-06-23 11:35:27 +00:00
|
|
|
%w[id name active updated_at].any? do |attribute|
|
2020-02-20 13:34:03 +00:00
|
|
|
saved_change_to_attribute?(attribute)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def push_ticket_create_screen
|
|
|
|
return if Setting.get('import_mode')
|
|
|
|
return if !push_ticket_create_screen?
|
|
|
|
|
|
|
|
push_ticket_create_screen_background_job
|
|
|
|
end
|
|
|
|
|
|
|
|
def push_ticket_create_screen_background_job
|
|
|
|
TicketCreateScreenJob.set(wait: 10.seconds).perform_later
|
|
|
|
end
|
|
|
|
end
|