if ($this->filtersForm->isSubmitted() && $this->filtersForm->isValid()) { | if ($this->filtersForm->isSubmitted() && $this->filtersForm->isValid()) { | ||||
foreach ($listFields as $field) { | foreach ($listFields as $field) { | ||||
if ($this->filtersForm->has($field['property'])) { | |||||
if ($this->filtersForm->has($field['property'])) { | |||||
switch ($field['dataType']) { | switch ($field['dataType']) { | ||||
case 'option': | case 'option': | ||||
case 'integer': | case 'integer': | ||||
foreach ($positionForm->get('entities')->getData() as $elm) { | foreach ($positionForm->get('entities')->getData() as $elm) { | ||||
$this->dispatch(EasyAdminEvents::PRE_UPDATE, ['entity' => $entity]); | $this->dispatch(EasyAdminEvents::PRE_UPDATE, ['entity' => $entity]); | ||||
$entity = $repo->find($elm['id']); | $entity = $repo->find($elm['id']); | ||||
$entity->setPosition($elm['position']); | $entity->setPosition($elm['position']); | ||||
$this->em->persist($entity); | $this->em->persist($entity); | ||||
$this->dispatch(EasyAdminEvents::POST_UPDATE, ['entity' => $entity]); | $this->dispatch(EasyAdminEvents::POST_UPDATE, ['entity' => $entity]); | ||||
$latsPos = $elm['position']; | $latsPos = $elm['position']; | ||||
} | } | ||||
dump($latsPos); | |||||
//die(); | |||||
//die(); | //die(); | ||||
//to do récupérer les élements hors ligne et incrémenter position | //to do récupérer les élements hors ligne et incrémenter position | ||||
/*foreach ($repo->findBy(array('status'=> false)) as $offlineEntity) { | /*foreach ($repo->findBy(array('status'=> false)) as $offlineEntity) { | ||||
return $this->redirectToRoute('easyadmin', ['entity' => $easyadmin['entity']['name'], 'action' => 'edit', 'id' =>$newEntity->getId(), 'referer' =>$refererUrl ]) ; | return $this->redirectToRoute('easyadmin', ['entity' => $easyadmin['entity']['name'], 'action' => 'edit', 'id' =>$newEntity->getId(), 'referer' =>$refererUrl ]) ; | ||||
} | } | ||||
public function duplicateOtherHubAction(){ | |||||
$id = $this->request->query->get('id'); | |||||
$hubAlias = $this->request->query->get('hub'); | |||||
$refererUrl = $this->request->query->get('referer', ''); | |||||
$user = $this->security->getUser() ; | |||||
$easyadmin = $this->request->attributes->get('easyadmin'); | |||||
$entity= $this->em->getRepository($easyadmin['entity']['class'])->find($id); | |||||
$hub= $this->em->getRepository(MerchantInterface::class)->findOneByDevAlias($hubAlias); | |||||
$newEntity = clone $entity ; | |||||
if($newEntity instanceof ImageInterface){ | |||||
$newEntity->setImage(null); | |||||
} | |||||
if ($hub) { | |||||
$newEntity->setMerchant($hub); | |||||
$user->setMerchant($hub); | |||||
$this->em->persist($user); | |||||
} | |||||
$this->em->persist($newEntity) ; | |||||
$this->em->flush() ; | |||||
$redirectUrl = $hub->getMerchantConfig('url').substr($this->generateUrl('easyadmin', ['entity' => $easyadmin['entity']['name'], 'action' => 'edit', 'id' =>$newEntity->getId(), 'referer' =>$refererUrl ]),1).'&hubredirection=true'; | |||||
return $this->redirect($redirectUrl) ; | |||||
} | |||||
} | } | ||||
$em->persist($user); | $em->persist($user); | ||||
$em->flush(); | $em->flush(); | ||||
return $this->redirect($merchant->getMerchantConfig('url').'admin/dashboard') ; | |||||
return $this->redirect($merchant->getMerchantConfig('url').'admin/dashboard?hubredirection=true') ; | |||||
} | } | ||||
} | } | ||||
use Lc\ShopBundle\Context\ProductFamilyInterface; | use Lc\ShopBundle\Context\ProductFamilyInterface; | ||||
use Lc\ShopBundle\Context\ReductionCatalogInterface; | use Lc\ShopBundle\Context\ReductionCatalogInterface; | ||||
use Lc\ShopBundle\Context\TaxRateInterface; | use Lc\ShopBundle\Context\TaxRateInterface; | ||||
use Lc\ShopBundle\Form\Backend\Common\AbstractEditPositionType; | |||||
use Lc\ShopBundle\Form\Backend\Common\ReductionCatalogType; | use Lc\ShopBundle\Form\Backend\Common\ReductionCatalogType; | ||||
use Lc\ShopBundle\Form\Backend\ProductFamily\ProductType; | use Lc\ShopBundle\Form\Backend\ProductFamily\ProductType; | ||||
use Lc\ShopBundle\Model\ProductFamily; | use Lc\ShopBundle\Model\ProductFamily; | ||||
//hack utilisé pour filter sur les catégories lors du tri des produits par sous cat | |||||
//A améliorer à l'occas | |||||
protected function createListQueryBuilder($entityClass, $sortDirection, $sortField = null, $dqlFilter = null) | |||||
{ | |||||
$productCategoryId = false; | |||||
if (isset($dqlFilter['productCategoryId'])) $productCategoryId = $dqlFilter['productCategoryId']; | |||||
if(isset($dqlFilter['filter']))$dqlFilter = $dqlFilter['filter']; | |||||
$queryBuilder = parent::createListQueryBuilder($entityClass, $sortDirection, $sortField, $dqlFilter); | |||||
$queryBuilder->leftJoin('entity.productCategories', 'product_categories'); | |||||
if ($productCategoryId) { | |||||
$queryBuilder->andWhere('product_categories.id = :cat'); | |||||
$queryBuilder->setParameter('cat', $productCategoryId); | |||||
} | |||||
return $queryBuilder; | |||||
} | |||||
public function sortByProductCategoryAction(){ | |||||
$this->dispatch(EasyAdminEvents::PRE_LIST); | |||||
$entity = null; | |||||
//Replace this with query builder function, do not use finAll of easyAdmin | |||||
if ($this->request->query->get('productCategoryId')) { | |||||
if(!is_array($this->entity['list']['dql_filter'])) { | |||||
$this->entity['list']['dql_filter'] = array('filter' => $this->entity['list']['dql_filter']); | |||||
} | |||||
$this->entity['list']['dql_filter']['productCategoryId'] = $this->request->query->get('productCategoryId'); | |||||
$easyadmin = $this->request->attributes->get('easyadmin'); | |||||
$entity = $easyadmin['item']; | |||||
}else{ | |||||
throw new \ErrorException('Action impossible') ; | |||||
} | |||||
if ($this->entity['list']['dql_filter']['filter']) $this->entity['list']['dql_filter']['filter'] .= sprintf(' AND entity.status = 1'); | |||||
else $this->entity['list']['dql_filter']['filter'] .= sprintf(' entity.status = 1'); | |||||
$fields = $this->entity['list']['fields']; | |||||
$paginator = $this->findAll($this->entity['class'], $this->request->query->get('page', 1), 500, 'position', 'asc', $this->entity['list']['dql_filter']); | |||||
$this->dispatch(EasyAdminEvents::POST_LIST, ['paginator' => $paginator]); | |||||
$positionForm = $this->createFormBuilder(array('entities', $paginator->getCurrentPageResults())) | |||||
->add('entities', CollectionType::class, array( | |||||
'required' => true, | |||||
'allow_add' => true, | |||||
'entry_type' => AbstractEditPositionType::class, | |||||
)) | |||||
->getForm(); | |||||
$positionForm->handleRequest($this->request); | |||||
if ($positionForm->isSubmitted() && $positionForm->isValid()) { | |||||
$class = $this->entity['class']; | |||||
$repo = $this->em->getRepository($class); | |||||
$latsPos = 0; | |||||
foreach ($positionForm->get('entities')->getData() as $elm) { | |||||
$this->dispatch(EasyAdminEvents::PRE_UPDATE, ['entity' => $entity]); | |||||
$entity = $repo->find($elm['id']); | |||||
$entity->setPosition($elm['position']); | |||||
$this->em->persist($entity); | |||||
$this->dispatch(EasyAdminEvents::POST_UPDATE, ['entity' => $entity]); | |||||
$latsPos = $elm['position']; | |||||
} | |||||
//die(); | |||||
//to do récupérer les élements hors ligne et incrémenter position | |||||
/*foreach ($repo->findBy(array('status'=> false)) as $offlineEntity) { | |||||
$latsPos++; | |||||
$offlineEntity->setPosition($latsPos); | |||||
$this->em->persist($offlineEntity); | |||||
}*/ | |||||
$this->em->flush(); | |||||
$this->addFlash('success', 'Position modifié', array(), 'mweb'); | |||||
return $this->redirectToReferrer(); | |||||
} | |||||
$parameters = [ | |||||
'paginator' => $paginator, | |||||
'fields' => $fields, | |||||
'batch_form' => $this->createBatchForm($this->entity['name'])->createView(), | |||||
'delete_form_template' => $this->createDeleteForm($this->entity['name'], '__id__')->createView(), | |||||
'postion_form' => $positionForm->createView(), | |||||
'entity' => $entity, | |||||
'sortable' => true | |||||
]; | |||||
return $this->executeDynamicMethod('render<EntityName>Template', ['sortable', "@LcShop/backend/default/sortable.html.twig", $parameters]); | |||||
} | |||||
} | } | ||||
if($this->request->isXmlHttpRequest()) { | if($this->request->isXmlHttpRequest()) { | ||||
$response['flashMessages'] = $this->utils->getFlashMessages(); | $response['flashMessages'] = $this->utils->getFlashMessages(); | ||||
return new Response(json_encode($response)); | return new Response(json_encode($response)); | ||||
}else{ | |||||
return parent::redirectToReferrer(); | |||||
} | } | ||||
} | } | ||||
use FOS\UserBundle\Model\UserManagerInterface; | use FOS\UserBundle\Model\UserManagerInterface; | ||||
use Lc\ShopBundle\Form\Backend\Ticket\TicketMessageType; | use Lc\ShopBundle\Form\Backend\Ticket\TicketMessageType; | ||||
use Lc\ShopBundle\Form\Backend\Ticket\TicketStatusType; | use Lc\ShopBundle\Form\Backend\Ticket\TicketStatusType; | ||||
use Lc\ShopBundle\Model\Ticket; | |||||
use Lc\ShopBundle\Services\UtilsManager; | use Lc\ShopBundle\Services\UtilsManager; | ||||
use Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport; | use Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport; | ||||
use Symfony\Component\HttpFoundation\Response; | use Symfony\Component\HttpFoundation\Response; | ||||
} | } | ||||
protected function createListQueryBuilder($entityClass, $sortDirection, $sortField = null, $dqlFilter = null) | |||||
{ | |||||
$queryBuilder = parent::createListQueryBuilder($entityClass, $sortDirection, $sortField, $dqlFilter); | |||||
if ($this->filtersForm->get('status')->getData() === null) { | |||||
$queryBuilder->andWhere('entity.status LIKE :open OR entity.status LIKE :beingprocessed'); | |||||
$queryBuilder->setParameter('open', Ticket::TICKET_STATUS_OPEN); | |||||
$queryBuilder->setParameter('beingprocessed', Ticket::TICKET_STATUS_BEING_PROCESSED); | |||||
} | |||||
return $queryBuilder; | |||||
} | |||||
public function showAction() | public function showAction() | ||||
{ | { | ||||
$this->dispatch(EasyAdminEvents::PRE_SHOW); | $this->dispatch(EasyAdminEvents::PRE_SHOW); |
<?php | |||||
namespace Lc\ShopBundle\EventSubscriber; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Event\EasyAdminEvents; | |||||
use Lc\ShopBundle\Context\FilterMerchantInterface; | |||||
use Lc\ShopBundle\Context\FilterMultipleMerchantsInterface; | |||||
use Lc\ShopBundle\Context\MerchantUtilsInterface; | |||||
use Lc\ShopBundle\Context\SortableInterface; | |||||
use Lc\ShopBundle\Context\StatusInterface; | |||||
use Lc\ShopBundle\Context\TreeInterface; | |||||
use Lc\ShopBundle\Services\Utils; | |||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |||||
use Symfony\Component\EventDispatcher\GenericEvent; | |||||
class InitializeEventSubscriber implements EventSubscriberInterface | |||||
{ | |||||
public $merchantUtils; | |||||
public $utils; | |||||
public function __construct(MerchantUtilsInterface $merchantUtils, Utils $utils) | |||||
{ | |||||
$this->merchantUtils = $merchantUtils; | |||||
$this->utils = $utils; | |||||
} | |||||
public static function getSubscribedEvents() | |||||
{ | |||||
return array( | |||||
'easy_admin.post_initialize' => array('postInitialize'), | |||||
); | |||||
} | |||||
public function postInitialize(GenericEvent $event) | |||||
{ | |||||
$request = $event->getArgument('request'); | |||||
if($request->query->get('hubredirection')){ | |||||
$this->utils->addFlash('alert', "Vous êtes maintenant sur le hub de ".$this->merchantUtils->getMerchantCurrent()->getTitle()); | |||||
} | |||||
} | |||||
} |
: void | : void | ||||
{ | { | ||||
dump('ncnnc'); | |||||
$level = $this->getLogLevel($evt); | $level = $this->getLogLevel($evt); | ||||
$message = $evt->getMessage(); | $message = $evt->getMessage(); | ||||
public function __toString() | public function __toString() | ||||
{ | { | ||||
return $this->getName(); | |||||
return $this->getSummary(); | |||||
} | } | ||||
public function getSummary() | public function getSummary() |
$query->innerJoin('e.products', 'pfp'); | $query->innerJoin('e.products', 'pfp'); | ||||
$query->addSelect('pfp') ; | $query->addSelect('pfp') ; | ||||
$query->orderBy('e.position', 'ASC'); | |||||
return $query ; | return $query ; | ||||
} | } | ||||
$query->setParameter('category', $category->getId()); | $query->setParameter('category', $category->getId()); | ||||
$query->andWhere('e.status = 1'); | $query->andWhere('e.status = 1'); | ||||
$query->orderBy('e.position', 'ASC'); | |||||
return $query->getQuery()->getResult() ; | return $query->getQuery()->getResult() ; | ||||
} | } |
$('#lc-flash-messages .notice').each(function (i, notice) { | $('#lc-flash-messages .notice').each(function (i, notice) { | ||||
generateNotice($(notice).find('.type').html(), $(notice).find('.message').html()); | generateNotice($(notice).find('.type').html(), $(notice).find('.message').html()); | ||||
}); | }); | ||||
$('#lc-flash-alert .modal').each(function (i, modal) { | |||||
$(modal).modal('show'); | |||||
}); | |||||
} | } | ||||
function initButtonConfirm() { | function initButtonConfirm() { |
prototype = $('#form_entities').data('prototype'); | prototype = $('#form_entities').data('prototype'); | ||||
$('.lc-sortable tr.lc-draggable').each(function (index, li) { | $('.lc-sortable tr.lc-draggable').each(function (index, li) { | ||||
// instead be a number based on how many items we have | // instead be a number based on how many items we have | ||||
var newForm = prototype.replace(/__name__/g, index); | var newForm = prototype.replace(/__name__/g, index); | ||||
$(li).append(newForm); | $(li).append(newForm); | ||||
$(li).find('#form_entities_' + index + '_id').val($(li).data('id')); | $(li).find('#form_entities_' + index + '_id').val($(li).data('id')); | ||||
if ($('.lc-sortable').data('parent-position') !== '') val = $('.lc-sortable').data('parent-position') + '.' + index | |||||
else val = index; | |||||
if ($('.lc-sortable').data('parent-position') !== '') { | |||||
//Ajout d'un 0 initial pour les nuémros <10 | |||||
indexAsString = index.toString().padStart(2, '0'); | |||||
val = $('.lc-sortable').data('parent-position') + '.' + indexAsString | |||||
} else { | |||||
val = index; | |||||
} | |||||
$(li).find('#form_entities_' + index + '_position').val(val); | $(li).find('#form_entities_' + index + '_position').val(val); | ||||
}); | }); | ||||
behaviorExpirationDate: null, | behaviorExpirationDate: null, | ||||
propertyAllergens: null, | propertyAllergens: null, | ||||
propertyOrganicLabelActive: false, | propertyOrganicLabelActive: false, | ||||
propertyOrganicLabel: null, | |||||
propertyNoveltyExpirationDateActive: false, | propertyNoveltyExpirationDateActive: false, | ||||
propertyNoveltyExpirationDate:null, | |||||
activeProducts: false, | activeProducts: false, | ||||
formProducts: {}, | formProducts: {}, | ||||
title: function () { | title: function () { | ||||
this.updateChild() | this.updateChild() | ||||
}, | }, | ||||
propertyNoveltyExpirationDateActive: function () { | |||||
if(!this.propertyNoveltyExpirationDateActive){ | |||||
this.propertyNoveltyExpirationDate = null; | |||||
} | |||||
}, | |||||
propertyOrganicLabelActive: function () { | |||||
if(!this.propertyOrganicLabelActive){ | |||||
this.propertyOrganicLabel = null; | |||||
$(this.$refs['propertyOrganicLabel']).val('').trigger('change'); | |||||
} | |||||
} | |||||
} | } | ||||
}); | }); | ||||
send: Envoyer | send: Envoyer | ||||
duplicate: Dupliquer | duplicate: Dupliquer | ||||
duplicateOtherHub: Dupliquer sur un autre hub | duplicateOtherHub: Dupliquer sur un autre hub | ||||
sortProductFamily: Trier les produits de cette catégorie | |||||
group: | group: | ||||
main: Général | main: Général | ||||
address: Adresse | address: Adresse |
{% if is_dropdown %} | {% if is_dropdown %} | ||||
<a class="btn dropdown-item {{ action.css_class|default('btn-default') }}" href="{{ action_href }}" 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> | |||||
<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 %} | {% else %} | ||||
<a class="btn {{ is_dropdown|default(false) ? 'dropdown-item' }} {{ action.css_class|default('btn-default') }}" data-toggle="tooltip" | |||||
{% if action.hub is defined %} | |||||
{% set trad = action.label~action.hub|uc_first %} | |||||
{% else %} | |||||
{% set trad = action.label %} | |||||
{% endif %} | |||||
<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) }}" | title="{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}" | ||||
href="{{ action_href }}" target="{{ action.target }}"> | |||||
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 -%} | {%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%} | ||||
</a> | </a> | ||||
{% endif %} | {% endif %} |
{% 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 %} |
{% if app.session is not null and app.session.started %} | {% if app.session is not null and app.session.started %} | ||||
{% set _flash_messages = app.session.flashbag.all %} | {% set _flash_messages = app.session.flashbag.all %} | ||||
{% if _flash_messages['alert'] is defined and _flash_messages['alert']|length > 0 %} | |||||
<div id="lc-flash-alert"> | |||||
{% for alert in _flash_messages['alert'] %} | |||||
<div class="modal fade"> | |||||
<div class="modal-dialog"> | |||||
<div class="modal-content bg-danger"> | |||||
<div class="modal-header"> | |||||
<h4 class="modal-title">{{ alert|trans|striptags }}</h4> | |||||
</div> | |||||
<div class="modal-footer align-right"> | |||||
<button type="button" data-dismiss="modal" class="btn btn-outline-light">OK</button> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
{% endfor %} | |||||
</div> | |||||
{% endif %} | |||||
{% if _flash_messages|length > 0 %} | {% if _flash_messages|length > 0 %} | ||||
<div id="lc-flash-messages"> | <div id="lc-flash-messages"> | ||||
{% for label, messages in _flash_messages %} | {% for label, messages in _flash_messages %} | ||||
{% for message in messages %} | |||||
<div class="notice"> | |||||
<span class="type">{{ label }}</span> | |||||
<span class="message"> {{ message|trans|striptags }}</span> | |||||
</div> | |||||
{% endfor %} | |||||
{% if label != 'alert' %} | |||||
{% for message in messages %} | |||||
<div class="notice"> | |||||
<span class="type">{{ label }}</span> | |||||
<span class="message"> {{ message|trans|striptags }}</span> | |||||
</div> | |||||
{% endfor %} | |||||
{% endif %} | |||||
{% endfor %} | {% endfor %} | ||||
</div> | </div> | ||||
{% endif %} | {% endif %} |
{% endif %} | {% endif %} | ||||
{% macro no_stock(behaviorStockWeek) %} | {% macro no_stock(behaviorStockWeek) %} | ||||
<span class="badge badge-danger"> | |||||
<span class="badge badge-warning"> | |||||
{{ _self.badge_stock_renewable(behaviorStockWeek) }} | {{ _self.badge_stock_renewable(behaviorStockWeek) }} | ||||
Pas de stock | Pas de stock | ||||
</span> | </span> | ||||
{% macro badge_stock_start(value) %} | {% macro badge_stock_start(value) %} | ||||
{% if value > 0 %} | {% if value > 0 %} | ||||
{% set badge_class = 'badge-success' %} | {% set badge_class = 'badge-success' %} | ||||
{% elseif value == 0%} | |||||
{% set badge_class = 'badge-warning' %} | |||||
{% else %} | {% else %} | ||||
{% set badge_class = 'badge-danger' %} | |||||
{% set badge_class = 'badge-secondary' %} | |||||
{% endif %} | {% endif %} | ||||
<span class="badge {{ badge_class }}"> | <span class="badge {{ badge_class }}"> | ||||
{% endmacro %} | {% endmacro %} |
{% 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 custom-switch-on-success custom-switch-off-danger" data-propertyname="{{ field_options.property }}"> | |||||
<input type="checkbox" class="custom-control-input" id="customSwitch{{ item.id }}-{{ field_options.property }}" {{ value == true ? 'checked' }}> | <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> | |||||
<label class="custom-control-label" for="customSwitch{{ item.id }}-{{ field_options.property }}">{{ field_options.label }}</label> | |||||
</div> | </div> | ||||
{# | {# | ||||
{% for val in value %} | |||||
<span class="badge badge-secondary">{{ val.getSummary }}</span> | |||||
{% endfor %} |
{% if item.getChildrens()|length == 0 %} | |||||
<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="{{ path('easyadmin', {action: 'sortByProductCategory', entity: 'ProductFamily', productCategoryId: item.id, referer: app.request.requestUri|url_encode }) }}" target="{{ action.target }}"> | |||||
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%} | |||||
</a> | |||||
{% endif %} |
{% if formValues.availableQuantity %}availableQuantity: "{{ formValues.availableQuantity }}",{% endif %} | {% if formValues.availableQuantity %}availableQuantity: "{{ formValues.availableQuantity }}",{% endif %} | ||||
{% if formValues.availableQuantityDefault %}availableQuantityDefault: "{{ formValues.availableQuantityDefault }}",{% endif %} | {% if formValues.availableQuantityDefault %}availableQuantityDefault: "{{ formValues.availableQuantityDefault }}",{% endif %} | ||||
{% if formValues.propertyOrganicLabel %}propertyOrganicLabelActive: true,{% endif %} | {% if formValues.propertyOrganicLabel %}propertyOrganicLabelActive: true,{% endif %} | ||||
{% if formValues.propertyOrganicLabel %}propertyOrganicLabel: "{{ formValues.propertyOrganicLabel }}",{% endif %} | |||||
{% if formValues.propertyNoveltyExpirationDate %}propertyNoveltyExpirationDateActive: true,{% endif %} | {% if formValues.propertyNoveltyExpirationDate %}propertyNoveltyExpirationDateActive: true,{% endif %} | ||||
{% if formValues.propertyNoveltyExpirationDate %}propertyNoveltyExpirationDate: "{{ formValues.propertyNoveltyExpirationDate|date('Y-m-d') }}",{% endif %} | |||||
{% if formValues.typeExpirationDate %}typeExpirationDate: "{{ formValues.typeExpirationDate }}",{% endif %} | {% if formValues.typeExpirationDate %}typeExpirationDate: "{{ formValues.typeExpirationDate }}",{% endif %} | ||||
{% if formValues.behaviorExpirationDate %}behaviorExpirationDate: "{{ formValues.behaviorExpirationDate }}",{% endif %} | {% if formValues.behaviorExpirationDate %}behaviorExpirationDate: "{{ formValues.behaviorExpirationDate }}",{% endif %} | ||||
{% if formValues.propertyExpirationDate %}propertyExpirationDate: "{{ formValues.propertyExpirationDate }}",{% endif %} | {% if formValues.propertyExpirationDate %}propertyExpirationDate: "{{ formValues.propertyExpirationDate }}",{% endif %} |
<td>{{ form_widget(form.propertyNoveltyExpirationDateActive, {"attr" : {'v-model' : 'propertyNoveltyExpirationDateActive'}}) }}</td> | <td>{{ form_widget(form.propertyNoveltyExpirationDateActive, {"attr" : {'v-model' : 'propertyNoveltyExpirationDateActive'}}) }}</td> | ||||
<td> | <td> | ||||
<div v-show="propertyNoveltyExpirationDateActive == true"> | <div v-show="propertyNoveltyExpirationDateActive == true"> | ||||
{{ form_widget(form.propertyNoveltyExpirationDate) }} | |||||
{{ form_widget(form.propertyNoveltyExpirationDate, {"attr" : {'v-model' : 'propertyNoveltyExpirationDate'}}) }} | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<td>{{ form_widget(form.propertyOrganicLabelActive, {"attr" : {'v-model' : 'propertyOrganicLabelActive' } }) }}</td> | <td>{{ form_widget(form.propertyOrganicLabelActive, {"attr" : {'v-model' : 'propertyOrganicLabelActive' } }) }}</td> | ||||
<td> | <td> | ||||
<div class="form-widget" v-show="propertyOrganicLabelActive == true"> | <div class="form-widget" v-show="propertyOrganicLabelActive == true"> | ||||
{{ form_widget(form.propertyOrganicLabel) }} | |||||
{{ form_widget(form.propertyOrganicLabel, {"attr" : {'v-model' : 'propertyOrganicLabel', 'ref': 'propertyOrganicLabel'}}) }} | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> |
{{ form_help(form.availableQuantityDefault) }} | {{ form_help(form.availableQuantityDefault) }} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<p v-show="behaviorCountStock == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY') }}' || behaviorCountStock == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') }}' "> | |||||
<p v-show="behaviorCountStock == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY') }}' || behaviorCountStock == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') }}' || behaviorCountStock == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_UNLIMITED') }}' "> | |||||
{{ product_family_macros.total_order_product_family(totalProductOrdered['total'], entity) }} | {{ product_family_macros.total_order_product_family(totalProductOrdered['total'], entity) }} | ||||
</p> | </p> | ||||
</div> | </div> |
use App\Entity\UserMerchant; | use App\Entity\UserMerchant; | ||||
use Doctrine\ORM\EntityManagerInterface; | use Doctrine\ORM\EntityManagerInterface; | ||||
use Lc\ShopBundle\Context\MerchantInterface; | |||||
use Lc\ShopBundle\Context\UserMerchantInterface; | use Lc\ShopBundle\Context\UserMerchantInterface; | ||||
use Symfony\Component\Security\Core\Security; | use Symfony\Component\Security\Core\Security; | ||||