Only show active overviews.

This commit is contained in:
Martin Edenhofer 2013-02-01 01:20:18 +01:00
parent 194b28b90f
commit 6982183086
2 changed files with 4 additions and 5 deletions

View file

@ -1,5 +1,5 @@
class App.Overview extends Spine.Model class App.Overview extends Spine.Model
@configure 'Overview', 'name', 'link', 'prio', 'condition', 'order', 'group_by', 'view', 'user_id', 'organization_shared', 'role_id', 'order', 'group_by' @configure 'Overview', 'name', 'link', 'prio', 'condition', 'order', 'group_by', 'view', 'user_id', 'organization_shared', 'role_id', 'order', 'group_by', 'active'
@extend Spine.Model.Ajax @extend Spine.Model.Ajax
@url: 'api/overviews' @url: 'api/overviews'
@configure_attributes = [ @configure_attributes = [
@ -96,5 +96,4 @@ class App.Overview extends Spine.Model
'link', 'link',
'role', 'role',
'prio', 'prio',
'active',
] ]

View file

@ -237,16 +237,16 @@ class Ticket < ApplicationModel
if data[:current_user].is_role('Customer') if data[:current_user].is_role('Customer')
role = data[:current_user].is_role( 'Customer' ) role = data[:current_user].is_role( 'Customer' )
if data[:current_user].organization_id && data[:current_user].organization.shared if data[:current_user].organization_id && data[:current_user].organization.shared
overviews = Overview.where( :role_id => role.id ) overviews = Overview.where( :role_id => role.id, :active => true )
else else
overviews = Overview.where( :role_id => role.id, :organization_shared => false ) overviews = Overview.where( :role_id => role.id, :organization_shared => false, :active => true )
end end
return overviews return overviews
end end
# get agent overviews # get agent overviews
role = data[:current_user].is_role( 'Agent' ) role = data[:current_user].is_role( 'Agent' )
overviews = Overview.where( :role_id => role.id ) overviews = Overview.where( :role_id => role.id, :active => true )
return overviews return overviews
end end