Merge branch 'develop' of github.com:martini/zammad into develop
This commit is contained in:
commit
746f825c8f
4 changed files with 271 additions and 37 deletions
|
@ -739,4 +739,4 @@ class TicketOverviewRouter extends App.ControllerPermanent
|
||||||
App.Config.set( 'ticket/view', TicketOverviewRouter, 'Routes' )
|
App.Config.set( 'ticket/view', TicketOverviewRouter, 'Routes' )
|
||||||
App.Config.set( 'ticket/view/:view', TicketOverviewRouter, 'Routes' )
|
App.Config.set( 'ticket/view/:view', TicketOverviewRouter, 'Routes' )
|
||||||
App.Config.set( 'TicketOverview', { controller: 'TicketOverview', authentication: true }, 'permanentTask' )
|
App.Config.set( 'TicketOverview', { controller: 'TicketOverview', authentication: true }, 'permanentTask' )
|
||||||
App.Config.set( 'TicketOverview', { prio: 1000, parent: '', name: 'Overviews', target: '#ticket/view', role: ['Agent', 'Customer'], class: 'overviews' }, 'NavBar' )
|
App.Config.set( 'TicketOverview', { prio: 1000, parent: '', name: 'Tickets', target: '#ticket/view', role: ['Agent', 'Customer'], class: 'overviews' }, 'NavBar' )
|
||||||
|
|
227
db/migrate/20151105000003_update_overview6.rb
Normal file
227
db/migrate/20151105000003_update_overview6.rb
Normal file
|
@ -0,0 +1,227 @@
|
||||||
|
class UpdateOverview6 < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
|
||||||
|
# return if it's a new setup
|
||||||
|
return if !Setting.find_by(name: 'system_init_done')
|
||||||
|
|
||||||
|
UserInfo.current_user_id = 1
|
||||||
|
Overview.destroy_all
|
||||||
|
overview_role = Role.where( name: 'Agent' ).first
|
||||||
|
Overview.create_or_update(
|
||||||
|
name: 'My assigned Tickets',
|
||||||
|
link: 'my_assigned',
|
||||||
|
prio: 1000,
|
||||||
|
role_id: overview_role.id,
|
||||||
|
condition: {
|
||||||
|
'ticket.state_id' => {
|
||||||
|
operator: 'is',
|
||||||
|
value: [ 1, 2, 3, 7 ],
|
||||||
|
},
|
||||||
|
'ticket.owner_id' => {
|
||||||
|
operator: 'is',
|
||||||
|
pre_condition: 'current_user.id',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
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',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
Overview.create_or_update(
|
||||||
|
name: 'Unassigned & Open',
|
||||||
|
link: 'all_unassigned',
|
||||||
|
prio: 1010,
|
||||||
|
role_id: overview_role.id,
|
||||||
|
condition: {
|
||||||
|
'ticket.state_id' => {
|
||||||
|
operator: 'is',
|
||||||
|
value: [1, 2, 3],
|
||||||
|
},
|
||||||
|
'ticket.owner_id' => {
|
||||||
|
operator: 'is',
|
||||||
|
value: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
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',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
Overview.create_or_update(
|
||||||
|
name: 'My pending reached Tickets',
|
||||||
|
link: 'my_pending_reached',
|
||||||
|
prio: 1020,
|
||||||
|
role_id: overview_role.id,
|
||||||
|
condition: {
|
||||||
|
'ticket.state_id' => {
|
||||||
|
operator: 'is',
|
||||||
|
value: 3,
|
||||||
|
},
|
||||||
|
'ticket.owner_id' => {
|
||||||
|
operator: 'is',
|
||||||
|
pre_condition: 'current_user.id',
|
||||||
|
},
|
||||||
|
'ticket.pending_time' => {
|
||||||
|
operator: 'within next (relative)',
|
||||||
|
value: 0,
|
||||||
|
range: 'minute',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
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',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
Overview.create_or_update(
|
||||||
|
name: 'Open',
|
||||||
|
link: 'all_open',
|
||||||
|
prio: 1030,
|
||||||
|
role_id: overview_role.id,
|
||||||
|
condition: {
|
||||||
|
'ticket.state_id' => {
|
||||||
|
operator: 'is',
|
||||||
|
value: [1, 2, 3],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
order: {
|
||||||
|
by: 'created_at',
|
||||||
|
direction: 'ASC',
|
||||||
|
},
|
||||||
|
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),
|
||||||
|
view_mode_default: 's',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
Overview.create_or_update(
|
||||||
|
name: 'Pending reached',
|
||||||
|
link: 'all_pending_reached',
|
||||||
|
prio: 1040,
|
||||||
|
role_id: overview_role.id,
|
||||||
|
condition: {
|
||||||
|
'ticket.state_id' => {
|
||||||
|
operator: 'is',
|
||||||
|
value: [3],
|
||||||
|
},
|
||||||
|
'ticket.pending_time' => {
|
||||||
|
operator: 'within next (relative)',
|
||||||
|
value: 0,
|
||||||
|
range: 'minute',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
order: {
|
||||||
|
by: 'created_at',
|
||||||
|
direction: 'ASC',
|
||||||
|
},
|
||||||
|
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),
|
||||||
|
view_mode_default: 's',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
Overview.create_or_update(
|
||||||
|
name: 'Escalated',
|
||||||
|
link: 'all_escalated',
|
||||||
|
prio: 1050,
|
||||||
|
role_id: overview_role.id,
|
||||||
|
condition: {
|
||||||
|
'ticket.escalation_time' => {
|
||||||
|
operator: 'within next (relative)',
|
||||||
|
value: '10',
|
||||||
|
range: 'minute',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
order: {
|
||||||
|
by: 'escalation_time',
|
||||||
|
direction: 'ASC',
|
||||||
|
},
|
||||||
|
view: {
|
||||||
|
d: %w(title customer group owner escalation_time),
|
||||||
|
s: %w(title customer group owner escalation_time),
|
||||||
|
m: %w(number title customer group owner escalation_time),
|
||||||
|
view_mode_default: 's',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
overview_role = Role.where( name: 'Customer' ).first
|
||||||
|
Overview.create_or_update(
|
||||||
|
name: 'My Tickets',
|
||||||
|
link: 'my_tickets',
|
||||||
|
prio: 1100,
|
||||||
|
role_id: overview_role.id,
|
||||||
|
condition: {
|
||||||
|
'ticket.state_id' => {
|
||||||
|
operator: 'is',
|
||||||
|
value: [ 1, 2, 3, 4, 6, 7 ],
|
||||||
|
},
|
||||||
|
'ticket.customer_id' => {
|
||||||
|
operator: 'is',
|
||||||
|
pre_condition: 'current_user.id',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
order: {
|
||||||
|
by: 'created_at',
|
||||||
|
direction: 'DESC',
|
||||||
|
},
|
||||||
|
view: {
|
||||||
|
d: %w(title customer state created_at),
|
||||||
|
s: %w(number title state created_at),
|
||||||
|
m: %w(number title state created_at),
|
||||||
|
view_mode_default: 's',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
Overview.create_or_update(
|
||||||
|
name: 'My Organization Tickets',
|
||||||
|
link: 'my_organization_tickets',
|
||||||
|
prio: 1200,
|
||||||
|
role_id: overview_role.id,
|
||||||
|
organization_shared: true,
|
||||||
|
condition: {
|
||||||
|
'ticket.state_id' => {
|
||||||
|
operator: 'is',
|
||||||
|
value: [ 1, 2, 3, 4, 6, 7 ],
|
||||||
|
},
|
||||||
|
'ticket.organization_id' => {
|
||||||
|
operator: 'is',
|
||||||
|
pre_condition: 'current_user.organization_id',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
order: {
|
||||||
|
by: 'created_at',
|
||||||
|
direction: 'DESC',
|
||||||
|
},
|
||||||
|
view: {
|
||||||
|
d: %w(title customer state created_at),
|
||||||
|
s: %w(number title customer state created_at),
|
||||||
|
m: %w(number title customer state created_at),
|
||||||
|
view_mode_default: 's',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
77
db/seeds.rb
77
db/seeds.rb
|
@ -1494,6 +1494,13 @@ Role.create_if_not_exists(
|
||||||
created_by_id: 1,
|
created_by_id: 1,
|
||||||
updated_by_id: 1,
|
updated_by_id: 1,
|
||||||
)
|
)
|
||||||
|
Role.create_if_not_exists(
|
||||||
|
id: 5,
|
||||||
|
name: 'Chat',
|
||||||
|
note: 'Access to chat feature.',
|
||||||
|
updated_by_id: 1,
|
||||||
|
created_by_id: 1
|
||||||
|
)
|
||||||
|
|
||||||
Group.create_if_not_exists(
|
Group.create_if_not_exists(
|
||||||
id: 1,
|
id: 1,
|
||||||
|
@ -1652,10 +1659,37 @@ Overview.create_if_not_exists(
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Overview.create_if_not_exists(
|
||||||
|
name: 'Unassigned & Open',
|
||||||
|
link: 'all_unassigned',
|
||||||
|
prio: 1010,
|
||||||
|
role_id: overview_role.id,
|
||||||
|
condition: {
|
||||||
|
'ticket.state_id' => {
|
||||||
|
operator: 'is',
|
||||||
|
value: [1, 2, 3],
|
||||||
|
},
|
||||||
|
'ticket.owner_id' => {
|
||||||
|
operator: 'is',
|
||||||
|
value: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
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',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
Overview.create_if_not_exists(
|
Overview.create_if_not_exists(
|
||||||
name: 'My pending reached Tickets',
|
name: 'My pending reached Tickets',
|
||||||
link: 'my_pending_reached',
|
link: 'my_pending_reached',
|
||||||
prio: 1010,
|
prio: 1020,
|
||||||
role_id: overview_role.id,
|
role_id: overview_role.id,
|
||||||
condition: {
|
condition: {
|
||||||
'ticket.state_id' => {
|
'ticket.state_id' => {
|
||||||
|
@ -1685,34 +1719,7 @@ Overview.create_if_not_exists(
|
||||||
)
|
)
|
||||||
|
|
||||||
Overview.create_if_not_exists(
|
Overview.create_if_not_exists(
|
||||||
name: 'Unassigned & Open Tickets',
|
name: 'Open',
|
||||||
link: 'all_unassigned',
|
|
||||||
prio: 1020,
|
|
||||||
role_id: overview_role.id,
|
|
||||||
condition: {
|
|
||||||
'ticket.state_id' => {
|
|
||||||
operator: 'is',
|
|
||||||
value: [1, 2, 3],
|
|
||||||
},
|
|
||||||
'ticket.owner_id' => {
|
|
||||||
operator: 'is',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
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',
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
Overview.create_if_not_exists(
|
|
||||||
name: 'All Open Tickets',
|
|
||||||
link: 'all_open',
|
link: 'all_open',
|
||||||
prio: 1030,
|
prio: 1030,
|
||||||
role_id: overview_role.id,
|
role_id: overview_role.id,
|
||||||
|
@ -1735,9 +1742,9 @@ Overview.create_if_not_exists(
|
||||||
)
|
)
|
||||||
|
|
||||||
Overview.create_if_not_exists(
|
Overview.create_if_not_exists(
|
||||||
name: 'All pending reached Tickets',
|
name: 'Pending reached',
|
||||||
link: 'all_pending_reached',
|
link: 'all_pending_reached',
|
||||||
prio: 1035,
|
prio: 1040,
|
||||||
role_id: overview_role.id,
|
role_id: overview_role.id,
|
||||||
condition: {
|
condition: {
|
||||||
'ticket.state_id' => {
|
'ticket.state_id' => {
|
||||||
|
@ -1763,9 +1770,9 @@ Overview.create_if_not_exists(
|
||||||
)
|
)
|
||||||
|
|
||||||
Overview.create_if_not_exists(
|
Overview.create_if_not_exists(
|
||||||
name: 'Escalated Tickets',
|
name: 'Escalated',
|
||||||
link: 'all_escalated',
|
link: 'all_escalated',
|
||||||
prio: 1040,
|
prio: 1050,
|
||||||
role_id: overview_role.id,
|
role_id: overview_role.id,
|
||||||
condition: {
|
condition: {
|
||||||
'ticket.escalation_time' => {
|
'ticket.escalation_time' => {
|
||||||
|
@ -1790,7 +1797,7 @@ overview_role = Role.where( name: 'Customer' ).first
|
||||||
Overview.create_if_not_exists(
|
Overview.create_if_not_exists(
|
||||||
name: 'My Tickets',
|
name: 'My Tickets',
|
||||||
link: 'my_tickets',
|
link: 'my_tickets',
|
||||||
prio: 1000,
|
prio: 1100,
|
||||||
role_id: overview_role.id,
|
role_id: overview_role.id,
|
||||||
condition: {
|
condition: {
|
||||||
'ticket.state_id' => {
|
'ticket.state_id' => {
|
||||||
|
@ -1816,7 +1823,7 @@ Overview.create_if_not_exists(
|
||||||
Overview.create_if_not_exists(
|
Overview.create_if_not_exists(
|
||||||
name: 'My Organization Tickets',
|
name: 'My Organization Tickets',
|
||||||
link: 'my_organization_tickets',
|
link: 'my_organization_tickets',
|
||||||
prio: 1100,
|
prio: 1200,
|
||||||
role_id: overview_role.id,
|
role_id: overview_role.id,
|
||||||
organization_shared: true,
|
organization_shared: true,
|
||||||
condition: {
|
condition: {
|
||||||
|
|
|
@ -38,7 +38,7 @@ class AgentTicketOverviewLevel0Test < TestCase
|
||||||
js: '$(".content.active .sidebar").css("display", "block")',
|
js: '$(".content.active .sidebar").css("display", "block")',
|
||||||
)
|
)
|
||||||
|
|
||||||
click( text: 'Unassigned & Open Tickets' )
|
click( text: 'Unassigned & Open' )
|
||||||
sleep 4 # till overview is rendered
|
sleep 4 # till overview is rendered
|
||||||
|
|
||||||
# select both via bulk action
|
# select both via bulk action
|
||||||
|
|
Loading…
Reference in a new issue