Przeglądaj źródła

Travail en cours reduction

reduction
Fab 4 lat temu
rodzic
commit
5e9d0b5237
21 zmienionych plików z 2653 dodań i 9 usunięć
  1. +8
    -0
      ShopBundle/Context/GroupUserInterface.php
  2. +7
    -0
      ShopBundle/Context/ReductionCartInterface.php
  3. +7
    -0
      ShopBundle/Context/ReductionCatalogInterface.php
  4. +7
    -0
      ShopBundle/Context/ReductionInterface.php
  5. +79
    -0
      ShopBundle/Model/GroupUser.php
  6. +42
    -5
      ShopBundle/Model/Merchant.php
  7. +6
    -1
      ShopBundle/Model/ProductFamily.php
  8. +75
    -0
      ShopBundle/Model/ReductionCart.php
  9. +154
    -0
      ShopBundle/Model/ReductionCatalog.php
  10. +81
    -0
      ShopBundle/Model/ReductionTrait.php
  11. +34
    -0
      ShopBundle/Model/User.php
  12. +21
    -0
      ShopBundle/Repository/ReductionCatalogRepository.php
  13. +410
    -0
      ShopBundle/Resources/public/css/backend/adminlte/plugins/daterange/daterangepicker.css
  14. +1565
    -0
      ShopBundle/Resources/public/js/backend/plugin/daterange/daterangepicker.js
  15. +7
    -0
      ShopBundle/Resources/public/js/backend/plugin/daterange/moment.min.js
  16. +54
    -2
      ShopBundle/Resources/public/js/backend/script/default/init-common.js
  17. +10
    -0
      ShopBundle/Resources/public/js/backend/script/default/init-list.js
  18. +1
    -1
      ShopBundle/Resources/views/backend/default/block/macros.html.twig
  19. +5
    -0
      ShopBundle/Resources/views/backend/form/custom_bootstrap_4.html.twig
  20. +23
    -0
      ShopBundle/Resources/views/backend/reductioncatalog/edit.html.twig
  21. +57
    -0
      ShopBundle/Resources/views/backend/reductioncatalog/form.html.twig

+ 8
- 0
ShopBundle/Context/GroupUserInterface.php Wyświetl plik

@@ -0,0 +1,8 @@
<?php

namespace Lc\ShopBundle\Context;

interface GroupUserInterface
{

}

+ 7
- 0
ShopBundle/Context/ReductionCartInterface.php Wyświetl plik

@@ -0,0 +1,7 @@
<?php

namespace Lc\ShopBundle\Context;

interface ReductionCartInterface
{
}

+ 7
- 0
ShopBundle/Context/ReductionCatalogInterface.php Wyświetl plik

@@ -0,0 +1,7 @@
<?php

namespace Lc\ShopBundle\Context;

interface ReductionCatalogInterface
{
}

+ 7
- 0
ShopBundle/Context/ReductionInterface.php Wyświetl plik

@@ -0,0 +1,7 @@
<?php

namespace Lc\ShopBundle\Context;

interface ReductionInterface
{
}

+ 79
- 0
ShopBundle/Model/GroupUser.php Wyświetl plik

@@ -0,0 +1,79 @@
<?php

namespace Lc\ShopBundle\Model;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Lc\ShopBundle\Context\FilterMerchantInterface;


/**
* @ORM\MappedSuperclass()
*/
abstract class GroupUser extends AbstractDocumentEntity implements FilterMerchantInterface
{

/**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", inversedBy="groupUsers")
* @ORM\JoinColumn(nullable=false)
*/
protected $merchant;

/**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\UserInterface", mappedBy="groupUsers")
*/
protected $users;


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


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

public function getMerchant(): ?Merchant
{
return $this->merchant;
}

public function setMerchant(?Merchant $merchant): self
{
$this->merchant = $merchant;

return $this;
}

/**
* @return Collection|User[]
*/
public function getUsers(): Collection
{
return $this->users;
}

public function addUser(User $user): self
{
if (!$this->users->contains($user)) {
$this->users[] = $user;
}

return $this;
}

public function removeUser(User $user): self
{
if ($this->users->contains($user)) {
$this->users->removeElement($user);
}

return $this;
}


}

+ 42
- 5
ShopBundle/Model/Merchant.php Wyświetl plik

@@ -2,12 +2,11 @@

namespace Lc\ShopBundle\Model;

use App\Entity\News;
use App\Entity\Newsletter;
use App\Entity\ProductCategory;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\CreditConfigInterface;
use Lc\ShopBundle\Context\GroupUserInterface;

/**
* @ORM\MappedSuperclass()
@@ -62,6 +61,12 @@ abstract class Merchant extends AbstractDocumentEntity
*/
protected $newsletters;

/**
* @ORM\OneToMany(targetEntity="App\Entity\GroupUser", mappedBy="merchant")
*/
protected $groupUsers;


public function __construct()
{
$this->pointSales = new ArrayCollection();
@@ -69,6 +74,7 @@ abstract class Merchant extends AbstractDocumentEntity
$this->merchantConfigs = new ArrayCollection();
$this->productCategories = new ArrayCollection();
$this->news = new ArrayCollection();
$this->groupUsers = new ArrayCollection();
$this->newsletters = new ArrayCollection();
}

@@ -77,7 +83,7 @@ abstract class Merchant extends AbstractDocumentEntity
return $this->creditConfig;
}

public function setCreditConfig(CreditConfig $creditConfig): self
public function setCreditConfig(CreditConfigInterface $creditConfig): self
{
$this->creditConfig = $creditConfig;

@@ -291,7 +297,7 @@ abstract class Merchant extends AbstractDocumentEntity
return $this;
}

public function removeNewsletter(Newsletter $newsletter): self
public function removeNewsletter(News $newsletter): self
{
if ($this->newsletters->contains($newsletter)) {
$this->newsletters->removeElement($newsletter);
@@ -312,4 +318,35 @@ abstract class Merchant extends AbstractDocumentEntity
}
return false ;
}

/**
* @return Collection|GroupUser[]
*/
public function getGroupUsers(): Collection
{
return $this->groupUsers;
}

public function addGroupUser(GroupUser $groupUser): self
{
if (!$this->groupUsers->contains($groupUser)) {
$this->groupUsers[] = $groupUser;
$groupUser->setMerchant($this);
}

return $this;
}

public function removeGroupUser(GroupUser $groupUser): self
{
if ($this->groupUsers->contains($groupUser)) {
$this->groupUsers->removeElement($groupUser);
// set the owning side to null (unless already changed)
if ($groupUser->getMerchant() === $this) {
$groupUser->setMerchant(null);
}
}

return $this;
}
}

+ 6
- 1
ShopBundle/Model/ProductFamily.php Wyświetl plik

@@ -41,7 +41,7 @@ abstract class ProductFamily extends AbstractDocumentEntity implements ProductPr
protected $productsType;

/**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\ProductInterface", mappedBy="productFamily", orphanRemoval=true, cascade={"persist"})
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\ProductInterface", mappedBy="productFamily", orphanRemoval=true, cascade={"persist"}, fetch="EAGER")
*/
protected $products;

@@ -126,6 +126,11 @@ abstract class ProductFamily extends AbstractDocumentEntity implements ProductPr
$this->products = new ArrayCollection();
}

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

public function getTaxRateInherited()
{
if($this->getTaxRate()) {

+ 75
- 0
ShopBundle/Model/ReductionCart.php Wyświetl plik

@@ -0,0 +1,75 @@
<?php

namespace App\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\ReductionInterface;
use Lc\ShopBundle\Model\AbstractDocumentEntity;
use Lc\ShopBundle\Model\ReductionTrait;

/**
* @ORM\MappedSuperclass()
*/
abstract class ReductionCart extends AbstractDocumentEntity
{
use ReductionTrait;


/**
* @ORM\Column(type="boolean", nullable=true)
*/
protected $freeShipping;

/**
* @ORM\Column(type="string", length=25)
*/
protected $appliedTo;

/**
* @ORM\Column(type="integer")
*/
protected $priority;



public function getFreeShipping(): ?bool
{
return $this->freeShipping;
}

public function setFreeShipping(?bool $freeShipping): self
{
$this->freeShipping = $freeShipping;

return $this;
}

public function getAppliedTo(): ?string
{
return $this->appliedTo;
}

public function setAppliedTo(string $appliedTo): self
{
$this->appliedTo = $appliedTo;

return $this;
}


public function getPriority(): ?int
{
return $this->priority;
}

public function setPriority(int $priority): self
{
$this->priority = $priority;

return $this;
}


}

+ 154
- 0
ShopBundle/Model/ReductionCatalog.php Wyświetl plik

@@ -0,0 +1,154 @@
<?php

namespace Lc\ShopBundle\Model;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\ReductionInterface;

/**
* @ORM\MappedSuperclass()
*/
abstract class ReductionCatalog extends AbstractDocumentEntity implements ReductionInterface
{

use ReductionTrait;

/**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\ProductFamilyInterface")
*/
protected $productFamilies;

/**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\ProductCategoryInterface")
*/
protected $productCategories;

/**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\GroupUserInterface")
*/
protected $groupUsers;

/**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\UserInterface")
*/
protected $users;


public function __construct()
{
$this->productFamilies = new ArrayCollection();
$this->groupUsers = new ArrayCollection();
$this->productCategories = new ArrayCollection();
$this->users = new ArrayCollection();
}


/**
* @return Collection|ProductFamily[]
*/
public function getProductFamilies(): Collection
{
return $this->productFamilies;
}

public function addProductFamily(ProductFamily $productFamily): self
{
if (!$this->productFamilies->contains($productFamily)) {
$this->productFamilies[] = $productFamily;
}

return $this;
}

public function removeProductFamily(ProductFamily $productFamily): self
{
if ($this->productFamilies->contains($productFamily)) {
$this->productFamilies->removeElement($productFamily);
}

return $this;
}


/**
* @return Collection|GroupUser[]
*/
public function getGroupUsers(): Collection
{
return $this->groupUsers;
}

public function addGroupUser(GroupUser $groupUser): self
{
if (!$this->groupUsers->contains($groupUser)) {
$this->groupUsers[] = $groupUser;
}

return $this;
}

public function removeGroupUser(GroupUser $groupUser): self
{
if ($this->groupUsers->contains($groupUser)) {
$this->groupUsers->removeElement($groupUser);
}

return $this;
}

/**
* @return Collection|ProductCategory[]
*/
public function getProductCategories(): Collection
{
return $this->productCategories;
}

public function addProductCategory(ProductCategory $productCategory): self
{
if (!$this->productCategories->contains($productCategory)) {
$this->productCategories[] = $productCategory;
}

return $this;
}

public function removeProductCategory(ProductCategory $productCategory): self
{
if ($this->productCategories->contains($productCategory)) {
$this->productCategories->removeElement($productCategory);
}

return $this;
}

/**
* @return Collection|User[]
*/
public function getUsers(): Collection
{
return $this->users;
}

public function addUser(User $user): self
{
if (!$this->users->contains($user)) {
$this->users[] = $user;
}

return $this;
}

public function removeUser(User $user): self
{
if ($this->users->contains($user)) {
$this->users->removeElement($user);
}

return $this;
}


}

+ 81
- 0
ShopBundle/Model/ReductionTrait.php Wyświetl plik

@@ -0,0 +1,81 @@
<?php

namespace Lc\ShopBundle\Model;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\StatusInterface;

trait ReductionTrait
{
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $dateStart;

/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $dateEnd;

/**
* @ORM\Column(type="float", nullable=true)
*/
protected $value;

/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
protected $unit;


public function getDateStart(): ?\DateTimeInterface
{
return $this->dateStart;
}

public function setDateStart(?\DateTimeInterface $dateStart): self
{
$this->dateStart = $dateStart;

return $this;
}

public function getDateEnd(): ?\DateTimeInterface
{
return $this->dateEnd;
}

public function setDateEnd(?\DateTimeInterface $dateEnd): self
{
$this->dateEnd = $dateEnd;

return $this;
}

public function getValue(): ?float
{
return $this->value;
}

public function setValue(?float $value): self
{
$this->value = $value;

return $this;
}

public function getUnit(): ?string
{
return $this->unit;
}

public function setUnit(?string $unit): self
{
$this->unit = $unit;

return $this;
}


}

+ 34
- 0
ShopBundle/Model/User.php Wyświetl plik

@@ -70,6 +70,11 @@ abstract class User extends UserModelFOS
*/
protected $newsletters;

/**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\GroupUserInterface", inversedBy="users")
*/
protected $groupUsers;

public function __construct()
{
parent::__construct();
@@ -78,6 +83,7 @@ abstract class User extends UserModelFOS
$this->orders = new ArrayCollection();
$this->carts = new ArrayCollection();
$this->newsletters = new ArrayCollection();
$this->groupUsers = new ArrayCollection();
}

public function setEmail($email)
@@ -307,4 +313,32 @@ abstract class User extends UserModelFOS

return $this;
}

/**
* @return Collection|GroupUser[]
*/
public function getGroupUsers(): Collection
{
return $this->groupUsers;
}

public function addGroupUser(GroupUser $groupUser): self
{
if (!$this->groupUsers->contains($groupUser)) {
$this->groupUsers[] = $groupUser;
$groupUser->addUser($this);
}

return $this;
}

public function removeGroupUser(GroupUser $groupUser): self
{
if ($this->groupUsers->contains($groupUser)) {
$this->groupUsers->removeElement($groupUser);
$groupUser->removeUser($this);
}

return $this;
}
}

+ 21
- 0
ShopBundle/Repository/ReductionCatalogRepository.php Wyświetl plik

@@ -0,0 +1,21 @@
<?php

namespace Lc\ShopBundle\Repository;

use Lc\ShopBundle\Context\DefaultRepositoryInterface;
use Lc\ShopBundle\Context\ReductionCatalogInterface;

/**
* @method ReductionCatalogInterface|null find($id, $lockMode = null, $lockVersion = null)
* @method ReductionCatalogInterface|null findOneBy(array $criteria, array $orderBy = null)
* @method ReductionCatalogInterface[] findAll()
* @method ReductionCatalogInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class ReductionCatalogRepository extends BaseRepository implements DefaultRepositoryInterface
{
public function getInterfaceClass()
{
return ReductionCatalogInterface::class;
}

}

+ 410
- 0
ShopBundle/Resources/public/css/backend/adminlte/plugins/daterange/daterangepicker.css Wyświetl plik

@@ -0,0 +1,410 @@
.daterangepicker {
position: absolute;
color: inherit;
background-color: #fff;
border-radius: 4px;
border: 1px solid #ddd;
width: 278px;
max-width: none;
padding: 0;
margin-top: 7px;
top: 100px;
left: 20px;
z-index: 3001;
display: none;
font-family: arial;
font-size: 15px;
line-height: 1em;
}
.daterangepicker:before, .daterangepicker:after {
position: absolute;
display: inline-block;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: '';
}
.daterangepicker:before {
top: -7px;
border-right: 7px solid transparent;
border-left: 7px solid transparent;
border-bottom: 7px solid #ccc;
}
.daterangepicker:after {
top: -6px;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
border-left: 6px solid transparent;
}
.daterangepicker.opensleft:before {
right: 9px;
}
.daterangepicker.opensleft:after {
right: 10px;
}
.daterangepicker.openscenter:before {
left: 0;
right: 0;
width: 0;
margin-left: auto;
margin-right: auto;
}
.daterangepicker.openscenter:after {
left: 0;
right: 0;
width: 0;
margin-left: auto;
margin-right: auto;
}
.daterangepicker.opensright:before {
left: 9px;
}
.daterangepicker.opensright:after {
left: 10px;
}
.daterangepicker.drop-up {
margin-top: -7px;
}
.daterangepicker.drop-up:before {
top: initial;
bottom: -7px;
border-bottom: initial;
border-top: 7px solid #ccc;
}
.daterangepicker.drop-up:after {
top: initial;
bottom: -6px;
border-bottom: initial;
border-top: 6px solid #fff;
}
.daterangepicker.single .daterangepicker .ranges, .daterangepicker.single .drp-calendar {
float: none;
}
.daterangepicker.single .drp-selected {
display: none;
}
.daterangepicker.show-calendar .drp-calendar {
display: block;
}
.daterangepicker.show-calendar .drp-buttons {
display: block;
}
.daterangepicker.auto-apply .drp-buttons {
display: none;
}
.daterangepicker .drp-calendar {
display: none;
max-width: 270px;
}
.daterangepicker .drp-calendar.left {
padding: 8px 0 8px 8px;
}
.daterangepicker .drp-calendar.right {
padding: 8px;
}
.daterangepicker .drp-calendar.single .calendar-table {
border: none;
}
.daterangepicker .calendar-table .next span, .daterangepicker .calendar-table .prev span {
color: #fff;
border: solid black;
border-width: 0 2px 2px 0;
border-radius: 0;
display: inline-block;
padding: 3px;
}
.daterangepicker .calendar-table .next span {
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}
.daterangepicker .calendar-table .prev span {
transform: rotate(135deg);
-webkit-transform: rotate(135deg);
}
.daterangepicker .calendar-table th, .daterangepicker .calendar-table td {
white-space: nowrap;
text-align: center;
vertical-align: middle;
min-width: 32px;
width: 32px;
height: 24px;
line-height: 24px;
font-size: 12px;
border-radius: 4px;
border: 1px solid transparent;
white-space: nowrap;
cursor: pointer;
}
.daterangepicker .calendar-table {
border: 1px solid #fff;
border-radius: 4px;
background-color: #fff;
}
.daterangepicker .calendar-table table {
width: 100%;
margin: 0;
border-spacing: 0;
border-collapse: collapse;
}
.daterangepicker td.available:hover, .daterangepicker th.available:hover {
background-color: #eee;
border-color: transparent;
color: inherit;
}
.daterangepicker td.week, .daterangepicker th.week {
font-size: 80%;
color: #ccc;
}
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
background-color: #fff;
border-color: transparent;
color: #999;
}
.daterangepicker td.in-range {
background-color: #ebf4f8;
border-color: transparent;
color: #000;
border-radius: 0;
}
.daterangepicker td.start-date {
border-radius: 4px 0 0 4px;
}
.daterangepicker td.end-date {
border-radius: 0 4px 4px 0;
}
.daterangepicker td.start-date.end-date {
border-radius: 4px;
}
.daterangepicker td.active, .daterangepicker td.active:hover {
background-color: #357ebd;
border-color: transparent;
color: #fff;
}
.daterangepicker th.month {
width: auto;
}
.daterangepicker td.disabled, .daterangepicker option.disabled {
color: #999;
cursor: not-allowed;
text-decoration: line-through;
}
.daterangepicker select.monthselect, .daterangepicker select.yearselect {
font-size: 12px;
padding: 1px;
height: auto;
margin: 0;
cursor: default;
}
.daterangepicker select.monthselect {
margin-right: 2%;
width: 56%;
}
.daterangepicker select.yearselect {
width: 40%;
}
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {
width: 50px;
margin: 0 auto;
background: #eee;
border: 1px solid #eee;
padding: 2px;
outline: 0;
font-size: 12px;
}
.daterangepicker .calendar-time {
text-align: center;
margin: 4px auto 0 auto;
line-height: 30px;
position: relative;
}
.daterangepicker .calendar-time select.disabled {
color: #ccc;
cursor: not-allowed;
}
.daterangepicker .drp-buttons {
clear: both;
text-align: right;
padding: 8px;
border-top: 1px solid #ddd;
display: none;
line-height: 12px;
vertical-align: middle;
}
.daterangepicker .drp-selected {
display: inline-block;
font-size: 12px;
padding-right: 8px;
}
.daterangepicker .drp-buttons .btn {
margin-left: 8px;
font-size: 12px;
font-weight: bold;
padding: 4px 8px;
}
.daterangepicker.show-ranges.single.rtl .drp-calendar.left {
border-right: 1px solid #ddd;
}
.daterangepicker.show-ranges.single.ltr .drp-calendar.left {
border-left: 1px solid #ddd;
}
.daterangepicker.show-ranges.rtl .drp-calendar.right {
border-right: 1px solid #ddd;
}
.daterangepicker.show-ranges.ltr .drp-calendar.left {
border-left: 1px solid #ddd;
}
.daterangepicker .ranges {
float: none;
text-align: left;
margin: 0;
}
.daterangepicker.show-calendar .ranges {
margin-top: 8px;
}
.daterangepicker .ranges ul {
list-style: none;
margin: 0 auto;
padding: 0;
width: 100%;
}
.daterangepicker .ranges li {
font-size: 12px;
padding: 8px 12px;
cursor: pointer;
}
.daterangepicker .ranges li:hover {
background-color: #eee;
}
.daterangepicker .ranges li.active {
background-color: #08c;
color: #fff;
}
/* Larger Screen Styling */
@media (min-width: 564px) {
.daterangepicker {
width: auto;
}
.daterangepicker .ranges ul {
width: 140px;
}
.daterangepicker.single .ranges ul {
width: 100%;
}
.daterangepicker.single .drp-calendar.left {
clear: none;
}
.daterangepicker.single .ranges, .daterangepicker.single .drp-calendar {
float: left;
}
.daterangepicker {
direction: ltr;
text-align: left;
}
.daterangepicker .drp-calendar.left {
clear: left;
margin-right: 0;
}
.daterangepicker .drp-calendar.left .calendar-table {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.daterangepicker .drp-calendar.right {
margin-left: 0;
}
.daterangepicker .drp-calendar.right .calendar-table {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.daterangepicker .drp-calendar.left .calendar-table {
padding-right: 8px;
}
.daterangepicker .ranges, .daterangepicker .drp-calendar {
float: left;
}
}
@media (min-width: 730px) {
.daterangepicker .ranges {
width: auto;
}
.daterangepicker .ranges {
float: left;
}
.daterangepicker.rtl .ranges {
float: right;
}
.daterangepicker .drp-calendar.left {
clear: none !important;
}
}

+ 1565
- 0
ShopBundle/Resources/public/js/backend/plugin/daterange/daterangepicker.js
Plik diff jest za duży
Wyświetl plik


+ 7
- 0
ShopBundle/Resources/public/js/backend/plugin/daterange/moment.min.js
Plik diff jest za duży
Wyświetl plik


+ 54
- 2
ShopBundle/Resources/public/js/backend/script/default/init-common.js Wyświetl plik

@@ -11,7 +11,7 @@ function initLcNoty() {


function custom_switch_merchants() {
$('#switch-merchant').on('change',function () {
$('#switch-merchant').on('change', function () {
$('#switch-merchant').parents('form').submit();
});
}
@@ -69,8 +69,60 @@ function initAdminLtePlugin() {
}
});


$('.date-time-range').each(function (i, picker) {

$(picker).daterangepicker({
timePicker: true,
timePickerIncrement: 30,
timePicker24Hour: true,
locale: {
"format": "MM/DD/YYYY HH:mm",
"separator": " - ",
"applyLabel": "Appliquer",
"cancelLabel": "Cancel",
"fromLabel": "From",
"toLabel": "To",
"customRangeLabel": "Custom",
"daysOfWeek": [
"Su",
"Mo",
"Tu",
"We",
"Th",
"Fr",
"Sa"
],
"monthNames": [
"January",
"February",
"March",
"Avril",
"Mai",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"firstDay": 1
}

});
$(picker).on('apply.daterangepicker', function(ev, picker) {
picker.startDate.format('YYYY-MM-DD HH:mm');
console.log(picker.endDate.format('YYYY-MM-DD'));
});
});


}

function moment() {
return '2020-04-08';
}

function setSelect2($select) {
if (typeof $select.data('select2-id') === 'undefined') {
@@ -84,7 +136,7 @@ function setSelect2($select) {
};

if ($select.data('allow-clear') == 'false') {
options.allowClear= false;
options.allowClear = false;
}
if ($select.data('width')) {
options.width = 'auto'

+ 10
- 0
ShopBundle/Resources/public/js/backend/script/default/init-list.js Wyświetl plik

@@ -3,6 +3,16 @@ jQuery(document).ready(function () {
initDataTable();
//generateNotice('error', 'Ceci est une notice');


$('a.action-delete').on('click', function(e) {
e.preventDefault();

$('#modal-delete').modal({ backdrop: true, keyboard: true })
.off('click', '#modal-delete-button')
.on('click', '#modal-delete-button', function () {
$('#delete-form').trigger('submit');
});
});
});

function initDataTable() {

+ 1
- 1
ShopBundle/Resources/views/backend/default/block/macros.html.twig Wyświetl plik

@@ -10,7 +10,7 @@
<div class="card-body {{ fullWidth == true ? 'p-0' : 'row' }}">

{% endmacro %}
v
{% macro endCard(noCol = false) %}
</div>
</div>

+ 5
- 0
ShopBundle/Resources/views/backend/form/custom_bootstrap_4.html.twig Wyświetl plik

@@ -205,3 +205,8 @@
</div>
{% endspaceless %}
{% endblock %}

{% block niche %}
NCICICICI
{{ form_widget(form) }}
{% endblock %}

+ 23
- 0
ShopBundle/Resources/views/backend/reductioncatalog/edit.html.twig Wyświetl plik

@@ -0,0 +1,23 @@
{% extends app.request.query.get('action') == 'edit' ? '@LcShop/backend/default/edit.html.twig' : '@LcShop/backend/default/new.html.twig' %}

{% block entity_form %}
{% include '@LcShop/backend/reductioncatalog/form.html.twig' %}
{% endblock entity_form %}

{% block head_stylesheets %}
{{ parent() }}
<link rel="stylesheet" href="{{ asset('bundles/lcshop/css/backend/adminlte/plugins/daterange/daterangepicker.css') }}">
{% endblock %}

{% block plugin_javascript %}
{{ parent() }}

<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>
{% endblock %}
{% block script_javascript %}
{{ parent() }}
{% include '@LcShop/backend/default/block/script-vuejs.html.twig' %}
{#<script src="{{ asset('bundles/lcshop/js/backend/script/reductioncatalog/vuejs-product-family.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/productfamily/init-edit.js') }}"></script>#}
{% endblock %}

+ 57
- 0
ShopBundle/Resources/views/backend/reductioncatalog/form.html.twig Wyświetl plik

@@ -0,0 +1,57 @@
{{ form_start(form) }}

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

{% set formValues = form.vars.value %}

<div id="lc-reduction-catalog-edit" class="row">

{{ macros.startCard(6, 'Reduction.info.','light') }}
<div class="col-12">
{{ form_row(form.title) }}
</div>
<div class="col-12">
{{ form_row(form.unit) }}
</div>
<div class="col-12">
{{ form_row(form.value) }}
</div>



{{ macros.endCard() }}


{{ macros.startCard(6, 'Reduction.conditions.','light') }}
<div class="col-12">
<div class="form-group">
<label>Date time</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="far fa-clock"></i></span>
</div>
<input type="text" class="form-control float-right date-time-range" id="reservationtime">
<div class="hidden" style="display: none;">
{{ form_row(form.dateStart, {"attr" : {'class' : 'date-start'}}) }}
{{ form_row(form.dateEnd, {"attr" : {'class' : 'date-end'}}) }}
</div>
</div>

</div>
</div>
<div class="col-12">
{{ form_row(form.users) }}
</div>
<div class="col-12">
{{ form_row(form.groupUsers) }}
</div>
<div class="col-12">
{{ form_row(form.productFamilies) }}
</div>
<div class="col-12">
{{ form_row(form.productCategories) }}
</div>
{{ macros.endCard() }}

</div>
{{ form_end(form) }}

Ładowanie…
Anuluj
Zapisz