1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
- module SessionHelper::CollectionTicket
- module_function
- def session(collections, assets, user)
- # all ticket stuff
- collections[ Ticket::StateType.to_app_model ] = []
- Ticket::StateType.all.each do |item|
- assets = item.assets(assets)
- end
- collections[ Ticket::State.to_app_model ] = []
- Ticket::State.all.each do |item|
- assets = item.assets(assets)
- end
- collections[ Ticket::Priority.to_app_model ] = []
- Ticket::Priority.all.each do |item|
- assets = item.assets(assets)
- end
- collections[ Ticket::Article::Type.to_app_model ] = []
- Ticket::Article::Type.all.each do |item|
- assets = item.assets(assets)
- end
- collections[ Ticket::Article::Sender.to_app_model ] = []
- Ticket::Article::Sender.all.each do |item|
- assets = item.assets(assets)
- end
- collections[ Ticket::TimeAccounting::Type.to_app_model ] = []
- Ticket::TimeAccounting::Type.all.each do |item|
- assets = item.assets(assets)
- end
- if user.permissions?(['ticket.agent', 'admin.channel_email'])
- collections[ Macro.to_app_model ] = []
- Macro.all.each do |item|
- assets = item.assets(assets)
- end
- collections[ TextModule.to_app_model ] = []
- TextModule.all.each do |item|
- assets = item.assets(assets)
- end
- collections[ Signature.to_app_model ] = []
- Signature.all.each do |item|
- assets = item.assets(assets)
- end
- collections[ EmailAddress.to_app_model ] = []
- EmailAddress.all.each do |item|
- assets = item.assets(assets)
- end
- end
- [collections, assets]
- end
- end
|