Commit f8c8467a authored by Evan Goldenberg's avatar Evan Goldenberg Committed by Richard Mansfield
Browse files

better subjects for view released and new friend notifications


Signed-off-by: default avatarEvan Goldenberg <evang@catalyst.net.nz>
parent 3a02c2f3
...@@ -100,8 +100,8 @@ $string['remove'] = 'Remove'; ...@@ -100,8 +100,8 @@ $string['remove'] = 'Remove';
$string['updatemembership'] = 'Update membership'; $string['updatemembership'] = 'Update membership';
$string['memberchangefailed'] = 'Failed to update some membership information'; $string['memberchangefailed'] = 'Failed to update some membership information';
$string['memberchangesuccess'] = 'Membership status changed successfully'; $string['memberchangesuccess'] = 'Membership status changed successfully';
$string['viewreleasedsubject'] = 'Your view has been released'; $string['viewreleasedsubject'] = 'Your view "%s" has been released from %s by %s';
$string['viewreleasedmessage'] = 'The view that you submitted to %s has been released back to you by %s'; $string['viewreleasedmessage'] = 'Your view "%s" has been released from %s by %s';
$string['viewreleasedsuccess'] = 'View was released successfully'; $string['viewreleasedsuccess'] = 'View was released successfully';
$string['groupmembershipchangesubject'] = 'Group membership: %s'; $string['groupmembershipchangesubject'] = 'Group membership: %s';
$string['groupmembershipchangedmessagetutor'] = 'You have been promoted to a tutor in this group'; $string['groupmembershipchangedmessagetutor'] = 'You have been promoted to a tutor in this group';
...@@ -186,7 +186,7 @@ $string['friendformrejectsuccess'] = 'Rejected friend request'; ...@@ -186,7 +186,7 @@ $string['friendformrejectsuccess'] = 'Rejected friend request';
$string['addtofriendslist'] = 'Add to friends'; $string['addtofriendslist'] = 'Add to friends';
$string['requestfriendship'] = 'Request friendship'; $string['requestfriendship'] = 'Request friendship';
$string['addedtofriendslistsubject'] = 'New friend'; $string['addedtofriendslistsubject'] = '%s has added you as a friend';
$string['addedtofriendslistmessage'] = '%s added you as a friend! This means that %s is also on your friend list now too. ' $string['addedtofriendslistmessage'] = '%s added you as a friend! This means that %s is also on your friend list now too. '
. ' Click on the link below to see their profile page'; . ' Click on the link below to see their profile page';
......
...@@ -1544,7 +1544,7 @@ function addfriend_submit(Pieform $form, $values) { ...@@ -1544,7 +1544,7 @@ function addfriend_submit(Pieform $form, $values) {
$f->usr1 = $values['id']; $f->usr1 = $values['id'];
$f->usr2 = $loggedinid; $f->usr2 = $loggedinid;
insert_record('usr_friend', $f); insert_record('usr_friend', $f);
$n->subject = get_string_from_language($lang, 'addedtofriendslistsubject', 'group'); $n->subject = get_string_from_language($lang, 'addedtofriendslistsubject', 'group', $displayname);
$n->message = get_string_from_language($lang, 'addedtofriendslistmessage', 'group', $displayname, $displayname); $n->message = get_string_from_language($lang, 'addedtofriendslistmessage', 'group', $displayname, $displayname);
require_once('activity.php'); require_once('activity.php');
......
...@@ -750,12 +750,18 @@ class View { ...@@ -750,12 +750,18 @@ class View {
$this->set('submittedtime', null); $this->set('submittedtime', null);
$this->commit(); $this->commit();
$ownerlang = get_user_language($this->get('owner')); $ownerlang = get_user_language($this->get('owner'));
$url = get_config('wwwroot') . 'view/view.php?id=' . $this->get('id');
require_once('activity.php'); require_once('activity.php');
activity_occurred('maharamessage', activity_occurred('maharamessage',
array('users' => array($this->get('owner')), array(
'subject' => get_string_from_language($ownerlang, 'viewreleasedsubject', 'group'), 'users' => array($this->get('owner')),
'message' => get_string_from_language($ownerlang, 'viewreleasedmessage', 'group', $submitinfo['name'], 'subject' => get_string_from_language($ownerlang, 'viewreleasedsubject', 'group', $this->get('title'),
display_name($releaseuser, $this->get_owner_object())))); $submitinfo['name'], display_name($releaseuser, $this->get_owner_object())),
'message' => get_string_from_language($ownerlang, 'viewreleasedmessage', 'group', $this->get('title'),
$submitinfo['name'], display_name($releaseuser, $this->get_owner_object())),
'url' => $url,
)
);
} }
/** /**
......
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