Skip to content

Commit

Permalink
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
eldy committed Oct 30, 2018
2 parents 68f6ebd + 0f850cf commit 4a71374
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 22 deletions.
6 changes: 3 additions & 3 deletions htdocs/core/lib/functions.lib.php
Expand Up @@ -115,16 +115,16 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port)
* 'c_paiement', 'c_payment_term', ...
* @param int $shared 0=Return id of current entity only,
* 1=Return id of current entity + shared entities (default)
* @param int $forceentity Entity id
* @param object $currentobject Current object if needed
* @return mixed Entity id(s) to use
*/
function getEntity($element, $shared=1, $forceentity=null)
function getEntity($element, $shared=1, $currentobject=null)
{
global $conf, $mc;

if (is_object($mc))
{
return $mc->getEntity($element, $shared, $forceentity);
return $mc->getEntity($element, $shared, $currentobject);
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions htdocs/expensereport/class/expensereport.class.php
Expand Up @@ -4,6 +4,7 @@
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (c) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* 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
Expand Down Expand Up @@ -1512,7 +1513,7 @@ function getNextNumRef()
$classname = $conf->global->EXPENSEREPORT_ADDON;

// Include file with class
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir)
{
$dir = dol_buildpath($reldir."core/modules/expensereport/");
Expand All @@ -1521,9 +1522,8 @@ function getNextNumRef()
$mybool|=@include_once $dir.$file;
}

if (! $mybool)
{
dol_print_error('',"Failed to include file ".$file);
if ($mybool === false) {
dol_print_error('', "Failed to include file ".$file);
return '';
}

Expand Down
8 changes: 4 additions & 4 deletions htdocs/fichinter/class/fichinter.class.php
Expand Up @@ -6,6 +6,7 @@
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* 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
Expand Down Expand Up @@ -805,15 +806,14 @@ function getNextNumRef($soc)
$mybool|=@include_once $dir.$file;
}

if (! $mybool)
{
dol_print_error('',"Failed to include file ".$file);
if ($mybool === false) {
dol_print_error('', "Failed to include file ".$file);
return '';
}

$obj = new $classname();
$numref = "";
$numref = $obj->getNextValue($soc,$this);
$numref = $obj->getNextValue($soc, $this);

if ( $numref != "")
{
Expand Down
4 changes: 2 additions & 2 deletions htdocs/fourn/class/fournisseur.commande.class.php
Expand Up @@ -9,6 +9,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* 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
Expand Down Expand Up @@ -800,8 +801,7 @@ public function getNextNumRef($soc)
$mybool|=@include_once $dir.$file;
}

if (! $mybool)
{
if ($mybool === false) {
dol_print_error('',"Failed to include file ".$file);
return '';
}
Expand Down
6 changes: 3 additions & 3 deletions htdocs/fourn/class/fournisseur.facture.class.php
Expand Up @@ -12,6 +12,7 @@
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* 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
Expand Down Expand Up @@ -2280,9 +2281,8 @@ public function getNextNumRef($soc,$mode='next')
$mybool|=@include_once $dir.$file;
}

if (! $mybool)
{
dol_print_error('',"Failed to include file ".$file);
if ($mybool === false) {
dol_print_error('', "Failed to include file ".$file);
return '';
}

Expand Down
10 changes: 4 additions & 6 deletions htdocs/fourn/class/paiementfourn.class.php
Expand Up @@ -6,6 +6,7 @@
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.francenetlogic.fr>
*
* 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
Expand Down Expand Up @@ -654,14 +655,12 @@ function getNextNumRef($soc,$mode='next')
}

// For compatibility
if (! $mybool)
{
if ($mybool === false) {
$file = $conf->global->SUPPLIER_PAYMENT_ADDON.".php";
$classname = "mod_supplier_payment_".$conf->global->SUPPLIER_PAYMENT_ADDON;
$classname = preg_replace('/\-.*$/','',$classname);
// Include file with class
foreach ($conf->file->dol_document_root as $dirroot)
{
foreach ($conf->file->dol_document_root as $dirroot) {
$dir = $dirroot."/core/modules/supplier_payment/";

// Load file with numbering class (if found)
Expand All @@ -671,8 +670,7 @@ function getNextNumRef($soc,$mode='next')
}
}

if (! $mybool)
{
if ($mybool === false) {
dol_print_error('',"Failed to include file ".$file);
return '';
}
Expand Down

0 comments on commit 4a71374

Please sign in to comment.