2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2016-11-25 16:10:37 +00:00
|
|
|
module Import
|
|
|
|
module OTRS
|
|
|
|
module Diff
|
|
|
|
extend self
|
|
|
|
|
|
|
|
def diff_worker
|
|
|
|
return if !diff_import_possible?
|
2018-10-09 06:17:41 +00:00
|
|
|
|
2016-11-25 16:10:37 +00:00
|
|
|
diff
|
|
|
|
end
|
|
|
|
|
2017-02-14 17:44:14 +00:00
|
|
|
def diff?
|
|
|
|
return true if @diff
|
2018-10-09 06:17:41 +00:00
|
|
|
|
2017-02-14 17:44:14 +00:00
|
|
|
false
|
|
|
|
end
|
|
|
|
|
2016-11-25 16:10:37 +00:00
|
|
|
private
|
|
|
|
|
|
|
|
def diff_import_possible?
|
|
|
|
return if !Setting.get('import_mode')
|
|
|
|
return if Setting.get('import_otrs_endpoint') == 'http://otrs_host/otrs'
|
2018-10-09 06:17:41 +00:00
|
|
|
|
2016-11-25 16:10:37 +00:00
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def diff
|
|
|
|
log 'Start diff...'
|
|
|
|
|
2017-02-14 17:44:14 +00:00
|
|
|
@diff = true
|
|
|
|
|
2016-11-25 16:10:37 +00:00
|
|
|
check_import_mode
|
|
|
|
|
|
|
|
updateable_objects
|
|
|
|
|
|
|
|
# get changed tickets
|
|
|
|
ticket_diff
|
|
|
|
end
|
|
|
|
|
|
|
|
def ticket_diff
|
2016-11-28 10:44:56 +00:00
|
|
|
import('Ticket', diff: true)
|
2016-11-25 16:10:37 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|