Merge pull request #10069 from snipe/fixes/add_use_default_eula_to_category_endpoint

Fixed #9973 - add use_default_eula to category endpoint
This commit is contained in:
snipe 2021-09-10 20:25:56 -07:00 committed by GitHub
commit fb68c49c44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View file

@ -29,6 +29,7 @@ class CategoriesTransformer
'image' => ($category->image) ? Storage::disk('public')->url('categories/'.e($category->image)) : null, 'image' => ($category->image) ? Storage::disk('public')->url('categories/'.e($category->image)) : null,
'category_type' => ucwords(e($category->category_type)), 'category_type' => ucwords(e($category->category_type)),
'has_eula' => ($category->getEula() ? true : false), 'has_eula' => ($category->getEula() ? true : false),
'use_default_eula' => ($category->use_default_eula=='1' ? true : false),
'eula' => ($category->getEula()), 'eula' => ($category->getEula()),
'checkin_email' => ($category->checkin_email =='1'), 'checkin_email' => ($category->checkin_email =='1'),
'require_acceptance' => ($category->require_acceptance == '1'), 'require_acceptance' => ($category->require_acceptance == '1'),

View file

@ -56,6 +56,13 @@ class CategoryPresenter extends Presenter
"title" => trans('admin/categories/table.eula_text'), "title" => trans('admin/categories/table.eula_text'),
"visible" => false, "visible" => false,
"formatter" => 'trueFalseFormatter', "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", "field" => "checkin_email",
"searchable" => false, "searchable" => false,

View file

@ -17,6 +17,7 @@ return array(
'no_default_eula' => 'No primary default EULA found. Add one in Settings.', 'no_default_eula' => 'No primary default EULA found. Add one in Settings.',
'update' => 'Update Category', 'update' => 'Update Category',
'use_default_eula' => 'Use the <a href="#" data-toggle="modal" data-target="#eulaModal">primary default EULA</a> instead.', 'use_default_eula' => 'Use the <a href="#" data-toggle="modal" data-target="#eulaModal">primary default EULA</a> instead.',
'use_default_eula_column' => 'Use default EULA',
'use_default_eula_disabled' => '<del>Use the primary default EULA instead.</del> No primary default EULA is set. Please add one in Settings.', 'use_default_eula_disabled' => '<del>Use the primary default EULA instead.</del> No primary default EULA is set. Please add one in Settings.',
); );