mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-10 15:12:12 +00:00
Merge 89c230322a into 6330b71bfb
This commit is contained in:
commit
187fbee94b
2 changed files with 59 additions and 0 deletions
|
|
@ -362,4 +362,35 @@ class PartListsController extends AbstractController
|
|||
{
|
||||
return $this->showListWithFilter($request,'parts/lists/all_list.html.twig');
|
||||
}
|
||||
|
||||
#[Route(path: '/parts/filter/less_than_desired', name: 'parts_filter_less_than_desired')]
|
||||
public function showLessThanDesiredFilter(Request $request): Response
|
||||
{
|
||||
return $this->showListWithFilter($request,
|
||||
'parts/lists/all_list.html.twig',
|
||||
function (PartFilter $filter) {
|
||||
$filter->lessThanDesired->setValue(true);
|
||||
},
|
||||
function (FormInterface $filterForm) {
|
||||
$this->disableFormFieldAfterCreation($filterForm->get('lessThanDesired')->get('value'));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[Route(path: '/parts/filter/custom', name: 'parts_filter_custom')]
|
||||
public function showCustomFilter(Request $request): Response
|
||||
{
|
||||
// TODO custom filters will need custom access permission checks!
|
||||
return $this->showListWithFilter($request,
|
||||
'parts/lists/all_list.html.twig',
|
||||
function (PartFilter $filter) {
|
||||
;
|
||||
},
|
||||
function (FormInterface $filterForm) {
|
||||
;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue