Browse Source

Correctif

master
Fab 4 years ago
parent
commit
cba9147daf
3 changed files with 23 additions and 12 deletions
  1. +1
    -0
      ShopBundle/Controller/Backend/AdminController.php
  2. +15
    -12
      ShopBundle/Resources/views/backend/default/block/action.html.twig
  3. +7
    -0
      ShopBundle/Resources/views/backend/default/block/action_duplicate_other_hub.html.twig

+ 1
- 0
ShopBundle/Controller/Backend/AdminController.php View File

@@ -636,6 +636,7 @@ class AdminController extends EasyAdminController
$this->em->persist($newEntity) ;
$this->em->flush() ;

$this->utils->addFlash('warning', "Vous êtes maintenant sur le hub de ".$hub->getTitle());
$redirectUrl = $hub->getMerchantConfig('url').substr($this->generateUrl('easyadmin', ['entity' => $easyadmin['entity']['name'], 'action' => 'edit', 'id' =>$newEntity->getId(), 'referer' =>$refererUrl ]),1);

return $this->redirect($redirectUrl) ;

+ 15
- 12
ShopBundle/Resources/views/backend/default/block/action.html.twig View File

@@ -1,12 +1,15 @@
{% if is_dropdown %}
<a class="btn dropdown-item {{ action.css_class|default('btn-default') }}" href="{{ action_href }}{{ action.extra_param is defined ? action.extra_param : '' }}" target="{{ action.target }}">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}
</a>
{% else %}
<a class="btn {{ is_dropdown|default(false) ? 'dropdown-item' }} {{ action.css_class|default('btn-default') }}" data-toggle="tooltip"
title="{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}"
href="{{ action_href }}{{ action.extra_param is defined ? action.extra_param : '' }}" target="{{ action.target }}">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
</a>
{% endif %}
{% if is_dropdown %}
<a class="btn dropdown-item {{ action.css_class|default('btn-default') }}"
href="{{ action_href }}{{ action.hub is defined ? '&hub='~action.hub : '' }}" target="{{ action.target }}">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}
</a>
{% else %}
{% set trad = action.label~action.hub|uc_first %}
<a class="btn {{ is_dropdown|default(false) ? 'dropdown-item' }} {{ action.css_class|default('btn-default') }}"
data-toggle="tooltip"
title="{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}"
href="{{ action_href }}{{ action.hub is defined ? '&hub='~action.hub : '' }}" target="{{ action.target }}">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
</a>
{% endif %}

+ 7
- 0
ShopBundle/Resources/views/backend/default/block/action_duplicate_other_hub.html.twig View File

@@ -0,0 +1,7 @@
{% for merchant in get_merchants() %}
{% if merchant != merchantUtils.getMerchantUser %}

{% set action = action|merge({ 'hub': merchant.devAlias }) %}
{% include '@LcShop/backend/default/block/action.html.twig' %}
{% endif %}
{% endfor %}

Loading…
Cancel
Save