Bug-fix-patch-1

# unverifeied user tickets issue(now showing tickets in inbox and
concating exclaimation marks on user name if account not verified)
This commit is contained in:
Manish Verma
2016-12-05 10:47:06 +05:30
parent dd0955cbd3
commit 3802620b1b

View File

@@ -1124,23 +1124,28 @@ class TicketController extends Controller
$ticket->source = $source; $ticket->source = $source;
$ticket_status = $this->checkUserVerificationStatus(); $ticket_status = $this->checkUserVerificationStatus();
//dd($ticket_status); //dd($ticket_status);
if ($ticket_status == 0) { // if ($ticket_status == 0) {
//check if user active then allow ticket creation else create unverified ticket // //check if user active then allow ticket creation else create unverified ticket
if ($user_status->active == 1) { // if ($user_status->active == 1) {
if ($status == null) { // if ($status == null) {
$ticket->status = 1; // $ticket->status = 1;
} else { // } else {
$ticket->status = $status; // $ticket->status = $status;
} // }
} else { // } else {
$ticket->status = 6; // $ticket->status = 6;
} // }
// } else {
// if ($status == null) {
// $ticket->status = 1;
// } else {
// $ticket->status = $status;
// }
// }
if ($status == null) {
$ticket->status = 1;
} else { } else {
if ($status == null) { $ticket->status = $status;
$ticket->status = 1;
} else {
$ticket->status = $status;
}
} }
$ticket->save(); $ticket->save();
@@ -2537,7 +2542,8 @@ class TicketController extends Controller
return $prio; return $prio;
}) })
->addColumn('from', function ($ticket) { ->addColumn('from', function ($ticket) {
$from = DB::table('users')->select('user_name', 'first_name', 'last_name')->where('id', '=', $ticket->user_id)->first(); $verify = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first();
$from = DB::table('users')->select('user_name', 'first_name', 'last_name', 'active')->where('id', '=', $ticket->user_id)->first();
$url = route('user.show', $ticket->user_id); $url = route('user.show', $ticket->user_id);
$name = ''; $name = '';
if ($from) { if ($from) {
@@ -2547,8 +2553,13 @@ class TicketController extends Controller
$name = $from->user_name; $name = $from->user_name;
} }
} }
$color = "";
return "<a href='".$url."' title='".Lang::get('lang.see-profile1').' '.ucfirst($from->user_name).'&apos;'.Lang::get('lang.see-profile2')."'><span style='color:#508983'>".ucfirst(str_limit($name, 30)).'</span></a>'; if($verify->status == 1 || $verify->status == '1') {
if($from->active == 0 || $from->active == '0') {
$color = "<i class='fa fa-exclamation-triangle'></i>";
}
}
return "<a href='".$url."' title='".Lang::get('lang.see-profile1').' '.ucfirst($from->user_name).'&apos;'.Lang::get('lang.see-profile2')."'><span style='color:#508983'>".ucfirst(str_limit($name, 30)).' <span style="color:#f75959">'.$color.'</span></span></a>';
}) })
// ->addColumn('Last Replier', function ($ticket) { // ->addColumn('Last Replier', function ($ticket) {
// $TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->where('is_internal', '=', 0)->max('id'); // $TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->where('is_internal', '=', 0)->max('id');