Commit 4b0d6f7d authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use clean group url for notification after adding a user to a group



Bug #1006634, part 3

When adding a user to a group directly from a user profile.

Change-Id: If97f429b4cd1106e50ec1c66800f42571d6ab603
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 16943862
......@@ -306,7 +306,8 @@ function invite_submit(Pieform $form, $values) {
function addmember_submit(Pieform $form, $values) {
global $USER, $SESSION, $userid;
$ctitle = get_field('group', 'name', 'id', $values['group']);
$group = get_record('group', 'id', $values['group']);
$ctitle = $group->name;
$adduser = get_record('usr', 'id', $userid);
try {
......@@ -317,7 +318,7 @@ function addmember_submit(Pieform $form, $values) {
'users' => array($userid),
'subject' => get_string_from_language($lang, 'addedtogroupsubject', 'group'),
'message' => get_string_from_language($lang, 'addedtogroupmessage', 'group', display_name($USER, $adduser), $ctitle),
'url' => 'group/view.php?id=' . $values['group'],
'url' => group_homepage_url($group, false),
'urltext' => $ctitle,
));
$SESSION->add_ok_msg(get_string('useradded', 'group'));
......
Markdown is supported
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