mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-02-27 02:30:02 +00:00
Merge branch 'master' into ticket-app-master
# Conflicts: # docs/source/development/create-a-new-bundle.md # src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialAction.vue # src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialIssue.vue # src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php # src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig # src/Bundle/ChillCalendarBundle/Resources/views/Calendar/cancelCalendarByAccompanyingCourse.html.twig # src/Bundle/ChillCalendarBundle/Resources/views/Calendar/cancelCalendarByPerson.html.twig # src/Bundle/ChillCalendarBundle/translations/messages.fr.yml # src/Bundle/ChillDocStoreBundle/Resources/public/types/index.ts # src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts # src/Bundle/ChillMainBundle/translations/messages.fr.yml # src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue
This commit is contained in:
@@ -87,7 +87,7 @@ class AdminDocGeneratorTemplateController extends CRUDController
|
||||
*/
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
return $query->addSelect('JSON_EXTRACT(e.name, :lang) AS HIDDEN name_lang')
|
||||
return $query->addSelect('REPLACE(JSON_EXTRACT(e.name, :lang), \' \', \'~\') AS HIDDEN name_lang')
|
||||
->setParameter('lang', $request->getLocale())
|
||||
->addOrderBy('name_lang', 'ASC');
|
||||
}
|
||||
|
||||
@@ -25,12 +25,24 @@
|
||||
<div class="item-bloc">
|
||||
<div class="item-row">
|
||||
<div class="item-col" style="flex-basis:100%;">
|
||||
<h2>{{ entity.name|localize_translatable_string }}</h2>
|
||||
<h2>{{ entity.name|localize_translatable_string }} </h2>
|
||||
<p style="margin-left: 1rem;"><span class="badge bg-chill-gray">
|
||||
{% if entity.active %}
|
||||
{{ 'admin.active'|trans }}
|
||||
{% else %}
|
||||
{{ 'admin.not active'|trans }}
|
||||
{% endif %}
|
||||
</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-row">
|
||||
<p><span class="badge bg-chill-green-dark">{{ contextManager.getContextByKey(entity.context).name|trans }}</span></p>
|
||||
</div>
|
||||
{# <div class="item-row">#}
|
||||
{# <div class="item-col" style="flex-basis:100%;">#}
|
||||
{##}
|
||||
{# </div>#}
|
||||
{# </div>#}
|
||||
<div class="item-row">
|
||||
<div class="item-col"></div>
|
||||
<ul class="record_actions item-col flex-shrink-1">
|
||||
|
||||
@@ -25,6 +25,8 @@ use Symfony\Component\Mailer\MailerInterface;
|
||||
use Symfony\Component\Messenger\Event\WorkerMessageFailedEvent;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
// use Symfony\Component\Translation\LocaleSwitcher;
|
||||
|
||||
/**
|
||||
* @see OnGenerationFailsTest for test suite
|
||||
*/
|
||||
@@ -40,6 +42,7 @@ final readonly class OnGenerationFails implements EventSubscriberInterface
|
||||
private StoredObjectRepositoryInterface $storedObjectRepository,
|
||||
private TranslatorInterface $translator,
|
||||
private UserRepositoryInterface $userRepository,
|
||||
// private LocaleSwitcher $localeSwitcher,
|
||||
) {}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
@@ -118,6 +121,25 @@ final readonly class OnGenerationFails implements EventSubscriberInterface
|
||||
return;
|
||||
}
|
||||
|
||||
// Implementation with LocaleSwitcher (commented out - to be activated after migration to sf7.2):
|
||||
/*
|
||||
$this->localeSwitcher->runWithLocale($creator->getLocale(), function () use ($message, $errors, $template, $creator) {
|
||||
$email = (new TemplatedEmail())
|
||||
->to($message->getSendResultToEmail())
|
||||
->subject($this->translator->trans('docgen.failure_email.The generation of a document failed'))
|
||||
->textTemplate('@ChillDocGenerator/Email/on_generation_failed_email.txt.twig')
|
||||
->context([
|
||||
'errors' => $errors,
|
||||
'template' => $template,
|
||||
'creator' => $creator,
|
||||
'stored_object_id' => $message->getDestinationStoredObjectId(),
|
||||
]);
|
||||
|
||||
$this->mailer->send($email);
|
||||
});
|
||||
*/
|
||||
|
||||
// Current implementation:
|
||||
$email = (new TemplatedEmail())
|
||||
->to($message->getSendResultToEmail())
|
||||
->subject($this->translator->trans('docgen.failure_email.The generation of a document failed'))
|
||||
|
||||
@@ -27,6 +27,8 @@ use Symfony\Component\Messenger\Exception\UnrecoverableMessageHandlingException;
|
||||
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
// use Symfony\Component\Translation\LocaleSwitcher;
|
||||
|
||||
/**
|
||||
* Handle the request of document generation.
|
||||
*/
|
||||
@@ -46,6 +48,7 @@ class RequestGenerationHandler implements MessageHandlerInterface
|
||||
private readonly MailerInterface $mailer,
|
||||
private readonly TranslatorInterface $translator,
|
||||
private readonly StoredObjectManagerInterface $storedObjectManager,
|
||||
// private readonly LocaleSwitcher $localeSwitcher,
|
||||
) {}
|
||||
|
||||
public function __invoke(RequestGenerationMessage $message)
|
||||
@@ -122,6 +125,30 @@ class RequestGenerationHandler implements MessageHandlerInterface
|
||||
|
||||
private function sendDataDump(StoredObject $destinationStoredObject, RequestGenerationMessage $message): void
|
||||
{
|
||||
// Implementation with LocaleSwitcher (commented out - to be activated after migration to sf7.2):
|
||||
// Note: This method sends emails to admin addresses, not user addresses, so locale switching may not be needed
|
||||
/*
|
||||
$this->localeSwitcher->runWithLocale('fr', function () use ($destinationStoredObject, $message) {
|
||||
// Get the content of the document
|
||||
$content = $this->storedObjectManager->read($destinationStoredObject);
|
||||
$filename = $destinationStoredObject->getFilename();
|
||||
$contentType = $destinationStoredObject->getType();
|
||||
|
||||
// Create the email with the document as an attachment
|
||||
$email = (new TemplatedEmail())
|
||||
->to($message->getSendResultToEmail())
|
||||
->textTemplate('@ChillDocGenerator/Email/send_data_dump_to_admin.txt.twig')
|
||||
->context([
|
||||
'filename' => $filename,
|
||||
])
|
||||
->subject($this->translator->trans('docgen.data_dump_email.subject'))
|
||||
->attach($content, $filename, $contentType);
|
||||
|
||||
$this->mailer->send($email);
|
||||
});
|
||||
*/
|
||||
|
||||
// Current implementation:
|
||||
// Get the content of the document
|
||||
$content = $this->storedObjectManager->read($destinationStoredObject);
|
||||
$filename = $destinationStoredObject->getFilename();
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
docgen:
|
||||
# Geen ICU berichten nodig voor data_dump_email meer
|
||||
@@ -49,3 +49,7 @@ crud:
|
||||
|
||||
|
||||
Template file: Fichier modèle
|
||||
|
||||
admin:
|
||||
active: Actif
|
||||
not active: Non-actif
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
docgen:
|
||||
Generate a document: Document genereren
|
||||
Generate: Genereren
|
||||
Document generation: Documentgeneratie
|
||||
Manage templates and document generation: Beheer van gegenereerde documenten en hun sjablonen
|
||||
Pick template context: Context kiezen
|
||||
Context: Context
|
||||
New template: Nieuw sjabloon
|
||||
Edit template: Sjabloon bewerken
|
||||
test generate: Generatie testen
|
||||
With context %name%: 'Met context "%name%"'
|
||||
|
||||
Doc generation failed: Het genereren van dit document is mislukt
|
||||
Doc generation is pending: Het genereren van dit document is bezig
|
||||
Come back later: Kom later terug
|
||||
|
||||
Send report to: Rapport verzenden naar
|
||||
Send report errors to this email address: Foutrapporten worden verzonden naar het opgegeven e-mailadres
|
||||
Generate as creator: Genereren als
|
||||
The document will be generated as the given creator: Het document wordt gegenereerd namens de opgegeven gebruiker
|
||||
Show data instead of generating: Gegevens tonen in plaats van document genereren
|
||||
|
||||
Any template configured: Geen documentsjabloon geconfigureerd
|
||||
|
||||
entity_id_placeholder: Identificatie van de entiteit
|
||||
|
||||
failure_email:
|
||||
The generation of a document failed: Het genereren van een document is mislukt
|
||||
The generation of the document %template_name% failed: Het genereren van een document op basis van sjabloon {{ template_name }} is mislukt.
|
||||
The following errors were encoutered: De volgende fouten zijn opgetreden
|
||||
Forward this email to your administrator for solving: Stuur dit bericht door naar uw beheerder voor probleemoplossing.
|
||||
References: Referenties
|
||||
|
||||
data_dump_email:
|
||||
subject: Inhoud van documentgeneratiegegevens beschikbaar
|
||||
Dear: Beste
|
||||
data_dump_ready_and_attached: >-
|
||||
De inhoud van de gegevens is beschikbaar. U vindt deze als bijlage bij deze e-mail.
|
||||
filename: >-
|
||||
Bestandsnaam: %filename%
|
||||
|
||||
|
||||
|
||||
crud:
|
||||
docgen_template:
|
||||
index:
|
||||
title: Documentgeneratie
|
||||
add_new: Aanmaken
|
||||
|
||||
|
||||
Template file: Sjabloonbestand
|
||||
Reference in New Issue
Block a user