Moved to new overview format.

This commit is contained in:
Martin Edenhofer 2013-02-01 01:01:20 +01:00
parent e529ac62ea
commit 0f01e5b19f

View file

@ -4,7 +4,7 @@ module Session
# get application root directory # get application root directory
@root = Dir.pwd.to_s @root = Dir.pwd.to_s
if !@root if !@root || @root.empty? || @root == '/'
@root = Rails.root @root = Rails.root
end end
@ -324,10 +324,10 @@ class UserState
:current_user => user, :current_user => user,
) )
overviews.each { |overview| overviews.each { |overview|
cache_key = @cache_key + '_overview_data_' + overview.meta[:url] cache_key = @cache_key + '_overview_data_' + overview.link
if CacheIn.expired(cache_key) if CacheIn.expired(cache_key)
overview_data = Ticket.overview( overview_data = Ticket.overview(
:view => overview.meta[:url], :view => overview.link,
# :view_mode => params[:view_mode], # :view_mode => params[:view_mode],
:current_user => user, :current_user => user,
:array => true, :array => true,
@ -552,13 +552,13 @@ class ClientState
:current_user => user, :current_user => user,
) )
overviews.each { |overview| overviews.each { |overview|
cache_key = @cache_key + '_overview_data_' + overview.meta[:url] cache_key = @cache_key + '_overview_data_' + overview.link
overview_data_time = CacheIn.get_time( cache_key, { :ignore_expire => true } ) overview_data_time = CacheIn.get_time( cache_key, { :ignore_expire => true } )
if overview_data_time && @data[cache_key] != overview_data_time if overview_data_time && @data[cache_key] != overview_data_time
@data[cache_key] = overview_data_time @data[cache_key] = overview_data_time
overview_data = CacheIn.get( cache_key, { :ignore_expire => true } ) overview_data = CacheIn.get( cache_key, { :ignore_expire => true } )
self.log 'notify', "push overview_data #{overview.meta[:url]} for user #{user.id}" self.log 'notify', "push overview_data #{overview.link} for user #{user.id}"
users = {} users = {}
tickets = [] tickets = []
overview_data[:ticket_list].each {|ticket_id| overview_data[:ticket_list].each {|ticket_id|
@ -603,7 +603,7 @@ class ClientState
}, },
}, },
:event => [ 'loadCollection', 'ticket_overview_rebuild' ], :event => [ 'loadCollection', 'ticket_overview_rebuild' ],
:collection => 'ticket_overview_' + overview.meta[:url].to_s, :collection => 'ticket_overview_' + overview.link.to_s,
}) })
end end
} }