From 9ff0efbcc2c04da094507ed8cdcb662fec0686aa Mon Sep 17 00:00:00 2001 From: kevin Date: Tue, 15 Jun 2021 12:04:24 +0200 Subject: [PATCH 1/5] FIX fatal error when adding message to a ticket --- htdocs/ticket/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 5ed28094e39..85e88ce012c 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1317,7 +1317,7 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action = // Substitution array $morehtmlright = ''; $help = ""; - $substitutionarray = getCommonSubstitutionArray($newlang, 0, $arrayoffamiliestoexclude, $object); + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); if ($object->fk_soc > 0) { $substitutionarray['__THIRDPARTY_NAME__'] = $object->thirdparty->name; } From 78f41bf60e4ae95a9b3978cfc5d2a60e2b97a5ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 15 Jun 2021 22:04:31 +0200 Subject: [PATCH 2/5] Update card.php --- htdocs/ticket/card.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 85e88ce012c..8a571ace839 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1305,10 +1305,14 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action = $newlang = ''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); - } - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($object->thirdparty)) { + } elseif ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($object->thirdparty)) { $newlang = $object->thirdparty->default_lang; } + if (!empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $arrayoffamiliestoexclude = array('objectamount'); $action = 'add_message'; // action to use to post the message From 5ddf12b29c0eab546d9f53972a977feebce08558 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 15 Jun 2021 22:06:26 +0200 Subject: [PATCH 3/5] Fix set language --- htdocs/core/actions_massactions.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 3cbcd30af7f..60b386ce083 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -956,8 +956,11 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto // Define output language (Here it is not used because we do only merging existing PDF) $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $objecttmp->thirdparty->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + $newlang = GETPOST('lang_id', 'aZ09'); + } elseif ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($objecttmp->thirdparty)) { + $newlang = $objecttmp->thirdparty->default_lang; + } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); From 26cae49fafb59deb74d4938c63acaadb8ebc00ec Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 15 Jun 2021 20:06:48 +0000 Subject: [PATCH 4/5] Fixing style errors. --- htdocs/ticket/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 8a571ace839..687aca67378 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1312,7 +1312,7 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action = $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } - + $arrayoffamiliestoexclude = array('objectamount'); $action = 'add_message'; // action to use to post the message From 2a3b330e1ef03a0f6989df30be4dfe1683565f38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 15 Jun 2021 22:10:59 +0200 Subject: [PATCH 5/5] Fix newToken() --- htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php | 2 +- htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php | 2 +- htdocs/core/tpl/admin_extrafields_add.tpl.php | 2 +- htdocs/core/tpl/contacts.tpl.php | 4 ++-- htdocs/core/tpl/passwordforgotten.tpl.php | 2 +- htdocs/product/canvas/product/tpl/card_create.tpl.php | 2 +- htdocs/product/canvas/product/tpl/card_edit.tpl.php | 2 +- htdocs/product/canvas/service/tpl/card_create.tpl.php | 2 +- htdocs/product/canvas/service/tpl/card_edit.tpl.php | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php index 98a66e499b9..14186afbff1 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php @@ -40,7 +40,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
"> - + control->tpl['company_id']) { ?> diff --git a/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php index 2c82a868ed4..a9cd393866b 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php @@ -40,7 +40,7 @@ echo $this->control->tpl['ajax_selectcountry'];
"> - + diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 2a9438f4413..657e29dc8f1 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -141,7 +141,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con " method="post"> - + diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index a1abc3a9240..7ea32370fcd 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -96,7 +96,7 @@ if ($permission) { ?> " /> + @@ -121,7 +121,7 @@ if ($permission) ?> " /> + diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 937ee63a68c..ac2dba0c233 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -74,7 +74,7 @@ $(document).ready(function () {