diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index a4e74cddd4..92d763dd23 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -188,7 +188,7 @@ class UsersController extends Controller $users = $users->OrderDepartment($order); break; case 'created_by': - $users = $users->CreatedBy($order); + $users = $users->OrderByCreatedBy($order); break; case 'company': $users = $users->OrderCompany($order); diff --git a/app/Models/User.php b/app/Models/User.php index 6dad9baee1..c2f2e06116 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -705,7 +705,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo * * @return \Illuminate\Database\Query\Builder Modified query builder */ - public function scopeCreatedBy($query, $order) + public function scopeOrderByCreatedBy($query, $order) { // Left join here, or it will only return results with parents return $query->leftJoin('users as admin_user', 'users.created_by', '=', 'admin_user.id') diff --git a/app/Presenters/UserPresenter.php b/app/Presenters/UserPresenter.php index 985348ca64..598f8f677e 100644 --- a/app/Presenters/UserPresenter.php +++ b/app/Presenters/UserPresenter.php @@ -289,7 +289,7 @@ class UserPresenter extends Presenter 'field' => 'created_by', 'searchable' => false, 'sortable' => true, - 'title' => trans('general.admin'), + 'title' => trans('general.created_by'), 'visible' => false, 'formatter' => 'usersLinkObjFormatter', ], diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index 07a72ad2ab..0b9c680f2d 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -65,7 +65,8 @@ return [ 'create' => 'Create New', 'created' => 'Item Created', 'created_asset' => 'created asset', - 'created_at' => 'Created at', + 'created_at' => 'Created At', + 'created_by' => 'Created By', 'record_created' => 'Record Created', 'updated_at' => 'Updated at', 'currency' => '$', // this is deprecated diff --git a/resources/views/users/view.blade.php b/resources/views/users/view.blade.php index c41afe19f3..a6161f5197 100755 --- a/resources/views/users/view.blade.php +++ b/resources/views/users/view.blade.php @@ -465,7 +465,7 @@ {{ \App\Helpers\Helper::getFormattedDateObject($user->created_at, 'datetime')['formatted']}} @if ($user->createdBy) - by + - @if ($user->createdBy->deleted_at=='') {{ $user->createdBy->present()->fullName }} @else