2016-10-19 03:11:36 +00:00
|
|
|
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
|
2015-09-06 23:02:15 +00:00
|
|
|
|
|
|
|
module ExtraCollection
|
|
|
|
def session( collections, assets, user )
|
|
|
|
return [collections, assets] if !user
|
|
|
|
|
|
|
|
item = StatsStore.search(
|
|
|
|
object: 'User',
|
2018-12-19 17:31:51 +00:00
|
|
|
o_id: user.id,
|
|
|
|
key: 'dashboard',
|
2015-09-06 23:02:15 +00:00
|
|
|
)
|
|
|
|
return [collections, assets] if !item
|
2018-10-09 06:17:41 +00:00
|
|
|
|
2015-09-06 23:02:15 +00:00
|
|
|
collections['StatsStore'] = [item]
|
|
|
|
|
|
|
|
[collections, assets]
|
|
|
|
end
|
2018-10-09 06:17:41 +00:00
|
|
|
module_function :session # rubocop:disable Style/AccessModifierDeclarations
|
2015-09-06 23:02:15 +00:00
|
|
|
end
|