20180521141004_ticket_last_contact_behavior.rb 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. class TicketLastContactBehavior < ActiveRecord::Migration[5.1]
  2. def up
  3. # return if it's a new setup
  4. return if !Setting.find_by(name: 'system_init_done')
  5. Setting.create_if_not_exists(
  6. title: 'Ticket Last Contact Behaviour',
  7. name: 'ticket_last_contact_behaviour',
  8. area: 'Ticket::Base',
  9. description: 'Sets the last customer contact based on the last contact of a customer or on the last contact of a customer to whom an agent has not yet responded.',
  10. options: {
  11. form: [
  12. {
  13. display: '',
  14. null: true,
  15. name: 'ticket_last_contact_behaviour',
  16. tag: 'select',
  17. translate: true,
  18. options: {
  19. 'based_on_customer_reaction' => 'Last customer contact (without consideration an agent has replied to it)',
  20. 'check_if_agent_already_replied' => 'Last customer contact (with consideration an agent has replied to it)',
  21. },
  22. },
  23. ],
  24. },
  25. state: 'check_if_agent_already_replied',
  26. preferences: {
  27. permission: ['admin.ticket'],
  28. },
  29. frontend: false
  30. )
  31. end
  32. end