messages/outbox: Fix undefined var warnings

This code needs urgent refactoring. I just applied something similar to
what other files in this module are doing.
lib/messages.lib: Undefined variable warning
Minor - adding api_get_cidreq().
Fixing double resursive in delete_document function see BT#7870
Minor - adding add_progress_bar() function see BT#7893
Adding progressbar & adding api_get_cidreq() see BT#7893
Minor - fixing PHP warning.
Adding group filter when deleting a doc see BT#7870
Added settings list to function call that otherwise removes all settings - refs #7051
Minor - format code, adding api_get_self();
Fixing query see BT#7682
Minor - format code.
Merge branch '1.9.x' of github.com:chamilo/chamilo-lms into 1.9.x
Minor - format code
Fixing plugin course settings see #7051
Minor - format code.
Merge pull request #238 from diegoe/1.9_empty-outbox-warnings

1.9 empty outbox warnings
Adding correct/incorrect score options when importing an exercise

See BT#7755
Minor - format code.
Minor - updating lang vars.