From fc9ec58ac96ea2126d789b5c16364a2654692308 Mon Sep 17 00:00:00 2001 From: Maximilien Rozniecki Date: Fri, 10 Mar 2023 17:11:27 +0100 Subject: [PATCH 1/3] added the possibility to show the mail information inside the event page in case the option is set --- htdocs/admin/agenda_other.php | 9 +++++++++ htdocs/comm/action/card.php | 14 ++++++++++++++ htdocs/langs/en_US/admin.lang | 1 + 3 files changed, 24 insertions(+) diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 18797312ad8..5ff544a1f6c 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -87,6 +87,7 @@ if ($action == 'set') { dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', $defaultfilter, 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "COMM_ACTION_MAIL_DESCRIPTION", GETPOST("COMM_ACTION_MAIL_DESCRIPTION", 'int'), 'chaine', 0, '', $conf->entity); $defaultValues = new DefaultValues($db); $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete', 't.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity)); @@ -398,6 +399,14 @@ print ''."\n"; $formactions->form_select_status_action('agenda', getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS'), 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2, 'minwidth100'); print ''."\n"; +//comm action show in description the mail information +print ''."\n"; +print ''.$langs->trans("COMM_ACTION_MAIL_DESCRIPTION").''."\n"; +print ' '."\n"; +print ''."\n"; +print $form->selectyesno('COMM_ACTION_MAIL_DESCRIPTION', getDolGlobalString('COMM_ACTION_MAIL_DESCRIPTION'), 1); +print ''; + print ''; print $form->buttonsSaveCancel("Save", ''); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index a36f944d6c5..b5a62c7480e 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -2403,6 +2403,20 @@ if ($id > 0) { print ''; } + //mail information + if (!empty($object->email_msgid) && $conf->global->COMM_ACTION_MAIL_DESCRIPTION) { + print ''.$langs->trans('MailTopic').''; + print ''.dol_escape_htmltag($object->email_subject).''; + print ''.$langs->trans('MailFrom').''; + print ''.dol_escape_htmltag($object->email_from).''; + print ''.$langs->trans('MailTo').''; + print ''.dol_escape_htmltag($object->email_to).''; + if (!empty($object->email_tocc)) { + print ''.$langs->trans('MailCC').''; + print ''.dol_escape_htmltag($object->email_tocc).''; + } + } + // Description print ''.$langs->trans("Description").''; print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 2ef2a996f3b..1a72704a2af 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -313,6 +313,7 @@ MAIN_DISABLE_ALL_SMS=Disable all SMS sending (for test purposes or demos) MAIN_SMS_SENDMODE=Method to use to send SMS MAIN_MAIL_SMS_FROM=Default sender phone number for SMS sending MAIN_MAIL_DEFAULT_FROMTYPE=Default sender email for manual sending (User email or Company email) +COMM_ACTION_MAIL_DESCRIPTION=Show the email information (sender, receivers, etc) in the event description (if defined) UserEmail=User email CompanyEmail=Company Email FeatureNotAvailableOnLinux=Feature not available on Unix like systems. Test your sendmail program locally. From 50971047abaea13c5959259ca14fbfc0a3f2fff9 Mon Sep 17 00:00:00 2001 From: Maximilien Rozniecki Date: Mon, 13 Mar 2023 15:53:37 +0100 Subject: [PATCH 2/3] removed the option to see the email information --- htdocs/admin/agenda_other.php | 9 --------- htdocs/comm/action/card.php | 2 +- htdocs/langs/en_US/admin.lang | 1 - 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 5ff544a1f6c..18797312ad8 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -87,7 +87,6 @@ if ($action == 'set') { dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', $defaultfilter, 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "COMM_ACTION_MAIL_DESCRIPTION", GETPOST("COMM_ACTION_MAIL_DESCRIPTION", 'int'), 'chaine', 0, '', $conf->entity); $defaultValues = new DefaultValues($db); $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete', 't.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity)); @@ -399,14 +398,6 @@ print ''."\n"; $formactions->form_select_status_action('agenda', getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS'), 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2, 'minwidth100'); print ''."\n"; -//comm action show in description the mail information -print ''."\n"; -print ''.$langs->trans("COMM_ACTION_MAIL_DESCRIPTION").''."\n"; -print ' '."\n"; -print ''."\n"; -print $form->selectyesno('COMM_ACTION_MAIL_DESCRIPTION', getDolGlobalString('COMM_ACTION_MAIL_DESCRIPTION'), 1); -print ''; - print ''; print $form->buttonsSaveCancel("Save", ''); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index b5a62c7480e..69cd535f82f 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -2404,7 +2404,7 @@ if ($id > 0) { } //mail information - if (!empty($object->email_msgid) && $conf->global->COMM_ACTION_MAIL_DESCRIPTION) { + if (!empty($object->email_msgid)) { print ''.$langs->trans('MailTopic').''; print ''.dol_escape_htmltag($object->email_subject).''; print ''.$langs->trans('MailFrom').''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1a72704a2af..2ef2a996f3b 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -313,7 +313,6 @@ MAIN_DISABLE_ALL_SMS=Disable all SMS sending (for test purposes or demos) MAIN_SMS_SENDMODE=Method to use to send SMS MAIN_MAIL_SMS_FROM=Default sender phone number for SMS sending MAIN_MAIL_DEFAULT_FROMTYPE=Default sender email for manual sending (User email or Company email) -COMM_ACTION_MAIL_DESCRIPTION=Show the email information (sender, receivers, etc) in the event description (if defined) UserEmail=User email CompanyEmail=Company Email FeatureNotAvailableOnLinux=Feature not available on Unix like systems. Test your sendmail program locally. From 5b8f9be246f8f4c9b4f9510c4380a75793ebc656 Mon Sep 17 00:00:00 2001 From: Maximilien Rozniecki Date: Mon, 13 Mar 2023 16:12:05 +0100 Subject: [PATCH 3/3] empty commit