templates/website/user/receiver/receiver-form.html.twig line 1

Open in your IDE?
  1. {% from 'utils.html.twig' import ico, dateFormat %}
  2. {# MODO DE EXIBIÇÃO #}
  3. {% if receiverEdit is not defined and receiverPartnerEdit is not defined %}
  4.     {% set receiverEdit = false %}
  5.     {% set receiverPartnerEdit = false %}
  6.     {% set status = 0 %}
  7. {% else %}
  8.     {% set status = receiverEdit.status %}
  9. {% endif %}
  10. {% set formEdit = (status in [0, enum('ReceiverEnum::RELEASED')])? true : false %}
  11. {% set req = ' <em>*</em>' %}
  12. <div id="status-type-person" data-status-tipo-pessoa="{{ receiverEdit? receiverEdit.personType }}">
  13.     {% if not receiverEdit %}
  14.         <div id="modal-etapas" class="modal-etapas">
  15.             <p class="etapa" data-status="active">
  16.                 <span class="indice">
  17.                     <i class="num">1</i>
  18.                     <i class="check">{{ ico('check') }}</i>
  19.                 </span>
  20.             </p>
  21.             <p class="etapa" data-status="next">
  22.                 <span class="indice">
  23.                     <i class="num">2</i>
  24.                     <i class="check">{{ ico('check') }}</i>
  25.                 </span>
  26.             </p>
  27.             <p class="etapa hidden juridico" data-status="next">
  28.                 <span class="indice">
  29.                     <i class="num">3</i>
  30.                     <i class="check">{{ ico('check') }}</i>
  31.                 </span>
  32.             </p>
  33.             <p class="etapa hidden juridico" data-status="next">
  34.                 <span class="indice">
  35.                     <i class="num">4</i>
  36.                     <i class="check">{{ ico('check') }}</i>
  37.                 </span>
  38.             </p>
  39.             <p class="etapa js--step-bank" data-status="next">
  40.                 <span class="indice">
  41.                     <i class="num"></i>
  42.                     <i class="check">{{ ico('check') }}</i>
  43.                 </span>
  44.             </p>
  45.         </div>
  46.     {% endif %}
  47.     <form
  48.     {# EDIT #}
  49.     {% if receiverEdit %}
  50.         action="/admin/receiver/user/edit/{{ receiverEdit.id }}" method="put"
  51.     {# CREATE #}
  52.     {% else %}
  53.         action="/admin/receiver/user/register" method="post"
  54.     {% endif %}
  55.     id="formReceiver" class="form-geral form-user" novalidate data-no-reset="true">
  56.         <input type="hidden" name="user" value="{{ user.id }}">
  57.         {# STEP 1 ////////////////////////////////////////////////////////////////////// #}
  58.         <section id="receiver-info-data" class="form-step tab-data" {{ not receiverEdit? 'data-status="active"' }}>
  59.             <div class="receiver-head">
  60.                 {# TITLE FORM #}
  61.                 <span class="person">{{ getLanguage('person_informations', 'receiver') }}</span>
  62.                 <span class="company">{{ getLanguage('company_informations', 'receiver') }}</span>
  63.                 {# WARN REQUIRED #}
  64.                 <p>{{ getLanguage('required_fields', 'util')|raw }}</p>
  65.             </div>
  66.             {% include 'website/user/receiver/receiver-form-step-info.html.twig' %}
  67.             {% if receiverEdit %}
  68.                 <div class="receiver-head">
  69.                     {# TITLE FORM #}
  70.                     <span class="person">{{ getLanguage('address_data_person', 'receiver') }}</span>
  71.                     <span class="company">{{ getLanguage('address_data_company', 'receiver') }}</span>
  72.                 </div>
  73.                 {% include 'website/user/receiver/receiver-form-step-address.html.twig' %}
  74.             {% endif %}
  75.         </section>
  76.         {# -/ STEP 1 /////////////////////////////////////////////////////////////////// #}
  77.             
  78.         {# STEP 2 ////////////////////////////////////////////////////////////////////// #}
  79.         {% if not receiverEdit %}
  80.             <section id="receiver-address-data" class="form-step tab-data" {{ not receiverEdit? 'data-status="next"' }}>
  81.                 <div class="receiver-head">
  82.                     {# TITLE FORM #}
  83.                     <span class="person">{{ getLanguage('address_data_person', 'receiver') }}</span>
  84.                     <span class="company">{{ getLanguage('address_data_company', 'receiver') }}</span>
  85.                     {# WARN REQUIRED #}
  86.                     <p>{{ getLanguage('required_fields', 'util')|raw }}</p>
  87.                 </div>
  88.                 {% include 'website/user/receiver/receiver-form-step-address.html.twig' %}
  89.             </section>
  90.         {% endif %}
  91.         {# -/ STEP 2 /////////////////////////////////////////////////////////////////// #}
  92.         {# STEP 3 ////////////////////////////////////////////////////////////////////// #}
  93.         <section id="receiver-info-partner-data" class="form-step tab-data hidden juridico" {{ not receiverEdit? 'data-status="next"' }} 
  94.             data-status-partner="{{ enum('ReceiverEnum::PERSON') }}"
  95.         >
  96.             <div class="receiver-head">
  97.                 {# TITLE FORM #}
  98.                 <span>{{ getLanguage('partner_informations', 'receiver') }}</span>
  99.                 {# WARN REQUIRED #}
  100.                 <p>{{ getLanguage('required_fields', 'util')|raw }}</p>
  101.             </div>
  102.             {% 
  103.                 include 'website/user/receiver/receiver-form-step-info.html.twig' 
  104.                 with { infoType: 'Partner' }
  105.             %}
  106.             {% if receiverEdit %}
  107.                 <div class="receiver-head">
  108.                     {# TITLE FORM #}
  109.                     <span>{{ getLanguage('partner_address_data', 'receiver') }}</span>
  110.                 </div>
  111.                 {% 
  112.                     include 'website/user/receiver/receiver-form-step-address.html.twig' 
  113.                     with { addressType: 'Partner' }
  114.                 %}
  115.             {% endif %}
  116.         </section>
  117.         {# -/ STEP 3 /////////////////////////////////////////////////////////////////// #}
  118.         {# STEP 4 ////////////////////////////////////////////////////////////////////// #}
  119.         {% if not receiverEdit %}
  120.             <section id="receiver-address-partner-data" class="form-step hidden juridico" data-status="next">
  121.                 <div class="receiver-head">
  122.                     {# TITLE FORM #}
  123.                     <span>{{ getLanguage('partner_address_data', 'receiver') }}</span>
  124.                     {# WARN REQUIRED #}
  125.                     <p>{{ getLanguage('required_fields', 'util')|raw }}</p>
  126.                 </div>
  127.                 {% 
  128.                     include 'website/user/receiver/receiver-form-step-address.html.twig' 
  129.                     with { addressType: 'Partner' }
  130.                 %}
  131.             </section>
  132.         {% endif %}
  133.         {# -/ STEP 4 /////////////////////////////////////////////////////////////////// #}
  134.         {# STEP 5 ////////////////////////////////////////////////////////////////////// #}
  135.         <section id="receiver-bank-data" class="form-step tab-data js--step-bank" {{ not receiverEdit? 'data-status="next"' }}>
  136.             <div class="receiver-head">
  137.                 {# TITLE FORM #}
  138.                 <span>{{ getLanguage('bank_data', 'receiver') }}</span>
  139.                 {# WARN REQUIRED #}
  140.                 <p>{{ getLanguage('required_fields', 'util')|raw }}</p>
  141.             </div>
  142.             {% include 'website/user/receiver/receiver-form-step-bank.html.twig' %}
  143.         </section>
  144.         {# -/ STEP 5 /////////////////////////////////////////////////////////////////// #}
  145.         {# STEP 6 ////////////////////////////////////////////////////////////////////// #}
  146.         {% if receiverEdit %}
  147.             {% set internalStatusVerification = (receiverEdit.internalStatus == enum('ReceiverEnum::RELEASED') ? true : false) %}
  148.             {% if not isTrial or not internalStatusVerification %}
  149.                 {% if receiverEdit.type == enum('ReceiverEnum::EMPLOYEE') 
  150.                 and receiverEdit.user.allowReceiver == enum('ReceiverEnum::YES')
  151.                 and receiverEdit.allowTransfer == enum('ReceiverEnum::YES') %}
  152.                     <section id="receiver-transfer-data" class="form-step tab-data js--step-transfer">
  153.                         <div class="receiver-head">
  154.                             {# TITLE FORM #}
  155.                             <span>{{ getLanguage('transfer_config', 'receiver') }}</span>
  156.                             {# WARN REQUIRED #}
  157.                             <p>{{ getLanguage('required_fields', 'util')|raw }}</p>
  158.                         </div>
  159.                         {% include 'website/user/receiver/receiver-form-step-transfer.html.twig' %}
  160.                     </section>
  161.                 {% endif %}
  162.             {% endif %}
  163.         {% endif %}
  164.         {# -/ STEP 6 /////////////////////////////////////////////////////////////////// #}
  165.         {# SUBMIT DADOS #}
  166.         {% if layout == 'page' %}
  167.             <nav class="actions-confirm">
  168.                 <button type="submit" id="btnReceiverSubmit" class="btn-continuar-peq">{{ ico('check-circle') }}&emsp;{{ getLanguage('save', 'receiver') }}<i class="loader">{{ ico('loader-wish') }}</i></button>
  169.             </nav>
  170.         {# MODAL #}
  171.         {% elseif layout == 'modal' %}
  172.             <nav class="actions">
  173.                 {# TERMS #}
  174.                 <div class="wrap-check-accept hidden">
  175.                     <p>
  176.                         <input type="checkbox" id="check-accept-terms" name="check-accept-terms">
  177.                         {{ getLanguage('declare_accepted', 'receiver') }} <a href="https://docs.google.com/document/d/1sjZPiNCOkRqSTL6JE4w1YMAaG028e_ez8E4JSaBbviQ/edit" target="_blank">{{ getLanguage('user_terms', 'receiver') }}</a>.
  178.                     </p>
  179.                 </div>
  180.                 <button type="reset" class="cancel">{{ getLanguage('reset', 'receiver') }}</button>
  181.                 <button type="button" class="cancel btn-receiver-anterior hidden">
  182.                     {{ ico('arrow-left') }}&nbsp;{{ getLanguage('back', 'receiver') }}
  183.                 </button>
  184.                 <button type="button" class="btn-continuar-peq btn-receiver-proximo">
  185.                     {{ getLanguage('next', 'receiver') }}&nbsp;{{ ico('arrow-right') }}
  186.                 </button>
  187.                 <button type="submit" class="btn-continuar-peq btn-receiver-finish hidden">{{ ico('check-circle') }}&emsp;{{ getLanguage('finish', 'receiver') }}<i class="loader">{{ ico('loader-wish') }}</i></button>
  188.             
  189.             </nav>
  190.         {% endif %}
  191.     </form>
  192. </div>