From 4cf6394f01d2dc2d40c38433c7c7732043f215d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Fali=C3=A8re?= Date: Tue, 25 Feb 2025 15:43:21 +0100 Subject: [PATCH 1/4] FIX(ticket): Notification email without public interface Remove link to public interface from automatic notification email if not enabled. --- .../interface_50_modTicket_TicketEmail.class.php | 14 +++++++++----- htdocs/langs/en_US/ticket.lang | 3 ++- htdocs/langs/fr_FR/ticket.lang | 3 ++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 00fce02d2c8..7cea13e58d4 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -1,8 +1,8 @@ - * 2016 Christophe Battarel - * Copyright (C) 2023 Benjamin Falière + * Copyright (C) 2016 Christophe Battarel + * Copyright (C) 2023-2025 Benjamin Falière * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -427,9 +427,13 @@ class InterfaceTicketEmail extends DolibarrTriggers } $message_customer .= '

'.$langs->trans('Message').' :

'.$message.'


'; - $url_public_ticket = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', dol_buildpath('/public/ticket/', 2)).'view.php?track_id='.$object->track_id; - $message_customer .= '

'.$langs->trans($see_ticket).' : '.$url_public_ticket.'

'; - $message_customer .= '

'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'

'; + if (!empty(getDolGlobalString('TICKET_ENABLE_PUBLIC_INTERFACE'))) { + $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id; + $message_customer .= '

'.$langs->trans($see_ticket).' : '.$url_public_ticket.'

'; + $message_customer .= '

'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'

'; + } else { + $message_customer .= '

'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmailNoInterface').'

'; + } $from = (empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? '' : $conf->global->MAIN_INFO_SOCIETE_NOM.' ').'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>'; diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 00b1b34d492..d0bbcafe01e 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -136,7 +136,7 @@ TicketsActivatePublicInterfaceHelp=Public interface allow any visitors to create TicketsAutoAssignTicket=Automatically assign the user who created the ticket TicketsAutoAssignTicketHelp=When creating a ticket, the user can be automatically assigned to the ticket. TicketNumberingModules=Tickets numbering module -TicketsModelModule=Document templates for tickets +TicketsModelModule=Document templates for tickets TicketNotifyTiersAtCreation=Notify third party at creation TicketsDisableCustomerEmail=Always disable emails when a ticket is created from public interface TicketsPublicNotificationNewMessage=Send email(s) when a new message/comment is added to a ticket @@ -308,6 +308,7 @@ TicketNewEmailBodyInfosTrackUrl=You can view the progress of the ticket by click TicketNewEmailBodyInfosTrackUrlCustomer=You can view the progress of the ticket in the specific interface by clicking the following link TicketCloseEmailBodyInfosTrackUrlCustomer=You can consult the history of this ticket by clicking the following link TicketEmailPleaseDoNotReplyToThisEmail=Please do not reply directly to this email! Use the link to reply into the interface. +TicketEmailPleaseDoNotReplyToThisEmailNoInterface=Please do not reply directly to this email! TicketPublicInfoCreateTicket=This form allows you to record a support ticket in our management system. TicketPublicPleaseBeAccuratelyDescribe=Please accurately describe your question. Provide the most information possible to allow us to correctly identify your request. TicketPublicMsgViewLogIn=Please enter ticket tracking ID diff --git a/htdocs/langs/fr_FR/ticket.lang b/htdocs/langs/fr_FR/ticket.lang index 6e849456452..9f9d39ad1b9 100644 --- a/htdocs/langs/fr_FR/ticket.lang +++ b/htdocs/langs/fr_FR/ticket.lang @@ -288,7 +288,7 @@ NoLogForThisTicket=Pas encore de log pour ce ticket TicketLogAssignedTo=Ticket %s assigné à %s TicketLogPropertyChanged=Ticket %s modifié: classification de %s à %s TicketLogClosedBy=Ticket %s clôt par %s -TicketLogReopen=Ticket %s ré-ouvert +TicketLogReopen=Ticket %s ré-ouvert # # Public pages @@ -310,6 +310,7 @@ TicketNewEmailBodyInfosTrackUrl=Vous pouvez voir la progression du ticket en cli TicketNewEmailBodyInfosTrackUrlCustomer=Vous pouvez voir la progression du ticket en cliquant sur le lien ci-dessus. TicketCloseEmailBodyInfosTrackUrlCustomer=Vous pouvez consulter l'historique de ce ticket en cliquant sur le lien suivant TicketEmailPleaseDoNotReplyToThisEmail=Merci de ne pas répondre directement à ce courriel ! Utilisez le lien pour répondre via l'interface. +TicketEmailPleaseDoNotReplyToThisEmailNoInterface=Merci de ne pas répondre directement à ce courriel ! TicketPublicInfoCreateTicket=Ce formulaire vous permet d'enregistrer un ticket dans notre système de gestion. TicketPublicPleaseBeAccuratelyDescribe=Veuillez décrire précisément votre question. Fournissez le plus d'informations possible pour nous permettre d'identifier correctement votre demande. TicketPublicMsgViewLogIn=Merci d'entrer le code de suivi du ticket From 0c573812e955fe1ec2ed0c5f3e56005e9d2a9714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Fali=C3=A8re?= Date: Tue, 25 Feb 2025 16:03:07 +0100 Subject: [PATCH 2/4] Remove empty on getDolGlobalString() --- .../core/triggers/interface_50_modTicket_TicketEmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 7cea13e58d4..ebd4ef77069 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -427,7 +427,7 @@ class InterfaceTicketEmail extends DolibarrTriggers } $message_customer .= '

'.$langs->trans('Message').' :

'.$message.'


'; - if (!empty(getDolGlobalString('TICKET_ENABLE_PUBLIC_INTERFACE'))) { + if (getDolGlobalString('TICKET_ENABLE_PUBLIC_INTERFACE')) { $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id; $message_customer .= '

'.$langs->trans($see_ticket).' : '.$url_public_ticket.'

'; $message_customer .= '

'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'

'; From db56e5c8ea81f20248ebbcd92c2ebcdd5ee3c1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Fali=C3=A8re?= Date: Tue, 25 Feb 2025 21:09:59 +0100 Subject: [PATCH 3/4] Replace getDolGlobalString by getDolGlobalInt --- .../core/triggers/interface_50_modTicket_TicketEmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index ebd4ef77069..1ecd3729925 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -427,7 +427,7 @@ class InterfaceTicketEmail extends DolibarrTriggers } $message_customer .= '

'.$langs->trans('Message').' :

'.$message.'


'; - if (getDolGlobalString('TICKET_ENABLE_PUBLIC_INTERFACE')) { + if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) { $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id; $message_customer .= '

'.$langs->trans($see_ticket).' : '.$url_public_ticket.'

'; $message_customer .= '

'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'

'; From 4272cfa7e4e3849a775055dd7363fce808623d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Fali=C3=A8re?= Date: Wed, 26 Feb 2025 10:06:43 +0100 Subject: [PATCH 4/4] Restore url public ticket --- .../core/triggers/interface_50_modTicket_TicketEmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 1ecd3729925..78911c88564 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -428,7 +428,7 @@ class InterfaceTicketEmail extends DolibarrTriggers $message_customer .= '

'.$langs->trans('Message').' :

'.$message.'


'; if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) { - $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id; + $url_public_ticket = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', dol_buildpath('/public/ticket/', 2)).'view.php?track_id='.$object->track_id; $message_customer .= '

'.$langs->trans($see_ticket).' : '.$url_public_ticket.'

'; $message_customer .= '

'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'

'; } else {