Merge remote-tracking branch 'origin/master' into issue383_referent_in_acc_course

This commit is contained in:
2022-01-24 15:04:55 +01:00
173 changed files with 7405 additions and 567 deletions

View File

@@ -0,0 +1,61 @@
function capitalizeFirstLetter(string) {
return string.charAt(0).toLocaleUpperCase() + string.slice(1);
}
window.addEventListener('DOMContentLoaded', function() {
const uri = decodeURI(location.hash.substring(1))
let searchFragments = uri.split(' ')
searchFragments = searchFragments.filter((el) => {
if ( ( el.startsWith("firstname") || el.startsWith("lastname") ) || (el !== '' && !el.startsWith('birthdate') && !el.startsWith('gender') && !el.startsWith('city') && !el.startsWith('phonenumber') && !el.startsWith('@'))) {
return el
}
})
searchFragments = searchFragments.map((el) => {
if (el.startsWith("firstname")) {
return el.slice(10)
} else if (el.startsWith("lastname")) {
return el.slice(10)
}
return el.replace('\"', '')
})
if (searchFragments) {
const pre = '<ul class="list-suggest add-items inline">';
const after = '</ul>';
document.querySelectorAll('[data-suggest-container]').forEach(function(container) {
const suggestions = searchFragments.map((el) => `<li class="suggest-item-name"><span data-suggest-target="${container.dataset.suggestContainer}">${capitalizeFirstLetter(el)}</span></li>`);
container.innerHTML = pre + suggestions.join(' ') + after;
})
}
const tags = document.querySelectorAll('[data-suggest-target]').forEach((tag) => {
tag.addEventListener('click', function(e) {
const field = document.querySelector(`[name="${e.target.dataset.suggestTarget}"]`);
let suggestion = e.target.textContent.trim();
switch (field.dataset.suggestTransform) {
case 'uppercase_all':
suggestion = suggestion.toLocaleUpperCase();
break;
case 'uppercase_first_letter':
default:
suggestion = capitalizeFirstLetter(suggestion);
}
if (field.value === '') {
field.value = suggestion;
} else {
field.value = `${field.value} ${suggestion}`
}
e.target.style.display = "none";
[...document.querySelectorAll("[data-suggest-target]")]
.filter(p => p.textContent.includes(e.target.textContent))
.forEach(p => p.remove());
})
})
})

View File

@@ -241,7 +241,17 @@
</div>
</div>
<ul class="record_actions sticky-form-buttons">
<ul class="record_actions sticky-form-buttons">
<!--
FAIT REPETER tout le template de App.vue plusieurs fois
<li>
<pick-workflow
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork"
:relatedEntityId="this.work.id"
:workflows="this.workflows"
></pick-workflow>
</li>
-->
<li v-if="!isPosting">
<button class="btn btn-save" @click="submit">
@@ -270,6 +280,7 @@ import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRe
import ThirdPartyRenderBox from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyRenderBox.vue';
import PickTemplate from 'ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue';
import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue';
import PickWorkflow from 'ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue';
const i18n = {
messages: {
@@ -317,6 +328,7 @@ export default {
AddressRenderBox,
ThirdPartyRenderBox,
PickTemplate,
PickWorkflow,
OnTheFly
},
i18n,
@@ -347,11 +359,11 @@ export default {
display: false
}
},
}
},
};
},
computed: {
...mapState([
computed: {
...mapState([
'work',
'resultsForAction',
'evaluationsForAction',

View File

@@ -1,12 +1,21 @@
<template>
<div>
<div class="item-title">
<div class="item-title" :title="evaluation.id || 'no id yet'">
<span>{{ evaluation.evaluation.title.fr }}</span>
</div>
<div>
<form-evaluation ref="FormEvaluation" :key="evaluation.key" :evaluation="evaluation"></form-evaluation>
<ul class="record_actions">
<ul class="record_actions">
<li v-if="evaluation.workflows_availables.length > 0">
<pick-workflow
relatedEntityClass="faked"
:relatedEntityId="evaluation.id"
:workflowsAvailables="evaluation.workflows_availables"
@goToGenerateWorkflow="goToGenerateWorkflow"
></pick-workflow>
</li>
<li>
<a class="btn btn-delete" @click="modal.showModal = true" :title="$t('action.delete')"></a>
</li>
@@ -34,6 +43,8 @@
<script>
import FormEvaluation from './FormEvaluation.vue';
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
import PickWorkflow from 'ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue';
import {buildLinkCreate} from 'ChillMainAssets/lib/entity-workflow/api.js';
const i18n = {
messages: {
@@ -60,7 +71,8 @@ export default {
name: "AddEvaluation",
components: {
FormEvaluation,
Modal
Modal,
PickWorkflow,
},
props: ['evaluation'],
i18n,
@@ -88,10 +100,19 @@ export default {
submitForm() {
this.toggleEditEvaluation();
},
buildEditLink(storedObject) {
return `/edit/${storedObject.uuid}?returnPath=` + encodeURIComponent(
window.location.pathname + window.location.search + window.location.hash);
},
goToGenerateWorkflow({event, link, workflowName}) {
event.preventDefault();
console.log(event, link, workflowName);
const callback = (data) => {
let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id;
window.location.assign(buildLinkCreate(workflowName,
'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluation', evaluationId));
};
return this.$store.dispatch('submit', callback)
.catch(e => { console.log(e); throw e; });
}
}
}
</script>

View File

@@ -61,6 +61,32 @@
</div>
</div>
<div v-if="evaluation.documents.length > 0" class="row mb-3">
<h5>{{ $t('Documents') }} :</h5>
<div class="flex-table">
<div class="item-bloc" v-for="d in evaluation.documents">
<div class="item-row">
<div class="item-col"><h6>{{ d.template.name.fr }}</h6></div>
<div class="item-col">
<p>Créé par {{ d.createdBy.text }}<br/>
Le {{ $d(ISOToDatetime(d.createdAt.datetime), 'long') }}</p>
</div>
</div>
<div class="item-row">
<ul class="record_actions" >
<li>
<a :href="buildEditLink(d.storedObject)" class="btn btn-action btn-sm">
<i class="fa fa-edit"></i>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="row mb-3">
<pick-template
entityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation"
@@ -99,7 +125,8 @@ const i18n = {
evaluation_generate_a_document: "Générer un document",
evaluation_choose_a_template: "Choisir un gabarit",
evaluation_add_a_document: "Ajouter un document",
evaluation_add: "Ajouter une évaluation"
evaluation_add: "Ajouter une évaluation",
Documents: "Documents",
}
}
};
@@ -163,6 +190,7 @@ export default {
},
},
methods: {
ISOToDatetime,
listAllStatus() {
console.log('load all status');
let url = `/api/`;
@@ -175,7 +203,11 @@ export default {
})
;
},
submitBeforeGenerate() {
buildEditLink(storedObject) {
return `/wopi/edit/${storedObject.uuid}?returnPath=` + encodeURIComponent(
window.location.pathname + window.location.search + window.location.hash);
},
submitBeforeGenerate() {
const callback = (data) => {
let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id;
return Promise.resolve({entityId: evaluationId});

View File

@@ -205,6 +205,7 @@ const store = createStore({
warningInterval: null,
comment: "",
editEvaluation: true,
workflows_availables: state.work.workflows_availables_evaluation,
};
state.evaluationsPicked.push(e);
},
@@ -371,7 +372,8 @@ const store = createStore({
if (typeof(callback) !== 'undefined') {
return callback(data);
} else {
console.info('nothing to do here, bye bye');window.location.assign(`/fr/person/accompanying-period/${state.work.accompanyingPeriod.id}/work`);
console.info('nothing to do here, bye bye');
window.location.assign(`/fr/person/accompanying-period/${state.work.accompanyingPeriod.id}/work`);
}
}).catch(error => {
console.log('error on submit', error);

View File

@@ -32,7 +32,7 @@
</button>
</li>
<li v-else>
<button class="btn btn-save" @click="confirm" :disabled="hasWarnings">
<button class="btn btn-save" @click="confirm" :disabled="hasWarnings || !lastStepIsSaveAllowed">
{{ $t('household_members_editor.app.save') }}
</button>
</li>
@@ -104,6 +104,13 @@ export default {
return false;
},
lastStepIsSaveAllowed() {
let r = !this.$store.getters.isHouseholdNew ||
(this.$store.state.numberOfChildren !== null && this.$store.state.householdCompositionType !== null);
console.log('is saved allowed ?', r);
return r;
},
},
methods: {
goToNext() {

View File

@@ -7,18 +7,14 @@
</div>
</div>
<div v-else>
<p>
{{ $t('household_members_editor.concerned.persons_will_be_moved') }}&nbsp;:
<span v-for="c in concerned" :key="c.person.id">
<person-render-box render="badge" :options="{addLink: false}" :person="c.person"></person-render-box>
<button class="btn" @click="removePerson(c.person)" v-if="c.allowRemove" style="padding-left:0;">
<span class="fa-stack fa-lg" :title="$t('household_members_editor.concerned.remove_concerned')">
<i class="fa fa-circle fa-stack-1x text-danger"></i>
<i class="fa fa-times fa-stack-1x"></i>
</span>
</button>
</span>
</p>
<p>{{ $t('household_members_editor.concerned.persons_will_be_moved') }}&nbsp;:</p>
<ul class="list-suggest remove-items inline">
<li v-for="c in concerned" :key="c.person.id" @click="removeConcerned(c)">
<span>{{ c.person.text }}</span>
</li>
</ul>
<div class="alert alert-info" v-if="concernedPersonsWithHouseholds.length > 0">
<p>{{ $t('household_members_editor.concerned.persons_with_household') }}</p>
<ul v-for="c in concernedPersonsWithHouseholds" :key="c.person.id">
@@ -108,9 +104,14 @@ export default {
this.$refs.addPersons.resetSearch(); // to cast child method
modal.showModal = false;
},
removePerson(person) {
console.log('remove person in concerned', person);
this.$store.dispatch('removePerson', person);
removeConcerned(concerned) {
console.log('removedconcerned', concerned);
if (!concerned.allowRemove) {
return;
}
this.$store.dispatch('removePerson', concerned.person);
},
makeHouseholdLink(id) {
return `/fr/person/household/${id}/summary`

View File

@@ -4,17 +4,38 @@
<h2>{{ $t('household_members_editor.dates.dates_title') }}</h2>
<p>
<label for="start_date">
<div class="mb-3 row">
<label for="start_date" class="col-form-label col-sm-4 required">
{{ $t('household_members_editor.dates.start_date') }}
</label>
<input type="date" v-model="startDate" />
</p>
<div class="col-sm-8">
<input type="date" v-model="startDate" class="form-control" />
</div>
</div>
<div v-if="this.isHouseholdNew">
<h2>{{ $t('household_members_editor.composition.composition') }}</h2>
<div class="mb-3 row">
<label class="col-form-label col-sm-4 required">{{ $t('household_members_editor.composition.household_composition') }}</label>
<div class="col-sm-8">
<select v-model="householdCompositionType" class="form-select form-control">
<option v-for="t in householdCompositionTypes" :key="t.id" :value="t.id">{{ t.label.fr }}</option>
</select>
</div>
</div>
<div class="mb-3 row">
<label class="col-form-label col-sm-4 required">{{ $t('household_members_editor.composition.number_of_children') }}</label>
<div class="col-sm-8">
<input type="number" v-model="numberOfChildren" min="0" max="30" class="form-control"/>
</div>
</div>
</div>
</template>
<script>
import CurrentHousehold from "./CurrentHousehold";
import {mapGetters, mapState} from 'vuex';
export default {
name: 'Dates',
@@ -22,6 +43,27 @@ export default {
CurrentHousehold
},
computed: {
...mapState(['householdCompositionTypes']),
...mapGetters(['isHouseholdNew']),
householdCompositionType: {
get() {
if (this.$store.state.householdCompositionType !== null) {
return this.$store.state.householdCompositionType.id;
}
return null;
},
set(value) {
this.$store.commit('setHouseholdCompositionType', value);
},
},
numberOfChildren: {
get() {
return this.$store.state.numberOfChildren;
},
set(value) {
this.$store.commit('setNumberOfChildren', value);
}
},
startDate: {
get() {
return [

View File

@@ -0,0 +1,42 @@
<template>
<ckeditor
name="content"
v-bind:placeholder="$t('comment.content')"
:editor="editor"
v-model="content"
tag-name="textarea">
</ckeditor>
</template>
<script>
import CKEditor from '@ckeditor/ckeditor5-vue';
import ClassicEditor from "ChillMainAssets/module/ckeditor5";
export default {
name: "PersonComment.vue",
components: {
ckeditor: CKEditor.component,
},
props: ['conc'],
data() {
return {
editor: ClassicEditor,
}
},
computed: {
content: {
get() {
return this.$props.conc.comment || '';
},
set(value) {
console.log('set content', value);
this.$store.commit('setComment', {conc: this.$props.conc, comment: value})
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -3,15 +3,15 @@
<h2>{{ $t('household_members_editor.positioning.persons_to_positionnate')}}</h2>
<div class="list-household-members">
<div class="list-household-members flex-table">
<div
v-for="conc in concerned"
class="item-bloc"
v-bind:key="conc.person.id"
>
<div class="pick-position">
<div class="pick-position item-row">
<div class="person">
<person-render-box render="badge" :options="{}" :person="conc.person"></person-render-box>
<h3>{{ conc.person.text }}</h3>
</div>
<div class="holder">
<button
@@ -37,6 +37,12 @@
</button>
</div>
</div>
<div class="item-row">
<div>
<h6>{{ $t('household_members_editor.positioning.comment') }}</h6>
<person-comment :conc="conc"></person-comment>
</div>
</div>
</div>
</div>
</template>
@@ -46,12 +52,14 @@ import MemberDetails from './MemberDetails.vue';
import {mapGetters, mapState} from "vuex";
import CurrentHousehold from "./CurrentHousehold";
import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue';
import PersonComment from './PersonComment';
export default {
name: "Positioning",
components: {
CurrentHousehold,
PersonRenderBox,
PersonComment,
},
computed: {
...mapState([

View File

@@ -52,6 +52,7 @@ const appMessages = {
positioning: {
persons_to_positionnate: 'Usagers à positionner',
holder: "Titulaire",
comment: "Commentaire",
},
app: {
next: 'Suivant',
@@ -77,7 +78,12 @@ const appMessages = {
dates: {
start_date: "Début de validité",
end_date: "Fin de validité",
dates_title: "Période de validité",
dates_title: "Depuis le",
},
composition: {
composition: "Composition familiale",
household_composition: "Composition du ménage",
number_of_children: "Nombre d'enfants mineurs au sein du ménage",
},
confirmation: {
save: "Enregistrer",

View File

@@ -1,5 +1,6 @@
import { createStore } from 'vuex';
import { householdMove, fetchHouseholdSuggestionByAccompanyingPeriod, fetchAddressSuggestionByPerson} from './../api.js';
import { fetchResults } from 'ChillMainAssets/lib/api/apiMethods.js'
import { fetchHouseholdByAddressReference } from 'ChillPersonAssets/lib/household.js';
import { datetimeToISO } from 'ChillMainAssets/chill/js/date.js';
@@ -54,8 +55,11 @@ const store = createStore({
*/
householdSuggestionByAccompanyingPeriod: [], // TODO rename into householdsSuggestion
showHouseholdSuggestion: window.household_members_editor_expand_suggestions === 1,
householdCompositionType: null,
numberOfChildren: 0,
addressesSuggestion: [],
showAddressSuggestion: true,
householdCompositionTypes: [],
warnings: [],
errors: []
},
@@ -250,7 +254,8 @@ const store = createStore({
payload_conc,
payload = {
concerned: [],
destination: null
destination: null,
composition: null,
}
;
@@ -261,7 +266,6 @@ const store = createStore({
};
if (getters.isHouseholdNew && state.household.current_address !== null) {
console.log(state.household);
payload.destination.forceAddress = { id: state.household.current_address.address_id };
}
}
@@ -290,6 +294,19 @@ const store = createStore({
payload.concerned.push(payload_conc);
}
if (getters.isHouseholdNew) {
payload.composition = {
household_composition_type: {
type: state.householdCompositionType.type,
id: state.householdCompositionType.id,
},
number_of_children: state.numberOfChildren,
start_date: {
datetime: datetimeToISO(state.startDate),
},
};
}
return payload;
},
},
@@ -409,6 +426,15 @@ const store = createStore({
setErrors(state, errors) {
state.errors = errors;
},
setHouseholdCompositionTypes(state, types) {
state.householdCompositionTypes = types;
},
setHouseholdCompositionType(state, id) {
state.householdCompositionType = state.householdCompositionTypes.find(t => t.id = id);
},
setNumberOfChildren(state, number) {
state.numberOfChildren = Number.parseInt(number);
},
addAddressesSuggestion(state, addresses) {
let existingIds = state.addressesSuggestion
.map(a => a.address_id);
@@ -570,4 +596,8 @@ if (concerned.length > 0) {
});
}
fetchResults(`/api/1.0/person/houehold/composition/type.json`).then(types => {
store.commit('setHouseholdCompositionTypes', types);
})
export { store };

View File

@@ -7,7 +7,7 @@
{% import '@ChillPerson/AccompanyingCourse/Comment/macro_showItem.html.twig' as m %}
{% macro recordAction(comment, isPinned) %}
{% if isPinned is defined and isPinned == 'true' %}
{% if isPinned is defined and isPinned == true %}
{% else %}
<li>
<form method="post" action="{{ chill_path_forward_return_path('chill_person_accompanying_period_comment_pin', {'id': comment.id}) }}">
@@ -66,8 +66,8 @@
{{ _self.form_comment('edit', edit_form) }}
{% else %}
{{ m.show_comment(accompanyingCourse.pinnedComment, {
'pinned': 'true',
'recordAction': _self.recordAction(accompanyingCourse.pinnedComment, 'true')
'pinned': true,
'recordAction': _self.recordAction(accompanyingCourse.pinnedComment, true)
}) }}
{% endif %}
{% endif %}

View File

@@ -1,23 +1,25 @@
{%- set countPersonLocation = accompanyingCourse.availablePersonLocation|length -%}
{%- set hasPersonLocation = countPersonLocation > 0 -%}
<div class="alert alert-danger {% if hasPersonLocation %}alert-with-actions{% endif %}">
<div class="float-button bottom"><div class="box">
<div class="action">
<ul class="record_actions">
<li>
<a class="btn btn-sm btn-update change-icon"
href="{{ path('chill_person_accompanying_course_edit', { 'accompanying_period_id': accompanyingCourse.id, '_fragment': 'section-20' }) }}">
<i class="fa fa-fw fa-crosshairs"></i>
{{ 'fix it'|trans }}
</a>
</li>
</ul>
<div class="float-button bottom">
<div class="box">
<div class="action">
<ul class="record_actions">
<li>
<a class="btn btn-sm btn-update change-icon"
href="{{ path('chill_person_accompanying_course_edit', { 'accompanying_period_id': accompanyingCourse.id, '_fragment': 'section-20' }) }}">
<i class="fa fa-fw fa-crosshairs"></i>
{{ 'fix it'|trans }}
</a>
</li>
</ul>
</div>
<p>
{{ 'This course is located at a temporarily address. You should locate this course to an user'|trans }}</p>
{% if not hasPersonLocation %}
<p>
{{ 'Associate at least one member with an household, and set an address to this household'|trans }}</p>
{% endif %}
</div>
<p>
{{ 'This course is located at a temporarily address. You should locate this course to an user'|trans }}</p>
{% if not hasPersonLocation %}
<p>
{{ 'Associate at least one member with an household, and set an address to this household'|trans }}</p>
{% endif %}
</div></div>
</div>
</div>

View File

@@ -9,7 +9,7 @@
action: 'show', displayBadge: true,
targetEntity: { name: type, id: entity.id },
buttonText: entity|chill_entity_render_string,
isDead: entity.deathdate is not null,
isDead: entity.deathdate is defined and entity.deathdate is not null,
parent: parent
} %}
{% endmacro %}
@@ -212,16 +212,13 @@
{% endblock %}
{% block block_post_menu %}
<div class="post-menu pt-4">
<div class="d-grid gap-2">
<a class="btn btn-primary" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod', 'entityId': accompanyingCourse.id}) }}">
<i class="fa fa-paper-plane fa-fw"></i>
{{ 'notification.Notify'|trans }}
</a>
</div>
{{ chill_list_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', accompanyingCourse.id) }}
<div class="post-menu pt-4">
<div class="d-grid gap-2">
<a class="btn btn-primary" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod', 'entityId': accompanyingCourse.id}) }}">
<i class="fa fa-paper-plane fa-fw"></i>
{{ 'notification.Notify'|trans }}
</a>
</div>
{{ chill_list_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', accompanyingCourse.id) }}
</div>
{% endblock %}

View File

@@ -0,0 +1,127 @@
<div class="item-bloc accompanying_course_work-item{% if itemBlocClass is defined %} {{ itemBlocClass }}{% endif %}">
<div class="item-row">
<h2 class="badge-title">
<span class="title_label"></span>
<span class="title_action">{{ w.socialAction|chill_entity_render_string }}
<ul class="small_in_title columns mt-1">
<li>
<span class="item-key">{{ 'accompanying_course_work.start_date'|trans ~ ' : ' }}</span>
<b>{{ w.startDate|format_date('short') }}</b>
</li>
{% if w.endDate %}
<li>
<span class="item-key">{{ 'accompanying_course_work.end_date'|trans ~ ' : ' }}</span>
<b>{{ w.endDate|format_date('short') }}</b>
</li>
{% endif %}
</ul>
</span>
</h2>
</div>
<div class="item-row separator">
<div class="wrap-list">
{% if w.createdBy %}
<div class="wl-row">
<div class="wl-col title">
<h3>{{ 'Referrer'|trans }}</h3>
</div>
<div class="wl-col list">
<p class="wl-item">
{{ w.createdBy|chill_entity_render_box }}
</p>
</div>
</div>
{% endif %}
{%- if w.persons -%}
<div class="wl-row">
<div class="wl-col title">
<h3>{{ 'Persons in accompanying course'|trans }}</h3>
</div>
<div class="wl-col list">
{% for p in w.persons %}
<span class="wl-item">
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
action: 'show', displayBadge: true,
targetEntity: { name: 'person', id: p.id },
buttonText: p|chill_entity_render_string,
isDead: p.deathdate is not null
} %}
</span>
{% endfor %}
</div>
</div>
{% endif %}
{%- if w.handlingThierParty -%}
<div class="wl-row">
<div class="wl-col title">
<h3>{{ 'Thirdparty handling'|trans }}</h3>
</div>
<div class="wl-col list">
<span class="wl-item">
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
action: 'show', displayBadge: true,
targetEntity: { name: 'thirdparty', id: w.handlingThierParty.id },
buttonText: w.handlingThierParty|chill_entity_render_string
} %}
</span>
</div>
</div>
{% endif %}
{%- if w.socialAction.issue -%}
<div class="wl-row">
<div class="wl-col title">
<h3>{{ 'Social issue'|trans }}</h3>
</div>
<div class="wl-col list">
<p class="wl-item social-issues">
{{ w.socialAction.issue|chill_entity_render_box }}
</p>
</div>
</div>
{% endif %}
</div>
</div>
<div class="item-row column">
{% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' %}
</div>
<div class="item-row separator">
<div class="item-col item-meta">
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id) %}
{% if notif_counter.total > 0 %}
{{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id) }}
{% endif %}
{% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %}
{{ macro.updatedBy(w) }}
</div>
{% if displayAction is defined and displayAction == true %}
<div class="item-col">
<ul class="record_actions">
<li>
<a class="btn btn-edit" title="{{ 'Edit'|trans }}"
href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_edit', { 'id': w.id }) }}"
></a>
</li>
<li>
<a class="btn btn-delete" title="{{ 'Delete'|trans }}"
href="{{ path('chill_person_accompanying_period_work_delete', { 'id': w.id } ) }}"
></a>
</li>
</ul>
</div>
{% endif %}
</div>
</div>

View File

@@ -2,27 +2,34 @@
{% block title 'accompanying_course_work.Edit accompanying course work'|trans %}
{% block css %}
{{ parent() }}
{{ encore_entry_link_tags('vue_accourse_work_edit') }}
{{ encore_entry_link_tags('mod_entity_workflow_pick') }}
{% endblock %}
{% block content %}
<div class="accompanying_course_work-edit">
<h1>{{ block('title') }}</h1>
<div id="accompanying_course_work_edit"></div>
</div>
{% endblock %}
{% block block_post_menu %}
<div class="post-menu pt-4">
{% set workflows_frame = chill_entity_workflow_list('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', work.id) %}
{% if workflows_frame is not empty %}
{{ workflows_frame|raw }}
{% endif %}
</div>
{% endblock %}
{% block js %}
{{ parent() }}
<script type="text/javascript">
window.accompanyingCourseWork = {{ json|json_encode|raw }};
window.accompanyingCourseWork = {{ json|json_encode|raw }};
</script>
{{ encore_entry_script_tags('vue_accourse_work_edit') }}
{{ encore_entry_script_tags('mod_entity_workflow_pick') }}
{% endblock %}
{% block css %}
{{ parent() }}
{{ encore_entry_link_tags('vue_accourse_work_edit') }}
{% endblock %}

View File

@@ -18,133 +18,7 @@
{% else %}
<div class="flex-table accompanying_course_work-list">
{% for w in works %}
<div class="item-bloc">
<div class="item-row">
<h2 class="badge-title">
<span class="title_label"></span>
<span class="title_action">{{ w.socialAction|chill_entity_render_string }}
<ul class="small_in_title columns mt-1">
<li>
<span class="item-key">{{ 'accompanying_course_work.start_date'|trans ~ ' : ' }}</span>
<b>{{ w.startDate|format_date('short') }}</b>
</li>
{% if w.endDate %}
<li>
<span class="item-key">{{ 'accompanying_course_work.end_date'|trans ~ ' : ' }}</span>
<b>{{ w.endDate|format_date('short') }}</b>
</li>
{% endif %}
</ul>
</span>
</h2>
</div>
<div class="item-row separator">
<div class="wrap-list">
{% if w.createdBy %}
<div class="wl-row">
<div class="wl-col title">
<h3>{{ 'Referrer'|trans }}</h3>
</div>
<div class="wl-col list">
<p class="wl-item">
{{ w.createdBy|chill_entity_render_box }}
</p>
</div>
</div>
{% endif %}
{%- if w.persons -%}
<div class="wl-row">
<div class="wl-col title">
<h3>{{ 'Persons in accompanying course'|trans }}</h3>
</div>
<div class="wl-col list">
{% for p in w.persons %}
<span class="wl-item">
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
action: 'show', displayBadge: true,
targetEntity: { name: 'person', id: p.id },
buttonText: p|chill_entity_render_string,
isDead: entity.deathdate is not null
} %}
</span>
{% endfor %}
</div>
</div>
{% endif %}
{%- if w.handlingThierParty -%}
<div class="wl-row">
<div class="wl-col title">
<h3>{{ 'Thirdparty handling'|trans }}</h3>
</div>
<div class="wl-col list">
<span class="wl-item">
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
action: 'show', displayBadge: true,
targetEntity: { name: 'thirdparty', id: w.handlingThierParty.id },
buttonText: w.handlingThierParty|chill_entity_render_string,
parent: {
'type': 'accompanying_period_resource',
'id': r.id,
'comment': r.comment,
'parent': {
'type': 'accompanying_period',
'id': accompanyingCourse.id
}
}
}
%}
</span>
</div>
</div>
{% endif %}
{%- if w.socialAction.issue -%}
<div class="wl-row">
<div class="wl-col title">
<h3>{{ 'Social issue'|trans }}</h3>
</div>
<div class="wl-col list">
<p class="wl-item social-issues">
{{ w.socialAction.issue|chill_entity_render_box }}
</p>
</div>
</div>
{% endif %}
</div>
</div>
<div class="item-row column">
{% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with {} %}
</div>
<div class="item-row separator">
<div class="updatedBy">
{{ 'Last updated by'|trans}} <b>{{ w.updatedBy|chill_entity_render_box }}</b>,<br>
{{ 'le ' ~ w.updatedAt|format_datetime('long', 'short') }}
</div>
<ul class="record_actions">
<li>
<a class="btn btn-edit" title="{{ 'Edit'|trans }}"
href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_edit', { 'id': w.id }) }}"
></a>
</li>
<li>
<a class="btn btn-delete" title="{{ 'Delete'|trans }}"
href="{{ path('chill_person_accompanying_period_work_delete', { 'id': w.id } ) }}"
></a>
</li>
</ul>
</div>
</div>
{% include '@ChillPerson/AccompanyingCourseWork/_item.html.twig' with { 'displayAction': true } %}
{% endfor %}
</div>
{% endif %}

View File

@@ -46,16 +46,15 @@
{% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with {} %}
</ul>
<div class="metadata text-end" style="font-size: 60%">
{{ 'Last updated by'|trans }}
<span class="user">{{ w.updatedBy|chill_entity_render_box }}</span>:
<span class="date">{{ w.updatedAt|format_datetime('short', 'short') }}</span>
<div class="metadata text-end">
{% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %}
{{ macro.updatedBy(w) }}
</div>
</span>
</div>
</a>{# {{ dump(w) }} #}
</a>
{% endfor %}
</div>

View File

@@ -113,11 +113,19 @@
{% endif %}
</div>
</div>
{% if recordAction is defined %}
<div class="item-row separator">
<ul class="record_actions">
{{ recordAction }}
</ul>
<div class="item-row separator">
<div class="item-col item-meta">
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', period.id) %}
{% if notif_counter.total > 0 %}
{{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', period.id) }}
{% endif %}
</div>
{% endif %}
<div class="item-col">
{% if recordAction is defined %}
<ul class="record_actions">
{{ recordAction }}
</ul>
{% endif %}
</div>
</div>
</div>

View File

@@ -4,12 +4,14 @@
{% block title 'household.Edit household members'|trans %}
{% block content %}
<div class="col-md-10 col-xxl household-members">
<div class="row">
<div class="col-md-10 col-xxl household-members">
<h1>{{ block('title') }}</h1>
<div id="household_members_editor"></div>
<h1>{{ block('title') }}</h1>
<div id="household_members_editor"></div>
</div>
</div>
</div>
{% endblock %}
{% block js %}

View File

@@ -51,7 +51,42 @@
</div>
<div class="item-bloc col-7 col-comment">
{% if form is null %}
{% set currentComposition = household.currentComposition %}
{% if currentComposition is not null %}
<div>
<h6>
{{ currentComposition.householdCompositionType.label|localize_translatable_string }}
</h6>
<p>
{{ 'household_composition.numberOfChildren children in household'|trans({'numberOfChildren': currentComposition.numberOfChildren}) }}
</p>
<p>
{{ 'household_composition.Since'|trans({'startDate': currentComposition.startDate}) }}
</p>
<ul class="record_actions">
<li>
<a class="btn btn-sm btn-update change-icon"
href="{{ path('chill_person_household_composition_index', {'id': household.id}) }}">
{{ 'household_composition.Update composition'|trans }}
</a>
</li>
</ul>
</div>
{% else %}
<div class="alert alert-danger">
<p>
{{ 'household_composition.Currently no composition'|trans }}
</p>
<ul class="record_actions" style="margin-bottom: 0">
<li>
<a class="btn btn-sm btn-update change-icon"
href="{{ path('chill_person_household_composition_index', {'id': household.id}) }}">
{{ 'household_composition.Add a composition'|trans }}
</a>
</li>
</ul>
</div>
{% endif %}
{% if household.waitingForBirth or not household.commentMembers.isEmpty() %}
<div class="p-4 bg-light">
{% if household.waitingForBirth %}
@@ -176,13 +211,26 @@
<span class="unfolded text-secondary">{{ 'household.Hide memberships'|trans }}</span>
</button>
</h2>
{% macro buttonsOldMembers(member) %}
{% set household = member.person.getCurrentHousehold %}
{% if household is not null %}
<li>
<a href="{{ path('chill_person_household_summary', { 'household_id': household.id }) }}" class="btn btn-sm btn-chill-beige"><i class="fa fa-home"></i></a>
</li>
{% endif %}
{% endmacro %}
<div id="collapse_{{ p == '_none' ? '_none' : p.id }}"
class="accordion-collapse collapse"
aria-labelledby="heading_{{ p == '_none' ? '_none' : p.id }}"
data-bs-parent="#nonCurrent">
<div class="flex-table my-0 list-household-members">
{% for m in old_members %}
{% include '@ChillPerson/Household/_render_member.html.twig' with { 'member': m } %}
{% include '@ChillPerson/Household/_render_member.html.twig' with {
'member': m,
'customButtons': { 'before': _self.buttonsOldMembers(m) }
} %}
{% endfor %}
</div>
</div>

View File

@@ -0,0 +1,96 @@
{% extends '@ChillPerson/Household/layout.html.twig' %}
{% block title 'household_composition.Compositions'|trans %}
{% block block_post_menu %}
<div class="post-menu"></div>
{% endblock %}
{% block content %}
<div class="household_composition">
<h1>{{ block('title') }}</h1>
{% if compositions|length == 0 %}
<p class="chill-no-data-statement">{{ 'household_composition.No composition yet'|trans }}</p>
{% else %}
<div class="flex-table">
{% for c in compositions %}
{% if c.id != editId %}
<div class="item-bloc">
<div class="item-row">
<div class="item-col">
<h3>{{ c.householdCompositionType.label|localize_translatable_string }}</h3>
<p>{{ 'household_composition.numberOfChildren'|trans }}: {{ c.numberOfChildren }}</p>
</div>
<div class="item-col">{{ 'household_composition.Since'|trans({'startDate': c.startDate}) }}</div>
</div>
<div class="item-row">
<div class="item-col">
{% if c.endDate is null %}
<span class="chill-no-data-statement">{{ 'household_composition.Still active'|trans }}</span>
{% else %}
{{ 'household_composition.Until'|trans({'endDate': c.endDate })}}
{% endif %}
</div>
</div>
{% if c.comment.comment is not empty %}
<div class="item-row separator">
{{ c.comment|chill_entity_render_box }}
</div>
{% endif %}
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', c.household) %}
<div class="item-row">
<ul class="record_actions">
<li>
<a href="{{ path('chill_person_household_composition_index', {'id': c.household.id, 'edit': c.id}) }}" class="btn btn-edit"></a>
</li>
<li>
<a href="{{ path('chill_person_household_composition_index', {'id': c.household.id, 'edit': c.id}) }}" class="btn btn-edit"></a>
</li>
</ul>
</div>
{% endif %}
</div>
{% else %}
{{ form_start(form) }}
{{ form_widget(form) }}
<ul class="record_actions">
<li class="cancel">
<a href="{{ path('chill_person_household_composition_index', {'id': c.household.id}) }}">{{ 'Cancel'|trans }}</a>
</li>
<li>
<button type="submit" class="btn btn-create">{{ 'Save'|trans }}</button>
</li>
</ul>
{{ form_end(form) }}
{% endif %}
{% endfor %}
</div>
{% endif %}
<div id="collapseForm" class="{% if not isPosted %}collapse{% endif %}">
{{ form_start(form) }}
{{ form_widget(form) }}
<ul class="record_actions">
<li>
<button type="submit" class="btn btn-create">{{ 'Save'|trans }}</button>
</li>
</ul>
{{ form_end(form) }}
</div>
{% if editId == -1 %}
<ul class="record_actions sticky-form-buttons">
<li>
<button class="btn btn-primary btn-create change-icon" type="button" data-bs-toggle="collapse" data-bs-target="#collapseForm" aria-expanded="false" aria-controls="collapseForm">
{{ 'Create'|trans }}
</button>
</li>
</ul>
{% endif %}
</div>
{% endblock %}

View File

@@ -0,0 +1,12 @@
{% macro updatedBy(entity) %}
<div class="updatedBy">
{{ 'Last updated on'|trans }}
<span class="date">
{{ entity.updatedAt|format_datetime('medium', 'short') }}
</span>,
{{ 'by_user'|trans }}
<span class="user">
{{ entity.updatedBy|chill_entity_render_box }}
</span>
</div>
{% endmacro %}

View File

@@ -63,18 +63,43 @@
{{ form_start(form, {'attr' : {'id' : 'create-form'}}) }}
<div class="row mb-1" style="display:flex;">
{{ form_label(form.lastName, 'Last name'|trans) }}
<div class="col-sm-8">
{{ form_widget(form.lastName, {'attr': {'data-suggest-transform': 'uppercase_all' } }) }}
</div>
</div>
<div data-suggest-container="{{ form.lastName.vars.full_name|e('html_attr') }}" class="col-sm-8" style="margin-left: auto;"></div>
{{ form_row(form.lastName, { 'label' : 'Last name'|trans }) }}
{{ form_row(form.firstName, { 'label' : 'First name'|trans }) }}
<div class="row mb-1" style="display:flex;">
{{ form_label(form.firstName, 'First name'|trans) }}
<div class="col-sm-8">
{{ form_widget(form.firstName, {'attr': {'data-suggest-transform': 'uppercase_first_letter' } }) }}
</div>
</div>
<div data-suggest-container="{{ form.firstName.vars.full_name|e('html_attr') }}" class="col-sm-8" style="margin-left: auto;"></div>
{% if form.altNames is defined %}
{{ form_widget(form.altNames) }}
{% for altName in form.altNames %}
<div class="row mb-1" style="display:flex;">
{{ form_label(altName) }}
<div class="col-sm-8">
{{ form_widget(altName, {'attr': {'data-suggest-transform': 'uppercase_all' } }) }}
</div>
</div>
<div data-suggest-container="{{ altName.vars.full_name|e('html_attr') }}" class="col-sm-8" style="margin-left: auto;"></div>
{% endfor %}
{% endif %}
{{ form_row(form.gender, { 'label' : 'Gender'|trans }) }}
{{ form_row(form.birthdate, { 'label' : 'Date of birth'|trans }) }}
{{ form_row(form.gender, { 'label' : 'Gender'|trans }) }}
{{ form_row(form.phonenumber, { 'label' : 'Phonenumber'|trans }) }}
{{ form_row(form.mobilenumber, { 'label' : 'Mobilenumber'|trans }) }}
{{ form_row(form.email, { 'label' : 'Email'|trans }) }}
{% if form.center is defined %}
{{ form_row(form.center) }}
@@ -93,7 +118,7 @@
<li>
{{ form_widget(form.createPeriod, { 'attr': { 'class': 'dropdown-item' }}) }}
</li>
</ul>
</ul>
</li>
</ul>
@@ -103,5 +128,5 @@
{% endblock content %}
{% block js %}
{# {{ encore_entry_script_tags('mod_disablebuttons') }} #}
{{ encore_entry_script_tags('page_suggest_names') }}
{% endblock js %}

View File

@@ -125,7 +125,7 @@
{% if not person.isSharingHousehold() %}
<ul class="record_actions">
<li>
<a class="btn btn-misc" href="{{chill_path_add_return_path('chill_person_household_members_editor', { 'persons': [ person.id ], 'followAfter': 'true'}) }}">
<a class="btn btn-misc" href="{{chill_path_add_return_path('chill_person_household_members_editor', { 'persons': [ person.id ], 'followAfter': true}) }}">
<i class="fa fa-sign-in fa-fw"></i>
{{ 'household.Join'|trans }}
</a>

View File

@@ -83,7 +83,7 @@
<ul class="record_actions">
{% if is_granted('CHILL_PERSON_CREATE') %}
<li>
<a href="{{ path('chill_person_new') }}" class="btn btn-create">
<a href="{{ path('chill_person_new', { "_fragment": pattern }) }}" class="btn btn-create">
{{ 'Add a person'|trans }}
</a>
</li>

View File

@@ -26,7 +26,7 @@
<ul class="record_actions">
{% if is_granted('CHILL_PERSON_CREATE') %}
<li>
<a href="{{ path('chill_person_new') }}" class="btn btn-create">
<a href="{{ path('chill_person_new', { "_fragment": pattern }) }}" class="btn btn-create">
{{ 'Add a person'|trans }}
</a>
</li>
@@ -74,138 +74,158 @@
{# add as requestor #}
{% if acps|length > 0 %}
<div class="item-row">
<div class="wrap-list periods-list">
{% for acp in acps %}
{% set app = person.findParticipationForPeriod(acp) %}
<div class="wl-row separator">
{% for acp in acps %}
{% set app = person.findParticipationForPeriod(acp) %}
<div class="item-row separator">
<div class="wrap-list periods-list">
<div class="wl-row">
<div class="wl-col title">
<div>
{% if acp.emergency %}
<span class="badge rounded-pill bg-danger">{{- 'Emergency'|trans|upper -}}</span>
{% endif %}
{% if acp.confidential %}
<span class="badge rounded-pill bg-confidential">{{- 'Confidential'|trans|upper -}}</span>
{% endif %}
</div>
{% if acp.step == 'DRAFT' %}
<div class="is-draft">
<span class="course-draft badge bg-secondary" title="{{ 'course.draft'|trans }}">{{ 'course.draft'|trans }}</span>
</div>
{% endif %}
{% if acp.step == 'CLOSED' %}
<div class="is-closed">
<span class="course-closed badge bg-danger" title="{{ 'course.closed'|trans }}">{{ 'course.closed'|trans }}</span>
</div>
{% endif %}
{% if acp.requestorPerson == person %}
<div>
<span class="as-requestor badge bg-info" title="{{ 'Requestor'|trans|e('html_attr') }}">
{{ 'Requestor'|trans({'gender': person.gender}) }}
</span>
</div>
{% endif %}
<div class="date">
<h3 class="courseid mb-2">
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': acp.id }) }}"
title="{{ 'See accompanying period'|trans }}" class="btn btn-outline-primary">
<i class="fa fa-random fa-fw"></i>
{{ 'File number'|trans }} {{ acp.id }}
</a>
</h3>
</div>
<div class="wl-col list">
<div class="d-flex flex-column justify-content-center">
{% if app != null %}
{{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }}
<div class="date">
{{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }}
</div>
{% endif %}
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) %}
{% if notif_counter.total > 0 %}
{{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) }}
{% endif %}
</div>
{% if acp.user is not null %}
<div class="ms-auto">
{% if acp.emergency %}
<span class="badge rounded-pill bg-danger">{{- 'Emergency'|trans|upper -}}</span>
{% endif %}
{% if acp.confidential %}
<span class="badge rounded-pill bg-confidential">{{- 'Confidential'|trans|upper -}}</span>
{% endif %}
{% if acp.step == 'DRAFT' %}
<span class="badge bg-secondary" style="font-size: 85%;" title="{{ 'course.draft'|trans }}">{{ 'course.draft'|trans }}</span>
{% endif %}
</div>
</div>
</div>
{% if acp.user is not null %}
<div class="wl-row">
<div class="wl-col title">
<h3 class="referrer">{{ 'Referrer'|trans }}</h3>
</div>
<div class="wl-col list">
<div class="user">
<abbr class="referrer" title="{{ 'Referrer'|trans }}">ref:</abbr>
{{ acp.user|chill_entity_render_box }}
</div>
{% endif %}
<div class="courseid">
{{ 'File number'|trans }} {{ acp.id }}
</div>
</div>
<div class="wl-col list">
{% for issue in acp.socialIssues %}
{{ issue|chill_entity_render_box }}
{% endfor %}
<ul class="record_actions record_actions_column">
<li>
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': acp.id }) }}"
class="btn btn-sm btn-outline-primary" title="{{ 'See accompanying period'|trans }}">
<i class="fa fa-random fa-fw"></i>
</a>
</li>
<li>
</li>
</ul>
</div>
</div>
{% if acp.currentParticipations|length > 1 %}
<div class="wl-row">
<div class="wl-col title">
<div class="participants">
{{ 'Participants'|trans }}
</div>
</div>
<div class="wl-col list">
{% set participating = false %}
{% for part in acp.currentParticipations %}
{% if part.person.id != person.id %}
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
targetEntity: { name: 'person', id: part.person.id },
action: 'show',
displayBadge: true,
buttonText: part.person|chill_entity_render_string,
isDead: part.person.deathdate is not null
} %}
{% else %}
{% set participating = true %}
{% endif %}
{% endfor %}
{% if participating %}
{{ 'person.and_himself'|trans({'gender': person.gender}) }}
{% endif %}
</div>
</div>
{% endif %}
{% if (acp.requestorPerson is not null and acp.requestorPerson.id != person.id) or acp.requestorThirdParty is not null %}
<div class="wl-row">
<div class="wl-col title">
<div>
{% if acp.requestorPerson is not null %}
{{ 'Requestor'|trans({'gender': acp.requestorPerson.gender}) }}
{% else %}
{{ 'Requestor'|trans({'gender': 'other'})}}
{% endif %}
</div>
</div>
<div class="wl-col list">
{% if acp.requestorThirdParty is not null %}
{% if acp.socialIssues|length > 0 %}
<div class="wl-row">
<div class="wl-col title">
<h3>{{ 'Social issues'|trans }}</h3>
</div>
<div class="wl-col list">
{% for issue in acp.socialIssues %}
{{ issue|chill_entity_render_box }}
{% endfor %}
</div>
</div>
{% endif %}
{# ????
{% if acp.requestorPerson == person %}
<div class="wl-row">
<div class="wl-col title">
<h3>
</h3>
</div>
<div class="wl-col list">
<span class="as-requestor badge bg-info" title="{{ 'Requestor'|trans|e('html_attr') }}">
{{ 'Requestor'|trans({'gender': person.gender}) }}
</span>
</div>
</div>
{% endif %}
#}
{% if acp.currentParticipations|length > 1 %}
<div class="wl-row">
<div class="wl-col title">
<h3 class="participants">
{{ 'Participants'|trans }}
</h3>
</div>
<div class="wl-col list">
{% set participating = false %}
{% for part in acp.currentParticipations %}
{% if part.person.id != person.id %}
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
targetEntity: { name: 'person', id: part.person.id },
action: 'show',
displayBadge: true,
buttonText: part.person|chill_entity_render_string,
isDead: part.person.deathdate is not null
} %}
{% else %}
{% set participating = true %}
{% endif %}
{% endfor %}
{% if participating %}
{{ 'person.and_himself'|trans({'gender': person.gender}) }}
{% endif %}
</div>
</div>
{% endif %}
{% if (acp.requestorPerson is not null and acp.requestorPerson.id != person.id) or acp.requestorThirdParty is not null %}
<div class="wl-row">
<div class="wl-col title">
<h3>
{% if acp.requestorPerson is not null %}
{{ 'Requestor'|trans({'gender': acp.requestorPerson.gender}) }}
{% else %}
{{ 'Requestor'|trans({'gender': 'other'})}}
{% endif %}
</h3>
</div>
<div class="wl-col list">
{% if acp.requestorThirdParty is not null %}
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
targetEntity: { name: 'thirdparty', id: acp.requestorThirdParty.id },
action: 'show',
displayBadge: true,
buttonText: acp.requestorThirdParty|chill_entity_render_string
} %}
{% else %}
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
targetEntity: { name: 'person', id: acp.requestorPerson.id },
action: 'show',
displayBadge: true,
buttonText: acp.requestorPerson|chill_entity_render_string,
isDead: acp.requestorPerson.deathdate is not null
} %}
{% endif %}
</div>
{% else %}
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
targetEntity: { name: 'person', id: acp.requestorPerson.id },
action: 'show',
displayBadge: true,
buttonText: acp.requestorPerson|chill_entity_render_string,
isDead: acp.requestorPerson.deathdate is not null
} %}
{% endif %}
</div>
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
{% endfor %}
{% endif %}
</div>

View File

@@ -301,10 +301,8 @@ This view should receive those arguments:
</div>
{% endif %}
{% if person.updatedBy %}
<div class="updatedBy">
{{ 'Last updated by'|trans}}: <b>{{ person.updatedBy|chill_entity_render_box }}</b>,<br>
{{ 'on'|trans ~ person.updatedAt|format_datetime('long', 'short') }}
</div>
{% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %}
{{ macro.updatedBy(person) }}
{% endif %}
</div>

View File

@@ -0,0 +1,17 @@
<div class="flex-table accompanying_course_work-list">
{% include '@ChillPerson/AccompanyingCourseWork/_item.html.twig' with {
'w': work,
'itemBlocClass': 'bg-chill-llight-gray'
} %}
</div>
{% if display_action is defined and display_action == true %}
<ul class="record_actions">
<li>
<a class="btn btn-update"
href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_edit', { 'id': work.id }) }}">
{{ 'Edit'|trans }}
</a>
</li>
</ul>
{% endif %}

View File

@@ -0,0 +1,19 @@
{% import '@ChillMain/Workflow/macro_breadcrumb.html.twig' as m %}
<div class="flex-grow-1 {% if add_classes is defined %}{{ add_classes }}{% else %}h2{% endif %}">
<div>
{% if concerne is defined and concerne == true %}
<span class="item-key">{{ 'Concerne'|trans }}: </span>
{% endif %}
{{ 'workflow.Work (n°%w%)'|trans({'%w%': work.id }) }}
{% if description is defined and description == true %}
{{ ' — ' ~ work.socialAction|chill_entity_render_string }}
{% endif %}
</div>
{% if breadcrumb is defined and breadcrumb == true %}
{{ m.breadcrumb(_context) }}
{% endif %}
</div>

View File

@@ -0,0 +1,99 @@
<div class="flex-table accompanying_course_work-list">
<div class="item-bloc evaluation-item bg-chill-llight-gray">
<div class="item-row mb-2">
<h2 class="badge-title">
<span class="title_label"></span>
<span class="title_action">
{{ evaluation.accompanyingPeriodWork.socialAction|chill_entity_render_string }}
<ul class="small_in_title columns mt-1">
<li>
<span class="item-key">{{ 'accompanying_course_work.start_date'|trans ~ ' : ' }}</span>
<b>{{ evaluation.accompanyingPeriodWork.startDate|format_date('short') }}</b>
</li>
{% if evaluation.accompanyingPeriodWork.endDate %}
<li>
<span class="item-key">{{ 'accompanying_course_work.end_date'|trans ~ ' : ' }}</span>
<b>{{ evaluation.accompanyingPeriodWork.endDate|format_date('short') }}</b>
</li>
{% endif %}
</ul>
</span>
</h2>
</div>
<div class="item-row column">
<table class="obj-res-eval my-3" style="font-size: 110% !important;">
<thead>
<tr>
<th class="eval">
<h4 class="title_label">
{{ 'Évaluation'|trans }}
</h4>
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="eval">
<ul class="eval_title">
<li class="my-2">
{{ evaluation.evaluation.title|localize_translatable_string }}
<ul class="columns pt-2">
<li>
<span class="item-key">{{ 'accompanying_course_work.start_date'|trans ~ ' : ' }}</span>
<b>{{ evaluation.startDate|format_date('short') }}</b>
</li>
{% if evaluation.endDate %}
<li>
<span class="item-key">{{ 'accompanying_course_work.end_date'|trans ~ ' : ' }}</span>
<b>{{ evaluation.endDate|format_date('short') }}</b>
</li>
{% endif %}
{% if evaluation.maxDate %}
<li>
<span class="item-key">{{ 'accompanying_course_work.max_date'|trans ~ ' : ' }}</span>
<b>{{ evaluation.maxDate|format_date('short') }}</b>
</li>
{% endif %}
{% if evaluation.warningInterval and evaluation.warningInterval.d > 0 %}
<li>
{% set days = (evaluation.warningInterval.d + evaluation.warningInterval.m * 30) %}
<span class="item-key">{{ 'accompanying_course_work.warning_interval'|trans ~ ' : ' }}</span>
{{ 'accompanying_course_work.%days% days before max_date'|trans({'%days%': days }) }}
</li>
{% endif %}
<li>
<span class="item-key">créé par</span>
<b>{{ evaluation.createdBy.username }}</b>
<span class="item-key">{{ 'le'|trans }}</span>
<b>{{ evaluation.createdAt|format_date('short') }}</b>
</li>
</ul>
{% if evaluation.comment %}
<blockquote class="chill-user-quote" style="margin-left: 0;">
{{ evaluation.comment }}
</blockquote>
{% endif %}
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="item-row">
{% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %}
{{ macro.updatedBy(evaluation) }}
</div>
</div>
</div>
{% if display_action is defined and display_action == true %}
{# TODO add acl #}
<ul class="record_actions">
<li>
<a class="btn btn-show" href="{{ path('chill_person_accompanying_period_work_edit', {'id': evaluation.accompanyingPeriodWork.id}) }}">
{{ 'Show'|trans }}
</a>
</li>
</ul>
{% endif %}

View File

@@ -0,0 +1,19 @@
{% import '@ChillMain/Workflow/macro_breadcrumb.html.twig' as m %}
<div class="flex-grow-1 {% if add_classes is defined %}{{ add_classes }}{% else %}h2{% endif %}">
<div>
{% if concerne is defined and concerne == true %}
<span class="item-key">{{ 'Concerne'|trans }}: </span>
{% endif %}
{{ 'workflow.Evaluation (n°%eval%)'|trans({'%eval%': evaluation.id}) }}
{% if description is defined and description == true %}
{{ ' — ' ~ evaluation.evaluation.title|localize_translatable_string }}
{% endif %}
</div>
{% if breadcrumb is defined and breadcrumb == true %}
{{ m.breadcrumb(_context) }}
{% endif %}
</div>