mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 11:33:49 +00:00
Merge remote-tracking branch 'origin/master' into 616_rapid-action
This commit is contained in:
@@ -207,10 +207,11 @@ div.banner {
|
||||
span.badge-member {
|
||||
flex-shrink: 0; flex-grow: 0; flex-basis: auto;
|
||||
color: $white;
|
||||
background-color: transparentize($white, 0.85);
|
||||
border: 1px solid transparentize($white, 0.75);
|
||||
border-bottom: 3px solid transparentize( shade-color( $chill-green, 20%), 0.3);
|
||||
border-radius: 8px;
|
||||
padding: 0.2em 0.7em;
|
||||
padding: 0.0em 0.5em;
|
||||
margin-bottom: 0.2em;
|
||||
margin-right: 0.3em;
|
||||
|
||||
|
@@ -297,7 +297,7 @@
|
||||
@go-to-generate-workflow="goToGenerateWorkflow"
|
||||
></list-workflow-modal>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<button v-if="AmIRefferer"
|
||||
class="btn btn-notify"
|
||||
@@ -311,7 +311,7 @@
|
||||
</ul>
|
||||
</template>
|
||||
</li>
|
||||
|
||||
|
||||
<li v-if="!isPosting">
|
||||
<button class="btn btn-save" @click="submit">
|
||||
{{ $t('action.save') }}
|
||||
@@ -348,6 +348,10 @@ import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods';
|
||||
const i18n = {
|
||||
messages: {
|
||||
fr: {
|
||||
action: {
|
||||
save: "Enregistrer"
|
||||
},
|
||||
conflict_on_save: "Désolé, cette action d'accompagnement a été modifiée dans une autre fenêtre ou par un autre utilisateur. Rechargez la page pour voir ses changements.",
|
||||
action_title: "Action d'accompagnement",
|
||||
comments: "Commentaire",
|
||||
startDate: "Date de début",
|
||||
@@ -378,6 +382,7 @@ const i18n = {
|
||||
no_evaluations_available: "Aucune évaluation disponible",
|
||||
no_goals_available: "Aucun objectif disponible",
|
||||
referrers: "Agents traitants",
|
||||
add_referrers: "Ajouter des agents traitants",
|
||||
no_referrers: "Aucun agent traitant",
|
||||
choose_referrers: "Choisir des agents traitants",
|
||||
remove_referrer: "Enlever l'agent",
|
||||
@@ -468,6 +473,7 @@ export default {
|
||||
'errors',
|
||||
'templatesAvailablesForAction',
|
||||
'me',
|
||||
'version'
|
||||
]),
|
||||
...mapGetters([
|
||||
'hasResultsForAction',
|
||||
@@ -595,7 +601,9 @@ export default {
|
||||
submit() {
|
||||
this.$store.dispatch('submit').catch((error) => {
|
||||
if (error.name === 'ValidationException' || error.name === 'AccessException') {
|
||||
error.violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
error.violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else if (error.name === 'ConflictHttpException') {
|
||||
this.$toast.open({message: this.$t('conflict_on_save')});
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'});
|
||||
throw error;
|
||||
@@ -621,8 +629,10 @@ export default {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({message: v });
|
||||
}
|
||||
} else if (error.name === 'ConflictHttpException') {
|
||||
this.$toast.open({message: this.$t('conflict_on_save')});
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'});
|
||||
this.$toast.open({message: 'An error occurred'});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@@ -135,6 +135,8 @@
|
||||
:filename="d.title"
|
||||
:can-edit="true"
|
||||
:execute-before-leave="submitBeforeLeaveToEditor"
|
||||
:davLink="d.storedObject._links?.dav_link.href"
|
||||
:davLinkExpiration="d.storedObject._links?.dav_link.expiration"
|
||||
@on-stored-object-status-change="onStatusDocumentChanged"
|
||||
></document-action-buttons-group>
|
||||
</li>
|
||||
|
@@ -35,7 +35,8 @@ const store = createStore({
|
||||
referrers: window.accompanyingCourseWork.referrers,
|
||||
isPosting: false,
|
||||
errors: [],
|
||||
me: null
|
||||
me: null,
|
||||
version: window.accompanyingCourseWork.version
|
||||
},
|
||||
getters: {
|
||||
socialAction(state) {
|
||||
@@ -74,6 +75,7 @@ const store = createStore({
|
||||
return {
|
||||
type: 'accompanying_period_work',
|
||||
id: state.work.id,
|
||||
version: state.version,
|
||||
startDate: state.startDate === null || state.startDate === '' ? null : {
|
||||
datetime: datetimeToISO(ISOToDate(state.startDate))
|
||||
},
|
||||
@@ -501,22 +503,26 @@ const store = createStore({
|
||||
submit({ getters, state, commit }, callback) {
|
||||
let
|
||||
payload = getters.buildPayload,
|
||||
url = `/api/1.0/person/accompanying-course/work/${state.work.id}.json`,
|
||||
params = new URLSearchParams({'entity_version': state.version}),
|
||||
url = `/api/1.0/person/accompanying-course/work/${state.work.id}.json?${params}`,
|
||||
errors = []
|
||||
;
|
||||
|
||||
commit('setIsPosting', true);
|
||||
|
||||
console.log('the social action', payload);
|
||||
// console.log('the social action', payload);
|
||||
|
||||
return makeFetch('PUT', url, payload)
|
||||
.then(data => {
|
||||
if (typeof(callback) !== 'undefined') {
|
||||
return callback(data);
|
||||
} else {
|
||||
console.info('nothing to do here, bye bye');
|
||||
// console.log('payload', payload.privateComment)
|
||||
// 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', error)
|
||||
commit('setIsPosting', false);
|
||||
throw error;
|
||||
});
|
||||
|
@@ -1,11 +1,10 @@
|
||||
<template>
|
||||
<teleport to="#export_filters_social_work_type_filter_form">
|
||||
|
||||
|
||||
<fieldset class="mb-3" id="actionType">
|
||||
<div class="row">
|
||||
<legend class="col-sm-4 col-form-label">{{ $t('action.label')}}</legend>
|
||||
<div class="col-sm-8">
|
||||
|
||||
|
||||
<VueMultiselect
|
||||
v-model="action"
|
||||
:options="actions.options"
|
||||
@@ -14,20 +13,20 @@
|
||||
:multiple="true"
|
||||
:close-on-select="false"
|
||||
:placeholder="$t('action.placeholder')"
|
||||
label="text"
|
||||
:custom-label="formatSocialAction"
|
||||
track-by="id"
|
||||
:searchable="true"
|
||||
></VueMultiselect>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset class="mb-3" id="goal">
|
||||
<div class="row">
|
||||
<legend class="col-sm-4 col-form-label">{{ $t('goal.label')}}</legend>
|
||||
<div class="col-sm-8">
|
||||
|
||||
|
||||
<VueMultiselect
|
||||
v-model="goal"
|
||||
:options="goals.options"
|
||||
@@ -41,16 +40,16 @@
|
||||
track-by="id"
|
||||
:searchable="true"
|
||||
></VueMultiselect>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset class="mb-3" id="result">
|
||||
<div class="row">
|
||||
<legend class="col-sm-4 col-form-label">{{ $t('result.label')}}</legend>
|
||||
<div class="col-sm-8">
|
||||
|
||||
|
||||
<VueMultiselect
|
||||
v-model="result"
|
||||
:options="results.options"
|
||||
@@ -64,12 +63,10 @@
|
||||
track-by="id"
|
||||
:searchable="true"
|
||||
></VueMultiselect>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
</teleport>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -150,74 +147,120 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getSocialActionsList();
|
||||
|
||||
this.actions.hiddenField.value = '';
|
||||
this.goals.hiddenField.value = '';
|
||||
this.results.hiddenField.value = '';
|
||||
|
||||
//console.log(this.actions.hiddenField, this.goals.hiddenField, this.results.hiddenField);
|
||||
async mounted() {
|
||||
await this.getSocialActionsList();
|
||||
|
||||
if ('' !== this.actions.hiddenField.value) {
|
||||
const actionIds = this.actions.hiddenField.value.split(',');
|
||||
for (const aid of actionIds) {
|
||||
let action = this.actions.options.find(a => Number.parseInt(aid) === a.id);
|
||||
if (undefined !== action) {
|
||||
this.action.push(action);
|
||||
await this.selectAction(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ('' !== this.goals.hiddenField.value) {
|
||||
const goalsIds = this.goals.hiddenField.value.split(',').map(s => Number.parseInt(s));
|
||||
for (const gid of goalsIds) {
|
||||
let goal = this.goals.options.find(g => gid === g.id);
|
||||
if (undefined !== goal) {
|
||||
this.goal.push(goal);
|
||||
await this.selectGoal(goal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ('' !== this.results.hiddenField.value) {
|
||||
const resultsIds = this.results.hiddenField.value.split(',').map(s => Number.parseInt(s));
|
||||
for (const rid of resultsIds) {
|
||||
let result = this.results.options.find(r => rid === r.id);
|
||||
if (undefined !== result) {
|
||||
this.result.push(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getSocialActionsList() {
|
||||
this.actions.options = await getSocialActions();
|
||||
let actions = await getSocialActions();
|
||||
this.actions.options = actions.toSorted(function (a, b) {
|
||||
if (a.issue.ordering === b.issue.ordering) {
|
||||
if (a.ordering === b.ordering) {
|
||||
return 0;
|
||||
}
|
||||
if (a.ordering < b.ordering) {
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (a.issue.ordering < b.issue.ordering) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
})
|
||||
|
||||
return Promise.resolve();
|
||||
},
|
||||
|
||||
|
||||
formatSocialAction({text, issue}) {
|
||||
return text + ' (' + issue.text + ')';
|
||||
},
|
||||
|
||||
/**
|
||||
* Select/unselect in Action Multiselect
|
||||
* @param value
|
||||
*/
|
||||
selectAction(value) {
|
||||
async selectAction(value) {
|
||||
//console.log('----'); console.log('select action', value.id);
|
||||
let children = this.getChildrensFromParent(value);
|
||||
this.addSelectedElement('actions', children);
|
||||
|
||||
|
||||
let parentAndChildren = [...[value], ...children];
|
||||
const promises = [];
|
||||
parentAndChildren.forEach(elem => {
|
||||
getGoalByAction(elem.id).then(response => new Promise((resolve, reject) => {
|
||||
this.addElementInData('goals', response.results);
|
||||
resolve();
|
||||
})).catch;
|
||||
getResultByAction(elem.id).then(response => new Promise((resolve, reject) => {
|
||||
this.addElementInData('results', response.results);
|
||||
resolve();
|
||||
})).catch;
|
||||
promises.push(getGoalByAction(elem.id).then(goals => {
|
||||
this.addElementInData('goals', goals);
|
||||
return Promise.resolve();
|
||||
}));
|
||||
promises.push(getResultByAction(elem.id).then(results => {
|
||||
this.addElementInData('results', results);
|
||||
return Promise.resolve();
|
||||
}));
|
||||
});
|
||||
|
||||
await Promise.all(promises);
|
||||
return Promise.resolve();
|
||||
},
|
||||
|
||||
unselectAction(value) {
|
||||
getGoalByAction(value.id).then(goals => {
|
||||
[this.results.options, this.results.value ] = this.removeElementInData('goals', goals);
|
||||
});
|
||||
getResultByAction(value.id).then(results => {
|
||||
[this.results.options, this.results.value ] = this.removeElementInData('results', results);
|
||||
});
|
||||
},
|
||||
|
||||
unselectAction(value) {
|
||||
//console.log('----'); console.log('unselect action', value.id);
|
||||
getGoalByAction(value.id).then(response => new Promise((resolve, reject) => {
|
||||
[ this.goals.options, this.goals.value ] = this.removeElementInData('goals', response.results);
|
||||
resolve();
|
||||
})).catch;
|
||||
getResultByAction(value.id).then(response => new Promise((resolve, reject) => {
|
||||
[ this.results.options, this.results.value ] = this.removeElementInData('results', response.results);
|
||||
resolve();
|
||||
})).catch;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Select/unselect in Goal Multiselect
|
||||
* @param value
|
||||
*/
|
||||
selectGoal(value) {
|
||||
//console.log('----'); console.log('select goal', value.id);
|
||||
getResultByGoal(value.id).then(response => new Promise((resolve, reject) => {
|
||||
this.addElementInData('results', response.results);
|
||||
resolve();
|
||||
})).catch;
|
||||
async selectGoal(value) {
|
||||
return getResultByGoal(value.id).then(results => {
|
||||
this.addElementInData('results', results);
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
unselectGoal(value) {
|
||||
//console.log('----'); console.log('unselect goal', value.id);
|
||||
getResultByGoal(value.id).then(response => new Promise((resolve, reject) => {
|
||||
[ this.results.options, this.results.value ] = this.removeElementInData('results', response.results);
|
||||
resolve();
|
||||
})).catch;
|
||||
getResultByGoal(value.id).then(results => {
|
||||
[ this.results.options, this.results.value ] = this.removeElementInData('results', results);
|
||||
}).catch;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Select/unselect in Result Multiselect
|
||||
* @param value
|
||||
@@ -225,11 +268,11 @@ export default {
|
||||
selectResult(value) {
|
||||
//console.log('----'); console.log('select result', value.id);
|
||||
},
|
||||
|
||||
|
||||
unselectResult(value) {
|
||||
//console.log('----'); console.log('unselect result', value.id);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Choose parent action will involve retaining the "children" actions.
|
||||
* @param value
|
||||
@@ -244,7 +287,7 @@ export default {
|
||||
}
|
||||
return [];
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Add response elements in data target
|
||||
* @param target string -> 'actions', 'goals' or 'results'
|
||||
@@ -263,8 +306,9 @@ export default {
|
||||
if (dump.length > 0) {
|
||||
//console.log('push ' + dump.length + ' elems in', target, dump);
|
||||
}
|
||||
data.options.sort();
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Remove response elements from data target
|
||||
* @param target string -> 'actions', 'goals' or 'results'
|
||||
@@ -279,7 +323,7 @@ export default {
|
||||
if (found) {
|
||||
data.options = data.options.filter(e => e.id !== elem.id);
|
||||
dump.push(elem.id);
|
||||
|
||||
|
||||
this.removeSelectedElement(target, elem);
|
||||
}
|
||||
})
|
||||
@@ -288,7 +332,7 @@ export default {
|
||||
}
|
||||
return [ data.options, data.value ];
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param target
|
||||
@@ -300,10 +344,10 @@ export default {
|
||||
elements.forEach(elem => {
|
||||
let selected = data.value.some(e => e.id === elem.id);
|
||||
if (!selected) {
|
||||
|
||||
|
||||
data.value.push(elem);
|
||||
dump.push(elem.id);
|
||||
|
||||
|
||||
// add in hiddenField
|
||||
this.rebuildHiddenFieldValues(target);
|
||||
}
|
||||
@@ -312,7 +356,7 @@ export default {
|
||||
//console.log('add ' + dump.length + ' selected elems in', target, dump);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Remove element from selected and from hiddenField
|
||||
* @param target
|
||||
@@ -322,19 +366,19 @@ export default {
|
||||
let data = this[target];
|
||||
let selected = data.value.some(e => e.id === elem.id);
|
||||
if (selected) {
|
||||
|
||||
|
||||
// remove from selected
|
||||
data.value = data.value.filter(e => e.id !== elem.id);
|
||||
//console.log('remove ' + elem.id + ' from selected ' + target);
|
||||
|
||||
|
||||
// remove from hiddenField
|
||||
this.rebuildHiddenFieldValues(target);
|
||||
|
||||
|
||||
// in any cases, remove should be recursive
|
||||
this.unselectToNextField(target, elem);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* When unselect Action, it could remove elements in goals multiselect.
|
||||
* In that case, we have to unselect Goal to remove elements in results too.
|
||||
@@ -348,7 +392,7 @@ export default {
|
||||
//console.log('!!!! done');
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Rebuild values serie (string) in target HiddenField
|
||||
* @param target
|
||||
@@ -362,14 +406,14 @@ export default {
|
||||
})
|
||||
//console.log(data.hiddenField);
|
||||
},
|
||||
|
||||
|
||||
addIdToValue(string, id) {
|
||||
let array = string ? string.split(',') : [];
|
||||
array.push(id.toString());
|
||||
let str = array.join();
|
||||
return str;
|
||||
},
|
||||
|
||||
|
||||
transTitle ({ title }) {
|
||||
return title.fr //TODO multilang
|
||||
},
|
||||
@@ -378,4 +422,4 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
</style>
|
||||
|
@@ -8,29 +8,17 @@ const getSocialActions = () => fetchResults(
|
||||
|
||||
const getGoalByAction = (id) => {
|
||||
let url = `/api/1.0/person/social-work/goal/by-social-action/${id}.json`;
|
||||
return fetch(url)
|
||||
.then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
throw Error('Error with request resource response');
|
||||
});
|
||||
return fetchResults(url);
|
||||
};
|
||||
|
||||
const getResultByAction = (id) => {
|
||||
let url = `/api/1.0/person/social-work/result/by-social-action/${id}.json`;
|
||||
return fetch(url)
|
||||
.then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
throw Error('Error with request resource response');
|
||||
});
|
||||
return fetchResults(url);
|
||||
};
|
||||
|
||||
const getResultByGoal = (id) => {
|
||||
let url = `/api/1.0/person/social-work/result/by-goal/${id}.json`;
|
||||
return fetch(url)
|
||||
.then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
throw Error('Error with request resource response');
|
||||
});
|
||||
return fetchResults(url);
|
||||
};
|
||||
|
||||
export {
|
||||
@@ -38,4 +26,4 @@ export {
|
||||
getGoalByAction,
|
||||
getResultByAction,
|
||||
getResultByGoal,
|
||||
}
|
||||
}
|
||||
|
@@ -2,12 +2,15 @@ import { createApp } from "vue";
|
||||
import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n';
|
||||
import App from './App.vue';
|
||||
|
||||
const i18n = _createI18n({});
|
||||
if (null !== document.getElementById('export_filters_social_work_type_filter_enabled')) {
|
||||
const i18n = _createI18n({});
|
||||
const form = document.getElementById('export_filters_social_work_type_filter_form');
|
||||
const after = form.appendChild(document.createElement('div'));
|
||||
|
||||
const app = createApp({
|
||||
template: `<app></app>`,
|
||||
})
|
||||
.use(i18n)
|
||||
.component('app', App)
|
||||
.mount('#export_export')
|
||||
;
|
||||
const app = createApp({
|
||||
template: `<app></app>`,
|
||||
})
|
||||
.use(i18n)
|
||||
.component('app', App)
|
||||
.mount(after);
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<ckeditor
|
||||
name="content"
|
||||
v-bind:placeholder="$t('comment.content')"
|
||||
v-bind:placeholder="$t('household_members_editor.positioning.comment_placeholder')"
|
||||
:editor="editor"
|
||||
v-model="content"
|
||||
tag-name="textarea">
|
||||
|
@@ -53,6 +53,7 @@ const appMessages = {
|
||||
persons_to_positionnate: 'Usagers à positionner',
|
||||
holder: "Titulaire",
|
||||
comment: "Commentaire",
|
||||
comment_placeholder: "Associer un commentaire",
|
||||
},
|
||||
app: {
|
||||
next: 'Suivant',
|
||||
|
@@ -12,7 +12,7 @@ const visMessages = {
|
||||
Holder: 'Titulaire',
|
||||
Legend: 'Calques',
|
||||
concerned: 'concerné',
|
||||
both: 'neutre, non binaire',
|
||||
// both: 'neutre, non binaire',
|
||||
woman: 'féminin',
|
||||
man: 'masculin',
|
||||
undefined: "genre non précisé",
|
||||
@@ -64,8 +64,9 @@ const visMessages = {
|
||||
placeholder: "Choisissez le genre de l'usager",
|
||||
woman: "Féminin",
|
||||
man: "Masculin",
|
||||
neuter: "Neutre, non binaire",
|
||||
undefined: "Non renseigné"
|
||||
both: "Neutre, non binaire",
|
||||
undefined: "Non renseigné",
|
||||
unknown: "Non renseigné"
|
||||
}
|
||||
},
|
||||
error_only_one_person: "Une seule personne peut être sélectionnée !",
|
||||
|
@@ -153,6 +153,8 @@ const getGender = (gender) => {
|
||||
return visMessages.fr.visgraph.woman
|
||||
case 'man':
|
||||
return visMessages.fr.visgraph.man
|
||||
case 'unknown':
|
||||
return visMessages.fr.visgraph.unknown
|
||||
default:
|
||||
return visMessages.fr.visgraph.undefined
|
||||
}
|
||||
|
@@ -68,28 +68,46 @@
|
||||
<ul class="list-content fa-ul">
|
||||
<li v-if="person.current_household_id">
|
||||
<i class="fa fa-li fa-map-marker"></i>
|
||||
<address-render-box v-if="person.current_household_address"
|
||||
:address="person.current_household_address"
|
||||
:isMultiline="isMultiline">
|
||||
</address-render-box>
|
||||
<p v-else class="chill-no-data-statement">
|
||||
{{ $t('renderbox.household_without_address') }}
|
||||
</p>
|
||||
<address-render-box v-if="person.current_household_address" :address="person.current_household_address" :isMultiline="isMultiline"></address-render-box>
|
||||
<p v-else class="chill-no-data-statement">{{ $t('renderbox.household_without_address') }}</p>
|
||||
<a v-if="options.addHouseholdLink === true"
|
||||
:href="getCurrentHouseholdUrl"
|
||||
:title="$t('persons_associated.show_household_number', {id: person.current_household_id})">
|
||||
<span class="badge rounded-pill bg-chill-beige">
|
||||
<i class="fa fa-fw fa-home"></i><!--{{ $t('persons_associated.show_household') }}-->
|
||||
</span>
|
||||
<span class="badge rounded-pill bg-chill-beige">
|
||||
<i class="fa fa-fw fa-home"></i><!--{{ $t('persons_associated.show_household') }}-->
|
||||
</span>
|
||||
</a>
|
||||
</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>
|
||||
<i class="fa fa-li fa-map-marker"></i><p class="chill-no-data-statement">{{ $t('renderbox.no_data') }}</p>
|
||||
</li>
|
||||
|
||||
<template v-if="this.showResidentialAddresses && (person.current_residential_addresses || []).length > 0">
|
||||
<li v-for="(addr, i) in person.current_residential_addresses" :key="i">
|
||||
<i class="fa fa-li fa-map-marker"></i>
|
||||
<div v-if="addr.address">
|
||||
<span class="item-key">{{ $t('renderbox.residential_address') }}:</span>
|
||||
<div style="margin-top: -1em;">
|
||||
<address-render-box :address="addr.address" :isMultiline="isMultiline"></address-render-box>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="addr.hostPerson" class="mt-3">
|
||||
<p>{{ $t('renderbox.located_at') }}:</p>
|
||||
<span class="chill-entity entity-person badge-person">
|
||||
<person-text v-if="addr.hostPerson" :person="addr.hostPerson"></person-text>
|
||||
</span>
|
||||
<address-render-box v-if="addr.hostPerson.address" :address="addr.hostPerson.address" :isMultiline="isMultiline"></address-render-box>
|
||||
</div>
|
||||
<div v-else-if="addr.hostThirdParty" class="mt-3">
|
||||
<p>{{ $t('renderbox.located_at') }}:</p>
|
||||
<span class="chill-entity entity-person badge-thirdparty">
|
||||
<third-party-text v-if="addr.hostThirdParty" :thirdparty="addr.hostThirdParty"></third-party-text>
|
||||
</span>
|
||||
<address-render-box v-if="addr.hostThirdParty.address" :address="addr.hostThirdParty.address" :isMultiline="isMultiline"></address-render-box>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
<li v-if="person.email">
|
||||
<i class="fa fa-li fa-envelope-o"></i>
|
||||
<a :href="'mailto: ' + person.email">{{ person.email }}</a>
|
||||
@@ -131,53 +149,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-col mx-3"
|
||||
v-if="this.showResidentialAddresses && (person.current_residential_addresses || []).length > 0">
|
||||
<div class="float-button bottom">
|
||||
<div class="box">
|
||||
<ul class="list-content fa-ul">
|
||||
<li v-for="(addr, i) in person.current_residential_addresses" :key="i">
|
||||
<i class="fa fa-li fa-map-marker"></i>
|
||||
<div v-if="addr.address">
|
||||
<address-render-box
|
||||
:address="addr.address"
|
||||
:isMultiline="isMultiline">
|
||||
</address-render-box>
|
||||
<p>({{ $t('renderbox.residential_address') }})</p>
|
||||
</div>
|
||||
<div v-else-if="addr.hostPerson" class="mt-3">
|
||||
<p>{{ $t('renderbox.located_at') }}:</p>
|
||||
<span class="chill-entity entity-person badge-person">
|
||||
<person-text
|
||||
v-if="addr.hostPerson"
|
||||
:person="addr.hostPerson"
|
||||
></person-text>
|
||||
</span>
|
||||
<address-render-box v-if="addr.hostPerson.address"
|
||||
:address="addr.hostPerson.address"
|
||||
:isMultiline="isMultiline">
|
||||
</address-render-box>
|
||||
</div>
|
||||
<div v-else-if="addr.hostThirdParty" class="mt-3">
|
||||
<p>{{ $t('renderbox.located_at') }}:</p>
|
||||
<span class="chill-entity entity-person badge-thirdparty">
|
||||
<third-party-text
|
||||
v-if="addr.hostThirdParty"
|
||||
:thirdparty="addr.hostThirdParty"
|
||||
></third-party-text>
|
||||
</span>
|
||||
<address-render-box v-if="addr.hostThirdParty.address"
|
||||
:address="addr.hostThirdParty.address"
|
||||
:isMultiline="isMultiline">
|
||||
</address-render-box>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<slot name="end-bloc"></slot>
|
||||
@@ -252,13 +223,13 @@ export default {
|
||||
}
|
||||
},
|
||||
getGenderIcon: function () {
|
||||
return this.person.gender === 'woman' ? 'fa-venus' : this.person.gender === 'man' ? 'fa-mars' : this.person.gender === 'neuter' ? 'fa-neuter' : 'fa-genderless';
|
||||
return this.person.gender === 'woman' ? 'fa-venus' : this.person.gender === 'man' ? 'fa-mars' : this.person.gender === 'both' ? 'fa-neuter' : 'fa-genderless';
|
||||
},
|
||||
getGenderTranslation: function () {
|
||||
return this.person.gender === 'woman' ? 'renderbox.birthday.woman' : 'renderbox.birthday.man';
|
||||
},
|
||||
getGender() {
|
||||
return this.person.gender === 'woman' ? 'person.gender.woman' : this.person.gender === 'man' ? 'person.gender.man' : this.person.gender === 'neuter' ? 'person.gender.neuter' : 'person.gender.undefined';
|
||||
return this.person.gender === 'woman' ? 'person.gender.woman' : this.person.gender === 'man' ? 'person.gender.man' : this.person.gender === 'both' ? 'person.gender.both' : 'person.gender.undefined';
|
||||
},
|
||||
birthdate: function () {
|
||||
if (this.person.birthdate !== null || this.person.birthdate === "undefined") {
|
||||
|
@@ -82,7 +82,7 @@
|
||||
<option selected disabled >{{ $t('person.gender.placeholder') }}</option>
|
||||
<option value="woman">{{ $t('person.gender.woman') }}</option>
|
||||
<option value="man">{{ $t('person.gender.man') }}</option>
|
||||
<option value="neuter">{{ $t('person.gender.neuter') }}</option>
|
||||
<option value="both">{{ $t('person.gender.both') }}</option>
|
||||
</select>
|
||||
<label>{{ $t('person.gender.title') }}</label>
|
||||
</div>
|
||||
@@ -291,8 +291,12 @@ export default {
|
||||
return 'fa-venus';
|
||||
case 'man':
|
||||
return 'fa-mars';
|
||||
case 'neuter':
|
||||
case 'both':
|
||||
return 'fa-neuter';
|
||||
case 'unknown':
|
||||
return 'fa-genderless';
|
||||
default:
|
||||
return 'fa-genderless';
|
||||
}
|
||||
},
|
||||
genderTranslation() {
|
||||
@@ -301,8 +305,12 @@ export default {
|
||||
return 'person.gender.woman';
|
||||
case 'man':
|
||||
return 'person.gender.man';
|
||||
case 'neuter':
|
||||
return 'person.gender.neuter';
|
||||
case 'both':
|
||||
return 'person.gender.both';
|
||||
case 'unknown':
|
||||
return 'person.gender.unknown';
|
||||
default:
|
||||
return 'person.gender.unknown';
|
||||
}
|
||||
},
|
||||
feminized() {
|
||||
@@ -329,12 +337,13 @@ export default {
|
||||
if (this.action !== 'create') {
|
||||
this.loadData();
|
||||
} else {
|
||||
console.log('show centers', this.showCenters);
|
||||
// console.log('show centers', this.showCenters);
|
||||
getCentersForPersonCreation()
|
||||
.then(params => {
|
||||
this.config.centers = params.centers;
|
||||
this.config.centers = params.centers.filter(c => c.isActive);
|
||||
this.showCenters = params.showCenters;
|
||||
console.log('show centers inside', this.showCenters);
|
||||
// console.log('centers', this.config.centers)
|
||||
// console.log('show centers inside', this.showCenters);
|
||||
if (this.showCenters && this.config.centers.length === 1) {
|
||||
this.person.center = this.config.centers[0];
|
||||
}
|
||||
|
@@ -36,7 +36,8 @@ const personMessages = {
|
||||
placeholder: "Choisissez le genre de l'usager",
|
||||
woman: "Féminin",
|
||||
man: "Masculin",
|
||||
neuter: "Neutre, non binaire",
|
||||
both: "Neutre, non binaire",
|
||||
unknown: "Non renseigné",
|
||||
undefined: "Non renseigné"
|
||||
},
|
||||
civility: {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{% extends 'ChillMainBundle::layout.html.twig' %}
|
||||
{% extends '@ChillMain/layout.html.twig' %}
|
||||
|
||||
{% block title "Liste de parcours à répartir" %}
|
||||
|
||||
|
@@ -35,9 +35,11 @@
|
||||
<div class="warnings">
|
||||
<div class="alert alert-danger">
|
||||
<h2>{{ 'This course is closed'|trans }}</h2>
|
||||
<p>
|
||||
{{ 'Closing motive'|trans }} : {{ accompanyingCourse.closingMotive.name|localize_translatable_string }}
|
||||
</p>
|
||||
{% if accompanyingCourse.closingMotive is not same as null %}
|
||||
<p>
|
||||
{{ 'Closing motive'|trans }} : {{ accompanyingCourse.closingMotive.name|localize_translatable_string }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -240,7 +242,7 @@
|
||||
|
||||
<div class="social-actions my-4">
|
||||
<h2 class="mb-3 visually-hidden">{{ 'Last social actions'|trans }}</h2>
|
||||
{% include 'ChillPersonBundle:AccompanyingCourseWork:list_recent_by_accompanying_period.html.twig' with {'buttonText': false } %}
|
||||
{% include '@ChillPerson/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig' with {'buttonText': false } %}
|
||||
</div>
|
||||
|
||||
{% block contentActivity %}
|
||||
@@ -258,7 +260,7 @@
|
||||
{% endif %}
|
||||
|
||||
<h2 class="mb-3 visually-hidden">{{ 'Last activities' |trans }}</h2>
|
||||
{% include 'ChillActivityBundle:Activity:list_recent.html.twig' with { 'context': 'accompanyingCourse', 'no_action': true } %}
|
||||
{% include '@ChillActivity/Activity/list_recent.html.twig' with { 'context': 'accompanyingCourse', 'no_action': true } %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
@@ -195,7 +195,7 @@
|
||||
<div class="flex-table">{# new flex-table wrapper #}
|
||||
<div
|
||||
class="item-bloc colored{% if displayContent is defined %} {{ displayContent }}{% endif %}{% if itemBlocClass is defined %} {{ itemBlocClass }}{% endif %}">
|
||||
{% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with {
|
||||
{% include '@ChillPerson/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig' with {
|
||||
'displayContent': displayContent,
|
||||
'onlyone' : false
|
||||
} %}
|
||||
|
@@ -5,18 +5,23 @@
|
||||
{% block js %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_script_tags('mod_entity_workflow_pick') }}
|
||||
{{ encore_entry_script_tags('mod_pickentity_type') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_link_tags('mod_entity_workflow_pick') }}
|
||||
{{ encore_entry_link_tags('mod_pickentity_type') }}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<div class="accompanying-course-work">
|
||||
|
||||
<h1>{{ block('title') }}</h1>
|
||||
|
||||
{{ filter|chill_render_filter_order_helper }}
|
||||
|
||||
{% if works|length == 0 %}
|
||||
<p class="chill-no-data-statement">{{ 'accompanying_course_work.Any work'|trans }}</p>
|
||||
{% else %}
|
||||
|
@@ -56,7 +56,7 @@
|
||||
</ul>
|
||||
|
||||
<ul class="small_in_title mb-3 ps-0">
|
||||
{% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with {} %}
|
||||
{% include '@ChillPerson/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig' with {} %}
|
||||
</ul>
|
||||
|
||||
<div class="metadata text-end">
|
||||
|
@@ -63,7 +63,7 @@
|
||||
|
||||
<div class="flex-table accompanyingcourse-list">
|
||||
{% for period in acps %}
|
||||
{% include 'ChillPersonBundle:AccompanyingPeriod:_list_item.html.twig' with {
|
||||
{% include '@ChillPerson/AccompanyingPeriod/_list_item.html.twig' with {
|
||||
'recordAction': _self.recordAction(period, contextEntity)
|
||||
} %}
|
||||
{% else %}
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
<div class="flex-table accompanyingcourse-list">
|
||||
{% for period in acpsClosed %}
|
||||
{% include 'ChillPersonBundle:AccompanyingPeriod:_list_item.html.twig' with {
|
||||
{% include '@ChillPerson/AccompanyingPeriod/_list_item.html.twig' with {
|
||||
'recordAction': _self.recordAction(period, contextEntity)
|
||||
} %}
|
||||
{% endfor %}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
|
||||
<h1>{{ 'Accompanying period list'|trans }}</h1>
|
||||
|
||||
{% include 'ChillPersonBundle:AccompanyingPeriod:_list.html.twig' %}
|
||||
{% include '@ChillPerson/AccompanyingPeriod/_list.html.twig' %}
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="cancel">
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{% extends 'ChillMainBundle::layout.html.twig' %}
|
||||
{% extends '@ChillMain/layout.html.twig' %}
|
||||
|
||||
{% block title 'period_by_user_list.Period by user'|trans %}
|
||||
|
||||
|
@@ -86,9 +86,9 @@
|
||||
</div>
|
||||
{%- if options['addInfo'] -%}
|
||||
{% set gender = (person.gender == 'woman') ? 'fa-venus' :
|
||||
(person.gender == 'man') ? 'fa-mars' : (person.gender == 'neuter') ? 'fa-neuter' : 'fa-genderless' %}
|
||||
(person.gender == 'man') ? 'fa-mars' : (person.gender == 'both') ? 'fa-neuter' : 'fa-genderless' %}
|
||||
{% set genderTitle = (person.gender == 'woman') ? 'woman' :
|
||||
(person.gender == 'man') ? 'man' : (person.gender == 'neuter') ? 'neuter' : 'Not given'|trans %}
|
||||
(person.gender == 'man') ? 'man' : (person.gender == 'both') ? 'both' : 'Not given'|trans %}
|
||||
<p class="moreinfo">
|
||||
<i class="fa fa-fw {{ gender }}" title="{{ genderTitle|trans }}"></i>
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
<h1>{{ block('title') }}</h1>
|
||||
|
||||
{% include 'ChillPersonBundle:AccompanyingPeriod:_list.html.twig' %}
|
||||
{% include '@ChillPerson/AccompanyingPeriod/_list.html.twig' %}
|
||||
|
||||
{% if accompanying_periods_old|length > 0 %}
|
||||
<div class="accordion" id="nonCurrent">
|
||||
@@ -28,7 +28,7 @@
|
||||
class="accordion-collapse collapse"
|
||||
aria-labelledby="heading_{{ household.id }}"
|
||||
data-bs-parent="#nonCurrent">
|
||||
{% include 'ChillPersonBundle:AccompanyingPeriod:_list.html.twig' with {'accompanying_periods' : accompanying_periods_old} %}
|
||||
{% include '@ChillPerson/AccompanyingPeriod/_list.html.twig' with {'accompanying_periods' : accompanying_periods_old} %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -59,7 +59,7 @@
|
||||
<span class=" d-block d-sm-inline-block">
|
||||
{{ address|chill_entity_render_box({
|
||||
'render': 'inline', 'multiline': false, 'with_picto': true, 'with_delimiter': true,
|
||||
'details_button': false
|
||||
'details_button': true
|
||||
}) }}
|
||||
</span>
|
||||
{% endif %}
|
||||
|
@@ -56,13 +56,12 @@
|
||||
{%- if address is not null -%}
|
||||
{{ address|chill_entity_render_box({
|
||||
'render': 'inline', 'multiline': false, 'with_picto': true, 'with_delimiter': true,
|
||||
'details_button': false
|
||||
'details_button': true
|
||||
}) }}
|
||||
{%- endif -%}
|
||||
{% if person.getCurrentHousehold is not null %}
|
||||
<a class="btn household-link text-end"
|
||||
href="{{ chill_path_add_return_path('chill_person_household_summary', { 'household_id' : person.getCurrentHousehold.id } ) }}"
|
||||
title="{{ 'Show household'|trans }}">
|
||||
<a href="{{ chill_path_add_return_path('chill_person_household_summary', { 'household_id' : person.getCurrentHousehold.id } ) }}"
|
||||
class="btn btn-sm household-link" title="{{ 'Show household'|trans }}">
|
||||
<i class="fa fa-lg fa-home"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
@@ -25,9 +25,7 @@
|
||||
{% if alternatePersons is not empty %}
|
||||
<div class="alert alert-warning flash_message">
|
||||
<span>
|
||||
{% transchoice alternatePersons|length with { '%nb%': alternatePersons|length } %}
|
||||
%nb% person with similar name. Please verify that this is a new person
|
||||
{% endtranschoice %}
|
||||
{{ 'nb person with similar name. Please verify that this is a new person'|trans({'nb' : alternatePersons|length}) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
<h2>{{ title|default('Person search results')|trans }}</h2>
|
||||
|
||||
<p>
|
||||
{{ '%total% persons matching the search pattern:'|transchoice( total, { '%total%' : total}) }}
|
||||
{{ 'total persons matching the search pattern'|trans({'total' : total}) }} :
|
||||
<a href="{{ path('chill_main_advanced_search', { "name": search_name, "q": pattern } ) }}" class="btn btn-sm">
|
||||
<i class="fa fa-search" aria-hidden="true"></i> {{ pattern }}
|
||||
</a>
|
||||
|
@@ -18,9 +18,9 @@
|
||||
<h2>{{ title|default('Person search results by phonenumber')|trans }}</h2>
|
||||
|
||||
<p>
|
||||
{{ '%total% persons matching the search pattern:'|transchoice( total, { '%total%' : total}) }}
|
||||
{{ 'total persons matching the search pattern'|trans({'total' : total}) }} :
|
||||
<a href="{{ path('chill_main_advanced_search', { "name": search_name, "q": pattern } ) }}" class="btn btn-sm">
|
||||
<i class="fa fa-search" aria-hidden="true"></i> {{ pattern }}
|
||||
<i class="fa fa-search" aria-hidden="true"></i> {{ pattern }}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
@@ -213,9 +213,9 @@
|
||||
<h2>{{ title|default('Person search results')|trans }}</h2>
|
||||
|
||||
<p>
|
||||
{{ '%total% persons matching the search pattern:'|transchoice( total, { '%total%' : total}) }}
|
||||
{{ 'total persons matching the search pattern'|trans({'total' : total}) }} :
|
||||
<a href="{{ path('chill_main_advanced_search', { "name": search_name, "q": pattern } ) }}" class="btn btn-sm">
|
||||
<i class="fa fa-fw fa-search" aria-hidden="true"></i> {{ pattern }}
|
||||
<i class="fa fa-search" aria-hidden="true"></i> {{ pattern }}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
@@ -28,7 +28,7 @@ This view should receive those arguments:
|
||||
we define variables to include an edit form repeated multiple time across
|
||||
the page
|
||||
#}
|
||||
{% set edit_tmp_name = 'ChillPersonBundle:Form:go_to_form.html.twig' %}
|
||||
{% set edit_tmp_name = '@ChillPerson/Form/go_to_form.html.twig' %}
|
||||
{% set edit_tmp_args = { 'form_path_args' : { 'person_id': person.id },
|
||||
'form_path_key' : 'chill_person_general_edit' } %}
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<li><b>{{ 'gender'|trans }}</b>:
|
||||
{{ person.gender|trans }}</li>
|
||||
<li><b>{{ 'maritalStatus'|trans }}</b>:
|
||||
{% if person.maritalStatus.name %}{{ person.maritalStatus.name|localize_translatable_string }}{% endif %}</li>
|
||||
{% if person.maritalStatus %}{{ person.maritalStatus.name|localize_translatable_string }}{% endif %}</li>
|
||||
<li><b>{{ 'birthdate'|trans }}</b>:
|
||||
{% if person.birthdate is not null %}{{ person.birthdate|format_date('short') }}{% endif %}</li>
|
||||
<li><b>{{ 'placeOfBirth'|trans }}</b>:
|
||||
|
@@ -8,9 +8,9 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="person-duplicate">
|
||||
|
||||
|
||||
<h1>{{ 'Désigner un dossier doublon'|trans }}</h1>
|
||||
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_rest(form) }}
|
||||
|
||||
@@ -29,3 +29,11 @@
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{{ encore_entry_script_tags('mod_pickentity_type') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
{{ encore_entry_link_tags('mod_pickentity_type') }}
|
||||
{% endblock %}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
{#
|
||||
{#
|
||||
if the `custom_fields` option is used, the custom fields are available
|
||||
under the customFields variable, with the custom field slug as key.
|
||||
#}
|
||||
{% import 'ChillPersonBundle:Person:macro.html.twig' as person %}
|
||||
{% import '@ChillPerson/Person/macro.html.twig' as person %}
|
||||
<div class="col-8 centered">
|
||||
<h2>{{ 'Accompanyied people'|trans }}</h2>
|
||||
<table>
|
||||
|
Reference in New Issue
Block a user