From 5680a25a3e468a9d2575e1762d63a44d035c5a17 Mon Sep 17 00:00:00 2001 From: Guillaume RENAUDIE Date: Mon, 9 Dec 2024 16:43:41 +0100 Subject: [PATCH 1/2] Fix scope - only tickets are affected "Display delete button" affect only ticket form not the change and problem. fixes #266 --- js/remove_btn.js.php | 4 +--- setup.php | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/js/remove_btn.js.php b/js/remove_btn.js.php index ff1a0ba..3fc1128 100644 --- a/js/remove_btn.js.php +++ b/js/remove_btn.js.php @@ -201,9 +201,7 @@ function handleEvent() { $(document).ready(function() { // only in ticket form - if (location.pathname.indexOf('ticket.form.php') > 0 - || location.pathname.indexOf('problem.form.php') > 0 - || location.pathname.indexOf('change.form.php') > 0) { + if (location.pathname.indexOf('ticket.form.php')) { $(document).on('glpi.tab.loaded', function() { let buttons_to_delete = { Group: { diff --git a/setup.php b/setup.php index 01ad6cc..68677d6 100644 --- a/setup.php +++ b/setup.php @@ -77,9 +77,7 @@ function plugin_init_escalade() // on ticket page (in edition) if ( - (strpos($_SERVER['REQUEST_URI'] ?? '', "ticket.form.php") !== false - || strpos($_SERVER['REQUEST_URI'] ?? '', "problem.form.php") !== false - || strpos($_SERVER['REQUEST_URI'] ?? '', "change.form.php") !== false) && isset($_GET['id']) + (strpos($_SERVER['REQUEST_URI'] ?? '', "ticket.form.php") !== false) && isset($_GET['id']) ) { if ( !$escalade_config['remove_delete_requester_user_btn'] From 30d0e48f77949cc322bfd96fe869dbaedcb97245 Mon Sep 17 00:00:00 2001 From: Guillaume RENAUDIE Date: Tue, 10 Dec 2024 09:39:42 +0100 Subject: [PATCH 2/2] Documentation added changelog information for the fix --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 968b596..92daacb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Redirect users without ticket rights after escalation. +- Fixed the "delete button" feature : only affects tickets and not the changes / problems ## [2.9.10] - 2024-11-27