2018-05-29 15:42:14 +00:00
|
|
|
class Issue2035RecursiveTicketTrigger < ActiveRecord::Migration[5.1]
|
|
|
|
def change
|
|
|
|
|
|
|
|
# return if it's a new setup
|
|
|
|
return if !Setting.find_by(name: 'system_init_done')
|
|
|
|
|
|
|
|
Setting.create_if_not_exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
title: 'Recursive Ticket Triggers',
|
|
|
|
name: 'ticket_trigger_recursive',
|
|
|
|
area: 'Ticket::Core',
|
2018-05-29 15:42:14 +00:00
|
|
|
description: 'Activate the recursive processing of ticket triggers.',
|
2018-12-19 17:31:51 +00:00
|
|
|
options: {
|
2018-05-29 15:42:14 +00:00
|
|
|
form: [
|
|
|
|
{
|
|
|
|
display: 'Recursive Ticket Triggers',
|
2018-12-19 17:31:51 +00:00
|
|
|
null: true,
|
|
|
|
name: 'ticket_trigger_recursive',
|
|
|
|
tag: 'boolean',
|
2018-05-29 15:42:14 +00:00
|
|
|
options: {
|
|
|
|
true => 'yes',
|
|
|
|
false => 'no',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
state: false,
|
2018-05-29 15:42:14 +00:00
|
|
|
preferences: {
|
|
|
|
permission: ['admin.ticket'],
|
2018-12-19 17:31:51 +00:00
|
|
|
hidden: true,
|
2018-05-29 15:42:14 +00:00
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
frontend: false
|
2018-05-29 15:42:14 +00:00
|
|
|
)
|
|
|
|
Setting.create_if_not_exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
title: 'Recursive Ticket Triggers Loop Max.',
|
|
|
|
name: 'ticket_trigger_recursive_max_loop',
|
|
|
|
area: 'Ticket::Core',
|
2018-05-29 15:42:14 +00:00
|
|
|
description: 'Maximum number of recursively executed triggers.',
|
2018-12-19 17:31:51 +00:00
|
|
|
options: {
|
2018-05-29 15:42:14 +00:00
|
|
|
form: [
|
|
|
|
{
|
|
|
|
display: 'Recursive Ticket Triggers',
|
2018-12-19 17:31:51 +00:00
|
|
|
null: true,
|
|
|
|
name: 'ticket_trigger_recursive_max_loop',
|
|
|
|
tag: 'select',
|
2018-05-29 15:42:14 +00:00
|
|
|
options: {
|
2018-12-19 17:31:51 +00:00
|
|
|
1 => ' 1',
|
|
|
|
2 => ' 2',
|
|
|
|
3 => ' 3',
|
|
|
|
4 => ' 4',
|
|
|
|
5 => ' 5',
|
|
|
|
6 => ' 6',
|
|
|
|
7 => ' 7',
|
|
|
|
8 => ' 8',
|
|
|
|
9 => ' 9',
|
2018-05-29 15:42:14 +00:00
|
|
|
10 => '10',
|
|
|
|
11 => '11',
|
|
|
|
12 => '12',
|
|
|
|
13 => '13',
|
|
|
|
14 => '14',
|
|
|
|
15 => '15',
|
|
|
|
16 => '16',
|
|
|
|
17 => '17',
|
|
|
|
18 => '18',
|
|
|
|
19 => '19',
|
|
|
|
20 => '20',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
state: 10,
|
2018-05-29 15:42:14 +00:00
|
|
|
preferences: {
|
|
|
|
permission: ['admin.ticket'],
|
2018-12-19 17:31:51 +00:00
|
|
|
hidden: true,
|
2018-05-29 15:42:14 +00:00
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
frontend: false
|
2018-05-29 15:42:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|