From cb7266d26106d16a4dfd34a95f4cf0dc17e9f623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 13 Jan 2021 16:18:23 +0100 Subject: [PATCH 1/2] fix trans --- htdocs/admin/dav.php | 4 ++-- htdocs/core/class/commonobject.class.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index 8f005c0f0d7..4008a3cd7be 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -172,13 +172,13 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai // Show message $message = ''; $url = ''.$urlwithroot.'/dav/fileserver.php'; -$message .= img_picto('', 'globe').' '.$langs->trans("WebDavServer", 'WebDAV', $url); +$message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV', '{url}')); $message .= '
'; if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) { $urlEntity = (!empty($conf->multicompany->enabled) ? '?entity='.$conf->entity : ''); $url = ''.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.''; - $message .= img_picto('', 'globe').' '.$langs->trans("WebDavServer", 'WebDAV public', $url); + $message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV public', '{url}')); $message .= '
'; } print $message; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d701da55d8f..bdca5f74d0a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3671,7 +3671,9 @@ abstract class CommonObject */ static public function getAllItemsLinkedByObjectID($fk_object_where, $field_select, $field_where, $table_element) { - if(empty($fk_object_where) || empty($field_where) || empty($table_element)) return -1; + if (empty($fk_object_where) || empty($field_where) || empty($table_element)) { + return -1; + } global $db; @@ -3686,7 +3688,6 @@ abstract class CommonObject } return $TRes; - } /** @@ -3698,7 +3699,7 @@ abstract class CommonObject */ static public function deleteAllItemsLinkedByObjectID($fk_object_where, $field_where, $table_element) { - if(empty($fk_object_where) || empty($field_where) || empty($table_element)) return -1; + if (empty($fk_object_where) || empty($field_where) || empty($table_element)) return -1; global $db; @@ -3708,7 +3709,6 @@ abstract class CommonObject if (empty($resql)) return 0; return 1; - } /** From 40a45efb63d9a5294a5da9da46beca6fa632b9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 13 Jan 2021 16:23:54 +0100 Subject: [PATCH 2/2] fix code --- htdocs/core/class/commonobject.class.php | 8 ++++++-- htdocs/core/class/html.formmail.class.php | 12 +++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bdca5f74d0a..2d0dc6b4090 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3699,14 +3699,18 @@ abstract class CommonObject */ static public function deleteAllItemsLinkedByObjectID($fk_object_where, $field_where, $table_element) { - if (empty($fk_object_where) || empty($field_where) || empty($table_element)) return -1; + if (empty($fk_object_where) || empty($field_where) || empty($table_element)) { + return -1; + } global $db; $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$table_element.' WHERE '.$field_where.' = '.$fk_object_where; $resql = $db->query($sql); - if (empty($resql)) return 0; + if (empty($resql)) { + return 0; + } return 1; } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 1b29af772a7..d3147eafa6f 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1509,9 +1509,15 @@ class FormMail extends Form //,'__PERSONALIZED__' => 'Personalized' // Hidden because not used yet in mass emailing $onlinepaymentenabled = 0; - if (!empty($conf->paypal->enabled)) $onlinepaymentenabled++; - if (!empty($conf->paybox->enabled)) $onlinepaymentenabled++; - if (!empty($conf->stripe->enabled)) $onlinepaymentenabled++; + if (!empty($conf->paypal->enabled)) { + $onlinepaymentenabled++; + } + if (!empty($conf->paybox->enabled)) { + $onlinepaymentenabled++; + } + if (!empty($conf->stripe->enabled)) { + $onlinepaymentenabled++; + } if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) { $tmparray['__SECUREKEYPAYMENT__'] = $conf->global->PAYMENT_SECURITY_TOKEN; if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {