Pārlūkot izejas kodu

[Backend] création de ticket depuis admin

develop
Fab pirms 3 gadiem
vecāks
revīzija
d099c3ca98
2 mainītis faili ar 12 papildinājumiem un 2 dzēšanām
  1. +11
    -2
      ShopBundle/Controller/Backend/TicketController.php
  2. +1
    -0
      ShopBundle/Services/TicketUtils.php

+ 11
- 2
ShopBundle/Controller/Backend/TicketController.php Parādīt failu

@@ -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 Parādīt failu

@@ -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() ;

Notiek ielāde…
Atcelt
Saglabāt