mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Merge remote-tracking branch 'origin/master' into features/docgen-widget-generate-template
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\DocGeneratorBundle\Controller;
|
||||
|
||||
use ChampsLibres\AsyncUploaderBundle\TempUrl\TempUrlGeneratorInterface;
|
||||
@@ -66,7 +68,7 @@ class DocGeneratorTemplateController extends AbstractController
|
||||
|
||||
$entity = $this->getDoctrine()->getRepository($entityClassName)->find($entityId);
|
||||
|
||||
if ($template->getContext() == HouseholdMemberSelectionContext::class) {
|
||||
if ($template->getContext() === HouseholdMemberSelectionContext::class) {
|
||||
$context = new HouseholdMemberSelectionContext();
|
||||
$datas = $context->getData($entity);
|
||||
} else {
|
||||
@@ -88,9 +90,9 @@ class DocGeneratorTemplateController extends AbstractController
|
||||
|
||||
unlink($tmpfname);
|
||||
|
||||
$fileContent = fopen($tmpfname2, 'r'); // the generated file content
|
||||
$fileContent = fopen($tmpfname2, 'rb'); // the generated file content
|
||||
|
||||
$genDocName = 'doc_' . sprintf('%010d', rand()) . '.docx';
|
||||
$genDocName = 'doc_' . sprintf('%010d', mt_rand()) . '.docx';
|
||||
|
||||
$getUrlGen = $tempUrlGenerator->generate(
|
||||
'PUT',
|
||||
@@ -106,7 +108,7 @@ class DocGeneratorTemplateController extends AbstractController
|
||||
'body' => $fileContent,
|
||||
]);
|
||||
|
||||
if ($putResponse->getStatusCode() == 201) {
|
||||
if ($putResponse->getStatusCode() === 201) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$storedObject = new StoredObject();
|
||||
$storedObject
|
||||
|
Reference in New Issue
Block a user