Commit 9af5e76f authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use clean profile urls on the view access page



Bug #1006634, part 3

Adds the profile url to the information returned by search_user, and
passes this into the javascript in the "Share with other users and
groups" fieldset on the Edit access page.

Change-Id: I9dc34ce94c30d8ed14464ad518e2b9cab02f4db9
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 43559c30
......@@ -70,6 +70,7 @@ function search_user($query_string, $limit, $offset = 0, $data = array()) {
if ($results['data']) {
foreach ($results['data'] as &$result) {
$result['name'] = display_name($result);
$result['url'] = profile_url($result);
}
}
......
......@@ -175,7 +175,7 @@ class PluginSearchInternal extends PluginSearch {
$sql = '
SELECT
u.id, u.username, u.firstname, u.lastname, u.preferredname, u.email, u.studentid, u.staff,
u.admin, u.profileicon
u.admin, u.profileicon, u.urlid
FROM {usr} u';
if (isset($data['group'])) {
......
......@@ -387,7 +387,7 @@ searchTable.rowfunction = function(rowdata, rownumber, globaldata) {
var identityNodes = [], profileIcon = null, roleSelector = null;
if (rowdata.type == 'user') {
profileIcon = IMG({'src': config.wwwroot + 'thumb.php?type=profileicon&maxwidth=20&maxheight=20&id=' + rowdata.id});
identityNodes.push(A({'href': config.wwwroot + 'user/view.php?id=' + rowdata.id, 'target': '_blank'}, rowdata.name));
identityNodes.push(A({'href': rowdata.url, 'target': '_blank'}, rowdata.name));
}
else if (rowdata.type == 'group') {
rowdata.role = null;
......
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