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