2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2017-04-26 11:28:32 +00:00
|
|
|
overview_role = Role.find_by(name: 'Agent')
|
|
|
|
Overview.create_if_not_exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
name: 'My assigned Tickets',
|
|
|
|
link: 'my_assigned',
|
|
|
|
prio: 1000,
|
|
|
|
role_ids: [overview_role.id],
|
2017-04-26 11:28:32 +00:00
|
|
|
condition: {
|
|
|
|
'ticket.state_id' => {
|
|
|
|
operator: 'is',
|
2018-12-19 17:31:51 +00:00
|
|
|
value: Ticket::State.by_category(:open).pluck(:id),
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
|
|
|
'ticket.owner_id' => {
|
2018-12-19 17:31:51 +00:00
|
|
|
operator: 'is',
|
2017-04-26 11:28:32 +00:00
|
|
|
pre_condition: 'current_user.id',
|
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
order: {
|
|
|
|
by: 'created_at',
|
2017-04-26 11:28:32 +00:00
|
|
|
direction: 'ASC',
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
view: {
|
|
|
|
d: %w[title customer group created_at],
|
|
|
|
s: %w[title customer group created_at],
|
|
|
|
m: %w[number title customer group created_at],
|
2017-04-26 11:28:32 +00:00
|
|
|
view_mode_default: 's',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
Overview.create_if_not_exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
name: 'Unassigned & Open',
|
|
|
|
link: 'all_unassigned',
|
|
|
|
prio: 1010,
|
|
|
|
role_ids: [overview_role.id],
|
2017-04-26 11:28:32 +00:00
|
|
|
condition: {
|
|
|
|
'ticket.state_id' => {
|
|
|
|
operator: 'is',
|
2018-12-19 17:31:51 +00:00
|
|
|
value: Ticket::State.by_category(:work_on_all).pluck(:id),
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
|
|
|
'ticket.owner_id' => {
|
2018-12-19 17:31:51 +00:00
|
|
|
operator: 'is',
|
2017-04-26 11:28:32 +00:00
|
|
|
pre_condition: 'not_set',
|
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
order: {
|
|
|
|
by: 'created_at',
|
2017-04-26 11:28:32 +00:00
|
|
|
direction: 'ASC',
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
view: {
|
|
|
|
d: %w[title customer group created_at],
|
|
|
|
s: %w[title customer group created_at],
|
|
|
|
m: %w[number title customer group created_at],
|
2017-04-26 11:28:32 +00:00
|
|
|
view_mode_default: 's',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
Overview.create_if_not_exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
name: 'My pending reached Tickets',
|
|
|
|
link: 'my_pending_reached',
|
|
|
|
prio: 1020,
|
|
|
|
role_ids: [overview_role.id],
|
2017-04-26 11:28:32 +00:00
|
|
|
condition: {
|
2018-12-19 17:31:51 +00:00
|
|
|
'ticket.state_id' => {
|
2017-04-26 11:28:32 +00:00
|
|
|
operator: 'is',
|
2018-12-19 17:31:51 +00:00
|
|
|
value: Ticket::State.by_category(:pending_reminder).pluck(:id),
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
'ticket.owner_id' => {
|
|
|
|
operator: 'is',
|
2017-04-26 11:28:32 +00:00
|
|
|
pre_condition: 'current_user.id',
|
|
|
|
},
|
|
|
|
'ticket.pending_time' => {
|
2020-12-02 11:20:49 +00:00
|
|
|
operator: 'before (relative)',
|
2018-12-19 17:31:51 +00:00
|
|
|
value: 0,
|
|
|
|
range: 'minute',
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
order: {
|
|
|
|
by: 'created_at',
|
2017-04-26 11:28:32 +00:00
|
|
|
direction: 'ASC',
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
view: {
|
|
|
|
d: %w[title customer group created_at],
|
|
|
|
s: %w[title customer group created_at],
|
|
|
|
m: %w[number title customer group created_at],
|
2017-04-26 11:28:32 +00:00
|
|
|
view_mode_default: 's',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2021-03-16 08:59:32 +00:00
|
|
|
Overview.create_if_not_exists(
|
2021-03-22 13:25:43 +00:00
|
|
|
name: 'My subscribed Tickets',
|
|
|
|
link: 'my_subscribed_tickets',
|
2021-03-16 08:59:32 +00:00
|
|
|
prio: 1025,
|
|
|
|
role_ids: [overview_role.id],
|
|
|
|
condition: { 'ticket.mention_user_ids'=>{ 'operator' => 'is', 'pre_condition' => 'current_user.id', 'value' => '', 'value_completion' => '' } },
|
|
|
|
order: {
|
|
|
|
by: 'created_at',
|
|
|
|
direction: 'ASC',
|
|
|
|
},
|
|
|
|
view: {
|
|
|
|
d: %w[title customer group created_at],
|
|
|
|
s: %w[title customer group created_at],
|
|
|
|
m: %w[number title customer group created_at],
|
|
|
|
view_mode_default: 's',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2017-04-26 11:28:32 +00:00
|
|
|
Overview.create_if_not_exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
name: 'Open',
|
|
|
|
link: 'all_open',
|
|
|
|
prio: 1030,
|
|
|
|
role_ids: [overview_role.id],
|
2017-04-26 11:28:32 +00:00
|
|
|
condition: {
|
|
|
|
'ticket.state_id' => {
|
|
|
|
operator: 'is',
|
2018-12-19 17:31:51 +00:00
|
|
|
value: Ticket::State.by_category(:work_on_all).pluck(:id),
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
order: {
|
|
|
|
by: 'created_at',
|
2017-04-26 11:28:32 +00:00
|
|
|
direction: 'ASC',
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
view: {
|
|
|
|
d: %w[title customer group state owner created_at],
|
|
|
|
s: %w[title customer group state owner created_at],
|
|
|
|
m: %w[number title customer group state owner created_at],
|
2017-04-26 11:28:32 +00:00
|
|
|
view_mode_default: 's',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
Overview.create_if_not_exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
name: 'Pending reached',
|
|
|
|
link: 'all_pending_reached',
|
|
|
|
prio: 1040,
|
|
|
|
role_ids: [overview_role.id],
|
2017-04-26 11:28:32 +00:00
|
|
|
condition: {
|
2018-12-19 17:31:51 +00:00
|
|
|
'ticket.state_id' => {
|
2017-04-26 11:28:32 +00:00
|
|
|
operator: 'is',
|
2018-12-19 17:31:51 +00:00
|
|
|
value: Ticket::State.by_category(:pending_reminder).pluck(:id),
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
|
|
|
'ticket.pending_time' => {
|
2020-12-02 11:20:49 +00:00
|
|
|
operator: 'before (relative)',
|
2018-12-19 17:31:51 +00:00
|
|
|
value: 0,
|
|
|
|
range: 'minute',
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
order: {
|
|
|
|
by: 'created_at',
|
2017-04-26 11:28:32 +00:00
|
|
|
direction: 'ASC',
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
view: {
|
|
|
|
d: %w[title customer group owner created_at],
|
|
|
|
s: %w[title customer group owner created_at],
|
|
|
|
m: %w[number title customer group owner created_at],
|
2017-04-26 11:28:32 +00:00
|
|
|
view_mode_default: 's',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
Overview.create_if_not_exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
name: 'Escalated',
|
|
|
|
link: 'all_escalated',
|
|
|
|
prio: 1050,
|
|
|
|
role_ids: [overview_role.id],
|
2017-04-26 11:28:32 +00:00
|
|
|
condition: {
|
|
|
|
'ticket.escalation_at' => {
|
2021-04-29 15:34:27 +00:00
|
|
|
operator: 'till (relative)',
|
2018-12-19 17:31:51 +00:00
|
|
|
value: '10',
|
|
|
|
range: 'minute',
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
order: {
|
|
|
|
by: 'escalation_at',
|
2017-04-26 11:28:32 +00:00
|
|
|
direction: 'ASC',
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
view: {
|
|
|
|
d: %w[title customer group owner escalation_at],
|
|
|
|
s: %w[title customer group owner escalation_at],
|
|
|
|
m: %w[number title customer group owner escalation_at],
|
2017-04-26 11:28:32 +00:00
|
|
|
view_mode_default: 's',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2017-09-05 09:49:32 +00:00
|
|
|
Overview.create_if_not_exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
name: 'My replacement Tickets',
|
|
|
|
link: 'my_replacement_tickets',
|
|
|
|
prio: 1080,
|
|
|
|
role_ids: [overview_role.id],
|
2017-09-05 09:49:32 +00:00
|
|
|
out_of_office: true,
|
2018-12-19 17:31:51 +00:00
|
|
|
condition: {
|
|
|
|
'ticket.state_id' => {
|
2017-09-05 09:49:32 +00:00
|
|
|
operator: 'is',
|
2018-12-19 17:31:51 +00:00
|
|
|
value: Ticket::State.by_category(:open).pluck(:id),
|
2017-09-05 09:49:32 +00:00
|
|
|
},
|
2017-09-11 00:50:05 +00:00
|
|
|
'ticket.out_of_office_replacement_id' => {
|
2018-12-19 17:31:51 +00:00
|
|
|
operator: 'is',
|
2017-09-11 00:50:05 +00:00
|
|
|
pre_condition: 'current_user.id',
|
|
|
|
},
|
2017-09-05 09:49:32 +00:00
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
order: {
|
|
|
|
by: 'created_at',
|
2017-09-05 09:49:32 +00:00
|
|
|
direction: 'DESC',
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
view: {
|
|
|
|
d: %w[title customer group owner escalation_at],
|
|
|
|
s: %w[title customer group owner escalation_at],
|
|
|
|
m: %w[number title customer group owner escalation_at],
|
2017-09-05 09:49:32 +00:00
|
|
|
view_mode_default: 's',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2017-04-26 11:28:32 +00:00
|
|
|
overview_role = Role.find_by(name: 'Customer')
|
|
|
|
Overview.create_if_not_exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
name: 'My Tickets',
|
|
|
|
link: 'my_tickets',
|
|
|
|
prio: 1100,
|
|
|
|
role_ids: [overview_role.id],
|
2017-04-26 11:28:32 +00:00
|
|
|
condition: {
|
2018-12-19 17:31:51 +00:00
|
|
|
'ticket.state_id' => {
|
2017-04-26 11:28:32 +00:00
|
|
|
operator: 'is',
|
2018-12-19 17:31:51 +00:00
|
|
|
value: Ticket::State.by_category(:viewable).pluck(:id),
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
|
|
|
'ticket.customer_id' => {
|
2018-12-19 17:31:51 +00:00
|
|
|
operator: 'is',
|
2017-04-26 11:28:32 +00:00
|
|
|
pre_condition: 'current_user.id',
|
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
order: {
|
|
|
|
by: 'created_at',
|
2017-04-26 11:28:32 +00:00
|
|
|
direction: 'DESC',
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
view: {
|
|
|
|
d: %w[title customer state created_at],
|
|
|
|
s: %w[number title state created_at],
|
|
|
|
m: %w[number title state created_at],
|
2017-04-26 11:28:32 +00:00
|
|
|
view_mode_default: 's',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
Overview.create_if_not_exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
name: 'My Organization Tickets',
|
|
|
|
link: 'my_organization_tickets',
|
|
|
|
prio: 1200,
|
|
|
|
role_ids: [overview_role.id],
|
2017-04-26 11:28:32 +00:00
|
|
|
organization_shared: true,
|
2018-12-19 17:31:51 +00:00
|
|
|
condition: {
|
|
|
|
'ticket.state_id' => {
|
2017-04-26 11:28:32 +00:00
|
|
|
operator: 'is',
|
2018-12-19 17:31:51 +00:00
|
|
|
value: Ticket::State.by_category(:viewable).pluck(:id),
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
|
|
|
'ticket.organization_id' => {
|
2018-12-19 17:31:51 +00:00
|
|
|
operator: 'is',
|
2017-04-26 11:28:32 +00:00
|
|
|
pre_condition: 'current_user.organization_id',
|
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
order: {
|
|
|
|
by: 'created_at',
|
2017-04-26 11:28:32 +00:00
|
|
|
direction: 'DESC',
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
view: {
|
|
|
|
d: %w[title customer state created_at],
|
|
|
|
s: %w[number title customer state created_at],
|
|
|
|
m: %w[number title customer state created_at],
|
2017-04-26 11:28:32 +00:00
|
|
|
view_mode_default: 's',
|
|
|
|
},
|
|
|
|
)
|