Browse Source

[Backend] Export bons de commande producteurs

feature/export_comptable
Guillaume 4 years ago
parent
commit
0c2dbcb1f3
2 changed files with 10 additions and 4 deletions
  1. +2
    -2
      ShopBundle/Resources/views/backend/default/list-fields/field_toggle.html.twig
  2. +8
    -2
      ShopBundle/Resources/views/backend/default/list.html.twig

+ 2
- 2
ShopBundle/Resources/views/backend/default/list-fields/field_toggle.html.twig View File

{% trans_default_domain 'EasyAdminBundle' %} {% trans_default_domain 'EasyAdminBundle' %}


<div class="custom-control custom-switch" data-propertyname="{{ field_options.property }}"> <div class="custom-control custom-switch" data-propertyname="{{ field_options.property }}">
<input type="checkbox" class="custom-control-input" id="customSwitch{{ item.id }}" {{ value == true ? 'checked' }}>
<label class="custom-control-label" for="customSwitch{{ item.id }}">{{ 'label.true'|trans }}</label>
<input type="checkbox" class="custom-control-input" id="customSwitch{{ item.id }}-{{ field_options.property }}" {{ value == true ? 'checked' }}>
<label class="custom-control-label" for="customSwitch{{ item.id }}-{{ field_options.property }}">{{ 'label.true'|trans }}</label>
</div> </div>
{# {#



+ 8
- 2
ShopBundle/Resources/views/backend/default/list.html.twig View File

{{ _action.label is defined and not _action.label is empty ? _action.label|trans(_trans_parameters) }} {{ _action.label is defined and not _action.label is empty ? _action.label|trans(_trans_parameters) }}
</a> </a>


{% if _entity_config['list']['btn_init_export_purchase_order'] is defined %}
<a class="float-right btn-sm btn-success action-sort"
href="{{ path('easyadmin', { entity: 'Supplier', action: 'initExportPurchaseOrder' }) }}"
target="{{ _action.target }}">
<i class="fa fa-undo"></i> Réinitialiser export bons de commande
</a>
{% endif %}

{% if _entity_config['list']['edit_position'] is defined %} {% if _entity_config['list']['edit_position'] is defined %}
<a class="float-right btn-sm btn-success action-sort" <a class="float-right btn-sm btn-success action-sort"
href="{{ path('easyadmin', _request_parameters|merge({ action: 'sort' })) }}" href="{{ path('easyadmin', _request_parameters|merge({ action: 'sort' })) }}"
const newValue = this.checked; const newValue = this.checked;
const oldValue = !newValue; const oldValue = !newValue;
const propertyName = this.closest('.custom-switch').dataset.propertyname; const propertyName = this.closest('.custom-switch').dataset.propertyname;

const toggleUrl = "{{ path('easyadmin', { action: 'edit', entity: _entity_config.name, view: 'list' })|raw }}" const toggleUrl = "{{ path('easyadmin', { action: 'edit', entity: _entity_config.name, view: 'list' })|raw }}"
+ "&id=" + this.closest('tr').dataset.id + "&id=" + this.closest('tr').dataset.id
+ "&property=" + propertyName + "&property=" + propertyName
let toggleRequest = $.ajax({type: "GET", url: toggleUrl, data: {}, dataType: 'json'}); let toggleRequest = $.ajax({type: "GET", url: toggleUrl, data: {}, dataType: 'json'});


toggleRequest.done(function (response) { toggleRequest.done(function (response) {
log(response)
setFlashMessages(response.flashMessages); setFlashMessages(response.flashMessages);
}); });



Loading…
Cancel
Save