mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
Add duplication feature for evaluation documents within generic doc
Introduced a new method to duplicate evaluation documents and forward return path URLs. Updated templates to include duplication buttons and adjusted routing for handling the duplication process.
This commit is contained in:
@@ -40,4 +40,15 @@ final readonly class ChillUrlGenerator implements ChillUrlGeneratorInterface
|
||||
|
||||
return $this->urlGenerator->generate($name, $parameters, $referenceType);
|
||||
}
|
||||
|
||||
public function forwardReturnPath(string $name, array $parameters = [], int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH): string
|
||||
{
|
||||
$request = $this->requestStack->getCurrentRequest();
|
||||
|
||||
if ($request->query->has('returnPath')) {
|
||||
return $this->urlGenerator->generate($name, [...$parameters, 'returnPath' => $request->query->get('returnPath')], $referenceType);
|
||||
}
|
||||
|
||||
return $this->urlGenerator->generate($name, $parameters, $referenceType);
|
||||
}
|
||||
}
|
||||
|
@@ -32,4 +32,9 @@ interface ChillUrlGeneratorInterface
|
||||
* Get the return path or, if any, generate an url.
|
||||
*/
|
||||
public function returnPathOr(string $name, array $parameters = [], int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH): string;
|
||||
|
||||
/**
|
||||
* Return a new URL, with the same return path as the existing one. If any, no return path is forwarded.
|
||||
*/
|
||||
public function forwardReturnPath(string $name, array $parameters = [], int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH): string;
|
||||
}
|
||||
|
Reference in New Issue
Block a user