From 6e82de2f47b5443ea185de030acdfebe1c71c6d9 Mon Sep 17 00:00:00 2001 From: Rick Nelson Date: Thu, 1 Sep 2022 11:21:02 -0400 Subject: [PATCH 1/5] Fixed #11769: PAT Test hardcoded text --- app/Models/AssetMaintenance.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/AssetMaintenance.php b/app/Models/AssetMaintenance.php index c59cc3cd84..41ab802579 100644 --- a/app/Models/AssetMaintenance.php +++ b/app/Models/AssetMaintenance.php @@ -74,7 +74,7 @@ class AssetMaintenance extends Model implements ICompanyableChild trans('admin/asset_maintenances/general.maintenance') => trans('admin/asset_maintenances/general.maintenance'), trans('admin/asset_maintenances/general.repair') => trans('admin/asset_maintenances/general.repair'), trans('admin/asset_maintenances/general.upgrade') => trans('admin/asset_maintenances/general.upgrade'), - 'PAT test' => 'PAT test', + trans('admin/asset_maintenances/general.pat_test') => trans('admin/asset_maintenances/general.pat_test'), trans('admin/asset_maintenances/general.calibration') => trans('admin/asset_maintenances/general.calibration'), trans('admin/asset_maintenances/general.software_support') => trans('admin/asset_maintenances/general.software_support'), trans('admin/asset_maintenances/general.hardware_support') => trans('admin/asset_maintenances/general.hardware_support'), From abd2349604ccc39521e19b68383c1d4fb9259fc1 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 14 Sep 2022 20:08:14 -0700 Subject: [PATCH 2/5] Add @rnelsonee as a contributor --- .all-contributorsrc | 9 +++++++++ README.md | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 16195f5034..690b8e8cc8 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2711,6 +2711,15 @@ "contributions": [ "code" ] + }, + { + "login": "rnelsonee", + "name": "Rick Nelson", + "avatar_url": "https://avatars.githubusercontent.com/u/19511639?v=4", + "profile": "https://github.com/rnelsonee", + "contributions": [ + "code" + ] } ] } diff --git a/README.md b/README.md index 8245086f2d..3b0029c711 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ![Build Status](https://app.chipperci.com/projects/0e5f8979-31eb-4ee6-9abf-050b76ab0383/status/master) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/snipe-it/localized.svg)](https://crowdin.com/project/snipe-it) [![Docker Pulls](https://img.shields.io/docker/pulls/snipe/snipe-it.svg)](https://hub.docker.com/r/snipe/snipe-it/) [![Twitter Follow](https://img.shields.io/twitter/follow/snipeitapp.svg?style=social)](https://twitter.com/snipeitapp) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/553ce52037fc43ea99149785afcfe641)](https://www.codacy.com/app/snipe/snipe-it?utm_source=github.com&utm_medium=referral&utm_content=snipe/snipe-it&utm_campaign=Badge_Grade) -[![All Contributors](https://img.shields.io/badge/all_contributors-298-orange.svg?style=flat-square)](#contributors) [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/yZFtShAcKk) [![huntr](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev) +[![All Contributors](https://img.shields.io/badge/all_contributors-299-orange.svg?style=flat-square)](#contributors) [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/yZFtShAcKk) [![huntr](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev) ## Snipe-IT - Open Source Asset Management System @@ -137,7 +137,7 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken | [
Adam](http://www.aboutcher.co.uk)
[💻](https://github.com/snipe/snipe-it/commits?author=adamboutcher "Code") | [
Ian](https://snksrv.com)
[💻](https://github.com/snipe/snipe-it/commits?author=sneak-it "Code") | [
Shao Yu-Lung (Allen)](http://blog.bestlong.idv.tw/)
[💻](https://github.com/snipe/snipe-it/commits?author=bestlong "Code") | [
Haxatron](https://github.com/Haxatron)
[💻](https://github.com/snipe/snipe-it/commits?author=Haxatron "Code") | [
PlaneNuts](https://github.com/PlaneNuts)
[💻](https://github.com/snipe/snipe-it/commits?author=PlaneNuts "Code") | [
Bradley Coudriet](http://bjcpgd.cias.rit.edu)
[💻](https://github.com/snipe/snipe-it/commits?author=exula "Code") | [
Dalton Durst](https://daltondur.st)
[💻](https://github.com/snipe/snipe-it/commits?author=UniversalSuperBox "Code") | | [
Alex Janes](https://adagiohealth.org)
[💻](https://github.com/snipe/snipe-it/commits?author=adagioajanes "Code") | [
Nuraeil](https://github.com/nuraeil)
[💻](https://github.com/snipe/snipe-it/commits?author=nuraeil "Code") | [
TenOfTens](https://github.com/TenOfTens)
[💻](https://github.com/snipe/snipe-it/commits?author=TenOfTens "Code") | [
waffle](https://ditisjens.be/)
[💻](https://github.com/snipe/snipe-it/commits?author=insert-waffle "Code") | [
Yevhenii Huzii](https://github.com/QveenSi)
[💻](https://github.com/snipe/snipe-it/commits?author=QveenSi "Code") | [
Achmad Fienan Rahardianto](https://github.com/veenone)
[💻](https://github.com/snipe/snipe-it/commits?author=veenone "Code") | [
Yevhenii Huzii](https://github.com/QveenSi)
[💻](https://github.com/snipe/snipe-it/commits?author=QveenSi "Code") | | [
Christian Weirich](https://github.com/chrisweirich)
[💻](https://github.com/snipe/snipe-it/commits?author=chrisweirich "Code") | [
denzfarid](https://github.com/denzfarid)
| [
ntbutler-nbcs](https://github.com/ntbutler-nbcs)
[💻](https://github.com/snipe/snipe-it/commits?author=ntbutler-nbcs "Code") | [
Naveen](https://naveensrinivasan.dev)
[💻](https://github.com/snipe/snipe-it/commits?author=naveensrinivasan "Code") | [
Mike Roquemore](https://github.com/mikeroq)
[💻](https://github.com/snipe/snipe-it/commits?author=mikeroq "Code") | [
Daniel Reeder](https://github.com/reederda)
[🌍](#translation-reederda "Translation") [🌍](#translation-reederda "Translation") [💻](https://github.com/snipe/snipe-it/commits?author=reederda "Code") | [
vickyjaura183](https://github.com/vickyjaura183)
[💻](https://github.com/snipe/snipe-it/commits?author=vickyjaura183 "Code") | -| [
Peace](https://github.com/julian-piehl)
[💻](https://github.com/snipe/snipe-it/commits?author=julian-piehl "Code") | [
Kyle Gordon](https://github.com/kylegordon)
[💻](https://github.com/snipe/snipe-it/commits?author=kylegordon "Code") | [
Katharina Drexel](http://www.bfh.ch)
[💻](https://github.com/snipe/snipe-it/commits?author=sunflowerbofh "Code") | [
David Sferruzza](https://david.sferruzza.fr/)
[💻](https://github.com/snipe/snipe-it/commits?author=dsferruzza "Code") | +| [
Peace](https://github.com/julian-piehl)
[💻](https://github.com/snipe/snipe-it/commits?author=julian-piehl "Code") | [
Kyle Gordon](https://github.com/kylegordon)
[💻](https://github.com/snipe/snipe-it/commits?author=kylegordon "Code") | [
Katharina Drexel](http://www.bfh.ch)
[💻](https://github.com/snipe/snipe-it/commits?author=sunflowerbofh "Code") | [
David Sferruzza](https://david.sferruzza.fr/)
[💻](https://github.com/snipe/snipe-it/commits?author=dsferruzza "Code") | [
Rick Nelson](https://github.com/rnelsonee)
[💻](https://github.com/snipe/snipe-it/commits?author=rnelsonee "Code") | This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome! From 20220764bb8a121e0f74e7860e771420c8cf6486 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Thu, 15 Sep 2022 11:18:54 -0500 Subject: [PATCH 3/5] Add possible values for custom fields of type checkbox --- .../custom-field-set-default-values-for-model.blade.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/views/livewire/custom-field-set-default-values-for-model.blade.php b/resources/views/livewire/custom-field-set-default-values-for-model.blade.php index 220956115c..9608e91ac2 100644 --- a/resources/views/livewire/custom-field-set-default-values-for-model.blade.php +++ b/resources/views/livewire/custom-field-set-default-values-for-model.blade.php @@ -46,7 +46,9 @@ defaultValue($model_id) == $field_value ? 'checked="checked"': '' }} />{{ $field_value }}
@endforeach @elseif($field->element == "checkbox") - defaultValue($model_id) ? 'checked="checked"': '' }}/> + @foreach(explode("\r\n", $field->field_values) as $field_value) + defaultValue($model_id) == $field_value ? 'checked="checked"': '' }} /> {{ $field_value }}
+ @endforeach @else Unknown field element: {{ $field->element }} From 41b75704e384461350a24dd87e6f0e70c2f0a941 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Thu, 15 Sep 2022 11:21:02 -0500 Subject: [PATCH 4/5] Removes format when changing to custom fields elements that doesn't need it --- app/Http/Controllers/CustomFieldsController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/CustomFieldsController.php b/app/Http/Controllers/CustomFieldsController.php index da4bd08550..43540ed421 100644 --- a/app/Http/Controllers/CustomFieldsController.php +++ b/app/Http/Controllers/CustomFieldsController.php @@ -235,6 +235,10 @@ class CustomFieldsController extends Controller $field->format = e($request->get('format')); } + if($field->element == 'checkbox' || $field->element == 'radio'){ + $field->format = 'ANY'; + } + if ($field->save()) { return redirect()->route('fields.index')->with('success', trans('admin/custom_fields/message.field.update.success')); } From 9b2eda2d708c956c159b7bca13e2851f332a7f83 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Thu, 15 Sep 2022 11:52:49 -0500 Subject: [PATCH 5/5] Save and show the default values properly on custom fields of type checkbox --- .../custom-field-set-default-values-for-model.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/livewire/custom-field-set-default-values-for-model.blade.php b/resources/views/livewire/custom-field-set-default-values-for-model.blade.php index 9608e91ac2..4ece5ab0ae 100644 --- a/resources/views/livewire/custom-field-set-default-values-for-model.blade.php +++ b/resources/views/livewire/custom-field-set-default-values-for-model.blade.php @@ -47,7 +47,7 @@ @endforeach @elseif($field->element == "checkbox") @foreach(explode("\r\n", $field->field_values) as $field_value) - defaultValue($model_id) == $field_value ? 'checked="checked"': '' }} /> {{ $field_value }}
+ defaultValue($model_id))) ? 'checked="checked"': '' }} /> {{ $field_value }}
@endforeach @else