From e972aa1f652ad4416c5ed29d15f37e496538131b Mon Sep 17 00:00:00 2001 From: Romain Lecouvreur <102067890+RomainLvr@users.noreply.github.com> Date: Mon, 6 May 2024 09:41:02 +0200 Subject: [PATCH] Fix unsended notifications while 'Delete old groups when adding a new one' is set to 'No' (#187) * Fix unsended notifications while 'Delete old groups when adding a new one' is set to 'No' * Update CHANGELOG.md --- CHANGELOG.md | 3 ++- inc/ticket.class.php | 14 ++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c71a631..f75138ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [unreleased] - +## [unreleased] ### Fixed - Fix unauthorized deletion of ticket actors according to plugin configuration +- Fix unsended notifications while `Delete old groups when adding a new one` is set to `No` ## [2.9.4] - 2024-04-03 diff --git a/inc/ticket.class.php b/inc/ticket.class.php index 814ff342..3c253d10 100644 --- a/inc/ticket.class.php +++ b/inc/ticket.class.php @@ -410,17 +410,15 @@ public static function addHistoryOnAddGroup(CommonDBTM $item) public static function processAfterAddGroup(CommonDBTM $item) { - if ($_SESSION['plugins']['escalade']['config']['remove_group'] == false) { - return true; - } - $tickets_id = $item->fields['tickets_id']; - $groups_id = $item->fields['groups_id']; + $groups_id = $item->fields['groups_id']; - //remove old groups (keep last assigned) - self::removeAssignGroups($tickets_id, $groups_id); + //remove old groups (keep last assigned) + if ($_SESSION['plugins']['escalade']['config']['remove_group'] == true) { + self::removeAssignGroups($tickets_id, $groups_id); + } - //notified only the last group assigned + //notified only the last group assigned $ticket = new Ticket(); $ticket->getFromDB($tickets_id);