Browse Source

Merge branch 'develop'

master
Fab 4 years ago
parent
commit
67693d6c08
14 changed files with 131 additions and 14 deletions
  1. +4
    -0
      ShopBundle/Controller/Backend/NewsController.php
  2. +5
    -0
      ShopBundle/EventSubscriber/ListEventSubscriber.php
  3. +17
    -0
      ShopBundle/Model/ProductCategory.php
  4. +17
    -0
      ShopBundle/Model/ProductFamily.php
  5. +2
    -1
      ShopBundle/Resources/public/js/backend/script/merchant/vuejs-merchant.js
  6. +6
    -1
      ShopBundle/Resources/translations/lcshop.fr.yaml
  7. +2
    -2
      ShopBundle/Resources/views/backend/default/list.html.twig
  8. +0
    -1
      ShopBundle/Resources/views/backend/merchant/form.html.twig
  9. +6
    -0
      ShopBundle/Resources/views/backend/merchant/panel_delivery.html.twig
  10. +2
    -0
      ShopBundle/Resources/views/backend/merchant/panel_email.html.twig
  11. +37
    -8
      ShopBundle/Resources/views/backend/merchant/panel_order.html.twig
  12. +3
    -0
      ShopBundle/Resources/views/backend/productfamily/panel_general.html.twig
  13. +21
    -1
      ShopBundle/Services/Order/OrderUtilsStockTrait.php
  14. +9
    -0
      ShopBundle/Services/Utils.php

+ 4
- 0
ShopBundle/Controller/Backend/NewsController.php View File

] ; ] ;


$i = 0 ; $i = 0 ;

foreach ($users as $user) { foreach ($users as $user) {
$paramsTemplate['user'] =$user;

if(!isset($packageMessagesArray[$i])) { if(!isset($packageMessagesArray[$i])) {
$packageMessagesArray[$i] = [] ; $packageMessagesArray[$i] = [] ;
} }
public function getNewsletter() public function getNewsletter()
{ {
$newsletter = $this->merchantUtils->getMerchantCurrent()->getNewsletter() ; $newsletter = $this->merchantUtils->getMerchantCurrent()->getNewsletter() ;

if($newsletter) { if($newsletter) {
return $newsletter ; return $newsletter ;
} }

+ 5
- 0
ShopBundle/EventSubscriber/ListEventSubscriber.php View File



use Lc\ShopBundle\Context\FilterMerchantInterface; use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\ShopBundle\Context\FilterMultipleMerchantsInterface; use Lc\ShopBundle\Context\FilterMultipleMerchantsInterface;
use Lc\ShopBundle\Context\ProductFamilyInterface;
use Lc\ShopBundle\Context\StatusInterface; use Lc\ShopBundle\Context\StatusInterface;
use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;


}else {*/ }else {*/


if ($entityObject instanceof ProductFamilyInterface) {
$paginator->nbResultsOnSale = $entityRepo->count(array('saleStatus' =>1, 'status'=> 1, 'merchant'=> $criteria['merchant']));
}

if ($entityObject instanceof StatusInterface) { if ($entityObject instanceof StatusInterface) {


for ($status = -1; $status <= 1; $status++) { for ($status = -1; $status <= 1; $status++) {

+ 17
- 0
ShopBundle/Model/ProductCategory.php View File

*/ */
protected $productFamilies; protected $productFamilies;


/**
* @ORM\Column(type="boolean")
*/
protected $saleStatus;

public function __construct() public function __construct()
{ {
$this->childrens = new ArrayCollection(); $this->childrens = new ArrayCollection();


return $this; return $this;
} }

public function getSaleStatus(): ?bool
{
return $this->saleStatus;
}

public function setSaleStatus(bool $saleStatus): self
{
$this->saleStatus = $saleStatus;

return $this;
}
} }

+ 17
- 0
ShopBundle/Model/ProductFamily.php View File

protected $behaviorPrice; protected $behaviorPrice;




/**
* @ORM\Column(type="boolean")
*/
protected $saleStatus;

public function __construct() public function __construct()
{ {
$this->productCategories = new ArrayCollection(); $this->productCategories = new ArrayCollection();


return false ; return false ;
} }

public function getSaleStatus(): ?bool
{
return $this->saleStatus;
}

public function setSaleStatus(bool $saleStatus): self
{
$this->saleStatus = $saleStatus;

return $this;
}
} }

+ 2
- 1
ShopBundle/Resources/public/js/backend/script/merchant/vuejs-merchant.js View File

{ {
addressType: null, addressType: null,
currentSection:'general', currentSection:'general',
isOpenFullTime: false,
sectionsArray: [ sectionsArray: [
{ {
name: 'general', name: 'general',
nameDisplay: 'Maintenance' nameDisplay: 'Maintenance'
} }
] ]
}, window.addressValues);
}, window.addressValues, window.merchantPanelOrderValues);
}, },
mounted: function () {}, mounted: function () {},
methods: { methods: {

+ 6
- 1
ShopBundle/Resources/translations/lcshop.fr.yaml View File

nbResultsFiltered: Total d'élements filtrés nbResultsFiltered: Total d'élements filtrés
nbResultsOnline: Total d'élements en ligne nbResultsOnline: Total d'élements en ligne
nbResultsOffline: Total d'élements hors ligne nbResultsOffline: Total d'élements hors ligne
nbResultsDeleted: Total d'élements supprimé
nbResultsDeleted: Total d'élements supprimés
nbResultsOnSale: Total de produits en vente
nbProductFamilyOnline: Total de produits visibles
listChildren: Afficher les enfants listChildren: Afficher les enfants
edit: Éditer edit: Éditer
delete: Supprimer delete: Supprimer
editStockNoQuantityDefault: "Le stock n'a pas été modifié pour le produit #%id% (Aucune quantité par défaut)" editStockNoQuantityDefault: "Le stock n'a pas été modifié pour le produit #%id% (Aucune quantité par défaut)"
field: field:
default: default:
unit: Unité
placeholder: Choisissez une option placeholder: Choisissez une option
deliveryPointSale: Lieu de livraison deliveryPointSale: Lieu de livraison
deliveryAvailabilty: Créneau de livraison deliveryAvailabilty: Créneau de livraison
id: Id id: Id
status: Statut status: Statut
saleStatus: En vente sur le site
statusOptions: statusOptions:
offline: <span class="badge badge-danger">Hors ligne</span> offline: <span class="badge badge-danger">Hors ligne</span>
online: <span class="badge badge-success">En ligne</span> online: <span class="badge badge-success">En ligne</span>
success: Succès (vert) success: Succès (vert)
warningMessage: Contenu du message d'avertissement warningMessage: Contenu du message d'avertissement
newsletters: Newsletters newsletters: Newsletters
deliveryDepositoryOnly: Retrait au dépot uniquement
isPublic: Publique isPublic: Publique
isDepository: Dépôt isDepository: Dépôt
productCategories: Catégories productCategories: Catégories

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

<i class="fa fa-check"></i> </span>{% endif %} <i class="fa fa-check"></i> </span>{% endif %}
{% if paginator.nbResultsOffline is defined %}<span data-toggle="tooltip" {% if paginator.nbResultsOffline is defined %}<span data-toggle="tooltip"
title="{{ "list.nbResultsOffline"|trans }}" title="{{ "list.nbResultsOffline"|trans }}"
class="badge badge-warning">{{ paginator.nbResultsOffline }}
class="badge badge-danger">{{ paginator.nbResultsOffline }}
<i class="fa fa-pen"></i></span>{% endif %} <i class="fa fa-pen"></i></span>{% endif %}
{% if is_granted('ROLE_SUPER_ADMIN') and paginator.nbResultsDeleted is defined %}<span {% if is_granted('ROLE_SUPER_ADMIN') and paginator.nbResultsDeleted is defined %}<span
data-toggle="tooltip" title="{{ "list.nbResultsDeleted"|trans }}" data-toggle="tooltip" title="{{ "list.nbResultsDeleted"|trans }}"
class="badge badge-danger">{{ paginator.nbResultsDeleted }} <i
class="badge badge-secondary">{{ paginator.nbResultsDeleted }} <i
class="fa fa-trash"></i> class="fa fa-trash"></i>
</span>{% endif %} </span>{% endif %}
{% endblock %} {% endblock %}

+ 0
- 1
ShopBundle/Resources/views/backend/merchant/form.html.twig View File

<span class="glyphicon glyphicon-triangle-bottom"></span> <span class="glyphicon glyphicon-triangle-bottom"></span>
<i class="fa fa-exclamation-circle invalid-form"></i> <i class="fa fa-exclamation-circle invalid-form"></i>
</button> </button>

</li> </li>
</ul> </ul>
</div> </div>

+ 6
- 0
ShopBundle/Resources/views/backend/merchant/panel_delivery.html.twig View File

<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
{{ macros.card_start('Merchant.delivery','light') }} {{ macros.card_start('Merchant.delivery','light') }}

{% if form.merchantConfigs['delivery-depository-only'] is defined %}
<div class="col-12">
{{ form_row(form.merchantConfigs['delivery-depository-only']) }}
</div>
{% endif %}
{% if form.merchantConfigs['image-zones'] is defined %} {% if form.merchantConfigs['image-zones'] is defined %}
<div class="col-12"> <div class="col-12">
{{ form_row(form.merchantConfigs['image-zones']) }} {{ form_row(form.merchantConfigs['image-zones']) }}

+ 2
- 0
ShopBundle/Resources/views/backend/merchant/panel_email.html.twig View File

<div class="col-12"> <div class="col-12">
{{ form_row(form.merchantConfigs['email-contact']) }} {{ form_row(form.merchantConfigs['email-contact']) }}
</div> </div>
{% if form.merchantConfigs['email-from-purchase-order'] is defined %}
<div class="col-12"> <div class="col-12">
{{ form_row(form.merchantConfigs['email-from-purchase-order']) }} {{ form_row(form.merchantConfigs['email-from-purchase-order']) }}
</div> </div>
{% endif %}
{% if form.merchantConfigs['purchase-order-email-content'] is defined %} {% if form.merchantConfigs['purchase-order-email-content'] is defined %}
<div class="col-12"> <div class="col-12">
{{ form_row(form.merchantConfigs['purchase-order-email-content']) }} {{ form_row(form.merchantConfigs['purchase-order-email-content']) }}

+ 37
- 8
ShopBundle/Resources/views/backend/merchant/panel_order.html.twig View File



{% import '@LcShop/backend/default/block/macros.html.twig' as macros %} {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}



<script>
window.merchantPanelOrderValues = {
{% if form.merchantConfigs['is-open-full-time'] is defined %}isOpenFullTime: {{ form.merchantConfigs['is-open-full-time'].vars.data.value }}{% endif %}
};
</script>


<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
{{ macros.card_start('Merchant.order','light') }} {{ macros.card_start('Merchant.order','light') }}
<div class="col-6"> <div class="col-6">
{{ form_row(form.merchantConfigs['maximum-order-week']) }} {{ form_row(form.merchantConfigs['maximum-order-week']) }}
</div> </div>
<div class="col-6">
{% if form.merchantConfigs['is-open-full-time'] is defined %}
<div class="col-12">
{% for field in form.merchantConfigs['is-open-full-time'] %}
{% if field.vars.name == 'value' %}
{{ form_row(field, {'attr': {"v-model" : 'isOpenFullTime'}}) }}
{% else %}
{{ form_row(field) }}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% if form.merchantConfigs['message-site-opening-background'] is defined %}
<div v-show="isOpenFullTime == true" class="col-6">
{{ form_row(form.merchantConfigs['message-site-opening-background']) }}
</div>
{% endif %}
{% if form.merchantConfigs['message-site-opening'] is defined %}
<div v-show="isOpenFullTime == true" class="col-6">
{{ form_row(form.merchantConfigs['message-site-opening']) }}
</div>
{% endif %}
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.merchantConfigs['order-open-day']) }} {{ form_row(form.merchantConfigs['order-open-day']) }}
</div> </div>
<div class="col-6">
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.merchantConfigs['order-open-time']) }} {{ form_row(form.merchantConfigs['order-open-time']) }}
</div> </div>
{% if form.merchantConfigs['order-open-day-vip'] is defined %} {% if form.merchantConfigs['order-open-day-vip'] is defined %}
<div class="col-6">
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.merchantConfigs['order-open-day-vip']) }} {{ form_row(form.merchantConfigs['order-open-day-vip']) }}
</div> </div>
{% endif %} {% endif %}
{% if form.merchantConfigs['order-open-time-vip'] is defined %} {% if form.merchantConfigs['order-open-time-vip'] is defined %}
<div class="col-6">
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.merchantConfigs['order-open-time-vip']) }} {{ form_row(form.merchantConfigs['order-open-time-vip']) }}
</div> </div>
{% endif %} {% endif %}
<div class="col-6">
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.merchantConfigs['order-close-day']) }} {{ form_row(form.merchantConfigs['order-close-day']) }}
</div> </div>
<div class="col-6">
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.merchantConfigs['order-close-time']) }} {{ form_row(form.merchantConfigs['order-close-time']) }}
</div> </div>
<div class="col-6">
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.dateBeginHoliday) }} {{ form_row(form.dateBeginHoliday) }}
</div> </div>
<div class="col-6">
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.dateEndHoliday) }} {{ form_row(form.dateEndHoliday) }}
</div> </div>
{{ macros.card_end() }} {{ macros.card_end() }}

+ 3
- 0
ShopBundle/Resources/views/backend/productfamily/panel_general.html.twig View File

<div class="col-12"> <div class="col-12">
{{ form_row(form.status) }} {{ form_row(form.status) }}
</div> </div>
<div class="col-12">
{{ form_row(form.saleStatus) }}
</div>
<div class="col-12"> <div class="col-12">
{{ form_row(form.supplier) }} {{ form_row(form.supplier) }}
</div> </div>

+ 21
- 1
ShopBundle/Services/Order/OrderUtilsStockTrait.php View File

} }
} }


public function isProductSaleStatusOn(Product $product)
{
if($product->getProductFamily()->getSaleStatus()!=1) {
return false ;
}

$allCategoriesSalesOff = true;
foreach ($product->getProductFamily()->getProductCategories() as $category){
if($category->getParent()) {
if($category->getSaleStatus() && $category->getParent()->getSaleStatus())
$allCategoriesSalesOff = false;
}
else {
if($category->getSaleStatus()) $allCategoriesSalesOff = false;
}
}
if($allCategoriesSalesOff) return false;

return true ;
}


public function isProductAvailable(Product $product, $quantityOrder = 0, $checkCart = false, $orderShop = null) public function isProductAvailable(Product $product, $quantityOrder = 0, $checkCart = false, $orderShop = null)
{ {
if ($product->getStatus() != 1 || $product->getProductFamily()->getStatus() != 1) {
if ($product->getStatus() != 1 || $product->getProductFamily()->getStatus() != 1 || !$this->isProductSaleStatusOn($product)) {
return false; return false;
} }



+ 9
- 0
ShopBundle/Services/Utils.php View File

]); ]);
} }


public function urlEncryptData($datas){
$key = 'secretToken';
foreach ($datas as $data) {
$key .= $data;
}
return md5($key);
}


} }

Loading…
Cancel
Save