Commit 58217f73 authored by Peter Hough's avatar Peter Hough
Browse files

Bug1415183 Adding date/time of a pending friend requests.

Change-Id: Ia2355da8bee087659c068d30e0776c6010daa701
parent 87c4ad2d
......@@ -286,6 +286,7 @@ $string['whymakemeyourfriend'] = 'This is why you should make me your friend:';
$string['approverequest'] = 'Approve request';
$string['denyrequest'] = 'Deny request';
$string['pending'] = 'pending';
$string['pendingsince'] = 'pending since %s';
$string['trysearchingforfriends'] = 'Try %ssearching for new friends%s to grow your network.';
$string['nobodyawaitsfriendapproval'] = 'Nobody is awaiting your approval to become your friend.';
$string['sendfriendrequest'] = 'Send friend request';
......
......@@ -1811,6 +1811,7 @@ function get_users_data($userids, $getviews=true) {
$sql = 'SELECT u.id, u.username, u.preferredname, u.firstname, u.lastname, u.admin, u.staff, u.deleted,
u.profileicon, u.email, u.urlid,
fp.requester AS pending,
fp.ctime AS pending_time,
ap.value AS hidenamepref,
COALESCE((SELECT ap.value FROM {usr_account_preference} ap WHERE ap.usr = u.id AND ap.field = \'messages\'), \'allow\') AS messages,
COALESCE((SELECT ap.value FROM {usr_account_preference} ap WHERE ap.usr = u.id AND ap.field = \'friendscontrol\'), \'auth\') AS friendscontrol,
......@@ -1829,6 +1830,7 @@ function get_users_data($userids, $getviews=true) {
$institutionstrings = get_institution_strings_for_users($userids);
foreach ($data as &$record) {
$record->pending_time = format_date(strtotime($record->pending_time), 'strftimedaydate');
$record->messages = ($record->messages == 'allow' || $record->friend && $record->messages == 'friends' || $USER->get('admin')) ? 1 : 0;
if (isset($institutionstrings[$record->id])) {
$record->institutions = $institutionstrings[$record->id];
......
......@@ -7,7 +7,7 @@
<div class="rightdiv">
<h3 class="title"><a href="{profile_url($user)}">{$user->display_name}</a>
{if $user->pending}
<span class="pendingfriend"> - {str tag='pending' section='group'}</span>
<span class="pendingfriend"> - {str tag='pendingsince' section='group' arg1=$user->pending_time}</span>
{elseif $user->friend && $page == 'find'}
<span class="existingfriend"> - {str tag='existingfriend' section='group'}</span>
{/if}
......
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