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

Conflicts:
	htdocs/cron/class/cronjob.class.php
This commit is contained in:
Laurent Destailleur 2017-07-31 02:39:42 +02:00
commit 7a69df08c5
2 changed files with 15 additions and 14 deletions

View File

@ -2553,7 +2553,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if ($pictoisfullpath) if ($pictoisfullpath)
{ {
// Clean parameters // Clean parameters
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png'; if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) $picto .= '.png';
$fullpathpicto = $picto; $fullpathpicto = $picto;
} }
else else
@ -2575,7 +2575,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
} }
// Clean parameters // Clean parameters
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png'; if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) $picto .= '.png';
// If alt path are defined, define url where img file is, according to physical path // If alt path are defined, define url where img file is, according to physical path
foreach ($conf->file->dol_document_root as $type => $dirroot) // ex: array(["main"]=>"/home/maindir/htdocs", ["alt0"]=>"/home/moddir0/htdocs", ...) foreach ($conf->file->dol_document_root as $type => $dirroot) // ex: array(["main"]=>"/home/maindir/htdocs", ["alt0"]=>"/home/moddir0/htdocs", ...)
{ {

View File

@ -973,6 +973,7 @@ class Cronjob extends CommonObject
$object = new $this->objectname($this->db); $object = new $this->objectname($this->db);
$params_arr = array_map('trim', explode(",",$this->params)); $params_arr = array_map('trim', explode(",",$this->params));
if (!is_array($params_arr)) if (!is_array($params_arr))
{ {
$result = call_user_func(array($object, $this->methodename), $this->params); $result = call_user_func(array($object, $this->methodename), $this->params);
@ -982,7 +983,7 @@ class Cronjob extends CommonObject
$result = call_user_func_array(array($object, $this->methodename), $params_arr); $result = call_user_func_array(array($object, $this->methodename), $params_arr);
} }
if ($result===false || $result != 0) if ($result === false || (! is_bool($result) && $result != 0))
{ {
$langs->load("errors"); $langs->load("errors");
dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$object->error, LOG_ERR); dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$object->error, LOG_ERR);
@ -1031,7 +1032,7 @@ class Cronjob extends CommonObject
$result = call_user_func_array($this->methodename, $params_arr); $result = call_user_func_array($this->methodename, $params_arr);
} }
if ($result === false || $result != 0) if ($result === false || (! is_bool($result) && $result != 0))
{ {
$langs->load("errors"); $langs->load("errors");
dol_syslog(get_class($this)."::run_jobs result=".$result, LOG_ERR); dol_syslog(get_class($this)."::run_jobs result=".$result, LOG_ERR);