Commit d1e59d9a authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Correct notification language in group requests & view feedback

parent 7fa7a11e
......@@ -382,10 +382,11 @@ function invite_submit(Pieform $form, $values) {
$adduser = get_record('usr', 'id', $data->member);
try {
insert_record('group_member_invite', $data);
$lang = get_user_language($values['id']);
activity_occurred('maharamessage',
array('users' => array($values['id']),
'subject' => get_string('invitetogroupsubject'),
'message' => get_string('invitetogroupmessage', 'mahara', display_name($USER, $adduser), $ctitle),
'subject' => get_string_from_language($lang, 'invitetogroupsubject'),
'message' => get_string_from_language($lang, 'invitetogroupmessage', 'mahara', display_name($USER, $adduser), $ctitle),
'url' => get_config('wwwroot')
. 'group/view.php?id=' . $values['group']));
}
......@@ -409,10 +410,11 @@ function addmember_submit(Pieform $form, $values) {
try {
insert_record('group_member', $data);
$lang = get_user_language($values['id']);
activity_occurred('maharamessage',
array('users' => array($values['id']),
'subject' => get_string('addedtogroupsubject'),
'message' => get_string('addedtogroupmessage', 'mahara', display_name($USER, $adduser), $ctitle),
'subject' => get_string_from_language($lang, 'addedtogroupsubject'),
'message' => get_string_from_language($lang, 'addedtogroupmessage', 'mahara', display_name($USER, $adduser), $ctitle),
'url' => get_config('wwwroot')
. 'group/view.php?id=' . $values['group']));
}
......
......@@ -58,9 +58,11 @@ if ($error = $um->preprocess_file()) {
}
$size = $um->file['size'];
$ownerlang = get_user_language($viewdata->owner);
safe_require('artefact', 'file');
$folderid = ArtefactTypeFolder::get_folder_id(get_string('feedbackattachdirname', 'view'),
get_string('feedbackattachdirdesc', 'view'),
$folderid = ArtefactTypeFolder::get_folder_id(get_string_from_language($ownerlang, 'feedbackattachdirname', 'view'),
get_string_from_language($ownerlang, 'feedbackattachdirdesc', 'view'),
null, $viewdata->owner);
// Create a new file object
......@@ -68,7 +70,7 @@ $data = (object) array('owner' => $viewdata->owner,
'parent' => $folderid,
'size' => $size,
'title' => $filename,
'description' => get_string('feedbackonviewbytutorofgroup', 'view',
'description' => get_string_from_language($ownerlang, 'feedbackonviewbytutorofgroup', 'view',
$viewdata->title, display_name($USER), $viewdata->name));
$f = ArtefactTypeFile::new_file($um->file['tmp_name'], $data);
$f->commit();
......
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