From 8eb78ef348050c6711f663e7c8d10b9f73ea1453 Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Fri, 4 Nov 2016 14:27:56 +0530 Subject: [PATCH] Bug-fix-patch-16 Starting count for bug patch so numbered this pacth as 16 (I hope we've commit atleast 15 bug fixes till now) Solved bugs: *While replying on a ticket as an agent subject of a mail is getting changed which results in new mail thread creation in emails. *Ticket title sometimes get replaced by ''(an empty string) because sometimes it fetches last created thread as first row and it my not have the subject/title. So tried to fetch only first row which contains subjetc of the tickets. --- app/Http/Controllers/Agent/helpdesk/TicketController.php | 4 ++-- .../views/themes/default1/client/helpdesk/mytickets.blade.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Agent/helpdesk/TicketController.php b/app/Http/Controllers/Agent/helpdesk/TicketController.php index 78993a7c8..35aad3df7 100644 --- a/app/Http/Controllers/Agent/helpdesk/TicketController.php +++ b/app/Http/Controllers/Agent/helpdesk/TicketController.php @@ -566,7 +566,7 @@ class TicketController extends Controller $attachment_files = null; } - $thread = Ticket_Thread::where('ticket_id', '=', $ticket_id)->first(); + $thread = Ticket_Thread::where('ticket_id', '=', $ticket_id)->orderBy('id')->first(); $ticket_subject = $thread->title; $user_id = $tickets->user_id; $user = User::where('id', '=', $user_id)->first(); @@ -2477,7 +2477,7 @@ class TicketController extends Controller return ""; }) ->addColumn('subject', function ($ticket) { - $subject = Ticket_Thread::where('ticket_id', '=', $ticket->id)->first(); + $subject = Ticket_Thread::where('ticket_id', '=', $ticket->id)->orderBy('id')->first(); if (isset($subject->title)) { $string = str_limit($subject->getSubject(), 20); } else { diff --git a/resources/views/themes/default1/client/helpdesk/mytickets.blade.php b/resources/views/themes/default1/client/helpdesk/mytickets.blade.php index dd7d5943d..0e72af7d8 100644 --- a/resources/views/themes/default1/client/helpdesk/mytickets.blade.php +++ b/resources/views/themes/default1/client/helpdesk/mytickets.blade.php @@ -71,7 +71,7 @@ class="active" ?> > id)->first(); + $title = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->orderBy('id')->first(); $string = strip_tags($title->title); if (strlen($string) > 40) { $stringCut = substr($string, 0, 40);