2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2015-09-06 23:02:15 +00:00
|
|
|
|
2021-06-23 11:35:27 +00:00
|
|
|
module SessionHelper::CollectionDashboard
|
2020-10-05 14:26:25 +00:00
|
|
|
|
|
|
|
module_function
|
|
|
|
|
2021-07-16 13:38:01 +00:00
|
|
|
def session(collections, assets, user)
|
2015-09-06 23:02:15 +00:00
|
|
|
return [collections, assets] if !user
|
|
|
|
|
2020-10-06 13:13:50 +00:00
|
|
|
item = StatsStore.find_by(
|
|
|
|
stats_storable: user,
|
|
|
|
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
|
|
|
|
end
|