Ver código fonte

Merge branch 'develop'

master
Guillaume 4 anos atrás
pai
commit
9fa4eccd71
26 arquivos alterados com 319 adições e 33 exclusões
  1. +37
    -3
      ShopBundle/Controller/Backend/AdminController.php
  2. +1
    -1
      ShopBundle/Controller/Backend/MerchantController.php
  3. +98
    -0
      ShopBundle/Controller/Backend/ProductFamilyController.php
  4. +2
    -0
      ShopBundle/Controller/Backend/ReminderController.php
  5. +15
    -0
      ShopBundle/Controller/Backend/TicketController.php
  6. +47
    -0
      ShopBundle/EventSubscriber/InitializeEventSubscriber.php
  7. +7
    -0
      ShopBundle/Form/Frontend/TicketType.php
  8. +0
    -1
      ShopBundle/Listener/MailLoggerListener.php
  9. +10
    -3
      ShopBundle/Model/ProductFamily.php
  10. +1
    -1
      ShopBundle/Model/User.php
  11. +3
    -0
      ShopBundle/Repository/ProductFamilyRepository.php
  12. +4
    -0
      ShopBundle/Resources/public/js/backend/script/default/init-common.js
  13. +8
    -3
      ShopBundle/Resources/public/js/backend/script/default/init-sort.js
  14. +13
    -0
      ShopBundle/Resources/public/js/backend/script/productfamily/vuejs-product-family.js
  15. +1
    -1
      ShopBundle/Resources/translations/lcshop.fr.yaml
  16. +13
    -7
      ShopBundle/Resources/views/backend/default/block/action.html.twig
  17. +7
    -0
      ShopBundle/Resources/views/backend/default/block/action_duplicate_other_hub.html.twig
  18. +27
    -6
      ShopBundle/Resources/views/backend/default/block/flash_messages.html.twig
  19. +4
    -2
      ShopBundle/Resources/views/backend/default/list-fields/field_product_family_available_quantity.html.twig
  20. +2
    -2
      ShopBundle/Resources/views/backend/default/list-fields/field_toggle.html.twig
  21. +3
    -0
      ShopBundle/Resources/views/backend/default/list-fields/list_association_users.html.twig
  22. +8
    -0
      ShopBundle/Resources/views/backend/productcategory/action_sort_productfamily.html.twig
  23. +4
    -0
      ShopBundle/Resources/views/backend/productfamily/form.html.twig
  24. +2
    -2
      ShopBundle/Resources/views/backend/productfamily/panel_property.html.twig
  25. +1
    -1
      ShopBundle/Resources/views/backend/productfamily/panel_stock.html.twig
  26. +1
    -0
      ShopBundle/Services/MerchantUtils.php

+ 37
- 3
ShopBundle/Controller/Backend/AdminController.php Ver arquivo

@@ -176,7 +176,7 @@ class AdminController extends EasyAdminController

if ($this->filtersForm->isSubmitted() && $this->filtersForm->isValid()) {
foreach ($listFields as $field) {
if ($this->filtersForm->has($field['property'])) {
if ($this->filtersForm->has($field['property'])) {
switch ($field['dataType']) {
case 'option':
case 'integer':
@@ -344,13 +344,14 @@ class AdminController extends EasyAdminController
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'];

}
dump($latsPos);

//die();
//die();
//to do récupérer les élements hors ligne et incrémenter position
/*foreach ($repo->findBy(array('status'=> false)) as $offlineEntity) {
@@ -608,5 +609,38 @@ class AdminController extends EasyAdminController

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) ;
}

}


+ 1
- 1
ShopBundle/Controller/Backend/MerchantController.php Ver arquivo

@@ -100,7 +100,7 @@ class MerchantController extends AdminController
$em->persist($user);
$em->flush();

return $this->redirect($merchant->getMerchantConfig('url').'admin/dashboard') ;
return $this->redirect($merchant->getMerchantConfig('url').'admin/dashboard?hubredirection=true') ;
}
}


+ 98
- 0
ShopBundle/Controller/Backend/ProductFamilyController.php Ver arquivo

@@ -12,6 +12,7 @@ use Lc\ShopBundle\Context\ProductCategoryInterface;
use Lc\ShopBundle\Context\ProductFamilyInterface;
use Lc\ShopBundle\Context\ReductionCatalogInterface;
use Lc\ShopBundle\Context\TaxRateInterface;
use Lc\ShopBundle\Form\Backend\Common\AbstractEditPositionType;
use Lc\ShopBundle\Form\Backend\Common\ReductionCatalogType;
use Lc\ShopBundle\Form\Backend\ProductFamily\ProductType;
use Lc\ShopBundle\Model\ProductFamily;
@@ -439,5 +440,102 @@ class ProductFamilyController extends AdminController



//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]);
}
}


+ 2
- 0
ShopBundle/Controller/Backend/ReminderController.php Ver arquivo

@@ -37,6 +37,8 @@ class ReminderController extends AdminController
if($this->request->isXmlHttpRequest()) {
$response['flashMessages'] = $this->utils->getFlashMessages();
return new Response(json_encode($response));
}else{
return parent::redirectToReferrer();
}
}


+ 15
- 0
ShopBundle/Controller/Backend/TicketController.php Ver arquivo

@@ -7,6 +7,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Event\EasyAdminEvents;
use FOS\UserBundle\Model\UserManagerInterface;
use Lc\ShopBundle\Form\Backend\Ticket\TicketMessageType;
use Lc\ShopBundle\Form\Backend\Ticket\TicketStatusType;
use Lc\ShopBundle\Model\Ticket;
use Lc\ShopBundle\Services\UtilsManager;
use Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport;
use Symfony\Component\HttpFoundation\Response;
@@ -24,6 +25,20 @@ class TicketController extends AdminController
}


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()
{
$this->dispatch(EasyAdminEvents::PRE_SHOW);

+ 47
- 0
ShopBundle/EventSubscriber/InitializeEventSubscriber.php Ver arquivo

@@ -0,0 +1,47 @@
<?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());

}
}


}

+ 7
- 0
ShopBundle/Form/Frontend/TicketType.php Ver arquivo

@@ -81,6 +81,13 @@ class TicketType extends AbstractType
'translation_domain' => 'lcshop',
]) ;
}
else {
// captcha (honey pot)
$builder->add('body', TextType::class, [
'label' => 'Body',
'required' => false,
]) ;
}

$builder->add('subject', TextType::class, [
'label' => 'Sujet'

+ 0
- 1
ShopBundle/Listener/MailLoggerListener.php Ver arquivo

@@ -36,7 +36,6 @@ class MailLoggerUtil implements Swift_Events_SendListener
: void
{

dump('ncnnc');
$level = $this->getLogLevel($evt);
$message = $evt->getMessage();


+ 10
- 3
ShopBundle/Model/ProductFamily.php Ver arquivo

@@ -591,10 +591,17 @@ abstract class ProductFamily extends AbstractDocumentEntity implements ProductPr
{
$count = 0;

$count += (int)strlen($this->getPropertyAllergens()) > 0;
$count += (int)strlen($this->getPropertyComposition()) > 0;
$count += (int)strlen($this->getPropertyFragrances()) > 0;
$count += (int)strlen($this->getPropertyOrganicLabel()) > 0;
$count += (int)strlen($this->getPropertyWeight()) > 0;
$count += (int)strlen($this->getPropertyFragrances()) > 0;
$count += (int)strlen($this->getPropertyComposition()) > 0;
$count += (int)strlen($this->getPropertyAllergens()) > 0;
$count += (int)strlen($this->getPropertyAlcoholLevel()) > 0;
$count += (int)strlen($this->getPropertyCharacteristics()) > 0;
$count += (int)strlen($this->getPropertyFeature()) > 0;
$count += (int)strlen($this->getPropertyPackaging()) > 0;
$count += (int)strlen($this->getPropertyQuantity()) > 0;
$count += (int)strlen($this->getPropertyVariety()) > 0;
$count += (int)($this->getPropertyExpirationDate() != null);

return $count;

+ 1
- 1
ShopBundle/Model/User.php Ver arquivo

@@ -116,7 +116,7 @@ abstract class User extends UserModelFOS

public function __toString()
{
return $this->getName();
return $this->getSummary();
}

public function getSummary()

+ 3
- 0
ShopBundle/Repository/ProductFamilyRepository.php Ver arquivo

@@ -27,6 +27,8 @@ class ProductFamilyRepository extends BaseRepository implements DefaultRepositor
$query->innerJoin('e.products', 'pfp');
$query->addSelect('pfp') ;

$query->orderBy('e.position', 'ASC');

return $query ;
}

@@ -61,6 +63,7 @@ class ProductFamilyRepository extends BaseRepository implements DefaultRepositor
$query->setParameter('category', $category->getId());

$query->andWhere('e.status = 1');
$query->orderBy('e.position', 'ASC');

return $query->getQuery()->getResult() ;
}

+ 4
- 0
ShopBundle/Resources/public/js/backend/script/default/init-common.js Ver arquivo

@@ -18,6 +18,10 @@ function initNotice() {
$('#lc-flash-messages .notice').each(function (i, notice) {
generateNotice($(notice).find('.type').html(), $(notice).find('.message').html());
});

$('#lc-flash-alert .modal').each(function (i, modal) {
$(modal).modal('show');
});
}

function initButtonConfirm() {

+ 8
- 3
ShopBundle/Resources/public/js/backend/script/default/init-sort.js Ver arquivo

@@ -14,6 +14,7 @@ function initLcSortableList() {
prototype = $('#form_entities').data('prototype');

$('.lc-sortable tr.lc-draggable').each(function (index, li) {

// instead be a number based on how many items we have
var newForm = prototype.replace(/__name__/g, index);

@@ -22,9 +23,13 @@ function initLcSortableList() {

$(li).append(newForm);
$(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);
});


+ 13
- 0
ShopBundle/Resources/public/js/backend/script/productfamily/vuejs-product-family.js Ver arquivo

@@ -419,7 +419,9 @@ $(window).on('load', function () {
behaviorExpirationDate: null,
propertyAllergens: null,
propertyOrganicLabelActive: false,
propertyOrganicLabel: null,
propertyNoveltyExpirationDateActive: false,
propertyNoveltyExpirationDate:null,
activeProducts: false,

formProducts: {},
@@ -578,6 +580,17 @@ $(window).on('load', function () {
title: function () {
this.updateChild()
},
propertyNoveltyExpirationDateActive: function () {
if(!this.propertyNoveltyExpirationDateActive){
this.propertyNoveltyExpirationDate = null;
}
},
propertyOrganicLabelActive: function () {
if(!this.propertyOrganicLabelActive){
this.propertyOrganicLabel = null;
$(this.$refs['propertyOrganicLabel']).val('').trigger('change');
}
}
}
});


+ 1
- 1
ShopBundle/Resources/translations/lcshop.fr.yaml Ver arquivo

@@ -13,7 +13,7 @@ list:
send: Envoyer
duplicate: Dupliquer
duplicateOtherHub: Dupliquer sur un autre hub
sortProductFamily: Trier les produits de cette catégorie
group:
main: Général
address: Adresse

+ 13
- 7
ShopBundle/Resources/views/backend/default/block/action.html.twig Ver arquivo

@@ -1,13 +1,19 @@

{% 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 %}
<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) }}"
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 -%}
</a>
{% endif %}

+ 7
- 0
ShopBundle/Resources/views/backend/default/block/action_duplicate_other_hub.html.twig Ver arquivo

@@ -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 %}

+ 27
- 6
ShopBundle/Resources/views/backend/default/block/flash_messages.html.twig Ver arquivo

@@ -1,15 +1,36 @@
{% if app.session is not null and app.session.started %}
{% 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 %}
<div id="lc-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 %}
</div>
{% endif %}

+ 4
- 2
ShopBundle/Resources/views/backend/default/list-fields/field_product_family_available_quantity.html.twig Ver arquivo

@@ -32,7 +32,7 @@
{% endif %}

{% macro no_stock(behaviorStockWeek) %}
<span class="badge badge-danger">
<span class="badge badge-warning">
{{ _self.badge_stock_renewable(behaviorStockWeek) }}
Pas de stock
</span>
@@ -51,8 +51,10 @@
{% macro badge_stock_start(value) %}
{% if value > 0 %}
{% set badge_class = 'badge-success' %}
{% elseif value == 0%}
{% set badge_class = 'badge-warning' %}
{% else %}
{% set badge_class = 'badge-danger' %}
{% set badge_class = 'badge-secondary' %}
{% endif %}
<span class="badge {{ badge_class }}">
{% endmacro %}

+ 2
- 2
ShopBundle/Resources/views/backend/default/list-fields/field_toggle.html.twig Ver arquivo

@@ -1,8 +1,8 @@
{% 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' }}>
<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>
{#


+ 3
- 0
ShopBundle/Resources/views/backend/default/list-fields/list_association_users.html.twig Ver arquivo

@@ -0,0 +1,3 @@
{% for val in value %}
<span class="badge badge-secondary">{{ val.getSummary }}</span>
{% endfor %}

+ 8
- 0
ShopBundle/Resources/views/backend/productcategory/action_sort_productfamily.html.twig Ver arquivo

@@ -0,0 +1,8 @@

{% 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 %}

+ 4
- 0
ShopBundle/Resources/views/backend/productfamily/form.html.twig Ver arquivo

@@ -39,7 +39,11 @@
{% if formValues.availableQuantity %}availableQuantity: "{{ formValues.availableQuantity }}",{% endif %}
{% if formValues.availableQuantityDefault %}availableQuantityDefault: "{{ formValues.availableQuantityDefault }}",{% endif %}
{% if formValues.propertyOrganicLabel %}propertyOrganicLabelActive: true,{% endif %}
{% if formValues.propertyOrganicLabel %}propertyOrganicLabel: "{{ formValues.propertyOrganicLabel }}",{% 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.behaviorExpirationDate %}behaviorExpirationDate: "{{ formValues.behaviorExpirationDate }}",{% endif %}
{% if formValues.propertyExpirationDate %}propertyExpirationDate: "{{ formValues.propertyExpirationDate }}",{% endif %}

+ 2
- 2
ShopBundle/Resources/views/backend/productfamily/panel_property.html.twig Ver arquivo

@@ -17,7 +17,7 @@
<td>{{ form_widget(form.propertyNoveltyExpirationDateActive, {"attr" : {'v-model' : 'propertyNoveltyExpirationDateActive'}}) }}</td>
<td>
<div v-show="propertyNoveltyExpirationDateActive == true">
{{ form_widget(form.propertyNoveltyExpirationDate) }}
{{ form_widget(form.propertyNoveltyExpirationDate, {"attr" : {'v-model' : 'propertyNoveltyExpirationDate'}}) }}
</div>
</td>
</tr>
@@ -25,7 +25,7 @@
<td>{{ form_widget(form.propertyOrganicLabelActive, {"attr" : {'v-model' : 'propertyOrganicLabelActive' } }) }}</td>
<td>
<div class="form-widget" v-show="propertyOrganicLabelActive == true">
{{ form_widget(form.propertyOrganicLabel) }}
{{ form_widget(form.propertyOrganicLabel, {"attr" : {'v-model' : 'propertyOrganicLabel', 'ref': 'propertyOrganicLabel'}}) }}
</div>
</td>
</tr>

+ 1
- 1
ShopBundle/Resources/views/backend/productfamily/panel_stock.html.twig Ver arquivo

@@ -61,7 +61,7 @@
{{ form_help(form.availableQuantityDefault) }}
</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) }}
</p>
</div>

+ 1
- 0
ShopBundle/Services/MerchantUtils.php Ver arquivo

@@ -4,6 +4,7 @@ namespace Lc\ShopBundle\Services ;

use App\Entity\UserMerchant;
use Doctrine\ORM\EntityManagerInterface;
use Lc\ShopBundle\Context\MerchantInterface;
use Lc\ShopBundle\Context\UserMerchantInterface;
use Symfony\Component\Security\Core\Security;


Carregando…
Cancelar
Salvar