Skip to content
GitLab
Menu
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
82384aa6
Commit
82384aa6
authored
Nov 26, 2015
by
Son Nguyen
Committed by
Gerrit Code Review
Nov 26, 2015
Browse files
Merge "Bug 1515053: adjusting OR joins to be UNION for artefactchooser"
parents
2f51835f
8148f07c
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/view.php
View file @
82384aa6
...
...
@@ -3401,21 +3401,22 @@ class View {
safe_require
(
'artefact'
,
'file'
);
$public
=
(
int
)
ArtefactTypeFolder
::
admin_public_folder_id
();
$select
=
'(
a.owner = ?
OR a.id IN (
$select
=
' a.id IN (
SELECT id
FROM {artefact}
WHERE owner = ?
UNION
SELECT id
FROM {artefact}
WHERE (path = ? OR path LIKE ?) AND institution = \'mahara\'
)
OR a.id IN (
UNION
SELECT aar.artefact
FROM {group_member} m
JOIN {artefact} aa ON m.group = aa.group
JOIN {artefact_access_role} aar ON aar.role = m.role AND aar.artefact = aa.id
WHERE m.member = ? AND aar.can_republish = 1
)
OR a.id IN (
SELECT artefact FROM {artefact_access_usr} WHERE usr = ? AND can_republish = 1
)
'
;
UNION
SELECT artefact FROM {artefact_access_usr} WHERE usr = ? AND can_republish = 1'
;
$ph
=
array
(
$user
->
get
(
'id'
),
"/
$public
"
,
db_like_escape
(
"/
$public
/"
)
.
'%'
,
$user
->
get
(
'id'
),
$user
->
get
(
'id'
));
...
...
@@ -3427,12 +3428,13 @@ class View {
if
(
$institutions
)
{
$select
.
=
'
OR a.institution IN ('
.
join
(
','
,
array_fill
(
0
,
count
(
$institutions
),
'?'
))
.
')'
;
UNION
SELECT id FROM {artefact} WHERE institution IN ('
.
join
(
','
,
array_fill
(
0
,
count
(
$institutions
),
'?'
))
.
')'
;
$ph
=
array_merge
(
$ph
,
$institutions
);
}
$select
.
=
"
)"
;
)"
;
}
if
(
!
empty
(
$data
[
'artefacttypes'
])
&&
is_array
(
$data
[
'artefacttypes'
]))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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