mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-03 09:57:45 -08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
a6d3886aaf
|
@ -281,9 +281,11 @@ abstract class Importer
|
||||||
$user_array['email'] = User::generateEmailFromFullName($user_array['full_name']);
|
$user_array['email'] = User::generateEmailFromFullName($user_array['full_name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get some variables for $user_formatted_array in case we need them later
|
||||||
|
$user_formatted_array = User::generateFormattedNameFromFullName($user_array['full_name'], Setting::getSettings()->username_format);
|
||||||
|
|
||||||
if (empty($user_array['first_name'])) {
|
if (empty($user_array['first_name'])) {
|
||||||
// Get some fields for first name and last name based off of full name
|
// Get some fields for first name and last name based off of full name
|
||||||
$user_formatted_array = User::generateFormattedNameFromFullName($user_array['full_name'], Setting::getSettings()->username_format);
|
|
||||||
$user_array['first_name'] = $user_formatted_array['first_name'];
|
$user_array['first_name'] = $user_formatted_array['first_name'];
|
||||||
$user_array['last_name'] = $user_formatted_array['last_name'];
|
$user_array['last_name'] = $user_formatted_array['last_name'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,6 +92,10 @@ class Setting extends Model
|
||||||
'google_client_secret',
|
'google_client_secret',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'label2_asset_logo' => 'boolean',
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the app settings.
|
* Get the app settings.
|
||||||
* Cache is expired on Setting model saved in EventServiceProvider.
|
* Cache is expired on Setting model saved in EventServiceProvider.
|
||||||
|
|
|
@ -103,19 +103,12 @@ class Label implements View
|
||||||
|
|
||||||
$logo = null;
|
$logo = null;
|
||||||
|
|
||||||
// Should we be trying to use a logo at all?
|
// Should we use the assets assigned company logo? (A.K.A. "Is `Labels > Use Asset Logo` enabled?"), and do we have a company logo?
|
||||||
if ($settings->label2_asset_logo='1') {
|
if ($settings->label2_asset_logo && $asset->company && $asset->company->image!='') {
|
||||||
|
$logo = Storage::disk('public')->path('companies/'.e($asset->company->image));
|
||||||
// If we don't have a company image, fall back to the general site label image
|
} elseif (!empty($settings->label_logo)) {
|
||||||
if (!empty($settings->label_logo)) {
|
// Use the general site label logo, if available
|
||||||
$logo = Storage::disk('public')->path('/'.e($settings->label_logo));
|
$logo = Storage::disk('public')->path('/'.e($settings->label_logo));
|
||||||
}
|
|
||||||
|
|
||||||
// If we have a company logo, use that first
|
|
||||||
if (($asset->company) && ($asset->company->image!='')) {
|
|
||||||
$logo = Storage::disk('public')->path('companies/'.e($asset->company->image));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($logo)) {
|
if (!empty($logo)) {
|
||||||
|
|
Loading…
Reference in a new issue