Added a page to quickly add many parts to a project from parts lists.

This commit is contained in:
Jan Böhmer 2022-12-28 23:32:46 +01:00
parent 345fb0a3c1
commit 25494c9ddf
7 changed files with 157 additions and 3 deletions

View file

@ -77,7 +77,7 @@ class PartListsController extends AbstractController
$this->addFlash('error', 'part.table.actions.no_params_given');
} else {
$parts = $actionHandler->idStringToArray($ids);
$actionHandler->handleAction($action, $parts, $target ? (int) $target : null);
$redirectResponse = $actionHandler->handleAction($action, $parts, $target ? (int) $target : null, $redirect);
//Save changes
$this->entityManager->flush();
@ -85,6 +85,11 @@ class PartListsController extends AbstractController
$this->addFlash('success', 'part.table.actions.success');
}
//If the action handler returned a response, we use it, otherwise we redirect back to the previous page.
if ($redirectResponse){
return $redirectResponse;
}
return $this->redirect($redirect);
}