20180529000001_issue_2035_recursive_ticket_trigger.rb 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue2035RecursiveTicketTrigger < ActiveRecord::Migration[5.1]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. Setting.create_if_not_exists(
  7. title: 'Recursive Ticket Triggers',
  8. name: 'ticket_trigger_recursive',
  9. area: 'Ticket::Core',
  10. description: 'Activate the recursive processing of ticket triggers.',
  11. options: {
  12. form: [
  13. {
  14. display: 'Recursive Ticket Triggers',
  15. null: true,
  16. name: 'ticket_trigger_recursive',
  17. tag: 'boolean',
  18. options: {
  19. true => 'yes',
  20. false => 'no',
  21. },
  22. },
  23. ],
  24. },
  25. state: false,
  26. preferences: {
  27. permission: ['admin.ticket'],
  28. hidden: true,
  29. },
  30. frontend: false
  31. )
  32. Setting.create_if_not_exists(
  33. title: 'Recursive Ticket Triggers Loop Max.',
  34. name: 'ticket_trigger_recursive_max_loop',
  35. area: 'Ticket::Core',
  36. description: 'Maximum number of recursively executed triggers.',
  37. options: {
  38. form: [
  39. {
  40. display: 'Recursive Ticket Triggers',
  41. null: true,
  42. name: 'ticket_trigger_recursive_max_loop',
  43. tag: 'select',
  44. options: {
  45. 1 => ' 1',
  46. 2 => ' 2',
  47. 3 => ' 3',
  48. 4 => ' 4',
  49. 5 => ' 5',
  50. 6 => ' 6',
  51. 7 => ' 7',
  52. 8 => ' 8',
  53. 9 => ' 9',
  54. 10 => '10',
  55. 11 => '11',
  56. 12 => '12',
  57. 13 => '13',
  58. 14 => '14',
  59. 15 => '15',
  60. 16 => '16',
  61. 17 => '17',
  62. 18 => '18',
  63. 19 => '19',
  64. 20 => '20',
  65. },
  66. },
  67. ],
  68. },
  69. state: 10,
  70. preferences: {
  71. permission: ['admin.ticket'],
  72. hidden: true,
  73. },
  74. frontend: false
  75. )
  76. end
  77. end