Browse Source

correctifs / duplications entity

feature/export_comptable
Fab 4 years ago
parent
commit
1c36f2e1f4
17 changed files with 396 additions and 156 deletions
  1. +64
    -10
      ShopBundle/Controller/Backend/AdminController.php
  2. +29
    -4
      ShopBundle/Controller/Backend/ProductFamilyController.php
  3. +11
    -0
      ShopBundle/Repository/BaseRepository.php
  4. +0
    -5
      ShopBundle/Resources/config/easy_admin/base.yaml
  5. +126
    -115
      ShopBundle/Resources/public/css/backend/custom.css
  6. +1
    -0
      ShopBundle/Resources/public/js/backend/plugin/autocomplete/bootstrap-autocomplete.min.js
  7. +33
    -2
      ShopBundle/Resources/public/js/backend/script/default/init-list.js
  8. +4
    -1
      ShopBundle/Resources/public/sass/backend/custom.scss
  9. +2
    -0
      ShopBundle/Resources/translations/lcshop.fr.yaml
  10. +0
    -6
      ShopBundle/Resources/views/backend/default/action.html.twig
  11. +13
    -0
      ShopBundle/Resources/views/backend/default/block/action.html.twig
  12. +58
    -0
      ShopBundle/Resources/views/backend/default/block/actions.html.twig
  13. +22
    -6
      ShopBundle/Resources/views/backend/default/list-fields/field_product_family_available_quantity.html.twig
  14. +15
    -6
      ShopBundle/Resources/views/backend/default/list.html.twig
  15. +4
    -0
      ShopBundle/Resources/views/backend/default/new.html.twig
  16. +7
    -1
      ShopBundle/Resources/views/backend/productfamily/macros.html.twig
  17. +7
    -0
      ShopBundle/Resources/views/backend/productfamily/panel_stock.html.twig

+ 64
- 10
ShopBundle/Controller/Backend/AdminController.php View File

use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormEvents;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
} }




public function autocompleteAction()
{

$entityName = $this->request->query->get('entity');
$valueSearched = $this->request->query->get('q');
$field = $this->request->query->get('field');

$class = $this->entity['class'];
$repo = $this->em->getRepository($class);

$values = $repo->findByTerm($field, $valueSearched);

$response = array();
foreach ($values as $value) {
$response[] = $value[$field];
}
return new JsonResponse($response);

}

/** /**
* Réécriture de show action pr rediriger vers l'édition * Réécriture de show action pr rediriger vers l'édition
*/ */
/* public function showAction()
{
$id = $this->request->query->get('id');
$entity = $this->request->query->get('entity');
public function showAction()
{
$id = $this->request->query->get('id');
$entity = $this->request->query->get('entity');


return $this->redirectToRoute('easyadmin', [
'action' => 'edit',
'entity' => $entity,
'id' => $id
]);
}*/
return $this->redirectToRoute('easyadmin', [
'action' => 'edit',
'entity' => $entity,
'id' => $id
]);
}




/** /**


return $this->executeDynamicMethod('render<EntityName>Template', ['edit', $this->entity['templates']['edit'], $parameters]); return $this->executeDynamicMethod('render<EntityName>Template', ['edit', $this->entity['templates']['edit'], $parameters]);
} }

public function createNewEntity(){
$idDuplicate = $this->request->query->get('duplicate', null);
if($idDuplicate){
$easyadmin = $this->request->attributes->get('easyadmin');
$entity= $this->em->getRepository($easyadmin['entity']['class'])->find($idDuplicate);

$newProductFamily = clone $entity ;
$this->em->persist($newProductFamily) ;
$this->em->flush() ;
}else{
$entityFullyQualifiedClassName = $this->entity['class'];

return new $entityFullyQualifiedClassName();
}

}

public function duplicateAction(){
$id = $this->request->query->get('id');
$refererUrl = $this->request->query->get('referer', '');

$easyadmin = $this->request->attributes->get('easyadmin');

$entity= $this->em->getRepository($easyadmin['entity']['class'])->find($id);

$newProductFamily = clone $entity ;

$this->em->persist($newProductFamily) ;
$this->em->flush() ;

return $this->redirectToRoute('easyadmin', ['entity' => $easyadmin['entity']['name'], 'action' => 'edit', 'id' =>$newProductFamily->getId(), 'referer' =>$refererUrl ]) ;
}
} }



+ 29
- 4
ShopBundle/Controller/Backend/ProductFamilyController.php View File

} }
} }


protected function processProducts($entity)
protected function processProducts($entity, $clone =false)
{ {
//si il existe un et un seul produit pour ce product family n'ajoute rien supprime rien //si il existe un et un seul produit pour ce product family n'ajoute rien supprime rien
if (count($entity->getProducts()) == 0) { if (count($entity->getProducts()) == 0) {
$entity->addProduct($product); $entity->addProduct($product);
} else { } else {
foreach ($entity->getProducts() as $i => $product) { foreach ($entity->getProducts() as $i => $product) {
$product->setProductFamily($entity);
$this->em->persist($product);
$entity->addProduct($product);
if($clone){
$newProduct = clone $product;
$newProduct->setProductFamily($entity);
$this->em->persist($newProduct);
$entity->addProduct($newProduct);
}else {
$product->setProductFamily($entity);
$this->em->persist($product);
$entity->addProduct($product);
}
} }
} }


return $this->executeDynamicMethod('render<EntityName>Template', ['new', $this->entity['templates']['new'], $parameters]); return $this->executeDynamicMethod('render<EntityName>Template', ['new', $this->entity['templates']['new'], $parameters]);
} }


public function duplicateAction(){
$id = $this->request->query->get('id');
$refererUrl = $this->request->query->get('referer', '');

$easyadmin = $this->request->attributes->get('easyadmin');

$entity= $this->em->getRepository($easyadmin['entity']['class'])->find($id);

$newProductFamily = clone $entity ;
if($easyadmin['entity']['name'] == "ProductFamily"){
$this->processProducts($newProductFamily, true);
}
$this->em->persist($newProductFamily) ;
$this->em->flush() ;

return $this->redirectToRoute('easyadmin', ['entity' => $easyadmin['entity']['name'], 'action' => 'edit', 'id' =>$newProductFamily->getId(), 'referer' =>$refererUrl ]) ;
}



public function getTotalProductOrdered($entity){ public function getTotalProductOrdered($entity){
$orderShopRepo = $this->em->getRepository(OrderShopInterface::class); $orderShopRepo = $this->em->getRepository(OrderShopInterface::class);

+ 11
- 0
ShopBundle/Repository/BaseRepository.php View File

} }




public function findByTerm($field, $term, $limit=10){
$qb = $this->findByMerchantQuery();
$qb->select('e.'.$field);
$qb->andWhere(
$qb->expr()->like('e.'.$field, ':term'));
$qb->setParameter('term', '%'.$term.'%');
$qb->setMaxResults($limit);

return $qb->getQuery()->getResult();

}
public function findByMerchantQuery() :QueryBuilder public function findByMerchantQuery() :QueryBuilder
{ {
return $this->createQueryBuilder('e') return $this->createQueryBuilder('e')

+ 0
- 5
ShopBundle/Resources/config/easy_admin/base.yaml View File

form_theme: form_theme:
- '@LcShop/backend/form/custom_bootstrap_4.html.twig' - '@LcShop/backend/form/custom_bootstrap_4.html.twig'
- '@LcShop/backend/form/ckeditor_widget.html.twig' - '@LcShop/backend/form/ckeditor_widget.html.twig'
list:
max_results: 30
actions:
- { name: 'edit', icon: 'pencil'}
- { name: 'delete', icon: 'trash'}
formats: formats:
date: 'd/m/Y' date: 'd/m/Y'
time: 'h:i A e' time: 'h:i A e'

+ 126
- 115
ShopBundle/Resources/public/css/backend/custom.css View File

margin-bottom: 0px; margin-bottom: 0px;
} }


/* line 32, ../../sass/backend/custom.scss */
a.link-as-text {
color: #333;
}

/***************************************** ADMIN SIDEBAR ***************************************/ /***************************************** ADMIN SIDEBAR ***************************************/
/* line 34, ../../sass/backend/custom.scss */
/* line 36, ../../sass/backend/custom.scss */
.main-sidebar p { .main-sidebar p {
font-size: 0.8rem; font-size: 0.8rem;
} }


/* line 35, ../../sass/backend/custom.scss */
/* line 37, ../../sass/backend/custom.scss */
.main-sidebar .sidebar { .main-sidebar .sidebar {
padding-left: 0px; padding-left: 0px;
padding-right: 0px; padding-right: 0px;
margin-top: 57px; margin-top: 57px;
} }


/* line 36, ../../sass/backend/custom.scss */
/* line 38, ../../sass/backend/custom.scss */
.main-sidebar .nav-link { .main-sidebar .nav-link {
padding: .4rem .5rem .4rem .7rem; padding: .4rem .5rem .4rem .7rem;
} }


/* line 41, ../../sass/backend/custom.scss */
/* line 43, ../../sass/backend/custom.scss */
#lc-flash-messages { #lc-flash-messages {
display: none; display: none;
} }


/* line 43, ../../sass/backend/custom.scss */
/* line 45, ../../sass/backend/custom.scss */
.main-sidebar .logo-long { .main-sidebar .logo-long {
padding: 8px 0; padding: 8px 0;
text-align: center; text-align: center;
} }


/* line 44, ../../sass/backend/custom.scss */
/* line 46, ../../sass/backend/custom.scss */
.main-sidebar .logo-long img { .main-sidebar .logo-long img {
height: 40px; height: 40px;
display: inline-block; display: inline-block;
} }


/* line 45, ../../sass/backend/custom.scss */
/* line 47, ../../sass/backend/custom.scss */
.sidebar-collapse .main-sidebar .logo-long span { .sidebar-collapse .main-sidebar .logo-long span {
display: none; display: none;
} }


/* line 46, ../../sass/backend/custom.scss */
/* line 48, ../../sass/backend/custom.scss */
.sidebar-collapse .main-sidebar:hover .logo-long span { .sidebar-collapse .main-sidebar:hover .logo-long span {
display: inline-block; display: inline-block;
} }


/* line 48, ../../sass/backend/custom.scss */
/* line 50, ../../sass/backend/custom.scss */
.table.datatable-simple .highlight { .table.datatable-simple .highlight {
background: var(--teal); background: var(--teal);
} }


/* line 49, ../../sass/backend/custom.scss */
/* line 51, ../../sass/backend/custom.scss */
.datatable-field-search.small { .datatable-field-search.small {
width: 50px; width: 50px;
} }


/* line 51, ../../sass/backend/custom.scss */
/* line 53, ../../sass/backend/custom.scss */
.dataTables_length, .dataTables_filter { .dataTables_length, .dataTables_filter {
padding: .75rem 1.25rem 0.25rem; padding: .75rem 1.25rem 0.25rem;
} }


/* line 53, ../../sass/backend/custom.scss */
/* line 55, ../../sass/backend/custom.scss */
table.fixedHeader-floating { table.fixedHeader-floating {
margin-top: 0px !important; margin-top: 0px !important;
} }


/* line 54, ../../sass/backend/custom.scss */
/* line 56, ../../sass/backend/custom.scss */
table th.sorting_asc, table th.sorting_desc { table th.sorting_asc, table th.sorting_desc {
border-top: 3px solid var(--success); border-top: 3px solid var(--success);
} }


/* line 55, ../../sass/backend/custom.scss */
/* line 57, ../../sass/backend/custom.scss */
.card-body table.lc-table-list th.sorted, table th.sorting_asc, table th.sorting_desc { .card-body table.lc-table-list th.sorted, table th.sorting_asc, table th.sorting_desc {
border-top: 2px solid var(--success); border-top: 2px solid var(--success);
} }


/*.card-body table.lc-table-list th{border-top:3px solid var(--success);}*/ /*.card-body table.lc-table-list th{border-top:3px solid var(--success);}*/
/* line 57, ../../sass/backend/custom.scss */
/* line 59, ../../sass/backend/custom.scss */
table th.filtered { table th.filtered {
border-top: 3px solid var(--primary); border-top: 3px solid var(--primary);
} }


/* line 60, ../../sass/backend/custom.scss */
/* line 62, ../../sass/backend/custom.scss */
.lc-table-list thead a { .lc-table-list thead a {
color: #212529; color: #212529;
} }


/* line 61, ../../sass/backend/custom.scss */
/* line 63, ../../sass/backend/custom.scss */
.table-filters-line th { .table-filters-line th {
font-weight: 400; font-weight: 400;
position: relative;
} }


/* line 62, ../../sass/backend/custom.scss */
/* line 64, ../../sass/backend/custom.scss */
.table-filters-line th input {
width: 350px;
}

/* line 65, ../../sass/backend/custom.scss */
#list_filter_id { #list_filter_id {
width: 60px; width: 60px;
} }


/* line 63, ../../sass/backend/custom.scss */
/* line 66, ../../sass/backend/custom.scss */
.lc-table-list .date-range { .lc-table-list .date-range {
width: 130px; width: 130px;
} }


/* line 65, ../../sass/backend/custom.scss */
/* line 68, ../../sass/backend/custom.scss */
th.actions, td.actions { th.actions, td.actions {
white-space: nowrap; white-space: nowrap;
text-align: right; text-align: right;
} }


/* line 67, ../../sass/backend/custom.scss */
/* line 70, ../../sass/backend/custom.scss */
.table td, .table th { .table td, .table th {
padding: 0.35rem; padding: 0.35rem;
} }


/* line 68, ../../sass/backend/custom.scss */
/* line 71, ../../sass/backend/custom.scss */
.delivery-field .form-group { .delivery-field .form-group {
display: inline-block; display: inline-block;
margin-bottom: 0px; margin-bottom: 0px;
margin-right: 15px; margin-right: 15px;
} }


/* line 69, ../../sass/backend/custom.scss */
/* line 72, ../../sass/backend/custom.scss */
.delivery-field .form-group .form-control { .delivery-field .form-group .form-control {
width: 150px; width: 150px;
} }


/* line 71, ../../sass/backend/custom.scss */
/* line 74, ../../sass/backend/custom.scss */
table th input { table th input {
width: auto; width: auto;
} }


/* line 72, ../../sass/backend/custom.scss */
/* line 75, ../../sass/backend/custom.scss */
table th .select2-container--default .select2-selection--single { table th .select2-container--default .select2-selection--single {
padding: 0.3rem 0.4rem; padding: 0.3rem 0.4rem;
} }


/************************ LOGIN PAGE *********************/ /************************ LOGIN PAGE *********************/
/* line 75, ../../sass/backend/custom.scss */
/* line 78, ../../sass/backend/custom.scss */
.login-logo { .login-logo {
display: block; display: block;
margin: auto; margin: auto;
} }


/************************ form error *********************/ /************************ form error *********************/
/* line 78, ../../sass/backend/custom.scss */
/* line 81, ../../sass/backend/custom.scss */
.form-sent .form-control:invalid { .form-sent .form-control:invalid {
border-color: #dc3545; border-color: #dc3545;
padding-right: 2.25rem; padding-right: 2.25rem;
background-size: calc(.75em + .375rem) calc(.75em + .375rem); background-size: calc(.75em + .375rem) calc(.75em + .375rem);
} }


/* line 79, ../../sass/backend/custom.scss */
/* line 82, ../../sass/backend/custom.scss */
.form-sent select.form-control:invalid + .select2 .select2-selection { .form-sent select.form-control:invalid + .select2 .select2-selection {
border-color: #dc3545; border-color: #dc3545;
} }


/* line 80, ../../sass/backend/custom.scss */
/* line 83, ../../sass/backend/custom.scss */
.form-sent select.form-control:invalid + .select2 .select2-selection b { .form-sent select.form-control:invalid + .select2 .select2-selection b {
border-color: #dc3545 transparent transparent transparent; border-color: #dc3545 transparent transparent transparent;
} }


/*CUSTOM Checkbox /*CUSTOM Checkbox
/* Customize the label (the container) */ /* Customize the label (the container) */
/* line 85, ../../sass/backend/custom.scss */
/* line 88, ../../sass/backend/custom.scss */
.form-check-label { .form-check-label {
display: block; display: block;
position: relative; position: relative;
} }


/* Hide the browser's default checkbox */ /* Hide the browser's default checkbox */
/* line 87, ../../sass/backend/custom.scss */
/* line 90, ../../sass/backend/custom.scss */
.form-check-label input { .form-check-label input {
position: absolute; position: absolute;
opacity: 0; opacity: 0;
} }


/* Create a custom checkbox */ /* Create a custom checkbox */
/* line 90, ../../sass/backend/custom.scss */
/* line 93, ../../sass/backend/custom.scss */
.form-check { .form-check {
padding-left: 0px; padding-left: 0px;
} }


/* line 92, ../../sass/backend/custom.scss */
/* line 95, ../../sass/backend/custom.scss */
.form-sent .form-check-label input:invalid ~ .checkmark { .form-sent .form-check-label input:invalid ~ .checkmark {
border-color: #dc3545; border-color: #dc3545;
} }


/* line 93, ../../sass/backend/custom.scss */
/* line 96, ../../sass/backend/custom.scss */
.form-check-label input:disabled ~ .checkmark { .form-check-label input:disabled ~ .checkmark {
display: none; display: none;
} }


/* line 94, ../../sass/backend/custom.scss */
/* line 97, ../../sass/backend/custom.scss */
.form-check-label input ~ .checkmark { .form-check-label input ~ .checkmark {
position: absolute; position: absolute;
top: 0; top: 0;
border: 1px solid var(--primary); border: 1px solid var(--primary);
} }


/* line 95, ../../sass/backend/custom.scss */
/* line 98, ../../sass/backend/custom.scss */
.form-check-label.big input ~ .checkmark { .form-check-label.big input ~ .checkmark {
height: 21px; height: 21px;
width: 21px; width: 21px;
} }


/* line 96, ../../sass/backend/custom.scss */
/* line 99, ../../sass/backend/custom.scss */
.form-check-label input[type="checkbox"] ~ .checkmark { .form-check-label input[type="checkbox"] ~ .checkmark {
top: 2px; top: 2px;
} }


/* line 97, ../../sass/backend/custom.scss */
/* line 100, ../../sass/backend/custom.scss */
.form-check-label input[type="radio"] ~ .checkmark { .form-check-label input[type="radio"] ~ .checkmark {
top: 3px; top: 3px;
border-radius: 50%; border-radius: 50%;
} }


/* line 98, ../../sass/backend/custom.scss */
/* line 101, ../../sass/backend/custom.scss */
.form-check-label:hover input ~ .checkmark { .form-check-label:hover input ~ .checkmark {
background-color: #ccc; background-color: #ccc;
} }


/* When the checkbox is checked, add a blue background */ /* When the checkbox is checked, add a blue background */
/* line 100, ../../sass/backend/custom.scss */
/* line 103, ../../sass/backend/custom.scss */
.form-check-label input:checked ~ .checkmark { .form-check-label input:checked ~ .checkmark {
background-color: var(--primary); background-color: var(--primary);
} }


/* Create the checkmark/indicator (hidden when not checked) */ /* Create the checkmark/indicator (hidden when not checked) */
/* line 102, ../../sass/backend/custom.scss */
/* line 105, ../../sass/backend/custom.scss */
.form-check-label .checkmark:after { .form-check-label .checkmark:after {
content: ""; content: "";
position: absolute; position: absolute;
} }


/* Show the checkmark when checked */ /* Show the checkmark when checked */
/* line 104, ../../sass/backend/custom.scss */
/* line 107, ../../sass/backend/custom.scss */
.form-check-label input:checked ~ .checkmark:after { .form-check-label input:checked ~ .checkmark:after {
display: block; display: block;
} }


/* Style the checkmark/indicator */ /* Style the checkmark/indicator */
/* line 106, ../../sass/backend/custom.scss */
/* line 109, ../../sass/backend/custom.scss */
.form-check-label .checkmark:after { .form-check-label .checkmark:after {
left: 7px; left: 7px;
top: 3px; top: 3px;
transform: rotate(45deg); transform: rotate(45deg);
} }


/* line 107, ../../sass/backend/custom.scss */
/* line 110, ../../sass/backend/custom.scss */
.form-check-label input[type="checkbox"] ~ .checkmark:after { .form-check-label input[type="checkbox"] ~ .checkmark:after {
left: 6px; left: 6px;
top: 2px; top: 2px;
transform: rotate(45deg); transform: rotate(45deg);
} }


/* line 108, ../../sass/backend/custom.scss */
/* line 111, ../../sass/backend/custom.scss */
.form-check-label input[type="radio"] ~ .checkmark:after { .form-check-label input[type="radio"] ~ .checkmark:after {
top: 4px; top: 4px;
left: 4px; left: 4px;
background: white; background: white;
} }


/* line 110, ../../sass/backend/custom.scss */
/* line 113, ../../sass/backend/custom.scss */
.form-check-label.big input[type="checkbox"] ~ .checkmark:after { .form-check-label.big input[type="checkbox"] ~ .checkmark:after {
left: 7px; left: 7px;
top: 3px; top: 3px;
} }


/* Create a custom radio button */ /* Create a custom radio button */
/* line 114, ../../sass/backend/custom.scss */
/* line 117, ../../sass/backend/custom.scss */
.product-categories .parent .form-group.field-checkbox .form-check-label { .product-categories .parent .form-group.field-checkbox .form-check-label {
padding-left: 0px; padding-left: 0px;
font-style: italic; font-style: italic;
} }


/* line 115, ../../sass/backend/custom.scss */
/* line 118, ../../sass/backend/custom.scss */
.product-categories .children .form-group.field-checkbox { .product-categories .children .form-group.field-checkbox {
margin-left: 20px; margin-left: 20px;
} }


/* line 116, ../../sass/backend/custom.scss */
/* line 119, ../../sass/backend/custom.scss */
.product-categories .form-group { .product-categories .form-group {
margin-bottom: 0.15rem; margin-bottom: 0.15rem;
} }


/* line 117, ../../sass/backend/custom.scss */
/* line 120, ../../sass/backend/custom.scss */
.lc-deleted-field { .lc-deleted-field {
display: none; display: none;
} }


/* line 118, ../../sass/backend/custom.scss */
/* line 121, ../../sass/backend/custom.scss */
.lc-offline-field { .lc-offline-field {
opacity: 0.5; opacity: 0.5;
} }


/* line 119, ../../sass/backend/custom.scss */
/* line 122, ../../sass/backend/custom.scss */
.lc-offline-field label::after { .lc-offline-field label::after {
content: ' [hors ligne]'; content: ' [hors ligne]';
} }


/* Général */ /* Général */
/* line 125, ../../sass/backend/custom.scss */
/* line 128, ../../sass/backend/custom.scss */
.btn.action-save { .btn.action-save {
float: right; float: right;
margin-left: 10px; margin-left: 10px;
} }


/* line 126, ../../sass/backend/custom.scss */
/* line 129, ../../sass/backend/custom.scss */
.button-action a.float-right { .button-action a.float-right {
margin-left: 10px; margin-left: 10px;
} }


/* line 128, ../../sass/backend/custom.scss */
/* line 131, ../../sass/backend/custom.scss */
.input-group-text { .input-group-text {
padding: 0.25rem 0.75rem; padding: 0.25rem 0.75rem;
} }


/* line 132, ../../sass/backend/custom.scss */
/* line 135, ../../sass/backend/custom.scss */
.col-form-label { .col-form-label {
font-weight: bold; font-weight: bold;
} }


/* line 134, ../../sass/backend/custom.scss */
/* line 137, ../../sass/backend/custom.scss */
#toast-container.toast-top-right { #toast-container.toast-top-right {
top: 60px; top: 60px;
} }


/* SIDEBAR */ /* SIDEBAR */
/* line 137, ../../sass/backend/custom.scss */
/* line 140, ../../sass/backend/custom.scss */
.main-header.navbar { .main-header.navbar {
padding: 0; padding: 0;
min-height: 57px; min-height: 57px;
} }


/* line 138, ../../sass/backend/custom.scss */
/* line 141, ../../sass/backend/custom.scss */
.lc-navbar li { .lc-navbar li {
border-left: 1px solid #e0e0e0; border-left: 1px solid #e0e0e0;
padding: 0.5rem 1.5rem; padding: 0.5rem 1.5rem;
} }


/* line 139, ../../sass/backend/custom.scss */
/* line 142, ../../sass/backend/custom.scss */
.lc-navbar li label { .lc-navbar li label {
margin-bottom: 0; margin-bottom: 0;
vertical-align: middle; vertical-align: middle;
font-weight: normal !important; font-weight: normal !important;
} }


/* line 141, ../../sass/backend/custom.scss */
/* line 144, ../../sass/backend/custom.scss */
#switch-merchant { #switch-merchant {
min-width: 170px; min-width: 170px;
} }


/* Sortable */ /* Sortable */
/* line 147, ../../sass/backend/custom.scss */
/* line 150, ../../sass/backend/custom.scss */
.ui-sortable-helper { .ui-sortable-helper {
display: table; display: table;
} }


/* line 148, ../../sass/backend/custom.scss */
/* line 151, ../../sass/backend/custom.scss */
.ui-state-highlight { .ui-state-highlight {
background: #eee; background: #eee;
} }


/* line 149, ../../sass/backend/custom.scss */
/* line 152, ../../sass/backend/custom.scss */
.lc-sortable div:last-child { .lc-sortable div:last-child {
display: none; display: none;
} }
.lc-ckfinder-wrap .lc-ckfinder-button{width: 100%; bottom: 0px; left: 0; position: absolute;} .lc-ckfinder-wrap .lc-ckfinder-button{width: 100%; bottom: 0px; left: 0; position: absolute;}
*/ */
/* VUES JS */ /* VUES JS */
/* line 164, ../../sass/backend/custom.scss */
/* line 167, ../../sass/backend/custom.scss */
.nav-item .btn { .nav-item .btn {
padding-right: 15px; padding-right: 15px;
position: relative; position: relative;
} }


/* line 165, ../../sass/backend/custom.scss */
/* line 168, ../../sass/backend/custom.scss */
.nav-item .btn .invalid-form { .nav-item .btn .invalid-form {
display: none; display: none;
position: absolute; position: absolute;
font-size: 1.2rem; font-size: 1.2rem;
} }


/* line 166, ../../sass/backend/custom.scss */
/* line 169, ../../sass/backend/custom.scss */
.nav-item.has-invalid .btn .invalid-form { .nav-item.has-invalid .btn .invalid-form {
display: inline-block; display: inline-block;
z-index: 2; z-index: 2;
} }


/* ProductFamily */ /* ProductFamily */
/* line 171, ../../sass/backend/custom.scss */
/* line 174, ../../sass/backend/custom.scss */
.field-unit-quantity { .field-unit-quantity {
border-bottom: 2px dotted #eee; border-bottom: 2px dotted #eee;
padding-bottom: 10px; padding-bottom: 10px;
margin-bottom: 20px; margin-bottom: 20px;
} }


/* line 172, ../../sass/backend/custom.scss */
/* line 175, ../../sass/backend/custom.scss */
.field-reduction-apply { .field-reduction-apply {
border-top: 2px dotted #eee; border-top: 2px dotted #eee;
padding-top: 10px; padding-top: 10px;
margin-top: 20px; margin-top: 20px;
} }


/* line 174, ../../sass/backend/custom.scss */
/* line 177, ../../sass/backend/custom.scss */
.new-productfamily #nav-params, .new-productfamily #nav-params,
.edit-productfamily #nav-params { .edit-productfamily #nav-params {
margin-bottom: 30px; margin-bottom: 30px;
} }


/* line 179, ../../sass/backend/custom.scss */
/* line 182, ../../sass/backend/custom.scss */
.new-productfamily #nav-params .btn, .new-productfamily #nav-params .btn,
.edit-productfamily #nav-params .btn { .edit-productfamily #nav-params .btn {
margin-left: 20px; margin-left: 20px;
} }


/* line 184, ../../sass/backend/custom.scss */
/* line 187, ../../sass/backend/custom.scss */
.new-productfamily #product-categories .row, .new-productfamily #product-categories .row,
.edit-productfamily #product-categories .row { .edit-productfamily #product-categories .row {
padding: 10px; padding: 10px;
} }


/* line 189, ../../sass/backend/custom.scss */
/* line 192, ../../sass/backend/custom.scss */
.new-productfamily #product-categories .form-group, .new-productfamily #product-categories .form-group,
.edit-productfamily #product-categories .form-group { .edit-productfamily #product-categories .form-group {
width: 100%; width: 100%;
padding: 4px; padding: 4px;
} }


/* line 195, ../../sass/backend/custom.scss */
/* line 198, ../../sass/backend/custom.scss */
.new-productfamily #product-categories .children, .new-productfamily #product-categories .children,
.edit-productfamily #product-categories .children { .edit-productfamily #product-categories .children {
margin-left: 20px; margin-left: 20px;
width: 100%; width: 100%;
} }


/* line 201, ../../sass/backend/custom.scss */
/* line 204, ../../sass/backend/custom.scss */
.new-productfamily ul.products, .new-productfamily ul.products,
.edit-productfamily ul.products { .edit-productfamily ul.products {
padding: 0px; padding: 0px;
list-style-type: none; list-style-type: none;
} }


/* line 207, ../../sass/backend/custom.scss */
/* line 210, ../../sass/backend/custom.scss */
.new-productfamily ul.products li.product, .new-productfamily ul.products li.product,
.edit-productfamily ul.products li.product { .edit-productfamily ul.products li.product {
padding: 0px; padding: 0px;
position: relative; position: relative;
} }


/* line 214, ../../sass/backend/custom.scss */
/* line 217, ../../sass/backend/custom.scss */
.new-productfamily ul.products li.add, .new-productfamily ul.products li.add,
.edit-productfamily ul.products li.add { .edit-productfamily ul.products li.add {
text-align: right; text-align: right;
} }


/* line 219, ../../sass/backend/custom.scss */
/* line 222, ../../sass/backend/custom.scss */
.autoresize textarea { .autoresize textarea {
height: auto; height: auto;
min-height: 38px; min-height: 38px;
} }


/* line 221, ../../sass/backend/custom.scss */
/* line 224, ../../sass/backend/custom.scss */
.field-price .input-group.buyingPrice input, .field-price .input-group.buyingPrice .input-group-text { .field-price .input-group.buyingPrice input, .field-price .input-group.buyingPrice .input-group-text {
font-weight: bold; font-weight: bold;
border-color: #222; border-color: #222;
} }


/* line 222, ../../sass/backend/custom.scss */
/* line 225, ../../sass/backend/custom.scss */
.field-price .input-group.buyingPriceByRefUnit input, .field-price .input-group.buyingPriceByRefUnit .input-group-text { .field-price .input-group.buyingPriceByRefUnit input, .field-price .input-group.buyingPriceByRefUnit .input-group-text {
font-weight: bold; font-weight: bold;
border-color: #222; border-color: #222;
} }


/* line 223, ../../sass/backend/custom.scss */
/* line 226, ../../sass/backend/custom.scss */
.field-price .input-group.priceWithTax input, .field-price .input-group.priceWithTax .input-group-text { .field-price .input-group.priceWithTax input, .field-price .input-group.priceWithTax .input-group-text {
font-weight: bold; font-weight: bold;
border-color: #222; border-color: #222;
} }


/* line 224, ../../sass/backend/custom.scss */
/* line 227, ../../sass/backend/custom.scss */
.field-price .input-group.priceByRefUnitWithTax input, .field-price .input-group.priceByRefUnitWithTax .input-group-text { .field-price .input-group.priceByRefUnitWithTax input, .field-price .input-group.priceByRefUnitWithTax .input-group-text {
font-weight: bold; font-weight: bold;
border-color: #222; border-color: #222;
} }


/* line 225, ../../sass/backend/custom.scss */
/* line 228, ../../sass/backend/custom.scss */
.input-group.multiplyingFactor input, .input-group.multiplyingFactor .input-group-text { .input-group.multiplyingFactor input, .input-group.multiplyingFactor .input-group-text {
font-weight: bold; font-weight: bold;
border-color: #222; border-color: #222;
} }


/* ORDER */ /* ORDER */
/* line 231, ../../sass/backend/custom.scss */
/* line 234, ../../sass/backend/custom.scss */
.table-order-summary { .table-order-summary {
width: 100%; width: 100%;
} }


/* line 234, ../../sass/backend/custom.scss */
/* line 237, ../../sass/backend/custom.scss */
.order-product-item.redelivery { .order-product-item.redelivery {
background: rgba(18, 104, 253, 0.38) !important; background: rgba(18, 104, 253, 0.38) !important;
} }
/*.select2-container--bootstrap .select2-selection{max-width: none;}*/ /*.select2-container--bootstrap .select2-selection{max-width: none;}*/
/*.order-product-item{margin: 15px 0; padding: 0;}*/ /*.order-product-item{margin: 15px 0; padding: 0;}*/
/* Product */ /* Product */
/* line 239, ../../sass/backend/custom.scss */
/* line 242, ../../sass/backend/custom.scss */
.product-form-modal { .product-form-modal {
display: none; display: none;
} }


/* line 240, ../../sass/backend/custom.scss */
/* line 243, ../../sass/backend/custom.scss */
.product-form.modal .form-check-label { .product-form.modal .form-check-label {
font-style: italic; font-style: italic;
color: #666; color: #666;
text-align: left; text-align: left;
} }


/* line 241, ../../sass/backend/custom.scss */
/* line 244, ../../sass/backend/custom.scss */
.products-collection-table .inherited { .products-collection-table .inherited {
color: #888; color: #888;
font-style: italic; font-style: italic;
font-weight: initial; font-weight: initial;
} }


/* line 242, ../../sass/backend/custom.scss */
/* line 245, ../../sass/backend/custom.scss */
.products-collection-table td { .products-collection-table td {
position: relative; position: relative;
} }


/* line 243, ../../sass/backend/custom.scss */
/* line 246, ../../sass/backend/custom.scss */
.card-body.p-0 .products-collection-table tbody > tr > td:first-of-type, .card-body.p-0 .products-collection-table tbody > tr > th:first-of-type, .card-body.p-0 .products-collection-table thead > tr > td:first-of-type, .card-body.p-0 .products-collection-table thead > tr > th:first-of-type { .card-body.p-0 .products-collection-table tbody > tr > td:first-of-type, .card-body.p-0 .products-collection-table tbody > tr > th:first-of-type, .card-body.p-0 .products-collection-table thead > tr > td:first-of-type, .card-body.p-0 .products-collection-table thead > tr > th:first-of-type {
padding-left: 0.35rem; padding-left: 0.35rem;
} }


/* line 244, ../../sass/backend/custom.scss */
/* line 247, ../../sass/backend/custom.scss */
.products-collection-table .btn-empty-field { .products-collection-table .btn-empty-field {
position: absolute; position: absolute;
right: 3px; right: 3px;
padding: 0px; padding: 0px;
} }


/* line 245, ../../sass/backend/custom.scss */
/* line 248, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table { #lc-product-family-edit .products-collection-table {
table-layout: fixed; table-layout: fixed;
/* background-clip: padding-box;*/ /* background-clip: padding-box;*/
border-collapse: collapse; border-collapse: collapse;
} }


/* line 246, ../../sass/backend/custom.scss */
/* line 249, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table th { #lc-product-family-edit .products-collection-table th {
font-size: 13px; font-size: 13px;
border-left: 1px solid #dee2e6; border-left: 1px solid #dee2e6;
border-bottom: 2px solid #dee2e6; border-bottom: 2px solid #dee2e6;
} }


/* line 247, ../../sass/backend/custom.scss */
/* line 250, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table tfoot th { #lc-product-family-edit .products-collection-table tfoot th {
border-top: 2px solid #dee2e6; border-top: 2px solid #dee2e6;
} }


/* line 248, ../../sass/backend/custom.scss */
/* line 251, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table th span { #lc-product-family-edit .products-collection-table th span {
white-space: initial; white-space: initial;
} }


/* line 249, ../../sass/backend/custom.scss */
/* line 252, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table th:last-child { #lc-product-family-edit .products-collection-table th:last-child {
border-right: 1px solid #dee2e6; border-right: 1px solid #dee2e6;
} }


/* line 250, ../../sass/backend/custom.scss */
/* line 253, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td { #lc-product-family-edit .products-collection-table td {
border-left: 1px solid #dee2e6; border-left: 1px solid #dee2e6;
text-align: center; text-align: center;
border-bottom: 1px solid #dee2e6; border-bottom: 1px solid #dee2e6;
} }


/* line 251, ../../sass/backend/custom.scss */
/* line 254, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td:last-child { #lc-product-family-edit .products-collection-table td:last-child {
border-right: 1px solid #dee2e6; border-right: 1px solid #dee2e6;
white-space: nowrap; white-space: nowrap;
} }


/* line 252, ../../sass/backend/custom.scss */
/* line 255, ../../sass/backend/custom.scss */
#lc-product-family-edit .btn-add-product { #lc-product-family-edit .btn-add-product {
margin: 20px 0; margin: 20px 0;
float: right; float: right;
} }


/* line 253, ../../sass/backend/custom.scss */
/* line 256, ../../sass/backend/custom.scss */
#lc-product-family-edit .inherited { #lc-product-family-edit .inherited {
color: #888; color: #888;
font-style: italic; font-style: italic;
font-weight: initial; font-weight: initial;
} }


/* line 254, ../../sass/backend/custom.scss */
/* line 257, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td .value { #lc-product-family-edit .products-collection-table td .value {
min-width: 80%; min-width: 80%;
margin: auto; margin: auto;
cursor: pointer; cursor: pointer;
} }


/* line 255, ../../sass/backend/custom.scss */
/* line 258, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td .modal { #lc-product-family-edit .products-collection-table td .modal {
text-align: left; text-align: left;
} }


/* line 256, ../../sass/backend/custom.scss */
/* line 259, ../../sass/backend/custom.scss */
table.products-collection-table th.main-info, td.buyingPrice, td.multiplyingFactor, td.priceWithTax { table.products-collection-table th.main-info, td.buyingPrice, td.multiplyingFactor, td.priceWithTax {
background: #eeeeee; background: #eeeeee;
background-clip: padding-box; background-clip: padding-box;
} }


/* line 258, ../../sass/backend/custom.scss */
/* line 261, ../../sass/backend/custom.scss */
table.products-collection-table tr.disabled { table.products-collection-table tr.disabled {
opacity: 0.5; opacity: 0.5;
} }


/* DeliveryZone */ /* DeliveryZone */
/* line 263, ../../sass/backend/custom.scss */
/* line 266, ../../sass/backend/custom.scss */
#autocomplete-cities { #autocomplete-cities {
position: relative; position: relative;
} }


/* line 267, ../../sass/backend/custom.scss */
/* line 270, ../../sass/backend/custom.scss */
#autocomplete-cities .ui-autocomplete { #autocomplete-cities .ui-autocomplete {
left: 30%; left: 30%;
top: 41px; top: 41px;
margin-left: 18px; margin-left: 18px;
} }


/* line 273, ../../sass/backend/custom.scss */
/* line 276, ../../sass/backend/custom.scss */
.head-reminders { .head-reminders {
margin-top: 15px; margin-top: 15px;
} }


/* TABLEAU DE BORD */ /* TABLEAU DE BORD */
/* line 276, ../../sass/backend/custom.scss */
/* line 279, ../../sass/backend/custom.scss */
.todo-list > li { .todo-list > li {
position: relative; position: relative;
} }


/* line 277, ../../sass/backend/custom.scss */
/* line 280, ../../sass/backend/custom.scss */
.todo-list > li .text { .todo-list > li .text {
margin-left: 30px; margin-left: 30px;
} }


/* line 278, ../../sass/backend/custom.scss */
/* line 281, ../../sass/backend/custom.scss */
.todo-list > li .tools { .todo-list > li .tools {
position: absolute; position: absolute;
top: 4px; top: 4px;
right: 15px; right: 15px;
} }


/* line 280, ../../sass/backend/custom.scss */
/* line 283, ../../sass/backend/custom.scss */
#addTicketMessageForm { #addTicketMessageForm {
margin-top: 30px; margin-top: 30px;
border-top: 2px dotted #eee; border-top: 2px dotted #eee;
padding-top: 30px; padding-top: 30px;
} }


/* line 282, ../../sass/backend/custom.scss */
/* line 285, ../../sass/backend/custom.scss */
#dashboard .list-btn-statistic { #dashboard .list-btn-statistic {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
} }


/* line 283, ../../sass/backend/custom.scss */
/* line 286, ../../sass/backend/custom.scss */
#dashboard .btn-statistic { #dashboard .btn-statistic {
width: 120px; width: 120px;
height: 70px; height: 70px;
line-height: 1rem; line-height: 1rem;
} }


/* line 284, ../../sass/backend/custom.scss */
/* line 287, ../../sass/backend/custom.scss */
#dashboard .btn-statistic small { #dashboard .btn-statistic small {
margin-bottom: 10px; margin-bottom: 10px;
display: block; display: block;
} }


/* line 285, ../../sass/backend/custom.scss */
/* line 288, ../../sass/backend/custom.scss */
#dashboard .btn-statistic .value { #dashboard .btn-statistic .value {
display: block; display: block;
} }

+ 1
- 0
ShopBundle/Resources/public/js/backend/plugin/autocomplete/bootstrap-autocomplete.min.js
File diff suppressed because it is too large
View File


+ 33
- 2
ShopBundle/Resources/public/js/backend/script/default/init-list.js View File

initDeleteAction(); initDeleteAction();


initResetFilters(); initResetFilters();

initAutocompleteField();

initDropdown();
}); });


function initDeleteAction() { function initDeleteAction() {


$('.action-delete').each(function (){
$('.action-delete').each(function () {
$(this).on('click', function (e) { $(this).on('click', function (e) {
e.preventDefault(); e.preventDefault();
const id = $(this).parents('tr').first().data('id'); const id = $(this).parents('tr').first().data('id');




function initResetFilters() { function initResetFilters() {
$('.lc-reset-filters').on('click',function () {
$('.lc-reset-filters').on('click', function () {
$(this).parents('form').find('.form-control').val('').trigger('change'); $(this).parents('form').find('.form-control').val('').trigger('change');


}) })


} }

function initAutocompleteField() {


var autocompleteFields = $('[data-lc-autocomplete-url]');

autocompleteFields.each(function () {
var $this = $(this),
url = $this.data('lc-autocomplete-url');

$this.autoComplete({
noResultsText: 'Aucun résultat n\'a été trouvé.',
resolverSettings: {
url: url
}
});
});
}


function initDropdown(){
$('.dropdown-toggle').hover(function() {
$(this).find('.dropdown-menu').stop(true, true).delay(50).fadeIn();
}, function() {
$(this).find('.dropdown-menu').stop(true, true).delay(50).fadeOut();
});
}

+ 4
- 1
ShopBundle/Resources/public/sass/backend/custom.scss View File



.card-tools h5{margin-bottom: 0px;} .card-tools h5{margin-bottom: 0px;}


a.link-as-text{color:#333;}



/***************************************** ADMIN SIDEBAR ***************************************/ /***************************************** ADMIN SIDEBAR ***************************************/
.main-sidebar p{font-size: 0.8rem;} .main-sidebar p{font-size: 0.8rem;}




.lc-table-list thead a{color: #212529} .lc-table-list thead a{color: #212529}
.table-filters-line th {font-weight: 400;}
.table-filters-line th {font-weight: 400; position: relative;}
.table-filters-line th input{width: 350px;}
#list_filter_id{width: 60px;} #list_filter_id{width: 60px;}
.lc-table-list .date-range{width: 130px;} .lc-table-list .date-range{width: 130px;}



+ 2
- 0
ShopBundle/Resources/translations/lcshop.fr.yaml View File

edit: Éditer edit: Éditer
delete: Supprimer delete: Supprimer
send: Envoyer send: Envoyer
duplicate: Dupliquer
duplicateOtherHub: Dupliquer sur un autre hub


group: group:
main: Général main: Général

+ 0
- 6
ShopBundle/Resources/views/backend/default/action.html.twig View File


<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 }}">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
</a>

+ 13
- 0
ShopBundle/Resources/views/backend/default/block/action.html.twig View File


{% 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>
{% 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 }}" target="{{ action.target }}">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
</a>
{% endif %}

+ 58
- 0
ShopBundle/Resources/views/backend/default/block/actions.html.twig View File

{% set dropdownAction ={} %}
{% for action in actions %}


{% if action.group is defined and action.group==true %}
{% set dropdownAction = dropdownAction|merge({(loop.index0): action}) %}
{% else %}
{% if 'list' == action.name %}
{% set action_href = request_parameters.referer|default('') ? request_parameters.referer|easyadmin_urldecode : path('easyadmin', request_parameters|merge({ action: 'list' })) %}
{% elseif 'method' == action.type %}
{% set action_href = path('easyadmin', request_parameters|merge({ action: action.name, id: item_id })) %}
{% elseif 'route' == action.type %}
{% set action_href = path(action.name, request_parameters|merge({ action: action.name, id: item_id })) %}
{% endif %}

{{ include(action.template, {
action: action,
action_href: action_href,
is_dropdown: is_dropdown|default(false),
item: item,
item_id: item_id,
request_parameters: request_parameters,
translation_domain: translation_domain,
trans_parameters: trans_parameters,
}, with_context = false) }}
{% endif %}
{% endfor %}
{% if dropdownAction|length > 0 %}
<div class="btn-group">
<button type="button" class="btn btn-sm btn-secondary dropdown-toggle dropdown-icon" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
<div class="dropdown-menu dropdown-menu-right" role="menu">
{% for action in dropdownAction %}

{% if 'list' == action.name %}
{% set action_href = request_parameters.referer|default('') ? request_parameters.referer|easyadmin_urldecode : path('easyadmin', request_parameters|merge({ action: 'list' })) %}
{% elseif 'method' == action.type %}
{% set action_href = path('easyadmin', request_parameters|merge({ action: action.name, id: item_id })) %}
{% elseif 'route' == action.type %}
{% set action_href = path(action.name, request_parameters|merge({ action: action.name, id: item_id })) %}
{% endif %}

{{ include(action.template, {
action: action,
action_href: action_href,
is_dropdown: true,
item: item,
item_id: item_id,
request_parameters: request_parameters,
translation_domain: translation_domain,
trans_parameters: trans_parameters,
}, with_context = false) }}
{% endfor %}
</div>
</button>
</div>

{% endif %}

+ 22
- 6
ShopBundle/Resources/views/backend/default/list-fields/field_product_family_available_quantity.html.twig View File

{% if item.getBehaviorCountStock() == constant("Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE") %} {% if item.getBehaviorCountStock() == constant("Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE") %}
{% if value_is_set %} {% if value_is_set %}
{{ _self.badge_stock_start(value) }} {{ _self.badge_stock_start(value) }}
{{ _self.badge_stock_renewable(item.behaviorStockWeek) }}
{{ value }} {{ item.getUnit().getUnit() }} {{ value }} {{ item.getUnit().getUnit() }}
{{ _self.badge_stock_end() }} {{ _self.badge_stock_end() }}
{% else %} {% else %}
{{ _self.no_stock() }}
{{ _self.no_stock(item.behaviorStockWeek) }}
{% endif %} {% endif %}
{% elseif item.getBehaviorCountStock() == constant("Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY") %} {% elseif item.getBehaviorCountStock() == constant("Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY") %}
{% if value_is_set %} {% if value_is_set %}
{{ _self.badge_stock_start(value) }} {{ _self.badge_stock_start(value) }}
{{ _self.badge_stock_renewable(item.behaviorStockWeek) }}
{{ value }} pièce{% if value > 1 %}s{% endif %} {{ value }} pièce{% if value > 1 %}s{% endif %}
{{ _self.badge_stock_end() }} {{ _self.badge_stock_end() }}
{% else %} {% else %}
{{ _self.no_stock() }}
{{ _self.no_stock(item.behaviorStockWeek) }}
{% endif %} {% endif %}
{% elseif item.getBehaviorCountStock() == constant("Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT") %} {% elseif item.getBehaviorCountStock() == constant("Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT") %}
{% set available_quantity_products = item.getAvailableQuantityInherited() %} {% set available_quantity_products = item.getAvailableQuantityInherited() %}
{% if available_quantity_products > 0 %} {% if available_quantity_products > 0 %}
{{ _self.badge_stock_start(available_quantity_products) }} {{ _self.badge_stock_start(available_quantity_products) }}
{{ _self.badge_stock_renewable(item.behaviorStockWeek) }}
{{ available_quantity_products }} pièce{% if available_quantity_products > 1 %}s{% endif %} (déclinaisons) {{ available_quantity_products }} pièce{% if available_quantity_products > 1 %}s{% endif %} (déclinaisons)
{{ _self.badge_stock_end() }} {{ _self.badge_stock_end() }}
{% else %} {% else %}
{{ _self.no_stock() }}
{{ _self.no_stock(item.behaviorStockWeek) }}
{% endif %} {% endif %}
{% elseif item.getBehaviorCountStock() == constant("Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_UNLIMITED") %} {% elseif item.getBehaviorCountStock() == constant("Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_UNLIMITED") %}
<span class="badge badge-success">Illimité</span> <span class="badge badge-success">Illimité</span>
{% endif %} {% endif %}


{% macro no_stock() %}
<span class="badge badge-danger">Pas de stock</span>
{% macro no_stock(behaviorStockWeek) %}
<span class="badge badge-danger">
{{ _self.badge_stock_renewable(behaviorStockWeek) }}
Pas de stock
</span>
{% endmacro %}

{% macro badge_stock_renewable(behaviorStockWeek) %}
{% if behaviorStockWeek == constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_RENEWABLE') %}
R
{% elseif behaviorStockWeek == constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_RENEWABLE_VALIDATION') %}
RV
{% elseif behaviorStockWeek == constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE') %}
NR
{% endif %}
{% endmacro %} {% endmacro %}


{% macro badge_stock_start(value) %} {% macro badge_stock_start(value) %}
<span class="badge {{ badge_class }}"> <span class="badge {{ badge_class }}">
{% endmacro %} {% endmacro %}


{% macro badge_stock_end() %}
{% macro badge_stock_end() %}
</span> </span>
{% endmacro %} {% endmacro %}

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

</div> </div>
{% else %} {% else %}
<div class="form-widget input-group-sm"> <div class="form-widget input-group-sm">
{{ form_widget(filters_form[field]) }}
{{ form_widget(filters_form[field], {'attr': {'autocomplete': 'off', 'data-lc-autocomplete-url' : path('easyadmin', {
action: 'autocomplete',
field: field,
entity: _entity_config.name,
})|raw }}) }}
</div> </div>
{% endif %} {% endif %}


{% set isSortingField = metadata.property == app.request.get('sortField') %} {% set isSortingField = metadata.property == app.request.get('sortField') %}
{% set _column_label = (metadata.label ?: field|humanize)|trans(_trans_parameters) %} {% set _column_label = (metadata.label ?: field|humanize)|trans(_trans_parameters) %}



<td class="{{ isSortingField ? 'sorted' }} {{ metadata.dataType|lower }} {{ metadata.css_class }}" {{ easyadmin_config('design.rtl') ? 'dir="rtl"' }}> <td class="{{ isSortingField ? 'sorted' }} {{ metadata.dataType|lower }} {{ metadata.css_class }}" {{ easyadmin_config('design.rtl') ? 'dir="rtl"' }}>
{{ easyadmin_render_field_for_list_view(_entity_config.name, item, metadata) }}
{% if (field == 'title' or field== 'id') and (metadata.dataType=="string" or metadata.dataType=="integer") %}
<a class="link-as-text" href="{{ path('easyadmin', {'action':'edit', 'entity':_entity_config.name, 'id': item.id}) }}">
{{ easyadmin_render_field_for_list_view(_entity_config.name, item, metadata) }}
</a>
{% else %}
{{ easyadmin_render_field_for_list_view(_entity_config.name, item, metadata) }}
{% endif %}
</td> </td>
{% endfor %} {% endfor %}


{% set _column_label = 'list.row_actions'|trans(_trans_parameters, 'EasyAdminBundle') %} {% set _column_label = 'list.row_actions'|trans(_trans_parameters, 'EasyAdminBundle') %}
<td class="actions"> <td class="actions">
{% block item_actions %} {% block item_actions %}
{% set _actions_template = _entity_config.list.collapse_actions
? '@EasyAdmin/default/includes/_actions_dropdown.html.twig'
: '@EasyAdmin/default/includes/_actions.html.twig' %}
{% set _actions_template = '@LcShop/backend/default/block/actions.html.twig' %}
{{ include(_actions_template, { {{ include(_actions_template, {
actions: _list_item_actions, actions: _list_item_actions,
entity_config: _entity_config, entity_config: _entity_config,
<script src="{{ asset('bundles/lcshop/js/backend/plugin/daterange/moment.min.js') }}"></script> <script src="{{ asset('bundles/lcshop/js/backend/plugin/daterange/moment.min.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/plugin/daterange/daterangepicker.js') }}"></script> <script src="{{ asset('bundles/lcshop/js/backend/plugin/daterange/daterangepicker.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/plugin/datatables/jquery.highlight.js') }}"></script> <script src="{{ asset('bundles/lcshop/js/backend/plugin/datatables/jquery.highlight.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/plugin/autocomplete/bootstrap-autocomplete.min.js') }}"></script>
{#<script src="{{ asset('bundles/lcshop/js/backend/plugin/datatables/responsive.bootstrap4.min.js') }}"></script>#} {#<script src="{{ asset('bundles/lcshop/js/backend/plugin/datatables/responsive.bootstrap4.min.js') }}"></script>#}
{% endblock %} {% endblock %}




<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
log('ncihe');
const toggles = document.querySelectorAll('.custom-switch input[type="checkbox"]'); const toggles = document.querySelectorAll('.custom-switch input[type="checkbox"]');
for (i = 0; i < toggles.length; i++) { for (i = 0; i < toggles.length; i++) {
toggles[i].addEventListener('change', function () { toggles[i].addEventListener('change', function () {

+ 4
- 0
ShopBundle/Resources/views/backend/default/new.html.twig View File

{% block plugin_javascript %} {% block plugin_javascript %}
{{ parent() }} {{ parent() }}
<script src="{{ asset('bundles/lcshop/js/backend/plugin/jquery-ui/jquery-ui.min.js') }}"></script> <script src="{{ asset('bundles/lcshop/js/backend/plugin/jquery-ui/jquery-ui.min.js') }}"></script>
<script type="text/javascript">
var CKEDITOR_BASEPATH = "{{ ckeditor_base_path("/bundles/fosckeditor/") }}";
</script>
<script type="text/javascript" src="{{ asset('bundles/fosckeditor/ckeditor.js') }}"></script>
{% endblock %} {% endblock %}


{% block script_javascript %} {% block script_javascript %}

+ 7
- 1
ShopBundle/Resources/views/backend/productfamily/macros.html.twig View File

{% macro product_row(product, totalProductOrdered) %} {% macro product_row(product, totalProductOrdered) %}


<tr class="lc-draggable"> <tr class="lc-draggable">
<td>{% verbatim %}{{keyForm}}{% endverbatim %}<i class="fa fa-fw fa-sort"></i></td>
<td>
{% if product.vars.value is not null %}
#{{ product.vars.value.id }}
{% else %}
#new
{% endif %} <br/>
{% verbatim %}{{keyForm}}{% endverbatim %}<i class="fa fa-fw fa-sort"></i></td>
{{ _self.product_field(4, product.title, 'title') }} {{ _self.product_field(4, product.title, 'title') }}
{{ _self.product_field(2, product.quantity, 'quantity') }} {{ _self.product_field(2, product.quantity, 'quantity') }}
{{ _self.product_field(2, product.unit, 'unit', 'unitWording') }} {{ _self.product_field(2, product.unit, 'unit', 'unitWording') }}

+ 7
- 0
ShopBundle/Resources/views/backend/productfamily/panel_stock.html.twig View File



{{ form_label(form.behaviorStockWeek) }} {{ form_label(form.behaviorStockWeek) }}
{% for field in form.behaviorStockWeek %} {% for field in form.behaviorStockWeek %}
{% if field.vars.value == constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_RENEWABLE') or field.vars.value == constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_RENEWABLE_VALIDATION') %}
<div v-if="behaviorCountStock != '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_UNLIMITED')}}'">
{{ form_widget(field, {"attr" : {"v-model" : 'behaviorStockWeek'}}) }}
</div>
{% else %}
{{ form_widget(field, {"attr" : {"v-model" : 'behaviorStockWeek'}}) }} {{ form_widget(field, {"attr" : {"v-model" : 'behaviorStockWeek'}}) }}
{% endif %}

{% endfor %} {% endfor %}
</div> </div>
<div class="col"> <div class="col">

Loading…
Cancel
Save