From decf7a6f1eb9db705a3a9a2c17d1a95d3fe246e6 Mon Sep 17 00:00:00 2001 From: Abhishek Gupta Date: Mon, 8 May 2023 14:05:28 +0530 Subject: [PATCH 1/4] Changes for create ticket message icon: https://github.com/uvdesk/core-framework/issues/629 --- Resources/views/Snippets/createMemberTicket.html.twig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Resources/views/Snippets/createMemberTicket.html.twig b/Resources/views/Snippets/createMemberTicket.html.twig index 7d4c31a1f..b42eb022c 100644 --- a/Resources/views/Snippets/createMemberTicket.html.twig +++ b/Resources/views/Snippets/createMemberTicket.html.twig @@ -440,6 +440,13 @@ }, 'reply' : { fn: function(value) { + var content = tinyMCE.activeEditor.getContent(); + if (content) { + return false; + }else { + return true; + } + if(!tinyMCE.get("uv-edit-create-thread")) return false; var html = tinyMCE.get("uv-edit-create-thread").getContent(); From 1876ef16cc0c8c043bb1d45f7595968567655574 Mon Sep 17 00:00:00 2001 From: Abhishek Gupta Date: Wed, 31 May 2023 16:10:59 +0530 Subject: [PATCH 2/4] Admin can not create ticket when email is bloked --- Controller/Ticket.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Controller/Ticket.php b/Controller/Ticket.php index af6f51ae1..9c844d75d 100755 --- a/Controller/Ticket.php +++ b/Controller/Ticket.php @@ -31,6 +31,8 @@ use Webkul\UVDesk\CoreFrameworkBundle\Entity\User; use Webkul\UVDesk\CoreFrameworkBundle\Entity\TicketPriority; use Webkul\UVDesk\CoreFrameworkBundle\Entity\TicketStatus; +use Webkul\UVDesk\CoreFrameworkBundle\Entity as CoreEntites; + class Ticket extends AbstractController { @@ -172,11 +174,11 @@ public function saveTicket(Request $request) $requestParams = $request->request->all(); $entityManager = $this->getDoctrine()->getManager(); $response = $this->redirect($this->generateUrl('helpdesk_member_ticket_collection')); - + if ($request->getMethod() != 'POST' || false == $this->userService->isAccessAuthorized('ROLE_AGENT_CREATE_TICKET')) { return $response; } - + // Get referral ticket if any $ticketValidationGroup = 'CreateTicket'; $referralURL = $request->headers->get('referer'); @@ -185,16 +187,23 @@ public function saveTicket(Request $request) $iterations = explode('/', $referralURL); $referralId = array_pop($iterations); $expectedReferralURL = $this->generateUrl('helpdesk_member_ticket', ['ticketId' => $referralId], UrlGeneratorInterface::ABSOLUTE_URL); - + if ($referralURL === $expectedReferralURL) { $referralTicket = $entityManager->getRepository(CoreBundleTicket::class)->findOneById($referralId); - + if (!empty($referralTicket)) { $ticketValidationGroup = 'CustomerCreateTicket'; } } } + $email = $request->request->get('from'); + $website = $entityManager->getRepository(CoreEntites\Website::class)->findOneByCode('knowledgebase'); + if(!empty($email) && $this->ticketService->isEmailBlocked($email, $website)) { + $request->getSession()->getFlashBag()->set('warning', $this->translator->trans('Warning ! Cannot create ticket, given email is blocked.')); + return $this->redirect($this->generateUrl('helpdesk_member_ticket_collection')); + } + $ticketType = $entityManager->getRepository(TicketType::class)->findOneById($requestParams['type']); try { From 4cd96eefd9fdfe2d1ac1ddf748823c8c4e5f45b4 Mon Sep 17 00:00:00 2001 From: Abhishek Gupta Date: Thu, 1 Jun 2023 16:32:04 +0530 Subject: [PATCH 3/4] Update in tickets view page: #32 --- Resources/views/ticket.html.twig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Resources/views/ticket.html.twig b/Resources/views/ticket.html.twig index d15543ccc..43be768c6 100755 --- a/Resources/views/ticket.html.twig +++ b/Resources/views/ticket.html.twig @@ -420,6 +420,8 @@ {{ 'Email'|trans }} {% elseif ticket.source == 'formbuilder' %} {{ 'Formbuilder'|trans }} + {% elseif ticket.source == 'api' %} + {{ 'Api'|trans }} {% else %} {{ 'Website'|trans }} {% endif %} From c4d4f7a35010269fce88f407cdec240beeca2d54 Mon Sep 17 00:00:00 2001 From: Abhishek Gupta Date: Thu, 1 Jun 2023 17:53:55 +0530 Subject: [PATCH 4/4] Change icon of channel in tickets view page --- Resources/views/ticket.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/views/ticket.html.twig b/Resources/views/ticket.html.twig index 43be768c6..3796d330b 100755 --- a/Resources/views/ticket.html.twig +++ b/Resources/views/ticket.html.twig @@ -421,7 +421,7 @@ {% elseif ticket.source == 'formbuilder' %} {{ 'Formbuilder'|trans }} {% elseif ticket.source == 'api' %} - {{ 'Api'|trans }} + {{ 'Api'|trans }} {% else %} {{ 'Website'|trans }} {% endif %}