From c850f4c91823ffe35a9ef15645a69438637a2c80 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Dec 2020 16:01:06 +0100 Subject: [PATCH] Fix fatal error --- htdocs/admin/emailcollector_card.php | 6 ++++-- htdocs/langs/en_US/errors.lang | 2 ++ htdocs/langs/en_US/ticket.lang | 1 - htdocs/public/recruitment/index.php | 3 ++- htdocs/public/recruitment/view.php | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 9e8b957d541..adfaaf4f816 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -412,13 +412,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtml .= $form->textwithpicto('', 'connect string '.$connectstringserver); } else { - $morehtml .= 'IMAP functions not available on your PHP'; + $morehtml .= 'IMAP functions not available on your PHP. '; } if (!$connection) { $morehtml .= 'Failed to open IMAP connection '.$connectstringsource; - $morehtml .= '
'.imap_last_error(); + if (function_exists('imap_last_error')) { + $morehtml .= '
'.imap_last_error(); + } //var_dump(imap_errors()) } else { $morehtml .= imap_num_msg($connection); diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 056c9240bd0..501a3005860 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -251,6 +251,8 @@ ErrorLoginDateValidity=Error, this login is outside the validity date range ErrorValueLength=Length of field '%s' must be higher than '%s' ErrorReservedKeyword=The word '%s' is a reserved keyword ErrorNotAvailableWithThisDistribution=Not available with this distribution +ErrorPublicInterfaceNotEnabled=Public interface was not enabled + # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index cf370fbdca0..68a8f708741 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -231,7 +231,6 @@ TicketLogStatusChanged=Status changed: %s to %s TicketNotNotifyTiersAtCreate=Not notify company at create Unread=Unread TicketNotCreatedFromPublicInterface=Not available. Ticket was not created from public interface. -PublicInterfaceNotEnabled=Public interface was not enabled ErrorTicketRefRequired=Ticket reference name is required # diff --git a/htdocs/public/recruitment/index.php b/htdocs/public/recruitment/index.php index 504ecadfc71..204d3bf3140 100644 --- a/htdocs/public/recruitment/index.php +++ b/htdocs/public/recruitment/index.php @@ -71,7 +71,8 @@ $user_assign = new User($db); $user_create = new User($db); if (!$conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE) { - print '
'.$langs->trans('PublicInterfaceForbidden').'
'; + $langs->load("errors"); + print '
'.$langs->trans('ErrorPublicInterfaceNotEnabled').'
'; $db->close(); exit(); } diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index d8b2a4280cf..b8858b921e9 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -156,7 +156,8 @@ $conf->dol_hide_topmenu = 1; $conf->dol_hide_leftmenu = 1; if (!$conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE) { - print '
'.$langs->trans('PublicInterfaceForbidden').'
'; + $langs->load("errors"); + print '
'.$langs->trans('ErrorPublicInterfaceNotEnabled').'
'; $db->close(); exit(); }