func_corrections

This commit is contained in:
KNaveenraj-ladybird
2023-10-05 17:35:09 +05:30
parent aa9072cc93
commit c138a85707
4 changed files with 497 additions and 183 deletions

View File

@@ -410,10 +410,9 @@ class AuthController extends Controller
return \Redirect::route($request->input('referer')); return \Redirect::route($request->input('referer'));
} }
return \Redirect::route('/'); // return \Redirect::route('/');
} else {
return redirect()->intended($this->redirectPath());
} }
return redirect()->intended($this->redirectPath());
} }
} }
} }

View File

@@ -267,7 +267,6 @@ class UnAuthController extends Controller
$email = $user->email; $email = $user->email;
$user_name = $user->user_name; $user_name = $user->user_name;
$ticket_number = $tickets->ticket_number; $ticket_number = $tickets->ticket_number;
$sending_emails = Emails::where('department', '=', $ticket_status->dept_id)->first(); $sending_emails = Emails::where('department', '=', $ticket_status->dept_id)->first();
@@ -331,13 +330,13 @@ class UnAuthController extends Controller
* *
* @return response * @return response
*/ */
public static function changeLanguage($lang) public static function changeLanguage($ids,$lang)
{ {
// if(Cache::has('language')) /* if(Cache::has('language'))
// { {
// return Cache::get('language'); return Cache::get('language');
// } else return 'false'; } else return 'false';
// Cache::put('language',$); Cache::put('language',$);
$path = base_path('lang'); // Path to check available language packages $path = base_path('lang'); // Path to check available language packages
if (array_key_exists($lang, \Config::get('languages')) && in_array($lang, scandir($path))) { if (array_key_exists($lang, \Config::get('languages')) && in_array($lang, scandir($path))) {
// dd(array_key_exists($lang, Config::get('languages'))); // dd(array_key_exists($lang, Config::get('languages')));
@@ -350,7 +349,20 @@ class UnAuthController extends Controller
return false; return false;
} }
return true; return true;*/
$path = base_path('lang'); // Path to check available language packages
if (array_key_exists($lang, \Config::get('languages')) && in_array($lang, scandir($path))) {
if (Auth::check()) {
$id = Auth::user()->id;
$user = User::find($id);
$user->user_language = $lang;
$user->save();
} else {
Session::put('language', $lang);
}
}
return redirect()->back();
} }
// Follow up tickets // Follow up tickets
@@ -446,4 +458,89 @@ class UnAuthController extends Controller
return redirect()->back(); return redirect()->back();
} }
public function close($id, Tickets $ticket)
{
$tickets = Tickets::where('id', '=', $id)->first();
$tickets->status = 3;
$ticket_status = Ticket_Status::where('id', '=', 3)->first();
if ($ticket_status->state == 'closed') {
$tickets->closed = $ticket_status->id;
$tickets->closed_at = date('Y-m-d H:i:s');
}
$tickets->save();
$ticket_thread = Ticket_Thread::where('ticket_id', '=', $ticket_status->id)->first();
$ticket_subject = $ticket_thread->title;
$user = User::where('id', '=', $tickets->user_id)->first();
$thread = new Ticket_Thread();
$thread->ticket_id = $tickets->id;
$thread->user_id = $tickets->user_id;
$thread->is_internal = 1;
$thread->body = $ticket_status->message.' '.$user->user_name;
$thread->save();
$email = $user->email;
$user_name = $user->user_name;
$ticket_number = $tickets->ticket_number;
$sending_emails = Emails::where('department', '=', $ticket_status->dept_id)->first();
if ($sending_emails == null) {
$from_email = $this->system_mail();
} else {
$from_email = $sending_emails->id;
}
try {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $tickets->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'close-ticket'], $template_variables = ['ticket_number' => $ticket_number]);
} catch (\Exception $e) {
return 0;
}
return Lang::get('lang.your_ticket_has_been').' '.$ticket_status->state;
}
public function open($id, Tickets $ticket)
{
$ticket_status = $ticket->where('id', '=', $id)->first();
$ticket_status->status = 1;
$ticket_status->reopened_at = date('Y-m-d H:i:s');
$ticket_status->save();
$ticket_status_message = Ticket_Status::where('id', '=', $ticket_status->status)->first();
$thread = new Ticket_Thread();
$user = User::where('id', '=', $ticket->user_id)->first();
$thread->ticket_id = $ticket_status->id;
$thread->user_id = $ticket->user_id;
$thread->is_internal = 1;
$thread->body = $ticket_status->message.' '.$user->user_name;
$thread->save();
return 'your ticket'.$ticket_status->ticket_number.' has been opened';
}
public function resolve($id, Tickets $ticket)
{
$ticket_status = $ticket->where('id', '=', $id)->first();
$ticket_status->status = 2;
$ticket_status->closed = 1;
$ticket_status->closed_at = date('Y-m-d H:i:s');
$ticket_status->save();
$ticket_status_message = Ticket_Status::where('id', '=', $ticket_status->status)->first();
$thread = new Ticket_Thread();
$user = User::where('id', '=', $ticket->user_id)->first();
$thread->ticket_id = $ticket_status->id;
$thread->user_id = $ticket->user_id;
$thread->is_internal = 1;
$thread->save();
return Lang::get('lang.your_ticket_has_been').' '.$ticket_status->state;
}
} }

View File

@@ -1,174 +1,265 @@
@extends('themes.default1.client.layout.client') @extends('themes.default1.client.layout.client')
@section('content') @section('content')
<?php <?php
$thread = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $tickets->id)->first(); $thread = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $tickets->id)->first();
//$user = App\User::where('id','=',$id1)->first(); //$user = App\User::where('id','=',$id1)->first();
?> ?>
<style type="text/css">
.caret {
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid;
display: inline-block;
height: 0;
margin-left: 2px;
vertical-align: middle;
width: 0;
}
.mailbox-attachments li{float:left;width:200px;border:1px solid #eee;margin-bottom:10px;margin-right:10px}
.mailbox-attachment-name{font-weight:bold;color:#666;word-break: break-word;}
.mailbox-attachment-icon,.mailbox-attachment-info,.mailbox-attachment-size{display:block}
.mailbox-attachment-info{padding:10px;background:#f4f4f4;height: auto;}
.mailbox-attachment-size{color:#999;font-size:12px}
.mailbox-attachment-icon{text-align:center;font-size:65px;color:#666;padding:20px 10px}
.mailbox-attachment-icon.has-img{padding:0}
.mailbox-attachment-icon.has-img>img{max-width:100%;height:auto}
#clearfix {display: inline-block!important;list-style-type: none!important;}
.ml40 {margin-left: -40px!important;}
</style>
<!-- Main content --> <!-- Main content -->
<div class="box box-primary"> <div id="content" class="site-content col-sm-12">
<div class="box-header">
<div class="row">
<div class="col-md-9">
<section class="content-header"><h3 class="box-title"><i class="fa fa-user"> </i> {{$thread->title}} </h3> ( {{$tickets->ticket_number}} )
</section>
</div>
<div class="col-md-3">
<div class="pull-right">
<!-- <button type="button" class="btn btn-default"><i class="fa fa-edit" style="color:green;"> </i> Edit</button> -->
{{-- <button type="button" class="btn btn-default"><i class="fa fa-print" style="color:blue;"> </i> {!! link_to_route('ticket.print','Print',[$tickets->id]) !!}</button> --}}
<!-- </div> -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-exchange" style="color:teal;"> </i>
{!! Lang::get('lang.change_status') !!} <span class="caret"></span>
</button>
<?php $statuses = \App\Model\helpdesk\Ticket\Ticket_Status::all(); ?>
<ul class="dropdown-menu" id='cc_page'> <article class="hentry">
@foreach($statuses as $status) <header class="entry-header">
<?php if ($status->name == 'Deleted' or $status->name == 'Accepted') continue; ?> <div class="row">
<li class="search_r"><a href="#" onclick="changeStatus({!! $status->id !!})"><i class="{!! $status->icon_class !!}" style="color:#FFD600;"> </i>{!! $status->name !!}</a>
</li>
@endforeach
</ul> <div class="col-sm-9">
</div>
<h3 class="entry-title"><i class="fas fa-ticket-alt"> </i> {{$thread->title}}
<small> ( {{$tickets->ticket_number}} ) </small>
</h3>
</div>
<div class="col-sm-3 text-right">
<div>
<button class="btn btn-light dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-expanded="false" style="background-color: whitesmoke">
<i class="fas fa-exchange-alt" style="color:teal;"> </i>
{!! Lang::get('lang.change_status') !!}
<span class="caret"></span>
</button>
<?php $statuses = \App\Model\helpdesk\Ticket\Ticket_Status::all(); ?>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" id="open">
<i class="fas fa-folder-open" style="color:#FFD600;"> </i> {!! Lang::get('lang.open') !!}
</a>
<a class="dropdown-item" href="#" id="close">
<i class="fas fa-check" style="color:#15F109;"> </i> {!! Lang::get('lang.close') !!}
</a>
<a class="dropdown-item" href="#" id="resolved">
<i class="fas fa-check-circle " style="color:#0EF1BE;"> </i> {!! Lang::get('lang.resolved') !!}
</a>
</div>
</div>
{!! Form::close() !!} {!! Form::close() !!}
</div> </div>
</div> </div>
</div>
<br/> <br/>
<div class="row"> <div class="row">
<div class="col-md-12">
<div class="alert alert-success alert-dismissable" id="alert11" style="display:none;"> <div class="col-md-12 mb-1">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<i class="fa fa-check-circle"></i> <span id="message-success1"> <div class="ticketratings float-right">
</span>
</div> <table>
<div class="ticketratings pull-right">
<table><tbody> <tbody>
<?php $ratings = App\Model\helpdesk\Ratings\Rating::orderby('display_order')->get(); ?> <?php $ratings = App\Model\helpdesk\Ratings\Rating::orderby('display_order')->get(); ?>
<form id="foo"> <form id="foo">
{!! csrf_field() !!} {!! csrf_field() !!}
@foreach($ratings as $rating) @foreach($ratings as $rating)
@if($rating->rating_area == 'Helpdesk Area') @if($rating->rating_area == 'Helpdesk Area')
<?php <?php
$rating_value = App\Model\helpdesk\Ratings\RatingRef::where('rating_id', '=', $rating->id)->where('ticket_id', '=', $tickets->id)->first(); $rating_value = App\Model\helpdesk\Ratings\RatingRef::where('rating_id', '=', $rating->id)->where('ticket_id', '=', $tickets->id)->first();
if ($rating_value == null) { if ($rating_value == null) {
$ratingval = '0'; $ratingval = '0';
} else { } else {
$ratingval = $rating_value->rating_value; $ratingval = $rating_value->rating_value;
} }
?> ?>
<tr>
<th><div class="ticketratingtitle">{!! $rating->name !!} &nbsp;</div></th>&nbsp <tr>
<td>
<?php for ($i = 1; $i <= $rating->rating_scale; $i++) { ?> <th><div class="ticketratingtitle">{!! $rating->name !!} &nbsp;</div></th>&nbsp
<input type="radio" class="star" id="star5" name="{!! $rating->name !!}" value="{!! $i !!}"<?php echo ($ratingval == $i) ? 'checked' : '' ?> />
<?php } ?> <td>
</td>
</tr> <?php for ($i = 1; $i <= $rating->rating_scale; $i++) { ?>
@endif <input type="radio" class="star" id="star5" name="{!! $rating->name !!}" value="{!! $i !!}"<?php echo ($ratingval == $i) ? 'checked' : '' ?> />
<?php } ?>
</td>
</tr>
@endif
@endforeach @endforeach
</form></tbody> </table> </form>
</tbody>
</table>
</div> </div>
</div> </div>
</div> </div>
</div> </header>
<div class="box-body" style="margin-bottom:-10px">
<div class="row"> <div class="entry-content clearfix">
<div id="loader" style="display:none;">
<div class="col-xs-5"> <div class="col-md-12 offset-md-5" id="loader" style="display:none;">
</div>
<div class="col-xs-1"> <img src="{{asset("lb-faveo/media/images/gifloader.gif")}}"><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<img src="{{asset("lb-faveo/media/images/gifloader.gif")}}"><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
</div>
<div class="col-xs-6">
</div>
</div> </div>
<section class="content" id="refresh" style="margin-bottom:-10px;margin-top:-10px">
<div class="col-md-12"> <div id="refresh">
<div>
<?php <?php
$priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $tickets->priority_id)->first(); $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $tickets->priority_id)->first();
?> ?>
<div class="callout callout-default "> <div class="alert alert-secondary">
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<?php <?php
$sla = $tickets->sla; $sla = $tickets->sla;
$SlaPlan = App\Model\helpdesk\Manage\Sla_plan::where('id', '=', 1)->first(); $SlaPlan = App\Model\helpdesk\Manage\Sla_plan::where('id', '=', $sla)->first();
?> ?>
<b>{!! Lang::get('lang.sla_plan') !!}: {{$SlaPlan->grace_period}} </b> <b>{!! Lang::get('lang.sla_plan') !!}: {{$SlaPlan->grace_period}} </b>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<b>{!! Lang::get('lang.created_date') !!}: </b> {{ UTC::usertimezone($tickets->created_at) }} <b>{!! Lang::get('lang.created_date') !!}: </b> {{ UTC::usertimezone($tickets->created_at) }}
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<b>{!! Lang::get('lang.due_date') !!}: </b> <b>{!! Lang::get('lang.due_date') !!}: </b>
<?php <?php
$time = $tickets->created_at; $time = $tickets->created_at;
$time = date_create($time); $time = date_create($time);
date_add($time, date_interval_create_from_date_string($SlaPlan->grace_period)); date_add($time, date_interval_create_from_date_string($SlaPlan->grace_period));
echo UTC::usertimezone(date_format($time, 'd/m/Y H:i:s')); echo UTC::usertimezone(date_format($time, 'Y-m-d H:i:s'));
?> ?>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<?php $response = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $tickets->id)->where('is_internal', '=', 0)->get(); ?> <?php $response = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $tickets->id)->where('is_internal', '=', 0)->get(); ?>
@foreach($response as $last) @foreach($response as $last)
<?php $ResponseDate = $last->created_at; ?> <?php $ResponseDate = $last->created_at; ?>
@endforeach @endforeach
<b>{!! Lang::get('lang.last_response') !!}: </b> {{ UTC::usertimezone($ResponseDate)}} <b>{!! Lang::get('lang.last_response') !!}: </b> {{ UTC::usertimezone($ResponseDate)}}
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="col-md-6">
<table class="table table-hover">
<!-- <tr><th></th><th></th></tr> -->
<tr><td><b>{!! Lang::get('lang.status') !!}:</b></td> <?php $status = App\Model\helpdesk\Ticket\Ticket_Status::where('id', '=', $tickets->status)->first(); ?>
@if($status->id == 1)
<td title="{{$status->properties}}" style="color:orange">{{$status->name}}</td></tr>
@elseif($status->id == 2)
<td title="{{$status->properties}}" style="color:green">{{$status->name}}</td></tr>
@elseif($status->id == 3)
<td title="{{$status->properties}}" style="color:green">{{$status->name}}</td></tr>
@endif
<tr><td><b>{!! Lang::get('lang.priority') !!}:</b></td> <?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $tickets->priority_id)->first(); ?>
@if($priority->priority_id == 1)
<td title="{{$priority->priority_desc}}" style="color:green">{{$priority->priority_desc}}</td>
@elseif($priority->priority_id == 2)
<td title="{{$priority->priority_desc}}" style="color:orange">{{$priority->priority_desc}}</td>
@elseif($priority->priority_id == 3)
<td title="{{$priority->priority_desc}}" style="color:red">{{$priority->priority_desc}}</td>
@endif
</tr>
<tr><td><b>{!! Lang::get('lang.department') !!}:</b></td>
<?php
$help_topic = App\Model\helpdesk\Manage\Help_topic::where('id', '=', $tickets->help_topic_id)->first();
$department = App\Model\helpdesk\Agent\Department::where('id', '=', $help_topic->department)->first();
?>
<td title="{{ $department->name }}">{!! $department->name !!}</td></tr>
</table>
<!-- </div> -->
</div> </div>
<div class="col-md-6">
<!-- <div class="callout callout-success"> --> <div class="row">
<table class="table table-hover">
<!-- <tr><th></th><th></th></tr> --> <div class="col-md-6">
<tr><td><b>{!! Lang::get('lang.help_topic') !!}:</b></td> <?php $help_topic = App\Model\helpdesk\Manage\Help_topic::where('id', '=', $tickets->help_topic_id)->first(); ?><td title="{{$help_topic->topic}}">{{$help_topic->topic}}</td></tr>
<tr><td><b>{!! Lang::get('lang.last_message') !!}:</b></td> <td>{{ucwords($last->poster)}}</td></tr> <table class="table">
</table>
</div> <tr>
<!-- </div> -->
</section> <td><b>{!! Lang::get('lang.status') !!}:</b></td>
</div>
<?php $status = App\Model\helpdesk\Ticket\Ticket_Status::where('id', '=', $tickets->status)->first(); ?>
@if($status->id == 1)
<td title="{{$status->properties}}" style="color:orange">{{$status->name}}</td>
@elseif($status->id == 2)
<td title="{{$status->properties}}" style="color:green">{{$status->name}}</td>
@elseif($status->id == 3)
<td title="{{$status->properties}}" style="color:green">{{$status->name}}</td>
@endif
</tr>
<tr>
<td><b>{!! Lang::get('lang.priority') !!}:</b></td>
<?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $tickets->priority_id)->first(); ?>
@if($priority->priority_id == 1)
<td title="{{$priority->priority_desc}}" style="color:green">{{$priority->priority_desc}}</td>
@elseif($priority->priority_id == 2)
<td title="{{$priority->priority_desc}}" style="color:orange">{{$priority->priority_desc}}</td>
@elseif($priority->priority_id == 3)
<td title="{{$priority->priority_desc}}" style="color:red">{{$priority->priority_desc}}</td>
@endif
</tr>
<tr>
<td><b>{!! Lang::get('lang.department') !!}:</b></td>
<?php
$help_topic = App\Model\helpdesk\Manage\Help_topic::where('id', '=', $tickets->help_topic_id)->first();
$department = App\Model\helpdesk\Agent\Department::where('id', '=', $help_topic->department)->first();
?>
<td title="{{ $department->name }}">{!! $department->name !!}</td>
</tr>
</table>
</div>
<div class="col-md-6">
<table class="table">
<tr>
<td><b>{!! Lang::get('lang.help_topic') !!}:</b></td>
<?php $help_topic = App\Model\helpdesk\Manage\Help_topic::where('id', '=', $tickets->help_topic_id)->first(); ?>
<td title="{{$help_topic->topic}}">{{$help_topic->topic}}</td>
</tr>
<tr>
<td><b>{!! Lang::get('lang.last_message') !!}:</b></td>
<td>{{ucwords($last->poster)}}</td>
</tr>
</table>
</div>
</div> </div>
</div> </div>
<div class="comments-area mb-0" id="comments">
<?php <?php
$conversations = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $tickets->id)->where('is_internal', '=', 0)->paginate(10); $conversations = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $tickets->id)->where('is_internal', '=', 0)->paginate(10);
foreach ($conversations as $conversation) { foreach ($conversations as $conversation) {
@@ -179,12 +270,13 @@ foreach ($conversations as $conversation) {
$time = $ConvDate[1]; $time = $ConvDate[1];
$time = substr($time, 0, -3); $time = substr($time, 0, -3);
if (isset($data) && $date == $data) { if (isset($data) && $date == $data) {
} else { } else {
$data = $ConvDate[0]; $data = $ConvDate[0];
} }
$role = App\User::where('id', '=', $conversation->user_id)->first(); $role = App\User::where('id', '=', $conversation->user_id)->first();
$attachment = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id', '=', $conversation->id)->first(); $attachment = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id', '=', $conversation->id)->first();
if ($attachment == null) { if ($attachment == null) {
$body = $conversation->body; $body = $conversation->body;
@@ -193,9 +285,9 @@ foreach ($conversations as $conversation) {
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id', '=', $conversation->id)->orderBy('id', 'DESC')->get(); $attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id', '=', $conversation->id)->orderBy('id', 'DESC')->get();
foreach ($attachments as $attachment) { foreach ($attachments as $attachment) {
if ($attachment->type == 'pdf') { if ($attachment->type == 'pdf') {
} elseif ($attachment->type == 'docx') { } elseif ($attachment->type == 'docx') {
} else { } else {
$image = @imagecreatefromstring($attachment->file); $image = @imagecreatefromstring($attachment->file);
ob_start(); ob_start();
@@ -209,7 +301,7 @@ foreach ($conversations as $conversation) {
$start = "<head>"; $start = "<head>";
$end = "</head>"; $end = "</head>";
if (strpos($string, $start) == false || strpos($string, $start) == false) { if (strpos($string, $start) == false || strpos($string, $start) == false) {
} else { } else {
$ini = strpos($string, $start); $ini = strpos($string, $start);
$ini += strlen($start); $ini += strlen($start);
@@ -225,7 +317,7 @@ foreach ($conversations as $conversation) {
$start = "<head>"; $start = "<head>";
$end = "</head>"; $end = "</head>";
if (strpos($string, $start) == false || strpos($string, $start) == false) { if (strpos($string, $start) == false || strpos($string, $start) == false) {
} else { } else {
$ini = strpos($string, $start); $ini = strpos($string, $start);
$ini += strlen($start); $ini += strlen($start);
@@ -237,8 +329,9 @@ foreach ($conversations as $conversation) {
?> ?>
<ol class="comment-list" > <ol class="comment-list" >
<li class="comment"> <li class="comment">
<article class="comment-body"> <article class="comment-body">
<footer class="comment-meta"<?php if ($role->role == "user") { ?> style="background-color: hsla(100, 100%, 51%, 0.15)" <?php } else { ?> style="background-color:#FFFCB3" <?php } ?> > <footer class="comment-meta"<?php if ($role->role == "user") { ?> style="background-color: hsla(100, 100%, 51%, 0.15)" <?php } else { ?> style="background-color:#FFFCB3" <?php } ?> >
<div class="comment-author"> <div class="comment-author">
<img src="{{$role->profile_pic}}"alt="" height="50" width="50" class="avatar" <?php if ($role->role == "user") { ?>style="box-shadow: 0 1px 3px #00FF26;" <?php } else { ?> style="box-shadow: 0 1px 3px #FFEC00;" <?php } ?> > <img src="{{$role->profile_pic}}"alt="" height="50" width="50" class="avatar" <?php if ($role->role == "user") { ?>style="box-shadow: 0 1px 3px #00FF26;" <?php } else { ?> style="box-shadow: 0 1px 3px #FFEC00;" <?php } ?> >
@@ -247,7 +340,7 @@ foreach ($conversations as $conversation) {
@else @else
<b class="fn"><a href="#" rel="external" class="url">{{$role->first_name." ".$role->last_name}}</a></b> <b class="fn"><a href="#" rel="external" class="url">{{$role->first_name." ".$role->last_name}}</a></b>
<div class="ticketratings pull-right"> <table><tbody> <div class="ticketratings pull-right"> <table><tbody>
@foreach($ratings as $rating) @foreach($ratings as $rating)
@if($rating->rating_area == 'Comment Area') @if($rating->rating_area == 'Comment Area')
<?php <?php
$rating_value = App\Model\helpdesk\Ratings\RatingRef::where('rating_id', '=', $rating->id)->where('thread_id', '=', $conversation->id)->first(); $rating_value = App\Model\helpdesk\Ratings\RatingRef::where('rating_id', '=', $rating->id)->where('thread_id', '=', $conversation->id)->first();
@@ -269,7 +362,7 @@ foreach ($conversations as $conversation) {
<input type="radio" class="star" id="star3" name="rating" value="3"<?php echo ($tickets->rating == '3') ? 'checked' : '' ?>/> <input type="radio" class="star" id="star3" name="rating" value="3"<?php echo ($tickets->rating == '3') ? 'checked' : '' ?>/>
<input type="radio" class="star" id="star2" name="rating" value="4"<?php echo ($tickets->rating == '4') ? 'checked' : '' ?>/> <input type="radio" class="star" id="star2" name="rating" value="4"<?php echo ($tickets->rating == '4') ? 'checked' : '' ?>/>
<input type="radio" class="star" id="star1" name="rating" value="5"<?php echo ($tickets->rating == '5') ? 'checked' : '' ?> />--> <input type="radio" class="star" id="star1" name="rating" value="5"<?php echo ($tickets->rating == '5') ? 'checked' : '' ?> />-->
</td> </td>
</tr> </tr>
</form> </form>
@endif @endif
@@ -325,7 +418,7 @@ foreach ($conversations as $conversation) {
</ul> </ul>
</div> </div>
</article><!-- .comment-body --> </article><!-- .comment-body -->
</li><!-- .comment --> </li><!-- .comment -->
</ol> </ol>
<?php <?php
@@ -335,7 +428,7 @@ foreach ($conversations as $conversation) {
<?php } <?php }
?> ?>
<div class="pull-right" style="margin-top:-30px;margin-bottom:-30px"> <div class="pull-right" style="margin-top:-30px;margin-bottom:-30px">
<?php echo $conversations->setPath(route('show.ticket', ['id' => $tickets->id, 'token' => $token]))->render(); ?> <?php echo $conversations->setPath(route('show.ticket', ['ids' => $tickets->id, 'code' => $token]))->render(); ?>
</div> </div>
<br/><br/> <br/><br/>
@if(Session::has('success1')) @if(Session::has('success1'))
@@ -355,48 +448,77 @@ foreach ($conversations as $conversation) {
</div> </div>
@endif @endif
<?php $id2 = $tickets->id; ?> <?php $id2 = $tickets->id; ?>
<div id="respond" class="comment-respond form-border">
<h3 id="reply-title" class="comment-reply-title section-title"><i class="line" style="border-color: rgb(0, 154, 186);"></i>{!! Lang::get('lang.leave_a_reply') !!}</h3> <div id="respond" class="comment-respond form-border">
{!! Form::open(['url'=>'post-ticket-reply/'.$tickets->id.'#formabc']) !!}
<div class="row"> <h3 id="reply-title" class="comment-reply-title section-title"><i class="line"></i>{!! Lang::get('lang.leave_a_reply') !!}</h3>
<div class="form-group"> @if(Auth::user())
<div class="col-md-12"> {!! Form::open(['url'=>'post/reply/'.$id2.'#formabc']) !!}
<div class="form-group "> @else
<textarea class="form-control" name="comment" cols="30" rows="8"></textarea> {!! Form::open(['url'=>'post-ticket-reply/'.$tickets->id.'#formabc']) !!}
@endif
<div class="row">
<div class="col-md-12">
<div class="form-group " style="background-color: white">
<textarea class="form-control" id="reply-input" name="comment" cols="30" rows="8" ></textarea>
</div>
</div>
</div>
<div class="text-right">
<button type="submit" onClick="return checkFunction();" class="btn btn-custom btn-lg" style="background-color: #009aba; hov: #00c0ef; color: #fff">{!! Lang::get('lang.post_comment') !!}</button>
</div>
{!! Form::close() !!}
</div> </div>
</div> </div>
</div> </div>
</div> </article>
<div class="text-right">
<button type="submit" class="btn btn-custom btn-lg">{!! Lang::get('lang.post_comment') !!}</button>
</div>
{!! Form::close() !!}
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
// $("#cc_page").on('click', '.search_r', function() {
// var search_r = $('a', this).attr('id'); $("#cc_page").on('click', '.search_r', function () {
// $.ajax({ var search_r = $('a', this).attr('id');
// type: "GET", $.ajax({
// url: "../ticket/status/{{$tickets->id}}/" + search_r, type: "GET",
// beforeSend: function() { url: "../../show/change-status/"+ id +"/"+ {!! $tickets->id !!},
// $("#refresh").hide(); beforeSend: function () {
// $("#loader").show(); $("#refresh").hide();
// }, $("#loader").show();
// success: function(response) { },
// $("#refresh").load("../show-ticket/{!! $tickets->id !!}/{!! $token !!} #refresh"); success: function (response) {
// $("#refresh").show(); $("#refresh").load("../show-ticket/{!! $tickets->id !!}/{!! $token !!} #refresh");
// $("#loader").hide(); $("#refresh").show();
// var message = response; $("#loader").hide();
// $("#alert11").show(); var message = response;
// $('#message-success1').html(message); $("#alert11").show();
// setInterval(function() { $('#message-success1').html(message);
// $("#alert11").hide(); setInterval(function () {
// }, 4000); $("#alert11").hide();
// } }, 4000);
// }); }
// return false; });
// }); return false;
});
$(function() {
//Add text editor
$("textarea").summernote({
height: 300,
tabsize: 2,
toolbar: [
['style', ['bold', 'italic', 'underline', 'clear']],
['font', ['strikethrough', 'superscript', 'subscript']],
['fontsize', ['fontsize']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['height', ['height']]
]
});
});
$(document).ready(function() { $(document).ready(function() {
var Data = $('input[name="rating"]:checked').val(); var Data = $('input[name="rating"]:checked').val();
@@ -473,5 +595,97 @@ foreach ($conversations as $conversation) {
}) })
return false; return false;
} }
jQuery(document).ready(function () {
// Close a ticket
$('#close').on('click', function (e) {
$.ajax({
type: "POST",
url: "../../show/close/{!! $tickets->id !!}",
data:{"_token": "{{ csrf_token() }}"},
beforeSend: function () {
$("#refresh").hide();
$("#loader").show();
},
success: function (response) {
$("#refresh").load("../../show-ticket/{!! $tickets->id !!}/{!! $token !!} #refresh");
$("#refresh").show();
$("#loader").hide();
// $("#d1").trigger("click");
// var message = "Success! Your Ticket have been Closed";
// $("#alert11").show();
// $('#message-success1').html(message);
// setInterval(function(){
// $("#alert11").hide();
// setTimeout(function() {
// var link = document.querySelector('#load-inbox');
// if(link) {
// link.click();
// }
// }, 500);
// },2000);
}
})
return false;
});
// Resolved a ticket
$('#resolved').on('click', function (e) {
$.ajax({
type: "POST",
url: "../../show/resolve/{!! $tickets->id !!}",
data:{"_token": "{{ csrf_token() }}"},
beforeSend: function () {
$("#refresh").hide();
$("#loader").show();
},
success: function (response) {
$("#refresh").load("../../show-ticket/{!! $tickets->id !!}/{!! $token !!} #refresh");
$("#refresh").show();
$("#loader").hide();
var message = "Success! Your Ticket have been Resolved";
$("#alert11").show();
$('#message-success1').html(message);
setInterval(function () {
$("#alert11").hide();
setTimeout(function () {
var link = document.querySelector('#load-inbox');
if (link) {
link.click();
}
}, 500);
}, 2000);
}
})
return false;
});
// Open a ticket
$('#open').on('click', function (e) {
$.ajax({
type: "POST",
url: "../../show/open/{!! $tickets->id !!}",
data:{"_token": "{{ csrf_token() }}"},
beforeSend: function () {
$("#refresh").hide();
$("#loader").show();
},
success: function (response) {
$("#refresh").load("../../show-ticket/{!! $tickets->id !!}/{!! $token !!} #refresh");
$("#refresh").show();
$("#loader").hide();
var message = "Success! Your Ticket have been Opened";
$("#alert11").show();
$('#message-success1').html(message);
setInterval(function () {
$("#alert11").hide();
}, 4000);
}
})
return false;
});
});
</script> </script>
@stop @stop

View File

@@ -525,7 +525,7 @@ Route::middleware('web')->group(function () {
Route::get('check_ticket/{id}', [Client\helpdesk\GuestController::class, 'get_ticket_email'])->name('check_ticket'); //detail ticket information Route::get('check_ticket/{id}', [Client\helpdesk\GuestController::class, 'get_ticket_email'])->name('check_ticket'); //detail ticket information
// show ticket via have a ticket // show ticket via have a ticket
Route::get('show-ticket/{id}/{code}', [Client\helpdesk\UnAuthController::class, 'showTicketCode'])->name('show.ticket'); //detail ticket information Route::get('show-ticket/{ids}/{code}', [Client\helpdesk\UnAuthController::class, 'showTicketCode'])->name('show.ticket'); //detail ticket information
//testing ckeditor //testing ckeditor
//=================================================================================== //===================================================================================
@@ -708,6 +708,10 @@ Route::middleware('web')->group(function () {
Route::post('show/rating/{id}', [Client\helpdesk\UnAuthController::class, 'rating'])->name('show.rating'); /* Get overall Ratings */ Route::post('show/rating/{id}', [Client\helpdesk\UnAuthController::class, 'rating'])->name('show.rating'); /* Get overall Ratings */
Route::post('show/rating2/{id}', [Client\helpdesk\UnAuthController::class, 'ratingReply'])->name('show.rating2'); /* Get reply Ratings */ Route::post('show/rating2/{id}', [Client\helpdesk\UnAuthController::class, 'ratingReply'])->name('show.rating2'); /* Get reply Ratings */
Route::get('show/change-status/{status}/{id}', [Client\helpdesk\UnAuthController::class, 'changeStatus'])->name('show.change.status'); /* Get reply Ratings */ Route::get('show/change-status/{status}/{id}', [Client\helpdesk\UnAuthController::class, 'changeStatus'])->name('show.change.status'); /* Get reply Ratings */
Route::post('show/close/{id}', [Client\helpdesk\UnAuthController::class, 'close'])->name('show.close'); /* Get reply Ratings */
Route::post('show/open/{id}', [Client\helpdesk\UnAuthController::class, 'open'])->name('show.open'); /* Get reply Ratings */
Route::post('show/resolve/{id}', [Client\helpdesk\UnAuthController::class, 'resolve'])->name('show.resolve'); /* Get reply Ratings */
/* get the home page */ /* get the home page */
Route::get('knowledgebase', [Client\kb\UserController::class, 'home'])->name('home'); Route::get('knowledgebase', [Client\kb\UserController::class, 'home'])->name('home');
/* get the faq value to user */ /* get the faq value to user */
@@ -800,7 +804,7 @@ Route::middleware('web')->group(function () {
// }); // });
Route::get('check_ticket/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage']); Route::get('check_ticket/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage']);
Route::get('category-list/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage']); Route::get('category-list/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage']);
Route::get('show/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage']); Route::get('show-ticket/{ids}/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeLanguage']);
Route::get('pages/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage'])->name('switch-user-lang'); Route::get('pages/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage'])->name('switch-user-lang');
Route::get('swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage'])->name('switch-user-lang'); Route::get('swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage'])->name('switch-user-lang');
}); });