Selaa lähdekoodia

[Backend] création de ticket depuis admin

develop
Fab 3 vuotta sitten
vanhempi
commit
d099c3ca98
2 muutettua tiedostoa jossa 12 lisäystä ja 2 poistoa
  1. +11
    -2
      ShopBundle/Controller/Backend/TicketController.php
  2. +1
    -0
      ShopBundle/Services/TicketUtils.php

+ 11
- 2
ShopBundle/Controller/Backend/TicketController.php Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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…
Peruuta
Tallenna