templates/bundles/SyliusAdminBundle/Doctor/_form.html.twig line 1

Open in your IDE?
  1. {% form_theme form '@SyliusUi/Form/imageTheme.html.twig' %}
  2. {% form_theme form.reductionTaxons '@SyliusUi/Form/customAutocompleteTheme.html.twig' %}
  3. {% form_theme form.reductionProducts '@SyliusUi/Form/customAutocompleteTheme.html.twig' %}
  4. {% form_theme form.doctor.programs '@SyliusUi/Form/customAutocompleteTheme.html.twig' %}
  5. {{ form_errors(form) }}
  6. <div class="ui two column stackable grid">
  7.     <div class="column">
  8.         <div class="ui segment">
  9.             <h4 class="ui dividing header">{{ 'sylius.ui.customer_details'|trans }}</h4>
  10.             <div class="two fields">
  11.                 {{ form_row(form.firstName) }}
  12.                 {{ form_row(form.lastName) }}
  13.             </div>
  14.             {{ form_row(form.email) }}
  15.             {{ form_row(form.doctor.attachedClinicalManager) }}
  16.             {{ form_row(form.doctor.requiresValidationByClinicalManager) }}
  17.             {{ form_row(form.attachedPDM) }}
  18.             {{ form_row(form.doctor.sendTransactionalEmails) }}
  19.             <div class="field" id="add-avatar">
  20.                 <label>{{ 'app.ui.avatar_with_recommended_size'|trans }}</label>
  21.                 {{ form_row(form.image, {'label': false}) }}
  22.             </div>
  23.         </div>
  24.         <div class="ui segment">
  25.             <h4 class="ui dividing header">{{ 'sylius.ui.extra_information'|trans }}</h4>
  26.             {{ form_row(form.birthday) }}
  27.             {{ form_row(form.phoneNumber) }}
  28.             {{ form_row(form.subscribedToNewsletter) }}
  29.             <div class="two fields">
  30.                 {{ form_row(form.company) }}
  31.                 {{ form_row(form.socialReason) }}
  32.             </div>
  33.             {{ form_row(form.interCommunityTvaNumber) }}
  34.             <div class="two fields">
  35.                 {{ form_row(form.city) }}
  36.                 {{ form_row(form.country) }}
  37.             </div>
  38.             {{ form_row(form.secondaryEmails) }}
  39.         </div>
  40.     </div>
  41.     <div class="column">
  42.         {#
  43.         <div class="ui segment">
  44.             <h4 class="ui dividing header">{{ 'app.ui.appointment_management'|trans }}</h4>
  45.             {{ form_row(form.doctor.makesAppointmentsOnExternalPlatform) }}
  46.             {{ form_row(form.doctor.externalPlatformName) }}
  47.             {{ form_row(form.doctor.externalPlatformLink) }}
  48.         </div>
  49.         #}
  50.         <div class="ui segment">
  51.             <h4 class="ui dividing header">{{ 'app.ui.programs'|trans }}</h4>
  52.             {{ form_row(form.doctor.programs) }}
  53.         </div>
  54.         <div class="ui segment">
  55.             <h4 class="ui dividing header">
  56.                 <i class="mobile alternate icon"></i>
  57.                 {{ 'app.ui.seriderm_360'|trans }}
  58.             </h4>
  59.             <div class="ui info message" style="margin-bottom: 1rem;">
  60.                 <i class="info circle icon"></i>
  61.                 {{ 'app.ui.seriderm_360_access_hint'|trans }}
  62.             </div>
  63.             {{ form_row(form.doctor.appAccessSeriderm360) }}
  64.         </div>
  65.         <div class="ui segment">
  66.             <h4 class="ui dividing header">{{ 'sylius.ui.account_credentials'|trans }}</h4>
  67.             {% if customer.user is empty or customer.user.id is null %}
  68.                 <div class="field">
  69.                     <div class="ui toggle checkbox" style="display: none;">
  70.                         {{ form_row(form.createUser) }}
  71.                     </div>
  72.                 </div>
  73.             {% endif %}
  74.             {% if form.user is defined %}
  75.                 <div id="user-form" {% if form.user.vars.data.id is not defined %} style="display: none" {% endif %}>
  76.                     {{ form_row(form.user.plainPassword, {'attr': {'autocomplete': 'new-password'}}) }}
  77.                     {{ form_row(form.user.enabled) }}
  78.                     {{ form_row(form.user.locked) }}
  79.                 </div>
  80.             {% endif %}
  81.         </div>
  82.         <div class="ui segment">
  83.             <h4 class="ui dividing header">{{ 'sylius.ui.shipping_address'|trans }}</h4>
  84.             {% if form.shippingAddress.vars.data is not null %}
  85.                 {% include '@SyliusShop/Common/_address.html.twig' with {'address': form.shippingAddress.vars.data} %}
  86.             {% endif %}
  87.         </div>
  88.         <div class="ui segment">
  89.             <h4 class="ui dividing header">{{ 'sylius.ui.billing_address'|trans }}</h4>
  90.             {% if form.billingAddress.vars.data is not null %}
  91.                 {% include '@SyliusShop/Common/_address.html.twig' with {'address': form.billingAddress.vars.data} %}
  92.             {% endif %}
  93.         </div>
  94.         <div class="ui segment">
  95.             <h4 class="ui dividing header">{{ 'app.ui.reduction_taxons'|trans }}</h4>
  96.             {{ form_row(form.reductionTaxons) }}
  97.         </div>
  98.         <div class="ui segment">
  99.             <h4 class="ui dividing header">{{ 'app.ui.reduction_products'|trans }}</h4>
  100.             {{ form_row(form.reductionProducts) }}
  101.         </div>
  102.     </div>
  103. </div>
  104. {% block javascripts %}
  105.     <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>
  106.     <script>
  107.         (function () {
  108.             // Edit form action
  109.             const formEl = document.querySelector('form[name="sylius_customer"]');
  110.             formEl.setAttribute('action', "{{ app.request.pathInfo }}");
  111.             document.querySelectorAll('.taxon-selects').forEach(function(selectEl,index){
  112.                 selectEl.addEventListener('change', (event) => {
  113.                     $('#sylius_customer_reductionProducts_'+index+'_products').parent().dropdown('clear');
  114.                 });
  115.             });
  116.             const addButtonEl = document.querySelector('#sylius_customer_reductionProducts > [data-form-collection="add"]');
  117.             addButtonEl.addEventListener("click", function (e) {
  118.                 setTimeout(() => {
  119.                     document.querySelectorAll('.taxon-selects').forEach(function(selectEl,index){
  120.                         selectEl.addEventListener('change', (event) => {
  121.                             $('#sylius_customer_reductionProducts_'+index+'_products').parent().dropdown('clear');
  122.                         });
  123.                     });
  124.                 }, '1')
  125.             });
  126.             document.addEventListener('DOMContentLoaded', function() {
  127.                 document.querySelectorAll('form').forEach(function(form) {
  128.                     form.setAttribute('autocomplete', 'off');
  129.                 });
  130.             });
  131.         })();
  132.     </script>
  133.     <script>
  134.         // Display / hide requiresValidationByClinicalManager field depending on attachedClinicalManager value
  135.         const attachedClinicalManagerEl = document.querySelector('#sylius_customer_doctor_attachedClinicalManager');
  136.         const requiresValidationByClinicalManagerEl = document.querySelector('#sylius_customer_doctor_requiresValidationByClinicalManager');
  137.         const toggleRequiresValidationByClinicalManager = () => {
  138.             if (attachedClinicalManagerEl.value !== '') {
  139.                 requiresValidationByClinicalManagerEl.closest('.field').style.display = 'block';
  140.             } else {
  141.                 requiresValidationByClinicalManagerEl.closest('.field').style.display = 'none';
  142.                 requiresValidationByClinicalManagerEl.checked = false;
  143.             }
  144.         };
  145.         attachedClinicalManagerEl.addEventListener('change', toggleRequiresValidationByClinicalManager);
  146.         toggleRequiresValidationByClinicalManager();
  147.     </script>
  148.     <script>
  149.         // Display / hide externalPlatformNameEl, externalPlatformLinkEl fields depending on makesAppointmentsOnExternalPlatform value
  150.         const makesAppointmentsOnExternalPlatformEl = document.querySelector('#sylius_customer_doctor_makesAppointmentsOnExternalPlatform');
  151.         const externalPlatformNameEl = document.querySelector('#sylius_customer_doctor_externalPlatformName');
  152.         const externalPlatformLinkEl = document.querySelector('#sylius_customer_doctor_externalPlatformLink');
  153.         const toggleMakesAppointmentsOnExternalPlatform = () => {
  154.             if (makesAppointmentsOnExternalPlatformEl.checked) {
  155.                 externalPlatformNameEl.closest('.field').style.display = 'block';
  156.                 externalPlatformLinkEl.closest('.field').style.display = 'block';
  157.             } else {
  158.                 externalPlatformNameEl.value = '';
  159.                 externalPlatformLinkEl.value = '';
  160.                 externalPlatformNameEl.closest('.field').style.display = 'none';
  161.                 externalPlatformLinkEl.closest('.field').style.display = 'none';
  162.             }
  163.         };
  164.         if (makesAppointmentsOnExternalPlatformEl !== null) {
  165.             makesAppointmentsOnExternalPlatformEl.addEventListener('change', toggleMakesAppointmentsOnExternalPlatform);
  166.             toggleMakesAppointmentsOnExternalPlatform();
  167.         }
  168.     </script>
  169.     <script>
  170.         window.addEventListener('DOMContentLoaded', () => {
  171.             // Check the createUser checkbox when the page is loaded
  172.             const createUserEl = document.querySelector('#sylius_customer_createUser');
  173.             if (createUserEl) {
  174.                 createUserEl.checked = true;
  175.                 const userFormEl = document.querySelector('#user-form');
  176.                 if (userFormEl) {
  177.                     userFormEl.style.display = 'block';
  178.                 }
  179.             }
  180.         });
  181.     </script>
  182. {% endblock %}