From 5c9c7619112e905292cd0a3512ec8264555fe632 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 9 Feb 2017 05:58:39 +0100 Subject: [PATCH 1/4] Fix : Bank account label not shown in dol_banner_tab --- htdocs/core/lib/functions.lib.php | 45 ++++++++++++++++--------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index acd74643a38..4d9f7c46e17 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1,18 +1,18 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2013 Laurent Destailleur - * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2004 Christophe Combelles - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2010-2016 Juanjo Menent - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2013 Alexandre Spangaro - * Copyright (C) 2014 Cédric GROSS - * Copyright (C) 2014-2015 Marcos García - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2000-2007 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2004 Christophe Combelles + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand (Resultic) + * Copyright (C) 2010-2016 Juanjo Menent + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2014 Cédric GROSS + * Copyright (C) 2014-2015 Marcos García + * Copyright (C) 2015 Jean-François Ferry * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -980,11 +980,11 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $showbarcode=empty($conf->barcode->enabled)?0:($object->barcode?1:0); if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0; $modulepart='unknown'; - if ($object->element == 'societe') $modulepart='societe'; - if ($object->element == 'contact') $modulepart='contact'; - if ($object->element == 'member') $modulepart='memberphoto'; - if ($object->element == 'user') $modulepart='userphoto'; - if ($object->element == 'product') $modulepart='product'; + if ($object->element == 'societe') $modulepart='societe'; + if ($object->element == 'contact') $modulepart='contact'; + if ($object->element == 'member') $modulepart='memberphoto'; + if ($object->element == 'user') $modulepart='userphoto'; + if ($object->element == 'product') $modulepart='product'; if ($object->element == 'product') { @@ -1003,7 +1003,6 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $nophoto='/public/theme/common/nophoto.png'; $morehtmlleft.='
No photo
'; } - } } else @@ -1088,7 +1087,11 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $morehtmlstatus.=$tmptxt; } if (! empty($object->name_alias)) $morehtmlref.='
'.$object->name_alias.'
'; // For thirdparty - if ($object->element == 'product' && ! empty($object->label)) $morehtmlref.='
'.$object->label.'
'; + + if ($object->element == 'product' || $object->element == 'bank_account') + { + if(! empty($object->label)) $morehtmlref.='
'.$object->label.'
'; + } if ($object->element != 'product' && $object->element != 'bookmark') { From 7e3785d44686037c5d4fd44da49312508677d7a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Feb 2017 15:40:25 +0100 Subject: [PATCH 2/4] FIX the dolCopyDir fails if target dir does not exists. --- htdocs/core/lib/files.lib.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index ed0e0725bed..33fa6e8b09f 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -436,13 +436,23 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists) $result=0; - dol_syslog("files.lib.php::dolCopyr srcfile=".$srcfile." destfile=".$destfile." newmask=".$newmask." overwriteifexists=".$overwriteifexists); + dol_syslog("files.lib.php::dolCopyDir srcfile=".$srcfile." destfile=".$destfile." newmask=".$newmask." overwriteifexists=".$overwriteifexists); if (empty($srcfile) || empty($destfile)) return -1; $destexists=dol_is_dir($destfile); if (! $overwriteifexists && $destexists) return 0; - + + if (! $destexists) + { + // We must set mask just before creating dir, becaause it can be set differently by dol_copy + umask(0); + $dirmaskdec=octdec($newmask); + if (empty($newmask) && ! empty($conf->global->MAIN_UMASK)) $dirmaskdec=octdec($conf->global->MAIN_UMASK); + $dirmaskdec |= octdec('0200'); // Set w bit required to be able to create content for recursive subdirs files + dol_mkdir($destfile."/".$file, '', decoct($dirmaskdec)); + } + $srcfile=dol_osencode($srcfile); $destfile=dol_osencode($destfile); @@ -459,6 +469,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists) { if (!is_dir($destfile."/".$file)) { + // We must set mask just before creating dir, becaause it can be set differently by dol_copy umask(0); $dirmaskdec=octdec($newmask); if (empty($newmask) && ! empty($conf->global->MAIN_UMASK)) $dirmaskdec=octdec($conf->global->MAIN_UMASK); From abffd29179cac5686aa8e45fc5acc2f28368a233 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Feb 2017 20:55:54 +0100 Subject: [PATCH 3/4] Try a fix for #6334, #6416 --- htdocs/user/class/user.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 188195b04bf..2616b816bb5 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1668,7 +1668,7 @@ class User extends CommonObject $subject = $outputlangs->transnoentitiesnoconv("SubjectNewPassword", $appli); // Define $urlwithroot - //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); + $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current From bf32acaadda0a8c0908387bb95f9c0df9c6a2109 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Feb 2017 01:13:41 +0100 Subject: [PATCH 4/4] Fix control of module format. --- htdocs/admin/tools/update.php | 12 +++++++++--- htdocs/langs/en_US/errors.lang | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index e306862b67a..b062f509388 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -69,12 +69,18 @@ if ($action=='install') } else { - if (! preg_match('/\.zip/i',$original_file)) + if (! preg_match('/\.zip$/i',$original_file)) { $langs->load("errors"); setEventMessages($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), null, 'errors'); $error++; } + if (! preg_match('/module_.*\-[\d]+\.[\d]+.*$/i',$original_file)) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFilenameDosNotMatchDolibarrPackageRules",$original_file, 'module_*-x.y*.zip'), null, 'errors'); + $error++; + } } if (! $error) @@ -117,7 +123,7 @@ if ($action=='install') //var_dump($modulenamedir); if (! dol_is_dir($modulenamedir)) { - setEventMessages($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), null, 'errors'); + setEventMessages($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat").'
Dir not found: '.$conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulename.'
'.$conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulename, null, 'errors'); $error++; } } @@ -168,7 +174,7 @@ print load_fiche_titre($langs->trans("Upgrade"),'','title_setup'); print $langs->trans("CurrentVersion").' : '.DOL_VERSION.'
'; -if (function_exists('curl_init')) +if (!function_exists('curl_init')) { $result = getURLContent('http://sourceforge.net/projects/dolibarr/rss'); //var_dump($result['content']); diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 0e0b3e40960..2596aef5ee8 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -177,6 +177,8 @@ ErrorStockIsNotEnoughToAddProductOnProposal=Stock is not enough for product %s t ErrorFailedToLoadLoginFileForMode=Failed to get the login key for mode '%s'. ErrorPhpMailDelivery=Check that you don't use a too high number of recipients and that your email content is not similar to a Spam. Ask also your administrator to check firewall and server logs files for a more complete information. ErrorUserNotAssignedToTask=User must be assigned to task to be able to enter time consumed. +ErrorModuleFileSeemsToHaveAWrongFormat=The module package seems to have a wrong format. +ErrorFilenameDosNotMatchDolibarrPackageRules=The name of the module package (%s) does not match expected name syntax: %s # Warnings 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.