kimai / Paid-plugins

Support for paid Kimai plugins: Discussions and feature requests
https://www.kimai.org/store/
11 stars 1 forks source link

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

Open acaliebe opened 8 months ago

acaliebe commented 8 months ago

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;```