From e26124bf847df2d23a2ba730caebc7016ff5e074 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Apr 2020 12:57:33 +0200 Subject: [PATCH] Clean code to make option TICKET_NOTIFICATION_EMAIL_TO easier to understand --- htdocs/admin/ticket.php | 10 +++++----- htdocs/core/class/html.formticket.class.php | 2 +- .../interface_50_modTicket_TicketEmail.class.php | 4 +--- htdocs/public/ticket/create_ticket.php | 4 ++-- htdocs/ticket/card.php | 2 +- htdocs/ticket/class/ticket.class.php | 1 - 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 5ad79c4f0bb..51d1e06ba87 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -358,16 +358,16 @@ print $form->textwithpicto('', $langs->trans("TicketEmailNotificationFromHelp"), print ''; print ''; -// Email de réception des notifications -print ''.$langs->trans("TicketEmailNotificationTo").''; +// Email for notification of TICKET_CREATE +print ''.$langs->trans("TicketEmailNotificationTo").' ('.$langs->trans("Creation").')'; print ''; -print ''; +print ''; print ''; print $form->textwithpicto('', $langs->trans("TicketEmailNotificationToHelp"), 1, 'help'); print ''; print ''; -// Also send to main email address +// Also send to TICKET_NOTIFICATION_EMAIL_TO for responses (not only creation) if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print ''.$langs->trans("TicketsEmailAlsoSendToMainAddress").''; @@ -387,7 +387,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // Texte d'introduction $mail_intro = $conf->global->TICKET_MESSAGE_MAIL_INTRO ? $conf->global->TICKET_MESSAGE_MAIL_INTRO : $langs->trans('TicketMessageMailIntroText'); -print ''.$langs->trans("TicketMessageMailIntroLabelAdmin").''; +print ''.$langs->trans("TicketMessageMailIntroLabelAdmin").' ('.$langs->trans("Responses").')'; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70); diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index b688d408284..675979d4512 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -354,7 +354,7 @@ class FormTicket { $formproject = new FormProjets($this->db); print ''; - print $formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1); + print $formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ''; } diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index fef54e6afb6..c84f334cc42 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -188,11 +188,9 @@ class InterfaceTicketEmail extends DolibarrTriggers // Send email to notification email - + $sendto = $conf->global->TICKET_NOTIFICATION_EMAIL_TO; if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) && empty($object->context['disableticketemail'])) { - $sendto = $conf->global->TICKET_NOTIFICATION_EMAIL_TO; - if ($sendto) { // Init to avoid errors diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 11e4cfc5e7e..a2ea4efec12 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -242,8 +242,8 @@ if ($action == 'create_ticket' && GETPOST('add', 'alpha')) { $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; } - // Send email to TICKET_NOTIFICATION_EMAIL_TO (Use TICKET_NOTIFICATION_EMAIL_FROM if not defined) - $sendto = (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? $conf->global->TICKET_NOTIFICATION_EMAIL_TO : $conf->global->TICKET_NOTIFICATION_EMAIL_FROM); + // Send email to TICKET_NOTIFICATION_EMAIL_TO + $sendto = $conf->global->TICKET_NOTIFICATION_EMAIL_TO; if ($sendto) { $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin', $object->ref, $object->track_id); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 8b8ba741ad3..561a491f1d1 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -803,7 +803,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); $morehtmlref .= ''; $morehtmlref .= '
'; } else { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 3dd7d67946b..ea30a7c7996 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2592,7 +2592,6 @@ class Ticket extends CommonObject $message .= "\n".$langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal').' : '.''.$object->track_id.''."\n"; // Add global email address recipient - // altairis: use new TICKET_NOTIFICATION_EMAIL_TO configuration variable if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS && !in_array($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto)) { if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO)) $sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO; }