From 88cd5dec4058a08ec0cce1fe97a7815d4a36dac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 13 Jun 2014 01:42:00 +0200 Subject: [PATCH] More substitutions --- htdocs/categories/class/categorie.class.php | 7 ++----- htdocs/commande/class/commande.class.php | 1 - htdocs/compta/facture/class/facture-rec.class.php | 1 - htdocs/compta/facture/class/facture.class.php | 3 +-- htdocs/contact/class/contact.class.php | 1 - htdocs/core/class/discount.class.php | 1 - htdocs/core/lib/admin.lib.php | 7 +++---- htdocs/expedition/class/expedition.class.php | 3 +-- htdocs/fichinter/class/fichinter.class.php | 1 - htdocs/fourn/class/fournisseur.facture.class.php | 1 - htdocs/holiday/class/holiday.class.php | 2 +- htdocs/livraison/class/livraison.class.php | 1 - htdocs/product/class/product.class.php | 9 +++------ htdocs/societe/class/companybankaccount.class.php | 6 +++--- htdocs/societe/class/societe.class.php | 1 - 15 files changed, 14 insertions(+), 31 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 69ee6b7dbb8..69c16a9fb09 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -633,7 +633,6 @@ class Categorie extends CommonObject else { $this->error=$this->db->error().' sql='.$sql; - dol_syslog(get_class($this)."::getObjectsInCateg ".$this->error, LOG_ERR); return -1; } } @@ -677,7 +676,6 @@ class Categorie extends CommonObject return $this->db->fetch_object($resql)->nb; } else { $this->error=$this->db->error().' sql='.$sql; - dol_syslog(get_class($this)."::containsObject ".$this->error, LOG_ERR); return -1; } } @@ -1218,7 +1216,6 @@ class Categorie extends CommonObject else { $this->error=$this->db->error().' sql='.$sql; - dol_syslog(get_class($this)."::rechercher ".$this->error, LOG_ERR); return -1; } } @@ -1438,7 +1435,7 @@ class Categorie extends CommonObject $sql2.= " VALUES(".$this->id.",'".$key."','". $this->db->escape($this->label); $sql2.= "','".$this->db->escape($this->multilangs["$key"]["description"])."')"; } - dol_syslog(get_class($this).'::setMultiLangs sql='.$sql2); + dol_syslog(get_class($this).'::setMultiLangs', LOG_DEBUG); if (! $this->db->query($sql2)) { $this->error=$this->db->lasterror(); @@ -1464,7 +1461,7 @@ class Categorie extends CommonObject // on ne sauvegarde pas des champs vides if ( $this->multilangs["$key"]["label"] || $this->multilangs["$key"]["description"] || $this->multilangs["$key"]["note"] ) - dol_syslog(get_class($this).'::setMultiLangs sql='.$sql2); + dol_syslog(get_class($this).'::setMultiLangs', LOG_DEBUG); if (! $this->db->query($sql2)) { $this->error=$this->db->lasterror(); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index e9f0ff9e43a..14958b6ed2d 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1401,7 +1401,6 @@ class Commande extends CommonOrder else { $this->error='Order with id '.$id.' not found sql='.$sql; - dol_syslog(get_class($this).'::fetch '.$this->error); return 0; } } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 39d5d7ca398..c059e7ef2fd 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -269,7 +269,6 @@ class FactureRec extends Facture if ($result < 0) { $this->error=$this->db->error(); - dol_syslog('Facture::Fetch Error '.$this->error, LOG_ERR); return -3; } return 1; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index d8b5914113d..94976d08e41 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -929,7 +929,6 @@ class Facture extends CommonInvoice else { $this->error=$this->db->error(); - dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR); return -1; } } @@ -1427,7 +1426,7 @@ class Facture extends CommonInvoice if (is_numeric($cond_reglement)) $sqltemp.= " WHERE c.rowid=".$cond_reglement; else $sqltemp.= " WHERE c.code='".$this->db->escape($cond_reglement)."'"; - dol_syslog(get_class($this).'::calculate_date_lim_reglement sql='.$sqltemp); + dol_syslog(get_class($this).'::calculate_date_lim_reglement', LOG_DEBUG); $resqltemp=$this->db->query($sqltemp); if ($resqltemp) { diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 26827a3d504..58a7902b51a 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -328,7 +328,6 @@ class Contact extends CommonObject else { $this->error=$this->db->lasterror().' sql='.$sql; - dol_syslog(get_class($this)."::update Error ".$this->error,LOG_ERR); $this->db->rollback(); return -1; } diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 6d45f1034f4..49ff65a0e2c 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -169,7 +169,6 @@ class DiscountAbsolute else { $this->error=$this->db->lasterror().' - sql='.$sql; - dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 9040d6a1caf..75cf39feb22 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -215,7 +215,6 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker } else { - dol_syslog('Admin.lib::run_sql Failed to get max rowid for '.$table.' '.$db->lasterror().' sql='.$sqlgetrowid, LOG_ERR); if (! $silent) print ''; if (! $silent) print '
'.$langs->trans("Failed to get max rowid for ".$table)."
"; if (! $silent) print ''; @@ -226,7 +225,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker $from='__+MAX_'.$table.'__'; $to='+'.$listofmaxrowid[$table]; $newsql=str_replace($from,$to,$newsql); - dol_syslog('Admin.lib::run_sql New Request '.($i+1).' (replacing '.$from.' to '.$to.') sql='.$newsql, LOG_DEBUG); + dol_syslog('Admin.lib::run_sql New Request '.($i+1).' (replacing '.$from.' to '.$to.')', LOG_DEBUG); $arraysql[$i]=$newsql; } @@ -251,7 +250,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker // Ajout trace sur requete (eventuellement a commenter si beaucoup de requetes) if (! $silent) print ''.$langs->trans("Request").' '.($i+1)." sql='".dol_htmlentities($newsql,ENT_NOQUOTES)."'\n"; - dol_syslog('Admin.lib::run_sql Request '.($i+1).' sql='.$newsql, LOG_DEBUG); + dol_syslog('Admin.lib::run_sql Request '.($i+1), LOG_DEBUG); $sqlmodified=0; // Replace for encrypt data @@ -300,7 +299,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker $sqlmodified++; } - if ($sqlmodified) dol_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG); + if ($sqlmodified) dol_syslog('Admin.lib::run_sql New Request '.($i+1), LOG_DEBUG); $result=$db->query($newsql,$usesavepoint); if ($result) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 3b7392c9a83..2a1dc833bdf 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -473,14 +473,13 @@ class Expedition extends CommonObject } else { - dol_syslog(get_class($this).'::Fetch Error -2'); + dol_syslog(get_class($this).'::Fetch Error -2', LOG_ERR); $this->error='Delivery with id '.$id.' not found sql='.$sql; return -2; } } else { - dol_syslog(get_class($this).'::Fetch Error -1'); $this->error=$this->db->error(); return -1; } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 0fdf6ae1b1f..d1d569101fd 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1074,7 +1074,6 @@ class FichinterLigne else { $this->error=$this->db->error().' sql='.$sql; - dol_print_error($this->db,$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index a5eb09f43f7..d6c8a9a4db7 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -432,7 +432,6 @@ class FactureFournisseur extends CommonInvoice else { $this->error="Error ".$this->db->lasterror(); - dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 1c90692d5a4..9932f2d609c 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -929,7 +929,7 @@ class Holiday extends CommonObject $sql2 = "UPDATE ".MAIN_DB_PREFIX."holiday_users SET"; $sql2.= " nb_holiday = nb_holiday + ".$nb_holiday; - dol_syslog(get_class($this).'::updateSoldeCP sql='.$sql2); + dol_syslog(get_class($this).'::updateSoldeCP', LOG_DEBUG); $result= $this->db->query($sql2); if ($result) return 1; diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index a9cb5df1191..83ca1a27b72 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -318,7 +318,6 @@ class Livraison extends CommonObject } else { - dol_syslog(get_class($this).'::fetch Error '.$this->error, LOG_ERR); $this->error=$this->db->error(); return -1; } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 7f3bf0d4dea..43731eb35f4 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -795,13 +795,12 @@ class Product extends CommonObject { $sqlz = "DELETE FROM ".MAIN_DB_PREFIX."product"; $sqlz.= " WHERE rowid = ".$id; - dol_syslog(get_class($this).'::delete sql='.$sqlz, LOG_DEBUG); + dol_syslog(get_class($this).'::delete', LOG_DEBUG); $resultz = $this->db->query($sqlz); if ( ! $resultz ) { $error++; $this->errors[] = $this->db->lasterror(); - dol_syslog(get_class($this).'::delete error '.$this->error, LOG_ERR); } } @@ -896,11 +895,10 @@ class Product extends CommonObject $sql2.= "','".$this->db->escape($this->description); $sql2.= "','".$this->db->escape($this->note)."')"; } - dol_syslog(get_class($this).'::setMultiLangs sql='.$sql2); + dol_syslog(get_class($this).'::setMultiLangs'); if (! $this->db->query($sql2)) { $this->error=$this->db->lasterror(); - dol_syslog(get_class($this).'::setMultiLangs error='.$this->error, LOG_ERR); return -1; } } @@ -924,11 +922,10 @@ class Product extends CommonObject // on ne sauvegarde pas des champs vides if ( $this->multilangs["$key"]["label"] || $this->multilangs["$key"]["description"] || $this->multilangs["$key"]["note"] ) - dol_syslog(get_class($this).'::setMultiLangs sql='.$sql2); + dol_syslog(get_class($this).'::setMultiLangs'); if (! $this->db->query($sql2)) { $this->error=$this->db->lasterror(); - dol_syslog(get_class($this).'::setMultiLangs error='.$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 784b02ed930..79b59211b51 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -323,7 +323,7 @@ class CompanyBankAccount extends Account $sql1 = "SELECT rowid as id, fk_soc FROM ".MAIN_DB_PREFIX."societe_rib"; $sql1.= " WHERE rowid = ".($rib?$rib:$this->id); - dol_syslog(get_class($this).'::setAsDefault sql='.$sql1); + dol_syslog(get_class($this).'::setAsDefault', LOG_DEBUG); $result1 = $this->db->query($sql1); if ($result1) { @@ -339,12 +339,12 @@ class CompanyBankAccount extends Account $sql2 = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET default_rib = 0 "; $sql2.= "WHERE fk_soc = ".$obj->fk_soc; - dol_syslog(get_class($this).'::setAsDefault sql='.$sql2); + dol_syslog(get_class($this).'::setAsDefault', LOG_DEBUG); $result2 = $this->db->query($sql2); $sql3 = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET default_rib = 1 "; $sql3.= "WHERE rowid = ".$obj->id; - dol_syslog(get_class($this).'::setAsDefault sql='.$sql3); + dol_syslog(get_class($this).'::setAsDefault', LOG_DEBUG); $result3 = $this->db->query($sql3); if (!$result2 || !$result3) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ff9608300d9..9b017472198 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1193,7 +1193,6 @@ class Societe extends CommonObject else { $this->error=$this->db->error().' sql='.$sql; - dol_syslog(get_class($this)."::searchByName ".$this->error, LOG_ERR); return -1; } }