Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
3f662c7b
Commit
3f662c7b
authored
Sep 16, 2008
by
Richard Mansfield
Browse files
mysql fix for copy view page
parent
237ceb96
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/view.php
View file @
3f662c7b
...
...
@@ -1674,17 +1674,26 @@ class View {
$qsql
=
''
;
}
if
(
is_mysql
())
{
$uid
=
'u.id'
;
$gid
=
'g.id'
;
}
else
{
$uid
=
'CAST (u.id AS TEXT)'
;
$gid
=
'CAST (g.id AS TEXT)'
;
}
$sql
=
"
SELECT
'user' AS ownertype,
CASE WHEN u.preferredname IS NULL OR u.preferredname = '' THEN u.firstname || ' ' || u.lastname
ELSE u.preferredname END AS display,
CAST (u.id AS TEXT)
, COUNT(v.id)
$uid
, COUNT(v.id)
FROM
{
usr
}
u INNER JOIN
{
view
}
v ON (v.owner = u.id AND v.type = 'portfolio')
WHERE u.deleted = 0
$tsql
GROUP BY ownertype, display, u.id
UNION
SELECT 'group' AS ownertype, g.name AS display,
CAST (g.id AS TEXT)
, COUNT(v.id)
SELECT 'group' AS ownertype, g.name AS display,
$gid
, COUNT(v.id)
FROM
{
group
}
g INNER JOIN
{
view
}
v ON (g.id = v.group)
WHERE g.deleted = 0
$tsql
GROUP BY ownertype, display, g.id
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment