From 6f7ee1569cdd7ce297a0f6e5df482427ec0ca1a6 Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Mon, 28 Nov 2016 16:41:55 +0530 Subject: [PATCH] Bug-fix-patch4 # client close ticket thread is not internal # change lenght of titcket title in cleint ticket list page # client side ticket attachment issue fixed --- .../Agent/helpdesk/TicketController.php | 7 +- .../client/helpdesk/ckeckticket.blade.php | 204 +++++++++--------- .../client/helpdesk/mytickets.blade.php | 5 +- 3 files changed, 106 insertions(+), 110 deletions(-) diff --git a/app/Http/Controllers/Agent/helpdesk/TicketController.php b/app/Http/Controllers/Agent/helpdesk/TicketController.php index a890b2988..a442760fc 100644 --- a/app/Http/Controllers/Agent/helpdesk/TicketController.php +++ b/app/Http/Controllers/Agent/helpdesk/TicketController.php @@ -1246,6 +1246,11 @@ class TicketController extends Controller if ($ticket_status == null) { return redirect()->route('unauth'); } + if(\Auth::user()->role == 'user') { + $is_internal = 0; + } else { + $is_internal = 1; + } $ticket_status->status = 3; $ticket_status->closed = 1; $ticket_status->closed_at = date('Y-m-d H:i:s'); @@ -1256,7 +1261,7 @@ class TicketController extends Controller $thread = new Ticket_Thread(); $thread->ticket_id = $ticket_status->id; $thread->user_id = Auth::user()->id; - $thread->is_internal = 1; + $thread->is_internal = $is_internal; $thread->body = $ticket_status_message->message.' '.Auth::user()->first_name.' '.Auth::user()->last_name; $thread->save(); diff --git a/resources/views/themes/default1/client/helpdesk/ckeckticket.blade.php b/resources/views/themes/default1/client/helpdesk/ckeckticket.blade.php index 08ffb3b63..6c84b8412 100644 --- a/resources/views/themes/default1/client/helpdesk/ckeckticket.blade.php +++ b/resources/views/themes/default1/client/helpdesk/ckeckticket.blade.php @@ -1,5 +1,4 @@ @extends('themes.default1.client.layout.client') - @section('content') first(); @@ -89,8 +88,7 @@ $thread = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', \Cryp priority_id)->first(); ?> -
- +
{!! Lang::get('lang.priority') !!}: priority_id)->first(); ?> - - {{$priority->priority}} - + @endif {!! Lang::get('lang.department') !!}: @@ -171,69 +167,11 @@ $thread = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', \Cryp
id)->where('is_internal', '=', 0)->paginate(10); +$ij = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $tickets->id)->first(); +$user = App\User::where('id', '=', $tickets->user_id)->first(); foreach ($conversations as $conversation) { - $ConvDate1 = $conversation->created_at; - $ConvDate = explode(' ', $ConvDate1); - - $date = $ConvDate[0]; - $time = $ConvDate[1]; - $time = substr($time, 0, -3); - if (isset($data) && $date == $data) { - - } else { - $data = $ConvDate[0]; - } - $role = App\User::where('id', '=', $conversation->user_id)->first(); - - $attachment = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id', '=', $conversation->id)->first(); - if ($attachment == null) { - $body = $conversation->body; - } else { - $body = $conversation->body; - $attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id', '=', $conversation->id)->orderBy('id', 'DESC')->get(); - foreach ($attachments as $attachment) { - if ($attachment->type == 'pdf') { - - } elseif ($attachment->type == 'docx') { - - } else { - $image = @imagecreatefromstring($attachment->file); - ob_start(); - imagejpeg($image, null, 80); - $data = ob_get_contents(); - ob_end_clean(); - $var = ''; - $body = str_replace($attachment->name, "data:image/jpg;base64," . base64_encode($data), $body); - - $string = $body; - $start = ""; - $end = ""; - if (strpos($string, $start) == false || strpos($string, $start) == false) { - - } else { - $ini = strpos($string, $start); - $ini += strlen($start); - $len = strpos($string, $end, $ini) - $ini; - $parsed = substr($string, $ini, $len); - $body2 = $parsed; - $body = str_replace($body2, " ", $body); - } - } - } - } - $string = $body; - $start = ""; - $end = ""; - if (strpos($string, $start) == false || strpos($string, $start) == false) { - - } else { - $ini = strpos($string, $start); - $ini += strlen($start); - $len = strpos($string, $end, $ini) - $ini; - $parsed = substr($string, $ini, $len); - $body2 = $parsed; - $body = str_replace($body2, " ", $body); - } + $role = $conversation->user; + $body = $conversation->thread($conversation->body); ?>
  1. @@ -265,10 +203,10 @@ foreach ($conversations as $conversation) { rating_scale; $i++) { ?> /> - + @@ -284,9 +222,63 @@ foreach ($conversations as $conversation) {
-

{!! $body !!}

+ @if($conversation->firstContent()=='yes') +
+ + +
+ + @else + {!! $body !!} + @endif + @if($conversation->id == $ij->id) + id)->get(); ?> + @if(isset($ticket_form_datas)) + +
+ + + @foreach($ticket_form_datas as $ticket_form_data) + + + + + @endforeach +
{!! $ticket_form_data->getFieldKeyLabel() !!}{!! removeUnderscore($ticket_form_data->content) !!}
+ + @endif + @endif
+