From e33a4c2ef2da36b830b28fee0fce2543e136fc15 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 27 Jun 2022 16:35:44 -0700 Subject: [PATCH 1/3] Added disclosure arrows to use screen Signed-off-by: snipe --- resources/views/users/edit.blade.php | 475 ++++++++++++++------------- 1 file changed, 253 insertions(+), 222 deletions(-) diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index 680af7bd3..ac8294958 100755 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -162,6 +162,7 @@ + @if ($user->ldap_import!='1' || str_contains(Route::currentRouteName(), 'clone'))
@@ -271,14 +272,7 @@
@endif - - - @if (\App\Models\Company::canManageUsersCompanies()) - @include ('partials.forms.edit.company-select', ['translated_name' => trans('general.select_company'), 'fieldname' => 'company_id']) - @endif - - - + @if ($user->avatar)
@@ -292,236 +286,255 @@ @include ('partials.forms.edit.image-upload', ['fieldname' => 'avatar']) - - -
- -
- {!! Form::locales('locale', old('locale', $user->locale), 'select2') !!} - {!! $errors->first('locale', '') !!} -
-
- - -
- -
- - {!! $errors->first('employee_num', '') !!} -
-
- - - -
- -
- - {!! $errors->first('jobtitle', '') !!} -
-
- - - - @include ('partials.forms.edit.user-select', ['translated_name' => trans('admin/users/table.manager'), 'fieldname' => 'manager_id']) - - - @include ('partials.forms.edit.department-select', ['translated_name' => trans('general.department'), 'fieldname' => 'department_id']) - - - -
-
- -

{{ trans('admin/users/general.remote_help') }} -

-
-
- - - @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id']) - - -
- -
- - {!! $errors->first('phone', '') !!} -
-
- - -
- -
- - {!! $errors->first('website', '') !!} -
-
- - -
- -
- - {!! $errors->first('address', '') !!} -
-
- - -
- -
- - {!! $errors->first('city', '') !!} -
-
- - -
- -
- - {!! $errors->first('state', '') !!} -
-
- - -
- -
- {!! Form::countries('country', old('country', $user->country), 'col-md-6 select2') !!} - {!! $errors->first('country', '') !!} -
-
- - -
- -
- - {!! $errors->first('zip', '') !!} -
-
- - - - - - @if ($snipeSettings->two_factor_enabled!='') - @if ($snipeSettings->two_factor_enabled=='1') +
-
- {{ Form::label('two_factor_optin', trans('admin/settings/general.two_factor')) }} -
-
- @if (config('app.lock_passwords')) -
- {{ Form::checkbox('two_factor_optin', '1', Request::old('two_factor_optin', $user->two_factor_optin),['class' => 'minimal', 'disabled'=>'disabled']) }} {{ trans('admin/settings/general.two_factor_enabled_text') }} -

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

-
- @else - {{ Form::checkbox('two_factor_optin', '1', Request::old('two_factor_optin', $user->two_factor_optin),['class' => 'minimal']) }} {{ trans('admin/settings/general.two_factor_enabled_text') }} -

{{ trans('admin/users/general.two_factor_admin_optin_help') }}

+ - @endif +
-
-
- @endif + + + {{ trans('admin/hardware/form.optional_infos') }} + - -
- -
-

{{ trans('admin/settings/general.two_factor_reset_help') }}

-
-
- @endif +
- -
- -
- - {!! $errors->first('notes', '') !!} -
-
+
@@ -619,6 +632,24 @@ $(document).ready(function() { } }); + $("#optional_user_info").on("click",function(){ + $('#optional_user_details').fadeToggle(100); + $('#optional_user_info_icon').toggleClass('fa-caret-right fa-caret-down'); + var optional_user_info_open = $('#optional_user_info_icon').hasClass('fa-caret-down'); + document.cookie = "optional_user_info_open="+optional_user_info_open+'; path=/'; + }); + + var all_cookies = document.cookie.split(';') + for(var i in all_cookies) { + var trimmed_cookie = all_cookies[i].trim(' ') + if (trimmed_cookie.startsWith('optional_user_info_open=')) { + elems = all_cookies[i].split('=', 2) + if (elems[1] == 'true') { + $('#optional_user_info').trigger('click') + } + } + } + $("#two_factor_reset").click(function(){ $("#two_factor_resetrow").removeClass('success'); $("#two_factor_resetrow").removeClass('danger'); From 4a3f56acf29fbc2d2f5cd73cef3b6721358f9fce Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 27 Jun 2022 16:35:54 -0700 Subject: [PATCH 2/3] Removed old cooke stuff Signed-off-by: snipe --- resources/views/hardware/edit.blade.php | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/views/hardware/edit.blade.php b/resources/views/hardware/edit.blade.php index 99ec724a3..0c651cd85 100755 --- a/resources/views/hardware/edit.blade.php +++ b/resources/views/hardware/edit.blade.php @@ -15,7 +15,6 @@ @include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id']) -
From bf08e73f8ff76393cec0921b67ba7c68cefd8e1c Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 27 Jun 2022 16:36:09 -0700 Subject: [PATCH 3/3] Removed comments and server side cookie info Signed-off-by: snipe --- app/Http/Controllers/Assets/AssetsController.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/Http/Controllers/Assets/AssetsController.php b/app/Http/Controllers/Assets/AssetsController.php index c278940a1..a54c0a0ef 100755 --- a/app/Http/Controllers/Assets/AssetsController.php +++ b/app/Http/Controllers/Assets/AssetsController.php @@ -203,11 +203,6 @@ class AssetsController extends Controller $success = true; - // $cookie = Cookie::queue(Cookie::make('optional_info', $_POST['options'],$minutes)); - // $data = $request->session()->all(); - - // dd($_POST['options']); - } } @@ -217,8 +212,7 @@ class AssetsController extends Controller // dd( $_POST['options']); // Cookie::queue(Cookie::make('optional_info', json_decode($_POST['options']), $minutes)); return redirect()->route('hardware.index') - ->with('success', trans('admin/hardware/message.create.success')) - ->withCookie(cookie('optional_info',json_encode($_POST['options']),$minutes,null,null,null,false)); + ->with('success', trans('admin/hardware/message.create.success')); }