Skip to content
Snippets Groups Projects
Commit d7bf050a authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Jan-Hendrik Willms
Browse files

fixes #3888

Closes #3888

Merge request studip/studip!2740
parent 5c639411
No related branches found
No related tags found
No related merge requests found
......@@ -305,7 +305,7 @@ class Admin_CoursesController extends AuthenticatedController
public function index_action()
{
$this->fields = $this->getViewFilters();
$this->sortby = $GLOBALS['user']->cfg->MEINE_SEMINARE_SORT ?? 'name';
$this->sortby = $GLOBALS['user']->cfg->MEINE_SEMINARE_SORT ?? (Config::get()->IMPORTANT_SEMNUMBER ? 'number' : 'name');
$this->sortflag = $GLOBALS['user']->cfg->MEINE_SEMINARE_SORT_FLAG ?? 'ASC';
$this->buildSidebar();
......
......@@ -235,6 +235,16 @@ export default {
if (sortby === 'last_activity') {
sortFunction = (a, b) => a.last_activity_raw - b.last_activity_raw;
} else if (sortby === 'name') {
sortFunction = (a, b) => {
return collator.compare(striptags(a.name), striptags(b.name))
|| collator.compare(striptags(a.number), striptags(b.number));
};
} else if (sortby === 'number') {
sortFunction = (a, b) => {
return collator.compare(striptags(a.number), striptags(b.number))
|| collator.compare(striptags(a.name), striptags(b.name));
};
} else {
let is_numeric = true;
for (let i in array) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment