{% form_theme form '@SyliusUi/Form/imageTheme.html.twig' %}
{% form_theme form.reductionTaxons '@SyliusUi/Form/customAutocompleteTheme.html.twig' %}
{% form_theme form.reductionProducts '@SyliusUi/Form/customAutocompleteTheme.html.twig' %}
{% form_theme form.doctor.programs '@SyliusUi/Form/customAutocompleteTheme.html.twig' %}
{{ form_errors(form) }}
<div class="ui two column stackable grid">
<div class="column">
<div class="ui segment">
<h4 class="ui dividing header">{{ 'sylius.ui.customer_details'|trans }}</h4>
<div class="two fields">
{{ form_row(form.firstName) }}
{{ form_row(form.lastName) }}
</div>
{{ form_row(form.email) }}
{{ form_row(form.doctor.attachedClinicalManager) }}
{{ form_row(form.doctor.requiresValidationByClinicalManager) }}
{{ form_row(form.attachedPDM) }}
{{ form_row(form.doctor.sendTransactionalEmails) }}
<div class="field" id="add-avatar">
<label>{{ 'app.ui.avatar_with_recommended_size'|trans }}</label>
{{ form_row(form.image, {'label': false}) }}
</div>
</div>
<div class="ui segment">
<h4 class="ui dividing header">{{ 'sylius.ui.extra_information'|trans }}</h4>
{{ form_row(form.birthday) }}
{{ form_row(form.phoneNumber) }}
{{ form_row(form.subscribedToNewsletter) }}
<div class="two fields">
{{ form_row(form.company) }}
{{ form_row(form.socialReason) }}
</div>
{{ form_row(form.interCommunityTvaNumber) }}
<div class="two fields">
{{ form_row(form.city) }}
{{ form_row(form.country) }}
</div>
{{ form_row(form.secondaryEmails) }}
</div>
</div>
<div class="column">
{#
<div class="ui segment">
<h4 class="ui dividing header">{{ 'app.ui.appointment_management'|trans }}</h4>
{{ form_row(form.doctor.makesAppointmentsOnExternalPlatform) }}
{{ form_row(form.doctor.externalPlatformName) }}
{{ form_row(form.doctor.externalPlatformLink) }}
</div>
#}
<div class="ui segment">
<h4 class="ui dividing header">{{ 'app.ui.programs'|trans }}</h4>
{{ form_row(form.doctor.programs) }}
</div>
<div class="ui segment">
<h4 class="ui dividing header">
<i class="mobile alternate icon"></i>
{{ 'app.ui.seriderm_360'|trans }}
</h4>
<div class="ui info message" style="margin-bottom: 1rem;">
<i class="info circle icon"></i>
{{ 'app.ui.seriderm_360_access_hint'|trans }}
</div>
{{ form_row(form.doctor.appAccessSeriderm360) }}
</div>
<div class="ui segment">
<h4 class="ui dividing header">{{ 'sylius.ui.account_credentials'|trans }}</h4>
{% if customer.user is empty or customer.user.id is null %}
<div class="field">
<div class="ui toggle checkbox" style="display: none;">
{{ form_row(form.createUser) }}
</div>
</div>
{% endif %}
{% if form.user is defined %}
<div id="user-form" {% if form.user.vars.data.id is not defined %} style="display: none" {% endif %}>
{{ form_row(form.user.plainPassword, {'attr': {'autocomplete': 'new-password'}}) }}
{{ form_row(form.user.enabled) }}
{{ form_row(form.user.locked) }}
</div>
{% endif %}
</div>
<div class="ui segment">
<h4 class="ui dividing header">{{ 'sylius.ui.shipping_address'|trans }}</h4>
{% if form.shippingAddress.vars.data is not null %}
{% include '@SyliusShop/Common/_address.html.twig' with {'address': form.shippingAddress.vars.data} %}
{% endif %}
</div>
<div class="ui segment">
<h4 class="ui dividing header">{{ 'sylius.ui.billing_address'|trans }}</h4>
{% if form.billingAddress.vars.data is not null %}
{% include '@SyliusShop/Common/_address.html.twig' with {'address': form.billingAddress.vars.data} %}
{% endif %}
</div>
<div class="ui segment">
<h4 class="ui dividing header">{{ 'app.ui.reduction_taxons'|trans }}</h4>
{{ form_row(form.reductionTaxons) }}
</div>
<div class="ui segment">
<h4 class="ui dividing header">{{ 'app.ui.reduction_products'|trans }}</h4>
{{ form_row(form.reductionProducts) }}
</div>
</div>
</div>
{% block javascripts %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js" integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
(function () {
// Edit form action
const formEl = document.querySelector('form[name="sylius_customer"]');
formEl.setAttribute('action', "{{ app.request.pathInfo }}");
document.querySelectorAll('.taxon-selects').forEach(function(selectEl,index){
selectEl.addEventListener('change', (event) => {
$('#sylius_customer_reductionProducts_'+index+'_products').parent().dropdown('clear');
});
});
const addButtonEl = document.querySelector('#sylius_customer_reductionProducts > [data-form-collection="add"]');
addButtonEl.addEventListener("click", function (e) {
setTimeout(() => {
document.querySelectorAll('.taxon-selects').forEach(function(selectEl,index){
selectEl.addEventListener('change', (event) => {
$('#sylius_customer_reductionProducts_'+index+'_products').parent().dropdown('clear');
});
});
}, '1')
});
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('form').forEach(function(form) {
form.setAttribute('autocomplete', 'off');
});
});
})();
</script>
<script>
// Display / hide requiresValidationByClinicalManager field depending on attachedClinicalManager value
const attachedClinicalManagerEl = document.querySelector('#sylius_customer_doctor_attachedClinicalManager');
const requiresValidationByClinicalManagerEl = document.querySelector('#sylius_customer_doctor_requiresValidationByClinicalManager');
const toggleRequiresValidationByClinicalManager = () => {
if (attachedClinicalManagerEl.value !== '') {
requiresValidationByClinicalManagerEl.closest('.field').style.display = 'block';
} else {
requiresValidationByClinicalManagerEl.closest('.field').style.display = 'none';
requiresValidationByClinicalManagerEl.checked = false;
}
};
attachedClinicalManagerEl.addEventListener('change', toggleRequiresValidationByClinicalManager);
toggleRequiresValidationByClinicalManager();
</script>
<script>
// Display / hide externalPlatformNameEl, externalPlatformLinkEl fields depending on makesAppointmentsOnExternalPlatform value
const makesAppointmentsOnExternalPlatformEl = document.querySelector('#sylius_customer_doctor_makesAppointmentsOnExternalPlatform');
const externalPlatformNameEl = document.querySelector('#sylius_customer_doctor_externalPlatformName');
const externalPlatformLinkEl = document.querySelector('#sylius_customer_doctor_externalPlatformLink');
const toggleMakesAppointmentsOnExternalPlatform = () => {
if (makesAppointmentsOnExternalPlatformEl.checked) {
externalPlatformNameEl.closest('.field').style.display = 'block';
externalPlatformLinkEl.closest('.field').style.display = 'block';
} else {
externalPlatformNameEl.value = '';
externalPlatformLinkEl.value = '';
externalPlatformNameEl.closest('.field').style.display = 'none';
externalPlatformLinkEl.closest('.field').style.display = 'none';
}
};
if (makesAppointmentsOnExternalPlatformEl !== null) {
makesAppointmentsOnExternalPlatformEl.addEventListener('change', toggleMakesAppointmentsOnExternalPlatform);
toggleMakesAppointmentsOnExternalPlatform();
}
</script>
<script>
window.addEventListener('DOMContentLoaded', () => {
// Check the createUser checkbox when the page is loaded
const createUserEl = document.querySelector('#sylius_customer_createUser');
if (createUserEl) {
createUserEl.checked = true;
const userFormEl = document.querySelector('#user-form');
if (userFormEl) {
userFormEl.style.display = 'block';
}
}
});
</script>
{% endblock %}