diff --git a/CHANGELOG.md b/CHANGELOG.md index f7c1c3d1f..57ecdf5a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,14 @@ and this project adheres to ## Unreleased -* [Activity form] invert 'incoming' and 'receiving' in Activity form -* [Activity form] keep the same order for 'attendee' field in new and edit form -* [list with period] use "sameas" test operator to introduce requestor in list +* [Datepickers] datepickers fixed when using keyboard to enter date (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/545) +* [social_action] Display 'agents traitants' in parcours resumé and social action list (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/568) +* [Person_search] Closed parcours shown within an accordeon that can be opened/closed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/574) + +## Test releases + +### 2021-04-24 + * [notification email on course designation] allow raw string in email content generation * [Accompanying period work] list evaluations associated to a work by startDate, and then by id, from the most recent to older * [Documents] Change wording 'créer' to 'enregistrer' (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/634) @@ -25,10 +30,15 @@ and this project adheres to * [Course comment] add validationConstraint NotNull and NotBlank on comment content, to avoid sql error * [Notifications] delay the sending of notificaiton to kernel.terminate * [Notifications / Period user change] fix the sending of notification when user changes +* [Activity form] invert 'incoming' and 'receiving' in Activity form +* [Activity form] keep the same order for 'attendee' field in new and edit form +* [list with period] use "sameas" test operator to introduce requestor in list +* [notification email on course designation] allow raw string in email content generation +* [Accompanying period work] list evaluations associated to a work by startDate, and then by id, from the most recent to older -## Test releases ### 2021-04-13 + * [person] household address: add a form for editing the validFrom date (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/541) * [person] householdmemberseditor: fix composition type bug in select form (vuejs) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/543) * [docgen] add more persons choices in docgen for course: amongst requestor (if person), resources of course (if person), and PersonResource (if person); diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue index 51957b010..4691a860a 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue @@ -54,19 +54,19 @@ {{ $t('activity.select_first_a_social_issue') }} - + - {{ $t('activity.social_action_list_empty') }} + {{ $t('activity.social_action_list_empty') }} @@ -111,7 +111,7 @@ export default { return this.$store.state.socialIssuesOther; }, socialActionsList() { - return this.$store.state.socialActionsList; + return this.$store.getters.socialActionsListSorted; }, socialActionsSelected() { return this.$store.state.activity.socialActions; diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js index f94381fc2..ca56a5dae 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js @@ -101,6 +101,9 @@ const store = createStore({ state.activity.activityType.thirdPartiesVisible !== 0) ); }, + socialActionsListSorted(state) { + return [ ...state.socialActionsList].sort((a, b) => a.ordering - b.ordering); + }, }, mutations: { // SocialIssueAcc @@ -131,7 +134,6 @@ const store = createStore({ state.socialActionsList = []; }, addActionInList(state, action) { - //console.log('add action list', action.id); state.socialActionsList.push(action); }, updateActionsSelected(state, actions) { diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss index 1750533f8..e4cdcb10c 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss @@ -16,6 +16,9 @@ // Chill forms @import './scss/forms'; +// Extend bootstrap accordion +@import './scss/accordion'; + // Chill record_actions @import './scss/record_actions'; diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/accordion.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/accordion.scss new file mode 100644 index 000000000..88d4b5e08 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/accordion.scss @@ -0,0 +1,11 @@ +.accordion { + // show a folded / label on accordion + button[aria-expanded="true"] > span.folded, + button[aria-expanded="false"] > span.unfolded { display: none; } + button[aria-expanded="false"] > span.folded, + button[aria-expanded="true"] > span.unfolded { display: inline; } + + .accordion-item { + margin-bottom: 1rem; + } +} diff --git a/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/flex_table.scss b/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/flex_table.scss index 2383e43b1..30cac9c85 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/flex_table.scss +++ b/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/flex_table.scss @@ -30,6 +30,7 @@ div.list-with-period { // override wrap-list div.wrap-list.periods-list { + padding-right: 1rem; div.wl-row { flex-wrap: nowrap; div.wl-col { @@ -63,6 +64,7 @@ div.list-with-period { } div.periods-list { + padding-right: 1rem; div.title { text-align: right; div.date {} diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue index 349581452..b6a55ef39 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue @@ -5,9 +5,8 @@
- -
- +
+
@@ -17,30 +16,54 @@ \ No newline at end of file + + + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js index 5bebdb52a..44238b0c7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js @@ -153,7 +153,7 @@ const appMessages = { }, startdate: { change: "Date d'ouverture", - date: "Date d'ouverture", + // update: "La nouvelle date d'ouverture a été enregistrée" }, // catch errors 'Error while updating AccompanyingPeriod Course.': "Erreur du serveur lors de la mise à jour du parcours d'accompagnement.", diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js index 06a3606ab..57415565b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js @@ -322,7 +322,6 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou } }, updateStartDate(state, date) { - console.log('new state date', date) state.accompanyingCourse.openingDate = date; } }, @@ -814,11 +813,9 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou }) }, updateStartDate({commit}, payload) { - console.log('payload', payload) - const date = ISOToDate(payload); const url = `/api/1.0/person/accompanying-course/${id}.json`; - const body = { type: "accompanying_period", openingDate: { datetime: datetimeToISO(date) }}; - console.log('body', body) + const date = payload === null || payload === '' ? null : { datetime: datetimeToISO(ISOToDate(payload)) } + const body = { type: "accompanying_period", openingDate: date}; return makeFetch('PATCH', url, body) .then((response) => { commit('updateStartDate', response.openingDate); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue index 503a00c59..758cd7e5e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue @@ -227,19 +227,18 @@ export default { }, startDate: { get() { - let d = this.$store.state.startDate; - return dateToISO(d); + return this.$store.state.startDate; }, set(value) { - this.$store.commit('setStartDate', ISOToDate(value)); + this.$store.commit('setStartDate', value); } }, endDate: { get() { - return dateToISO(this.$store.state.endDate); + return this.$store.state.endDate; }, set(value) { - this.$store.commit('setEndDate', ISOToDate(value)); + this.$store.commit('setEndDate', value); } }, setSocialIssue: { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js index 408115257..3c2e034d7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js @@ -1,6 +1,6 @@ import { createStore } from 'vuex'; -import { datetimeToISO } from 'ChillMainAssets/chill/js/date.js'; +import { datetimeToISO, dateToISO, ISOToDate, ISOToDatetime } from 'ChillMainAssets/chill/js/date.js'; import { findSocialActionsBySocialIssue } from 'ChillPersonAssets/vuejs/_api/SocialWorkSocialAction.js'; // import { create } from 'ChillPersonAssets/vuejs/_api/AccompanyingCourseWork.js'; import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods'; @@ -20,7 +20,7 @@ const store = createStore({ .map(p => p.person), personsReachables: window.accompanyingCourse.participations.filter(p => p.endDate == null) .map(p => p.person), - startDate: new Date(), + startDate: dateToISO(new Date()), endDate: null, isLoadingSocialActions: false, isPostingWork: false, @@ -47,7 +47,7 @@ const store = createStore({ id: state.socialActionPicked.id }, startDate: { - datetime: datetimeToISO(state.startDate) + datetime: datetimeToISO(ISOToDate(state.startDate)) }, persons: [] }; @@ -61,7 +61,7 @@ const store = createStore({ if (null !== state.endDate) { payload.endDate = { - datetime: datetimeToISO(state.endDate) + datetime: datetimeToISO(ISOToDate(state.endDate)) }; } @@ -111,6 +111,7 @@ const store = createStore({ state.startDate = date; }, setEndDate(state, date) { + console.log(date) state.endDate = date; }, setPersonsPickedIds(state, ids) { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index bcfa53e45..bab64018a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -439,18 +439,18 @@ export default { ]), startDate: { get() { - return dateToISO(this.$store.state.startDate); + return this.$store.state.startDate; }, set(v) { - this.$store.commit('setStartDate', ISOToDate(v)); + this.$store.commit('setStartDate', v); } }, endDate: { get() { - return dateToISO(this.$store.state.endDate); + return this.$store.state.endDate; }, set(v) { - this.$store.commit('setEndDate', ISOToDate(v)); + this.$store.commit('setEndDate', v); } }, note: { @@ -521,12 +521,12 @@ export default { this.$store.commit('removeReferrer', u); }, goToGenerateWorkflow({link}) { - console.log('save before leave to generate workflow') - const callback = (data) => { - window.location.assign(link); - }; + // console.log('save before leave to generate workflow') + const callback = (data) => { + window.location.assign(link); + }; - return this.$store.dispatch('submit', callback) + return this.$store.dispatch('submit', callback) .catch(e => { console.log(e); throw e; }); }, submit() { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index 53e2b72f3..ca0d16eec 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -298,38 +298,39 @@ export default { } }, computed: { - ...mapState([ - 'isPosting' - ]), + ...mapState([ + 'isPosting' + ]), getTemplatesAvailables() { - return this.$store.getters.getTemplatesAvailablesForEvaluation(this.evaluation.evaluation); + return this.$store.getters.getTemplatesAvailablesForEvaluation(this.evaluation.evaluation); }, canGenerate() { - return !this.$store.state.isPosting && this.template !== null; + return !this.$store.state.isPosting && this.template !== null; }, startDate: { - get() { - return dateToISO(this.evaluation.startDate); - }, - set(v) { - this.$store.commit('setEvaluationStartDate', { key: this.evaluation.key, date: ISOToDate(v) }); - } + get() { + console.log('evaluation', this.evaluation); + return this.evaluation.startDate; + }, + set(v) { + this.$store.commit('setEvaluationStartDate', { key: this.evaluation.key, date: v }); + } }, endDate: { - get() { - return dateToISO(this.evaluation.endDate); - }, - set(v) { - this.$store.commit('setEvaluationEndDate', { key: this.evaluation.key, date: ISOToDate(v) }); - } + get() { + return this.evaluation.endDate; + }, + set(v) { + this.$store.commit('setEvaluationEndDate', { key: this.evaluation.key, date: v }); + } }, maxDate: { - get() { - return dateToISO(this.evaluation.maxDate); - }, - set(v) { - this.$store.commit('setEvaluationMaxDate', { key: this.evaluation.key, date: ISOToDate(v) }); - } + get() { + return this.evaluation.maxDate; + }, + set(v) { + this.$store.commit('setEvaluationMaxDate', { key: this.evaluation.key, date: v }); + } }, warningInterval: { get() { return this.evaluation.warningInterval; }, @@ -344,7 +345,7 @@ export default { ISOToDatetime, canEditDocument(document) { return 'storedObject' in document ? - this.mime.includes(document.storedObject.type) && document.storedObject.keyInfos.length === 0 : false; + this.mime.includes(document.storedObject.type) && document.storedObject.keyInfos.length === 0 : false; }, listAllStatus() { console.log('load all status'); @@ -360,16 +361,16 @@ export default { }, buildEditLink(storedObject) { return `/wopi/edit/${storedObject.uuid}?returnPath=` + encodeURIComponent( - window.location.pathname + window.location.search + window.location.hash); + window.location.pathname + window.location.search + window.location.hash); }, submitBeforeGenerate({template}) { - const callback = (data) => { - let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id; + const callback = (data) => { + let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id; - window.location.assign(buildLink(template, evaluationId, 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluation')); - }; + window.location.assign(buildLink(template, evaluationId, 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluation')); + }; - return this.$store.dispatch('submit', callback).catch(e => { console.log(e); throw e; }); + return this.$store.dispatch('submit', callback).catch(e => { console.log(e); throw e; }); }, onInputDocumentTitle(event) { const id = Number(event.target.id); @@ -395,20 +396,20 @@ export default { }, removeDocument(document) { if (window.confirm("Êtes-vous sûr·e de vouloir supprimer le document qui a pour titre \"" + document.title +"\" ?")) { - this.$store.commit('removeDocument', {key: this.evaluation.key, document: document}); + this.$store.commit('removeDocument', {key: this.evaluation.key, document: document}); } }, goToGenerateWorkflowEvaluationDocument({event, link, workflowName, payload}) { - const callback = (data) => { - let evaluation = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key); - let updatedDocument = evaluation.documents.find(d => d.key === payload.doc.key); - window.location.assign(buildLinkCreate(workflowName, - 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument', updatedDocument.id)); - }; + const callback = (data) => { + let evaluation = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key); + let updatedDocument = evaluation.documents.find(d => d.key === payload.doc.key); + window.location.assign(buildLinkCreate(workflowName, + 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument', updatedDocument.id)); + }; - return this.$store.dispatch('submit', callback) - .catch(e => { console.log(e); throw e; }); - }, + return this.$store.dispatch('submit', callback) + .catch(e => { console.log(e); throw e; }); + }, }, } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index 4ce0b8ebe..502704716 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -1,5 +1,5 @@ import { createStore } from 'vuex'; -import { datetimeToISO, ISOToDatetime, intervalDaysToISO, intervalISOToDays } from 'ChillMainAssets/chill/js/date.js'; +import { dateToISO, ISOToDate, datetimeToISO, ISOToDatetime, intervalDaysToISO, intervalISOToDays } from 'ChillMainAssets/chill/js/date.js'; import { findSocialActionsBySocialIssue } from 'ChillPersonAssets/vuejs/_api/SocialWorkSocialAction.js'; import { create } from 'ChillPersonAssets/vuejs/_api/AccompanyingCourseWork.js'; import { fetchResults, makeFetch } from 'ChillMainAssets/lib/api/apiMethods.js'; @@ -13,9 +13,9 @@ const store = createStore({ state: { work: window.accompanyingCourseWork, startDate: window.accompanyingCourseWork.startDate !== null ? - ISOToDatetime(window.accompanyingCourseWork.startDate.datetime) : null, + dateToISO(new Date(window.accompanyingCourseWork.startDate.datetime)) : null, endDate: window.accompanyingCourseWork.endDate !== null ? - ISOToDatetime(window.accompanyingCourseWork.endDate.datetime) : null, + dateToISO(new Date(window.accompanyingCourseWork.endDate.datetime)) : null, note: window.accompanyingCourseWork.note, goalsPicked: window.accompanyingCourseWork.goals, goalsForAction: [], @@ -69,14 +69,15 @@ const store = createStore({ return []; }, buildPayload(state) { + console.log('end date', state.endDate); return { type: 'accompanying_period_work', id: state.work.id, - startDate: state.startDate === null ? null : { - datetime: datetimeToISO(state.startDate) + startDate: state.startDate === null || state.startDate === '' ? null : { + datetime: datetimeToISO(ISOToDate(state.startDate)) }, - endDate: state.endDate === null ? null : { - datetime: datetimeToISO(state.endDate) + endDate: state.endDate === null || state.endDate === '' ? null : { + datetime: datetimeToISO(ISOToDate(state.endDate)) }, note: state.note, persons: state.personsPicked.map(p => ({id: p.id, type: p.type})), @@ -110,9 +111,9 @@ const store = createStore({ id: e.evaluation.id, type: e.evaluation.type }, - startDate: e.startDate !== null ? { datetime: datetimeToISO(e.startDate) } : null, - endDate: e.endDate !== null ? { datetime: datetimeToISO(e.endDate) } : null, - maxDate: e.maxDate !== null ? { datetime: datetimeToISO(e.maxDate) } : null, + startDate: e.startDate === null || e.startDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.startDate)) }, + endDate: e.endDate === null || e.endDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.endDate)) }, + maxDate: e.maxDate === null || e.maxDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.maxDate)) }, warningInterval: intervalDaysToISO(e.warningInterval), comment: e.comment, documents: e.documents @@ -132,9 +133,9 @@ const store = createStore({ var k = Object.assign(e, { key: index, editEvaluation: false, - startDate: e.startDate !== null ? ISOToDatetime(e.startDate.datetime) : null, - endDate: e.endDate !== null ? ISOToDatetime(e.endDate.datetime) : null, - maxDate: e.maxDate !== null ? ISOToDatetime(e.maxDate.datetime) : null, + startDate: e.startDate !== null ? dateToISO(new Date(e.startDate.datetime)) : null, + endDate: e.endDate !== null ? dateToISO(new Date(e.endDate.datetime)) : null, + maxDate: e.maxDate !== null ? dateToISO(new Date(e.maxDate.datetime)) : null, warningInterval: e.warningInterval !== null ? intervalISOToDays(e.warningInterval) : null, documents: e.documents.map((d, docIndex) => { return Object.assign(d, { @@ -264,6 +265,7 @@ const store = createStore({ .startDate = date; }, setEvaluationEndDate(state, {key, date}) { + console.log('commit date', date) state.evaluationsPicked.find(e => e.key === key) .endDate = date; }, diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Dates.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Dates.vue index 040d316bb..03feb0329 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Dates.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Dates.vue @@ -66,18 +66,19 @@ export default { }, startDate: { get() { - return [ - this.$store.state.startDate.getFullYear(), - (this.$store.state.startDate.getMonth() + 1).toString().padStart(2, '0'), - this.$store.state.startDate.getDate().toString().padStart(2, '0') - ].join('-'); + return this.$store.state.startDate; + // return [ + // this.$store.state.startDate.getFullYear(), + // (this.$store.state.startDate.getMonth() + 1).toString().padStart(2, '0'), + // this.$store.state.startDate.getDate().toString().padStart(2, '0') + // ].join('-'); }, set(value) { - let - [year, month, day] = value.split('-'), - dValue = new Date(year, month-1, day); + // let + // [year, month, day] = value.split('-'), + // dValue = new Date(year, month-1, day); - this.$store.dispatch('setStartDate', dValue); + this.$store.dispatch('setStartDate', value); } } } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js index f09b19787..f3801576d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js @@ -2,7 +2,7 @@ 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'; +import { datetimeToISO, dateToISO, ISOToDate } from 'ChillMainAssets/chill/js/date.js'; const debug = process.env.NODE_ENV !== 'production'; @@ -30,7 +30,7 @@ const store = createStore({ } return 0; }), - startDate: new Date(), + startDate: dateToISO(new Date()), /** * Indicates if the destination is: * @@ -278,7 +278,7 @@ const store = createStore({ type: conc.person.type }, start_date: { - datetime: datetimeToISO(state.startDate) + datetime: state.startDate === null || state.startDate === '' ? null : datetimeToISO(ISOToDate(state.startDate)) } }; @@ -302,7 +302,7 @@ const store = createStore({ }, number_of_children: state.numberOfChildren, start_date: { - datetime: datetimeToISO(state.startDate), + datetime: datetimeToISO(ISOToDate(state.startDate)), }, }; } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig index 8ff8a0617..3d4f46425 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig @@ -25,22 +25,6 @@
- {% if w.createdBy %} -
-
-

{{ 'Referrers'|trans }}

-
-
-

- {% for u in w.referrers %} - {{ u|chill_entity_render_box }} - {% if not loop.last %}, {% endif %} - {% endfor %} -

-
-
- {% endif %} - {%- if w.persons -%}
@@ -78,6 +62,22 @@
{% endif %} + {%- if w.referrers -%} +
+
+

{{ 'Referrers'|trans }}

+
+
+ {% for u in w.referrers %} + + {{ u|chill_entity_render_box }} + {% if not loop.last %}, {% endif %} + + {% endfor %} +
+
+ {% endif %} + {%- if w.socialAction.issue -%}
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig index 7f2fb0177..4621cb97a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig @@ -28,6 +28,15 @@ {{ w.handlingThierParty|chill_entity_render_box }} {% endif %} + {% if w.referrers %} +
  • + {{ 'Referrers'|trans ~ ' : ' }} + {% for u in w.referrers %} + {{ u|chill_entity_render_box }} + {% if not loop.last %}, {% endif %} + {% endfor %} +
  • + {% endif %}
  • {{ 'Participants'|trans ~ ' : ' }} {% for p in w.persons %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig index 62d0682df..cfa616988 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig @@ -20,7 +20,7 @@ {% elseif period.step == 'CONFIRMED' %} {{- 'Confirmed'|trans|upper -}} {% else %} - {{- 'Closed'|trans|upper -}} + {{- 'Closed'|trans|upper -}} {% endif %}
  • diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/accompanying_period.html.twig index a793ac37a..acd251735 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/accompanying_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/accompanying_period.html.twig @@ -10,12 +10,6 @@ {% include 'ChillPersonBundle:AccompanyingPeriod:_list.html.twig' %} {% if accompanying_periods_old|length > 0 %} -

    diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig index a00c8df36..7ba2235a6 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig @@ -191,12 +191,6 @@ {% endif %} {% if old_members|length > 0 %} -

    diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig index c43806a71..9c7486fc2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig @@ -10,6 +10,157 @@ {% endmacro %} +{% macro accompanying_period(acp, person) %} + {% set app = person.findParticipationForPeriod(acp) %} +
    +
    +
    +
    +

    + + {{ 'Course number'|trans }} {{ acp.id }} +

    +
    +
    +
    + {% if app != null %} +
    + {{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }} +
    + {% 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 %} +
    +
    + {% if acp.requestoranonymous == false and acp.requestorPerson is same as(person) %} + + {{ 'Requestor'|trans({'gender': person.gender}) }} + + {% endif %} + + {% if acp.emergency %} + {{- 'Emergency'|trans|upper -}} + {% endif %} + + {% if acp.confidential %} + {{- 'Confidential'|trans|upper -}} + {% endif %} + + {% if acp.step == 'DRAFT' %} + {{ 'course.draft'|trans }} + {% endif %} + + {% if acp.step == 'CLOSED' %} + {{ 'course.closed'|trans }} + {% endif %} +
    +
    +
    + + {% if acp.user is not null %} +
    +
    +

    {{ 'Referrer'|trans }}

    +
    +
    +
    + {{ acp.user|chill_entity_render_box }} +
    +
    +
    + {% endif %} + + {% if acp.socialIssues|length > 0 %} +
    +
    +

    {{ 'Social issues'|trans }}

    +
    +
    + {% for issue in acp.socialIssues %} + {{ issue|chill_entity_render_box }} + {% endfor %} +
    +
    + {% endif %} + + {% if acp.currentParticipations|length > 1 %} +
    +
    +

    + {{ 'Participants'|trans }} +

    +
    +
    + {% 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 %} +
    +
    + {% endif %} + + {% if acp.requestoranonymous == false %} + {% if (acp.requestorPerson is not null and acp.requestorPerson.id != person.id) or acp.requestorThirdParty is not null %} +
    +
    +

    + {% if acp.requestorPerson is not null %} + {{ 'Requestor'|trans({'gender': acp.requestorPerson.gender}) }} + {% else %} + {{ 'Requestor'|trans({'gender': 'other'})}} + {% endif %} +

    +
    +
    + {% 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 %} +
    +
    + {% endif %} + {% endif %} + + +
    +
    +{% endmacro %} +

    {{ title|default('Person search results')|trans }}

    @@ -66,167 +217,53 @@ {#- 'acps' is for AcCompanyingPeriodS #} {%- set acps = [] %} + {%- set acpsClosed = [] %} {%- for acp in person.accompanyingPeriodInvolved %} {%- if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', acp) %} - {%- set acps = acps|merge([acp]) %} + {% if acp.step == 'CLOSED' %} + {%- set acpsClosed = acpsClosed|merge([acp]) %} + {% else %} + {%- set acps = acps|merge([acp]) %} + {% endif %} {%- endif %} {%- endfor %} {# add as requestor #} {% if acps|length > 0 %} {% for acp in acps %} - {% set app = person.findParticipationForPeriod(acp) %} -
    -
    -
    -
    -

    - - {{ 'Course number'|trans }} {{ acp.id }} -

    -
    -
    -
    - {% if app != null %} -
    - {{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }} -
    - {% 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 %} -
    -
    - {% if acp.requestoranonymous == false and acp.requestorPerson is same as(person) %} - - {{ 'Requestor'|trans({'gender': person.gender}) }} - - {% endif %} - - {% if acp.emergency %} - {{- 'Emergency'|trans|upper -}} - {% endif %} - - {% if acp.confidential %} - {{- 'Confidential'|trans|upper -}} - {% endif %} - - {% if acp.step == 'DRAFT' %} - {{ 'course.draft'|trans }} - {% endif %} - - {% if acp.step == 'CLOSED' %} - {{ 'course.closed'|trans }} - {% endif %} -
    -
    -
    - - {% if acp.user is not null %} -
    -
    -

    {{ 'Referrer'|trans }}

    -
    -
    -
    - {{ acp.user|chill_entity_render_box }} -
    -
    -
    - {% endif %} - - {% if acp.socialIssues|length > 0 %} -
    -
    -

    {{ 'Social issues'|trans }}

    -
    -
    - {% for issue in acp.socialIssues %} - {{ issue|chill_entity_render_box }} - {% endfor %} -
    -
    - {% endif %} - - {% if acp.currentParticipations|length > 1 %} -
    -
    -

    - {{ 'Participants'|trans }} -

    -
    -
    - {% 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 %} -
    -
    - {% endif %} - - {% if acp.requestoranonymous == false %} - {% if (acp.requestorPerson is not null and acp.requestorPerson.id != person.id) or acp.requestorThirdParty is not null %} -
    -
    -

    - {% if acp.requestorPerson is not null %} - {{ 'Requestor'|trans({'gender': acp.requestorPerson.gender}) }} - {% else %} - {{ 'Requestor'|trans({'gender': 'other'})}} - {% endif %} -

    -
    -
    - {% 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 %} -
    -
    - {% endif %} - {% endif %} - - - -
    -
    + {{ _self.accompanying_period(acp, person) }} {% endfor %} {% endif %} + {% if acpsClosed|length > 0 %} +
    +
    +

    + +

    + +
    + {% for acp in acpsClosed %} + {{ _self.accompanying_period(acp, person) }} + {% endfor %} +
    +
    +
    + {% endif %} + +
    {% endfor %}

    diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php index e210e1c4f..52ba07a93 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php @@ -40,6 +40,7 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte 'desactivationDate' => $this->normalizer->normalize($socialAction->getDesactivationDate(), $format, $context), 'title' => $socialAction->getTitle(), 'issue' => $this->normalizer->normalize($socialAction->getIssue(), $format, $context), + 'ordering' => $socialAction->getOrdering(), ]; case 'docgen': diff --git a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml index 44f69b4c2..0e825aa72 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml @@ -114,3 +114,19 @@ household_composition: few {# enfants dans le ménage} other {# enfants dans le ménage} } + +periods: + show closed periods: >- + {nb_items, plural, + =0 {Aucun parcours clôturé} + one {Montrer un parcours clôturé} + many {Montrer # parcours clôturés} + other {Montrer # parcours clôturés} + } + hide closed periods: >- + {nb_items, plural, + =0 {Aucun parcours clôturé} + one {Masquer un parcours clôturé} + many {Masquer # parcours clôturés} + other {Masquer # parcours clôturés} + } diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 2a4077e1c..77ff2bdb2 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -214,7 +214,7 @@ No requestor: Pas de demandeur No resources: "Pas d'interlocuteurs privilégiés" Persons associated: Usagers concernés Referrer: Référent -Referrers: Référents +Referrers: Agents traitants Some peoples does not belong to any household currently. Add them to an household soon: Certaines personnes n'appartiennent à aucun ménage actuellement. Renseignez leur ménage dès que possible. Add to household now: Ajouter à un ménage Any resource for this accompanying course: Aucun interlocuteur privilégié pour ce parcours @@ -465,6 +465,9 @@ fix it: Compléter accompanying_course: administrative_location: Localisation administrative comment is pinned: Le commentaire est épinglé +show: Montrer +hide: Masquer +closed periods: parcours clôturer # Accompanying Course comments Accompanying Course Comment: Commentaire