Bugfixes/tasks list

This commit is contained in:
2021-11-05 12:31:41 +00:00
parent e1677cd2b6
commit 35d807cab0
11 changed files with 74 additions and 26 deletions

View File

@@ -88,27 +88,27 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
if ($ended > 0) {
$this->addItemInMenu(
$menu,
$user,
'%number% tasks over deadline',
'My tasks over deadline',
SingleTaskRepository::DATE_STATUS_ENDED,
$ended,
-15);
-15,
['new', 'in_progress'],
['alert']
);
}
if ($warning > 0) {
$this->addItemInMenu(
$menu,
$user,
'%number% tasks near deadline',
'My tasks near deadline',
SingleTaskRepository::DATE_STATUS_WARNING,
$warning,
-14);
-14,
['new', 'in_progress'],
['warning']
);
}
$menu->addChild("My tasks", [
'route' => 'chill_task_single_my_tasks'
'route' => 'chill_task_singletask_my_tasks'
])
->setExtras([
'order' => -10,
@@ -117,20 +117,20 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
}
protected function addItemInMenu(MenuItem $menu, User $u, $message, $title, $status, $number, $order)
protected function addItemInMenu(MenuItem $menu, $message, $number, $order, array $states = [], array $status = [])
{
if ($number > 0) {
$menu->addChild(
$this->translator->transChoice($message, $number),
[
'route' => 'chill_task_singletask_list',
'route' => 'chill_task_singletask_my_tasks',
'routeParameters' => [
'user_id' => $u->getId(),
'status' => [
$status
],
'hide_form' => true,
'title' => $this->translator->trans($title)
'f' => [
'checkboxes' => [
'states' => $states,
'status' => $status
]
]
]
])
->setExtras([