From cc0db78984843173339cd6cab4b338bea6e722d4 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech <52404047+nicolas-eoxia@users.noreply.github.com> Date: Thu, 21 Nov 2024 08:48:55 +0100 Subject: [PATCH 1/6] FIX #32007 missing parameter on function multiSelectArrayWithCheckbox (#32008) --- htdocs/projet/tasks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index d770f23f4f5ff..6f4a3aa4832bd 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -857,7 +857,7 @@ print ''; } elseif ($id > 0 || !empty($ref)) { - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields /* * Projet card in view mode From c907327e3c0e6bea8d1b81e389e0b0979404cba7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Nov 2024 09:08:54 +0100 Subject: [PATCH 2/6] Fix removed foreign key not on a unique key --- htdocs/install/mysql/migration/19.0.0-20.0.0.sql | 3 ++- htdocs/install/mysql/tables/llx_societe_commerciaux.key.sql | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql index b2397e2069cf0..ec3053a6a400c 100644 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql @@ -349,7 +349,8 @@ ALTER TABLE llx_societe_commerciaux ADD COLUMN fk_c_type_contact_code varchar(32 -- VPGSQL8.2 DROP INDEX uk_societe_commerciaux; ALTER TABLE llx_societe_commerciaux ADD UNIQUE INDEX uk_societe_commerciaux_c_type_contact (fk_soc, fk_user, fk_c_type_contact_code); ALTER TABLE llx_c_type_contact ADD INDEX idx_c_type_contact_code (code); -ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_c_type_contact_code FOREIGN KEY (fk_c_type_contact_code) REFERENCES llx_c_type_contact(code); +--Removed, not unique. ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_c_type_contact_code FOREIGN KEY (fk_c_type_contact_code) REFERENCES llx_c_type_contact(code); +ALTER TABLE llx_societe_commerciaux DROP FOREIGN KEY fk_societe_commerciaux_fk_c_type_contact_code; ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid); ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_user FOREIGN KEY (fk_user) REFERENCES llx_user(rowid); diff --git a/htdocs/install/mysql/tables/llx_societe_commerciaux.key.sql b/htdocs/install/mysql/tables/llx_societe_commerciaux.key.sql index 1672ff659c1f4..f4bc719c4ba32 100644 --- a/htdocs/install/mysql/tables/llx_societe_commerciaux.key.sql +++ b/htdocs/install/mysql/tables/llx_societe_commerciaux.key.sql @@ -17,6 +17,6 @@ -- =================================================================== ALTER TABLE llx_societe_commerciaux ADD UNIQUE INDEX uk_societe_commerciaux_c_type_contact (fk_soc, fk_user, fk_c_type_contact_code); -ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_c_type_contact_code FOREIGN KEY (fk_c_type_contact_code) REFERENCES llx_c_type_contact(code); +--Removed, not unique. ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_c_type_contact_code FOREIGN KEY (fk_c_type_contact_code) REFERENCES llx_c_type_contact(code); ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid); ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_user FOREIGN KEY (fk_user) REFERENCES llx_user(rowid); From bf3a08ffa51771a197248911e1ee406833c01a59 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Nov 2024 09:41:59 +0100 Subject: [PATCH 3/6] Tooltip --- htdocs/langs/en_US/ticket.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index bb0cd645857cc..f0f7a31831d36 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -75,7 +75,7 @@ TicketParamMail=Email setup TicketEmailNotificationFrom=Sender e-mail for notification on answers TicketEmailNotificationFromHelp=Sender e-mail to use to send the notification email when an answer is provided inside the back office. For example noreply@example.com TicketEmailNotificationTo=Notify ticket creation to this e-mail address -TicketEmailNotificationToHelp=If present, this e-mail address will be notified of a ticket creation +TicketEmailNotificationToHelp=If present, this e-mail address will be notified of a ticket creation (in addition to already assigned contacts) TicketNewEmailBodyLabel=Text message sent after creating a ticket TicketNewEmailBodyHelp=The text specified here will be inserted into the email confirming the creation of a new ticket from the public interface. Information on the consultation of the ticket are automatically added. TicketParamPublicInterface=Public interface setup From 4c95fa2ac6b8a96baa6091a955aa128db30aa788 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Nov 2024 10:10:32 +0100 Subject: [PATCH 4/6] Fix clean a bugged option duplicated at wrong place in setup --- htdocs/admin/ticket.php | 40 +++------------------------- htdocs/ticket/class/ticket.class.php | 8 +++--- 2 files changed, 7 insertions(+), 41 deletions(-) diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 76fd7f98064ab..b05d7e71f2345 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -89,17 +89,9 @@ } elseif (preg_match('/set_(.*)/', $action, $reg)) { $code = $reg[1]; $value = GETPOSTISSET($code) ? GETPOSTINT($code) : 1; - if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { - $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha'); - $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity); - if (!($res > 0)) { - $error++; - } - } else { - $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity); - if (!($res > 0)) { - $error++; - } + $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity); + if (!($res > 0)) { + $error++; } } elseif (preg_match('/del_(.*)/', $action, $reg)) { $code = $reg[1]; @@ -211,15 +203,6 @@ if (!($res > 0)) { $error++; } - - // For compatibility when javascript is not enabled - if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 && empty($conf->use_javascript_ajax)) { - $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha'); - $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity); - if (!($res > 0)) { - $error++; - } - } } @@ -659,23 +642,6 @@ print ''; print ''; -// Also send to TICKET_NOTIFICATION_EMAIL_TO for responses (not only creation) -if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { - print ''.$langs->trans("TicketsEmailAlsoSendToMainAddress").''; - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $formcategory->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS); - } - print ''; - print ''; - print $formcategory->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help'); - print ''; - print ''; -} - // Message header $mail_intro = getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO', ''); print ''.$langs->trans("TicketMessageMailIntro"); diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 219feb82a0f76..77671f6161438 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2779,10 +2779,10 @@ public function newMessage($user, &$action, $private = 1, $public_area = 0) } // Add global email address recipient - if (getDolGlobalString('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS') && - getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') && !array_key_exists(getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'), $sendto) - ) { - $sendto[getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')] = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'); + if (getDolGlobalString('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS') && !array_key_exists(getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'), $sendto)) { + if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')) { + $sendto[getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')] = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'); + } } if (!empty($sendto)) { From 9a5aea09da2732df10a241260d4b44c280c39bfd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Nov 2024 12:33:23 +0100 Subject: [PATCH 5/6] FIX Debug option not working replaced by the one that works. --- htdocs/admin/ticket.php | 31 +++++++++- htdocs/admin/ticket_public.php | 56 ++++++------------- ...terface_50_modTicket_TicketEmail.class.php | 18 ++++-- htdocs/langs/en_US/ticket.lang | 12 ++-- htdocs/ticket/class/ticket.class.php | 2 +- 5 files changed, 64 insertions(+), 55 deletions(-) diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index b05d7e71f2345..192a8ad9c9892 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -59,6 +59,15 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; +if (GETPOSTISSET('TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION')) { // only for no js case + $param_disable_email = GETPOST('TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION', 'alpha'); + $res = dolibarr_set_const($db, 'TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION', $param_disable_email, 'chaine', 0, '', $conf->entity); + if (!($res > 0)) { + $error++; + setEventMessages($db->lasterror(), null, 'errors'); + } +} + if ($action == 'updateMask') { $maskconstticket = GETPOST('maskconstticket', 'aZ09'); $maskticket = GETPOST('maskticket', 'alpha'); @@ -595,13 +604,14 @@ print ''; +print '
'; /* - * Notification + * Emails */ // Admin var of module -print load_fiche_titre($langs->trans("Notification"), '', ''); +print load_fiche_titre($langs->trans("Emails"), '', ''); print ''; @@ -636,12 +646,27 @@ // Email for notification of TICKET_CREATE print ''; print ''; +print ''; print ''; print ''; +// Disable email to customers +print ''; +print ''; +print ''; +print ''; + // Message header $mail_intro = getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO', ''); print ''; print ''; - // Also send to main email address - if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { - print ''; - print ''; - print ''; - print ''; - } - if (empty($conf->use_javascript_ajax)) { print ''; print ''; @@ -493,20 +467,6 @@ print '
'; print '
'.$langs->trans("TicketEmailNotificationTo").''; -print ''; print $formcategory->textwithpicto('', $langs->trans("TicketEmailNotificationToHelp"), 1, 'help'); print '
'; +print $form->textwithpicto($langs->trans("TicketsNotifyThirdPartyFromBackOfficeByDefault"), $langs->trans("TicketsNotifyThirdPartyFromBackOfficeByDefaultHelp"), 1, 'help'); +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION", $arrval, getDolGlobalInt('TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION')); +} +print '
'.$langs->trans("TicketMessageMailIntro"); diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index abda918f20200..91ae4bf549184 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -72,15 +72,6 @@ } } - if (GETPOSTISSET('TICKET_DISABLE_CUSTOMER_MAILS')) { // only for no js case - $param_disable_email = GETPOST('TICKET_DISABLE_CUSTOMER_MAILS', 'alpha'); - $res = dolibarr_set_const($db, 'TICKET_DISABLE_CUSTOMER_MAILS', $param_disable_email, 'chaine', 0, '', $conf->entity); - if (!($res > 0)) { - $error++; - $errors[] = $db->lasterror(); - } - } - if (GETPOSTISSET('TICKET_SHOW_COMPANY_LOGO')) { // only for no js case $param_show_module_logo = GETPOST('TICKET_SHOW_COMPANY_LOGO', 'alpha'); $res = dolibarr_set_const($db, 'TICKET_SHOW_COMPANY_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity); @@ -412,23 +403,6 @@ print '
'.$langs->trans("TicketsEmailAlsoSendToMainAddress").''; - if (!empty($conf->use_javascript_ajax)) { - print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, getDolGlobalInt('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS')); - } - print ''; - print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp", $langs->transnoentitiesnoconv("TicketEmailNotificationTo").' ('.$langs->transnoentitiesnoconv("Creation").')', $langs->trans("Settings")), 1, 'help'); - print '
'; - // Activate email creation to user - print ''; - print ''; - print ''; - // Text of email after creatio of a ticket $mail_mesg_new = getDolGlobalString("TICKET_MESSAGE_MAIL_NEW", $langs->trans('TicketNewEmailBody')); print ''; print ''; + // Also send to main email address + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { + print ''; + print ''; + print ''; + } + print '
'; - print $form->textwithpicto($langs->trans("TicketsDisableCustomerEmail"), $langs->trans("TicketsDisableEmailHelp"), 1, 'help'); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('TICKET_DISABLE_CUSTOMER_MAILS'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKET_DISABLE_CUSTOMER_MAILS", $arrval, getDolGlobalInt('TICKET_DISABLE_CUSTOMER_MAILS')); - } - print '
'; @@ -541,6 +501,22 @@ print '
'.$langs->trans("TicketsEmailAlsoSendToMainAddress"); + print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp", $langs->transnoentitiesnoconv("TicketEmailNotificationTo").' ('.$langs->transnoentitiesnoconv("Creation").')', $langs->trans("Settings")), 1, 'help'); + print ''; + if (!empty($conf->use_javascript_ajax)) { + print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, getDolGlobalInt('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS')); + } + print '
'; print ''; diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index faa556da23576..ed97f3b7b408e 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -183,15 +183,19 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf $see_ticket_customer = 'TicketNewEmailBodyInfosTrackUrlCustomer'; // Send email to notification email + // Note: $object->context['disableticketemail'] is set to 1 by public interface at creation because email sending is already managed by page + // $object->context['createdfrompublicinterface'] may also be defined when creation done from public interface if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') && empty($object->context['disableticketemail'])) { - $sendto = !getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') ? '' : $conf->global->TICKET_NOTIFICATION_EMAIL_TO; + $sendto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'); if ($sendto) { $this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs); } } // Send email to customer - if (!getDolGlobalInt('TICKET_DISABLE_CUSTOMER_MAILS') && empty($object->context['disableticketemail']) && $object->notify_tiers_at_create) { + // Note: $object->context['disableticketemail'] is set to 1 by public interface at creation because email sending is already managed by page + // $object->context['createdfrompublicinterface'] may also be defined when creation done from public interface + if (empty($object->context['disableticketemail']) && $object->notify_tiers_at_create) { $sendto = ''; // if contact selected send to email's contact else send to email's thirdparty @@ -238,15 +242,17 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf $see_ticket_customer = 'TicketCloseEmailBodyInfosTrackUrlCustomer'; // Send email to notification email + // Note: $object->context['disableticketemail'] is set to 1 by public interface at creation but not at closing if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') && empty($object->context['disableticketemail'])) { - $sendto = !getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') ? '' : $conf->global->TICKET_NOTIFICATION_EMAIL_TO; + $sendto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'); if ($sendto) { $this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs); } } // Send email to customer. - if (!getDolGlobalString('TICKET_DISABLE_CUSTOMER_MAILS') && empty($object->context['disableticketemail'])) { + // Note: $object->context['disableticketemail'] is set to 1 by public interface at creation but not at closing + if (empty($object->context['disableticketemail'])) { $linked_contacts = $object->listeContact(-1, 'thirdparty'); $linked_contacts = array_merge($linked_contacts, $object->listeContact(-1, 'internal')); if (empty($linked_contacts) && getDolGlobalString('TICKET_NOTIFY_AT_CLOSING') && !empty($object->fk_soc)) { @@ -346,7 +352,7 @@ private function composeAndSendAdminMessage($sendto, $base_subject, $body, Ticke $message_admin .= '

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

'.$message.'


'; $message_admin .= '

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

'; - $from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . '<' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>'; + $from = (getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' ' : '') . '<' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>'; $trackid = 'tic'.$object->id; @@ -434,7 +440,7 @@ private function composeAndSendCustomerMessage($sendto, $base_subject, $body, $s $message_customer .= '

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

'; $message_customer .= '

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

'; - $from = (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? '' : getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' ').'<' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>'; + $from = (getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' ' : '').'<' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>'; $trackid = 'tic'.$object->id; diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index f0f7a31831d36..4e3788f05120f 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -72,10 +72,10 @@ TicketPublicAccess=A public interface requiring no identification is available a TicketSetupDictionaries=The type of ticket, severity and analytic codes are configurable from dictionaries TicketParamModule=Module variable setup TicketParamMail=Email setup -TicketEmailNotificationFrom=Sender e-mail for notification on answers -TicketEmailNotificationFromHelp=Sender e-mail to use to send the notification email when an answer is provided inside the back office. For example noreply@example.com +TicketEmailNotificationFrom=Sender e-mail for notification on tickets +TicketEmailNotificationFromHelp=Sender e-mail to use to send the notification emails for tickets creation or messages. For example noreply@example.com TicketEmailNotificationTo=Notify ticket creation to this e-mail address -TicketEmailNotificationToHelp=If present, this e-mail address will be notified of a ticket creation (in addition to already assigned contacts) +TicketEmailNotificationToHelp=If present, this e-mail address will be notified of a ticket creation (in addition to any other default recipients) TicketNewEmailBodyLabel=Text message sent after creating a ticket TicketNewEmailBodyHelp=The text specified here will be inserted into the email confirming the creation of a new ticket from the public interface. Information on the consultation of the ticket are automatically added. TicketParamPublicInterface=Public interface setup @@ -96,7 +96,9 @@ TicketPublicInterfaceTextHelpMessageHelpAdmin=This text will appear above the me ExtraFieldsTicket=Extra attributes TicketCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL content to 1 to get it. TicketsDisableEmail=Do not send emails for ticket creation or message recording -TicketsDisableEmailHelp=By default, emails are sent when new tickets or messages created. Enable this option to disable *all* email notifications +TicketsDisableEmailHelp=By default, notification emails to third parties are sent when new tickets or messages are created for both backoffice and public interface. Enable this option to disable email notifications to thirdparties when creation is done from backoffice. +TicketsNotifyThirdPartyFromBackOfficeByDefault=Notify third party by default on ticket creation from backoffice +TicketsNotifyThirdPartyFromBackOfficeByDefaultHelp=When creating a ticket from the backoffice, the option "Notify third party" will be checked by default TicketsLogEnableEmail=Enable log by email TicketsLogEnableEmailHelp=At each change, an email will be sent **to each contact** associated with the ticket. TicketParams=Params @@ -117,7 +119,7 @@ TicketsAutoAssignTicketHelp=When creating a ticket, the user can be automaticall TicketNumberingModules=Tickets numbering module TicketsModelModule=Document templates for tickets TicketNotifyTiersAtCreation=Notify third party at creation -TicketsDisableCustomerEmail=Always disable emails when a ticket is created from public interface +TicketsDisableCustomerEmail=Always disable emails to third parties when a ticket is created from the backoffice TicketsPublicNotificationNewMessage=Send email(s) when a new message/comment is added to a ticket TicketsPublicNotificationNewMessageHelp=Send email(s) when a new message is added from public interface (to assigned user or the notifications email to (update) and/or the notifications email to) TicketPublicNotificationNewMessageDefaultEmail=Notifications email to (update) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 77671f6161438..24629554b3227 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -223,7 +223,7 @@ class Ticket extends CommonObject public $cache_msgs_ticket; /** - * @var int Notify thirdparty at create + * @var int Save if a thirdparty was notified at creation at ticket or not */ public $notify_tiers_at_create; From 283265448a1692a548ccba666e9516c3a8fb2b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Nov 2024 17:12:16 +0100 Subject: [PATCH 6/6] fix CI phpstan (#32032) * fix CI phpstan * Update interface_50_modTicket_TicketEmail.class.php * Update interface_50_modTicket_TicketEmail.class.php --- htdocs/core/lib/bank.lib.php | 2 +- .../interface_50_modTicket_TicketEmail.class.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 7091f6aa0e5e4..5815d177767be 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -54,7 +54,7 @@ function bank_prepare_head(Account $object) $h++; if ($object->canBeConciliated() > 0) { - $allowautomaticconciliation = false; // TODO + $allowautomaticconciliation = getDolGlobalBool('MAIN_ALLOW_AUTOMATIC_CONCILIATION'); // TODO $titletoconciliatemanual = $langs->trans("Conciliate"); $titletoconciliateauto = $langs->trans("Conciliate"); if ($allowautomaticconciliation) { diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 27b544205b1ac..9661cdb6416a8 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -164,9 +164,9 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // $object->context['createdfrompublicinterface'] may also be defined when creation done from public interface if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') && empty($object->context['disableticketemail'])) { $sendto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'); - if ($sendto) { - $this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs); - } + // if ($sendto) { // already test, can't be empty + $this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs); + // } } // Send email to assignee if an assignee was set at creation @@ -251,9 +251,9 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // Note: $object->context['disableticketemail'] is set to 1 by public interface at creation but not at closing if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') && empty($object->context['disableticketemail'])) { $sendto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'); - if ($sendto) { - $this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs); - } + // if ($sendto) { // already test, can't be empty + $this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs); + // } } // Send email to customer.