Browse Source

[Backend] création de ticket depuis admin

develop
Fab 3 years ago
parent
commit
d099c3ca98
2 changed files with 12 additions and 2 deletions
  1. +11
    -2
      ShopBundle/Controller/Backend/TicketController.php
  2. +1
    -0
      ShopBundle/Services/TicketUtils.php

+ 11
- 2
ShopBundle/Controller/Backend/TicketController.php View File

@@ -24,10 +24,19 @@ class TicketController extends AdminController

}

public function persistEntity($entity)
public function persistTicketEntity($entity, $form)
{
$entity->setStatus(Ticket::TICKET_STATUS_OPEN);
parent::persistEntity($entity);

$ticket = $this->ticketUtils->createTicket([
'user' => $entity->getUser(),
'type' => $entity->getType(),
'orderShop' => $entity->getOrderShop(),
'subject' => $entity->getSubject(),
'message' => $form->get('message')->getData(),
'answerByAdmin' =>true,
]) ;

}

protected function createListQueryBuilder($entityClass, $sortDirection, $sortField = null, $dqlFilter = null)

+ 1
- 0
ShopBundle/Services/TicketUtils.php View File

@@ -63,6 +63,7 @@ class TicketUtils
$ticketMessage->setStatus(1) ;
$ticketMessage->setTicket($ticket) ;
$ticketMessage->setMessage($params['message']) ;
if(isset($params['answerByAdmin']) && $params['answerByAdmin'])$ticketMessage->setAnswerByAdmin(true);
$this->em->persist($ticketMessage);

$this->em->flush() ;

Loading…
Cancel
Save