20181023163804_add_stats_backends.rb 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. class AddStatsBackends < ActiveRecord::Migration[5.1]
  2. def up
  3. return if !Setting.exists?(name: 'system_init_done')
  4. # add the dashboard stats backend for 'Stats::TicketWaitingTime'
  5. Setting.create_if_not_exists(
  6. title: 'Stats Backend',
  7. name: 'Stats::TicketWaitingTime',
  8. area: 'Dashboard::Stats',
  9. description: 'Defines a dashboard stats backend that get scheduled automatically.',
  10. options: {},
  11. state: 'Stats::TicketWaitingTime',
  12. preferences: {
  13. permission: ['ticket.agent'],
  14. prio: 1,
  15. },
  16. frontend: false
  17. )
  18. # add the dashboard stats backend for 'Stats::TicketEscalation'
  19. Setting.create_if_not_exists(
  20. title: 'Stats Backend',
  21. name: 'Stats::TicketEscalation',
  22. area: 'Dashboard::Stats',
  23. description: 'Defines a dashboard stats backend that get scheduled automatically.',
  24. options: {},
  25. state: 'Stats::TicketEscalation',
  26. preferences: {
  27. permission: ['ticket.agent'],
  28. prio: 2,
  29. },
  30. frontend: false
  31. )
  32. # add the dashboard stats backend for 'Stats::TicketChannelDistribution'
  33. Setting.create_if_not_exists(
  34. title: 'Stats Backend',
  35. name: 'Stats::TicketChannelDistribution',
  36. area: 'Dashboard::Stats',
  37. description: 'Defines a dashboard stats backend that get scheduled automatically.',
  38. options: {},
  39. state: 'Stats::TicketChannelDistribution',
  40. preferences: {
  41. permission: ['ticket.agent'],
  42. prio: 3,
  43. },
  44. frontend: false
  45. )
  46. # add the dashboard stats backend for 'Stats::TicketLoadMeasure'
  47. Setting.create_if_not_exists(
  48. title: 'Stats Backend',
  49. name: 'Stats::TicketLoadMeasure',
  50. area: 'Dashboard::Stats',
  51. description: 'Defines a dashboard stats backend that get scheduled automatically.',
  52. options: {},
  53. state: 'Stats::TicketLoadMeasure',
  54. preferences: {
  55. permission: ['ticket.agent'],
  56. prio: 4,
  57. },
  58. frontend: false
  59. )
  60. # add the dashboard stats backend for 'Stats::TicketInProcess'
  61. Setting.create_if_not_exists(
  62. title: 'Stats Backend',
  63. name: 'Stats::TicketInProcess',
  64. area: 'Dashboard::Stats',
  65. description: 'Defines a dashboard stats backend that get scheduled automatically.',
  66. options: {},
  67. state: 'Stats::TicketInProcess',
  68. preferences: {
  69. permission: ['ticket.agent'],
  70. prio: 5,
  71. },
  72. frontend: false
  73. )
  74. # add the dashboard stats backend for 'Stats::TicketReopen'
  75. Setting.create_if_not_exists(
  76. title: 'Stats Backend',
  77. name: 'Stats::TicketReopen',
  78. area: 'Dashboard::Stats',
  79. description: 'Defines a dashboard stats backend that get scheduled automatically.',
  80. options: {},
  81. state: 'Stats::TicketReopen',
  82. preferences: {
  83. permission: ['ticket.agent'],
  84. prio: 6,
  85. },
  86. frontend: false
  87. )
  88. end
  89. end