Fix: Bugs reported by scrutinizer

This commit is contained in:
Laurent Destailleur 2014-11-15 15:19:37 +01:00
parent d0fb732cce
commit d98bfb1d8d
18 changed files with 84 additions and 79 deletions

View File

@ -26,7 +26,7 @@
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
// Class // Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
@ -44,7 +44,7 @@ $action = GETPOST('action', 'alpha');
// Other parameters ACCOUNTING_* // Other parameters ACCOUNTING_*
$list = array ( $list = array (
'ACCOUNTING_SEPARATORCSV' 'ACCOUNTING_SEPARATORCSV'
); );
/* /*
@ -52,26 +52,26 @@ $list = array (
*/ */
if ($action == 'update') { if ($action == 'update') {
$error = 0; $error = 0;
$modelcsv = GETPOST('modelcsv', 'int'); $modelcsv = GETPOST('modelcsv', 'int');
if (! empty($modelcsv)) { if (! empty($modelcsv)) {
if (! dolibarr_set_const($db, 'ACCOUNTING_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) { if (! dolibarr_set_const($db, 'ACCOUNTING_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
$error ++; $error ++;
} }
} else { } else {
$error ++; $error ++;
} }
foreach ( $list as $constname ) { foreach ( $list as $constname ) {
$constvalue = GETPOST($constname, 'alpha'); $constvalue = GETPOST($constname, 'alpha');
if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error ++; $error ++;
} }
} }
if (! $error) { if (! $error) {
setEventMessage($langs->trans("SetupSaved")); setEventMessage($langs->trans("SetupSaved"));
} else { } else {
@ -90,7 +90,7 @@ $form = new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'setup'); print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'setup');
$head = admin_accounting_prepare_head(null); $head = admin_accounting_prepare_head();
dol_fiche_head($head, 'export', $langs->trans("Configuration"), 0, 'cron'); dol_fiche_head($head, 'export', $langs->trans("Configuration"), 0, 'cron');
@ -142,13 +142,13 @@ if ($num) {
foreach ( $list as $key ) { foreach ( $list as $key ) {
$var = ! $var; $var = ! $var;
print '<tr ' . $bc[$var] . ' class="value">'; print '<tr ' . $bc[$var] . ' class="value">';
// Param // Param
$label = $langs->trans($key); $label = $langs->trans($key);
print '<td>' . $label . '</td>'; print '<td>' . $label . '</td>';
// Value // Value
print '<td>'; print '<td>';
print '<input type="text" size="20" name="' . $key . '" value="' . $conf->global->$key . '">'; print '<input type="text" size="20" name="' . $key . '" value="' . $conf->global->$key . '">';

View File

@ -103,7 +103,7 @@ class CActionComm
* @param string $idorcode 'id' or 'code' * @param string $idorcode 'id' or 'code'
* @param string $excludetype Type to exclude * @param string $excludetype Type to exclude
* @param string $onlyautoornot Group list by auto events or not * @param string $onlyautoornot Group list by auto events or not
* @return array Array of all event types if OK, <0 if KO * @return mixed Array of all event types if OK, <0 if KO
*/ */
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0) function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0)
{ {

View File

@ -755,6 +755,8 @@ class BonPrelevement extends CommonObject
$factures = array(); $factures = array();
$factures_prev = array(); $factures_prev = array();
$factures_result = array(); $factures_result = array();
$factures_prev_id=array();
$factures_errors=array();
if (! $error) if (! $error)
{ {

View File

@ -127,7 +127,7 @@ class PaymentSalary extends CommonObject
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('PAYMENT_SALARY_MODIFY',$user); $result=$this->call_trigger('PAYMENT_SALARY_MODIFY',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
//FIXME: Add rollback if trigger fail //FIXME: Add rollback if trigger fail
@ -223,12 +223,12 @@ class PaymentSalary extends CommonObject
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
// Call trigger // Call trigger
$result=$this->call_trigger('PAYMENT_SALARY_DELETE',$user); $result=$this->call_trigger('PAYMENT_SALARY_DELETE',$user);
if ($result < 0) return -1; if ($result < 0) return -1;
// End call triggers // End call triggers
$sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_salary"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_salary";
$sql.= " WHERE rowid=".$this->id; $sql.= " WHERE rowid=".$this->id;
@ -279,7 +279,7 @@ class PaymentSalary extends CommonObject
function create($user) function create($user)
{ {
global $conf,$langs; global $conf,$langs;
$error=0; $error=0;
// Clean parameters // Clean parameters
@ -414,7 +414,6 @@ class PaymentSalary extends CommonObject
$this->fk_user, $this->fk_user,
DOL_URL_ROOT.'/user/card.php?id=', DOL_URL_ROOT.'/user/card.php?id=',
$langs->trans("SalaryPayment").' '.$fuser->getFullName($langs).' '.dol_print_date($this->datesp,'dayrfc').' '.dol_print_date($this->dateep,'dayrfc'), $langs->trans("SalaryPayment").' '.$fuser->getFullName($langs).' '.dol_print_date($this->datesp,'dayrfc').' '.dol_print_date($this->dateep,'dayrfc'),
'(User)',
'user' 'user'
); );
@ -427,9 +426,9 @@ class PaymentSalary extends CommonObject
// Call trigger // Call trigger
$result=$this->call_trigger('PAYMENT_SALARY_CREATE',$user); $result=$this->call_trigger('PAYMENT_SALARY_CREATE',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
} }
else $error++; else $error++;

View File

@ -62,17 +62,19 @@ class ChargeSociales extends CommonObject
/** /**
* Retrouve et charge une charge sociale * Retrouve et charge une charge sociale
* *
* @param int $id 1 si trouve, 0 sinon * @param int $id Id
* @param string $ref Ref
* @return void * @return void
*/ */
function fetch($id) function fetch($id, $ref='')
{ {
$sql = "SELECT cs.rowid, cs.date_ech,"; $sql = "SELECT cs.rowid, cs.date_ech,";
$sql.= " cs.libelle as lib, cs.fk_type, cs.amount, cs.paye, cs.periode,"; $sql.= " cs.libelle as lib, cs.fk_type, cs.amount, cs.paye, cs.periode,";
$sql.= " c.libelle"; $sql.= " c.libelle";
$sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as cs, ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as cs, ".MAIN_DB_PREFIX."c_chargesociales as c";
$sql.= " WHERE cs.fk_type = c.id"; $sql.= " WHERE cs.fk_type = c.id";
$sql.= " AND cs.rowid = ".$id; if ($ref) $sql.= " AND cs.rowid = ".$ref;
else $sql.= " AND cs.rowid = ".$id;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG); dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);

View File

@ -159,6 +159,7 @@ class box_actions extends ModeleBoxes
$actioncejour=false; $actioncejour=false;
$contents=$this->info_box_contents; $contents=$this->info_box_contents;
$nblines=count($contents); $nblines=count($contents);
$bcx=array();
$bcx[0] = 'class="box_pair"'; $bcx[0] = 'class="box_pair"';
$bcx[1] = 'class="box_impair"'; $bcx[1] = 'class="box_impair"';
if ($contents[0][0]['text'] != $langs->trans("NoActionsToDo")) if ($contents[0][0]['text'] != $langs->trans("NoActionsToDo"))

View File

@ -181,6 +181,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
global $langs,$conf; global $langs,$conf;
$MAXLENGTHBOX=60; // Mettre 0 pour pas de limite $MAXLENGTHBOX=60; // Mettre 0 pour pas de limite
$bcx=array();
$bcx[0] = 'class="box_pair"'; $bcx[0] = 'class="box_pair"';
$bcx[1] = 'class="box_impair"'; $bcx[1] = 'class="box_impair"';
$var = false; $var = false;

View File

@ -256,10 +256,10 @@ class Ccountry // extends CommonObject
/** /**
* Delete object in database * Delete object in database
* *
* @param User $user User that delete * @param User $user User that delete
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user, $notrigger=0) function delete($user, $notrigger=0)

View File

@ -277,7 +277,7 @@ function limitChars(textarea, limit, infodiv)
{ {
$defaultmessage=$this->withbody; $defaultmessage=$this->withbody;
} }
$defaultmessage=make_substitutions($defaultmessage,$this->substit,$langs); $defaultmessage=make_substitutions($defaultmessage,$this->substit);
if (isset($_POST["message"])) $defaultmessage=$_POST["message"]; if (isset($_POST["message"])) $defaultmessage=$_POST["message"];
$defaultmessage=str_replace('\n',"\n",$defaultmessage); $defaultmessage=str_replace('\n',"\n",$defaultmessage);

View File

@ -847,6 +847,7 @@ class Ldap
*/ */
function getAttributeValues($filterrecord,$attribute) function getAttributeValues($filterrecord,$attribute)
{ {
$attributes=array();
$attributes[0] = $attribute; $attributes[0] = $attribute;
// We need to search for this user in order to get their entry. // We need to search for this user in order to get their entry.
@ -1075,9 +1076,9 @@ class Ldap
$subcount = hexdec(substr($hex_sid,2,2)); // Get count of sub-auth entries $subcount = hexdec(substr($hex_sid,2,2)); // Get count of sub-auth entries
$auth = hexdec(substr($hex_sid,4,12)); // SECURITY_NT_AUTHORITY $auth = hexdec(substr($hex_sid,4,12)); // SECURITY_NT_AUTHORITY
$result = "$rev-$auth"; $result = "$rev-$auth";
for ($x=0;$x < $subcount; $x++) { for ($x=0;$x < $subcount; $x++)
$subauth[$x] = hexdec($this->littleEndian(substr($hex_sid,16+($x*8),8))); // get all SECURITY_NT_AUTHORITY {
$result .= "-".$subauth[$x]; $result .= "-".hexdec($this->littleEndian(substr($hex_sid,16+($x*8),8))); // get all SECURITY_NT_AUTHORITY
} }
return $result; return $result;
} }
@ -1090,9 +1091,9 @@ class Ldap
* car conflit majuscule-minuscule. A n'utiliser que pour les pages * car conflit majuscule-minuscule. A n'utiliser que pour les pages
* 'Fiche LDAP' qui affiche champ lisibles par defaut. * 'Fiche LDAP' qui affiche champ lisibles par defaut.
* *
* @param string $checkDn DN de recherche (Ex: ou=users,cn=my-domain,cn=com) * @param string $checkDn DN de recherche (Ex: ou=users,cn=my-domain,cn=com)
* @param string $filter Filtre de recherche (ex: (sn=nom_personne) ) * @param string $filter Search filter (ex: (sn=nom_personne) )
* @return array Tableau des reponses (cle en minuscule-valeur) * @return array|int Array with answers (key lowercased - value)
*/ */
function search($checkDn, $filter) function search($checkDn, $filter)
{ {

View File

@ -121,9 +121,9 @@ interface Database
/** /**
* List tables into a database * List tables into a database
* *
* @param string $database Name of database * @param string $database Name of database
* @param string $table Nmae of table filter ('xxx%') * @param string $table Nmae of table filter ('xxx%')
* @return resource Resource * @return array List of tables in an array
*/ */
function DDLListTables($database, $table = ''); function DDLListTables($database, $table = '');
@ -386,9 +386,9 @@ interface Database
* 19700101020000 -> 3600 with TZ+1 and gmt=0 * 19700101020000 -> 3600 with TZ+1 and gmt=0
* 19700101020000 -> 7200 whaterver is TZ if gmt=1 * 19700101020000 -> 7200 whaterver is TZ if gmt=1
* *
* @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS)
* @param int $gm 1=Input informations are GMT values, otherwise local to server TZ * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ
* @return date Date TMS * @return timestamp|string Date TMS
*/ */
function jdate($string, $gm=false); function jdate($string, $gm=false);

View File

@ -158,8 +158,8 @@ abstract class DoliDB implements Database
/** /**
* Annulation d'une transaction et retour aux anciennes valeurs * Annulation d'une transaction et retour aux anciennes valeurs
* *
* @param string $log Add more log to default log line * @param string $log Add more log to default log line
* @return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur * @return resource|int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
*/ */
function rollback($log='') function rollback($log='')
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -28,36 +28,36 @@
* *
* @return array Array of tabs to show * @return array Array of tabs to show
*/ */
function admin_accounting_prepare_head() function admin_accounting_prepare_head($object=null)
{ {
global $langs, $conf; global $langs, $conf;
$h = 0; $h = 0;
$head = array (); $head = array ();
$head[$h][0] = dol_buildpath('/accountancy/admin/index.php', 1); $head[$h][0] = dol_buildpath('/accountancy/admin/index.php', 1);
$head[$h][1] = $langs->trans("Configuration"); $head[$h][1] = $langs->trans("Configuration");
$head[$h][2] = 'general'; $head[$h][2] = 'general';
$h ++; $h ++;
// Show more tabs from modules // Show more tabs from modules
// Entries must be declared in modules descriptor with line // Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin'); complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin');
$head[$h][0] = dol_buildpath('/accountancy/admin/journaux.php', 1); $head[$h][0] = dol_buildpath('/accountancy/admin/journaux.php', 1);
$head[$h][1] = $langs->trans("Journaux"); $head[$h][1] = $langs->trans("Journaux");
$head[$h][2] = 'journal'; $head[$h][2] = 'journal';
$h ++; $h ++;
$head[$h][0] = dol_buildpath('/accountancy/admin/export.php', 1); $head[$h][0] = dol_buildpath('/accountancy/admin/export.php', 1);
$head[$h][1] = $langs->trans("Export"); $head[$h][1] = $langs->trans("Export");
$head[$h][2] = 'export'; $head[$h][2] = 'export';
$h ++; $h ++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin', 'remove'); complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin', 'remove');
return $head; return $head;
} }
@ -70,23 +70,23 @@ function admin_accounting_prepare_head()
function accounting_prepare_head($object) function accounting_prepare_head($object)
{ {
global $langs, $conf; global $langs, $conf;
$h = 0; $h = 0;
$head = array (); $head = array ();
$head[$h][0] = dol_buildpath('/accountancy/admin/card.php', 1) . '?id=' . $object->id; $head[$h][0] = dol_buildpath('/accountancy/admin/card.php', 1) . '?id=' . $object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h ++; $h ++;
// Show more tabs from modules // Show more tabs from modules
// Entries must be declared in modules descriptor with line // Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_account'); complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_account');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_account', 'remove'); complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_account', 'remove');
return $head; return $head;
} }
@ -94,25 +94,25 @@ function accounting_prepare_head($object)
* Return general accounting account with defined length * Return general accounting account with defined length
* *
* @param string $account General accounting account * @param string $account General accounting account
* @return string String with defined length * @return string String with defined length
*/ */
function length_accountg($account) function length_accountg($account)
{ {
global $conf; global $conf;
$g = $conf->global->ACCOUNTING_LENGTH_GACCOUNT; $g = $conf->global->ACCOUNTING_LENGTH_GACCOUNT;
if (! empty($g)) { if (! empty($g)) {
// Clean parameters // Clean parameters
$i = strlen($account); $i = strlen($account);
if ($i >= 2) { if ($i >= 2) {
while ( $i < $g ) { while ( $i < $g ) {
$account .= '0'; $account .= '0';
$i ++; $i ++;
} }
return $account; return $account;
} else { } else {
return $account; return $account;
@ -126,25 +126,25 @@ function length_accountg($account)
* Return auxiliary accounting account with defined length * Return auxiliary accounting account with defined length
* *
* @param string $accounta Auxiliary accounting account * @param string $accounta Auxiliary accounting account
* @return string String with defined length * @return string String with defined length
*/ */
function length_accounta($accounta) function length_accounta($accounta)
{ {
global $conf, $langs; global $conf, $langs;
$a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT; $a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT;
if (! empty($a)) { if (! empty($a)) {
// Clean parameters // Clean parameters
$i = strlen($accounta); $i = strlen($accounta);
if ($i >= 2) { if ($i >= 2) {
while ( $i < $a ) { while ( $i < $a ) {
$accounta .= '0'; $accounta .= '0';
$i ++; $i ++;
} }
return $accounta; return $accounta;
} else { } else {
return $accounta; return $accounta;
@ -160,8 +160,8 @@ function length_accounta($accounta)
* @param string $txt Accounting account * @param string $txt Accounting account
* @param int $len Length * @param int $len Length
* @param int $end Number of characters * @param int $end Number of characters
* *
* @return string Formated string * @return string Formated string
*/ */
function length_exportsage($txt, $len, $end) function length_exportsage($txt, $len, $end)
{ {
@ -169,11 +169,11 @@ function length_exportsage($txt, $len, $end)
// problem with this function, but we need to have the number of letter // problem with this function, but we need to have the number of letter
if (strlen($txt) == $len) { if (strlen($txt) == $len) {
$res = $txt; $res = $txt;
} }
elseif (strlen($txt) > $len) { elseif (strlen($txt) > $len) {
$res = substr($txt, 0, $len); $res = substr($txt, 0, $len);
} }
else { else {
if ($end == 1) { if ($end == 1) {

View File

@ -3837,13 +3837,14 @@ function dol_html_entity_decode($a,$b,$c='UTF-8')
/** /**
* Replace htmlentities functions to manage errors * Replace htmlentities functions to manage errors
* http://php.net/manual/en/function.htmlentities.php * http://php.net/manual/en/function.htmlentities.php
* TODO Remove this function to replace it with direct htmlentities.
* *
* @param string $string The input string. * @param string $string The input string.
* @param int $flags Flags(see PHP doc above) * @param int $flags Flags(see PHP doc above)
* @param string $encoding Encoding * @param string $encoding Encoding
* @param bool $double_encode When double_encode is turned off PHP will not encode existing html entities * @param bool $double_encode When double_encode is turned off PHP will not encode existing html entities
* @return string $ret Encoded string * @return string $ret Encoded string
* @deprecated Since PHP4 support is no longer available, this function does not make sense * @deprecated Since PHP4 support is no longer available, this function does not make sense.
*/ */
function dol_htmlentities($string, $flags=null, $encoding='UTF-8', $double_encode=false) function dol_htmlentities($string, $flags=null, $encoding='UTF-8', $double_encode=false)
{ {
@ -3998,10 +3999,7 @@ function dol_concatdesc($text1,$text2,$forxml=false)
} }
/** /**
* Make substition into a string * Make substition into a string replacing key with vals from $substitutionarray (oldval=>newval)
* There is two type of substitions:
* - From $substitutionarray (oldval=>newval)
* - From special constants (__XXX__=>f(objet->xxx)) by substitutions modules
* *
* @param string $chaine Source string in which we must do substitution * @param string $chaine Source string in which we must do substitution
* @param array $substitutionarray Array with key->val to substitute * @param array $substitutionarray Array with key->val to substitute

View File

@ -316,6 +316,7 @@ function measuring_units_string($unit,$measuring_style='')
{ {
global $langs; global $langs;
$measuring_units=array();
if ($measuring_style == 'weight') if ($measuring_style == 'weight')
{ {
$measuring_units[3] = $langs->trans("WeightUnitton"); $measuring_units[3] = $langs->trans("WeightUnitton");

View File

@ -637,7 +637,7 @@ if (! defined('NOLOGIN'))
{ {
$db->rollback(); $db->rollback();
session_destroy(); session_destroy();
dol_print_error($db,'Error in some triggers on action USER_LOGIN',LOG_ERR); dol_print_error($db,'Error in some triggers on action USER_LOGIN');
exit; exit;
} }
else else

View File

@ -1396,7 +1396,7 @@ class Product extends CommonObject
if (! $id && ! $ref && ! $ref_ext) if (! $id && ! $ref && ! $ref_ext)
{ {
$this->error='ErrorWrongParameters'; $this->error='ErrorWrongParameters';
dol_print_error(get_class($this)."::fetch ".$this->error, LOG_ERR); dol_print_error(get_class($this)."::fetch ".$this->error);
return -1; return -1;
} }

View File

@ -633,7 +633,7 @@ class Resource extends CommonObject
if (! $this->table_element) if (! $this->table_element)
{ {
dol_print_error('',get_class($this)."::load_previous_next_ref was called on objet with property table_element not defined", LOG_ERR); dol_print_error('',get_class($this)."::load_previous_next_ref was called on objet with property table_element not defined");
return -1; return -1;
} }