trabajo-afectivo/app/controllers/sessions/collection_ticket.rb

49 lines
1.4 KiB
Ruby
Raw Normal View History

2014-02-03 19:24:49 +00:00
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
module ExtraCollection
def session( collections, assets, user )
# all ticket stuff
2015-10-15 13:23:41 +00:00
collections[ Macro.to_app_model ] = []
2016-06-30 20:04:48 +00:00
Macro.all.each { |item|
2015-10-15 13:23:41 +00:00
assets = item.assets(assets)
}
collections[ Ticket::StateType.to_app_model ] = []
2016-06-30 20:04:48 +00:00
Ticket::StateType.all.each { |item|
assets = item.assets(assets)
}
collections[ Ticket::State.to_app_model ] = []
2016-06-30 20:04:48 +00:00
Ticket::State.all.each { |item|
assets = item.assets(assets)
}
collections[ Ticket::Priority.to_app_model ] = []
2016-06-30 20:04:48 +00:00
Ticket::Priority.all.each { |item|
assets = item.assets(assets)
}
collections[ Ticket::Article::Type.to_app_model ] = []
2016-06-30 20:04:48 +00:00
Ticket::Article::Type.all.each { |item|
assets = item.assets(assets)
}
collections[ Ticket::Article::Sender.to_app_model ] = []
2016-06-30 20:04:48 +00:00
Ticket::Article::Sender.all.each { |item|
assets = item.assets(assets)
}
if !user.role?(Z_ROLENAME_CUSTOMER)
2012-11-12 09:34:22 +00:00
# all signatures
collections[ Signature.to_app_model ] = []
2016-06-30 20:04:48 +00:00
Signature.all.each { |item|
assets = item.assets(assets)
}
2012-11-12 09:34:22 +00:00
# all email addresses
collections[ EmailAddress.to_app_model ] = []
2016-06-30 20:04:48 +00:00
EmailAddress.all.each { |item|
assets = item.assets(assets)
}
2012-11-12 09:34:22 +00:00
end
[collections, assets]
end
module_function :session
end