diff.rb 690 B

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