20230425094249_setting_add_ticket_agent_default_notifications.rb 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class SettingAddTicketAgentDefaultNotifications < ActiveRecord::Migration[6.1]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. Setting.create_or_update(
  7. title: 'Default Ticket Agent Notifications',
  8. name: 'ticket_agent_default_notifications',
  9. area: 'Ticket::Core',
  10. description: 'Define the default agent notifications for new users.',
  11. options: {
  12. form: [
  13. {},
  14. ],
  15. },
  16. preferences: {
  17. authentication: true,
  18. permission: ['admin.ticket'],
  19. },
  20. state: {
  21. create: {
  22. criteria: {
  23. owned_by_me: true,
  24. owned_by_nobody: true,
  25. subscribed: true,
  26. no: false,
  27. },
  28. channel: {
  29. email: true,
  30. online: true,
  31. }
  32. },
  33. update: {
  34. criteria: {
  35. owned_by_me: true,
  36. owned_by_nobody: true,
  37. subscribed: true,
  38. no: false,
  39. },
  40. channel: {
  41. email: true,
  42. online: true,
  43. }
  44. },
  45. reminder_reached: {
  46. criteria: {
  47. owned_by_me: true,
  48. owned_by_nobody: false,
  49. subscribed: false,
  50. no: false,
  51. },
  52. channel: {
  53. email: true,
  54. online: true,
  55. }
  56. },
  57. escalation: {
  58. criteria: {
  59. owned_by_me: true,
  60. owned_by_nobody: false,
  61. subscribed: false,
  62. no: false,
  63. },
  64. channel: {
  65. email: true,
  66. online: true,
  67. }
  68. }
  69. },
  70. frontend: true
  71. )
  72. end
  73. end