handle kind as contacts

This commit is contained in:
2021-10-08 17:51:51 +02:00
parent 4d71a1c630
commit 0633fd812f
8 changed files with 148 additions and 58 deletions

View File

@@ -1,29 +1,31 @@
{% if form.civility is defined %}
{{ form_row(form.civility) }}
{% endif %}
{{ form_row(form.name) }}
{{ form_row(form.name) }}
{% if form.nameCompany is defined %}
{{ form_row(form.nameCompany) }}
{{ form_row(form.acronym) }}
{% endif %}
{% if form.nameCompany is defined %}
{{ form_row(form.nameCompany) }}
{{ form_row(form.acronym) }}
{% endif %}
{% if form.profession is defined %}
{{ form_row(form.profession) }}
{% endif %}
{% if form.profession is defined %}
{{ form_row(form.profession) }}
{% endif %}
{{ form_row(form.types) }}
{{ form_row(form.categories) }}
{{ form_row(form.types) }}
{{ form_row(form.categories) }}
{{ form_row(form.telephone) }}
{{ form_row(form.email) }}
{{ form_row(form.telephone) }}
{{ form_row(form.email) }}
<h2>{{ 'Contacts'|trans }}</h2>
{{ form_widget(form.activeChildren) }}
{{ form_row(form.contactDataAnonymous) }}
{% if form.activeChildren is defined %}
<h2>{{ 'Contacts'|trans }}</h2>
{{ form_widget(form.activeChildren) }}
{% endif %}
<div class="mb-3 row">
{{ form_label(form.address) }}
@@ -54,6 +56,6 @@
</div>
{{ form_row(form.comment) }}
{{ form_row(form.centers) }}
{{ form_row(form.centers) }}
{{ form_row(form.active) }}
{{ form_row(form.active) }}

View File

@@ -0,0 +1,37 @@
{% extends "@ChillMain/layout.html.twig" %}
{% block title 'thirdparty.Which kind of third party ?'|trans %}
{% block content %}
<div class="col-10 centered">
<h1>{{ block('title') }}</h1>
<div class="container" style="margin-top: 2rem;">
<div class="row">
<div class="col-md-4">
<a
href="{{ chill_path_forward_return_path('chill_crud_3party_3party_new', {'kind': 'company'}) }}"
class="btn btn-outline-chill-green-dark">
{{ 'thirdparty.A company'|trans }}
</a>
</div>
<div class="col-md-8">
<p>{{ 'thirdparty.a_company_explanation'|trans }}</p>
</div>
</div>
<div class="row">
<div class="col-md-4">
<a
href="{{ chill_path_forward_return_path('chill_crud_3party_3party_new', {'kind': 'contact'}) }}"
class="btn btn-outline-chill-green-dark">
{{ 'thirdparty.A contact'|trans }}
</a>
</div>
<div class="col-md-8">
<p>{{ 'thirdparty.a_contact_explanation'|trans }}</p>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -28,7 +28,7 @@
{{ thirdParty.name }}
</dd>
{% if thirdParty.isLeaf == false %}
{% if thirdParty.kind == 'company' %}
<dt>{{ 'thirdparty.NameCompany'|trans }}</dt>
<dd>
{% if thirdParty.nameCompany == null %}
@@ -99,20 +99,22 @@
{% endif %}
</dd>
<dt>{{ 'Contacts'|trans }}</dt>
<dd>
{% if thirdParty.activeChildren|length == 0 %}
<p class="chill-no-data-statement">{{ 'Any contacts associated'|trans }}</p>
{% else %}
<div class="flex-table">
{% for tp in thirdParty.activeChildren %}
<div class="item-bloc">
{{ tp|chill_entity_render_box({'render': 'bloc', 'addLink': false}) }}
{% if thirdParty.kind == 'company' %}
<dt>{{ 'Contacts'|trans }}</dt>
<dd>
{% if thirdParty.activeChildren|length == 0 %}
<p class="chill-no-data-statement">{{ 'Any contacts associated'|trans }}</p>
{% else %}
<div class="flex-table">
{% for tp in thirdParty.activeChildren %}
<div class="item-bloc">
{{ tp|chill_entity_render_box({'render': 'bloc', 'addLink': false}) }}
</div>
{% endfor %}
</div>
{% endfor %}
</div>
{% endif %}
</dd>
{% endif %}
</dd>
{% endif %}
<dt>{{ 'Centers'|trans }}</dt>
<dd>