Commit 6cfeeed4 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Only count portfolio views in view owner search

parent 8839e27c
...@@ -1680,7 +1680,7 @@ class View { ...@@ -1680,7 +1680,7 @@ class View {
CASE WHEN u.preferredname IS NULL OR u.preferredname = '' THEN u.firstname || ' ' || u.lastname CASE WHEN u.preferredname IS NULL OR u.preferredname = '' THEN u.firstname || ' ' || u.lastname
ELSE u.preferredname END AS display, ELSE u.preferredname END AS display,
CAST (u.id AS TEXT), COUNT(v.id) CAST (u.id AS TEXT), COUNT(v.id)
FROM {usr} u INNER JOIN {view} v ON (v.owner = u.id) FROM {usr} u INNER JOIN {view} v ON (v.owner = u.id AND v.type = 'portfolio')
WHERE u.deleted = 0 $tsql WHERE u.deleted = 0 $tsql
GROUP BY ownertype, display, u.id GROUP BY ownertype, display, u.id
UNION UNION
...@@ -1698,7 +1698,7 @@ class View { ...@@ -1698,7 +1698,7 @@ class View {
$data = get_records_sql_array("SELECT * FROM ($sql) q $qsql", $ph, $offset, $limit); $data = get_records_sql_array("SELECT * FROM ($sql) q $qsql", $ph, $offset, $limit);
foreach ($data as &$r) { foreach ($data as &$r) {
if ($r->type == 'institution' && $r->id == 'mahara') { if ($r->ownertype == 'institution' && $r->id == 'mahara') {
$r->display = get_config('sitename'); $r->display = get_config('sitename');
} }
} }
......
Supports Markdown
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