Skip to content

A free open source IT asset/license management system

Removed old history importer from blades

snipe5a643f254690
diff --git a/resources/views/blade/input/select.blade.php b/resources/views/blade/input/select.blade.php
index 9ddbbd6d7c..74a4f6e90a 100644
--- a/resources/views/blade/input/select.blade.php
+++ b/resources/views/blade/input/select.blade.php
@@ -5,10 +5,12 @@
'selected' => null,
'includeEmpty' => false,
'forLivewire' => false,
+ 'required' => false,
])
<select
{{ $attributes->class(['select2', 'livewire-select2' => $forLivewire]) }}
+ @required($required)
@if($forLivewire) data-livewire-component="{{ $this->getId() }}" @endif
>
@if($includeEmpty)
diff --git a/resources/views/hardware/history.blade.php b/resources/views/hardware/history.blade.php
deleted file mode 100644
index 628fea31e1..0000000000
--- a/resources/views/hardware/history.blade.php
+++ /dev/null
@@ -1,226 +0,0 @@
-@extends('layouts/default')
-
-{{-- Page title --}}
-@section('title')
- {{ trans('general.import-history') }}
- @parent
-@stop
-
-
-{{-- Page content --}}
-@section('content')
-
-
- @if (isset($status))
-
- @if (count($status['error']) > 0)
- <div class="row">
- <div class="col-md-8 col-md-offset-2">
- <div class="box box-default">
- <x-alert type="danger" icon="warning">
- <strong>{{ count($status['error']) }} {{ trans('admin/hardware/general.error_messages') }}</strong>
- {{ trans('admin/hardware/general.alert_details') }}
- </x-alert>
- </div>
- </div>
- </div>
- @endif
-
- <div class="row">
- <div class="col-md-8 col-md-offset-2">
- <div class="box box-default">
- <x-alert type="success" icon="checkmark">
- <strong>{{ count($status['success']) }} {{ trans('admin/hardware/general.success_messages') }} </strong>
- {{ trans('admin/hardware/general.alert_details') }}
- </x-alert>
- </div>
- </div>
- </div>
-
- @endif
-
- <div class="row">
- <div class="col-md-8 col-md-offset-2">
- <div class="box box-default">
- <div class="box-body">
- <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" action="">
- <!-- CSRF Token -->
- <input type="hidden" name="_token" value="{{ csrf_token() }}" />
-
- <div class="col-md-12">
- @if (Session::get('message'))
- <p class="alert-danger">
- {{ trans('admin/hardware/general.csv_error') }}<br />
- {{ Session::get('message') }}
- </p>
- @endif
- </div>
- <div class="col-md-12" style="padding: 10px;">
- {!! trans('admin/hardware/general.import_text') !!}
- </div>
-
- <div class="col-md-12" style="padding: 10px;">
- <div class="form-group">
- <div class="col-md-9 col-md-offset-2">
-
- <label class="btn btn-theme" aria-hidden="true">
- {{ trans('button.select_file') }}
- <input type="file" name="user_import_csv" class="js-uploadFile" id="uploadFile" data-maxsize="user_import_csv" accept=".csv,.xls,.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,text/plain" style="display:none; max-width: 90%" aria-label="user_import_csv" aria-hidden="true"{{ (config('app.lock_passwords')===true) ? ' disabled' : ''}}>
- </label>
- <span class="label label-default" id="uploadFile-info" style="font-size: 15px;"></span>
-
- @if (config('app.lock_passwords')===true)
- <p class="text-warning"><i class="fas fa-lock"></i>
- {{ trans('general.feature_disabled') }}</p>
- @endif
- </div>
- </div>
- </div>
-
- <div class="col-md-12">
- <!-- Match firstname.lastname -->
- <div class="form-group">
- <div class="col-sm-10 col-md-offset-2">
- <label class="form-control">
- <input type="checkbox" name="match_firstnamelastname" value="1" @checked(old('match_firstnamelastname'))>
- <!-- enclosing span needed for the checkbox CSS to work properly, since there's HTML in the label text -->
- <span>
- {!! trans('admin/hardware/general.csv_import_match_f-l') !!}
- </span>
- </label>
- </div>
- </div>
-
- <!-- Match flastname -->
- <div class="form-group">
- <div class="col-sm-10 col-md-offset-2">
- <label class="form-control">
- <input type="checkbox" name="match_flastname" value="1" @checked(old('match_flastname'))>
- <!-- enclosing span needed for the checkbox CSS to work properly, since there's HTML in the label text -->
- <span>
- {!! trans('admin/hardware/general.csv_import_match_initial_last') !!}
- </span>
- </label>
- </div>
- </div>
-
- <!-- Match firstname -->
- <div class="form-group">
- <div class="col-sm-10 col-md-offset-2">
- <label class="form-control">
- <input type="checkbox" name="match_firstname" value="1" @checked(old('match_firstname'))>
- <!-- enclosing span needed for the checkbox CSS to work properly, since there's HTML in the label text -->
- <span>
- {!! trans('admin/hardware/general.csv_import_match_first') !!}
- </span>
- </label>
- </div>
- </div>
-
- <!-- Match email -->
- <div class="form-group">
- <div class="col-sm-10 col-md-offset-2">
- <label class="form-control">
- <input type="checkbox" name="match_email" value="1" @checked(old('match_email'))>
- <!-- enclosing span needed for the checkbox CSS to work properly, since there's HTML in the label text -->
- <span>
- {!! trans('admin/hardware/general.csv_import_match_email') !!}
- </span>
- </label>
- </div>
- </div>
-
- <!-- Match username -->
- <div class="form-group">
- <div class="col-sm-10 col-md-offset-2">
- <label class="form-control">
- <input type="checkbox" name="match_username" value="1" @checked(old('match_username'))>
- <!-- enclosing span needed for the checkbox CSS to work properly, since there's HTML in the label text -->
- <span>
- {!! trans('admin/hardware/general.csv_import_match_username') !!}
- </span>
- </label>
- </div>
- </div>
-
-
- <!-- Form Actions -->
- <div class="box-footer text-right">
- @if (config('app.lock_passwords')===true)
- <div class="col-md-12">
- <x-callout type="info" role="status">
- {{ trans('general.feature_disabled') }}
- </x-callout>
- </div>
-
- @else
- <button type="submit" class="btn btn-default">{{ trans('button.submit') }}</button>
- @endif
- </div>
-
- </form>
-
- </div>
-
-@if (isset($status))
-
-
-@if (count($status['error']) > 0)
-<div class="row">
- <div class="col-md-12">
- <div class="box box-default">
- <div class="box-header with-border">
- <h2 class="box-title"> {{ count($status['error']) }} {{ trans('admin/hardware/general.error_messages') }} </h2>
- </div>
- <div class="box-body">
- <div style="height : 400px; overflow : auto;">
- <table class="table">
- @for ($x = 0; $x < count($status['error']); $x++)
- @foreach($status['error'][$x] as $object_type => $message)
- <tr class="danger">
- <td><strong>{{ ucwords($object_type) }} {{ key($message) }}:</strong></td>
- <td>{{ $message[key($message)]['msg'] }}</td>
- </tr>
- @endforeach
- @endfor
- </table>
- </div>
- </div>
- </div>
- </div>
-</div>
-
-@endif
-
-@if (count($status['success']) > 0)
-<div class="row">
- <div class="col-md-12">
- <div class="box box-default">
- <div class="box-header with-border">
- <h2 class="box-title"> {{ count($status['success']) }} {{ trans('admin/hardware/general.success_messages') }} </h2>
- </div>
- <div class="box-body">
- <div style="height : 400px; overflow : auto;">
- <table class="table">
- @for ($x = 0; $x < count($status['success']); $x++)
- @foreach($status['success'][$x] as $object_type => $message)
- <tr class="success">
- <td><strong>{{ ucwords($object_type) }} {{ key($message) }}:</strong></td>
- <td>{{ $message[key($message)]['msg'] }}</td>
- </tr>
- @endforeach
- @endfor
- </table>
- </div>
- </div>
- </div>
- </div>
-</div>
-@endif
-@endif
-
-</div>
- </div>
- </div>
-
-@stop
diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php
index 074c57d569..59d0d60166 100644
--- a/resources/views/layouts/default.blade.php
+++ b/resources/views/layouts/default.blade.php
@@ -1774,14 +1774,6 @@
</li>
@endcan
- @can('admin')
- <li id="import-history-sidenav-option" {!! (request()->is('hardware/history') ? ' class="active" aria-current="page"' : '') !!}>
- <a href="{{ url('hardware/history') }}">
- {{ trans('general.import-history') }}
- </a>
- </li>
- @endcan
-
</ul>
</li>
@endcan
diff --git a/routes/web/hardware.php b/routes/web/hardware.php
index eb63007da5..a374b8a172 100644
--- a/routes/web/hardware.php
+++ b/routes/web/hardware.php
@@ -29,7 +29,7 @@ Route::group(
Route::get('bulkaudit', [AssetsController::class, 'quickScan'])
->name('assets.bulkaudit')
->breadcrumbs(fn (Trail $trail) => $trail->parent('hardware.index')
- ->push(trans('general.bulkaudit'), route('asset.import-history'))
+ ->push(trans('general.bulkaudit'), route('assets.bulkaudit'))
);
Route::get('quickscancheckin', [AssetsController::class, 'quickScanCheckin'])
@@ -71,15 +71,12 @@ Route::group(
[AssetCheckinController::class, 'forceCheckin']
)->name('asset.checkin.force');
- Route::get('history', [AssetsController::class, 'getImportHistory'])
- ->name('asset.import-history')
- ->breadcrumbs(fn (Trail $trail) => $trail->parent('hardware.index')
- ->push(trans('general.import-history'), route('asset.import-history'))
- );
-
- Route::post('history',
- [AssetsController::class, 'postImportHistory']
- )->name('asset.process-import-history');
+ // Legacy import-history endpoint. The dedicated `/hardware/history`
+ // controller + form was folded into the main Livewire importer
+ // (import type "assetHistory"). Keep the route name so any external
+ // bookmark or deep-link still lands somewhere sane.
+ Route::get('history', fn () => redirect()->route('imports.index'))
+ ->name('asset.import-history');
Route::get('bytag/{any?}',
[AssetsController::class, 'getAssetByTag']