diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index b0a84fa4e..fbd10e723 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -106,15 +106,16 @@ class Activity implements HasCenterInterface, HasScopeInterface /** * @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialIssue") * @ORM\JoinTable(name="chill_activity_activity_chill_person_socialissue") + * @Groups({"read"}) */ - private $socialIssues; + private Collection $socialIssues; /** * @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialAction") * @ORM\JoinTable(name="chill_activity_activity_chill_person_socialaction") + * @Groups({"read"}) */ - private $socialActions; - + private Collection $socialActions; /** * @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityType") @@ -281,7 +282,7 @@ class Activity implements HasCenterInterface, HasScopeInterface return $this->socialIssues; } - public function addSocialIssue(SocialIssue $socialIssue): self + public function addSocialIssue(?SocialIssue $socialIssue): self { if (!$this->socialIssues->contains($socialIssue)) { $this->socialIssues[] = $socialIssue; @@ -297,15 +298,12 @@ class Activity implements HasCenterInterface, HasScopeInterface return $this; } - /** - * @return Collection|SocialAction[] - */ public function getSocialActions(): Collection { return $this->socialActions; } - public function addSocialAction(SocialAction $socialAction): self + public function addSocialAction(?SocialAction $socialAction): self { if (!$this->socialActions->contains($socialAction)) { $this->socialActions[] = $socialAction; diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 22bd45658..3ad204f18 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -112,31 +112,51 @@ class ActivityType extends AbstractType } if ($activityType->isVisible('socialIssues') && $accompanyingPeriod) { - $builder->add('socialIssues', EntityType::class, [ - 'label' => $activityType->getLabel('socialIssues'), - 'required' => $activityType->isRequired('socialIssues'), - 'class' => SocialIssue::class, - 'choice_label' => function (SocialIssue $socialIssue) { - return $this->socialIssueRender->renderString($socialIssue, []); - }, - 'multiple' => true, - 'choices' => $accompanyingPeriod->getRecursiveSocialIssues(), - 'expanded' => true, - ]); + $builder->add('socialIssues', HiddenType::class); + $builder->get('socialIssues') + ->addModelTransformer(new CallbackTransformer( + function (iterable $socialIssuesAsIterable): string { + $socialIssueIds = []; + foreach ($socialIssuesAsIterable as $value) { + $socialIssueIds[] = $value->getId(); + } + return implode(',', $socialIssueIds); + }, + function (?string $socialIssuesAsString): array { + if (null === $socialIssuesAsString) { + return []; + } + return array_map( + fn(string $id): ?SocialIssue => $this->om->getRepository(SocialIssue::class)->findOneBy(['id' => (int) $id]), + explode(',', $socialIssuesAsString) + ); + } + )) + ; } if ($activityType->isVisible('socialActions') && $accompanyingPeriod) { - $builder->add('socialActions', EntityType::class, [ - 'label' => $activityType->getLabel('socialActions'), - 'required' => $activityType->isRequired('socialActions'), - 'class' => SocialAction::class, - 'choice_label' => function (SocialAction $socialAction) { - return $this->socialActionRender->renderString($socialAction, []); - }, - 'multiple' => true, - 'choices' => $accompanyingPeriod->getRecursiveSocialActions(), - 'expanded' => true, - ]); + $builder->add('socialActions', HiddenType::class); + $builder->get('socialActions') + ->addModelTransformer(new CallbackTransformer( + function (iterable $socialActionsAsIterable): string { + $socialActionIds = []; + foreach ($socialActionsAsIterable as $value) { + $socialActionIds[] = $value->getId(); + } + return implode(',', $socialActionIds); + }, + function (?string $socialActionsAsString): array { + if (null === $socialActionsAsString) { + return []; + } + return array_map( + fn(string $id): ?SocialAction => $this->om->getRepository(SocialAction::class)->findOneBy(['id' => (int) $id]), + explode(',', $socialActionsAsString) + ); + } + )) + ; } if ($activityType->isVisible('date')) { @@ -210,9 +230,7 @@ class ActivityType extends AbstractType } if ($activityType->isVisible('persons')) { - $builder->add('persons', HiddenType::class, [ - //'data_class' => Person::class, - ]); + $builder->add('persons', HiddenType::class); $builder->get('persons') ->addModelTransformer(new CallbackTransformer( function (iterable $personsAsIterable): string { @@ -233,9 +251,7 @@ class ActivityType extends AbstractType } if ($activityType->isVisible('thirdParties')) { - $builder->add('thirdParties', HiddenType::class, [ - //'data_class' => ThirdParty::class, - ]); + $builder->add('thirdParties', HiddenType::class); $builder->get('thirdParties') ->addModelTransformer(new CallbackTransformer( function (iterable $thirdpartyAsIterable): string { @@ -267,9 +283,7 @@ class ActivityType extends AbstractType } if ($activityType->isVisible('users')) { - $builder->add('users', HiddenType::class, [ - //'data_class' => User::class, - ]); + $builder->add('users', HiddenType::class); $builder->get('users') ->addModelTransformer(new CallbackTransformer( function (iterable $usersAsIterable): string { diff --git a/src/Bundle/ChillActivityBundle/Resources/public/scss/chillactivity.scss b/src/Bundle/ChillActivityBundle/Resources/public/scss/chillactivity.scss index 64fd1cb18..ed54ce27a 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/scss/chillactivity.scss +++ b/src/Bundle/ChillActivityBundle/Resources/public/scss/chillactivity.scss @@ -112,3 +112,19 @@ div.flex-table.list-records { margin-top: 1em; } } + +div.activity-row { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: center; + gap: 12px; + div.bloc { + width: 200px; + align-self: flex-end; + height: 140px; + display: flex; + justify-content: center; + align-items: center; + } +} diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/App.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/App.vue index bf8467c2b..07fe84319 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/App.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/App.vue @@ -1,170 +1,17 @@ - - diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/api.js b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/api.js new file mode 100644 index 000000000..79b4ec8fc --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/api.js @@ -0,0 +1,18 @@ +import { getSocialIssues } from 'ChillPersonAssets/vuejs/AccompanyingCourse/api.js'; + +/* +* Load socialActions by socialIssue (id) +*/ +const getSocialActionByIssue = (id) => { + const url = `/api/1.0/person/social/social-action/by-social-issue/${id}.json`; + return fetch(url) + .then(response => { + if (response.ok) { return response.json(); } + throw Error('Error with request resource response'); + }); +}; + +export { + getSocialIssues, + getSocialActionByIssue +}; diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue new file mode 100644 index 000000000..cf97f6502 --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue @@ -0,0 +1,170 @@ + + + + + diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/PersonBadge.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups/PersonBadge.vue similarity index 100% rename from src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/PersonBadge.vue rename to src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups/PersonBadge.vue diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/PersonsBloc.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups/PersonsBloc.vue similarity index 100% rename from src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/PersonsBloc.vue rename to src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups/PersonsBloc.vue diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue new file mode 100644 index 000000000..154209cbf --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue @@ -0,0 +1,214 @@ + + + + + + diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialAction.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialAction.vue new file mode 100644 index 000000000..4da3a7ffc --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialAction.vue @@ -0,0 +1,34 @@ + + + diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialIssue.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialIssue.vue new file mode 100644 index 000000000..0f223eced --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialIssue.vue @@ -0,0 +1,34 @@ + + + diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/i18n.js b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/i18n.js index 778072e61..3262a37a5 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/i18n.js +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/i18n.js @@ -3,6 +3,13 @@ import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n' const appMessages = { fr: { activity: { + // + social_issues: "Problématiques sociales", + choose_other_social_issue: "Ajouter une autre problématique sociale...", + social_actions: "Actions d'accompagnement", + select_first_a_social_issue: "Sélectionnez d'abord une problématique sociale", + + // add_persons: "Ajouter des personnes concernées", bloc_persons: "Usagers", bloc_persons_associated: "Usagers du parcours", diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js index 4f30cf516..c87573797 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js @@ -21,11 +21,62 @@ const removeIdFromValue = (string, id) => { const store = createStore({ strict: debug, state: { - activity: window.activity - }, - getters: { + activity: window.activity, + socialIssuesOther: [], + socialActionsList: [], }, mutations: { + + // SocialIssueAcc + addIssueInList(state, issue) { + //console.log('add issue list', issue.id); + state.activity.accompanyingPeriod.socialIssues.push(issue); + }, + addIssueSelected(state, issue) { + //console.log('add issue selected', issue.id); + state.activity.socialIssues.push(issue); + }, + updateIssuesSelected(state, issues) { + //console.log('update issues selected', issues); + state.activity.socialIssues = issues; + }, + updateIssuesOther(state, payload) { + //console.log('update issues other'); + state.socialIssuesOther = payload; + }, + removeIssueInOther(state, issue) { + //console.log('remove issue other', issue.id); + state.socialIssuesOther = state.socialIssuesOther.filter(i => i.id !== issue.id); + }, + resetActionsList(state) { + //console.log('reset list actions'); + state.socialActionsList = []; + }, + addActionInList(state, action) { + //console.log('add action list', action.id); + state.socialActionsList.push(action); + }, + updateActionsSelected(state, actions) { + //console.log('update actions selected', actions); + state.activity.socialActions = actions; + }, + filterList(state, list) { + const filterList = (list) => { + // remove duplicates entries + list = list.filter((value, index) => list.findIndex(array => array.id === value.id) === index); + // alpha sort + list.sort((a,b) => (a.text > b.text) ? 1 : ((b.text > a.text) ? -1 : 0)); + return list; + }; + if (list === 'issues') { + state.activity.accompanyingPeriod.socialIssues = filterList(state.activity.accompanyingPeriod.socialIssues); + } + if (list === 'actions') { + state.socialActionsList = filterList(state.socialActionsList); + } + }, + + // ConcernedGroups addPersonsInvolved(state, payload) { //console.log('### mutation addPersonsInvolved', payload.result.type); switch (payload.result.type) { @@ -56,8 +107,29 @@ const store = createStore({ } }, actions: { + addIssueSelected({ commit }, issue) { + let aSocialIssues = document.getElementById("chill_activitybundle_activity_socialIssues"); + aSocialIssues.value = addIdToValue(aSocialIssues.value, issue.id); + commit('addIssueSelected', issue); + }, + updateIssuesSelected({ commit }, payload) { + let aSocialIssues = document.getElementById("chill_activitybundle_activity_socialIssues"); + aSocialIssues.value = ''; + payload.forEach(item => { + aSocialIssues.value = addIdToValue(aSocialIssues.value, item.id); + }); + commit('updateIssuesSelected', payload); + }, + updateActionsSelected({ commit }, payload) { + let aSocialActions = document.getElementById("chill_activitybundle_activity_socialActions"); + aSocialActions.value = ''; + payload.forEach(item => { + aSocialActions.value = addIdToValue(aSocialActions.value, item.id); + }); + commit('updateActionsSelected', payload); + }, addPersonsInvolved({ commit }, payload) { - console.log('### action addPersonsInvolved', payload.result.type); + //console.log('### action addPersonsInvolved', payload.result.type); switch (payload.result.type) { case 'person': let aPersons = document.getElementById("chill_activitybundle_activity_persons"); @@ -75,7 +147,7 @@ const store = createStore({ commit('addPersonsInvolved', payload); }, removePersonInvolved({ commit }, payload) { - console.log('### action removePersonInvolved', payload); + //console.log('### action removePersonInvolved', payload); switch (payload.type) { case 'person': let aPersons = document.getElementById("chill_activitybundle_activity_persons"); diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig index 3024148e1..56a7c96b4 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig @@ -1,4 +1,8 @@ -

{{ "Update activity"|trans }}

+

{{ "Update activity"|trans ~ ' :' }} + + {{ entity.type.name|localize_translatable_string }} + +

{{ form_start(edit_form) }} {{ form_errors(edit_form) }} @@ -19,13 +23,15 @@ {{ form_row(edit_form.scope) }} {% endif %} +{%- if edit_form.socialIssues is defined -%} + {{ form_row(edit_form.socialIssues) }} +{% endif %} + {%- if edit_form.socialActions is defined -%} {{ form_row(edit_form.socialActions) }} {% endif %} -{%- if edit_form.socialIssues is defined -%} - {{ form_row(edit_form.socialIssues) }} -{% endif %} +
{%- if edit_form.reasons is defined -%} {{ form_row(edit_form.reasons) }} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig index aa64bc388..a40b1d721 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig @@ -12,8 +12,10 @@ {% block js %} {{ encore_entry_link_tags('async_upload') }} {{ encore_entry_script_tags('vue_activity') }} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig index d8d3df0bd..1022bdd5b 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig @@ -21,15 +21,17 @@ {% block title 'Update activity'|trans %} {% block personcontent %} - {% include 'ChillActivityBundle:Activity:edit.html.twig' %}
{# <=== vue component #} + {% include 'ChillActivityBundle:Activity:edit.html.twig' %} {% endblock %} {% block js %} {{ encore_entry_link_tags('async_upload') }} {{ encore_entry_script_tags('vue_activity') }} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/new.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/new.html.twig index b65a3268c..35e466915 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/new.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/new.html.twig @@ -1,4 +1,8 @@ -

{{ "Activity creation"|trans }}

+

{{ "Activity creation"|trans ~ ' :' }} + + {{ entity.type.name|localize_translatable_string }} + +

{{ form_start(form) }} {{ form_errors(form) }} @@ -20,14 +24,15 @@ {{ form_row(form.scope) }} {% endif %} -{%- if form.socialActions is defined -%} - {{ form_row(form.socialActions) }} -{% endif %} - {%- if form.socialIssues is defined -%} {{ form_row(form.socialIssues) }} {% endif %} +{%- if form.socialActions is defined -%} + {{ form_row(form.socialActions) }} +{% endif %} + +
{%- if form.reasons is defined -%} {{ form_row(form.reasons) }} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/newAccompanyingCourse.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/newAccompanyingCourse.html.twig index f5e3a8629..bcf386ffd 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/newAccompanyingCourse.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/newAccompanyingCourse.html.twig @@ -12,8 +12,10 @@ {% block js %} {{ encore_entry_script_tags('async_upload') }} {{ encore_entry_script_tags('vue_activity') }} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/newPerson.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/newPerson.html.twig index 67eebdea0..6b1613a90 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/newPerson.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/newPerson.html.twig @@ -5,15 +5,17 @@ {% block title 'Activity creation' |trans %} {% block personcontent %} - {% include 'ChillActivityBundle:Activity:new.html.twig' with {'context': 'person'} %}
{# <=== vue component #} + {% include 'ChillActivityBundle:Activity:new.html.twig' with {'context': 'person'} %} {% endblock %} {% block js %} {{ encore_entry_link_tags('async_upload') }} {{ encore_entry_script_tags('vue_activity') }} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/selectType.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/selectType.html.twig index 76e3f25ad..484deb55a 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/selectType.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/selectType.html.twig @@ -4,7 +4,7 @@ {% for row in data %}

{{ row.activityTypeCategory.name|localize_translatable_string }}

-
+
{% for activityType in row.activityTypes %} {% set person_id = null %} @@ -19,7 +19,7 @@ -
+
{{ activityType.name|localize_translatable_string }}
diff --git a/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php b/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php index a2d4058da..e100000c4 100644 --- a/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php @@ -43,6 +43,11 @@ final class ScopeRepository implements ObjectRepository { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + + public function createQueryBuilder($alias, $indexBy = null) + { + return $this->repository->createQueryBuilder($alias, $indexBy); + } public function getClassName() { return Scope::class; diff --git a/src/Bundle/ChillMainBundle/Resources/public/scss/chillmain.scss b/src/Bundle/ChillMainBundle/Resources/public/scss/chillmain.scss index 1d0ad253f..c001c31b9 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/scss/chillmain.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/scss/chillmain.scss @@ -45,33 +45,6 @@ table { } } -/* - * ACCOMPANYING_COURSE - * Header custom for Accompanying Course - */ - -div#header-accompanying_course-name { - background: none repeat scroll 0 0 #718596; - color: #FFF; - h1 { - margin: 0.4em 0; - } - span { - a { - color: white; - } - a:hover { - text-decoration: underline; - } - } -} -div#header-accompanying_course-details { - background: none repeat scroll 0 0 #718596ab; - color: #FFF; - padding-top: 1em; - padding-bottom: 1em; -} - /* * FLEX RESPONSIVE TABLE/BLOCK PRESENTATION */ @@ -109,23 +82,13 @@ div.flex-bloc { align-content: stretch; div.item-bloc { - flex-grow: 0; flex-shrink: 1; flex-basis: 50%; + flex-grow: 0; flex-shrink: 1; flex-basis: 33%; margin: 0; padding: 1em; - border-top: 0; - &:nth-child(1), &:nth-child(2) { - border-top: 1px solid #000; - } - border-left: 0; - &:nth-child(odd) { - border-left: 1px solid #000; - } - - //background-color: #e6e6e6; display: flex; flex-direction: column; - & > div.item-row { + div.item-row { flex-grow: 1; flex-shrink: 1; flex-basis: auto; display: flex; flex-direction: column; @@ -158,12 +121,6 @@ div.flex-bloc { @media only screen and (max-width: 900px) { flex-direction: column; margin: auto 0; - div.item-bloc { - border-left: 1px solid #000; - &:nth-child(2) { - border-top: 0; - } - } } } @@ -232,8 +189,6 @@ div.flex-table { } } - - /* * Address form */ @@ -277,5 +232,3 @@ div.address_form { } } } - - diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js index d89470bc4..3964a85fe 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js @@ -58,9 +58,9 @@ const messages = { }, create: { button: "Créer \"{q}\"", - title: "Créer à la volée…", + title: "Création d'un nouvel usager ou d'un tiers professionnel", person: "un nouvel usager", - thirdparty: "un nouveau tiers" + thirdparty: "un nouveau tiers professionnel" }, }, } diff --git a/src/Bundle/ChillMainBundle/chill.webpack.config.js b/src/Bundle/ChillMainBundle/chill.webpack.config.js index 78accf004..b9038efa9 100644 --- a/src/Bundle/ChillMainBundle/chill.webpack.config.js +++ b/src/Bundle/ChillMainBundle/chill.webpack.config.js @@ -56,7 +56,6 @@ module.exports = function(encore, entries) // Chill2 new assets encore.addEntry('forkawesome', __dirname + '/Resources/public/modules/forkawesome/index.js'); encore.addEntry('bootstrap', __dirname + '/Resources/public/modules/bootstrap/index.js'); - //encore.addEntry('vuejs', __dirname + '/Resources/public/modules/vue/index.js'); // CKEditor5 buildCKEditor(encore); diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php index 47bb3c953..b2de73651 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -848,7 +848,6 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface } } } - return $recursiveSocialIssues; } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/index.js b/src/Bundle/ChillPersonBundle/Resources/public/index.js index acdc04579..34d0be7d8 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/index.js @@ -1,3 +1,3 @@ -require('./sass/person.scss'); +require('./sass/chillperson.scss'); require('./sass/person_with_period.scss'); require('./sass/household_banner.scss'); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/sass/chillperson.scss b/src/Bundle/ChillPersonBundle/Resources/public/sass/chillperson.scss new file mode 100644 index 000000000..55546c56e --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/public/sass/chillperson.scss @@ -0,0 +1,214 @@ +@import '~ChillMainSass/custom/config/colors'; + +/* +* PERSON CONTEXT +*/ + +div#header-person-name { + background: none repeat scroll 0 0 $chill-green-dark; + color: #FFF; + padding-top: 1em; + padding-bottom: 1em; +} + +div#header-person-details { + background: none repeat scroll 0 0 $chill-green; + color: #FFF; + padding-top: 1em; + padding-bottom: 1em; +} + +div#person_details_container { + padding-top: 20px; + padding-bottom: 20px; +} + +div.person-view { + figure.person-details { + h2 { + font-family: 'Open Sans'; + font-weight: 600; + margin-bottom: 0.3em; + font-variant: small-caps; + } + dl { + margin-top: 0.3em; + } + dt { + font-family: 'Open Sans'; + font-weight: 600; + } + dd { + margin-left: 0; + } + /* + a.sc-button { background-color: $black; padding-top: 0.2em; padding-bottom: 0.2em; } + */ + } + /* custom fields on the home page */ + div.custom-fields { + figure.person-details { + display: flex; + flex-flow: row wrap; + div.cf_title_box:nth-child(4n+1) h2 { + @extend .chill-red; + } + div.cf_title_box:nth-child(4n+2) h2 { + @extend .chill-green; + } + div.cf_title_box:nth-child(4n+3) h2 { + @extend .chill-orange; + } + div.cf_title_box:nth-child(4n+4) h2 { + @extend .chill-blue; + } + div.cf_title_box:nth-child(2n+1) { + width: 50%; + margin-right: 40px; + } + div.cf_title_box:nth-child(2n+2) { + width: calc(50% - 40px); + } + } + } +} + +/* + * ACCOMPANYING_COURSE CONTEXT + * Header custom for Accompanying Course + */ + +div#header-accompanying_course-name { + background: none repeat scroll 0 0 #718596; + color: #FFF; + h1 { + margin: 0.4em 0; + } + span { + a { + color: white; + } + a:hover { + text-decoration: underline; + } + } +} +div#header-accompanying_course-details { + background: none repeat scroll 0 0 #718596ab; + color: #FFF; + padding-top: 1em; + padding-bottom: 1em; +} + +/* + * HOUSEHOLD CONTEXT + * Header custom for Household + */ + +div#header-household-name { + background: none repeat scroll 0 0 #929d69; //#b97a7a; + color: #FFF; + h1 { + margin: 0.4em 0; + } + span { + a { + color: white; + } + a:hover { + text-decoration: underline; + } + } +} +div#header-household-details { + background: none repeat scroll 0 0 #b0b984; //#d29791; + color: #FFF; + padding-top: 1em; + padding-bottom: 1em; + span.current-members-explain { + font-weight: bold; + } +} + +/* +* ADDRESS HISTORY +* context person / household +*/ +div.address-timeline.grid { + display: grid; + grid-template-rows: auto auto auto; + grid-template-columns: auto 120px auto; + + @media only screen and (max-width: 750px) { + grid-template-columns: auto 1em auto; + } + + div.top { + grid-column: 2; + text-align: center; + color: lightgrey; + margin-bottom: -20px; + } + div.col-a { + grid-column: 1; + text-align: right; + } + div.col-b, + div.date { + grid-column: 2; + position: relative; + &:after { + position: absolute; + content: ''; + top: 0; bottom: 0; + left: 50%; + margin: auto -5px; + width: 10px; + height: 100%; + background-color: lightgrey; + z-index: -5; + } + } + div.col-c { + grid-column: 3; + } + + div.col-b, + div.action, + div.content { + min-height: 30px; + padding: 1em; + } + div.content { + margin: 0.3em; + border: 1px dashed #00000045; + &.row1 { // current address + border: 1px solid #000; + } + div.address { + font-variant: small-caps; + } + } + div.date { + text-align: center; + background-color: lightgrey; + padding: 0.5em; + border-radius: 0.3em; + } + + div.span2 { grid-row: span 3; } + div.span3 { grid-row: span 5; } + div.span4 { grid-row: span 7; } + div.span5 { grid-row: span 9; } + + ul.record_actions { + margin: 0; + } + .fake { + &:after { + content: 'fake, just to test.. '; + color: lightgrey; + font-style: italic; + } + } +} diff --git a/src/Bundle/ChillPersonBundle/Resources/public/sass/person.scss b/src/Bundle/ChillPersonBundle/Resources/public/sass/person.scss deleted file mode 100644 index 7ea0d7dfb..000000000 --- a/src/Bundle/ChillPersonBundle/Resources/public/sass/person.scss +++ /dev/null @@ -1,168 +0,0 @@ - -@import '~ChillMainSass/custom/config/colors'; - -div#header-person-name { - background: none repeat scroll 0 0 $chill-green-dark; - color: #FFF; - padding-top: 1em; - padding-bottom: 1em; -} - -div#header-person-details { - background: none repeat scroll 0 0 $chill-green; - color: #FFF; - padding-top: 1em; - padding-bottom: 1em; -} - -div#person_details_container { - padding-top: 20px; - padding-bottom: 20px; -} - -div.person-view { - figure.person-details { - h2 { - font-family: 'Open Sans'; - font-weight: 600; - margin-bottom: 0.3em; - font-variant: small-caps; - } - - dl { - margin-top: 0.3em; - } - - dt { - font-family: 'Open Sans'; - font-weight: 600; - } - - dd { - margin-left: 0; - } - -// a.sc-button { -/* background-color: $black; - padding-top: 0.2em; - padding-bottom: 0.2em; - }*/ - } - - /* custom fields on the home page */ - div.custom-fields { - figure.person-details { - display: flex; - flex-flow: row wrap; - - div.cf_title_box:nth-child(4n+1) h2 { - @extend .chill-red; - } - - div.cf_title_box:nth-child(4n+2) h2 { - @extend .chill-green; - } - - div.cf_title_box:nth-child(4n+3) h2 { - @extend .chill-orange; - } - - div.cf_title_box:nth-child(4n+4) h2 { - @extend .chill-blue; - } - - div.cf_title_box:nth-child(2n+1){ - width: 50%; - margin-right: 40px; - } - - iv.cf_title_box:nth-child(2n+2) { - width: calc(50% - 40px); - } - - } - - - } - -} - - -/* - * HOUSEHOLD - */ - - -div.household__address, div.person__address { - div.row { - height: 100px; - width: 100%; - position: relative; - & > div { - position: absolute; - display: table; - height: 100%; - border: 1px dotted #c3c3c3; - } - div.household__address--date, div.person__address--date { - width: 30%; - background-color: #c3c3c3; - height: 100%; - div.cell { - box-sizing: border-box; - position: relative; - height: 100%; - width: 100%; - margin-left: 50%; - div.pill { - position: absolute; - box-sizing: border-box; - width: 120px; - height: 40px; - bottom: -20px; - background-color: white; - padding: 10px; - border-radius: 30px; - left: -60px; - text-align: center; - z-index: 10; - } - } - } - div.household__address--content, div.person__address--content { - width: 70%; - left: 30%; - text-align: left; - background-color: #ececec; - border: 1px solid #888; - div.cell { - display: table-cell; - padding: 5px 30px; - vertical-align: middle; - & > div { - display: flex; - justify-content: space-between; - } - i.dot::before, i.dot::after { - position: absolute; - width: 20px; - height: 20px; - content: ''; - border: 0; - background-color: white; - border-radius: 50%; - border: 5px solid #c3c3c3; - z-index: 10; - left: -15px; - bottom: -15px; - } - } - } - } -} -div.household__address-move { - div.household__address-move__create { - display: flex; - flex-direction: column; - } -} diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue index 8dd66d0f2..617c0e4dd 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue @@ -57,12 +57,6 @@ export default { position: relative; &:before { position: absolute; - /* - content: "\f192"; //circle-dot - content: "\f1dd"; //paragraph - content: "\f292"; //hashtag - content: "\f069"; //asterisk - */ content: "\f142"; //ellipsis-v font-family: "ForkAwesome"; color: #718596ab; @@ -71,7 +65,7 @@ export default { } a[name^="section"] { position: absolute; - top: -3.5em; // ref. stickNav + top: -3.5em; // reference for stickNav } } padding: 0.8em 0em; @@ -80,18 +74,6 @@ export default { border-radius: 5px; border-left: 1px dotted #718596ab; border-right: 1px dotted #718596ab; - /* debug components - position: relative; - &:before { - content: "vuejs component"; - position: absolute; - left: 1.5em; - top: -0.9em; - background-color: white; - color: grey; - padding: 0 0.3em; - } - */ dd { margin-left: 1em; } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_js/i18n.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_js/i18n.js index f83004ce8..4a5711509 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_js/i18n.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_js/i18n.js @@ -9,7 +9,7 @@ const personMessages = { item: { type_person: "Usager", type_user: "TMS", - type_thirdparty: "Tiers", + type_thirdparty: "Tiers professionnel", type_household: "Ménage" }, person: { diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Address/list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Address/list.html.twig index 698f1e9d0..638d38b36 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Address/list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Address/list.html.twig @@ -25,68 +25,84 @@ {% block personcontent %}

{{ 'Addresses\'history for %name%'|trans({ '%name%': person.firstName ~ ' ' ~ person.lastName } ) }}

- -
- -
-
-
-
-
- {% if person.addresses|length == 0 %} - {{ 'No address given'|trans }} - {% endif %} - - {{ 'Add an address'|trans }} - -
-
-
-
- + +
+ + {% if person.addresses|length == 0 %} + {{ 'No address given'|trans }} + {% else %} +
+ {% endif %} + {% for address in person.addresses %} -
-
-
-
- {% if address.validFrom is not empty %} - {{ address.validFrom|format_date('long') }} - {% endif %} -
-
-
-
-
- -
- {% if address.isNoAddress == true %} + + {# if person address #} +
+
+ {% if address.isNoAddress == true %}
{{ 'address.consider homeless'|trans }}
- {% else %} -
- {% if address.street is not empty %} -
- - {{ address.street }} - {% if address.streetNumber is not empty %} - , {{ address.streetNumber }} - {% endif %} -
- {% endif %} - {% if address.postCode is not empty %} -
- {{ address.postCode.code }} {{ address.postCode.name }} - ({{ address.postCode.country.name|localize_translatable_string }}) -
+ {% else %} + + {% if address.street is not empty %} +
+ {{ address.street }} + {% if address.streetNumber is not empty %} + , {{ address.streetNumber }} {% endif %}
{% endif %} - -
+ + {% if address.postCode is not empty %} +
+ {{ address.postCode.code }} {{ address.postCode.name }} + ({{ address.postCode.country.name|localize_translatable_string }}) +
+ {% endif %} + + {% endif %} + +
    +
  • + +
  • +
-
+ {# endif #} + +
+ + {# if household address #}{# +
+
...
+
+ #}{# endif #} + +
+ {% if address.validFrom is not empty %} + {{ address.validFrom|format_date('long') }} + {% endif %} +
+ {% endfor %} + + {# TEST HOUSEHOLD POSITION + #} +
+
+
+
+ 549, chemin De Sousa + , 45, boulevard Aurore Roux +
+
+ 10850 Nanterre (France) +
+
+
+
+
01 janvier 1970
+
- {% endblock personcontent %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig index fcc21765b..1e029c9a2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig @@ -4,67 +4,66 @@ {% block content %}

{{ block('title') }}

-
-
+
- + {% if household.addresses|length == 0 %} + {{ 'No address given'|trans }} + {% else %} +
+ {% endif %} + + {% for address in household.addresses %} - {% for address in household.addresses %} -
-
-
-
- {% if address.validFrom is not empty %} - {{ address.validFrom|format_date('long') }} - {% endif %} -
-
-
-
-
- -
- {% if address.isNoAddress == true %} -
{{ 'address.consider homeless'|trans }}
- {% else %} -
- {% if address.street is not empty %} -
- - {{ address.street }} - {% if address.streetNumber is not empty %} - , {{ address.streetNumber }} - {% endif %} -
- {% endif %} - {% if address.postCode is not empty %} -
- {{ address.postCode.code }} {{ address.postCode.name }} - ({{ address.postCode.country.name|localize_translatable_string }}) -
- {% endif %} - -
+
+ +
+
+ {% if address.isNoAddress == true %} +
{{ 'address.consider homeless'|trans }}
+ {% else %} + {% if address.street is not empty %} +
+ {{ address.street }} + {% if address.streetNumber is not empty %} + , {{ address.streetNumber }} {% endif %} -
-
-
-
- {% endfor %} -
+ {% endif %} + {% if address.postCode is not empty %} +
+ {{ address.postCode.code }} {{ address.postCode.name }} + ({{ address.postCode.country.name|localize_translatable_string }}) +
+ {% endif %} + {% endif %} +
+ +
    +
  • + +
  • +
+
+ +
+ {% if address.validFrom is not empty %} + {{ address.validFrom|format_date('long') }} + {% endif %} +
+ + {% endfor %} +
+ + {% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/banner.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/banner.html.twig index d5131223c..d585f2ade 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/banner.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/banner.html.twig @@ -1,5 +1,5 @@