Updated ->present()->fullName() to ->display_name
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
@@ -77,7 +77,7 @@ class SendAcceptanceReminder extends Command
|
||||
if(!$email){
|
||||
$no_email_list[] = [
|
||||
'id' => $acceptance->assignedTo?->id,
|
||||
'name' => $acceptance->assignedTo?->present()->fullName(),
|
||||
'name' => $acceptance->assignedTo?->display_name,
|
||||
];
|
||||
} else {
|
||||
$count++;
|
||||
|
||||
@@ -609,7 +609,7 @@ class AssetsController extends Controller
|
||||
$asset->use_text = $asset->present()->fullName;
|
||||
|
||||
if (($asset->checkedOutToUser()) && ($asset->assigned)) {
|
||||
$asset->use_text .= ' → ' . $asset->assigned->getFullNameAttribute();
|
||||
$asset->use_text .= ' → ' . $asset->assigned->display_name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -230,13 +230,13 @@ class ConsumablesController extends Controller
|
||||
'avatar' => ($consumable_assignment->user) ? e($consumable_assignment->user->present()->gravatar) : '',
|
||||
'user' => ($consumable_assignment->user) ? [
|
||||
'id' => (int) $consumable_assignment->user->id,
|
||||
'name'=> e($consumable_assignment->user->present()->fullName()),
|
||||
'name'=> e($consumable_assignment->user->display_name),
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($consumable_assignment->created_at, 'datetime'),
|
||||
'note' => ($consumable_assignment->note) ? e($consumable_assignment->note) : null,
|
||||
'created_by' => ($consumable_assignment->adminuser) ? [
|
||||
'id' => (int) $consumable_assignment->adminuser->id,
|
||||
'name'=> e($consumable_assignment->adminuser->present()->fullName()),
|
||||
'name'=> e($consumable_assignment->adminuser->display_name),
|
||||
] : null,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -361,6 +361,7 @@ class UsersController extends Controller
|
||||
'users.employee_num',
|
||||
'users.first_name',
|
||||
'users.last_name',
|
||||
'users.display_name',
|
||||
'users.gravatar',
|
||||
'users.avatar',
|
||||
'users.email',
|
||||
@@ -371,20 +372,17 @@ class UsersController extends Controller
|
||||
$users = $users->where(function ($query) use ($request) {
|
||||
$query->SimpleNameSearch($request->get('search'))
|
||||
->orWhere('username', 'LIKE', '%'.$request->get('search').'%')
|
||||
->orWhere('display_name', 'LIKE', '%'.$request->get('search').'%')
|
||||
->orWhere('email', 'LIKE', '%'.$request->get('search').'%')
|
||||
->orWhere('employee_num', 'LIKE', '%'.$request->get('search').'%');
|
||||
});
|
||||
}
|
||||
|
||||
$users = $users->orderBy('last_name', 'asc')->orderBy('first_name', 'asc');
|
||||
$users = $users->orderBy('display_name', 'asc')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc');
|
||||
$users = $users->paginate(50);
|
||||
|
||||
foreach ($users as $user) {
|
||||
$name_str = '';
|
||||
if ($user->last_name != '') {
|
||||
$name_str .= $user->last_name.', ';
|
||||
}
|
||||
$name_str .= $user->first_name;
|
||||
$name_str = $user->display_name;
|
||||
|
||||
if ($user->username != '') {
|
||||
$name_str .= ' ('.$user->username.')';
|
||||
|
||||
@@ -797,7 +797,7 @@ class AssetsController extends Controller
|
||||
'item_id' => $asset->id,
|
||||
'item_type' => Asset::class,
|
||||
'created_by' => auth()->id(),
|
||||
'note' => 'Checkout imported by '.auth()->user()->present()->fullName().' from history importer',
|
||||
'note' => 'Checkout imported by '.auth()->user()->display_name.' from history importer',
|
||||
'target_id' => $item[$asset_tag][$batch_counter]['user_id'],
|
||||
'target_type' => User::class,
|
||||
'created_at' => $item[$asset_tag][$batch_counter]['checkout_date'],
|
||||
@@ -825,7 +825,7 @@ class AssetsController extends Controller
|
||||
'item_id' => $item[$asset_tag][$batch_counter]['asset_id'],
|
||||
'item_type' => Asset::class,
|
||||
'created_by' => auth()->id(),
|
||||
'note' => 'Checkin imported by '.auth()->user()->present()->fullName().' from history importer',
|
||||
'note' => 'Checkin imported by '.auth()->user()->display_name.' from history importer',
|
||||
'target_id' => null,
|
||||
'created_at' => $checkin_date,
|
||||
'action_type' => 'checkin',
|
||||
|
||||
@@ -364,7 +364,7 @@ class LicensesController extends Controller
|
||||
$license->order_number,
|
||||
$license->free_seat_count,
|
||||
$license->seats,
|
||||
($license->adminuser ? $license->adminuser->present()->fullName() : trans('admin/reports/general.deleted_user')),
|
||||
($license->adminuser ? $license->adminuser->display_name : trans('admin/reports/general.deleted_user')),
|
||||
$license->depreciation ? $license->depreciation->name: '',
|
||||
$license->updated_at,
|
||||
$license->deleted_at,
|
||||
|
||||
@@ -275,7 +275,7 @@ class ReportsController extends Controller
|
||||
|
||||
if ($actionlog->target) {
|
||||
if ($actionlog->targetType() == 'user') {
|
||||
$target_name = $actionlog->target->getFullNameAttribute();
|
||||
$target_name = $actionlog->target->display_name;
|
||||
} else {
|
||||
$target_name = $actionlog->target->getDisplayNameAttribute();
|
||||
}
|
||||
@@ -289,7 +289,7 @@ class ReportsController extends Controller
|
||||
|
||||
$row = [
|
||||
$actionlog->created_at,
|
||||
($actionlog->adminuser) ? e($actionlog->adminuser->getFullNameAttribute()) : '',
|
||||
($actionlog->adminuser) ? e($actionlog->adminuser->display_name) : '',
|
||||
$actionlog->present()->actionType(),
|
||||
e($actionlog->itemType()),
|
||||
($actionlog->itemType() == 'user') ? $actionlog->filename : $item_name,
|
||||
@@ -856,7 +856,7 @@ class ReportsController extends Controller
|
||||
}
|
||||
|
||||
if ($request->filled('assigned_to')) {
|
||||
$row[] = ($asset->checkedOutToUser() && $asset->assigned) ? $asset->assigned->getFullNameAttribute() : ($asset->assigned ? $asset->assigned->display_name : '');
|
||||
$row[] = ($asset->checkedOutToUser() && $asset->assigned) ?? $asset->assigned->display_name;
|
||||
$row[] = ($asset->checkedOutToUser() && $asset->assigned) ? 'user' : $asset->assignedType();
|
||||
}
|
||||
|
||||
|
||||
@@ -564,10 +564,10 @@ class UsersController extends Controller
|
||||
$user->employee_num,
|
||||
$user->first_name,
|
||||
$user->last_name,
|
||||
$user->present()->fullName(),
|
||||
$user->display_name,
|
||||
$user->username,
|
||||
$user->email,
|
||||
($user->manager) ? $user->manager->present()->fullName() : '',
|
||||
($user->manager) ? $user->manager->display_name : '',
|
||||
($user->userloc) ? $user->userloc->name : '',
|
||||
($user->department) ? $user->department->name : '',
|
||||
$user->assets->count(),
|
||||
|
||||
@@ -185,7 +185,7 @@ class ViewAssetsController extends Controller
|
||||
$logaction->target_type = User::class;
|
||||
|
||||
$data['item_quantity'] = $request->has('request-quantity') ? e($request->input('request-quantity')) : 1;
|
||||
$data['requested_by'] = $user->present()->fullName();
|
||||
$data['requested_by'] = $user->display_name;
|
||||
$data['item'] = $item;
|
||||
$data['item_type'] = $itemType;
|
||||
$data['target'] = auth()->user();
|
||||
|
||||
@@ -44,7 +44,7 @@ class AccessoriesTransformer
|
||||
'checkouts_count' => $accessory->checkouts_count,
|
||||
'created_by' => ($accessory->adminuser) ? [
|
||||
'id' => (int) $accessory->adminuser->id,
|
||||
'name'=> e($accessory->adminuser->present()->fullName()),
|
||||
'name'=> e($accessory->adminuser->display_name),
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($accessory->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($accessory->updated_at, 'datetime'),
|
||||
|
||||
@@ -150,7 +150,7 @@ class ActionlogsTransformer
|
||||
|
||||
'item' => ($actionlog->item) ? [
|
||||
'id' => (int) $actionlog->item->id,
|
||||
'name' => ($actionlog->itemType()=='user') ? e($actionlog->item->getFullNameAttribute()) : e($actionlog->item->getDisplayNameAttribute()),
|
||||
'name' => e($actionlog->item->display_name) ?? null,
|
||||
'type' => e($actionlog->itemType()),
|
||||
'serial' =>e($actionlog->item->serial) ? e($actionlog->item->serial) : null
|
||||
] : null,
|
||||
@@ -165,19 +165,19 @@ class ActionlogsTransformer
|
||||
'action_type' => $actionlog->present()->actionType(),
|
||||
'admin' => ($actionlog->adminuser) ? [
|
||||
'id' => (int) $actionlog->adminuser->id,
|
||||
'name' => e($actionlog->adminuser->getFullNameAttribute()),
|
||||
'name' => e($actionlog->adminuser->display_name),
|
||||
'first_name'=> e($actionlog->adminuser->first_name),
|
||||
'last_name'=> e($actionlog->adminuser->last_name)
|
||||
] : null,
|
||||
'created_by' => ($actionlog->adminuser) ? [
|
||||
'id' => (int) $actionlog->adminuser->id,
|
||||
'name' => e($actionlog->adminuser->getFullNameAttribute()),
|
||||
'name' => e($actionlog->adminuser->display_name),
|
||||
'first_name'=> e($actionlog->adminuser->first_name),
|
||||
'last_name'=> e($actionlog->adminuser->last_name)
|
||||
] : null,
|
||||
'target' => ($actionlog->target) ? [
|
||||
'id' => (int) $actionlog->target->id,
|
||||
'name' => ($actionlog->targetType()=='user') ? e($actionlog->target->getFullNameAttribute()) : e($actionlog->target->getDisplayNameAttribute()),
|
||||
'name' => ($actionlog->target->display_name) ?? null,
|
||||
'type' => e($actionlog->targetType()),
|
||||
] : null,
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class AssetModelsTransformer
|
||||
'notes' => Helper::parseEscapedMarkedownInline($assetmodel->notes),
|
||||
'created_by' => ($assetmodel->adminuser) ? [
|
||||
'id' => (int) $assetmodel->adminuser->id,
|
||||
'name'=> e($assetmodel->adminuser->present()->fullName()),
|
||||
'name'=> e($assetmodel->adminuser->display_name),
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($assetmodel->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($assetmodel->updated_at, 'datetime'),
|
||||
|
||||
@@ -84,7 +84,7 @@ class AssetsTransformer
|
||||
'warranty_expires' => ($asset->warranty_months > 0) ? Helper::getFormattedDateObject($asset->warranty_expires, 'date') : null,
|
||||
'created_by' => ($asset->adminuser) ? [
|
||||
'id' => (int) $asset->adminuser->id,
|
||||
'name'=> e($asset->adminuser->present()->fullName()),
|
||||
'name'=> e($asset->adminuser->display_name),
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($asset->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($asset->updated_at, 'datetime'),
|
||||
@@ -280,7 +280,7 @@ class AssetsTransformer
|
||||
'id' => (int) $asset->id,
|
||||
'image' => ($asset->getImageUrl()) ? $asset->getImageUrl() : null,
|
||||
'type' => 'asset',
|
||||
'name' => e($asset->present()->fullName()),
|
||||
'name' => e($asset->display_name),
|
||||
'model' => ($asset->model) ? e($asset->model->name) : null,
|
||||
'model_number' => (($asset->model) && ($asset->model->model_number)) ? e($asset->model->model_number) : null,
|
||||
'asset_tag' => e($asset->asset_tag),
|
||||
|
||||
@@ -64,7 +64,7 @@ class CategoriesTransformer
|
||||
'licenses_count' => (int) $category->licenses_count,
|
||||
'created_by' => ($category->adminuser) ? [
|
||||
'id' => (int) $category->adminuser->id,
|
||||
'name'=> e($category->adminuser->present()->fullName()),
|
||||
'name'=> e($category->adminuser->display_name),
|
||||
] : null,
|
||||
'notes' => Helper::parseEscapedMarkedownInline($category->notes),
|
||||
'created_at' => Helper::getFormattedDateObject($category->created_at, 'datetime'),
|
||||
|
||||
@@ -38,7 +38,7 @@ class CompaniesTransformer
|
||||
'users_count' => (int) $company->users_count,
|
||||
'created_by' => ($company->adminuser) ? [
|
||||
'id' => (int) $company->adminuser->id,
|
||||
'name'=> e($company->adminuser->present()->fullName()),
|
||||
'name'=> e($company->adminuser->display_name),
|
||||
] : null,
|
||||
'notes' => Helper::parseEscapedMarkedownInline($company->notes),
|
||||
'created_at' => Helper::getFormattedDateObject($company->created_at, 'datetime'),
|
||||
|
||||
@@ -51,7 +51,7 @@ class ComponentsTransformer
|
||||
'notes' => ($component->notes) ? Helper::parseEscapedMarkedownInline($component->notes) : null,
|
||||
'created_by' => ($component->adminuser) ? [
|
||||
'id' => (int) $component->adminuser->id,
|
||||
'name'=> e($component->adminuser->present()->fullName()),
|
||||
'name'=> e($component->adminuser->display_name),
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($component->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($component->updated_at, 'datetime'),
|
||||
|
||||
@@ -42,7 +42,7 @@ class ConsumablesTransformer
|
||||
'notes' => ($consumable->notes) ? Helper::parseEscapedMarkedownInline($consumable->notes) : null,
|
||||
'created_by' => ($consumable->adminuser) ? [
|
||||
'id' => (int) $consumable->adminuser->id,
|
||||
'name'=> e($consumable->adminuser->present()->fullName()),
|
||||
'name'=> e($consumable->adminuser->display_name),
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($consumable->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($consumable->updated_at, 'datetime'),
|
||||
|
||||
@@ -35,7 +35,7 @@ class DepartmentsTransformer
|
||||
] : null,
|
||||
'manager' => ($department->manager) ? [
|
||||
'id' => (int) $department->manager->id,
|
||||
'name' => e($department->manager->getFullNameAttribute()),
|
||||
'name' => e($department->manager->display_name),
|
||||
'first_name'=> e($department->manager->first_name),
|
||||
'last_name'=> e($department->manager->last_name),
|
||||
] : null,
|
||||
|
||||
@@ -33,7 +33,7 @@ class DepreciationsTransformer
|
||||
'licenses_count' => ($depreciation->licenses_count > 0) ? (int) $depreciation->licenses_count : 0,
|
||||
'created_by' => ($depreciation->adminuser) ? [
|
||||
'id' => (int) $depreciation->adminuser->id,
|
||||
'name'=> e($depreciation->adminuser->present()->fullName()),
|
||||
'name'=> e($depreciation->adminuser->display_name),
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($depreciation->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($depreciation->updated_at, 'datetime')
|
||||
|
||||
@@ -29,7 +29,7 @@ class GroupsTransformer
|
||||
'notes' => Helper::parseEscapedMarkedownInline($group->notes),
|
||||
'created_by' => ($group->adminuser) ? [
|
||||
'id' => (int) $group->adminuser->id,
|
||||
'name'=> e($group->adminuser->present()->fullName()),
|
||||
'name'=> e($group->adminuser->display_name),
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($group->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($group->updated_at, 'datetime'),
|
||||
|
||||
@@ -48,7 +48,7 @@ class LicensesTransformer
|
||||
'category' => ($license->category) ? ['id' => (int) $license->category->id, 'name'=> e($license->category->name)] : null,
|
||||
'created_by' => ($license->adminuser) ? [
|
||||
'id' => (int) $license->adminuser->id,
|
||||
'name'=> e($license->adminuser->present()->fullName()),
|
||||
'name'=> e($license->adminuser->display_name),
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($license->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($license->updated_at, 'datetime'),
|
||||
|
||||
@@ -73,11 +73,11 @@ class MaintenancesTransformer
|
||||
'completion_date' => Helper::getFormattedDateObject($assetmaintenance->completion_date, 'date'),
|
||||
'user_id' => ($assetmaintenance->adminuser) ? [
|
||||
'id' => $assetmaintenance->adminuser->id,
|
||||
'name'=> e($assetmaintenance->adminuser->present()->fullName())
|
||||
'name'=> e($assetmaintenance->adminuser->display_name)
|
||||
] : null, // legacy to not change the shape of the API
|
||||
'created_by' => ($assetmaintenance->adminuser) ? [
|
||||
'id' => (int) $assetmaintenance->adminuser->id,
|
||||
'name'=> e($assetmaintenance->adminuser->present()->fullName()),
|
||||
'name'=> e($assetmaintenance->adminuser->display_name),
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($assetmaintenance->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($assetmaintenance->updated_at, 'datetime'),
|
||||
|
||||
@@ -40,7 +40,7 @@ class ManufacturersTransformer
|
||||
'notes' => Helper::parseEscapedMarkedownInline($manufacturer->notes),
|
||||
'created_by' => ($manufacturer->adminuser) ? [
|
||||
'id' => (int) $manufacturer->adminuser->id,
|
||||
'name'=> e($manufacturer->adminuser->present()->fullName()),
|
||||
'name'=> e($manufacturer->adminuser->display_name),
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($manufacturer->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($manufacturer->updated_at, 'datetime'),
|
||||
|
||||
@@ -34,7 +34,7 @@ class PredefinedKitsTransformer
|
||||
'name' => e($kit->name),
|
||||
'created_by' => ($kit->adminuser) ? [
|
||||
'id' => (int) $kit->adminuser->id,
|
||||
'name'=> e($kit->adminuser->present()->fullName()),
|
||||
'name'=> e($kit->adminuser->display_name),
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($kit->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($kit->updated_at, 'datetime'),
|
||||
|
||||
@@ -26,7 +26,7 @@ class ProfileTransformer
|
||||
'id' => (int) $file->id,
|
||||
'icon' => Helper::filetype_icon($file->filename),
|
||||
'item' => ($file->item) ? [
|
||||
'name' => ($file->itemType()=='user') ? e($file->item->getFullNameAttribute()) : e($file->item->getDisplayNameAttribute()),
|
||||
'name' => ($file->itemType()=='user') ? e($file->item->display_name) : e($file->item->getDisplayNameAttribute()),
|
||||
'type' => e($file->itemType()),
|
||||
] : null,
|
||||
'filename' => e($file->filename),
|
||||
|
||||
@@ -32,7 +32,7 @@ class StatuslabelsTransformer
|
||||
'notes' => e($statuslabel->notes),
|
||||
'created_by' => ($statuslabel->adminuser) ? [
|
||||
'id' => (int) $statuslabel->adminuser->id,
|
||||
'name'=> e($statuslabel->adminuser->present()->fullName()),
|
||||
'name'=> e($statuslabel->adminuser->display_name),
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($statuslabel->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($statuslabel->updated_at, 'datetime'),
|
||||
|
||||
@@ -34,14 +34,14 @@ class UsersTransformer
|
||||
'name' => e($user->getFullNameAttribute()) ?? null,
|
||||
'first_name' => e($user->first_name) ?? null,
|
||||
'last_name' => e($user->last_name) ?? null,
|
||||
'display_name' => e($user->display_name) ?? null,
|
||||
'display_name' => e($user->getRawOriginal('display_name')) ?? null,
|
||||
'username' => e($user->username) ?? null,
|
||||
'remote' => ($user->remote == '1') ? true : false,
|
||||
'locale' => ($user->locale) ? e($user->locale) : null,
|
||||
'employee_num' => ($user->employee_num) ? e($user->employee_num) : null,
|
||||
'manager' => ($user->manager) ? [
|
||||
'id' => (int) $user->manager->id,
|
||||
'name'=> e($user->manager->first_name).' '.e($user->manager->last_name),
|
||||
'name'=> e($user->manager->display_name),
|
||||
] : null,
|
||||
'jobtitle' => ($user->jobtitle) ? e($user->jobtitle) : null,
|
||||
'vip' => ($user->vip == '1') ? true : false,
|
||||
@@ -83,7 +83,7 @@ class UsersTransformer
|
||||
'company' => ($user->company) ? ['id' => (int) $user->company->id, 'name'=> e($user->company->name)] : null,
|
||||
'created_by' => ($user->createdBy) ? [
|
||||
'id' => (int) $user->createdBy->id,
|
||||
'name'=> e($user->createdBy->present()->fullName),
|
||||
'name'=> e($user->createdBy->display_name),
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($user->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($user->updated_at, 'datetime'),
|
||||
|
||||
@@ -38,10 +38,10 @@ class CheckoutAssetMail extends Mailable
|
||||
|
||||
// Location is a target option, but there are no emails currently associated with locations.
|
||||
if($this->target instanceof User){
|
||||
$this->target = $this->target->present()?->fullName();
|
||||
$this->target = $this->target->display_name;
|
||||
}
|
||||
else if($this->target instanceof Asset){
|
||||
$this->target = $this->target->assignedto?->present()?->fullName();
|
||||
$this->target = $this->target->assignedto?->display_name;
|
||||
}
|
||||
|
||||
$this->last_checkout = '';
|
||||
|
||||
@@ -31,10 +31,10 @@ class CheckoutLicenseMail extends Mailable
|
||||
$this->target = $checkedOutTo;
|
||||
|
||||
if($this->target instanceof User){
|
||||
$this->target = $this->target->present()?->fullName();
|
||||
$this->target = $this->target->display_name;
|
||||
}
|
||||
elseif($this->target instanceof Asset){
|
||||
$this->target = $this->target->assignedto?->present()?->fullName();
|
||||
$this->target = $this->target->display_name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ class FieldOption
|
||||
if ($asset->relationLoaded('assignedTo')) {
|
||||
// If the "assignedTo" relationship was eager loaded then the way to get the
|
||||
// relationship changes from $asset->assignedTo to $asset->assigned.
|
||||
return $asset->assigned ? $asset->assigned->present()->fullName() : null;
|
||||
return $asset->assigned ? $asset->assigned->display_name : null;
|
||||
}
|
||||
|
||||
return $asset->assignedTo ? $asset->assignedTo->present()->fullName() : null;
|
||||
return $asset->assignedTo ? $asset->assignedTo->display_name : null;
|
||||
}
|
||||
|
||||
// Handle Laravel's stupid Carbon datetime casting
|
||||
|
||||
@@ -64,7 +64,7 @@ use NotificationChannels\MicrosoftTeams\MicrosoftTeamsMessage;
|
||||
$item = $this->params['item'];
|
||||
$admin_user = $this->params['admin'];
|
||||
$fields = [
|
||||
'By' => '<'.$admin_user->present()->viewUrl().'|'.$admin_user->present()->fullName().'>',
|
||||
'By' => '<'.$admin_user->present()->viewUrl().'|'.$admin_user->display_name.'>',
|
||||
];
|
||||
array_key_exists('note', $this->params) && $fields['Notes'] = $this->params['note'];
|
||||
array_key_exists('location', $this->params) && $fields['Location'] = $this->params['location'];
|
||||
@@ -89,9 +89,9 @@ use NotificationChannels\MicrosoftTeams\MicrosoftTeamsMessage;
|
||||
->title(class_basename(get_class($params['item'])) . ' Audited')
|
||||
->addStartGroupToSection('activityText')
|
||||
->fact(trans('mail.asset'), $item)
|
||||
->fact(trans('general.administrator'), $admin_user->present()->viewUrl() . '|' . $admin_user->present()->fullName());
|
||||
->fact(trans('general.administrator'), $admin_user->present()->viewUrl() . '|' . $admin_user->display_name);
|
||||
}
|
||||
$message = class_basename(get_class($params['item'])) . ' Audited By '.$admin_user->present()->fullName();
|
||||
$message = class_basename(get_class($params['item'])) . ' Audited By '.$admin_user->display_name;
|
||||
$details = [
|
||||
trans('mail.asset') => htmlspecialchars_decode($item->present()->name),
|
||||
trans('mail.notes') => $note ?: '',
|
||||
|
||||
@@ -73,8 +73,8 @@ class CheckinAccessoryNotification extends Notification
|
||||
$channel = ($this->settings->webhook_channel) ? $this->settings->webhook_channel : '';
|
||||
|
||||
$fields = [
|
||||
trans('general.from') => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
|
||||
trans('general.from') => '<'.$target->present()->viewUrl().'|'.$target->display_name.'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->display_name.'>',
|
||||
];
|
||||
|
||||
if ($item->location) {
|
||||
@@ -109,7 +109,7 @@ class CheckinAccessoryNotification extends Notification
|
||||
->addStartGroupToSection('activityText')
|
||||
->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle')
|
||||
->fact(trans('mail.checked_into'), $item->location->name ? $item->location->name : '')
|
||||
->fact(trans('mail.Accessory_Checkin_Notification')." by ", $admin->present()->fullName())
|
||||
->fact(trans('mail.Accessory_Checkin_Notification')." by ", $admin->display_name)
|
||||
->fact(trans('admin/consumables/general.remaining'), $item->numRemaining())
|
||||
->fact(trans('mail.notes'), $note ?: '');
|
||||
}
|
||||
@@ -118,7 +118,7 @@ class CheckinAccessoryNotification extends Notification
|
||||
$details = [
|
||||
trans('mail.accessory_name') => htmlspecialchars_decode($item->present()->name),
|
||||
trans('mail.checked_into') => $item->location->name ? $item->location->name : '',
|
||||
trans('mail.Accessory_Checkin_Notification'). ' by' => $admin->present()->fullName(),
|
||||
trans('mail.Accessory_Checkin_Notification'). ' by' => $admin->display_name,
|
||||
trans('admin/consumables/general.remaining')=> $item->numRemaining(),
|
||||
trans('mail.notes') => $note ?: '',
|
||||
];
|
||||
|
||||
@@ -78,7 +78,7 @@ class CheckinAssetNotification extends Notification
|
||||
$channel = ($this->settings->webhook_channel) ? $this->settings->webhook_channel : '';
|
||||
|
||||
$fields = [
|
||||
trans('general.administrator') => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
|
||||
trans('general.administrator') => '<'.$admin->present()->viewUrl().'|'.$admin->display_name.'>',
|
||||
trans('general.status') => $item->assetstatus?->name,
|
||||
trans('general.location') => ($item->location) ? $item->location->name : '',
|
||||
];
|
||||
@@ -116,7 +116,7 @@ class CheckinAssetNotification extends Notification
|
||||
->addStartGroupToSection('activityText')
|
||||
->fact(htmlspecialchars_decode($item->present()->name), '', 'activityText')
|
||||
->fact(trans('mail.checked_into'), ($item->location) ? $item->location->name : '')
|
||||
->fact(trans('mail.Asset_Checkin_Notification') . " by ", $admin->present()->fullName())
|
||||
->fact(trans('mail.Asset_Checkin_Notification') . " by ", $admin->display_name)
|
||||
->fact(trans('admin/hardware/form.status'), $item->assetstatus?->name)
|
||||
->fact(trans('mail.notes'), $note ?: '');
|
||||
}
|
||||
@@ -126,7 +126,7 @@ class CheckinAssetNotification extends Notification
|
||||
$details = [
|
||||
trans('mail.asset') => htmlspecialchars_decode($item->present()->name),
|
||||
trans('mail.checked_into') => ($item->location) ? $item->location->name : '',
|
||||
trans('mail.Asset_Checkin_Notification')." by " => $admin->present()->fullName(),
|
||||
trans('mail.Asset_Checkin_Notification')." by " => $admin->display_name,
|
||||
trans('admin/hardware/form.status') => $item->assetstatus?->name,
|
||||
trans('mail.notes') => $note ?: '',
|
||||
];
|
||||
|
||||
@@ -76,8 +76,8 @@ class CheckinComponentNotification extends Notification
|
||||
|
||||
if ($admin) {
|
||||
$fields = [
|
||||
trans('general.from') => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
|
||||
trans('general.from') => '<'.$target->present()->viewUrl().'|'.$target->display_name.'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->display_name.'>',
|
||||
];
|
||||
|
||||
if ($item->location) {
|
||||
@@ -90,7 +90,7 @@ class CheckinComponentNotification extends Notification
|
||||
|
||||
} else {
|
||||
$fields = [
|
||||
'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
|
||||
'To' => '<'.$target->present()->viewUrl().'|'.$target->display_name.'>',
|
||||
'By' => 'CLI tool',
|
||||
];
|
||||
}
|
||||
@@ -119,16 +119,16 @@ class CheckinComponentNotification extends Notification
|
||||
->title(trans('mail.Component_checkin_notification'))
|
||||
->addStartGroupToSection('activityText')
|
||||
->fact(htmlspecialchars_decode($item->present()->name), '', 'header')
|
||||
->fact(trans('mail.Component_checkin_notification')." by ", $admin->present()->fullName() ?: 'CLI tool')
|
||||
->fact(trans('mail.checkedin_from'), $target->present()->fullName())
|
||||
->fact(trans('mail.Component_checkin_notification')." by ", $admin->display_name ?: 'CLI tool')
|
||||
->fact(trans('mail.checkedin_from'), $target->display_name)
|
||||
->fact(trans('admin/consumables/general.remaining'), $item->numRemaining())
|
||||
->fact(trans('mail.notes'), $note ?: '');
|
||||
}
|
||||
|
||||
$message = trans('mail.Component_checkin_notification');
|
||||
$details = [
|
||||
trans('mail.checkedin_from')=> $target->present()->fullName(),
|
||||
trans('mail.Component_checkin_notification')." by " => $admin->present()->fullName() ?: 'CLI tool',
|
||||
trans('mail.checkedin_from')=> $target->display_name,
|
||||
trans('mail.Component_checkin_notification')." by " => $admin->display_name ?: 'CLI tool',
|
||||
trans('admin/consumables/general.remaining') => $item->numRemaining(),
|
||||
trans('mail.notes') => $note ?: '',
|
||||
];
|
||||
@@ -153,7 +153,7 @@ class CheckinComponentNotification extends Notification
|
||||
Section::create(
|
||||
KeyValue::create(
|
||||
trans('mail.checkedin_from') ?: '',
|
||||
$target->present()->fullName() ?: '',
|
||||
$target->display_name ?: '',
|
||||
trans('admin/consumables/general.remaining').': '.$item->numRemaining(),
|
||||
)
|
||||
->onClick(route('components.show', $item->id))
|
||||
|
||||
@@ -77,8 +77,8 @@ class CheckinLicenseSeatNotification extends Notification
|
||||
|
||||
if ($admin) {
|
||||
$fields = [
|
||||
trans('general.from') => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
|
||||
trans('general.from') => '<'.$target->present()->viewUrl().'|'.$target->display_name.'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->display_name.'>',
|
||||
];
|
||||
|
||||
if ($item->location) {
|
||||
@@ -91,7 +91,7 @@ class CheckinLicenseSeatNotification extends Notification
|
||||
|
||||
} else {
|
||||
$fields = [
|
||||
'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
|
||||
'To' => '<'.$target->present()->viewUrl().'|'.$target->display_name.'>',
|
||||
'By' => 'CLI tool',
|
||||
];
|
||||
}
|
||||
@@ -120,17 +120,17 @@ class CheckinLicenseSeatNotification extends Notification
|
||||
->title(trans('mail.License_Checkin_Notification'))
|
||||
->addStartGroupToSection('activityText')
|
||||
->fact(htmlspecialchars_decode($item->present()->name), '', 'header')
|
||||
->fact(trans('mail.License_Checkin_Notification')." by ", $admin->present()->fullName() ?: 'CLI tool')
|
||||
->fact(trans('mail.checkedin_from'), $target->present()->fullName())
|
||||
->fact(trans('mail.License_Checkin_Notification')." by ", $admin->display_name ?: 'CLI tool')
|
||||
->fact(trans('mail.checkedin_from'), $target->display_name)
|
||||
->fact(trans('admin/consumables/general.remaining'), $item->availCount()->count())
|
||||
->fact(trans('mail.notes'), $note ?: '');
|
||||
}
|
||||
|
||||
$message = trans('mail.License_Checkin_Notification');
|
||||
$details = [
|
||||
trans('mail.checkedin_from')=> $target->present()->fullName(),
|
||||
trans('mail.checkedin_from')=> $target->display_name,
|
||||
trans('mail.license_for') => htmlspecialchars_decode($item->present()->name),
|
||||
trans('mail.License_Checkin_Notification')." by " => $admin->present()->fullName() ?: 'CLI tool',
|
||||
trans('mail.License_Checkin_Notification')." by " => $admin->display_name ?: 'CLI tool',
|
||||
trans('admin/consumables/general.remaining') => $item->availCount()->count(),
|
||||
trans('mail.notes') => $note ?: '',
|
||||
];
|
||||
@@ -155,7 +155,7 @@ class CheckinLicenseSeatNotification extends Notification
|
||||
Section::create(
|
||||
KeyValue::create(
|
||||
trans('mail.checkedin_from') ?: '',
|
||||
$target->present()->fullName() ?: '',
|
||||
$target->display_name ?: '',
|
||||
trans('admin/consumables/general.remaining').': '.$item->availCount()->count(),
|
||||
)
|
||||
->onClick(route('licenses.show', $item->id))
|
||||
|
||||
@@ -100,8 +100,8 @@ class CheckoutAccessoryNotification extends Notification
|
||||
$channel = ($this->settings->webhook_channel) ? $this->settings->webhook_channel : '';
|
||||
|
||||
$fields = [
|
||||
trans('general.to') => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
|
||||
trans('general.to') => '<'.$target->present()->viewUrl().'|'.$target->display_name.'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->display_name.'>',
|
||||
];
|
||||
|
||||
if ($item->location) {
|
||||
@@ -140,7 +140,7 @@ class CheckoutAccessoryNotification extends Notification
|
||||
->fact(trans('mail.assigned_to'), $target->present()->name)
|
||||
->fact(trans('general.qty'), $this->checkout_qty)
|
||||
->fact(trans('mail.checkedout_from'), $item->location->name ? $item->location->name : '')
|
||||
->fact(trans('mail.Accessory_Checkout_Notification') . " by ", $admin->present()->fullName())
|
||||
->fact(trans('mail.Accessory_Checkout_Notification') . " by ", $admin->display_name)
|
||||
->fact(trans('admin/consumables/general.remaining'), $item->numRemaining())
|
||||
->fact(trans('mail.notes'), $note ?: '');
|
||||
}
|
||||
@@ -151,7 +151,7 @@ class CheckoutAccessoryNotification extends Notification
|
||||
trans('mail.accessory_name') => htmlspecialchars_decode($item->present()->name),
|
||||
trans('general.qty') => $this->checkout_qty,
|
||||
trans('mail.checkedout_from') => $item->location->name ? $item->location->name : '',
|
||||
trans('mail.Accessory_Checkout_Notification'). ' by' => $admin->present()->fullName(),
|
||||
trans('mail.Accessory_Checkout_Notification'). ' by' => $admin->display_name,
|
||||
trans('admin/consumables/general.remaining')=> $item->numRemaining(),
|
||||
trans('mail.notes') => $note ?: '',
|
||||
];
|
||||
|
||||
@@ -93,8 +93,8 @@ class CheckoutAssetNotification extends Notification
|
||||
$channel = ($this->settings->webhook_channel) ? $this->settings->webhook_channel : '';
|
||||
|
||||
$fields = [
|
||||
trans('general.to') => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
|
||||
trans('general.to') => '<'.$target->present()->viewUrl().'|'.$target->display_name.'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->display_name.'>',
|
||||
];
|
||||
|
||||
if ($item->location) {
|
||||
@@ -135,7 +135,7 @@ class CheckoutAssetNotification extends Notification
|
||||
->addStartGroupToSection('activityText')
|
||||
->fact(trans('mail.assigned_to'), $target->present()->name)
|
||||
->fact(htmlspecialchars_decode($item->present()->name), '', 'activityText')
|
||||
->fact(trans('mail.Asset_Checkout_Notification') . " by ", $admin->present()->fullName())
|
||||
->fact(trans('mail.Asset_Checkout_Notification') . " by ", $admin->display_name)
|
||||
->fact(trans('mail.notes'), $note ?: '');
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ class CheckoutAssetNotification extends Notification
|
||||
$details = [
|
||||
trans('mail.assigned_to') => $target->present()->name,
|
||||
trans('mail.asset') => htmlspecialchars_decode($item->present()->name),
|
||||
trans('mail.Asset_Checkout_Notification'). ' by' => $admin->present()->fullName(),
|
||||
trans('mail.Asset_Checkout_Notification'). ' by' => $admin->display_name,
|
||||
trans('mail.notes') => $note ?: '',
|
||||
];
|
||||
return array($message, $details);
|
||||
|
||||
@@ -80,8 +80,8 @@ class CheckoutComponentNotification extends Notification
|
||||
$channel = ($this->settings->webhook_channel) ? $this->settings->webhook_channel : '';
|
||||
|
||||
$fields = [
|
||||
trans('general.to') => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
|
||||
trans('general.to') => '<'.$target->present()->viewUrl().'|'.$target->display_name.'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->display_name.'>',
|
||||
];
|
||||
|
||||
if ($item->location) {
|
||||
@@ -117,17 +117,17 @@ class CheckoutComponentNotification extends Notification
|
||||
->title(trans('mail.Component_checkout_notification'))
|
||||
->addStartGroupToSection('activityText')
|
||||
->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle')
|
||||
->fact(trans('mail.Component_checkout_notification')." by ", $admin->present()->fullName())
|
||||
->fact(trans('mail.assigned_to'), $target->present()->fullName())
|
||||
->fact(trans('mail.Component_checkout_notification')." by ", $admin->display_name)
|
||||
->fact(trans('mail.assigned_to'), $target->display_name)
|
||||
->fact(trans('admin/consumables/general.remaining'), $item->numRemaining())
|
||||
->fact(trans('mail.notes'), $note ?: '');
|
||||
}
|
||||
|
||||
$message = trans('mail.Component_checkout_notification');
|
||||
$details = [
|
||||
trans('mail.assigned_to') => $target->present()->fullName(),
|
||||
trans('mail.assigned_to') => $target->display_name,
|
||||
trans('mail.item') => htmlspecialchars_decode($item->present()->name),
|
||||
trans('mail.Component_checkout_notification').' by' => $admin->present()->fullName(),
|
||||
trans('mail.Component_checkout_notification').' by' => $admin->display_name,
|
||||
trans('admin/consumables/general.remaining') => $item->numRemaining(),
|
||||
trans('mail.notes') => $note ?: '',
|
||||
];
|
||||
@@ -152,7 +152,7 @@ class CheckoutComponentNotification extends Notification
|
||||
Section::create(
|
||||
KeyValue::create(
|
||||
trans('mail.assigned_to') ?: '',
|
||||
$target->present()->fullName() ?: '',
|
||||
$target->display_name ?: '',
|
||||
trans('admin/consumables/general.remaining').': '.$item->numRemaining(),
|
||||
)
|
||||
->onClick(route('api.assets.show', $target->id))
|
||||
|
||||
@@ -80,8 +80,8 @@ class CheckoutConsumableNotification extends Notification
|
||||
$channel = ($this->settings->webhook_channel) ? $this->settings->webhook_channel : '';
|
||||
|
||||
$fields = [
|
||||
trans('general.to') => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
|
||||
trans('general.to') => '<'.$target->present()->viewUrl().'|'.$target->display_name.'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->display_name.'>',
|
||||
];
|
||||
|
||||
if ($item->location) {
|
||||
@@ -117,17 +117,17 @@ class CheckoutConsumableNotification extends Notification
|
||||
->title(trans('mail.Consumable_checkout_notification'))
|
||||
->addStartGroupToSection('activityText')
|
||||
->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle')
|
||||
->fact(trans('mail.Consumable_checkout_notification')." by ", $admin->present()->fullName())
|
||||
->fact(trans('mail.assigned_to'), $target->present()->fullName())
|
||||
->fact(trans('mail.Consumable_checkout_notification')." by ", $admin->display_name)
|
||||
->fact(trans('mail.assigned_to'), $target->display_name)
|
||||
->fact(trans('admin/consumables/general.remaining'), $item->numRemaining())
|
||||
->fact(trans('mail.notes'), $note ?: '');
|
||||
}
|
||||
|
||||
$message = trans('mail.Consumable_checkout_notification');
|
||||
$details = [
|
||||
trans('mail.assigned_to') => $target->present()->fullName(),
|
||||
trans('mail.assigned_to') => $target->display_name,
|
||||
trans('mail.item') => htmlspecialchars_decode($item->present()->name),
|
||||
trans('mail.Consumable_checkout_notification').' by' => $admin->present()->fullName(),
|
||||
trans('mail.Consumable_checkout_notification').' by' => $admin->display_name,
|
||||
trans('admin/consumables/general.remaining') => $item->numRemaining(),
|
||||
trans('mail.notes') => $note ?: '',
|
||||
];
|
||||
@@ -152,7 +152,7 @@ class CheckoutConsumableNotification extends Notification
|
||||
Section::create(
|
||||
KeyValue::create(
|
||||
trans('mail.assigned_to') ?: '',
|
||||
$target->present()->fullName() ?: '',
|
||||
$target->display_name ?: '',
|
||||
trans('admin/consumables/general.remaining').': '.$item->numRemaining(),
|
||||
)
|
||||
->onClick(route('users.show', $target->id))
|
||||
|
||||
@@ -78,8 +78,8 @@ class CheckoutLicenseSeatNotification extends Notification
|
||||
$channel = ($this->settings->webhook_channel) ? $this->settings->webhook_channel : '';
|
||||
|
||||
$fields = [
|
||||
trans('general.to') => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
|
||||
trans('general.to') => '<'.$target->present()->viewUrl().'|'.$target->display_name.'>',
|
||||
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->display_name.'>',
|
||||
];
|
||||
|
||||
if ($item->location) {
|
||||
@@ -115,17 +115,17 @@ class CheckoutLicenseSeatNotification extends Notification
|
||||
->title(trans('mail.License_Checkout_Notification'))
|
||||
->addStartGroupToSection('activityText')
|
||||
->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle')
|
||||
->fact(trans('mail.License_Checkout_Notification')." by ", $admin->present()->fullName())
|
||||
->fact(trans('mail.assigned_to'), $target->present()->fullName())
|
||||
->fact(trans('mail.License_Checkout_Notification')." by ", $admin->display_name)
|
||||
->fact(trans('mail.assigned_to'), $target->display_name)
|
||||
->fact(trans('admin/consumables/general.remaining'), $item->availCount()->count())
|
||||
->fact(trans('mail.notes'), $note ?: '');
|
||||
}
|
||||
|
||||
$message = trans('mail.License_Checkout_Notification');
|
||||
$details = [
|
||||
trans('mail.assigned_to') => $target->present()->fullName(),
|
||||
trans('mail.assigned_to') => $target->display_name,
|
||||
trans('mail.license_for') => htmlspecialchars_decode($item->present()->name),
|
||||
trans('mail.License_Checkout_Notification').' by' => $admin->present()->fullName(),
|
||||
trans('mail.License_Checkout_Notification').' by' => $admin->display_name,
|
||||
trans('admin/consumables/general.remaining') => $item->availCount()->count(),
|
||||
trans('mail.notes') => $note ?: '',
|
||||
];
|
||||
|
||||
@@ -79,7 +79,7 @@ class RequestAssetCancelation extends Notification
|
||||
|
||||
$fields = [
|
||||
'QTY' => $qty,
|
||||
'Canceled By' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
|
||||
'Canceled By' => '<'.$target->present()->viewUrl().'|'.$target->display_name.'>',
|
||||
];
|
||||
|
||||
if (($this->expected_checkin) && ($this->expected_checkin != '')) {
|
||||
|
||||
@@ -78,7 +78,7 @@ class RequestAssetNotification extends Notification
|
||||
|
||||
$fields = [
|
||||
'QTY' => $qty,
|
||||
'Requested By' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
|
||||
'Requested By' => '<'.$target->present()->viewUrl().'|'.$target->display_name.'>',
|
||||
];
|
||||
|
||||
return (new SlackMessage)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Presenters;
|
||||
|
||||
use App\Models\SnipeModel;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
|
||||
abstract class Presenter
|
||||
{
|
||||
@@ -69,10 +70,30 @@ abstract class Presenter
|
||||
return '';
|
||||
}
|
||||
|
||||
public function name()
|
||||
{
|
||||
return $this->model->name;
|
||||
}
|
||||
// public function name()
|
||||
// {
|
||||
// return $this->model->name;
|
||||
// }
|
||||
//
|
||||
// public function display_name()
|
||||
// {
|
||||
// return $this->model->display_name;
|
||||
// }
|
||||
|
||||
|
||||
// protected function displayName(): Attribute
|
||||
// {
|
||||
// // This override should only kick in if the model has a display_name prope
|
||||
// if ($this->getRawOriginal('display_name')) {
|
||||
// return Attribute:: make (
|
||||
// get: fn(mixed $value) => 'Poop:'.$this->display_name
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// return Attribute:: make(
|
||||
// get: fn(mixed $value) => 'Fart: '.$this->name,
|
||||
// );
|
||||
// }
|
||||
|
||||
public function __get($property)
|
||||
{
|
||||
@@ -80,7 +101,7 @@ abstract class Presenter
|
||||
return $this->{$property}();
|
||||
}
|
||||
|
||||
return e($this->model->{$property});
|
||||
return $this->model->{$property};
|
||||
}
|
||||
|
||||
public function __call($method, $args)
|
||||
|
||||
@@ -456,23 +456,23 @@ class UserPresenter extends Presenter
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function fullName()
|
||||
{
|
||||
if ($this->display_name) {
|
||||
return html_entity_decode($this->display_name, ENT_QUOTES | ENT_XML1, 'UTF-8');
|
||||
}
|
||||
return html_entity_decode($this->first_name.' '.$this->last_name, ENT_QUOTES | ENT_XML1, 'UTF-8');
|
||||
}
|
||||
// public function fullName()
|
||||
// {
|
||||
// if ($this->display_name) {
|
||||
// return 'kjdfh'.html_entity_decode($this->display_name, ENT_QUOTES | ENT_XML1, 'UTF-8');
|
||||
// }
|
||||
// return 'roieuoe'.html_entity_decode($this->first_name.' '.$this->last_name, ENT_QUOTES | ENT_XML1, 'UTF-8');
|
||||
// }
|
||||
|
||||
/**
|
||||
* Standard accessor.
|
||||
* @TODO Remove presenter::fullName() entirely?
|
||||
* @return string
|
||||
*/
|
||||
public function name()
|
||||
{
|
||||
return $this->fullName();
|
||||
}
|
||||
// /**
|
||||
// * Standard accessor.
|
||||
// * @TODO Remove presenter::fullName() entirely?
|
||||
// * @return string
|
||||
// */
|
||||
// public function name()
|
||||
// {
|
||||
// return $this->fullName();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -74,12 +74,12 @@ class BreadcrumbsServiceProvider extends ServiceProvider
|
||||
|
||||
Breadcrumbs::for('hardware.show', fn (Trail $trail, Asset $asset) =>
|
||||
$trail->parent('hardware.index', route('hardware.index'))
|
||||
->push($asset->present()->fullName(), route('hardware.show', $asset))
|
||||
->push($asset->display_name, route('hardware.show', $asset))
|
||||
);
|
||||
|
||||
Breadcrumbs::for('hardware.edit', fn (Trail $trail, Asset $asset) =>
|
||||
$trail->parent('hardware.index', route('hardware.index'))
|
||||
->push($asset->present()->fullName(), route('hardware.show', $asset))
|
||||
->push($asset->display_name, route('hardware.show', $asset))
|
||||
->push(trans('admin/hardware/general.edit'))
|
||||
);
|
||||
|
||||
@@ -579,7 +579,7 @@ class BreadcrumbsServiceProvider extends ServiceProvider
|
||||
|
||||
Breadcrumbs::for('users.show', fn (Trail $trail, User $user) =>
|
||||
$trail->parent('users.index', route('users.index'))
|
||||
->push($user->getFullNameAttribute() ?? 'Missing Username!', route('users.show', $user))
|
||||
->push($user->display_name ?? 'Missing Username!', route('users.show', $user))
|
||||
);
|
||||
|
||||
Breadcrumbs::for('users.edit', fn (Trail $trail, User $user) =>
|
||||
|
||||
@@ -28,8 +28,9 @@ class UserFactory extends Factory
|
||||
'email' => $this->faker->safeEmail(),
|
||||
'employee_num' => $this->faker->numberBetween(3500, 35050),
|
||||
'first_name' => $this->faker->firstName(),
|
||||
'jobtitle' => $this->faker->jobTitle(),
|
||||
'last_name' => $this->faker->lastName(),
|
||||
'display_name' => null,
|
||||
'jobtitle' => $this->faker->jobTitle(),
|
||||
'locale' => 'en-US',
|
||||
'notes' => 'Created by DB seeder',
|
||||
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
<input class="form-control" type="text" name="gravatar" id="gravatar" value="{{ old('gravatar', $user->gravatar) }}" />
|
||||
{!! $errors->first('gravatar', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
<p style="padding-top: 3px;">
|
||||
<img src="//secure.gravatar.com/avatar/{{ md5(strtolower(trim($user->gravatar))) }}" width="30" height="30" alt="{{ $user->present()->fullName() }} avatar image">
|
||||
<img src="//secure.gravatar.com/avatar/{{ md5(strtolower(trim($user->gravatar))) }}" width="30" height="30" alt="{{ $user->display_name }} avatar image">
|
||||
{!! trans('general.gravatar_url') !!}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.hello_name', array('name' => $user->present()->getFullNameAttribute())) }}
|
||||
{{ trans('general.hello_name', array('name' => $user->display_name)) }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<select name="user_id" id="user_id" class="form-control select2" onchange="this.form.submit()" style="width: 250px; display: inline-block;">
|
||||
@foreach ($subordinates as $subordinate)
|
||||
<option value="{{ $subordinate->id }}" {{ (int)$selectedUserId === (int)$subordinate->id ? ' selected' : '' }}>
|
||||
{{ $subordinate->present()->fullName() }}
|
||||
{{ $subordinate->display_name }}
|
||||
@if ($subordinate->id == auth()->id())
|
||||
({{ trans('general.me') }})
|
||||
@endif
|
||||
@@ -133,7 +133,7 @@
|
||||
<div class="col-md-3 col-xs-12 col-sm-push-9">
|
||||
|
||||
<div class="col-md-12 text-center">
|
||||
<img src="{{ $user->present()->gravatar() }}" class=" img-thumbnail hidden-print" style="margin-bottom: 20px;" alt="{{ $user->present()->fullName() }}" alt="User avatar">
|
||||
<img src="{{ $user->present()->gravatar() }}" class=" img-thumbnail hidden-print" style="margin-bottom: 20px;" alt="{{ $user->display_name }}" alt="User avatar">
|
||||
</div>
|
||||
@can('self.profile')
|
||||
<div class="col-md-12">
|
||||
@@ -204,7 +204,7 @@
|
||||
{{ trans('admin/users/table.name') }}
|
||||
</div>
|
||||
<div class="col-md-9 col-sm-2">
|
||||
{{ $user->present()->fullName() }}
|
||||
{{ $user->display_name }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -309,9 +309,7 @@
|
||||
{{ trans('admin/users/table.manager') }}
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<a href="{{ route('users.show', $user->manager->id) }}">
|
||||
{{ $user->manager->getFullNameAttribute() }}
|
||||
</a>
|
||||
<x-full-user-name :user="$user->manager" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -2,26 +2,22 @@
|
||||
'user'
|
||||
])
|
||||
|
||||
@if($user)
|
||||
@php
|
||||
$fullName = $user->present()->fullName();
|
||||
@endphp
|
||||
|
||||
@if ($user)
|
||||
@can('view', $user)
|
||||
@if(! $user->trashed())
|
||||
{{-- if the user is in database but soft-deleted --}}
|
||||
<a href="{{ route('users.show', $user->id) }}">{{ $fullName }}</a>
|
||||
{{-- if the user is in database, the viewer CAN see them, and the user is not deleted --}}
|
||||
<a href="{{ route('users.show', $user->id) }}">{{ $user->display_name }}</a>
|
||||
@else
|
||||
{{-- if the user exists --}}
|
||||
<s><a href="{{ route('users.show', $user->id) }}">{{ $fullName }}</a></s>
|
||||
{{-- if the user is soft deleted, but the viewer can see them, add a strikethrough --}}
|
||||
<s><a href="{{ route('users.show', $user->id) }}">{{ $user->display_name }}</a></s>
|
||||
@endif
|
||||
@else
|
||||
@if(! $user->trashed())
|
||||
{{-- if the user is in database but soft-deleted --}}
|
||||
<span>{{ $fullName }}</span>
|
||||
{{-- if the user is in database and not soft-deleted --}}
|
||||
<span>{{ $user->display_name }}</span>
|
||||
@else
|
||||
{{-- if the user exists --}}
|
||||
<s><span>{{ $fullName }}</span></s>
|
||||
{{-- if the user exists but is deleted and the viewer cannot click through to see their details --}}
|
||||
<s><span>{{ $user->display_name }}</span></s>
|
||||
@endif
|
||||
@endcan
|
||||
@endif
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
<td>
|
||||
@if ($request->requestingUser() && !$request->requestingUser()->trashed())
|
||||
<a href="{{ config('app.url') }}/users/{{ $request->requestingUser()->id }}">
|
||||
{{ $request->requestingUser()->present()->fullName() }}
|
||||
{{ $request->requestingUser()->display_name }}
|
||||
</a>
|
||||
@else
|
||||
(deleted user)
|
||||
|
||||
@@ -338,7 +338,7 @@
|
||||
|
||||
@if (($asset->checkedOutToUser()) && ($asset->assignedTo->present()->gravatar()))
|
||||
<li>
|
||||
<img src="{{ $asset->assignedTo->present()->gravatar() }}" class="user-image-inline hidden-print" alt="{{ $asset->assignedTo->present()->fullName() }}">
|
||||
<img src="{{ $asset->assignedTo->present()->gravatar() }}" class="user-image-inline hidden-print" alt="{{ $asset->assignedTo->display_name }}">
|
||||
{!! $asset->assignedTo->present()->nameUrl() !!}
|
||||
</li>
|
||||
@else
|
||||
@@ -547,7 +547,7 @@
|
||||
{!! $asset->checkInvalidNextAuditDate() ? '<i class="fas fa-exclamation-triangle text-orange" aria-hidden="true"></i>' : '' !!}
|
||||
{{ Helper::getFormattedDateObject($audit_log->created_at, 'datetime', false) }}
|
||||
@if ($audit_log->user)
|
||||
(by {{ link_to_route('users.show', $audit_log->user->present()->fullname(), [$audit_log->user->id]) }})
|
||||
(by {{ link_to_route('users.show', $audit_log->user->display_name, [$audit_log->user->id]) }})
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
@@ -353,7 +353,7 @@ dir="{{ Helper::determineLanguageDirection() }}">
|
||||
@endif
|
||||
|
||||
<span class="hidden-xs">
|
||||
{{ Auth::user()->getFullNameAttribute() }}
|
||||
{{ Auth::user()->display_name }}
|
||||
<strong class="caret"></strong>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>{{ trans('general.assigned_to', array('name' => $location->present()->fullName())) }} </title>
|
||||
<title>{{ trans('general.assigned_to', array('name' => $location->display_name)) }} </title>
|
||||
<style>
|
||||
body {
|
||||
font-family: "Arial, Helvetica", sans-serif;
|
||||
@@ -49,9 +49,9 @@
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<h2>{{ trans('general.assigned_to', array('name' => $location->present()->fullName())) }}</h2>
|
||||
<h2>{{ trans('general.assigned_to', array('name' => $location->display_name)) }}</h2>
|
||||
@if ($parent)
|
||||
{{ $parent->present()->fullName() }}
|
||||
{{ $parent->display_name }}
|
||||
@endif
|
||||
<br>
|
||||
@if ($company)
|
||||
@@ -59,7 +59,7 @@
|
||||
<br>
|
||||
@endif
|
||||
@if ($manager)
|
||||
<b>{{ trans('general.manager') }}</b> {{ $manager->present()->fullName() }}<br>
|
||||
<b>{{ trans('general.manager') }}</b> {{ $manager->display_name }}<br>
|
||||
@endif
|
||||
<b>{{ trans('general.date') }}</b> {{ \App\Helpers\Helper::getFormattedDateObject(now(), 'datetime', false) }}<br><br>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@component('mail::message')
|
||||
# {{ trans('mail.hello') }} {{ $target->present()->fullName() }},
|
||||
# {{ trans('mail.hello') }} {{ $target->display_name }},
|
||||
|
||||
{{ trans('mail.the_following_item') }}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
| **{{ trans('general.model_no') }}** | {{ $item->model_no }} |
|
||||
@endif
|
||||
@if ($admin)
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->present()->fullName() }} |
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->display_name }} |
|
||||
@endif
|
||||
@if ($note)
|
||||
| **{{ trans('mail.additional_notes') }}** | {{ $note }} |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@component('mail::message')
|
||||
# {{ trans('mail.hello') }} {{ $target->present()->fullName() }},
|
||||
# {{ trans('mail.hello') }} {{ $target->display_name }},
|
||||
|
||||
{{ trans('mail.the_following_item') }}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
@endif
|
||||
@endforeach
|
||||
@if ($admin)
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->present()->fullName() }} |
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->display_name }} |
|
||||
@endif
|
||||
@if ($note)
|
||||
| **{{ trans('mail.additional_notes') }}** | {{ $note }} |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@component('mail::message')
|
||||
# {{ trans('mail.hello') }} {{ $target->assignedto->present()->fullName() }},
|
||||
# {{ trans('mail.hello') }} {{ $target->assignedto->display_name }},
|
||||
|
||||
{{ trans('mail.the_following_item') }}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
| **{{ trans('general.manufacturer') }}** | {{ $item->manufacturer->name }} |
|
||||
@endif
|
||||
@if ($admin)
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->present()->fullName() }} |
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->display_name }} |
|
||||
@endif
|
||||
@if ($note)
|
||||
| **{{ trans('mail.additional_notes') }}** | {{ $note }} |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@component('mail::message')
|
||||
# {{ trans('mail.hello') }} {{ $target->present()->fullName() }},
|
||||
# {{ trans('mail.hello') }} {{ $target->display_name }},
|
||||
|
||||
{{ trans('mail.the_following_item') }}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
| **{{ trans('general.category') }}** | {{ $license->category->name }} |
|
||||
@endif
|
||||
@if ($admin)
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->present()->fullName() }} |
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->display_name }} |
|
||||
@endif
|
||||
@if ($note)
|
||||
| **{{ trans('mail.additional_notes') }}** | {{ $note }} |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@component('mail::message')
|
||||
# {{ trans('mail.hello') }} {{ $recipient->present()->fullName() }},
|
||||
# {{ trans('mail.hello') }} {{ $recipient->display_name }},
|
||||
|
||||
{{ $introduction }}:
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
@component('mail::table')
|
||||
| | |
|
||||
| ------------- | ------------- |
|
||||
| **{{ trans('mail.user') }}** | {{ $assignedTo->present()->fullName() }} |
|
||||
| **{{ trans('mail.user') }}** | {{ $assignedTo->display_name }} |
|
||||
| **{{ trans('mail.name') }}** | {{ $item->present()->name() }} |
|
||||
@if (isset($item->asset_tag))
|
||||
| **{{ trans('mail.asset_tag') }}** | {{ $item->asset_tag }} |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@component('mail::message')
|
||||
# {{ trans('mail.hello') }}{{ $target->assignedto?->present()->fullName() ? ' ' . $target->assignedto->present()->fullName() . ',' : ',' }}
|
||||
# {{ trans('mail.hello') }}{{ $target->assignedto?->display_name ? ' ' . $target->assignedto->display_name . ',' : ',' }}
|
||||
|
||||
{{ trans('mail.new_item_checked') }}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
| **{{ trans('mail.additional_notes') }}** | {{ $note }} |
|
||||
@endif
|
||||
@if ($admin)
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->present()->fullName() }} |
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->display_name }} |
|
||||
@endif
|
||||
@endcomponent
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
@endif
|
||||
@endforeach
|
||||
@if ($admin)
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->present()->fullName() }} |
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->display_name }} |
|
||||
@endif
|
||||
@if ($note)
|
||||
| **{{ trans('mail.additional_notes') }}** | {{ $note }} |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@component('mail::message')
|
||||
# {{ trans('mail.hello') }} {{ $target->assignedto->present()->fullName() }},
|
||||
# {{ trans('mail.hello') }} {{ $target->assignedto->display_name }},
|
||||
|
||||
{{ trans('mail.new_item_checked') }}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
| **{{ trans('mail.additional_notes') }}** | {{ $note }} |
|
||||
@endif
|
||||
@if ($admin)
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->present()->fullName() }} |
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->display_name }} |
|
||||
@endif
|
||||
@endcomponent
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@component('mail::message')
|
||||
# {{ trans('mail.hello') }} {{ $target->present()->fullName() }},
|
||||
# {{ trans('mail.hello') }} {{ $target->display_name }},
|
||||
|
||||
{{ trans('mail.new_item_checked') }}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
| **{{ trans('mail.additional_notes') }}** | {{ $note }} |
|
||||
@endif
|
||||
@if ($admin)
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->present()->fullName() }} |
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->display_name }} |
|
||||
@endif
|
||||
@endcomponent
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
| **{{ trans('mail.additional_notes') }}** | {{ $note }} |
|
||||
@endif
|
||||
@if ($admin)
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->present()->fullName() }} |
|
||||
| **{{ trans('general.administrator') }}** | {{ $admin->display_name }} |
|
||||
@endif
|
||||
@endcomponent
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@
|
||||
@if ($model->adminuser)
|
||||
<li>
|
||||
<strong>{{ trans('general.created_by') }}</strong>:
|
||||
{{ $model->adminuser->present()->name() }}
|
||||
{{ $model->adminuser->display_name }}
|
||||
</li>
|
||||
@endif
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
@if (isset($qty))
|
||||
| **{{ trans('general.qty') }}** | {{ $qty }}
|
||||
@endif
|
||||
| **{{ trans('mail.user') }}** | [{{ $requested_by->present()->fullName() }}]({{ route('users.show', $requested_by->id) }}) |
|
||||
| **{{ trans('mail.user') }}** | [{{ $requested_by->display_name }}]({{ route('users.show', $requested_by->id) }}) |
|
||||
| **{{ trans('general.requested') }}** | {{ $requested_date }} |
|
||||
@if ((isset($item->asset_tag)) && ($item->asset_tag!=''))
|
||||
| **{{ trans('mail.asset_tag') }}** | {{ $item->asset_tag }} |
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
<td>
|
||||
<span {!! (Auth::user()->id==$user->id ? ' style="text-decoration: line-through"' : '') !!}>
|
||||
{{ $user->present()->fullName() }} ({{ $user->username }})
|
||||
{{ $user->display_name }} ({{ $user->username }})
|
||||
</span>
|
||||
{{ (Auth::id()==$user->id ? ' (cannot delete yourself)' : '') }}
|
||||
</td>
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
@foreach ($users as $user)
|
||||
<tr {!! ($user->isSuperUser() ? ' class="danger"':'') !!}>
|
||||
<td>
|
||||
<label class="form-control" for="{{ $user->id }}"><input type="radio" name="merge_into_id" id="{{ $user->id }}" value="{{ $user->id }}"> {{ $user->present()->fullName() }}</label>
|
||||
<label class="form-control" for="{{ $user->id }}"><input type="radio" name="merge_into_id" id="{{ $user->id }}" value="{{ $user->id }}"> {{ $user->display_name }}</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ $user->email }}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@section('title')
|
||||
@if ($user->id)
|
||||
{{ trans('admin/users/table.updateuser') }}
|
||||
{{ $user->present()->fullName() }}
|
||||
{{ $user->display_name }}
|
||||
@else
|
||||
{{ trans('admin/users/table.createuser') }}
|
||||
@endif
|
||||
@@ -322,7 +322,7 @@
|
||||
maxlength="191"
|
||||
name="display_name"
|
||||
id="display_name"
|
||||
value="{{ old('display_name', $user->display_name) }}"
|
||||
value="{{ old('display_name', $user->getRawOriginal('display_name')) }}"
|
||||
/>
|
||||
{!! $errors->first('display_name', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
@if ((isset($users) && count($users) === 1))
|
||||
<title>{{ trans('general.assigned_to', ['name' => $users[0]->present()->fullName()]) }} - {{ date('Y-m-d H:i', time()) }}</title>
|
||||
<title>{{ trans('general.assigned_to', ['name' => $users[0]->display_name]) }} - {{ date('Y-m-d H:i', time()) }}</title>
|
||||
@else
|
||||
<title>{{ trans('admin/users/general.print_assigned') }} - {{ date('Y-m-d H:i', time()) }}</title>
|
||||
@endisset
|
||||
@@ -96,10 +96,10 @@
|
||||
<div id="start_of_user_section"> {{-- used for page breaks when printing --}}</div>
|
||||
<h3>
|
||||
@if ($show_user->company)
|
||||
<b>{{ trans('admin/companies/table.name') }}:</b> {{ $show_user->company->name }}</b>
|
||||
<b>{{ trans('admin/companies/table.name') }}:</b> {{ $show_user->company->name }}
|
||||
<br>
|
||||
@endif
|
||||
{{ trans('general.assigned_to', ['name' => $show_user->present()->fullName()]) }}
|
||||
{{ trans('general.assigned_to', ['name' => $show_user->display_name]) }}
|
||||
{{ ($show_user->employee_num!='') ? ' (#'.$show_user->employee_num.') ' : '' }}
|
||||
{{ ($show_user->jobtitle!='' ? ' - '.$show_user->jobtitle : '') }}
|
||||
</h3>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/users/general.view_user', ['name' => $user->present()->fullName()]) }}
|
||||
{{ trans('admin/users/general.view_user', ['name' => $user->display_name]) }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
|
||||
</div>
|
||||
<div class="col-md-12 text-center">
|
||||
<img src="{{ $user->present()->gravatar() }}" class=" img-thumbnail hidden-print" style="margin-bottom: 20px;" alt="{{ $user->present()->fullName() }}">
|
||||
<img src="{{ $user->present()->gravatar() }}" class=" img-thumbnail hidden-print" style="margin-bottom: 20px;" alt="{{ $user->display_name }}">
|
||||
</div>
|
||||
|
||||
@can('update', $user)
|
||||
@@ -266,7 +266,7 @@
|
||||
@if ($user->deleted_at=='')
|
||||
<div class="col-md-12" style="padding-top: 30px;">
|
||||
@if ($user->isDeletable())
|
||||
<a href="" class="delete-asset btn-block btn btn-sm btn-danger btn-social hidden-print" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $user->present()->fullName]) }}" data-icon="fa-trash" data-target="#dataConfirmModal" onClick="return false;" >
|
||||
<a href="" class="delete-asset btn-block btn btn-sm btn-danger btn-social hidden-print" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $user->display_name]) }}" data-icon="fa-trash" data-target="#dataConfirmModal" onClick="return false;" >
|
||||
<x-icon type="delete" />
|
||||
{{ trans('button.delete')}}
|
||||
</a>
|
||||
@@ -353,7 +353,7 @@
|
||||
{{ trans('admin/users/table.display_name') }}
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $user->display_name }}
|
||||
{{ $user->getRawOriginal('display_name') }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@@ -490,7 +490,7 @@
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<a href="{{ route('users.show', $user->manager->id) }}">
|
||||
{{ $user->manager->getFullNameAttribute() }}
|
||||
{{ $user->manager->display_name }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -613,7 +613,7 @@
|
||||
@if ($user->createdBy)
|
||||
-
|
||||
@if ($user->createdBy->deleted_at=='')
|
||||
<a href="{{ route('users.show', ['user' => $user->created_by]) }}">{{ $user->createdBy->present()->fullName }}</a>
|
||||
<a href="{{ route('users.show', ['user' => $user->created_by]) }}">{{ $user->createdBy->display_name }}</a>
|
||||
@else
|
||||
<del>{{ $user->createdBy->present()->fullName }}</del>
|
||||
@endif
|
||||
@@ -838,7 +838,7 @@
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.assets.index',['assigned_to' => e($user->id), 'assigned_type' => 'App\Models\User']) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($user->present()->fullName()) }}-assets-{{ date('Y-m-d') }}",
|
||||
"fileName": "export-{{ str_slug($user->username) }}-assets-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
@@ -45,7 +45,7 @@ class SendAcceptanceReminderTest extends TestCase
|
||||
]);
|
||||
$headers = ['ID', 'Name'];
|
||||
$rows = [
|
||||
[$userA->id, $userA->present()->fullName()],
|
||||
[$userA->id, $userA->display_name],
|
||||
];
|
||||
$this->artisan('snipeit:acceptance-reminder')
|
||||
->expectsOutput("The following users do not have an email address:")
|
||||
|
||||
@@ -17,7 +17,7 @@ class UserFullNameTest extends TestCase
|
||||
function () {
|
||||
return [
|
||||
'actor' => User::factory()->viewUsers()->create(),
|
||||
'user' => User::factory()->create(['first_name' => 'Jim', 'last_name' => 'Bagg']),
|
||||
'user' => User::factory()->create(['first_name' => 'Jim', 'last_name' => 'Bagg', 'display_name' => null]),
|
||||
'assertions' => function ($rendered) {
|
||||
Assert::assertStringContainsString('<a ', $rendered);
|
||||
Assert::assertStringContainsString('Jim Bagg', $rendered);
|
||||
@@ -30,7 +30,7 @@ class UserFullNameTest extends TestCase
|
||||
function () {
|
||||
return [
|
||||
'actor' => User::factory()->viewUsers()->create(),
|
||||
'user' => User::factory()->deleted()->create(['first_name' => 'Jim', 'last_name' => 'Bagg']),
|
||||
'user' => User::factory()->deleted()->create(['first_name' => 'Jim', 'last_name' => 'Bagg', 'display_name' => 'Jim Baggins']),
|
||||
'assertions' => function ($rendered) {
|
||||
Assert::assertStringContainsString('<s><a ', $rendered);
|
||||
Assert::assertStringContainsString('Jim Bagg', $rendered);
|
||||
@@ -43,7 +43,7 @@ class UserFullNameTest extends TestCase
|
||||
function () {
|
||||
return [
|
||||
'actor' => User::factory()->create(),
|
||||
'user' => User::factory()->create(['first_name' => 'Jim', 'last_name' => 'Bagg']),
|
||||
'user' => User::factory()->create(['first_name' => 'Jim', 'last_name' => 'Bagg', 'display_name' => 'Jim Bagg']),
|
||||
'assertions' => function ($rendered) {
|
||||
Assert::assertStringContainsString('<span>Jim Bagg', $rendered);
|
||||
Assert::assertStringNotContainsString('<a ', $rendered);
|
||||
@@ -56,7 +56,7 @@ class UserFullNameTest extends TestCase
|
||||
function () {
|
||||
return [
|
||||
'actor' => User::factory()->create(),
|
||||
'user' => User::factory()->deleted()->create(['first_name' => 'Jim', 'last_name' => 'Bagg']),
|
||||
'user' => User::factory()->deleted()->create(['first_name' => 'Jim', 'last_name' => 'Bagg', 'display_name' => 'Jim Bagg']),
|
||||
'assertions' => function ($rendered) {
|
||||
Assert::assertStringContainsString('<s><span>Jim Bagg', $rendered);
|
||||
},
|
||||
@@ -82,6 +82,10 @@ class UserFullNameTest extends TestCase
|
||||
{
|
||||
['actor' => $actor, 'user' => $user, 'assertions' => $assertions] = $provided();
|
||||
|
||||
// $user->displayName();
|
||||
|
||||
// \Log::error($user->toArray());
|
||||
|
||||
$this->actingAs($actor);
|
||||
|
||||
$renderedTemplateString = View::make('blade.full-user-name', ['user' => $user])->render();
|
||||
|
||||
Reference in New Issue
Block a user