Merge branch '111_exports_suite' into calendar/finalization

This commit is contained in:
2022-12-06 21:21:01 +01:00
19 changed files with 826 additions and 21 deletions

View File

@@ -37,8 +37,9 @@ class LoadAddressesBEFromBestAddressCommand extends Command
{
$this
->setName('chill:main:address-ref-from-best-addresses')
->addArgument('lang', InputArgument::REQUIRED)
->addArgument('list', InputArgument::IS_ARRAY, 'The list to add');
->addArgument('lang', InputArgument::REQUIRED, "Language code, for example 'fr'")
->addArgument('list', InputArgument::IS_ARRAY, "The list to add, for example 'full', or 'extract' (dev) or '1xxx' (brussel CP)")
->setDescription('Import BE addresses from BeST Address (see https://osoc19.github.io/best/)');
}
protected function execute(InputInterface $input, OutputInterface $output): int

View File

@@ -31,7 +31,7 @@ class LoadAddressesFRFromBANOCommand extends Command
{
$this->setName('chill:main:address-ref-from-bano')
->addArgument('departementNo', InputArgument::REQUIRED | InputArgument::IS_ARRAY, 'a list of departement numbers')
->setDescription('Import addresses from bano (see https://bano.openstreetmap.fr');
->setDescription('Import FR addresses from bano (see https://bano.openstreetmap.fr');
}
protected function execute(InputInterface $input, OutputInterface $output): int

View File

@@ -133,8 +133,7 @@ class EntityWorkflowStep
if (!$this->destUser->contains($user)) {
$this->destUser[] = $user;
$this->getEntityWorkflow()
->addSubscriberToFinal($user)
->addSubscriberToStep($user);
->addSubscriberToFinal($user);
}
return $this;
@@ -145,8 +144,7 @@ class EntityWorkflowStep
if (!$this->destUserByAccessKey->contains($user) && !$this->destUser->contains($user)) {
$this->destUserByAccessKey[] = $user;
$this->getEntityWorkflow()
->addSubscriberToFinal($user)
->addSubscriberToStep($user);
->addSubscriberToFinal($user);
}
return $this;

View File

@@ -0,0 +1,70 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\MainBundle\Export\Helper;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
/**
* This class provides support for showing translatable string into list or exports.
*
* (note: the name of the class contains "ExportLabelHelper" to give a distinction
* with TranslatableStringHelper.)
*/
class TranslatableStringExportLabelHelper
{
private TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(TranslatableStringHelperInterface $translatableStringHelper)
{
$this->translatableStringHelper = $translatableStringHelper;
}
public function getLabel(string $key, array $values, string $header)
{
return function ($value) use ($header) {
if ('_header' === $value) {
return $header;
}
if (null === $value) {
return '';
}
return $this->translatableStringHelper->localize(json_decode($value, true));
};
}
public function getLabelMulti(string $key, array $values, string $header)
{
return function ($value) use ($header) {
if ('_header' === $value) {
return $header;
}
if (null === $value) {
return '';
}
$decoded = json_decode($value, true);
return implode(
'|',
array_unique(
array_map(
fn (array $translatableString) => $this->translatableStringHelper->localize($translatableString),
array_filter($decoded, static fn ($elem) => null !== $elem)
)
)
);
};
}
}

View File

@@ -13,6 +13,8 @@ namespace Chill\MainBundle\Export\Helper;
use Chill\MainBundle\Repository\UserRepositoryInterface;
use Chill\MainBundle\Templating\Entity\UserRender;
use function count;
use const SORT_NUMERIC;
class UserHelper
{
@@ -40,4 +42,43 @@ class UserHelper
return $this->userRender->renderString($user, []);
};
}
public function getLabelMulti($key, array $values, string $header): callable
{
return function ($value) {
if ('_header' === $value) {
return 'users name';
}
if (null === $value) {
return '';
}
$decoded = json_decode($value);
if (0 === count($decoded)) {
return '';
}
return
implode(
'|',
array_map(
function (int $userId) {
$user = $this->userRepository->find($userId);
if (null === $user) {
return '';
}
return $this->userRender->renderString($user, []);
},
array_unique(
array_filter($decoded, static fn (?int $userId) => null !== $userId),
SORT_NUMERIC
)
)
);
};
}
}

View File

@@ -97,8 +97,8 @@ class PostalCodeBEFromBestAddress
trim($record['postal_info_objectid']),
$record['municipality_objectid'],
'bestaddress',
$record['Y'],
$record['X'],
(float) $record['Y'],
(float) $record['X'],
3812
);
}

View File

@@ -56,6 +56,12 @@ Until %date%: Jusqu'au %date%
until %date%: jusqu'au %date%
Since: Depuis le
Until: Jusqu'au
updatedAt: Mise à jour le
updatedBy: Mise à jour par
createdAt: Créé le
createdBy: Créé par
#elements used in software
centers: centres
Centers: Centres
@@ -471,8 +477,8 @@ workflow:
Previous workflow transitionned help: Workflows où vous avez exécuté une action.
For: Pour
You must select a next step, pick another decision if no next steps are available: Il faut une prochaine étape. Choissisez une autre décision si nécessaire.
An access key was also sent to those addresses: Un lien d'accès a été envoyé à ces addresses
Those users are also granted to apply a transition by using an access key: Ces utilisateurs ont obtennu l'accès grâce au lien reçu par email
An access key was also sent to those addresses: Un lien d'accès a été envoyé à ces adresses
Those users are also granted to apply a transition by using an access key: Ces utilisateurs ont obtenu l'accès grâce au lien reçu par email
Access link copied: Lien d'accès copié
This link grant any user to apply a transition: Le lien d'accès suivant permet d'appliquer une transition
The workflow may be accssed through this link: Une transition peut être appliquée sur ce workflow grâce au lien d'accès suivant