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 { ...@@ -749,7 +749,7 @@ class Stat extends CommonGLPI {
$criteria = []; $criteria = [];
$WHERE = []; $WHERE = [];
if ($DB->fieldExists($table, 'is_deleted')) { if ($item->maybeDeleted()) {
$WHERE["$table.is_deleted"] = 0; $WHERE["$table.is_deleted"] = 0;
} }
$WHERE += getEntitiesRestrictCriteria($table); $WHERE += getEntitiesRestrictCriteria($table);
...@@ -1938,4 +1938,3 @@ class Stat extends CommonGLPI { ...@@ -1938,4 +1938,3 @@ class Stat extends CommonGLPI {
return "fas fa-chart-bar"; return "fas fa-chart-bar";
} }
} }
...@@ -120,10 +120,10 @@ class State extends CommonTreeDropdown { ...@@ -120,10 +120,10 @@ class State extends CommonTreeDropdown {
} else { } else {
$table = getTableForItemType($itemtype); $table = getTableForItemType($itemtype);
$WHERE = []; $WHERE = [];
if ($DB->fieldExists($table, 'is_deleted')) { if ($item->maybeDeleted()) {
$WHERE["$table.is_deleted"] = 0; $WHERE["$table.is_deleted"] = 0;
} }
if ($DB->fieldExists($table, 'is_template')) { if ($item->maybeTemplate()) {
$WHERE["$table.is_template"] = 0; $WHERE["$table.is_template"] = 0;
} }
$WHERE += getEntitiesRestrictCriteria($table); $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