From 41e0275c951798bb69836ee3f8350cae45542e39 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 3 Jan 2024 12:42:36 -0600 Subject: [PATCH 01/78] `htmlentities()` --- resources/views/models/custom_fields_form.blade.php | 2 +- resources/views/models/custom_fields_form_bulk_edit.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/models/custom_fields_form.blade.php b/resources/views/models/custom_fields_form.blade.php index bae98373e4..90985ce77f 100644 --- a/resources/views/models/custom_fields_form.blade.php +++ b/resources/views/models/custom_fields_form.blade.php @@ -9,7 +9,7 @@ @if ($field->element=='listbox') {{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(), - Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, htmlspecialchars($item->{$field->db_column_name()}, ENT_QUOTES)) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }} + Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, htmlentities($item->{$field->db_column_name()})) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }} @elseif ($field->element=='textarea') diff --git a/resources/views/models/custom_fields_form_bulk_edit.blade.php b/resources/views/models/custom_fields_form_bulk_edit.blade.php index f30c60d331..f01815d5e3 100644 --- a/resources/views/models/custom_fields_form_bulk_edit.blade.php +++ b/resources/views/models/custom_fields_form_bulk_edit.blade.php @@ -25,7 +25,7 @@ @if ($field->element=='listbox') {{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(), - Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, htmlspecialchars($item->{$field->db_column_name()}, ENT_QUOTES)) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }} + Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, htmlentities($item->{$field->db_column_name()})) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }} @elseif ($field->element=='textarea') @if($field->is_unique) From 2b0dd8851c254e1f5aabf00ac01a4f436e836c85 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Fri, 26 Jan 2024 11:47:09 -0600 Subject: [PATCH 02/78] probably needs more testing... but should work --- app/Http/Controllers/CustomFieldsController.php | 2 +- resources/views/models/custom_fields_form.blade.php | 2 +- resources/views/models/custom_fields_form_bulk_edit.blade.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/CustomFieldsController.php b/app/Http/Controllers/CustomFieldsController.php index ffe5eceec2..b109c65f78 100644 --- a/app/Http/Controllers/CustomFieldsController.php +++ b/app/Http/Controllers/CustomFieldsController.php @@ -103,7 +103,7 @@ class CustomFieldsController extends Controller "name" => trim($request->get("name")), "element" => $request->get("element"), "help_text" => $request->get("help_text"), - "field_values" => $request->get("field_values"), + "field_values" => e($request->get("field_values")), "field_encrypted" => $request->get("field_encrypted", 0), "show_in_email" => $show_in_email, "is_unique" => $request->get("is_unique", 0), diff --git a/resources/views/models/custom_fields_form.blade.php b/resources/views/models/custom_fields_form.blade.php index 90985ce77f..bae98373e4 100644 --- a/resources/views/models/custom_fields_form.blade.php +++ b/resources/views/models/custom_fields_form.blade.php @@ -9,7 +9,7 @@ @if ($field->element=='listbox') {{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(), - Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, htmlentities($item->{$field->db_column_name()})) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }} + Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, htmlspecialchars($item->{$field->db_column_name()}, ENT_QUOTES)) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }} @elseif ($field->element=='textarea') diff --git a/resources/views/models/custom_fields_form_bulk_edit.blade.php b/resources/views/models/custom_fields_form_bulk_edit.blade.php index f01815d5e3..f30c60d331 100644 --- a/resources/views/models/custom_fields_form_bulk_edit.blade.php +++ b/resources/views/models/custom_fields_form_bulk_edit.blade.php @@ -25,7 +25,7 @@ @if ($field->element=='listbox') {{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(), - Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, htmlentities($item->{$field->db_column_name()})) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }} + Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, htmlspecialchars($item->{$field->db_column_name()}, ENT_QUOTES)) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }} @elseif ($field->element=='textarea') @if($field->is_unique) From 4cb804cf038bc900aeb2e081df489cde69a59cf6 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Fri, 26 Jan 2024 11:56:02 -0600 Subject: [PATCH 03/78] get rid of `e()` on store and update --- app/Http/Controllers/CustomFieldsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/CustomFieldsController.php b/app/Http/Controllers/CustomFieldsController.php index b109c65f78..23ea9da34b 100644 --- a/app/Http/Controllers/CustomFieldsController.php +++ b/app/Http/Controllers/CustomFieldsController.php @@ -103,7 +103,7 @@ class CustomFieldsController extends Controller "name" => trim($request->get("name")), "element" => $request->get("element"), "help_text" => $request->get("help_text"), - "field_values" => e($request->get("field_values")), + "field_values" => $request->get("field_values"), "field_encrypted" => $request->get("field_encrypted", 0), "show_in_email" => $show_in_email, "is_unique" => $request->get("is_unique", 0), @@ -260,7 +260,7 @@ class CustomFieldsController extends Controller $field->name = trim(e($request->get("name"))); $field->element = e($request->get("element")); - $field->field_values = e($request->get("field_values")); + $field->field_values = $request->get("field_values"); $field->user_id = Auth::id(); $field->help_text = $request->get("help_text"); $field->show_in_email = $show_in_email; From 1248260df37b28ba1d62e1498c9d562a8ab6ba23 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Fri, 26 Jan 2024 12:33:35 -0600 Subject: [PATCH 04/78] i don't think the output needs to separately escaped, the entire statement is already wrapped in `{{}}` --- resources/views/models/custom_fields_form.blade.php | 2 +- resources/views/models/custom_fields_form_bulk_edit.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/models/custom_fields_form.blade.php b/resources/views/models/custom_fields_form.blade.php index bae98373e4..3c49ef8f7e 100644 --- a/resources/views/models/custom_fields_form.blade.php +++ b/resources/views/models/custom_fields_form.blade.php @@ -9,7 +9,7 @@ @if ($field->element=='listbox') {{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(), - Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, htmlspecialchars($item->{$field->db_column_name()}, ENT_QUOTES)) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }} + Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }} @elseif ($field->element=='textarea') diff --git a/resources/views/models/custom_fields_form_bulk_edit.blade.php b/resources/views/models/custom_fields_form_bulk_edit.blade.php index f30c60d331..dc0ad1f88a 100644 --- a/resources/views/models/custom_fields_form_bulk_edit.blade.php +++ b/resources/views/models/custom_fields_form_bulk_edit.blade.php @@ -25,7 +25,7 @@ @if ($field->element=='listbox') {{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(), - Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, htmlspecialchars($item->{$field->db_column_name()}, ENT_QUOTES)) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }} + Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }} @elseif ($field->element=='textarea') @if($field->is_unique) From 43d8474caa4f5ff39c61493a067ecd113f3b13dc Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Tue, 6 Feb 2024 17:45:46 -0600 Subject: [PATCH 05/78] a note to remember this tomorrow --- app/Http/Controllers/AssetModelsController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.php index 012f40e399..02d9404556 100755 --- a/app/Http/Controllers/AssetModelsController.php +++ b/app/Http/Controllers/AssetModelsController.php @@ -513,6 +513,8 @@ class AssetModelsController extends Controller $validator = Validator::make($data, $rules); + // Okay, this is the problem. Seems to be failing every time, kind of makes sense because it looks like + // $rules is an empty array, but I need to wrap my head around this entire method a little more. if($validator->fails()){ return false; } From bcfa913450e96f1248fd45fcaa61c8bc8b79f1e6 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 7 Feb 2024 20:03:37 -0600 Subject: [PATCH 06/78] condition makes this work, needs more testing --- app/Http/Controllers/AssetModelsController.php | 4 ++-- app/Models/CustomFieldset.php | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.php index 02d9404556..f1a8c85c20 100755 --- a/app/Http/Controllers/AssetModelsController.php +++ b/app/Http/Controllers/AssetModelsController.php @@ -11,6 +11,7 @@ use App\Models\User; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Input; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\Validator; use Redirect; @@ -513,9 +514,8 @@ class AssetModelsController extends Controller $validator = Validator::make($data, $rules); - // Okay, this is the problem. Seems to be failing every time, kind of makes sense because it looks like - // $rules is an empty array, but I need to wrap my head around this entire method a little more. if($validator->fails()){ + Log::debug($validator->errors()); return false; } diff --git a/app/Models/CustomFieldset.php b/app/Models/CustomFieldset.php index a62f96d631..0d0f3974ff 100644 --- a/app/Models/CustomFieldset.php +++ b/app/Models/CustomFieldset.php @@ -92,8 +92,11 @@ class CustomFieldset extends Model array_push($rule, $field->attributes['format']); $rules[$field->db_column_name()] = $rule; - //add not_array to rules for all fields - $rules[$field->db_column_name()][] = 'not_array'; + // add not_array to rules for all fields + // condition added to fix issue with model default updates + if ($field->element != 'checkbox') { + $rules[$field->db_column_name()][] = 'not_array'; + } } return $rules; From d55358652bc33acd49b153ce81c2379acc1432e3 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Tue, 13 Feb 2024 13:45:56 -0600 Subject: [PATCH 07/78] cleanup for pr --- app/Http/Controllers/AssetModelsController.php | 2 -- app/Models/CustomFieldset.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.php index f1a8c85c20..012f40e399 100755 --- a/app/Http/Controllers/AssetModelsController.php +++ b/app/Http/Controllers/AssetModelsController.php @@ -11,7 +11,6 @@ use App\Models\User; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Input; -use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\Validator; use Redirect; @@ -515,7 +514,6 @@ class AssetModelsController extends Controller $validator = Validator::make($data, $rules); if($validator->fails()){ - Log::debug($validator->errors()); return false; } diff --git a/app/Models/CustomFieldset.php b/app/Models/CustomFieldset.php index 0d0f3974ff..e9be7c53c9 100644 --- a/app/Models/CustomFieldset.php +++ b/app/Models/CustomFieldset.php @@ -93,7 +93,7 @@ class CustomFieldset extends Model array_push($rule, $field->attributes['format']); $rules[$field->db_column_name()] = $rule; // add not_array to rules for all fields - // condition added to fix issue with model default updates + // temporary condition added to fix issue with model default updates in the gui if ($field->element != 'checkbox') { $rules[$field->db_column_name()][] = 'not_array'; } From dcf2168454245f1d84a4c8ee3f2c6e706ffc744f Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Tue, 13 Feb 2024 19:35:37 -0600 Subject: [PATCH 08/78] initial stuff, need to switch branches --- app/Models/CustomFieldset.php | 7 +++++++ app/Providers/ValidationServiceProvider.php | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/app/Models/CustomFieldset.php b/app/Models/CustomFieldset.php index e9be7c53c9..373c137bc4 100644 --- a/app/Models/CustomFieldset.php +++ b/app/Models/CustomFieldset.php @@ -5,6 +5,8 @@ namespace App\Models; use Gate; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Rule; use Watson\Validating\ValidatingTrait; class CustomFieldset extends Model @@ -97,6 +99,11 @@ class CustomFieldset extends Model if ($field->element != 'checkbox') { $rules[$field->db_column_name()][] = 'not_array'; } + if ($field->element == 'checkbox') { + //Log::alert($field->formatFieldValuesAsArray()); + $values = $field->formatFieldValuesAsArray(); + //$rules[$field->db_column_name()] = 'checkboxes'; + } } return $rules; diff --git a/app/Providers/ValidationServiceProvider.php b/app/Providers/ValidationServiceProvider.php index 50468c8d72..754c2de9a0 100644 --- a/app/Providers/ValidationServiceProvider.php +++ b/app/Providers/ValidationServiceProvider.php @@ -2,9 +2,11 @@ namespace App\Providers; +use App\Models\CustomField; use App\Models\Department; use App\Models\Setting; use DB; +use Illuminate\Support\Facades\Log; use Illuminate\Support\ServiceProvider; use Illuminate\Validation\Rule; use Validator; @@ -294,6 +296,25 @@ class ValidationServiceProvider extends ServiceProvider Validator::extend('not_array', function ($attribute, $value, $parameters, $validator) { return !is_array($value); }); + + Validator::extend('checkboxes', function ($attribute, $value, $parameters, $validator){ + $options = CustomField::where('db_column', $attribute)->formatFieldValuesAsArray(); + if(!is_array($value)) { + $exploded = explode(',', $value); + $valid = array_intersect($exploded, $options); + if(array_count_values($valid) > 0) { + return true; + } + } + if(is_array($value)) { + $valid = array_intersect($value, $options); + if(array_count_values($valid) > 0) { + return true; + } + } + + + }); } /** From 57a75e68b91e765b6ac205b66db851a1cdb87085 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 14 Feb 2024 00:52:50 -0600 Subject: [PATCH 09/78] maybe i do the inverse here? --- app/Models/CustomFieldset.php | 2 +- app/Providers/ValidationServiceProvider.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Models/CustomFieldset.php b/app/Models/CustomFieldset.php index 373c137bc4..c73d277a10 100644 --- a/app/Models/CustomFieldset.php +++ b/app/Models/CustomFieldset.php @@ -102,7 +102,7 @@ class CustomFieldset extends Model if ($field->element == 'checkbox') { //Log::alert($field->formatFieldValuesAsArray()); $values = $field->formatFieldValuesAsArray(); - //$rules[$field->db_column_name()] = 'checkboxes'; + $rules[$field->db_column_name()] = 'checkboxes'; } } diff --git a/app/Providers/ValidationServiceProvider.php b/app/Providers/ValidationServiceProvider.php index 754c2de9a0..860564ec1f 100644 --- a/app/Providers/ValidationServiceProvider.php +++ b/app/Providers/ValidationServiceProvider.php @@ -298,15 +298,15 @@ class ValidationServiceProvider extends ServiceProvider }); Validator::extend('checkboxes', function ($attribute, $value, $parameters, $validator){ - $options = CustomField::where('db_column', $attribute)->formatFieldValuesAsArray(); + $options = CustomField::where('db_column', $attribute)->first()->formatFieldValuesAsArray(); + // for legacy, allows users to submit a comma separated string of options if(!is_array($value)) { $exploded = explode(',', $value); - $valid = array_intersect($exploded, $options); - if(array_count_values($valid) > 0) { - return true; + $invalid = array_diff($exploded, $options); + if(count($invalid) > 0) { + return false; } - } - if(is_array($value)) { + } else { $valid = array_intersect($value, $options); if(array_count_values($valid) > 0) { return true; From 25241542d2b74c27f03062895ff260e833d11695 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 14 Feb 2024 02:12:31 -0600 Subject: [PATCH 10/78] progress, going to sleep --- .../Controllers/AssetModelsController.php | 6 ++++-- app/Models/CustomFieldset.php | 2 +- app/Providers/ValidationServiceProvider.php | 19 ++++++++++--------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.php index 012f40e399..455fc82491 100755 --- a/app/Http/Controllers/AssetModelsController.php +++ b/app/Http/Controllers/AssetModelsController.php @@ -7,6 +7,7 @@ use App\Http\Requests\ImageUploadRequest; use App\Models\Actionlog; use App\Models\Asset; use App\Models\AssetModel; +use App\Models\CustomField; use App\Models\User; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; @@ -169,6 +170,7 @@ class AssetModelsController extends Controller if ($this->shouldAddDefaultValues($request->input())) { if (!$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'))){ + //TODO: this needs to return the actual validation errors, will come back to this before opening PR return redirect()->back()->withInput()->with('error', trans('admin/custom_fields/message.fieldset_default_value.error')); } } @@ -489,11 +491,11 @@ class AssetModelsController extends Controller * @param array $defaultValues * @return void */ - private function assignCustomFieldsDefaultValues(AssetModel $model, array $defaultValues) + private function assignCustomFieldsDefaultValues(AssetModel $model, array $defaultValues): bool { $data = array(); foreach ($defaultValues as $customFieldId => $defaultValue) { - $customField = \App\Models\CustomField::find($customFieldId); + $customField = CustomField::find($customFieldId); $data[$customField->db_column] = $defaultValue; } diff --git a/app/Models/CustomFieldset.php b/app/Models/CustomFieldset.php index c73d277a10..f5e9897dd3 100644 --- a/app/Models/CustomFieldset.php +++ b/app/Models/CustomFieldset.php @@ -102,7 +102,7 @@ class CustomFieldset extends Model if ($field->element == 'checkbox') { //Log::alert($field->formatFieldValuesAsArray()); $values = $field->formatFieldValuesAsArray(); - $rules[$field->db_column_name()] = 'checkboxes'; + $rules[$field->db_column_name()][] = 'checkboxes'; } } diff --git a/app/Providers/ValidationServiceProvider.php b/app/Providers/ValidationServiceProvider.php index 860564ec1f..0bd201a262 100644 --- a/app/Providers/ValidationServiceProvider.php +++ b/app/Providers/ValidationServiceProvider.php @@ -297,23 +297,24 @@ class ValidationServiceProvider extends ServiceProvider return !is_array($value); }); + // This is only used in Models/CustomFieldset.php - it does automatic validation for checkboxes by making sure + // that the submitted values actually exist in the options. Validator::extend('checkboxes', function ($attribute, $value, $parameters, $validator){ $options = CustomField::where('db_column', $attribute)->first()->formatFieldValuesAsArray(); + if(is_array($value)) { + $invalid = array_diff($value, $options); + if(count($invalid) > 0) { + return false; + } + } // for legacy, allows users to submit a comma separated string of options - if(!is_array($value)) { + elseif(!is_array($value)) { $exploded = explode(',', $value); $invalid = array_diff($exploded, $options); if(count($invalid) > 0) { return false; } - } else { - $valid = array_intersect($value, $options); - if(array_count_values($valid) > 0) { - return true; - } - } - - + } else return true; }); } From 72c118a70f2704fb4dc4c038ef16cdc159e996ec Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 14 Feb 2024 11:41:46 -0600 Subject: [PATCH 11/78] cleanup --- app/Models/CustomFieldset.php | 7 +++---- app/Providers/ValidationServiceProvider.php | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Models/CustomFieldset.php b/app/Models/CustomFieldset.php index f5e9897dd3..4d960ede41 100644 --- a/app/Models/CustomFieldset.php +++ b/app/Models/CustomFieldset.php @@ -94,14 +94,13 @@ class CustomFieldset extends Model array_push($rule, $field->attributes['format']); $rules[$field->db_column_name()] = $rule; - // add not_array to rules for all fields - // temporary condition added to fix issue with model default updates in the gui + + // add not_array to rules for all fields but checkboxes if ($field->element != 'checkbox') { $rules[$field->db_column_name()][] = 'not_array'; } + if ($field->element == 'checkbox') { - //Log::alert($field->formatFieldValuesAsArray()); - $values = $field->formatFieldValuesAsArray(); $rules[$field->db_column_name()][] = 'checkboxes'; } } diff --git a/app/Providers/ValidationServiceProvider.php b/app/Providers/ValidationServiceProvider.php index 0bd201a262..835587571d 100644 --- a/app/Providers/ValidationServiceProvider.php +++ b/app/Providers/ValidationServiceProvider.php @@ -314,7 +314,8 @@ class ValidationServiceProvider extends ServiceProvider if(count($invalid) > 0) { return false; } - } else return true; + } + return true; }); } From d9c61fdb025e2751af0584ca2d275a8ead7be570 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 14 Feb 2024 11:52:25 -0600 Subject: [PATCH 12/78] validation msg --- app/Http/Controllers/AssetModelsController.php | 3 +-- resources/lang/en-US/validation.php | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.php index 455fc82491..34f12b826b 100755 --- a/app/Http/Controllers/AssetModelsController.php +++ b/app/Http/Controllers/AssetModelsController.php @@ -169,8 +169,7 @@ class AssetModelsController extends Controller $model->fieldset_id = $request->input('fieldset_id'); if ($this->shouldAddDefaultValues($request->input())) { - if (!$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'))){ - //TODO: this needs to return the actual validation errors, will come back to this before opening PR + if ($msg = !$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'))){ return redirect()->back()->withInput()->with('error', trans('admin/custom_fields/message.fieldset_default_value.error')); } } diff --git a/resources/lang/en-US/validation.php b/resources/lang/en-US/validation.php index 1c6ad8a148..98084afcd4 100644 --- a/resources/lang/en-US/validation.php +++ b/resources/lang/en-US/validation.php @@ -105,6 +105,7 @@ return [ 'gte' => [ 'numeric' => 'Value cannot be negative' ], + 'checkboxes' => ':attribute contains invalid options.', /* From fb28882f65d5832b4b7d744af8790c93efaeb35e Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 14 Feb 2024 11:59:14 -0600 Subject: [PATCH 13/78] trim potential spaces --- app/Providers/ValidationServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Providers/ValidationServiceProvider.php b/app/Providers/ValidationServiceProvider.php index 835587571d..02a2bf3136 100644 --- a/app/Providers/ValidationServiceProvider.php +++ b/app/Providers/ValidationServiceProvider.php @@ -309,7 +309,7 @@ class ValidationServiceProvider extends ServiceProvider } // for legacy, allows users to submit a comma separated string of options elseif(!is_array($value)) { - $exploded = explode(',', $value); + $exploded = array_map('trim', explode(',', $value)); $invalid = array_diff($exploded, $options); if(count($invalid) > 0) { return false; From 1ceb703129974e05e4f77e82a3895bb6b1778070 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 14 Feb 2024 12:44:09 -0600 Subject: [PATCH 14/78] rm var --- app/Http/Controllers/AssetModelsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.php index 34f12b826b..aa4c9dd238 100755 --- a/app/Http/Controllers/AssetModelsController.php +++ b/app/Http/Controllers/AssetModelsController.php @@ -169,7 +169,7 @@ class AssetModelsController extends Controller $model->fieldset_id = $request->input('fieldset_id'); if ($this->shouldAddDefaultValues($request->input())) { - if ($msg = !$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'))){ + if (!$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'))){ return redirect()->back()->withInput()->with('error', trans('admin/custom_fields/message.fieldset_default_value.error')); } } From 115e0fc11927e0196bd37f2cc6f3a8168f06019f Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 14 Feb 2024 13:15:23 -0600 Subject: [PATCH 15/78] implode submitted arrays to save --- app/Http/Controllers/Api/AssetsController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index f5168a5914..6ef3b30503 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -584,6 +584,11 @@ class AssetsController extends Controller } } } + if ($field->element == 'checkbox') { + if(is_array($field_val)) { + $field_val = implode(',', $field_val); + } + } $asset->{$field->db_column} = $field_val; From c6d85a1b0bb15102a4f1c1e1d15e6633be342996 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Tue, 20 Feb 2024 12:23:24 -0600 Subject: [PATCH 16/78] allows arrays on checkbox values --- app/Http/Controllers/Api/AssetsController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 6ef3b30503..dbeb1b6c63 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -663,6 +663,11 @@ class AssetsController extends Controller $asset->{$field->db_column} = \Crypt::encrypt($request->input($field->db_column)); } } else { + if ($field->element == 'checkbox') { + if(is_array($field_val)) { + $field_val = implode(',', $field_val); + } + } $asset->{$field->db_column} = $request->input($field->db_column); } } From 26728a85addc318c86677b1095377f9e2506bf7f Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Tue, 20 Feb 2024 13:18:40 -0600 Subject: [PATCH 17/78] this seems to work for patches --- app/Http/Controllers/Api/AssetsController.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index dbeb1b6c63..2922766286 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -556,7 +556,7 @@ class AssetsController extends Controller $model = AssetModel::find($request->input('model_id')); // Check that it's an object and not a collection - // (Sometimes people send arrays here and they shouldn't + // (Sometimes people send arrays here and they shouldn't, unless it's a checkbox) if (($model) && ($model instanceof AssetModel) && ($model->fieldset)) { foreach ($model->fieldset->fields as $field) { @@ -657,18 +657,21 @@ class AssetsController extends Controller // Update custom fields if (($model) && (isset($model->fieldset))) { foreach ($model->fieldset->fields as $field) { + $field_val = $request->input($field->db_column, null); if ($request->has($field->db_column)) { if ($field->field_encrypted == '1') { if (Gate::allows('admin')) { - $asset->{$field->db_column} = \Crypt::encrypt($request->input($field->db_column)); + $asset->{$field->db_column} = Crypt::encrypt($field_val); } - } else { - if ($field->element == 'checkbox') { - if(is_array($field_val)) { - $field_val = implode(',', $field_val); - } + } + if ($field->element == 'checkbox') { + if(is_array($field_val)) { + $field_val = implode(',', $field_val); + $asset->{$field->db_column} = $field_val; } - $asset->{$field->db_column} = $request->input($field->db_column); + } + else { + $asset->{$field->db_column} = $field_val; } } } From d67ff54f4b29e2c8d3d1b5b395cc938df3aa03f5 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Tue, 20 Feb 2024 16:20:03 -0600 Subject: [PATCH 18/78] temporary decrypt, almost there --- app/Providers/ValidationServiceProvider.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/Providers/ValidationServiceProvider.php b/app/Providers/ValidationServiceProvider.php index 02a2bf3136..80697ce458 100644 --- a/app/Providers/ValidationServiceProvider.php +++ b/app/Providers/ValidationServiceProvider.php @@ -6,6 +6,7 @@ use App\Models\CustomField; use App\Models\Department; use App\Models\Setting; use DB; +use Illuminate\Support\Facades\Crypt; use Illuminate\Support\Facades\Log; use Illuminate\Support\ServiceProvider; use Illuminate\Validation\Rule; @@ -300,13 +301,22 @@ class ValidationServiceProvider extends ServiceProvider // This is only used in Models/CustomFieldset.php - it does automatic validation for checkboxes by making sure // that the submitted values actually exist in the options. Validator::extend('checkboxes', function ($attribute, $value, $parameters, $validator){ - $options = CustomField::where('db_column', $attribute)->first()->formatFieldValuesAsArray(); + $field = CustomField::where('db_column', $attribute)->first(); + $options = $field->formatFieldValuesAsArray(); + + // temporarily decrypt for validation + if($field->field_encrypted) { + $value = Crypt::decrypt($value); + } + dump(is_array($value)); + if(is_array($value)) { $invalid = array_diff($value, $options); if(count($invalid) > 0) { return false; } } + // for legacy, allows users to submit a comma separated string of options elseif(!is_array($value)) { $exploded = array_map('trim', explode(',', $value)); @@ -315,6 +325,7 @@ class ValidationServiceProvider extends ServiceProvider return false; } } + return true; }); } From 20dbacd22f5c35a3b5c1a6cb4865d205019e1fe4 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 21 Feb 2024 21:33:34 -0600 Subject: [PATCH 19/78] store good, update needs work --- app/Http/Controllers/Api/AssetsController.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 2922766286..75d64d440f 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -585,6 +585,16 @@ class AssetsController extends Controller } } if ($field->element == 'checkbox') { + if ($field->field_encrypted) { + // to not break a bunch of stuff, we must decrypt + implode if the checkbox value is an array + $field_val_decrypt = Crypt::decrypt($field_val); + if (is_array($field_val_decrypt)) { + $field_val_decrypt_imploded = implode(',', $field_val_decrypt); + $field_val = Crypt::encrypt($field_val_decrypt_imploded); + } else + $field_val = Crypt::encrypt($field_val_decrypt); + + } if(is_array($field_val)) { $field_val = implode(',', $field_val); } @@ -665,6 +675,16 @@ class AssetsController extends Controller } } if ($field->element == 'checkbox') { + //if ($field->field_encrypted) { + // // to not break a bunch of stuff, we must decrypt + implode if the checkbox value is an array + // $field_val_decrypt = Crypt::decrypt($field_val); + // if (is_array($field_val_decrypt)) { + // $field_val_decrypt_imploded = implode(',', $field_val_decrypt); + // $field_val = Crypt::encrypt($field_val_decrypt_imploded); + // } else + // $field_val = Crypt::encrypt($field_val_decrypt); + // + //} if(is_array($field_val)) { $field_val = implode(',', $field_val); $asset->{$field->db_column} = $field_val; From 14358651e491fb2725ff1af5b0050675e25c4f49 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Thu, 22 Feb 2024 13:28:23 -0600 Subject: [PATCH 20/78] pushing to test other branches --- app/Http/Controllers/Api/AssetsController.php | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 75d64d440f..c3d4ce8d21 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -668,23 +668,26 @@ class AssetsController extends Controller if (($model) && (isset($model->fieldset))) { foreach ($model->fieldset->fields as $field) { $field_val = $request->input($field->db_column, null); + if ($request->has($field->db_column)) { + //if ($field->field_encrypted) { + // // to not break a bunch of stuff, we must decrypt + implode if the checkbox value is an array + // $field_val_decrypt = Crypt::decrypt($field_val); + // if (is_array($field_val_decrypt)) { + // $field_val_decrypt_imploded = implode(',', $field_val_decrypt); + // $field_val = Crypt::encrypt($field_val_decrypt_imploded); + // } else + // $field_val = Crypt::encrypt($field_val_decrypt); + // + //} if ($field->field_encrypted == '1') { if (Gate::allows('admin')) { $asset->{$field->db_column} = Crypt::encrypt($field_val); } } + if ($field->element == 'checkbox') { - //if ($field->field_encrypted) { - // // to not break a bunch of stuff, we must decrypt + implode if the checkbox value is an array - // $field_val_decrypt = Crypt::decrypt($field_val); - // if (is_array($field_val_decrypt)) { - // $field_val_decrypt_imploded = implode(',', $field_val_decrypt); - // $field_val = Crypt::encrypt($field_val_decrypt_imploded); - // } else - // $field_val = Crypt::encrypt($field_val_decrypt); - // - //} + if(is_array($field_val)) { $field_val = implode(',', $field_val); $asset->{$field->db_column} = $field_val; From b6fa6cba2244926071281789c2c2fdfead7e2874 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Thu, 22 Feb 2024 15:01:14 -0600 Subject: [PATCH 21/78] note before switching tasks --- app/Providers/ValidationServiceProvider.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Providers/ValidationServiceProvider.php b/app/Providers/ValidationServiceProvider.php index 80697ce458..71c24694db 100644 --- a/app/Providers/ValidationServiceProvider.php +++ b/app/Providers/ValidationServiceProvider.php @@ -305,6 +305,8 @@ class ValidationServiceProvider extends ServiceProvider $options = $field->formatFieldValuesAsArray(); // temporarily decrypt for validation + // so, this is breaking patches, i don't really get why. + // is it not encrypted here on an update? need to do more testing. :( if($field->field_encrypted) { $value = Crypt::decrypt($value); } From ad0f873ecee737c73b8d157b89001146c14437ba Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Tue, 5 Mar 2024 11:58:00 -0600 Subject: [PATCH 22/78] rm validation stuff --- app/Http/Controllers/Api/AssetsController.php | 22 ------------------- app/Providers/ValidationServiceProvider.php | 8 ------- 2 files changed, 30 deletions(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index c3d4ce8d21..7b3db3090c 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -585,16 +585,6 @@ class AssetsController extends Controller } } if ($field->element == 'checkbox') { - if ($field->field_encrypted) { - // to not break a bunch of stuff, we must decrypt + implode if the checkbox value is an array - $field_val_decrypt = Crypt::decrypt($field_val); - if (is_array($field_val_decrypt)) { - $field_val_decrypt_imploded = implode(',', $field_val_decrypt); - $field_val = Crypt::encrypt($field_val_decrypt_imploded); - } else - $field_val = Crypt::encrypt($field_val_decrypt); - - } if(is_array($field_val)) { $field_val = implode(',', $field_val); } @@ -670,24 +660,12 @@ class AssetsController extends Controller $field_val = $request->input($field->db_column, null); if ($request->has($field->db_column)) { - //if ($field->field_encrypted) { - // // to not break a bunch of stuff, we must decrypt + implode if the checkbox value is an array - // $field_val_decrypt = Crypt::decrypt($field_val); - // if (is_array($field_val_decrypt)) { - // $field_val_decrypt_imploded = implode(',', $field_val_decrypt); - // $field_val = Crypt::encrypt($field_val_decrypt_imploded); - // } else - // $field_val = Crypt::encrypt($field_val_decrypt); - // - //} if ($field->field_encrypted == '1') { if (Gate::allows('admin')) { $asset->{$field->db_column} = Crypt::encrypt($field_val); } } - if ($field->element == 'checkbox') { - if(is_array($field_val)) { $field_val = implode(',', $field_val); $asset->{$field->db_column} = $field_val; diff --git a/app/Providers/ValidationServiceProvider.php b/app/Providers/ValidationServiceProvider.php index 71c24694db..d13898fb3f 100644 --- a/app/Providers/ValidationServiceProvider.php +++ b/app/Providers/ValidationServiceProvider.php @@ -304,14 +304,6 @@ class ValidationServiceProvider extends ServiceProvider $field = CustomField::where('db_column', $attribute)->first(); $options = $field->formatFieldValuesAsArray(); - // temporarily decrypt for validation - // so, this is breaking patches, i don't really get why. - // is it not encrypted here on an update? need to do more testing. :( - if($field->field_encrypted) { - $value = Crypt::decrypt($value); - } - dump(is_array($value)); - if(is_array($value)) { $invalid = array_diff($value, $options); if(count($invalid) > 0) { From af06b1cd06fb2e11a1e93bf4a96939d44992c668 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Tue, 5 Mar 2024 13:37:30 -0600 Subject: [PATCH 23/78] hide encryption option for checkbox and radio --- resources/views/custom_fields/fields/edit.blade.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/resources/views/custom_fields/fields/edit.blade.php b/resources/views/custom_fields/fields/edit.blade.php index 504b556faa..fa869bc372 100644 --- a/resources/views/custom_fields/fields/edit.blade.php +++ b/resources/views/custom_fields/fields/edit.blade.php @@ -135,7 +135,7 @@ @if (!$field->id) -
+
- @endif @@ -302,11 +301,21 @@ $(this).find("option:selected").each(function(){ if (($(this).attr("value")!="text") && ($(this).attr("value")!="textarea")){ $("#field_values_text").show(); + if ($(this).attr("value") == "checkbox" || $(this).attr("value") == "radio") { + $("#encryption_section").hide(); + } } else{ + $("#encryption_section").show(); $("#field_values_text").hide(); } }); }).change(); + // $(".field_element").change(function(){ + // $(this).find("option:selected").each(function(){ + // if + // }) + // }) + }); From a251e61d73a11a853250934c17235fabb19dc2d4 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Tue, 5 Mar 2024 13:40:44 -0600 Subject: [PATCH 24/78] rm commented code and add comment --- resources/views/custom_fields/fields/edit.blade.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/resources/views/custom_fields/fields/edit.blade.php b/resources/views/custom_fields/fields/edit.blade.php index fa869bc372..e21e9fba48 100644 --- a/resources/views/custom_fields/fields/edit.blade.php +++ b/resources/views/custom_fields/fields/edit.blade.php @@ -297,6 +297,7 @@ }).change(); // Only display the field element if the type is not text + // and don't display encryption option for checkbox or radio $(".field_element").change(function(){ $(this).find("option:selected").each(function(){ if (($(this).attr("value")!="text") && ($(this).attr("value")!="textarea")){ @@ -310,12 +311,6 @@ } }); }).change(); - // $(".field_element").change(function(){ - // $(this).find("option:selected").each(function(){ - // if - // }) - // }) - }); From 3a0a13d06d377bc86695006885730f57cb641bc2 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Tue, 5 Mar 2024 16:35:06 -0600 Subject: [PATCH 25/78] tests written but something not working... --- tests/Feature/Api/Assets/AssetStoreTest.php | 66 +++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/tests/Feature/Api/Assets/AssetStoreTest.php b/tests/Feature/Api/Assets/AssetStoreTest.php index 92a58a5006..f7a0aaf6dc 100644 --- a/tests/Feature/Api/Assets/AssetStoreTest.php +++ b/tests/Feature/Api/Assets/AssetStoreTest.php @@ -438,4 +438,70 @@ class AssetStoreTest extends TestCase $json->has('messages.company_id')->etc(); }); } + + public function testCustomFieldCheckboxPassesValidationForValidOptionsWithString() + { + $model = AssetModel::factory()->create(); + $status = Statuslabel::factory()->create(); + + $this->settings->enableAutoIncrement(); + + $this->actingAsForApi(User::factory()->createAssets()->create()) + ->postJson(route('api.assets.store'), [ + 'model_id' => $model->id, + 'status_id' => $status->id, + '_snipeit_test_checkbox_7' => 'One, Two, Three', + ]) + ->assertOk() + ->assertStatusMessageIs('success'); + } + + public function testCustomFieldCheckboxPassesValidationForValidOptionsWithArray() + { + $model = AssetModel::factory()->create(); + $status = Statuslabel::factory()->create(); + + $this->settings->enableAutoIncrement(); + + $this->actingAsForApi(User::factory()->createAssets()->create()) + ->postJson(route('api.assets.store'), [ + 'model_id' => $model->id, + 'status_id' => $status->id, + '_snipeit_test_checkbox_7' => ['One', 'Two', 'Three'], + ]) + ->assertOk() + ->assertStatusMessageIs('success'); + } + + public function testCustomFieldCheckboxFailsValidationForInvalidOptionsWithString() + { + $model = AssetModel::factory()->create(); + $status = Statuslabel::factory()->create(); + + $this->settings->enableAutoIncrement(); + + $this->actingAsForApi(User::factory()->createAssets()->create()) + ->postJson(route('api.assets.store'), [ + 'model_id' => $model->id, + 'status_id' => $status->id, + '_snipeit_test_checkbox_7' => "One, Two, Four, Five", + ]) + ->assertStatusMessageIs('error'); + } + + public function testCustomFieldCheckboxFailsValidationForInvalidOptionsWithArray() + { + $model = AssetModel::factory()->create(); + $status = Statuslabel::factory()->create(); + + $this->settings->enableAutoIncrement(); + + $this->actingAsForApi(User::factory()->createAssets()->create()) + ->postJson(route('api.assets.store'), [ + 'model_id' => $model->id, + 'status_id' => $status->id, + '_snipeit_test_checkbox_7' => ['One', 'Two', 'Four', 'Five'] + ]) + ->assertStatusMessageIs('error'); + } } From 04e0a9d4a560dfcdaa1f1a1b3b71af3c35e2da0c Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Fri, 8 Mar 2024 13:14:59 -0600 Subject: [PATCH 26/78] commented tests for now --- tests/Feature/Api/Assets/AssetStoreTest.php | 134 ++++++++++---------- 1 file changed, 69 insertions(+), 65 deletions(-) diff --git a/tests/Feature/Api/Assets/AssetStoreTest.php b/tests/Feature/Api/Assets/AssetStoreTest.php index f7a0aaf6dc..cafd71f558 100644 --- a/tests/Feature/Api/Assets/AssetStoreTest.php +++ b/tests/Feature/Api/Assets/AssetStoreTest.php @@ -439,69 +439,73 @@ class AssetStoreTest extends TestCase }); } - public function testCustomFieldCheckboxPassesValidationForValidOptionsWithString() - { - $model = AssetModel::factory()->create(); - $status = Statuslabel::factory()->create(); - - $this->settings->enableAutoIncrement(); - - $this->actingAsForApi(User::factory()->createAssets()->create()) - ->postJson(route('api.assets.store'), [ - 'model_id' => $model->id, - 'status_id' => $status->id, - '_snipeit_test_checkbox_7' => 'One, Two, Three', - ]) - ->assertOk() - ->assertStatusMessageIs('success'); - } - - public function testCustomFieldCheckboxPassesValidationForValidOptionsWithArray() - { - $model = AssetModel::factory()->create(); - $status = Statuslabel::factory()->create(); - - $this->settings->enableAutoIncrement(); - - $this->actingAsForApi(User::factory()->createAssets()->create()) - ->postJson(route('api.assets.store'), [ - 'model_id' => $model->id, - 'status_id' => $status->id, - '_snipeit_test_checkbox_7' => ['One', 'Two', 'Three'], - ]) - ->assertOk() - ->assertStatusMessageIs('success'); - } - - public function testCustomFieldCheckboxFailsValidationForInvalidOptionsWithString() - { - $model = AssetModel::factory()->create(); - $status = Statuslabel::factory()->create(); - - $this->settings->enableAutoIncrement(); - - $this->actingAsForApi(User::factory()->createAssets()->create()) - ->postJson(route('api.assets.store'), [ - 'model_id' => $model->id, - 'status_id' => $status->id, - '_snipeit_test_checkbox_7' => "One, Two, Four, Five", - ]) - ->assertStatusMessageIs('error'); - } - - public function testCustomFieldCheckboxFailsValidationForInvalidOptionsWithArray() - { - $model = AssetModel::factory()->create(); - $status = Statuslabel::factory()->create(); - - $this->settings->enableAutoIncrement(); - - $this->actingAsForApi(User::factory()->createAssets()->create()) - ->postJson(route('api.assets.store'), [ - 'model_id' => $model->id, - 'status_id' => $status->id, - '_snipeit_test_checkbox_7' => ['One', 'Two', 'Four', 'Five'] - ]) - ->assertStatusMessageIs('error'); - } + // Commenting these tests because they should be good, but there's a factory problem with + // custom fields that's preventing them from working properly. Leaving them here for now + // so that we can uncomment once we figure out how to resolve that. + //public function testCustomFieldCheckboxPassesValidationForValidOptionsWithString() + //{ + // $model = AssetModel::factory()->create(); + // $status = Statuslabel::factory()->create(); + // + // + // $this->settings->enableAutoIncrement(); + // + // $this->actingAsForApi(User::factory()->createAssets()->create()) + // ->postJson(route('api.assets.store'), [ + // 'model_id' => $model->id, + // 'status_id' => $status->id, + // '_snipeit_test_checkbox_7' => 'One, Two, Three', + // ]) + // ->assertOk() + // ->assertStatusMessageIs('success'); + //} + // + //public function testCustomFieldCheckboxPassesValidationForValidOptionsWithArray() + //{ + // $model = AssetModel::factory()->create(); + // $status = Statuslabel::factory()->create(); + // + // $this->settings->enableAutoIncrement(); + // + // $this->actingAsForApi(User::factory()->createAssets()->create()) + // ->postJson(route('api.assets.store'), [ + // 'model_id' => $model->id, + // 'status_id' => $status->id, + // '_snipeit_test_checkbox_7' => ['One', 'Two', 'Three'], + // ]) + // ->assertOk() + // ->assertStatusMessageIs('success'); + //} + // + //public function testCustomFieldCheckboxFailsValidationForInvalidOptionsWithString() + //{ + // $model = AssetModel::factory()->mbp13Model()->create(); + // $status = Statuslabel::factory()->create(); + // + // $this->settings->enableAutoIncrement(); + // + // $this->actingAsForApi(User::factory()->createAssets()->create()) + // ->postJson(route('api.assets.store'), [ + // 'model_id' => $model->id, + // 'status_id' => $status->id, + // '_snipeit_test_checkbox_7' => "One, Two, Four, Five", + // ]) + // ->assertStatusMessageIs('error'); + //} + // + //public function testCustomFieldCheckboxFailsValidationForInvalidOptionsWithArray() + //{ + // $model = AssetModel::factory()->mbp13Model()->create(); + // $status = Statuslabel::factory()->create(); + // + // $this->settings->enableAutoIncrement(); + // + // $this->actingAsForApi(User::factory()->createAssets()->create()) + // ->postJson(route('api.assets.store'), [ + // 'model_id' => $model->id, + // 'status_id' => $status->id, + // '_snipeit_test_checkbox_7' => ['One', 'Two', 'Four', 'Five'] + // ]) + // ->assertStatusMessageIs('error'); + //} } From 0fcf2239605b3d6463b40123c8ba9e6d9d620c7d Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 12 Mar 2024 12:00:10 -0700 Subject: [PATCH 27/78] Add minimal validation for asset_tags --- app/Http/Controllers/Assets/AssetsController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/Assets/AssetsController.php b/app/Http/Controllers/Assets/AssetsController.php index 0683a54e3a..6054718e6b 100755 --- a/app/Http/Controllers/Assets/AssetsController.php +++ b/app/Http/Controllers/Assets/AssetsController.php @@ -102,6 +102,10 @@ class AssetsController extends Controller { $this->authorize(Asset::class); + // There are a lot more rules to add here but prevents + // errors around `asset_tags` not being present below. + $this->validate($request, ['asset_tags' => ['required', 'array']]); + // Handle asset tags - there could be one, or potentially many. // This is only necessary on create, not update, since bulk editing is handled // differently From 8003615b1f1bb377afd157e74a8f9025395630f1 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 14 Mar 2024 14:15:11 -0700 Subject: [PATCH 28/78] Move InteractsWithSettings to TestCase --- tests/Feature/Api/Accessories/AccessoryCheckoutTest.php | 3 --- tests/Feature/Api/Assets/AssetCheckinTest.php | 3 --- tests/Feature/Api/Assets/AssetIndexTest.php | 3 --- tests/Feature/Api/Assets/AssetStoreTest.php | 4 ---- tests/Feature/Api/Assets/AssetsForSelectListTest.php | 3 --- tests/Feature/Api/Assets/RequestableAssetsTest.php | 3 --- tests/Feature/Api/Components/ComponentIndexTest.php | 3 --- tests/Feature/Api/Consumables/ConsumableCheckoutTest.php | 3 --- tests/Feature/Api/Consumables/ConsumablesIndexTest.php | 3 --- tests/Feature/Api/Departments/DepartmentIndexTest.php | 4 ---- tests/Feature/Api/Groups/GroupStoreTest.php | 3 --- tests/Feature/Api/Licenses/LicensesIndexTest.php | 3 --- tests/Feature/Api/Locations/LocationsForSelectListTest.php | 3 --- tests/Feature/Api/Users/UpdateUserApiTest.php | 7 ------- tests/Feature/Api/Users/UsersForSelectListTest.php | 3 --- tests/Feature/Api/Users/UsersSearchTest.php | 3 --- tests/Feature/Api/Users/UsersUpdateTest.php | 3 --- tests/Feature/Checkins/AccessoryCheckinTest.php | 3 --- tests/Feature/Checkins/AssetCheckinTest.php | 3 --- .../CheckoutAcceptances/AccessoryAcceptanceTest.php | 3 --- tests/Feature/Checkouts/AccessoryCheckoutTest.php | 3 --- tests/Feature/Checkouts/ConsumableCheckoutTest.php | 3 --- tests/Feature/Checkouts/LicenseCheckoutTest.php | 3 --- tests/Feature/DashboardTest.php | 3 --- tests/Feature/Notifications/AccessoryWebhookTest.php | 3 --- tests/Feature/Notifications/AssetWebhookTest.php | 3 --- tests/Feature/Notifications/ComponentWebhookTest.php | 4 ---- tests/Feature/Notifications/ConsumableWebhookTest.php | 3 --- tests/Feature/Notifications/LicenseWebhookTest.php | 3 --- tests/Feature/Reports/CustomReportTest.php | 4 ---- tests/Feature/Users/UpdateUserTest.php | 3 --- tests/TestCase.php | 1 + tests/Unit/AssetMaintenanceTest.php | 4 ---- tests/Unit/AssetModelTest.php | 3 --- tests/Unit/AssetTest.php | 3 --- tests/Unit/CategoryTest.php | 3 --- tests/Unit/CompanyScopingTest.php | 3 --- tests/Unit/ComponentTest.php | 3 --- tests/Unit/DepreciationTest.php | 3 --- tests/Unit/LdapTest.php | 3 --- tests/Unit/Models/Company/GetIdForCurrentUserTest.php | 3 --- tests/Unit/NotificationTest.php | 3 --- tests/Unit/SnipeModelTest.php | 3 --- 43 files changed, 1 insertion(+), 135 deletions(-) diff --git a/tests/Feature/Api/Accessories/AccessoryCheckoutTest.php b/tests/Feature/Api/Accessories/AccessoryCheckoutTest.php index d65a3ad613..854a96ada2 100644 --- a/tests/Feature/Api/Accessories/AccessoryCheckoutTest.php +++ b/tests/Feature/Api/Accessories/AccessoryCheckoutTest.php @@ -7,13 +7,10 @@ use App\Models\Actionlog; use App\Models\User; use App\Notifications\CheckoutAccessoryNotification; use Illuminate\Support\Facades\Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class AccessoryCheckoutTest extends TestCase { - use InteractsWithSettings; - public function testCheckingOutAccessoryRequiresCorrectPermission() { $this->actingAsForApi(User::factory()->create()) diff --git a/tests/Feature/Api/Assets/AssetCheckinTest.php b/tests/Feature/Api/Assets/AssetCheckinTest.php index 6f8daf5691..add90a067d 100644 --- a/tests/Feature/Api/Assets/AssetCheckinTest.php +++ b/tests/Feature/Api/Assets/AssetCheckinTest.php @@ -11,13 +11,10 @@ use App\Models\Statuslabel; use App\Models\User; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Event; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class AssetCheckinTest extends TestCase { - use InteractsWithSettings; - public function testCheckingInAssetRequiresCorrectPermission() { $this->actingAsForApi(User::factory()->create()) diff --git a/tests/Feature/Api/Assets/AssetIndexTest.php b/tests/Feature/Api/Assets/AssetIndexTest.php index 778483c1c9..3175db6953 100644 --- a/tests/Feature/Api/Assets/AssetIndexTest.php +++ b/tests/Feature/Api/Assets/AssetIndexTest.php @@ -6,13 +6,10 @@ use App\Models\Asset; use App\Models\Company; use App\Models\User; use Illuminate\Testing\Fluent\AssertableJson; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class AssetIndexTest extends TestCase { - use InteractsWithSettings; - public function testAssetIndexReturnsExpectedAssets() { Asset::factory()->count(3)->create(); diff --git a/tests/Feature/Api/Assets/AssetStoreTest.php b/tests/Feature/Api/Assets/AssetStoreTest.php index 92a58a5006..ceae053648 100644 --- a/tests/Feature/Api/Assets/AssetStoreTest.php +++ b/tests/Feature/Api/Assets/AssetStoreTest.php @@ -9,15 +9,11 @@ use App\Models\Location; use App\Models\Statuslabel; use App\Models\Supplier; use App\Models\User; -use Carbon\Carbon; use Illuminate\Testing\Fluent\AssertableJson; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class AssetStoreTest extends TestCase { - use InteractsWithSettings; - public function testRequiresPermissionToCreateAsset() { $this->actingAsForApi(User::factory()->create()) diff --git a/tests/Feature/Api/Assets/AssetsForSelectListTest.php b/tests/Feature/Api/Assets/AssetsForSelectListTest.php index cccae38d38..3c5e1e4e7c 100644 --- a/tests/Feature/Api/Assets/AssetsForSelectListTest.php +++ b/tests/Feature/Api/Assets/AssetsForSelectListTest.php @@ -5,13 +5,10 @@ namespace Tests\Feature\Api\Assets; use App\Models\Asset; use App\Models\Company; use App\Models\User; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class AssetsForSelectListTest extends TestCase { - use InteractsWithSettings; - public function testAssetsCanBeSearchedForByAssetTag() { Asset::factory()->create(['asset_tag' => '0001']); diff --git a/tests/Feature/Api/Assets/RequestableAssetsTest.php b/tests/Feature/Api/Assets/RequestableAssetsTest.php index 8649b1b00b..d90e45f223 100644 --- a/tests/Feature/Api/Assets/RequestableAssetsTest.php +++ b/tests/Feature/Api/Assets/RequestableAssetsTest.php @@ -5,13 +5,10 @@ namespace Tests\Feature\Api\Assets; use App\Models\Asset; use App\Models\Company; use App\Models\User; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class RequestableAssetsTest extends TestCase { - use InteractsWithSettings; - public function testViewingRequestableAssetsRequiresCorrectPermission() { $this->actingAsForApi(User::factory()->create()) diff --git a/tests/Feature/Api/Components/ComponentIndexTest.php b/tests/Feature/Api/Components/ComponentIndexTest.php index ee83b7a46d..517724a499 100644 --- a/tests/Feature/Api/Components/ComponentIndexTest.php +++ b/tests/Feature/Api/Components/ComponentIndexTest.php @@ -5,13 +5,10 @@ namespace Tests\Feature\Api\Components; use App\Models\Company; use App\Models\Component; use App\Models\User; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class ComponentIndexTest extends TestCase { - use InteractsWithSettings; - public function testComponentIndexAdheresToCompanyScoping() { [$companyA, $companyB] = Company::factory()->count(2)->create(); diff --git a/tests/Feature/Api/Consumables/ConsumableCheckoutTest.php b/tests/Feature/Api/Consumables/ConsumableCheckoutTest.php index 103be96ac2..1528e65aa3 100644 --- a/tests/Feature/Api/Consumables/ConsumableCheckoutTest.php +++ b/tests/Feature/Api/Consumables/ConsumableCheckoutTest.php @@ -7,13 +7,10 @@ use App\Models\Consumable; use App\Models\User; use App\Notifications\CheckoutConsumableNotification; use Illuminate\Support\Facades\Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class ConsumableCheckoutTest extends TestCase { - use InteractsWithSettings; - public function testCheckingOutConsumableRequiresCorrectPermission() { $this->actingAsForApi(User::factory()->create()) diff --git a/tests/Feature/Api/Consumables/ConsumablesIndexTest.php b/tests/Feature/Api/Consumables/ConsumablesIndexTest.php index 33c10ed078..00fa43da27 100644 --- a/tests/Feature/Api/Consumables/ConsumablesIndexTest.php +++ b/tests/Feature/Api/Consumables/ConsumablesIndexTest.php @@ -5,13 +5,10 @@ namespace Tests\Feature\Api\Consumables; use App\Models\Company; use App\Models\Consumable; use App\Models\User; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class ConsumablesIndexTest extends TestCase { - use InteractsWithSettings; - public function testConsumableIndexAdheresToCompanyScoping() { [$companyA, $companyB] = Company::factory()->count(2)->create(); diff --git a/tests/Feature/Api/Departments/DepartmentIndexTest.php b/tests/Feature/Api/Departments/DepartmentIndexTest.php index 1a3884308f..11ab5df9bc 100644 --- a/tests/Feature/Api/Departments/DepartmentIndexTest.php +++ b/tests/Feature/Api/Departments/DepartmentIndexTest.php @@ -5,15 +5,11 @@ namespace Tests\Feature\Api\Departments; use App\Models\Company; use App\Models\Department; use App\Models\User; -use Illuminate\Routing\Route; use Illuminate\Testing\Fluent\AssertableJson; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class DepartmentIndexTest extends TestCase { - use InteractsWithSettings; - public function testViewingDepartmentIndexRequiresAuthentication() { $this->getJson(route('api.departments.index'))->assertRedirect(); diff --git a/tests/Feature/Api/Groups/GroupStoreTest.php b/tests/Feature/Api/Groups/GroupStoreTest.php index 9ffba51913..31a69fb469 100644 --- a/tests/Feature/Api/Groups/GroupStoreTest.php +++ b/tests/Feature/Api/Groups/GroupStoreTest.php @@ -4,13 +4,10 @@ namespace Tests\Feature\Api\Groups; use App\Models\Group; use App\Models\User; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class GroupStoreTest extends TestCase { - use InteractsWithSettings; - public function testStoringGroupRequiresSuperAdminPermission() { $this->actingAsForApi(User::factory()->create()) diff --git a/tests/Feature/Api/Licenses/LicensesIndexTest.php b/tests/Feature/Api/Licenses/LicensesIndexTest.php index a21a27da73..603002a095 100644 --- a/tests/Feature/Api/Licenses/LicensesIndexTest.php +++ b/tests/Feature/Api/Licenses/LicensesIndexTest.php @@ -5,13 +5,10 @@ namespace Tests\Feature\Api\Licenses; use App\Models\Company; use App\Models\License; use App\Models\User; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class LicensesIndexTest extends TestCase { - use InteractsWithSettings; - public function testLicensesIndexAdheresToCompanyScoping() { [$companyA, $companyB] = Company::factory()->count(2)->create(); diff --git a/tests/Feature/Api/Locations/LocationsForSelectListTest.php b/tests/Feature/Api/Locations/LocationsForSelectListTest.php index 4170cfc7f7..bfc7fc5374 100644 --- a/tests/Feature/Api/Locations/LocationsForSelectListTest.php +++ b/tests/Feature/Api/Locations/LocationsForSelectListTest.php @@ -5,13 +5,10 @@ namespace Tests\Feature\Api\Locations; use App\Models\Location; use App\Models\User; use Illuminate\Testing\Fluent\AssertableJson; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class LocationsForSelectListTest extends TestCase { - use InteractsWithSettings; - public function testGettingLocationListRequiresProperPermission() { $this->actingAsForApi(User::factory()->create()) diff --git a/tests/Feature/Api/Users/UpdateUserApiTest.php b/tests/Feature/Api/Users/UpdateUserApiTest.php index 81c1154648..f58aae4a05 100644 --- a/tests/Feature/Api/Users/UpdateUserApiTest.php +++ b/tests/Feature/Api/Users/UpdateUserApiTest.php @@ -3,16 +3,10 @@ namespace Tests\Feature\Api\Users; use App\Models\User; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; -use Tests\Support\InteractsWithAuthentication; - class UpdateUserApiTest extends TestCase { - use InteractsWithSettings; - use InteractsWithAuthentication; - public function testApiUsersCanBeActivatedWithNumber() { $admin = User::factory()->superuser()->create(); @@ -64,5 +58,4 @@ class UpdateUserApiTest extends TestCase $this->assertEquals(0, $user->refresh()->activated); } - } diff --git a/tests/Feature/Api/Users/UsersForSelectListTest.php b/tests/Feature/Api/Users/UsersForSelectListTest.php index 8cdf700f04..1ebfcf72eb 100644 --- a/tests/Feature/Api/Users/UsersForSelectListTest.php +++ b/tests/Feature/Api/Users/UsersForSelectListTest.php @@ -6,13 +6,10 @@ use App\Models\Company; use App\Models\User; use Illuminate\Testing\Fluent\AssertableJson; use Laravel\Passport\Passport; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class UsersForSelectListTest extends TestCase { - use InteractsWithSettings; - public function testUsersAreReturned() { $users = User::factory()->superuser()->count(3)->create(); diff --git a/tests/Feature/Api/Users/UsersSearchTest.php b/tests/Feature/Api/Users/UsersSearchTest.php index 723a115db1..72f23017f5 100644 --- a/tests/Feature/Api/Users/UsersSearchTest.php +++ b/tests/Feature/Api/Users/UsersSearchTest.php @@ -5,13 +5,10 @@ namespace Tests\Feature\Api\Users; use App\Models\Company; use App\Models\User; use Laravel\Passport\Passport; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class UsersSearchTest extends TestCase { - use InteractsWithSettings; - public function testCanSearchByUserFirstAndLastName() { User::factory()->create(['first_name' => 'Luke', 'last_name' => 'Skywalker']); diff --git a/tests/Feature/Api/Users/UsersUpdateTest.php b/tests/Feature/Api/Users/UsersUpdateTest.php index 953a671cf1..d6e0f9e46b 100644 --- a/tests/Feature/Api/Users/UsersUpdateTest.php +++ b/tests/Feature/Api/Users/UsersUpdateTest.php @@ -8,13 +8,10 @@ use App\Models\Group; use App\Models\Location; use App\Models\User; use Illuminate\Support\Facades\Hash; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class UsersUpdateTest extends TestCase { - use InteractsWithSettings; - public function testCanUpdateUserViaPatch() { $admin = User::factory()->superuser()->create(); diff --git a/tests/Feature/Checkins/AccessoryCheckinTest.php b/tests/Feature/Checkins/AccessoryCheckinTest.php index 25cd5d0d87..56030991e2 100644 --- a/tests/Feature/Checkins/AccessoryCheckinTest.php +++ b/tests/Feature/Checkins/AccessoryCheckinTest.php @@ -8,13 +8,10 @@ use App\Models\User; use App\Notifications\CheckinAccessoryNotification; use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class AccessoryCheckinTest extends TestCase { - use InteractsWithSettings; - public function testCheckingInAccessoryRequiresCorrectPermission() { $accessory = Accessory::factory()->checkedOutToUser()->create(); diff --git a/tests/Feature/Checkins/AssetCheckinTest.php b/tests/Feature/Checkins/AssetCheckinTest.php index fb6d21a6ac..1e6d2b995b 100644 --- a/tests/Feature/Checkins/AssetCheckinTest.php +++ b/tests/Feature/Checkins/AssetCheckinTest.php @@ -11,13 +11,10 @@ use App\Models\Statuslabel; use App\Models\User; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Event; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class AssetCheckinTest extends TestCase { - use InteractsWithSettings; - public function testCheckingInAssetRequiresCorrectPermission() { $this->actingAs(User::factory()->create()) diff --git a/tests/Feature/CheckoutAcceptances/AccessoryAcceptanceTest.php b/tests/Feature/CheckoutAcceptances/AccessoryAcceptanceTest.php index a49b1167cb..bdaf0e780f 100644 --- a/tests/Feature/CheckoutAcceptances/AccessoryAcceptanceTest.php +++ b/tests/Feature/CheckoutAcceptances/AccessoryAcceptanceTest.php @@ -7,13 +7,10 @@ use App\Models\CheckoutAcceptance; use App\Notifications\AcceptanceAssetAcceptedNotification; use App\Notifications\AcceptanceAssetDeclinedNotification; use Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class AccessoryAcceptanceTest extends TestCase { - use InteractsWithSettings; - /** * This can be absorbed into a bigger test */ diff --git a/tests/Feature/Checkouts/AccessoryCheckoutTest.php b/tests/Feature/Checkouts/AccessoryCheckoutTest.php index cbe9801cc0..11224e4d1f 100644 --- a/tests/Feature/Checkouts/AccessoryCheckoutTest.php +++ b/tests/Feature/Checkouts/AccessoryCheckoutTest.php @@ -7,13 +7,10 @@ use App\Models\Actionlog; use App\Models\User; use App\Notifications\CheckoutAccessoryNotification; use Illuminate\Support\Facades\Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class AccessoryCheckoutTest extends TestCase { - use InteractsWithSettings; - public function testCheckingOutAccessoryRequiresCorrectPermission() { $this->actingAs(User::factory()->create()) diff --git a/tests/Feature/Checkouts/ConsumableCheckoutTest.php b/tests/Feature/Checkouts/ConsumableCheckoutTest.php index 5785d0572b..e38ae96c83 100644 --- a/tests/Feature/Checkouts/ConsumableCheckoutTest.php +++ b/tests/Feature/Checkouts/ConsumableCheckoutTest.php @@ -7,13 +7,10 @@ use App\Models\Consumable; use App\Models\User; use App\Notifications\CheckoutConsumableNotification; use Illuminate\Support\Facades\Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class ConsumableCheckoutTest extends TestCase { - use InteractsWithSettings; - public function testCheckingOutConsumableRequiresCorrectPermission() { $this->actingAs(User::factory()->create()) diff --git a/tests/Feature/Checkouts/LicenseCheckoutTest.php b/tests/Feature/Checkouts/LicenseCheckoutTest.php index 978fac28f2..2f4f51d4ac 100644 --- a/tests/Feature/Checkouts/LicenseCheckoutTest.php +++ b/tests/Feature/Checkouts/LicenseCheckoutTest.php @@ -6,13 +6,10 @@ use App\Models\Asset; use App\Models\License; use App\Models\LicenseSeat; use App\Models\User; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class LicenseCheckoutTest extends TestCase { - use InteractsWithSettings; - public function testNotesAreStoredInActionLogOnCheckoutToAsset() { $admin = User::factory()->superuser()->create(); diff --git a/tests/Feature/DashboardTest.php b/tests/Feature/DashboardTest.php index 4e9459fb06..4690a13901 100644 --- a/tests/Feature/DashboardTest.php +++ b/tests/Feature/DashboardTest.php @@ -3,13 +3,10 @@ namespace Tests\Feature; use App\Models\User; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class DashboardTest extends TestCase { - use InteractsWithSettings; - public function testUsersWithoutAdminAccessAreRedirected() { $this->actingAs(User::factory()->create()) diff --git a/tests/Feature/Notifications/AccessoryWebhookTest.php b/tests/Feature/Notifications/AccessoryWebhookTest.php index 2e3ef999ba..42a48c9ebe 100644 --- a/tests/Feature/Notifications/AccessoryWebhookTest.php +++ b/tests/Feature/Notifications/AccessoryWebhookTest.php @@ -11,13 +11,10 @@ use App\Notifications\CheckinAccessoryNotification; use App\Notifications\CheckoutAccessoryNotification; use Illuminate\Notifications\AnonymousNotifiable; use Illuminate\Support\Facades\Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class AccessoryWebhookTest extends TestCase { - use InteractsWithSettings; - public function testAccessoryCheckoutSendsWebhookNotificationWhenSettingEnabled() { Notification::fake(); diff --git a/tests/Feature/Notifications/AssetWebhookTest.php b/tests/Feature/Notifications/AssetWebhookTest.php index 95218f98e7..93da395a37 100644 --- a/tests/Feature/Notifications/AssetWebhookTest.php +++ b/tests/Feature/Notifications/AssetWebhookTest.php @@ -12,13 +12,10 @@ use App\Notifications\CheckinAssetNotification; use App\Notifications\CheckoutAssetNotification; use Illuminate\Notifications\AnonymousNotifiable; use Illuminate\Support\Facades\Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class AssetWebhookTest extends TestCase { - use InteractsWithSettings; - public function targets(): array { return [ diff --git a/tests/Feature/Notifications/ComponentWebhookTest.php b/tests/Feature/Notifications/ComponentWebhookTest.php index 2e2a535219..f6aa8a6689 100644 --- a/tests/Feature/Notifications/ComponentWebhookTest.php +++ b/tests/Feature/Notifications/ComponentWebhookTest.php @@ -8,14 +8,10 @@ use App\Models\Asset; use App\Models\Component; use App\Models\User; use Illuminate\Support\Facades\Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class ComponentWebhookTest extends TestCase { - - use InteractsWithSettings; - public function testComponentCheckoutDoesNotSendWebhookNotification() { Notification::fake(); diff --git a/tests/Feature/Notifications/ConsumableWebhookTest.php b/tests/Feature/Notifications/ConsumableWebhookTest.php index 2815731bd2..2a1126f917 100644 --- a/tests/Feature/Notifications/ConsumableWebhookTest.php +++ b/tests/Feature/Notifications/ConsumableWebhookTest.php @@ -9,13 +9,10 @@ use App\Models\User; use App\Notifications\CheckoutConsumableNotification; use Illuminate\Notifications\AnonymousNotifiable; use Illuminate\Support\Facades\Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class ConsumableWebhookTest extends TestCase { - use InteractsWithSettings; - public function testConsumableCheckoutSendsWebhookNotificationWhenSettingEnabled() { Notification::fake(); diff --git a/tests/Feature/Notifications/LicenseWebhookTest.php b/tests/Feature/Notifications/LicenseWebhookTest.php index 24ec53a75e..2ee14f9134 100644 --- a/tests/Feature/Notifications/LicenseWebhookTest.php +++ b/tests/Feature/Notifications/LicenseWebhookTest.php @@ -12,13 +12,10 @@ use App\Notifications\CheckinLicenseSeatNotification; use App\Notifications\CheckoutLicenseSeatNotification; use Illuminate\Notifications\AnonymousNotifiable; use Illuminate\Support\Facades\Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class LicenseWebhookTest extends TestCase { - use InteractsWithSettings; - public function targets(): array { return [ diff --git a/tests/Feature/Reports/CustomReportTest.php b/tests/Feature/Reports/CustomReportTest.php index dd3199212e..d90e4cb2a0 100644 --- a/tests/Feature/Reports/CustomReportTest.php +++ b/tests/Feature/Reports/CustomReportTest.php @@ -8,14 +8,10 @@ use App\Models\User; use Illuminate\Testing\TestResponse; use League\Csv\Reader; use PHPUnit\Framework\Assert; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; - class CustomReportTest extends TestCase { - use InteractsWithSettings; - protected function setUp(): void { parent::setUp(); diff --git a/tests/Feature/Users/UpdateUserTest.php b/tests/Feature/Users/UpdateUserTest.php index 92245059ef..934fbce2b8 100644 --- a/tests/Feature/Users/UpdateUserTest.php +++ b/tests/Feature/Users/UpdateUserTest.php @@ -3,13 +3,10 @@ namespace Tests\Feature\Users; use App\Models\User; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class UpdateUserTest extends TestCase { - use InteractsWithSettings; - public function testUsersCanBeActivatedWithNumber() { $admin = User::factory()->superuser()->create(); diff --git a/tests/TestCase.php b/tests/TestCase.php index 03f273ad6f..9b77eeb328 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -15,6 +15,7 @@ abstract class TestCase extends BaseTestCase use CreatesApplication; use CustomTestMacros; use InteractsWithAuthentication; + use InteractsWithSettings; use LazilyRefreshDatabase; private array $globallyDisabledMiddleware = [ diff --git a/tests/Unit/AssetMaintenanceTest.php b/tests/Unit/AssetMaintenanceTest.php index 69c4c30938..46a0efdd7c 100644 --- a/tests/Unit/AssetMaintenanceTest.php +++ b/tests/Unit/AssetMaintenanceTest.php @@ -2,14 +2,10 @@ namespace Tests\Unit; use App\Models\AssetMaintenance; -use Carbon\Carbon; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class AssetMaintenanceTest extends TestCase { - use InteractsWithSettings; - public function testZerosOutWarrantyIfBlank() { $c = new AssetMaintenance; diff --git a/tests/Unit/AssetModelTest.php b/tests/Unit/AssetModelTest.php index aec8edf692..4cc62e20a0 100644 --- a/tests/Unit/AssetModelTest.php +++ b/tests/Unit/AssetModelTest.php @@ -4,13 +4,10 @@ namespace Tests\Unit; use App\Models\Asset; use App\Models\Category; use App\Models\AssetModel; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class AssetModelTest extends TestCase { - use InteractsWithSettings; - public function testAnAssetModelContainsAssets() { $category = Category::factory()->create([ diff --git a/tests/Unit/AssetTest.php b/tests/Unit/AssetTest.php index 7670d10753..913d9f639e 100644 --- a/tests/Unit/AssetTest.php +++ b/tests/Unit/AssetTest.php @@ -5,13 +5,10 @@ use App\Models\Asset; use App\Models\AssetModel; use App\Models\Category; use Carbon\Carbon; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class AssetTest extends TestCase { - use InteractsWithSettings; - public function testAutoIncrement() { $this->settings->enableAutoIncrement(); diff --git a/tests/Unit/CategoryTest.php b/tests/Unit/CategoryTest.php index c74597b1b4..387ed946e0 100644 --- a/tests/Unit/CategoryTest.php +++ b/tests/Unit/CategoryTest.php @@ -4,13 +4,10 @@ namespace Tests\Unit; use App\Models\Category; use App\Models\AssetModel; use App\Models\Asset; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class CategoryTest extends TestCase { - use InteractsWithSettings; - public function testFailsEmptyValidation() { // An Asset requires a name, a qty, and a category_id. diff --git a/tests/Unit/CompanyScopingTest.php b/tests/Unit/CompanyScopingTest.php index 669dd5ed41..3923dd9f7d 100644 --- a/tests/Unit/CompanyScopingTest.php +++ b/tests/Unit/CompanyScopingTest.php @@ -12,13 +12,10 @@ use App\Models\License; use App\Models\LicenseSeat; use App\Models\User; use Illuminate\Database\Eloquent\Model; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class CompanyScopingTest extends TestCase { - use InteractsWithSettings; - public function models(): array { return [ diff --git a/tests/Unit/ComponentTest.php b/tests/Unit/ComponentTest.php index 8f71057bfc..df8f64771f 100644 --- a/tests/Unit/ComponentTest.php +++ b/tests/Unit/ComponentTest.php @@ -5,13 +5,10 @@ use App\Models\Category; use App\Models\Company; use App\Models\Component; use App\Models\Location; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class ComponentTest extends TestCase { - use InteractsWithSettings; - public function testAComponentBelongsToACompany() { $component = Component::factory() diff --git a/tests/Unit/DepreciationTest.php b/tests/Unit/DepreciationTest.php index ed033cf442..4dd8422276 100644 --- a/tests/Unit/DepreciationTest.php +++ b/tests/Unit/DepreciationTest.php @@ -5,13 +5,10 @@ use App\Models\Depreciation; use App\Models\Category; use App\Models\License; use App\Models\AssetModel; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class DepreciationTest extends TestCase { - use InteractsWithSettings; - public function testADepreciationHasModels() { $depreciation = Depreciation::factory()->create(); diff --git a/tests/Unit/LdapTest.php b/tests/Unit/LdapTest.php index c286b38496..6beb0d2118 100644 --- a/tests/Unit/LdapTest.php +++ b/tests/Unit/LdapTest.php @@ -3,8 +3,6 @@ namespace Tests\Unit; use App\Models\Ldap; -use Exception; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; /** @@ -12,7 +10,6 @@ use Tests\TestCase; */ class LdapTest extends TestCase { - use InteractsWithSettings; use \phpmock\phpunit\PHPMock; public function testConnect() diff --git a/tests/Unit/Models/Company/GetIdForCurrentUserTest.php b/tests/Unit/Models/Company/GetIdForCurrentUserTest.php index 1ca88d7cac..6d77c88731 100644 --- a/tests/Unit/Models/Company/GetIdForCurrentUserTest.php +++ b/tests/Unit/Models/Company/GetIdForCurrentUserTest.php @@ -4,13 +4,10 @@ namespace Tests\Unit\Models\Company; use App\Models\Company; use App\Models\User; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class GetIdForCurrentUserTest extends TestCase { - use InteractsWithSettings; - public function testReturnsProvidedValueWhenFullCompanySupportDisabled() { $this->settings->disableMultipleFullCompanySupport(); diff --git a/tests/Unit/NotificationTest.php b/tests/Unit/NotificationTest.php index 64cf8afb0a..8005759a1e 100644 --- a/tests/Unit/NotificationTest.php +++ b/tests/Unit/NotificationTest.php @@ -8,13 +8,10 @@ use App\Models\Category; use Carbon\Carbon; use App\Notifications\CheckoutAssetNotification; use Illuminate\Support\Facades\Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class NotificationTest extends TestCase { - use InteractsWithSettings; - public function testAUserIsEmailedIfTheyCheckoutAnAssetWithEULA() { $admin = User::factory()->superuser()->create(); diff --git a/tests/Unit/SnipeModelTest.php b/tests/Unit/SnipeModelTest.php index ad4231010f..2bc81da61b 100644 --- a/tests/Unit/SnipeModelTest.php +++ b/tests/Unit/SnipeModelTest.php @@ -2,13 +2,10 @@ namespace Tests\Unit; use App\Models\SnipeModel; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; class SnipeModelTest extends TestCase { - use InteractsWithSettings; - public function testSetsPurchaseDatesAppropriately() { $c = new SnipeModel; From 95ff692b14a16ad90df44d4c45b40fc8cecde082 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 14 Mar 2024 15:06:52 -0700 Subject: [PATCH 29/78] Improve InteractsWithSettings name --- ...{InteractsWithSettings.php => InitializesSettings.php} | 2 +- tests/TestCase.php | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) rename tests/Support/{InteractsWithSettings.php => InitializesSettings.php} (90%) diff --git a/tests/Support/InteractsWithSettings.php b/tests/Support/InitializesSettings.php similarity index 90% rename from tests/Support/InteractsWithSettings.php rename to tests/Support/InitializesSettings.php index a8c0070188..7c08e6f897 100644 --- a/tests/Support/InteractsWithSettings.php +++ b/tests/Support/InitializesSettings.php @@ -4,7 +4,7 @@ namespace Tests\Support; use App\Models\Setting; -trait InteractsWithSettings +trait InitializesSettings { protected Settings $settings; diff --git a/tests/TestCase.php b/tests/TestCase.php index 9b77eeb328..8a3321ac62 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -8,14 +8,14 @@ use Illuminate\Foundation\Testing\TestCase as BaseTestCase; use RuntimeException; use Tests\Support\CustomTestMacros; use Tests\Support\InteractsWithAuthentication; -use Tests\Support\InteractsWithSettings; +use Tests\Support\InitializesSettings; abstract class TestCase extends BaseTestCase { use CreatesApplication; use CustomTestMacros; use InteractsWithAuthentication; - use InteractsWithSettings; + use InitializesSettings; use LazilyRefreshDatabase; private array $globallyDisabledMiddleware = [ @@ -34,9 +34,7 @@ abstract class TestCase extends BaseTestCase $this->withoutMiddleware($this->globallyDisabledMiddleware); - if (collect(class_uses_recursive($this))->contains(InteractsWithSettings::class)) { - $this->initializeSettings(); - } + $this->initializeSettings(); $this->registerCustomMacros(); } From fb648929712ab4dc7adca1b7916a549fe4896ea4 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 14 Mar 2024 16:26:27 -0700 Subject: [PATCH 30/78] Re-order --- tests/TestCase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index 8a3321ac62..9bb7f56e17 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -32,10 +32,10 @@ abstract class TestCase extends BaseTestCase parent::setUp(); + $this->registerCustomMacros(); + $this->withoutMiddleware($this->globallyDisabledMiddleware); $this->initializeSettings(); - - $this->registerCustomMacros(); } } From a28bee86ba1b980db6b76a01e804e51d240c4e3b Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 14 Mar 2024 16:33:49 -0700 Subject: [PATCH 31/78] Extract method --- tests/TestCase.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index 9bb7f56e17..f9f4dbae58 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -24,11 +24,7 @@ abstract class TestCase extends BaseTestCase protected function setUp(): void { - if (!file_exists(realpath(__DIR__ . '/../') . '/.env.testing')) { - throw new RuntimeException( - '.env.testing file does not exist. Aborting to avoid wiping your local database' - ); - } + $this->guardAgainstMissingEnv(); parent::setUp(); @@ -38,4 +34,13 @@ abstract class TestCase extends BaseTestCase $this->initializeSettings(); } + + private function guardAgainstMissingEnv(): void + { + if (!file_exists(realpath(__DIR__ . '/../') . '/.env.testing')) { + throw new RuntimeException( + '.env.testing file does not exist. Aborting to avoid wiping your local database.' + ); + } + } } From d1dffb84dca52101a9fd1589e47baeb3498ca8a8 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 18 Mar 2024 12:33:45 -0700 Subject: [PATCH 32/78] Remove InteractsWithSettings trait for remaining tests --- .../Notifications/Email/EmailNotificationsUponCheckinTest.php | 3 --- .../Webhooks/SlackNotificationsUponCheckinTest.php | 3 --- .../Webhooks/SlackNotificationsUponCheckoutTest.php | 3 --- 3 files changed, 9 deletions(-) diff --git a/tests/Feature/Notifications/Email/EmailNotificationsUponCheckinTest.php b/tests/Feature/Notifications/Email/EmailNotificationsUponCheckinTest.php index dbe79c5727..4ae415f1ee 100644 --- a/tests/Feature/Notifications/Email/EmailNotificationsUponCheckinTest.php +++ b/tests/Feature/Notifications/Email/EmailNotificationsUponCheckinTest.php @@ -7,7 +7,6 @@ use App\Models\Asset; use App\Models\User; use App\Notifications\CheckinAssetNotification; use Illuminate\Support\Facades\Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; /** @@ -15,8 +14,6 @@ use Tests\TestCase; */ class EmailNotificationsUponCheckinTest extends TestCase { - use InteractsWithSettings; - protected function setUp(): void { parent::setUp(); diff --git a/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckinTest.php b/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckinTest.php index b6bb7801a7..29bf06d9dc 100644 --- a/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckinTest.php +++ b/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckinTest.php @@ -14,7 +14,6 @@ use App\Notifications\CheckinAssetNotification; use App\Notifications\CheckinLicenseSeatNotification; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; /** @@ -22,8 +21,6 @@ use Tests\TestCase; */ class SlackNotificationsUponCheckinTest extends TestCase { - use InteractsWithSettings; - protected function setUp(): void { parent::setUp(); diff --git a/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckoutTest.php b/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckoutTest.php index 550f7c5b18..048448cad7 100644 --- a/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckoutTest.php +++ b/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckoutTest.php @@ -16,7 +16,6 @@ use App\Notifications\CheckoutConsumableNotification; use App\Notifications\CheckoutLicenseSeatNotification; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Notification; -use Tests\Support\InteractsWithSettings; use Tests\TestCase; /** @@ -24,8 +23,6 @@ use Tests\TestCase; */ class SlackNotificationsUponCheckoutTest extends TestCase { - use InteractsWithSettings; - protected function setUp(): void { parent::setUp(); From 417caae58901f831e5d771c3ca96361ff188ce26 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 20 Mar 2024 12:07:18 +0000 Subject: [PATCH 33/78] Added translation Signed-off-by: snipe --- app/Presenters/UserPresenter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Presenters/UserPresenter.php b/app/Presenters/UserPresenter.php index 211057c548..f023569f9e 100644 --- a/app/Presenters/UserPresenter.php +++ b/app/Presenters/UserPresenter.php @@ -38,7 +38,7 @@ class UserPresenter extends Presenter 'searchable' => false, 'sortable' => false, 'switchable' => true, - 'title' => 'Avatar', + 'title' => trans('general.importer.avatar'), 'visible' => false, 'formatter' => 'imageFormatter', ], From 0d124bb5a1a04a30517deebf99a71f716dff7008 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 20 Mar 2024 12:08:35 +0000 Subject: [PATCH 34/78] Fixed indent Signed-off-by: snipe --- resources/views/partials/bootstrap-table.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 95f2785b61..a7a4666f93 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -85,7 +85,7 @@ export: 'fa-download', clearSearch: 'fa-times' }, - exportOptions: export_options, + exportOptions: export_options, exportTypes: ['xlsx', 'excel', 'csv', 'pdf','json', 'xml', 'txt', 'sql', 'doc' ], onLoadSuccess: function () { $('[data-tooltip="true"]').tooltip(); // Needed to attach tooltips after ajax call From 278a25c63b8fdfa50934b1c720d6cd053b8bf35e Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 20 Mar 2024 12:14:41 +0000 Subject: [PATCH 35/78] Added toggle all to column selector Signed-off-by: snipe --- app/Presenters/AssetPresenter.php | 1 + app/Presenters/LocationPresenter.php | 1 + app/Presenters/UserPresenter.php | 2 +- resources/views/hardware/index.blade.php | 1 + resources/views/locations/index.blade.php | 1 + resources/views/users/index.blade.php | 1 + 6 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Presenters/AssetPresenter.php b/app/Presenters/AssetPresenter.php index dd88b07fde..711a3424c5 100644 --- a/app/Presenters/AssetPresenter.php +++ b/app/Presenters/AssetPresenter.php @@ -55,6 +55,7 @@ class AssetPresenter extends Presenter 'field' => 'asset_tag', 'searchable' => true, 'sortable' => true, + 'switchable' => false, 'title' => trans('admin/hardware/table.asset_tag'), 'visible' => true, 'formatter' => 'hardwareLinkFormatter', diff --git a/app/Presenters/LocationPresenter.php b/app/Presenters/LocationPresenter.php index 6a9bc0b568..56d710ac96 100644 --- a/app/Presenters/LocationPresenter.php +++ b/app/Presenters/LocationPresenter.php @@ -31,6 +31,7 @@ class LocationPresenter extends Presenter 'field' => 'name', 'searchable' => true, 'sortable' => true, + 'switchable' => false, 'title' => trans('admin/locations/table.name'), 'visible' => true, 'formatter' => 'locationsLinkFormatter', diff --git a/app/Presenters/UserPresenter.php b/app/Presenters/UserPresenter.php index f023569f9e..4726205c72 100644 --- a/app/Presenters/UserPresenter.php +++ b/app/Presenters/UserPresenter.php @@ -175,7 +175,7 @@ class UserPresenter extends Presenter 'field' => 'username', 'searchable' => true, 'sortable' => true, - 'switchable' => true, + 'switchable' => false, 'title' => trans('admin/users/table.username'), 'visible' => true, 'formatter' => 'usersLinkFormatter', diff --git a/resources/views/hardware/index.blade.php b/resources/views/hardware/index.blade.php index d30a1c012a..ffc2668d40 100755 --- a/resources/views/hardware/index.blade.php +++ b/resources/views/hardware/index.blade.php @@ -75,6 +75,7 @@ data-search="true" data-side-pagination="server" data-show-columns="true" + data-show-columns-toggle-all="true" data-show-export="true" data-show-footer="true" data-show-refresh="true" diff --git a/resources/views/locations/index.blade.php b/resources/views/locations/index.blade.php index 2d020cb026..c21ad47fe8 100755 --- a/resources/views/locations/index.blade.php +++ b/resources/views/locations/index.blade.php @@ -35,6 +35,7 @@ data-show-footer="true" data-side-pagination="server" data-show-columns="true" + data-show-columns-toggle-all="true" data-show-fullscreen="true" data-show-export="true" data-show-refresh="true" diff --git a/resources/views/users/index.blade.php b/resources/views/users/index.blade.php index 91b9a2a318..306722f87f 100755 --- a/resources/views/users/index.blade.php +++ b/resources/views/users/index.blade.php @@ -44,6 +44,7 @@ Date: Wed, 20 Mar 2024 18:55:47 +0000 Subject: [PATCH 36/78] Added default location to print all assigned Signed-off-by: snipe --- resources/views/users/print.blade.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/views/users/print.blade.php b/resources/views/users/print.blade.php index 324fda1b0f..2c9b4719f2 100644 --- a/resources/views/users/print.blade.php +++ b/resources/views/users/print.blade.php @@ -110,6 +110,7 @@ + @@ -129,6 +130,7 @@ + + From e5d01170d26ccf8d0917a25ffe613c08ba787a1a Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 20 Mar 2024 21:24:59 +0000 Subject: [PATCH 37/78] Fixed locale, added showColumnsToggleAll and minimumCountColumns Signed-off-by: snipe --- resources/views/partials/bootstrap-table.blade.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index a7a4666f93..b4f47c6a3c 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -46,12 +46,14 @@ stickyHeader: true, stickyHeaderOffsetLeft: parseInt($('body').css('padding-left'), 10), stickyHeaderOffsetRight: parseInt($('body').css('padding-right'), 10), - locale: locale, + locale: '{{ app()->getLocale() }}', undefinedText: '', iconsPrefix: 'fa', cookieStorage: '{{ config('session.bs_table_storage') }}', cookie: true, cookieExpire: '2y', + showColumnsToggleAll: true, + minimumCountColumns: 2, mobileResponsive: true, maintainSelected: true, trimOnSearch: false, From 1f586d3102da96a1990e125ca20df1621c38fda1 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 20 Mar 2024 21:25:16 +0000 Subject: [PATCH 38/78] Removed data-show-columns-toggle-all data attribute Signed-off-by: snipe --- resources/views/hardware/index.blade.php | 1 - resources/views/locations/index.blade.php | 1 - resources/views/users/index.blade.php | 1 - 3 files changed, 3 deletions(-) diff --git a/resources/views/hardware/index.blade.php b/resources/views/hardware/index.blade.php index ffc2668d40..d30a1c012a 100755 --- a/resources/views/hardware/index.blade.php +++ b/resources/views/hardware/index.blade.php @@ -75,7 +75,6 @@ data-search="true" data-side-pagination="server" data-show-columns="true" - data-show-columns-toggle-all="true" data-show-export="true" data-show-footer="true" data-show-refresh="true" diff --git a/resources/views/locations/index.blade.php b/resources/views/locations/index.blade.php index c21ad47fe8..2d020cb026 100755 --- a/resources/views/locations/index.blade.php +++ b/resources/views/locations/index.blade.php @@ -35,7 +35,6 @@ data-show-footer="true" data-side-pagination="server" data-show-columns="true" - data-show-columns-toggle-all="true" data-show-fullscreen="true" data-show-export="true" data-show-refresh="true" diff --git a/resources/views/users/index.blade.php b/resources/views/users/index.blade.php index 306722f87f..91b9a2a318 100755 --- a/resources/views/users/index.blade.php +++ b/resources/views/users/index.blade.php @@ -44,7 +44,6 @@
{{ trans('general.name') }} {{ trans('general.category') }} {{ trans('admin/hardware/form.model') }}{{ trans('admin/hardware/form.default_location') }} {{ trans('general.location') }} {{ trans('admin/hardware/form.serial') }} {{ trans('admin/hardware/table.checkout_date') }}{{ $asset->name }} {{ (($asset->model) && ($asset->model->category)) ? $asset->model->category->name : trans('general.invalid_category') }} {{ ($asset->model) ? $asset->model->name : trans('general.invalid_model') }}{{ ($asset->defaultLoc) ? $asset->defaultLoc->name : '' }} {{ ($asset->location) ? $asset->location->name : '' }} {{ $asset->serial }} @@ -155,6 +157,7 @@ {{ $asset->asset_tag }} {{ $asset->name }} {{ $asset->model->category->name }}{{ ($asset->defaultLoc) ? $asset->defaultLoc->name : '' }} {{ ($asset->location) ? $asset->location->name : '' }} {{ $asset->model->name }} {{ $asset->serial }}
Date: Wed, 20 Mar 2024 21:25:50 +0000 Subject: [PATCH 39/78] Set names and actions to switchable = false Signed-off-by: snipe --- app/Presenters/AccessoryPresenter.php | 1 + app/Presenters/AssetMaintenancesPresenter.php | 1 + app/Presenters/AssetModelPresenter.php | 1 + app/Presenters/AssetPresenter.php | 2 +- app/Presenters/CategoryPresenter.php | 1 + app/Presenters/CompanyPresenter.php | 2 +- app/Presenters/ComponentPresenter.php | 2 +- app/Presenters/ConsumablePresenter.php | 1 + app/Presenters/DepreciationPresenter.php | 1 + app/Presenters/DepreciationReportPresenter.php | 1 + app/Presenters/LicensePresenter.php | 5 +++-- app/Presenters/ManufacturerPresenter.php | 1 + 12 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/Presenters/AccessoryPresenter.php b/app/Presenters/AccessoryPresenter.php index cc4f9badfc..fd6122cab7 100644 --- a/app/Presenters/AccessoryPresenter.php +++ b/app/Presenters/AccessoryPresenter.php @@ -41,6 +41,7 @@ class AccessoryPresenter extends Presenter 'field' => 'name', 'searchable' => true, 'sortable' => true, + 'switchable' => false, 'title' => trans('general.name'), 'formatter' => 'accessoriesLinkFormatter', ], [ diff --git a/app/Presenters/AssetMaintenancesPresenter.php b/app/Presenters/AssetMaintenancesPresenter.php index 5f9694b44c..3908720dc3 100644 --- a/app/Presenters/AssetMaintenancesPresenter.php +++ b/app/Presenters/AssetMaintenancesPresenter.php @@ -85,6 +85,7 @@ class AssetMaintenancesPresenter extends Presenter 'field' => 'title', 'searchable' => true, 'sortable' => true, + 'switchable' => false, 'title' => trans('admin/asset_maintenances/form.title'), ], [ 'field' => 'start_date', diff --git a/app/Presenters/AssetModelPresenter.php b/app/Presenters/AssetModelPresenter.php index 85a0fa58ec..da93092b91 100644 --- a/app/Presenters/AssetModelPresenter.php +++ b/app/Presenters/AssetModelPresenter.php @@ -35,6 +35,7 @@ class AssetModelPresenter extends Presenter 'field' => 'name', 'searchable' => true, 'sortable' => true, + 'switchable' => false, 'visible' => true, 'title' => trans('general.name'), 'formatter' => 'modelsLinkFormatter', diff --git a/app/Presenters/AssetPresenter.php b/app/Presenters/AssetPresenter.php index 711a3424c5..5f900a6a83 100644 --- a/app/Presenters/AssetPresenter.php +++ b/app/Presenters/AssetPresenter.php @@ -317,7 +317,7 @@ class AssetPresenter extends Presenter 'field' => 'checkincheckout', 'searchable' => false, 'sortable' => false, - 'switchable' => true, + 'switchable' => false, 'title' => trans('general.checkin').'/'.trans('general.checkout'), 'visible' => true, 'formatter' => 'hardwareInOutFormatter', diff --git a/app/Presenters/CategoryPresenter.php b/app/Presenters/CategoryPresenter.php index e9276a3417..fbf431637c 100644 --- a/app/Presenters/CategoryPresenter.php +++ b/app/Presenters/CategoryPresenter.php @@ -25,6 +25,7 @@ class CategoryPresenter extends Presenter 'field' => 'name', 'searchable' => true, 'sortable' => true, + 'switchable' => false, 'title' => trans('general.name'), 'visible' => true, 'formatter' => 'categoriesLinkFormatter', diff --git a/app/Presenters/CompanyPresenter.php b/app/Presenters/CompanyPresenter.php index ec2e7cfc5a..7603191fc1 100644 --- a/app/Presenters/CompanyPresenter.php +++ b/app/Presenters/CompanyPresenter.php @@ -25,7 +25,7 @@ class CompanyPresenter extends Presenter 'field' => 'name', 'searchable' => true, 'sortable' => true, - 'switchable' => true, + 'switchable' => false, 'title' => trans('admin/companies/table.name'), 'visible' => true, 'formatter' => 'companiesLinkFormatter', diff --git a/app/Presenters/ComponentPresenter.php b/app/Presenters/ComponentPresenter.php index c7468911a1..d142d7abc2 100644 --- a/app/Presenters/ComponentPresenter.php +++ b/app/Presenters/ComponentPresenter.php @@ -126,7 +126,7 @@ class ComponentPresenter extends Presenter 'field' => 'checkincheckout', 'searchable' => false, 'sortable' => false, - 'switchable' => true, + 'switchable' => false, 'title' => trans('general.checkin').'/'.trans('general.checkout'), 'visible' => true, 'formatter' => 'componentsInOutFormatter', diff --git a/app/Presenters/ConsumablePresenter.php b/app/Presenters/ConsumablePresenter.php index abb599de4f..d3e73de1cf 100644 --- a/app/Presenters/ConsumablePresenter.php +++ b/app/Presenters/ConsumablePresenter.php @@ -35,6 +35,7 @@ class ConsumablePresenter extends Presenter 'field' => 'name', 'searchable' => true, 'sortable' => true, + 'switchable' => false, 'title' => trans('general.name'), 'visible' => true, 'formatter' => 'consumablesLinkFormatter', diff --git a/app/Presenters/DepreciationPresenter.php b/app/Presenters/DepreciationPresenter.php index 2a293a46ff..9df1fe1322 100644 --- a/app/Presenters/DepreciationPresenter.php +++ b/app/Presenters/DepreciationPresenter.php @@ -25,6 +25,7 @@ class DepreciationPresenter extends Presenter 'field' => 'name', 'searchable' => true, 'sortable' => true, + 'switchable' => false, 'title' => trans('general.name'), 'visible' => true, 'formatter' => 'depreciationsLinkFormatter', diff --git a/app/Presenters/DepreciationReportPresenter.php b/app/Presenters/DepreciationReportPresenter.php index ea88342372..50a8b73b54 100644 --- a/app/Presenters/DepreciationReportPresenter.php +++ b/app/Presenters/DepreciationReportPresenter.php @@ -34,6 +34,7 @@ class DepreciationReportPresenter extends Presenter "field" => "name", "searchable" => true, "sortable" => true, + 'switchable' => false, "title" => trans('admin/hardware/form.name'), "visible" => false, ], [ diff --git a/app/Presenters/LicensePresenter.php b/app/Presenters/LicensePresenter.php index c5c8982664..8ca8e120f2 100644 --- a/app/Presenters/LicensePresenter.php +++ b/app/Presenters/LicensePresenter.php @@ -33,6 +33,7 @@ class LicensePresenter extends Presenter 'field' => 'name', 'searchable' => true, 'sortable' => true, + 'switchable' => false, 'title' => trans('general.name'), 'formatter' => 'licensesLinkFormatter', ], [ @@ -186,7 +187,7 @@ class LicensePresenter extends Presenter 'field' => 'checkincheckout', 'searchable' => false, 'sortable' => false, - 'switchable' => true, + 'switchable' => false, 'title' => trans('general.checkin').'/'.trans('general.checkout'), 'visible' => true, 'formatter' => 'licensesInOutFormatter', @@ -280,7 +281,7 @@ class LicensePresenter extends Presenter 'field' => 'checkincheckout', 'searchable' => false, 'sortable' => false, - 'switchable' => true, + 'switchable' => false, 'title' => trans('general.checkin').'/'.trans('general.checkout'), 'visible' => true, 'formatter' => 'licenseSeatInOutFormatter', diff --git a/app/Presenters/ManufacturerPresenter.php b/app/Presenters/ManufacturerPresenter.php index ad6b5443bf..3e36cbcde0 100644 --- a/app/Presenters/ManufacturerPresenter.php +++ b/app/Presenters/ManufacturerPresenter.php @@ -27,6 +27,7 @@ class ManufacturerPresenter extends Presenter 'field' => 'name', 'searchable' => true, 'sortable' => true, + 'switchable' => false, 'title' => trans('admin/manufacturers/table.name'), 'visible' => true, 'formatter' => 'manufacturersLinkFormatter', From f2a5eac2561158b15970423aabb0e8f0fbef407c Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 20 Mar 2024 23:43:05 +0000 Subject: [PATCH 40/78] Tightened up 2FA text Signed-off-by: snipe --- resources/views/users/edit.blade.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index 8d24e440b8..98fd991248 100755 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -702,7 +702,7 @@ $(document).ready(function() { $("#two_factor_resetrow").removeClass('success'); $("#two_factor_resetrow").removeClass('danger'); $("#two_factor_resetstatus").html(''); - $("#two_factor_reseticon").html(''); + $("#two_factor_reseticon").html(' '); $.ajax({ url: '{{ route('api.users.two_factor_reset', ['id'=> $user->id]) }}', type: 'POST', @@ -715,13 +715,12 @@ $(document).ready(function() { success: function (data) { $("#two_factor_reseticon").html(''); - $("#two_factor_resetstatus").html('' + data.message); + $("#two_factor_resetstatus").html(' ' + data.message + ''); }, error: function (data) { $("#two_factor_reseticon").html(''); - $("#two_factor_reseticon").html(''); - $('#two_factor_resetstatus').text(data.message); + $("#two_factor_resetstatus").html(' ' + data.message + ''); } From bd2812cac1d3f1713e3081908e643f6e34b68945 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 20 Mar 2024 23:43:12 +0000 Subject: [PATCH 41/78] Added new string Signed-off-by: snipe --- resources/lang/en-US/general.php | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/lang/en-US/general.php b/resources/lang/en-US/general.php index bf17024844..9f9a0e08c7 100644 --- a/resources/lang/en-US/general.php +++ b/resources/lang/en-US/general.php @@ -1,6 +1,7 @@ '2FA reset', 'accessories' => 'Accessories', 'activated' => 'Activated', 'accepted_date' => 'Date Accepted', From 1ffbdee156d417c6bfa3a8d539eff1d421eee258 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 20 Mar 2024 23:43:30 +0000 Subject: [PATCH 42/78] Updated 2FA text to not be google authenticator specific Signed-off-by: snipe --- resources/lang/en-US/admin/settings/general.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/en-US/admin/settings/general.php b/resources/lang/en-US/admin/settings/general.php index 33cfd7b416..71fb8eb2c6 100644 --- a/resources/lang/en-US/admin/settings/general.php +++ b/resources/lang/en-US/admin/settings/general.php @@ -261,7 +261,7 @@ return [ 'two_factor_enrollment' => 'Two-Factor Enrollment', 'two_factor_enabled_text' => 'Enable Two Factor', 'two_factor_reset' => 'Reset Two-Factor Secret', - 'two_factor_reset_help' => 'This will force the user to enroll their device with Google Authenticator again. This can be useful if their currently enrolled device is lost or stolen. ', + 'two_factor_reset_help' => 'This will force the user to enroll their device with their authenticator app again. This can be useful if their currently enrolled device is lost or stolen. ', 'two_factor_reset_success' => 'Two factor device successfully reset', 'two_factor_reset_error' => 'Two factor device reset failed', 'two_factor_enabled_warning' => 'Enabling two-factor if it is not currently enabled will immediately force you to authenticate with a Google Auth enrolled device. You will have the ability to enroll your device if one is not currently enrolled.', From 2067b1138af7a1a010f81007c90d31112652fcba Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 20 Mar 2024 23:43:58 +0000 Subject: [PATCH 43/78] Added the log item Signed-off-by: snipe --- app/Http/Controllers/Api/UsersController.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index 6d32e8b6f2..cacfe7662b 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -663,6 +663,16 @@ class UsersController extends Controller $user->two_factor_enrolled = 0; $user->save(); + // Log the reset + $logaction = new Actionlog(); + $logaction->target_type = User::class; + $logaction->target_id = $user->id; + $logaction->item_type = User::class; + $logaction->item_id = $user->id; + $logaction->created_at = date('Y-m-d H:i:s'); + $logaction->user_id = Auth::user()->id; + $logaction->logaction('2FA reset'); + return response()->json(['message' => trans('admin/settings/general.two_factor_reset_success')], 200); } catch (\Exception $e) { return response()->json(['message' => trans('admin/settings/general.two_factor_reset_error')], 500); From bc908b854de54eef4f6b13f1edfe326fe3c47301 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 20 Mar 2024 23:44:47 +0000 Subject: [PATCH 44/78] Added icon Signed-off-by: snipe --- app/Presenters/ActionlogPresenter.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Presenters/ActionlogPresenter.php b/app/Presenters/ActionlogPresenter.php index ddff10864e..2794b6c5fb 100644 --- a/app/Presenters/ActionlogPresenter.php +++ b/app/Presenters/ActionlogPresenter.php @@ -38,10 +38,14 @@ class ActionlogPresenter extends Presenter public function icon() { - + // User related icons if ($this->itemType() == 'user') { + if ($this->actionType()=='2fa reset') { + return 'fa-solid fa-mobile-screen'; + } + if ($this->actionType()=='create new') { return 'fa-solid fa-user-plus'; } @@ -61,6 +65,7 @@ class ActionlogPresenter extends Presenter if ($this->actionType()=='update') { return 'fa-solid fa-user-pen'; } + return 'fa-solid fa-user'; } From 5ed2bd0fb78fb1ca3bb485318aa40f90d1e45029 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 20 Mar 2024 23:52:22 +0000 Subject: [PATCH 45/78] Skip the normal edit observer Signed-off-by: snipe --- app/Http/Controllers/Api/UsersController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index cacfe7662b..e9551d51a8 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -661,7 +661,7 @@ class UsersController extends Controller $user = User::find($request->get('id')); $user->two_factor_secret = null; $user->two_factor_enrolled = 0; - $user->save(); + $user->saveQuietly(); // Log the reset $logaction = new Actionlog(); From 945e8b402fd78c5e6649d503344dc6014c443b51 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 20 Mar 2024 23:52:51 +0000 Subject: [PATCH 46/78] Only offer the 2FA reset if the user already has 2FA set up Signed-off-by: snipe --- resources/views/users/edit.blade.php | 25 ++++++++++++++----------- resources/views/users/view.blade.php | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index 98fd991248..9a2a039af7 100755 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -499,18 +499,21 @@ @endif - -
-
- {{ trans('admin/settings/general.two_factor_reset') }} - - - + @if ((Auth::user()->isSuperUser()) && ($user->two_factor_active_and_enrolled()) && ($snipeSettings->two_factor_enabled!='0') && ($snipeSettings->two_factor_enabled!='')) + +
+ +
+

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

+
-
-

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

-
-
+ @endif + @endif diff --git a/resources/views/users/view.blade.php b/resources/views/users/view.blade.php index a8c24b9321..3dbd9ff531 100755 --- a/resources/views/users/view.blade.php +++ b/resources/views/users/view.blade.php @@ -597,7 +597,7 @@
- @if ((Auth::user()->isSuperUser()) && ($snipeSettings->two_factor_enabled!='0') && ($snipeSettings->two_factor_enabled!='')) + @if ((Auth::user()->isSuperUser()) && ($user->two_factor_active_and_enrolled()) && ($snipeSettings->two_factor_enabled!='0') && ($snipeSettings->two_factor_enabled!=''))
From 828b84084d00761d41b6fb8787919d59ff04c19f Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 21 Mar 2024 18:29:38 +0000 Subject: [PATCH 47/78] Added validation for last_audit_date and next_audit_date Signed-off-by: snipe --- app/Http/Controllers/Api/AssetsController.php | 4 ++-- app/Models/Asset.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index b26887b6ce..c672781e6f 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -613,7 +613,7 @@ class AssetsController extends Controller $asset->image = $asset->getImageUrl(); } - return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.create.success'))); + return response()->json(Helper::formatStandardApiResponse('success', (new AssetsTransformer)->transformAsset($asset), trans('admin/hardware/message.create.success'))); } return response()->json(Helper::formatStandardApiResponse('error', null, $asset->getErrors()), 200); @@ -692,7 +692,7 @@ class AssetsController extends Controller $asset->image = $asset->getImageUrl(); } - return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.update.success'))); + return response()->json(Helper::formatStandardApiResponse('success', (new AssetsTransformer)->transformAsset($asset), trans('admin/hardware/message.update.success'))); } return response()->json(Helper::formatStandardApiResponse('error', null, $asset->getErrors()), 200); diff --git a/app/Models/Asset.php b/app/Models/Asset.php index c2a2a8d995..981d785251 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -97,6 +97,8 @@ class Asset extends Depreciable 'warranty_months' => 'nullable|numeric|digits_between:0,240', 'last_checkout' => 'nullable|date_format:Y-m-d H:i:s', 'expected_checkin' => 'nullable|date', + 'last_audit_date' => 'nullable|date_format:Y-m-d H:i:s', + 'next_audit_date' => 'nullable|date|date_format:Y-m-d', 'location_id' => 'nullable|exists:locations,id', 'rtd_location_id' => 'nullable|exists:locations,id', 'purchase_date' => 'nullable|date|date_format:Y-m-d', From e9e6f925bf6dc119608986a28b427e9eeb0b4e42 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 21 Mar 2024 18:34:39 +0000 Subject: [PATCH 48/78] Updated validation Signed-off-by: snipe --- app/Models/Asset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 981d785251..2830eca7e5 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -98,7 +98,7 @@ class Asset extends Depreciable 'last_checkout' => 'nullable|date_format:Y-m-d H:i:s', 'expected_checkin' => 'nullable|date', 'last_audit_date' => 'nullable|date_format:Y-m-d H:i:s', - 'next_audit_date' => 'nullable|date|date_format:Y-m-d', + 'next_audit_date' => 'nullable|date|after:last_audit_date', 'location_id' => 'nullable|exists:locations,id', 'rtd_location_id' => 'nullable|exists:locations,id', 'purchase_date' => 'nullable|date|date_format:Y-m-d', From 7e4a0eedf0c5e062ca85618bb8e52fb39d93d4e5 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Mon, 25 Mar 2024 10:46:26 -0500 Subject: [PATCH 49/78] rm dumb note --- app/Http/Controllers/Api/AssetsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 7b3db3090c..ecd0ff7a04 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -556,7 +556,7 @@ class AssetsController extends Controller $model = AssetModel::find($request->input('model_id')); // Check that it's an object and not a collection - // (Sometimes people send arrays here and they shouldn't, unless it's a checkbox) + // (Sometimes people send arrays here and they shouldn't if (($model) && ($model instanceof AssetModel) && ($model->fieldset)) { foreach ($model->fieldset->fields as $field) { From e45fd4088f8438e7e301a1608fddd455bf20f536 Mon Sep 17 00:00:00 2001 From: Phil J R <52716446+PP-JN-RL@users.noreply.github.com> Date: Mon, 25 Mar 2024 16:31:20 +0000 Subject: [PATCH 50/78] Created Dymo LabelWriter Label 2112283 I have added the layout for the Dymo LabelWriter 2112283 Labels. They are: DYMO 2112283 DURABLE SMALL MULTI PURPOSE LABELS (160 LABELS) - 25 X 54MM --- .../Tapes/Dymo/Label_Writer_2112283.php | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 app/Models/Labels/Tapes/Dymo/Label_Writer_2112283.php diff --git a/app/Models/Labels/Tapes/Dymo/Label_Writer_2112283.php b/app/Models/Labels/Tapes/Dymo/Label_Writer_2112283.php new file mode 100644 index 0000000000..e1305bd068 --- /dev/null +++ b/app/Models/Labels/Tapes/Dymo/Label_Writer_2112283.php @@ -0,0 +1,89 @@ +getPrintableArea(); + + $currentX = $pa->x1; + $currentY = $pa->y1; + $usableWidth = $pa->w; + + $barcodeSize = $pa->h - self::TAG_SIZE; + + if ($record->has('barcode2d')) { + static::writeText( + $pdf, $record->get('tag'), + $pa->x1, $pa->y2 - self::TAG_SIZE, + 'freesans', 'b', self::TAG_SIZE, 'C', + $barcodeSize, self::TAG_SIZE, true, 0 + ); + static::write2DBarcode( + $pdf, $record->get('barcode2d')->content, $record->get('barcode2d')->type, + $currentX, $currentY, + $barcodeSize, $barcodeSize + ); + $currentX += $barcodeSize + self::BARCODE_MARGIN; + $usableWidth -= $barcodeSize + self::BARCODE_MARGIN; + } else { + static::writeText( + $pdf, $record->get('tag'), + $pa->x1, $pa->y2 - self::TAG_SIZE, + 'freesans', 'b', self::TAG_SIZE, 'R', + $usableWidth, self::TAG_SIZE, true, 0 + ); + } + + if ($record->has('title')) { + static::writeText( + $pdf, $record->get('title'), + $currentX, $currentY, + 'freesans', 'b', self::TITLE_SIZE, 'L', + $usableWidth, self::TITLE_SIZE, true, 0 + ); + $currentY += self::TITLE_SIZE + self::TITLE_MARGIN; + } + + foreach ($record->get('fields') as $field) { + static::writeText( + $pdf, (($field['label']) ? $field['label'].' ' : '') . $field['value'], + $currentX, $currentY, + 'freesans', '', self::FIELD_SIZE, 'L', + $usableWidth, self::FIELD_SIZE, true, 0, 0.3 + ); + $currentY += self::FIELD_SIZE + self::FIELD_MARGIN; + } + + if ($record->has('barcode1d')) { + static::write1DBarcode( + $pdf, $record->get('barcode1d')->content, $record->get('barcode1d')->type, + $currentX, $barcodeSize + self::BARCODE_MARGIN, $usableWidth - self::TAG_SIZE, self::TAG_SIZE + ); + } + } + +} From 66ba96d5315cb6b042eb2887b4a53f75a7f4497c Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 25 Mar 2024 12:38:12 -0700 Subject: [PATCH 51/78] Set last_audit_date to valid format in StoreAssetRequest --- app/Http/Requests/StoreAssetRequest.php | 2 ++ tests/Feature/Api/Assets/AssetStoreTest.php | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/Http/Requests/StoreAssetRequest.php b/app/Http/Requests/StoreAssetRequest.php index 74988b6c62..e46128b6ff 100644 --- a/app/Http/Requests/StoreAssetRequest.php +++ b/app/Http/Requests/StoreAssetRequest.php @@ -4,6 +4,7 @@ namespace App\Http\Requests; use App\Models\Asset; use App\Models\Company; +use Carbon\Carbon; use Illuminate\Support\Facades\Gate; class StoreAssetRequest extends ImageUploadRequest @@ -31,6 +32,7 @@ class StoreAssetRequest extends ImageUploadRequest 'asset_tag' => $this->asset_tag ?? Asset::autoincrement_asset(), 'company_id' => $idForCurrentUser, 'assigned_to' => $assigned_to ?? null, + 'last_audit_date' => Carbon::parse($this->input('last_audit_date'))->startOfDay()->format('Y-m-d H:i:s'), ]); } diff --git a/tests/Feature/Api/Assets/AssetStoreTest.php b/tests/Feature/Api/Assets/AssetStoreTest.php index ceae053648..91c10a936c 100644 --- a/tests/Feature/Api/Assets/AssetStoreTest.php +++ b/tests/Feature/Api/Assets/AssetStoreTest.php @@ -65,8 +65,7 @@ class AssetStoreTest extends TestCase $this->assertEquals('random_string', $asset->asset_tag); $this->assertEquals($userAssigned->id, $asset->assigned_to); $this->assertTrue($asset->company->is($company)); - // I don't see this on the GUI side either, but it's in the docs so I'm guessing that's a mistake? It wasn't in the controller. - // $this->assertEquals('2023-09-03', $asset->last_audit_date); + $this->assertEquals('2023-09-03 00:00:00', $asset->last_audit_date->format('Y-m-d H:i:s')); $this->assertTrue($asset->location->is($location)); $this->assertTrue($asset->model->is($model)); $this->assertEquals('A New Asset', $asset->name); @@ -82,6 +81,22 @@ class AssetStoreTest extends TestCase $this->assertEquals(10, $asset->warranty_months); } + public function testSetsLastAuditDateToMidnightOfProvidedDate() + { + $response = $this->actingAsForApi(User::factory()->superuser()->create()) + ->postJson(route('api.assets.store'), [ + 'last_audit_date' => '2023-09-03 12:23:45', + 'asset_tag' => '1234', + 'model_id' => AssetModel::factory()->create()->id, + 'status_id' => Statuslabel::factory()->create()->id, + ]) + ->assertOk() + ->assertStatusMessageIs('success'); + + $asset = Asset::find($response['payload']['id']); + $this->assertEquals('00:00:00', $asset->last_audit_date->format('H:i:s')); + } + public function testArchivedDepreciateAndPhysicalCanBeNull() { $model = AssetModel::factory()->ipadModel()->create(); From 5f4c964309c14eeaf8038c0ed4b3f3b78ceb8eda Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 25 Mar 2024 12:45:11 -0700 Subject: [PATCH 52/78] Account for `last_audit_date` not being provided --- app/Http/Requests/StoreAssetRequest.php | 7 ++++++- tests/Feature/Api/Assets/AssetStoreTest.php | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/Http/Requests/StoreAssetRequest.php b/app/Http/Requests/StoreAssetRequest.php index e46128b6ff..d87d5bc2fb 100644 --- a/app/Http/Requests/StoreAssetRequest.php +++ b/app/Http/Requests/StoreAssetRequest.php @@ -28,11 +28,16 @@ class StoreAssetRequest extends ImageUploadRequest ? Company::getIdForCurrentUser($this->company_id) : $this->company_id; + if ($this->input('last_audit_date')) { + $this->merge([ + 'last_audit_date' => Carbon::parse($this->input('last_audit_date'))->startOfDay()->format('Y-m-d H:i:s'), + ]); + } + $this->merge([ 'asset_tag' => $this->asset_tag ?? Asset::autoincrement_asset(), 'company_id' => $idForCurrentUser, 'assigned_to' => $assigned_to ?? null, - 'last_audit_date' => Carbon::parse($this->input('last_audit_date'))->startOfDay()->format('Y-m-d H:i:s'), ]); } diff --git a/tests/Feature/Api/Assets/AssetStoreTest.php b/tests/Feature/Api/Assets/AssetStoreTest.php index 91c10a936c..4b4f66f3df 100644 --- a/tests/Feature/Api/Assets/AssetStoreTest.php +++ b/tests/Feature/Api/Assets/AssetStoreTest.php @@ -97,6 +97,22 @@ class AssetStoreTest extends TestCase $this->assertEquals('00:00:00', $asset->last_audit_date->format('H:i:s')); } + public function testLastAuditDateCanBeNull() + { + $response = $this->actingAsForApi(User::factory()->superuser()->create()) + ->postJson(route('api.assets.store'), [ + // 'last_audit_date' => '2023-09-03 12:23:45', + 'asset_tag' => '1234', + 'model_id' => AssetModel::factory()->create()->id, + 'status_id' => Statuslabel::factory()->create()->id, + ]) + ->assertOk() + ->assertStatusMessageIs('success'); + + $asset = Asset::find($response['payload']['id']); + $this->assertNull($asset->last_audit_date); + } + public function testArchivedDepreciateAndPhysicalCanBeNull() { $model = AssetModel::factory()->ipadModel()->create(); From 675717ff82b3e30ba7e76cbe4cec25def5615c0d Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 25 Mar 2024 13:46:22 -0700 Subject: [PATCH 53/78] Add failing test --- tests/Feature/Api/Assets/AssetStoreTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/Feature/Api/Assets/AssetStoreTest.php b/tests/Feature/Api/Assets/AssetStoreTest.php index 4b4f66f3df..e98da36cf9 100644 --- a/tests/Feature/Api/Assets/AssetStoreTest.php +++ b/tests/Feature/Api/Assets/AssetStoreTest.php @@ -113,6 +113,20 @@ class AssetStoreTest extends TestCase $this->assertNull($asset->last_audit_date); } + public function testNonDateUsedForLastAuditDateReturnsValidationError() + { + $response = $this->actingAsForApi(User::factory()->superuser()->create()) + ->postJson(route('api.assets.store'), [ + 'last_audit_date' => 'this-is-not-valid', + 'asset_tag' => '1234', + 'model_id' => AssetModel::factory()->create()->id, + 'status_id' => Statuslabel::factory()->create()->id, + ]) + ->assertStatusMessageIs('error'); + + $this->assertNotNull($response->json('messages.last_audit_date')); + } + public function testArchivedDepreciateAndPhysicalCanBeNull() { $model = AssetModel::factory()->ipadModel()->create(); From c98b9da612a701a49119bdc0a1b7ff8dfe928ab8 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 25 Mar 2024 13:47:24 -0700 Subject: [PATCH 54/78] Pass last_audit_date through for model level validation if not a date --- app/Http/Requests/StoreAssetRequest.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/Http/Requests/StoreAssetRequest.php b/app/Http/Requests/StoreAssetRequest.php index d87d5bc2fb..918972c6cc 100644 --- a/app/Http/Requests/StoreAssetRequest.php +++ b/app/Http/Requests/StoreAssetRequest.php @@ -5,6 +5,7 @@ namespace App\Http\Requests; use App\Models\Asset; use App\Models\Company; use Carbon\Carbon; +use Carbon\Exceptions\InvalidFormatException; use Illuminate\Support\Facades\Gate; class StoreAssetRequest extends ImageUploadRequest @@ -29,9 +30,15 @@ class StoreAssetRequest extends ImageUploadRequest : $this->company_id; if ($this->input('last_audit_date')) { - $this->merge([ - 'last_audit_date' => Carbon::parse($this->input('last_audit_date'))->startOfDay()->format('Y-m-d H:i:s'), - ]); + try { + $lastAuditDate = Carbon::parse($this->input('last_audit_date')); + + $this->merge([ + 'last_audit_date' => $lastAuditDate->startOfDay()->format('Y-m-d H:i:s'), + ]); + } catch (InvalidFormatException $e) { + // we don't need to do anything here... + } } $this->merge([ From a2625c889ac307556badd99fe28b15c09392494d Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 25 Mar 2024 13:48:32 -0700 Subject: [PATCH 55/78] Improve comment --- app/Http/Requests/StoreAssetRequest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Http/Requests/StoreAssetRequest.php b/app/Http/Requests/StoreAssetRequest.php index 918972c6cc..20b801a52c 100644 --- a/app/Http/Requests/StoreAssetRequest.php +++ b/app/Http/Requests/StoreAssetRequest.php @@ -38,6 +38,8 @@ class StoreAssetRequest extends ImageUploadRequest ]); } catch (InvalidFormatException $e) { // we don't need to do anything here... + // we'll keep the provided date in an + // invalid format so validation picks it up later } } From 71722b753d87e056e366450604dda21c7b8e189c Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 25 Mar 2024 13:49:03 -0700 Subject: [PATCH 56/78] Little bit of clean up --- app/Http/Requests/StoreAssetRequest.php | 31 ++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/app/Http/Requests/StoreAssetRequest.php b/app/Http/Requests/StoreAssetRequest.php index 20b801a52c..70e7195c7d 100644 --- a/app/Http/Requests/StoreAssetRequest.php +++ b/app/Http/Requests/StoreAssetRequest.php @@ -29,19 +29,7 @@ class StoreAssetRequest extends ImageUploadRequest ? Company::getIdForCurrentUser($this->company_id) : $this->company_id; - if ($this->input('last_audit_date')) { - try { - $lastAuditDate = Carbon::parse($this->input('last_audit_date')); - - $this->merge([ - 'last_audit_date' => $lastAuditDate->startOfDay()->format('Y-m-d H:i:s'), - ]); - } catch (InvalidFormatException $e) { - // we don't need to do anything here... - // we'll keep the provided date in an - // invalid format so validation picks it up later - } - } + $this->formatLastAuditDate(); $this->merge([ 'asset_tag' => $this->asset_tag ?? Asset::autoincrement_asset(), @@ -64,4 +52,21 @@ class StoreAssetRequest extends ImageUploadRequest return $rules; } + + private function formatLastAuditDate(): void + { + if ($this->input('last_audit_date')) { + try { + $lastAuditDate = Carbon::parse($this->input('last_audit_date')); + + $this->merge([ + 'last_audit_date' => $lastAuditDate->startOfDay()->format('Y-m-d H:i:s'), + ]); + } catch (InvalidFormatException $e) { + // we don't need to do anything here... + // we'll keep the provided date in an + // invalid format so validation picks it up later + } + } + } } From 57d1c036ecbf3d1b67c1c0e721641c769839d34e Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 25 Mar 2024 13:53:30 -0700 Subject: [PATCH 57/78] Improve method name --- app/Http/Requests/StoreAssetRequest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Requests/StoreAssetRequest.php b/app/Http/Requests/StoreAssetRequest.php index 70e7195c7d..8e7559673e 100644 --- a/app/Http/Requests/StoreAssetRequest.php +++ b/app/Http/Requests/StoreAssetRequest.php @@ -29,7 +29,7 @@ class StoreAssetRequest extends ImageUploadRequest ? Company::getIdForCurrentUser($this->company_id) : $this->company_id; - $this->formatLastAuditDate(); + $this->parseLastAuditDate(); $this->merge([ 'asset_tag' => $this->asset_tag ?? Asset::autoincrement_asset(), @@ -53,7 +53,7 @@ class StoreAssetRequest extends ImageUploadRequest return $rules; } - private function formatLastAuditDate(): void + private function parseLastAuditDate(): void { if ($this->input('last_audit_date')) { try { From 9b40c9788fc349972e6d45eb4a4a019c28000b97 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Mon, 25 Mar 2024 18:58:49 -0500 Subject: [PATCH 58/78] rm commented tests --- tests/Feature/Api/Assets/AssetStoreTest.php | 70 --------------------- 1 file changed, 70 deletions(-) diff --git a/tests/Feature/Api/Assets/AssetStoreTest.php b/tests/Feature/Api/Assets/AssetStoreTest.php index cafd71f558..92a58a5006 100644 --- a/tests/Feature/Api/Assets/AssetStoreTest.php +++ b/tests/Feature/Api/Assets/AssetStoreTest.php @@ -438,74 +438,4 @@ class AssetStoreTest extends TestCase $json->has('messages.company_id')->etc(); }); } - - // Commenting these tests because they should be good, but there's a factory problem with - // custom fields that's preventing them from working properly. Leaving them here for now - // so that we can uncomment once we figure out how to resolve that. - //public function testCustomFieldCheckboxPassesValidationForValidOptionsWithString() - //{ - // $model = AssetModel::factory()->create(); - // $status = Statuslabel::factory()->create(); - // - // - // $this->settings->enableAutoIncrement(); - // - // $this->actingAsForApi(User::factory()->createAssets()->create()) - // ->postJson(route('api.assets.store'), [ - // 'model_id' => $model->id, - // 'status_id' => $status->id, - // '_snipeit_test_checkbox_7' => 'One, Two, Three', - // ]) - // ->assertOk() - // ->assertStatusMessageIs('success'); - //} - // - //public function testCustomFieldCheckboxPassesValidationForValidOptionsWithArray() - //{ - // $model = AssetModel::factory()->create(); - // $status = Statuslabel::factory()->create(); - // - // $this->settings->enableAutoIncrement(); - // - // $this->actingAsForApi(User::factory()->createAssets()->create()) - // ->postJson(route('api.assets.store'), [ - // 'model_id' => $model->id, - // 'status_id' => $status->id, - // '_snipeit_test_checkbox_7' => ['One', 'Two', 'Three'], - // ]) - // ->assertOk() - // ->assertStatusMessageIs('success'); - //} - // - //public function testCustomFieldCheckboxFailsValidationForInvalidOptionsWithString() - //{ - // $model = AssetModel::factory()->mbp13Model()->create(); - // $status = Statuslabel::factory()->create(); - // - // $this->settings->enableAutoIncrement(); - // - // $this->actingAsForApi(User::factory()->createAssets()->create()) - // ->postJson(route('api.assets.store'), [ - // 'model_id' => $model->id, - // 'status_id' => $status->id, - // '_snipeit_test_checkbox_7' => "One, Two, Four, Five", - // ]) - // ->assertStatusMessageIs('error'); - //} - // - //public function testCustomFieldCheckboxFailsValidationForInvalidOptionsWithArray() - //{ - // $model = AssetModel::factory()->mbp13Model()->create(); - // $status = Statuslabel::factory()->create(); - // - // $this->settings->enableAutoIncrement(); - // - // $this->actingAsForApi(User::factory()->createAssets()->create()) - // ->postJson(route('api.assets.store'), [ - // 'model_id' => $model->id, - // 'status_id' => $status->id, - // '_snipeit_test_checkbox_7' => ['One', 'Two', 'Four', 'Five'] - // ]) - // ->assertStatusMessageIs('error'); - //} } From 581560792421a53fbb698716be4cd5d73cd57cce Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 25 Mar 2024 17:45:41 -0700 Subject: [PATCH 59/78] Add validation for pwd_secure_complexity --- app/Http/Controllers/SettingsController.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index b1cb620a83..dbb6f66222 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -20,6 +20,7 @@ use DB; use enshrined\svgSanitize\Sanitizer; use Illuminate\Http\Request; use Illuminate\Support\Facades\Storage; +use Illuminate\Validation\Rule; use Image; use Input; use Redirect; @@ -499,6 +500,19 @@ class SettingsController extends Controller */ public function postSecurity(Request $request) { + $this->validate($request, [ + 'pwd_secure_complexity' => 'array', + 'pwd_secure_complexity.*' => [ + Rule::in([ + 'disallow_same_pwd_as_user_fields', + 'letters', + 'numbers', + 'symbols', + 'case_diff', + ]) + ] + ]); + if (is_null($setting = Setting::getSettings())) { return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error')); } From bd506820b7144da54cfcc1d1f26221773a602863 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 25 Mar 2024 17:59:39 -0700 Subject: [PATCH 60/78] Display error message --- resources/views/settings/security.blade.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/views/settings/security.blade.php b/resources/views/settings/security.blade.php index a23b8cece9..baacb41440 100644 --- a/resources/views/settings/security.blade.php +++ b/resources/views/settings/security.blade.php @@ -74,12 +74,11 @@ -
+
{{ Form::label('pwd_secure_complexity', trans('admin/settings/general.pwd_secure_complexity')) }}
- + @if ($errors->has('pwd_secure_complexity.*')) + Invalid value included in this field + @endif

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

From 5cf1a6c3006c4ca82c8251c751aa311c79cbdd4e Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Mon, 25 Mar 2024 21:03:13 -0500 Subject: [PATCH 61/78] new validator for radio buttons --- app/Models/CustomFieldset.php | 4 ++++ app/Providers/ValidationServiceProvider.php | 8 ++++++++ resources/lang/en-US/validation.php | 1 + 3 files changed, 13 insertions(+) diff --git a/app/Models/CustomFieldset.php b/app/Models/CustomFieldset.php index 4d960ede41..71be28e8a3 100644 --- a/app/Models/CustomFieldset.php +++ b/app/Models/CustomFieldset.php @@ -103,6 +103,10 @@ class CustomFieldset extends Model if ($field->element == 'checkbox') { $rules[$field->db_column_name()][] = 'checkboxes'; } + + if ($field->element == 'radio') { + $rules[$field->db_column_name()][] = 'radio_buttons'; + } } return $rules; diff --git a/app/Providers/ValidationServiceProvider.php b/app/Providers/ValidationServiceProvider.php index d13898fb3f..803d540865 100644 --- a/app/Providers/ValidationServiceProvider.php +++ b/app/Providers/ValidationServiceProvider.php @@ -322,6 +322,14 @@ class ValidationServiceProvider extends ServiceProvider return true; }); + + // Validates that a radio button option exists + Validator::extend('radio_buttons', function ($attribute, $value) { + $field = CustomField::where('db_column', $attribute)->first(); + $options = $field->formatFieldValuesAsArray(); + + return in_array($value, $options); + }); } /** diff --git a/resources/lang/en-US/validation.php b/resources/lang/en-US/validation.php index 98084afcd4..d027a93f86 100644 --- a/resources/lang/en-US/validation.php +++ b/resources/lang/en-US/validation.php @@ -106,6 +106,7 @@ return [ 'numeric' => 'Value cannot be negative' ], 'checkboxes' => ':attribute contains invalid options.', + 'radio_buttons' => ':attribute is invalid.', /* From f8363421941645ea02ad813043c32e2370ceae46 Mon Sep 17 00:00:00 2001 From: Phil J R <52716446+PP-JN-RL@users.noreply.github.com> Date: Tue, 26 Mar 2024 08:16:00 +0000 Subject: [PATCH 62/78] Rename Label_Writer_2112283.php to LabelWriter_2112283.php Fix the name of LabelWWriter_2112283 to be consistent with the existing one. --- .../Dymo/{Label_Writer_2112283.php => LabelWriter_2112283.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/Models/Labels/Tapes/Dymo/{Label_Writer_2112283.php => LabelWriter_2112283.php} (100%) diff --git a/app/Models/Labels/Tapes/Dymo/Label_Writer_2112283.php b/app/Models/Labels/Tapes/Dymo/LabelWriter_2112283.php similarity index 100% rename from app/Models/Labels/Tapes/Dymo/Label_Writer_2112283.php rename to app/Models/Labels/Tapes/Dymo/LabelWriter_2112283.php From 7ebbef25e77c22815db85862addf336bd0c2c649 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 26 Mar 2024 08:18:36 +0000 Subject: [PATCH 63/78] Standardize button styling Signed-off-by: snipe --- resources/views/hardware/view.blade.php | 34 ++++++++++++------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index a32503d7ea..ce814d5c76 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -904,27 +904,18 @@ @endcan @can('delete', $asset) - @if ($asset->deleted_at=='') -
- +
+ @if ($asset->deleted_at=='') + {{ trans('general.delete') }} -
- @endif + @else +
+ @csrf + + + @endif @endcan - @if ($asset->deleted_at!='') -
-
- @csrf - - -
- @endif - - @if ($snipeSettings->qr_code=='1') - QR code for {{ $asset->getDisplayNameAttribute() }} - @endif - @if (($asset->assignedTo) && ($asset->deleted_at==''))

{{ trans('admin/hardware/form.checkedout_to') }}

@@ -982,6 +973,13 @@
@endif + + @if ($snipeSettings->qr_code=='1') +
+ QR code for {{ $asset->getDisplayNameAttribute() }} +
+ @endif +
From 31a57cdf141ecebd1827cfbf38089f071845821e Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 26 Mar 2024 08:18:59 +0000 Subject: [PATCH 64/78] Fixed #14482 - bad method call on restore from view Signed-off-by: snipe --- resources/views/models/view.blade.php | 35 ++++++++++++++++++--------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/resources/views/models/view.blade.php b/resources/views/models/view.blade.php index 91f112d8aa..76d3322998 100755 --- a/resources/views/models/view.blade.php +++ b/resources/views/models/view.blade.php @@ -236,6 +236,12 @@ @endif + @if ($model->created_at) +
  • {{ trans('general.created_at') }}: + {{ Helper::getFormattedDateObject($model->created_at, 'datetime', false) }} +
  • + @endif + @if ($model->min_amt)
  • {{ trans('general.min_amt') }}: {{$model->min_amt }} @@ -313,11 +319,6 @@
  • @endif - - - @if ($model->deleted_at!='') -

  • {{ trans('admin/models/general.restore') }}
  • - @endif @if ($model->note) @@ -337,22 +338,32 @@ @can('create', \App\Models\AssetModel::class) @endcan @can('delete', \App\Models\AssetModel::class) @if ($model->assets_count > 0) -
    - +
    @else -
    - - {{ trans('general.delete') }} -
    + @endif + + +
    + @if ($model->deleted_at!='') +
    + @csrf + + + @else + + {{ trans('general.delete') }} + @endif +
    + @endcan
    From afe1cb82349c2cde57009103df869f52d7a769dd Mon Sep 17 00:00:00 2001 From: Phil J R <52716446+PP-JN-RL@users.noreply.github.com> Date: Tue, 26 Mar 2024 08:29:47 +0000 Subject: [PATCH 65/78] Create LabelWriter_1933081.php Added a longer version of the existing label (25 x 54mm vs. 25 x 89mm) due to better availability and to support longer asset names. --- .../Labels/Tapes/Dymo/LabelWriter_1933081.php | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 app/Models/Labels/Tapes/Dymo/LabelWriter_1933081.php diff --git a/app/Models/Labels/Tapes/Dymo/LabelWriter_1933081.php b/app/Models/Labels/Tapes/Dymo/LabelWriter_1933081.php new file mode 100644 index 0000000000..9b56012f7a --- /dev/null +++ b/app/Models/Labels/Tapes/Dymo/LabelWriter_1933081.php @@ -0,0 +1,89 @@ +getPrintableArea(); + + $currentX = $pa->x1; + $currentY = $pa->y1; + $usableWidth = $pa->w; + + $barcodeSize = $pa->h - self::TAG_SIZE; + + if ($record->has('barcode2d')) { + static::writeText( + $pdf, $record->get('tag'), + $pa->x1, $pa->y2 - self::TAG_SIZE, + 'freesans', 'b', self::TAG_SIZE, 'C', + $barcodeSize, self::TAG_SIZE, true, 0 + ); + static::write2DBarcode( + $pdf, $record->get('barcode2d')->content, $record->get('barcode2d')->type, + $currentX, $currentY, + $barcodeSize, $barcodeSize + ); + $currentX += $barcodeSize + self::BARCODE_MARGIN; + $usableWidth -= $barcodeSize + self::BARCODE_MARGIN; + } else { + static::writeText( + $pdf, $record->get('tag'), + $pa->x1, $pa->y2 - self::TAG_SIZE, + 'freesans', 'b', self::TAG_SIZE, 'R', + $usableWidth, self::TAG_SIZE, true, 0 + ); + } + + if ($record->has('title')) { + static::writeText( + $pdf, $record->get('title'), + $currentX, $currentY, + 'freesans', 'b', self::TITLE_SIZE, 'L', + $usableWidth, self::TITLE_SIZE, true, 0 + ); + $currentY += self::TITLE_SIZE + self::TITLE_MARGIN; + } + + foreach ($record->get('fields') as $field) { + static::writeText( + $pdf, (($field['label']) ? $field['label'].' ' : '') . $field['value'], + $currentX, $currentY, + 'freesans', '', self::FIELD_SIZE, 'L', + $usableWidth, self::FIELD_SIZE, true, 0, 0.3 + ); + $currentY += self::FIELD_SIZE + self::FIELD_MARGIN; + } + + if ($record->has('barcode1d')) { + static::write1DBarcode( + $pdf, $record->get('barcode1d')->content, $record->get('barcode1d')->type, + $currentX, $barcodeSize + self::BARCODE_MARGIN, $usableWidth - self::TAG_SIZE, self::TAG_SIZE + ); + } + } + +} From 8ff85c952e48818351825f97e7dd53fc978b20da Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 26 Mar 2024 08:33:30 +0000 Subject: [PATCH 66/78] Fixed labelwriter 2112283 namespace Signed-off-by: snipe --- .../Dymo/{Label_Writer_2112283.php => LabelWriter_2112283.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/Models/Labels/Tapes/Dymo/{Label_Writer_2112283.php => LabelWriter_2112283.php} (100%) diff --git a/app/Models/Labels/Tapes/Dymo/Label_Writer_2112283.php b/app/Models/Labels/Tapes/Dymo/LabelWriter_2112283.php similarity index 100% rename from app/Models/Labels/Tapes/Dymo/Label_Writer_2112283.php rename to app/Models/Labels/Tapes/Dymo/LabelWriter_2112283.php From 566ba4783e1ee82796c6692ad2b2ebaac4d36528 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 26 Mar 2024 09:50:01 +0000 Subject: [PATCH 67/78] Fixed #14483 - adds deeplinking to search/sort/pagination Signed-off-by: snipe --- .env.example | 1 + config/session.php | 13 +++++++++++++ public/js/dist/bootstrap-table.js | Bin 1814684 -> 1930592 bytes public/mix-manifest.json | 2 +- .../views/partials/bootstrap-table.blade.php | 1 + webpack.mix.js | 1 + 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index f8e1df2987..fd90391973 100644 --- a/.env.example +++ b/.env.example @@ -86,6 +86,7 @@ COOKIE_DOMAIN=null SECURE_COOKIES=false API_TOKEN_EXPIRATION_YEARS=15 BS_TABLE_STORAGE=cookieStorage +BS_TABLE_DEEPLINK=true # -------------------------------------------- # OPTIONAL: SECURITY HEADER SETTINGS diff --git a/config/session.php b/config/session.php index a47294a8cb..5c6cb27a9f 100644 --- a/config/session.php +++ b/config/session.php @@ -174,4 +174,17 @@ return [ 'bs_table_storage' => env('BS_TABLE_STORAGE', 'cookieStorage'), + + /* + |-------------------------------------------------------------------------- + | Bootstrap Table Enable Deeplinking + |-------------------------------------------------------------------------- + | + | Use deeplinks to directly link to search results, sorting, and pagination + | + | More info: https://github.com/generals-space/bootstrap-table-addrbar/blob/master/readme(EN).md + */ + + 'bs_table_addrbar' => env('BS_TABLE_DEEPLINK', true), + ]; diff --git a/public/js/dist/bootstrap-table.js b/public/js/dist/bootstrap-table.js index 7d45dced5d75cc86c7af020d1b8cd477e720a155..6e6d74268fea7a9ca8ba148cb08a412bd95bff19 100644 GIT binary patch delta 22314 zcmcJ134Bvk_VDkf&H8BR-X`ht3N1d28!y)?vDkq8S;_D#!DWxfNVUA&ul5{}B zR&BbF*kyrD3k}+Yj?#9gyTfd^xm*PuP_E;~C3ckByk1wI+}5V!t_J-g!)>Gj&b_2w zgI|MJXbo`Iqtu7`5398VTNXW{x<**Frhrt3+7h@lLhNwTr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Fq7OpMavwpY79pD9GJ|N}?VgVo)1Y#i| g76xJwAQlB;F(4KPVhJFY1Y#*5mfjwBK!#~60LBg|-2eap diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 6c7fa0e60f..be7c6d027d 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -31,7 +31,7 @@ "/css/webfonts/fa-v4compatibility.woff2": "/css/webfonts/fa-v4compatibility.woff2?id=e11465c0eff0549edd4e8ea6bbcf242f", "/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=99c395f0bab5966f32f63f4e55899e64", "/js/build/vendor.js": "/js/build/vendor.js?id=a2b971da417306a63385c8098acfe4af", - "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=d0eb38da8b772a21b827b7df208dc4fe", + "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=47596e30f56a42f12175ac54592d0912", "/js/dist/all.js": "/js/dist/all.js?id=13bdb521e0c745d7f81dae3fb110b650", "/js/dist/all-defer.js": "/js/dist/all-defer.js?id=19ccc62a8f1ea103dede4808837384d4", "/css/dist/skins/skin-green.min.css": "/css/dist/skins/skin-green.min.css?id=0a82a6ae6bb4e58fe62d162c4fb50397", diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index b4f47c6a3c..28c414a436 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -58,6 +58,7 @@ maintainSelected: true, trimOnSearch: false, showSearchClearButton: true, + addrbar: true, // deeplink search phrases, sorting, etc paginationFirstText: "{{ trans('general.first') }}", paginationLastText: "{{ trans('general.last') }}", paginationPreText: "{{ trans('general.previous') }}", diff --git a/webpack.mix.js b/webpack.mix.js index fdda6618ab..0b5e2ed3ee 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -188,6 +188,7 @@ mix './node_modules/bootstrap-table/dist/extensions/export/bootstrap-table-export.js', './node_modules/bootstrap-table/dist/extensions/cookie/bootstrap-table-cookie.js', './node_modules/bootstrap-table/dist/extensions/sticky-header/bootstrap-table-sticky-header.js', + './node_modules/bootstrap-table/dist/extensions/addrbar/bootstrap-table-addrbar.js', './resources/assets/js/extensions/jquery.base64.js', './node_modules/tableexport.jquery.plugin/tableExport.min.js', './node_modules/tableexport.jquery.plugin/libs/jsPDF/jspdf.umd.min.js', From 9df84e235ca4048af82dd81eb2bdc94827211b08 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 26 Mar 2024 09:54:40 +0000 Subject: [PATCH 68/78] Check for config variable Signed-off-by: snipe --- resources/views/partials/bootstrap-table.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 28c414a436..a3d6b6df2d 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -58,7 +58,7 @@ maintainSelected: true, trimOnSearch: false, showSearchClearButton: true, - addrbar: true, // deeplink search phrases, sorting, etc + addrbar: {{ (config('session.bs_table_addrbar') == 'true') ? 'true' : 'false'}}, // deeplink search phrases, sorting, etc paginationFirstText: "{{ trans('general.first') }}", paginationLastText: "{{ trans('general.last') }}", paginationPreText: "{{ trans('general.previous') }}", From 9c1b1bc2b5c8b2ee379ac5f152ca014839358b6d Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 26 Mar 2024 10:15:46 +0000 Subject: [PATCH 69/78] =?UTF-8?q?Removed=20fre-order=20columns=20-=20it?= =?UTF-8?q?=E2=80=99s=20not=20currently=20used?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: snipe --- public/js/dist/bootstrap-table.js | Bin 1930592 -> 1847874 bytes public/mix-manifest.json | 2 +- webpack.mix.js | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/public/js/dist/bootstrap-table.js b/public/js/dist/bootstrap-table.js index 6e6d74268fea7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%?rd)hUcVCr zNv_-mK%)-dX6-;~JfSua$-ldSLiYd6X=ZjwOHUK&#(T}N^y%%U za{HSKn%mmE9l89rW-m1thr!$|ebR_Y@X5o2VwxUhN?Zl6zzMxdrk3?b`=g=~L)vt$ z7l)F72z~7?zlZibY;wTpiX02j-ae~UfS%g2O)F1KWX4|7A*Hv4dRLo@_{zXUYx^gf zQ}_TiY-RY$diX`23^z6l1A4bG$!jKyk!wm|BXV7))}NWIH-1LZY*uR z4e{Wz7_-QX71h3Nky70OIC_zx=;YwmRjVB>RT#zGcrh5k@Q&ET4l35rSgScMge{`5 z0IeQB?B);L>_3Qv<&ITII&ys!#3Ssot@EZ46Zj~t!nA~S#ug~T`4AV{$bl$ z^t44rc%|%FV_Il()OygE$T$15gT^Qh73t(Yqeawv()y|sS>ao-j})kr&~gN5*INQJ zk~)I??kK!B*5M@e`-}7a_U=#v9SC8qgM1YHA7Le=HGqL7-`X4Wze>F@n#&p#q8G5n|Q6npXUhi z(ZR=98~~4V>0m9GEYPdhnxd0<4{N|dfI^`$$F*b>W$4?gGsQ)FSEH}OVybQfvjur9 zIN#v^q=H*xgK`T}0&5o(RweA(%w|5)U3EKv>#F!^dATTPoyPOTEkh|4I5q^oL8F~*`b zH1HP~_HX`(qTkS}?!Uq;CN}!;f(HG)F5Xrg&ScAmQvAo7tSZ|;zKOf9vWl^t^T#h5 ze8*OuEm)(oi54oqCL);+%`Ob!0*{meg~o6?+11)4yxM2{T~wLq+s8^tQqwb9N3_h{=#NiW diff --git a/public/mix-manifest.json b/public/mix-manifest.json index be7c6d027d..68309ab7e0 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -31,7 +31,7 @@ "/css/webfonts/fa-v4compatibility.woff2": "/css/webfonts/fa-v4compatibility.woff2?id=e11465c0eff0549edd4e8ea6bbcf242f", "/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=99c395f0bab5966f32f63f4e55899e64", "/js/build/vendor.js": "/js/build/vendor.js?id=a2b971da417306a63385c8098acfe4af", - "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=47596e30f56a42f12175ac54592d0912", + "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=857da5daffd13e0553510e5ccd410c79", "/js/dist/all.js": "/js/dist/all.js?id=13bdb521e0c745d7f81dae3fb110b650", "/js/dist/all-defer.js": "/js/dist/all-defer.js?id=19ccc62a8f1ea103dede4808837384d4", "/css/dist/skins/skin-green.min.css": "/css/dist/skins/skin-green.min.css?id=0a82a6ae6bb4e58fe62d162c4fb50397", diff --git a/webpack.mix.js b/webpack.mix.js index 0b5e2ed3ee..cbf7fe1231 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -183,7 +183,6 @@ mix [ "./resources/assets/js/dragtable.js", './node_modules/bootstrap-table/dist/bootstrap-table.js', - "./resources/assets/js/bootstrap-table-reorder-columns.js", './node_modules/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile.js', './node_modules/bootstrap-table/dist/extensions/export/bootstrap-table-export.js', './node_modules/bootstrap-table/dist/extensions/cookie/bootstrap-table-cookie.js', From 02a37e2f893b08acb46bd1e4c4405e746f25f551 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 26 Mar 2024 10:16:46 +0000 Subject: [PATCH 70/78] Bumped hash Signed-off-by: snipe --- config/version.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/version.php b/config/version.php index a1d26453da..4812c3368e 100644 --- a/config/version.php +++ b/config/version.php @@ -1,10 +1,10 @@ 'v6.3.3', - 'full_app_version' => 'v6.3.3 - build 12903-g0f63fa23e', - 'build_version' => '12903', + 'full_app_version' => 'v6.3.3 - build 13056-gb34156ca2', + 'build_version' => '13056', 'prerelease_version' => '', - 'hash_version' => 'g0f63fa23e', - 'full_hash' => 'v6.3.3-67-g0f63fa23e', + 'hash_version' => 'gb34156ca2', + 'full_hash' => 'v6.3.3-151-gb34156ca2', 'branch' => 'develop', ); \ No newline at end of file From 0d9b6eaf7150629b0323a80867ebda7d72e16332 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 26 Mar 2024 12:18:04 +0000 Subject: [PATCH 71/78] Added supplier details to license view Signed-off-by: snipe --- resources/views/licenses/view.blade.php | 71 +++++++++++++++++++------ 1 file changed, 56 insertions(+), 15 deletions(-) diff --git a/resources/views/licenses/view.blade.php b/resources/views/licenses/view.blade.php index b23023f489..8caddd03b9 100755 --- a/resources/views/licenses/view.blade.php +++ b/resources/views/licenses/view.blade.php @@ -174,23 +174,64 @@ @endif - @if ($license->supplier_id) -
    -
    - - {{ trans('general.supplier') }} - -
    -
    - @if ($license->supplier) - + @if ($license->supplier) +
    +
    + {{ trans('general.supplier') }} +
    +
    + @can('view', \App\Models\Supplier::class) + + {{ $license->supplier->name }} + + @else {{ $license->supplier->name }} - - @else - {{ trans('general.deleted') }} - @endif + @endcan + + @if ($license->supplier->url) +
    {{ $license->supplier->url }} + @endif + + @if ($license->supplier->phone) +
    + {{ $license->supplier->phone }} + @endif + + @if ($license->supplier->email) +
    {{ $license->supplier->email }} + @endif + + @if ($license->supplier->address) +
    {{ $license->supplier->address }} + @endif + @if ($license->supplier->address2) +
    {{ $license->supplier->address2 }} + @endif + @if ($license->supplier->city) +
    {{ $license->supplier->city }}, + @endif + @if ($license->supplier->state) + {{ $license->supplier->state }} + @endif + @if ($license->supplier->country) + {{ $license->supplier->country }} + @endif + @if ($license->supplier->zip) + {{ $license->supplier->zip }} + @endif + + + + @if ($license->supplier->support_phone) +
    + {{ $license->supplier->support_phone }} + @endif + + @if ($license->supplier->support_email) +
    {{ $license->supplier->support_email }} + @endif +
    -
    @endif From 77dacfcc30e4eb42deb6657f296002b4b6b2046f Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 26 Mar 2024 12:19:29 +0000 Subject: [PATCH 72/78] Show if deleted supplier Signed-off-by: snipe --- resources/views/licenses/view.blade.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/views/licenses/view.blade.php b/resources/views/licenses/view.blade.php index 8caddd03b9..62c5ffa67f 100755 --- a/resources/views/licenses/view.blade.php +++ b/resources/views/licenses/view.blade.php @@ -187,7 +187,7 @@ @else {{ $license->supplier->name }} @endcan - + @if ($license->supplier->url)
    {{ $license->supplier->url }} @endif @@ -232,6 +232,8 @@ @endif
    + @else + {{ trans('general.deleted') }} @endif From a4e5ae0938dccc87af3c2172f71e97448d73f884 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 26 Mar 2024 12:20:27 +0000 Subject: [PATCH 73/78] Removed duplicates Signed-off-by: snipe --- resources/views/licenses/view.blade.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/resources/views/licenses/view.blade.php b/resources/views/licenses/view.blade.php index 62c5ffa67f..4f47055c27 100755 --- a/resources/views/licenses/view.blade.php +++ b/resources/views/licenses/view.blade.php @@ -219,17 +219,7 @@ @if ($license->supplier->zip) {{ $license->supplier->zip }} @endif - - - - @if ($license->supplier->support_phone) -
    - {{ $license->supplier->support_phone }} - @endif - - @if ($license->supplier->support_email) -
    {{ $license->supplier->support_email }} - @endif + @else From f450cafe3ea748081141959e44fdb1b274095f83 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 26 Mar 2024 12:29:25 +0000 Subject: [PATCH 74/78] Fixed missing div Signed-off-by: snipe --- resources/views/hardware/view.blade.php | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index ce814d5c76..550359eb0b 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -983,6 +983,7 @@ +
    From 3ced85080a76dc7e5ba9b5584fdcf8689b0bb3af Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 26 Mar 2024 14:45:20 +0000 Subject: [PATCH 75/78] Fixed #14495 - Allow user_id to be passed to limit to only specific admins Signed-off-by: snipe --- app/Http/Controllers/Api/ReportsController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/Api/ReportsController.php b/app/Http/Controllers/Api/ReportsController.php index a91d8a9bcc..3c1faa1031 100644 --- a/app/Http/Controllers/Api/ReportsController.php +++ b/app/Http/Controllers/Api/ReportsController.php @@ -45,6 +45,10 @@ class ReportsController extends Controller $actionlogs = $actionlogs->where('action_type', '=', $request->input('action_type'))->orderBy('created_at', 'desc'); } + if ($request->filled('user_id')) { + $actionlogs = $actionlogs->where('user_id', '=', $request->input('user_id')); + } + if ($request->filled('action_source')) { $actionlogs = $actionlogs->where('action_source', '=', $request->input('action_source'))->orderBy('created_at', 'desc'); } From b5b8777c9486d86832035b8c5d283d62121f0499 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 26 Mar 2024 12:23:57 -0700 Subject: [PATCH 76/78] Extract translation string --- resources/lang/en-US/validation.php | 6 ++++++ resources/views/settings/security.blade.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/lang/en-US/validation.php b/resources/lang/en-US/validation.php index 1c6ad8a148..9298bc106f 100644 --- a/resources/lang/en-US/validation.php +++ b/resources/lang/en-US/validation.php @@ -151,4 +151,10 @@ return [ 'attributes' => [], + /* + |-------------------------------------------------------------------------- + | Generic Validation Messages + |-------------------------------------------------------------------------- + */ + 'invalid_value_in_field' => 'Invalid value included in this field', ]; diff --git a/resources/views/settings/security.blade.php b/resources/views/settings/security.blade.php index baacb41440..f108683dc3 100644 --- a/resources/views/settings/security.blade.php +++ b/resources/views/settings/security.blade.php @@ -106,7 +106,7 @@ @if ($errors->has('pwd_secure_complexity.*')) - Invalid value included in this field + {{ trans('validation.invalid_value_in_field') }} @endif

    {{ trans('admin/settings/general.pwd_secure_complexity_help') }} From 8bc9688d719d84a657cb7455dc88604be291fca2 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 27 Mar 2024 16:04:00 +0000 Subject: [PATCH 77/78] =?UTF-8?q?Added=20ability=20to=20filter=20on=20cate?= =?UTF-8?q?gory=20ID=20and=20model=20ID=20from=20user=E2=80=99s=20asset=20?= =?UTF-8?q?API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: snipe --- app/Http/Controllers/Api/UsersController.php | 21 +++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index e9551d51a8..5ef45ee4d9 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -560,7 +560,26 @@ class UsersController extends Controller { $this->authorize('view', User::class); $this->authorize('view', Asset::class); - $assets = Asset::where('assigned_to', '=', $id)->where('assigned_type', '=', User::class)->with('model')->get(); + $assets = Asset::where('assigned_to', '=', $id)->where('assigned_type', '=', User::class)->with('model'); + + + // Filter on category ID + if ($request->filled('category_id')) { + $assets = $assets->InCategory($request->input('category_id')); + } + + + // Filter on model ID + if ($request->filled('model_id')) { + + $model_ids = $request->input('model_id'); + if (!is_array($model_ids)) { + $model_ids = array($model_ids); + } + $assets = $assets->InModelList($model_ids); + } + + $assets = $assets->get(); return (new AssetsTransformer)->transformAssets($assets, $assets->count(), $request); } From 60c678680ae50666168e6d9ede7f132c1c405146 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 27 Mar 2024 16:12:57 +0000 Subject: [PATCH 78/78] [Snyk] Upgrade alpinejs from 3.13.5 to 3.13.6 Signed-off-by: snipe --- package-lock.json | 6 +++--- package.json | 2 +- public/js/dist/all-defer.js | Bin 106924 -> 107263 bytes public/mix-manifest.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3a81578e6a..37902c1ffa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2379,9 +2379,9 @@ } }, "alpinejs": { - "version": "3.13.5", - "resolved": "https://registry.npmjs.org/alpinejs/-/alpinejs-3.13.5.tgz", - "integrity": "sha512-1d2XeNGN+Zn7j4mUAKXtAgdc4/rLeadyTMWeJGXF5DzwawPBxwTiBhFFm6w/Ei8eJxUZeyNWWSD9zknfdz1kEw==", + "version": "3.13.7", + "resolved": "https://registry.npmjs.org/alpinejs/-/alpinejs-3.13.7.tgz", + "integrity": "sha512-rcTyjTANbsePq1hb7eSekt3qjI94HLGeO6JaRjCssCVbIIc+qBrc7pO5S/+2JB6oojIibjM6FA+xRI3zhGPZIg==", "requires": { "@vue/reactivity": "~3.1.1" } diff --git a/package.json b/package.json index f02b78db0b..fab86d9d2c 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "acorn-import-assertions": "^1.9.0", "admin-lte": "^2.4.18", "ajv": "^6.12.6", - "alpinejs": "^3.13.5", + "alpinejs": "^3.13.6", "blueimp-file-upload": "^9.34.0", "bootstrap": "^3.4.1", "bootstrap-colorpicker": "^2.5.3", diff --git a/public/js/dist/all-defer.js b/public/js/dist/all-defer.js index 50470c93f94476a9e18c2393958ae02a43c41f5a..5d43f61e37c99fe148b6bc6438ccee6fadf89f22 100644 GIT binary patch delta 573 zcmZ2;nC<^jwhc4HWpxzF6LYdtixh0Z3{8bv`B16!8KZi~exFW95Z5g%U`U!0v;Fqwav%;rNTf)m-zm2^NxPPS8& z-~97vQ@l!AW?qVOPJVG}afwE1j*fyxrlx|e9n@k4h0HXd$n;&Rj7prDdhr$UMX71U zlMC&{wri>}-ixeP+b^^; z#&CJUz2`NfV)kp>j0t0Ar;53Qt!99$txHX8>p|PE3 I2IB%w094?u^Z)<= delta 287 zcmex=lx@vnwhc4Hc{CNOxfFn)JTWJG^HyB$pNyrRJ5m<|x=Iq~=&d49UpMNmbB*OTi3RP{>R}5}wYd z#;9ZoSEUzU5nq&=R;&pzL;=NUgsOr>kbQpnDU%nT7TNBv#&|DMFgvxfSg)Y8I76c> zF{d=uNOQVF6QjuVV-1Yo1<>R)w*#fx*rs##F>-Hz+QFE~GJUBTqr~J>)A+Xc_A;*G N26MM(%w(L-2>@3;V-^4a diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 68309ab7e0..0c7d2c8a80 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -33,7 +33,7 @@ "/js/build/vendor.js": "/js/build/vendor.js?id=a2b971da417306a63385c8098acfe4af", "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=857da5daffd13e0553510e5ccd410c79", "/js/dist/all.js": "/js/dist/all.js?id=13bdb521e0c745d7f81dae3fb110b650", - "/js/dist/all-defer.js": "/js/dist/all-defer.js?id=19ccc62a8f1ea103dede4808837384d4", + "/js/dist/all-defer.js": "/js/dist/all-defer.js?id=18d36546bdad8285c229008df799b343", "/css/dist/skins/skin-green.min.css": "/css/dist/skins/skin-green.min.css?id=0a82a6ae6bb4e58fe62d162c4fb50397", "/css/dist/skins/skin-green-dark.min.css": "/css/dist/skins/skin-green-dark.min.css?id=d419cb63a12dc175d71645c876bfc2ab", "/css/dist/skins/skin-black.min.css": "/css/dist/skins/skin-black.min.css?id=76482123f6c70e866d6b971ba91de7bb",