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

43 lines
1.5 KiB
Ruby
Raw Normal View History

# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
module ExtraCollection
2012-10-23 20:25:42 +00:00
def session( collections, user )
# all ticket stuff
collections[ Ticket::StateType.to_online_model ] = Ticket::StateType.all
collections[ Ticket::State.to_online_model ] = Ticket::State.all
collections[ Ticket::Priority.to_online_model ] = Ticket::Priority.all
collections[ Ticket::Article::Type.to_online_model ] = Ticket::Article::Type.all
collections[ Ticket::Article::Sender.to_online_model ] = Ticket::Article::Sender.all
2012-11-12 09:34:22 +00:00
if !user.is_role('Customer')
2012-11-12 09:34:22 +00:00
# all signatures
collections[ Signature.to_online_model ] = Signature.all
2012-11-12 09:34:22 +00:00
# all email addresses
collections[ EmailAddress.to_online_model ] = EmailAddress.all
2012-11-12 09:34:22 +00:00
end
end
2012-10-23 20:25:42 +00:00
def push( collections, user )
# all ticket stuff
collections[ Ticket::StateType.to_online_model ] = Ticket::StateType.all
collections[ Ticket::State.to_online_model ] = Ticket::State.all
collections[ Ticket::Priority.to_online_model ] = Ticket::Priority.all
collections[ Ticket::Article::Type.to_online_model ] = Ticket::Article::Type.all
collections[ Ticket::Article::Sender.to_online_model ] = Ticket::Article::Sender.all
2012-11-12 09:34:22 +00:00
if !user.is_role('Customer')
# all signatures
collections[ Signature.to_online_model ] = Signature.all
2012-11-12 09:34:22 +00:00
# all email addresses
collections[ EmailAddress.to_online_model ] = EmailAddress.all
2012-11-12 09:34:22 +00:00
end
end
module_function :session, :push
end