From 43d92bec5b05fff621fe2ebe625cf9585f5211a1 Mon Sep 17 00:00:00 2001 From: Dampfklon Date: Tue, 13 Jul 2021 21:36:58 +0200 Subject: [PATCH 1/3] apply translation to view rearrange eula on top small design fixes --- .../views/account/accept/create.blade.php | 71 ++++++++----------- 1 file changed, 31 insertions(+), 40 deletions(-) diff --git a/resources/views/account/accept/create.blade.php b/resources/views/account/accept/create.blade.php index defba995b0..7fd2da23cc 100644 --- a/resources/views/account/accept/create.blade.php +++ b/resources/views/account/accept/create.blade.php @@ -2,7 +2,7 @@ {{-- Page title --}} @section('title') - {{ trans('general.accept', array('asset' => $acceptance->checkoutable->present()->name())) }} + {{trans('general.accept', ['asset' => $acceptance->checkoutable->present()->name()])}} @parent @stop @@ -22,7 +22,7 @@ #eula_div { width: 100%; height: auto; - overflow: scroll; + overflow: auto; } .m-signature-pad--body { @@ -43,51 +43,42 @@
-
-
- + @if ($acceptance->checkoutable->getEula()) +
+ {!! $acceptance->checkoutable->getEula() !!}
+ @endif -
- +

{{$acceptance->checkoutable->present()->name()}}

+
+ +
+
+ +
+ + @if ($snipeSettings->require_accept_signature=='1') +

{{trans('general.sign_tos')}}

+
+
+ +
- - @if ($acceptance->checkoutable->getEula()) -
-
- {!! $acceptance->checkoutable->getEula() !!} -
+
+
- @endif - - @if ($snipeSettings->require_accept_signature=='1') -
- -

{{ trans('general.sign_tos') }}

- -
-
- - -
-
- -
-
-
- @endif - -
+
+ @endif
From 0d49fc3a2e7801e3fa509dd3c9ef4b642a151c62 Mon Sep 17 00:00:00 2001 From: Dampfklon Date: Tue, 13 Jul 2021 21:38:58 +0200 Subject: [PATCH 2/3] remove unused route, controller functions and view --- app/Http/Controllers/ViewAssetsController.php | 119 --------------- .../views/account/accept-asset.blade.php | 135 ------------------ routes/web.php | 6 - 3 files changed, 260 deletions(-) delete mode 100644 resources/views/account/accept-asset.blade.php diff --git a/app/Http/Controllers/ViewAssetsController.php b/app/Http/Controllers/ViewAssetsController.php index e6da196038..29d039a207 100755 --- a/app/Http/Controllers/ViewAssetsController.php +++ b/app/Http/Controllers/ViewAssetsController.php @@ -180,123 +180,4 @@ class ViewAssetsController extends Controller { return view('account/requested'); } - - // Get the acceptance screen - public function getAcceptAsset($logID = null) - { - $findlog = Actionlog::where('id', $logID)->first(); - - if (! $findlog) { - return redirect()->to('account/view-assets')->with('error', 'No matching record.'); - } - - if ($findlog->accepted_id != '') { - return redirect()->to('account/view-assets')->with('error', trans('admin/users/message.error.asset_already_accepted')); - } - - $user = Auth::user(); - - // TODO - Fix this for non-assets - if (($findlog->item_type == Asset::class) && ($user->id != $findlog->item->assigned_to)) { - return redirect()->to('account/view-assets')->with('error', trans('admin/users/message.error.incorrect_user_accepted')); - } - - $item = $findlog->item; - - // Check if the asset exists - if (is_null($item)) { - // Redirect to the asset management page - return redirect()->to('account')->with('error', trans('admin/hardware/message.does_not_exist')); - } elseif (! Company::isCurrentUserHasAccess($item)) { - return redirect()->route('requestable-assets')->with('error', trans('general.insufficient_permissions')); - } else { - return view('account/accept-asset', compact('item'))->with('findlog', $findlog)->with('item', $item); - } - } - - // Save the acceptance - public function postAcceptAsset(Request $request, $logID = null) - { - - // Check if the asset exists - if (is_null($findlog = Actionlog::where('id', $logID)->first())) { - // Redirect to the asset management page - return redirect()->to('account/view-assets')->with('error', trans('admin/hardware/message.does_not_exist')); - } - - if ($findlog->accepted_id != '') { - // Redirect to the asset management page - return redirect()->to('account/view-assets')->with('error', trans('admin/users/message.error.asset_already_accepted')); - } - - if ($request->missing('asset_acceptance')) { - return redirect()->back()->with('error', trans('admin/users/message.error.accept_or_decline')); - } - - $user = Auth::user(); - - if (($findlog->item_type == Asset::class) && ($user->id != $findlog->item->assigned_to)) { - return redirect()->to('account/view-assets')->with('error', trans('admin/users/message.error.incorrect_user_accepted')); - } - - if ($request->filled('signature_output')) { - $path = config('app.private_uploads').'/signatures'; - $sig_filename = 'siglog-'.$findlog->id.'-'.date('Y-m-d-his').'.png'; - $data_uri = e($request->get('signature_output')); - $encoded_image = explode(',', $data_uri); - $decoded_image = base64_decode($encoded_image[1]); - - Storage::putFileAs($path, $decoded_image, $sig_filename); - //file_put_contents($path.'/'.$sig_filename, $decoded_image); - } - - $logaction = new Actionlog(); - - if ($request->input('asset_acceptance') == 'accepted') { - $logaction_msg = 'accepted'; - $accepted = 'accepted'; - $return_msg = trans('admin/users/message.accepted'); - } else { - $logaction_msg = 'declined'; - $accepted = 'rejected'; - $return_msg = trans('admin/users/message.declined'); - } - $logaction->item_id = $findlog->item_id; - $logaction->item_type = $findlog->item_type; - - // Asset - if (($findlog->item_id != '') && ($findlog->item_type == Asset::class)) { - if ($request->input('asset_acceptance') != 'accepted') { - DB::table('assets') - ->where('id', $findlog->item_id) - ->update(['assigned_to' => null]); - } - } - - $logaction->target_id = $findlog->target_id; - $logaction->target_type = User::class; - $logaction->note = e($request->input('note')); - $logaction->updated_at = date('Y-m-d H:i:s'); - - if (isset($sig_filename)) { - $logaction->accept_signature = $sig_filename; - } - $log = $logaction->logaction($logaction_msg); - - $update_checkout = DB::table('action_logs') - ->where('id', $findlog->id) - ->update(['accepted_id' => $logaction->id]); - - if (($findlog->item_id != '') && ($findlog->item_type == Asset::class)) { - $affected_asset = $logaction->item; - $affected_asset->accepted = $accepted; - $affected_asset->save(); - } - - if ($update_checkout) { - return redirect()->to('account/view-assets')->with('success', $return_msg); - } else { - return redirect()->to('account/view-assets')->with('error', 'Something went wrong '); - } - } } diff --git a/resources/views/account/accept-asset.blade.php b/resources/views/account/accept-asset.blade.php deleted file mode 100644 index e9034c7100..0000000000 --- a/resources/views/account/accept-asset.blade.php +++ /dev/null @@ -1,135 +0,0 @@ -@extends('layouts/default') - -{{-- Page title --}} -@section('title') - {{ trans('general.accept', ['asset' => $item->present()->name()]) }} - @parent -@stop - - -{{-- Page content --}} -@section('content') - - - - - - - -
- - - - - -
-
-
-
-
-
- -
- -
- -
- - @if ($item->getEula()) -
-
- {!! $item->getEula() !!} -
-
- @endif - - @if ($snipeSettings->require_accept_signature=='1') -
- -

{{trans('general.sign_tos')}}

- -
-
- - -
-
- -
-
-
- @endif - -
- -
- -
-
-
-
- -@stop - -@section('moar_scripts') - - -@stop diff --git a/routes/web.php b/routes/web.php index 315d841655..a38794749b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -248,12 +248,6 @@ Route::group(['prefix' => 'account', 'middleware' => ['auth']], function () { Route::get('requested', [ViewAssetsController::class, 'getRequestedAssets'])->name('account.requested'); - // Accept Asset - Route::get( - 'accept-asset/{logID}', - [ViewAssetsController::class, 'getAcceptAsset'] - )->name('account/accept-assets'); - // Profile Route::get( 'requestable-assets', From 242836719d4ac36161f94440e12abfe525eea757 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 27 Jun 2022 19:32:10 -0700 Subject: [PATCH 3/3] Bumped hash Signed-off-by: snipe --- config/version.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/version.php b/config/version.php index fd17b0c4cc..f5fc4bb380 100644 --- a/config/version.php +++ b/config/version.php @@ -1,10 +1,10 @@ 'v6.0.5', - 'full_app_version' => 'v6.0.5 - build 8229-g94e723a88', - 'build_version' => '8229', + 'full_app_version' => 'v6.0.5 - build 8230-g393c32558', + 'build_version' => '8230', 'prerelease_version' => '', - 'hash_version' => 'g94e723a88', - 'full_hash' => 'v6.0.5-101-g94e723a88', - 'branch' => 'develop', + 'hash_version' => 'g393c32558', + 'full_hash' => 'v6.0.5-102-g393c32558', + 'branch' => 'master', ); \ No newline at end of file