2014-02-03 19:24:49 +00:00
|
|
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
2013-06-12 15:59:58 +00:00
|
|
|
|
2012-05-18 13:53:20 +00:00
|
|
|
module ExtraCollection
|
2014-08-02 21:54:54 +00:00
|
|
|
def session( collections, assets, user )
|
2012-05-18 13:53:20 +00:00
|
|
|
|
2012-10-01 18:41:08 +00:00
|
|
|
# all ticket stuff
|
2013-09-21 22:50:23 +00:00
|
|
|
collections[ Ticket::StateType.to_app_model ] = Ticket::StateType.all
|
2014-08-02 21:54:54 +00:00
|
|
|
collections[ Ticket::StateType.to_app_model ].each {|item|
|
|
|
|
assets = item.assets(assets)
|
|
|
|
}
|
2013-09-21 22:50:23 +00:00
|
|
|
collections[ Ticket::State.to_app_model ] = Ticket::State.all
|
2014-08-02 21:54:54 +00:00
|
|
|
collections[ Ticket::State.to_app_model ].each {|item|
|
|
|
|
assets = item.assets(assets)
|
|
|
|
}
|
2013-09-21 22:50:23 +00:00
|
|
|
collections[ Ticket::Priority.to_app_model ] = Ticket::Priority.all
|
2014-08-02 21:54:54 +00:00
|
|
|
collections[ Ticket::Priority.to_app_model ].each {|item|
|
|
|
|
assets = item.assets(assets)
|
|
|
|
}
|
2013-09-21 22:50:23 +00:00
|
|
|
collections[ Ticket::Article::Type.to_app_model ] = Ticket::Article::Type.all
|
2014-08-02 21:54:54 +00:00
|
|
|
collections[ Ticket::Article::Type.to_app_model ].each {|item|
|
|
|
|
assets = item.assets(assets)
|
|
|
|
}
|
2013-09-21 22:50:23 +00:00
|
|
|
collections[ Ticket::Article::Sender.to_app_model ] = Ticket::Article::Sender.all
|
2014-08-02 21:54:54 +00:00
|
|
|
collections[ Ticket::Article::Sender.to_app_model ].each {|item|
|
|
|
|
assets = item.assets(assets)
|
|
|
|
}
|
2012-11-12 09:34:22 +00:00
|
|
|
if !user.is_role('Customer')
|
2013-06-12 15:59:58 +00:00
|
|
|
|
2012-11-12 09:34:22 +00:00
|
|
|
# all signatures
|
2013-09-21 22:50:23 +00:00
|
|
|
collections[ Signature.to_app_model ] = Signature.all
|
2014-08-02 21:54:54 +00:00
|
|
|
collections[ Signature.to_app_model ].each {|item|
|
|
|
|
assets = item.assets(assets)
|
|
|
|
}
|
2013-06-12 15:59:58 +00:00
|
|
|
|
2012-11-12 09:34:22 +00:00
|
|
|
# all email addresses
|
2013-09-21 22:50:23 +00:00
|
|
|
collections[ EmailAddress.to_app_model ] = EmailAddress.all
|
2014-08-02 21:54:54 +00:00
|
|
|
collections[ EmailAddress.to_app_model ].each {|item|
|
|
|
|
assets = item.assets(assets)
|
|
|
|
}
|
2012-11-12 09:34:22 +00:00
|
|
|
end
|
2012-05-18 13:53:20 +00:00
|
|
|
end
|
2014-08-02 21:54:54 +00:00
|
|
|
module_function :session
|
|
|
|
end
|