mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-11 08:04:09 -08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
eabc7479e3
|
@ -48,7 +48,7 @@ class AssetsController extends Controller
|
|||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @param int $assetId
|
||||
* @since [v4.0]
|
||||
* @return JsonResponse
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function index(Request $request, $audit = null)
|
||||
{
|
||||
|
@ -443,7 +443,7 @@ class AssetsController extends Controller
|
|||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @param int $assetId
|
||||
* @since [v4.0]
|
||||
* @return JsonResponse
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
|
@ -474,7 +474,7 @@ class AssetsController extends Controller
|
|||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @since [v4.0.16]
|
||||
* @see \App\Http\Transformers\SelectlistTransformer
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function selectlist(Request $request)
|
||||
{
|
||||
|
@ -530,6 +530,7 @@ class AssetsController extends Controller
|
|||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @param \App\Http\Requests\ImageUploadRequest $request
|
||||
* @since [v4.0]
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function store(ImageUploadRequest $request)
|
||||
{
|
||||
|
@ -638,7 +639,7 @@ class AssetsController extends Controller
|
|||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @param \App\Http\Requests\ImageUploadRequest $request
|
||||
* @since [v4.0]
|
||||
* @return JsonResponse
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function update(ImageUploadRequest $request, $id)
|
||||
{
|
||||
|
@ -719,7 +720,7 @@ class AssetsController extends Controller
|
|||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @param int $assetId
|
||||
* @since [v4.0]
|
||||
* @return JsonResponse
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
|
@ -748,7 +749,7 @@ class AssetsController extends Controller
|
|||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @param int $assetId
|
||||
* @since [v5.1.18]
|
||||
* @return JsonResponse
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function restore(Request $request, $assetId = null)
|
||||
{
|
||||
|
@ -788,7 +789,7 @@ class AssetsController extends Controller
|
|||
* @author [N. Butler]
|
||||
* @param string $tag
|
||||
* @since [v6.0.5]
|
||||
* @return JsonResponse
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function checkoutByTag(AssetCheckoutRequest $request, $tag)
|
||||
{
|
||||
|
@ -804,7 +805,7 @@ class AssetsController extends Controller
|
|||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @param int $assetId
|
||||
* @since [v4.0]
|
||||
* @return JsonResponse
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function checkout(AssetCheckoutRequest $request, $asset_id)
|
||||
{
|
||||
|
@ -888,7 +889,7 @@ class AssetsController extends Controller
|
|||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @param int $assetId
|
||||
* @since [v4.0]
|
||||
* @return JsonResponse
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function checkin(Request $request, $asset_id)
|
||||
{
|
||||
|
@ -944,7 +945,7 @@ class AssetsController extends Controller
|
|||
*
|
||||
* @author [A. Janes] [<ajanes@adagiohealth.org>]
|
||||
* @since [v6.0]
|
||||
* @return JsonResponse
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function checkinByTag(Request $request, $tag = null)
|
||||
{
|
||||
|
@ -970,7 +971,7 @@ class AssetsController extends Controller
|
|||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @param int $id
|
||||
* @since [v4.0]
|
||||
* @return JsonResponse
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function audit(Request $request)
|
||||
|
||||
|
@ -1031,24 +1032,54 @@ class AssetsController extends Controller
|
|||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @since [v4.0]
|
||||
* @return JsonResponse
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function requestable(Request $request)
|
||||
{
|
||||
$this->authorize('viewRequestable', Asset::class);
|
||||
|
||||
$allowed_columns = [
|
||||
'name',
|
||||
'asset_tag',
|
||||
'serial',
|
||||
'model_number',
|
||||
'image',
|
||||
'purchase_cost',
|
||||
'expected_checkin',
|
||||
];
|
||||
|
||||
$all_custom_fields = CustomField::all(); //used as a 'cache' of custom fields throughout this page load
|
||||
|
||||
foreach ($all_custom_fields as $field) {
|
||||
$allowed_columns[] = $field->db_column_name();
|
||||
}
|
||||
|
||||
$assets = Asset::select('assets.*')
|
||||
->with('location', 'assetstatus', 'assetlog', 'company', 'defaultLoc','assignedTo',
|
||||
'model.category', 'model.manufacturer', 'model.fieldset', 'supplier')
|
||||
->with('location', 'assetstatus', 'assetlog', 'company','assignedTo',
|
||||
'model.category', 'model.manufacturer', 'model.fieldset', 'supplier', 'requests')
|
||||
->requestableAssets();
|
||||
|
||||
$offset = request('offset', 0);
|
||||
$limit = $request->input('limit', 50);
|
||||
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
|
||||
|
||||
|
||||
|
||||
if ($request->filled('search')) {
|
||||
$assets->TextSearch($request->input('search'));
|
||||
}
|
||||
|
||||
// Search custom fields by column name
|
||||
foreach ($all_custom_fields as $field) {
|
||||
if ($request->filled($field->db_column_name())) {
|
||||
$assets->where($field->db_column_name(), '=', $request->input($field->db_column_name()));
|
||||
}
|
||||
}
|
||||
|
||||
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
|
||||
$sort_override = str_replace('custom_fields.', '', $request->input('sort'));
|
||||
|
||||
// This handles all the pivot sorting (versus the assets.* fields
|
||||
// in the allowed_columns array)
|
||||
$column_sort = in_array($sort_override, $allowed_columns) ? $sort_override : 'assets.created_at';
|
||||
|
||||
switch ($request->input('sort')) {
|
||||
case 'model':
|
||||
$assets->OrderModels($order);
|
||||
|
@ -1056,17 +1087,18 @@ class AssetsController extends Controller
|
|||
case 'model_number':
|
||||
$assets->OrderModelNumber($order);
|
||||
break;
|
||||
case 'category':
|
||||
$assets->OrderCategory($order);
|
||||
break;
|
||||
case 'manufacturer':
|
||||
$assets->OrderManufacturer($order);
|
||||
break;
|
||||
case 'location':
|
||||
$assets->OrderLocation($order);
|
||||
default:
|
||||
$assets->orderBy('assets.created_at', $order);
|
||||
$assets->orderBy($column_sort, $order);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Make sure the offset and limit are actually integers and do not exceed system limits
|
||||
$offset = ($request->input('offset') > $assets->count()) ? $assets->count() : app('api_offset_value');
|
||||
$limit = app('api_limit_value');
|
||||
|
||||
$total = $assets->count();
|
||||
$assets = $assets->skip($offset)->take($limit)->get();
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ use Illuminate\Http\Request;
|
|||
use Laravel\Passport\TokenRepository;
|
||||
use Illuminate\Contracts\Validation\Factory as ValidationFactory;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use App\Models\CustomField;
|
||||
use DB;
|
||||
|
||||
class ProfileController extends Controller
|
||||
|
@ -48,14 +49,23 @@ class ProfileController extends Controller
|
|||
{
|
||||
$checkoutRequests = CheckoutRequest::where('user_id', '=', Auth::user()->id)->get();
|
||||
|
||||
$results = [];
|
||||
$results = array();
|
||||
$show_field = array();
|
||||
$showable_fields = array();
|
||||
$results['total'] = $checkoutRequests->count();
|
||||
|
||||
$all_custom_fields = CustomField::all(); //used as a 'cache' of custom fields throughout this page load
|
||||
foreach ($all_custom_fields as $field) {
|
||||
if (($field->field_encrypted=='0') && ($field->show_in_requestable_list=='1')) {
|
||||
$showable_fields[] = $field->db_column_name();
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($checkoutRequests as $checkoutRequest) {
|
||||
|
||||
// Make sure the asset and request still exist
|
||||
if ($checkoutRequest && $checkoutRequest->itemRequested()) {
|
||||
$results['rows'][] = [
|
||||
$assets = [
|
||||
'image' => e($checkoutRequest->itemRequested()->present()->getImageUrl()),
|
||||
'name' => e($checkoutRequest->itemRequested()->present()->name()),
|
||||
'type' => e($checkoutRequest->itemType()),
|
||||
|
@ -64,7 +74,16 @@ class ProfileController extends Controller
|
|||
'expected_checkin' => Helper::getFormattedDateObject($checkoutRequest->itemRequested()->expected_checkin, 'datetime'),
|
||||
'request_date' => Helper::getFormattedDateObject($checkoutRequest->created_at, 'datetime'),
|
||||
];
|
||||
|
||||
foreach ($showable_fields as $showable_field_name) {
|
||||
$show_field['custom_fields.'.$showable_field_name] = $checkoutRequest->itemRequested()->{$showable_field_name};
|
||||
}
|
||||
|
||||
// Merge the plain asset data and the custom fields data
|
||||
$results['rows'][] = array_merge($assets, $show_field);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $results;
|
||||
|
|
|
@ -195,9 +195,15 @@ class BulkAssetsController extends Controller
|
|||
}
|
||||
|
||||
if ($request->filled('rtd_location_id')) {
|
||||
$this->update_array['rtd_location_id'] = $request->input('rtd_location_id');
|
||||
if (($request->filled('update_real_loc')) && (($request->input('update_real_loc')) == '0')) {
|
||||
$this->update_array['rtd_location_id'] = $request->input('rtd_location_id');
|
||||
}
|
||||
if (($request->filled('update_real_loc')) && (($request->input('update_real_loc')) == '1')) {
|
||||
$this->update_array['location_id'] = $request->input('rtd_location_id');
|
||||
$this->update_array['rtd_location_id'] = $request->input('rtd_location_id');
|
||||
}
|
||||
if (($request->filled('update_real_loc')) && (($request->input('update_real_loc')) == '2')) {
|
||||
$this->update_array['location_id'] = $request->input('rtd_location_id');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -110,6 +110,7 @@ class CustomFieldsController extends Controller
|
|||
"display_in_user_view" => $display_in_user_view,
|
||||
"auto_add_to_fieldsets" => $request->get("auto_add_to_fieldsets", 0),
|
||||
"show_in_listview" => $request->get("show_in_listview", 0),
|
||||
"show_in_requestable_list" => $request->get("show_in_requestable_list", 0),
|
||||
"user_id" => Auth::id()
|
||||
]);
|
||||
|
||||
|
@ -267,6 +268,7 @@ class CustomFieldsController extends Controller
|
|||
$field->display_in_user_view = $display_in_user_view;
|
||||
$field->auto_add_to_fieldsets = $request->get("auto_add_to_fieldsets", 0);
|
||||
$field->show_in_listview = $request->get("show_in_listview", 0);
|
||||
$field->show_in_requestable_list = $request->get("show_in_requestable_list", 0);
|
||||
|
||||
if ($request->get('format') == 'CUSTOM REGEX') {
|
||||
$field->format = e($request->get('custom_format'));
|
||||
|
|
|
@ -7,7 +7,7 @@ use App\Models\Asset;
|
|||
use App\Models\Setting;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
||||
use Auth;
|
||||
|
||||
class AssetsTransformer
|
||||
{
|
||||
|
@ -231,6 +231,29 @@ class AssetsTransformer
|
|||
'assigned_to_self' => ($asset->assigned_to == \Auth::user()->id),
|
||||
];
|
||||
|
||||
if (($asset->model) && ($asset->model->fieldset) && ($asset->model->fieldset->fields->count() > 0)) {
|
||||
$fields_array = [];
|
||||
|
||||
foreach ($asset->model->fieldset->fields as $field) {
|
||||
|
||||
// Only display this if it's allowed via the custom field setting
|
||||
if (($field->field_encrypted=='0') && ($field->show_in_requestable_list=='1')) {
|
||||
|
||||
$value = $asset->{$field->db_column};
|
||||
if (($field->format == 'DATE') && (!is_null($value)) && ($value != '')) {
|
||||
$value = Helper::getFormattedDateObject($value, 'date', false);
|
||||
}
|
||||
|
||||
$fields_array[$field->db_column] = e($value);
|
||||
}
|
||||
|
||||
$array['custom_fields'] = $fields_array;
|
||||
}
|
||||
} else {
|
||||
$array['custom_fields'] = new \stdClass; // HACK to force generation of empty object instead of empty list
|
||||
}
|
||||
|
||||
|
||||
$permissions_array['available_actions'] = [
|
||||
'cancel' => ($asset->isRequestedBy(\Auth::user())) ? true : false,
|
||||
'request' => ($asset->isRequestedBy(\Auth::user())) ? false : true,
|
||||
|
|
|
@ -787,7 +787,6 @@ class Asset extends Depreciable
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the next autoincremented asset tag
|
||||
*
|
||||
|
|
|
@ -53,6 +53,12 @@ class CustomField extends Model
|
|||
'field_encrypted' => 'nullable|boolean',
|
||||
'auto_add_to_fieldsets' => 'boolean',
|
||||
'show_in_listview' => 'boolean',
|
||||
'show_in_requestable_list' => 'boolean',
|
||||
'show_in_email' => 'boolean',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'show_in_requestable_list' => 'boolean',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -72,7 +78,8 @@ class CustomField extends Model
|
|||
'display_in_user_view',
|
||||
'auto_add_to_fieldsets',
|
||||
'show_in_listview',
|
||||
|
||||
'show_in_email',
|
||||
'show_in_requestable_list',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -243,8 +250,6 @@ class CustomField extends Model
|
|||
/**
|
||||
* Gets the DB column name.
|
||||
*
|
||||
* @todo figure out if this is still needed? I don't know WTF it's for.
|
||||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @since [v3.0]
|
||||
* @return string
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddShowInRequestableToCustomFields extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('custom_fields', function (Blueprint $table) {
|
||||
$table->boolean('show_in_requestable_list')->after('show_in_email')->nullable()->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('custom_fields', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('custom_fields', 'show_in_requestable_list')) {
|
||||
$table->dropColumn('show_in_requestable_list');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@ services:
|
|||
ports:
|
||||
- "8000:80"
|
||||
volumes:
|
||||
- ./logs:/var/www/html/storage/logs
|
||||
- ./storage/logs:/var/www/html/storage/logs
|
||||
depends_on:
|
||||
- mariadb
|
||||
- redis
|
||||
|
|
|
@ -34,7 +34,8 @@ return [
|
|||
'create_field' => 'New Custom Field',
|
||||
'create_field_title' => 'Create a new custom field',
|
||||
'value_encrypted' => 'The value of this field is encrypted in the database. Only admin users will be able to view the decrypted value',
|
||||
'show_in_email' => 'Include the value of this field in checkout emails sent to the user? Encrypted fields cannot be included in emails.',
|
||||
'show_in_email' => 'Include the value of this field in checkout emails sent to the user? Encrypted fields cannot be included in emails',
|
||||
'show_in_email_short' => 'Include in emails.',
|
||||
'help_text' => 'Help Text',
|
||||
'help_text_description' => 'This is optional text that will appear below the form elements while editing an asset to provide context on the field.',
|
||||
'about_custom_fields_title' => 'About Custom Fields',
|
||||
|
@ -51,7 +52,10 @@ return [
|
|||
'display_in_user_view_table' => 'Visible to User',
|
||||
'auto_add_to_fieldsets' => 'Automatically add this to every new fieldset',
|
||||
'add_to_preexisting_fieldsets' => 'Add to any existing fieldsets',
|
||||
'show_in_listview' => 'Show in list views by default. Authorized users will still be able to show/hide via the column selector.',
|
||||
'show_in_listview' => 'Show in list views by default. Authorized users will still be able to show/hide via the column selector',
|
||||
'show_in_listview_short' => 'Show in lists',
|
||||
'show_in_requestable_list_short' => 'Show in requestable assets list',
|
||||
'show_in_requestable_list' => 'Show value in requestable assets list. Encrypted fields will not be shown',
|
||||
'encrypted_options' => 'This field is encrypted, so some display options will not be available.',
|
||||
|
||||
];
|
||||
|
|
|
@ -49,6 +49,7 @@ return [
|
|||
'asset_location' => 'Update Asset Location',
|
||||
'asset_location_update_default_current' => 'Update default location AND actual location',
|
||||
'asset_location_update_default' => 'Update only default location',
|
||||
'asset_location_update_actual' => 'Update only actual location',
|
||||
'asset_not_deployable' => 'That asset status is not deployable. This asset cannot be checked out.',
|
||||
'asset_deployable' => 'That status is deployable. This asset can be checked out.',
|
||||
'processing_spinner' => 'Processing... (This might take a bit of time on large files)',
|
||||
|
|
|
@ -30,5 +30,6 @@ return [
|
|||
'consumables' => 'Consumables are anything purchased that will be used up over time. For example, printer ink or copier paper.',
|
||||
|
||||
'depreciations' => 'You can set up asset depreciations to depreciate assets based on straight-line depreciation.',
|
||||
|
||||
|
||||
'empty_file' => 'The importer detects that this file is empty.'
|
||||
];
|
||||
|
|
|
@ -65,6 +65,12 @@
|
|||
<th class="col-md-2" data-field="location" data-sortable="true">{{ trans('admin/hardware/table.location') }}</th>
|
||||
<th class="col-md-2" data-field="status" data-sortable="true">{{ trans('admin/hardware/table.status') }}</th>
|
||||
<th class="col-md-2" data-field="expected_checkin" data-formatter="dateDisplayFormatter" data-sortable="true">{{ trans('admin/hardware/form.expected_checkin') }}</th>
|
||||
|
||||
@foreach(\App\Models\CustomField::get() as $field)
|
||||
@if (($field->field_encrypted=='0') && ($field->show_in_requestable_list=='1'))
|
||||
<th class="col-md-2" data-field="custom_fields.{{ $field->db_column }}" data-sortable="true">{{ $field->name }}</th>
|
||||
@endif
|
||||
@endforeach
|
||||
<th class="col-md-1" data-formatter="assetRequestActionsFormatter" data-field="actions" data-sortable="false">{{ trans('table.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
|
@ -32,13 +32,19 @@
|
|||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-1" data-field="image" data-formatter="imageFormatter">{{ trans('general.image') }}</th>
|
||||
<th class="col-md-2" data-field="name">{{ trans('general.item_name') }}</th>
|
||||
<th class="col-md-2" data-field="type">{{ trans('general.type') }}</th>
|
||||
<th class="col-md-2" data-field="qty">{{ trans('general.qty') }}</th>
|
||||
<th class="col-md-2" data-field="location">{{ trans('admin/hardware/table.location') }}</th>
|
||||
<th class="col-md-2" data-field="expected_checkin" data-formatter="dateDisplayFormatter"> {{ trans('admin/hardware/form.expected_checkin') }}</th>
|
||||
<th class="col-md-2" data-field="request_date" data-formatter="dateDisplayFormatter"> {{ trans('general.requested_date') }}</th>
|
||||
<th data-field="image" data-formatter="imageFormatter">{{ trans('general.image') }}</th>
|
||||
<th data-field="name">{{ trans('general.item_name') }}</th>
|
||||
<th data-field="type">{{ trans('general.type') }}</th>
|
||||
<th data-field="qty">{{ trans('general.qty') }}</th>
|
||||
<th data-field="location">{{ trans('admin/hardware/table.location') }}</th>
|
||||
<th data-field="expected_checkin" data-formatter="dateDisplayFormatter"> {{ trans('admin/hardware/form.expected_checkin') }}</th>
|
||||
<th data-field="request_date" data-formatter="dateDisplayFormatter"> {{ trans('general.requested_date') }}</th>
|
||||
|
||||
@foreach(\App\Models\CustomField::get() as $field)
|
||||
@if (($field->field_encrypted=='0') && ($field->show_in_requestable_list=='1'))
|
||||
<th data-field="custom_fields.{{ $field->db_column }}">{{ $field->name }}</th>
|
||||
@endif
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
}
|
||||
@endphp
|
||||
<div class="col-md-8 required">
|
||||
{{ Form::select("format",Helper::predefined_formats(), ($field_format == '') ? $field->format : $field_format, array('class'=>'format select2 form-control', 'aria-label'=>'format')) }}
|
||||
{{ Form::select("format",Helper::predefined_formats(), ($field_format == '') ? $field->format : $field_format, array('class'=>'format select2 form-control', 'aria-label'=>'format', 'style' => 'width:100%;')) }}
|
||||
{!! $errors->first('format', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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,45 +167,43 @@
|
|||
</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
|
||||
@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>
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<!-- Value Must be Unique -->
|
||||
<div class="col-md-9 col-md-offset-3" id="is_unique">
|
||||
<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') }}
|
||||
</label>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Show in View All Assets profile view -->
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<div class="col-md-9 col-md-offset-3" id="display_in_user_view">
|
||||
<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') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Value Must be Unique -->
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<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') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -287,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();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -145,12 +145,13 @@
|
|||
<th data-sortable="true"><i class="fa fa-lock" aria-hidden="true"></i>
|
||||
<span class="hidden-xs hidden-sm hidden-md hidden-lg">{{ trans('admin/custom_fields/general.encrypted') }}</span>
|
||||
</th>
|
||||
<th data-sortable="true"><i class="fa fa-list" aria-hidden="true"></i>
|
||||
<th data-sortable="true" class="text-center"><i class="fa fa-list" aria-hidden="true"></i>
|
||||
<span class="hidden-xs hidden-sm hidden-md hidden-lg">{{ trans('admin/custom_fields/general.show_in_listview_short') }}</span>
|
||||
</th>
|
||||
<th data-visible="false" data-sortable="true"><i class="fa fa-eye" aria-hidden="true"><span class="sr-only">Visible to User</span></i></th>
|
||||
<th data-sortable="true" data-searchable="true"><i class="fa fa-envelope" aria-hidden="true"><span class="sr-only">Show in Email</span></i></th>
|
||||
<th data-sortable="true" data-searchable="true">{{ trans('admin/custom_fields/general.field_element_short') }}</th>
|
||||
<th data-visible="false" data-sortable="true" class="text-center"><i class="fa fa-eye" aria-hidden="true"><span class="sr-only">Visible to User</span></i></th>
|
||||
<th data-sortable="true" data-searchable="true" class="text-center"><i class="fa fa-envelope" aria-hidden="true"><span class="sr-only">{{ trans('admin/custom_fields/general.show_in_email_short') }}</span></i></th>
|
||||
<th data-sortable="true" data-searchable="true" class="text-center"><i class="fa fa-laptop fa-fw" aria-hidden="true"><span class="sr-only">{{ trans('admin/custom_fields/general.show_in_requestable_list_short') }}</span></i></th>
|
||||
<th data-sortable="true" data-searchable="true" class="text-center">{{ trans('admin/custom_fields/general.field_element_short') }}</th>
|
||||
<th data-searchable="true">{{ trans('admin/custom_fields/general.fieldsets') }}</th>
|
||||
<th>{{ trans('button.actions') }}</th>
|
||||
</tr>
|
||||
|
@ -161,7 +162,7 @@
|
|||
<td>{{ $field->name }}</td>
|
||||
<td>{{ $field->help_text }}</td>
|
||||
|
||||
<td class='text-center'>{!! ($field->is_unique=='1') ? '<i class="fas fa-check text-success" aria-hidden="true"><span class="sr-only">'.trans('general.yes').'</span></i>' : '<i class="fas fa-times text-danger" aria-hidden="true"><span class="sr-only">'.trans('general.no').'</span></i>' !!}</td>
|
||||
<td class="text-center">{!! ($field->is_unique=='1') ? '<i class="fas fa-check text-success" aria-hidden="true"><span class="sr-only">'.trans('general.yes').'</span></i>' : '<i class="fas fa-times text-danger" aria-hidden="true"><span class="sr-only">'.trans('general.no').'</span></i>' !!}</td>
|
||||
<td>
|
||||
<code>{{ $field->convertUnicodeDbSlug() }}</code>
|
||||
@if ($field->convertUnicodeDbSlug()!=$field->db_column)
|
||||
|
@ -170,10 +171,11 @@
|
|||
@endif
|
||||
</td>
|
||||
<td>{{ $field->format }}</td>
|
||||
<td>{!! ($field->field_encrypted=='1' ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-times text-danger"></i>') !!}</td>
|
||||
<td>{!! ($field->show_in_listview=='1' ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-times text-danger"></i>') !!}</td>
|
||||
<td>{!! ($field->display_in_user_view=='1' ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-times text-danger"></i>') !!}</td>
|
||||
<td class='text-center'>{!! ($field->show_in_email=='1') ? '<i class="fas fa-check text-success" aria-hidden="true"><span class="sr-only">'.trans('general.yes').'</span></i>' : '<i class="fas fa-times text-danger" aria-hidden="true"><span class="sr-only">'.trans('general.no').'</span></i>' !!}</td>
|
||||
<td class="text-center">{!! ($field->field_encrypted=='1' ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-times text-danger"></i>') !!}</td>
|
||||
<td class="text-center">{!! ($field->show_in_listview=='1' ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-times text-danger"></i>') !!}</td>
|
||||
<td class="text-center">{!! ($field->display_in_user_view=='1' ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-times text-danger"></i>') !!}</td>
|
||||
<td class="text-center">{!! ($field->show_in_email=='1') ? '<i class="fas fa-check text-success" aria-hidden="true"><span class="sr-only">'.trans('general.yes').'</span></i>' : '<i class="fas fa-times text-danger" aria-hidden="true"><span class="sr-only">'.trans('general.no').'</span></i>' !!}</td>
|
||||
<td class="text-center">{!! ($field->show_in_requestable_list=='1') ? '<i class="fas fa-check text-success" aria-hidden="true"><span class="sr-only">'.trans('general.yes').'</span></i>' : '<i class="fas fa-times text-danger" aria-hidden="true"><span class="sr-only">'.trans('general.no').'</span></i>' !!}</td>
|
||||
<td>{{ $field->element }}</td>
|
||||
<td>
|
||||
@foreach($field->fieldset as $fieldset)
|
||||
|
|
|
@ -92,9 +92,13 @@
|
|||
{{ Form::radio('update_real_loc', '1', old('update_real_loc'), ['checked'=> 'checked', 'aria-label'=>'update_real_loc']) }}
|
||||
{{ trans('admin/hardware/form.asset_location_update_default_current') }}
|
||||
</label>
|
||||
<label class="form-control">
|
||||
{{ Form::radio('update_real_loc', '0', old('update_real_loc'), ['aria-label'=>'update_default_loc']) }}
|
||||
{{ trans('admin/hardware/form.asset_location_update_default') }}
|
||||
</label>
|
||||
<label class="form-control">
|
||||
{{ Form::radio('update_real_loc', '0', old('update_real_loc'), ['aria-label'=>'update_default_loc']) }}
|
||||
{{ trans('admin/hardware/form.asset_location_update_default') }}
|
||||
{{ Form::radio('update_real_loc', '2', old('update_real_loc'), ['aria-label'=>'update_default_loc']) }}
|
||||
{{ trans('admin/hardware/form.asset_location_update_actual') }}
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -235,9 +235,16 @@
|
|||
])
|
||||
}}
|
||||
</div>
|
||||
@if ($activeFile->first_row)
|
||||
<div class="col-md-5">
|
||||
<p class="form-control-static">{{ str_limit($activeFile->first_row[$index], 50, '...') }}</p>
|
||||
</div>
|
||||
@else
|
||||
@php
|
||||
$statusText = trans('help.empty_file');
|
||||
$statusType = 'info';
|
||||
@endphp
|
||||
@endif
|
||||
</div><!-- /div row -->
|
||||
@endforeach
|
||||
@else
|
||||
|
|
Loading…
Reference in a new issue