Skip to content
Snippets Groups Projects
Commit a01ecbe4 authored by Elmar Ludwig's avatar Elmar Ludwig Committed by David Siegfried
Browse files

use current+next semester as default for globalsearch, fixes #1348

Closes #1348

Merge request studip/studip!829
parent dee03e51
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,7 @@ class Search_GlobalsearchController extends AuthenticatedController ...@@ -79,7 +79,7 @@ class Search_GlobalsearchController extends AuthenticatedController
null, null,
'semester', 'semester',
$this->getSemesters(), $this->getSemesters(),
(int) $_SESSION['global_search']['selects']['semester'], 'future',
['id' => 'semester_select'] ['id' => 'semester_select']
); );
...@@ -90,7 +90,7 @@ class Search_GlobalsearchController extends AuthenticatedController ...@@ -90,7 +90,7 @@ class Search_GlobalsearchController extends AuthenticatedController
null, null,
'seminar_type', 'seminar_type',
$this->getSemClasses(), $this->getSemClasses(),
$_SESSION['global_search']['selects']['seminar_type'], '',
['id' => 'seminar_type_select'] ['id' => 'seminar_type_select']
); );
...@@ -101,7 +101,7 @@ class Search_GlobalsearchController extends AuthenticatedController ...@@ -101,7 +101,7 @@ class Search_GlobalsearchController extends AuthenticatedController
null, null,
'institute', 'institute',
$this->getInstitutes(), $this->getInstitutes(),
$_SESSION['global_search']['selects']['institute'], '',
['id' => 'institute_select'] ['id' => 'institute_select']
); );
} }
...@@ -115,12 +115,8 @@ class Search_GlobalsearchController extends AuthenticatedController ...@@ -115,12 +115,8 @@ class Search_GlobalsearchController extends AuthenticatedController
*/ */
private function getSemesters() private function getSemesters()
{ {
// set the current semester as the initially selected semester
if (!$_SESSION['global_search']['selects']) {
$current_sem = GlobalSearchModule::getCurrentSemester();
$_SESSION['global_search']['selects']['semester'] = $current_sem;
}
$semesters = []; $semesters = [];
$semesters['future'] = _('Aktuelles und nächstes Semester');
$semesters[''] = _('Alle Semester'); $semesters[''] = _('Alle Semester');
$sems = array_reverse(Semester::getAll()); $sems = array_reverse(Semester::getAll());
......
...@@ -205,20 +205,6 @@ abstract class GlobalSearchModule ...@@ -205,20 +205,6 @@ abstract class GlobalSearchModule
} }
} }
/**
* Get the current semester considering the given
* SEMESTER_TIME_SWITCH in the CONFIG
* (n weeks before the next semester)
*
* @return int The start time of the current semester.
*/
public static function getCurrentSemester()
{
$current_semester = Semester::findDefault();
return (int)$current_semester['beginn'];
}
/** /**
* Returns a list of all active search modules * Returns a list of all active search modules
* @return array search_class => data * @return array search_class => data
......
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