Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2022-07-02 13:08:59 -07:00
commit 1ef20ec622
4 changed files with 12 additions and 55 deletions

View file

@ -282,8 +282,7 @@
if ((row.available_actions) && (row.available_actions.restore === true)) {
actions += '<form style="display: inline;" method="POST" action="{{ url('/') }}/' + dest + '/' + row.id + '/restore"> ';
actions += '@csrf';
actions += '<a href="{{ url('/') }}/' + dest + '/' + row.id + '/restore" class="btn btn-sm btn-warning" data-toggle="tooltip" title="{{ trans('general.restore') }}"><i class="far fa-clone"></i></a>&nbsp;';
actions += '<i class="fa fa-retweet" aria-hidden="true"></i><span class="sr-only">{{ trans('general.restore') }}</span></button></form>&nbsp;';
actions += '<button class="btn btn-sm btn-warning" data-toggle="tooltip" title="{{ trans('general.restore') }}"><i class="far fa-retweet"></i></button>&nbsp;';
}
actions +='</nobr>';
@ -780,4 +779,4 @@
</script>
@endpush
@endpush

View file

@ -141,11 +141,6 @@
<div class="callout callout-warning">
<i class="icon fas fa-exclamation-triangle"></i>
{{ trans('admin/users/message.user_deleted_warning') }}
@can('update', $user)
<a href="{{ route('restore/user', $user->id) }}">
{{ trans('admin/users/general.restore_user') }}
</a>
@endcan
</div>
</div>
@endif
@ -229,7 +224,10 @@
</div>
@else
<div class="col-md-12" style="padding-top: 5px;">
<a href="{{ route('restore/user', $user->id) }}" style="width: 100%;" class="btn btn-sm btn-warning hidden-print">{{ trans('button.restore') }}</a>
<form method="POST" action="{{ route('restore/user', $user->id) }}">
@csrf
<button style="width: 100%;" class="btn btn-sm btn-warning hidden-print">{{ trans('button.restore') }}</button>
</form>
</div>
@endif
@endcan
@ -1037,4 +1035,4 @@ $(function () {
</script>
@stop
@stop

View file

@ -134,7 +134,7 @@ Route::group(
[AssetsController::class, 'getBarCode']
)->name('barcode/hardware');
Route::get('{assetId}/restore',
Route::post('{assetId}/restore',
[AssetsController::class, 'getRestore']
)->name('restore/hardware');
@ -181,4 +181,4 @@ Route::resource('hardware',
'middleware' => ['auth'],
'parameters' => ['asset' => 'asset_id'
],
]);
]);

View file

@ -4,47 +4,7 @@ use App\Http\Controllers\Users;
use App\Http\Controllers\Users\UserFilesController;
use Illuminate\Support\Facades\Route;
// User Management
Route::post(
'{userId}/clone',
[
Users\UsersController::class,
'postCreate'
]
);
Route::post(
'{userId}/restore',
[
Users\UsersController::class,
'getRestore'
]
)->name('restore/user');
Route::get(
'{userId}/unsuspend',
[
Users\UsersController::class,
'getUnsuspend'
]
)->name('unsuspend/user');
Route::post(
'{userId}/upload',
[
Users\UserFilesController::class,
'store'
]
)->name('upload/user');
Route::delete(
'{userId}/deletefile/{fileId}',
[
Users\UserFilesController::class,
'destroy'
]
)->name('userfile.destroy');
// User Management
Route::group(['prefix' => 'users', 'middleware' => ['auth']], function () {
@ -88,7 +48,7 @@ Route::group(['prefix' => 'users', 'middleware' => ['auth']], function () {
]
)->name('clone/user');
Route::get(
Route::post(
'{userId}/restore',
[
Users\UsersController::class,
@ -183,4 +143,4 @@ Route::group(['prefix' => 'users', 'middleware' => ['auth']], function () {
Route::resource('users', Users\UsersController::class, [
'middleware' => ['auth'],
'parameters' => ['user' => 'user_id'],
]);
]);