From 02b4b4236390e5bec2216009585a57d416643196 Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Thu, 9 Aug 2018 16:57:57 +0530 Subject: [PATCH] Update inbox fix --- .../helpdesk/Filter/FilterController.php | 3 +-- .../Agent/helpdesk/TicketController.php | 19 ++++++++----------- app/Http/helpers.php | 11 +++++++++++ 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/app/Http/Controllers/Agent/helpdesk/Filter/FilterController.php b/app/Http/Controllers/Agent/helpdesk/Filter/FilterController.php index 382f68e35..43fae0c8a 100644 --- a/app/Http/Controllers/Agent/helpdesk/Filter/FilterController.php +++ b/app/Http/Controllers/Agent/helpdesk/Filter/FilterController.php @@ -1035,14 +1035,13 @@ class FilterController extends Controller public function getGMT() { $system = \App\Model\helpdesk\Settings\System::select('time_zone')->first(); - $timezone = \DB::table('timezone')->select('location')->where('name', '=', $system->time_zone)->first(); + $timezone = \DB::table('timezone')->select('location')->where('id', '=', $system->time_zone)->first(); $location = '(GMT) London'; if ($timezone) { $location = $timezone->location; } $tz = explode(')', substr($location, stripos($location, 'T') + 1)); - return $tz[0]; } diff --git a/app/Http/Controllers/Agent/helpdesk/TicketController.php b/app/Http/Controllers/Agent/helpdesk/TicketController.php index 27f6251e6..77fa77539 100644 --- a/app/Http/Controllers/Agent/helpdesk/TicketController.php +++ b/app/Http/Controllers/Agent/helpdesk/TicketController.php @@ -2659,7 +2659,12 @@ class TicketController extends Controller { return \Datatable::table() ->addColumn( - '', Lang::get('lang.subject'), Lang::get('lang.ticket_id'), Lang::get('lang.from'), Lang::get('lang.assigned_to'), Lang::get('lang.last_activity') + '', + Lang::get('lang.subject'), + Lang::get('lang.ticket_id'), + Lang::get('lang.from'), + Lang::get('lang.assigned_to'), + Lang::get('lang.last_activity') )->noScript(); } @@ -2691,7 +2696,7 @@ class TicketController extends Controller return "
"; }) - ->addColumn('title', function ($tickets) { + ->editColumn('title', function ($tickets) { if (isset($tickets->ticket_title)) { $string = utfEncoding($tickets->ticket_title); if (strlen($string) > 25) { @@ -2783,15 +2788,7 @@ class TicketController extends Controller } } }) - ->editColumn('updated_at', function ($tickets) { - $TicketDatarow = $tickets->updated_at; - $updated = '--'; - if ($TicketDatarow) { - $updated = faveoDate($tickets->updated_at); - } - - return ''.$updated.''.$updated; - }) + ->make(); } diff --git a/app/Http/helpers.php b/app/Http/helpers.php index 2b7343c29..b22b7b5b0 100644 --- a/app/Http/helpers.php +++ b/app/Http/helpers.php @@ -211,3 +211,14 @@ function faveoDate($date = '', $format = '', $tz = '') return 'invalid'; } } + +function timezone() +{ + $system = App\Model\helpdesk\Settings\System::select('time_zone')->first(); + $tz = 'UTC'; + if ($system) { + $tz = App\Model\helpdesk\Utility\Timezones::where('id', $system->time_zone)->first()->name; + } + + return $tz; +}