diff --git a/ChangeLog b/ChangeLog index 9d084f3a98e..7f210c6fab1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -41,6 +41,31 @@ Dolibarr better: - Method commande->deleteline($lindeid) has been replaced with commande->deleteline($user, $lineid). + +***** ChangeLog for 4.0.2 compared to 4.0.1 ***** +FIX: #5340 +FIX: #5779 +FIX: #5849 +FIX: #5866 +FIX: #5907 +FIX: Addline if $txlocaltax1 is empty +FIX: Avoid error 500 if phpexcel is disabled +FIX: Avoid errors on debian +FIX: Can edit the customer ref even if order is not draft. +FIX: Documents not moved in new directory if we change reference of the task. +FIX: Error when CATEGORIE_RECURSIV_ADD is enabled and new category is child of an already linked to object +FIX: Extra fields of task not copied on project cloning +FIX: Hidden option PRODUCT_MAX_VISIBLE_PHOTO +FIX: Link on supplier invoice in widget was not clickable +FIX: margin tab on customer card must filter on current entity invoices +FIX: missing column into SQL on thirdparty list +FIX: Nber of attached files were not reported in event report of email sent +FIX: only show projects of related third if external user +FIX: Search provider by price +FIX: Solve backup when using mysqldump that return warning +FIX: Sql error in widget of product for stock alerts +FIX: updateligne if $txlocaltax1 is null + ***** ChangeLog for 4.0.1 compared to 4.0.0 ***** FIX: #2853 FIX: #2991 diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 41ae64834e4..fb3b39feca3 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -159,6 +159,7 @@ $REL1 = $newbuild; $REL1 =~ s/-.*$//gi; if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; } $FILENAMETGZ2="$PROJECT-$MAJOR.$MINOR.$REL1"; $FILENAMERPM=$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm"; +$FILENAMERPMSRC=$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm"; # For Deb $newbuild = $BUILD; $newbuild =~ s/(dev|alpha)/1/gi; # dev @@ -733,8 +734,8 @@ if ($nboftargetok) { print "Remove target ".$FILENAMERPM."...\n"; unlink("$NEWDESTI/".$FILENAMERPM); - print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n"; - unlink("$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm"); + print "Remove target ".$FILENAMERPMSRC."...\n"; + unlink("$NEWDESTI/".$FILENAMERPMSRC); print "Create directory $BUILDROOT/$FILENAMETGZ2\n"; $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`; @@ -1140,10 +1141,11 @@ if ($nboftargetok) { print "\nList of files to publish (BUILD=$BUILD)\n"; %filestoscansf=( - "$DESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml"=>'signatures', + "$DESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml"=>'none', # none means it won't be published on SF "$DESTI/package_rpm_generic/$FILENAMERPM"=>'Dolibarr installer for Fedora-Redhat-Mandriva-Opensuse (DoliRpm)', + "$DESTI/package_rpm_generic/$FILENAMERPMSRC"=>'none', # none means it won't be published on SF "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)', - "$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'none', + "$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'none', # none means it won't be published on SF "$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)', "$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM', "$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM' @@ -1151,6 +1153,7 @@ if ($nboftargetok) { %filestoscanstableasso=( "$DESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml"=>'signatures', "$DESTI/package_rpm_generic/$FILENAMERPM"=>'package_rpm_generic', + "$DESTI/package_rpm_generic/$FILENAMERPMSRC"=>'package_rpm_generic', "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu', "$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu', "$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows', @@ -1212,9 +1215,10 @@ if ($nboftargetok) { my $filesize = -s $file; if (! $filesize) { next; } - print "\n"; - - if ($target eq 'SF' && $filestoscan{$file} ne 'none') { + if ($target eq 'SF') { + if ($filestoscan{$file} eq 'none') { + next; + } $destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD; } elsif ($target eq 'ASSO' and $NEWPUBLISH =~ /stable/) { @@ -1231,6 +1235,8 @@ if ($nboftargetok) { $filenameonly =~ s/.*\/[^\/]+\/([^\/])+$/$1/; $destFolder="$NEWPUBLISH/$dirnameonly"; } + + print "\n"; print "Publish file ".$file." to ".$destFolder."\n"; # mkdir diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 4ad1441104d..e65e6bc3b7d 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -34,7 +34,7 @@ AutoReqProv: no %description -An easy to use CRM & ERP open source/free software for small +An easy to use CRM & ERP open source/free software package for small and medium companies, foundations or freelances. It includes different features for Enterprise Resource Planning (ERP) and Customer Relationship Management (CRM) but also for different other activities. diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index f20b2047225..655ef87f925 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -75,7 +75,7 @@ AutoReqProv: no %description -An easy to use CRM & ERP open source/free software for small +An easy to use CRM & ERP open source/free software package for small and medium companies, foundations or freelances. It includes different features for Enterprise Resource Planning (ERP) and Customer Relationship Management (CRM) but also for different other activities. diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index ca836bc47d6..55fb7183734 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -33,7 +33,7 @@ AutoReqProv: no %description -An easy to use CRM & ERP open source/free software for small +An easy to use CRM & ERP open source/free software package for small and medium companies, foundations or freelances. It includes different features for Enterprise Resource Planning (ERP) and Customer Relationship Management (CRM) but also for different other activities. diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index fcff3363213..f7e29927ebb 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -36,7 +36,7 @@ AutoReqProv: no %description -An easy to use CRM & ERP open source/free software for small +An easy to use CRM & ERP open source/free software package for small and medium companies, foundations or freelances. It includes different features for Enterprise Resource Planning (ERP) and Customer Relationship Management (CRM) but also for different other activities. diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 1b03c0a6d3e..bce8a063ecb 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1786,12 +1786,14 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') print ''; if (! empty($conf->accounting->enabled)) { - $accountancy_account = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0); + $fieldname = $fieldlist[$field]; + $accountancy_account = (! empty($obj->$fieldname) ? $obj->$fieldname : 0); print $formaccountancy->select_account($accountancy_account, $fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone'); } else { - print ''; + $fieldname = $fieldlist[$field]; + print ''; } print ''; } diff --git a/htdocs/admin/websites.php b/htdocs/admin/websites.php index ecc6b6a0166..b0c81ec18af 100644 --- a/htdocs/admin/websites.php +++ b/htdocs/admin/websites.php @@ -535,7 +535,8 @@ if ($id) { $showfield=1; $align="left"; - $valuetoshow=$obj->$fieldlist[$field]; + $fieldname=$fieldlist[$field]; + $valuetoshow=$obj->$fieldname; // Show value for field if ($showfield) print ''.$valuetoshow.''; @@ -613,14 +614,15 @@ function fieldListWebsites($fieldlist, $obj='', $tabname='', $context='') foreach ($fieldlist as $field => $value) { + $fieldname = $fieldlist[$field]; if ($fieldlist[$field] == 'lang') { print ''; print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,'lang'); print ''; } - elseif ($fieldlist[$field] == 'code' && isset($obj->$fieldlist[$field])) { - print ''; + elseif ($fieldlist[$field] == 'code' && isset($obj->$fieldname)) { + print ''; } else { @@ -631,7 +633,7 @@ function fieldListWebsites($fieldlist, $obj='', $tabname='', $context='') if ($fieldlist[$field]=='libelle') $size='size="32" '; if ($fieldlist[$field]=='tracking') $size='size="92" '; if ($fieldlist[$field]=='sortorder') $size='size="2" '; - print ''; + print ''; print ''; } } diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index ab82466d32d..e9883a78ec7 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -9,7 +9,6 @@ * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2015 Frederic France * Copyright (C) 2015 Marcos GarcĂ­a - * * 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 * the Free Software Foundation; either version 3 of the License, or @@ -89,7 +88,7 @@ $hookmanager->initHooks(array('commcard','globalcard')); * Actions */ -$parameters = array('socid' => $id); +$parameters = array('id' => $id, 'socid' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -440,7 +439,8 @@ if ($id > 0) { $langs->load("members"); $langs->load("users"); - print ''.$langs->trans("LinkedToDolibarrMember").''; + + print ''.$langs->trans("LinkedToDolibarrMember").''; print ''; $adh=new Adherent($db); $result=$adh->fetch('','',$object->id); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1c88cbc1e9a..d7414a46835 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -390,7 +390,21 @@ function dol_buildpath($path, $type=0) foreach ($conf->file->dol_document_root as $key => $dirroot) // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...) { - if ($key == 'main') continue; + if ($key == 'main') + { + if ($type == 3) + { + global $dolibarr_main_url_root; + + // Define $urlwithroot + $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 + + $res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':$urlwithroot).'/'.$path; // Test on start with http is for old conf syntax + } + continue; + } preg_match('/^([^\?]+(\.css\.php|\.css|\.js\.php|\.js|\.png|\.jpg|\.php)?)/i',$path,$regs); // Take part before '?' if (! empty($regs[1])) { @@ -414,7 +428,7 @@ function dol_buildpath($path, $type=0) $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 - $res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':$urlwithroot).$conf->file->dol_url_root[$key].'/'.$path; + $res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':$urlwithroot).$conf->file->dol_url_root[$key].'/'.$path; // Test on start with http is for old conf syntax } break; } diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index ee7288e2928..f967b53d9db 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -119,6 +119,32 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase } + + /** + * testDolBuildPath + * + * @return boolean + */ + public function testDolBuildPath() + { + /*$tmp=dol_buildpath('/google/oauth2callback.php', 0); + var_dump($tmp); + */ + + /*$tmp=dol_buildpath('/google/oauth2callback.php', 1); + var_dump($tmp); + */ + + $result=dol_buildpath('/google/oauth2callback.php', 2); + print __METHOD__." result=".$result."\n"; + $this->assertStringStartsWith('http', $result); + + $result=dol_buildpath('/google/oauth2callback.php', 3); + print __METHOD__." result=".$result."\n"; + $this->assertStringStartsWith('http', $result); + } + + /** * testGetBrowserInfo * @@ -1009,5 +1035,5 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase return true; } - + }