Sfoglia il codice sorgente

[Administration] Utilisateurs : correctif nom d'utilisateur particuliers avec libellé personnes morales défini

feature/souke
Guillaume Bourgeois 10 mesi fa
parent
commit
8310401e07
2 ha cambiato i file con 20 aggiunte e 18 eliminazioni
  1. +1
    -1
      backend/views/distribution/index.php
  2. +19
    -17
      common/logic/User/User/Service/UserSolver.php

+ 1
- 1
backend/views/distribution/index.php Vedi File

@@ -657,7 +657,7 @@ $this->setPageTitle('Distributions') ;
<select class="form-control select2-order-form" v-model="order.id_user" @change="userChange">
<option value="0">--</option>
<option v-for="user in users" :value="user.id_user">
<template v-if="user.name_legal_person && user.name_legal_person.length">
<template v-if="user.type == 'legal-person' && user.name_legal_person && user.name_legal_person.length">
{{ user.name_legal_person }} (personne morale)
</template>
<template v-else>

+ 19
- 17
common/logic/User/User/Service/UserSolver.php Vedi File

@@ -61,22 +61,6 @@ class UserSolver extends AbstractService implements SolverInterface
return $user->type == User::TYPE_GUEST;
}

public function getUsernameFromArray(array $modelArray, $withType = false): string
{
$username = '';
if (isset($modelArray['name_legal_person']) && strlen($modelArray['name_legal_person'])) {
$username = $modelArray['name_legal_person'];
} else {
$username = $modelArray['lastname'] . ' ' . $modelArray['name'];
}

if ($withType && $modelArray['type'] == User::TYPE_LEGAL_PERSON) {
$username = $username . ' (personne morale)';
}

return $username;
}

public function getContactSummaryFromArrayAsHtml(array $user): string
{
$html = '';
@@ -107,7 +91,25 @@ class UserSolver extends AbstractService implements SolverInterface
$username = $user->lastname . ' ' . $user->name;
}

if ($withType) {
if ($withType && $this->isTypeLegalPerson($user)) {
$username = $username . ' (personne morale)';
}

return $username;
}

public function getUsernameFromArray(array $modelArray, $withType = false): string
{
$username = '';
if ($modelArray['type'] == User::TYPE_LEGAL_PERSON
&& isset($modelArray['name_legal_person'])
&& strlen($modelArray['name_legal_person'])) {
$username = $modelArray['name_legal_person'];
} else {
$username = $modelArray['lastname'] . ' ' . $modelArray['name'];
}

if ($withType && $modelArray['type'] == User::TYPE_LEGAL_PERSON) {
$username = $username . ' (personne morale)';
}


Loading…
Annulla
Salva