Commit 5803fac7 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Fixed bug 422, regarding links to the appropriate view in the

notifications
parent 1a7e41e7
......@@ -75,8 +75,8 @@ $string['newfeedbackonartefact'] = 'New feedback on artefact';
$string['watchlistmessageview'] = 'Activity on watchlist (View)';
$string['watchlistmessageartefact'] = 'Activity on watchlist (Artefact)';
$string['watchlistmessagecommunity'] = 'Activity on watchlist (Community)';
$string['newviewmessage'] = 'New view called';
$string['newviewsubject'] = 'New view';
$string['newviewmessage'] = 'has created a view called "%s" and has granted you access to it.';
$string['newviewsubject'] = 'New view created';
$string['newviewaccessmessage'] = 'You have been added to the access list for the view called';
$string['newviewaccesssubject'] = 'New view access';
......
......@@ -321,9 +321,11 @@ function handle_activity($activitytype, $data, $cron=false) {
WHERE v.id = ?', array($data->view))) {
throw new InvalidArgumentException("Couldn't find view with id " . $data->view);
}
$data->message = get_string('newviewmessage', 'activity')
. ' ' . $viewinfo->title . ' ' . get_string('ownedby', 'activity');
$data->message = get_string('newviewmessage', 'activity', $viewinfo->title);
$data->subject = get_string('newviewsubject', 'activity');
$data->url = get_config('wwwroot') . 'view/view.php?view=' . $data->view;
// add users on friendslist, userlist or grouplist...
$users = activity_get_viewaccess_users($data->view, $data->owner);
if (empty($users)) {
......@@ -331,8 +333,9 @@ function handle_activity($activitytype, $data, $cron=false) {
}
// ick
foreach ($users as $user) {
$user->message = $data->message . ' ' . display_name($viewinfo, $user);
$user->message = display_name($viewinfo, $user) . ' ' . $data->message;
}
break;
case 'viewaccess':
if (!is_numeric($data->owner) || !is_numeric($data->view)) {
......@@ -347,8 +350,9 @@ function handle_activity($activitytype, $data, $cron=false) {
throw new InvalidArgumentException("Couldn't find view with id " . $data->view);
}
$data->message = get_string('newviewaccessmessage', 'activity')
. ' ' . $viewinfo->title . ' ' . get_string('ownedby', 'activity');
. ' "' . $viewinfo->title . '" ' . get_string('ownedby', 'activity');
$data->subject = get_string('newviewaccesssubject', 'activity');
$data->url = get_config('wwwroot') . 'view/view.php?view=' . $data->view;
$users = array_diff_key(activity_get_viewaccess_users($data->view, $data->owner), $data->oldusers);
if (empty($users)) {
$users = array();
......
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