mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-28 04:56:13 +00:00
Fix counter on notification for document, using "more" parameter
The counter now show results for embedded document, in the accompanying period work list.
This commit is contained in:
parent
3879e5cd9b
commit
a6b451df98
@ -1,7 +1,17 @@
|
||||
{% macro metadata(w) %}
|
||||
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id) %}
|
||||
{% macro metadata(w, include_notif_counter = true) %}
|
||||
{% if include_notif_counter == true %}
|
||||
{% set more = [] %}
|
||||
{% for e in w.accompanyingPeriodWorkEvaluations %}
|
||||
{% for d in e.documents %}
|
||||
{% set more = more|merge([{'relatedEntityClass': 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument', 'relatedEntityId': d.id}]) %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id, more) %}
|
||||
|
||||
{% if notif_counter.total > 0 %}
|
||||
{{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id) }}
|
||||
{{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id, more) }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %}
|
||||
{{ macro.updatedBy(w) }}
|
||||
|
@ -27,7 +27,20 @@
|
||||
'displayContent': 'long',
|
||||
'itemBlocClass': 'uniq extended',
|
||||
} %}
|
||||
<div class="p-3 mt-3">{{ macro.metadata(work) }}</div>
|
||||
<div class="p-3 mt-3">{{ macro.metadata(work, false) }}</div>
|
||||
</div>
|
||||
|
||||
<div class="notification notification-list">
|
||||
{% set more = [] %}
|
||||
{% for e in work.accompanyingPeriodWorkEvaluations %}
|
||||
{% for d in e.documents %}
|
||||
{% set more = more|merge([{'relatedEntityClass': 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument', 'relatedEntityId': d.id}]) %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% set notifications = chill_list_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', work.id, more) %}
|
||||
{% if notifications is not empty %}
|
||||
{{ notifications|raw }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
|
Loading…
x
Reference in New Issue
Block a user