firstname added to onthefly for child or contact

This commit is contained in:
Julie Lenaerts 2022-03-14 11:48:39 +01:00
parent f44f9d356b
commit 09e6872724
5 changed files with 21 additions and 4 deletions

View File

@ -65,7 +65,7 @@
</div> </div>
<div v-if="thirdparty.kind === 'child' || thirdparty.kind === 'contact'"> <div v-if="thirdparty.kind === 'child' || thirdparty.kind === 'contact'">
<div id="child-info"> <div class="child-info">
<div class="input-group mb-3"> <div class="input-group mb-3">
<select class="form-select form-select-lg" id="profession" <select class="form-select form-select-lg" id="profession"
v-model="thirdparty.civility"> v-model="thirdparty.civility">
@ -81,9 +81,19 @@
</select> </select>
</div> </div>
</div> </div>
<div class="child-info">
<div class="form-floating mb-3">
<input class="form-control form-control-lg" id="firstname" v-model="thirdparty.firstname" v-bind:placeholder="$t('thirdparty.firstname')" />
<label for="firstname">{{ $t('thirdparty.firstname') }}</label>
</div>
<div class="form-floating mb-3">
<input class="form-control form-control-lg" id="name" v-model="thirdparty.name" v-bind:placeholder="$t('thirdparty.lastname')" />
<label for="name">{{ $t('thirdparty.lastname') }}</label>
</div>
</div>
</div> </div>
<div class="form-floating mb-3"> <div class="form-floating mb-3" v-if="thirdparty.kind === 'company'">
<input class="form-control form-control-lg" id="name" v-model="thirdparty.name" v-bind:placeholder="$t('thirdparty.name')" /> <input class="form-control form-control-lg" id="name" v-model="thirdparty.name" v-bind:placeholder="$t('thirdparty.name')" />
<label for="name">{{ $t('thirdparty.name') }}</label> <label for="name">{{ $t('thirdparty.name') }}</label>
</div> </div>
@ -307,7 +317,7 @@ dl {
margin-bottom: 1rem; margin-bottom: 1rem;
} }
#child-info { .child-info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
div { div {

View File

@ -1,6 +1,8 @@
const thirdpartyMessages = { const thirdpartyMessages = {
fr: { fr: {
thirdparty: { thirdparty: {
firstname: "Prénom",
lastname: "Nom",
name: "Dénomination", name: "Dénomination",
email: "Courriel", email: "Courriel",
phonenumber: "Téléphone", phonenumber: "Téléphone",

View File

@ -43,6 +43,7 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf
{ {
return [ return [
'type' => 'thirdparty', 'type' => 'thirdparty',
'firstname' => $thirdParty->getFirstname(),
'name' => $thirdParty->getName(), 'name' => $thirdParty->getName(),
'text' => $this->thirdPartyRender->renderString($thirdParty, []), 'text' => $this->thirdPartyRender->renderString($thirdParty, []),
'id' => $thirdParty->getId(), 'id' => $thirdParty->getId(),

View File

@ -77,7 +77,9 @@ class ThirdPartyRender extends AbstractChillEntityRender
$acronym = ''; $acronym = '';
} }
return $civility . $entity->getName() . $acronym; $firstname = empty($entity->getFirstname()) ? '' : $entity->getFirstname();
return $civility . $firstname . ' ' . $entity->getName() . $acronym;
} }
public function supports($entity, array $options): bool public function supports($entity, array $options): bool

View File

@ -20,6 +20,8 @@ components:
type: string type: string
enum: enum:
- "thirdparty" - "thirdparty"
firstname:
type: string
name: name:
type: string type: string
email: email: