From 5082b1cc66a734adf615f1e6e6ea96a21e94ce3f Mon Sep 17 00:00:00 2001 From: Nikos Drosis Date: Tue, 17 Nov 2015 20:22:27 +0200 Subject: [PATCH 1/4] Fix for utf-8 characters in the mask mercure --- htdocs/core/lib/functions2.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 9c77729ac5a..2b31296ad7a 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -814,7 +814,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m //print "masktri=".$masktri." maskcounter=".$maskcounter." maskraz=".$maskraz." maskoffset=".$maskoffset."
\n"; // Define $sqlstring - $posnumstart=strrpos($maskwithnocode,$maskcounter); // Pos of counter in final string (from 0 to ...) + $posnumstart=mb_strrpos($maskwithnocode,$maskcounter, 'UTF-8'); // Pos of counter in final string (from 0 to ...) if ($posnumstart < 0) return 'ErrorBadMaskFailedToLocatePosOfSequence'; $sqlstring='SUBSTRING('.$field.', '.($posnumstart+1).', '.dol_strlen($maskcounter).')'; From ee4eb13fff588e74d8507816065e281144a8b974 Mon Sep 17 00:00:00 2001 From: Drosis Nikos Date: Fri, 20 Nov 2015 19:05:00 +0200 Subject: [PATCH 2/4] Update functions2.lib.php --- htdocs/core/lib/functions2.lib.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 2b31296ad7a..0cc43080c6c 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -814,7 +814,14 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m //print "masktri=".$masktri." maskcounter=".$maskcounter." maskraz=".$maskraz." maskoffset=".$maskoffset."
\n"; // Define $sqlstring - $posnumstart=mb_strrpos($maskwithnocode,$maskcounter, 'UTF-8'); // Pos of counter in final string (from 0 to ...) + if (function_exists('mb_strrpos')) + { + $posnumstart=mb_strrpos($maskwithnocode,$maskcounter, 'UTF-8'); + } + else + { + $posnumstart=strrpos($maskwithnocode,$maskcounter); + } // Pos of counter in final string (from 0 to ...) if ($posnumstart < 0) return 'ErrorBadMaskFailedToLocatePosOfSequence'; $sqlstring='SUBSTRING('.$field.', '.($posnumstart+1).', '.dol_strlen($maskcounter).')'; From 5dba9ef54e62e03008a2181a7337ee7c1cd5e5f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 20 Nov 2015 22:00:11 +0100 Subject: [PATCH 3/4] FIX #4043 Incorrect translation in error mesage in menu creation admin page --- htdocs/admin/menus/edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 4ab41c7991e..3fe94c1d8c5 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -147,7 +147,7 @@ if ($action == 'add') } if (! $error && ! $_POST['url']) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Url")), 'errors'); + setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("URL")), 'errors'); $action = 'create'; $error++; } From 2dedea8736833468b12a1c272ec5ab113f7c3477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 20 Nov 2015 22:03:44 +0100 Subject: [PATCH 4/4] FIX #4016 User link is not correctly formed in emailing receivers --- htdocs/comm/mailing/cibles.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 99c73dc4837..b73f8a0743b 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -485,13 +485,14 @@ if ($object->fetch($id) >= 0) { include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $m=new Adherent($db); - $m->id=$obj->source_id; + $m->fetch($obj->source_id); print $m->getNomUrl(2); } else if ($obj->source_type == 'user') { include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $m=new User($db); + $m->fetch($obj->source_id); $m->id=$obj->source_id; print $m->getNomUrl(2); } @@ -499,7 +500,7 @@ if ($object->fetch($id) >= 0) { include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $m=new Societe($db); - $m->id=$obj->source_id; + $m->fetch($obj->source_id); print $m->getNomUrl(2); } else