Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin/TaskManagementBundle: add additional sort of 'Tasks' -> t.id #124

Open
acaliebe opened this issue Jan 23, 2024 · 0 comments
Open
Labels
task management Task-Management plugin

Comments

@acaliebe
Copy link

acaliebe commented Jan 23, 2024

Feature-Request:

Hello,
I often have to search for a task that is already marked as 'Completed', when I open 'tasks' I unfortunately don't have the sorting by 't.id' - so just 'newest first', as a task doesn't have to have a start/end time at this point.

Describe the solution you'd like
It would be great if the sorting criterion ID were included in one of the next versions.

As a quick test, I changed the $orderBy='endsort' to $orderBy='t.id' in var/plugins/TaskManagementBundle/Repository/TaskRepository.php for this purpose.

+++ kimai.testing/var/plugins/TaskManagementBundle/Repository/TaskRepository.php      2024-01-18 14:07:22.257200822 +0100
@@ -321,12 +321,14 @@
                 $orderBy = 'team.name';
                 break;
             case 'end':
-                $orderBy = 'endSort';
+               /* (quickfix/testing) Use 'order by END' as 'order by ID' to show the last created entries first  */
+               $orderBy = 't.id';
+                /* $orderBy = 'endSort';
                 if ($query->getOrder() === TaskQuery::ORDER_ASC) {
                     $qb->addSelect('COALESCE(t.end, \'9999-12-31 23:59:59\') AS HIDDEN endSort');
                 } else {
                     $qb->addSelect('COALESCE(t.end, \'0000-12-31 23:59:59\') AS HIDDEN endSort');
-                }
+                } */
                 break;
             default:
                 $orderBy = 't.' . $orderBy;```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task management Task-Management plugin
Projects
None yet
Development

No branches or pull requests

2 participants