MDL-46987 report_participation: Count duplicate logs as 1

Some of the actions generate more then 1 event.
Example: forum post create generate:
- post_created and
- accessible_uploaded
events which  gets logged at the same time.
Count them as 1 action and not 2, as it is
single action and report should show 1 and not 2
MDL-47316 mod_forum: Fix course overview performance regression

 make more efficient use of mod_info cache by processing courses
 sequentially.

Change-Id: I03b808c8a7efc42879ec2689fbd2a9fe7a8f1103
MDL-46391 messages: Add search button under contact list.

Add search button to only Message navigation -> Contacts section.
MDL-46054 web_services: bug fix in core_user_get_users

Thanks to Mikko Rantanen for the patch
MDL-46054 web_services: wrong key in exception string
MDL-46054 web_services: Fixed invalid parameter definitions
MDL-46984 core_course: added grouping name for activities with no link
MDL-47470 behat: fix 'I navigate to' exception

When a child page is not found
MDL-47484 atto_indent: Prevent loss of rangy markers in some cases
MDL-47474 Calendar export: Fix user id in authorization check
MDL-46295 course: add search box to all course listings, manage button when appropriate
MDL-47492 behat: refer to table column indexes instead of names
MDL-47492 core_grades: Behat test for using scales and mingrade in gradebook
MDL-47481 Availability: Profile condition error if no users
MDL-47426 assign local roles: rewrite query for better performance.

This is an extremely dangerous query, because it includes the user
table twice, along-side two other potentially large tables,
role_assignments and user_enrolments.

The solution is to rewrite the query so that:

1. The subquery is JOINed, not WHERE ... INed. Typically query
   optimisers handle the JOIN case better.

2. Before the join was role-assignments <-> users <-> subquery.
   That is, everything was linked to u.id.

   Now the linking is role-assignments <-> subquery <-> users,
   so the SELECT DISTINT eu1_u.id FROM {enrolled users} is central.
   That seems to send a strong hint to the query optimiser about
   a good order to execute the query.
MDL-28075 question editing: sort out nav bar when editing in a quiz

If you edited a question from the Edit quiz page in a quiz, the navigation
bar was far too long. This was due to some odd code that was trying too
hard to be clever.

Instead, editing a question is now always treated as being logically within
the question bank for the purposes of navigation. That is, even if the
returnurl will end up taking you back to where you where when you have finished.
MDL-28075 question editing: tidy code

Remove an unnecessary else (the if, and else if, always end in a redirect)
and unindent that code.
MDL-47518 report_log: Logfiles of single users no longer accessible

* Removing join on courseid if it is the SITEID.
MDL-36460 mod_forum: Restrict forum subsription list based on availability info
MDL-44536 workshop: Instantiate with the plain course module record

When the workshop class constructor signature was designed, the class
cm_info did not exist yet. Instead, plain course modules records were
used everywhere - including the $mod parameter in the
workshop_user_complete() callback. Even if cm_info is backwards
compatible with the plain data record when it comes to behaviour, it
must not be passed where the workshop API expects the stdClass (coding
error is thrown).

Alternative solution would be to remove the type hinting in the workshop
constructor. That is what the 'assign' class does, for example (the
inline docs describe the expected type to be stdClass, but that is not
forced via the method declaration).

As the problem seems to be pretty sole, I prefer not touching the
workshop internal API for now. So we let the cm_info degrade back into
the stdClass to make the workshop constructor happy without significant
performance lost.