mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Add the new rule to proper views and also in the Asset Transformer
This commit is contained in:
parent
705411eb4d
commit
ecf522243b
|
@ -101,10 +101,10 @@ class AssetsTransformer
|
|||
foreach ($asset->model->fieldset->fields as $field) {
|
||||
if ($field->isFieldDecryptable($asset->{$field->db_column})) {
|
||||
$decrypted = Helper::gracefulDecrypt($field, $asset->{$field->db_column});
|
||||
$value = (Gate::allows('superadmin') || Gate::allows('admin')) ? $decrypted : strtoupper(trans('admin/custom_fields/general.encrypted'));
|
||||
$value = (Gate::allows('assets.view.encrypted_custom_fields')) ? $decrypted : strtoupper(trans('admin/custom_fields/general.encrypted'));
|
||||
|
||||
if ($field->format == 'DATE'){
|
||||
if (Gate::allows('superadmin') || Gate::allows('admin')){
|
||||
if (Gate::allows('assets.view.encrypted_custom_fields')){
|
||||
$value = Helper::getFormattedDateObject($value, 'date', false);
|
||||
} else {
|
||||
$value = strtoupper(trans('admin/custom_fields/general.encrypted'));
|
||||
|
|
|
@ -460,7 +460,7 @@
|
|||
@endif
|
||||
|
||||
@if ($field->isFieldDecryptable($asset->{$field->db_column_name()} ))
|
||||
@canany(['superuser', 'admin'])
|
||||
@can('assets.view.encrypted_custom_fields')
|
||||
@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()}!=''))
|
||||
|
@ -470,7 +470,7 @@
|
|||
@endif
|
||||
@else
|
||||
{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}
|
||||
@endcanany
|
||||
@endcan
|
||||
|
||||
@else
|
||||
@if (($field->format=='BOOLEAN') && ($asset->{$field->db_column_name()}!=''))
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
|
||||
@else
|
||||
@if (($field->field_encrypted=='0') || (Gate::allows('admin')))
|
||||
@if (($field->field_encrypted=='0') || (Gate::allows('assets.view.encrypted_custom_fields')))
|
||||
<input type="text" value="{{ Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))) }}" id="{{ $field->db_column_name() }}" class="form-control" name="{{ $field->db_column_name() }}" placeholder="Enter {{ strtolower($field->format) }} text">
|
||||
@else
|
||||
<input type="text" value="{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}" class="form-control disabled" disabled>
|
||||
|
|
Loading…
Reference in a new issue