mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
Merge remote-tracking branch 'origin/fix_issues_juminet' into deploy/quick-fixes
This commit is contained in:
commit
1cddad5c66
@ -132,6 +132,7 @@ class Address
|
||||
/**
|
||||
* True if the address is a "no address", aka homeless person, ...
|
||||
* @groups({"write"})
|
||||
* @ORM\Column(type="boolean")
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@ -298,7 +299,7 @@ class Address
|
||||
* @param bool $isNoAddress
|
||||
* @return $this
|
||||
*/
|
||||
public function setIsNoAddress(bool $isNoAddress)
|
||||
public function setIsNoAddress(bool $isNoAddress): self
|
||||
{
|
||||
$this->isNoAddress = $isNoAddress;
|
||||
return $this;
|
||||
|
@ -14,7 +14,7 @@ class AddressNormalizer implements NormalizerAwareInterface, NormalizerInterface
|
||||
public function normalize($address, string $format = null, array $context = [])
|
||||
{
|
||||
$data['address_id'] = $address->getId();
|
||||
$data['text'] = $address->getStreet().', '.$address->getStreetNumber();
|
||||
$data['text'] = $address->isNoAddress() ? '' : $address->getStreet().', '.$address->getStreetNumber();
|
||||
$data['street'] = $address->getStreet();
|
||||
$data['streetNumber'] = $address->getStreetNumber();
|
||||
$data['postcode']['name'] = $address->getPostCode()->getName();
|
||||
|
@ -7,6 +7,7 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
||||
use Chill\PersonBundle\Privacy\AccompanyingPeriodPrivacyEvent;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepository;
|
||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
@ -35,14 +36,18 @@ class AccompanyingCourseController extends Controller
|
||||
|
||||
protected ValidatorInterface $validator;
|
||||
|
||||
private AccompanyingPeriodWorkRepository $workRepository;
|
||||
|
||||
public function __construct(
|
||||
SerializerInterface $serializer,
|
||||
EventDispatcherInterface $dispatcher,
|
||||
ValidatorInterface $validator
|
||||
ValidatorInterface $validator,
|
||||
AccompanyingPeriodWorkRepository $workRepository
|
||||
) {
|
||||
$this->serializer = $serializer;
|
||||
$this->dispatcher = $dispatcher;
|
||||
$this->validator = $validator;
|
||||
$this->workRepository = $workRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,9 +107,16 @@ class AccompanyingCourseController extends Controller
|
||||
['date' => 'DESC'],
|
||||
);
|
||||
|
||||
$works = $this->workRepository->findByAccompanyingPeriod(
|
||||
$accompanyingCourse,
|
||||
['startDate' => 'DESC', 'endDate' => 'DESC'],
|
||||
3
|
||||
);
|
||||
|
||||
return $this->render('@ChillPerson/AccompanyingCourse/index.html.twig', [
|
||||
'accompanyingCourse' => $accompanyingCourse,
|
||||
'withoutHousehold' => $withoutHousehold,
|
||||
'works' => $works,
|
||||
'activities' => $activities
|
||||
]);
|
||||
}
|
||||
|
@ -75,8 +75,10 @@ class AccompanyingPeriodController extends AbstractController
|
||||
]);
|
||||
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||
|
||||
$accompanyingPeriods = $person->getAccompanyingPeriodsOrdered();
|
||||
|
||||
return $this->render('ChillPersonBundle:AccompanyingPeriod:list.html.twig', [
|
||||
'accompanying_periods' => $person->getAccompanyingPeriodsOrdered(),
|
||||
'accompanying_periods' => $accompanyingPeriods,
|
||||
'person' => $person
|
||||
]);
|
||||
}
|
||||
|
@ -225,11 +225,103 @@
|
||||
|
||||
<h2>{{ 'Social actions'|trans }}</h2>
|
||||
|
||||
{% set person = null %}
|
||||
{% for w in works %}
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<h2 class="action_title">
|
||||
{{ w.socialAction|chill_entity_render_box({ 'no-badge': false }) }}
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="timeline">
|
||||
<ul class="timeline">
|
||||
<li class="completed">
|
||||
<div class="date">
|
||||
<span>{{ w.createdAt|format_date('long') }}</span>
|
||||
</div>
|
||||
<div class="label">
|
||||
<span>{{ 'accompanying_course_work.create_date'|trans }}</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class="completed">
|
||||
<div class="date">
|
||||
<span>{{ w.startDate|format_date('long') }}</span>
|
||||
</div>
|
||||
<div class="label">
|
||||
<span>{{ 'accompanying_course_work.start_date'|trans }}</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class="{%if date(w.endDate) < date('now') %}completed{% endif %}">
|
||||
<div class="date">
|
||||
<span>{{ w.endDate|format_date('long') }}</span>
|
||||
</div>
|
||||
<div class="label">
|
||||
<span>{{ 'accompanying_course_work.end_date'|trans }}</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% if w.results|length > 0 %}
|
||||
<div class="objective_results objective_results__without-objectives">
|
||||
<div class="obj without_objective">
|
||||
<p class="title_label">{{ 'accompanying_course_work.goal'|trans }}</p>
|
||||
<p class="chill-no-data-statement">{{ 'accompanying_course_work.results without objective'|trans }}</p>
|
||||
</div>
|
||||
<div class="res results">
|
||||
<p class="title_label">{{ 'accompanying_course_work.results'|trans }}</p>
|
||||
<ul class="result_list">
|
||||
{% for r in w.results %}
|
||||
<li class="badge badge-primary">{{ r.title|localize_translatable_string }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if w.goals|length > 0 %}
|
||||
{% for g in w.goals %}
|
||||
<div class="objective_results objective_results--with-objectives">
|
||||
<div class="objective obj">
|
||||
<p class="title_label">{{ 'accompanying_course_work.goal'|trans }}</p>
|
||||
<h3 class="goal_title">{{ g.goal.title|localize_translatable_string }}</h3>
|
||||
</div>
|
||||
<div class="results res">
|
||||
{% if g.results|length == 0 %}
|
||||
<p class="title_label">{{ 'accompanying_course_work.results'|trans }}</p>
|
||||
<p class="chill-no-data-statement">{{ 'accompanying_course_work.no_results'|trans }}</p>
|
||||
{% else %}
|
||||
<p class="title_label">{{ 'accompanying_course_work.results'|trans }}</p>
|
||||
<ul class="result_list">
|
||||
{% for r in g.results %}
|
||||
<li class="badge badge-primary">{{ r.title|localize_translatable_string }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<div class="updatedBy">
|
||||
{{ 'Last updated by'|trans}}: {{ w.updatedBy|chill_entity_render_box }}, {{ w.updatedAt|format_datetime('long', 'short') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
{% block contentActivity %}
|
||||
{% set person = null %}
|
||||
{% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'accompanyingCourse', 'context': 'person'} %}
|
||||
{% endblock %}
|
||||
|
||||
{# ==> insert accompanyingCourse vue component #}
|
||||
<div id="accompanying-course"></div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block css %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_link_tags('accompanying_course_work_list') }}
|
||||
{% endblock %}
|
||||
|
@ -8,22 +8,28 @@
|
||||
|
||||
<h1>{{ 'Accompanying period list'|trans }}</h1>
|
||||
|
||||
<table class="rounded">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="chill-red">{{ 'accompanying_period.dates'|trans }}</th>
|
||||
{% if chill_accompanying_periods.fields.user == 'visible' %}
|
||||
<th class="chill-blue">{{ 'Accompanying user'|trans }}</th>
|
||||
{% endif %}
|
||||
<th class="chill-orange">{{ 'Remark'|trans }}</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for accompanying_period in accompanying_periods %}
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<div class="flex-table">
|
||||
<div class="item-bloc">
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
{{'Accompanying period'|trans}} #{{ accompanying_period.id }}
|
||||
</div>
|
||||
|
||||
<div class="item-col">
|
||||
{% if chill_accompanying_periods.fields.user == 'visible' %}
|
||||
{% if accompanying_period.user %}
|
||||
{{ accompanying_period.user.username }}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No accompanying user'|trans }}</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="item-row">
|
||||
{% if accompanying_period.closingDate == null %}
|
||||
{{ 'accompanying_period.dates_from_%opening_date%'|trans({ '%opening_date%': accompanying_period.openingDate|format_date('long') } ) }}
|
||||
{% else %}
|
||||
@ -40,28 +46,38 @@
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if chill_accompanying_periods.fields.user == 'visible' %}
|
||||
<td>
|
||||
{% if accompanying_period.user %}
|
||||
{{ accompanying_period.user.username }}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No accompanying user'|trans }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
{% if accompanying_period is not empty %}
|
||||
<blockquote class="chill-user-quote">
|
||||
{{ accompanying_period.remark|chill_markdown_to_html }}
|
||||
</blockquote>
|
||||
{% else %}
|
||||
{{ null|chill_print_or_message('No remark', 'blockquote') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
</div>
|
||||
<div class="item-row">
|
||||
|
||||
<h3>{{ 'Participants'|trans }}</h3>
|
||||
{% if accompanying_period.participations.count > 0 %}
|
||||
{% for p in accompanying_period.participations %}
|
||||
<p>
|
||||
<a href="{{ path('chill_person_accompanying_period_list', { person_id: p.person.id }) }}">
|
||||
{{ p.person.firstname ~ ' ' ~ p.person.lastname }}
|
||||
</a>
|
||||
</p>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="item-col">
|
||||
<h3>{{ 'Requestors'|trans }}</h3>
|
||||
{% if accompanying_period.requestorPerson is not null or accompanying_period.requestorThirdParty is not null %}
|
||||
{% if accompanying_period.requestorPerson is not null %}
|
||||
<p>{{ accompanying_period.requestorPerson.firstname ~ ' ' ~ accompanying_period.requestorPerson.lastname }}</p>
|
||||
{% endif %}
|
||||
{% if accompanying_period.requestorThirdParty is not null %}
|
||||
<p>{{ accompanying_period.requestorThirdParty.firstname ~ ' ' ~ accompanying_period.requestorThirdParty.lastname }}</p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="item-row">
|
||||
<ul class="record_actions">
|
||||
{# TODO if enable_accompanying_course_with_multiple_persons is true ... #}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': accompanying_period.id }) }}" class="sc-button bt-show"></a>
|
||||
@ -85,12 +101,13 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</div>
|
||||
</div>
|
||||
<p></p>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<div class="form_control">
|
||||
<ul class="record_actions">
|
||||
|
@ -46,6 +46,7 @@ services:
|
||||
$serializer: '@Symfony\Component\Serializer\SerializerInterface'
|
||||
$dispatcher: '@Symfony\Contracts\EventDispatcher\EventDispatcherInterface'
|
||||
$validator: '@Symfony\Component\Validator\Validator\ValidatorInterface'
|
||||
$workRepository: '@Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepository'
|
||||
tags: ['controller.service_arguments']
|
||||
|
||||
Chill\PersonBundle\Controller\AccompanyingCourseApiController:
|
||||
|
@ -165,6 +165,7 @@ An accompanying period starts: Une période d'accompagnement est ouverte
|
||||
Any accompanying periods are open: Aucune période d'accompagnement ouverte
|
||||
An accompanying period is open: Une période d'accompagnement est ouverte
|
||||
Accompanying period list: Périodes d'accompagnement
|
||||
Accompanying period: Période d'accompagnement
|
||||
New accompanying course: Nouveau parcours d'accompagnement
|
||||
Choose a motive: Motif de fermeture
|
||||
Re-open accompanying period: Ré-ouvrir
|
||||
|
Loading…
x
Reference in New Issue
Block a user