A free open source IT asset/license management system
remove getbarcodes, postbarcodes, barcodes settings blade
Godfrey Mfa5651f33595
diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.phpindex 3000ec7f14..56da1d19b9 100755--- a/app/Http/Controllers/SettingsController.php+++ b/app/Http/Controllers/SettingsController.php@@ -702,44 +702,6 @@ class SettingsController extends Controllerreturn redirect()->back()->withInput()->withErrors($setting->getErrors());}- /**- * Return a form to allow a super admin to update settings.- *- * @author [A. Gianotto] [<[email protected]>]- *- * @since [v1.0]- */- public function getBarcodes() : View- {- $setting = Setting::getSettings();- $is_gd_installed = extension_loaded('gd');-- return view('settings.barcodes', compact('setting'))->with('is_gd_installed', $is_gd_installed);- }-- /**- * Saves settings from form.- *- * @author [A. Gianotto] [<[email protected]>]- *- * @since [v1.0]- */- public function postBarcodes(Request $request) : RedirectResponse- {- if (is_null($setting = Setting::getSettings())) {- return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error'));- }---- if ($setting->save()) {- return redirect()->route('settings.index')- ->with('success', trans('admin/settings/message.update.success'));- }-- return redirect()->back()->withInput()->withErrors($setting->getErrors());- }-/*** Return a form to allow a super admin to update settings.*@@ -813,8 +775,6 @@ class SettingsController extends Controller//QR-Code$setting->qr_text = $request->input('qr_text');--if ($request->filled('labels_display_name')) {$setting->labels_display_name = 1;} else {diff --git a/resources/views/settings/barcodes.blade.php b/resources/views/settings/barcodes.blade.phpdeleted file mode 100644index 970f1d4f99..0000000000--- a/resources/views/settings/barcodes.blade.php+++ /dev/null@@ -1,213 +0,0 @@-@extends('layouts/default')--{{-- Page title --}}-@section('title')- {{ trans('admin/settings/general.barcode_title') }}- @parent-@stop--@section('header_right')- <a href="{{ route('settings.index') }}" class="btn btn-primary"> {{ trans('general.back') }}</a>-@stop---{{-- Page content --}}-@section('content')-- <style>- .checkbox label {- padding-right: 40px;- }- </style>--- {{ Form::open(['method' => 'POST', 'files' => false, 'autocomplete' => 'off', 'class' => 'form-horizontal', 'role' => 'form' ]) }}- <!-- CSRF Token -->- {{csrf_field()}}-- <div class="row">- <div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2">--- <div class="panel box box-default">- <div class="box-header with-border">- <h2 class="box-title">- <x-icon type="assets"/>- {{ trans('admin/settings/general.barcodes') }}- </h2>- </div>- <div class="box-body">--- <div class="col-md-11 col-md-offset-1">-- @if ($is_gd_installed)- <!-- qr code -->- <div class="form-group">- <div class="col-md-9 col-md-offset-3">- <label class="form-control">- {{ Form::checkbox('qr_code', '1', old('qr_code', $setting->qr_code),array('aria-label'=>'qr_code')) }}- {{ trans('admin/settings/general.display_qr') }}- </label>- </div>- </div>-- <!-- square barcode type -->- <div class="form-group{{ $errors->has('barcode_type') ? ' has-error' : '' }}">- <div class="col-md-3">- {{ Form::label('barcode_type', trans('admin/settings/general.barcode_type')) }}- </div>- <div class="col-md-9">- {!! Form::barcode_types('barcode_type', old('barcode_type', $setting->barcode_type), 'select2 col-md-4') !!}- {!! $errors->first('barcode_type', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}- </div>- </div>-- <!-- barcode -->- <div class="form-group">-- <div class="col-md-9 col-md-offset-3">- <label class="form-control">- {{ Form::checkbox('alt_barcode_enabled', '1', old('alt_barcode_enabled', $setting->alt_barcode_enabled),array( 'aria-label'=>'alt_barcode_enabled')) }}- {{ trans('admin/settings/general.display_alt_barcode') }}- </label>- </div>- </div>-- <!-- barcode type -->- <div class="form-group{{ $errors->has('alt_barcode') ? ' has-error' : '' }}">- <div class="col-md-3">- {{ Form::label('alt_barcode', trans('admin/settings/general.alt_barcode_type')) }}- </div>- <div class="col-md-9">- {!! Form::alt_barcode_types('alt_barcode', old('alt_barcode', $setting->alt_barcode), 'select2 col-md-4') !!}- {!! $errors->first('barcode_type', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}- </div>- </div>- @else- <span class="help-block col-md-offset-3 col-md-12">- {{ trans('admin/settings/general.php_gd_warning') }}- <br>- {{ trans('admin/settings/general.php_gd_info') }}- </span>- @endif-- <!-- qr text -->- <div class="form-group {{ $errors->has('qr_text') ? 'error' : '' }}">- <div class="col-md-3">- {{ Form::label('qr_text', trans('admin/settings/general.qr_text')) }}- </div>- <div class="col-md-9">- @if ($setting->qr_code == 1)- {{ Form::text('qr_text', old('qr_text', $setting->qr_text), array('class' => 'form-control','placeholder' => 'Property of Your Company',- 'rel' => 'txtTooltip',- 'title' =>'Extra text that you would like to display on your labels. ',- 'data-toggle' =>'tooltip',- 'data-placement'=>'top')) }}- {!! $errors->first('qr_text', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}- @else- {{ Form::text('qr_text', old('qr_text', $setting->qr_text), array('class' => 'form-control', 'disabled'=>'disabled','placeholder' => 'Property of Your Company')) }}- <p class="help-block">{{ trans('admin/settings/general.qr_help') }}</p>- @endif- </div>- </div>-- <!-- Nuke barcode cache -->- <div class="form-group">- <div class="col-md-3">- {{ Form::label('purge_barcodes', 'Purge Barcodes') }}- </div>- <div class="col-md-9" id="purgebarcodesrow">- <a class="btn btn-default btn-sm pull-left" id="purgebarcodes" style="margin-right: 10px;">- {{ trans('admin/settings/general.barcode_delete_cache') }}</a>- <span id="purgebarcodesicon"></span>- <span id="purgebarcodesresult"></span>- <span id="purgebarcodesstatus"></span>- </div>- <div class="col-md-9 col-md-offset-3">- <div id="purgebarcodesstatus-error" class="text-danger"></div>- </div>- <div class="col-md-9 col-md-offset-3">- <p class="help-block">{{ trans('admin/settings/general.barcodes_help') }}</p>- </div>-- </div>--- </div>-- </div> <!--/.box-body-->- <div class="box-footer">- <div class="text-left col-md-6">- <a class="btn btn-link text-left" href="{{ route('settings.index') }}">{{ trans('button.cancel') }}</a>- </div>- <div class="text-right col-md-6">- <button type="submit" class="btn btn-success"><x-icon type="checkmark" /> {{ trans('general.save') }}</button>- </div>-- </div>- </div> <!-- /box -->- </div> <!-- /.col-md-8-->- </div> <!-- /.row-->-- {{Form::close()}}--@stop--@push('js')-- <script nonce="{{ csrf_token() }}">- // Delete barcodes- $("#purgebarcodes").click(function(){- $("#purgebarcodesrow").removeClass('text-success');- $("#purgebarcodesrow").removeClass('text-danger');- $("#purgebarcodesicon").html('');- $("#purgebarcodesstatus").html('');- $('#purgebarcodesstatus-error').html('');- $("#purgebarcodesicon").html('<i class="fas fa-spinner spin"></i> {{ trans('admin/settings/general.barcodes_spinner') }}');- $.ajax({- url: '{{ route('api.settings.purgebarcodes') }}',- type: 'POST',- headers: {- "X-Requested-With": 'XMLHttpRequest',- "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')- },- data: {},- dataType: 'json',-- success: function (data) {- console.dir(data);- $("#purgebarcodesicon").html('');- $("#purgebarcodesstatus").html('');- $('#purgebarcodesstatus-error').html('');- $("#purgebarcodesstatus").removeClass('text-danger');- $("#purgebarcodesstatus").addClass('text-success');- if (data.message) {- $("#purgebarcodesstatus").html('<i class="fas fa-check text-success"></i> ' + data.message);- }- },-- error: function (data) {-- $("#purgebarcodesicon").html('');- $("#purgebarcodesstatus").html('');- $('#purgebarcodesstatus-error').html('');- $("#purgebarcodesstatus").removeClass('text-success');- $("#purgebarcodesstatus").addClass('text-danger');- $("#purgebarcodesicon").html('<i class="fas fa-exclamation-triangle text-danger"></i>');- $('#purgebarcodesstatus').html('Files could not be deleted.');- if (data.responseJSON) {- $('#purgebarcodesstatus-error').html('Error: ' + data.responseJSON.messages);- } else {- console.dir(data);- }-- }--- });- });-- </script>--@endpushdiff --git a/resources/views/settings/index.blade.php b/resources/views/settings/index.blade.phpindex 8834b21d90..bf22638adf 100755--- a/resources/views/settings/index.blade.php+++ b/resources/views/settings/index.blade.php@@ -187,22 +187,6 @@</div></div>- <div class="col-md-4 col-lg-3 col-sm-6 col-xl-1">- <div class="admin box box-default">- <div class="box-body text-center">- <h5>- <a href="{{ route('settings.barcodes.index') }}" class="settings_button">- <x-icon type="assets" class="fa-4x"/>- <br><br>- <span class="name">{{ trans('admin/settings/general.barcodes') }}</span>- </a>- </h5>- <p class="help-block">{!! trans('admin/settings/general.barcodes_help_overview') !!}</p>- </div>- </div>- </div>--<div class="col-md-4 col-lg-3 col-sm-6 col-xl-1"><div class="admin box box-default"><div class="box-body text-center">diff --git a/routes/web.php b/routes/web.phpindex a05b7aba63..c7fecb86a0 100644--- a/routes/web.php+++ b/routes/web.php@@ -201,10 +201,7 @@ Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'authorize:superuserRoute::get('asset_tags', [SettingsController::class, 'getAssetTags'])->name('settings.asset_tags.index');Route::post('asset_tags', [SettingsController::class, 'postAssetTags'])->name('settings.asset_tags.save');- Route::get('barcodes', [SettingsController::class, 'getBarcodes'])->name('settings.barcodes.index');- Route::post('barcodes', [SettingsController::class, 'postBarcodes'])->name('settings.barcodes.save');-- Route::get('labels', [SettingsController::class, 'getLabels', 'getBarcodes'])->name('settings.labels.index');+ Route::get('labels', [SettingsController::class, 'getLabels'])->name('settings.labels.index');Route::post('labels', [SettingsController::class, 'postLabels'])->name('settings.labels.save');Route::get('ldap', [SettingsController::class, 'getLdapSettings'])->name('settings.ldap.index');