Resolve "Fusion des tiers"

This commit is contained in:
2025-08-18 15:34:48 +00:00
committed by Julien Fastré
parent aa085a1562
commit f5668592ca
14 changed files with 580 additions and 10 deletions

View File

@@ -0,0 +1,34 @@
{%- macro details(thirdparty, options) -%}
<ul>
<li><b>{{ 'name'|trans }}</b>:
{{ thirdparty.name }}</li>
<li><b>{{ 'First name'|trans }}</b>:
{% if thirdparty.firstname %}{{ thirdparty.firstname }}{% endif %}</li>
<li><b>{{ 'thirdparty.Civility'|trans }}</b>:
{% if thirdparty.getCivility %}{{ thirdparty.getCivility.name|localize_translatable_string }}{% endif %}</li>
<li><b>{{ 'thirdparty.NameCompany'|trans }}</b>:
{% if thirdparty.nameCompany is not empty %}{{ thirdparty.nameCompany }}{% endif %}</li>
<li><b>{{ 'thirdparty.Acronym'|trans }}</b>:
{% if thirdparty.acronym %}{{ thirdparty.acronym }}{% endif %}</li>
<li><b>{{ 'thirdparty.Profession'|trans }}</b>:
{% if thirdparty.profession %}{{ thirdparty.profession }}{% endif %}</li>
<li><b>{{ 'telephone'|trans }}</b>:
{% if thirdparty.telephone %}{{ thirdparty.telephone|chill_format_phonenumber }}{% endif %}</li>
<li><b>{{ 'email'|trans }}</b>:
{% if thirdparty.email is not null %}{{ thirdparty.email }}{% endif %}</li>
<li><b>{{ 'Address'|trans }}</b>:
{%- if thirdparty.getAddress is not empty -%}
{{ thirdparty.getAddress|chill_entity_render_box }}
{% endif %}</li>
<li><b>{{ 'thirdparty.Contact data are confidential'|trans }}</b>:
{{ thirdparty.contactDataAnonymous }}</li>
<li><b>{{ 'Contacts'|trans }}</b>:
<ul>
{% for c in thirdparty.getChildren %}
<li>{{ c.name }} {{ c.firstName }}</li>
{% endfor %}
</ul>
</li>
</ul>
{% endmacro %}

View File

@@ -0,0 +1,97 @@
{% extends "@ChillMain/layout.html.twig" %}
{% import '@ChillThirdParty/ThirdPartyDuplicate/_details.html.twig' as details %}
{% block title %}{{ 'thirdparty_duplicate.Thirdparty duplicate title'|trans ~ ' ' ~ thirdparty.name }}{% endblock %}
{% block content %}
<style>
div.duplicate-content {
margin: 0 2rem;
}
div.col {
padding: 1em;
border: 3px solid #cccccc;
}
div.border {
border: 4px solid #3c9f8d;
}
</style>
<div class="container-fluid content"><div class="duplicate-content">
<h1>{{ 'thirdparty_duplicate.title'|trans }}</h1>
<div class="col-md-11">
<p><b>{{ 'thirdparty_duplicate.Thirdparty to delete'|trans }}</b>:
{{ 'thirdparty_duplicate.Thirdparty to delete explanation'|trans }}
</p>
<div class="col">
<h1><span><a class="btn btn-show" target="_blank" title="{{ 'Open in another window'|trans }}" href="{{ path('chill_crud_3party_3party_view', { id : thirdparty2.id }) }}"></a></span>
{{ thirdparty2 }}
</h1>
<h4>{{ 'Deleted datas'|trans ~ ':' }}</h4>
{{ details.details(thirdparty2) }}
{# <h4>{{ 'Moved links'|trans ~ ':' }}</h4>#}
{# {{ details.links(thirdparty2) }}#}
</div>
</div>
<div class="col-md-11 mt-3">
<p><b>{{ 'thirdparty_duplicate.Thirdparty to keep'|trans }}</b>:
{{ 'thirdparty_duplicate.Thirdparty to keep explanation'|trans }}
</p>
<div class="col border">
<h1><span><a class="btn btn-show" target="_blank" title="{{ 'Open in another window'|trans }}" href="{{ path('chill_crud_3party_3party_view', { id : thirdparty.id }) }}"></a></span>
{{ thirdparty }}
</h1>
<h4>{{ 'thirdparty_duplicate.Data to keep'|trans ~ ':' }}</h4>
{{ details.details(thirdparty) }}
{# <h4>{{ 'thirdparty_duplicate.links to keep'|trans ~ ':' }}</h4>#}
{# {{ sidepane.links(thirdparty) }}#}
</div>
</div>
{{ form_start(form) }}
<div class="col-md-12 centered">
<div class="container-fluid" style="padding-top: 1em;">
<div class="clear" style="padding-top: 10px;">
{{ form_widget(form.confirm) }}
</div>
<div class="col-11">
{{ form_label(form.confirm) }}
</div>
</div>
</div>
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('chill_thirdparty_find_duplicate', {thirdparty_id : thirdparty.id}) }}" class="btn btn-cancel">
{{ 'Cancel'|trans }}
</a>
</li>
<li>
<a href="{{ path('chill_thirdparty_duplicate_confirm', { thirdparty1_id : thirdparty2.id, thirdparty2_id : thirdparty.id }) }}"
class="btn btn-action">
<i class="fa fa-exchange"></i>
{{ 'Invert'|trans }}
</a>
</li>
<li>
<button class="btn btn-submit" type="submit"><i class="fa fa-cog fa-fw"></i>{{ 'Merge'|trans }}</button>
</li>
</ul>
{{ form_end(form) }}
</div></div>
{% endblock %}

View File

@@ -0,0 +1,38 @@
{% extends "@ChillMain/layout.html.twig" %}
{% set activeRouteKey = 'chill_thirdparty_duplicate' %}
{% block title %}{{ 'thirdparty_duplicate.find'|trans ~ ' ' ~ thirdparty.name|capitalize }}{% endblock %}
{% block content %}
<div class="person-duplicate">
<h1>{{ 'thirdparty_duplicate.find'|trans }}</h1>
{{ form_start(form) }}
{{ form_rest(form) }}
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('chill_crud_3party_3party_view', {'id' : thirdparty.id}) }}" class="btn btn-cancel">
{{ 'Return'|trans }}
</a>
</li>
<li>
<button class="btn btn-submit" type="submit">{{ 'Next'|trans }}</button>
</li>
</ul>
{{ form_end(form) }}
</div>
{% endblock %}
{% block js %}
{{ encore_entry_script_tags('mod_pickentity_type') }}
{% endblock %}
{% block css %}
{{ encore_entry_link_tags('mod_pickentity_type') }}
{% endblock %}