A free open source IT asset/license management system
Fixed bug in categories asset listing for hardware
snipe062cbeb18fff
diff --git a/app/Http/Controllers/CategoriesController.php b/app/Http/Controllers/CategoriesController.phpindex c59bf8d13f..4caa3106bf 100755--- a/app/Http/Controllers/CategoriesController.php+++ b/app/Http/Controllers/CategoriesController.php@@ -354,11 +354,20 @@ class CategoriesController extends Controllerforeach ($category_assets as $asset) {+ if ($category->category_type=='asset') {+ $category_type = 'hardware';+ } else {+ $category_type = $category->category_type;+ }+$actions = '';$inout='';if ($asset->deleted_at=='') {- $actions = '<div style=" white-space: nowrap;"><a href="'.route('clone/hardware', $asset->id).'" class="btn btn-info btn-sm" title="Clone asset"><i class="fa fa-files-o"></i></a> <a href="'.route('update/'.$category->category_type, $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/hardware', $asset->id).'" data-content="'.trans('admin/hardware/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($asset->asset_tag).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';+ $actions = '<div style=" white-space: nowrap;">';+ $actions .= '<a href="'.route('clone/hardware', $asset->id).'" class="btn btn-info btn-sm" title="Clone asset"><i class="fa fa-files-o"></i></a> ';+ $actions .= '<a href="'.route('update/'.$category_type, $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> ';+ $actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/hardware', $asset->id).'" data-content="'.trans('admin/hardware/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($asset->asset_tag).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';} elseif ($asset->deleted_at!='') {$actions = '<a href="'.route('restore/hardware', $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';}