diff.rb 767 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. module Import
  3. module OTRS
  4. module Diff
  5. extend self
  6. def diff_worker
  7. return if !diff_import_possible?
  8. diff
  9. end
  10. def diff?
  11. return true if @diff
  12. false
  13. end
  14. private
  15. def diff_import_possible?
  16. return if !Setting.get('import_mode')
  17. return if Setting.get('import_otrs_endpoint') == 'http://otrs_host/otrs'
  18. true
  19. end
  20. def diff
  21. log 'Start diff...'
  22. @diff = true
  23. check_import_mode
  24. updateable_objects
  25. # get changed tickets
  26. ticket_diff
  27. end
  28. def ticket_diff
  29. import('Ticket', diff: true)
  30. end
  31. end
  32. end
  33. end