Skip to content

Commit

Permalink
Add copy of encrypted custom fields
Browse files Browse the repository at this point in the history
Encrypted custom fields may contain sensitive or important information, and it may be useful to have the ability to copy them.
  • Loading branch information
mauro-miatello authored Feb 25, 2024
1 parent 10dad8e commit b69364d
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions resources/views/hardware/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -126,7 +126,7 @@
</a>
</li>


@can('update', \App\Models\Asset::class)
<li class="pull-right">
<a href="#" data-toggle="modal" data-target="#uploadFileModal">
Expand All @@ -138,7 +138,7 @@


</ul>

<div class="tab-content">
<div class="tab-pane fade in active" id="details">
<div class="row">
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -415,14 +415,19 @@

@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()}!=''))
{{ \App\Helpers\Helper::gracefulDecrypt($field, \App\Helpers\Helper::getFormattedDateObject($asset->{$field->db_column_name()}, 'date', false)) }}
@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

Expand Down Expand Up @@ -520,7 +525,7 @@
@endif
{{ Helper::formatCurrencyOutput($asset->getDepreciatedValue() )}}


</div>
</div>
@endif
Expand Down

0 comments on commit b69364d

Please sign in to comment.