diff --git a/CHANGELOG.md b/CHANGELOG.md index f96b7f0c1..1b9bdde0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,9 @@ and this project adheres to * refactor `AuthorizationHelper` and `UserACLAwareRepository` to fix constructor, and separate logic for parent role helper into `ParentRoleHelper` * [main]: filter location and locationType in backend: exclude NULL names, only active and availableToUsers * [activity]: perform client-side validation & show/hide fields in the "new location" modal +* [person] show current address in search results +* [person] show alt names in search results +* [admin]: links to activity admin section added again. * [tasks]: different layout for task list / my tasks, and fix link to tasks in alert or in warning * [admin]: links to activity admin section added again. * [household]: household addresses ordered by ValidFrom date and by id to show the last created address on top. diff --git a/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig index b1bdb8438..104f46b27 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig @@ -83,6 +83,10 @@ {% endmacro %} +{# + this enclose the rendering inside a "li", which ease the placement operation when the address + must be shown in such list +#} {%- if render == 'list' -%}
  • {% if options['with_picto'] %} diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index 9aaad8c04..382c311d9 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -1283,11 +1283,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI /** * get the address associated with the person at the given date * + * If the `$at` parameter is now, use the method `getCurrentPersonAddress`, which is optimized + * on database side. + * * @param DateTime|null $at * @return Address|null * @throws \Exception */ - public function getCurrentPersonAddress(?\DateTime $at = null): ?Address + public function getAddressAt(?\DateTime $at = null): ?Address { $at ??= new DateTime('now'); @@ -1305,6 +1308,20 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI current($addresses); } + /** + * Get the current person address + * + * @return Address|null + */ + public function getCurrentPersonAddress(): ?Address + { + if (null === $this->currentPersonAddress) { + return null; + } + + return $this->currentPersonAddress->getAddress(); + } + /** * Validation callback that checks if the accompanying periods are valid * diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig index 0d0aa289b..d2ed09135 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig @@ -67,7 +67,7 @@ {%- endif -%} {%- if options['addInfo'] -%} - {% set gender = (person.gender == 'woman') ? 'fa-venus' : + {% set gender = (person.gender == 'woman') ? 'fa-venus' : (person.gender == 'man') ? 'fa-mars' : (person.gender == 'neuter') ? 'fa-neuter' : 'fa-genderless' %} {% set genderTitle = (person.gender == 'woman') ? 'woman' : (person.gender == 'man') ? 'man' : (person.gender == 'neuter') ? 'neuter' : 'Not given'|trans %} @@ -123,13 +123,15 @@