2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2018-06-04 12:57:53 +00:00
|
|
|
class SettingAddTicketAutoAssignment2 < ActiveRecord::Migration[5.1]
|
|
|
|
def up
|
|
|
|
|
|
|
|
# return if it's a new setup
|
2020-08-03 08:35:43 +00:00
|
|
|
return if !Setting.exists?(name: 'system_init_done')
|
2018-06-04 12:57:53 +00:00
|
|
|
|
|
|
|
Setting.create_if_not_exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
title: 'Auto Assigment',
|
|
|
|
name: 'ticket_auto_assignment',
|
|
|
|
area: 'Web::Base',
|
2018-06-04 12:57:53 +00:00
|
|
|
description: 'Enable ticket auto assignment.',
|
2018-12-19 17:31:51 +00:00
|
|
|
options: {
|
2018-06-04 12:57:53 +00:00
|
|
|
form: [
|
|
|
|
{
|
|
|
|
display: '',
|
2018-12-19 17:31:51 +00:00
|
|
|
null: true,
|
|
|
|
name: 'ticket_auto_assignment',
|
|
|
|
tag: 'boolean',
|
2018-06-04 12:57:53 +00:00
|
|
|
options: {
|
|
|
|
true => 'yes',
|
|
|
|
false => 'no',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
preferences: {
|
|
|
|
authentication: true,
|
2018-12-19 17:31:51 +00:00
|
|
|
permission: ['admin.ticket_auto_assignment'],
|
2018-06-04 12:57:53 +00:00
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
state: false,
|
|
|
|
frontend: true
|
2018-06-04 12:57:53 +00:00
|
|
|
)
|
|
|
|
Setting.create_if_not_exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
title: 'Time Accounting Selector',
|
|
|
|
name: 'ticket_auto_assignment_selector',
|
|
|
|
area: 'Web::Base',
|
2018-06-04 12:57:53 +00:00
|
|
|
description: 'Enable auto assignment for following matching tickets.',
|
2018-12-19 17:31:51 +00:00
|
|
|
options: {
|
2018-06-04 12:57:53 +00:00
|
|
|
form: [
|
|
|
|
{},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
preferences: {
|
|
|
|
authentication: true,
|
2018-12-19 17:31:51 +00:00
|
|
|
permission: ['admin.ticket_auto_assignment'],
|
2018-06-04 12:57:53 +00:00
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
state: { condition: { 'ticket.state_id' => { operator: 'is', value: Ticket::State.by_category(:work_on).pluck(:id) } } },
|
|
|
|
frontend: true
|
2018-06-04 12:57:53 +00:00
|
|
|
)
|
|
|
|
Setting.create_or_update(
|
2018-12-19 17:31:51 +00:00
|
|
|
title: 'Time Accounting Selector',
|
|
|
|
name: 'ticket_auto_assignment_user_ids_ignore',
|
|
|
|
area: 'Web::Base',
|
2018-06-04 12:57:53 +00:00
|
|
|
description: 'Define an exception of "automatic assignment" for certain users (e.g. executives).',
|
2018-12-19 17:31:51 +00:00
|
|
|
options: {
|
2018-06-04 12:57:53 +00:00
|
|
|
form: [
|
|
|
|
{},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
preferences: {
|
|
|
|
authentication: true,
|
2018-12-19 17:31:51 +00:00
|
|
|
permission: ['admin.ticket_auto_assignment'],
|
2018-06-04 12:57:53 +00:00
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
state: [],
|
|
|
|
frontend: true
|
2018-06-04 12:57:53 +00:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|