@php
if (!isset($excludeFieldTypes))
{
$excludeFieldTypes = [];
}
@endphp
@if($userfields && count($userfields) > 0)
@foreach($userfields as $userfield)
@if(in_array($userfield->type, $excludeFieldTypes))
@continue
@endif
@if($userfield->show_as_column_in_tables == 1)
@php $userfieldObject = FindObjectInArrayByPropertyValue($userfieldValues, 'name', $userfield->name) @endphp
@if($userfieldObject !== null)
@if($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_CHECKBOX)
@if($userfieldObject->value == 1)@endif
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_PRESET_CHECKLIST)
{!! str_replace(',', ' ', $userfieldObject->value) !!}
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_LINK)
{{ $userfieldObject->value }}
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_LINK_WITH_TITLE)
@php
$title = '';
$link = '';
if(!empty($userfieldObject->value))
{
$data = json_decode($userfieldObject->value);
$title = $data->title;
$link = $data->link;
}
@endphp
{{ $title }}
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_FILE && !empty($userfieldObject->value))
{{ base64_decode(explode('_', $userfieldObject->value)[1]) }}
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_IMAGE && !empty($userfieldObject->value))
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_NUMBER_DECIMAL)
{{ $userfieldObject->value }}
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_NUMBER_CURRENCY)
{{ $userfieldObject->value }}
@else
{{ $userfieldObject->value }}
@endif
@endif
|
@endif
@endforeach
@endif