Fixed #4952 - ignore show_archived setting when drilling down into specific ID

This commit is contained in:
snipe 2018-02-01 16:31:32 -06:00
parent 8b2045523d
commit d2587337e4

View file

@ -199,12 +199,18 @@ class AssetsController extends Controller
break;
default:
if ($settings->show_archived_in_list!='1') {
if ((!$request->has('status_id')) && ($settings->show_archived_in_list!='1')) {
// terrible workaround for complex-query Laravel bug in fulltext
$assets->join('status_labels AS status_alias',function ($join) {
$join->on('status_alias.id', "=", "assets.status_id")
->where('status_alias.archived', '=', 0);
});
// If there is a status ID, don't take show_archived_in_list into consideration
} else {
$assets->join('status_labels AS status_alias',function ($join) {
$join->on('status_alias.id', "=", "assets.status_id");
});
}
}