Skip to content
Snippets Groups Projects
Commit b742d300 authored by André Noack's avatar André Noack Committed by Jan-Hendrik Willms
Browse files

Resolve #3099 "JSONAPI Route courses erlaubt nicht die Filterung nach...

Resolve #3099 "JSONAPI Route courses erlaubt nicht die Filterung nach Kategorien, Studienbereichen und EInrichtungen"

Closes #3099

Merge request studip/studip!2085
parent fefcbb67
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ use JsonApi\JsonApiController; ...@@ -10,7 +10,7 @@ use JsonApi\JsonApiController;
class CoursesIndex extends JsonApiController class CoursesIndex extends JsonApiController
{ {
protected $allowedFilteringParameters = ['q', 'fields', 'semester']; protected $allowedFilteringParameters = ['q', 'fields', 'semester', 'category', 'scope_choose', 'range_choose'];
protected $allowedIncludePaths = [ protected $allowedIncludePaths = [
'blubber-threads', 'blubber-threads',
...@@ -92,9 +92,9 @@ class CoursesIndex extends JsonApiController ...@@ -92,9 +92,9 @@ class CoursesIndex extends JsonApiController
'q' => '%%%', 'q' => '%%%',
'fields' => 'all', // Titel, Lehrende... 'fields' => 'all', // Titel, Lehrende...
'semester' => 'all', // Semester 'semester' => 'all', // Semester
'search_sem_category' => null, // SEM_CLASS 'category' => null, // SEM_CLASS
'search_sem_scope_choose' => null, // Studienbereiche 'scope_choose' => null, // Studienbereiche
'search_sem_range_choose' => null, // Einrichtungen, 'range_choose' => null, // Einrichtungen,
'combination' => 'OR', // OR|AND 'combination' => 'OR', // OR|AND
]; ];
...@@ -112,8 +112,6 @@ class CoursesIndex extends JsonApiController ...@@ -112,8 +112,6 @@ class CoursesIndex extends JsonApiController
*/ */
private function searchCourses(\User $user, array $filters) private function searchCourses(\User $user, array $filters)
{ {
require_once 'lib/classes/searchtypes/SearchType.class.php';
require_once 'lib/classes/searchtypes/SeminarSearch.class.php';
$visibleOnly = !(is_object($GLOBALS['perm']) $visibleOnly = !(is_object($GLOBALS['perm'])
&& $GLOBALS['perm']->have_perm(\Config::Get()->SEM_VISIBILITY_PERM, $user->id)); && $GLOBALS['perm']->have_perm(\Config::Get()->SEM_VISIBILITY_PERM, $user->id));
...@@ -123,9 +121,9 @@ class CoursesIndex extends JsonApiController ...@@ -123,9 +121,9 @@ class CoursesIndex extends JsonApiController
'quick_search' => $filters['q'], 'quick_search' => $filters['q'],
'qs_choose' => $filters['fields'], 'qs_choose' => $filters['fields'],
'sem' => $filters['semester'], 'sem' => $filters['semester'],
'category' => $filters['search_sem_category'], 'category' => $filters['category'],
'scope_choose' => $filters['search_sem_scope_choose'], 'scope_choose' => $filters['scope_choose'],
'range_choose' => $filters['search_sem_range_choose'], 'range_choose' => $filters['range_choose'],
], ],
$visibleOnly $visibleOnly
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment