mirror of
https://github.com/freescout-helpdesk/freescout.git
synced 2024-11-24 11:22:42 +01:00
Apply fixes from StyleCI
This commit is contained in:
parent
3a0d8b7de9
commit
0ce7cce32a
@ -289,7 +289,7 @@ class Conversation extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set conversation user and all related fields.
|
* Set conversation user and all related fields.
|
||||||
*
|
*
|
||||||
* @param int $user_id
|
* @param int $user_id
|
||||||
*/
|
*/
|
||||||
public function setUser($user_id)
|
public function setUser($user_id)
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Conversation;
|
use App\Conversation;
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
class ConversationsController extends Controller
|
class ConversationsController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\ActivityLog;
|
use App\ActivityLog;
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Conversation;
|
use App\Conversation;
|
||||||
use App\Events\ConversationStatusChanged;
|
use App\Events\ConversationStatusChanged;
|
||||||
use App\Events\ConversationUserChanged;
|
use App\Events\ConversationUserChanged;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class SecureController extends Controller
|
class SecureController extends Controller
|
||||||
{
|
{
|
||||||
@ -92,7 +92,7 @@ class SecureController extends Controller
|
|||||||
case 'conversation_change_user':
|
case 'conversation_change_user':
|
||||||
$conversation = Conversation::find($request->conversation_id);
|
$conversation = Conversation::find($request->conversation_id);
|
||||||
|
|
||||||
$new_user_id = (int)$request->user_id;
|
$new_user_id = (int) $request->user_id;
|
||||||
|
|
||||||
if (!$conversation) {
|
if (!$conversation) {
|
||||||
$response['msg'] = 'Conversation not found';
|
$response['msg'] = 'Conversation not found';
|
||||||
|
@ -4,7 +4,6 @@ namespace App;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use App\User;
|
|
||||||
|
|
||||||
class Mailbox extends Model
|
class Mailbox extends Model
|
||||||
{
|
{
|
||||||
@ -210,7 +209,7 @@ class Mailbox extends Model
|
|||||||
->where('status', Conversation::STATUS_ACTIVE)
|
->where('status', Conversation::STATUS_ACTIVE)
|
||||||
->where('user_id', $folder->user_id)
|
->where('user_id', $folder->user_id)
|
||||||
->count();
|
->count();
|
||||||
// todo: starred conversations counting
|
// todo: starred conversations counting
|
||||||
} else {
|
} else {
|
||||||
$folder->active_count = $folder->conversations()
|
$folder->active_count = $folder->conversations()
|
||||||
->where('status', Conversation::STATUS_ACTIVE)
|
->where('status', Conversation::STATUS_ACTIVE)
|
||||||
@ -268,6 +267,7 @@ class Mailbox extends Model
|
|||||||
{
|
{
|
||||||
$users = $this->users;
|
$users = $this->users;
|
||||||
$admins = User::where('role', User::ROLE_ADMIN)->get();
|
$admins = User::where('role', User::ROLE_ADMIN)->get();
|
||||||
|
|
||||||
return $users->merge($admins)->unique();
|
return $users->merge($admins)->unique();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,6 +278,7 @@ class Mailbox extends Model
|
|||||||
{
|
{
|
||||||
$user_ids = $this->users()->pluck('users.id');
|
$user_ids = $this->users()->pluck('users.id');
|
||||||
$admin_ids = User::where('role', User::ROLE_ADMIN)->pluck('id');
|
$admin_ids = User::where('role', User::ROLE_ADMIN)->pluck('id');
|
||||||
|
|
||||||
return $user_ids->merge($admin_ids)->unique()->toArray();
|
return $user_ids->merge($admin_ids)->unique()->toArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -284,15 +284,15 @@ class Thread extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get text for the assignee.
|
* Get text for the assignee.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getAssignedName()
|
public function getAssignedName()
|
||||||
{
|
{
|
||||||
if (!$this->user_id) {
|
if (!$this->user_id) {
|
||||||
return __("anyone");
|
return __('anyone');
|
||||||
} elseif ($this->user_id == auth()->user()->id) {
|
} elseif ($this->user_id == auth()->user()->id) {
|
||||||
return __("yourself");
|
return __('yourself');
|
||||||
} else {
|
} else {
|
||||||
return $this->user->getFullName();
|
return $this->user->getFullName();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user