merge master into branch

This commit is contained in:
Julie Lenaerts 2022-03-21 10:21:59 +01:00
commit 5a8291dc87
17 changed files with 85 additions and 30 deletions

View File

@ -11,6 +11,7 @@ and this project adheres to
## Unreleased ## Unreleased
<!-- write down unreleased development here --> <!-- write down unreleased development here -->
* [person] AccompanyingPeriodWorkEvaluation: fix circular reference when serialising (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/495)
* [person] order accompanying period by opening date in search persons, person and household period lists (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/493) * [person] order accompanying period by opening date in search persons, person and household period lists (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/493)
* [parcours] autosave of the pinned comment for draft accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/477) * [parcours] autosave of the pinned comment for draft accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/477)
* [main] filter user job in undispatch acc period to assign (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/472) * [main] filter user job in undispatch acc period to assign (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/472)
@ -46,6 +47,8 @@ and this project adheres to
* [household] create-edit household composition placed in separate page to avoid confusion (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/505) * [household] create-edit household composition placed in separate page to avoid confusion (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/505)
* [blur] Improved positioning of toggle icon (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/486) * [blur] Improved positioning of toggle icon (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/486)
* [parcours] List of parcours for a specific user so they can be reassigned in case of absence (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/509) * [parcours] List of parcours for a specific user so they can be reassigned in case of absence (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/509)
* [thirdparty] Thirdparty view page, english text translated (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/534)
* [social_action] Translation changed in evaluation section (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/512)
## Test releases ## Test releases

View File

@ -46,7 +46,7 @@
{% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'person'} %} {% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'person'} %}
{% if is_granted('CHILL_ACTIVITY_CREATE', person) %} {% if is_granted('CHILL_ACTIVITY_CREATE_PERSON', person) %}
<ul class="record_actions sticky-form-buttons"> <ul class="record_actions sticky-form-buttons">
<li> <li>
<a href="{{ path('chill_activity_activity_new', {'person_id': person_id, 'accompanying_period_id': accompanying_course_id}) }}" <a href="{{ path('chill_activity_activity_new', {'person_id': person_id, 'accompanying_period_id': accompanying_course_id}) }}"

View File

@ -118,6 +118,13 @@ class LoadPostalCodesCommand extends Command
private function addPostalCode($row, OutputInterface $output) private function addPostalCode($row, OutputInterface $output)
{ {
if($row[2] == 'FR' && strlen($row[0]) == 4) {
// CP in FRANCE are on 5 digit
// For CP starting with a zero, the starting zero can be remove if stored as number in a csv
// add a zero if CP from FR and on 4 digit
$row[0] = '0'.$row[0];
}
if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
$output->writeln('handling row: ' . $row[0] . ' | ' . $row[1] . ' | ' . $row[2]); $output->writeln('handling row: ' . $row[0] . ' | ' . $row[1] . ' | ' . $row[2]);
} }

View File

@ -40,6 +40,7 @@ class UserJob
* @var array|string[]A * @var array|string[]A
* @ORM\Column(name="label", type="json") * @ORM\Column(name="label", type="json")
* @Serializer\Groups({"read", "docgen:read"}) * @Serializer\Groups({"read", "docgen:read"})
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/ */
protected array $label = []; protected array $label = [];

View File

@ -42,9 +42,6 @@
<a class="btn btn-sm btn-show" :href="getUrl(e)"> <a class="btn btn-sm btn-show" :href="getUrl(e)">
{{ $t('show_entity', { entity: $t('the_evaluation') }) }} {{ $t('show_entity', { entity: $t('the_evaluation') }) }}
</a> </a>
<a class="btn btn-sm btn-update" :href="getUrl(e.accompanyingPeriodWork)">
{{ $t('show_entity', { entity: $t('the_action') }) }}
</a>
<a class="btn btn-sm btn-show" :href="getUrl(e.accompanyingPeriodWork.accompanyingPeriod)"> <a class="btn btn-sm btn-show" :href="getUrl(e.accompanyingPeriodWork.accompanyingPeriod)">
{{ $t('show_entity', { entity: $t('the_course') }) }} {{ $t('show_entity', { entity: $t('the_course') }) }}
</a> </a>
@ -102,4 +99,4 @@ export default {
<style scoped> <style scoped>
</style> </style>

View File

@ -16,10 +16,11 @@ use libphonenumber\PhoneNumber;
use libphonenumber\PhoneNumberUtil; use libphonenumber\PhoneNumberUtil;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Serializer\Exception\UnexpectedValueException; use Symfony\Component\Serializer\Exception\UnexpectedValueException;
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
class PhonenumberNormalizer implements NormalizerInterface, DenormalizerInterface class PhonenumberNormalizer implements ContextAwareNormalizerInterface, DenormalizerInterface
{ {
private string $defaultCarrierCode; private string $defaultCarrierCode;
@ -53,6 +54,10 @@ class PhonenumberNormalizer implements NormalizerInterface, DenormalizerInterfac
public function normalize($object, ?string $format = null, array $context = []): string public function normalize($object, ?string $format = null, array $context = []): string
{ {
if ($format === 'docgen' && null === $object) {
return '';
}
return $this->phoneNumberUtil->formatOutOfCountryCallingNumber($object, $this->defaultCarrierCode); return $this->phoneNumberUtil->formatOutOfCountryCallingNumber($object, $this->defaultCarrierCode);
} }
@ -61,8 +66,18 @@ class PhonenumberNormalizer implements NormalizerInterface, DenormalizerInterfac
return 'libphonenumber\PhoneNumber' === $type; return 'libphonenumber\PhoneNumber' === $type;
} }
public function supportsNormalization($data, ?string $format = null) public function supportsNormalization($data, ?string $format = null, array $context = []): bool
{ {
return $data instanceof PhoneNumber; if ($data instanceof PhoneNumber && $format === 'json') {
return true;
}
if ($format === 'docgen' && (
$data instanceof PhoneNumber || PhoneNumber::class === ($context['docgen:expects'] ?? null)
)) {
return true;
}
return false;
} }
} }

View File

@ -124,6 +124,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
/** /**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null}) * @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
* @Serializer\Groups({"read", "docgen:read"}) * @Serializer\Groups({"read", "docgen:read"})
* @Serializer\Groups({"write"})
* @Serializer\Groups({"accompanying_period_work_evaluation:create"}) * @Serializer\Groups({"accompanying_period_work_evaluation:create"})
*/ */
private ?DateTimeImmutable $maxDate = null; private ?DateTimeImmutable $maxDate = null;

View File

@ -68,12 +68,14 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
} }
if ($this->security->isGranted(AccompanyingPeriodVoter::SEE_DETAILS, $period)) { if ($this->security->isGranted(AccompanyingPeriodVoter::SEE_DETAILS, $period)) {
$menu->addChild($this->translator->trans('Accompanying Course History'), [ /*
'route' => 'chill_person_accompanying_course_history', $menu->addChild($this->translator->trans('Accompanying Course History'), [
'routeParameters' => [ 'route' => 'chill_person_accompanying_course_history',
'accompanying_period_id' => $period->getId(), 'routeParameters' => [
], ]) 'accompanying_period_id' => $period->getId(),
->setExtras(['order' => 30]); ], ])
->setExtras(['order' => 30]);
*/
$menu->addChild($this->translator->trans('Accompanying Course Comment'), [ $menu->addChild($this->translator->trans('Accompanying Course Comment'), [
'route' => 'chill_person_accompanying_period_comment_list', 'route' => 'chill_person_accompanying_period_comment_list',

View File

@ -319,7 +319,7 @@ const i18n = {
add_thirdparties: "Ajouter des tiers", add_thirdparties: "Ajouter des tiers",
choose_thirdparties: "Choisir des tiers", choose_thirdparties: "Choisir des tiers",
fix_these_errors: "Veuillez corriger les erreurs suivantes :", fix_these_errors: "Veuillez corriger les erreurs suivantes :",
available_evaluations_text: "Évaluations disponibles pour ajout :", available_evaluations_text: "Documents disponibles pour ajout :",
no_evaluations_available: "Aucune évaluation disponible", no_evaluations_available: "Aucune évaluation disponible",
no_goals_available: "Aucun objectif disponible", no_goals_available: "Aucun objectif disponible",
} }

View File

@ -70,7 +70,7 @@
<div class="input-group input-group-lg mb-3"> <div class="input-group input-group-lg mb-3">
<div> <div>
<input <input
class="form-control form-control-lg" class="form-control"
style="font-weight: bold;" style="font-weight: bold;"
type="text" type="text"
:value="d.title" :value="d.title"

View File

@ -1,5 +1,10 @@
{%- import "@ChillDocStore/Macro/macro.html.twig" as m -%}
<div class="flex-table accompanying_course_work-list"> <div class="flex-table accompanying_course_work-list">
<div class="item-bloc evaluation-item bg-chill-llight-gray"> <div class="item-bloc evaluation-item bg-chill-llight-gray">
<div class="item-row mb-2">
<h1>{{ doc.title }}</h1>
</div>
<div class="item-row mb-2"> <div class="item-row mb-2">
<h2 class="badge-title"> <h2 class="badge-title">
<span class="title_label"></span> <span class="title_label"></span>
@ -20,6 +25,24 @@
</span> </span>
</h2> </h2>
</div> </div>
<div class="item-row mb-2">
<div class="item-col" style="width: 17%;">
<h4 class="title_label">
{{ 'Participants'|trans }}
</h4>
</div>
<div class="item-col list">
{% for p in evaluation.accompanyingPeriodWork.persons %}
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
targetEntity: { name: 'person', id: p.id },
action: 'show',
displayBadge: true,
buttonText: p|chill_entity_render_string,
isDead: p.deathdate is not null
} %}
{% endfor %}
</div>
</div>
<div class="item-row column"> <div class="item-row column">
<table class="obj-res-eval my-3" style="font-size: 110% !important;"> <table class="obj-res-eval my-3" style="font-size: 110% !important;">
<thead> <thead>
@ -92,12 +115,19 @@
</div> </div>
{% if display_action is defined and display_action == true %} {% if display_action is defined and display_action == true %}
{# TODO add acl #} {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', evaluation.accompanyingPeriodWork) %}
<ul class="record_actions"> <ul class="record_actions">
<li>{{ m.download_button(doc.storedObject, doc.title) }}</li>
{% if chill_document_is_editable(doc.storedObject) %}
<li>
{{ doc.storedObject|chill_document_edit_button }}
</li>
{% endif %}
<li> <li>
<a class="btn btn-show" href="{{ path('chill_person_accompanying_period_work_edit', {'id': evaluation.accompanyingPeriodWork.id}) }}"> <a class="btn btn-show" href="{{ path('chill_person_accompanying_period_work_edit', {'id': evaluation.accompanyingPeriodWork.id}) }}">
{{ 'Show'|trans }} {{ 'Show'|trans }}
</a> </a>
</li> </li>
</ul> </ul>
{% endif %}
{% endif %} {% endif %}

View File

@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Serializer\Normalizer;
use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository; use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository;
use Chill\MainBundle\Workflow\Helper\MetadataExtractor; use Chill\MainBundle\Workflow\Helper\MetadataExtractor;
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation; use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation;
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface; use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
@ -46,7 +47,10 @@ class AccompanyingPeriodWorkEvaluationNormalizer implements ContextAwareNormaliz
{ {
$initial = $this->normalizer->normalize($object, $format, array_merge( $initial = $this->normalizer->normalize($object, $format, array_merge(
$context, $context,
[self::IGNORE_EVALUATION => spl_object_hash($object)] [self::IGNORE_EVALUATION => spl_object_hash($object)],
[AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER => static function ($object, $format, $context) {
return $object->getId();
}]
)); ));
// due to bug: https://api-platform.com/docs/core/serialization/#collection-relation // due to bug: https://api-platform.com/docs/core/serialization/#collection-relation

View File

@ -61,8 +61,8 @@ class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityW
return $this->translator->trans( return $this->translator->trans(
'workflow.Doc for evaluation (n°%eval%)', 'workflow.Doc for evaluation (n°%eval%)',
['%eval%' => $entityWorkflow->getRelatedEntityId()] ['%eval%' => $entityWorkflow->getRelatedEntityId()]
) . ' - ' . $this->translatableStringHelper->localize($doc->getAccompanyingPeriodWorkEvaluation() ) . ' (' . $this->translatableStringHelper->localize($doc->getAccompanyingPeriodWorkEvaluation()
->getEvaluation()->getTitle()); ->getEvaluation()->getTitle()).') '.$doc->getTitle();
} }
public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?AccompanyingPeriodWorkEvaluationDocument public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?AccompanyingPeriodWorkEvaluationDocument

View File

@ -95,11 +95,6 @@ chill_person_address_update:
chill_person_timeline: chill_person_timeline:
path: /{_locale}/person/{person_id}/timeline path: /{_locale}/person/{person_id}/timeline
controller: Chill\PersonBundle\Controller\TimelinePersonController::personAction controller: Chill\PersonBundle\Controller\TimelinePersonController::personAction
options:
menus:
person:
order: 60
label: Timeline
chill_person_admin: chill_person_admin:
path: "/{_locale}/admin/person" path: "/{_locale}/admin/person"

View File

@ -60,7 +60,7 @@
{% if types|length > 0 %} {% if types|length > 0 %}
{{ types|join(', ') }} {{ types|join(', ') }}
{% else %} {% else %}
<p class="chill-no-data-statement">{{ 'thirdParty.Any categories' }}</p> <p class="chill-no-data-statement">{{ 'thirdparty.no_categories' }}</p>
{% endif %} {% endif %}
</dd> </dd>
@ -110,7 +110,7 @@
<dt>{{ 'Contacts'|trans }}</dt> <dt>{{ 'Contacts'|trans }}</dt>
<dd> <dd>
{% if thirdParty.activeChildren|length == 0 %} {% if thirdParty.activeChildren|length == 0 %}
<p class="chill-no-data-statement">{{ 'Any contacts associated'|trans }}</p> <p class="chill-no-data-statement">{{ 'No contacts associated'|trans }}</p>
{% else %} {% else %}
<div class="flex-table"> <div class="flex-table">
{% for tp in thirdParty.activeChildren %} {% for tp in thirdParty.activeChildren %}

View File

@ -63,13 +63,13 @@ Show thirdparty: Voir le tiers
Add a contact: Ajouter un contact Add a contact: Ajouter un contact
Remove a contact: Supprimer Remove a contact: Supprimer
Contacts: Contacts Contacts: Contacts
Any contact: Aucun contact No contacts associated: Aucun contact
No nameCompany given: Aucune raison sociale renseignée No nameCompany given: Aucune raison sociale renseignée
No acronym given: Aucun sigle renseigné No acronym given: Aucun sigle renseigné
No phone given: Aucun téléphone renseigné No phone given: Aucun téléphone renseigné
No email given: Aucune adresse courriel renseignée No email given: Aucune adresse courriel renseignée
thirdparty.Any categories: Aucune catégorie thirdparty.no_categories: Aucune catégorie
The party is visible in those centers: Le tiers est visible dans ces centres The party is visible in those centers: Le tiers est visible dans ces centres
The party is not visible in any center: Le tiers n'est associé à aucun centre The party is not visible in any center: Le tiers n'est associé à aucun centre

View File

@ -14,7 +14,7 @@ window.addEventListener('DOMContentLoaded', function(e) {
office_frame.setAttribute('allowfullscreen', 'true'); office_frame.setAttribute('allowfullscreen', 'true');
// The sandbox attribute is needed to allow automatic redirection to the O365 sign-in page in the business user flow // The sandbox attribute is needed to allow automatic redirection to the O365 sign-in page in the business user flow
office_frame.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms allow-popups allow-top-navigation allow-popups-to-escape-sandbox'); office_frame.setAttribute('sandbox', 'allow-downloads allow-scripts allow-same-origin allow-forms allow-popups allow-top-navigation allow-popups-to-escape-sandbox');
frameholder.appendChild(office_frame); frameholder.appendChild(office_frame);
document.getElementById('office_form').submit(); document.getElementById('office_form').submit();