mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Merge branch 'master' into 232_resources_comment
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\AccompanyingPeriod\Workflow;
|
||||
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Templating\EngineInterface;
|
||||
use Symfony\Component\Workflow\Event\EnteredEvent;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class WorkflowEventSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
private EngineInterface $engine;
|
||||
|
||||
private Security $security;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
public function __construct(Security $security, TranslatorInterface $translator, EngineInterface $engine, EntityManagerInterface $em)
|
||||
{
|
||||
$this->security = $security;
|
||||
$this->translator = $translator;
|
||||
$this->engine = $engine;
|
||||
$this->em = $em;
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return [
|
||||
'workflow.accompanying_period_lifecycle.entered' => [
|
||||
'onStateEntered',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function onStateEntered(EnteredEvent $enteredEvent): void
|
||||
{
|
||||
if ($enteredEvent->getMarking()->has(AccompanyingPeriod::STEP_CONFIRMED)) {
|
||||
$this->onPeriodConfirmed($enteredEvent->getSubject());
|
||||
}
|
||||
}
|
||||
|
||||
private function onPeriodConfirmed(AccompanyingPeriod $period)
|
||||
{
|
||||
if ($period->getUser() instanceof User
|
||||
&& $period->getUser() !== $this->security->getUser()) {
|
||||
$notification = new Notification();
|
||||
$notification
|
||||
->setRelatedEntityId($period->getId())
|
||||
->setRelatedEntityClass(AccompanyingPeriod::class)
|
||||
->setTitle($this->translator->trans('period_notification.period_designated_subject'))
|
||||
->setMessage($this->engine->render(
|
||||
'@ChillPerson/Notification/accompanying_course_designation.md.twig',
|
||||
[
|
||||
'accompanyingCourse' => $period,
|
||||
]
|
||||
))
|
||||
->addAddressee($period->getUser());
|
||||
$this->em->persist($notification);
|
||||
}
|
||||
}
|
||||
}
|
@@ -33,7 +33,7 @@ class LoadHouseholdPosition extends Fixture
|
||||
{
|
||||
foreach (
|
||||
self::POSITIONS_DATA as [$name, $share, $allowHolder,
|
||||
$ordering, $ref, ]
|
||||
$ordering, $ref, ]
|
||||
) {
|
||||
$position = (new Position())
|
||||
->setLabel(['fr' => $name])
|
||||
|
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Notification;
|
||||
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
use Chill\MainBundle\Notification\NotificationHandlerInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
|
||||
|
||||
final class AccompanyingPeriodNotificationHandler implements NotificationHandlerInterface
|
||||
{
|
||||
private AccompanyingPeriodRepository $accompanyingPeriodRepository;
|
||||
|
||||
public function __construct(AccompanyingPeriodRepository $accompanyingPeriodRepository)
|
||||
{
|
||||
$this->accompanyingPeriodRepository = $accompanyingPeriodRepository;
|
||||
}
|
||||
|
||||
public function getTemplate(Notification $notification, array $options = []): string
|
||||
{
|
||||
return 'ChillPersonBundle:AccompanyingPeriod:showInNotification.html.twig';
|
||||
}
|
||||
|
||||
public function getTemplateData(Notification $notification, array $options = []): array
|
||||
{
|
||||
return [
|
||||
'notification' => $notification,
|
||||
'period' => $this->accompanyingPeriodRepository->find($notification->getRelatedEntityId()),
|
||||
];
|
||||
}
|
||||
|
||||
public function supports(Notification $notification, array $options = []): bool
|
||||
{
|
||||
return $notification->getRelatedEntityClass() === AccompanyingPeriod::class;
|
||||
}
|
||||
}
|
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Notification;
|
||||
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
|
||||
final class AccompanyingPeriodNotificationRenderer
|
||||
{
|
||||
public function getTemplate()
|
||||
{
|
||||
return 'ChillPersonBundle:AccompanyingPeriod:showInNotification.html.twig';
|
||||
}
|
||||
|
||||
public function getTemplateData(Notification $notification)
|
||||
{
|
||||
return ['notification' => $notification];
|
||||
}
|
||||
|
||||
public function supports(Notification $notification)
|
||||
{
|
||||
return $notification->getRelatedEntityClass() === AccompanyingPeriod::class;
|
||||
}
|
||||
}
|
@@ -259,9 +259,9 @@ abbr.referrer { // still used ?
|
||||
div#dashboards {
|
||||
div.mbloc {
|
||||
& > div:not(.warnings) {
|
||||
border: 1px solid $chill-light-gray;
|
||||
//border: 1px solid $chill-light-gray;
|
||||
//border-radius: 0.35rem;
|
||||
background-color: $chill-llight-gray;
|
||||
border-radius: 0.35rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
& > div.warnings .alert {
|
||||
|
@@ -20,6 +20,11 @@ span.badge-thirdparty {
|
||||
|
||||
span.badge-user {
|
||||
border-bottom-width: 1px;
|
||||
&.system {
|
||||
background-color: $chill-llight-gray;
|
||||
font-style: italic;
|
||||
color: $chill-gray;
|
||||
}
|
||||
}
|
||||
span.badge-person {
|
||||
border-bottom-color: $chill-green;
|
||||
|
@@ -81,6 +81,7 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% if form is not null %}
|
||||
<div class="new-comment my-5">
|
||||
<h2 class="chill-blue">{{ 'Write a new comment'|trans }}</h2>
|
||||
|
@@ -13,14 +13,19 @@
|
||||
{% endmacro %}
|
||||
|
||||
{% block js %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_script_tags('page_accompanying_course_index_person_locate') }}
|
||||
{{ encore_entry_script_tags('page_accompanying_course_index_masonry') }}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_script_tags('page_accompanying_course_index_person_locate') }}
|
||||
{{ encore_entry_script_tags('page_accompanying_course_index_masonry') }}
|
||||
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="accompanyingcourse-resume">
|
||||
|
||||
<div id="dashboards" class="row g-3" data-masonry='{"percentPosition": true }'>
|
||||
|
||||
{% if 'DRAFT' == accompanyingCourse.step %}
|
||||
@@ -186,3 +191,18 @@
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block block_post_menu %}
|
||||
<div class="post-menu pt-4">
|
||||
|
||||
<div class="d-grid gap-2">
|
||||
<a class="btn btn-primary" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod', 'entityId': accompanyingCourse.id}) }}">
|
||||
<i class="fa fa-paper-plane fa-fw"></i>
|
||||
{{ 'notification.Notify'|trans }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{ chill_list_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', accompanyingCourse.id) }}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@@ -1,170 +1,60 @@
|
||||
{% if person is defined %}
|
||||
{% set contextEntity = { 'type': 'person', 'entity': person } %}{% endif %}
|
||||
{% if household is defined %}
|
||||
{% set contextEntity = { 'type': 'household', 'entity': household } %}{% endif %}
|
||||
|
||||
{% macro recordAction(period, contextEntity) %}
|
||||
{# TODO if enable_accompanying_course_with_multiple_persons is true ... #}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': period.id }) }}"
|
||||
class="btn btn-show" title="{{ 'See accompanying period'|trans }}">{# {{ 'See this period'|trans }} #}</a>
|
||||
</li>
|
||||
{% if period.step == 'DRAFT' and contextEntity.type == 'person' %}
|
||||
{% set person = contextEntity.entity %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_course_delete', { 'accompanying_period_id': period.id, 'person_id' : person.id }) }}"
|
||||
class="btn btn-delete" title="{{ 'Delete accompanying period'|trans }}">{# {{ 'Delete this period'|trans }} #}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{# DISABLED if new accompanying course, this is not necessary
|
||||
{% if person is defined %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_period_update', {'person_id' : person.id, 'period_id' : period.id } ) }}"
|
||||
class="btn btn-update" title="{{ 'Edit accompanying period'|trans }}"></a>
|
||||
</li>
|
||||
{% if period.isOpen == true %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_period_close', {'person_id' : person.id}) }}"
|
||||
class="btn btn-update change-icon">
|
||||
<i class="fa fa-fw fa-lock" aria-hidden="true"></i>
|
||||
{{'Close accompanying period'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if period.canBeReOpened(person) == true %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_period_re_open', {'person_id' : person.id, 'period_id' : period.id } ) }}"
|
||||
class="btn btn-create change-icon">
|
||||
<i class="fa fa-fw fa-unlock" aria-hidden="true"></i>
|
||||
{{'Re-open accompanying period'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% elseif household is defined %}
|
||||
TODO buttons specific for household ?
|
||||
{% endif %}
|
||||
#}
|
||||
{% endmacro %}
|
||||
|
||||
{% block content %}
|
||||
<div class="flex-table accompanyingcourse-list">
|
||||
{% for accompanying_period in accompanying_periods %}
|
||||
<div class="item-bloc">
|
||||
<div class="item-row">
|
||||
<div class="wrap-header">
|
||||
<div class="wh-row">
|
||||
<div class="wh-col">
|
||||
<span class="h3">
|
||||
<i class="fa fa-fw fa-random"></i>
|
||||
<b>{{ accompanying_period.id }}</b>
|
||||
</span>
|
||||
{% if accompanying_period.emergency %}
|
||||
<span class="badge rounded-pill bg-danger">{{- 'Emergency'|trans|upper -}}</span>
|
||||
{% endif %}
|
||||
{% if accompanying_period.confidential %}
|
||||
<span class="badge rounded-pill bg-danger">{{- 'Confidential'|trans|upper -}}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="wh-col">
|
||||
{% if accompanying_period.step == 'DRAFT' %}
|
||||
<span class="badge bg-secondary">{{- 'Draft'|trans|upper -}}</span>
|
||||
{% elseif accompanying_period.step == 'CONFIRMED' %}
|
||||
<span class="badge bg-primary">{{- 'Confirmed'|trans|upper -}}</span>
|
||||
{% else %}
|
||||
<span class="badge bg-primary">{{- 'Closed'|trans|upper -}}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="wh-row">
|
||||
<div class="wh-col">
|
||||
{% if accompanying_period.closingDate == null %}
|
||||
{{ 'accompanying_period.dates_from_%opening_date%'|trans({ '%opening_date%': accompanying_period.openingDate|format_date('long') } ) }}
|
||||
{% else %}
|
||||
{{ 'accompanying_period.dates_from_%opening_date%_to_%closing_date%'|trans({
|
||||
'%opening_date%': accompanying_period.openingDate|format_date('long'),
|
||||
'%closing_date%': accompanying_period.closingDate|format_date('long')}
|
||||
) }}
|
||||
{% if accompanying_period.isOpen == false %}
|
||||
<dl class="chill_view_data">
|
||||
<dt>{{ 'Closing motive'|trans }} :</dt>
|
||||
<dd>{{ accompanying_period.closingMotive|chill_entity_render_box }}</dd>
|
||||
</dl>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="wh-col">
|
||||
{% if chill_accompanying_periods.fields.user == 'visible' %}
|
||||
{% if accompanying_period.user %}
|
||||
<abbr class="referrer" title="{{ 'Referrer'|trans }}">ref:</abbr>
|
||||
{{ accompanying_period.user.username|chill_entity_render_box }}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No accompanying user'|trans }}</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% for period in accompanying_periods %}
|
||||
|
||||
</div>
|
||||
<div class="item-row separator">
|
||||
<div class="wrap-list">
|
||||
{% if accompanying_period.requestorPerson is not null or accompanying_period.requestorThirdParty is not null %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title"><h3>{{ 'Requestor'|trans({'gender': null }) }}</h3></div>
|
||||
<div class="wl-col list">
|
||||
{% if accompanying_period.requestorPerson is not null %}
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'person', id: accompanying_period.requestorPerson.id },
|
||||
buttonText: accompanying_period.requestorPerson|chill_entity_render_string
|
||||
} %}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if accompanying_period.requestorThirdParty is not null %}
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'thirdparty', id: accompanying_period.requestorThirdParty.id },
|
||||
buttonText: accompanying_period.requestorThirdParty|chill_entity_render_string
|
||||
} %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% include 'ChillPersonBundle:AccompanyingPeriod:_list_item.html.twig' with {
|
||||
'recordAction': _self.recordAction(period, contextEntity)
|
||||
} %}
|
||||
|
||||
{% if accompanying_period.participations.count > 0 %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title"><h3>{{ 'Participants'|trans }}</h3></div>
|
||||
<div class="wl-col list">
|
||||
{% for p in accompanying_period.getCurrentParticipations %}
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'person', id: p.person.id },
|
||||
buttonText: p.person|chill_entity_render_string
|
||||
} %}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if accompanying_period.socialIssues.count > 0 %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title"><h3>{{ 'Social issues'|trans }}</h3></div>
|
||||
<div class="wl-col list">
|
||||
{% for si in accompanying_period.socialIssues %}
|
||||
<p class="wl-item">
|
||||
{{ si|chill_entity_render_box }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="item-row separator">
|
||||
|
||||
<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="btn btn-show" title="{{ 'See accompanying period'|trans }}">{# {{ 'See this period'|trans }} #}</a>
|
||||
</li>
|
||||
{% if accompanying_period.step == 'DRAFT' %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_course_delete', { 'accompanying_period_id': accompanying_period.id, 'person_id' : person.id }) }}"
|
||||
class="btn btn-delete" title="{{ 'Delete accompanying period'|trans }}">{# {{ 'Delete this period'|trans }} #}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
<!-- if new accompanying course, this is not necessary
|
||||
{% if person is defined %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_period_update', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}"
|
||||
class="btn btn-update" title="{{ 'Edit accompanying period'|trans }}"></a>
|
||||
</li>
|
||||
{% if accompanying_period.isOpen == true %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_period_close', {'person_id' : person.id}) }}"
|
||||
class="btn btn-update change-icon">
|
||||
<i class="fa fa-fw fa-lock" aria-hidden="true"></i>
|
||||
{{'Close accompanying period'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if accompanying_period.canBeReOpened(person) == true %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_period_re_open', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}"
|
||||
class="btn btn-create change-icon">
|
||||
<i class="fa fa-fw fa-unlock" aria-hidden="true"></i>
|
||||
{{'Re-open accompanying period'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% elseif household is defined %}
|
||||
{# TODO buttons specific for household ? #}
|
||||
{% endif %}
|
||||
-->
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
@@ -0,0 +1,121 @@
|
||||
<div class="item-bloc accompanying-period-item{% if itemBlocClass is defined %} {{ itemBlocClass }}{% endif %}">
|
||||
<div class="item-row">
|
||||
<div class="wrap-header">
|
||||
<div class="wh-row">
|
||||
<div class="wh-col">
|
||||
<span class="h3">
|
||||
<i class="fa fa-fw fa-random"></i>
|
||||
<b>{{ period.id }}</b>
|
||||
</span>
|
||||
{% if period.emergency %}
|
||||
<span class="badge rounded-pill bg-danger">{{- 'Emergency'|trans|upper -}}</span>
|
||||
{% endif %}
|
||||
{% if period.confidential %}
|
||||
<span class="badge rounded-pill bg-danger">{{- 'Confidential'|trans|upper -}}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="wh-col">
|
||||
{% if period.step == 'DRAFT' %}
|
||||
<span class="badge bg-secondary">{{- 'Draft'|trans|upper -}}</span>
|
||||
{% elseif period.step == 'CONFIRMED' %}
|
||||
<span class="badge bg-primary">{{- 'Confirmed'|trans|upper -}}</span>
|
||||
{% else %}
|
||||
<span class="badge bg-primary">{{- 'Closed'|trans|upper -}}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="wh-row">
|
||||
<div class="wh-col">
|
||||
{% if period.closingDate == null %}
|
||||
{{ 'accompanying_period.dates_from_%opening_date%'|trans({ '%opening_date%': period.openingDate|format_date('long') } ) }}
|
||||
{% else %}
|
||||
{{ 'accompanying_period.dates_from_%opening_date%_to_%closing_date%'|trans({
|
||||
'%opening_date%': period.openingDate|format_date('long'),
|
||||
'%closing_date%': period.closingDate|format_date('long')}
|
||||
) }}
|
||||
{% if period.isOpen == false %}
|
||||
<dl class="chill_view_data">
|
||||
<dt>{{ 'Closing motive'|trans }} :</dt>
|
||||
<dd>{{ period.closingMotive|chill_entity_render_box }}</dd>
|
||||
</dl>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="wh-col">
|
||||
{% if chill_accompanying_periods.fields.user == 'visible' %}
|
||||
{% if period.user %}
|
||||
<abbr class="referrer" title="{{ 'Referrer'|trans }}">{{ 'Referrer'|trans }}:</abbr>
|
||||
{{ period.user.username|chill_entity_render_box }}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No accompanying user'|trans }}</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-row separator">
|
||||
<div class="wrap-list">
|
||||
{% if period.requestorPerson is not null or period.requestorThirdParty is not null %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title"><h3>{{ 'Requestor'|trans({'gender': null }) }}</h3></div>
|
||||
<div class="wl-col list">
|
||||
{% if period.requestorPerson is not null %}
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'person', id: period.requestorPerson.id },
|
||||
buttonText: period.requestorPerson|chill_entity_render_string
|
||||
} %}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if period.requestorThirdParty is not null %}
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'thirdparty', id: period.requestorThirdParty.id },
|
||||
buttonText: period.requestorThirdParty|chill_entity_render_string
|
||||
} %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if period.participations.count > 0 %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title"><h3>{{ 'Participants'|trans }}</h3></div>
|
||||
<div class="wl-col list">
|
||||
{% for p in period.getCurrentParticipations %}
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'person', id: p.person.id },
|
||||
buttonText: p.person|chill_entity_render_string
|
||||
} %}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if period.socialIssues.count > 0 %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title"><h3>{{ 'Social issues'|trans }}</h3></div>
|
||||
<div class="wl-col list">
|
||||
{% for si in period.socialIssues %}
|
||||
<p class="wl-item">
|
||||
{{ si|chill_entity_render_box }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if recordAction is defined %}
|
||||
<div class="item-row separator">
|
||||
<ul class="record_actions">
|
||||
{{ recordAction }}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
@@ -1,3 +1,26 @@
|
||||
<a href="{{ path('chill_person_accompanying_course_index', {'accompanying_period_id': notification.relatedEntityId }) }}">
|
||||
Go to Acc. period.
|
||||
</a>
|
||||
{% macro recordAction(period) %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': period }) }}"
|
||||
class="btn btn-show" title="{{ 'See accompanying period'|trans }}"></a>
|
||||
</li>
|
||||
{% endmacro %}
|
||||
|
||||
{% if period is not null %}
|
||||
<div class="flex-table">
|
||||
{% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', period) %}
|
||||
{% include 'ChillPersonBundle:AccompanyingPeriod:_list_item.html.twig' with {
|
||||
'recordAction': _self.recordAction(notification.relatedEntityId),
|
||||
'itemBlocClass': 'bg-chill-llight-gray'
|
||||
} %}
|
||||
{% else %}
|
||||
<div class="alert alert-warning border-warning border-1">
|
||||
{{ 'This is the minimal period details'|trans ~ ': ' ~ period.id }}<br>
|
||||
{{ 'You are getting a notification for a period you are not allowed to see'|trans }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-warning border-warning border-1">
|
||||
{{ 'You are getting a notification for a period which does not exists any more'|trans }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
{% block title 'household.Household summary'|trans %}
|
||||
|
||||
{% block block_post_menu %}
|
||||
<div class="block-post-menu"></div>
|
||||
<div class="post-menu"></div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
@@ -0,0 +1,14 @@
|
||||
{{ 'period_notification.You are designated to a new period'|trans }}
|
||||
|
||||
{{ 'period_notification.See it online'|trans }}:
|
||||
|
||||
{{ absolute_url(path('chill_person_accompanying_course_index', {'accompanying_period_id': accompanyingCourse.id}, false)) }}
|
||||
|
||||
{{ 'period_notification.Persons are'|trans }}:
|
||||
|
||||
{% for p in accompanyingCourse.getCurrentParticipations %}
|
||||
* {{ p.person|chill_entity_render_string }}
|
||||
{% endfor %}
|
||||
|
||||
{{ 'period_notification.Social issues are'|trans }}: {% for s in accompanyingCourse.socialIssues %}{{ s|chill_entity_render_string }}{% if not loop.last %}, {% endif %}{% endfor %}.
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{#
|
||||
* Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS,
|
||||
* Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS,
|
||||
<info@champs-libres.coop> / <http://www.champs-libres.coop>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -38,7 +38,7 @@
|
||||
}) }}
|
||||
|
||||
{% block block_post_menu %}
|
||||
<div class="block-post-menu">
|
||||
<div class="post-menu">
|
||||
{{ chill_delegated_block('person_post_vertical_menu', { 'person': person } ) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@@ -98,7 +98,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriod|null $period
|
||||
* @param null|string $format
|
||||
* @param string|null $format
|
||||
*/
|
||||
public function normalize($period, $format = null, array $context = [])
|
||||
{
|
||||
|
@@ -21,7 +21,7 @@ final class AccompanyingPeriodOriginNormalizer implements NormalizerInterface
|
||||
{
|
||||
/**
|
||||
* @param Origin $origin
|
||||
* @param null|string $format
|
||||
* @param string|null $format
|
||||
*/
|
||||
public function normalize($origin, $format = null, array $context = [])
|
||||
{
|
||||
|
@@ -21,7 +21,7 @@ class AccompanyingPeriodParticipationNormalizer implements NormalizerAwareInterf
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodParticipation $participation
|
||||
* @param null|string $format
|
||||
* @param string|null $format
|
||||
*/
|
||||
public function normalize($participation, $format = null, array $context = [])
|
||||
{
|
||||
|
@@ -168,7 +168,7 @@ class PersonJsonNormalizer implements
|
||||
|
||||
/**
|
||||
* @param Person $person
|
||||
* @param null|string $format
|
||||
* @param string|null $format
|
||||
*/
|
||||
public function normalize($person, $format = null, array $context = [])
|
||||
{
|
||||
|
@@ -31,7 +31,7 @@ class RelationshipDocGenNormalizer implements ContextAwareNormalizerInterface, N
|
||||
|
||||
/**
|
||||
* @param Relationship $relation
|
||||
* @param null|string $format
|
||||
* @param string|null $format
|
||||
*/
|
||||
public function normalize($relation, $format = null, array $context = [])
|
||||
{
|
||||
|
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace AccompanyingPeriod\Workflow;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
final class WorkflowEventSubscriberTest extends KernelTestCase
|
||||
{
|
||||
}
|
@@ -20,3 +20,9 @@ services:
|
||||
|
||||
Chill\PersonBundle\AccompanyingPeriod\Suggestion\ReferralsSuggestionInterface: '@Chill\PersonBundle\AccompanyingPeriod\Suggestion\ReferralsSuggestion'
|
||||
|
||||
Chill\PersonBundle\AccompanyingPeriod\Workflow\:
|
||||
resource: './../../AccompanyingPeriod/Workflow'
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
||||
|
||||
|
@@ -1,3 +1,4 @@
|
||||
services:
|
||||
Chill\PersonBundle\Notification\AccompanyingPeriodNotificationRenderer:
|
||||
Chill\PersonBundle\Notification\AccompanyingPeriodNotificationHandler:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
@@ -487,3 +487,14 @@ docgen:
|
||||
A basic context for accompanying period: Contexte pour les parcours
|
||||
A context for accompanying period work: Contexte pour les actions d'accompagnement
|
||||
A context for accompanying period work evaluation: Contexte pour les évaluations dans les actions d'accompagnement
|
||||
|
||||
period_notification:
|
||||
period_designated_subject: Vous êtes référent d'un parcours d'accompagnement
|
||||
You are designated to a new period: Vous avez été désigné référent d'un parcours d'accompagnement.
|
||||
Persons are: Les usagers concernés sont les suivants
|
||||
Social issues are: Les problématiques sociales renseignées sont les suivantes
|
||||
See it online: Visualisez le parcours en ligne
|
||||
|
||||
You are getting a notification for a period which does not exists any more: Cette notification ne correspond pas à une période d'accompagnement valide.
|
||||
You are getting a notification for a period you are not allowed to see: La notification fait référence à une période d'accompagnement à laquelle vous n'avez pas accès.
|
||||
This is the minimal period details: Période d'accompagnement n°
|
||||
|
Reference in New Issue
Block a user