Only display custom fields that are active

This commit is contained in:
Marc Ducobu 2015-09-30 14:56:06 +02:00
parent 6acba49f38
commit 426849f169
2 changed files with 3 additions and 10 deletions

View File

@ -4,7 +4,7 @@
#}"{{ 'Date'|trans }}",{# #}"{{ 'Date'|trans }}",{#
#}"{{ 'User'|trans }}",{# #}"{{ 'User'|trans }}",{#
#}"{{ 'Report type'|trans }}",{# #}"{{ 'Report type'|trans }}",{#
#}{% for customField in cf_group.customFields %}{# #}{% for customField in cf_group.activeCustomFields %}{#
#}"{{ chill_custom_field_label(customField) }}"{% if not loop.last %},{% endif %}{# #}"{{ chill_custom_field_label(customField) }}"{% if not loop.last %},{% endif %}{#
#}{% endfor %}{# #}{% endfor %}{#
@ -16,7 +16,7 @@
#}"{{ report.date|localizeddate('short', 'none') }}",{# #}"{{ report.date|localizeddate('short', 'none') }}",{#
#}"{{ report.user|csv_cell }}",{# #}"{{ report.user|csv_cell }}",{#
#}"{{ report.cFGroup.getName(app.request.locale)|csv_cell }}",{# #}"{{ report.cFGroup.getName(app.request.locale)|csv_cell }}",{#
#}{% for customField in report.cFGroup.customFields %}{# #}{% for customField in report.cFGroup.activeCustomFields %}{#
#}{% if customField.type == 'title' %}{# #}{% if customField.type == 'title' %}{#
#}""{# #}""{#
#}{% else %}{# #}{% else %}{#

View File

@ -39,14 +39,7 @@
<dt class="inline">{{ 'Report type'|trans }}</dt> <dt class="inline">{{ 'Report type'|trans }}</dt>
<dd>{{ entity.cFGroup.getName(app.request.locale) }}</dd> <dd>{{ entity.cFGroup.getName(app.request.locale) }}</dd>
{% for customField in entity.cFGroup.customFields %} {{ chill_custom_fields_group_widget(entity.cFData, entity.cFGroup) }}
{% if customField.type == 'title' %}
{{ chill_custom_field_widget(entity.cFData , customField) }}
{% else %}
<dt>{{ chill_custom_field_label(customField) }}</dt>
<dd>{{ chill_custom_field_widget(entity.cFData , customField) }}</dd>
{% endif %}
{% endfor %}
</dl> </dl>
<a href="{{ path('report_edit', { 'person_id': entity.person.id, 'report_id': entity.id }) }}"><i class="fa fa-pencil"></i> {{ 'Update the report' | trans }}</a> <a href="{{ path('report_edit', { 'person_id': entity.person.id, 'report_id': entity.id }) }}"><i class="fa fa-pencil"></i> {{ 'Update the report' | trans }}</a>