#bug-fix-patch-11

# Showing correct ticket count and correct message in ticket listing
pages
# removed "my tickets" tab form top bar as it's already in sidebar
This commit is contained in:
Manish Verma
2016-12-27 16:19:08 +05:30
parent 8fefca286f
commit 5ea755fb55
14 changed files with 42 additions and 74 deletions

View File

@@ -196,6 +196,7 @@ class FilterController extends Controller
->leftJoin('ticket_status', function ($join) {
$join->on('ticket_status.id', '=', 'tickets.status');
})
->where('isanswered', '=', 0)
->where('tickets.status', '=', 1);
case '/duetoday':
if (Auth::user()->role == 'agent') {
@@ -238,7 +239,7 @@ class FilterController extends Controller
->whereNotNull('title')
->where('ticket_thread.is_internal', '<>', 1);
})
->leftJoin('ticket_thread as ticket_thread2', 'ticket_thread2.ticket_id', '=', 'tickets.id')
->Join('ticket_source', 'ticket_source.id', '=', 'tickets.source')
->leftJoin('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id')
->leftJoin('users as u', 'u.id', '=', 'tickets.user_id')

View File

@@ -72,7 +72,7 @@ class="active"
<div class="info-box">
<span class="info-box-icon bg-red"><i class="fa fa-calendar-times-o"></i></span>
<div class="info-box-content">
s <span class="info-box-text">{!! Lang::get('lang.overdue') !!}</span>
<span class="info-box-text">{!! Lang::get('lang.overdue') !!}</span>
<span class="info-box-number">{{ $overdues->count() }} <small> Tickets</small></span>
</div><!-- /.info-box-content -->
</div><!-- /.info-box -->

View File

@@ -45,17 +45,15 @@ class="active"
$date_time_format = UTC::getDateTimeFormat();
if (Auth::user()->role == 'agent') {
$dept = App\Model\helpdesk\Agent\Department::select('id', 'name')->where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->paginate(20);
$dept_name = $dept->name;
} else {
$dept_name = \Request::segments()[1];
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->orderBy('id', 'DESC')->paginate(20);
}
?>
<!-- Main content -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{!! $dept_name !!} / {!! $status !!} </h3> <small id="title_refresh">{!! $tickets->total() !!} {!! Lang::get('lang.tickets') !!}</small>
<h3 class="box-title">{!! $dept_name !!} / {!! $status !!} </h3>
</div><!-- /.box-header -->
<div class="box-body ">

View File

@@ -46,15 +46,15 @@ class="active"
$date_time_format = UTC::getDateTimeFormat();
if (Auth::user()->role == 'agent') {
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 1)->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 1)->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->count();
} else {
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 1)->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 1)->orderBy('id', 'DESC')->count();
}
?>
<!-- Main content -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{!! Lang::get('lang.answered') !!} </h3> <small id="title_refresh">{!! $tickets->total() !!} {!! Lang::get('lang.tickets') !!}</small>
<h3 class="box-title">{!! Lang::get('lang.answered') !!} </h3> <small id="title_refresh">{!! $tickets !!} {!! Lang::get('lang.tickets') !!}</small>
<div class="box-tools pull-right">
<div class="has-feedback">
</div>

View File

@@ -46,15 +46,15 @@ class="active"
$date_time_format = UTC::getDateTimeFormat();
if (Auth::user()->role == 'agent') {
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('assigned_to', '>', 0)->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('assigned_to', '>', 0)->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->count();
} else {
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('assigned_to', '>', 0)->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('assigned_to', '>', 0)->orderBy('id', 'DESC')->count();
}
?>
<!-- Main content -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"> {!! Lang::get('lang.assigned') !!} </h3> <small id="title_refresh"> {!! $tickets->total() !!} {!! Lang::get('lang.tickets') !!}</small>
<h3 class="box-title"> {!! Lang::get('lang.assigned') !!} </h3> <small id="title_refresh"> {!! $tickets !!} {!! Lang::get('lang.tickets') !!}</small>
</div><!-- /.box-header -->
<div class="box-body">
@if(Session::has('success'))

View File

@@ -46,15 +46,15 @@ class="active"
$date_time_format = UTC::getDateTimeFormat();
if (Auth::user()->role == 'agent') {
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '>', 1)->where('dept_id', '=', $dept->id)->where('status', '<', 4)->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '>', 1)->where('dept_id', '=', $dept->id)->where('status', '<', 4)->orderBy('id', 'DESC')->count();
} else {
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '>', 1)->where('status', '<', 4)->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '>', 1)->where('status', '<', 4)->orderBy('id', 'DESC')->count();
}
?>
<!-- Main content -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"> {!! Lang::get('lang.closed') !!} </h3> <small id="title_refresh">{!! $tickets->total() !!} {!! Lang::get('lang.tickets') !!}</small>
<h3 class="box-title"> {!! Lang::get('lang.closed') !!} </h3> <small id="title_refresh">{!! $tickets !!} {!! Lang::get('lang.tickets') !!}</small>
</div><!-- /.box-header -->
<div class="box-body">
@if(Session::has('success'))

View File

@@ -48,23 +48,14 @@ class="active"
$todaytickets = count(App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->whereRaw('date(duedate) = ?', [date('Y-m-d')])->get());
} else {
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
$todaytickets = count(App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->whereRaw('date(duedate) = ?', [date('Y-m-d')])->where('dept_id', '=', $dept->id)->get());
$todaytickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->whereRaw('date(duedate) = ?', [date('Y-m-d')])->where('dept_id', '=', $dept->id)->count();
}
?>
<!-- //no need -->
<?php
$date_time_format = UTC::getDateTimeFormat();
if (Auth::user()->role == 'agent') {
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->paginate(20);
} else {
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->orderBy('id', 'DESC')->paginate(20);
}
?>
<!-- Main content -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{!! Lang::get('lang.open') !!} </h3> <small id="title_refresh">{!! $todaytickets !!} {!! Lang::get('lang.tickets') !!}</small>
<h3 class="box-title">{!! Lang::get('lang.duetoday') !!} </h3> <small id="title_refresh">{!! $todaytickets !!} {!! Lang::get('lang.tickets') !!}</small>
<div class="box-tools pull-right">
<div class="has-feedback">
</div>

View File

@@ -45,15 +45,15 @@ class="active"
$date_time_format = UTC::getDateTimeFormat();
if (Auth::user()->role == 'agent') {
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->count();
} else {
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->orderBy('id', 'DESC')->count();
}
?>
<!-- Main content -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{!! Lang::get('lang.inbox') !!} </h3> <small id="title_refresh">{!! $tickets->total() !!} {!! Lang::get('lang.tickets') !!}</small>
<h3 class="box-title">{!! Lang::get('lang.inbox') !!} </h3> <small id="title_refresh">{!! $tickets !!} {!! Lang::get('lang.tickets') !!}</small>
</div><!-- /.box-header -->
<div class="box-body ">

View File

@@ -44,15 +44,15 @@ class="active"
$date_time_format = UTC::getDateTimeFormat();
if (Auth::user()->role == 'agent') {
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('assigned_to', '=', Auth::user()->id)->orderBy('id', 'ASC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('assigned_to', '=', Auth::user()->id)->orderBy('id', 'ASC')->count();
} else {
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('assigned_to', '=', Auth::user()->id)->orderBy('id', 'ASC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('assigned_to', '=', Auth::user()->id)->orderBy('id', 'ASC')->count();
}
?>
<!-- Main content -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{!! Lang::get('lang.my_tickets') !!}</h3> <small id="title_refresh">{!! $tickets->total() !!} {!! Lang::get('lang.tickets') !!}</small>
<h3 class="box-title">{!! Lang::get('lang.my_tickets') !!}</h3> <small id="title_refresh">{!! $tickets !!} {!! Lang::get('lang.tickets') !!}</small>
</div><!-- /.box-header -->
<div class="box-body">

View File

@@ -46,15 +46,15 @@ class="active"
$date_time_format = UTC::getDateTimeFormat();
if (Auth::user()->role == 'agent') {
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->count();
} else {
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->orderBy('id', 'DESC')->count();
}
?>
<!-- Main content -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{!! Lang::get('lang.open') !!} </h3> <small id="title_refresh">{!! $tickets->total() !!} {!! Lang::get('lang.tickets') !!}</small>
<h3 class="box-title">{!! Lang::get('lang.open') !!} </h3> <small id="title_refresh">{!! $tickets !!} {!! Lang::get('lang.tickets') !!}</small>
<div class="box-tools pull-right">
<div class="has-feedback">
</div>

View File

@@ -41,38 +41,20 @@ class="active"
@stop
@section('content')
<?php
// $date_time_format = UTC::getDateTimeFormat();
// if (Auth::user()->role == 'agent') {
// $dept = \App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
// $overdues = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->get();
// } else {
// $overdues = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->orderBy('id', 'DESC')->get();
// }
// $i = count($overdues);
// if ($i == 0) {
// $overdue_ticket = 0;
// } else {
// $j = 0;
// foreach ($overdues as $overdue) {
// $sla_plan = App\Model\helpdesk\Manage\Sla_plan::where('id', '=', $overdue->sla)->first();
// $ovadate = $overdue->created_at;
// $new_date = date_add($ovadate, date_interval_create_from_date_string($sla_plan->grace_period)) . '<br/><br/>';
// if (date('Y-m-d H:i:s') > $new_date) {
// $j++;
// //$value[] = $overdue;
// }
// }
// // dd(count($value));
// if ($j > 0) {
// $overdue_ticket = $j;
// } else {
// $overdue_ticket = 0;
// }
// }
$overdue_ticket=App\Model\helpdesk\Ticket\Tickets::where('tickets.duedate','<', \Carbon\Carbon::now())->count();
$otickets = App\Model\helpdesk\Ticket\Tickets::where('tickets.status', '=', 1)
->where('tickets.isanswered', '=', 0)
->whereNotNull('tickets.duedate')
->where('tickets.duedate', '!=', '00-00-00 00:00:00')
// ->where('duedate','>',\Carbon\Carbon::now());
->where('tickets.duedate', '<', \Carbon\Carbon::now());
if (\Auth::user()->role === 'agent') {
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
$otickets = $otickets->where('dept_id', '=', $dept->id);
}
$overdue_ticket = $otickets->count();
?>
<!-- Main content -->

View File

@@ -44,15 +44,15 @@ class="active"
// $date_time_format = UTC::getDateTimeFormat();
if (Auth::user()->role == 'agent') {
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 5)->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 5)->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->count();
} else {
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 5)->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 5)->orderBy('id', 'DESC')->count();
}
?>
<!-- Main content -->
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title">{!! Lang::get('lang.trash') !!} </h3> <small id="title_refresh">{!! $tickets->total() !!} {!! Lang::get('lang.tickets') !!}</small>
<h3 class="box-title">{!! Lang::get('lang.trash') !!} </h3> <small id="title_refresh">{!! $tickets !!} {!! Lang::get('lang.tickets') !!}</small>
</div><!-- /.box-header -->
<div class="box-body">
@if(Session::has('success'))

View File

@@ -44,9 +44,9 @@ class="active"
$date_time_format = UTC::getDateTimeFormat();
if (Auth::user()->role == 'agent') {
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = App\Model\helpdesk\Ticket\Tickets::where('assigned_to', '=', null)->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')->count();
} else {
$tickets = App\Model\helpdesk\Ticket\Tickets::where('assigned_to', '=', null)->where('status', '1')->orderBy('id', 'DESC')->paginate(20);
$tickets = App\Model\helpdesk\Ticket\Tickets::where('assigned_to', '=', null)->where('status', '1')->orderBy('id', 'DESC')->count();
}
// dd($tickets);
?>
@@ -54,7 +54,7 @@ if (Auth::user()->role == 'agent') {
<div class="box box-info">
<div class="box-header with-border">
<?php $counted = count(App\Model\helpdesk\Ticket\Tickets::where('assigned_to', '=', 0)->get()); ?>
<h3 class="box-title">{!! Lang::get('lang.unassigned') !!} </h3> <small id="title_refresh"> {!! $tickets->total() !!} {!! Lang::get('lang.tickets') !!}</small>
<h3 class="box-title">{!! Lang::get('lang.unassigned') !!} </h3> <small id="title_refresh"> {!! $tickets !!} {!! Lang::get('lang.tickets') !!}</small>
</div><!-- /.box-header -->
<div class="box-body">
@if(Session::has('success'))

View File

@@ -320,7 +320,7 @@
</aside>
<?php
$agent_group = $auth_user_assign_group;
$group = App\Model\helpdesk\Agent\Groups::where('id', '=', $agent_group)->where('group_status', '=', '1')->first();
$group = App\Model\helpdesk\Agent\Groups::where('id', '=', $agent_group)->first();
?>
<!-- Right side column. Contains the navbar and content of the page -->
<div class="content-wrapper">
@@ -344,10 +344,6 @@ $group = App\Model\helpdesk\Agent\Groups::where('id', '=', $agent_group)->where(
<ul class="nav navbar-nav">
<li id="bar" @yield('open')><a href="{{ url('/ticket/open')}}" id="load-open">{!! Lang::get('lang.open') !!}</a></li>
<li id="bar" @yield('answered')><a href="{{ url('/ticket/answered')}}" id="load-answered">{!! Lang::get('lang.answered') !!}</a></li>
<li id="bar" @yield('myticket')><a href="{{ url('/ticket/myticket')}}" >{!! Lang::get('lang.my_tickets') !!}</a></li>
{{-- < li id = "bar" @yield('ticket') > < a href = "{{ url('ticket') }}" >Ticket</a></li> --}}
{{-- < li id = "bar" @yield('overdue') > < a href = "{{ url('/ticket/overdue') }}" >Overdue</a></li> --}}
<li id="bar" @yield('assigned')><a href="{{ url('/ticket/assigned')}}" id="load-assigned" >{!! Lang::get('lang.assigned') !!}</a></li>
<li id="bar" @yield('closed')><a href="{{ url('/ticket/closed')}}" >{!! Lang::get('lang.closed') !!}</a></li>
<?php if ($group->can_create_ticket == 1) { ?>