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

Use clean urls on share page



Bug #1006634, part 3

For user and group links under "Access list" on the share tab.

Change-Id: I48f0f78cf3741b0afac66da4c20df3f7184f83d7
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 10401ccc
......@@ -4031,7 +4031,7 @@ class View {
);
$sql = "
SELECT v.id AS vid, v.type AS vtype, v.title AS vname, v.accessconf,
v.startdate, v.stopdate, v.template, v.owner, v.group,
v.startdate, v.stopdate, v.template, v.owner, v.group, v.urlid,
c.id AS cid, c.name AS cname
FROM {view} v
LEFT JOIN {collection_view} cv ON v.id = cv.view
......@@ -4057,6 +4057,7 @@ class View {
'type' => $r->vtype,
'owner' => $r->owner,
'group' => $r->group,
'urlid' => $r->urlid,
));
$view->set('dirty', false);
$v = array(
......@@ -4161,7 +4162,7 @@ class View {
// Get view_access records, apart from those with visible = 0 (system access records)
$accessgroups = get_records_sql_array('
SELECT va.*, g.grouptype, g.name
SELECT va.*, g.grouptype, g.name, g.urlid
FROM {view_access} va LEFT OUTER JOIN {group} g ON (g.id = va.group AND g.deleted = 0)
WHERE va.view IN (' . join(',', array_keys($viewindex)) . ') AND va.visible = 1
ORDER BY va.view, va.accesstype, g.grouptype, va.role, g.name, va.group, va.usr',
......@@ -4203,6 +4204,7 @@ class View {
if ($access->role) {
$access->roledisplay = get_string($access->role, 'grouptype.' . $access->grouptype);
}
$access->groupurl = group_homepage_url((object) array('id' => $access->group, 'urlid' => $access->urlid));
}
else if ($access->institution) {
$access->accesstype = 'institution';
......
......@@ -12,11 +12,11 @@
{elseif $accessgroup.accesstype == 'friends'}
<a href="{$WWWROOT}user/myfriends.php" id="link-myfriends">{str tag="friends" section="view"}</a>
{elseif $accessgroup.accesstype == 'group'}
<a href="{$WWWROOT}group/view.php?id={$accessgroup.id}">{$accessgroup.name}</a>{if $accessgroup.role} ({$accessgroup.roledisplay}){/if}
<a href="{$accessgroup.groupurl}">{$accessgroup.name}</a>{if $accessgroup.role} ({$accessgroup.roledisplay}){/if}
{elseif $accessgroup.accesstype == 'institution'}
<a href="{$WWWROOT}account/institutions.php">{$accessgroup.id|institution_display_name}</a>
{elseif $accessgroup.accesstype == 'user'}
<a href="{$WWWROOT}user/view.php?id={$accessgroup.id}">{$accessgroup.id|display_name}</a>
<a href="{profile_url($accessgroup.id)}">{$accessgroup.id|display_name}</a>
{/if}
{if $accessgroup.startdate}
{if $accessgroup.stopdate}
......
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