+
-
+
-
Objectifs
-
Résultats
+
Motifs - objectifs - dispositifs
+
Orientations - résultats
+
+
+
+
+ {{ $t('results_without_objective') }}
+
+
+
+
+
+
+
+
+
+ {{ g.title.fr }}
+
+
+
+
+
+
+
+
+
+
+
Motifs, objectifs et dispositifs disponibles pour ajout :
+
+
+ -
+
+ {{ g.title.fr }}
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
{{ $t('persons_involved') }}
+
+
+
+
+
+
+
Tiers traitant
+
+
+
+ Aucun tiers traitant
+
+
+
+
+
+
{{ handlingThirdParty.text }}
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
Tiers intervenants
+
+
+
Aucun tiers intervenant
+
+
+
+
+ -
+
{{ t.text }}
+
+
+
+
+
+
+
+
@@ -33,29 +164,208 @@
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js
index f72badc91..318853293 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js
@@ -20,12 +20,36 @@ const store = createStore({
resultsForAction: [],
goalsForAction: [],
resultsForGoal: [],
+ personsPicked: window.accompanyingCourseWork.persons,
+ personsReachables: window.accompanyingCourseWork.accompanyingPeriod.participations.filter(p => p.endDate == null)
+ .map(p => p.person),
+ handlingThirdParty: window.accompanyingCourseWork.handlingThierParty,
+ thirdParties: window.accompanyingCourseWork.thirdParties,
errors: [],
},
getters: {
socialAction(state) {
return state.work.socialAction;
},
+ hasResultsForAction(state) {
+ return state.resultsForAction.length > 0;
+ },
+ resultsForGoal: (state) => (goal) => {
+ let founds = state.resultsForGoal.filter(r => r.goalId === goal.id);
+
+ return founds === undefined ? [] : founds;
+ },
+ resultsPickedForGoal: (state) => (goal) => {
+ let found = state.goalsPicked.find(g => g.id === goal.id);
+
+ return found === undefined ? [] : found.results;
+ },
+ hasHandlingThirdParty(state) {
+ return state.handlingThirdParty !== null;
+ },
+ hasThirdParties(state) {
+ return state.thirdParties.length > 0;
+ },
},
mutations: {
setStartDate(state, date) {
@@ -40,7 +64,7 @@ const store = createStore({
},
setResultsForGoal(state, { goal, results }) {
console.log('set results for goal', results);
- state.goalsForAction = goal;
+ state.goalsForAction.push(goal);
for (let i in results) {
let r = results[i];
r.goalId = goal.id;
@@ -48,15 +72,70 @@ const store = createStore({
state.resultsForGoal.push(r);
}
},
+ addResultPicked(state, result) {
+ state.resultsPicked.push(result);
+ },
+ removeResultPicked(state, result) {
+ state.resultsPicked = state.resultsPicked.filter(r => r.id !== result.id);
+ },
+ addGoal(state, goal) {
+ let g = goal;
+ // initialize results to empty array
+ g.results = []
+ state.goalsPicked.push(g);
+ },
+ removeGoal(state, goal) {
+ state.goalsPicked = state.goalsPicked.filter(g => g.id !== goal.id);
+ },
+ addResultForGoalPicked(state, { goal, result}) {
+ let found = state.goalsPicked.find(g => g.id === goal.id);
+
+ if (found === undefined) {
+ return;
+ }
+
+ found.results.push(result);
+ },
+ removeResultForGoalPicked(state, { goal, result}) {
+ let found = state.goalsPicked.find(g => g.id === goal.id);
+
+ if (found === undefined) {
+ return;
+ }
+
+ found.results = found.results.filter(r => r.id !== result.id);
+ },
+ setPersonsPickedIds(state, ids) {
+ console.log('persons ids', ids);
+ state.personsPicked = state.personsReachables
+ .filter(p => ids.includes(p.id))
+ },
+ setNote(state, note) {
+ state.note = note;
+ },
+ setHandlingThirdParty(state, thirdParty) {
+ state.handlingThirdParty = thirdParty;
+ },
+ addThirdParties(state, thirdParties) {
+ console.log('addThirdParties', thirdParties);
+ // filter to remove existing thirdparties
+ let ids = state.thirdParties.map(t => t.id);
+ let unexistings = thirdParties.filter(t => !ids.includes(t.id));
+ console.log('unexisting third parties', unexistings);
+ for (let i in unexistings) {
+ state.thirdParties.push(unexistings[i]);
+ }
+ },
+ removeThirdParty(state, thirdParty) {
+ state.thirdParties = state.thirdParties
+ .filter(t => t.id !== thirdParty.id);
+ },
addErrors(state, errors) {
console.log('handling errors', errors);
for (let i in errors) {
state.push(errors[i]);
}
},
- setNote(state, note) {
- state.note = note;
- },
},
actions: {
getReachablesGoalsForAction({ getters, commit, dispatch }) {
diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210623135043.php b/src/Bundle/ChillPersonBundle/migrations/Version20210623135043.php
new file mode 100644
index 000000000..d7f2f4ccc
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/migrations/Version20210623135043.php
@@ -0,0 +1,34 @@
+addSql("CREATE TABLE chill_person_accompanying_period_work_person (accompanyingperiodwork_id INT NOT NULL, person_id INT NOT NULL, PRIMARY KEY(accompanyingperiodwork_id, person_id))");
+ $this->addSql("CREATE INDEX IDX_615F494CB99F6060 ON chill_person_accompanying_period_work_person (accompanyingperiodwork_id)");
+ $this->addSql("CREATE INDEX IDX_615F494C217BBB47 ON chill_person_accompanying_period_work_person (person_id)");
+ $this->addSql("ALTER TABLE chill_person_accompanying_period_work_person ADD CONSTRAINT FK_615F494CB99F6060 FOREIGN KEY (accompanyingperiodwork_id) REFERENCES chill_person_accompanying_period_work (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE");
+ $this->addSql("ALTER TABLE chill_person_accompanying_period_work_person ADD CONSTRAINT FK_615F494C217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE");
+
+ }
+
+ public function down(Schema $schema): void
+ {
+ $this->addSql("DROP TABLE chill_person_accompanying_period_work_person");
+ }
+}
diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml
index 8bba291cd..95f5ab99d 100644
--- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml
+++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml
@@ -330,6 +330,10 @@ Move household: Nouveau déménagement
Addresses history for household: Historique des adresses
# accompanying course work
+Accompanying Course Actions: Actions d'accompagnements
accompanying_course_work:
+ create: Créer une action
Create accompanying course work: Créer une action d'accompagnement
+ Edit accompanying course work: Modifier une action d'accompagnement
+ List accompanying course work: Liste des actions d'accompagnement