-
Notifications
You must be signed in to change notification settings - Fork 70
Refonte - Trésorerie > Journal > Télécharger un justificatif #2067
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Refonte - Trésorerie > Journal > Télécharger un justificatif #2067
Conversation
| $content = $this->filesystem->readFile($path); | ||
|
|
||
| $mimeTypes = $this->mimeTypes->getMimeTypes($path); | ||
|
|
||
| return new Response($content, Response::HTTP_OK, [ | ||
| 'Content-Type' => implode(', ', $mimeTypes), | ||
| 'Content-Transfer-Encoding' => 'Binary', | ||
| 'Content-disposition' => 'attachment; filename="' . basename($path) . '"', | ||
| ]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
À vérifier mais je pense que tu devrais pouvoir remplacer tout ça par un return new BinaryFileResponse($path);
| use CCMBenchmark\Ting\Entity\NotifyPropertyInterface; | ||
| use DateTime; | ||
|
|
||
| class Accounting implements NotifyPropertyInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm je suis pas fan du nom (éternel sujet 😅 le naming).
Pourquoi pas Transaction ou Operation ? Ou même JournalEntry.
(Je sais qu'on a déjà une table et entité Operation mais vu son utilité on pourrait s'en passer).
| $id = $request->query->getInt('id'); | ||
| if ($id === 0) { | ||
| throw $this->createNotFoundException('No id provided'); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi pas en profiter pour modifier l'url et avoir l'id direct dedans ?
Genre /journal/download/123
Comme ça tu récupère int $id dans la méthode et plus besoin de gérer la 404 à la main.
| Then the response header "Content-disposition" should match '#filename="afup_justificatifs-(.*).zip"#' | ||
|
|
||
| @reloadDbWithTestData | ||
| Scenario: Compte journal afficher les entrées déjà pointées |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ça me paraitrait plus juste comme ça :
| Scenario: Compte journal afficher les entrées déjà pointées | |
| Scenario: Compte journal Télécharger un justificatif |
(par contre tu peux tout à fait faire un autre scénario pour l'affichage des entrées pointées)
Refonte du téléchargement d'un justificatif du journal avec Symfony et ajout de l'entité et du repository Ting pour la table compta.
fixes #2066