Skip to content

A free open source IT asset/license management system

Nicer show/hide if encrypted, warn if already encrypted

snipe0f97c0601b5f
diff --git a/resources/views/custom_fields/fields/edit.blade.php b/resources/views/custom_fields/fields/edit.blade.php
index 6a2bbd7ede..227fb08378 100644
--- a/resources/views/custom_fields/fields/edit.blade.php
+++ b/resources/views/custom_fields/fields/edit.blade.php
@@ -118,10 +118,40 @@
</div>
</div>
+ <!-- Set up checkbox form group -->
+ <div class="form-group">
+
+ <!-- Encrypted warning callout box -->
+ @if (($field->id) && ($field->field_encrypted=='1'))
+ <div class="col-md-9 col-md-offset-3">
+ <div class="alert alert-warning fade in">
+ <i class="fas fa-exclamation-triangle faa-pulse animated"></i>
+ <strong>{{ trans('general.notification_warning') }}:</strong>
+ {{ trans('admin/custom_fields/general.encrypted_options') }}
+ </div>
+
+ </div>
+ @endif
+
+ @if (!$field->id)
+ <!-- Encrypted -->
+ <div class="col-md-9 col-md-offset-3">
+ <label class="form-control">
+ <input type="checkbox" value="1" name="field_encrypted" id="field_encrypted"{{ (Request::old('field_encrypted') || $field->field_encrypted) ? ' checked="checked"' : '' }}>
+ {{ trans('admin/custom_fields/general.encrypt_field') }}
+ </label>
+ </div>
+ <div class="col-md-9 col-md-offset-3" id="encrypt_warning" style="display:none;">
+ <div class="callout callout-danger">
+ <p><i class="fas fa-exclamation-triangle" aria-hidden="true"></i> {{ trans('admin/custom_fields/general.encrypt_field_help') }}</p>
+ </div>
+ </div>
+
+ @endif
+
<!-- Auto-Add to Future Fieldsets -->
- <div class="form-group {{ $errors->has('auto_add_to_fieldsets') ? ' has-error' : '' }}" id="auto_add_to_fieldsets">
<div class="col-md-9 col-md-offset-3">
<label class="form-control">
<input type="checkbox" name="auto_add_to_fieldsets" aria-label="auto_add_to_fieldsets" value="1"{{ (old('auto_add_to_fieldsets') || $field->auto_add_to_fieldsets) ? ' checked="checked"' : '' }}>
@@ -129,6 +159,7 @@
</label>
</div>
+ <!-- Show in list view -->
<div class="col-md-9 col-md-offset-3">
<label class="form-control">
<input type="checkbox" name="show_in_listview" aria-label="show_in_listview" value="1"{{ (old('show_in_listview') || $field->show_in_listview) ? ' checked="checked"' : '' }}>
@@ -136,53 +167,44 @@
</label>
</div>
- <div class="col-md-9 col-md-offset-3">
+
+ @if ((!$field->id) || ($field->field_encrypted=='0'))
+
+ <!-- Show in requestable list view -->
+ <div class="col-md-9 col-md-offset-3" id="show_in_requestable_list">
<label class="form-control">
<input type="checkbox" name="show_in_requestable_list" aria-label="show_in_requestable_list" value="1"{{ (old('show_in_requestable_list') || $field->show_in_requestable_list) ? ' checked="checked"' : '' }}>
{{ trans('admin/custom_fields/general.show_in_requestable_list') }}
</label>
</div>
- @if (!$field->id)
- <!-- Encrypted -->
- <div class="col-md-9 col-md-offset-3">
- <label class="form-control">
- <input type="checkbox" value="1" name="field_encrypted" id="field_encrypted"{{ (Request::old('field_encrypted') || $field->field_encrypted) ? ' checked="checked"' : '' }}>
- {{ trans('admin/custom_fields/general.encrypt_field') }}
- </label>
- </div>
-
- <div class="col-md-9 col-md-offset-3" id="encrypt_warning" style="display:none;">
- <div class="callout callout-danger">
- <p><i class="fas fa-exclamation-triangle" aria-hidden="true"></i> {{ trans('admin/custom_fields/general.encrypt_field_help') }}</p>
- </div>
- </div>
- @endif
-
<!-- Show in Email -->
- <div class="col-md-9 col-md-offset-3">
+ <div class="col-md-9 col-md-offset-3" id="show_in_email">
<label class="form-control">
<input type="checkbox" name="show_in_email" aria-label="show_in_email" value="1"{{ (old('show_in_email') || $field->show_in_email) ? ' checked="checked"' : '' }}>
{{ trans('admin/custom_fields/general.show_in_email') }}
</label>
</div>
- <!-- Show in View All Assets profile view -->
- <div class="col-md-9 col-md-offset-3">
+ <!-- Value Must be Unique -->
+ <div class="col-md-9 col-md-offset-3" id="is_unique">
<label class="form-control">
- <input type="checkbox" name="display_in_user_view" aria-label="display_in_user_view" value="1" {{ (old('display_in_user_view') || $field->display_in_user_view) ? ' checked="checked"' : '' }}>
- {{ trans('admin/custom_fields/general.display_in_user_view') }}
+ <input type="checkbox" name="is_unique" aria-label="is_unique" value="1"{{ (old('is_unique') || $field->is_unique) ? ' checked="checked"' : '' }}>
+ {{ trans('admin/custom_fields/general.is_unique') }}
</label>
</div>
+ @endif
- <!-- Value Must be Unique -->
- <div class="col-md-9 col-md-offset-3">
+ <!-- Show in View All Assets profile view -->
+ <div class="col-md-9 col-md-offset-3" id="display_in_user_view">
<label class="form-control">
- <input type="checkbox" name="is_unique" aria-label="is_unique" value="1"{{ (old('is_unique') || $field->is_unique) ? ' checked="checked"' : '' }}>
- {{ trans('admin/custom_fields/general.is_unique') }}
+ <input type="checkbox" name="display_in_user_view" aria-label="display_in_user_view" value="1" {{ (old('display_in_user_view') || $field->display_in_user_view) ? ' checked="checked"' : '' }}>
+ {{ trans('admin/custom_fields/general.display_in_user_view') }}
</label>
</div>
+
+
</div>
</div>
@@ -294,11 +316,13 @@
$("#show_in_email").hide();
$("#display_in_user_view").hide();
$("#is_unique").hide();
+ $("#show_in_requestable_list").hide();
} else {
$("#encrypt_warning").hide();
$("#show_in_email").show();
$("#display_in_user_view").show();
$("#is_unique").show();
+ $("#show_in_requestable_list").show();
}
});