mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-12 16:44:08 -08:00
Merge pull request #14335 from mauro-miatello/develop
Copy encrypted custom fields
This commit is contained in:
commit
fcb2bf7fea
|
@ -76,12 +76,12 @@
|
||||||
</span>
|
</span>
|
||||||
<span class="hidden-xs hidden-sm">{{ trans('general.assets') }}
|
<span class="hidden-xs hidden-sm">{{ trans('general.assets') }}
|
||||||
{!! ($asset->assignedAssets()->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($asset->assignedAssets()->count()).'</badge>' : '' !!}
|
{!! ($asset->assignedAssets()->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($asset->assignedAssets()->count()).'</badge>' : '' !!}
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a href="#history" data-toggle="tab">
|
<a href="#history" data-toggle="tab">
|
||||||
<span class="hidden-lg hidden-md">
|
<span class="hidden-lg hidden-md">
|
||||||
|
@ -126,7 +126,7 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
@can('update', \App\Models\Asset::class)
|
@can('update', \App\Models\Asset::class)
|
||||||
<li class="pull-right">
|
<li class="pull-right">
|
||||||
<a href="#" data-toggle="modal" data-target="#uploadFileModal">
|
<a href="#" data-toggle="modal" data-target="#uploadFileModal">
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane fade in active" id="details">
|
<div class="tab-pane fade in active" id="details">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -238,11 +238,11 @@
|
||||||
</strong>
|
</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
{{ \App\Helpers\Helper::getFormattedDateObject($audit_log->created_at, 'date', false) }}
|
{{ \App\Helpers\Helper::getFormattedDateObject($audit_log->created_at, 'date', false) }}
|
||||||
@if ($audit_log->user)
|
@if ($audit_log->user)
|
||||||
(by {{ link_to_route('users.show', $audit_log->user->present()->fullname(), [$audit_log->user->id]) }})
|
(by {{ link_to_route('users.show', $audit_log->user->present()->fullname(), [$audit_log->user->id]) }})
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
@ -415,6 +415,7 @@
|
||||||
|
|
||||||
@if ($field->isFieldDecryptable($asset->{$field->db_column_name()} ))
|
@if ($field->isFieldDecryptable($asset->{$field->db_column_name()} ))
|
||||||
@can('assets.view.encrypted_custom_fields')
|
@can('assets.view.encrypted_custom_fields')
|
||||||
|
<span class="js-copy-{{ $field->id }}">
|
||||||
@if (($field->format=='URL') && ($asset->{$field->db_column_name()}!=''))
|
@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>
|
<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()}!=''))
|
@elseif (($field->format=='DATE') && ($asset->{$field->db_column_name()}!=''))
|
||||||
|
@ -422,7 +423,11 @@
|
||||||
@else
|
@else
|
||||||
{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}
|
{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}
|
||||||
@endif
|
@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')) }}
|
{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}
|
||||||
@endcan
|
@endcan
|
||||||
|
|
||||||
|
@ -520,7 +525,7 @@
|
||||||
@endif
|
@endif
|
||||||
{{ Helper::formatCurrencyOutput($asset->getDepreciatedValue() )}}
|
{{ Helper::formatCurrencyOutput($asset->getDepreciatedValue() )}}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
|
@ -960,7 +960,13 @@
|
||||||
var clipboard = new ClipboardJS('.js-copy-link');
|
var clipboard = new ClipboardJS('.js-copy-link');
|
||||||
|
|
||||||
clipboard.on('success', function(e) {
|
clipboard.on('success', function(e) {
|
||||||
$('.js-copy-link').tooltip('hide').attr('data-original-title', '{{ trans('general.copied') }}').tooltip('show');
|
// Get the clicked element
|
||||||
|
var clickedElement = $(e.trigger);
|
||||||
|
// Get the target element selector from data attribute
|
||||||
|
var targetSelector = clickedElement.data('data-clipboard-target');
|
||||||
|
// Find the target element
|
||||||
|
var targetEl = $(targetSelector);
|
||||||
|
clickedElement.tooltip('hide').attr('data-original-title', '{{ trans('general.copied') }}').tooltip('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
// ignore: 'input[type=hidden]' is required here to validate the select2 lists
|
// ignore: 'input[type=hidden]' is required here to validate the select2 lists
|
||||||
|
|
Loading…
Reference in a new issue