FEATURE [user filter] implement query. Selecting multiple users doesn't work

This commit is contained in:
2023-07-05 12:38:42 +02:00
parent a34b5f8588
commit 4da7040a49
8 changed files with 58 additions and 13 deletions

View File

@@ -300,13 +300,16 @@ final class SingleTaskController extends AbstractController
$filterOrder = $this->buildFilterOrder();
$filteredUsers = $filterOrder->getUserPickerData('userPicker');
$flags = array_merge(
$filterOrder->getCheckboxData('status'),
array_map(static fn ($i) => 'state_' . $i, $filterOrder->getCheckboxData('states'))
);
$nb = $this->singleTaskAclAwareRepository->countByAllViewable(
$filterOrder->getQueryString(),
$flags
$flags,
$filteredUsers
);
$paginator = $this->paginatorFactory->create($nb);
@@ -314,6 +317,7 @@ final class SingleTaskController extends AbstractController
$tasks = $this->singleTaskAclAwareRepository->findByAllViewable(
$filterOrder->getQueryString(),
$flags,
$filteredUsers,
$paginator->getCurrentPageFirstItemNumber(),
$paginator->getItemsPerPage(),
[
@@ -681,7 +685,7 @@ final class SingleTaskController extends AbstractController
->addSearchBox()
->addCheckbox('status', $statuses, $statuses, $statusTrans)
->addCheckbox('states', $states, ['new', 'in_progress'])
->addUserPickers('userPicker', 'userPicker', ['multiple' => True])
->addUserPicker('userPicker', 'Filter by user', ['multiple' => True, 'required' => False])
->build();
}