app/template/admin/Customer/edit.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% extends '@admin/default_frame.twig' %}
  9. {% set menus = ['customer', 'customer_edit'] %}
  10. {% block title %}{{ 'admin.customer.customer_registration'|trans }}{% endblock %}
  11. {% block sub_title %}{{ 'admin.customer.customer_management'|trans }}{% endblock %}
  12. {% form_theme form '@admin/Form/bootstrap_4_horizontal_layout.html.twig' %}
  13. {% block javascript %}
  14.     <script src="//yubinbango.github.io/yubinbango/yubinbango.js" charset="UTF-8"></script>
  15. {% endblock javascript %}
  16. {% block main %}
  17.     <form name="customer_form" role="form" id="customer_form" method="post" class="h-adr"
  18.           action="{%- if Customer.id %}{{ url('admin_customer_edit', { id : Customer.id }) }}{% else %}{{ url('admin_customer_new') }}{% endif -%}"
  19.           novalidate>
  20.         <span class="p-country-name" style="display:none;">Japan</span>
  21.         {{ form_widget(form._token) }}
  22.         <div class="c-contentsArea__cols">
  23.             <div class="c-contentsArea__primaryCol">
  24.                 <div class="c-primaryCol">
  25.                     <div class="card rounded border-0 mb-4">
  26.                         <div class="card-header">
  27.                             <div class="row">
  28.                                 <div class="col-8"><span class="card-title">{{ 'admin.customer.customer_info'|trans }}</span>
  29.                                 </div>
  30.                                 <div class="col-4 text-end">
  31.                                     <a data-bs-toggle="collapse" href="#ordererInfo"
  32.                                        aria-expanded="false" aria-controls="ordererInfo">
  33.                                         <i class="fa fa-angle-up fa-lg"></i>
  34.                                     </a>
  35.                                 </div>
  36.                             </div>
  37.                         </div>
  38.                         <div class="collapse show ec-cardCollapse" id="ordererInfo">
  39.                             <div class="card-body">
  40.                                 {% if Customer.id %}
  41.                                     <div class="row mb-2">
  42.                                         <div class="col-3">
  43.                                             <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top"
  44.                                                  title="{{ 'tooltip.customer.customer_id'|trans }}">
  45.                                                 <span>{{ 'admin.customer.customer_id'|trans }}</span>
  46.                                                 <i class="fa fa-question-circle fa-lg ms-1"></i>
  47.                                             </div>
  48.                                         </div>
  49.                                         <div class="col">
  50.                                             <p>{{ Customer.id }}</p>
  51.                                         </div>
  52.                                     </div>
  53.                                 {% endif %}
  54.                                 <div class="row mb-2">
  55.                                     <div class="col-3">
  56.                                         <span>{{ 'admin.common.name'|trans }}</span>
  57.                                         <span class="badge bg-primary ms-1">{{ 'admin.common.required'|trans }}</span>
  58.                                     </div>
  59.                                     <div class="col">
  60.                                         <div class="row">
  61.                                             <div class="col">
  62.                                                 {{ form_widget(form.name.name01) }}
  63.                                             </div>
  64.                                             <div class="col">
  65.                                                 {{ form_widget(form.name.name02) }}
  66.                                             </div>
  67.                                         </div>
  68.                                         <div class="row">
  69.                                             <div class="col">
  70.                                                 {{ form_errors(form.name.name01) }}
  71.                                             </div>
  72.                                             <div class="col">
  73.                                                 {{ form_errors(form.name.name02) }}
  74.                                             </div>
  75.                                         </div>
  76.                                     </div>
  77.                                 </div>
  78.                                 <div class="row mb-2">
  79.                                     <div class="col-3">
  80.                                         <span>{{ 'admin.common.kana'|trans }}</span>
  81.                                         {# <span class="badge bg-primary ms-1">{{ 'admin.common.required'|trans }}</span> #}
  82.                                     </div>
  83.                                     <div class="col">
  84.                                         <div class="row">
  85.                                             <div class="col">
  86.                                                 {{ form_widget(form.kana.kana01) }}
  87.                                             </div>
  88.                                             <div class="col">
  89.                                                 {{ form_widget(form.kana.kana02) }}
  90.                                             </div>
  91.                                         </div>
  92.                                         <div class="row">
  93.                                             <div class="col">
  94.                                                 {{ form_errors(form.kana.kana01) }}
  95.                                             </div>
  96.                                             <div class="col">
  97.                                                 {{ form_errors(form.kana.kana02) }}
  98.                                             </div>
  99.                                         </div>
  100.                                     </div>
  101.                                 </div>
  102.                                 <div class="row mb-2">
  103.                                     <div class="col-3">
  104.                                         <span>{{ 'admin.common.company_name'|trans }}</span>
  105.                                     </div>
  106.                                     <div class="col">
  107.                                         {{ form_widget(form.company_name) }}
  108.                                         {{ form_errors(form.company_name) }}
  109.                                     </div>
  110.                                 </div>
  111.                                 <div class="row mb-2">
  112.                                     <div class="col-3"><span>{{ 'admin.common.address'|trans }}</span><span
  113.                                                 class="badge bg-primary ms-1">{{ 'admin.common.required'|trans }}</span>
  114.                                     </div>
  115.                                     <div class="col">
  116.                                         <div class="mb-3">
  117.                                             <div class="row justify-content-start">
  118.                                                 <div class="col-auto pe-0 align-self-center"><span>{{ 'admin.common.postal_symbol'|trans }}</span></div>
  119.                                                 <div class="col-2">
  120.                                                     {{ form_widget(form.postal_code) }}
  121.                                                 </div>
  122.                                             </div>
  123.                                             <div class="row">
  124.                                                 <div class="col">
  125.                                                     {{ form_errors(form.postal_code) }}
  126.                                                 </div>
  127.                                             </div>
  128.                                         </div>
  129.                                         <div class="mb-3">
  130.                                             <div class="row justify-content-start">
  131.                                                 <div class="col-auto">
  132.                                                     {{ form_widget(form.address.pref) }}
  133.                                                     {{ form_errors(form.address.pref) }}
  134.                                                 </div>
  135.                                             </div>
  136.                                         </div>
  137.                                         <div class="mb-3">
  138.                                             {{ form_widget(form.address.addr01, { attr : { placeholder : 'admin.common.address_sample_01' }} ) }}
  139.                                             {{ form_errors(form.address.addr01) }}
  140.                                         </div>
  141.                                         <div class="mb-3">
  142.                                             {{ form_widget(form.address.addr02, { attr : { placeholder : 'admin.common.address_sample_02' }}) }}
  143.                                             {{ form_errors(form.address.addr02) }}
  144.                                         </div>
  145.                                     </div>
  146.                                 </div>
  147.                                 <div class="row mb-2">
  148.                                     <div class="col-3">
  149.                                         <span>{{ 'admin.common.mail_address'|trans }}</span>
  150.                                         <span class="badge bg-primary ms-1">{{ 'admin.common.required'|trans }}</span>
  151.                                     </div>
  152.                                     <div class="col">
  153.                                         {{ form_widget(form.email) }}
  154.                                         {{ form_errors(form.email) }}
  155.                                     </div>
  156.                                 </div>
  157.                                 <div class="row mb-2">
  158.                                     <div class="col-3">
  159.                                         <span>{{ 'admin.common.phone_number'|trans }}</span>
  160.                                         <span class="badge bg-primary ms-1">{{ 'admin.common.required'|trans }}</span>
  161.                                     </div>
  162.                                     <div class="col">
  163.                                         {{ form_widget(form.phone_number) }}
  164.                                         {{ form_errors(form.phone_number) }}
  165.                                     </div>
  166.                                 </div>
  167.                                 <div class="row mb-2">
  168.                                     <div class="col-3">
  169.                                         <span>{{ 'admin.common.password'|trans }}</span>
  170.                                         <span class="badge bg-primary ms-1">{{ 'admin.common.required'|trans }}</span>
  171.                                     </div>
  172.                                     <div class="col">
  173.                                         {{ form_widget(form.plain_password.first, { type : 'password'}) }}
  174.                                         {{ form_errors(form.plain_password.first) }}
  175.                                     </div>
  176.                                 </div>
  177.                                 <div class="row mb-2">
  178.                                     <div class="col-3">
  179.                                         <span>{{ 'admin.common.password_for_confirmation'|trans }}</span>
  180.                                         <span class="badge bg-primary ms-1">{{ 'admin.common.required'|trans }}</span>
  181.                                     </div>
  182.                                     <div class="col">
  183.                                         {{ form_widget(form.plain_password.second, { type : 'password'}) }}
  184.                                         {{ form_errors(form.plain_password.second) }}
  185.                                     </div>
  186.                                 </div>
  187.                                 <div class="row mb-2">
  188.                                     <div class="col-3">
  189.                                         <span>{{ 'admin.common.gender'|trans }}</span>
  190.                                     </div>
  191.                                     <div class="col">
  192.                                         {{ form_widget(form.sex,  {'label_attr': {'class': 'radio-inline'}}) }}
  193.                                         {{ form_errors(form.sex) }}
  194.                                     </div>
  195.                                 </div>
  196.                                 <div class="row mb-2">
  197.                                     <div class="col-3">
  198.                                         <span>{{ 'admin.common.job'|trans }}</span>
  199.                                     </div>
  200.                                     <div class="col">
  201.                                         {{ form_widget(form.job) }}
  202.                                         {{ form_errors(form.job) }}
  203.                                     </div>
  204.                                 </div>
  205.                                 <div class="row mb-2">
  206.                                     <div class="col-3">
  207.                                         <span>{{ 'admin.common.birth_day'|trans }}</span>
  208.                                     </div>
  209.                                     <div class="col">
  210.                                         {{ form_widget(form.birth) }}
  211.                                         {{ form_errors(form.birth) }}
  212.                                     </div>
  213.                                 </div>
  214.                                 <div class="row mb-2">
  215.                                     <div class="col-3">
  216.                                         <span>{{ 'admin.common.point'|trans }}</span>
  217.                                     </div>
  218.                                     <div class="col">
  219.                                         {{ form_widget(form.point) }}
  220.                                         {{ form_errors(form.point) }}
  221.                                     </div>
  222.                                 </div>
  223.                                 {# エンティティ拡張の自動出力 #}
  224.                                 {% for f in form|filter(f => f.vars.eccube_form_options.auto_render) %}
  225.                                     {% if f.vars.eccube_form_options.form_theme %}
  226.                                         {% form_theme f f.vars.eccube_form_options.form_theme %}
  227.                                         {{ form_row(f) }}
  228.                                     {% else %}
  229.                                         <div class="row mb-2">
  230.                                             <div class="col-3">
  231.                                                 <span>{{ f.vars.label|trans }}</span>
  232.                                             </div>
  233.                                             <div class="col">
  234.                                                 {{ form_widget(f) }}
  235.                                                 {{ form_errors(f) }}
  236.                                             </div>
  237.                                         </div>
  238.                                     {% endif %}
  239.                                 {% endfor %}
  240.                             </div>
  241.                         </div>
  242.                     </div>
  243.                     {% if Customer.id %}
  244.                         <div class="card rounded border-0 mb-4">
  245.                             <div class="card-header">
  246.                                 <div class="row">
  247.                                     <div class="col-8">
  248.                                         <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top"
  249.                                              title="{{ 'tooltip.customer.customer_address'|trans }}">
  250.                                         <span class="card-title">
  251.                                             {{ 'admin.customer.customer_address'|trans }}
  252.                                             <i class="fa fa-question-circle fa-lg ms-1"></i>
  253.                                         </span>
  254.                                         </div>
  255.                                     </div>
  256.                                     <div class="col-4 text-end">
  257.                                         <a data-bs-toggle="collapse" href="#delivery" aria-expanded="false"
  258.                                            aria-controls="delivery">
  259.                                             <i class="fa fa-angle-up fa-lg"></i>
  260.                                         </a>
  261.                                     </div>
  262.                                 </div>
  263.                             </div>
  264.                             <div class="collapse show ec-cardCollapse" id="delivery">
  265.                                 {% if Customer.CustomerAddresses|length > 0 %}
  266.                                     <div class="card-body">
  267.                                         <table class="table table-striped table-sm">
  268.                                             <thead class="table-active">
  269.                                             <th class="align-middle pt-2 pb-2">{{ 'admin.common.name'|trans }}</th>
  270.                                             <th class="align-middle pt-2 pb-2">{{ 'admin.common.address'|trans }}</th>
  271.                                             <th class="align-middle pt-2 pb-2 pe-3">{{ 'admin.common.phone_number'|trans }}</th>
  272.                                             <th class="align-middle pt-2 pb-2 pe-3"></th>
  273.                                             </thead>
  274.                                             <tbody>
  275.                                             {% for CustomerAddress in Customer.CustomerAddresses %}
  276.                                                 <tr>
  277.                                                     <td class="align-middle">
  278.                                                         {{ CustomerAddress.name01 }}&nbsp;{{ CustomerAddress.name02 }}
  279.                                                     </td>
  280.                                                     <td class="align-middle">
  281.                                                         <a href="{{ url('admin_customer_delivery_edit', { 'id': Customer.id, 'did': CustomerAddress.id }) }}">
  282.                                                             {{ 'admin.common.postal_symbol'|trans }}{{ CustomerAddress.postal_code }} {{ CustomerAddress.Pref }}{{ CustomerAddress.addr01 }}{{ CustomerAddress.addr02 }}
  283.                                                         </a>
  284.                                                     </td>
  285.                                                     <td class="align-middle">
  286.                                                         {{ CustomerAddress.phone_number }}
  287.                                                     </td>
  288.                                                     <td>
  289.                                                         <div class="text-center" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'admin.common.delete'|trans }}">
  290.                                                             <a class="btn btn-ec-actionIcon" data-bs-toggle="modal"
  291.                                                                data-bs-target="#discontinuance-{{ CustomerAddress.id }}">
  292.                                                                 <i class="fa fa-close text-secondary"
  293.                                                                    aria-hidden="true"></i>
  294.                                                             </a>
  295.                                                         </div>
  296.                                                         <div class="modal fade" id="discontinuance-{{ CustomerAddress.id }}" tabindex="-1" role="dialog" aria-labelledby="discontinuance" aria-hidden="true">
  297.                                                             <div class="modal-dialog" role="document">
  298.                                                                 <div class="modal-content">
  299.                                                                     <div class="modal-header">
  300.                                                                         <h5 class="modal-title fw-bold">
  301.                                                                             {{ 'admin.common.delete_modal__title'|trans }}</h5>
  302.                                                                         <button class="btn-close" type="button" data-bs-dismiss="modal" aria-label="Close">
  303.                                                                         </button>
  304.                                                                     </div>
  305.                                                                     <div class="modal-body text-start">
  306.                                                                         <p class="text-start">
  307.                                                                             {{ 'admin.common.delete_modal__message'|trans({ '%name%' : 'admin.common.postal_symbol'|trans ~ CustomerAddress.postal_code ~ CustomerAddress.Pref ~ ' ' ~ CustomerAddress.name01 ~ CustomerAddress.name02 }) }}</p>
  308.                                                                     </div>
  309.                                                                     <div class="modal-footer">
  310.                                                                         <button class="btn btn-ec-sub" type="button" data-bs-dismiss="modal">
  311.                                                                             {{ 'admin.common.cancel'|trans }}
  312.                                                                         </button>
  313.                                                                         <a href="{{ url('admin_customer_delivery_delete', {'id' : Customer.id, 'did':  CustomerAddress.id}) }}" class="btn btn-ec-delete"{{ csrf_token_for_anchor() }} data-method="delete" data-confirm="false">
  314.                                                                             {{ 'admin.common.delete'|trans }}
  315.                                                                         </a>
  316.                                                                     </div>
  317.                                                                 </div>
  318.                                                             </div>
  319.                                                         </div>
  320.                                                     </td>
  321.                                                 </tr>
  322.                                             {% endfor %}
  323.                                             </tbody>
  324.                                         </table>
  325.                                         {# TODO: 新規追加ボタンと文言のデザインを整える #}
  326.                                         {% if Customer.CustomerAddresses|length < eccube_config.eccube_deliv_addr_max %}
  327.                                             <div class="d-block text-center">
  328.                                                 <a href="{{ url('admin_customer_delivery_new', { id: Customer.id }) }}"
  329.                                                    class="btn btn-ec-regular">{{ 'admin.customer.customer_address__add'|trans }}</a>
  330.                                             </div>
  331.                                         {% else %}
  332.                                             <span class="ec-errorMessage">
  333.                                                 {{ 'admin.customer.customer_address_count_is_over'|trans({"%eccube_deliv_addr_max%":eccube_config.eccube_deliv_addr_max}) }}
  334.                                             </span>
  335.                                         {% endif %}
  336.                                     </div>
  337.                                 {% else %}
  338.                                     <div class="card-body">
  339.                                         <div id="address_box" class="data-empty">
  340.                                             <span>{{ 'admin.customer.no_customer_address'|trans }}</span>
  341.                                         </div>
  342.                                         <div class="d-block text-center">
  343.                                             <a href="{{ url('admin_customer_delivery_new', { id: Customer.id }) }}"
  344.                                                class="btn btn-ec-regular">{{ 'admin.customer.customer_address__add'|trans }}</a>
  345.                                         </div>
  346.                                     </div>
  347.                                 {% endif %}
  348.                             </div>
  349.                         </div>
  350.                     {% endif %}
  351.                     {% if Customer.id %}
  352.                         <div class="card rounded border-0 mb-4">
  353.                             <div class="card-header">
  354.                                 <div class="row">
  355.                                     <div class="col-8">
  356.                                         <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top"
  357.                                              title="{{ 'tooltip.customer.purchase_history'|trans }}">
  358.                                         <span class="card-title">
  359.                                             {{ 'admin.customer.purchase_history'|trans }}
  360.                                             <i class="fa fa-question-circle fa-lg ms-1"></i>
  361.                                         </span>
  362.                                         </div>
  363.                                     </div>
  364.                                     <div class="col-4 text-end">
  365.                                         <a data-bs-toggle="collapse" href="#orderHistory" aria-expanded="false"
  366.                                            aria-controls="orderHistory">
  367.                                             <i class="fa fa-angle-up fa-lg"></i>
  368.                                         </a>
  369.                                     </div>
  370.                                 </div>
  371.                             </div>
  372.                             <div class="collapse show ec-cardCollapse" id="orderHistory">
  373.                                 {% if Customer.Orders|length > 0 %}
  374.                                     <div class="card-body">
  375.                                         <div class="row justify-content-between mb-2">
  376.                                             <div class="col-6">
  377.                                             </div>
  378.                                             <div class="col-5 text-end">
  379.                                                 <div class="d-inline-block me-2 align-bottom">
  380.                                                     <div>
  381.                                                         <select class="form-select" onchange="location = this.value;">
  382.                                                             {% for pageMax in pageMaxis %}
  383.                                                                 <option {% if pageMax.name == page_count %}selected=""{% endif %} value="{{ path('admin_customer_edit', {'id':Customer.id, 'page_no': 1, 'page_count': pageMax.name}) }}">{{ 'admin.common.count'|trans({ '%count%': pageMax.name }) }}</option>
  384.                                                             {% endfor %}
  385.                                                         </select>
  386.                                                     </div>
  387.                                                 </div>
  388.                                             </div>
  389.                                         </div>
  390.                                         <table class="table table-striped table-sm">
  391.                                             <thead class="table-active">
  392.                                             <th class="align-middle pt-2 pb-2 ps-3">{{ 'admin.order.order_date'|trans }}</th>
  393.                                             <th class="align-middle pt-2 pb-2">{{ 'admin.order.order_no'|trans }}</th>
  394.                                             <th class="align-middle pt-2 pb-2">{{ 'admin.order.purchase_price'|trans }}</th>
  395.                                             <th class="align-middle pt-2 pb-2 pe-3">{{ 'admin.order.order_status'|trans }}</th>
  396.                                             </thead>
  397.                                             <tbody>
  398.                                             {% for Order in pagination %}
  399.                                                 <tr>
  400.                                                     <td class="align-middle ps-3">{{ Order.order_date|date_min }}</td>
  401.                                                     <td class="align-middle">
  402.                                                         <a href="{{ url('admin_order_edit', { 'id' : Order.id }) }}">
  403.                                                             {{ Order.order_no }}
  404.                                                         </a>
  405.                                                     </td>
  406.                                                     <td class="align-middle">{{ Order.total|price }}</td>
  407.                                                     <td class="align-middle pe-3">
  408.                                                         <span class="badge badge-ec-blue" style="background-color: #fff; color: {{ Order.OrderStatusColor }}; border-color: {{ Order.OrderStatusColor }}">{{ Order.OrderStatus }}</span>
  409.                                                     </td>
  410.                                                 </tr>
  411.                                             {% endfor %}
  412.                                             </tbody>
  413.                                         </table>
  414.                                         {% if pagination.totalItemCount > 0 %}
  415.                                                 <div class="row justify-content-md-center pb-4">
  416.                                                     {% include "@admin/pager.twig" with { 'id':Customer.id, 'pages' : pagination.paginationData, 'routes' : 'admin_customer_edit' } %}
  417.                                                 </div>
  418.                                             {% endif %}
  419.                                     </div>
  420.                                 {% else %}
  421.                                     <div class="card-body">
  422.                                         <div id="history_box" class="data-empty">
  423.                                         <span>
  424.                                             {{ 'admin.customer.no_purchase_history'|trans }}
  425.                                         </span>
  426.                                         </div>
  427.                                     </div>
  428.                                 {% endif %}
  429.                             </div>
  430.                         </div>
  431.                     {% endif %}
  432.                     <div class="card rounded border-0 mb-4">
  433.                         <div class="card-header">
  434.                             <div class="row">
  435.                                 <div class="col-8">
  436.                                     <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top"
  437.                                          title="{{ 'tooltip.customer.shop_memo'|trans }}">
  438.                                         <span class="card-title">{{ 'admin.common.shop_memo'|trans }}</span>
  439.                                         <i class="fa fa-question-circle fa-lg ms-1"></i>
  440.                                     </div>
  441.                                 </div>
  442.                                 <div class="col-4 text-end">
  443.                                     <a data-bs-toggle="collapse" href="#shopMemo" aria-expanded="false"
  444.                                        aria-controls="shopMemo">
  445.                                         <i class="fa fa-angle-up fa-lg"></i>
  446.                                     </a>
  447.                                 </div>
  448.                             </div>
  449.                         </div>
  450.                         <div class="collapse show ec-cardCollapse" id="shopMemo">
  451.                             <div class="card-body">
  452.                                 {{ form_widget(form.note, { 'attr': { 'row': 8 }}) }}
  453.                                 {{ form_errors(form.note) }}
  454.                             </div>
  455.                         </div>
  456.                     </div>
  457.                 </div>
  458.             </div>
  459.         </div>
  460.         <div class="c-conversionArea">
  461.             <div class="c-conversionArea__container">
  462.                 <div class="row justify-content-between align-items-center">
  463.                     <div class="col-6">
  464.                         <div class="c-conversionArea__leftBlockItem">
  465.                             <a class="c-baseLink"
  466.                                href="{{ url('admin_customer_page', { page_no : app.session.get('eccube.admin.customer.search.page_no')|default('1') } ) }}?resume=1">
  467.                                 <i class="fa fa-backward" aria-hidden="true"></i>
  468.                                 <span>{{ 'admin.customer.customer_list'|trans }}</span>
  469.                             </a>
  470.                         </div>
  471.                     </div>
  472.                     <div class="col-6">
  473.                         <div id="ex-conversion-action" class="row align-items-center justify-content-end">
  474.                             <div class="col-auto">
  475.                                 {{ form_widget(form.status) }}
  476.                                 {{ form_errors(form.status) }}
  477.                             </div>
  478.                             <div class="col-auto">
  479.                                 <button class="btn btn-ec-conversion px-5"
  480.                                         type="submit">{{ 'admin.common.registration'|trans }}</button>
  481.                             </div>
  482.                         </div>
  483.                     </div>
  484.                 </div>
  485.             </div>
  486.         </div>
  487.     </form>
  488. {% endblock %}