Commit db3782d5 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1850220: Can't get to site's contacts page form profile page"

parents 5c33bf75 5803793d
......@@ -833,6 +833,12 @@ class Institution {
WHERE i.institution = ? AND u.deleted = 0 AND i.staff = 1', array($this->name))) {
return array_map('extract_institution_user_id', $results);
}
if ($this->name == 'mahara') {
// get all the site staff who are not also site admins
if ($results = get_records_sql_array("SELECT u.id FROM {usr} u WHERE u.deleted = 0 AND u.staff = 1 AND u.admin = 0")) {
return array_map('extract_institution_user_id', $results);
}
}
return array();
}
......
{foreach from=$institutions item=institution}
<tr class="{cycle values='r0,r1'}">
<td>
{if !$institution->site}<a href="{$WWWROOT}institution/index.php?institution={$institution->name}">{/if}
<a href="{$WWWROOT}institution/index.php?institution={$institution->name}">
{$institution->displayname}
{if !$institution->site}</a>{/if}
</a>
</td>
<td class="center">
{$institution->name}
......
......@@ -13,6 +13,12 @@
</h1>
<div class="userdetail view-container">
{if $siterole}
<p class="lead text-small">
<span class="icon icon-lg icon-university left" role="presentation" aria-hidden="true"></span>
{$siterole|safe}
</p>
{/if}
{if $institutions}
<p class="lead text-small">
<span class="icon icon-lg icon-university left" role="presentation" aria-hidden="true"></span>
......
......@@ -70,7 +70,8 @@ if (!isset($user)) {
$is_friend = is_friend($userid, $loggedinid);
if ($loggedinid == $userid) {
$view = $USER->get_profile_view();
$userobj = clone $USER;
$view = $userobj->get_profile_view();
}
else {
$userobj = new User();
......@@ -390,7 +391,13 @@ if ($remoteuserrelationship) {
$smarty->assign('loginas', $loginas);
$smarty->assign('INLINEJAVASCRIPT', $blocksjs . $inlinejs);
if ($userobj->get('admin') || $userobj->get('staff')) {
$url = get_config('wwwroot') . 'institution/index.php?institution=mahara';
$link = get_string('institutionlink', 'mahara', $url, 'mahara');
// If user is both Admin and Staff, only say Site administrator and not both
$role = $userobj->get('admin') ? get_string('siteadmin', 'admin') : get_string('sitestaff', 'admin');
$smarty->assign('siterole', $role . ' ' . $link);
}
$smarty->assign('institutions', get_institution_string_for_user($userid));
$smarty->assign('canmessage', $loggedinid != $userid && can_send_message($loggedinid, $userid));
$smarty->assign('USERID', $userid);
......
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