Commit 110b4f19 authored by Lisa Seeto's avatar Lisa Seeto Committed by Gerrit Code Review
Browse files

Merge "Bug 1905624: Make sure expiry part of message is in correct language"

parents 532ad838 aaf4b0f1
......@@ -3217,22 +3217,22 @@ function auth_register_submit(Pieform $form, $values) {
}
require_once(get_config('libroot') . 'pieforms/pieform/elements/expiry.php');
// email each admin
// @TODO Respect the notification preferences of the admins.
foreach ($admins as $admin) {
$adminuser = new User();
$adminuser->find_by_id($admin);
$ownerlang = get_user_language($adminuser->get('id'));
$expirytime = pieform_element_expiry_get_expiry_from_seconds(get_config('defaultregistrationexpirylifetime'));
if ($expirytime == null) {
$expirystring = get_config('defaultregistrationexpirylifetime') . ' ' . get_string('seconds', 'performance');
$expirystring = get_config('defaultregistrationexpirylifetime') . ' ' . get_string_from_language($ownerlang, 'seconds', 'performance');
}
else if ($expirytime['units'] == 'noenddate') {
$expirystring = get_string('element.expiry.noenddate', 'pieforms');
$expirystring = get_string_from_language($ownerlang, 'element.expiry.noenddate', 'pieforms');
}
else {
$expirystring = get_string('element.expiry.' . $expirytime['units'] . '.lowercase', 'pieforms', $expirytime['number'], $expirytime['number']);
$expirystring = get_string_from_language($ownerlang, 'element.expiry.' . $expirytime['units'] . '.lowercase', 'pieforms', $expirytime['number'], $expirytime['number']);
}
// email each admin
// @TODO Respect the notification preferences of the admins.
foreach ($admins as $admin) {
$adminuser = new User();
$adminuser->find_by_id($admin);
$ownerlang = get_user_language($adminuser->get('id'));
email_user($adminuser, null,
get_string_from_language($ownerlang, 'pendingregistrationadminemailsubject', 'auth.internal', $institution->displayname, get_config('sitename')),
get_string_from_language($ownerlang, 'pendingregistrationadminemailtext', 'auth.internal',
......
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