Fixed for initial setup.

This commit is contained in:
Martin Edenhofer 2014-06-10 09:16:18 +02:00
parent 2d715c713b
commit 943d015ae9

View file

@ -1,9 +1,10 @@
class UpdateTicketReplace2 < ActiveRecord::Migration
def up
overview_role = Role.where( :name => 'Agent' ).first
if overview_role
Overview.destroy_all
UserInfo.current_user_id = 1
overview_role = Role.where( :name => 'Agent' ).first
Overview.create_if_not_exists(
UserInfo.current_user_id = 1
Overview.create_if_not_exists(
:name => 'My assigned Tickets',
:link => 'my_assigned',
:prio => 1000,
@ -22,9 +23,9 @@ Overview.create_if_not_exists(
:m => [ 'number', 'title', 'customer', 'state', 'priority', 'group', 'created_at' ],
:view_mode_default => 's',
},
)
)
Overview.create_if_not_exists(
Overview.create_if_not_exists(
:name => 'Unassigned & Open Tickets',
:link => 'all_unassigned',
:prio => 1001,
@ -43,9 +44,9 @@ Overview.create_if_not_exists(
:m => [ 'number', 'title', 'customer', 'state', 'priority', 'group', 'created_at' ],
:view_mode_default => 's',
},
)
)
Overview.create_if_not_exists(
Overview.create_if_not_exists(
:name => 'All Open Tickets',
:link => 'all_open',
:prio => 1002,
@ -63,9 +64,9 @@ Overview.create_if_not_exists(
:m => [ 'number', 'title', 'customer', 'state', 'priority', 'group', 'created_at' ],
:view_mode_default => 's',
},
)
)
Overview.create_if_not_exists(
Overview.create_if_not_exists(
:name => 'Escalated Tickets',
:link => 'all_escalated',
:prio => 1010,
@ -83,9 +84,9 @@ Overview.create_if_not_exists(
:m => [ 'number', 'title', 'customer', 'state', 'priority', 'group', 'owner', 'escalation_time' ],
:view_mode_default => 's',
},
)
)
Overview.create_if_not_exists(
Overview.create_if_not_exists(
:name => 'My pending reached Tickets',
:link => 'my_pending_reached',
:prio => 1020,
@ -104,16 +105,16 @@ Overview.create_if_not_exists(
:m => [ 'number', 'title', 'customer', 'state', 'priority', 'group', 'created_at' ],
:view_mode_default => 's',
},
)
)
Overview.create_if_not_exists(
Overview.create_if_not_exists(
:name => 'All Tickets',
:link => 'all',
:prio => 9003,
:role_id => overview_role.id,
:condition => {
# 'tickets.state_id' => [3],
# 'tickets.owner_id' => current_user.id,
# 'tickets.state_id' => [3],
# 'tickets.owner_id' => current_user.id,
},
:order => {
:by => 'created_at',
@ -125,10 +126,10 @@ Overview.create_if_not_exists(
:m => [ 'number', 'title', 'customer', 'state', 'priority', 'group', 'created_at' ],
:view_mode_default => 's',
},
)
)
overview_role = Role.where( :name => 'Customer' ).first
Overview.create_if_not_exists(
overview_role = Role.where( :name => 'Customer' ).first
Overview.create_if_not_exists(
:name => 'My Tickets',
:link => 'my_tickets',
:prio => 1000,
@ -147,8 +148,8 @@ Overview.create_if_not_exists(
:m => [ 'number', 'title', 'state', 'priority', 'created_at' ],
:view_mode_default => 's',
},
)
Overview.create_if_not_exists(
)
Overview.create_if_not_exists(
:name => 'My Organization Tickets',
:link => 'my_organization_tickets',
:prio => 1100,
@ -168,8 +169,8 @@ Overview.create_if_not_exists(
:m => [ 'number', 'title', 'state', 'priority', 'created_at' ],
:view_mode_default => 's',
},
)
)
end
end
def down