Add copy of encrypted custom fields

Encrypted custom fields may contain sensitive or important information, and it may be useful to have the ability to copy them.
This commit is contained in:
MrM 2024-02-25 14:47:06 +01:00 committed by GitHub
parent 10dad8e6e6
commit b69364d5ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -76,12 +76,12 @@
</span>
<span class="hidden-xs hidden-sm">{{ trans('general.assets') }}
{!! ($asset->assignedAssets()->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($asset->assignedAssets()->count()).'</badge>' : '' !!}
</span>
</a>
</li>
<li>
<a href="#history" data-toggle="tab">
<span class="hidden-lg hidden-md">
@ -126,7 +126,7 @@
</a>
</li>
@can('update', \App\Models\Asset::class)
<li class="pull-right">
<a href="#" data-toggle="modal" data-target="#uploadFileModal">
@ -138,7 +138,7 @@
</ul>
<div class="tab-content">
<div class="tab-pane fade in active" id="details">
<div class="row">
@ -238,11 +238,11 @@
</strong>
</div>
<div class="col-md-6">
{{ \App\Helpers\Helper::getFormattedDateObject($audit_log->created_at, 'date', false) }}
@if ($audit_log->user)
{{ \App\Helpers\Helper::getFormattedDateObject($audit_log->created_at, 'date', false) }}
@if ($audit_log->user)
(by {{ link_to_route('users.show', $audit_log->user->present()->fullname(), [$audit_log->user->id]) }})
@endif
@endif
</div>
</div>
@endif
@ -415,6 +415,7 @@
@if ($field->isFieldDecryptable($asset->{$field->db_column_name()} ))
@can('assets.view.encrypted_custom_fields')
<span class="js-copy-{{ $field->id }}">
@if (($field->format=='URL') && ($asset->{$field->db_column_name()}!=''))
<a href="{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}" target="_new">{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}</a>
@elseif (($field->format=='DATE') && ($asset->{$field->db_column_name()}!=''))
@ -422,7 +423,11 @@
@else
{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}
@endif
@else
</span>
<i class="fa-regular fa-clipboard js-copy-link" data-clipboard-target=".js-copy-{{ $field->id }}" aria-hidden="true" data-tooltip="true" data-placement="top" title="{{ trans('general.copy_to_clipboard') }}">
<span class="sr-only">{{ trans('general.copy_to_clipboard') }}</span>
</i>
@else
{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}
@endcan
@ -520,7 +525,7 @@
@endif
{{ Helper::formatCurrencyOutput($asset->getDepreciatedValue() )}}
</div>
</div>
@endif