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);
?>
@@ -284,9 +222,63 @@ foreach ($conversations as $conversation) {
+
{!! $body !!}
+ @if($conversation->firstContent()=='yes') ++