mirror of
https://github.com/freescout-helpdesk/freescout.git
synced 2024-11-24 19:33:07 +01:00
Show customer social profiles
This commit is contained in:
parent
4f8063214f
commit
bd1278aab4
@ -1148,7 +1148,7 @@ class Customer extends Model
|
||||
{
|
||||
if (!empty($this->photo_url) || !$default_if_empty) {
|
||||
if (!empty($this->photo_url)) {
|
||||
return Storage::url(self::PHOTO_DIRECTORY.DIRECTORY_SEPARATOR.$this->photo_url);
|
||||
return self::getPhotoUrlByFileName($this->photo_url);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
@ -1157,6 +1157,11 @@ class Customer extends Model
|
||||
}
|
||||
}
|
||||
|
||||
public static function getPhotoUrlByFileName($file_name)
|
||||
{
|
||||
return Storage::url(self::PHOTO_DIRECTORY.DIRECTORY_SEPARATOR.$file_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resize and save photo.
|
||||
*/
|
||||
@ -1234,11 +1239,13 @@ class Customer extends Model
|
||||
|
||||
$sp['type_name'] = self::$social_type_names[$sp['type']];
|
||||
|
||||
if (!preg_match("/^https?:\/\//i", $sp['value'])) {
|
||||
$sp['value'] = 'http://'.$sp['value'];
|
||||
$sp['value_url'] = $sp['value'];
|
||||
|
||||
if (!preg_match("/^https?:\/\//i", $sp['value_url'])) {
|
||||
$sp['value_url'] = 'http://'.$sp['value_url'];
|
||||
}
|
||||
if (empty($sp['value'])) {
|
||||
$sp['value'] = '';
|
||||
if (empty($sp['value_url'])) {
|
||||
$sp['value_url'] = '';
|
||||
}
|
||||
|
||||
return $sp;
|
||||
|
@ -31,7 +31,7 @@
|
||||
<a href="{{ $website }}" target="_blank" title="{{ parse_url($website, PHP_URL_HOST) }}" data-toggle="tooltip" class="glyphicon glyphicon-globe"></a>
|
||||
@endforeach
|
||||
@foreach ($customer->getSocialProfiles() as $sp)
|
||||
<a href="{{ App\Customer::formatSocialProfile($sp)['value'] }}" target="_blank" data-toggle="tooltip" title="{{ App\Customer::formatSocialProfile($sp)['type_name'] }}" class="glyphicon glyphicon-user"></a>
|
||||
<a href="{{ App\Customer::formatSocialProfile($sp)['value_url'] }}" target="_blank" data-toggle="tooltip" title="{{ App\Customer::formatSocialProfile($sp)['type_name'] }}" class="glyphicon glyphicon-user"></a>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
Loading…
Reference in New Issue
Block a user