stats_reopen.rb 518 B

12345678910111213141516171819202122232425
  1. # Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
  2. require_dependency 'stats/ticket_reopen'
  3. class Observer::Ticket::StatsReopen < ActiveRecord::Observer
  4. observe 'ticket'
  5. def after_create(record)
  6. _check(record)
  7. end
  8. def after_update(record)
  9. _check(record)
  10. end
  11. private
  12. def _check(record)
  13. # return if we run import mode
  14. return if Setting.get('import_mode')
  15. Stats::TicketReopen.log('Ticket', record.id, record.saved_changes, record.updated_by_id)
  16. end
  17. end