update v1.0.7.5

This commit is contained in:
Sujit Prasad
2016-06-14 14:45:24 +05:30
parent 32a73e76d1
commit 050086df09
46 changed files with 2009 additions and 1437 deletions

View File

@@ -31,6 +31,8 @@ use App\Model\helpdesk\Ticket\Tickets;
use App\Model\helpdesk\Utility\CountryCode;
use App\Model\helpdesk\Utility\Date_time_format;
use App\Model\helpdesk\Utility\Timezones;
use App\Model\helpdesk\Notification\Notification;
use App\Model\helpdesk\Notification\UserNotification;
use App\User;
use Auth;
use DB;
@@ -1533,6 +1535,14 @@ class TicketController extends Controller
$ticket->closed_at = null;
$ticket->save();
} elseif ($value == 'Delete forever') {
$notification = Notification::select('id')->where('model_id', '=', $ticket->id)->get();
foreach ($notification as $id) {
$user_notification = UserNotification::where(
'notification_id', '=', $id->id);
$user_notification->delete();
}
$notification = Notification::select('id')->where('model_id', '=', $ticket->id);
$notification->delete();
$thread = Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
foreach ($thread as $th_id) {
// echo $th_id->id." ";
@@ -1562,11 +1572,11 @@ class TicketController extends Controller
}
}
if ($value == 'Delete') {
return redirect()->back()->with('success', 'Moved to trash');
return redirect()->back()->with('success', lang::get('lang.moved_to_trash'));
} elseif ($value == 'Close') {
return redirect()->back()->with('success', 'Tickets has been Closed');
return redirect()->back()->with('success', Lang::get('lang.tickets_have_been_closed'));
} elseif ($value == 'Open') {
return redirect()->back()->with('success', 'Ticket has been Opened');
return redirect()->back()->with('success', Lang::get('lang.tickets_have_been_opened'));
} else {
return redirect()->back()->with('success', Lang::get('lang.hard-delete-success-message'));
}