Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
f7f9c69b
Commit
f7f9c69b
authored
10 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-984: fancy automatic sorting based on recent launch date, lifecycle, mark and display name
parent
112369d4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/repository/manager/RepositoryEntryMyCourseQueries.java
+7
-3
7 additions, 3 deletions
...at/repository/manager/RepositoryEntryMyCourseQueries.java
with
7 additions
and
3 deletions
src/main/java/org/olat/repository/manager/RepositoryEntryMyCourseQueries.java
+
7
−
3
View file @
f7f9c69b
...
@@ -394,6 +394,7 @@ public class RepositoryEntryMyCourseQueries {
...
@@ -394,6 +394,7 @@ public class RepositoryEntryMyCourseQueries {
OrderBy
orderBy
=
params
.
getOrderBy
();
OrderBy
orderBy
=
params
.
getOrderBy
();
if
(
orderBy
!=
null
)
{
if
(
orderBy
!=
null
)
{
switch
(
orderBy
)
{
switch
(
orderBy
)
{
case
automatic:
//need lastVisited
case
lastVisited:
case
lastVisited:
sb
.
append
(
" ,(select infos2.recentLaunch from usercourseinfos as infos2"
)
sb
.
append
(
" ,(select infos2.recentLaunch from usercourseinfos as infos2"
)
.
append
(
" where infos2.resource=res and infos2.identity=ident"
)
.
append
(
" where infos2.resource=res and infos2.identity=ident"
)
...
@@ -417,9 +418,12 @@ public class RepositoryEntryMyCourseQueries {
...
@@ -417,9 +418,12 @@ public class RepositoryEntryMyCourseQueries {
private
void
appendOrderBy
(
OrderBy
orderBy
,
boolean
asc
,
StringBuilder
sb
)
{
private
void
appendOrderBy
(
OrderBy
orderBy
,
boolean
asc
,
StringBuilder
sb
)
{
if
(
orderBy
!=
null
)
{
if
(
orderBy
!=
null
)
{
switch
(
orderBy
)
{
switch
(
orderBy
)
{
case
automatic:
case
automatic:
//! the sorting is reverse
sb
.
append
(
" order by lower(v.displayname)"
);
if
(
asc
)
{
appendAsc
(
sb
,
asc
);
sb
.
append
(
" order by recentLaunch desc nulls last, lifecycle.validFrom desc nulls last, marks asc nulls last, lower(v.displayname) asc "
);
}
else
{
sb
.
append
(
" order by recentLaunch asc nulls last, lifecycle.validFrom asc nulls last, marks asc nulls last, lower(v.displayname) desc "
);
}
break
;
break
;
case
favorit:
case
favorit:
if
(
asc
)
{
if
(
asc
)
{
...
...
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