PostgreSQL compatibility
Only try deleting the calendar events if the id is defined
Fix some inconsistencies in SQL requests building
In scheduler_get_attendants, use user_picture::fields to make sure fullname() always works
Use user_picture::fields everywhere possible instead of hardcoding the user name fields
Merge remote-tracking branch 'upstream/MOODLE_25_STABLE' into MOODLE_25_REVIEWED

Conflicts:
	datelist.php
	downloads.php
	locallib.php
	viewstatistics.php
	viewstudent.php