update v1.0.5

This commit is contained in:
sujitprasad
2016-01-25 20:45:35 +05:30
parent 0b8ebb9c70
commit e7149e34e4
252 changed files with 9008 additions and 3152 deletions

View File

@@ -13,9 +13,10 @@ class="active"
@stop
@section('content')
<div class="box box-info">
<link type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">{!! Lang::get('lang.line_chart') !!}</h3>
<div class="box-tools pull-right">
@@ -24,10 +25,17 @@ class="active"
</div>
</div>
<div class="box-body">
<div class="chart" >
<div id="legendDiv"></div>
<canvas class="chart-data" id="tickets-graph" width="1000" height="400"></canvas>
@if(Session::has('content'))
<div class="chart">
<div id="legendDiv1"></div>
<canvas class="chart-data" id="tickets-graph1" width="1000" height="400"></canvas>
</div>
@else
<div class="chart">
<div id="legendDiv"></div>
<canvas class="chart-data" id="tickets-graph" width="1000" height="400"></canvas>
</div>
@endif
</div><!-- /.box-body -->
</div><!-- /.box -->
<hr/>
@@ -37,9 +45,9 @@ class="active"
</div>
<div class="box-body">
<table class="table table-hover" style="overflow:hidden;">
<table class="table table-hover" style="overflow:hidden;">
<tr>
<tr>
<th>{!! Lang::get('lang.department') !!}</th>
<th>{!! Lang::get('lang.opened') !!}</th>
<th>{!! Lang::get('lang.resolved') !!}</th>
@@ -54,7 +62,6 @@ $open = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)-
$resolve = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',2)->count();
$close = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',3)->count();
$delete = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',5)->count();
?>
<tr>
@@ -71,8 +78,8 @@ $delete = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id
</div>
</div>
<script src="{{asset("lb-faveo/plugins/chartjs/Chart.min.js")}}" type="text/javascript"></script>
<script type="text/javascript">
<script src="{{asset("lb-faveo/plugins/chartjs/Chart.min.js")}}" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$.getJSON("agen", function (result) {
@@ -189,4 +196,26 @@ $delete = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id
</script>
<script type="text/javascript">
jQuery(document).ready(function() {
// Close a ticket
$('#close').on('click', function(e) {
$.ajax({
type: "GET",
url: "agen",
beforeSend: function() {
},
success: function(response) {
}
})
return false;
});
});
</script>
<script src="{{asset("lb-faveo/plugins/moment-develop/moment.js")}}" type="text/javascript"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/js/bootstrap-datetimepicker.min.js"></script>
@stop

View File

@@ -49,114 +49,34 @@ class="active"
{{Session::get('fails')}}
</div>
@endif
<div class="box-body no-padding ">
<div class="box-body">
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
<div class="mailbox-controls">
<h3 class="pull-right" style="margin-top:0;margin-bottom:0;"> <div id="count_refresh">{!! $tickets->count().'-'.$tickets->total(); !!}</div></h3>
<!-- Check all button -->
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
<a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a>
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" value="{!! Lang::get('lang.delete') !!}">
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" value="{!! Lang::get('lang.close') !!}">
</div>
<div class=" table-responsive mailbox-messages" id="refresh">
<div class="mailbox-messages" id="refresh">
<p style="display:none;text-align:center; position:fixed; margin-left:40%;margin-top:-70px;" id="show" class="text-red"><b>{!! Lang::get('lang.loading') !!}...</b></p>
<!-- table -->
<table class="table table-hover table-striped">
<thead>
<th>
</th>
<th>{!! Lang::get('lang.subject') !!}</th>
<th>{!! Lang::get('lang.ticket_id') !!}</th>
<th>{!! Lang::get('lang.priority') !!}</th>
<th>{!! Lang::get('lang.from') !!}</th>
<th>{!! Lang::get('lang.last_replier') !!}</th>
<th>{!! Lang::get('lang.assigned_to') !!}</th>
<th>{!! Lang::get('lang.last_activity') !!}</th>
</thead>
<tbody id="hello">
@foreach ($tickets as $ticket)
<?php
// title
$title = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
{!! Datatable::table()
->addColumn(
"",
Lang::get('lang.subject'),
Lang::get('lang.ticket_id'),
Lang::get('lang.priority'),
Lang::get('lang.from'),
Lang::get('lang.last_replier'),
Lang::get('lang.assigned_to'),
Lang::get('lang.last_activity'))
->setUrl(route('get.answered.ticket'))
->setOrder(array(7=>'desc'))
->setClass('table table-hover table-bordered table-striped')
->render();!!}
$title = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->first();
$string = strip_tags($title->title);
if($title)
if($title == null){
} else {
?>
<tr <?php if ($ticket->seen_by == null) {?> style="color:green;" <?php } ?> >
<td ><input type="checkbox" class="icheckbox_flat-blue" name="select_all[]" value="{{$ticket->id}}"/></td>
<?php
// collaborators
$collaborators = App\Model\helpdesk\Ticket\Ticket_Collaborator::where('ticket_id','=',$ticket->id)->get();
$collab = count($collaborators);
// check atatchments
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id','=',$title->id)->first();
$attach = count($attachments);
if (strlen($string) > 40) {
$stringCut = substr($string, 0, 40);
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
$TicketData = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
$TicketDatarow = App\Model\helpdesk\Ticket\Ticket_Thread::where('id', '=', $TicketData)->first();
$LastResponse = App\User::where('id', '=', $TicketDatarow->user_id)->first();
if($LastResponse->role == "user") {
$rep = "#F39C12";
$username = $LastResponse->user_name;
} else { $rep = "#000"; $username = $LastResponse->first_name ." ". $LastResponse->last_name;
if($LastResponse->first_name==null || $LastResponse->last_name==null) {
$username = $LastResponse->user_name;
}}
$titles = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
$count = count($titles);
foreach($titles as $title)
{
$title = $title;
}
$assigned_to = App\User::where('id','=',$ticket->assigned_to)->first();
if($assigned_to == null)
{
$assigned = "Unassigned";
}
else
{
$assigned = $assigned_to->first_name ." ". $assigned_to->last_name;
}
?>
<td class="mailbox-name"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">{{$string}} </a> ({!! $count!!}) <i class="fa fa-comment"></i>
@if($collab > 0)&nbsp;<i class="fa fa-users"></i>@endif
@if($attach > 0)&nbsp;<i class="fa fa-paperclip"></i>@endif</td>
<td class="mailbox-Id"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">#{!! $ticket->ticket_number !!}</a></td>
<?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $ticket->priority_id)->first();?>
<td class="mailbox-priority"><spam class="btn btn-{{$priority->priority_color}} btn-xs">{{$priority->priority_desc}}</spam></td>
<?php $from = App\User::where('id','=',$ticket->user_id)->first(); ?>
@if($from->role == "user")
<td class="mailbox-from" >{!! $from->user_name !!}</td>
@else
<td class="mailbox-from" >{!! $from->first_name." ".$from->last_name !!}</td>
@endif
<td class="mailbox-last-reply" style="color:{!! $rep !!}">{!! $username !!}</td>
<td>{!! $assigned !!}</td>
<td class="mailbox-last-activity">{!! UTC::usertimezone($title->updated_at) !!}</td>
</tr>
<?php } ?>
@endforeach
</tbody>
</table><!-- /.table -->
<div class="pull-right">
<?php echo $tickets->setPath(url('/ticket/answered'))->render();?>&nbsp;
</div>
</div><!-- /.mail-box-messages -->
{!! Form::close() !!}
</div><!-- /.box-body -->

View File

@@ -41,111 +41,33 @@ class="active"
{{Session::get('fails')}}
</div>
@endif
<div class="box-body no-padding ">
<div class="box-body">
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
<div class="mailbox-controls">
<h3 class="pull-right" style="margin-top:0;margin-bottom:0;"> <div id="count_refresh">{!! $tickets->count().'-'.$tickets->total(); !!}</div></h3>
<!-- Check all button -->
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
<a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a>
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" value="{!! Lang::get('lang.delete') !!}">
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" value="{!! Lang::get('lang.close') !!}">
</div>
<div class=" table-responsive mailbox-messages" id="refresh">
<div class="mailbox-messages" id="refresh">
<p style="display:none;text-align:center; position:fixed; margin-left:40%;margin-top:-70px;" id="show" class="text-red"><b>{!! Lang::get('lang.loading') !!}...</b></p>
<!-- table -->
<table class="table table-hover table-striped">
<thead>
<th>
</th>
<th>{!! Lang::get('lang.subject') !!}</th>
<th>{!! Lang::get('lang.ticket_id') !!}</th>
<th>{!! Lang::get('lang.priority') !!}</th>
<th>{!! Lang::get('lang.from') !!}</th>
<th>{!! Lang::get('lang.last_replier') !!}</th>
<th>{!! Lang::get('lang.assigned_to') !!}</th>
<th>{!! Lang::get('lang.last_activity') !!}</th>
</thead>
<tbody id="hello">
@foreach ($tickets as $ticket)
<?php
// title
$title = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->first();
$string = strip_tags($title->title);
if($title)
if($title == null){
} else {
?>
<tr <?php if ($ticket->seen_by == null) {?> style="color:green;" <?php } ?> >
<td ><input type="checkbox" class="icheckbox_flat-blue" name="select_all[]" value="{{$ticket->id}}"/></td>
<?php
// collaborators
$collaborators = App\Model\helpdesk\Ticket\Ticket_Collaborator::where('ticket_id','=',$ticket->id)->get();
$collab = count($collaborators);
// check atatchments
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id','=',$title->id)->first();
$attach = count($attachments);
if (strlen($string) > 40) {
$stringCut = substr($string, 0, 40);
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
$TicketData = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
$TicketDatarow = App\Model\helpdesk\Ticket\Ticket_Thread::where('id', '=', $TicketData)->first();
$LastResponse = App\User::where('id', '=', $TicketDatarow->user_id)->first();
if($LastResponse->role == "user") {
$rep = "#F39C12";
$username = $LastResponse->user_name;
} else { $rep = "#000"; $username = $LastResponse->first_name ." ". $LastResponse->last_name;
if($LastResponse->first_name==null || $LastResponse->last_name==null) {
$username = $LastResponse->user_name;
}}
$titles = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
$count = count($titles);
foreach($titles as $title)
{
$title = $title;
}
$assigned_to = App\User::where('id','=',$ticket->assigned_to)->first();
if($assigned_to == null)
{
$assigned = "Unassigned";
}
else
{
$assigned = $assigned_to->first_name ." ". $assigned_to->last_name;
}
?>
<td class="mailbox-name"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">{{$string}} </a> ({!! $count!!}) <i class="fa fa-comment"></i>
@if($collab > 0)&nbsp;<i class="fa fa-users"></i>@endif
@if($attach > 0)&nbsp;<i class="fa fa-paperclip"></i>@endif</td>
<td class="mailbox-Id"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">#{!! $ticket->ticket_number !!}</a></td>
<?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $ticket->priority_id)->first();?>
<td class="mailbox-priority"><spam class="btn btn-{{$priority->priority_color}} btn-xs">{{$priority->priority_desc}}</spam></td>
<?php $from = App\User::where('id','=',$ticket->user_id)->first(); ?>
@if($from->role == "user")
<td class="mailbox-from" >{!! $from->user_name !!}</td>
@else
<td class="mailbox-from" >{!! $from->first_name." ".$from->last_name !!}</td>
@endif
<td class="mailbox-last-reply" style="color:{!! $rep !!}">{!! $username !!}</td>
<td>{!! $assigned !!}</td>
<td class="mailbox-last-activity">{!! UTC::usertimezone($title->updated_at) !!}</td>
</tr>
<?php } ?>
@endforeach
</tbody>
</table><!-- /.table -->
<div class="pull-right">
<?php echo $tickets->setPath(url('/ticket/assigned'))->render();?>&nbsp;
</div>
{!! Datatable::table()
->addColumn(
"",
Lang::get('lang.subject'),
Lang::get('lang.ticket_id'),
Lang::get('lang.priority'),
Lang::get('lang.from'),
Lang::get('lang.last_replier'),
Lang::get('lang.assigned_to'),
Lang::get('lang.last_activity'))
->setUrl(route('get.assigned.ticket'))
->setOrder(array(7=>'desc'))
->setClass('table table-hover table-bordered table-striped')
->render();!!}
</div><!-- /.mail-box-messages -->
{!! Form::close() !!}
</div><!-- /.box-body -->

View File

@@ -12,7 +12,6 @@ active
class="active"
@stop
@section('content')
<?php
if(Auth::user()->role == 'agent') {
@@ -42,102 +41,35 @@ class="active"
{{Session::get('fails')}}
</div>
@endif
<div class="box-body no-padding ">
<div class="box-body">
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
<div class="mailbox-controls">
<h3 class="pull-right" style="margin-top:0;margin-bottom:0;"><div id="count_refresh"> {!! $tickets->count().'-'.$tickets->total(); !!}</div></h3>
<!-- Check all button -->
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
<a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a>
{{-- <a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a> --}}
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" value="{!! Lang::get('lang.delete') !!}">
<input type="submit" class="btn btn-default text-blue btn-sm" name="submit" value="{!! Lang::get('lang.open') !!}">
</div>
<div class=" table-responsive mailbox-messages" id="refresh">
<div class="mailbox-messages" id="refresh">
<p style="display:none;text-align:center; position:fixed; margin-left:40%;margin-top:-70px;" id="show" class="text-red"><b>{!! Lang::get('lang.loading') !!}...</b></p>
<!-- table -->
<table class="table table-hover table-striped">
<thead>
<th></th>
<th>{!! Lang::get('lang.subject') !!}</th>
<th>{!! Lang::get('lang.ticket_id') !!}</th>
<th>{!! Lang::get('lang.priority') !!}</th>
<th>{!! Lang::get('lang.from') !!}</th>
<th>{!! Lang::get('lang.last_replier') !!}</th>
<th>{!! Lang::get('lang.assigned_to') !!}</th>
<th>{!! Lang::get('lang.last_activity') !!}</th>
</thead>
<tbody id="hello">
@foreach ($tickets as $ticket )
<tr <?php if ($ticket->seen_by == null) {?> style="color:green;" <?php }
?> >
<td><input type="checkbox" class="icheckbox_flat-blue" name="select_all[]" value="{{$ticket->id}}"/></td>
<?php
// title
$title = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->first();
$string = strip_tags($title->title);
// collaborators
$collaborators = App\Model\helpdesk\Ticket\Ticket_Collaborator::where('ticket_id','=',$ticket->id)->get();
$collab = count($collaborators);
// check atatchments
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id','=',$title->id)->first();
$attach = count($attachments);
{!! Datatable::table()
->addColumn(
"",
Lang::get('lang.subject'),
Lang::get('lang.ticket_id'),
Lang::get('lang.priority'),
Lang::get('lang.from'),
Lang::get('lang.last_replier'),
Lang::get('lang.assigned_to'),
Lang::get('lang.last_activity'))
->setUrl(route('get.closed.ticket'))
->setOrder(array(7=>'desc'))
->setClass('table table-hover table-bordered table-striped')
->render();!!}
if (strlen($string) > 40) {
$stringCut = substr($string, 0, 40);
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
$TicketData = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
$TicketDatarow = App\Model\helpdesk\Ticket\Ticket_Thread::where('id', '=', $TicketData)->first();
$LastResponse = App\User::where('id', '=', $TicketDatarow->user_id)->first();
if($LastResponse->role == "user") {
$rep = "#F39C12";
$username = $LastResponse->user_name;
} else { $rep = "#000"; $username = $LastResponse->first_name ." ". $LastResponse->last_name;
if($LastResponse->first_name==null || $LastResponse->last_name==null) {
$username = $LastResponse->user_name;
}}
$titles = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
$count = count($titles);
foreach($titles as $title)
{
$title = $title;
}
$assigned_to = App\User::where('id','=',$ticket->assigned_to)->first();
if($assigned_to == null)
{
$assigned = "Unassigned";
}
else
{
$assigned = $assigned_to->first_name ." ". $assigned_to->last_name;
}
?>
<td class="mailbox-name"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">{{$string}} </a> ({!! $count!!}) <i class="fa fa-comment"></i>
@if($collab > 0)&nbsp;<i class="fa fa-users"></i>@endif
@if($attach > 0)&nbsp;<i class="fa fa-paperclip"></i>@endif</td>
<td class="mailbox-Id"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">#{!! $ticket->ticket_number !!}</a></td>
<?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $ticket->priority_id)->first();?>
<td class="mailbox-priority"><spam class="btn btn-{{$priority->priority_color}} btn-xs">{{$priority->priority_desc}}</spam></td>
<?php $from = App\User::where('id','=',$ticket->user_id)->first(); ?>
@if($from->role == "user")
<td class="mailbox-from" >{!! $from->user_name !!}</td>
@else
<td class="mailbox-from" >{!! $from->first_name." ".$from->last_name !!}</td>
@endif
<td class="mailbox-last-reply" style="color:{!! $rep !!}">{!! $username !!}</td>
<td>{!! $assigned !!}</td>
<td class="mailbox-last-activity">{!! UTC::usertimezone($title->updated_at) !!}</td>
</tr>
@endforeach
</tbody>
</table><!-- /.table -->
<div class="pull-right">
<?php echo $tickets->setPath(url('/ticket/closed'))->render();?>&nbsp;
</div>
</div><!-- /.mail-box-messages -->
{!! Form::close() !!}
</div><!-- /.box-body -->

View File

@@ -41,108 +41,38 @@ class="active"
{{Session::get('fails')}}
</div>
@endif
<div class="box-body no-padding ">
<div class="box-body ">
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
<div class="mailbox-controls">
<h3 class="pull-right" style="margin-top:0;margin-bottom:0;"> <div id="count_refresh">{!! $tickets->count().'-'.$tickets->total(); !!}</div> </h3>
<!-- Check all button -->
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
<a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a>
{{-- <a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a> --}}
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" value="{!! Lang::get('lang.delete') !!}">
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" value="{!! Lang::get('lang.close') !!}">
</div>
<div class=" table-responsive mailbox-messages" id="refresh">
<p style="display:none;text-align:center; position:fixed; margin-left:40%;margin-top:-70px;" id="show" class="text-red"><b>{!! Lang::get('lang.loading') !!}...</b></p>
<!-- table -->
<table class="table table-hover table-striped">
<thead>
<th>
</th>
<th>{!! Lang::get('lang.subject') !!}</th>
<th>{!! Lang::get('lang.ticket_id') !!}</th>
<th>{!! Lang::get('lang.priority') !!}</th>
<th>{!! Lang::get('lang.from') !!}</th>
<th>{!! Lang::get('lang.last_replier') !!}</th>
<th>{!! Lang::get('lang.assigned_to') !!}</th>
<th>{!! Lang::get('lang.last_activity') !!}</th>
</thead>
<tbody id="hello">
@foreach ($tickets as $ticket)
<?php
// title
$title = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->first();
$string = strip_tags($title->title);
if($title)
if($title == null){
} else {
?>
<tr <?php if ($ticket->seen_by == null) {?> style="color:green;" <?php } ?> >
<td ><input type="checkbox" class="icheckbox_flat-blue" name="select_all[]" value="{{$ticket->id}}"/></td>
<?php
// collaborators
$collaborators = App\Model\helpdesk\Ticket\Ticket_Collaborator::where('ticket_id','=',$ticket->id)->get();
$collab = count($collaborators);
// check atatchments
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id','=',$title->id)->first();
$attach = count($attachments);
if (strlen($string) > 40) {
$stringCut = substr($string, 0, 40);
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
$TicketData = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
$TicketDatarow = App\Model\helpdesk\Ticket\Ticket_Thread::where('id', '=', $TicketData)->first();
$LastResponse = App\User::where('id', '=', $TicketDatarow->user_id)->first();
if($LastResponse->role == "user") {
$rep = "#F39C12";
$username = $LastResponse->user_name;
} else { $rep = "#000"; $username = $LastResponse->first_name ." ". $LastResponse->last_name;
if($LastResponse->first_name==null || $LastResponse->last_name==null) {
$username = $LastResponse->user_name;
}}
$titles = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
$count = count($titles);
foreach($titles as $title) {
$title = $title;
}
$assigned_to = App\User::where('id','=',$ticket->assigned_to)->first();
if($assigned_to == null) {
$assigned = "Unassigned";
} else {
$assigned = $assigned_to->first_name ." ". $assigned_to->last_name;
}
?>
<td class="mailbox-name"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">{{$string}} </a> ({!! $count!!}) <i class="fa fa-comment"></i>
@if($collab > 0)&nbsp;<i class="fa fa-users"></i>@endif
@if($attach > 0)&nbsp;<i class="fa fa-paperclip"></i>@endif</td>
<td class="mailbox-Id"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">#{!! $ticket->ticket_number !!}</a></td>
<?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $ticket->priority_id)->first();?>
<td class="mailbox-priority"><spam class="btn btn-{{$priority->priority_color}} btn-xs">{{$priority->priority_desc}}</spam></td>
<?php $from = App\User::where('id','=',$ticket->user_id)->first(); ?>
@if($from->role == "user")
<td class="mailbox-from" >{!! $from->user_name !!}</td>
@else
<td class="mailbox-from" >{!! $from->first_name." ".$from->last_name !!}</td>
@endif
<td class="mailbox-last-reply" style="color:{!! $rep !!}">{!! $username !!}</td>
<td>{!! $assigned !!}</td>
<td class="mailbox-last-activity">{!! UTC::usertimezone($title->updated_at) !!}</td>
</tr>
<?php } ?>
@endforeach
</tbody>
</table><!-- /.table -->
<div class="pull-right">
<?php echo $tickets->setPath(url('/ticket/inbox'))->render();?>&nbsp;
</div>
<div class="mailbox-messages" id="refresh">
<!--datatable-->
{!! Datatable::table()
->addColumn(
"",
Lang::get('lang.subject'),
Lang::get('lang.ticket_id'),
Lang::get('lang.priority'),
Lang::get('lang.from'),
Lang::get('lang.last_replier'),
Lang::get('lang.assigned_to'),
Lang::get('lang.last_activity'))
->setUrl(route('get.inbox.ticket'))
->setOrder(array(7=>'desc'))
->setClass('table table-hover table-bordered table-striped')
->render();!!}
<!-- /.datatable -->
</div><!-- /.mail-box-messages -->
{!! Form::close() !!}
</div><!-- /.box-body -->
</div><!-- /. box -->
<script>
$(function () {
//Enable check and uncheck all functionality
@@ -161,8 +91,6 @@ class="active"
});
});
$(function() {
// Enable check and uncheck all functionality
$(".checkbox-toggle").click(function() {
@@ -178,7 +106,6 @@ class="active"
});
});
$(document).ready(function() { /// Wait till page is loaded
$('#click').click(function() {
$('#refresh').load('inbox #refresh');
@@ -188,6 +115,5 @@ class="active"
});
});
</script>
@stop

View File

@@ -41,101 +41,34 @@ class="active"
{{Session::get('fails')}}
</div>
@endif
<div class="box-body no-padding ">
<div class="box-body">
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
<div class="mailbox-controls">
<h3 class="pull-right" style="margin-top:0;margin-bottom:0;"><div id="count_refresh"> {!! $tickets->count().'-'.$tickets->total(); !!}</div></h3>
<!-- Check all button -->
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
<a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a>
{{-- <a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a> --}}
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" value="{!! Lang::get('lang.delete') !!}">
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" value="{!! Lang::get('lang.close') !!}">
</div>
<div class=" table-responsive mailbox-messages" id="refresh">
<div class="mailbox-messages" id="refresh">
<p style="display:none;text-align:center; position:fixed; margin-left:40%;margin-top:-70px;" id="show" class="text-red"><b>{!! Lang::get('lang.loading') !!}...</b></p>
<!-- table -->
<table class="table table-hover table-striped">
<thead>
<th></th>
<th>{!! Lang::get('lang.subject') !!}</th>
<th>{!! Lang::get('lang.ticket_id') !!}</th>
<th>{!! Lang::get('lang.priority') !!}</th>
<th>{!! Lang::get('lang.from') !!}</th>
<th>{!! Lang::get('lang.last_replier') !!}</th>
<th>{!! Lang::get('lang.assigned_to') !!}</th>
<th>{!! Lang::get('lang.last_activity') !!}</th>
</thead>
<tbody id="hello">
@foreach ($tickets as $ticket )
<tr <?php if ($ticket->seen_by == null) {?> style="color:green;" <?php }
?> >
<td><input type="checkbox" class="icheckbox_flat-blue" name="select_all[]" value="{{$ticket->id}}"/></td>
<?php
// collaborators
$collaborators = App\Model\helpdesk\Ticket\Ticket_Collaborator::where('ticket_id','=',$ticket->id)->get();
$collab = count($collaborators);
// title
$title = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->first();
$string = strip_tags($title->title);
// check atatchments
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id','=',$title->id)->first();
$attach = count($attachments);
{!! Datatable::table()
->addColumn(
"",
Lang::get('lang.subject'),
Lang::get('lang.ticket_id'),
Lang::get('lang.priority'),
Lang::get('lang.from'),
Lang::get('lang.last_replier'),
Lang::get('lang.assigned_to'),
Lang::get('lang.last_activity'))
->setUrl(route('get.myticket.ticket'))
->setOrder(array(7=>'desc'))
->setClass('table table-hover table-bordered table-striped')
->render();!!}
if (strlen($string) > 40) {
$stringCut = substr($string, 0, 40);
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
$TicketData = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->where('is_internal', '=', 0)->max('id');
$TicketDatarow = App\Model\helpdesk\Ticket\Ticket_Thread::where('id', '=', $TicketData)->first();
$LastResponse = App\User::where('id', '=', $TicketDatarow->user_id)->first();
if($LastResponse->role == "user") {
$rep = "#F39C12";
$username = $LastResponse->user_name;
} else { $rep = "#000"; $username = $LastResponse->first_name ." ". $LastResponse->last_name;
if($LastResponse->first_name==null || $LastResponse->last_name==null) {
$username = $LastResponse->user_name;
}}
$titles = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
$count = count($titles);
foreach($titles as $title)
{
$title = $title;
}
$assigned_to = App\User::where('id','=',$ticket->assigned_to)->first();
if($assigned_to == null)
{
$assigned = "Unassigned";
}
else
{
$assigned = $assigned_to->first_name ." ". $assigned_to->last_name;
}
?>
<td class="mailbox-name"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">{{$string}} </a> ({!! $count!!}) <i class="fa fa-comment"></i>
@if($collab > 0)&nbsp;<i class="fa fa-users"></i>@endif
@if($attach > 0)&nbsp;<i class="fa fa-paperclip"></i>@endif</td>
<td class="mailbox-Id"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">#{!! $ticket->ticket_number !!}</a></td>
<?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $ticket->priority_id)->first();?>
<td class="mailbox-priority"><spam class="btn btn-{{$priority->priority_color}} btn-xs">{{$priority->priority_desc}}</spam></td>
<?php $from = App\User::where('id','=',$ticket->user_id)->first(); ?>
@if($from->role == "user")
<td class="mailbox-from" >{!! $from->user_name !!}</td>
@else
<td class="mailbox-from" >{!! $from->first_name." ".$from->last_name !!}</td>
@endif
<td class="mailbox-last-reply" style="color:{!! $rep !!}">{!! $username !!}</td>
<td>{!! $assigned !!}</td>
<td class="mailbox-last-activity">{!! UTC::usertimezone($title->updated_at) !!}</td>
</tr>
@endforeach
</tbody>
</table><!-- /.table -->
<div class="pull-right">
<?php echo $tickets->setPath(url('/ticket/myticket'))->render();?>&nbsp;
</div>
</div><!-- /.mail-box-messages -->
{!! Form::close() !!}
</div><!-- /.box-body -->

View File

@@ -48,124 +48,32 @@ class="active"
{{Session::get('fails')}}
</div>
@endif
<div class="box-body no-padding ">
<div class="box-body">
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
<div class="mailbox-controls">
<h3 class="pull-right" style="margin-top:0;margin-bottom:0;"> <div id="count_refresh">{!! $tickets->count().'-'.$tickets->total(); !!}</div></h3>
<!-- Check all button -->
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
<a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a>
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" value="{!! Lang::get('lang.delete') !!}">
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" value="{!! Lang::get('lang.close') !!}">
</div>
<div class=" table-responsive mailbox-messages" id="refresh">
<div class="mailbox-messages" id="refresh">
<p style="display:none;text-align:center; position:fixed; margin-left:40%;margin-top:-70px;" id="show" class="text-red"><b>{!! Lang::get('lang.loading') !!}...</b></p>
<!-- table -->
<table class="table table-hover table-striped">
<thead>
<th>
</th>
<th>{!! Lang::get('lang.subject') !!}</th>
<th>{!! Lang::get('lang.ticket_id') !!}</th>
<th>{!! Lang::get('lang.priority') !!}</th>
<th>{!! Lang::get('lang.from') !!}</th>
<th>{!! Lang::get('lang.last_replier') !!}</th>
<th>{!! Lang::get('lang.assigned_to') !!}</th>
<th>{!! Lang::get('lang.last_activity') !!}</th>
</thead>
<tbody id="hello">
@foreach ($tickets as $ticket)
<?php
{!! Datatable::table()
->addColumn(
"",
Lang::get('lang.subject'),
Lang::get('lang.ticket_id'),
Lang::get('lang.priority'),
Lang::get('lang.from'),
Lang::get('lang.last_replier'),
Lang::get('lang.assigned_to'),
Lang::get('lang.last_activity'))
->setUrl(route('get.open.ticket'))
->setOrder(array(7=>'desc'))
->setClass('table table-hover table-bordered table-striped')
->render();!!}
// // title
$ticket_reply = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->where('is_internal', '=', 0)->max('id');
$ticket_reply1 = App\Model\helpdesk\Ticket\Ticket_Thread::where('id','=',$ticket_reply)->first();
$last_replier = App\User::where('id','=', $ticket_reply1->user_id)->first();
if($last_replier->role == 'agent') {
} else {
$title = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->first();
$string = strip_tags($title->title);
if($title == null){
} else {
?>
<tr <?php if ($ticket->seen_by == null) {?> style="color:green;" <?php } ?> >
<td ><input type="checkbox" class="icheckbox_flat-blue" name="select_all[]" value="{{$ticket->id}}"/></td>
<?php
// collaborators
$collaborators = App\Model\helpdesk\Ticket\Ticket_Collaborator::where('ticket_id','=',$ticket->id)->get();
$collab = count($collaborators);
// check atatchments
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id','=',$title->id)->first();
$attach = count($attachments);
if (strlen($string) > 40) {
$stringCut = substr($string, 0, 40);
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
$TicketData = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
$TicketDatarow = App\Model\helpdesk\Ticket\Ticket_Thread::where('id', '=', $TicketData)->first();
$LastResponse = App\User::where('id', '=', $TicketDatarow->user_id)->first();
if($LastResponse->role == "user") {
$rep = "#F39C12";
$username = $LastResponse->user_name;
} else { $rep = "#000"; $username = $LastResponse->first_name ." ". $LastResponse->last_name;
if($LastResponse->first_name==null || $LastResponse->last_name==null) {
$username = $LastResponse->user_name;
}}
$titles = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
$count = count($titles);
foreach($titles as $title)
{
$title = $title;
}
$assigned_to = App\User::where('id','=',$ticket->assigned_to)->first();
if($assigned_to == null)
{
$assigned = "Unassigned";
}
else
{
$assigned = $assigned_to->first_name ." ". $assigned_to->last_name;
}
?>
<td class="mailbox-name"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">{{$string}} </a> ({!! $count!!}) <i class="fa fa-comment"></i>
@if($collab > 0)&nbsp;<i class="fa fa-users"></i>@endif
@if($attach > 0)&nbsp;<i class="fa fa-paperclip"></i>@endif</td>
<td class="mailbox-Id"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">#{!! $ticket->ticket_number !!}</a></td>
<?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $ticket->priority_id)->first();?>
<td class="mailbox-priority"><spam class="btn btn-{{$priority->priority_color}} btn-xs">{{$priority->priority_desc}}</spam></td>
<?php $from = App\User::where('id','=',$ticket->user_id)->first(); ?>
@if($from->role == "user")
<td class="mailbox-from" >{!! $from->user_name !!}</td>
@else
<td class="mailbox-from" >{!! $from->first_name." ".$from->last_name !!}</td>
@endif
<td class="mailbox-last-reply" style="color:{!! $rep !!}">{!! $username !!}</td>
<td>{!! $assigned !!}</td>
<td class="mailbox-last-activity">{!! UTC::usertimezone($title->updated_at) !!}</td>
</tr>
<?php } } ?>
@endforeach
</tbody>
</table><!-- /.table -->
<div class="pull-right">
<?php echo $tickets->setPath(url('/ticket/open'))->render();?>&nbsp;
</div>
</div><!-- /.mail-box-messages -->
{!! Form::close() !!}
</div><!-- /.box-body -->

View File

@@ -12,7 +12,7 @@ active
$user = App\User::where('id', '=', $tickets->user_id)->first();
$assignedto = App\User::where('id', '=', $tickets->assigned_to)->first();
$agent_group = Auth::user()->assign_group;
$group = App\Model\helpdesk\Agent\Groups::where('name', '=', $agent_group)->where('group_status', '=', '1')->first();
$group = App\Model\helpdesk\Agent\Groups::where('id', '=', $agent_group)->where('group_status', '=', '1')->first();
?>
@section('sidebar')
@@ -53,7 +53,7 @@ active
<?php
Event::fire(new \App\Events\TicketBoxHeader($user->id));
if ($group->can_edit_ticket == 1) {?>
if ($group->can_edit_ticket == 1) {?>
<button type="button" class="btn btn-default" id="Edit_Ticket" data-toggle="modal" data-target="#Edit"><i class="fa fa-edit" style="color:green;"> </i> {!! Lang::get('lang.edit') !!}</button>
<?php } ?>
@@ -62,7 +62,7 @@ active
<?php } ?>
@if($tickets->assigned_to == Auth::user()->id)
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#surrender"> <i class="fa fa-arrows-alt" style="color:red;"> </i> {!! Lang::get('lang.surrender') !!}</button>
<button type="button" id="surrender_button" class="btn btn-default" data-toggle="modal" data-target="#surrender"> <i class="fa fa-arrows-alt" style="color:red;"> </i> {!! Lang::get('lang.surrender') !!}</button>
@endif
<a href="{{url('ticket/print/'.$tickets->id)}}" target="_blank" class="btn btn-primary"><i class="fa fa-print" > </i> {!! Lang::get('lang.generate_pdf') !!}</a>
@@ -724,7 +724,7 @@ $data = $ConvDate[0];
<?php $sla_plans = App\Model\helpdesk\Manage\Sla_plan::all() ?>
<select class="form-control" name="sla_paln">
@foreach($sla_plans as $sla_plan)
<option value="{!! $sla_plan->id !!}">{!! $sla_plan->grace_period !!}</option>
<option value="{!! $sla_plan->id !!}" <?php if($SlaPlan->id == $sla_plan->id){ echo "selected"; } ?> >{!! $sla_plan->grace_period !!}</option>
@endforeach
</select>
<spam id="error-sla" style="display:none" class="help-block text-red">This is a required field</spam>
@@ -735,8 +735,8 @@ $data = $ConvDate[0];
<label>{!! Lang::get('lang.help_topic') !!}</label>
<?php $help_topics = App\Model\helpdesk\Manage\Help_topic::all() ?>
<select class="form-control" name="help_topic">
@foreach($help_topics as $help_topic)
<option value="{!! $help_topic->id !!}">{!! $help_topic->topic !!}</option>
@foreach($help_topics as $helptopic)
<option value="{!! $helptopic->id !!}" <?php if($help_topic->id == $helptopic->id){echo 'selected';} ?> >{!! $helptopic->topic !!}</option>
@endforeach
</select>
<spam id="error-help" style="display:none" class="help-block text-red">This is a required field</spam>
@@ -747,20 +747,23 @@ $data = $ConvDate[0];
<label>{!! Lang::get('lang.ticket_source') !!}</label>
<?php $ticket_sources = App\Model\helpdesk\Ticket\Ticket_source::all() ?>
<select class="form-control" name="ticket_source">
@foreach($ticket_sources as $ticket_source)
<option value="{!! $ticket_source->id !!}">{!! $ticket_source->value !!}</option>
@endforeach
@foreach($ticket_sources as $ticketsource)
<option value="{!! $ticketsource->id !!}" <?php if($tickets->source == $ticketsource->id){echo "selected"; } ?> >{!! $ticketsource->value !!}</option>
@endforeach
</select>
<spam id="error-source" style="display:none" class="help-block text-red">This is a required field</spam>
</div>
</div>
<?php
?>
<div class="col-md-6">
<div class="form-group">
<label>{!! Lang::get('lang.priority') !!}</label>
<?php $ticket_prioritys = App\Model\helpdesk\Ticket\Ticket_Priority::all() ?>
<select class="form-control" name="ticket_priority">
@foreach($ticket_prioritys as $ticket_priority)
<option value="{!! $ticket_priority->priority_id !!}">{!! $ticket_priority->priority_desc !!}</option>
<option value="{!! $ticket_priority->priority_id !!}" <?php if($tickets->priority_id == $ticket_priority->priority_id){echo "selected";} ?> >{!! $ticket_priority->priority_desc !!}</option>
@endforeach
</select>
<spam id="error-priority" style="display:none" class="help-block text-red">This is a required field</spam>
@@ -858,6 +861,7 @@ $data = $ConvDate[0];
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<?php if ($group->can_assign_ticket == 1) {?>
<!-- Ticket Assign Modal -->
<div class="modal fade" id="{{$tickets->id}}assign">
@@ -884,7 +888,7 @@ $data = $ConvDate[0];
<div id="assign_body">
<p>{!! Lang::get('lang.whome_do_you_want_to_assign_ticket') !!}?</p>
<select id="asssign" class="form-control" name="user">
<select id="asssign" class="form-control" name="assign_to">
<?php
$assign = App\User::where('role', '!=', 'user')->get();
$count_assign = count($assign);
@@ -893,12 +897,12 @@ $count_teams = count($teams);
?>
<optgroup label="Teams ( {!! $count_teams !!} )">
@foreach($teams as $team)
<option value="{{$team->id}}">{!! $team->name !!}</option>
<option value="team_{{$team->id}}">{!! $team->name !!}</option>
@endforeach
</optgroup>
<optgroup label="Agents ( {!! $count_assign !!} )">
@foreach($assign as $user)
<option value="{{$user->email}}">{{$user->first_name." ".$user->last_name}}</option>
<option value="user_{{$user->id}}">{{$user->first_name." ".$user->last_name}}</option>
@endforeach
</optgroup>
</select>
@@ -923,7 +927,7 @@ $count_teams = count($teams);
<h4 class="modal-title">{!! Lang::get('lang.surrender') !!}</h4>
</div>
<div class="modal-body">
<p>{!! Lang::get('are_you_sure_you_want_to_surrender_this_ticket') !!}?</p>
<p>{!! Lang::get('lang.are_you_sure_you_want_to_surrender_this_ticket') !!}?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis6">{!! Lang::get('lang.close') !!}</button>
@@ -1315,12 +1319,17 @@ $(document).ready(function () {
$("#assign_loader").show();
},
success: function(response) {
if(response === 1)
if(response == 1)
{
// $("#assign_body").show();
var message = "Success";
$('#message-success2').html(message);
setInterval(function(){$("#alert21").hide(); },4000);
// var message = "Success";
// $('#message-success1').html(message);
// setInterval(function(){$("#alert11").hide(); },4000);
var message = "Success!";
$("#alert11").show();
$('#message-success1').html(message);
setInterval(function(){$("#dismiss11").trigger("click"); },2000);
}
$("#assign_body").show();
$("#assign_loader").hide();
@@ -1442,17 +1451,18 @@ $(document).ready(function () {
{
// alert('ticket has been un assigned');
var message = "Success! You have Unassigned your ticket";
$("#alert21").show();
$('#message-success2').html(message);
setInterval(function(){$("#dismiss21").trigger("click"); },2000);
$("#alert11").show();
$('#message-success1').html(message);
setInterval(function(){$("#dismiss11").trigger("click"); },2000);
// $("#refresh1").load( "http://localhost/faveo/public/thread/{{$tickets->id}} #refresh1");
$('#surrender_button').hide();
}
else
{
var message = "Fail! For some reason your request failed";
$("#alert23").show();
$('#message-danger2').html(message);
setInterval(function(){$("#dismiss23").trigger("click"); },2000);
$("#alert13").show();
$('#message-danger1').html(message);
setInterval(function(){$("#dismiss13").trigger("click"); },2000);
// alert('fail');
// $( "#dismis4" ).trigger( "click" );
}

View File

@@ -43,103 +43,35 @@ class="active"
{{Session::get('fails')}}
</div>
@endif
<div class="box-body no-padding ">
<div class="box-body">
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
<div class="mailbox-controls">
<h3 class="pull-right" style="margin-top:0;margin-bottom:0;"> <div id="count_refresh">{!! $tickets->count().'-'.$tickets->total(); !!}</div></h3>
<!-- Check all button -->
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
<a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a>
<input type="submit" class="btn btn-default text-blue btn-sm" name="submit" value="{!! Lang::get('lang.open') !!}">
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" value="{!! Lang::get('lang.close') !!}">
</div>
<div class=" table-responsive mailbox-messages" id="refresh">
<div class="mailbox-messages" id="refresh">
<p style="display:none;text-align:center; position:fixed; margin-left:40%;margin-top:-70px;" id="show" class="text-red"><b>{!! Lang::get('lang.loading') !!}...</b></p>
<!-- table -->
<table class="table table-hover table-striped">
<thead>
<th>
</th>
<th>{!! Lang::get('lang.subject') !!}</th>
<th>{!! Lang::get('lang.ticket_id') !!}</th>
<th>{!! Lang::get('lang.priority') !!}</th>
<th>{!! Lang::get('lang.from') !!}</th>
<th>{!! Lang::get('lang.last_replier') !!}</th>
<th>{!! Lang::get('lang.assigned_to') !!}</th>
<th>{!! Lang::get('lang.last_activity') !!}</th>
</thead>
<tbody id="hello">
{!! Datatable::table()
->addColumn(
"",
Lang::get('lang.subject'),
Lang::get('lang.ticket_id'),
Lang::get('lang.priority'),
Lang::get('lang.from'),
Lang::get('lang.last_replier'),
Lang::get('lang.assigned_to'),
Lang::get('lang.last_activity'))
->setUrl(route('get.trash.ticket'))
->setOrder(array(7=>'desc'))
->setClass('table table-hover table-bordered table-striped')
->render();!!}
@foreach ($tickets as $ticket )
<tr <?php if ($ticket->seen_by == null) {?> style="color:green;" <?php }
?> >
<td><input type="checkbox" class="icheckbox_flat-blue" name="select_all[]" value="{{$ticket->id}}"/></td>
<?php
// collaborators
$collaborators = App\Model\helpdesk\Ticket\Ticket_Collaborator::where('ticket_id','=',$ticket->id)->get();
$collab = count($collaborators);
// title
$title = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->first();
$string = strip_tags($title->title);
// check atatchments
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id','=',$title->id)->first();
$attach = count($attachments);
if (strlen($string) > 40) {
$stringCut = substr($string, 0, 40);
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
$TicketData = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
$TicketDatarow = App\Model\helpdesk\Ticket\Ticket_Thread::where('id', '=', $TicketData)->first();
$LastResponse = App\User::where('id', '=', $TicketDatarow->user_id)->first();
if($LastResponse->role == "user") {
$rep = "#F39C12";
$username = $LastResponse->user_name;
} else { $rep = "#000"; $username = $LastResponse->first_name ." ". $LastResponse->last_name;
if($LastResponse->first_name==null || $LastResponse->last_name==null) {
$username = $LastResponse->user_name;
}}
$titles = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
$count = count($titles);
foreach($titles as $title)
{
$title = $title;
}
$assigned_to = App\User::where('id','=',$ticket->assigned_to)->first();
if($assigned_to == null)
{
$assigned = "Unassigned";
}
else
{
$assigned = $assigned_to->first_name ." ". $assigned_to->last_name;
}
?>
<td class="mailbox-name"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">{{$string}} </a> ({!! $count!!}) <i class="fa fa-comment"></i>
@if($collab > 0)&nbsp;<i class="fa fa-users"></i>@endif
@if($attach > 0)&nbsp;<i class="fa fa-paperclip"></i>@endif</td>
<td class="mailbox-Id"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">#{!! $ticket->ticket_number !!}</a></td>
<?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $ticket->priority_id)->first();?>
<td class="mailbox-priority"><spam class="btn btn-{{$priority->priority_color}} btn-xs">{{$priority->priority_desc}}</spam></td>
<?php $from = App\User::where('id','=',$ticket->user_id)->first(); ?>
@if($from->role == "user")
<td class="mailbox-from" >{!! $from->user_name !!}</td>
@else
<td class="mailbox-from" >{!! $from->first_name." ".$from->last_name !!}</td>
@endif
<td class="mailbox-last-reply" style="color:{!! $rep !!}">{!! $username !!}</td>
<td>{!! $assigned !!}</td>
<td class="mailbox-last-activity">{!! UTC::usertimezone($title->updated_at) !!}</td>
</tr>
@endforeach
</tbody>
</table><!-- /.table -->
<div class="pull-right">
<?php echo $tickets->setPath(url('/trash'))->render();?>&nbsp;
</div>
</div><!-- /.mail-box-messages -->
{!! Form::close() !!}
</div><!-- /.box-body -->

View File

@@ -16,10 +16,11 @@ class="active"
<?php
if(Auth::user()->role == 'agent') {
$dept = App\Model\helpdesk\Agent\Department::where('name','=',Auth::user()->primary_dpt)->first();
$tickets = App\Model\helpdesk\Ticket\Tickets::where('assigned_to', '=', 0)->where('dept_id','=',$dept->id)->where('status','1')->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('assigned_to', '=', null)->where('dept_id','=',$dept->id)->where('status','1')->orderBy('id', 'DESC')->paginate(20);
} else {
$tickets = App\Model\helpdesk\Ticket\Tickets::where('assigned_to', '=', 0)->where('status','1')->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('assigned_to', '=', null)->where('status','1')->orderBy('id', 'DESC')->paginate(20);
}
// dd($tickets);
?>
<!-- Main content -->
<div class="box box-info">
@@ -44,104 +45,35 @@ class="active"
{{Session::get('fails')}}
</div>
@endif
<div class="box-body no-padding ">
<div class="box-body">
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
<div class="mailbox-controls">
<h3 class="pull-right" style="margin-top:0;margin-bottom:0;"> <div id="count_refresh">{!! $tickets->count().'-'.$tickets->total(); !!}</div></h3>
<!-- Check all button -->
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
<a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a>
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" value="{!! Lang::get('lang.delete') !!}">
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" value="{!! Lang::get('lang.close') !!}">
</div>
<div class=" table-responsive mailbox-messages" id="refresh">
<div class="mailbox-messages" id="refresh">
<p style="display:none;text-align:center; position:fixed; margin-left:40%;margin-top:-70px;" id="show" class="text-red"><b>{!! Lang::get('lang.loading') !!}...</b></p>
<!-- table -->
<table class="table table-hover table-striped">
<thead>
<th>
</th>
<th>{!! Lang::get('lang.subject') !!}</th>
<th>{!! Lang::get('lang.ticket_id') !!}</th>
<th>{!! Lang::get('lang.priority') !!}</th>
<th>{!! Lang::get('lang.from') !!}</th>
<th>{!! Lang::get('lang.last_replier') !!}</th>
<th>{!! Lang::get('lang.assigned_to') !!}</th>
<th>{!! Lang::get('lang.last_activity') !!}</th>
</thead>
<tbody id="hello">
{!! Datatable::table()
->addColumn(
"",
Lang::get('lang.subject'),
Lang::get('lang.ticket_id'),
Lang::get('lang.priority'),
Lang::get('lang.from'),
Lang::get('lang.last_replier'),
Lang::get('lang.assigned_to'),
Lang::get('lang.last_activity'))
->setUrl(route('get.unassigned.ticket'))
->setOrder(array(7=>'desc'))
->setClass('table table-hover table-bordered table-striped')
->render();!!}
@foreach ($tickets as $ticket )
<tr <?php if ($ticket->seen_by == null) {?> style="color:green;" <?php }
?> >
<td><input type="checkbox" class="icheckbox_flat-blue" name="select_all[]" value="{{$ticket->id}}"/></td>
<?php
// collaborators
$collaborators = App\Model\helpdesk\Ticket\Ticket_Collaborator::where('ticket_id','=',$ticket->id)->get();
$collab = count($collaborators);
// title
$title = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->first();
$string = strip_tags($title->title);
// check atatchments
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id','=',$title->id)->first();
$attach = count($attachments);
if (strlen($string) > 40) {
$stringCut = substr($string, 0, 40);
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
$TicketData = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
$TicketDatarow = App\Model\helpdesk\Ticket\Ticket_Thread::where('id', '=', $TicketData)->first();
$LastResponse = App\User::where('id', '=', $TicketDatarow->user_id)->first();
if($LastResponse->role == "user") {
$rep = "#F39C12";
$username = $LastResponse->user_name;
} else { $rep = "#000"; $username = $LastResponse->first_name ." ". $LastResponse->last_name;
if($LastResponse->first_name==null || $LastResponse->last_name==null) {
$username = $LastResponse->user_name;
}}
$titles = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
$count = count($titles);
foreach($titles as $title)
{
$title = $title;
}
$assigned_to = App\User::where('id','=',$ticket->assigned_to)->first();
if($assigned_to == null)
{
$assigned = "Unassigned";
}
else
{
$assigned = $assigned_to->first_name ." ". $assigned_to->last_name;
}
?>
<td class="mailbox-name"><a class="text-red" href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">{{$string}} </a> ({!! $count!!}) <i class="fa fa-comment"></i>
@if($collab > 0)&nbsp;<i class="fa fa-users"></i>@endif
@if($attach > 0)&nbsp;<i class="fa fa-paperclip"></i>@endif</td>
<td class="mailbox-Id"><a href="{!! route('ticket.thread',[$ticket->id]) !!}" title="{!! $title->title !!}">#{!! $ticket->ticket_number !!}</a></td>
<?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $ticket->priority_id)->first();?>
<td class="mailbox-priority"><spam class="btn btn-{{$priority->priority_color}} btn-xs">{{$priority->priority_desc}}</spam></td>
<?php $from = App\User::where('id','=',$ticket->user_id)->first(); ?>
@if($from->role == "user")
<td class="mailbox-from" >{!! $from->user_name !!}</td>
@else
<td class="mailbox-from" >{!! $from->first_name." ".$from->last_name !!}</td>
@endif
<td class="mailbox-last-reply" style="color:{!! $rep !!}">{!! $username !!}</td>
<td>{!! $assigned !!}</td>
<td class="mailbox-last-activity">{!! UTC::usertimezone($title->updated_at) !!}</td>
</tr>
@endforeach
</tbody>
</table><!-- /.table -->
<div class="pull-right">
<?php echo $tickets->setPath(url('/unassigned'))->render();?>&nbsp;
</div>
</div><!-- /.mail-box-messages -->
{!! Form::close() !!}
</div><!-- /.box-body -->

View File

@@ -45,8 +45,16 @@ class="active"
@else
<tr><th class="col-md-8"><h4><b>{!! Lang::get('lang.gender') !!}:</b></h4></th><td class="col-md-6"><h4>{{ 'Female' }}</h4></td></tr>
@endif
<tr><th class="col-md-8"><h4><b>{!! Lang::get('lang.department') !!}:</b></h4></th><td class="col-md-6"><h4>{{ $user->primary_dpt }}</h4></td></tr>
<tr><th class="col-md-8"><h4><b>{!! Lang::get('lang.group') !!}:</b></h4></th><td class="col-md-6"><h4>{{ $user->assign_group }}</h4></td></tr>
<?php
if($user->primary_dpt){
$dept = App\Model\helpdesk\Agent\Department::where('id','=',$user->primary_dpt)->first();
}
if($user->assign_group){
$grp = App\Model\helpdesk\Agent\Groups::where('id','=',$user->assign_group)->first();
}
?>
<tr><th class="col-md-8"><h4><b>{!! Lang::get('lang.department') !!}:</b></h4></th><td class="col-md-6"><h4>{{ $dept->name }}</h4></td></tr>
<tr><th class="col-md-8"><h4><b>{!! Lang::get('lang.group') !!}:</b></h4></th><td class="col-md-6"><h4>{{ $grp->name }}</h4></td></tr>
<tr><th class="col-md-8"><h4><b>{!! Lang::get('lang.company') !!}:</b></h4></th><td class="col-md-6"> <h4>{{ $user->company }}</h4></td></tr>
<tr><th class="col-md-8"><h4><b>{!! Lang::get('lang.time_zone') !!}:</b></h4></th><td class="col-md-6"><h4> {{ $user->agent_tzone }}</h4></td></tr>
<tr><th class="col-md-8"><h4><b>{!! Lang::get('lang.role') !!}:</b></h4></th><td class="col-md-6"> <h4>{{ $user->role }}</h4></td></tr>

View File

@@ -228,7 +228,7 @@ if (Auth::user()->role == 'admin') { ?>
<!-- /.sidebar -->
</aside>
<?php $agent_group = Auth::user()->assign_group;
$group = App\Model\helpdesk\Agent\Groups::where('name', '=', $agent_group)->where('group_status', '=', '1')->first();
$group = App\Model\helpdesk\Agent\Groups::where('id', '=', $agent_group)->where('group_status', '=', '1')->first();
// dd($group); ?>
<!-- Right side column. Contains the navbar and content of the page -->
<div class="content-wrapper">
@@ -288,6 +288,7 @@ $group = App\Model\helpdesk\Agent\Groups::where('name', '=', $agent_group)->wher
</footer>
</div><!-- ./wrapper -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/js/bootstrap-datetimepicker.min.js"></script>
<!-- Bootstrap 3.3.2 JS -->
<script src="{{asset("lb-faveo/downloads/bootstrap.min.js")}}" type="text/javascript"></script>
<!-- Slimscroll -->

View File

@@ -39,24 +39,14 @@
<li @yield('all-pages')><a href="{{url('page')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.allpages')}}</a></li>
</ul>
</li>
<li class="treeview @yield('widget')">
<a href="#">
<i class="fa fa-th"></i> <span>{{Lang::get('lang.widgets')}}</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li @yield('side1')><a href="{{url('side1')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.sidewidget1')}}</a></li>
<li @yield('side2')><a href="{{url('side2')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.sidewidget2')}}</a></li>
<li @yield('social')><a href="{{url('social')}}"><i class="fa fa-circle-o"></i> {!! Lang::get('lang.social') !!}</a></li>
</ul>
</li>
<li @yield('comment')>
<li @yield('comment')>
<a href="{{url('comment')}}">
<i class="fa fa-comments-o"></i>
<span>{{Lang::get('lang.comments')}}</span>
</a>
</li>
<li @yield('settings')>
<li @yield('settings')>
<a href="{{url('kb/settings')}}">
<i class="fa fa-wrench"></i>
<span>{{Lang::get('lang.settings')}}</span>