diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..d7a227605 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,30 @@ +{ + // Use IntelliSense to learn about possible attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Chill Debug", + "type": "php", + "request": "launch", + "port": 9000, + "pathMappings": { + "/var/www/html": "${workspaceFolder}" + }, + "preLaunchTask": "symfony" + }, + { + "name": "Yarn Encore Dev (Watch)", + "type": "node-terminal", + "request": "launch", + "command": "yarn encore dev --watch", + "cwd": "${workspaceFolder}" + } + ], + "compounds": [ + { + "name": "Chill Debug + Yarn Encore Dev (Watch)", + "configurations": ["Chill Debug", "Yarn Encore Dev (Watch)"] + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000..a652cfe03 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + "tasks": [ + { + "type": "shell", + "command": "symfony", + "args": [ + "server:start", + "--allow-http", + "--no-tls", + "--port=8000", + "--allow-all-ip", + "-d" + ], + "label": "symfony" + }, + { + "type": "shell", + "command": "yarn", + "args": ["encore", "dev", "--watch"], + "label": "webpack" + } + ] +} diff --git a/src/Bundle/ChillMainBundle/Resources/public/types.ts b/src/Bundle/ChillMainBundle/Resources/public/types.ts index 90ddacf22..e520ac747 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/types.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/types.ts @@ -49,6 +49,30 @@ export interface User { // todo: mainCenter; mainJob; etc.. } +// TODO : Add missing household properties +export interface Household { + type: "household"; + id: number; +} + +export interface ThirdParty { + type: "thirdparty"; + id: number; + firstname: string; + name: string; + email: string; + telephone: string; + telephone2: string; + address: { + address_id: number; + text: string; + postcode: { + name: string; + }; + id: number; + }; +} + export interface UserGroup { type: "user_group"; id: number; diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/Create.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/Create.vue index 9a4325060..f05080fba 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/Create.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/Create.vue @@ -10,7 +10,7 @@ v-model="radioType" value="person" /> - {{ $t("onthefly.create.person") }} + {{ trans(ONTHEFLY_CREATE_PERSON) }} @@ -24,7 +24,7 @@ v-model="radioType" value="thirdparty" /> - {{ $t("onthefly.create.thirdparty") }} + {{ trans(ONTHEFLY_CREATE_THIRDPARTY) }} @@ -46,64 +46,67 @@ /> - - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue index 9d05f6883..bcdad2835 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue @@ -2,21 +2,23 @@ - {{ $t(buttonTitle || "") }} + {{ buttonTitle }} @@ -24,15 +26,19 @@ @@ -63,7 +73,7 @@ - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/HouseholdRenderBox.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/HouseholdRenderBox.vue index a9d937250..e6f50708b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/HouseholdRenderBox.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/HouseholdRenderBox.vue @@ -5,11 +5,11 @@
- {{ $t("new_household") }} + {{ trans(RENDERBOX_NEW_HOUSEHOLD) }}
- {{ $t("household_number", { number: household.id }) }} + {{ trans(RENDERBOX_HOUSEHOLD_NUMBER, { number: household.id }) }}
@@ -18,7 +18,7 @@
  • -
  • +
  • - {{ $t("no_members_yet") }} + {{ trans(RENDERBOX_NO_MEMBERS_YET) }}

  • @@ -57,7 +57,7 @@
  • {{ - $t("no_current_address") + trans(RENDERBOX_NO_CURRENT_ADDRESS) }}
  • @@ -65,89 +65,82 @@
    - - +}); + +const altNameLabel = computed(() => { + let altNameLabel = ""; + (props.person.altNames || []).forEach( + (altName) => (altNameLabel += altName.label), + ); + return altNameLabel; +}); + +const altNameKey = computed(() => { + let altNameKey = ""; + (props.person.altNames || []).forEach( + (altName) => (altNameKey += altName.key), + ); + return altNameKey; +}); + +const getUrl = computed(() => { + return `/fr/person/${props.person.id}/general`; +}); + +const getCurrentHouseholdUrl = computed(() => { + let returnPath = props.returnPath ? `?returnPath=${props.returnPath}` : ``; + return `/fr/person/household/${props.person.current_household_id}/summary${returnPath}`; +}); + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonText.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonText.vue index f3005f235..36be069b6 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonText.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonText.vue @@ -2,65 +2,65 @@ {{ cutText }} {{ person.firstName }} -  {{ person.lastName }} -  ({{ altNameLabel }}) -  {{ person.suffixText }} -  {{ $tc("renderbox.years_old", person.age) }} {{ trans(RENDERBOX_YEARS_OLD, person.age) }} -  (‡) +  (‡) - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue index 9abd03991..3a93a305d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue @@ -17,7 +17,7 @@ isMultiline: true, }" :show-residential-addresses="true" - > + /> @@ -27,10 +27,10 @@ class="form-control form-control-lg" id="lastname" v-model="lastName" - :placeholder="$t('person.lastname')" + :placeholder="trans(PERSON_MESSAGES_PERSON_LASTNAME)" @change="checkErrors" /> - +
    @@ -50,10 +50,12 @@ class="form-control form-control-lg" id="firstname" v-model="firstName" - :placeholder="$t('person.firstname')" + :placeholder="trans(PERSON_MESSAGES_PERSON_FIRSTNAME)" @change="checkErrors" /> - +
    @@ -86,12 +88,14 @@ -->
    - +
    - +
    @@ -114,64 +120,50 @@ v-model="civility" > - +
    - - -
    - -
    - + + +
    - + + +
    - + + +
    @@ -183,22 +175,21 @@ v-model="showAddressForm" name="showAddressForm" /> - +
    -

    {{ $t("person.address.warning") }}

    - {{ trans(PERSON_MESSAGES_PERSON_ADDRESS_WARNING) }}

    + -
    + />
    @@ -208,8 +199,8 @@
    - - +}); +const mobilenumber = computed({ + get: () => person.mobilenumber, + set: (value) => { + person.mobilenumber = value; + }, +}); +const email = computed({ + get: () => person.email, + set: (value) => { + person.email = value; + }, +}); +const showAddressForm = computed({ + get: () => showAddressFormValue.value, + set: (value) => { + showAddressFormValue.value = value; + }, +}); +const center = computed({ + get: () => { + const c = config.centers.find( + (c) => person.center !== null && person.center.id === c.id, + ); + return typeof c === "undefined" ? null : c; + }, + set: (value) => { + person.center = { id: value.id, type: value.type }; + }, +}); - +}); + +defineExpose(genderClass, genderTranslation, feminized, birthDate); + diff --git a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml index 830e21d2d..f81efac8c 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml @@ -198,3 +198,59 @@ accompanying_course_evaluation_document: accompanying_period_work: title: Action d'accompagnement (n°{id}) - {action_title} + +add_persons: + title: "Ajouter des usagers" + suggested_counter: >- + {count, plural, + =0 {Pas de résultats} + =1 {1 résultat} + other {# résultats} + } + selected_counter: >- + {count, plural, + =1 {1 sélectionné} + other {# sélectionnés} + } + search_some_persons: "Rechercher des personnes.." + + item: + type_person: "Usager" + type_user: "TMS" + type_thirdparty: "Tiers professionnel" + type_household: "Ménage" + + person: + firstname: "Prénom" + lastname: "Nom" + born: + man: "Né le" + woman: "Née le" + neutral: "Né·e le" + center_id: "Identifiant du centre" + center_type: "Type de centre" + center_name: "Territoire" + phonenumber: "Téléphone" + mobilenumber: "Mobile" + altnames: "Autres noms" + email: "Courriel" + gender: + title: "Genre" + placeholder: "Choisissez le genre de l'usager" + woman: "Féminin" + man: "Masculin" + neutral: "Neutre, non binaire" + unknown: "Non renseigné" + undefined: "Non renseigné" + civility: + title: "Civilité" + placeholder: "Choisissez la civilité" + address: + create_address: "Ajouter une adresse" + show_address_form: "Ajouter une adresse pour un usager non suivi et seul dans un ménage" + warning: "Un nouveau ménage va être créé. L'usager sera membre de ce ménage." + center: + placeholder: "Choisissez un centre" + title: "Centre" + + error_only_one_person: "Une seule personne peut être sélectionnée !" diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 9bce912a0..47d4feed3 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -1505,3 +1505,48 @@ my_parcours_filters: parcours_intervening: Intervenant is_open: Parcours ouverts is_closed: Parcours clôturés + +person_messages: + add_persons: + title: "Ajouter des usagers" + suggested_counter: "Pas de résultats | 1 résultat | {count} résultats" + selected_counter: " 1 sélectionné | {count} sélectionnés" + search_some_persons: "Rechercher des personnes.." + item: + type_person: "Usager" + type_user: "TMS" + type_thirdparty: "Tiers professionnel" + type_household: "Ménage" + person: + firstname: "Prénom" + lastname: "Nom" + born: + man: "Né le" + woman: "Née le" + neutral: "Né·e le" + center_id: "Identifiant du centre" + center_type: "Type de centre" + center_name: "Territoire" + phonenumber: "Téléphone" + mobilenumber: "Mobile" + altnames: "Autres noms" + email: "Courriel" + gender: + title: "Genre" + placeholder: "Choisissez le genre de l'usager" + woman: "Féminin" + man: "Masculin" + neutral: "Neutre, non binaire" + unknown: "Non renseigné" + undefined: "Non renseigné" + civility: + title: "Civilité" + placeholder: "Choisissez la civilité" + address: + create_address: "Ajouter une adresse" + show_address_form: "Ajouter une adresse pour un usager non suivi et seul dans un ménage" + warning: "Un nouveau ménage va être créé. L'usager sera membre de ce ménage." + center: + placeholder: "Choisissez un centre" + title: "Centre" + error_only_one_person: "Une seule personne peut être sélectionnée !" diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue index 623926807..eab1db50b 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue @@ -27,18 +27,18 @@
    - {{ $t("child_of") }} + {{ trans(THIRDPARTY_MESSAGES_CHILD_OF) }} {{ parent.text }}
    -
    +
    @@ -53,7 +53,7 @@ @@ -95,7 +95,7 @@ v-model="thirdparty.civility" >
    @@ -123,10 +127,12 @@ class="form-control form-control-lg" id="firstname" v-model="thirdparty.firstname" - :placeholder="$t('thirdparty.firstname')" + :placeholder=" + trans(THIRDPARTY_MESSAGES_THIRDPARTY_FIRSTNAME) + " />
    @@ -147,10 +153,12 @@ class="form-control form-control-lg" id="name" v-model="thirdparty.name" - :placeholder="$t('thirdparty.lastname')" + :placeholder=" + trans(THIRDPARTY_MESSAGES_THIRDPARTY_LASTNAME) + " />
    @@ -174,9 +182,11 @@ class="form-control form-control-lg" id="name" v-model="thirdparty.name" - :placeholder="$t('thirdparty.name')" + :placeholder="trans(THIRDPARTY_MESSAGES_THIRDPARTY_NAME)" /> - +
      @@ -188,7 +198,7 @@