diff --git a/app/Http/Controllers/Api/StatuslabelsController.php b/app/Http/Controllers/Api/StatuslabelsController.php
index 46159d053d..20a67e8335 100644
--- a/app/Http/Controllers/Api/StatuslabelsController.php
+++ b/app/Http/Controllers/Api/StatuslabelsController.php
@@ -7,7 +7,7 @@ use App\Http\Controllers\Controller;
use App\Helpers\Helper;
use App\Models\Statuslabel;
use App\Models\Asset;
-use App\Http\Transformers\DatatablesTransformer;
+use App\Http\Transformers\StatuslabelsTransformer;
use App\Http\Transformers\AssetsTransformer;
use PhpParser\Node\Expr\Cast\Bool_;
@@ -25,8 +25,7 @@ class StatuslabelsController extends Controller
$this->authorize('view', Statuslabel::class);
$allowed_columns = ['id','name','created_at'];
- $statuslabels = Statuslabel::select(['id','name','deployable','pending','archived','color','show_in_nav','created_at'])
- ->withCount('assets');
+ $statuslabels = Statuslabel::withCount('assets');
if ($request->has('search')) {
$statuslabels = $statuslabels->TextSearch($request->input('search'));
@@ -40,7 +39,7 @@ class StatuslabelsController extends Controller
$total = $statuslabels->count();
$statuslabels = $statuslabels->skip($offset)->take($limit)->get();
- return (new DatatablesTransformer)->transformDatatables($statuslabels, $total);
+ return (new StatuslabelsTransformer)->transformStatuslabels($statuslabels, $total);
}
diff --git a/app/Http/Transformers/StatuslabelsTransformer.php b/app/Http/Transformers/StatuslabelsTransformer.php
index bd99fe6c99..605dbb940a 100644
--- a/app/Http/Transformers/StatuslabelsTransformer.php
+++ b/app/Http/Transformers/StatuslabelsTransformer.php
@@ -22,8 +22,9 @@ class StatuslabelsTransformer
'id' => e($statuslabel->id),
'name' => e($statuslabel->name),
'type' => $statuslabel->getStatuslabelType(),
- 'color' => e($statuslabel->color),
+ 'color' => ($statuslabel->color) ? e($statuslabel->color) : null,
'show_in_nav' => ($statuslabel->show_in_nav=='1') ? true : false,
+ 'notes' => e($statuslabel->notes),
'created_at' => $statuslabel->created_at,
'updated_at' => $statuslabel->updated_at,
];
@@ -31,10 +32,6 @@ class StatuslabelsTransformer
return $array;
}
- public function transformStatuslabelsDatatable($users) {
- return (new DatatablesTransformer)->transformDatatables($users);
- }
-
}
diff --git a/resources/views/categories/index.blade.php b/resources/views/categories/index.blade.php
index b8a8d78aa5..bcfc2eb3df 100755
--- a/resources/views/categories/index.blade.php
+++ b/resources/views/categories/index.blade.php
@@ -27,8 +27,7 @@
data-url="{{route('api.categories.index') }}"
data-cookie="true"
data-click-to-select="true"
- data-cookie-id-table="categoriesTable-{{ config('version.hash_version') }}"
- >
+ data-cookie-id-table="categoriesTable-{{ config('version.hash_version') }}">
{{ trans('general.id') }} |
diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php
index 47d90aba54..a4a827a438 100644
--- a/resources/views/partials/bootstrap-table.blade.php
+++ b/resources/views/partials/bootstrap-table.blade.php
@@ -152,9 +152,9 @@ $('.snipe-table').bootstrapTable({
function trueFalseFormatter(value, row) {
if ((value) && ((value == 'true') || (value == '1'))) {
- return '';
+ return '';
} else {
- return '';
+ return '';
}
}
diff --git a/resources/views/statuslabels/index.blade.php b/resources/views/statuslabels/index.blade.php
index a721dfd066..d55bde038c 100755
--- a/resources/views/statuslabels/index.blade.php
+++ b/resources/views/statuslabels/index.blade.php
@@ -31,9 +31,9 @@
{{ trans('general.id') }} |
{{ trans('admin/statuslabels/table.name') }} |
- {{ trans('admin/statuslabels/table.status_type') }} |
- {{ trans('admin/statuslabels/table.color') }} |
- {{ trans('admin/statuslabels/table.show_in_nav') }} |
+ {{ trans('admin/statuslabels/table.status_type') }} |
+ {{ trans('admin/statuslabels/table.color') }} |
+ {{ trans('admin/statuslabels/table.show_in_nav') }} |
{{ trans('table.actions') }} |
@@ -53,4 +53,20 @@
@section('moar_scripts')
@include ('partials.bootstrap-table', ['exportFile' => 'statuslabels-export', 'search' => true])
+
+
@stop