mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-11-04 03:08:25 +00:00 
			
		
		
		
	Compare commits
	
		
			12 Commits
		
	
	
		
			ameliorati
			...
			fixtures/f
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 609deba325 | |||
| c7c62dc10b | |||
| fbc7cf3954 | |||
| 958cacd61f | |||
| 58bb471d32 | |||
| 259d0b5668 | |||
| 5224a26e57 | |||
| afb2a92997 | |||
| 1a37910fb1 | |||
| 8a8ec31163 | |||
| b88c01365d | |||
| 71c22b9c06 | 
@@ -54,7 +54,7 @@
 | 
			
		||||
    {{ form_row(edit_form.date) }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{# TODO .. location #}
 | 
			
		||||
.. location
 | 
			
		||||
 | 
			
		||||
{%- if edit_form.durationTime is defined -%}
 | 
			
		||||
    {{ form_row(edit_form.durationTime) }}
 | 
			
		||||
@@ -65,7 +65,7 @@
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{%- if edit_form.comment is defined -%}
 | 
			
		||||
    {# TODO .. public and private #}
 | 
			
		||||
    .. public and private
 | 
			
		||||
    {{ form_row(edit_form.comment) }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
@@ -77,7 +77,7 @@
 | 
			
		||||
    {{ form_row(edit_form.attendee) }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{# TODO .. status #}
 | 
			
		||||
.. status
 | 
			
		||||
 | 
			
		||||
{% set person_id = null %}
 | 
			
		||||
{% if entity.person %}
 | 
			
		||||
 
 | 
			
		||||
@@ -55,7 +55,7 @@
 | 
			
		||||
    {{ form_row(form.date) }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{# TODO .. location #}
 | 
			
		||||
.. location
 | 
			
		||||
 | 
			
		||||
{%- if form.durationTime is defined -%}
 | 
			
		||||
    {{ form_row(form.durationTime) }}
 | 
			
		||||
@@ -66,7 +66,7 @@
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{%- if form.comment is defined -%}
 | 
			
		||||
    {# TODO .. public and private #}
 | 
			
		||||
    .. public and private
 | 
			
		||||
    {{ form_row(form.comment) }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
@@ -78,13 +78,13 @@
 | 
			
		||||
    {{ form_row(form.attendee) }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{# TODO .. status #}
 | 
			
		||||
.. status
 | 
			
		||||
 | 
			
		||||
<ul class="record_actions sticky-form-buttons">
 | 
			
		||||
  <li class="cancel">
 | 
			
		||||
    <a
 | 
			
		||||
    <a 
 | 
			
		||||
      class="btn btn-cancel"
 | 
			
		||||
      {%- if context == 'person' -%}
 | 
			
		||||
      {%- if context == 'person' -%} 
 | 
			
		||||
      href="{{ chill_return_path_or('chill_activity_activity_list', { 'person_id': person.id } )}}"
 | 
			
		||||
      {%- else -%}
 | 
			
		||||
      href="{{ chill_return_path_or('chill_activity_activity_list', { 'accompanying_period_id': accompanyingCourse.id } )}}"
 | 
			
		||||
 
 | 
			
		||||
@@ -81,9 +81,9 @@ activity:
 | 
			
		||||
'%user% has done an %activity_type%': '%user% a effectué une activité de type "%activity_type%"'
 | 
			
		||||
 | 
			
		||||
#controller
 | 
			
		||||
'Success : activity created!': L'activité a été créée.
 | 
			
		||||
'Success : activity created!': Bravo ! L'activité a été créée.
 | 
			
		||||
'The form is not valid. The activity has not been created !': Le formulaire est invalide. L'activité n'a pas été créée.
 | 
			
		||||
'Success : activity updated!': L'activité a été mise à jour.
 | 
			
		||||
'Success : activity updated!': Bravo ! L'activité a été mise à jour.
 | 
			
		||||
'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'activité n'a pas été mise à jour.
 | 
			
		||||
 | 
			
		||||
# ROLES
 | 
			
		||||
 
 | 
			
		||||
@@ -17,19 +17,15 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
 | 
			
		||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
 | 
			
		||||
use Symfony\Component\Form\FormEvent;
 | 
			
		||||
use Symfony\Component\Form\FormEvents;
 | 
			
		||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
 | 
			
		||||
use Symfony\Component\Security\Core\Security;
 | 
			
		||||
 | 
			
		||||
final class AsideActivityFormType extends AbstractType
 | 
			
		||||
{
 | 
			
		||||
    protected array $timeChoices;
 | 
			
		||||
    private TranslatableStringHelper $translatableStringHelper;
 | 
			
		||||
    private TokenStorageInterface $storage;
 | 
			
		||||
 | 
			
		||||
    public function __construct (TranslatableStringHelper $translatableStringHelper, array $timeChoices, TokenStorageInterface $storage){
 | 
			
		||||
    public function __construct (TranslatableStringHelper $translatableStringHelper, array $timeChoices){
 | 
			
		||||
        $this->timeChoices = $timeChoices;
 | 
			
		||||
        $this->translatableStringHelper = $translatableStringHelper;
 | 
			
		||||
        $this->storage = $storage;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function buildForm(FormBuilderInterface $builder, array $options)
 | 
			
		||||
@@ -52,8 +48,7 @@ final class AsideActivityFormType extends AbstractType
 | 
			
		||||
                'label' => 'Agent',
 | 
			
		||||
                'required' => true,
 | 
			
		||||
                'class' => User::class,
 | 
			
		||||
                'data' => $this->storage->getToken()->getUser(),
 | 
			
		||||
                'attr' => array('class' => 'select2 '),
 | 
			
		||||
                //translate
 | 
			
		||||
                'placeholder' => 'Choose the agent for whom this activity is created',
 | 
			
		||||
                'choice_label' => 'username'
 | 
			
		||||
            ])
 | 
			
		||||
 
 | 
			
		||||
@@ -1,14 +1,12 @@
 | 
			
		||||
{% extends "@ChillMain/layout.html.twig" %}
 | 
			
		||||
 | 
			
		||||
{% block title %}{{ 'Aside activity list' |trans }}{% endblock title %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
<div class="col-md-10 col-xxl asideactivity-list">
 | 
			
		||||
<h2>{{ 'My aside activities' |trans }}</h2>
 | 
			
		||||
 | 
			
		||||
{% if entities|length == 0 %}
 | 
			
		||||
    <p class="chill-no-data-statement">
 | 
			
		||||
        {{ "There aren't any aside activities."|trans }}
 | 
			
		||||
        {{ "There isn't any activities."|trans }}
 | 
			
		||||
        <a href="{{ path('chill_crud_aside_activity_new') }}" class="btn btn-create button-small"></a>
 | 
			
		||||
    </p>
 | 
			
		||||
{% else %}
 | 
			
		||||
@@ -32,13 +30,13 @@
 | 
			
		||||
                    {% if entity.date %}
 | 
			
		||||
                        <p>{{ entity.date|format_date('long') }}</p>
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
 | 
			
		||||
{# 
 | 
			
		||||
                    <div class="duration">
 | 
			
		||||
                            <p>
 | 
			
		||||
                                <i class="fa fa-fw fa-hourglass-end"></i>
 | 
			
		||||
                                {{ entity.duration|date('H:i') }}
 | 
			
		||||
                            </p>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    </div> #}
 | 
			
		||||
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="item-col">
 | 
			
		||||
@@ -68,9 +66,9 @@
 | 
			
		||||
            <div class="item-col">
 | 
			
		||||
                <ul class="list-content">
 | 
			
		||||
                    <ul class="record_actions">
 | 
			
		||||
                        {# <li>
 | 
			
		||||
                        <li>
 | 
			
		||||
                            <a href="{{ path('chill_crud_aside_activity_view', { 'id': entity.id} ) }}" class="btn btn-show "></a>
 | 
			
		||||
                        </li> #}
 | 
			
		||||
                        </li>
 | 
			
		||||
                        {# TOOD
 | 
			
		||||
                        {% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %}
 | 
			
		||||
                        #}
 | 
			
		||||
@@ -93,15 +91,18 @@
 | 
			
		||||
        </div>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
    {% endfor %}
 | 
			
		||||
</div>
 | 
			
		||||
    <ul class="record_actions">
 | 
			
		||||
        <li>
 | 
			
		||||
            <a href="{{ path('chill_crud_aside_activity_new') }}" class="btn btn-create">
 | 
			
		||||
                {{ 'Add a new aside activity' | trans }}
 | 
			
		||||
            </a>
 | 
			
		||||
        </li>
 | 
			
		||||
    </ul>
 | 
			
		||||
</div>
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{# TODO set this condition in configuration #}
 | 
			
		||||
  <ul class="record_actions">
 | 
			
		||||
      <li>
 | 
			
		||||
          <a href="{{ path('chill_crud_aside_activity_new') }}" class="btn btn-create">
 | 
			
		||||
              {{ 'Add a new activity' | trans }}
 | 
			
		||||
          </a>
 | 
			
		||||
      </li>
 | 
			
		||||
  </ul>
 | 
			
		||||
</div>
 | 
			
		||||
   {% endblock %}
 | 
			
		||||
 
 | 
			
		||||
@@ -36,8 +36,8 @@
 | 
			
		||||
 | 
			
		||||
        <ul class="record_actions">
 | 
			
		||||
        <li>
 | 
			
		||||
            <a href="{{ path('chill_crud_aside_activity_category_new') }}" class="btn btn-create">
 | 
			
		||||
                {{ 'Create a new aside activity type'|trans }}
 | 
			
		||||
            <a href="{{ path('chill_crud_activity_type_new') }}" class="btn btn-create">
 | 
			
		||||
                {{ 'Create a new activity type'|trans }}
 | 
			
		||||
            </a>
 | 
			
		||||
        </li>
 | 
			
		||||
    </ul>
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,5 @@ services:
 | 
			
		||||
        arguments:
 | 
			
		||||
            - "@chill.main.helper.translatable_string"
 | 
			
		||||
            - "%chill_activity.form.time_duration%"
 | 
			
		||||
            - "@security.token_storage"
 | 
			
		||||
        tags:
 | 
			
		||||
            - { name: form.type, alias: chill_asideactivitybundle_asideactivity }
 | 
			
		||||
@@ -8,7 +8,7 @@ user_username: nom de l'utilisateur
 | 
			
		||||
Remark: Commentaire
 | 
			
		||||
No comments: Aucun commentaire
 | 
			
		||||
Add a new aside activity: Ajouter une nouvelle activité annexe
 | 
			
		||||
Aside activity list: Activités annexes
 | 
			
		||||
Aside activity list: Liste des activités annexes
 | 
			
		||||
present: présent
 | 
			
		||||
not present: absent
 | 
			
		||||
Delete: Supprimer
 | 
			
		||||
@@ -32,7 +32,7 @@ location: Lieu
 | 
			
		||||
crud:
 | 
			
		||||
  aside_activity:
 | 
			
		||||
    title_view: Détail de l'activité annexe
 | 
			
		||||
    title_new: Nouvelle activité annexe
 | 
			
		||||
    title_new: Nouveau activité annexe
 | 
			
		||||
    title_edit: Edition d'une activité annexe
 | 
			
		||||
    title_delete: Supprimation d'une activité annexe
 | 
			
		||||
    button_delete: Supprimer
 | 
			
		||||
@@ -43,20 +43,14 @@ crud:
 | 
			
		||||
 | 
			
		||||
#forms
 | 
			
		||||
Activity creation: Nouvelle activité annexe
 | 
			
		||||
Create a new aside activity type: Nouvelle categorie d'activité annexe
 | 
			
		||||
Create: Créer
 | 
			
		||||
Back to the list: Retour à la liste
 | 
			
		||||
Save activity: Sauver l'activité
 | 
			
		||||
Reset form: Remise à zéro du formulaire
 | 
			
		||||
Choose the agent for whom this activity is created: Choissisez l'utilisateur pour qui l'activité est creéé.
 | 
			
		||||
Choose the agent for whom this activity is created: Choissisez l'agent pour qui l'activitée est creeé.
 | 
			
		||||
Choose the activity category: Choissisez le type d'activité
 | 
			
		||||
Choose the duration: Choisir la durée
 | 
			
		||||
Choose a category: Choisir un categorie
 | 
			
		||||
Is active: Actif
 | 
			
		||||
Agent: Utilisateur
 | 
			
		||||
date: Date
 | 
			
		||||
Duration: Durée
 | 
			
		||||
Note: Note
 | 
			
		||||
5 minutes: 5 minutes
 | 
			
		||||
10 minutes: 10 minutes
 | 
			
		||||
15 minutes: 15 minutes
 | 
			
		||||
 
 | 
			
		||||
@@ -1,67 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Chill is a software for social workers
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2021, Champs Libres Cooperative SCRLFS,
 | 
			
		||||
 * <http://www.champs-libres.coop>
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU Affero General Public License as
 | 
			
		||||
 * published by the Free Software Foundation, either version 3 of the
 | 
			
		||||
 * License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU Affero General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU Affero General Public License
 | 
			
		||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
namespace Chill\MainBundle\Pagination;
 | 
			
		||||
 | 
			
		||||
use Twig\Environment;
 | 
			
		||||
use Twig\Extension\AbstractExtension;
 | 
			
		||||
use Twig\TwigFunction;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * add twig function to render pagination
 | 
			
		||||
 *
 | 
			
		||||
 * @author Mathieu Jaumotte <mathieu.jaumotte@champs-libres.coop>
 | 
			
		||||
 * @author Champs Libres <info@champs-libres.coop>
 | 
			
		||||
 */
 | 
			
		||||
class ChillItemsPerPageTwig extends AbstractExtension
 | 
			
		||||
{
 | 
			
		||||
    public function getName()
 | 
			
		||||
    {
 | 
			
		||||
        return 'chill_items_per_page';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getFunctions()
 | 
			
		||||
    {
 | 
			
		||||
        return array(
 | 
			
		||||
           new TwigFunction(
 | 
			
		||||
                 'chill_items_per_page',
 | 
			
		||||
                 array($this, 'paginationRender'),
 | 
			
		||||
                 array(
 | 
			
		||||
                    'needs_environment' => true,
 | 
			
		||||
                    'is_safe' => ['html']
 | 
			
		||||
                 )
 | 
			
		||||
            )
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function paginationRender(
 | 
			
		||||
          Environment $env,
 | 
			
		||||
          PaginatorInterface $paginator,
 | 
			
		||||
          $template = '@ChillMain/Pagination/items_per_page.html.twig'
 | 
			
		||||
    ) {
 | 
			
		||||
 | 
			
		||||
        return $env->render($template, array(
 | 
			
		||||
           'paginator' => $paginator,
 | 
			
		||||
           'current' => $paginator->getItemsPerPage()
 | 
			
		||||
        ));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -61,7 +61,7 @@ class PaginatorFactory
 | 
			
		||||
    public function __construct(
 | 
			
		||||
          RequestStack $requestStack,
 | 
			
		||||
          RouterInterface $router,
 | 
			
		||||
          $itemPerPage = 20
 | 
			
		||||
          $itemPerPage = 50
 | 
			
		||||
    ) {
 | 
			
		||||
        $this->itemPerPage = $itemPerPage;
 | 
			
		||||
        $this->requestStack = $requestStack;
 | 
			
		||||
 
 | 
			
		||||
@@ -111,8 +111,3 @@ $chill-theme-buttons: (
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// fix min-width on small pictos buttons
 | 
			
		||||
.btn-sm, .btn-group-sm > .btn {
 | 
			
		||||
   min-width: 36px;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -51,7 +51,6 @@ div.flex-bloc {
 | 
			
		||||
        flex-grow: 0; flex-shrink: 1; flex-basis: auto;
 | 
			
		||||
        flex-direction: column;
 | 
			
		||||
        margin: 0;
 | 
			
		||||
        hyphens: auto;
 | 
			
		||||
 | 
			
		||||
        div.item-row {
 | 
			
		||||
            flex-grow: 1; flex-shrink: 1; flex-basis: auto;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,9 @@
 | 
			
		||||
<template>
 | 
			
		||||
   <component :is="component" class="chill-entity entity-address my-3">
 | 
			
		||||
 | 
			
		||||
      <component :is="component" class="address" :class="multiline">
 | 
			
		||||
   <div class="chill-entity entity-address my-3">
 | 
			
		||||
      <div class="address multiline">
 | 
			
		||||
         <p v-if="address.text"
 | 
			
		||||
            class="street">
 | 
			
		||||
            {{ address.text }},
 | 
			
		||||
            {{ address.text }}
 | 
			
		||||
         </p>
 | 
			
		||||
         <p v-if="address.postcode"
 | 
			
		||||
            class="postcode">
 | 
			
		||||
@@ -14,9 +13,8 @@
 | 
			
		||||
            class="country">
 | 
			
		||||
            {{ address.country.name.fr }}
 | 
			
		||||
         </p>
 | 
			
		||||
      </component>
 | 
			
		||||
 | 
			
		||||
      <div v-if="isMultiline">
 | 
			
		||||
      </div>
 | 
			
		||||
      <div>
 | 
			
		||||
         <div v-if="address.floor">
 | 
			
		||||
            <span class="floor">
 | 
			
		||||
               <b>{{ $t('floor') }}</b>: {{ address.floor }}
 | 
			
		||||
@@ -37,76 +35,28 @@
 | 
			
		||||
               <b>{{ $t('flat') }}</b>: {{ address.flat }}
 | 
			
		||||
            </span>
 | 
			
		||||
         </div>
 | 
			
		||||
         <div>
 | 
			
		||||
            <div v-if="address.floor">
 | 
			
		||||
               <span class="floor">
 | 
			
		||||
                  <b>{{ $t('floor') }}</b>: {{ address.floor }}
 | 
			
		||||
               </span>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div v-if="address.corridor">
 | 
			
		||||
               <span class="corridor">
 | 
			
		||||
                  <b>{{ $t('corridor') }}</b>: {{ address.corridor }}
 | 
			
		||||
               </span>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div v-if="address.steps">
 | 
			
		||||
               <span class="steps">
 | 
			
		||||
                  <b>{{ $t('steps') }}</b>: {{ address.steps }}
 | 
			
		||||
               </span>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div v-if="address.flat">
 | 
			
		||||
               <span class="flat">
 | 
			
		||||
                  <b>{{ $t('flat') }}</b>: {{ address.flat }}
 | 
			
		||||
               </span>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div v-if="address.buildingName">
 | 
			
		||||
               <span class="buildingName">
 | 
			
		||||
                  <b>{{ $t('buildingName') }}</b>: {{ address.buildingName }}
 | 
			
		||||
               </span>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div v-if="address.extra">
 | 
			
		||||
               <span class="extra">
 | 
			
		||||
                  <b>{{ $t('extra') }}</b>: {{ address.extra }}
 | 
			
		||||
               </span>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div v-if="address.distribution">
 | 
			
		||||
               <span class="distribution">
 | 
			
		||||
                  <b>{{ $t('distribution') }}</b>: {{ address.distribution }}
 | 
			
		||||
               </span>
 | 
			
		||||
            </div>
 | 
			
		||||
         <div v-if="address.buildingName">
 | 
			
		||||
            <span class="buildingName">
 | 
			
		||||
               <b>{{ $t('buildingName') }}</b>: {{ address.buildingName }}
 | 
			
		||||
            </span>
 | 
			
		||||
         </div>
 | 
			
		||||
         <div v-if="address.extra">
 | 
			
		||||
            <span class="extra">
 | 
			
		||||
               <b>{{ $t('extra') }}</b>: {{ address.extra }}
 | 
			
		||||
            </span>
 | 
			
		||||
         </div>
 | 
			
		||||
         <div v-if="address.distribution">
 | 
			
		||||
            <span class="distribution">
 | 
			
		||||
               <b>{{ $t('distribution') }}</b>: {{ address.distribution }}
 | 
			
		||||
            </span>
 | 
			
		||||
         </div>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
   </component>
 | 
			
		||||
   </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
   name: 'ShowAddress',
 | 
			
		||||
   props: {
 | 
			
		||||
      address: {
 | 
			
		||||
         type: Object
 | 
			
		||||
      },
 | 
			
		||||
      isMultiline: {
 | 
			
		||||
         default: true,
 | 
			
		||||
         type: Boolean
 | 
			
		||||
      }
 | 
			
		||||
   },
 | 
			
		||||
   computed: {
 | 
			
		||||
      component(){
 | 
			
		||||
         return this.isMultiline == true ? "div" : "span";
 | 
			
		||||
      },
 | 
			
		||||
      multiline(){
 | 
			
		||||
         return this.isMultiline == true ? "multiline" : "";
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
p {
 | 
			
		||||
   &:after {
 | 
			
		||||
      content: " ";
 | 
			
		||||
      margin-right: 0.3em;
 | 
			
		||||
   }
 | 
			
		||||
   name: "ShowAddress",
 | 
			
		||||
   props: ['address']
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
@@ -43,9 +43,8 @@
 | 
			
		||||
 | 
			
		||||
         <template v-slot:footer>
 | 
			
		||||
            <button v-if="action === 'show'"
 | 
			
		||||
               @click="goToLocation(id, type)"
 | 
			
		||||
               :title="$t(titleMessage)"
 | 
			
		||||
               class="btn btn-show">{{ $t(buttonMessage) }}
 | 
			
		||||
               @click="changeActionTo('edit')"
 | 
			
		||||
               class="btn btn-update">
 | 
			
		||||
            </button>
 | 
			
		||||
            <button v-else
 | 
			
		||||
               class="btn btn-save"
 | 
			
		||||
@@ -61,9 +60,9 @@
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal.vue';
 | 
			
		||||
import OnTheFlyCreate from './OnTheFly/Create.vue';
 | 
			
		||||
import OnTheFlyPerson from 'ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue';
 | 
			
		||||
import OnTheFlyThirdparty from 'ChillThirdPartyAssets/vuejs/_components/OnTheFly/ThirdParty.vue';
 | 
			
		||||
import OnTheFlyThirdparty from './OnTheFly/ThirdParty.vue';
 | 
			
		||||
import OnTheFlyCreate from './OnTheFly/Create.vue';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
   name: 'OnTheFly',
 | 
			
		||||
@@ -116,22 +115,6 @@ export default {
 | 
			
		||||
            case 'create':
 | 
			
		||||
               return 'onthefly.create.title';
 | 
			
		||||
         }
 | 
			
		||||
      },
 | 
			
		||||
      titleMessage() {
 | 
			
		||||
         switch (this.type){
 | 
			
		||||
            case 'person':
 | 
			
		||||
               return 'action.redirect.' + this.type;
 | 
			
		||||
            case 'thirdparty':
 | 
			
		||||
               return 'action.redirect.' + this.type;
 | 
			
		||||
         }
 | 
			
		||||
      },
 | 
			
		||||
      buttonMessage(){
 | 
			
		||||
         switch (this.type){
 | 
			
		||||
            case 'person':
 | 
			
		||||
               return 'onthefly.show.file_' + this.type;
 | 
			
		||||
            case 'thirdparty':
 | 
			
		||||
               return 'onthefly.show.file_' + this.type;
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
   },
 | 
			
		||||
   methods: {
 | 
			
		||||
@@ -156,13 +139,6 @@ export default {
 | 
			
		||||
            this.$refs.castNew.castByType();
 | 
			
		||||
         }
 | 
			
		||||
         this.modal.showModal = false;
 | 
			
		||||
      },
 | 
			
		||||
      goToLocation(id, type){
 | 
			
		||||
         if(type == 'person'){
 | 
			
		||||
            window.location = `../../person/${id}/general`
 | 
			
		||||
         } else if(type == 'thirdparty') {
 | 
			
		||||
            window.location = `../../thirdparty/thirdparty/${id}/show`
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
@@ -172,5 +148,4 @@ export default {
 | 
			
		||||
a {
 | 
			
		||||
   cursor: pointer;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -35,7 +35,7 @@
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import OnTheFlyPerson from 'ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue';
 | 
			
		||||
import OnTheFlyThirdparty from 'ChillThirdPartyAssets/vuejs/_components/OnTheFly/ThirdParty.vue'; 
 | 
			
		||||
import OnTheFlyThirdparty from './ThirdParty.vue'; // TODO move in ChillThirdpartyAssets
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
   name: "OnTheFlyCreate",
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,23 @@
 | 
			
		||||
<template>
 | 
			
		||||
   <div v-if="action === 'show'">
 | 
			
		||||
      show
 | 
			
		||||
      thirdparty
 | 
			
		||||
      {{ id }}
 | 
			
		||||
   </div>
 | 
			
		||||
   <div v-else-if="action === 'edit' || action === 'create'">
 | 
			
		||||
      {{ action }}
 | 
			
		||||
      thirdparty 
 | 
			
		||||
      {{ id }}
 | 
			
		||||
   </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
   name: "OnTheFlyThirdParty",
 | 
			
		||||
   props: ['id', 'type', 'action']
 | 
			
		||||
}
 | 
			
		||||
// TODO move in ChillThirdpartyAssets
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="css" scoped>
 | 
			
		||||
</style>
 | 
			
		||||
@@ -41,11 +41,7 @@ const messages = {
 | 
			
		||||
         close: "Fermer",
 | 
			
		||||
         back: "Retour",
 | 
			
		||||
         check_all: "cocher tout",
 | 
			
		||||
         reset: "réinitialiser",
 | 
			
		||||
         redirect: {
 | 
			
		||||
            person: "Quitter la page et ouvrir le dossier",
 | 
			
		||||
            thirdparty: "Quitter la page et voir le tiers",
 | 
			
		||||
         }
 | 
			
		||||
         reset: "réinitialiser"
 | 
			
		||||
      },
 | 
			
		||||
      nav: {
 | 
			
		||||
         next: "Suivant",
 | 
			
		||||
@@ -56,9 +52,7 @@ const messages = {
 | 
			
		||||
      onthefly: {
 | 
			
		||||
         show: {
 | 
			
		||||
            person: "Détails de l'usager",
 | 
			
		||||
            thirdparty: "Détails du tiers",
 | 
			
		||||
            file_person: "Ouvrir le dossier",
 | 
			
		||||
            file_thirdparty: "Voir le Tiers",
 | 
			
		||||
            thirdparty: "Détails du tiers"
 | 
			
		||||
         },
 | 
			
		||||
         edit: {
 | 
			
		||||
            person: "Modifier un usager",
 | 
			
		||||
@@ -71,18 +65,6 @@ const messages = {
 | 
			
		||||
            thirdparty: "un nouveau tiers professionnel"
 | 
			
		||||
         },
 | 
			
		||||
      },
 | 
			
		||||
      renderbox: {
 | 
			
		||||
         person: "Person",
 | 
			
		||||
         birthday: {
 | 
			
		||||
            man: "Né le",
 | 
			
		||||
            woman: "Née le"
 | 
			
		||||
         } ,
 | 
			
		||||
         no_data: "Aucune information renseignée",
 | 
			
		||||
         type: {
 | 
			
		||||
            thirdparty: "Tiers",
 | 
			
		||||
            person: "Usager"
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,20 +0,0 @@
 | 
			
		||||
<select class="form-select" aria-label="items Per Page" id="itemsPerPage">
 | 
			
		||||
    <option value="10">10 {{ 'results'|trans }}</option>
 | 
			
		||||
    <option value="20">20 {{ 'results'|trans }}</option>
 | 
			
		||||
    <option value="50">50 {{ 'results'|trans }}</option>
 | 
			
		||||
    <option value="100">100 {{ 'results'|trans }}</option>
 | 
			
		||||
</select>
 | 
			
		||||
<script>
 | 
			
		||||
    let select = document.querySelector("select#itemsPerPage");
 | 
			
		||||
    window.addEventListener('load', () =>
 | 
			
		||||
        select.value = {{ current }}
 | 
			
		||||
    );
 | 
			
		||||
    select.addEventListener('change', () => {
 | 
			
		||||
        let url = new URL(window.location.href);
 | 
			
		||||
        let params = url.searchParams;
 | 
			
		||||
        params.set('page', '1');
 | 
			
		||||
        params.set('item_per_page', select.value);
 | 
			
		||||
        url.search = params.toString();
 | 
			
		||||
        window.location.href = url.toString();
 | 
			
		||||
    });
 | 
			
		||||
</script>
 | 
			
		||||
@@ -15,8 +15,3 @@ services:
 | 
			
		||||
        class: Chill\MainBundle\Pagination\ChillPaginationTwig
 | 
			
		||||
        tags:
 | 
			
		||||
            - { name: twig.extension }
 | 
			
		||||
 | 
			
		||||
    chill_main.paginator.items_per_page.twig_extensions:
 | 
			
		||||
        class: Chill\MainBundle\Pagination\ChillItemsPerPageTwig
 | 
			
		||||
        tags:
 | 
			
		||||
            - { name: twig.extension }
 | 
			
		||||
 
 | 
			
		||||
@@ -85,7 +85,6 @@ Search %pattern%: Recherche de "%pattern%"
 | 
			
		||||
Results %start%-%end% of %total%: Résultats %start%-%end% sur %total%
 | 
			
		||||
See all results: Voir tous les résultats
 | 
			
		||||
Advanced search: Recherche avancée
 | 
			
		||||
results: résultats
 | 
			
		||||
 | 
			
		||||
# timeline
 | 
			
		||||
Global timeline: Historique global
 | 
			
		||||
 
 | 
			
		||||
@@ -167,7 +167,7 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct
 | 
			
		||||
    /**
 | 
			
		||||
     * @return DateTimeImmutable|null
 | 
			
		||||
     */
 | 
			
		||||
    public function getUpdatedAt(): ?\DateTimeInterface
 | 
			
		||||
    public function getUpdatedAt(): ?DateTimeInterface
 | 
			
		||||
    {
 | 
			
		||||
        return $this->updatedAt;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -6,21 +6,15 @@
 | 
			
		||||
   <h1 v-else>{{ $t('course.title.active') }}</h1>
 | 
			
		||||
 | 
			
		||||
   <persons-associated></persons-associated>
 | 
			
		||||
   <course-location></course-location>
 | 
			
		||||
   <origin-demand></origin-demand>
 | 
			
		||||
   <requestor></requestor>
 | 
			
		||||
   <social-issue></social-issue>
 | 
			
		||||
   <course-location></course-location>
 | 
			
		||||
   <referrer></referrer>
 | 
			
		||||
   <resources></resources>
 | 
			
		||||
   <comment v-if="accompanyingCourse.step === 'DRAFT'"></comment>
 | 
			
		||||
   <confirm v-if="accompanyingCourse.step === 'DRAFT'"></confirm>
 | 
			
		||||
 | 
			
		||||
    <div v-for="error in errorMsg" class="vue-component errors alert alert-danger">
 | 
			
		||||
       <p>
 | 
			
		||||
          <span>{{ error.sta }} {{ error.txt }}</span><br>
 | 
			
		||||
          <span>{{ $t(error.msg) }}</span>
 | 
			
		||||
       </p>
 | 
			
		||||
    </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
@@ -54,8 +48,7 @@ export default {
 | 
			
		||||
   },
 | 
			
		||||
   computed: mapState([
 | 
			
		||||
      'accompanyingCourse',
 | 
			
		||||
      'addressContext',
 | 
			
		||||
      'errorMsg'
 | 
			
		||||
      'addressContext'
 | 
			
		||||
   ])
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -93,27 +86,8 @@ export default {
 | 
			
		||||
         }
 | 
			
		||||
         & > div {
 | 
			
		||||
            margin: 1em 3em 0;
 | 
			
		||||
            &.flex-table {
 | 
			
		||||
               margin: 1em 0 0;
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
 | 
			
		||||
         div.flex-table {
 | 
			
		||||
            div.item-row {
 | 
			
		||||
               div.item-col:first-child {
 | 
			
		||||
                  flex-basis: 33%;
 | 
			
		||||
               }
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
 | 
			
		||||
         &.errors {
 | 
			
		||||
            //display: flex;
 | 
			
		||||
            //position: sticky;
 | 
			
		||||
            //bottom: 0.3em;
 | 
			
		||||
            //z-index: 1000;
 | 
			
		||||
            margin: 1em 0;
 | 
			
		||||
            padding: 1em;
 | 
			
		||||
            border-radius: 0;
 | 
			
		||||
         table {
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ const getAccompanyingCourse = (id) => {
 | 
			
		||||
   return fetch(url)
 | 
			
		||||
      .then(response => {
 | 
			
		||||
         if (response.ok) { return response.json(); }
 | 
			
		||||
         throw { msg: 'Error while retriving AccompanyingPeriod Course.', sta: response.status, txt: response.statusText, err: new Error(), body: response.body };
 | 
			
		||||
         throw Error('Error with request resource response');
 | 
			
		||||
      });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -32,8 +32,7 @@ const patchAccompanyingCourse = (id, body) => {
 | 
			
		||||
      })
 | 
			
		||||
      .then(response => {
 | 
			
		||||
         if (response.ok) { return response.json(); }
 | 
			
		||||
          console.log(response);
 | 
			
		||||
         throw { msg: 'Error while updating AccompanyingPeriod Course.', sta: response.status, txt: response.statusText, err: new Error(), body: response.body };
 | 
			
		||||
         throw Error('Error with request resource response');
 | 
			
		||||
      });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -48,7 +47,7 @@ const confirmAccompanyingCourse = (id) => {
 | 
			
		||||
      })
 | 
			
		||||
      .then(response => {
 | 
			
		||||
         if (response.ok) { return response.json(); }
 | 
			
		||||
         throw { msg: 'Error while confirming AccompanyingPeriod Course.', sta: response.status, txt: response.statusText, err: new Error(), body: response.body };
 | 
			
		||||
         throw Error('Error with request resource response');
 | 
			
		||||
      });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -60,7 +59,7 @@ const getSocialIssues = () => {
 | 
			
		||||
   return fetch(url)
 | 
			
		||||
      .then(response => {
 | 
			
		||||
         if (response.ok) { return response.json(); }
 | 
			
		||||
         throw { msg: 'Error while retriving Social Issues.', sta: response.status, txt: response.statusText, err: new Error(), body: response.body };
 | 
			
		||||
         throw Error('Error with request resource response');
 | 
			
		||||
      });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -84,7 +83,7 @@ const postParticipation = (id, payload, method) => {
 | 
			
		||||
      })
 | 
			
		||||
      .then(response => {
 | 
			
		||||
         if (response.ok) { return response.json(); }
 | 
			
		||||
         throw { msg: 'Error while sending AccompanyingPeriod Course participation.', sta: response.status, txt: response.statusText, err: new Error(), body: response.body };
 | 
			
		||||
         throw Error('Error with request resource response');
 | 
			
		||||
      });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -110,7 +109,7 @@ const postRequestor = (id, payload, method) => {
 | 
			
		||||
      })
 | 
			
		||||
      .then(response => {
 | 
			
		||||
         if (response.ok) { return response.json(); }
 | 
			
		||||
         throw { msg: 'Error while sending AccompanyingPeriod Course requestor', sta: response.status, txt: response.statusText, err: new Error(), body: response.body };
 | 
			
		||||
         throw Error('Error with request resource response');
 | 
			
		||||
      });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -143,7 +142,7 @@ const postResource = (id, payload, method) => {
 | 
			
		||||
      })
 | 
			
		||||
      .then(response => {
 | 
			
		||||
         if (response.ok) { return response.json(); }
 | 
			
		||||
         throw { msg: 'Error while sending AccompanyingPeriod Course resource.', sta: response.status, txt: response.statusText, err: new Error(), body: response.body };
 | 
			
		||||
         throw Error('Error with request resource response');
 | 
			
		||||
      });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -162,7 +161,7 @@ const postSocialIssue = (id, body, method) => {
 | 
			
		||||
      })
 | 
			
		||||
      .then(response => {
 | 
			
		||||
         if (response.ok) { return response.json(); }
 | 
			
		||||
         throw { msg: 'Error while updating SocialIssue.', sta: response.status, txt: response.statusText, err: new Error(), body: response.body };
 | 
			
		||||
         throw Error('Error with request resource response');
 | 
			
		||||
      });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -171,7 +170,7 @@ const getUsers = () => {
 | 
			
		||||
   return fetch(url)
 | 
			
		||||
      .then(response => {
 | 
			
		||||
         if (response.ok) { return response.json(); }
 | 
			
		||||
         throw { msg: 'Error while retriving users.', sta: response.status, txt: response.statusText, err: new Error(), body: response.body };
 | 
			
		||||
         throw Error('Error with request resource response');
 | 
			
		||||
      });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -180,7 +179,7 @@ const whoami = () => {
 | 
			
		||||
   return fetch(url)
 | 
			
		||||
      .then(response => {
 | 
			
		||||
         if (response.ok) { return response.json(); }
 | 
			
		||||
         throw { msg: 'Error while getting whoami.', sta: response.status, txt: response.statusText, err: new Error(), body: response.body };
 | 
			
		||||
         throw Error('Error with request resource response');
 | 
			
		||||
      });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -189,7 +188,7 @@ const getListOrigins = () => {
 | 
			
		||||
   return fetch(url)
 | 
			
		||||
      .then(response => {
 | 
			
		||||
         if (response.ok) { return response.json(); }
 | 
			
		||||
         throw { msg: 'Error while retriving origin\'s list.', sta: response.status, txt: response.statusText, err: new Error(), body: response.body };
 | 
			
		||||
         throw Error('Error with request resource response');
 | 
			
		||||
      });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -60,7 +60,7 @@ export default {
 | 
			
		||||
            personId: this.person.id
 | 
			
		||||
         };
 | 
			
		||||
         this.$store.dispatch('updateLocation', payload);
 | 
			
		||||
         window.location.assign('#section-20');
 | 
			
		||||
         window.location.assign('#section-50');
 | 
			
		||||
         this.modal.showModal = false;
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
 
 | 
			
		||||
@@ -27,19 +27,17 @@
 | 
			
		||||
            ]) }}
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div>
 | 
			
		||||
               <ul class="record_actions">
 | 
			
		||||
                  <li>
 | 
			
		||||
                     <button type="submit" class="btn btn-save">{{ $t('action.save') }}</button>
 | 
			
		||||
                  </li>
 | 
			
		||||
                  <li v-if="initialComment !== null">
 | 
			
		||||
                     <a class="btn btn-delete"
 | 
			
		||||
                        @click="removeComment">
 | 
			
		||||
                        {{ $t('action.delete') }}
 | 
			
		||||
                     </a>
 | 
			
		||||
                  </li>
 | 
			
		||||
               </ul>
 | 
			
		||||
            </div>
 | 
			
		||||
            <ul class="record_actions">
 | 
			
		||||
               <li>
 | 
			
		||||
                  <button type="submit" class="btn btn-save">{{ $t('action.save') }}</button>
 | 
			
		||||
               </li>
 | 
			
		||||
               <li v-if="initialComment !== null">
 | 
			
		||||
                  <a class="btn btn-delete"
 | 
			
		||||
                     @click="removeComment">
 | 
			
		||||
                     {{ $t('action.delete') }}
 | 
			
		||||
                  </a>
 | 
			
		||||
               </li>
 | 
			
		||||
            </ul>
 | 
			
		||||
 | 
			
		||||
         </form>
 | 
			
		||||
      </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -3,43 +3,24 @@
 | 
			
		||||
   <h2><a name="section-90"></a>
 | 
			
		||||
      {{ $t('confirm.title') }}
 | 
			
		||||
   </h2>
 | 
			
		||||
 | 
			
		||||
   <div>
 | 
			
		||||
      <p v-html="$t('confirm.text_draft', [$t('course.step.draft')])"></p>
 | 
			
		||||
 | 
			
		||||
      <div v-if="!isValidToBeConfirmed">
 | 
			
		||||
         <div class="alert alert-warning">
 | 
			
		||||
            {{ $t('confirm.alert_validation') }}
 | 
			
		||||
            <ul class="mt-2">
 | 
			
		||||
               <li v-for="k in validationKeys">
 | 
			
		||||
                  {{ $t(notValidMessages[k].msg) }}
 | 
			
		||||
                  <a :href="notValidMessages[k].anchor">
 | 
			
		||||
                     <i class="fa fa-level-up fa-fw"></i>
 | 
			
		||||
                  </a>
 | 
			
		||||
               </li>
 | 
			
		||||
            </ul>
 | 
			
		||||
         </div>
 | 
			
		||||
         <ul class="record_actions">
 | 
			
		||||
            <li>
 | 
			
		||||
               <button class="btn btn-save" disabled>
 | 
			
		||||
                  {{ $t('confirm.ok') }}
 | 
			
		||||
               </button>
 | 
			
		||||
            </li>
 | 
			
		||||
         </ul>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <div v-else>
 | 
			
		||||
         <p v-html="$t('confirm.text_active', [$t('course.step.active')])"></p>
 | 
			
		||||
         <ul class="record_actions">
 | 
			
		||||
            <li>
 | 
			
		||||
               <button
 | 
			
		||||
                  class="btn btn-save"
 | 
			
		||||
                  @click="modal.showModal = true">
 | 
			
		||||
                  {{ $t('confirm.ok') }}
 | 
			
		||||
               </button>
 | 
			
		||||
            </li>
 | 
			
		||||
         </ul>
 | 
			
		||||
      </div>
 | 
			
		||||
      <p>
 | 
			
		||||
         {{ $t('confirm.text_draft') }}
 | 
			
		||||
         <span class="badge bg-secondary">{{ $t('course.step.draft') }}</span>
 | 
			
		||||
      </p>
 | 
			
		||||
      <p>
 | 
			
		||||
         {{ $t('confirm.text_active') }}
 | 
			
		||||
         <span class="badge bg-primary">{{ $t('course.step.active') }}</span>
 | 
			
		||||
      </p>
 | 
			
		||||
 | 
			
		||||
      <ul class="record_actions">
 | 
			
		||||
         <li>
 | 
			
		||||
            <button class="btn btn-save" @click="modal.showModal = true">
 | 
			
		||||
               {{ $t('confirm.ok') }}
 | 
			
		||||
            </button>
 | 
			
		||||
         </li>
 | 
			
		||||
      </ul>
 | 
			
		||||
   </div>
 | 
			
		||||
 | 
			
		||||
   <teleport to="body">
 | 
			
		||||
@@ -62,7 +43,6 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import {mapGetters, mapState} from "vuex";
 | 
			
		||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
@@ -75,34 +55,13 @@ export default {
 | 
			
		||||
         modal: {
 | 
			
		||||
            showModal: false,
 | 
			
		||||
            modalDialogClass: "modal-dialog-centered modal-md"
 | 
			
		||||
         },
 | 
			
		||||
         notValidMessages: {
 | 
			
		||||
            participation: {
 | 
			
		||||
               msg: 'confirm.participation_not_valid',
 | 
			
		||||
               anchor: '#section-10'
 | 
			
		||||
            },
 | 
			
		||||
            location: {
 | 
			
		||||
               msg: 'confirm.location_not_valid',
 | 
			
		||||
               anchor: '#section-20' //
 | 
			
		||||
            },
 | 
			
		||||
            socialIssue: {
 | 
			
		||||
               msg: 'confirm.socialIssue_not_valid',
 | 
			
		||||
               anchor: '#section-50'
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
   },
 | 
			
		||||
   computed: {
 | 
			
		||||
      ...mapState([
 | 
			
		||||
         'accompanyingCourse'
 | 
			
		||||
      ]),
 | 
			
		||||
      ...mapGetters([
 | 
			
		||||
         'isParticipationValid',
 | 
			
		||||
         'isSocialIssueValid',
 | 
			
		||||
         'isLocationValid',
 | 
			
		||||
         'validationKeys',
 | 
			
		||||
         'isValidToBeConfirmed'
 | 
			
		||||
      ])
 | 
			
		||||
      accompanyingCourse() {
 | 
			
		||||
         return this.$store.state.accompanyingCourse
 | 
			
		||||
      }
 | 
			
		||||
   },
 | 
			
		||||
   methods: {
 | 
			
		||||
      confirmCourse() {
 | 
			
		||||
@@ -113,3 +72,9 @@ export default {
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
div.vue-component > div {
 | 
			
		||||
    //margin: 1em;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,36 +1,28 @@
 | 
			
		||||
<template>
 | 
			
		||||
   <div class="vue-component">
 | 
			
		||||
      <h2><a name="section-20"></a>
 | 
			
		||||
      <h2><a name="section-50"></a>
 | 
			
		||||
         {{ $t('courselocation.title') }}
 | 
			
		||||
      </h2>
 | 
			
		||||
      <div class="my-4">
 | 
			
		||||
 | 
			
		||||
      <!-- {# include vue_address component #} -->
 | 
			
		||||
      <div v-for="error in displayErrors" class="alert alert-danger my-2">
 | 
			
		||||
         {{ error }}
 | 
			
		||||
      </div>
 | 
			
		||||
         <!-- {# include vue_address component #} -->
 | 
			
		||||
         <div v-for="error in displayErrors" class="alert alert-danger my-2">
 | 
			
		||||
            {{ error }}
 | 
			
		||||
         </div>
 | 
			
		||||
 | 
			
		||||
      <div v-if="hasNoLocation">
 | 
			
		||||
         <label class="chill-no-data-statement">
 | 
			
		||||
            {{ $t('courselocation.no_address') }}
 | 
			
		||||
         </label>
 | 
			
		||||
      </div>
 | 
			
		||||
         <show-address
 | 
			
		||||
            v-if="accompanyingCourse.location"
 | 
			
		||||
            :address="accompanyingCourse.location">
 | 
			
		||||
         </show-address>
 | 
			
		||||
 | 
			
		||||
      <div v-if="isPersonLocation">
 | 
			
		||||
         <label class="col-form-label">
 | 
			
		||||
         <div v-if="isPersonLocation" class="alert alert-success">
 | 
			
		||||
            {{ $t('courselocation.person_locator', [ accompanyingCourse.personLocation.text ]) }}
 | 
			
		||||
         </label>
 | 
			
		||||
      </div>
 | 
			
		||||
         </div>
 | 
			
		||||
 | 
			
		||||
      <show-address
 | 
			
		||||
         v-if="accompanyingCourse.location"
 | 
			
		||||
         :address="accompanyingCourse.location">
 | 
			
		||||
      </show-address>
 | 
			
		||||
         <div v-if="isTemporaryAddress" class="alert alert-warning">
 | 
			
		||||
            <p>{{ $t('courselocation.temporary_address_must_be_changed') }}</p>
 | 
			
		||||
         </div>
 | 
			
		||||
 | 
			
		||||
      <div v-if="isTemporaryAddress" class="alert alert-warning">
 | 
			
		||||
         <p>{{ $t('courselocation.temporary_address_must_be_changed') }}</p>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <div>
 | 
			
		||||
         <ul class="record_actions">
 | 
			
		||||
            <li>
 | 
			
		||||
               <add-address
 | 
			
		||||
@@ -51,8 +43,8 @@
 | 
			
		||||
               </button>
 | 
			
		||||
            </li>
 | 
			
		||||
         </ul>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      </div>
 | 
			
		||||
   </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@@ -104,9 +96,6 @@ export default {
 | 
			
		||||
      isPersonLocation() {
 | 
			
		||||
         return this.accompanyingCourse.locationStatus === 'person';
 | 
			
		||||
      },
 | 
			
		||||
      hasNoLocation() {
 | 
			
		||||
         return this.accompanyingCourse.locationStatus === 'none';
 | 
			
		||||
      },
 | 
			
		||||
      isContextEdit() {
 | 
			
		||||
         return this.context.edit;
 | 
			
		||||
      }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
<template>
 | 
			
		||||
   <div class="vue-component">
 | 
			
		||||
      <h2><a name="section-30"></a>{{ $t('origin.title') }}</h2>
 | 
			
		||||
      <h2><a name="section-20"></a>{{ $t('origin.title') }}</h2>
 | 
			
		||||
 | 
			
		||||
      <div class="mb-4">
 | 
			
		||||
      <div class="my-4">
 | 
			
		||||
         <label for="selectOrigin">
 | 
			
		||||
            {{ $t('origin.label') }}
 | 
			
		||||
         </label>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,22 +2,29 @@
 | 
			
		||||
<div class="vue-component">
 | 
			
		||||
   <h2><a name="section-10"></a>{{ $t('persons_associated.title')}}</h2>
 | 
			
		||||
 | 
			
		||||
   <div v-if="participations.length > 0">
 | 
			
		||||
   <div>
 | 
			
		||||
      <label class="col-form-label">{{ $tc('persons_associated.counter', counter) }}</label>
 | 
			
		||||
   </div>
 | 
			
		||||
   <div v-else>
 | 
			
		||||
      <label class="chill-no-data-statement">{{ $tc('persons_associated.counter', counter) }}</label>
 | 
			
		||||
   </div>
 | 
			
		||||
 | 
			
		||||
   <div class="flex-table mb-3">
 | 
			
		||||
      <participation-item
 | 
			
		||||
         v-for="participation in participations"
 | 
			
		||||
         v-bind:participation="participation"
 | 
			
		||||
         v-bind:key="participation.id"
 | 
			
		||||
         @remove="removeParticipation"
 | 
			
		||||
         @close="closeParticipation">
 | 
			
		||||
      </participation-item>
 | 
			
		||||
   </div>
 | 
			
		||||
   <table class="table table-bordered table-striped border-dark align-middle" v-if="participations.length > 0">
 | 
			
		||||
      <thead>
 | 
			
		||||
         <tr>
 | 
			
		||||
            <th class="chill-orange">{{ $t('persons_associated.name') }}</th>
 | 
			
		||||
            <th class="chill-orange">{{ $t('persons_associated.startdate') }}</th>
 | 
			
		||||
            <th class="chill-orange">{{ $t('persons_associated.enddate') }}</th>
 | 
			
		||||
            <th class="chill-orange">{{ $t('action.actions') }}</th>
 | 
			
		||||
         </tr>
 | 
			
		||||
      </thead>
 | 
			
		||||
      <tbody>
 | 
			
		||||
         <person-item
 | 
			
		||||
            v-for="participation in participations"
 | 
			
		||||
            v-bind:participation="participation"
 | 
			
		||||
            v-bind:key="participation.id"
 | 
			
		||||
            @remove="removeParticipation"
 | 
			
		||||
            @close="closeParticipation">
 | 
			
		||||
         </person-item>
 | 
			
		||||
      </tbody>
 | 
			
		||||
   </table>
 | 
			
		||||
 | 
			
		||||
   <div>
 | 
			
		||||
      <add-persons
 | 
			
		||||
@@ -35,13 +42,13 @@
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { mapState } from 'vuex';
 | 
			
		||||
import ParticipationItem from "./PersonsAssociated/ParticipationItem.vue"
 | 
			
		||||
import PersonItem from "./PersonsAssociated/PersonItem.vue"
 | 
			
		||||
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
   name: 'PersonsAssociated',
 | 
			
		||||
   components: {
 | 
			
		||||
      ParticipationItem,
 | 
			
		||||
      PersonItem,
 | 
			
		||||
      AddPersons
 | 
			
		||||
   },
 | 
			
		||||
   data() {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,111 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
   <person-render-box
 | 
			
		||||
      :options="{
 | 
			
		||||
               addInfo : true,
 | 
			
		||||
               addId : false,
 | 
			
		||||
               addEntity: false,
 | 
			
		||||
               addLink: false,
 | 
			
		||||
               addAltNames: true,
 | 
			
		||||
               addAge : false,
 | 
			
		||||
               hLevel : 3,
 | 
			
		||||
            }"
 | 
			
		||||
      :person="participation.person">
 | 
			
		||||
 | 
			
		||||
      <template v-slot:record-actions>
 | 
			
		||||
         <ul class="record_actions">
 | 
			
		||||
            <button-location
 | 
			
		||||
               v-if="hasCurrentHouseholdAddress"
 | 
			
		||||
               v-bind:person="participation.person">
 | 
			
		||||
            </button-location>
 | 
			
		||||
            <li>
 | 
			
		||||
               <on-the-fly
 | 
			
		||||
                  v-bind:type="participation.person.type"
 | 
			
		||||
                  v-bind:id="participation.person.id"
 | 
			
		||||
                  action="show">
 | 
			
		||||
               </on-the-fly>
 | 
			
		||||
            </li>
 | 
			
		||||
            <li>
 | 
			
		||||
               <on-the-fly
 | 
			
		||||
                  v-bind:type="participation.person.type"
 | 
			
		||||
                  v-bind:id="participation.person.id"
 | 
			
		||||
                  action="edit">
 | 
			
		||||
               </on-the-fly>
 | 
			
		||||
            </li>
 | 
			
		||||
            <!-- <li>
 | 
			
		||||
               <button class="btn btn-delete"
 | 
			
		||||
                  :title="$t('action.delete')"
 | 
			
		||||
                  @click.prevent="$emit('remove', participation)">
 | 
			
		||||
               </button>
 | 
			
		||||
            </li> -->
 | 
			
		||||
            <li>
 | 
			
		||||
               <button v-if="!participation.endDate"
 | 
			
		||||
                  class="btn btn-sm btn-remove"
 | 
			
		||||
                  v-bind:title="$t('action.remove')"
 | 
			
		||||
                  @click.prevent="$emit('close', participation)">
 | 
			
		||||
               </button>
 | 
			
		||||
               <button v-else
 | 
			
		||||
                  class="btn btn-sm btn-remove disabled"></button>
 | 
			
		||||
            </li>
 | 
			
		||||
         </ul>
 | 
			
		||||
 | 
			
		||||
      </template>
 | 
			
		||||
   </person-render-box>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
 | 
			
		||||
import ButtonLocation from '../ButtonLocation.vue';
 | 
			
		||||
import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
   name: 'ParticipationItem',
 | 
			
		||||
   components: {
 | 
			
		||||
      OnTheFly,
 | 
			
		||||
      ButtonLocation,
 | 
			
		||||
      PersonRenderBox
 | 
			
		||||
   },
 | 
			
		||||
   props: ['participation'],
 | 
			
		||||
   emits: ['remove', 'close'],
 | 
			
		||||
   data() {
 | 
			
		||||
      return {
 | 
			
		||||
         PersonRenderBox: {
 | 
			
		||||
            participation: 'participation',
 | 
			
		||||
            options: {
 | 
			
		||||
               addInfo: false,
 | 
			
		||||
               addId: true,
 | 
			
		||||
               addAge: false,
 | 
			
		||||
               hLevel: 1
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
   },
 | 
			
		||||
   computed: {
 | 
			
		||||
      hasCurrentHouseholdAddress() {
 | 
			
		||||
         if ( !this.participation.endDate
 | 
			
		||||
            && this.participation.person.current_household_address !== null ) {
 | 
			
		||||
            return true;
 | 
			
		||||
         }
 | 
			
		||||
         return false;
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  dates of participation
 | 
			
		||||
 *
 | 
			
		||||
 *   :title="$t('persons_associated.date_start_to_end', {
 | 
			
		||||
 *      start: $d(participation.startDate.datetime, 'short'),
 | 
			
		||||
 *      end: $d(participation.endDate.datetime, 'short')
 | 
			
		||||
 *   })"
 | 
			
		||||
 *
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *      <td><span v-if="participation.startDate">
 | 
			
		||||
 *          {{ $d(participation.startDate.datetime, 'short') }}</span>
 | 
			
		||||
 *      </td>
 | 
			
		||||
 *      <td><span v-if="participation.endDate">
 | 
			
		||||
 *          {{ $d(participation.endDate.datetime, 'short') }}</span>
 | 
			
		||||
 *      </td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *
 | 
			
		||||
*/
 | 
			
		||||
</script>
 | 
			
		||||
@@ -0,0 +1,74 @@
 | 
			
		||||
<template>
 | 
			
		||||
<tr>
 | 
			
		||||
   <td>
 | 
			
		||||
      {{ participation.person.firstName }}
 | 
			
		||||
      {{ participation.person.lastName }}
 | 
			
		||||
   </td>
 | 
			
		||||
   <td><span v-if="participation.startDate">
 | 
			
		||||
       {{ $d(participation.startDate.datetime, 'short') }}</span>
 | 
			
		||||
   </td>
 | 
			
		||||
   <td><span v-if="participation.endDate">
 | 
			
		||||
       {{ $d(participation.endDate.datetime, 'short') }}</span>
 | 
			
		||||
   </td>
 | 
			
		||||
   <td>
 | 
			
		||||
      <ul class="record_actions">
 | 
			
		||||
         <button-location
 | 
			
		||||
            v-if="hasCurrentHouseholdAddress"
 | 
			
		||||
            v-bind:person="participation.person">
 | 
			
		||||
         </button-location>
 | 
			
		||||
         <li>
 | 
			
		||||
            <on-the-fly
 | 
			
		||||
               v-bind:type="participation.person.type"
 | 
			
		||||
               v-bind:id="participation.person.id"
 | 
			
		||||
               action="show">
 | 
			
		||||
            </on-the-fly>
 | 
			
		||||
         </li>
 | 
			
		||||
         <li>
 | 
			
		||||
            <on-the-fly
 | 
			
		||||
               v-bind:type="participation.person.type"
 | 
			
		||||
               v-bind:id="participation.person.id"
 | 
			
		||||
               action="edit">
 | 
			
		||||
            </on-the-fly>
 | 
			
		||||
         </li>
 | 
			
		||||
         <!--li>
 | 
			
		||||
            <button class="btn btn-delete"
 | 
			
		||||
               :title="$t('action.delete')"
 | 
			
		||||
               @click.prevent="$emit('remove', participation)">
 | 
			
		||||
            </button>
 | 
			
		||||
         </li-->
 | 
			
		||||
         <li>
 | 
			
		||||
            <button v-if="!participation.endDate"
 | 
			
		||||
               class="btn btn-sm btn-remove"
 | 
			
		||||
               v-bind:title="$t('action.remove')"
 | 
			
		||||
               @click.prevent="$emit('close', participation)">
 | 
			
		||||
            </button>
 | 
			
		||||
            <button v-else class="btn btn-sm btn-remove" disabled></button>
 | 
			
		||||
         </li>
 | 
			
		||||
      </ul>
 | 
			
		||||
   </td>
 | 
			
		||||
</tr>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
 | 
			
		||||
import ButtonLocation from '../ButtonLocation.vue';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
   name: 'PersonItem',
 | 
			
		||||
   components: {
 | 
			
		||||
      OnTheFly,
 | 
			
		||||
      ButtonLocation
 | 
			
		||||
   },
 | 
			
		||||
   props: ['participation'],
 | 
			
		||||
   emits: ['remove', 'close'],
 | 
			
		||||
   computed: {
 | 
			
		||||
      hasCurrentHouseholdAddress() {
 | 
			
		||||
         if ( !this.participation.endDate
 | 
			
		||||
            && this.participation.person.current_household_address !== null ) {
 | 
			
		||||
            return true;
 | 
			
		||||
         }
 | 
			
		||||
         return false;
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
<div class="vue-component">
 | 
			
		||||
   <h2><a name="section-60"></a>{{ $t('referrer.title') }}</h2>
 | 
			
		||||
 | 
			
		||||
   <div>
 | 
			
		||||
   <div class="my-4">
 | 
			
		||||
      <label class="col-form-label" for="selectReferrer">
 | 
			
		||||
         {{ $t('referrer.label') }}
 | 
			
		||||
      </label>
 | 
			
		||||
@@ -18,9 +18,7 @@
 | 
			
		||||
         v-bind:options="options"
 | 
			
		||||
         @select="updateReferrer">
 | 
			
		||||
      </VueMultiselect>
 | 
			
		||||
   </div>
 | 
			
		||||
 | 
			
		||||
   <div>
 | 
			
		||||
      <ul class="record_actions">
 | 
			
		||||
         <li>
 | 
			
		||||
            <button
 | 
			
		||||
@@ -32,8 +30,8 @@
 | 
			
		||||
            </button>
 | 
			
		||||
         </li>
 | 
			
		||||
      </ul>
 | 
			
		||||
   </div>
 | 
			
		||||
 | 
			
		||||
   </div>
 | 
			
		||||
</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,58 +1,17 @@
 | 
			
		||||
<template>
 | 
			
		||||
<div class="vue-component">
 | 
			
		||||
<!-- {{ accompanyingCourse.requestor }} -->
 | 
			
		||||
   <h2><a name="section-40"></a>{{ $t('requestor.title') }}</h2>
 | 
			
		||||
 | 
			
		||||
   <h2><a name="section-30"></a>{{ $t('requestor.title') }}</h2>
 | 
			
		||||
 | 
			
		||||
   <div v-if="accompanyingCourse.requestor" class="flex-table">
 | 
			
		||||
 | 
			
		||||
      <label>
 | 
			
		||||
         <input type="checkbox" v-model="isAnonymous" class="me-2" />
 | 
			
		||||
         <input type="checkbox" v-model="isAnonymous" class="me-2" /><!--  :value="value" -->
 | 
			
		||||
         {{ $t('requestor.is_anonymous') }}
 | 
			
		||||
      </label>
 | 
			
		||||
      
 | 
			
		||||
      <third-party-render-box v-if="accompanyingCourse.requestor.type == 'thirdparty'"
 | 
			
		||||
         :thirdparty="accompanyingCourse.requestor"
 | 
			
		||||
         :options="{
 | 
			
		||||
            addLink: false,
 | 
			
		||||
            addId: false,
 | 
			
		||||
            addEntity: true,
 | 
			
		||||
            addInfo: true,
 | 
			
		||||
            hLevel: 3,
 | 
			
		||||
            isMultiline: true
 | 
			
		||||
            }"
 | 
			
		||||
      >
 | 
			
		||||
      <template v-slot:record-actions>
 | 
			
		||||
         <ul class="record_actions">
 | 
			
		||||
            <button-location v-if="hasCurrentHouseholdAddress" :thirdparty="accompanyingCourse.requestor"></button-location>
 | 
			
		||||
            <li><on-the-fly :type="accompanyingCourse.requestor.type" :id="accompanyingCourse.requestor.id" action="show"></on-the-fly></li>
 | 
			
		||||
            <li><on-the-fly :type="accompanyingCourse.requestor.type" :id="accompanyingCourse.requestor.id" action="edit"></on-the-fly></li>
 | 
			
		||||
         </ul>
 | 
			
		||||
      </template>
 | 
			
		||||
      </third-party-render-box>
 | 
			
		||||
 | 
			
		||||
      <person-render-box v-else-if="accompanyingCourse.requestor.type == 'person'"
 | 
			
		||||
         :person="accompanyingCourse.requestor"
 | 
			
		||||
         :options="{
 | 
			
		||||
            addLink: false,
 | 
			
		||||
            addId: false,
 | 
			
		||||
            addAltNames: false,
 | 
			
		||||
            addEntity: true,
 | 
			
		||||
            addInfo: true,
 | 
			
		||||
            hLevel: 3,
 | 
			
		||||
            isMultiline: true
 | 
			
		||||
            }"
 | 
			
		||||
      >
 | 
			
		||||
      <template v-slot:record-actions>
 | 
			
		||||
         <ul class="record_actions">
 | 
			
		||||
            <button-location v-if="hasCurrentHouseholdAddress" :person="accompanyingCourse.requestor"></button-location>
 | 
			
		||||
            <li><on-the-fly :type="accompanyingCourse.requestor.type" :id="accompanyingCourse.requestor.id" action="show"></on-the-fly></li>
 | 
			
		||||
            <li><on-the-fly :type="accompanyingCourse.requestor.type" :id="accompanyingCourse.requestor.id" action="edit"></on-the-fly></li>
 | 
			
		||||
         </ul>
 | 
			
		||||
      </template>
 | 
			
		||||
      </person-render-box>
 | 
			
		||||
      
 | 
			
		||||
 | 
			
		||||
         <!-- <h4>
 | 
			
		||||
      <div class="item-bloc">
 | 
			
		||||
         <h4>
 | 
			
		||||
            <span class="badge rounded-pill bg-secondary">{{ accompanyingCourse.requestor.type }}</span>
 | 
			
		||||
            {{ accompanyingCourse.requestor.text }}
 | 
			
		||||
         </h4>
 | 
			
		||||
@@ -95,8 +54,8 @@
 | 
			
		||||
                  action="edit">
 | 
			
		||||
               </on-the-fly>
 | 
			
		||||
            </li>
 | 
			
		||||
         </ul> -->
 | 
			
		||||
 | 
			
		||||
         </ul>
 | 
			
		||||
      </div>
 | 
			
		||||
      <ul class="record_actions">
 | 
			
		||||
         <li>
 | 
			
		||||
            <button class="btn btn-remove"
 | 
			
		||||
@@ -108,7 +67,7 @@
 | 
			
		||||
      </ul>
 | 
			
		||||
   </div>
 | 
			
		||||
   <div v-else>
 | 
			
		||||
      <label class="chill-no-data-statement">{{ $t('requestor.counter') }}</label>
 | 
			
		||||
      <label>{{ $t('requestor.counter') }}</label>
 | 
			
		||||
   </div>
 | 
			
		||||
 | 
			
		||||
   <div>
 | 
			
		||||
@@ -128,16 +87,12 @@
 | 
			
		||||
<script>
 | 
			
		||||
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
 | 
			
		||||
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
 | 
			
		||||
import PersonRenderBox from '../../_components/Entity/PersonRenderBox.vue';
 | 
			
		||||
import ThirdPartyRenderBox from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyRenderBox.vue';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
   name: 'Requestor',
 | 
			
		||||
   components: {
 | 
			
		||||
      AddPersons,
 | 
			
		||||
      OnTheFly,
 | 
			
		||||
      PersonRenderBox,
 | 
			
		||||
      ThirdPartyRenderBox,
 | 
			
		||||
      OnTheFly
 | 
			
		||||
   },
 | 
			
		||||
   data() {
 | 
			
		||||
      return {
 | 
			
		||||
 
 | 
			
		||||
@@ -3,21 +3,28 @@
 | 
			
		||||
 | 
			
		||||
   <h2><a name="section-70"></a>{{ $t('resources.title')}}</h2>
 | 
			
		||||
 | 
			
		||||
   <div v-if="resources.length > 0">
 | 
			
		||||
   <div>
 | 
			
		||||
      <label class="col-form-label">{{ $tc('resources.counter', counter) }}</label>
 | 
			
		||||
   </div>
 | 
			
		||||
   <div v-else>
 | 
			
		||||
      <label class="chill-no-data-statement">{{ $tc('resources.counter', counter) }}</label>
 | 
			
		||||
   </div>
 | 
			
		||||
 | 
			
		||||
   <div class="flex-table mb-3">
 | 
			
		||||
      <resource-item
 | 
			
		||||
         v-for="resource in resources"
 | 
			
		||||
         v-bind:resource="resource"
 | 
			
		||||
         v-bind:key="resource.id"
 | 
			
		||||
         @remove="removeResource">
 | 
			
		||||
      </resource-item>
 | 
			
		||||
   </div>
 | 
			
		||||
   <table class="table table-bordered table-striped border-dark align-middle" v-if="resources.length > 0">
 | 
			
		||||
      <thead>
 | 
			
		||||
         <tr>
 | 
			
		||||
            <th class="chill-orange">{{ $t('resources.text') }}</th>
 | 
			
		||||
            <th class="chill-orange">{{ $t('resources.description') }}</th>
 | 
			
		||||
            <th class="chill-orange">{{ $t('action.actions') }}</th>
 | 
			
		||||
         </tr>
 | 
			
		||||
      </thead>
 | 
			
		||||
      <tbody>
 | 
			
		||||
         <resource-item
 | 
			
		||||
            v-for="resource in resources"
 | 
			
		||||
            v-bind:resource="resource"
 | 
			
		||||
            v-bind:key="resource.id"
 | 
			
		||||
            @remove="removeResource">
 | 
			
		||||
         </resource-item>
 | 
			
		||||
      </tbody>
 | 
			
		||||
   </table>
 | 
			
		||||
 | 
			
		||||
   <div>
 | 
			
		||||
      <add-persons
 | 
			
		||||
        buttonTitle="resources.add_resources"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,54 +1,71 @@
 | 
			
		||||
<template>
 | 
			
		||||
   <person-render-box
 | 
			
		||||
      v-if="resource.resource.type === 'person'"
 | 
			
		||||
      :person="resource.resource"
 | 
			
		||||
      :options="{ addInfo : true, addId : false, addEntity: true, addLink: false, addAltNames: true, addAge : false, hLevel : 3 }"
 | 
			
		||||
      >
 | 
			
		||||
      <template v-slot:record-actions>
 | 
			
		||||
         <ul class="record_actions">
 | 
			
		||||
            <button-location v-if="hasCurrentHouseholdAddress" :person="resource.resource"></button-location>
 | 
			
		||||
            <li><on-the-fly :type="resource.resource.type" :id="resource.resource.id" action="show"></on-the-fly></li>
 | 
			
		||||
            <li><on-the-fly :type="resource.resource.type" :id="resource.resource.id" action="edit"></on-the-fly></li>
 | 
			
		||||
            <li><button class="btn btn-sm btn-remove" :title="$t('action.remove')" @click.prevent="$emit('remove', resource)"></button></li>
 | 
			
		||||
         </ul>
 | 
			
		||||
      </template>
 | 
			
		||||
<tr>
 | 
			
		||||
 | 
			
		||||
   </person-render-box>
 | 
			
		||||
   <third-party-render-box
 | 
			
		||||
      v-if="resource.resource.type === 'thirdparty'"
 | 
			
		||||
      :thirdparty="resource.resource"
 | 
			
		||||
      :options="{ addLink : false, addId : false, addEntity: true, addInfo: true, hLevel: 3 }"
 | 
			
		||||
      >
 | 
			
		||||
      <template v-slot:record-actions>
 | 
			
		||||
         <ul class="record_actions">
 | 
			
		||||
            <li><on-the-fly :type="resource.resource.type" :id="resource.resource.id" action="show"></on-the-fly></li>
 | 
			
		||||
            <li><on-the-fly :type="resource.resource.type" :id="resource.resource.id" action="edit"></on-the-fly></li>
 | 
			
		||||
            <li><button class="btn btn-sm btn-remove" :title="$t('action.remove')" @click.prevent="$emit('remove', resource)"></button></li>
 | 
			
		||||
         </ul>
 | 
			
		||||
      </template>
 | 
			
		||||
   <td>
 | 
			
		||||
      <span class="badge rounded-pill bg-secondary"
 | 
			
		||||
         v-bind:title="resource.resource.id">
 | 
			
		||||
         <span v-if="resource.resource.type === 'person'" >{{ $t('item.type_person') }}</span>
 | 
			
		||||
         <span v-if="resource.resource.type === 'thirdparty'" >{{ $t('item.type_thirdparty') }}</span>
 | 
			
		||||
      </span>
 | 
			
		||||
      {{ resource.resource.text }}
 | 
			
		||||
   </td>
 | 
			
		||||
 | 
			
		||||
   </third-party-render-box>
 | 
			
		||||
   <td v-if="resource.resource.type === 'person'">
 | 
			
		||||
      {{ $tc('person.born') }}{{ $d(resource.resource.birthdate.datetime, 'short') }}
 | 
			
		||||
   </td>
 | 
			
		||||
   <td v-else-if="resource.resource.type === 'thirdparty'">
 | 
			
		||||
      {{ resource.resource.address.text }}<br>
 | 
			
		||||
      {{ resource.resource.address.postcode.name }}
 | 
			
		||||
   </td>
 | 
			
		||||
 | 
			
		||||
   <td>
 | 
			
		||||
      <ul class="record_actions">
 | 
			
		||||
         <button-location
 | 
			
		||||
            v-if="hasCurrentHouseholdAddress"
 | 
			
		||||
            v-bind:person="resource.resource">
 | 
			
		||||
         </button-location>
 | 
			
		||||
         <li>
 | 
			
		||||
            <on-the-fly
 | 
			
		||||
               v-bind:type="resource.resource.type"
 | 
			
		||||
               v-bind:id="resource.resource.id"
 | 
			
		||||
               action="show">
 | 
			
		||||
            </on-the-fly>
 | 
			
		||||
         </li>
 | 
			
		||||
         <li>
 | 
			
		||||
            <on-the-fly
 | 
			
		||||
               v-bind:type="resource.resource.type"
 | 
			
		||||
               v-bind:id="resource.resource.id"
 | 
			
		||||
               action="edit">
 | 
			
		||||
            </on-the-fly>
 | 
			
		||||
         </li>
 | 
			
		||||
         <li>
 | 
			
		||||
            <button
 | 
			
		||||
               class="btn btn-sm btn-remove"
 | 
			
		||||
               v-bind:title="$t('action.remove')"
 | 
			
		||||
               @click.prevent="$emit('remove', resource)">
 | 
			
		||||
            </button>
 | 
			
		||||
         </li>
 | 
			
		||||
      </ul>
 | 
			
		||||
   </td>
 | 
			
		||||
</tr>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
 | 
			
		||||
import ButtonLocation from '../ButtonLocation.vue';
 | 
			
		||||
import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue';
 | 
			
		||||
import ThirdPartyRenderBox from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyRenderBox.vue';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
   name: 'ResourceItem',
 | 
			
		||||
   components: {
 | 
			
		||||
      OnTheFly,
 | 
			
		||||
      ButtonLocation,
 | 
			
		||||
      PersonRenderBox,
 | 
			
		||||
      ThirdPartyRenderBox
 | 
			
		||||
      ButtonLocation
 | 
			
		||||
   },
 | 
			
		||||
   props: ['resource'],
 | 
			
		||||
   emits: ['remove'],
 | 
			
		||||
   computed: {
 | 
			
		||||
      hasCurrentHouseholdAddress() {
 | 
			
		||||
         if ( this.resource.resource.current_household_address !== null ) {
 | 
			
		||||
         if ( !this.resource.resource.type === 'person'
 | 
			
		||||
            && this.resource.resource.current_household_address !== null ) {
 | 
			
		||||
            return true;
 | 
			
		||||
         }
 | 
			
		||||
         return false;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="vue-component">
 | 
			
		||||
     <h2><a name="section-50"></a>{{ $t('social_issue.title') }}</h2>
 | 
			
		||||
     <h2><a name="section-40"></a>{{ $t('social_issue.title') }}</h2>
 | 
			
		||||
 | 
			
		||||
     <div class="my-4">
 | 
			
		||||
        <!--label for="field">{{ $t('social_issue.label') }}</label
 | 
			
		||||
 
 | 
			
		||||
@@ -1,14 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "vendor_name/AccompanyingCourse",
 | 
			
		||||
  "description": "description",
 | 
			
		||||
  "minimum-stability": "stable",
 | 
			
		||||
  "license": "proprietary",
 | 
			
		||||
  "authors": [
 | 
			
		||||
    {
 | 
			
		||||
      "name": "mat",
 | 
			
		||||
      "email": "email@example.com"
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "require": {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@@ -34,14 +34,13 @@ const appMessages = {
 | 
			
		||||
      },
 | 
			
		||||
      persons_associated: {
 | 
			
		||||
         title: "Usagers concernés",
 | 
			
		||||
         counter: "Il n'y a pas encore d'usagers | 1 usager | {count} usagers",
 | 
			
		||||
         counter: "Il n'y a pas encore d'usager | 1 usager | {count} usagers",
 | 
			
		||||
         firstname: "Prénom",
 | 
			
		||||
         lastname: "Nom",
 | 
			
		||||
         name: "Nom",
 | 
			
		||||
         startdate: "Date d'entrée",
 | 
			
		||||
         enddate: "Date de sortie",
 | 
			
		||||
         add_persons: "Ajouter des usagers",
 | 
			
		||||
         date_start_to_end: "Participation du {start} au {end}",
 | 
			
		||||
      },
 | 
			
		||||
      requestor: {
 | 
			
		||||
         title: "Demandeur",
 | 
			
		||||
@@ -71,12 +70,11 @@ const appMessages = {
 | 
			
		||||
         edit_temporary_address: "Modifier l'adresse temporaire",
 | 
			
		||||
         assign_course_address: "Désigner comme l'adresse du parcours",
 | 
			
		||||
         remove_button: "Enlever l'adresse",
 | 
			
		||||
         temporary_address_must_be_changed: "Cette addresse est temporaire et devrait être remplacée par celle d'un usager de référence.",
 | 
			
		||||
         temporary_address_must_be_changed: "Cette addresse est temporaire et doit être remplacée par celle d'un usager de référence.",
 | 
			
		||||
         sure: "Êtes-vous sûr ?",
 | 
			
		||||
         sure_description: "Voulez-vous faire de cette adresse l'adresse du parcours ?",
 | 
			
		||||
         ok: "Désigner comme adresse du parcours",
 | 
			
		||||
         person_locator: "Parcours localisé auprès de {0}",
 | 
			
		||||
         no_address: "Il n'y a pas d'adresse associée au parcours"
 | 
			
		||||
      },
 | 
			
		||||
      referrer: {
 | 
			
		||||
         title: "Référent du parcours",
 | 
			
		||||
@@ -99,28 +97,13 @@ const appMessages = {
 | 
			
		||||
      },
 | 
			
		||||
      confirm: {
 | 
			
		||||
         title: "Confirmation",
 | 
			
		||||
         text_draft: "Le parcours est actuellement à l'état de <b>{0}</b>.",
 | 
			
		||||
         text_active: "En validant cette étape, vous lui donnez le statut <b>{0}</b>.",
 | 
			
		||||
         alert_validation: "Certaines conditions ne sont pas remplies pour pouvoir confirmer le parcours :",
 | 
			
		||||
         participation_not_valid: "sélectionnez au minimum 1 usager",
 | 
			
		||||
         socialIssue_not_valid: "sélectionnez au minimum une problématique sociale",
 | 
			
		||||
         location_not_valid: "indiquez au minimum une localisation temporaire du parcours",
 | 
			
		||||
         text_draft: "Le parcours est actuellement à l'état de ",
 | 
			
		||||
         text_active: "En validant cette étape, vous lui donnez le statut ",
 | 
			
		||||
         sure: "Êtes-vous sûr ?",
 | 
			
		||||
         sure_description: "Une fois le changement confirmé, il ne sera plus possible de le remettre à l'état de brouillon !",
 | 
			
		||||
         sure_description: "Une fois le changement confirmé, il n'est plus possible de le remettre à l'état de brouillon !",
 | 
			
		||||
         ok: "Confirmer le parcours"
 | 
			
		||||
      },
 | 
			
		||||
      // catch errors
 | 
			
		||||
      'Error while updating AccompanyingPeriod Course.': "Erreur du serveur lors de la mise à jour du parcours d'accompagnement.",
 | 
			
		||||
      'Error while retriving AccompanyingPeriod Course.': "Erreur du serveur lors du chargement du parcours d'accompagnement.",
 | 
			
		||||
      'Error while confirming AccompanyingPeriod Course.': "Erreur du serveur lors de la confirmation du parcours d'accompagnement.",
 | 
			
		||||
      'Error while retriving Social Issues.': "Erreur du serveur lors du chargement des problématique sociales.",
 | 
			
		||||
      'Error while sending AccompanyingPeriod Course participation.': "Erreur du serveur lors de l'envoi des infos d'un usager.",
 | 
			
		||||
      'Error while sending AccompanyingPeriod Course requestor': "Erreur du serveur lors de l'envoi des infos du demandeur.",
 | 
			
		||||
      'Error while sending AccompanyingPeriod Course resource.': "Erreur du serveur lors de l'envoi des infos d'un interlocuteur privilégié.",
 | 
			
		||||
      'Error while updating SocialIssue.': "Erreur du serveur lors de la mise à jour d'une problématique sociale.",
 | 
			
		||||
      'Error while retriving users.': "Erreur du serveur lors du chargement de la liste des travailleurs.",
 | 
			
		||||
      'Error while getting whoami.': "Erreur du serveur lors de la requête 'qui suis-je ?'",
 | 
			
		||||
      'Error while retriving origin\'s list.': "Erreur du serveur lors du chargement de la liste des origines de la demande.",
 | 
			
		||||
 | 
			
		||||
   }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -25,33 +25,9 @@ let initPromise = getAccompanyingCourse(id)
 | 
			
		||||
            errorMsg: []
 | 
			
		||||
         },
 | 
			
		||||
         getters: {
 | 
			
		||||
            isParticipationValid(state) {
 | 
			
		||||
               return state.accompanyingCourse.participations.length > 0;
 | 
			
		||||
            },
 | 
			
		||||
            isSocialIssueValid(state) {
 | 
			
		||||
               return state.accompanyingCourse.socialIssues.length > 0;
 | 
			
		||||
            },
 | 
			
		||||
            isLocationValid(state) {
 | 
			
		||||
               return state.accompanyingCourse.location !== null;
 | 
			
		||||
            },
 | 
			
		||||
            validationKeys(state, getters) {
 | 
			
		||||
               let keys = [];
 | 
			
		||||
               if (!getters.isParticipationValid) { keys.push('participation'); }
 | 
			
		||||
               if (!getters.isLocationValid) { keys.push('location'); }
 | 
			
		||||
               if (!getters.isSocialIssueValid) { keys.push('socialIssue'); }
 | 
			
		||||
               //console.log('getter keys', keys);
 | 
			
		||||
               return keys;
 | 
			
		||||
            },
 | 
			
		||||
            isValidToBeConfirmed(state, getters) {
 | 
			
		||||
               if (getters.validationKeys.length === 0) {
 | 
			
		||||
                  return true;
 | 
			
		||||
               }
 | 
			
		||||
               return false;
 | 
			
		||||
            }
 | 
			
		||||
         },
 | 
			
		||||
         mutations: {
 | 
			
		||||
            catchError(state, error) {
 | 
			
		||||
               console.log('### mutation: a new error have been catched and pushed in store !', error);
 | 
			
		||||
               state.errorMsg.push(error);
 | 
			
		||||
            },
 | 
			
		||||
            removeParticipation(state, participation) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,48 +0,0 @@
 | 
			
		||||
// CURRENTLY NOT IN USE
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
 | 
			
		||||
        <li v-if="address" class="chill-entity entity-address">
 | 
			
		||||
            <i v-if="options.with_picto == true" class="fa fa-fw fa-map-marker"></i>
 | 
			
		||||
            <span v-if="options.render == 'list' || options.render == 'list'" :class="'address ' + {'multiline' : options.multiline === true}">
 | 
			
		||||
                
 | 
			
		||||
                    
 | 
			
		||||
                    <!-- if address.street is not empty -->
 | 
			
		||||
                    <p v-if="address.street" class="street">{{ address.street }}
 | 
			
		||||
                        <!-- if address.streetNumber is not empty -->
 | 
			
		||||
                        <span v-if="address.streetNumber" class="streetnumber">{{ address.streetNumber }}</span>
 | 
			
		||||
                    </p>
 | 
			
		||||
 | 
			
		||||
                        <!-- if options['extended_infos'] -->
 | 
			
		||||
                        <div v-if="options.extended_infos == true">
 | 
			
		||||
                            <span v-if="address.floor" class="floor">{{ address.floor }}</span>
 | 
			
		||||
                            <span v-if="address.corridor" class="corridor">{{ address.corridor }}</span>
 | 
			
		||||
                            <span v-if="address.steps" class="steps">{{ address.steps }}</span>
 | 
			
		||||
                            <span v-if="address.buildingName" class="buildingName">{{ address.buildingName }}</span>
 | 
			
		||||
                            <span v-if="address.flat" class="flat">{{ address.flat }}</span>
 | 
			
		||||
                            <span v-if="address.distribution" class="distribution">{{ address.distribution }}</span>
 | 
			
		||||
                            <span v-if="address.extra" class="extra">{{ address.extra }}</span>
 | 
			
		||||
                        </div>
 | 
			
		||||
 | 
			
		||||
                    <!-- if address.postCode is not empty -->
 | 
			
		||||
                    <div v-if="address.postCode">
 | 
			
		||||
                        <p class="postcode">
 | 
			
		||||
                            <span class="code">{{ address.postCode.code }}</span>
 | 
			
		||||
                            <span class="name">{{ address.postCode.name }}</span>
 | 
			
		||||
                        </p>
 | 
			
		||||
                        <p class="country">{{ address.postCode.country.name }}</p>
 | 
			
		||||
                    </div>
 | 
			
		||||
                
 | 
			
		||||
            </span>
 | 
			
		||||
        </li> 
 | 
			
		||||
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
 | 
			
		||||
export default{
 | 
			
		||||
    name: "AddressRenderBox",
 | 
			
		||||
    props: ['address', 'options']
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,158 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
 <div class="item-bloc">
 | 
			
		||||
    <section class="chill-entity entity-person">
 | 
			
		||||
    <div class="item-row entity-bloc">
 | 
			
		||||
 | 
			
		||||
        <div  class="item-col">
 | 
			
		||||
            <div class="entity-label">
 | 
			
		||||
 | 
			
		||||
                <div :class="'denomination h' + options.hLevel">
 | 
			
		||||
 | 
			
		||||
                   <a v-if="this.options.addLink ==  true" href="#">
 | 
			
		||||
                        <span class="firstname">{{ person.firstName }}</span>
 | 
			
		||||
                        <span class="lastname">{{ person.lastName }}</span>
 | 
			
		||||
                        <span v-if="person.altNames && options.addAltNames ==  true" class="altnames">
 | 
			
		||||
                            <span :class="'altname altname-' + altNameKey">{{ altNameLabel }}</span>
 | 
			
		||||
                        </span>
 | 
			
		||||
                    </a>
 | 
			
		||||
 | 
			
		||||
                   <span class="firstname">{{ person.firstName }}</span>
 | 
			
		||||
                   <span class="lastname">{{ person.lastName }}</span>
 | 
			
		||||
                   <span v-if="person.altNames && options.addAltNames ==  true" class="altnames">
 | 
			
		||||
                       <span :class="'altname altname-' + altNameKey">{{ altNameLabel }}</span>
 | 
			
		||||
                   </span>
 | 
			
		||||
 | 
			
		||||
                   <span v-if="options.addId ==  true" class="id-number" :title="'n° ' + person.id">{{ person.id }}</span>
 | 
			
		||||
                   <span v-if="options.addEntity ==  true" class="badge rounded-pill bg-secondary">{{ $t('renderbox.person') }}</span>
 | 
			
		||||
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <p v-if="this.options.addInfo == true" class="moreinfo">
 | 
			
		||||
                    <i :class="'fa fa-fw ' + getGenderIcon" title="{{ getGender }}"></i>
 | 
			
		||||
                    <time v-if="person.birthdate" datetime="{{ person.birthdate }}" title="{{ birthdate }}">
 | 
			
		||||
                        {{ $t(getGender) + ' ' + $d(birthdate, 'text') }}
 | 
			
		||||
                    </time>
 | 
			
		||||
                    <time v-else-if="person.deathdate" datetime="{{ person.deathdate }}" title="{{ person.deathdate }}">
 | 
			
		||||
                        {{ birthdate }} - {{ deathdate }}
 | 
			
		||||
                    </time>
 | 
			
		||||
                    <!-- <span class="age">{{ person.age }}</span> -->
 | 
			
		||||
                </p>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="item-col separator">
 | 
			
		||||
            <ul class="list-content fa-ul">
 | 
			
		||||
                
 | 
			
		||||
                <li v-if="person.current_household_address">
 | 
			
		||||
                    <i class="fa fa-li fa-map-marker"></i>
 | 
			
		||||
                    <show-address :address="person.current_household_address" :isMultiline="isMultiline"></show-address>
 | 
			
		||||
                </li>
 | 
			
		||||
                <li v-else-if="options.addNoData">
 | 
			
		||||
                    <i class="fa fa-li fa-map-marker"></i>
 | 
			
		||||
                    <p class="chill-no-data-statement">{{ $t('renderbox.no_data') }}</p>
 | 
			
		||||
                </li>
 | 
			
		||||
 | 
			
		||||
                <li v-if="person.mobilenumber">
 | 
			
		||||
                    <i class="fa fa-li fa-mobile"></i>
 | 
			
		||||
                    <a :href="'tel: ' + person.mobilenumber">{{ person.mobilenumber }}</a>
 | 
			
		||||
                </li>
 | 
			
		||||
                <li v-else-if="options.addNoData">
 | 
			
		||||
                    <i class="fa fa-li fa-mobile"></i>
 | 
			
		||||
                    <p class="chill-no-data-statement">{{ $t('renderbox.no_data') }}</p>
 | 
			
		||||
                </li>
 | 
			
		||||
                <li v-if="person.phonenumber">
 | 
			
		||||
                    <i class="fa fa-li fa-phone"></i>
 | 
			
		||||
                    <a :href="'tel: ' + person.phonenumber">{{ person.phonenumber }}</a>
 | 
			
		||||
                </li>
 | 
			
		||||
                <li v-else-if="options.addNoData">
 | 
			
		||||
                    <i class="fa fa-li fa-phone"></i>
 | 
			
		||||
                    <p class="chill-no-data-statement">{{ $t('renderbox.no_data') }}</p>
 | 
			
		||||
                </li>
 | 
			
		||||
                
 | 
			
		||||
                <li v-if="person.center && options.addCenter">
 | 
			
		||||
                    <i class="fa fa-li fa-long-arrow-right"></i>
 | 
			
		||||
                    {{ person.center.name }}
 | 
			
		||||
                </li>
 | 
			
		||||
                <li v-else-if="options.addNoData">
 | 
			
		||||
                    <i class="fa fa-li fa-long-arrow-right"></i>
 | 
			
		||||
                    <p class="chill-no-data-statement">{{ $t('renderbox.no_data') }}</p>
 | 
			
		||||
                </li>
 | 
			
		||||
                <slot name="custom-zone"></slot>
 | 
			
		||||
 | 
			
		||||
            </ul>
 | 
			
		||||
 | 
			
		||||
            <slot name="record-actions"></slot>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
    </div>
 | 
			
		||||
    </section>
 | 
			
		||||
 </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import {dateToISO} from 'ChillMainAssets/chill/js/date.js';
 | 
			
		||||
import ShowAddress from 'ChillMainAssets/vuejs/Address/components/ShowAddress.vue';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
    name: "PersonRenderBox",
 | 
			
		||||
    components: {
 | 
			
		||||
        ShowAddress
 | 
			
		||||
    },
 | 
			
		||||
    props: ['person', 'options'],
 | 
			
		||||
    computed: {
 | 
			
		||||
        getGender: function() {
 | 
			
		||||
            return this.person.gender == 'woman' ? 'renderbox.birthday.woman' : 'renderbox.birthday.man';
 | 
			
		||||
        },
 | 
			
		||||
        isMultiline: function() {
 | 
			
		||||
            if(this.options.isMultiline){
 | 
			
		||||
                return this.options.isMultiline
 | 
			
		||||
            } else {
 | 
			
		||||
                return false
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        getGenderIcon: function() {
 | 
			
		||||
            return this.person.gender == 'woman' ? 'fa-venus' : this.person.gender == 'man' ? 'fa-mars' : 'fa-neuter';
 | 
			
		||||
        },
 | 
			
		||||
        birthdate: function(){
 | 
			
		||||
            var date = new Date(this.person.birthdate.datetime);
 | 
			
		||||
            return dateToISO(date);
 | 
			
		||||
        },
 | 
			
		||||
        deathdate: function(){
 | 
			
		||||
            var date = new Date(this.person.deathdate.datetime);
 | 
			
		||||
            return dateToISO(date);
 | 
			
		||||
        },
 | 
			
		||||
        altNameLabel: function(){
 | 
			
		||||
            for(let i = 0; i < this.person.altNames.length; i++){
 | 
			
		||||
                return this.person.altNames[i].label
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        altNameKey: function(){
 | 
			
		||||
            for(let i = 0; i < this.person.altNames.length; i++){
 | 
			
		||||
                return this.person.altNames[i].key
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang='scss'>
 | 
			
		||||
.lastname:before{
 | 
			
		||||
    content: " "
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
div.item-col:first-child{
 | 
			
		||||
    width: 33%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
div.flex-table {
 | 
			
		||||
   div.item-bloc {
 | 
			
		||||
      div.item-row {
 | 
			
		||||
         div.item-col:last-child {
 | 
			
		||||
            justify-content: flex-start;
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -1,23 +1,57 @@
 | 
			
		||||
<template>
 | 
			
		||||
<div v-if="action === 'show'">
 | 
			
		||||
   <div class="flex-table">
 | 
			
		||||
      <person-render-box
 | 
			
		||||
         :person="person"
 | 
			
		||||
         :options="{
 | 
			
		||||
            addInfo: true,
 | 
			
		||||
            addEntity: false,
 | 
			
		||||
            addAltNames: true,
 | 
			
		||||
            addId: true,
 | 
			
		||||
            addLink: false,
 | 
			
		||||
            hLevel: 3,
 | 
			
		||||
            addCenter: true,
 | 
			
		||||
            addNoData: true,
 | 
			
		||||
            isMultiline: true
 | 
			
		||||
         }"
 | 
			
		||||
      ></person-render-box>
 | 
			
		||||
   </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
   <div class="flex-table">
 | 
			
		||||
      <div class="item-bloc">
 | 
			
		||||
         <div class="item-row">
 | 
			
		||||
            <div class="item-col">
 | 
			
		||||
               <h3 :title="person.id">{{ person.text }}</h3>
 | 
			
		||||
               <p>
 | 
			
		||||
                  <i class="fa fa-fw"
 | 
			
		||||
                     :class="genderClass">
 | 
			
		||||
                     <!--
 | 
			
		||||
                     :title="$t(genderTranslation)"
 | 
			
		||||
                     -->
 | 
			
		||||
                  </i>
 | 
			
		||||
                  <span v-if="person.birthdate">
 | 
			
		||||
                     {{ $t('person.born', { e: feminized }) }}
 | 
			
		||||
                     {{ $d(person.birthdate.datetime, 'short') }}
 | 
			
		||||
                  </span>
 | 
			
		||||
               </p>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="item-col">
 | 
			
		||||
               <dl class="list-content">
 | 
			
		||||
                  <dt>{{ $t('person.firstname') }}</dt>
 | 
			
		||||
                  <dd>{{ person.firstName }}</dd>
 | 
			
		||||
 | 
			
		||||
                  <dt>{{ $t('person.lastname') }}</dt>
 | 
			
		||||
                  <dd>{{ person.lastName }}</dd>
 | 
			
		||||
 | 
			
		||||
                  <dt>{{ $t('person.altnames') }}</dt>
 | 
			
		||||
                  <dd>{{ person.altNames }}</dd>
 | 
			
		||||
 | 
			
		||||
                  <span v-if="person.center">
 | 
			
		||||
                     <dt>{{ $t('person.center_name') }}</dt>
 | 
			
		||||
                     <dd :title="person.center.id">{{ person.center.name }}</dd>
 | 
			
		||||
                  </span>
 | 
			
		||||
 | 
			
		||||
                  <dt>{{ $t('person.phonenumber') }}</dt>
 | 
			
		||||
                  <dd>{{ person.phonenumber }}</dd>
 | 
			
		||||
 | 
			
		||||
                  <dt>{{ $t('person.mobilenumber') }}</dt>
 | 
			
		||||
                  <dd>{{ person.mobilenumber }}</dd>
 | 
			
		||||
 | 
			
		||||
                  <dt>{{ $t('person.gender.title') }}</dt>
 | 
			
		||||
                  <!--
 | 
			
		||||
                  <dd>{{ $t(genderTranslation) }}</dd>
 | 
			
		||||
                  -->
 | 
			
		||||
               </dl>
 | 
			
		||||
            </div>
 | 
			
		||||
         </div>
 | 
			
		||||
      </div>
 | 
			
		||||
   </div>
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
<div v-else-if="action === 'edit' || action === 'create'">
 | 
			
		||||
 | 
			
		||||
   <div class="form-floating mb-3">
 | 
			
		||||
@@ -75,14 +109,10 @@
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { getPerson, postPerson } from '../../_api/OnTheFly';
 | 
			
		||||
import PersonRenderBox from '../Entity/PersonRenderBox.vue';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
   name: "OnTheFlyPerson",
 | 
			
		||||
   props: ['id', 'type', 'action'],
 | 
			
		||||
   components: {
 | 
			
		||||
      PersonRenderBox
 | 
			
		||||
   },
 | 
			
		||||
   data() {
 | 
			
		||||
      return {
 | 
			
		||||
         person: {
 | 
			
		||||
@@ -174,6 +204,10 @@ export default {
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
ul {
 | 
			
		||||
   li::marker {
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
div.flex-table {
 | 
			
		||||
   div.item-bloc {
 | 
			
		||||
      div.item-row {
 | 
			
		||||
 
 | 
			
		||||
@@ -137,14 +137,13 @@
 | 
			
		||||
                {{ options['customButtons']['before'] }}
 | 
			
		||||
            {% endif %}
 | 
			
		||||
 | 
			
		||||
            {%- if options['customButtons']['replace'] is defined -%}
 | 
			
		||||
                {{ options['customButtons']['replace'] }}
 | 
			
		||||
            {%- elseif is_granted('CHILL_PERSON_SEE', person) -%}
 | 
			
		||||
            {%- if options['customButtons']['replace'] is not defined and is_granted('CHILL_PERSON_SEE', person) -%}
 | 
			
		||||
                <li>
 | 
			
		||||
                    <a class="btn btn-sm btn-show" target="_blank" title="{{ 'Show person'|trans }}"
 | 
			
		||||
                    href="{{ path('chill_person_view', { person_id: person.id }) }}"></a>
 | 
			
		||||
                </li>
 | 
			
		||||
            {%- else -%}
 | 
			
		||||
                {{ options['customButtons']['replace'] }}
 | 
			
		||||
            {%- endif -%}
 | 
			
		||||
 | 
			
		||||
            {% if options['customButtons']['after'] is defined %}
 | 
			
		||||
 
 | 
			
		||||
@@ -36,11 +36,8 @@
 | 
			
		||||
        'args' : {'person_id': person.id, 'person': person },
 | 
			
		||||
        'activeRouteKey': activeRouteKey
 | 
			
		||||
    }) }}
 | 
			
		||||
 | 
			
		||||
    {% block block_post_menu %}
 | 
			
		||||
        <div class="block-post-menu">
 | 
			
		||||
            {{ chill_delegated_block('person_post_vertical_menu', { 'person': person } ) }}
 | 
			
		||||
        </div>
 | 
			
		||||
    {% endblock %}
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    <div class="block-post-menu">
 | 
			
		||||
        {{ chill_delegated_block('person_post_vertical_menu', { 'person': person } ) }}
 | 
			
		||||
    </div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 
 | 
			
		||||
@@ -46,7 +46,7 @@ Married: Marié(e)
 | 
			
		||||
Return: Retour
 | 
			
		||||
Submit: Submit
 | 
			
		||||
Reset: 'Remise à zéro'
 | 
			
		||||
'The person data has been updated': 'Les données ont été mises à jour.'
 | 
			
		||||
'The person data has been updated': 'Bravo ! Les données ont été mises à jour.'
 | 
			
		||||
'{1} The person field %field% is incorrect. Please check. | ]1, Inf] Several person fields are incorrect. Please check.': '{1} Le champs %field% est incorrect. Veuillez le corriger. | ]1, Inf] Plusieurs champs sont incorrects. Veuillez les vérifier.'
 | 
			
		||||
'Add a person': 'Ajout d''une personne'
 | 
			
		||||
'Person Menu': 'Menu personne'
 | 
			
		||||
 
 | 
			
		||||
@@ -125,7 +125,7 @@ Show person: Voir le dossier de la personne
 | 
			
		||||
Return: Retour
 | 
			
		||||
Submit: Envoi
 | 
			
		||||
Reset: 'Remise à zéro'
 | 
			
		||||
'The person data has been updated': 'Les données ont été mises à jour.'
 | 
			
		||||
'The person data has been updated': 'Bravo ! Les données ont été mises à jour.'
 | 
			
		||||
'The person data provided are not valid': 'Les données introduites ne sont pas valides'
 | 
			
		||||
'{1} The person field %field% is incorrect. Please check. | ]1, Inf] Several person fields are incorrect. Please check.': '{1} Le champs %field% est incorrect. Veuillez le corriger. | ]1, Inf] Plusieurs champs sont incorrects. Veuillez les vérifier.'
 | 
			
		||||
'Add a person': 'Ajout d''une personne'
 | 
			
		||||
 
 | 
			
		||||
@@ -28,36 +28,36 @@ use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
 | 
			
		||||
use Chill\TaskBundle\Security\Authorization\TaskVoter;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
 * 
 | 
			
		||||
 *
 | 
			
		||||
 * @author Julien Fastré <julien.fastre@champs-libres.coop>
 | 
			
		||||
 */
 | 
			
		||||
class UserMenuBuilder implements LocalMenuBuilderInterface
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     * @var CountNotificationTask
 | 
			
		||||
     */
 | 
			
		||||
    public $counter;
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    /*
 | 
			
		||||
     * @var TokenStorageInterface
 | 
			
		||||
     */
 | 
			
		||||
    public $tokenStorage;
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     * @var TranslatorInterface
 | 
			
		||||
     */
 | 
			
		||||
    public $translator;
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     * @var AuthorizationCheckerInterface
 | 
			
		||||
     */
 | 
			
		||||
    public $authorizationChecker;
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    public function __construct(
 | 
			
		||||
        CountNotificationTask $counter,
 | 
			
		||||
        TokenStorageInterface $tokenStorage,
 | 
			
		||||
@@ -69,44 +69,44 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
 | 
			
		||||
        $this->translator = $translator;
 | 
			
		||||
        $this->authorizationChecker = $authorizationChecker;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    public static function getMenuIds(): array
 | 
			
		||||
    {
 | 
			
		||||
        return [ 'user' ];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    public function buildMenu($menuId, MenuItem $menu, array $parameters)
 | 
			
		||||
    {
 | 
			
		||||
        if (FALSE === $this->authorizationChecker->isGranted(TaskVoter::SHOW)) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        $user = $this->tokenStorage->getToken()->getUser();
 | 
			
		||||
        $ended = $this->counter->countNotificationEnded($user);
 | 
			
		||||
        $warning = $this->counter->countNotificationWarning($user);
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        if ($ended > 0) {
 | 
			
		||||
            $this->addItemInMenu(
 | 
			
		||||
                $menu,
 | 
			
		||||
                $user,
 | 
			
		||||
                '%number% tasks over deadline',
 | 
			
		||||
                $menu, 
 | 
			
		||||
                $user, 
 | 
			
		||||
                '%number% tasks over deadline', 
 | 
			
		||||
                'My tasks over deadline',
 | 
			
		||||
                SingleTaskRepository::DATE_STATUS_ENDED,
 | 
			
		||||
                $ended,
 | 
			
		||||
                $ended, 
 | 
			
		||||
                -15);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        if ($warning > 0) {
 | 
			
		||||
            $this->addItemInMenu(
 | 
			
		||||
                $menu,
 | 
			
		||||
                $user,
 | 
			
		||||
                '%number% tasks near deadline',
 | 
			
		||||
                'My tasks near deadline',
 | 
			
		||||
                $menu, 
 | 
			
		||||
                $user, 
 | 
			
		||||
                '%number% tasks near deadline', 
 | 
			
		||||
                'My tasks near deadline', 
 | 
			
		||||
                SingleTaskRepository::DATE_STATUS_WARNING,
 | 
			
		||||
                $warning,
 | 
			
		||||
                $warning, 
 | 
			
		||||
                -14);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        $menu->addChild("My tasks", [
 | 
			
		||||
                'route' => 'chill_task_single_my_tasks'
 | 
			
		||||
            ])
 | 
			
		||||
@@ -115,7 +115,6 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
 | 
			
		||||
                'icon' => 'tasks'
 | 
			
		||||
            ]);
 | 
			
		||||
 | 
			
		||||
        /*
 | 
			
		||||
        $menu->addChild("My aside activities", [
 | 
			
		||||
                'route' => 'chill_crud_aside_activity_index'
 | 
			
		||||
            ])
 | 
			
		||||
@@ -123,14 +122,13 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
 | 
			
		||||
                'order' => -10,
 | 
			
		||||
                'icon' => 'tasks'
 | 
			
		||||
            ]);
 | 
			
		||||
         */
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    protected function addItemInMenu(MenuItem $menu, User $u, $message, $title, $status, $number, $order)
 | 
			
		||||
    {
 | 
			
		||||
        if ($number > 0) {
 | 
			
		||||
            $menu->addChild(
 | 
			
		||||
                $this->translator->transChoice($message, $number),
 | 
			
		||||
                $this->translator->transChoice($message, $number), 
 | 
			
		||||
                [
 | 
			
		||||
                    'route' => 'chill_task_singletask_list',
 | 
			
		||||
                    'routeParameters' => [
 | 
			
		||||
 
 | 
			
		||||
@@ -70,6 +70,8 @@ class ThirdPartyController extends Controller
 | 
			
		||||
        $nbThirdParties = $repository->countByMemberOfCenters($centers);
 | 
			
		||||
        $pagination = $this->paginatorFactory->create($nbThirdParties);
 | 
			
		||||
        
 | 
			
		||||
        $pagination->setItemsPerPage(20);
 | 
			
		||||
        
 | 
			
		||||
        $thirdParties = $repository->findByMemberOfCenters(
 | 
			
		||||
            $centers,
 | 
			
		||||
            $pagination->getCurrentPage()->getFirstItemNumber(),
 | 
			
		||||
 
 | 
			
		||||
@@ -1,46 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Chill\ThirdPartyBundle\DataFixtures\ORM;
 | 
			
		||||
 | 
			
		||||
use Chill\ThirdPartyBundle\Entity\ThirdPartyCategory;
 | 
			
		||||
use Doctrine\Bundle\FixturesBundle\Fixture;
 | 
			
		||||
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
 | 
			
		||||
use Doctrine\Persistence\ObjectManager;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Class LoadThirdPartyCategory
 | 
			
		||||
 * @package Chill\ThirdPartyBundle\DataFixtures\ORM
 | 
			
		||||
 * @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
 | 
			
		||||
 */
 | 
			
		||||
class LoadThirdPartyCategory extends Fixture implements FixtureGroupInterface
 | 
			
		||||
{
 | 
			
		||||
    public static function getGroups(): array
 | 
			
		||||
    {
 | 
			
		||||
        return ['thirdparty_categories'];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function load(ObjectManager $manager)
 | 
			
		||||
    {
 | 
			
		||||
        $categories = [
 | 
			
		||||
            ['name' => ['fr' => "maison médicale" ]],
 | 
			
		||||
            ['name' => ['fr' => "hôpital" ]],
 | 
			
		||||
            ['name' => ['fr' => "médecin généraliste" ]],
 | 
			
		||||
            ['name' => ['fr' => "pharmacien" ]],
 | 
			
		||||
            ['name' => ['fr' => "assistance aux personnes âgées" ]],
 | 
			
		||||
            ['name' => ['fr' => "assistante maternelle" ]],
 | 
			
		||||
            ['name' => ['fr' => "assistant social" ]],
 | 
			
		||||
            ['name' => ['fr' => "éducateur spécialisé" ]],
 | 
			
		||||
            ['name' => ['fr' => "infirmier.ère" ]],
 | 
			
		||||
        ];
 | 
			
		||||
 | 
			
		||||
        foreach ( $categories as $val) {
 | 
			
		||||
            print "Creating thirdparty category : " . $val['name']['fr'] . "\n";
 | 
			
		||||
            $category = (new ThirdPartyCategory())
 | 
			
		||||
                ->setName($val['name'])
 | 
			
		||||
                ->setActive(true);
 | 
			
		||||
            $manager->persist($category);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $manager->flush();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,46 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Chill\ThirdPartyBundle\DataFixtures\ORM;
 | 
			
		||||
 | 
			
		||||
use Chill\ThirdPartyBundle\Entity\ThirdPartyCivility;
 | 
			
		||||
use Doctrine\Bundle\FixturesBundle\Fixture;
 | 
			
		||||
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
 | 
			
		||||
use Doctrine\Persistence\ObjectManager;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Class LoadThirdPartyCivility
 | 
			
		||||
 * @package Chill\ThirdPartyBundle\DataFixtures\ORM
 | 
			
		||||
 * @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
 | 
			
		||||
 */
 | 
			
		||||
class LoadThirdPartyCivility extends Fixture implements FixtureGroupInterface
 | 
			
		||||
{
 | 
			
		||||
    public static function getGroups(): array
 | 
			
		||||
    {
 | 
			
		||||
        return ['thirdparty_civilities'];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function load(ObjectManager $manager): void
 | 
			
		||||
    {
 | 
			
		||||
        $civilities = [
 | 
			
		||||
            ['name' => ['fr' => "Monsieur" ]],
 | 
			
		||||
            ['name' => ['fr' => "Madame" ]],
 | 
			
		||||
            ['name' => ['fr' => "Docteur" ]],
 | 
			
		||||
            ['name' => ['fr' => "Professeur" ]],
 | 
			
		||||
            ['name' => ['fr' => "Madame la Directrice" ]],
 | 
			
		||||
            ['name' => ['fr' => "Monsieur le Directeur" ]],
 | 
			
		||||
            ['name' => ['fr' => "Madame la Maire" ]],
 | 
			
		||||
            ['name' => ['fr' => "Monsieur le Maire" ]],
 | 
			
		||||
            ['name' => ['fr' => "Maître" ]],
 | 
			
		||||
        ];
 | 
			
		||||
 | 
			
		||||
        foreach ( $civilities as $val) {
 | 
			
		||||
            print "Creating thirdparty civility : " . $val['name']['fr'] . "\n";
 | 
			
		||||
            $civility = (new ThirdPartyCivility())
 | 
			
		||||
                ->setName($val['name'])
 | 
			
		||||
                ->setActive(true);
 | 
			
		||||
            $manager->persist($civility);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $manager->flush();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,44 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Chill\ThirdPartyBundle\DataFixtures\ORM;
 | 
			
		||||
 | 
			
		||||
use Chill\ThirdPartyBundle\Entity\ThirdPartyProfession;
 | 
			
		||||
use Doctrine\Bundle\FixturesBundle\Fixture;
 | 
			
		||||
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
 | 
			
		||||
use Doctrine\Persistence\ObjectManager;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Class LoadThirdPartyProfession
 | 
			
		||||
 * @package Chill\ThirdPartyBundle\DataFixtures\ORM
 | 
			
		||||
 * @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
 | 
			
		||||
 */
 | 
			
		||||
class LoadThirdPartyProfession extends Fixture implements FixtureGroupInterface
 | 
			
		||||
{
 | 
			
		||||
    public static function getGroups(): array
 | 
			
		||||
    {
 | 
			
		||||
        return ['thirdparty_professions'];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function load(ObjectManager $manager)
 | 
			
		||||
    {
 | 
			
		||||
        $professions = [
 | 
			
		||||
            ['name' => ['fr' => "Directeur" ]],
 | 
			
		||||
            ['name' => ['fr' => "Docteur" ]],
 | 
			
		||||
            ['name' => ['fr' => "Médecin" ]],
 | 
			
		||||
            ['name' => ['fr' => "Opérateur" ]],
 | 
			
		||||
            ['name' => ['fr' => "Personnel administratif" ]],
 | 
			
		||||
            ['name' => ['fr' => "Président" ]],
 | 
			
		||||
            ['name' => ['fr' => "Responsable infirmier.ère" ]],
 | 
			
		||||
        ];
 | 
			
		||||
 | 
			
		||||
        foreach ( $professions as $val) {
 | 
			
		||||
            print "Creating thirdparty professions : " . $val['name']['fr'] . "\n";
 | 
			
		||||
            $profession = (new ThirdPartyProfession())
 | 
			
		||||
                ->setName($val['name'])
 | 
			
		||||
                ->setActive(true);
 | 
			
		||||
            $manager->persist($profession);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $manager->flush();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -22,7 +22,6 @@
 | 
			
		||||
 | 
			
		||||
namespace Chill\ThirdPartyBundle\Entity;
 | 
			
		||||
 | 
			
		||||
use Chill\MainBundle\Entity\User;
 | 
			
		||||
use Doctrine\ORM\Mapping as ORM;
 | 
			
		||||
use Doctrine\Common\Collections\Collection;
 | 
			
		||||
use Doctrine\Common\Collections\ArrayCollection;
 | 
			
		||||
@@ -42,13 +41,13 @@ use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
 | 
			
		||||
 * @ORM\Entity(repositoryClass="Chill\ThirdPartyBundle\Repository\ThirdPartyRepository")
 | 
			
		||||
 * @DiscriminatorMap(typeProperty="type", mapping={
 | 
			
		||||
 *  "thirdparty"=ThirdParty::class
 | 
			
		||||
 * })
 | 
			
		||||
 * @ORM\HasLifecycleCallbacks()
 | 
			
		||||
 *})
 | 
			
		||||
 */
 | 
			
		||||
class ThirdParty
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var int
 | 
			
		||||
     *
 | 
			
		||||
     * @ORM\Column(name="id", type="integer")
 | 
			
		||||
     * @ORM\Id
 | 
			
		||||
     * @ORM\GeneratedValue(strategy="AUTO")
 | 
			
		||||
@@ -57,73 +56,15 @@ class ThirdParty
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var string
 | 
			
		||||
     *
 | 
			
		||||
     * @ORM\Column(name="name", type="string", length=255)
 | 
			
		||||
     * @Assert\Length(min="2")
 | 
			
		||||
     */
 | 
			
		||||
    private $name;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * [fr] Raison sociale
 | 
			
		||||
     * @var string
 | 
			
		||||
     * @ORM\Column(name="name_company", type="string", length=255, nullable=true)
 | 
			
		||||
     * @Assert\Length(min="3")
 | 
			
		||||
    */
 | 
			
		||||
    private $nameCompany;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * [fr] Sigle
 | 
			
		||||
     * @var string
 | 
			
		||||
     * @ORM\Column(name="acronym", type="string", length=64, nullable=true)
 | 
			
		||||
     * @Assert\Length(min="2")
 | 
			
		||||
    */
 | 
			
		||||
    private $acronym;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var ThirdPartyCategory
 | 
			
		||||
     * @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdPartyCategory")
 | 
			
		||||
     * @ORM\JoinTable(name="chill_3party.thirdparty_category",
 | 
			
		||||
     *     joinColumns={@ORM\JoinColumn(name="thirdparty_id", referencedColumnName="id")},
 | 
			
		||||
     *     inverseJoinColumns={@ORM\JoinColumn(name="category_id", referencedColumnName="id")})
 | 
			
		||||
    */
 | 
			
		||||
    private $categories;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var array|null
 | 
			
		||||
     * @ORM\Column(name="types", type="json", nullable=true)
 | 
			
		||||
     * @Assert\Count(min=1)
 | 
			
		||||
     */
 | 
			
		||||
    private $type;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Contact Persons: One Institutional ThirdParty has Many Contact Persons
 | 
			
		||||
     * @ORM\OneToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty", mappedBy="parent")
 | 
			
		||||
     */
 | 
			
		||||
    private Collection $children;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Institutional ThirdParty: Many Contact Persons have One Institutional ThirdParty
 | 
			
		||||
     * @ORM\ManyToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty", inversedBy="children")
 | 
			
		||||
     * @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
 | 
			
		||||
     */
 | 
			
		||||
    private ?ThirdParty $parent;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var ThirdPartyCivility
 | 
			
		||||
     * @ORM\OneToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdPartyCivility")
 | 
			
		||||
     * @ORM\JoinColumn(name="civility", referencedColumnName="id", nullable=true)
 | 
			
		||||
     */
 | 
			
		||||
    private $civility;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * [fr] Qualité
 | 
			
		||||
     * @var ThirdPartyProfession
 | 
			
		||||
     * @ORM\OneToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdPartyProfession")
 | 
			
		||||
     * @ORM\JoinColumn(name="profession", referencedColumnName="id", nullable=true)
 | 
			
		||||
     */
 | 
			
		||||
    private $profession;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var string|null
 | 
			
		||||
     *
 | 
			
		||||
     * @ORM\Column(name="telephone", type="string", length=64, nullable=true)
 | 
			
		||||
     * @Assert\Regex("/^([\+{1}])([0-9\s*]{4,20})$/",
 | 
			
		||||
     *   message="Invalid phone number: it should begin with the international prefix starting with ""+"", hold only digits and be smaller than 20 characters. Ex: +33123456789"
 | 
			
		||||
@@ -133,11 +74,41 @@ class ThirdParty
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var string|null
 | 
			
		||||
     *
 | 
			
		||||
     * @ORM\Column(name="email", type="string", length=255, nullable=true)
 | 
			
		||||
     * @Assert\Email(checkMX=false)
 | 
			
		||||
     */
 | 
			
		||||
    private $email;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var string|null
 | 
			
		||||
     *
 | 
			
		||||
     * @ORM\Column(name="comment", type="text", nullable=true)
 | 
			
		||||
     */
 | 
			
		||||
    private $comment;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var array|null
 | 
			
		||||
     *
 | 
			
		||||
     * @ORM\Column(name="types", type="json", nullable=true)
 | 
			
		||||
     * @Assert\Count(min=1)
 | 
			
		||||
     */
 | 
			
		||||
    private $type;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var boolean
 | 
			
		||||
     * @ORM\Column(name="active", type="boolean", options={"defaut": true})
 | 
			
		||||
     */
 | 
			
		||||
    private $active = true;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var Collection instances of Center
 | 
			
		||||
     * @ORM\ManyToMany(targetEntity="\Chill\MainBundle\Entity\Center")
 | 
			
		||||
     * @ORM\JoinTable(name="chill_3party.party_center")
 | 
			
		||||
     * @Assert\Count(min=1)
 | 
			
		||||
     */
 | 
			
		||||
    private $centers;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var Address|null
 | 
			
		||||
     * @ORM\ManyToOne(targetEntity="\Chill\MainBundle\Entity\Address",
 | 
			
		||||
@@ -146,69 +117,12 @@ class ThirdParty
 | 
			
		||||
     */
 | 
			
		||||
    private $address;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var boolean
 | 
			
		||||
     * @ORM\Column(name="active", type="boolean", options={"defaut": true})
 | 
			
		||||
     */
 | 
			
		||||
    private $active = true;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var string|null
 | 
			
		||||
     * @ORM\Column(name="comment", type="text", nullable=true)
 | 
			
		||||
     */
 | 
			
		||||
    private $comment;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var Collection
 | 
			
		||||
     * @ORM\ManyToMany(targetEntity="\Chill\MainBundle\Entity\Center")
 | 
			
		||||
     * @ORM\JoinTable(name="chill_3party.party_center")
 | 
			
		||||
     * @Assert\Count(min=1)
 | 
			
		||||
     */
 | 
			
		||||
    private $centers;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @ORM\Column(name="created_at", type="datetime_immutable", nullable=false)
 | 
			
		||||
     */
 | 
			
		||||
    private \DateTimeImmutable $createdAt;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @ORM\Column(name="updated_at", type="datetime", nullable=true)
 | 
			
		||||
     */
 | 
			
		||||
    private ?\DateTime $updatedAt;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var User
 | 
			
		||||
     * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
 | 
			
		||||
     * @ORM\JoinColumn(name="updated_by", referencedColumnName="id")
 | 
			
		||||
     */
 | 
			
		||||
    private $updatedBy;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @ORM\PrePersist()
 | 
			
		||||
     */
 | 
			
		||||
    public function prePersist()
 | 
			
		||||
    {
 | 
			
		||||
        $this->createdAt = new \DateTimeImmutable();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @ORM\PreUpdate()
 | 
			
		||||
     */
 | 
			
		||||
    public function preUpdate()
 | 
			
		||||
    {
 | 
			
		||||
        $this->updatedAt = new \DateTime();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * ThirdParty constructor.
 | 
			
		||||
     */
 | 
			
		||||
    public function __construct()
 | 
			
		||||
    {
 | 
			
		||||
        $this->centers = new ArrayCollection();
 | 
			
		||||
        $this->categories = new ArrayCollection();
 | 
			
		||||
        $this->children = new ArrayCollection();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -428,212 +342,4 @@ class ThirdParty
 | 
			
		||||
    {
 | 
			
		||||
        return $this->getName();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return string|null
 | 
			
		||||
     */
 | 
			
		||||
    public function getNameCompany(): ?string
 | 
			
		||||
    {
 | 
			
		||||
        return $this->nameCompany;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param string $nameCompany
 | 
			
		||||
     * @return ThirdParty
 | 
			
		||||
     */
 | 
			
		||||
    public function setNameCompany(string $nameCompany): ThirdParty
 | 
			
		||||
    {
 | 
			
		||||
        $this->nameCompany = $nameCompany;
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return string
 | 
			
		||||
     */
 | 
			
		||||
    public function getAcronym(): ?string
 | 
			
		||||
    {
 | 
			
		||||
        return $this->acronym;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param string $acronym
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function setAcronym(string $acronym): ThirdParty
 | 
			
		||||
    {
 | 
			
		||||
        $this->acronym = $acronym;
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return Collection
 | 
			
		||||
     */
 | 
			
		||||
    public function getCategories(): Collection
 | 
			
		||||
    {
 | 
			
		||||
        return $this->categories;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param ThirdPartyCategory $category
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function addCategory(ThirdPartyCategory $category): self
 | 
			
		||||
    {
 | 
			
		||||
        $this->categories[] = $category;
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param ThirdPartyCategory $category
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function removeCategory(ThirdPartyCategory $category): self
 | 
			
		||||
    {
 | 
			
		||||
        $this->categories->removeElement($category);
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function isLeaf(): bool
 | 
			
		||||
    {
 | 
			
		||||
        return $this->children->count() !== 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return Collection
 | 
			
		||||
     */
 | 
			
		||||
    public function getChildren(): Collection
 | 
			
		||||
    {
 | 
			
		||||
        return $this->children;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param ThirdParty $child
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function addChild(ThirdParty $child): self
 | 
			
		||||
    {
 | 
			
		||||
        $this->children[] = $child;
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param ThirdParty $child
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function removeChild(ThirdParty $child): self
 | 
			
		||||
    {
 | 
			
		||||
        $this->categories->removeElement($child);
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return ThirdParty|null
 | 
			
		||||
     */
 | 
			
		||||
    public function getParent(): ?ThirdParty
 | 
			
		||||
    {
 | 
			
		||||
        return $this->parent;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param ThirdParty|null $parent
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function setParent(?ThirdParty $parent): ThirdParty
 | 
			
		||||
    {
 | 
			
		||||
        $this->parent = $parent;
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return ThirdPartyCivility|null
 | 
			
		||||
     */
 | 
			
		||||
    public function getCivility(): ?ThirdPartyCivility
 | 
			
		||||
    {
 | 
			
		||||
        return $this->civility;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param ThirdPartyCivility $civility
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function setCivility(ThirdPartyCivility $civility): ThirdParty
 | 
			
		||||
    {
 | 
			
		||||
        $this->civility = $civility;
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return ThirdPartyProfession
 | 
			
		||||
     */
 | 
			
		||||
    public function getProfession(): ?ThirdPartyProfession
 | 
			
		||||
    {
 | 
			
		||||
        return $this->profession;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param ThirdPartyProfession $profession
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function setProfession(ThirdPartyProfession $profession): ThirdParty
 | 
			
		||||
    {
 | 
			
		||||
        $this->profession = $profession;
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return \DateTimeImmutable
 | 
			
		||||
     */
 | 
			
		||||
    public function getCreatedAt(): \DateTimeImmutable
 | 
			
		||||
    {
 | 
			
		||||
        return $this->createdAt;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param \DateTimeImmutable $createdAt
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function setCreatedAt(\DateTimeImmutable $createdAt): ThirdParty
 | 
			
		||||
    {
 | 
			
		||||
        $this->createdAt = $createdAt;
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return \DateTime|null
 | 
			
		||||
     */
 | 
			
		||||
    public function getUpdatedAt(): ?\DateTime
 | 
			
		||||
    {
 | 
			
		||||
        return $this->updatedAt;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param \DateTime $updatedAt
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function setUpdatedAt(\DateTime $updatedAt): ThirdParty
 | 
			
		||||
    {
 | 
			
		||||
        $this->updatedAt = $updatedAt;
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return User|null
 | 
			
		||||
     */
 | 
			
		||||
    public function getUpdatedBy(): ?User
 | 
			
		||||
    {
 | 
			
		||||
        return $this->updatedBy;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param User $updatedBy
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function setUpdatedBy(User $updatedBy): ThirdParty
 | 
			
		||||
    {
 | 
			
		||||
        $this->updatedBy = $updatedBy;
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,79 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Chill is a software for social workers
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2021, Champs Libres Cooperative SCRLFS,
 | 
			
		||||
 * <http://www.champs-libres.coop>, <info@champs-libres.coop>
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU Affero General Public License as
 | 
			
		||||
 * published by the Free Software Foundation, either version 3 of the
 | 
			
		||||
 * License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU Affero General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU Affero General Public License
 | 
			
		||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
namespace Chill\ThirdPartyBundle\Entity;
 | 
			
		||||
 | 
			
		||||
use Chill\ThirdPartyBundle\Repository\ThirdPartyCategoryRepository;
 | 
			
		||||
use Doctrine\ORM\Mapping as ORM;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @ORM\Table(name="chill_3party.party_category")
 | 
			
		||||
 * @ORM\Entity(repositoryClass=ThirdPartyCategoryRepository::class)
 | 
			
		||||
 */
 | 
			
		||||
class ThirdPartyCategory
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @ORM\Id
 | 
			
		||||
     * @ORM\GeneratedValue
 | 
			
		||||
     * @ORM\Column(type="integer")
 | 
			
		||||
     */
 | 
			
		||||
    private $id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @ORM\Column(type="json")
 | 
			
		||||
     */
 | 
			
		||||
    private $name = [];
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @ORM\Column(type="boolean")
 | 
			
		||||
     */
 | 
			
		||||
    private $active = true;
 | 
			
		||||
 | 
			
		||||
    public function getId(): ?int
 | 
			
		||||
    {
 | 
			
		||||
        return $this->id;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getName(): ?array
 | 
			
		||||
    {
 | 
			
		||||
        return $this->name;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function setName(array $name): self
 | 
			
		||||
    {
 | 
			
		||||
        $this->name = $name;
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getActive(): ?bool
 | 
			
		||||
    {
 | 
			
		||||
        return $this->active;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function setActive(bool $active): self
 | 
			
		||||
    {
 | 
			
		||||
        $this->active = $active;
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,79 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Chill is a software for social workers
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2021, Champs Libres Cooperative SCRLFS,
 | 
			
		||||
 * <http://www.champs-libres.coop>, <info@champs-libres.coop>
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU Affero General Public License as
 | 
			
		||||
 * published by the Free Software Foundation, either version 3 of the
 | 
			
		||||
 * License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU Affero General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU Affero General Public License
 | 
			
		||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
namespace Chill\ThirdPartyBundle\Entity;
 | 
			
		||||
 | 
			
		||||
use Chill\ThirdPartyBundle\Repository\ThirdPartyCivilityRepository;
 | 
			
		||||
use Doctrine\ORM\Mapping as ORM;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @ORM\Table(name="chill_3party.party_civility")
 | 
			
		||||
 * @ORM\Entity(repositoryClass=ThirdPartyCivilityRepository::class)
 | 
			
		||||
 */
 | 
			
		||||
class ThirdPartyCivility
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @ORM\Id
 | 
			
		||||
     * @ORM\GeneratedValue
 | 
			
		||||
     * @ORM\Column(type="integer")
 | 
			
		||||
     */
 | 
			
		||||
    private $id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @ORM\Column(type="json")
 | 
			
		||||
     */
 | 
			
		||||
    private $name = [];
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @ORM\Column(type="boolean")
 | 
			
		||||
     */
 | 
			
		||||
    private $active = true;
 | 
			
		||||
 | 
			
		||||
    public function getId(): ?int
 | 
			
		||||
    {
 | 
			
		||||
        return $this->id;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getName(): ?array
 | 
			
		||||
    {
 | 
			
		||||
        return $this->name;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function setName(array $name): self
 | 
			
		||||
    {
 | 
			
		||||
        $this->name = $name;
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getActive(): ?bool
 | 
			
		||||
    {
 | 
			
		||||
        return $this->active;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function setActive(bool $active): self
 | 
			
		||||
    {
 | 
			
		||||
        $this->active = $active;
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,79 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Chill is a software for social workers
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2021, Champs Libres Cooperative SCRLFS,
 | 
			
		||||
 * <http://www.champs-libres.coop>, <info@champs-libres.coop>
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU Affero General Public License as
 | 
			
		||||
 * published by the Free Software Foundation, either version 3 of the
 | 
			
		||||
 * License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU Affero General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU Affero General Public License
 | 
			
		||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
namespace Chill\ThirdPartyBundle\Entity;
 | 
			
		||||
 | 
			
		||||
use Chill\ThirdPartyBundle\Repository\ThirdPartyProfessionRepository;
 | 
			
		||||
use Doctrine\ORM\Mapping as ORM;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @ORM\Table(name="chill_3party.party_profession")
 | 
			
		||||
 * @ORM\Entity(repositoryClass=ThirdPartyProfessionRepository::class)
 | 
			
		||||
 */
 | 
			
		||||
class ThirdPartyProfession
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @ORM\Id
 | 
			
		||||
     * @ORM\GeneratedValue
 | 
			
		||||
     * @ORM\Column(type="integer")
 | 
			
		||||
     */
 | 
			
		||||
    private $id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @ORM\Column(type="json")
 | 
			
		||||
     */
 | 
			
		||||
    private $name = [];
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @ORM\Column(type="boolean")
 | 
			
		||||
     */
 | 
			
		||||
    private $active = true;
 | 
			
		||||
 | 
			
		||||
    public function getId(): ?int
 | 
			
		||||
    {
 | 
			
		||||
        return $this->id;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getName(): ?array
 | 
			
		||||
    {
 | 
			
		||||
        return $this->name;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function setName(array $name): self
 | 
			
		||||
    {
 | 
			
		||||
        $this->name = $name;
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getActive(): ?bool
 | 
			
		||||
    {
 | 
			
		||||
        return $this->active;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function setActive(bool $active): self
 | 
			
		||||
    {
 | 
			
		||||
        $this->active = $active;
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -2,13 +2,6 @@
 | 
			
		||||
 | 
			
		||||
namespace Chill\ThirdPartyBundle\Form;
 | 
			
		||||
 | 
			
		||||
use Chill\MainBundle\Form\Type\ChillTextareaType;
 | 
			
		||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
 | 
			
		||||
use Chill\ThirdPartyBundle\Entity\ThirdPartyCategory;
 | 
			
		||||
use Chill\ThirdPartyBundle\Entity\ThirdPartyCivility;
 | 
			
		||||
use Chill\ThirdPartyBundle\Entity\ThirdPartyProfession;
 | 
			
		||||
use Doctrine\ORM\EntityRepository;
 | 
			
		||||
use Doctrine\ORM\QueryBuilder;
 | 
			
		||||
use Symfony\Component\Form\AbstractType;
 | 
			
		||||
use Symfony\Component\Form\FormBuilderInterface;
 | 
			
		||||
use Symfony\Component\OptionsResolver\OptionsResolver;
 | 
			
		||||
@@ -27,26 +20,34 @@ use Chill\MainBundle\Form\Type\AddressType;
 | 
			
		||||
 | 
			
		||||
class ThirdPartyType extends AbstractType
 | 
			
		||||
{
 | 
			
		||||
    protected AuthorizationHelper $authorizationHelper;
 | 
			
		||||
 | 
			
		||||
    protected TokenStorageInterface $tokenStorage;
 | 
			
		||||
 | 
			
		||||
    protected ThirdPartyTypeManager $typesManager;
 | 
			
		||||
 | 
			
		||||
    protected TranslatableStringHelper $translatableStringHelper;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     * @var AuthorizationHelper
 | 
			
		||||
     */
 | 
			
		||||
    protected $authorizationHelper;
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     * @var TokenStorageInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $tokenStorage;
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     * @var ThirdPartyTypeManager
 | 
			
		||||
     */
 | 
			
		||||
    protected $typesManager;
 | 
			
		||||
    
 | 
			
		||||
    public function __construct(
 | 
			
		||||
        AuthorizationHelper $authorizationHelper,
 | 
			
		||||
        AuthorizationHelper $authorizationHelper, 
 | 
			
		||||
        TokenStorageInterface $tokenStorage,
 | 
			
		||||
        ThirdPartyTypeManager $typesManager,
 | 
			
		||||
        TranslatableStringHelper $translatableStringHelper
 | 
			
		||||
        ThirdPartyTypeManager $typesManager
 | 
			
		||||
    ) {
 | 
			
		||||
        $this->authorizationHelper = $authorizationHelper;
 | 
			
		||||
        $this->tokenStorage = $tokenStorage;
 | 
			
		||||
        $this->typesManager = $typesManager;
 | 
			
		||||
        $this->translatableStringHelper = $translatableStringHelper;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * {@inheritdoc}
 | 
			
		||||
     */
 | 
			
		||||
@@ -56,31 +57,11 @@ class ThirdPartyType extends AbstractType
 | 
			
		||||
        foreach ($this->typesManager->getProviders() as $key => $provider) {
 | 
			
		||||
            $types['chill_3party.key_label.'.$key] = $key;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        $builder
 | 
			
		||||
            ->add('name', TextType::class, [
 | 
			
		||||
                'required' => true
 | 
			
		||||
            ])
 | 
			
		||||
            ->add('categories', EntityType::class, [
 | 
			
		||||
                'label' => 'thirdparty.Categories',
 | 
			
		||||
                'class' => ThirdPartyCategory::class,
 | 
			
		||||
                'choice_label' => function (ThirdPartyCategory $category): string {
 | 
			
		||||
                    return $this->translatableStringHelper->localize($category->getName());
 | 
			
		||||
                },
 | 
			
		||||
                'query_builder' => function (EntityRepository $er): QueryBuilder {
 | 
			
		||||
                    return $er->createQueryBuilder('c')
 | 
			
		||||
                        ->where('c.active = true');
 | 
			
		||||
                },
 | 
			
		||||
                'required' => true,
 | 
			
		||||
                'multiple' => true,
 | 
			
		||||
                'attr' => ['class' => 'select2']
 | 
			
		||||
            ])
 | 
			
		||||
            ->add('type', ChoiceType::class, [
 | 
			
		||||
                'choices' => $types,
 | 
			
		||||
                'expanded' => true,
 | 
			
		||||
                'multiple' => true,
 | 
			
		||||
                'label'    => 'thirdparty.Type'
 | 
			
		||||
            ])
 | 
			
		||||
            ->add('telephone', TextType::class, [
 | 
			
		||||
                'label' => 'Phonenumber',
 | 
			
		||||
                'required' => false
 | 
			
		||||
@@ -88,13 +69,16 @@ class ThirdPartyType extends AbstractType
 | 
			
		||||
            ->add('email', EmailType::class, [
 | 
			
		||||
                'required' => false
 | 
			
		||||
            ])
 | 
			
		||||
            ->add('address', AddressType::class, [
 | 
			
		||||
                'has_valid_from' => false,
 | 
			
		||||
                'null_if_empty' => true,
 | 
			
		||||
            ->add('comment', TextareaType::class, [
 | 
			
		||||
                'required' => false
 | 
			
		||||
            ])
 | 
			
		||||
            ->add('type', ChoiceType::class, [
 | 
			
		||||
                'choices' => $types,
 | 
			
		||||
                'expanded' => true,
 | 
			
		||||
                'multiple' => true,
 | 
			
		||||
                'label'    => 'thirdparty.Type'
 | 
			
		||||
            ])
 | 
			
		||||
            ->add('active', ChoiceType::class, [
 | 
			
		||||
                'label' => 'thirdparty.Status',
 | 
			
		||||
                'choices' => [
 | 
			
		||||
                    'Active, shown to users' => true,
 | 
			
		||||
                    'Inactive, not shown to users' => false
 | 
			
		||||
@@ -102,65 +86,22 @@ class ThirdPartyType extends AbstractType
 | 
			
		||||
                'expanded' => true,
 | 
			
		||||
                'multiple' => false
 | 
			
		||||
            ])
 | 
			
		||||
            ->add('comment', ChillTextareaType::class, [
 | 
			
		||||
                'required' => false
 | 
			
		||||
            ])
 | 
			
		||||
            ->add('centers', EntityType::class, [
 | 
			
		||||
                'choices' => $this->getReachableCenters($options),
 | 
			
		||||
                'class' => \Chill\MainBundle\Entity\Center::class,
 | 
			
		||||
                'multiple' => true,
 | 
			
		||||
                'attr' => ['class' => 'select2']
 | 
			
		||||
                'expanded' => true
 | 
			
		||||
            ])
 | 
			
		||||
            ->add('address', AddressType::class, [
 | 
			
		||||
                'has_valid_from' => false,
 | 
			
		||||
                'null_if_empty' => true,
 | 
			
		||||
                'required' => false
 | 
			
		||||
            ])
 | 
			
		||||
        ;
 | 
			
		||||
 | 
			
		||||
        // Contact Person ThirdParty (child)
 | 
			
		||||
        if ($options['data']->isLeaf()) {
 | 
			
		||||
            $builder
 | 
			
		||||
                ->add('civility', EntityType::class, [
 | 
			
		||||
                    'label' => 'thirdparty.Civility',
 | 
			
		||||
                    'class' => ThirdPartyCivility::class,
 | 
			
		||||
                    'choice_label' => function (ThirdPartyCivility $civility): string {
 | 
			
		||||
                        return $this->translatableStringHelper->localize($civility->getName());
 | 
			
		||||
                    },
 | 
			
		||||
                    'query_builder' => function (EntityRepository $er): QueryBuilder {
 | 
			
		||||
                        return $er->createQueryBuilder('c')
 | 
			
		||||
                            ->where('c.active = true');
 | 
			
		||||
                    },
 | 
			
		||||
                    'placeholder' => 'thirdparty.choose civility',
 | 
			
		||||
                    'required' => true
 | 
			
		||||
                ])
 | 
			
		||||
                ->add('profession', EntityType::class, [
 | 
			
		||||
                    'label' => 'thirdparty.Profession',
 | 
			
		||||
                    'class' => ThirdPartyProfession::class,
 | 
			
		||||
                    'choice_label' => function (ThirdPartyProfession $profession): string {
 | 
			
		||||
                        return $this->translatableStringHelper->localize($profession->getName());
 | 
			
		||||
                    },
 | 
			
		||||
                    'query_builder' => function (EntityRepository $er): QueryBuilder {
 | 
			
		||||
                        return $er->createQueryBuilder('p')
 | 
			
		||||
                            ->where('p.active = true');
 | 
			
		||||
                    },
 | 
			
		||||
                    'placeholder' => 'thirdparty.choose profession',
 | 
			
		||||
                    'required' => false
 | 
			
		||||
                ])
 | 
			
		||||
            ;
 | 
			
		||||
 | 
			
		||||
        // Institutional ThirdParty (parent)
 | 
			
		||||
        } else {
 | 
			
		||||
            $builder
 | 
			
		||||
                ->add('nameCompany', TextType::class, [
 | 
			
		||||
                    'label' => 'thirdparty.NameCompany',
 | 
			
		||||
                    'required' => false
 | 
			
		||||
                ])
 | 
			
		||||
                ->add('acronym', TextType::class, [
 | 
			
		||||
                    'label' => 'thirdparty.Acronym',
 | 
			
		||||
                    'required' => false
 | 
			
		||||
                ])
 | 
			
		||||
            ;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     * 
 | 
			
		||||
     * @param array $options
 | 
			
		||||
     * @return \Chill\MainBundle\Entity\Center[]
 | 
			
		||||
     */
 | 
			
		||||
@@ -172,11 +113,11 @@ class ThirdPartyType extends AbstractType
 | 
			
		||||
            case 'update': $role = new Role(ThirdPartyVoter::UPDATE);
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        return $this->authorizationHelper->getReachableCenters(
 | 
			
		||||
            $this->tokenStorage->getToken()->getUser(), $role);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * {@inheritdoc}
 | 
			
		||||
     */
 | 
			
		||||
@@ -185,7 +126,7 @@ class ThirdPartyType extends AbstractType
 | 
			
		||||
        $resolver->setDefaults(array(
 | 
			
		||||
            'data_class' => 'Chill\ThirdPartyBundle\Entity\ThirdParty'
 | 
			
		||||
        ));
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        $resolver->setRequired('usage')
 | 
			
		||||
            ->setAllowedValues('usage', ['create', 'update'])
 | 
			
		||||
            ;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,42 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Chill is a software for social workers
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2021, Champs Libres Cooperative SCRLFS,
 | 
			
		||||
 * <http://www.champs-libres.coop>, <info@champs-libres.coop>
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU Affero General Public License as
 | 
			
		||||
 * published by the Free Software Foundation, either version 3 of the
 | 
			
		||||
 * License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU Affero General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU Affero General Public License
 | 
			
		||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
namespace Chill\ThirdPartyBundle\Repository;
 | 
			
		||||
 | 
			
		||||
use Chill\ThirdPartyBundle\Entity\ThirdPartyCategory;
 | 
			
		||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
 | 
			
		||||
use Doctrine\Persistence\ManagerRegistry;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @method ThirdPartyCategory|null find($id, $lockMode = null, $lockVersion = null)
 | 
			
		||||
 * @method ThirdPartyCategory|null findOneBy(array $criteria, array $orderBy = null)
 | 
			
		||||
 * @method ThirdPartyCategory[]    findAll()
 | 
			
		||||
 * @method ThirdPartyCategory[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
 | 
			
		||||
 */
 | 
			
		||||
class ThirdPartyCategoryRepository extends ServiceEntityRepository
 | 
			
		||||
{
 | 
			
		||||
    public function __construct(ManagerRegistry $registry)
 | 
			
		||||
    {
 | 
			
		||||
        parent::__construct($registry, ThirdPartyCategory::class);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,42 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Chill is a software for social workers
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2021, Champs Libres Cooperative SCRLFS,
 | 
			
		||||
 * <http://www.champs-libres.coop>, <info@champs-libres.coop>
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU Affero General Public License as
 | 
			
		||||
 * published by the Free Software Foundation, either version 3 of the
 | 
			
		||||
 * License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU Affero General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU Affero General Public License
 | 
			
		||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
namespace Chill\ThirdPartyBundle\Repository;
 | 
			
		||||
 | 
			
		||||
use Chill\ThirdPartyBundle\Entity\ThirdPartyCivility;
 | 
			
		||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
 | 
			
		||||
use Doctrine\Persistence\ManagerRegistry;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @method ThirdPartyCivility|null find($id, $lockMode = null, $lockVersion = null)
 | 
			
		||||
 * @method ThirdPartyCivility|null findOneBy(array $criteria, array $orderBy = null)
 | 
			
		||||
 * @method ThirdPartyCivility[]    findAll()
 | 
			
		||||
 * @method ThirdPartyCivility[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
 | 
			
		||||
 */
 | 
			
		||||
class ThirdPartyCivilityRepository extends ServiceEntityRepository
 | 
			
		||||
{
 | 
			
		||||
    public function __construct(ManagerRegistry $registry)
 | 
			
		||||
    {
 | 
			
		||||
        parent::__construct($registry, ThirdPartyCivility::class);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,42 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Chill is a software for social workers
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2021, Champs Libres Cooperative SCRLFS,
 | 
			
		||||
 * <http://www.champs-libres.coop>, <info@champs-libres.coop>
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU Affero General Public License as
 | 
			
		||||
 * published by the Free Software Foundation, either version 3 of the
 | 
			
		||||
 * License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU Affero General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU Affero General Public License
 | 
			
		||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
namespace Chill\ThirdPartyBundle\Repository;
 | 
			
		||||
 | 
			
		||||
use Chill\ThirdPartyBundle\Entity\ThirdPartyProfession;
 | 
			
		||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
 | 
			
		||||
use Doctrine\Persistence\ManagerRegistry;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @method ThirdPartyProfession|null find($id, $lockMode = null, $lockVersion = null)
 | 
			
		||||
 * @method ThirdPartyProfession|null findOneBy(array $criteria, array $orderBy = null)
 | 
			
		||||
 * @method ThirdPartyProfession[]    findAll()
 | 
			
		||||
 * @method ThirdPartyProfession[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
 | 
			
		||||
 */
 | 
			
		||||
class ThirdPartyProfessionRepository extends ServiceEntityRepository
 | 
			
		||||
{
 | 
			
		||||
    public function __construct(ManagerRegistry $registry)
 | 
			
		||||
    {
 | 
			
		||||
        parent::__construct($registry, ThirdPartyProfession::class);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,13 +1,3 @@
 | 
			
		||||
///
 | 
			
		||||
div.thirdparty-list {
 | 
			
		||||
    label.counter {
 | 
			
		||||
        float: right;
 | 
			
		||||
        span {
 | 
			
		||||
            font-weight: bold;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// render_box
 | 
			
		||||
section.chill-entity {
 | 
			
		||||
    .entity-thirdparty {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,103 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
<div class="item-bloc col">
 | 
			
		||||
    <section class="chill-entity entity-thirdparty">
 | 
			
		||||
    <div class="item-row entity-bloc">
 | 
			
		||||
 | 
			
		||||
        <div  class="item-col">
 | 
			
		||||
            <div class="entity-label">
 | 
			
		||||
 | 
			
		||||
                <div :class="'denomination h' + options.hLevel">
 | 
			
		||||
 | 
			
		||||
                    <a v-if="this.options.addLink ==  true" href="#">
 | 
			
		||||
                        <span class="name">{{ thirdparty.text }}</span>
 | 
			
		||||
                    </a>
 | 
			
		||||
                    <span class="name">{{ thirdparty.text }}</span>
 | 
			
		||||
 | 
			
		||||
                    <span v-if="options.addId ==  true" class="id-number" :title="'n° ' + thirdparty.id">{{ thirdparty.id }}</span>
 | 
			
		||||
                    <span v-if="options.addEntity ==  true && thirdparty.type == 'thirdparty'" class="badge rounded-pill bg-secondary">{{ $t('renderbox.type.thirdparty') }}</span>
 | 
			
		||||
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <p v-if="this.options.addInfo == true" class="moreinfo">
 | 
			
		||||
                    <i v-if="thirdparty.birthdate" :class="'fa fa-fw ' + getGenderIcon" title="{{ getGender }}"></i>
 | 
			
		||||
                    <time v-if="thirdparty.birthdate" datetime="{{ thirdparty.birthdate.datetime }}" title="{{ birthdate }}">
 | 
			
		||||
                        {{ $t(getGender) + ' ' + $d(birthdate, 'short') }}
 | 
			
		||||
                    </time>
 | 
			
		||||
                    <time v-else-if="thirdparty.deathdate" datetime="{{ thirdparty.deathdate.datetime }}" title="{{ thirdparty.deathdate }}">
 | 
			
		||||
                        {{ birthdate }} - {{ deathdate }}
 | 
			
		||||
                    </time>
 | 
			
		||||
                    <span class="age">{{ thirdparty.age }}</span>
 | 
			
		||||
                </p>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="item-col separator">
 | 
			
		||||
            <ul class="list-content fa-ul">
 | 
			
		||||
                <li v-if="thirdparty.address">
 | 
			
		||||
                    <i class="fa fa-li fa-map-marker"></i>
 | 
			
		||||
                    <show-address :address="thirdparty.address" :isMultiline="isMultiline"></show-address>
 | 
			
		||||
                </li>
 | 
			
		||||
                <li v-if="thirdparty.telephone">
 | 
			
		||||
                    <i class="fa fa-li fa-mobile"></i>
 | 
			
		||||
                    <a :href="'tel: ' + thirdparty.telephone">{{ thirdparty.telephone }}</a>
 | 
			
		||||
                </li>
 | 
			
		||||
                <li v-if="thirdparty.email">
 | 
			
		||||
                    <i class="fa fa-li fa-envelope-o"></i>
 | 
			
		||||
                    <a :href="'mailto: ' + thirdparty.email">{{ thirdparty.email }}</a>
 | 
			
		||||
                </li>
 | 
			
		||||
 | 
			
		||||
            </ul>
 | 
			
		||||
 | 
			
		||||
            <slot name="record-actions"></slot>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    </section>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import ShowAddress from 'ChillMainAssets/vuejs/Address/components/ShowAddress.vue';
 | 
			
		||||
import {dateToISO} from 'ChillMainAssets/chill/js/date.js';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
    name: "ThirdPartyRenderBox",
 | 
			
		||||
    components: {
 | 
			
		||||
        ShowAddress
 | 
			
		||||
    },
 | 
			
		||||
    props: ['thirdparty', 'options'],
 | 
			
		||||
    computed: {
 | 
			
		||||
        isMultiline: function() {
 | 
			
		||||
            if(this.options.isMultiline){
 | 
			
		||||
                return this.options.isMultiline
 | 
			
		||||
            } else {
 | 
			
		||||
                return false
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        getGender: function() {
 | 
			
		||||
            return this.thirdparty.gender == 'woman' ? 'renderbox.birthday.woman' : 'renderbox.birthday.man';
 | 
			
		||||
        },
 | 
			
		||||
        getGenderIcon: function() {
 | 
			
		||||
            return this.thirdparty.gender == 'woman' ? 'fa-venus' : this.thirdparty.gender == 'man' ? 'fa-mars' : 'fa-neuter';
 | 
			
		||||
        },
 | 
			
		||||
        birthdate: function(){
 | 
			
		||||
            var date = new Date(this.thirdparty.birthdate.datetime);
 | 
			
		||||
            return dateToISO(date);
 | 
			
		||||
        },
 | 
			
		||||
        deathdate: function(){
 | 
			
		||||
            var date = new Date(this.thirdparty.deathdate.datetime);
 | 
			
		||||
            return dateToISO(date);
 | 
			
		||||
        },
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss">
 | 
			
		||||
.name{
 | 
			
		||||
    &:before{
 | 
			
		||||
        content: " "
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -1,80 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
<!-- !!!! DATA still hardcoded until endpoint is fixed -->
 | 
			
		||||
 | 
			
		||||
   <div v-if="action === 'show'">
 | 
			
		||||
      <div class="flex-table">
 | 
			
		||||
         <third-party-render-box
 | 
			
		||||
            :thirdparty="thirdparty"
 | 
			
		||||
            :options="{
 | 
			
		||||
               addInfo: true,
 | 
			
		||||
               addEntity: false,
 | 
			
		||||
               addAltNames: true,
 | 
			
		||||
               addId: true,
 | 
			
		||||
               addLink: false,
 | 
			
		||||
               hLevel: 3,
 | 
			
		||||
               addCenter: true,
 | 
			
		||||
               addNoData: true,
 | 
			
		||||
               isMultiline: true
 | 
			
		||||
            }"
 | 
			
		||||
         ></third-party-render-box>
 | 
			
		||||
      </div>
 | 
			
		||||
   </div>
 | 
			
		||||
   <div v-else-if="action === 'edit' || action === 'create'">
 | 
			
		||||
      <div class="form-floating mb-3">
 | 
			
		||||
         <input class="form-control form-control-lg" id="firstname" v-model="thirdparty.firstName" v-bind:placeholder="$t('thirdparty.firstname')" />
 | 
			
		||||
         <label for="firstname">{{ $t('thirdparty.firstname') }}</label>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <div class="form-floating mb-3">
 | 
			
		||||
         <input class="form-control form-control-lg" id="lastname" v-model="thirdparty.lastName" v-bind:placeholder="$t('thirdparty.lastname')" />
 | 
			
		||||
         <label for="lastname">{{ $t('thirdparty.lastname') }}</label>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <div class="input-group mb-3">
 | 
			
		||||
         <span class="input-group-text" id="email"><i class="fa fa-fw fa-envelope"></i></span>
 | 
			
		||||
         <input class="form-control form-control-lg"
 | 
			
		||||
            v-model="thirdparty.email"
 | 
			
		||||
            v-bind:placeholder="$t('thirdparty.email')"
 | 
			
		||||
            v-bind:aria-label="$t('thirdparty.email')"
 | 
			
		||||
            aria-describedby="email" />
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <div class="input-group mb-3">
 | 
			
		||||
         <span class="input-group-text" id="phonenumber"><i class="fa fa-fw fa-phone"></i></span>
 | 
			
		||||
         <input class="form-control form-control-lg"
 | 
			
		||||
            v-model="thirdparty.telephone"
 | 
			
		||||
            v-bind:placeholder="$t('thirdparty.phonenumber')"
 | 
			
		||||
            v-bind:aria-label="$t('thirdparty.phonenumber')"
 | 
			
		||||
            aria-describedby="phonenumber" />
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
   </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import ThirdPartyRenderBox from '../Entity/ThirdPartyRenderBox.vue'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
   name: "OnTheFlyThirdParty",
 | 
			
		||||
   props: ['id', 'type', 'action'],
 | 
			
		||||
   components: {
 | 
			
		||||
      ThirdPartyRenderBox,
 | 
			
		||||
   },
 | 
			
		||||
   data: function() {
 | 
			
		||||
      return {
 | 
			
		||||
         thirdparty: {
 | 
			
		||||
            text : "Bart Maes",
 | 
			
		||||
            firstName : "Bart",
 | 
			
		||||
            lastName : "Maes",
 | 
			
		||||
            email : "bartmaes@gmail.com",
 | 
			
		||||
            telephone : "0475 94 66 15",
 | 
			
		||||
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
// TODO move in ChillThirdpartyAssets
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="css" scoped>
 | 
			
		||||
</style>
 | 
			
		||||
@@ -94,12 +94,13 @@
 | 
			
		||||
 | 
			
		||||
                {% if options['customButtons']['replace'] is defined %}
 | 
			
		||||
                    {{ options['customButtons']['replace'] }}
 | 
			
		||||
                {% elseif is_granted('CHILL_3PARTY_3PARTY_SHOW', thirdparty) %}
 | 
			
		||||
                {% elseif  is_granted('CHILL_3PARTY_3PARTY_SHOW', thirdparty) %}
 | 
			
		||||
                    <li>
 | 
			
		||||
                        <a class="btn btn-sm btn-show" target="_blank" title="{{ 'Show thirdparty'|trans }}"
 | 
			
		||||
                            href="{{ path('chill_3party_3party_show', { thirdparty_id: thirdparty.id }) }}"></a>
 | 
			
		||||
                    </li>
 | 
			
		||||
                {% else %}
 | 
			
		||||
                    {# rien faire ? j'ai eu un bug car options['customButtons'] était vide (marc)  #}
 | 
			
		||||
                {% endif %}
 | 
			
		||||
 | 
			
		||||
                {% if options['customButtons']['after'] is defined %}
 | 
			
		||||
 
 | 
			
		||||
@@ -3,107 +3,64 @@
 | 
			
		||||
{% block title 'List of third parties'|trans %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
<div class="thirdparty-list my-5">
 | 
			
		||||
    <div class="row justify-content-center">
 | 
			
		||||
        <div class="col-md-10 col-xxl">
 | 
			
		||||
<div class="col-10 centered">
 | 
			
		||||
    <h1>{{ 'List of third parties'|trans }}</h1>
 | 
			
		||||
    
 | 
			
		||||
    {% if third_parties|length == 0 %}
 | 
			
		||||
        <p class="chill-no-data-statement">{{ 'No third parties'|trans }}</p>
 | 
			
		||||
    {% else %}
 | 
			
		||||
        
 | 
			
		||||
    
 | 
			
		||||
        <table>
 | 
			
		||||
            <thead>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <th style="width: 35px;"></th>
 | 
			
		||||
                    <th>{{ 'Name'|trans }}</th>
 | 
			
		||||
                    <th>{{ 'Category'|trans }}</th>
 | 
			
		||||
                    <th> </th>
 | 
			
		||||
                </tr>
 | 
			
		||||
            </thead>
 | 
			
		||||
            <tbody>
 | 
			
		||||
                {% for tp in third_parties %}
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <th>{{ (tp.active ? '<i class="fa fa-check chill-green">' : '<i class="fa fa-times chill-red">')|raw }}</th>
 | 
			
		||||
                    <td>{{ tp.name }}</td>
 | 
			
		||||
                    {% set types = [] %}
 | 
			
		||||
                    {% for t in tp.type %}
 | 
			
		||||
                        {% set types = types|merge( [ ('chill_3party.key_label.'~t)|trans ] ) %}
 | 
			
		||||
                    {% endfor %}
 | 
			
		||||
                    <td>{{ types|join(', ') }}</td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <ul class="record_actions">
 | 
			
		||||
                            {% if is_granted('CHILL_3PARTY_3PARTY_UPDATE', tp) %}
 | 
			
		||||
                                <li>
 | 
			
		||||
                                    <a href="{{ chill_path_add_return_path('chill_3party_3party_update', { 'thirdparty_id': tp.id }) }}" class="btn btn-update"></a>
 | 
			
		||||
                                </li>
 | 
			
		||||
                            {% endif %}
 | 
			
		||||
                            {% if is_granted('CHILL_3PARTY_3PARTY_SHOW', tp) %}
 | 
			
		||||
                                <li>
 | 
			
		||||
                                    <a href="{{ chill_path_add_return_path('chill_3party_3party_show', { 'thirdparty_id': tp.id }) }}" class="btn btn-show"></a>
 | 
			
		||||
                                </li>
 | 
			
		||||
                            {% endif %}
 | 
			
		||||
                        </ul>
 | 
			
		||||
                    </td>
 | 
			
		||||
                </tr>            
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
            </tbody>
 | 
			
		||||
        </table>
 | 
			
		||||
 | 
			
		||||
            <h1>{{ 'List of third parties'|trans }}</h1>
 | 
			
		||||
        {% if third_parties|length < pagination.getTotalItems %}
 | 
			
		||||
            {{ chill_pagination(pagination) }}
 | 
			
		||||
        {% endif %}
 | 
			
		||||
 | 
			
		||||
            {% if third_parties|length == 0 %}
 | 
			
		||||
                <p class="chill-no-data-statement">{{ 'No third parties'|trans }}</p>
 | 
			
		||||
            {% else %}
 | 
			
		||||
    {% endif %}
 | 
			
		||||
 | 
			
		||||
                <nav class="filter-actions border border-secondary my-4 p-3">
 | 
			
		||||
                    <i>outils de filtrage</i>
 | 
			
		||||
                </nav>
 | 
			
		||||
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="row justify-content-center">
 | 
			
		||||
        <div class="col-md-10 col-xxl">
 | 
			
		||||
 | 
			
		||||
                <label class="counter">
 | 
			
		||||
                    <span>{{ pagination.totalItems }}</span> {{ 'third parties'|trans }}
 | 
			
		||||
                </label>
 | 
			
		||||
 | 
			
		||||
                <table class="table table-striped table-hover align-middle">
 | 
			
		||||
                    <thead>
 | 
			
		||||
                        <tr>
 | 
			
		||||
                            <th class="chill-pink" style="width: 35px;"></th>
 | 
			
		||||
                            <th class="chill-pink">{{ 'Name'|trans }}
 | 
			
		||||
                                <i class="fa fa-fw fa-sort"></i>
 | 
			
		||||
                            </th>
 | 
			
		||||
                            <th class="chill-pink">{{ 'Category'|trans }}
 | 
			
		||||
                                <i class="fa fa-fw fa-sort"></i>
 | 
			
		||||
                            </th>
 | 
			
		||||
                            <th class="chill-pink">{{ 'Address'|trans }}
 | 
			
		||||
                                <i class="fa fa-fw fa-sort"></i>
 | 
			
		||||
                            </th>
 | 
			
		||||
                            <th class="chill-pink">{{ 'thirdparty.UpdatedAt.short'|trans }}
 | 
			
		||||
                                <i class="fa fa-fw fa-sort"></i>
 | 
			
		||||
                            </th>
 | 
			
		||||
                            <th class="chill-pink"></th>
 | 
			
		||||
                        </tr>
 | 
			
		||||
                    </thead>
 | 
			
		||||
                    <tbody>
 | 
			
		||||
                        {% for tp in third_parties %}
 | 
			
		||||
                        <tr>
 | 
			
		||||
                            <th>{{ (tp.active ? '<i class="fa fa-check chill-green">' : '<i class="fa fa-times chill-red">')|raw }}</th>
 | 
			
		||||
                            <td>{{ tp.name }}</td>
 | 
			
		||||
                            {% set types = [] %}
 | 
			
		||||
                            {% for t in tp.type %}
 | 
			
		||||
                                {% set types = types|merge( [ ('chill_3party.key_label.'~t)|trans ] ) %}
 | 
			
		||||
                            {% endfor %}
 | 
			
		||||
                            <td>{{ types|join(', ') }}</td>
 | 
			
		||||
                            <td>
 | 
			
		||||
                                {{ tp.address|chill_entity_render_box({'multiline': false, 'with_valid_from': false}) }}
 | 
			
		||||
                            </td>
 | 
			
		||||
                            <td>
 | 
			
		||||
                                {% if tp.updatedAt != null %}
 | 
			
		||||
                                    {{ tp.updatedAt|format_date('short') }}
 | 
			
		||||
                                {% else %}
 | 
			
		||||
                                    {{ tp.createdAt|format_date('short') }}
 | 
			
		||||
                                {% endif %}
 | 
			
		||||
                            </td>
 | 
			
		||||
                            <td>
 | 
			
		||||
                                <ul class="record_actions">
 | 
			
		||||
                                    {% if is_granted('CHILL_3PARTY_3PARTY_UPDATE', tp) %}
 | 
			
		||||
                                        <li>
 | 
			
		||||
                                            <a href="{{ chill_path_add_return_path('chill_3party_3party_update', { 'thirdparty_id': tp.id }) }}" class="btn btn-update"></a>
 | 
			
		||||
                                        </li>
 | 
			
		||||
                                    {% endif %}
 | 
			
		||||
                                    {% if is_granted('CHILL_3PARTY_3PARTY_SHOW', tp) %}
 | 
			
		||||
                                        <li>
 | 
			
		||||
                                            <a href="{{ chill_path_add_return_path('chill_3party_3party_show', { 'thirdparty_id': tp.id }) }}" class="btn btn-show"></a>
 | 
			
		||||
                                        </li>
 | 
			
		||||
                                    {% endif %}
 | 
			
		||||
                                </ul>
 | 
			
		||||
                            </td>
 | 
			
		||||
                        </tr>
 | 
			
		||||
                        {% endfor %}
 | 
			
		||||
                    </tbody>
 | 
			
		||||
                </table>
 | 
			
		||||
 | 
			
		||||
                {% if third_parties|length < pagination.getTotalItems %}
 | 
			
		||||
                    {{ chill_pagination(pagination, 'long') }}
 | 
			
		||||
                {% endif %}
 | 
			
		||||
 | 
			
		||||
            {% endif %}
 | 
			
		||||
 | 
			
		||||
            <ul class="record_actions sticky-form-buttons">
 | 
			
		||||
                <li class="cancel">
 | 
			
		||||
                    {{ chill_items_per_page(pagination) }}
 | 
			
		||||
                </li>
 | 
			
		||||
                {% if is_granted('CHILL_3PARTY_3PARTY_CREATE') %}
 | 
			
		||||
                <li>
 | 
			
		||||
                    <a href="{{ chill_path_add_return_path('chill_3party_3party_new') }}" class="btn btn-create">
 | 
			
		||||
                        {{ "New third party"|trans }}
 | 
			
		||||
                    </a>
 | 
			
		||||
                </li>
 | 
			
		||||
                {% endif %}
 | 
			
		||||
            </ul>
 | 
			
		||||
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    {% if is_granted('CHILL_3PARTY_3PARTY_CREATE') %}
 | 
			
		||||
    <ul class="record_actions">
 | 
			
		||||
        <li>
 | 
			
		||||
            <a href="{{ chill_path_add_return_path('chill_3party_3party_new') }}" class="btn btn-create">
 | 
			
		||||
                {{ "New third party"|trans }}
 | 
			
		||||
            </a>
 | 
			
		||||
    {% endif %}
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 
 | 
			
		||||
@@ -3,58 +3,32 @@
 | 
			
		||||
{% block title 'Create third party'|trans %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
<div class="thirdparty-new my-5">
 | 
			
		||||
    <div class="row justify-content-center">
 | 
			
		||||
        <div class="col-md-10 col-xxl">
 | 
			
		||||
<div class="col-10 centered">
 | 
			
		||||
    <h1>{{ 'Create third party'|trans }}</h1>
 | 
			
		||||
 | 
			
		||||
            <h1>{{ 'Create third party'|trans }}</h1>
 | 
			
		||||
    {{ form_start(form) }}
 | 
			
		||||
    {{ form_row(form.name) }}
 | 
			
		||||
    {{ form_row(form.type) }}
 | 
			
		||||
    {{ form_row(form.telephone) }}
 | 
			
		||||
    {{ form_row(form.email) }}
 | 
			
		||||
    {{ form_row(form.address) }}
 | 
			
		||||
    
 | 
			
		||||
    {{ form_row(form.active) }}
 | 
			
		||||
    {{ form_row(form.centers) }}
 | 
			
		||||
    {{ form_row(form.comment) }}
 | 
			
		||||
 | 
			
		||||
            {{ form_start(form) }}
 | 
			
		||||
 | 
			
		||||
            {% if form.civility is defined %}
 | 
			
		||||
                {{ form_row(form.civility) }}
 | 
			
		||||
            {% endif %}
 | 
			
		||||
 | 
			
		||||
            {{ form_row(form.name) }}
 | 
			
		||||
 | 
			
		||||
            {% if form.nameCompany is defined %}
 | 
			
		||||
                {{ form_row(form.nameCompany) }}
 | 
			
		||||
                {{ form_row(form.acronym) }}
 | 
			
		||||
            {% endif %}
 | 
			
		||||
 | 
			
		||||
            {% if form.profession is defined %}
 | 
			
		||||
                {{ form_row(form.profession) }}
 | 
			
		||||
            {% endif %}
 | 
			
		||||
 | 
			
		||||
            {{ form_row(form.categories) }}
 | 
			
		||||
            {{ form_row(form.type) }}
 | 
			
		||||
 | 
			
		||||
            {{ form_row(form.telephone) }}
 | 
			
		||||
            {{ form_row(form.email) }}
 | 
			
		||||
            {{ form_row(form.address) }}
 | 
			
		||||
 | 
			
		||||
            {{ form_row(form.comment) }}
 | 
			
		||||
            {{ form_row(form.centers) }}
 | 
			
		||||
 | 
			
		||||
            {{ form_row(form.active) }}
 | 
			
		||||
 | 
			
		||||
            <ul class="record_actions sticky-form-buttons">
 | 
			
		||||
                <li class="cancel">
 | 
			
		||||
                    <a href="{{ chill_return_path_or('chill_3party_3party_index') }}" class="btn btn-cancel">
 | 
			
		||||
                        {{ 'Back to the list'|trans }}
 | 
			
		||||
                    </a>
 | 
			
		||||
                </li>
 | 
			
		||||
                <li>
 | 
			
		||||
 | 
			
		||||
                </li>
 | 
			
		||||
                <li>
 | 
			
		||||
                    {{ form_widget(form.submit, {'label': 'Create', 'attr': {'class': 'btn btn-new' }}) }}
 | 
			
		||||
                </li>
 | 
			
		||||
            </ul>
 | 
			
		||||
 | 
			
		||||
            {{ form_end(form) }}
 | 
			
		||||
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <ul class="record_actions">
 | 
			
		||||
        <li class="cancel">
 | 
			
		||||
            <a href="{{ chill_return_path_or('chill_3party_3party_index') }}" class="btn btn-cancel">
 | 
			
		||||
                {{ 'Back to the list'|trans }}
 | 
			
		||||
            </a>
 | 
			
		||||
        </li>
 | 
			
		||||
        <li>
 | 
			
		||||
            {{ form_widget(form.submit, {'label': 'Create', 'attr': {'class': 'btn btn-new' }}) }}
 | 
			
		||||
        </li>
 | 
			
		||||
    </ul>
 | 
			
		||||
        
 | 
			
		||||
    {{ form_end(form) }}
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 
 | 
			
		||||
@@ -5,118 +5,61 @@
 | 
			
		||||
{% block title title_ %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
<div class="thirdparty-show my-5">
 | 
			
		||||
    <div class="row justify-content-center">
 | 
			
		||||
        <div class="col-md-10 col-xxl">
 | 
			
		||||
 | 
			
		||||
            <h1>
 | 
			
		||||
                {{ title_ }}
 | 
			
		||||
                <span class="badge bg-{{ thirdParty.active ? 'success' : 'danger' }}"
 | 
			
		||||
                      title="{{ (thirdParty.active ? 'shown to users' : 'not shown to users')|trans }}">
 | 
			
		||||
                    {{ (thirdParty.active ? 'Active' : 'Inactive')|trans }}
 | 
			
		||||
                </span>
 | 
			
		||||
            </h1>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            <dl class="chill_view_data">
 | 
			
		||||
 | 
			
		||||
                <dt>{{ 'Name'|trans }}</dt>
 | 
			
		||||
                <dd>
 | 
			
		||||
                    {% if thirdParty.isLeaf == true %}{{ thirdParty.civility }}{% endif %}
 | 
			
		||||
                    {{ thirdParty.name }}
 | 
			
		||||
                </dd>
 | 
			
		||||
 | 
			
		||||
                {% if thirdParty.isLeaf == false %}
 | 
			
		||||
                    <dt>{{ 'thirdparty.NameCompany'|trans }}</dt>
 | 
			
		||||
                    <dd>
 | 
			
		||||
                        {% if thirdParty.nameCompany == null %}
 | 
			
		||||
                            <span class="chill-no-data-statement">{{ 'No nameCompany given'|trans }}</span>
 | 
			
		||||
                        {%  else %}
 | 
			
		||||
                            {{ thirdParty.nameCompany }}
 | 
			
		||||
                        {% endif %}
 | 
			
		||||
                    </dd>
 | 
			
		||||
 | 
			
		||||
                    <dt>{{ 'thirdparty.Acronym'|trans }}</dt>
 | 
			
		||||
                    <dd>
 | 
			
		||||
                        {% if thirdParty.acronym == null %}
 | 
			
		||||
                            <span class="chill-no-data-statement">{{ 'No acronym given'|trans }}</span>
 | 
			
		||||
                        {%  else %}
 | 
			
		||||
                            {{ thirdParty.acronym }}
 | 
			
		||||
                        {% endif %}
 | 
			
		||||
                    </dd>
 | 
			
		||||
                {% endif %}
 | 
			
		||||
 | 
			
		||||
                <dt>{{ 'Type'|trans }}</dt>
 | 
			
		||||
                {% set types = [] %}
 | 
			
		||||
                {% for t in thirdParty.type %}
 | 
			
		||||
                    {% set types = types|merge( [ ('chill_3party.key_label.'~t)|trans ] ) %}
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
                <dd>
 | 
			
		||||
                    {{ types|join(', ') }}
 | 
			
		||||
                </dd>
 | 
			
		||||
 | 
			
		||||
                <dt>{{ 'Phonenumber'|trans }}</dt>
 | 
			
		||||
                <dd>
 | 
			
		||||
                    {% if thirdParty.telephone == null %}
 | 
			
		||||
                        <span class="chill-no-data-statement">{{ 'No phone given'|trans }}</span>
 | 
			
		||||
                    {%  else %}
 | 
			
		||||
                        <a href="{{ 'tel:' ~ thirdParty.telephone }}">
 | 
			
		||||
                            {{ thirdParty.telephone|chill_print_or_message("thirdparty.No_phonenumber") }}
 | 
			
		||||
                        </a>
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
                </dd>
 | 
			
		||||
 | 
			
		||||
                <dt>{{ 'email'|trans }}<dt>
 | 
			
		||||
                <dd>
 | 
			
		||||
                    {% if thirdParty.email == null %}
 | 
			
		||||
                        <span class="chill-no-data-statement">{{ 'No email given'|trans }}</span>
 | 
			
		||||
                    {%  else %}
 | 
			
		||||
                        <a href="{{ 'mailto:' ~ thirdParty.email }}">
 | 
			
		||||
                            {{ thirdParty.email|chill_print_or_message("thirdparty.No_email") }}
 | 
			
		||||
                        </a>
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
                </dd>
 | 
			
		||||
 | 
			
		||||
                <dt>{{ 'Address'|trans }}</dt>
 | 
			
		||||
                <dd>
 | 
			
		||||
                    {% if thirdParty.address == null %}
 | 
			
		||||
                        <span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
 | 
			
		||||
                    {%  else %}
 | 
			
		||||
                        {{ thirdParty.address|chill_entity_render_box({'with_valid_from': false }) }}
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
                </dd>
 | 
			
		||||
 | 
			
		||||
                <dt>{{ 'Comment'|trans }}</dt>
 | 
			
		||||
                <dd>
 | 
			
		||||
                    {% if thirdParty.comment is not empty %}
 | 
			
		||||
                    <blockquote class="chill-user-quote">
 | 
			
		||||
                        {{ thirdParty.comment|chill_markdown_to_html }}
 | 
			
		||||
                    </blockquote>
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
                </dd>
 | 
			
		||||
 | 
			
		||||
                <dt>{{ 'Centers'|trans }}</dt>
 | 
			
		||||
                <dd>{{ 'The party is visible in those centers'|trans }} : {{ thirdParty.centers|join(', ') }}</dd>
 | 
			
		||||
 | 
			
		||||
            </dl>
 | 
			
		||||
 | 
			
		||||
            <ul class="record_actions sticky-form-buttons">
 | 
			
		||||
                <li class="cancel">
 | 
			
		||||
                    <a class="btn btn-cancel" href="{{ chill_return_path_or('chill_3party_3party_index') }}">
 | 
			
		||||
                        {{ 'Cancel'|trans }}
 | 
			
		||||
                    </a>
 | 
			
		||||
                </li>
 | 
			
		||||
 | 
			
		||||
                {% if is_granted('CHILL_3PARTY_3PARTY_UPDATE', thirdParty) %}
 | 
			
		||||
                    <li>
 | 
			
		||||
                        <a class="btn btn-update" href="{{ chill_path_forward_return_path('chill_3party_3party_update', { 'thirdparty_id': thirdParty.id }) }}">
 | 
			
		||||
                            {{ 'Update'|trans }}
 | 
			
		||||
                        </a>
 | 
			
		||||
                    </li>
 | 
			
		||||
                {% endif %}
 | 
			
		||||
            </ul>
 | 
			
		||||
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
<div class="col-10 centered">
 | 
			
		||||
    <h1>
 | 
			
		||||
        {{ title_ }} 
 | 
			
		||||
        <span class="chill__box {{ thirdParty.active ? 'green' : 'red' }}">{{ (thirdParty.active ? 'Active, shown to users' : 'Inactive, not shown to users')|trans }}</span>
 | 
			
		||||
    </h1>
 | 
			
		||||
    
 | 
			
		||||
    <dl class="chill_view_data">
 | 
			
		||||
        <dt>{{ 'Name'|trans }}</dt>
 | 
			
		||||
        <dd>{{ thirdParty.name }}</dd>
 | 
			
		||||
        
 | 
			
		||||
        <dt>{{ 'Type'|trans }}</dt>
 | 
			
		||||
        {% set types = [] %}
 | 
			
		||||
        {% for t in thirdParty.type %}
 | 
			
		||||
            {% set types = types|merge( [ ('chill_3party.key_label.'~t)|trans ] ) %}
 | 
			
		||||
        {% endfor %}
 | 
			
		||||
        <dd>{{ types|join(', ') }}</dd>
 | 
			
		||||
            
 | 
			
		||||
        <dt>{{ 'Centers'|trans }}</dt>
 | 
			
		||||
        <dd>{{ 'The party is visible in those centers'|trans }} : {{ thirdParty.centers|join(', ') }}</dd>
 | 
			
		||||
        
 | 
			
		||||
        <dt>{{ 'Phonenumber'|trans }}</dt>
 | 
			
		||||
        <dd>{{ thirdParty.telephone|chill_print_or_message("thirdparty.No_phonenumber") }}</dd>
 | 
			
		||||
        
 | 
			
		||||
        <dt>{{ 'email'|trans }}<dt>
 | 
			
		||||
        <dd>{{ thirdParty.email|chill_print_or_message("thirdparty.No_email") }}</dd>
 | 
			
		||||
        
 | 
			
		||||
        <dt>{{ 'Address'|trans }}</dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
            {% if thirdParty.address == null %}
 | 
			
		||||
                <span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
 | 
			
		||||
            {%  else %}
 | 
			
		||||
                {{ thirdParty.address|chill_entity_render_box({'with_valid_from': false }) }}
 | 
			
		||||
            {% endif %}
 | 
			
		||||
        </dd>
 | 
			
		||||
        
 | 
			
		||||
        <dt>{{ 'Comment'|trans }}</dt>
 | 
			
		||||
        <dd>{{ thirdParty.comment|chill_print_or_message("thirdparty.No_comment") }}</dd>
 | 
			
		||||
            
 | 
			
		||||
    </dl>
 | 
			
		||||
        
 | 
			
		||||
    <ul class="record_actions">
 | 
			
		||||
        <li class="cancel">
 | 
			
		||||
            <a class="btn btn-cancel" href="{{ chill_return_path_or('chill_3party_3party_index') }}">
 | 
			
		||||
                {{ 'Cancel'|trans }}
 | 
			
		||||
            </a>
 | 
			
		||||
        </li>
 | 
			
		||||
        
 | 
			
		||||
        {% if is_granted('CHILL_3PARTY_3PARTY_UPDATE', thirdParty) %}
 | 
			
		||||
            <li>
 | 
			
		||||
                <a class="btn btn-update" href="{{ chill_path_forward_return_path('chill_3party_3party_update', { 'thirdparty_id': thirdParty.id }) }}">
 | 
			
		||||
                    {{ 'Update'|trans }}
 | 
			
		||||
                </a>
 | 
			
		||||
            </li>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
    </ul>
 | 
			
		||||
    
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
@@ -3,75 +3,35 @@
 | 
			
		||||
{% block title 'Update third party %name%'|trans({ '%name%': thirdParty.name }) %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
<div class="thirdparty-edit my-5">
 | 
			
		||||
    <div class="row justify-content-center">
 | 
			
		||||
        <div class="col-md-10 col-xxl">
 | 
			
		||||
<div class="col-10 centered">
 | 
			
		||||
    <h1>
 | 
			
		||||
        {{ 'Update third party %name%'|trans({ '%name%': thirdParty.name }) }}
 | 
			
		||||
         <span class="chill__box {{ thirdParty.active ? 'green' : 'red' }}">{{ (thirdParty.active ? 'Active, shown to users' : 'Inactive, not shown to users')|trans }}</span>
 | 
			
		||||
 | 
			
		||||
            <h1>
 | 
			
		||||
                {{ 'Update third party %name%'|trans({ '%name%': thirdParty.name }) }}
 | 
			
		||||
                <span class="badge bg-{{ thirdParty.active ? 'success' : 'danger' }}"
 | 
			
		||||
                    title="{{ (thirdParty.active ? 'shown to users' : 'not shown to users')|trans }}">
 | 
			
		||||
                    {{ (thirdParty.active ? 'Active' : 'Inactive')|trans }}
 | 
			
		||||
                </span>
 | 
			
		||||
            </h1>
 | 
			
		||||
    </h1>
 | 
			
		||||
 | 
			
		||||
            <div class="date-by">
 | 
			
		||||
                {% if thirdParty.updatedAt != null %}
 | 
			
		||||
                    {{ 'thirdparty.UpdatedAt.short'|trans ~ thirdParty.updatedAt|format_date('short') }}
 | 
			
		||||
                {% else %}
 | 
			
		||||
                    {{ 'thirdparty.CreatedAt.short'|trans ~ thirdParty.createdAt|format_date('short') }}
 | 
			
		||||
                {% endif %}
 | 
			
		||||
                {% if thirdParty.updatedBy != null %}
 | 
			
		||||
                    {{ 'thirdparty.UpdateBy.short'|trans ~ thirdParty.updatedBy.usernameCanonical }}
 | 
			
		||||
                {% endif %}
 | 
			
		||||
            </div>
 | 
			
		||||
    {{ form_start(form) }}
 | 
			
		||||
    {{ form_row(form.name) }}
 | 
			
		||||
    {{ form_row(form.type) }}
 | 
			
		||||
    {{ form_row(form.telephone) }}
 | 
			
		||||
    {{ form_row(form.email) }}
 | 
			
		||||
    {{ form_row(form.address) }}
 | 
			
		||||
    
 | 
			
		||||
    {{ form_row(form.active) }}
 | 
			
		||||
    {{ form_row(form.centers) }}
 | 
			
		||||
    {{ form_row(form.comment) }}
 | 
			
		||||
 | 
			
		||||
            {{ form_start(form) }}
 | 
			
		||||
 | 
			
		||||
            {% if form.civility is defined %}
 | 
			
		||||
                {{ form_row(form.civility) }}
 | 
			
		||||
            {% endif %}
 | 
			
		||||
 | 
			
		||||
            {{ form_row(form.name) }}
 | 
			
		||||
 | 
			
		||||
            {% if form.nameCompany is defined %}
 | 
			
		||||
                {{ form_row(form.nameCompany) }}
 | 
			
		||||
                {{ form_row(form.acronym) }}
 | 
			
		||||
            {% endif %}
 | 
			
		||||
 | 
			
		||||
            {% if form.profession is defined %}
 | 
			
		||||
                {{ form_row(form.profession) }}
 | 
			
		||||
            {% endif %}
 | 
			
		||||
 | 
			
		||||
            {{ form_row(form.categories) }}
 | 
			
		||||
            {{ form_row(form.type) }}
 | 
			
		||||
 | 
			
		||||
            {{ form_row(form.telephone) }}
 | 
			
		||||
            {{ form_row(form.email) }}
 | 
			
		||||
            {{ form_row(form.address) }}
 | 
			
		||||
 | 
			
		||||
            {{ form_row(form.comment) }}
 | 
			
		||||
            {{ form_row(form.centers) }}
 | 
			
		||||
 | 
			
		||||
            {{ form_row(form.active) }}
 | 
			
		||||
 | 
			
		||||
            <ul class="record_actions sticky-form-buttons">
 | 
			
		||||
                <li class="cancel">
 | 
			
		||||
                    <a class="btn btn-cancel" href="{{ chill_path_forward_return_path('chill_3party_3party_index') }}">
 | 
			
		||||
                        {{ 'Back to the list'|trans }}
 | 
			
		||||
                    </a>
 | 
			
		||||
                </li>
 | 
			
		||||
                <li>
 | 
			
		||||
 | 
			
		||||
                </li>
 | 
			
		||||
                <li>
 | 
			
		||||
                    {{ form_widget(form.submit, {'label': 'Update', 'attr': {'class': 'btn btn-update' }}) }}
 | 
			
		||||
                </li>
 | 
			
		||||
            </ul>
 | 
			
		||||
 | 
			
		||||
            {{ form_end(form) }}
 | 
			
		||||
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <ul class="record_actions">
 | 
			
		||||
        <li class="cancel">
 | 
			
		||||
            <a class="btn btn-cancel" href="{{ chill_path_forward_return_path('chill_3party_3party_index') }}">
 | 
			
		||||
                {{ 'Back to the list'|trans }}
 | 
			
		||||
            </a>
 | 
			
		||||
        <li>
 | 
			
		||||
            {{ form_row(form.submit, {'label': 'Update', 'attr': {'class': 'btn btn-update' }}) }}
 | 
			
		||||
        </li>
 | 
			
		||||
    </ul>
 | 
			
		||||
        
 | 
			
		||||
    {{ form_end(form) }}
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,4 @@
 | 
			
		||||
module.exports = function(encore, entries)
 | 
			
		||||
{
 | 
			
		||||
    entries.push(__dirname + '/Resources/public/chill/index.js');
 | 
			
		||||
 | 
			
		||||
    // Aliases are used when webpack is trying to resolve modules path
 | 
			
		||||
    encore.addAliases({
 | 
			
		||||
        ChillThirdPartyAssets: __dirname + '/Resources/public'
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -2,16 +2,4 @@
 | 
			
		||||
services:
 | 
			
		||||
  Chill\ThirdPartyBundle\DataFixtures\ORM\LoadThirdParty:
 | 
			
		||||
      tags:
 | 
			
		||||
          - { 'name': doctrine.fixture.orm }
 | 
			
		||||
 | 
			
		||||
  Chill\ThirdPartyBundle\DataFixtures\ORM\LoadThirdPartyCivility:
 | 
			
		||||
    tags:
 | 
			
		||||
      - { 'name': doctrine.fixture.orm }
 | 
			
		||||
 | 
			
		||||
  Chill\ThirdPartyBundle\DataFixtures\ORM\LoadThirdPartyCategory:
 | 
			
		||||
    tags:
 | 
			
		||||
      - { 'name': doctrine.fixture.orm }
 | 
			
		||||
 | 
			
		||||
  Chill\ThirdPartyBundle\DataFixtures\ORM\LoadThirdPartyProfession:
 | 
			
		||||
    tags:
 | 
			
		||||
      - { 'name': doctrine.fixture.orm }
 | 
			
		||||
          - { 'name': doctrine.fixture.orm } 
 | 
			
		||||
 
 | 
			
		||||
@@ -4,10 +4,9 @@ services:
 | 
			
		||||
            $authorizationHelper: '@Chill\MainBundle\Security\Authorization\AuthorizationHelper'
 | 
			
		||||
            $tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface'
 | 
			
		||||
            $typesManager: '@Chill\ThirdPartyBundle\ThirdPartyType\ThirdPartyTypeManager'
 | 
			
		||||
            $translatableStringHelper: '@Chill\MainBundle\Templating\TranslatableStringHelper'
 | 
			
		||||
        tags:
 | 
			
		||||
            - { name: form.type }
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
    Chill\ThirdPartyBundle\Form\Type\PickThirdPartyType:
 | 
			
		||||
        arguments:
 | 
			
		||||
            $em: '@Doctrine\ORM\EntityManagerInterface'
 | 
			
		||||
@@ -15,4 +14,4 @@ services:
 | 
			
		||||
            $translator: '@Symfony\Component\Translation\TranslatorInterface'
 | 
			
		||||
            $typesManager: '@Chill\ThirdPartyBundle\ThirdPartyType\ThirdPartyTypeManager'
 | 
			
		||||
        tags:
 | 
			
		||||
            - { name: form.type }
 | 
			
		||||
            - { name: form.type }
 | 
			
		||||
@@ -1,79 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Chill\Migrations\ThirdParty;
 | 
			
		||||
 | 
			
		||||
use Doctrine\DBAL\Schema\Schema;
 | 
			
		||||
use Doctrine\Migrations\AbstractMigration;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Add new fields to ThirdParty Entity
 | 
			
		||||
 * @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
 | 
			
		||||
 */
 | 
			
		||||
final class Version20210719105918 extends AbstractMigration
 | 
			
		||||
{
 | 
			
		||||
    public function getDescription(): string
 | 
			
		||||
    {
 | 
			
		||||
        return 'Add new fields to ThirdParty Entity + new join tables';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function up(Schema $schema): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->addSql('CREATE SEQUENCE chill_3party.party_category_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
 | 
			
		||||
        $this->addSql('CREATE SEQUENCE chill_3party.party_civility_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
 | 
			
		||||
        $this->addSql('CREATE SEQUENCE chill_3party.party_profession_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
 | 
			
		||||
        $this->addSql('CREATE TABLE chill_3party.party_category (id INT NOT NULL, name JSON NOT NULL, active BOOLEAN NOT NULL, PRIMARY KEY(id))');
 | 
			
		||||
        $this->addSql('CREATE TABLE chill_3party.party_civility (id INT NOT NULL, name JSON NOT NULL, active BOOLEAN NOT NULL, PRIMARY KEY(id))');
 | 
			
		||||
        $this->addSql('CREATE TABLE chill_3party.party_profession (id INT NOT NULL, name JSON NOT NULL, active BOOLEAN NOT NULL, PRIMARY KEY(id))');
 | 
			
		||||
        $this->addSql('CREATE TABLE chill_3party.thirdparty_category (thirdparty_id INT NOT NULL, category_id INT NOT NULL, PRIMARY KEY(thirdparty_id, category_id))');
 | 
			
		||||
        $this->addSql('CREATE INDEX IDX_70495637C7D3A8E6 ON chill_3party.thirdparty_category (thirdparty_id)');
 | 
			
		||||
        $this->addSql('CREATE INDEX IDX_7049563712469DE2 ON chill_3party.thirdparty_category (category_id)');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.thirdparty_category ADD CONSTRAINT FK_70495637C7D3A8E6 FOREIGN KEY (thirdparty_id) REFERENCES chill_3party.third_party (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.thirdparty_category ADD CONSTRAINT FK_7049563712469DE2 FOREIGN KEY (category_id) REFERENCES chill_3party.party_category (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party ADD parent_id INT DEFAULT NULL');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party ADD civility INT DEFAULT NULL');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party ADD profession INT DEFAULT NULL');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party ADD updated_by INT DEFAULT NULL');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party ADD name_company VARCHAR(255) DEFAULT NULL');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party ADD acronym VARCHAR(64) DEFAULT NULL');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party ADD created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT \'2015-01-01\' NOT NULL');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party ADD updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party ADD CONSTRAINT FK_D952467B727ACA70 FOREIGN KEY (parent_id) REFERENCES chill_3party.third_party (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party ADD CONSTRAINT FK_D952467B384D4799 FOREIGN KEY (civility) REFERENCES chill_3party.party_civility (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party ADD CONSTRAINT FK_D952467BBA930D69 FOREIGN KEY (profession) REFERENCES chill_3party.party_profession (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party ADD CONSTRAINT FK_D952467B16FE72E1 FOREIGN KEY (updated_by) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
 | 
			
		||||
        $this->addSql('CREATE INDEX IDX_D952467B727ACA70 ON chill_3party.third_party (parent_id)');
 | 
			
		||||
        $this->addSql('CREATE UNIQUE INDEX UNIQ_D952467B384D4799 ON chill_3party.third_party (civility)');
 | 
			
		||||
        $this->addSql('CREATE UNIQUE INDEX UNIQ_D952467BBA930D69 ON chill_3party.third_party (profession)');
 | 
			
		||||
        $this->addSql('CREATE INDEX IDX_D952467B16FE72E1 ON chill_3party.third_party (updated_by)');
 | 
			
		||||
        $this->addSql('ALTER INDEX chill_3party.idx_c65d4397c7d3a8e6 RENAME TO IDX_14DC4475C7D3A8E6');
 | 
			
		||||
        $this->addSql('ALTER INDEX chill_3party.idx_c65d43975932f377 RENAME TO IDX_14DC44755932F377');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function down(Schema $schema): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.thirdparty_category DROP CONSTRAINT FK_7049563712469DE2');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party DROP CONSTRAINT FK_D952467B384D4799');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party DROP CONSTRAINT FK_D952467BBA930D69');
 | 
			
		||||
        $this->addSql('DROP SEQUENCE chill_3party.party_category_id_seq CASCADE');
 | 
			
		||||
        $this->addSql('DROP SEQUENCE chill_3party.party_civility_id_seq CASCADE');
 | 
			
		||||
        $this->addSql('DROP SEQUENCE chill_3party.party_profession_id_seq CASCADE');
 | 
			
		||||
        $this->addSql('DROP TABLE chill_3party.party_category');
 | 
			
		||||
        $this->addSql('DROP TABLE chill_3party.party_civility');
 | 
			
		||||
        $this->addSql('DROP TABLE chill_3party.party_profession');
 | 
			
		||||
        $this->addSql('DROP TABLE chill_3party.thirdparty_category');
 | 
			
		||||
        $this->addSql('ALTER INDEX chill_3party.idx_14dc44755932f377 RENAME TO idx_c65d43975932f377');
 | 
			
		||||
        $this->addSql('ALTER INDEX chill_3party.idx_14dc4475c7d3a8e6 RENAME TO idx_c65d4397c7d3a8e6');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party DROP CONSTRAINT FK_D952467B727ACA70');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party DROP CONSTRAINT FK_D952467B16FE72E1');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party DROP parent_id');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party DROP civility');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party DROP profession');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party DROP updated_by');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party DROP name_company');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party DROP acronym');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party DROP created_at');
 | 
			
		||||
        $this->addSql('ALTER TABLE chill_3party.third_party DROP updated_at');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,6 +1,5 @@
 | 
			
		||||
Third party: Tiers
 | 
			
		||||
Third parties: Tiers
 | 
			
		||||
third parties: tiers
 | 
			
		||||
name: Nom
 | 
			
		||||
telephone: Téléphone
 | 
			
		||||
adress: Adresse
 | 
			
		||||
@@ -12,45 +11,17 @@ thirdparty.No_phonenumber: Aucun numéro de téléphone
 | 
			
		||||
thirdparty.No_email: Aucun email
 | 
			
		||||
thirdparty.No_comment: Aucun commentaire
 | 
			
		||||
 | 
			
		||||
thirdparty.NameCompany:  Raison sociale
 | 
			
		||||
thirdparty.Acronym:  Sigle
 | 
			
		||||
thirdparty.Categories:  Catégories
 | 
			
		||||
thirdparty.Child:  Personne de contact
 | 
			
		||||
thirdparty.Children:  Personnes de contact
 | 
			
		||||
thirdparty.Parent:  Tiers institutionnel
 | 
			
		||||
thirdparty.Parents:  Tiers institutionnels
 | 
			
		||||
thirdparty.Civility:  Civilité
 | 
			
		||||
thirdparty.choose civility: --
 | 
			
		||||
thirdparty.Profession:  Qualité
 | 
			
		||||
thirdparty.choose profession: --
 | 
			
		||||
thirdparty.CreatedAt.short:  'Créé le '
 | 
			
		||||
thirdparty.UpdatedAt.short:  'Modifié le '
 | 
			
		||||
thirdparty.UpdateBy.short:  ' par '
 | 
			
		||||
thirdparty.CreatedAt.long:  Date de création
 | 
			
		||||
thirdparty.UpdatedAt.long:  Date de la dernière modification
 | 
			
		||||
thirdparty.UpdateBy.long:  Utilisateur qui a effectué la dernière modification
 | 
			
		||||
 | 
			
		||||
New third party: Ajouter un nouveau tiers
 | 
			
		||||
New third party: Nouveau tiers
 | 
			
		||||
Show third party %name%: Tiers "%name%"
 | 
			
		||||
Create third party: Créer un tiers
 | 
			
		||||
Update third party %name%: Mettre à jour "%name%"
 | 
			
		||||
List of third parties: Liste des tiers
 | 
			
		||||
Third party updated: Le tiers a été mis à jour
 | 
			
		||||
Third party created: Le tiers a été créé
 | 
			
		||||
thirdparty.Status: Statut
 | 
			
		||||
Active, shown to users: Actif, visible pour les utilisateurs
 | 
			
		||||
Active: Actif
 | 
			
		||||
shown to users: visible pour les utilisateurs
 | 
			
		||||
Inactive, not shown to users: Inactif, invisible pour les utilisateurs
 | 
			
		||||
Inactive: Inactif
 | 
			
		||||
not shown to users: invisible pour les utilisateurs
 | 
			
		||||
Active, shown to users: Actif, visible par les utilisateurs
 | 
			
		||||
Inactive, not shown to users: Inactif, invisible par les utilisateurs
 | 
			
		||||
Show thirdparty: Voir le tiers
 | 
			
		||||
 | 
			
		||||
No nameCompany given: Aucune raison sociale renseignée
 | 
			
		||||
No acronym given: Aucun sigle renseigné
 | 
			
		||||
No phone given: Aucun téléphone renseigné
 | 
			
		||||
No email given:  Aucune adresse courriel renseignée
 | 
			
		||||
 | 
			
		||||
The party is visible in those centers: Le tiers est visible dans ces centres
 | 
			
		||||
No third parties: Aucun tiers
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user