Commit 8db3b86c authored by Johan Cwiklinski's avatar Johan Cwiklinski
Browse files

Use maybe* methods


Co-authored-by: default avatarCédric Anne <cedric.anne@gmail.com>
parent 46244585
......@@ -749,7 +749,7 @@ class Stat extends CommonGLPI {
$criteria = [];
$WHERE = [];
if ($DB->fieldExists($table, 'is_deleted')) {
if ($item->maybeDeleted()) {
$WHERE["$table.is_deleted"] = 0;
}
$WHERE += getEntitiesRestrictCriteria($table);
......@@ -1938,4 +1938,3 @@ class Stat extends CommonGLPI {
return "fas fa-chart-bar";
}
}
......@@ -120,10 +120,10 @@ class State extends CommonTreeDropdown {
} else {
$table = getTableForItemType($itemtype);
$WHERE = [];
if ($DB->fieldExists($table, 'is_deleted')) {
if ($item->maybeDeleted()) {
$WHERE["$table.is_deleted"] = 0;
}
if ($DB->fieldExists($table, 'is_template')) {
if ($item->maybeTemplate()) {
$WHERE["$table.is_template"] = 0;
}
$WHERE += getEntitiesRestrictCriteria($table);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment