household: safe display of household members without positions

This commit is contained in:
nobohan 2022-04-19 17:09:10 +02:00
parent 4bc8da9655
commit c214c2f4a4
2 changed files with 11 additions and 6 deletions

View File

@ -26,12 +26,15 @@ class HouseholdMemberType extends AbstractType
'input' => 'datetime_immutable',
]);
if (!$options['data']->getPosition()->getShareHousehold()) {
$builder->add('endDate', ChillDateType::class, [
'label' => 'household.End date',
'input' => 'datetime_immutable',
]);
if (null !== $options['data']->getPosition()) {
if (!$options['data']->getPosition()->getShareHousehold()) {
$builder->add('endDate', ChillDateType::class, [
'label' => 'household.End date',
'input' => 'datetime_immutable',
]);
}
}
$builder
->add('comment', ChillTextareaType::class, [
'label' => 'household.Comment',

View File

@ -48,7 +48,9 @@
</div>
<div class="wl-col list">
<p class="item">
{{ p.position.label|localize_translatable_string }}
{% if p.position %}
{{ p.position.label|localize_translatable_string }}
{% endif %}
{% if p.holder %}
<span class="fa-stack fa-holder" title="{{ 'houshold.holder'|trans|e('html_attr') }}">
<i class="fa fa-circle fa-stack-1x text-success"></i>