Commit 2a0fd12b authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1538225: Respect user's lang preference when adding to institution



Currently the notification message is sent out in the language of the
institution one is joining if that institution has language set. But
if the user being added to the institution has a language preference
set then it should be respected.

behatnotneeded - involves emails

Change-Id: I3e42b08d30c69832e5dcd2e7c5eed835bdb26154
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 3bee7ecf
......@@ -296,8 +296,12 @@ class Institution {
if (is_numeric($user)) {
$user = get_record('usr', 'id', $user);
}
// The user hasn't been added yet, so we have to manually use this institution's lang
if ($this->lang != 'default') {
if ($lang = get_account_preference($user->id, 'lang')) {
// The user has a preset lang preference so we will use this
}
else if ($this->lang != 'default') {
// The user hasn't been added yet, so we have to manually use this institution's lang
$lang = $this->lang;
}
else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment