Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/compta/bank/transfer.php
	htdocs/core/lib/functions.lib.php
This commit is contained in:
Laurent Destailleur 2017-11-06 21:37:19 +01:00
commit e7abc92f97
6 changed files with 33 additions and 8 deletions

View File

@ -280,6 +280,23 @@ Following changes may create regression for some external modules, but were nece
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
hook specifications so you must return output into "resprint". hook specifications so you must return output into "resprint".
***** ChangeLog for 5.0.7 compared to 5.0.6 *****
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
FIX: #7148
FIX: #7325 Default VAT rate when editing template invoices is 0%
FIX: #7366 renaming table with pgsql
FIX: #7391
FIX: #7510 Bug: extrafield content disappear when generate pdf within intervention
FIX: Agenda events are not exported in the ICAL, VCAL if begin exactly with the same $datestart
FIX: Bad link to unpayed suppliers invoices
FIX: bankentries search conciliated if val 0
FIX: multicompany better accuracy in rounding and with revenue stamp.
FIX: PDF output was sharing 2 different currencies in same total
FIX: Upgrade missing on field
FIX: wrong key in selectarray
FIX: wrong personnal project time spent
***** ChangeLog for 5.0.6 compared to 5.0.5 ***** ***** ChangeLog for 5.0.6 compared to 5.0.5 *****
FIX: Removed a bad symbolic link into custom directory. FIX: Removed a bad symbolic link into custom directory.
FIX: Renaming a resource ref rename also the directory of attached files. FIX: Renaming a resource ref rename also the directory of attached files.

View File

@ -82,9 +82,12 @@ if ($action == 'add')
$accountto=new Account($db); $accountto=new Account($db);
$accountto->fetch(GETPOST('account_to','int')); $accountto->fetch(GETPOST('account_to','int'));
if ($accountto->currency_code == $accountfrom->currency_code) { if ($accountto->currency_code == $accountfrom->currency_code)
{
$amountto=$amount; $amountto=$amount;
} else { }
else
{
if (! $amountto) if (! $amountto)
{ {
$error++; $error++;

View File

@ -56,7 +56,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
{ {
if ($object->id) if ($object->id)
{ {
$urlfile = GETPOST('urlfile', 'alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
if (GETPOST('section', 'alpha')) $file = $upload_dir . "/" . $urlfile; // For a delete of GED module urlfile contains full path from upload_dir if (GETPOST('section', 'alpha')) $file = $upload_dir . "/" . $urlfile; // For a delete of GED module urlfile contains full path from upload_dir
else // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile. else // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
{ {

View File

@ -1052,7 +1052,11 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
$file_name_osencoded=dol_osencode($file_name); $file_name_osencoded=dol_osencode($file_name);
// Check if destination dir is writable // Check if destination dir is writable
// TODO if (! is_writable(dirname($file_name_osencoded)))
{
dol_syslog("Files.lib::dol_move_uploaded_file Dir ".dirname($file_name_osencoded)." is not writable. Return 'ErrorDirNotWritable'", LOG_WARNING);
return 'ErrorDirNotWritable';
}
// Check if destination file already exists // Check if destination file already exists
if (! $allowoverwrite) if (! $allowoverwrite)

View File

@ -270,10 +270,11 @@ function GETPOSTISSET($paramname)
* 'custom'= custom filter specify $filter and $options) * 'custom'= custom filter specify $filter and $options)
* @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie) * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie)
* @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails) * @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails)
* @param mixed $options Options to pass to filter_var when $check is set to 'custom'. * @param mixed $options Options to pass to filter_var when $check is set to 'custom'
* @param string $noreplace Force disable of replacement of __xxx__ strings.
* @return string|string[] Value found (string or array), or '' if check fails * @return string|string[] Value found (string or array), or '' if check fails
*/ */
function GETPOST($paramname, $check='alpha', $method=0, $filter=NULL, $options=NULL) function GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
{ {
global $mysoc,$user,$conf; global $mysoc,$user,$conf;
@ -467,7 +468,7 @@ function GETPOST($paramname, $check='alpha', $method=0, $filter=NULL, $options=N
// Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable paramaters) // Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable paramaters)
// Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOUNTRYID__, __USERID__, __ENTITYID__, ... // Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOUNTRYID__, __USERID__, __ENTITYID__, ...
// We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text. // We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text.
if (! is_array($out) && empty($_POST[$paramname])) if (! is_array($out) && empty($_POST[$paramname]) && empty($noreplace))
{ {
$maxloop=20; $loopnb=0; // Protection against infinite loop $maxloop=20; $loopnb=0; // Protection against infinite loop
while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side. while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side.