Adding AND only if there are filters.
Adding custom petition only when there are more than one course

see BT#6449
Fixing get_sessions_admin() query
Merge branch '1.9.x' of ssh://github.com/chamilo/chamilo-lms into chamilo19