From fb482b0dd6d049196bd95e8f9428d0f154c9ed89 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 27 Jan 2021 14:09:01 -0800 Subject: [PATCH 1/3] Fixed translation string in Depreciation view [ch15776] --- resources/views/depreciations/view.blade.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/views/depreciations/view.blade.php b/resources/views/depreciations/view.blade.php index 89baef33f4..89b465ce20 100644 --- a/resources/views/depreciations/view.blade.php +++ b/resources/views/depreciations/view.blade.php @@ -10,7 +10,15 @@ @stop @section('header_right') - {{ trans('admin/depreciations/table.update') }} +
+ + +
@stop {{-- Page content --}} From 6772835efcfc97288de64f106eb6f17baa005eb3 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Date: Wed, 27 Jan 2021 16:41:58 -0600 Subject: [PATCH 2/3] Added support for radio buttons in Custom Fields. (#9053) --- app/Models/CustomField.php | 2 +- resources/views/custom_fields/fields/edit.blade.php | 13 ++++++++++++- resources/views/models/custom_fields_form.blade.php | 11 +++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/Models/CustomField.php b/app/Models/CustomField.php index 016d310d78..93942596c5 100644 --- a/app/Models/CustomField.php +++ b/app/Models/CustomField.php @@ -287,7 +287,7 @@ class CustomField extends Model { $arr = preg_split("/\\r\\n|\\r|\\n/", $this->field_values); - if (($this->element!='checkbox') && ($this->element!='checkbox')) { + if (($this->element!='checkbox') && ($this->element!='radio')) { $result[''] = 'Select '.strtolower($this->format); } diff --git a/resources/views/custom_fields/fields/edit.blade.php b/resources/views/custom_fields/fields/edit.blade.php index 7e6213c187..2eb2238522 100644 --- a/resources/views/custom_fields/fields/edit.blade.php +++ b/resources/views/custom_fields/fields/edit.blade.php @@ -70,7 +70,7 @@ -
+
@@ -168,6 +168,17 @@ }); }).change(); + // If the element is a radiobutton, doesn't show the format input box + $(".field_element").change(function(){ + $(this).find("option:selected").each(function(){ + if (($(this).attr("value") != "radio")){ + $("#format_values").show(); + } else{ + $("#format_values").hide(); + } + }); + }).change(); + // Only display the field element if the type is not text $(".field_element").change(function(){ $(this).find("option:selected").each(function(){ diff --git a/resources/views/models/custom_fields_form.blade.php b/resources/views/models/custom_fields_form.blade.php index 7c906cae41..e84839214d 100644 --- a/resources/views/models/custom_fields_form.blade.php +++ b/resources/views/models/custom_fields_form.blade.php @@ -27,6 +27,17 @@
@endforeach + @elseif ($field->element=='radio') + @foreach ($field->formatFieldValuesAsArray() as $value) + +
+ +
+ @endforeach + @endif From 70e6a6ced6d590594275f7d365bfd861c6d2432d Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Wed, 27 Jan 2021 15:36:43 -0800 Subject: [PATCH 3/3] Fix issue where users with edit permission cannot invoke LDAP sync (#9058) * Fix issue where users with edit permission cannot invoke LDAP sync * Make User::class consistent with usage elsewhere in the same directory --- app/Http/Controllers/Users/LDAPImportController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Http/Controllers/Users/LDAPImportController.php b/app/Http/Controllers/Users/LDAPImportController.php index 6e2a3091b0..337a43bc36 100644 --- a/app/Http/Controllers/Users/LDAPImportController.php +++ b/app/Http/Controllers/Users/LDAPImportController.php @@ -6,6 +6,7 @@ use App\Http\Controllers\Controller; use App\Services\LdapAd; use Illuminate\Http\Request; use Illuminate\Support\Facades\Artisan; +use App\Models\User; // Note that this is awful close to 'Users' the namespace above; be careful class LDAPImportController extends Controller { @@ -65,6 +66,7 @@ class LDAPImportController extends Controller */ public function store(Request $request) { + $this->authorize('update', User::class); // Call Artisan LDAP import command. $location_id = $request->input('location_id'); Artisan::call('snipeit:ldap-sync', ['--location_id' => $location_id, '--json_summary' => true]);