Commit f2af0940 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use clean group urls on view access page



Bug #1006634, part 3

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

Change-Id: Ie5b88afba4a76bdae8d150452dbae7daed61471d
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent f4f4589d
......@@ -746,7 +746,7 @@ class PluginSearchInternal extends PluginSearch {
$count = get_field_sql('SELECT COUNT(*) '.$sql, $values);
if ($count > 0) {
$sql = 'SELECT id, name, description, grouptype, jointype, request, public, ctime, mtime, category ' . $sql . ' ORDER BY name';
$sql = 'SELECT id, name, description, grouptype, jointype, request, public, ctime, mtime, category, urlid ' . $sql . ' ORDER BY name';
$data = get_records_sql_array($sql, $values, $offset, $limit);
}
......
......@@ -402,7 +402,7 @@ searchTable.rowfunction = function(rowdata, rownumber, globaldata) {
rowdata.roledisplay = scrapeText(this.childNodes[this.selectedIndex]);
}
});
identityNodes.push(A({'href': config.wwwroot + 'group/view.php?id=' + rowdata.id, 'target': '_blank'}, rowdata.name));
identityNodes.push(A({'href': rowdata.url, 'target': '_blank'}, rowdata.name));
identityNodes.push(" - ");
identityNodes.push(roleSelector);
}
......
......@@ -47,12 +47,16 @@ switch ($type) {
$data = search_user($query, $limit, $offset, array('exclude' => $USER->get('id')));
break;
case 'group':
require_once('group.php');
$data = search_group($query, $limit, $offset, '');
$roles = get_records_array('grouptype_roles');
$data['roles'] = array();
foreach ($roles as $r) {
$data['roles'][$r->grouptype][] = array('name' => $r->role, 'display' => get_string($r->role, 'grouptype.'.$r->grouptype));
}
foreach ($data['data'] as &$r) {
$r->url = group_homepage_url($r);
}
break;
}
......
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