mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-11 09:14:59 +00:00
Compare commits
43 Commits
integratio
...
ameliorati
Author | SHA1 | Date | |
---|---|---|---|
1e996ce230 | |||
4ee67869bd | |||
8bcd69c5ec | |||
badf632a8a | |||
7363092d51 | |||
698514ef12 | |||
55c34c2583 | |||
3e27589cca | |||
52469d995a | |||
b4234ddc58 | |||
bb471fd4af | |||
fdd08905a8 | |||
755812ae3c | |||
3602b0d097 | |||
5dc92ed5bd | |||
d61dbaed91 | |||
9ac72a21d1 | |||
fd8f4a98c0 | |||
2394895ccb | |||
6ca35d5a18 | |||
6253927e2e | |||
0f87d77896 | |||
8b50e5bd62 | |||
f490fdd37c | |||
7ffdf4cb1f | |||
de7322464b | |||
90cfcd0569 | |||
4a0ffd2cba | |||
3e9d96368d | |||
39e8af48b4 | |||
a6b360c193 | |||
42b9e25403 | |||
34e1a9b748 | |||
eac4c48d8f | |||
7af85bc401 | |||
1a6c0529cc | |||
77fe497994 | |||
b89a66b20c | |||
438134690f | |||
166144e57e | |||
6bb5440220 | |||
c48586cd0e | |||
21fd69488f |
@@ -54,7 +54,7 @@
|
|||||||
{{ form_row(edit_form.date) }}
|
{{ form_row(edit_form.date) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
.. location
|
{# TODO .. location #}
|
||||||
|
|
||||||
{%- if edit_form.durationTime is defined -%}
|
{%- if edit_form.durationTime is defined -%}
|
||||||
{{ form_row(edit_form.durationTime) }}
|
{{ form_row(edit_form.durationTime) }}
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{%- if edit_form.comment is defined -%}
|
{%- if edit_form.comment is defined -%}
|
||||||
.. public and private
|
{# TODO .. public and private #}
|
||||||
{{ form_row(edit_form.comment) }}
|
{{ form_row(edit_form.comment) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
{{ form_row(edit_form.attendee) }}
|
{{ form_row(edit_form.attendee) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
.. status
|
{# TODO .. status #}
|
||||||
|
|
||||||
{% set person_id = null %}
|
{% set person_id = null %}
|
||||||
{% if entity.person %}
|
{% if entity.person %}
|
||||||
|
@@ -55,7 +55,7 @@
|
|||||||
{{ form_row(form.date) }}
|
{{ form_row(form.date) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
.. location
|
{# TODO .. location #}
|
||||||
|
|
||||||
{%- if form.durationTime is defined -%}
|
{%- if form.durationTime is defined -%}
|
||||||
{{ form_row(form.durationTime) }}
|
{{ form_row(form.durationTime) }}
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{%- if form.comment is defined -%}
|
{%- if form.comment is defined -%}
|
||||||
.. public and private
|
{# TODO .. public and private #}
|
||||||
{{ form_row(form.comment) }}
|
{{ form_row(form.comment) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -78,13 +78,13 @@
|
|||||||
{{ form_row(form.attendee) }}
|
{{ form_row(form.attendee) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
.. status
|
{# TODO .. status #}
|
||||||
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
<ul class="record_actions sticky-form-buttons">
|
||||||
<li class="cancel">
|
<li class="cancel">
|
||||||
<a
|
<a
|
||||||
class="btn btn-cancel"
|
class="btn btn-cancel"
|
||||||
{%- if context == 'person' -%}
|
{%- if context == 'person' -%}
|
||||||
href="{{ chill_return_path_or('chill_activity_activity_list', { 'person_id': person.id } )}}"
|
href="{{ chill_return_path_or('chill_activity_activity_list', { 'person_id': person.id } )}}"
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
href="{{ chill_return_path_or('chill_activity_activity_list', { 'accompanying_period_id': accompanyingCourse.id } )}}"
|
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%"'
|
'%user% has done an %activity_type%': '%user% a effectué une activité de type "%activity_type%"'
|
||||||
|
|
||||||
#controller
|
#controller
|
||||||
'Success : activity created!': Bravo ! L'activité a été créée.
|
'Success : activity created!': 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.
|
'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!': Bravo ! L'activité a été mise à jour.
|
'Success : activity updated!': 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.
|
'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'activité n'a pas été mise à jour.
|
||||||
|
|
||||||
# ROLES
|
# ROLES
|
||||||
|
@@ -17,15 +17,19 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
use Symfony\Component\Form\FormEvent;
|
use Symfony\Component\Form\FormEvent;
|
||||||
use Symfony\Component\Form\FormEvents;
|
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
|
final class AsideActivityFormType extends AbstractType
|
||||||
{
|
{
|
||||||
protected array $timeChoices;
|
protected array $timeChoices;
|
||||||
private TranslatableStringHelper $translatableStringHelper;
|
private TranslatableStringHelper $translatableStringHelper;
|
||||||
|
private TokenStorageInterface $storage;
|
||||||
|
|
||||||
public function __construct (TranslatableStringHelper $translatableStringHelper, array $timeChoices){
|
public function __construct (TranslatableStringHelper $translatableStringHelper, array $timeChoices, TokenStorageInterface $storage){
|
||||||
$this->timeChoices = $timeChoices;
|
$this->timeChoices = $timeChoices;
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
|
$this->storage = $storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
@@ -48,7 +52,8 @@ final class AsideActivityFormType extends AbstractType
|
|||||||
'label' => 'Agent',
|
'label' => 'Agent',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'class' => User::class,
|
'class' => User::class,
|
||||||
//translate
|
'data' => $this->storage->getToken()->getUser(),
|
||||||
|
'attr' => array('class' => 'select2 '),
|
||||||
'placeholder' => 'Choose the agent for whom this activity is created',
|
'placeholder' => 'Choose the agent for whom this activity is created',
|
||||||
'choice_label' => 'username'
|
'choice_label' => 'username'
|
||||||
])
|
])
|
||||||
|
@@ -1,12 +1,14 @@
|
|||||||
{% extends "@ChillMain/layout.html.twig" %}
|
{% extends "@ChillMain/layout.html.twig" %}
|
||||||
|
|
||||||
|
{% block title %}{{ 'Aside activity list' |trans }}{% endblock title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="col-md-10 col-xxl asideactivity-list">
|
<div class="col-md-10 col-xxl asideactivity-list">
|
||||||
<h2>{{ 'My aside activities' |trans }}</h2>
|
<h2>{{ 'My aside activities' |trans }}</h2>
|
||||||
|
|
||||||
{% if entities|length == 0 %}
|
{% if entities|length == 0 %}
|
||||||
<p class="chill-no-data-statement">
|
<p class="chill-no-data-statement">
|
||||||
{{ "There isn't any activities."|trans }}
|
{{ "There aren't any aside activities."|trans }}
|
||||||
<a href="{{ path('chill_crud_aside_activity_new') }}" class="btn btn-create button-small"></a>
|
<a href="{{ path('chill_crud_aside_activity_new') }}" class="btn btn-create button-small"></a>
|
||||||
</p>
|
</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -30,13 +32,13 @@
|
|||||||
{% if entity.date %}
|
{% if entity.date %}
|
||||||
<p>{{ entity.date|format_date('long') }}</p>
|
<p>{{ entity.date|format_date('long') }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{#
|
|
||||||
<div class="duration">
|
<div class="duration">
|
||||||
<p>
|
<p>
|
||||||
<i class="fa fa-fw fa-hourglass-end"></i>
|
<i class="fa fa-fw fa-hourglass-end"></i>
|
||||||
{{ entity.duration|date('H:i') }}
|
{{ entity.duration|date('H:i') }}
|
||||||
</p>
|
</p>
|
||||||
</div> #}
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="item-col">
|
<div class="item-col">
|
||||||
@@ -66,9 +68,9 @@
|
|||||||
<div class="item-col">
|
<div class="item-col">
|
||||||
<ul class="list-content">
|
<ul class="list-content">
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
{# <li>
|
||||||
<a href="{{ path('chill_crud_aside_activity_view', { 'id': entity.id} ) }}" class="btn btn-show "></a>
|
<a href="{{ path('chill_crud_aside_activity_view', { 'id': entity.id} ) }}" class="btn btn-show "></a>
|
||||||
</li>
|
</li> #}
|
||||||
{# TOOD
|
{# TOOD
|
||||||
{% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %}
|
{% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %}
|
||||||
#}
|
#}
|
||||||
@@ -91,18 +93,15 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% 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>
|
</div>
|
||||||
{% endif %}
|
{% 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">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_crud_activity_type_new') }}" class="btn btn-create">
|
<a href="{{ path('chill_crud_aside_activity_category_new') }}" class="btn btn-create">
|
||||||
{{ 'Create a new activity type'|trans }}
|
{{ 'Create a new aside activity type'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@@ -5,5 +5,6 @@ services:
|
|||||||
arguments:
|
arguments:
|
||||||
- "@chill.main.helper.translatable_string"
|
- "@chill.main.helper.translatable_string"
|
||||||
- "%chill_activity.form.time_duration%"
|
- "%chill_activity.form.time_duration%"
|
||||||
|
- "@security.token_storage"
|
||||||
tags:
|
tags:
|
||||||
- { name: form.type, alias: chill_asideactivitybundle_asideactivity }
|
- { name: form.type, alias: chill_asideactivitybundle_asideactivity }
|
@@ -8,7 +8,7 @@ user_username: nom de l'utilisateur
|
|||||||
Remark: Commentaire
|
Remark: Commentaire
|
||||||
No comments: Aucun commentaire
|
No comments: Aucun commentaire
|
||||||
Add a new aside activity: Ajouter une nouvelle activité annexe
|
Add a new aside activity: Ajouter une nouvelle activité annexe
|
||||||
Aside activity list: Liste des activités annexes
|
Aside activity list: Activités annexes
|
||||||
present: présent
|
present: présent
|
||||||
not present: absent
|
not present: absent
|
||||||
Delete: Supprimer
|
Delete: Supprimer
|
||||||
@@ -32,7 +32,7 @@ location: Lieu
|
|||||||
crud:
|
crud:
|
||||||
aside_activity:
|
aside_activity:
|
||||||
title_view: Détail de l'activité annexe
|
title_view: Détail de l'activité annexe
|
||||||
title_new: Nouveau activité annexe
|
title_new: Nouvelle activité annexe
|
||||||
title_edit: Edition d'une activité annexe
|
title_edit: Edition d'une activité annexe
|
||||||
title_delete: Supprimation d'une activité annexe
|
title_delete: Supprimation d'une activité annexe
|
||||||
button_delete: Supprimer
|
button_delete: Supprimer
|
||||||
@@ -43,14 +43,20 @@ crud:
|
|||||||
|
|
||||||
#forms
|
#forms
|
||||||
Activity creation: Nouvelle activité annexe
|
Activity creation: Nouvelle activité annexe
|
||||||
|
Create a new aside activity type: Nouvelle categorie d'activité annexe
|
||||||
Create: Créer
|
Create: Créer
|
||||||
Back to the list: Retour à la liste
|
Back to the list: Retour à la liste
|
||||||
Save activity: Sauver l'activité
|
Save activity: Sauver l'activité
|
||||||
Reset form: Remise à zéro du formulaire
|
Reset form: Remise à zéro du formulaire
|
||||||
Choose the agent for whom this activity is created: Choissisez l'agent pour qui l'activitée est creeé.
|
Choose the agent for whom this activity is created: Choissisez l'utilisateur pour qui l'activité est creéé.
|
||||||
Choose the activity category: Choissisez le type d'activité
|
Choose the activity category: Choissisez le type d'activité
|
||||||
Choose the duration: Choisir la durée
|
Choose the duration: Choisir la durée
|
||||||
Choose a category: Choisir un categorie
|
Choose a category: Choisir un categorie
|
||||||
|
Is active: Actif
|
||||||
|
Agent: Utilisateur
|
||||||
|
date: Date
|
||||||
|
Duration: Durée
|
||||||
|
Note: Note
|
||||||
5 minutes: 5 minutes
|
5 minutes: 5 minutes
|
||||||
10 minutes: 10 minutes
|
10 minutes: 10 minutes
|
||||||
15 minutes: 15 minutes
|
15 minutes: 15 minutes
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="chill-entity entity-address my-3">
|
<component :is="component" class="chill-entity entity-address my-3">
|
||||||
<div class="address multiline">
|
|
||||||
|
<component :is="component" class="address" :class="multiline">
|
||||||
<p v-if="address.text"
|
<p v-if="address.text"
|
||||||
class="street">
|
class="street">
|
||||||
{{ address.text }}
|
{{ address.text }},
|
||||||
</p>
|
</p>
|
||||||
<p v-if="address.postcode"
|
<p v-if="address.postcode"
|
||||||
class="postcode">
|
class="postcode">
|
||||||
@@ -13,8 +14,9 @@
|
|||||||
class="country">
|
class="country">
|
||||||
{{ address.country.name.fr }}
|
{{ address.country.name.fr }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</component>
|
||||||
<div>
|
|
||||||
|
<div v-if="isMultiline">
|
||||||
<div v-if="address.floor">
|
<div v-if="address.floor">
|
||||||
<span class="floor">
|
<span class="floor">
|
||||||
<b>{{ $t('floor') }}</b>: {{ address.floor }}
|
<b>{{ $t('floor') }}</b>: {{ address.floor }}
|
||||||
@@ -35,28 +37,76 @@
|
|||||||
<b>{{ $t('flat') }}</b>: {{ address.flat }}
|
<b>{{ $t('flat') }}</b>: {{ address.flat }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="address.buildingName">
|
<div>
|
||||||
<span class="buildingName">
|
<div v-if="address.floor">
|
||||||
<b>{{ $t('buildingName') }}</b>: {{ address.buildingName }}
|
<span class="floor">
|
||||||
</span>
|
<b>{{ $t('floor') }}</b>: {{ address.floor }}
|
||||||
</div>
|
</span>
|
||||||
<div v-if="address.extra">
|
</div>
|
||||||
<span class="extra">
|
<div v-if="address.corridor">
|
||||||
<b>{{ $t('extra') }}</b>: {{ address.extra }}
|
<span class="corridor">
|
||||||
</span>
|
<b>{{ $t('corridor') }}</b>: {{ address.corridor }}
|
||||||
</div>
|
</span>
|
||||||
<div v-if="address.distribution">
|
</div>
|
||||||
<span class="distribution">
|
<div v-if="address.steps">
|
||||||
<b>{{ $t('distribution') }}</b>: {{ address.distribution }}
|
<span class="steps">
|
||||||
</span>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
</component>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "ShowAddress",
|
name: 'ShowAddress',
|
||||||
props: ['address']
|
props: {
|
||||||
}
|
address: {
|
||||||
|
type: Object
|
||||||
|
},
|
||||||
|
isMultiline: {
|
||||||
|
default: true,
|
||||||
|
type: Boolean
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
component(){
|
||||||
|
return this.isMultiline == true ? "div" : "span";
|
||||||
|
},
|
||||||
|
multiline(){
|
||||||
|
return this.isMultiline == true ? "multiline" : "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
p {
|
||||||
|
&:after {
|
||||||
|
content: " ";
|
||||||
|
margin-right: 0.3em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@@ -43,8 +43,9 @@
|
|||||||
|
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
<button v-if="action === 'show'"
|
<button v-if="action === 'show'"
|
||||||
@click="changeActionTo('edit')"
|
@click="goToLocation(id, type)"
|
||||||
class="btn btn-update">
|
:title="$t(titleMessage)"
|
||||||
|
class="btn btn-show">{{ $t(buttonMessage) }}
|
||||||
</button>
|
</button>
|
||||||
<button v-else
|
<button v-else
|
||||||
class="btn btn-save"
|
class="btn btn-save"
|
||||||
@@ -60,9 +61,9 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal.vue';
|
import Modal from 'ChillMainAssets/vuejs/_components/Modal.vue';
|
||||||
import OnTheFlyPerson from 'ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue';
|
|
||||||
import OnTheFlyThirdparty from './OnTheFly/ThirdParty.vue';
|
|
||||||
import OnTheFlyCreate from './OnTheFly/Create.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';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'OnTheFly',
|
name: 'OnTheFly',
|
||||||
@@ -115,6 +116,22 @@ export default {
|
|||||||
case 'create':
|
case 'create':
|
||||||
return 'onthefly.create.title';
|
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: {
|
methods: {
|
||||||
@@ -139,6 +156,13 @@ export default {
|
|||||||
this.$refs.castNew.castByType();
|
this.$refs.castNew.castByType();
|
||||||
}
|
}
|
||||||
this.modal.showModal = false;
|
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`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,4 +172,5 @@ export default {
|
|||||||
a {
|
a {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import OnTheFlyPerson from 'ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue';
|
import OnTheFlyPerson from 'ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue';
|
||||||
import OnTheFlyThirdparty from './ThirdParty.vue'; // TODO move in ChillThirdpartyAssets
|
import OnTheFlyThirdparty from 'ChillThirdPartyAssets/vuejs/_components/OnTheFly/ThirdParty.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "OnTheFlyCreate",
|
name: "OnTheFlyCreate",
|
||||||
|
@@ -1,23 +0,0 @@
|
|||||||
<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,7 +41,11 @@ const messages = {
|
|||||||
close: "Fermer",
|
close: "Fermer",
|
||||||
back: "Retour",
|
back: "Retour",
|
||||||
check_all: "cocher tout",
|
check_all: "cocher tout",
|
||||||
reset: "réinitialiser"
|
reset: "réinitialiser",
|
||||||
|
redirect: {
|
||||||
|
person: "Quitter la page et ouvrir le dossier",
|
||||||
|
thirdparty: "Quitter la page et voir le tiers",
|
||||||
|
}
|
||||||
},
|
},
|
||||||
nav: {
|
nav: {
|
||||||
next: "Suivant",
|
next: "Suivant",
|
||||||
@@ -52,7 +56,9 @@ const messages = {
|
|||||||
onthefly: {
|
onthefly: {
|
||||||
show: {
|
show: {
|
||||||
person: "Détails de l'usager",
|
person: "Détails de l'usager",
|
||||||
thirdparty: "Détails du tiers"
|
thirdparty: "Détails du tiers",
|
||||||
|
file_person: "Ouvrir le dossier",
|
||||||
|
file_thirdparty: "Voir le Tiers",
|
||||||
},
|
},
|
||||||
edit: {
|
edit: {
|
||||||
person: "Modifier un usager",
|
person: "Modifier un usager",
|
||||||
@@ -65,6 +71,18 @@ const messages = {
|
|||||||
thirdparty: "un nouveau tiers professionnel"
|
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"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -93,8 +93,17 @@ export default {
|
|||||||
}
|
}
|
||||||
& > div {
|
& > div {
|
||||||
margin: 1em 3em 0;
|
margin: 1em 3em 0;
|
||||||
|
&.flex-table {
|
||||||
|
margin: 1em 0 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
table {
|
|
||||||
|
div.flex-table {
|
||||||
|
div.item-row {
|
||||||
|
div.item-col:first-child {
|
||||||
|
flex-basis: 33%;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.errors {
|
&.errors {
|
||||||
|
@@ -9,25 +9,15 @@
|
|||||||
<label class="chill-no-data-statement">{{ $tc('persons_associated.counter', counter) }}</label>
|
<label class="chill-no-data-statement">{{ $tc('persons_associated.counter', counter) }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class="table table-bordered table-striped border-dark align-middle" v-if="participations.length > 0">
|
<div class="flex-table mb-3">
|
||||||
<thead>
|
<participation-item
|
||||||
<tr>
|
v-for="participation in participations"
|
||||||
<th class="chill-orange">{{ $t('persons_associated.name') }}</th>
|
v-bind:participation="participation"
|
||||||
<th class="chill-orange">{{ $t('persons_associated.startdate') }}</th>
|
v-bind:key="participation.id"
|
||||||
<th class="chill-orange">{{ $t('persons_associated.enddate') }}</th>
|
@remove="removeParticipation"
|
||||||
<th class="chill-orange">{{ $t('action.actions') }}</th>
|
@close="closeParticipation">
|
||||||
</tr>
|
</participation-item>
|
||||||
</thead>
|
</div>
|
||||||
<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>
|
<div>
|
||||||
<add-persons
|
<add-persons
|
||||||
@@ -45,13 +35,13 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState } from 'vuex';
|
import { mapState } from 'vuex';
|
||||||
import PersonItem from "./PersonsAssociated/PersonItem.vue"
|
import ParticipationItem from "./PersonsAssociated/ParticipationItem.vue"
|
||||||
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue'
|
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PersonsAssociated',
|
name: 'PersonsAssociated',
|
||||||
components: {
|
components: {
|
||||||
PersonItem,
|
ParticipationItem,
|
||||||
AddPersons
|
AddPersons
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
@@ -0,0 +1,111 @@
|
|||||||
|
<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>
|
@@ -1,74 +0,0 @@
|
|||||||
<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>
|
|
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="vue-component">
|
<div class="vue-component">
|
||||||
|
<!-- {{ accompanyingCourse.requestor }} -->
|
||||||
<h2><a name="section-40"></a>{{ $t('requestor.title') }}</h2>
|
<h2><a name="section-40"></a>{{ $t('requestor.title') }}</h2>
|
||||||
|
|
||||||
<div v-if="accompanyingCourse.requestor" class="flex-table">
|
<div v-if="accompanyingCourse.requestor" class="flex-table">
|
||||||
@@ -9,9 +9,50 @@
|
|||||||
<input type="checkbox" v-model="isAnonymous" class="me-2" />
|
<input type="checkbox" v-model="isAnonymous" class="me-2" />
|
||||||
{{ $t('requestor.is_anonymous') }}
|
{{ $t('requestor.is_anonymous') }}
|
||||||
</label>
|
</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>
|
||||||
|
|
||||||
<div class="item-bloc">
|
<person-render-box v-else-if="accompanyingCourse.requestor.type == 'person'"
|
||||||
<h4>
|
: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>
|
||||||
<span class="badge rounded-pill bg-secondary">{{ accompanyingCourse.requestor.type }}</span>
|
<span class="badge rounded-pill bg-secondary">{{ accompanyingCourse.requestor.type }}</span>
|
||||||
{{ accompanyingCourse.requestor.text }}
|
{{ accompanyingCourse.requestor.text }}
|
||||||
</h4>
|
</h4>
|
||||||
@@ -54,8 +95,8 @@
|
|||||||
action="edit">
|
action="edit">
|
||||||
</on-the-fly>
|
</on-the-fly>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul> -->
|
||||||
</div>
|
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-remove"
|
<button class="btn btn-remove"
|
||||||
@@ -87,12 +128,16 @@
|
|||||||
<script>
|
<script>
|
||||||
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
|
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
|
||||||
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.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 {
|
export default {
|
||||||
name: 'Requestor',
|
name: 'Requestor',
|
||||||
components: {
|
components: {
|
||||||
AddPersons,
|
AddPersons,
|
||||||
OnTheFly
|
OnTheFly,
|
||||||
|
PersonRenderBox,
|
||||||
|
ThirdPartyRenderBox,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@@ -10,24 +10,14 @@
|
|||||||
<label class="chill-no-data-statement">{{ $tc('resources.counter', counter) }}</label>
|
<label class="chill-no-data-statement">{{ $tc('resources.counter', counter) }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class="table table-bordered table-striped border-dark align-middle" v-if="resources.length > 0">
|
<div class="flex-table mb-3">
|
||||||
<thead>
|
<resource-item
|
||||||
<tr>
|
v-for="resource in resources"
|
||||||
<th class="chill-orange">{{ $t('resources.text') }}</th>
|
v-bind:resource="resource"
|
||||||
<th class="chill-orange">{{ $t('resources.description') }}</th>
|
v-bind:key="resource.id"
|
||||||
<th class="chill-orange">{{ $t('action.actions') }}</th>
|
@remove="removeResource">
|
||||||
</tr>
|
</resource-item>
|
||||||
</thead>
|
</div>
|
||||||
<tbody>
|
|
||||||
<resource-item
|
|
||||||
v-for="resource in resources"
|
|
||||||
v-bind:resource="resource"
|
|
||||||
v-bind:key="resource.id"
|
|
||||||
@remove="removeResource">
|
|
||||||
</resource-item>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<add-persons
|
<add-persons
|
||||||
buttonTitle="resources.add_resources"
|
buttonTitle="resources.add_resources"
|
||||||
|
@@ -1,71 +1,54 @@
|
|||||||
<template>
|
<template>
|
||||||
<tr>
|
<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>
|
||||||
|
|
||||||
<td>
|
</person-render-box>
|
||||||
<span class="badge rounded-pill bg-secondary"
|
<third-party-render-box
|
||||||
v-bind:title="resource.resource.id">
|
v-if="resource.resource.type === 'thirdparty'"
|
||||||
<span v-if="resource.resource.type === 'person'" >{{ $t('item.type_person') }}</span>
|
:thirdparty="resource.resource"
|
||||||
<span v-if="resource.resource.type === 'thirdparty'" >{{ $t('item.type_thirdparty') }}</span>
|
:options="{ addLink : false, addId : false, addEntity: true, addInfo: true, hLevel: 3 }"
|
||||||
</span>
|
>
|
||||||
{{ resource.resource.text }}
|
<template v-slot:record-actions>
|
||||||
</td>
|
<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 v-if="resource.resource.type === 'person'">
|
</third-party-render-box>
|
||||||
{{ $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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
|
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
|
||||||
import ButtonLocation from '../ButtonLocation.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 {
|
export default {
|
||||||
name: 'ResourceItem',
|
name: 'ResourceItem',
|
||||||
components: {
|
components: {
|
||||||
OnTheFly,
|
OnTheFly,
|
||||||
ButtonLocation
|
ButtonLocation,
|
||||||
|
PersonRenderBox,
|
||||||
|
ThirdPartyRenderBox
|
||||||
},
|
},
|
||||||
props: ['resource'],
|
props: ['resource'],
|
||||||
emits: ['remove'],
|
emits: ['remove'],
|
||||||
computed: {
|
computed: {
|
||||||
hasCurrentHouseholdAddress() {
|
hasCurrentHouseholdAddress() {
|
||||||
if ( this.resource.resource.type === 'person'
|
if ( this.resource.resource.current_household_address !== null ) {
|
||||||
&& this.resource.resource.current_household_address !== null ) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@@ -41,6 +41,7 @@ const appMessages = {
|
|||||||
startdate: "Date d'entrée",
|
startdate: "Date d'entrée",
|
||||||
enddate: "Date de sortie",
|
enddate: "Date de sortie",
|
||||||
add_persons: "Ajouter des usagers",
|
add_persons: "Ajouter des usagers",
|
||||||
|
date_start_to_end: "Participation du {start} au {end}",
|
||||||
},
|
},
|
||||||
requestor: {
|
requestor: {
|
||||||
title: "Demandeur",
|
title: "Demandeur",
|
||||||
|
@@ -0,0 +1,48 @@
|
|||||||
|
// 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>
|
@@ -0,0 +1,158 @@
|
|||||||
|
<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,57 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="action === 'show'">
|
<div v-if="action === 'show'">
|
||||||
|
|
||||||
<div class="flex-table">
|
<div class="flex-table">
|
||||||
<div class="item-bloc">
|
<person-render-box
|
||||||
<div class="item-row">
|
:person="person"
|
||||||
<div class="item-col">
|
:options="{
|
||||||
<h3 :title="person.id">{{ person.text }}</h3>
|
addInfo: true,
|
||||||
<p>
|
addEntity: false,
|
||||||
<i class="fa fa-fw"
|
addAltNames: true,
|
||||||
:class="genderClass">
|
addId: true,
|
||||||
<!--
|
addLink: false,
|
||||||
:title="$t(genderTranslation)"
|
hLevel: 3,
|
||||||
-->
|
addCenter: true,
|
||||||
</i>
|
addNoData: true,
|
||||||
<span v-if="person.birthdate">
|
isMultiline: true
|
||||||
{{ $t('person.born', { e: feminized }) }}
|
}"
|
||||||
{{ $d(person.birthdate.datetime, 'short') }}
|
></person-render-box>
|
||||||
</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>
|
</div>
|
||||||
|
|
||||||
<div v-else-if="action === 'edit' || action === 'create'">
|
<div v-else-if="action === 'edit' || action === 'create'">
|
||||||
|
|
||||||
<div class="form-floating mb-3">
|
<div class="form-floating mb-3">
|
||||||
@@ -109,10 +75,14 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getPerson, postPerson } from '../../_api/OnTheFly';
|
import { getPerson, postPerson } from '../../_api/OnTheFly';
|
||||||
|
import PersonRenderBox from '../Entity/PersonRenderBox.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "OnTheFlyPerson",
|
name: "OnTheFlyPerson",
|
||||||
props: ['id', 'type', 'action'],
|
props: ['id', 'type', 'action'],
|
||||||
|
components: {
|
||||||
|
PersonRenderBox
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
person: {
|
person: {
|
||||||
@@ -204,10 +174,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
ul {
|
|
||||||
li::marker {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
div.flex-table {
|
div.flex-table {
|
||||||
div.item-bloc {
|
div.item-bloc {
|
||||||
div.item-row {
|
div.item-row {
|
||||||
|
@@ -137,13 +137,14 @@
|
|||||||
{{ options['customButtons']['before'] }}
|
{{ options['customButtons']['before'] }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{%- if options['customButtons']['replace'] is not defined and is_granted('CHILL_PERSON_SEE', person) -%}
|
{%- if options['customButtons']['replace'] is defined -%}
|
||||||
|
{{ options['customButtons']['replace'] }}
|
||||||
|
{%- elseif is_granted('CHILL_PERSON_SEE', person) -%}
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-sm btn-show" target="_blank" title="{{ 'Show person'|trans }}"
|
<a class="btn btn-sm btn-show" target="_blank" title="{{ 'Show person'|trans }}"
|
||||||
href="{{ path('chill_person_view', { person_id: person.id }) }}"></a>
|
href="{{ path('chill_person_view', { person_id: person.id }) }}"></a>
|
||||||
</li>
|
</li>
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
{{ options['customButtons']['replace'] }}
|
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
{% if options['customButtons']['after'] is defined %}
|
{% if options['customButtons']['after'] is defined %}
|
||||||
|
@@ -36,8 +36,11 @@
|
|||||||
'args' : {'person_id': person.id, 'person': person },
|
'args' : {'person_id': person.id, 'person': person },
|
||||||
'activeRouteKey': activeRouteKey
|
'activeRouteKey': activeRouteKey
|
||||||
}) }}
|
}) }}
|
||||||
|
|
||||||
<div class="block-post-menu">
|
{% block block_post_menu %}
|
||||||
{{ chill_delegated_block('person_post_vertical_menu', { 'person': person } ) }}
|
<div class="block-post-menu">
|
||||||
</div>
|
{{ chill_delegated_block('person_post_vertical_menu', { 'person': person } ) }}
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -46,7 +46,7 @@ Married: Marié(e)
|
|||||||
Return: Retour
|
Return: Retour
|
||||||
Submit: Submit
|
Submit: Submit
|
||||||
Reset: 'Remise à zéro'
|
Reset: 'Remise à zéro'
|
||||||
'The person data has been updated': 'Bravo ! Les données ont été mises à jour.'
|
'The person data has been updated': '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.'
|
'{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'
|
'Add a person': 'Ajout d''une personne'
|
||||||
'Person Menu': 'Menu personne'
|
'Person Menu': 'Menu personne'
|
||||||
|
@@ -125,7 +125,7 @@ Show person: Voir le dossier de la personne
|
|||||||
Return: Retour
|
Return: Retour
|
||||||
Submit: Envoi
|
Submit: Envoi
|
||||||
Reset: 'Remise à zéro'
|
Reset: 'Remise à zéro'
|
||||||
'The person data has been updated': 'Bravo ! Les données ont été mises à jour.'
|
'The person data has been updated': 'Les données ont été mises à jour.'
|
||||||
'The person data provided are not valid': 'Les données introduites ne sont pas valides'
|
'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.'
|
'{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'
|
'Add a person': 'Ajout d''une personne'
|
||||||
|
@@ -0,0 +1,103 @@
|
|||||||
|
<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>
|
||||||
|
|
||||||
|
|
@@ -0,0 +1,80 @@
|
|||||||
|
<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,13 +94,12 @@
|
|||||||
|
|
||||||
{% if options['customButtons']['replace'] is defined %}
|
{% if options['customButtons']['replace'] is defined %}
|
||||||
{{ options['customButtons']['replace'] }}
|
{{ options['customButtons']['replace'] }}
|
||||||
{% elseif is_granted('CHILL_3PARTY_3PARTY_SHOW', thirdparty) %}
|
{% elseif is_granted('CHILL_3PARTY_3PARTY_SHOW', thirdparty) %}
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-sm btn-show" target="_blank" title="{{ 'Show thirdparty'|trans }}"
|
<a class="btn btn-sm btn-show" target="_blank" title="{{ 'Show thirdparty'|trans }}"
|
||||||
href="{{ path('chill_3party_3party_show', { thirdparty_id: thirdparty.id }) }}"></a>
|
href="{{ path('chill_3party_3party_show', { thirdparty_id: thirdparty.id }) }}"></a>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
{# rien faire ? j'ai eu un bug car options['customButtons'] était vide (marc) #}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if options['customButtons']['after'] is defined %}
|
{% if options['customButtons']['after'] is defined %}
|
||||||
|
@@ -1,4 +1,9 @@
|
|||||||
module.exports = function(encore, entries)
|
module.exports = function(encore, entries)
|
||||||
{
|
{
|
||||||
entries.push(__dirname + '/Resources/public/chill/index.js');
|
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'
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user