From 514f9aa64aef22e42b03ab8f8d78357fa4587360 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 10 Sep 2021 20:23:49 -0700 Subject: [PATCH] Fixed #9973 - add use_default_eula to categories API endpoint Signed-off-by: snipe --- app/Http/Transformers/CategoriesTransformer.php | 1 + app/Presenters/CategoryPresenter.php | 7 +++++++ resources/lang/en/admin/categories/general.php | 1 + 3 files changed, 9 insertions(+) diff --git a/app/Http/Transformers/CategoriesTransformer.php b/app/Http/Transformers/CategoriesTransformer.php index a07d8b345c..0ecdb923d6 100644 --- a/app/Http/Transformers/CategoriesTransformer.php +++ b/app/Http/Transformers/CategoriesTransformer.php @@ -29,6 +29,7 @@ class CategoriesTransformer 'image' => ($category->image) ? Storage::disk('public')->url('categories/'.e($category->image)) : null, 'category_type' => ucwords(e($category->category_type)), 'has_eula' => ($category->getEula() ? true : false), + 'use_default_eula' => ($category->use_default_eula=='1' ? true : false), 'eula' => ($category->getEula()), 'checkin_email' => ($category->checkin_email =='1'), 'require_acceptance' => ($category->require_acceptance == '1'), diff --git a/app/Presenters/CategoryPresenter.php b/app/Presenters/CategoryPresenter.php index 19507e2771..0b87b13e02 100644 --- a/app/Presenters/CategoryPresenter.php +++ b/app/Presenters/CategoryPresenter.php @@ -56,6 +56,13 @@ class CategoryPresenter extends Presenter "title" => trans('admin/categories/table.eula_text'), "visible" => false, "formatter" => 'trueFalseFormatter', + ],[ + "field" => "use_default_eula", + "searchable" => false, + "sortable" => true, + "title" => trans('admin/categories/general.use_default_eula_column'), + "visible" => false, + "formatter" => 'trueFalseFormatter', ],[ "field" => "checkin_email", "searchable" => false, diff --git a/resources/lang/en/admin/categories/general.php b/resources/lang/en/admin/categories/general.php index 7741b7da62..c8385018d8 100644 --- a/resources/lang/en/admin/categories/general.php +++ b/resources/lang/en/admin/categories/general.php @@ -17,6 +17,7 @@ return array( 'no_default_eula' => 'No primary default EULA found. Add one in Settings.', 'update' => 'Update Category', 'use_default_eula' => 'Use the primary default EULA instead.', + 'use_default_eula_column' => 'Use default EULA', 'use_default_eula_disabled' => 'Use the primary default EULA instead. No primary default EULA is set. Please add one in Settings.', );