From 6d4574130f1c51f750f12c3360c0b4daf1a22dc1 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 11 Oct 2017 14:44:25 -0700 Subject: [PATCH] Clearer indication of whether or not the user will be emailed a eula --- app/Http/Controllers/Api/CategoriesController.php | 4 ++-- app/Http/Transformers/CategoriesTransformer.php | 2 +- app/Presenters/CategoryPresenter.php | 7 ++++--- resources/views/hardware/checkin.blade.php | 10 ++++------ 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/Api/CategoriesController.php b/app/Http/Controllers/Api/CategoriesController.php index 944f049f6f..82f34754ad 100644 --- a/app/Http/Controllers/Api/CategoriesController.php +++ b/app/Http/Controllers/Api/CategoriesController.php @@ -20,9 +20,9 @@ class CategoriesController extends Controller public function index(Request $request) { $this->authorize('view', Category::class); - $allowed_columns = ['id', 'name','category_type','use_default_eula','require_acceptance','checkin_email']; + $allowed_columns = ['id', 'name','category_type','use_default_eula','eula_text', 'require_acceptance','checkin_email']; - $categories = Category::select(['id', 'created_at', 'updated_at', 'name','category_type','use_default_eula','require_acceptance','checkin_email']) + $categories = Category::select(['id', 'created_at', 'updated_at', 'name','category_type','use_default_eula','eula_text', 'require_acceptance','checkin_email']) ->withCount('assets', 'accessories', 'consumables', 'components'); if ($request->has('search')) { diff --git a/app/Http/Transformers/CategoriesTransformer.php b/app/Http/Transformers/CategoriesTransformer.php index bcfa0aec26..edb56c0127 100644 --- a/app/Http/Transformers/CategoriesTransformer.php +++ b/app/Http/Transformers/CategoriesTransformer.php @@ -26,7 +26,7 @@ class CategoriesTransformer 'id' => (int) $category->id, 'name' => e($category->name), 'type' => e($category->category_type), - 'use_default_eula' => ($category->use_default_eula =='1') ? true : false, + 'eula' => ($category->getEula()) ? true : false, 'checkin_email' => ($category->checkin_email =='1') ? true : false, 'require_acceptance' => ($category->require_acceptance =='1') ? true : false, 'assets_count' => $category->assets_count, diff --git a/app/Presenters/CategoryPresenter.php b/app/Presenters/CategoryPresenter.php index 7dbcb4d541..4b545b82de 100644 --- a/app/Presenters/CategoryPresenter.php +++ b/app/Presenters/CategoryPresenter.php @@ -63,20 +63,21 @@ class CategoryPresenter extends Presenter "title" => trans('general.components'), "visible" => true ], [ - "field" => "use_default_eula", + "field" => "eula", "searchable" => false, "sortable" => false, "title" => trans('admin/categories/table.eula_text'), "visible" => false, "formatter" => 'trueFalseFormatter', - ], [ + ], [ "field" => "require_acceptance", "searchable" => false, "sortable" => false, "title" => trans('admin/categories/table.require_acceptance'), "visible" => true, "formatter" => 'trueFalseFormatter', - ], [ + ], + [ "field" => "actions", "searchable" => false, "sortable" => false, diff --git a/resources/views/hardware/checkin.blade.php b/resources/views/hardware/checkin.blade.php index 351be85643..bf365b958c 100755 --- a/resources/views/hardware/checkin.blade.php +++ b/resources/views/hardware/checkin.blade.php @@ -91,16 +91,14 @@ {!! $errors->first('note', ' :message') !!} - - + - +