From ac978423ad2845fd844c0dd9b250ef1da3f69045 Mon Sep 17 00:00:00 2001 From: Sanjeev Papnoi Date: Thu, 24 Jun 2021 16:12:33 +0530 Subject: [PATCH 01/17] updates --- Controller/Ticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/Ticket.php b/Controller/Ticket.php index dfe1a4f..6ea34f5 100644 --- a/Controller/Ticket.php +++ b/Controller/Ticket.php @@ -197,7 +197,7 @@ public function ticketadd(Request $request) if($request->request->get('customFields') || $request->files->get('customFields')) { $this->get('ticket.service')->addTicketCustomFields($ticket, $request->request->get('customFields'), $request->files->get('customFields')); } - $request->getSession()->getFlashBag()->set('success', sprintf('Success ! Ticket #%s has been created successfully.', $ticket->getId())); + $this->addFlash('success', $this->translator->trans('Success ! Ticket has been created successfully.')); } else { $this->addFlash('warning', $this->translator->trans('Warning ! Can not create ticket, invalid details.')); } From 15e0291a677e1593297fe4834df8c77a1759964f Mon Sep 17 00:00:00 2001 From: Sanjeev Papnoi Date: Thu, 24 Jun 2021 16:24:53 +0530 Subject: [PATCH 02/17] updates --- Controller/Ticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/Ticket.php b/Controller/Ticket.php index 6ea34f5..10a5b53 100644 --- a/Controller/Ticket.php +++ b/Controller/Ticket.php @@ -160,7 +160,7 @@ public function ticketadd(Request $request) $customerEmail = $params['email'] = $request->request->get('from'); $customer = $em->getRepository('UVDeskCoreFrameworkBundle:User')->findOneBy(array('email' => $customerEmail)); - $params['flag'] = (!$customer) ? 1 : 0;$request->getSession()->getFlashBag()->set('success', $this->translator->trans('Success ! Ticket has been created successfully.')); + $params['flag'] = (!$customer) ? 1 : 0; $data['firstName'] = current($nameDetails = explode(' ', $request->request->get('name'))); $data['fullname'] = $request->request->get('name'); From 818e3189c73cb10795a8c3d1ecd1e3023de94dbb Mon Sep 17 00:00:00 2001 From: Sanjeev Papnoi Date: Fri, 25 Jun 2021 10:17:24 +0530 Subject: [PATCH 03/17] updates --- Resources/views/Knowledgebase/ticket.html.twig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Resources/views/Knowledgebase/ticket.html.twig b/Resources/views/Knowledgebase/ticket.html.twig index c21ffd4..8a043cd 100644 --- a/Resources/views/Knowledgebase/ticket.html.twig +++ b/Resources/views/Knowledgebase/ticket.html.twig @@ -217,6 +217,9 @@ {{ include('@UVDeskCoreFramework/Templates/attachment.html.twig') }} + + {% endblock %} From 13bc9b80a91d949063d11394435df3f1b3755207 Mon Sep 17 00:00:00 2001 From: Sanjeev Papnoi Date: Fri, 23 Jul 2021 11:33:37 +0530 Subject: [PATCH 11/17] updates --- Controller/Ticket.php | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/Controller/Ticket.php b/Controller/Ticket.php index c7708a6..2c86114 100644 --- a/Controller/Ticket.php +++ b/Controller/Ticket.php @@ -275,11 +275,14 @@ public function saveReply(int $id, Request $request) $this->isWebsiteActive(); $data = $request->request->all(); $ticket = $this->getDoctrine()->getRepository('UVDeskCoreFrameworkBundle:Ticket')->find($id); + $user = $this->userService->getSessionUser(); - // Proceed only if user has access to the resource - if (false == $this->ticketService->isTicketAccessGranted($ticket)) { - throw new \Exception('Access Denied', 403); - } + // process only if access for the resource. + if (empty($ticket) || ( (!empty($user)) && $user->getId() != $ticket->getCustomer()->getId()) ) { + if(!$this->isCollaborator($ticket, $user)) { + throw new \Exception('Access Denied', 403); + } + } if($_POST) { if(str_replace(' ','',str_replace(' ','',trim(strip_tags($data['message'], '')))) != "") { @@ -510,9 +513,13 @@ public function downloadAttachmentZip(Request $request) } $ticket = $attachment->getThread()->getTicket(); - // Proceed only if user has access to the resource - if (false == $this->ticketService->isTicketAccessGranted($ticket)) { - throw new \Exception('Access Denied', 403); + $user = $this->userService->getSessionUser(); + + // process only if access for the resource. + if (empty($ticket) || ( (!empty($user)) && $user->getId() != $ticket->getCustomer()->getId()) ) { + if(!$this->isCollaborator($ticket, $user)) { + throw new \Exception('Access Denied', 403); + } } $zipname = 'attachments/' .$threadId.'.zip'; @@ -572,10 +579,14 @@ public function ticketCollaboratorXhr(Request $request) $content = json_decode($request->getContent(), true); $em = $this->getDoctrine()->getManager(); $ticket = $em->getRepository('UVDeskCoreFrameworkBundle:Ticket')->find($content['ticketId']); - - if (false == $this->ticketService->isTicketAccessGranted($ticket)) { - throw new \Exception('Access Denied', 403); - } + $user = $this->userService->getSessionUser(); + + // process only if access for the resource. + if (empty($ticket) || ( (!empty($user)) && $user->getId() != $ticket->getCustomer()->getId()) ) { + if(!$this->isCollaborator($ticket, $user)) { + throw new \Exception('Access Denied', 403); + } + } if ($request->getMethod() == "POST") { if ($content['email'] == $ticket->getCustomer()->getEmail()) { @@ -601,7 +612,6 @@ public function ticketCollaboratorXhr(Request $request) $ticket->lastCollaborator = $collaborator; $collaborator = $em->getRepository('UVDeskCoreFrameworkBundle:User')->find($collaborator->getId()); - $json['collaborator'] = $this->userService->getCustomerPartialDetailById($collaborator->getId()); $json['alertClass'] = 'success'; $json['alertMessage'] = $this->translator->trans('Success ! Collaborator added successfully.'); From cbfa3667df302ba754c2c4791cad06665c816e5a Mon Sep 17 00:00:00 2001 From: Sanjeev Papnoi Date: Sat, 7 Aug 2021 16:05:24 +0530 Subject: [PATCH 12/17] status translation at customer end --- .../views/Knowledgebase/ticketList.html.twig | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Resources/views/Knowledgebase/ticketList.html.twig b/Resources/views/Knowledgebase/ticketList.html.twig index fb63e14..91026aa 100644 --- a/Resources/views/Knowledgebase/ticketList.html.twig +++ b/Resources/views/Knowledgebase/ticketList.html.twig @@ -192,7 +192,21 @@ - <%- status.description %> + <% if (status.description == 'Open') { %> + {{ 'Open'|trans }} + <% } else if (status.description == 'Closed') { %> + {{ 'Closed'|trans }} + <% } else if (status.description == 'Pending') { %> + {{ 'Pending'|trans }} + <% } else if (status.description == 'Answered') { %> + {{ 'Answered'|trans }} + <% } else if(status.description == 'Resolved') { %> + {{ 'Resolved'|trans }} + <% } else if(status.description == 'UnAnswered') { %> + {{ 'UnAnswered'|trans }} + <% } else if(status.description == 'UnAssigned') { %> + {{ 'UnAssigned'|trans }} + <% } %> From 934c6a80e4661e119591349777e720d50cb6f8e6 Mon Sep 17 00:00:00 2001 From: Sanjeev Papnoi Date: Thu, 12 Aug 2021 11:38:06 +0530 Subject: [PATCH 13/17] updates --- Resources/views/Templates/layout.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/views/Templates/layout.html.twig b/Resources/views/Templates/layout.html.twig index 42fda22..2cd389d 100644 --- a/Resources/views/Templates/layout.html.twig +++ b/Resources/views/Templates/layout.html.twig @@ -3,8 +3,8 @@ - - + + From 422281b99b22615319b61587158f61a6f40209e2 Mon Sep 17 00:00:00 2001 From: Sanjeev Papnoi Date: Thu, 12 Aug 2021 13:57:16 +0530 Subject: [PATCH 14/17] remove customer image --- Controller/Customer.php | 4 ++++ .../views/Knowledgebase/customerAccount.html.twig | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Controller/Customer.php b/Controller/Customer.php index bd185f2..75b6525 100755 --- a/Controller/Customer.php +++ b/Controller/Customer.php @@ -183,6 +183,10 @@ public function Account(Request $request) $userInstance->setProfileImagePath($assetDetails['path']); } + if ($request->get('removeImage') == 'on') { + $userInstance->setProfileImagePath(''); + } + $userInstance = $userInstance->setContactNumber($data['contactNumber']); $em->persist($userInstance); $em->flush(); diff --git a/Resources/views/Knowledgebase/customerAccount.html.twig b/Resources/views/Knowledgebase/customerAccount.html.twig index 2433529..fb50848 100644 --- a/Resources/views/Knowledgebase/customerAccount.html.twig +++ b/Resources/views/Knowledgebase/customerAccount.html.twig @@ -187,7 +187,18 @@ - + + {% if isHaveImage %} +
+ +
+ {% endif %} +
From 1528c8487e8a09902898d2f4585b7b360eff4836 Mon Sep 17 00:00:00 2001 From: Sanjay Date: Thu, 19 Aug 2021 16:50:45 +0530 Subject: [PATCH 15/17] Fix issue: Reply from collaborator gmail so collaborator name is not showing. & update related date icon --- Controller/Customer.php | 4 ++-- Resources/views/Staff/branding.html.twig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Controller/Customer.php b/Controller/Customer.php index 75b6525..8b92b23 100755 --- a/Controller/Customer.php +++ b/Controller/Customer.php @@ -184,7 +184,7 @@ public function Account(Request $request) } if ($request->get('removeImage') == 'on') { - $userInstance->setProfileImagePath(''); + $userInstance->setProfileImagePath(null); } $userInstance = $userInstance->setContactNumber($data['contactNumber']); @@ -232,4 +232,4 @@ public function searchArticle(Request $request) } -} \ No newline at end of file +} diff --git a/Resources/views/Staff/branding.html.twig b/Resources/views/Staff/branding.html.twig index b571f2c..283afea 100644 --- a/Resources/views/Staff/branding.html.twig +++ b/Resources/views/Staff/branding.html.twig @@ -457,11 +457,11 @@
- +
- +
{{ 'Time duration between which message will be displayed(if applicable)'|trans }}
From 5f28655aa7f18e84de9ee4a35c7c7ea858c968ea Mon Sep 17 00:00:00 2001 From: Sanjay Date: Fri, 20 Aug 2021 13:57:14 +0530 Subject: [PATCH 16/17] Fix issue Reply from Customer Side also added CC and BCC mails So Not going to mail CC and BCC mail id's --- Controller/Ticket.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Controller/Ticket.php b/Controller/Ticket.php index 2c86114..fc3cb3c 100644 --- a/Controller/Ticket.php +++ b/Controller/Ticket.php @@ -326,10 +326,12 @@ public function saveReply(int $id, Request $request) if ($thread->getcreatedBy() == 'customer') { $event = new GenericEvent(CoreWorkflowEvents\Ticket\CustomerReply::getId(), [ 'entity' => $ticket, + 'thread' => $thread ]); } else { $event = new GenericEvent(CoreWorkflowEvents\Ticket\CollaboratorReply::getId(), [ 'entity' => $ticket, + 'thread' => $thread ]); } @@ -640,4 +642,4 @@ public function ticketCollaboratorXhr(Request $request) $response->headers->set('Content-Type', 'application/json'); return $response; } -} \ No newline at end of file +} From 663e972af1a46309dda308bb1ab162e885ed9c52 Mon Sep 17 00:00:00 2001 From: Sanjeev Papnoi Date: Sat, 21 Aug 2021 13:16:44 +0530 Subject: [PATCH 17/17] updates --- .../Announcement/announcementForm.html.twig | 39 ++++++++----------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/Resources/views/Staff/Announcement/announcementForm.html.twig b/Resources/views/Staff/Announcement/announcementForm.html.twig index e6f7f5d..20d5e62 100644 --- a/Resources/views/Staff/Announcement/announcementForm.html.twig +++ b/Resources/views/Staff/Announcement/announcementForm.html.twig @@ -50,31 +50,31 @@
- +
- Choose a promo tag + {{ 'Choose a promo tag'|trans }}
- +
- Tag background color + {{ 'Tag background color'|trans }}
- +
@@ -84,7 +84,7 @@
- +
@@ -94,20 +94,20 @@
- +
- Choose a status + {{ 'Choose a status'|trans }}
- +
- Choose a group + {{ 'Choose a group'|trans }}
@@ -147,7 +147,6 @@ textColor = app.appView.getTextColorBasedBackground($(this).val()); $(this).css('color', textColor) }); - var AnnouncementModel = Backbone.Model.extend({ validation: { 'announcement_form[title]':[{ @@ -189,7 +188,6 @@ } } }); - var AnnouncementForm = Backbone.View.extend({ events : { 'click .uv-btn': "savePromotion" @@ -199,7 +197,6 @@ textColor = app.appView.getTextColorBasedBackground($(this).val()); $(this).css('color', textColor) }); - Backbone.Validation.bind(this); var jsonContext = ''; for (var field in jsonContext) { @@ -207,11 +204,9 @@ } }, formChanegd: function(e) { - // this.model.set(Backbone.$(e.currentTarget).attr('title'), Backbone.$(e.currentTarget).val()) - // this.model.isValid([Backbone.$(e.currentTarget).attr('name')]) + }, savePromotion : function (e) { - debugger e.preventDefault(); this.model.set(this.$el.serializeObject()); if(this.model.isValid(true)) { @@ -224,9 +219,7 @@ $(selector).find('.uv-filtered-tags .uv-btn-small').each(function() { ids.push($(this).attr('data-id')) }); - $(selector).find("input[type='hidden']").val(ids.join(',')) - return ids; }, addEntity: function(e) {