Browse Source

ticker+reminder

feature/ticket
Charly 3 years ago
parent
commit
4e74ee5946
11 changed files with 13 additions and 426 deletions
  1. +2
    -2
      Controller/Dashboard/DashboardAdminAdminController.php
  2. +1
    -1
      Controller/Reminder/ReminderAdminController.php
  3. +2
    -2
      Model/Order/OrderShopModel.php
  4. +0
    -8
      Model/Ticket/TicketInterface.php
  5. +0
    -8
      Model/Ticket/TicketMessageInterface.php
  6. +0
    -105
      Model/Ticket/TicketMessageModel.php
  7. +6
    -252
      Model/Ticket/TicketModel.php
  8. +0
    -1
      Model/User/GroupUserModel.php
  9. +2
    -3
      Model/User/UserModel.php
  10. +0
    -22
      Repository/Ticket/TicketMessageRepository.php
  11. +0
    -22
      Repository/Ticket/TicketRepository.php

Controller/Dashboard/DashboardAdminController.php → Controller/Dashboard/DashboardAdminAdminController.php View File

@@ -4,9 +4,9 @@ namespace Lc\CaracoleBundle\Controller\Dashboard;

use EasyCorp\Bundle\EasyAdminBundle\Config\Assets;
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use Lc\SovBundle\Controller\Dashboard\DashboardController as SovDashboardController ;
use Lc\SovBundle\Controller\Dashboard\DashboardAdminController as SovDashboardController ;

class DashboardAdminController extends SovDashboardController
class DashboardAdminAdminController extends SovDashboardController
{
public function configureCrud(): Crud
{

+ 1
- 1
Controller/Reminder/ReminderAdminController.php View File

@@ -3,7 +3,7 @@
namespace Lc\CaracoleBundle\Controller\Reminder;

use Lc\CaracoleBundle\Controller\AdminControllerTrait;
use Lc\SovBundle\Controller\Reminder\ReminderController as SovReminderController;
use Lc\SovBundle\Controller\Reminder\ReminderAdminController as SovReminderController;

abstract class ReminderAdminController extends SovReminderController
{

+ 2
- 2
Model/Order/OrderShopModel.php View File

@@ -13,7 +13,7 @@ use Lc\CaracoleBundle\Model\File\DocumentInterface;
use Lc\CaracoleBundle\Model\File\DocumentModel;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Model\Ticket\TicketInterface;
use Lc\SovBundle\Model\Ticket\TicketInterface;
use Lc\CaracoleBundle\Model\User\VisitorInterface;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
use Lc\SovBundle\Model\User\UserInterface;
@@ -125,7 +125,7 @@ abstract class OrderShopModel extends AbstractLightEntity implements FilterMerch
protected $updatedBy;

/**
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Ticket\TicketInterface", mappedBy="orderShop")
* @ORM\OneToMany(targetEntity="Lc\SovBundle\Model\Ticket\TicketInterface", mappedBy="orderShop")
*/
protected $tickets;


+ 0
- 8
Model/Ticket/TicketInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Ticket ;

interface TicketInterface
{

}

+ 0
- 8
Model/Ticket/TicketMessageInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Ticket ;

interface TicketMessageInterface
{

}

+ 0
- 105
Model/Ticket/TicketMessageModel.php View File

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

namespace Lc\CaracoleBundle\Model\Ticket;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Lc\SovBundle\Doctrine\Extension\StatusInterface;
use Lc\SovBundle\Doctrine\Extension\StatusTrait;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;

/**
* @ORM\MappedSuperclass()
*/
abstract class TicketMessageModel extends AbstractLightEntity implements StatusInterface
{
use StatusTrait;

/**
* @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $createdBy;

/**
* @Gedmo\Blameable(on="update")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $updatedBy;

/**
* @ORM\Column(type="text")
*/
protected $message;

/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Ticket\TicketInterface", inversedBy="ticketMessages")
* @ORM\JoinColumn(nullable=false)
*/
protected $ticket;

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

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

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

public function getMessage(): ?string
{
return $this->message;
}

public function setMessage(string $message): self
{
$this->message = $message;

return $this;
}

public function getTicket(): ?TicketInterface
{
return $this->ticket;
}

public function setTicket(?TicketInterface $ticket): self
{
$this->ticket = $ticket;

return $this;
}

public function getAnswerByAdmin(): ?bool
{
return $this->answerByAdmin;
}

public function setAnswerByAdmin(?bool $answerByAdmin): self
{
$this->answerByAdmin = $answerByAdmin;

return $this;
}

public function getImageFilename(): ?string
{
return $this->imageFilename;
}

public function setImageFilename(?string $imageFilename): self
{
$this->imageFilename = $imageFilename;

return $this;
}
}

+ 6
- 252
Model/Ticket/TicketModel.php View File

@@ -2,46 +2,19 @@

namespace Lc\CaracoleBundle\Model\Ticket;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Gedmo\Mapping\Annotation as Gedmo;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Model\Ticket\TicketModel as SovTicketModel;

/**
* @ORM\MappedSuperclass()
*/
abstract class TicketModel extends AbstractLightEntity implements FilterMerchantInterface
abstract class TicketModel extends SovTicketModel implements FilterMerchantInterface
{
const TYPE_PRODUCT_UNAVAILABLE = 'product-unavailable';
const TYPE_PRODUCT_ERROR = 'product-error';
const TYPE_TECHNICAL_PROBLEM = 'technical-problem';
const TYPE_GENERAL_QUESTION = 'general-question';
const TYPE_POULTRY_BOOKING = 'poultry-booking';
const TYPE_MESSAGE_FROM_PDL = 'message-from-pdl';


const TICKET_STATUS_OPEN = 'open';
const TICKET_STATUS_BEING_PROCESSED = 'being-processed';
const TICKET_STATUS_CLOSED = 'closed';

/**
* @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $createdBy;

/**
* @Gedmo\Blameable(on="update")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $updatedBy;

/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
@@ -49,252 +22,33 @@ abstract class TicketModel extends AbstractLightEntity implements FilterMerchant
*/
protected $merchant;

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

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

/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderShopInterface", inversedBy="tickets")
*/
protected $orderShop;

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

/**
* @ORM\Column(type="array", nullable=true)
*/
protected $tags = [];

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

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

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

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

/**
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Ticket\TicketMessageInterface", mappedBy="ticket", orphanRemoval=true)
* @ORM\OrderBy({"id" = "ASC"})
*/
protected $ticketMessages;

/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="tickets")
*/
protected $user;

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

public function getUsername()
{
if ($this->getUser()) {
return $this->getUser()->getName();
} else {
return strtoupper($this->getVisitorLastname()) . ' ' . $this->getVisitorFirstname();
}
}

public function getVisitorInfos()
{
return strtoupper($this->getVisitorLastname()) . ' ' . $this->getVisitorFirstname(
) . ' (' . $this->getVisitorEmail() . ')';
}

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

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

return $this;
}

public function getType(): ?string
{
return $this->type;
}

public function setType(string $type): self
{
$this->type = $type;

return $this;
}

public function getTypeLabel(): string
{
return 'field.Ticket.typeOptions.' . $this->getType();
}

public function getStatus(): ?string
{
return $this->status;
}

public function setStatus(string $status): self
{
$this->status = $status;

return $this;
}

public function getStatusLabel(): string
{
return 'field.Ticket.statusOptions.' . $this->getStatus();
}

public function getOrderShop(): ?OrderShopInterface
public function getOrderShop(): OrderShopInterface
{
return $this->orderShop;
}

public function setOrderShop(?OrderShopInterface $orderShop): self
public function setOrderShop(OrderShopInterface $orderShop): self
{
$this->orderShop = $orderShop;

return $this;
}

public function getSubject(): ?string
{
return $this->subject;
}

public function setSubject(string $subject): self
{
$this->subject = $subject;

return $this;
}

public function getTags(): ?array
{
return $this->tags;
}

public function setTags(?array $tags): self
{
$this->tags = $tags;

return $this;
}

public function getVisitorFirstname(): ?string
{
return $this->visitorFirstname;
}

public function setVisitorFirstname(?string $visitorFirstname): self
{
$this->visitorFirstname = $visitorFirstname;

return $this;
}

public function getVisitorLastname(): ?string
{
return $this->visitorLastname;
}

public function setVisitorLastname(?string $visitorLastname): self
{
$this->visitorLastname = $visitorLastname;

return $this;
}

public function getVisitorEmail(): ?string
{
return $this->visitorEmail;
}

public function setVisitorEmail(?string $visitorEmail): self
{
$this->visitorEmail = $visitorEmail;

return $this;
}

public function getVisitorToken(): ?string
{
return $this->visitorToken;
}

public function setVisitorToken(?string $visitorToken): self
{
$this->visitorToken = $visitorToken;

return $this;
}

/**
* @return Collection|TicketMessageInterface[]
*/
public function getTicketMessages(): Collection
{
return $this->ticketMessages;
}

public function addTicketMessage(TicketMessageInterface $ticketMessage): self
{
if (!$this->ticketMessages->contains($ticketMessage)) {
$this->ticketMessages[] = $ticketMessage;
$ticketMessage->setTicket($this);
}

return $this;
}

public function removeTicketMessage(TicketMessageInterface $ticketMessage): self
{
if ($this->ticketMessages->contains($ticketMessage)) {
$this->ticketMessages->removeElement($ticketMessage);
// set the owning side to null (unless already changed)
if ($ticketMessage->getTicket() === $this) {
$ticketMessage->setTicket(null);
}
}

return $this;
}

public function getUser(): ?UserInterface
{
return $this->user;
}

public function setUser(?UserInterface $user): self
{
$this->user = $user;

return $this;
}
}

+ 0
- 1
Model/User/GroupUserModel.php View File

@@ -12,7 +12,6 @@ use Lc\SovBundle\Model\User\GroupUserModel as SovGroupUserModel;
*/
abstract class GroupUserModel extends SovGroupUserModel implements FilterMerchantInterface
{

/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="groupUsers")
* @ORM\JoinColumn(nullable=false)

+ 2
- 3
Model/User/UserModel.php View File

@@ -13,8 +13,7 @@ use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface;
use Lc\SovBundle\Model\User\User as SovUserModel;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Ticket\TicketInterface;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Model\Ticket\TicketInterface;

/**
* @ORM\MappedSuperclass()
@@ -85,7 +84,7 @@ abstract class UserModel extends SovUserModel
protected $userMerchants;

/**
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Ticket\TicketInterface", mappedBy="user")
* @ORM\OneToMany(targetEntity="Lc\SovBundle\Model\Ticket\TicketInterface", mappedBy="user")
*/
protected $tickets;


+ 0
- 22
Repository/Ticket/TicketMessageRepository.php View File

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

namespace Lc\CaracoleBundle\Repository\Ticket;

use Lc\CaracoleBundle\Model\Ticket\TicketMessageInterface;
use Lc\SovBundle\Repository\AbstractRepository;

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


}

+ 0
- 22
Repository/Ticket/TicketRepository.php View File

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

namespace Lc\CaracoleBundle\Repository\Ticket;

use Lc\CaracoleBundle\Model\Ticket\TicketInterface;
use Lc\SovBundle\Repository\AbstractRepository;

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


}

Loading…
Cancel
Save