From fc1a69a7f1a74dee4d6a7c16f034207a36e3c8e2 Mon Sep 17 00:00:00 2001 From: Stanislas Kita Date: Fri, 19 Dec 2025 15:17:47 +0100 Subject: [PATCH 1/4] Fix(Reporting): Fix LIMIT clause --- CHANGELOG.md | 3 ++- inc/helpdeskplus.class.php | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0b3c28f..4e73a722 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed -- Fix missing attachment from notification + - Fix missing attachment from notification + - Fix `limit` clause ## [1.8.10] - 2025-12-05 diff --git a/inc/helpdeskplus.class.php b/inc/helpdeskplus.class.php index 93b44123..7aa43f58 100644 --- a/inc/helpdeskplus.class.php +++ b/inc/helpdeskplus.class.php @@ -661,7 +661,7 @@ public function reportHbarTopcategory($config = []) //Init delay value $delay = PluginMreportingCommon::getCriteriaDate('glpi_tickets.date', $config['delay'], $config['randname']); - $limit = isset($_SESSION['mreporting_values']['glpilist_limit']) ? '0, ' . $_SESSION['mreporting_values']['glpilist_limit'] : '0, 20'; + $limit = isset($_SESSION['mreporting_values']['glpilist_limit']) ? $_SESSION['mreporting_values']['glpilist_limit'] : 20; $query = [ "SELECT" => [ @@ -715,7 +715,7 @@ public function reportHbarTopapplicant($config = []) //Init delay value $delay = PluginMreportingCommon::getCriteriaDate('glpi_tickets.date', $config['delay'], $config['randname']); - $limit = isset($_SESSION['mreporting_values']['glpilist_limit']) ? '0, ' . $_SESSION['mreporting_values']['glpilist_limit'] : '0, 20'; + $limit = isset($_SESSION['mreporting_values']['glpilist_limit']) ? $_SESSION['mreporting_values']['glpilist_limit'] : 20; $query = [ "SELECT" => [ @@ -1013,7 +1013,7 @@ public function reportHgbarRespectedSlasByTopCategory($config = []) if (isset($_POST['categories']) && $_POST['categories'] > 0) { $category = $_POST['categories']; } else { - $category = false; + $category = false;To } $category_limit = isset($_POST['glpilist_limit']) ? $_POST['glpilist_limit'] : 10; From cd2894be09e4cd979347b5c433cf43855d0983c0 Mon Sep 17 00:00:00 2001 From: "Romain B." <8530352+Rom1-B@users.noreply.github.com> Date: Wed, 24 Dec 2025 07:45:40 +0100 Subject: [PATCH 2/4] Update inc/helpdeskplus.class.php --- inc/helpdeskplus.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/helpdeskplus.class.php b/inc/helpdeskplus.class.php index 7aa43f58..ceb0d34a 100644 --- a/inc/helpdeskplus.class.php +++ b/inc/helpdeskplus.class.php @@ -1013,7 +1013,7 @@ public function reportHgbarRespectedSlasByTopCategory($config = []) if (isset($_POST['categories']) && $_POST['categories'] > 0) { $category = $_POST['categories']; } else { - $category = false;To + $category = false; } $category_limit = isset($_POST['glpilist_limit']) ? $_POST['glpilist_limit'] : 10; From 1ca6ca89169b2d62f37d4a923543d9b81f1c13b0 Mon Sep 17 00:00:00 2001 From: Stanislas Date: Wed, 24 Dec 2025 08:47:04 +0100 Subject: [PATCH 3/4] refactor Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com> --- inc/helpdeskplus.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/helpdeskplus.class.php b/inc/helpdeskplus.class.php index ceb0d34a..04985755 100644 --- a/inc/helpdeskplus.class.php +++ b/inc/helpdeskplus.class.php @@ -661,7 +661,7 @@ public function reportHbarTopcategory($config = []) //Init delay value $delay = PluginMreportingCommon::getCriteriaDate('glpi_tickets.date', $config['delay'], $config['randname']); - $limit = isset($_SESSION['mreporting_values']['glpilist_limit']) ? $_SESSION['mreporting_values']['glpilist_limit'] : 20; + $limit = $_SESSION['mreporting_values']['glpilist_limit'] ?? 20; $query = [ "SELECT" => [ From d529bba89221422ddff18883be918eac9a79a541 Mon Sep 17 00:00:00 2001 From: Stanislas Date: Wed, 24 Dec 2025 08:47:10 +0100 Subject: [PATCH 4/4] refactor Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com> --- inc/helpdeskplus.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/helpdeskplus.class.php b/inc/helpdeskplus.class.php index 04985755..6d01e67c 100644 --- a/inc/helpdeskplus.class.php +++ b/inc/helpdeskplus.class.php @@ -715,7 +715,7 @@ public function reportHbarTopapplicant($config = []) //Init delay value $delay = PluginMreportingCommon::getCriteriaDate('glpi_tickets.date', $config['delay'], $config['randname']); - $limit = isset($_SESSION['mreporting_values']['glpilist_limit']) ? $_SESSION['mreporting_values']['glpilist_limit'] : 20; + $limit = $_SESSION['mreporting_values']['glpilist_limit'] ?? 20; $query = [ "SELECT" => [