Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Uni Osnabrück
Stud.IP
Commits
ae60458a
Commit
ae60458a
authored
1 year ago
by
Ron Lucke
Committed by
Jan-Hendrik Willms
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix #2972
Closes #2972 Merge request
studip/studip!2078
parent
ac82f363
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/classes/globalsearch/GlobalSearchCourseware.php
+8
-6
8 additions, 6 deletions
lib/classes/globalsearch/GlobalSearchCourseware.php
with
8 additions
and
6 deletions
lib/classes/globalsearch/GlobalSearchCourseware.php
+
8
−
6
View file @
ae60458a
...
@@ -39,13 +39,15 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF
...
@@ -39,13 +39,15 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF
if
(
!
$search
)
{
if
(
!
$search
)
{
return
null
;
return
null
;
}
}
$payload_search
=
str_replace
(
'"'
,
''
,
json_encode
(
$search
));
$query
=
DBManager
::
get
()
->
quote
(
"%
{
$search
}
%"
);
$query
=
DBManager
::
get
()
->
quote
(
"%
{
$search
}
%"
);
$payload_query
=
DBManager
::
get
()
->
quote
(
"%
{
$payload_search
}
%"
);
if
(
!
empty
(
$filter
[
'rangeId'
]))
{
if
(
!
empty
(
$filter
[
'rangeId'
]))
{
$range_id
=
$filter
[
'rangeId'
];
$range_id
=
$filter
[
'rangeId'
];
$sql
=
"(SELECT `cw_structural_elements` . `id` AS id, CONCAT('', 'cw_structural_elements') AS type
$sql
=
"(SELECT `cw_structural_elements` . `id` AS id, CONCAT('', 'cw_structural_elements') AS type
FROM `cw_structural_elements`
FROM `cw_structural_elements`
WHERE (`title` LIKE
{
$query
}
OR `payload` LIKE
{
$query
}
)
WHERE (`title` LIKE
{
$query
}
OR `payload` LIKE
{
$
payload_
query
}
)
AND `range_id` = '
{
$range_id
}
'
AND `range_id` = '
{
$range_id
}
'
ORDER BY `cw_structural_elements`.`mkdate` DESC)
ORDER BY `cw_structural_elements`.`mkdate` DESC)
UNION (
UNION (
...
@@ -53,7 +55,7 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF
...
@@ -53,7 +55,7 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF
FROM `cw_containers` c
FROM `cw_containers` c
JOIN cw_structural_elements se
JOIN cw_structural_elements se
ON se . `id` = c . `structural_element_id`
ON se . `id` = c . `structural_element_id`
WHERE c. `payload` LIKE
{
$query
}
WHERE c. `payload` LIKE
{
$
payload_
query
}
AND `container_type` != 'list'
AND `container_type` != 'list'
AND se . `range_id` = '
{
$range_id
}
'
AND se . `range_id` = '
{
$range_id
}
'
ORDER BY c . `mkdate` DESC)
ORDER BY c . `mkdate` DESC)
...
@@ -64,7 +66,7 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF
...
@@ -64,7 +66,7 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF
ON c.id = b.container_id
ON c.id = b.container_id
JOIN cw_structural_elements se
JOIN cw_structural_elements se
ON se . `id` = c . `structural_element_id`
ON se . `id` = c . `structural_element_id`
WHERE b.payload LIKE
{
$query
}
WHERE b.payload LIKE
{
$
payload_
query
}
AND se . `range_id` = '
{
$range_id
}
'
AND se . `range_id` = '
{
$range_id
}
'
ORDER BY b . `mkdate` DESC
ORDER BY b . `mkdate` DESC
) LIMIT
{
$limit
}
"
;
) LIMIT
{
$limit
}
"
;
...
@@ -84,7 +86,7 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF
...
@@ -84,7 +86,7 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF
$sql
=
"(SELECT `cw_structural_elements` . `id` AS id, CONCAT('', 'cw_structural_elements') AS type
$sql
=
"(SELECT `cw_structural_elements` . `id` AS id, CONCAT('', 'cw_structural_elements') AS type
FROM `cw_structural_elements`
FROM `cw_structural_elements`
WHERE (`title` LIKE
{
$query
}
OR `payload` LIKE
{
$query
}
)
WHERE (`title` LIKE
{
$query
}
OR `payload` LIKE
{
$
payload_
query
}
)
AND (`range_id` IN (
{
$mycourses
}
) OR `range_id` =
{
$user_id
}
)
AND (`range_id` IN (
{
$mycourses
}
) OR `range_id` =
{
$user_id
}
)
ORDER BY `cw_structural_elements`.`mkdate` DESC)
ORDER BY `cw_structural_elements`.`mkdate` DESC)
UNION (
UNION (
...
@@ -92,7 +94,7 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF
...
@@ -92,7 +94,7 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF
FROM `cw_containers` c
FROM `cw_containers` c
JOIN cw_structural_elements se
JOIN cw_structural_elements se
ON se . `id` = c . `structural_element_id`
ON se . `id` = c . `structural_element_id`
WHERE c. `payload` LIKE
{
$query
}
WHERE c. `payload` LIKE
{
$
payload_
query
}
AND `container_type` != 'list'
AND `container_type` != 'list'
AND (se . `range_id` IN (
{
$mycourses
}
) OR se .`range_id` =
{
$user_id
}
)
AND (se . `range_id` IN (
{
$mycourses
}
) OR se .`range_id` =
{
$user_id
}
)
ORDER BY c . `mkdate` DESC)
ORDER BY c . `mkdate` DESC)
...
@@ -103,7 +105,7 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF
...
@@ -103,7 +105,7 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF
ON c.id = b.container_id
ON c.id = b.container_id
JOIN cw_structural_elements se
JOIN cw_structural_elements se
ON se . `id` = c . `structural_element_id`
ON se . `id` = c . `structural_element_id`
WHERE b.payload LIKE
{
$query
}
WHERE b.payload LIKE
{
$
payload_
query
}
AND (se . `range_id` IN (
{
$mycourses
}
) OR se .`range_id` =
{
$user_id
}
)
AND (se . `range_id` IN (
{
$mycourses
}
) OR se .`range_id` =
{
$user_id
}
)
ORDER BY b . `mkdate` DESC
ORDER BY b . `mkdate` DESC
) LIMIT
{
$limit
}
"
;
) LIMIT
{
$limit
}
"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment