From 1f3f2b8c44e175ee9274f05fab6df6e8efd5e25e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Mar 2009 22:49:05 +0000 Subject: [PATCH] Log file for error messages use LOG_ERR level. --- htdocs/adherents/cotisation.class.php | 24 +++---- htdocs/categories/categorie.class.php | 3 +- htdocs/commande/commande.class.php | 10 +-- htdocs/compta/bank/account.class.php | 52 +++++++-------- htdocs/compta/facture/facture-rec.class.php | 8 +-- .../prelevement/bon-prelevement.class.php | 30 ++++----- htdocs/contact.class.php | 4 +- htdocs/contrat/contrat.class.php | 10 +-- htdocs/discount.class.php | 2 +- htdocs/expedition/expedition.class.php | 10 +-- htdocs/exports/export.class.php | 4 +- htdocs/facture.class.php | 30 ++++----- htdocs/fichinter/fichinter.class.php | 46 ++++++------- htdocs/fourn/facture/paiementfourn.class.php | 30 ++++----- htdocs/fourn/fournisseur.commande.class.php | 18 ++--- htdocs/fourn/fournisseur.product.class.php | 52 +++++++-------- .../modules/export/modules_export.php | 2 +- .../modules/facture/pdf_crabe.modules.php | 4 +- .../societe/mod_codecompta_aquarium.php | 4 +- .../interface_all_Logevents.class.php | 2 +- .../interface_modAgenda_ActionsAuto.class.php | 42 ++++++------ ...nterface_modPhenix_Phenixsynchro.class.php | 20 +++--- ...ace_modWebcalendar_Webcalsynchro.class.php | 20 +++--- htdocs/lib/CMailFile.class.php | 2 +- htdocs/livraison/livraison.class.php | 20 +++--- .../produits/osc_categories.class.php | 66 +++++++++---------- htdocs/phenix/phenix.class.php | 34 +++++----- htdocs/product.class.php | 2 +- htdocs/product/stock/entrepot.class.php | 14 ++-- htdocs/product/stock/mouvementstock.class.php | 12 ++-- htdocs/propal.class.php | 8 +-- htdocs/societe.class.php | 10 +-- htdocs/user.class.php | 2 +- htdocs/webcal/webcal.class.php | 50 +++++++------- 34 files changed, 323 insertions(+), 324 deletions(-) diff --git a/htdocs/adherents/cotisation.class.php b/htdocs/adherents/cotisation.class.php index fa714961ef1..01aff9f8870 100644 --- a/htdocs/adherents/cotisation.class.php +++ b/htdocs/adherents/cotisation.class.php @@ -45,7 +45,7 @@ class Cotisation extends CommonObject var $note; var $fk_bank; - + /** \brief Cotisation \param DB Handler base de données @@ -69,7 +69,7 @@ class Cotisation extends CommonObject $this->error="Error: Bad value for datef or dateh"; return -1; } - + $sql = "INSERT INTO ".MAIN_DB_PREFIX."cotisation (fk_adherent, datec, dateadh, datef, cotisation, note)"; $sql.= " VALUES (".$this->fk_adherent.", ".$this->db->idate(mktime()).","; $sql.= " ".$this->db->idate($this->dateh).","; @@ -85,7 +85,7 @@ class Cotisation extends CommonObject else { $this->error=$this->db->error(); - dol_syslog($this->error); + dol_syslog($this->error, LOG_ERR); return -1; } } @@ -149,7 +149,7 @@ class Cotisation extends CommonObject function update($user,$notrigger=0) { $this->db->begin(); - + $sql = "UPDATE ".MAIN_DB_PREFIX."cotisation SET "; $sql .= " fk_adherent = ".$this->fk_adherent.","; $sql .= " note=".($this->note ? "'".addslashes($this->note)."'" : 'null').","; @@ -175,7 +175,7 @@ class Cotisation extends CommonObject { $this->db->rollback(); $this->error=$this->db->error(); - dol_syslog("Cotisation::update ".$this->error); + dol_syslog("Cotisation::update ".$this->error, LOG_ERR); return -1; } } @@ -249,22 +249,22 @@ class Cotisation extends CommonObject function getNomUrl($withpicto=0) { global $langs; - + $result=''; $lien = ''; $lienfin=''; - + $picto='payment'; $label=$langs->trans("ShowSubscription"); - + if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin); if ($withpicto && $withpicto != 2) $result.=' '; $result.=$lien.$this->ref.$lienfin; return $result; } - - + + /** * \brief Charge les informations d'ordre info dans l'objet cotisation * \param id Id adhesion a charger @@ -275,7 +275,7 @@ class Cotisation extends CommonObject $sql.= ' '.$this->db->pdate('c.tms').' as datem'; $sql.= ' FROM '.MAIN_DB_PREFIX.'cotisation as c'; $sql.= ' WHERE c.rowid = '.$id; - + $result=$this->db->query($sql); if ($result) { @@ -295,6 +295,6 @@ class Cotisation extends CommonObject { dol_print_error($this->db); } - } + } } ?> diff --git a/htdocs/categories/categorie.class.php b/htdocs/categories/categorie.class.php index 0b7c4caec61..c4ac5efd00f 100644 --- a/htdocs/categories/categorie.class.php +++ b/htdocs/categories/categorie.class.php @@ -957,8 +957,7 @@ class Categorie else { $this->error=$this->db->error().' sql='.$sql; - //dol_syslog($this->error); - dol_print_error('',$this->error); + dol_syslog("Categorie::rechercher ".$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 146152508d2..b1afbf7d9cb 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -726,7 +726,7 @@ class Commande extends CommonObject else { $this->error=$this->db->error(); - dol_syslog("Error sql=$sql, error=".$this->error); + dol_syslog("Error sql=$sql, error=".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -1066,7 +1066,7 @@ class Commande extends CommonObject else { $this->error=$this->db->error(); - dol_syslog('Commande::fetch_lines: Error '.$this->error); + dol_syslog('Commande::fetch_lines: Error '.$this->error, LOG_ERR); return -3; } } @@ -2259,7 +2259,7 @@ class CommandeLigne else { $this->error=$this->db->lasterror(); - dol_syslog("CommandeLigne::delete ".$this->error); + dol_syslog("CommandeLigne::delete ".$this->error, LOG_ERR); return -1; } } @@ -2356,7 +2356,7 @@ class CommandeLigne else { $this->error=$this->db->error(); - dol_syslog("CommandeLigne::insert Error ".$this->error); + dol_syslog("CommandeLigne::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } @@ -2389,7 +2389,7 @@ class CommandeLigne else { $this->error=$this->db->error(); - dol_syslog("CommandeLigne::update_total Error ".$this->error); + dol_syslog("CommandeLigne::update_total Error ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } diff --git a/htdocs/compta/bank/account.class.php b/htdocs/compta/bank/account.class.php index 4092f39eae9..d7a49bc18a5 100644 --- a/htdocs/compta/bank/account.class.php +++ b/htdocs/compta/bank/account.class.php @@ -222,7 +222,7 @@ class Account extends CommonObject $this->db->begin(); - + $datev = $date; $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank (datec, dateo, datev, label, amount, fk_user_author, num_chq, fk_account, fk_type,emetteur,banque)"; @@ -315,12 +315,12 @@ class Account extends CommonObject if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $this->error=$langs->trans("ErrorBankLabelAlreadyExists"); - dol_syslog($this->error); + dol_syslog($this->error, LOG_ERR); return -1; } else { $this->error=$this->db->error()." sql=".$sql; - dol_syslog($this->error); + dol_syslog($this->error, LOG_ERR); return -2; } } @@ -338,11 +338,11 @@ class Account extends CommonObject // Check parameters if (! $this->min_allowed) $this->min_allowed=0; if (! $this->min_desired) $this->min_desired=0; - + if (! $this->ref) { $this->error=$langs->trans("ErrorFieldRequired",$langs->trans("Ref")); - dol_syslog("Account::update ".$this->error); + dol_syslog("Account::update ".$this->error, LOG_ERR); return -1; } if (! $this->label) $this->label = "???"; @@ -375,7 +375,7 @@ class Account extends CommonObject else { $this->error=$this->db.' sql='.$sql; - dol_print_error($this->error); + dol_print_error($this->error, LOG_ERR); return -1; } } @@ -425,7 +425,7 @@ class Account extends CommonObject else { $this->error=$this->db.' sql='.$sql; - dol_print_error($this->error); + dol_print_error($this->error, LOG_ERR); return -1; } } @@ -604,7 +604,7 @@ class Account extends CommonObject return $this->error; } - /** + /** * \brief Return current sold * \param option 1=Exclude future operation date (this is to exclude input made in advance and have real account sold) * \return int Current sold (value date <= today) @@ -750,18 +750,18 @@ class Account extends CommonObject function getCountryCode() { global $mysoc; - + if (! empty($this->iban)) { // If IBAN defined, we can know country of account from it if (eregi("^([a-zA-Z][a-zA-Z])",$this->iban,$reg)) return $reg[1]; } - + // We return country code if (! empty($mysoc->pays_code)) return $mysoc->pays_code; return ''; - } + } /** * \brief Return if a bank account is defined with detailed information (bank code, desk code, number and key) @@ -773,10 +773,10 @@ class Account extends CommonObject if ($country_code == 'FR') return true; if ($country_code == 'ES') return true; - + return false; - } - + } + } @@ -803,10 +803,10 @@ class AccountLine var $num_releve; var $num_chq; var $rappro; - + var $bank_account_label; - - + + /** * Constructeur */ @@ -949,7 +949,7 @@ class AccountLine { $this->db->rollback(); $this->error=$this->db->error(); - dol_syslog("AccountLine::update ".$this->error); + dol_syslog("AccountLine::update ".$this->error, LOG_ERR); return -1; } } @@ -981,12 +981,12 @@ class AccountLine dol_syslog("AccountLine::update_conciliation sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); - + // No error check. Can fail if category already affected } $bankline->rappro=1; - + $this->db->commit(); return 1; } @@ -994,9 +994,9 @@ class AccountLine { $this->db->rollback(); return -1; - } + } } - + /** * \brief Charge les informations d'ordre info dans l'objet facture * \param id Id de la facture a charger @@ -1040,7 +1040,7 @@ class AccountLine } } - + /** * \brief Renvoie nom clicable (avec eventuellement le picto) * \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul @@ -1070,12 +1070,12 @@ class AccountLine $result.=$accountstatic->getNomUrl(0).', '; $result.=$langs->trans("BankLineConciliated").': '; $result.=yn($this->rappro); - $result.=')'; + $result.=')'; } - + return $result; } - + } ?> diff --git a/htdocs/compta/facture/facture-rec.class.php b/htdocs/compta/facture/facture-rec.class.php index 9abc4785ebd..69394c7e208 100644 --- a/htdocs/compta/facture/facture-rec.class.php +++ b/htdocs/compta/facture/facture-rec.class.php @@ -248,7 +248,7 @@ class FactureRec extends Facture if ($result < 0) { $this->error=$this->db->error(); - dol_syslog('Facture::Fetch Error '.$this->error); + dol_syslog('Facture::Fetch Error '.$this->error, LOG_ERR); return -3; } return 1; @@ -256,14 +256,14 @@ class FactureRec extends Facture else { $this->error='Bill with id '.$rowid.' not found sql='.$sql; - dol_syslog('Facture::Fetch Error '.$this->error); + dol_syslog('Facture::Fetch Error '.$this->error, LOG_ERR); return -2; } } else { $this->error=$this->db->error(); - dol_syslog('Facture::Fetch Error '.$this->error); + dol_syslog('Facture::Fetch Error '.$this->error, LOG_ERR); return -1; } } @@ -328,7 +328,7 @@ class FactureRec extends Facture else { $this->error=$this->db->error(); - dol_syslog('Facture::fetch_lines: Error '.$this->error); + dol_syslog('Facture::fetch_lines: Error '.$this->error, LOG_ERR); return -3; } } diff --git a/htdocs/compta/prelevement/bon-prelevement.class.php b/htdocs/compta/prelevement/bon-prelevement.class.php index 5e0ef0d52de..9c305fc0bb4 100644 --- a/htdocs/compta/prelevement/bon-prelevement.class.php +++ b/htdocs/compta/prelevement/bon-prelevement.class.php @@ -48,14 +48,14 @@ class BonPrelevement extends CommonObject var $total; var $_fetched; - + function BonPrelevement($DB, $filename='') { $error = 0; $this->db = $DB; $this->filename=$filename; - + $this->date_echeance = time(); $this->raison_sociale = ""; $this->reference_remise = ""; @@ -262,7 +262,7 @@ class BonPrelevement extends CommonObject function set_credite() { global $user; - + $error == 0; if ($this->db->begin()) @@ -501,7 +501,7 @@ class BonPrelevement extends CommonObject $arr_mime = array(); $arr_name = array(); $msgishtml=0; - + if ($joinfile == 1) { $arr_file = array(DOL_DATA_ROOT.'/prelevement/bon/'.$this->ref.'.ps'); @@ -641,12 +641,12 @@ class BonPrelevement extends CommonObject else { $this->error="BonPrelevement::SommeAPrelever Erreur -1 sql=".$this->db->error(); - dol_syslog($this->error); + dol_syslog($this->error, LOG_ERR); return -1; } } - + /** * \brief Create a withdraw * \return int <0 if KO, nbre of invoice withdrawed if OK @@ -654,7 +654,7 @@ class BonPrelevement extends CommonObject function Create($banque=0, $guichet=0) { global $conf; - + dol_syslog("BonPrelevement::Create banque=$banque guichet=$guichet"); require_once (DOL_DOCUMENT_ROOT."/compta/prelevement/bon-prelevement.class.php"); @@ -833,7 +833,7 @@ class BonPrelevement extends CommonObject $dir=$conf->prelevement->dir_output.'/bon'; $file=$filebonprev; if (! is_dir($dir)) create_exdir($dir); - + $bonprev = new BonPrelevement($this->db, $dir."/".$file); $bonprev->id = $prev_id; } @@ -1000,7 +1000,7 @@ class BonPrelevement extends CommonObject } } - + /** * \brief Renvoie nom clicable (avec eventuellement le picto) * \param withpicto Inclut le picto dans le lien @@ -1025,9 +1025,9 @@ class BonPrelevement extends CommonObject if ($withpicto) $result.=($lien.img_object($langs->trans("ShowWithdraw"),'payment').$lienfin.' '); $result.=$lien.$this->ref.$lienfin; return $result; - } - - + } + + /** * * @@ -1106,7 +1106,7 @@ class BonPrelevement extends CommonObject function Generate() { global $conf; - + $result = -1; $this->file = fopen ($this->filename,"w"); @@ -1160,9 +1160,9 @@ class BonPrelevement extends CommonObject $this->EnregTotal($this->total); fclose($this->file); - if (! empty($conf->global->MAIN_UMASK)) + if (! empty($conf->global->MAIN_UMASK)) @chmod($this->file, octdec($conf->global->MAIN_UMASK)); - + return $result; } diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php index 2c9770ea745..35d6eeb03f9 100644 --- a/htdocs/contact.class.php +++ b/htdocs/contact.class.php @@ -127,7 +127,7 @@ class Contact extends CommonObject else { $this->error=$this->db->error(); - dol_syslog("Contact::create ".$this->error); + dol_syslog("Contact::create ".$this->error, LOG_ERR); return -1; } } @@ -529,7 +529,7 @@ class Contact extends CommonObject else { $this->error=$this->db->error()." - ".$sql; - dol_syslog("Contact::load_ref_elements Error ".$this->error); + dol_syslog("Contact::load_ref_elements Error ".$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/contrat/contrat.class.php b/htdocs/contrat/contrat.class.php index 18903747abc..ef4392a25d5 100644 --- a/htdocs/contrat/contrat.class.php +++ b/htdocs/contrat/contrat.class.php @@ -123,7 +123,7 @@ class Contrat extends CommonObject else { $this->error=$this->db->lasterror(); - dol_syslog("Contrat::active_line error ".$this->error); + dol_syslog("Contrat::active_line error ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -564,7 +564,7 @@ class Contrat extends CommonObject else { $this->error=$interface->error; - dol_syslog("Contrat::create - 30 - ".$this->error); + dol_syslog("Contrat::create - 30 - ".$this->error, LOG_ERR); $this->db->rollback(); return -3; @@ -573,7 +573,7 @@ class Contrat extends CommonObject else { $this->error="Failed to add contact"; - dol_syslog("Contrat::create - 20 - ".$this->error); + dol_syslog("Contrat::create - 20 - ".$this->error, LOG_ERR); $this->db->rollback(); return -2; @@ -582,7 +582,7 @@ class Contrat extends CommonObject else { $this->error=$langs->trans("UnknownError: ".$this->db->error()." - sql=".$sql); - dol_syslog("Contrat::create - 10 - ".$this->error); + dol_syslog("Contrat::create - 10 - ".$this->error, LOG_ERR); $this->db->rollback(); return -1; @@ -739,7 +739,7 @@ class Contrat extends CommonObject else { $this->error=$this->db->error(); - dol_syslog("Contrat::delete ERROR ".$this->error); + dol_syslog("Contrat::delete ERROR ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } diff --git a/htdocs/discount.class.php b/htdocs/discount.class.php index f2a9aae7aa6..d01fdfd4dff 100644 --- a/htdocs/discount.class.php +++ b/htdocs/discount.class.php @@ -159,7 +159,7 @@ class DiscountAbsolute else { $this->error=$this->db->lasterror().' - sql='.$sql; - dol_syslog("DiscountAbsolute::create ".$this->error); + dol_syslog("DiscountAbsolute::create ".$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/expedition/expedition.class.php b/htdocs/expedition/expedition.class.php index 64f47b4333c..5950aad4658 100644 --- a/htdocs/expedition/expedition.class.php +++ b/htdocs/expedition/expedition.class.php @@ -386,7 +386,7 @@ class Expedition extends CommonObject { $this->db->rollback(); $this->error=$this->db->error()." - sql=$sql"; - dol_syslog("Expedition::valid ".$this->error); + dol_syslog("Expedition::valid ".$this->error, LOG_ERR); return -3; } @@ -398,7 +398,7 @@ class Expedition extends CommonObject { $this->db->rollback(); $this->error=$this->db->error()." - sql=$sql"; - dol_syslog("Expedition::valid ".$this->error); + dol_syslog("Expedition::valid ".$this->error, LOG_ERR); return -2; } } @@ -430,7 +430,7 @@ class Expedition extends CommonObject { $this->db->rollback(); $this->error=$this->db->error(); - dol_syslog("Expedition::valid ".$this->error); + dol_syslog("Expedition::valid ".$this->error, LOG_ERR); return -1; } } @@ -438,7 +438,7 @@ class Expedition extends CommonObject { $this->db->rollback(); $this->error="Non autorise"; - dol_syslog("Expedition::valid ".$this->error); + dol_syslog("Expedition::valid ".$this->error, LOG_ERR); return -1; } @@ -633,7 +633,7 @@ class Expedition extends CommonObject else { $this->error=$this->db->error(); - dol_syslog('Expedition::fetch_lines: Error '.$this->error); + dol_syslog('Expedition::fetch_lines: Error '.$this->error, LOG_ERR); return -3; } } diff --git a/htdocs/exports/export.class.php b/htdocs/exports/export.class.php index 53eef819d58..9db0daf12e3 100644 --- a/htdocs/exports/export.class.php +++ b/htdocs/exports/export.class.php @@ -268,14 +268,14 @@ class Export else { $this->error=$objmodel->error; - dol_syslog("Error: ".$this->error); + dol_syslog("Export::build_file Error: ".$this->error, LOG_ERR); return -1; } } else { $this->error=$this->db->error()." - sql=".$sql; - dol_syslog("Error: ".$this->error); + dol_syslog("Export::build_file Error: ".$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 5b0e36accf8..9add64182b3 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -316,7 +316,7 @@ class Facture extends CommonObject } else { - dol_syslog("Facture::create error ".$this->error); + dol_syslog("Facture::create error ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } @@ -324,7 +324,7 @@ class Facture extends CommonObject else { $this->error=$this->db->error(); - dol_syslog("Facture::create error ".$this->error." sql=".$sql); + dol_syslog("Facture::create error ".$this->error." sql=".$sql, LOG_ERR); $this->db->rollback(); return -1; } @@ -581,7 +581,7 @@ class Facture extends CommonObject if ($result < 0) { $this->error=$this->db->error(); - dol_syslog('Facture::Fetch Error '.$this->error); + dol_syslog('Facture::Fetch Error '.$this->error, LOG_ERR); return -3; } return 1; @@ -589,14 +589,14 @@ class Facture extends CommonObject else { $this->error='Bill with id '.$rowid.' not found sql='.$sql; - dol_syslog('Facture::Fetch Error '.$this->error); + dol_syslog('Facture::Fetch Error '.$this->error, LOG_ERR); return -2; } } else { $this->error=$this->db->error(); - dol_syslog('Facture::Fetch Error '.$this->error); + dol_syslog('Facture::Fetch Error '.$this->error, LOG_ERR); return -1; } } @@ -940,7 +940,7 @@ class Facture extends CommonObject if (! $this->db->query($sql)) { $this->error=$this->db->error()." sql=".$sql; - dol_syslog("Facture.class::delete ".$this->error); + dol_syslog("Facture.class::delete ".$this->error, LOG_ERR); $this->db->rollback(); return -5; } @@ -966,7 +966,7 @@ class Facture extends CommonObject else { $this->error=$this->db->error()." sql=".$sql; - dol_syslog("Facture.class::delete ".$this->error); + dol_syslog("Facture.class::delete ".$this->error, LOG_ERR); $this->db->rollback(); return -6; } @@ -974,7 +974,7 @@ class Facture extends CommonObject else { $this->error=$this->db->error()." sql=".$sql; - dol_syslog("Facture.class::delete ".$this->error); + dol_syslog("Facture.class::delete ".$this->error, LOG_ERR); $this->db->rollback(); return -4; } @@ -982,7 +982,7 @@ class Facture extends CommonObject else { $this->error=$this->db->error()." sql=".$sql; - dol_syslog("Facture.class::delete ".$this->error); + dol_syslog("Facture.class::delete ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } @@ -990,7 +990,7 @@ class Facture extends CommonObject else { $this->error=$this->db->error()." sql=".$sql; - dol_syslog("Facture.class::delete ".$this->error); + dol_syslog("Facture.class::delete ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } @@ -1746,7 +1746,7 @@ class Facture extends CommonObject if (! $result) { $this->error=$this->db->error(); - dol_syslog("Facture::Deleteline Error ".$this->error); + dol_syslog("Facture::Deleteline Error ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -1758,7 +1758,7 @@ class Facture extends CommonObject if (! $result) { $this->error=$this->db->error(); - dol_syslog("Facture::Deleteline Error ".$this->error); + dol_syslog("Facture::Deleteline Error ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -2421,7 +2421,7 @@ class Facture extends CommonObject else { $this->error=$this->db->error(); - dol_syslog("Facture::list_replacable_invoices ".$this->error); + dol_syslog("Facture::list_replacable_invoices ".$this->error, LOG_ERR); return -1; } } @@ -2474,7 +2474,7 @@ class Facture extends CommonObject else { $this->error=$this->db->error(); - dol_syslog("Facture::list_avoir_invoices ".$this->error); + dol_syslog("Facture::list_avoir_invoices ".$this->error, LOG_ERR); return -1; } } @@ -3099,7 +3099,7 @@ class FactureLigne else { $this->error=$this->db->error(); - dol_syslog("FactureLigne::update_total Error ".$this->error); + dol_syslog("FactureLigne::update_total Error ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } diff --git a/htdocs/fichinter/fichinter.class.php b/htdocs/fichinter/fichinter.class.php index 5822aaa8f7c..af3c5b5bc73 100644 --- a/htdocs/fichinter/fichinter.class.php +++ b/htdocs/fichinter/fichinter.class.php @@ -226,11 +226,11 @@ class Fichinter extends CommonObject if ($this->statut != 0) { $this->db->begin(); - + $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter"; $sql.= " SET fk_statut = 0"; $sql.= " WHERE rowid = ".$this->id; - + dol_syslog("Fichinter::setDraft sql=".$sql); $resql=$this->db->query($sql); if ($resql) @@ -245,9 +245,9 @@ class Fichinter extends CommonObject dol_syslog("Fichinter::setDraft ".$this->error,LOG_ERR); return -1; } - } + } } - + /** * \brief Valide une fiche intervention * \param user User qui valide @@ -260,11 +260,11 @@ class Fichinter extends CommonObject if ($this->statut != 1) { $this->db->begin(); - + $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter"; $sql.= " SET fk_statut = 1, date_valid=".$this->db->idate(mktime()).", fk_user_valid=".$user->id; $sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0"; - + dol_syslog("Fichinter::setValid sql=".$sql); $resql=$this->db->query($sql); if ($resql) @@ -275,7 +275,7 @@ class Fichinter extends CommonObject $result=$interface->run_triggers('FICHEINTER_VALIDATE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers - + if (! $error) { $this->db->commit(); @@ -364,7 +364,7 @@ class Fichinter extends CommonObject } } } - + /** * \brief Renvoie la reference de fiche intervention suivante non utilisee en fonction du module @@ -474,7 +474,7 @@ class Fichinter extends CommonObject else { $this->error=$this->db->error(); - dol_syslog("Fichinter::set_project Error ".$this->error); + dol_syslog("Fichinter::set_project Error ".$this->error, LOG_ERR); } } else @@ -613,19 +613,19 @@ class Fichinter extends CommonObject function addline($fichinterid, $desc, $date_intervention, $duration) { dol_syslog("Fichinter::Addline $fichinterid, $desc, $date_intervention, $duration"); - + if ($this->statut == 0) { $this->db->begin(); - + // Insertion ligne $ligne=new FichinterLigne($this->db); - + $ligne->fk_fichinter = $fichinterid; $ligne->desc = $desc; $ligne->datei = $date_intervention; $ligne->duration = $duration; - + $result=$ligne->insert(); if ($result > 0) { @@ -635,7 +635,7 @@ class Fichinter extends CommonObject else { $this->error=$this->db->error(); - dol_syslog("Error sql=$sql, error=".$this->error); + dol_syslog("Error sql=$sql, error=".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -813,7 +813,7 @@ class FichinterLigne else { $this->error=$this->db->error().' sql='.$sql; - dol_print_error($this->db,$this->error); + dol_print_error($this->db,$this->error, LOG_ERR); return -1; } } @@ -877,7 +877,7 @@ class FichinterLigne else { $this->error=$this->db->error()." sql=".$sql; - dol_syslog("FichinterLigne::insert Error ".$this->error); + dol_syslog("FichinterLigne::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -913,7 +913,7 @@ class FichinterLigne else { $this->error=$this->db->lasterror(); - dol_syslog("FichinterLigne::update Error ".$this->error); + dol_syslog("FichinterLigne::update Error ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -921,7 +921,7 @@ class FichinterLigne else { $this->error=$this->db->lasterror(); - dol_syslog("FichinterLigne::update Error ".$this->error); + dol_syslog("FichinterLigne::update Error ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -944,7 +944,7 @@ class FichinterLigne $obj=$this->db->fetch_object($resql); $total_duration=0; if ($obj) $total_duration = $obj->total_duration; - + $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter"; $sql.= " SET duree = ".$total_duration; $sql.= " WHERE rowid = ".$this->fk_fichinter; @@ -959,7 +959,7 @@ class FichinterLigne else { $this->error=$this->db->error(); - dol_syslog("FichinterLigne::update_total Error ".$this->error); + dol_syslog("FichinterLigne::update_total Error ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } @@ -967,7 +967,7 @@ class FichinterLigne else { $this->error=$this->db->error(); - dol_syslog("FichinterLigne::update Error ".$this->error); + dol_syslog("FichinterLigne::update Error ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -983,7 +983,7 @@ class FichinterLigne { dol_syslog("FichinterLigne::delete_line lineid=".$this->rowid); $this->db->begin(); - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE rowid = ".$this->rowid; $resql = $this->db->query($sql); dol_syslog("FichinterLigne::delete_line sql=".$sql); @@ -1005,7 +1005,7 @@ class FichinterLigne else { $this->error=$this->db->error()." sql=".$sql; - dol_syslog("FichinterLigne::delete_line Error ".$this->error); + dol_syslog("FichinterLigne::delete_line Error ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } diff --git a/htdocs/fourn/facture/paiementfourn.class.php b/htdocs/fourn/facture/paiementfourn.class.php index 95b48d9bc1d..de92415a2ef 100644 --- a/htdocs/fourn/facture/paiementfourn.class.php +++ b/htdocs/fourn/facture/paiementfourn.class.php @@ -120,7 +120,7 @@ class PaiementFourn function create($user) { global $langs,$conf; - + $error = 0; // Clean parameters @@ -134,16 +134,16 @@ class PaiementFourn } $this->total = price2num($this->total); - + $this->db->begin(); - + if ($this->total <> 0) // On accepte les montants negatifs { $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiementfourn ('; $sql.= 'datec, datep, amount, fk_paiement, num_paiement, note, fk_user_author, fk_bank)'; $sql.= ' VALUES ('.$this->db->idate(mktime()).','; $sql.= " ".$this->db->idate($this->datepaye).", '".$this->total."', ".$this->paiementid.", '".$this->num_paiement."', '".addslashes($this->note)."', ".$user->id.", 0)"; - + dol_syslog("PaiementFourn::create sql=".$sql); $resql = $this->db->query($sql); if ($resql) @@ -330,7 +330,7 @@ class PaiementFourn else { $this->error='Paiement::Valide Error -1 '.$this->db->error(); - dol_syslog('PaiementFourn::valide error '.$this->error); + dol_syslog('PaiementFourn::valide error '.$this->error, LOG_ERR); return -1; } } @@ -431,7 +431,7 @@ class PaiementFourn function LibStatut($status,$mode=0) { global $langs; - + $langs->load('compta'); if ($mode == 0) { @@ -465,8 +465,8 @@ class PaiementFourn } return $langs->trans('Unknown'); } - - + + /** * \brief Renvoie nom clicable (avec eventuellement le picto) * \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul @@ -476,7 +476,7 @@ class PaiementFourn function getNomUrl($withpicto=0,$option='') { global $langs; - + $result=''; $lien = ''; @@ -490,14 +490,14 @@ class PaiementFourn /** * \brief Updates the payment number * \param string New num - * \return int -1 on error, 0 otherwise + * \return int -1 on error, 0 otherwise */ function update_num($num) { if(!empty($num) && $this->statut!=1) { $sql = 'UPDATE '.MAIN_DB_PREFIX.'paiementfourn SET num_paiement = \''.$this->db->escape($num).'\' WHERE rowid = '.$this->id; - + dol_syslog("PaiementFourn::update_num sql=".$sql); $result = $this->db->query($sql); if ($result) @@ -508,7 +508,7 @@ class PaiementFourn else { $this->error='PaiementFourn::update_num Error -1 '.$this->db->error(); - dol_syslog('PaiementFourn::update_num error '.$this->error); + dol_syslog('PaiementFourn::update_num error '.$this->error, LOG_ERR); return -1; } } @@ -517,7 +517,7 @@ class PaiementFourn /** * \brief Updates the payment date * \param string New date - * \return int -1 on error, 0 otherwise + * \return int -1 on error, 0 otherwise */ function update_date($date) { @@ -535,11 +535,11 @@ class PaiementFourn else { $this->error='PaiementFourn::update_date Error -1 '.$this->db->error(); - dol_syslog('PaiementFourn::update_date error '.$this->error); + dol_syslog('PaiementFourn::update_date error '.$this->error, LOG_ERR); return -1; } } return -1; //no date given or already validated - } + } } ?> diff --git a/htdocs/fourn/fournisseur.commande.class.php b/htdocs/fourn/fournisseur.commande.class.php index 4ae44dc55be..b1e3242f875 100644 --- a/htdocs/fourn/fournisseur.commande.class.php +++ b/htdocs/fourn/fournisseur.commande.class.php @@ -285,7 +285,7 @@ class CommandeFournisseur extends Commande else { $this->error=$this->db->lasterror(); - dol_syslog("CommandeFournisseur::valid ".$this->error); + dol_syslog("CommandeFournisseur::valid ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -293,7 +293,7 @@ class CommandeFournisseur extends Commande else { $this->error='Not Authorized'; - dol_syslog("CommandeFournisseur::valid ".$this->error); + dol_syslog("CommandeFournisseur::valid ".$this->error, LOG_ERR); return -1; } } @@ -731,7 +731,7 @@ class CommandeFournisseur extends Commande else { $this->error=$this->db->error()." - ".$sql; - dol_syslog("CommandeFournisseur::Create: Failed -2 - ".$this->error); + dol_syslog("CommandeFournisseur::Create: Failed -2 - ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } @@ -739,7 +739,7 @@ class CommandeFournisseur extends Commande else { $this->error=$this->db->error()." - ".$sql; - dol_syslog("CommandeFournisseur::Create: Failed -1 - ".$this->error); + dol_syslog("CommandeFournisseur::Create: Failed -1 - ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -945,7 +945,7 @@ class CommandeFournisseur extends Commande if ($result < 0) { $this->error=$this->db->error()." - sql=$sql"; - dol_syslog("CommandeFournisseur::DispatchProduct".$this->error); + dol_syslog("CommandeFournisseur::DispatchProduct".$this->error, LOG_ERR); $error = -2; } $i++; @@ -1198,7 +1198,7 @@ class CommandeFournisseur extends Commande else { $this->error=$this->db->error(); - dol_syslog("CommandeFournisseur::UpdateNote "+$this->error); + dol_syslog("CommandeFournisseur::UpdateNote "+$this->error, LOG_ERR); $result = -1; } @@ -1324,7 +1324,7 @@ class CommandeFournisseur extends Commande else { $this->error=$this->db->error(); - dol_syslog("CommandeFournisseur::updateline ".$this->error); + dol_syslog("CommandeFournisseur::updateline ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -1332,7 +1332,7 @@ class CommandeFournisseur extends Commande else { $this->error="Order status makes operation forbidden"; - dol_syslog("CommandeFournisseur::updateline ".$this->error); + dol_syslog("CommandeFournisseur::updateline ".$this->error, LOG_ERR); return -2; } } @@ -1519,7 +1519,7 @@ class CommandeFournisseurLigne extends CommandeLigne else { $this->error=$this->db->error(); - dol_syslog("CommandeFournisseurLigne.class.php::update_total Error ".$this->error); + dol_syslog("CommandeFournisseurLigne.class.php::update_total Error ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } diff --git a/htdocs/fourn/fournisseur.product.class.php b/htdocs/fourn/fournisseur.product.class.php index 8c35ab41767..f6b6210cd66 100644 --- a/htdocs/fourn/fournisseur.product.class.php +++ b/htdocs/fourn/fournisseur.product.class.php @@ -59,9 +59,9 @@ class ProductFournisseur extends Product function remove_fournisseur($id_fourn) { $ok=1; - + $this->db->begin(); - + // Search all links $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur"; @@ -76,7 +76,7 @@ class ProductFournisseur extends Product { $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql.= " WHERE fk_product_fournisseur = ".$obj->rowid; - + dol_syslog("ProductFournisseur::remove_fournisseur sql=".$sql); $resql2=$this->db->query($sql); if (! $resql2) @@ -86,11 +86,11 @@ class ProductFournisseur extends Product $ok=0; } } - + // Now delete all link supplier-product (they have no more childs) $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur"; $sql.= " WHERE fk_product = ".$this->id." AND fk_soc = ".$id_fourn; - + dol_syslog("ProductFournisseur::remove_fournisseur sql=".$sql); $resql=$this->db->query($sql); if (! $resql) @@ -99,7 +99,7 @@ class ProductFournisseur extends Product dol_syslog("ProductFournisseur::remove_fournisseur ".$this->error, LOG_ERR); $ok=0; } - + if ($ok) { $this->db->commit(); @@ -126,7 +126,7 @@ class ProductFournisseur extends Product $sql.= " WHERE rowid = ".$rowid; dol_syslog("ProductFournisseur::remove_product_fournisseur sql=".$sql); - $resql = $this->db->query($sql); + $resql = $this->db->query($sql); if ($resql) { return 1; @@ -149,8 +149,8 @@ class ProductFournisseur extends Product $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql.= " WHERE rowid = ".$rowid; dol_syslog("ProductFournisseur::remove_product_fournisseur_price sql=".$sql); - $resql = $this->db->query($sql); - if ($resql) + $resql = $this->db->query($sql); + if ($resql) { // Remove all entries with no childs $sql = "SELECT pf.rowid"; @@ -158,19 +158,19 @@ class ProductFournisseur extends Product $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pfp.fk_product_fournisseur = pf.rowid"; $sql.= " WHERE pfp.rowid IS NULL"; dol_syslog("ProductFournisseur::remove_product_fournisseur_price sql=".$sql); - $resql = $this->db->query($sql); + $resql = $this->db->query($sql); if ($resql) { $ok=1; - + while ($obj=$this->db->fetch_object($resql)) - { + { $rowidpf=$obj->rowid; - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur"; $sql.= " WHERE rowid = ".$rowidpf; dol_syslog("ProductFournisseur::remove_product_fournisseur_price sql=".$sql); - $resql2 = $this->db->query($sql); + $resql2 = $this->db->query($sql); if (! $resql2) { $this->error=$this->db->lasterror(); @@ -178,7 +178,7 @@ class ProductFournisseur extends Product $ok=0; } } - + if ($ok) { $this->db->commit(); @@ -206,13 +206,13 @@ class ProductFournisseur extends Product return -1; } } - - + + /* * * */ - function update($ref, $qty, $buyprice, $user) + function update($ref, $qty, $buyprice, $user) { $this->fourn_ref = $ref; @@ -225,7 +225,7 @@ class ProductFournisseur extends Product $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur "; $sql .= " SET ref_fourn = '" . $this->fourn_ref ."'"; $sql .= " WHERE fk_product = " . $this->id; - $sql .=" AND fk_soc = ".$this->fourn->id; + $sql .=" AND fk_soc = ".$this->fourn->id; $resql = $this->db->query($sql) ; } @@ -242,12 +242,12 @@ class ProductFournisseur extends Product function update_buyprice($qty, $buyprice, $user, $price_base_type='HT', $fourn) { global $mysoc; - + $buyprice=price2num($buyprice); - + $error=0; $this->db->begin(); - + // Supprime prix courant du fournisseur pour cette quantité $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price "; if ($this->product_fourn_price_id) @@ -258,7 +258,7 @@ class ProductFournisseur extends Product { $sql .= " WHERE fk_product_fournisseur = ".$this->product_fourn_id." AND quantity = ".$qty; } - + if ($this->db->query($sql)) { if ($price_base_type == 'TTC') @@ -352,7 +352,7 @@ class ProductFournisseur extends Product return $result; } - + /** * \brief Charge les informations relatives à un fournisseur * \param fournid id du fournisseur @@ -377,11 +377,11 @@ class ProductFournisseur extends Product else { $this->error=$this->db->error(); - dol_syslog("Product::fetch_fourn_data error=".$this->error); + dol_syslog("Product::fetch_fourn_data error=".$this->error, LOG_ERR); return -1; } } - + /** * \brief Charge les informations relatives à un prix de fournisseur * \param rowid id ligne diff --git a/htdocs/includes/modules/export/modules_export.php b/htdocs/includes/modules/export/modules_export.php index 01103914f8e..f79d1630fa5 100644 --- a/htdocs/includes/modules/export/modules_export.php +++ b/htdocs/includes/modules/export/modules_export.php @@ -168,7 +168,7 @@ class ModeleExports else { $this->error=$this->db->error(); - dol_syslog("Error: sql=$sql ".$this->error); + dol_syslog("Error: sql=$sql ".$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index 1054851b127..38d5ebd6f00 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -477,7 +477,7 @@ class pdf_crabe extends ModelePDFFactures else { $this->error=$this->db->lasterror(); - dol_syslog($this->db,$this->error); + dol_syslog($this->db,$this->error, LOG_ERR); return -1; } @@ -536,7 +536,7 @@ class pdf_crabe extends ModelePDFFactures else { $this->error=$this->db->lasterror(); - dol_syslog($this->db,$this->error); + dol_syslog($this->db,$this->error, LOG_ERR); return -1; } diff --git a/htdocs/includes/modules/societe/mod_codecompta_aquarium.php b/htdocs/includes/modules/societe/mod_codecompta_aquarium.php index 2add754fa2c..6ff0905d131 100644 --- a/htdocs/includes/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/includes/modules/societe/mod_codecompta_aquarium.php @@ -130,7 +130,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode if ($type == 'supplier') $sql.= "code_compta_fournisseur"; $sql.= " = '".$code."'"; $sql.= " AND rowid != ".$societe->id; - + $resql=$db->query($sql); if ($resql) { @@ -148,7 +148,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode else { $this->error=$db->error()." sql=".$sql; - dol_syslog("mod_codecompta_aquarium::verif error".$this->error); + dol_syslog("mod_codecompta_aquarium::verif error".$this->error, LOG_ERR); return -1; // Erreur } } diff --git a/htdocs/includes/triggers/interface_all_Logevents.class.php b/htdocs/includes/triggers/interface_all_Logevents.class.php index 9f1da9bb8e4..550b09ccf46 100644 --- a/htdocs/includes/triggers/interface_all_Logevents.class.php +++ b/htdocs/includes/triggers/interface_all_Logevents.class.php @@ -514,7 +514,7 @@ class InterfaceLogevents $error ="Failed to insert security event: ".$event->error; $this->error=$error; - dol_syslog("interface_all_Logevents.class.php: ".$this->error); + dol_syslog("interface_all_Logevents.class.php: ".$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php b/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php index e97d3c083c7..5713b64bcd0 100644 --- a/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php +++ b/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php @@ -19,7 +19,7 @@ /** \file htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php \ingroup core - \brief Trigger file for + \brief Trigger file for \version $Id$ */ @@ -33,12 +33,12 @@ class InterfaceActionsAuto { var $db; var $error; - + var $date; var $duree; var $texte; var $desc; - + /** * \brief Constructeur. * \param DB Handler d'acces base @@ -46,7 +46,7 @@ class InterfaceActionsAuto function InterfaceActionsAuto($DB) { $this->db = $DB ; - + $this->name = eregi_replace('^Interface','',get_class($this)); $this->family = "agenda"; $this->description = "Triggers of this module add actions in agenda according to setup made in agenda setup."; @@ -61,7 +61,7 @@ class InterfaceActionsAuto { return $this->name; } - + /** * \brief Renvoi descriptif du lot de triggers * \return string Descriptif du lot de triggers @@ -101,7 +101,7 @@ class InterfaceActionsAuto $key='MAIN_AGENDA_ACTIONAUTO_'.$action; //dol_syslog("xxxxxxxxxxx".$key); if (empty($conf->global->$key)) return 0; // Log events not enabled for this action - + // Following properties must be filled: // $object->actiontypecode; // $object->actionmsg (note, long text) @@ -112,9 +112,9 @@ class InterfaceActionsAuto // $object->facid // $object->propalrowid // $object->orderrowid - + $ok=0; - + // Actions if ($action == 'COMPANY_CREATE') { @@ -173,7 +173,7 @@ class InterfaceActionsAuto $langs->load("propal"); $langs->load("agenda"); $ok=1; - + // Parameters $object->xxx defined by caller } elseif ($action == 'PROPAL_CLOSE_SIGNED') @@ -207,13 +207,13 @@ class InterfaceActionsAuto $object->propalrowid=$object->id; $object->facid=$object->orderrowid=0; $ok=1; - } + } elseif ($action == 'ORDER_VALIDATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); $langs->load("orders"); $langs->load("agenda"); - + $object->actiontypecode='AC_OTH'; $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref); @@ -257,7 +257,7 @@ class InterfaceActionsAuto $langs->load("bills"); $langs->load("agenda"); $ok=1; - + // Parameters $object->xxx defined by caller } elseif ($action == 'BILL_PAYED') @@ -299,7 +299,7 @@ class InterfaceActionsAuto dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); $langs->load("orders"); $langs->load("agenda"); - + $object->actiontypecode='AC_OTH'; $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref); @@ -327,7 +327,7 @@ class InterfaceActionsAuto $object->orderrowid=$object->propalrowid=0; $ok=1; } - + // Members elseif ($action == 'MEMBER_VALIDATE') { @@ -342,7 +342,7 @@ class InterfaceActionsAuto $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->fullname; $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; - + $object->sendtoid=0; $object->facid=0; // Supplier invoice not yet supported $object->orderrowid=$object->propalrowid=0; @@ -363,7 +363,7 @@ class InterfaceActionsAuto $object->actionmsg.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount; $object->actionmsg.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start,'day').' - '.dol_print_date($object->last_subscription_date_end,'day'); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; - + $object->sendtoid=0; $object->facid=$object->orderrowid=$object->propalrowid=0; $ok=1; @@ -385,7 +385,7 @@ class InterfaceActionsAuto $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->fullname; $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; - + $object->sendtoid=0; $object->facid=$object->orderrowid=$object->propalrowid=0; $ok=1; @@ -403,12 +403,12 @@ class InterfaceActionsAuto $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->fullname; $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; - + $object->sendtoid=0; $object->facid=$object->orderrowid=$object->propalrowid=0; $ok=1; } - + // If not found /* else @@ -422,7 +422,7 @@ class InterfaceActionsAuto if ($ok) { $now=time(); - + // Insertion action require_once(DOL_DOCUMENT_ROOT.'/contact.class.php'); require_once(DOL_DOCUMENT_ROOT.'/actioncomm.class.php'); @@ -453,7 +453,7 @@ class InterfaceActionsAuto $error ="Failed to insert : ".$actioncomm->error." "; $this->error=$error; - dol_syslog("interface_modAgenda_ActionsAuto.class.php: ".$this->error); + dol_syslog("interface_modAgenda_ActionsAuto.class.php: ".$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/includes/triggers/interface_modPhenix_Phenixsynchro.class.php b/htdocs/includes/triggers/interface_modPhenix_Phenixsynchro.class.php index 433600bdd73..630fa1fca5b 100644 --- a/htdocs/includes/triggers/interface_modPhenix_Phenixsynchro.class.php +++ b/htdocs/includes/triggers/interface_modPhenix_Phenixsynchro.class.php @@ -36,12 +36,12 @@ class InterfacePhenixsynchro { var $db; var $error; - + var $date; var $duree; var $texte; var $desc; - + /** * \brief Constructeur. * \param DB Handler d'accès base @@ -49,13 +49,13 @@ class InterfacePhenixsynchro function InterfacePhenixsynchro($DB) { $this->db = $DB ; - + $this->name = eregi_replace('Interface','',get_class($this)); $this->family = "phenix"; $this->description = "Triggers of this module allows to add an event inside Phenix calenar for each Dolibarr business event."; $this->version = 'experimental'; // 'experimental' or 'dolibarr' or version } - + /** * \brief Renvoi nom du lot de triggers * \return string Nom du lot de triggers @@ -64,7 +64,7 @@ class InterfacePhenixsynchro { return $this->name; } - + /** * \brief Renvoi descriptif du lot de triggers * \return string Descriptif du lot de triggers @@ -141,7 +141,7 @@ class InterfacePhenixsynchro { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); $langs->load("other"); - + // Initialisation donnees (date,duree,texte,desc) $this->date=time(); $this->duree=0; @@ -223,7 +223,7 @@ class InterfacePhenixsynchro $this->desc=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref); $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; } - + // Invoices elseif ($action == 'BILL_VALIDATE') { @@ -394,8 +394,8 @@ class InterfacePhenixsynchro $error ="Dolibarr n'a pu se connecter à la base Phenix avec les identifiants définis (host=".$conf->phenix->db->host." dbname=".$conf->phenix->db->name." user=".$conf->phenix->db->user."). "; $error.="La mise a jour Webcalendar a été ignorée."; $this->error=$error; - - //dol_syslog("interface_phenix.class.php: ".$this->error); + + //dol_syslog("interface_phenix.class.php: ".$this->error, LOG_ERR); return -1; } @@ -415,7 +415,7 @@ class InterfacePhenixsynchro $error.="La mise a jour Phenix a été ignorée."; $this->error=$error; - //dol_syslog("interface_phenix.class.php: ".$this->error); + //dol_syslog("interface_phenix.class.php: ".$this->error, LOG_ERR); return -2; } } diff --git a/htdocs/includes/triggers/interface_modWebcalendar_Webcalsynchro.class.php b/htdocs/includes/triggers/interface_modWebcalendar_Webcalsynchro.class.php index cee1deea4a4..973d1924a9e 100644 --- a/htdocs/includes/triggers/interface_modWebcalendar_Webcalsynchro.class.php +++ b/htdocs/includes/triggers/interface_modWebcalendar_Webcalsynchro.class.php @@ -35,12 +35,12 @@ class InterfaceWebcalsynchro { var $db; var $error; - + var $date; var $duree; var $texte; var $desc; - + /** * \brief Constructeur. * \param DB Handler d'accès base @@ -48,13 +48,13 @@ class InterfaceWebcalsynchro function InterfaceWebcalsynchro($DB) { $this->db = $DB ; - + $this->name = eregi_replace('Interface','',get_class($this)); $this->family = "webcal"; $this->description = "Triggers of this module allows to add an event inside Webcalendar for each Dolibarr business event."; $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version } - + /** * \brief Renvoi nom du lot de triggers * \return string Nom du lot de triggers @@ -63,7 +63,7 @@ class InterfaceWebcalsynchro { return $this->name; } - + /** * \brief Renvoi descriptif du lot de triggers * \return string Descriptif du lot de triggers @@ -140,7 +140,7 @@ class InterfaceWebcalsynchro { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); $langs->load("other"); - + // Initialisation donnees (date,duree,texte,desc) $this->date=time(); $this->duree=0; @@ -200,7 +200,7 @@ class InterfaceWebcalsynchro $this->desc=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref); $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; } - + // Invoices elseif ($action == 'BILL_VALIDATE') { @@ -371,8 +371,8 @@ class InterfaceWebcalsynchro $error ="Dolibarr n'a pu se connecter à la base Webcalendar avec les identifiants définis (host=".$conf->webcal->db->host." dbname=".$conf->webcal->db->name." user=".$conf->webcal->db->user."). "; $error.="La mise a jour Webcalendar a été ignorée."; $this->error=$error; - - //dol_syslog("interface_webcal.class.php: ".$this->error); + + //dol_syslog("interface_webcal.class.php: ".$this->error, LOG_ERR); return -1; } @@ -392,7 +392,7 @@ class InterfaceWebcalsynchro $error.="La mise a jour Webcalendar a été ignorée."; $this->error=$error; - //dol_syslog("interface_webcal.class.php: ".$this->error); + //dol_syslog("interface_webcal.class.php: ".$this->error, LOG_ERR); return -2; } } diff --git a/htdocs/lib/CMailFile.class.php b/htdocs/lib/CMailFile.class.php index ed9d8b348da..99f599785a2 100644 --- a/htdocs/lib/CMailFile.class.php +++ b/htdocs/lib/CMailFile.class.php @@ -329,7 +329,7 @@ class CMailFile else { $this->error='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; - dol_syslog("CMailFile::sendfile: ".$this->error); + dol_syslog("CMailFile::sendfile: ".$this->error, LOG_WARN); } error_reporting($errorlevel); // Reactive niveau erreur origine diff --git a/htdocs/livraison/livraison.class.php b/htdocs/livraison/livraison.class.php index 5c23e9c74cf..81ba2be0d95 100644 --- a/htdocs/livraison/livraison.class.php +++ b/htdocs/livraison/livraison.class.php @@ -158,7 +158,7 @@ class Livraison extends CommonObject { $error++; $this->error=$this->db->lasterror()." - sql=".$this->db->lastqueryerror; - dol_syslog("Livraison::create Error -3 ".$this->error); + dol_syslog("Livraison::create Error -3 ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } @@ -167,7 +167,7 @@ class Livraison extends CommonObject { $error++; $this->error=$this->db->lasterror()." - sql=".$this->db->lastqueryerror; - dol_syslog("Livraison::create Error -2 ".$this->error); + dol_syslog("Livraison::create Error -2 ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } @@ -176,7 +176,7 @@ class Livraison extends CommonObject { $error++; $this->error=$this->db->lasterror()." - sql=".$this->db->lastqueryerror; - dol_syslog("Livraison::create Error -1 ".$this->error); + dol_syslog("Livraison::create Error -1 ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -298,13 +298,13 @@ class Livraison extends CommonObject else { $this->error='Delivery with id '.$rowid.' not found sql='.$sql; - dol_syslog('Livraison::Fetch Error '.$this->error); + dol_syslog('Livraison::Fetch Error '.$this->error, LOG_ERR); return -2; } } else { - dol_syslog('Livraison::Fetch Error '.$this->error); + dol_syslog('Livraison::Fetch Error '.$this->error, LOG_ERR); $this->error=$this->db->error(); return -1; } @@ -398,7 +398,7 @@ class Livraison extends CommonObject { $this->db->rollback(); $this->error=$this->db->error()." - sql=$sql"; - dol_syslog("livraison.class.php::valid ".$this->error); + dol_syslog("livraison.class.php::valid ".$this->error, LOG_ERR); return -3; } $i++; @@ -409,7 +409,7 @@ class Livraison extends CommonObject { $this->db->rollback(); $this->error=$this->db->error()." - sql=$sql"; - dol_syslog("livraison.class.php::valid ".$this->error); + dol_syslog("livraison.class.php::valid ".$this->error, LOG_ERR); return -2; } @@ -445,7 +445,7 @@ class Livraison extends CommonObject { $this->db->rollback(); $this->error=$this->db->error()." - sql=$sql"; - dol_syslog("livraison.class.php::valid ".$this->error); + dol_syslog("livraison.class.php::valid ".$this->error, LOG_ERR); return -1; } } @@ -454,7 +454,7 @@ class Livraison extends CommonObject else { $this->error="Non autorise"; - dol_syslog("livraison.class.php::valid ".$this->error); + dol_syslog("livraison.class.php::valid ".$this->error, LOG_ERR); return -1; } @@ -463,7 +463,7 @@ class Livraison extends CommonObject return 1; } - /** \brief Cr�� le bon de livraison depuis une exp�dition existante + /** \brief Cr�� le bon de livraison depuis une expedition existante * \param user Utilisateur qui cr�e * \param sending_id Id de l'exp�dition qui sert de mod�le */ diff --git a/htdocs/oscommerce_ws/produits/osc_categories.class.php b/htdocs/oscommerce_ws/produits/osc_categories.class.php index a5661da8c94..f9f61098245 100644 --- a/htdocs/oscommerce_ws/produits/osc_categories.class.php +++ b/htdocs/oscommerce_ws/produits/osc_categories.class.php @@ -43,23 +43,23 @@ class Osc_Categorie var $db; var $error=''; var $errors=array(); - + var $id; var $dolicatid; var $osccatid; - + /** * \brief Constructor * \param DB Database handler */ - function Osc_Categorie($DB) + function Osc_Categorie($DB) { $this->db = $DB; return 1; } - + /** * \brief Create in database * \param user User that create @@ -68,7 +68,7 @@ class Osc_Categorie function create($user) { global $conf, $langs; - + // Clean parameters $this->dolicatid=trim($this->dolicatid); $this->ocscatid=trim($this->ocscatid); @@ -86,7 +86,7 @@ class Osc_Categorie if ($resql) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."osc_categories"); - + /* $resql=$this->update($user, 1); if ($resql < 0) { @@ -109,7 +109,7 @@ class Osc_Categorie { $this->error=$this->db->lasterror(); $this->error .= "erreur ".$sql; - dol_syslog("Osc_Categorie.class::create ".$this->error); + dol_syslog("Osc_Categorie.class::create ".$this->error, LOG_ERR); return -1; } } @@ -123,7 +123,7 @@ class Osc_Categorie function update($user=0, $notrigger=0) { global $conf, $langs; - + // Clean parameters $this->dolicatid=trim($this->dolicatid); $this->ocscatid=trim($this->ocscatid); @@ -134,7 +134,7 @@ class Osc_Categorie $sql.= " osccatid='".addslashes($this->osccatid)."'"; $sql.= " WHERE rowid=".$this->id; dol_syslog("Osc_Categorie.class::update sql=".$sql,LOG_DEBUG); - + $resql = $this->db->query($sql); if (! $resql) { @@ -154,8 +154,8 @@ class Osc_Categorie return 1; } - - + + /* * \brief Load object in memory from database * \param id id object @@ -168,7 +168,7 @@ class Osc_Categorie $sql = "SELECT t.rowid, t.dolicatid, t.osccatid"; $sql.= " FROM ".MAIN_DB_PREFIX."osc_categories as t"; $sql.= " WHERE c.rowid = ".$id; - + dol_syslog("Osc_Categorie.class::fetch sql=".$sql); $resql=$this->db->query($sql); if ($resql) @@ -176,23 +176,23 @@ class Osc_Categorie if ($this->db->num_rows($resql)) { $obj = $this->db->fetch_object($resql); - + $this->id = $obj->rowid; $this->dolicatid = $obj->dolicatid; $this->ocscatid = $obj->osccatid; } $this->db->free($resql); - + return 1; } else { $this->error="Error ".$this->db->lasterror(); - dol_syslog("Osc_Categorie.class::fetch ".$this->error); + dol_syslog("Osc_Categorie.class::fetch ".$this->error, LOG_ERR); return -1; } } - + /* * \brief Load object in memory from database * \param id id object @@ -205,7 +205,7 @@ class Osc_Categorie $sql = "SELECT t.rowid, t.dolicatid, t.osccatid"; $sql.= " FROM ".MAIN_DB_PREFIX."osc_categories as t"; $sql.= " WHERE t.osccatid = ".$oscid; - + dol_syslog("Osc_Categorie.class::fetch_osccat sql=".$sql); $resql=$this->db->query($sql); if ($resql) @@ -213,25 +213,25 @@ class Osc_Categorie if ($this->db->num_rows($resql)) { $obj = $this->db->fetch_object($resql); - + $this->id = $obj->rowid; $this->dolicatid = $obj->dolicatid; $this->osccatid = $obj->osccatid; } - else + else $this->initAsSpecimen(); $this->db->free($resql); - + return 1; } else { $this->error="Error ".$this->db->lasterror(); - dol_syslog("Osc_Categorie.class::fetch_osccat ".$this->error); + dol_syslog("Osc_Categorie.class::fetch_osccat ".$this->error, LOG_ERR); return -1; } - } - + } + /* * \brief Load object in memory from database * \param id id object @@ -244,7 +244,7 @@ class Osc_Categorie $sql = "SELECT t.rowid, t.dolicatid, t.osccatid"; $sql.= " FROM ".MAIN_DB_PREFIX."osc_categories as t"; $sql.= " WHERE t.dolicatid = ".$doliid; - + dol_syslog("Osc_Categorie.class::fetch_dolicat sql=".$sql); $resql=$this->db->query($sql); if ($resql) @@ -252,23 +252,23 @@ class Osc_Categorie if ($this->db->num_rows($resql)) { $obj = $this->db->fetch_object($resql); - + $this->id = $obj->rowid; $this->dolicatid = $obj->dolicatid; $this->ocscatid = $obj->osccatid; } $this->db->free($resql); - + return 1; } else { $this->error="Error ".$this->db->lasterror(); - dol_syslog("Osc_Categorie.class::fetch_dolicat ".$this->error); + dol_syslog("Osc_Categorie.class::fetch_dolicat ".$this->error, LOG_ERR); return -1; } } - + /* * \brief Delete object in database * \param user User that delete @@ -277,10 +277,10 @@ class Osc_Categorie function delete($user) { global $conf, $langs; - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."osc_categories"; $sql.= " WHERE rowid=".$this->id; - + dol_syslog("Osc_Categorie.class::delete sql=".$sql); $resql = $this->db->query($sql); if (! $resql) @@ -288,7 +288,7 @@ class Osc_Categorie $this->error=$this->db->lasterror().' sql='.$sql; return -1; } - + // Appel des triggers include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php"); $interface=new Interfaces($this->db); @@ -299,7 +299,7 @@ class Osc_Categorie return 1; } - + /** * \brief Initialise object with example values * \remarks id must be 0 if object instance is a specimen. @@ -310,6 +310,6 @@ class Osc_Categorie $this->dolicatid=0; $this->osccatid=0; } - + } ?> diff --git a/htdocs/phenix/phenix.class.php b/htdocs/phenix/phenix.class.php index fea08da2119..84b6f52fe28 100644 --- a/htdocs/phenix/phenix.class.php +++ b/htdocs/phenix/phenix.class.php @@ -35,16 +35,16 @@ */ class Phenix { - + var $localdb; var $error; var $date; var $duree = 0; /* Secondes */ var $texte; var $desc; - - + + /** \brief Constructeur de la classe d'interface à Phenix */ @@ -80,23 +80,23 @@ class Phenix { function add($user) { global $langs; - + dol_syslog("Phenix::add user=".$user->id); - + // Test si login phenix défini pour le user if (! $user->phenix_login) { $langs->load("other"); $this->error=$langs->transnoentities("ErrorPhenixLoginNotDefined","id."\">".$user->login.""); - dol_syslog("Phenix::add ERROR ".$this->error); - return -4; + dol_syslog("Phenix::add ERROR ".$this->error, LOG_ERR); + return -4; } - + $this->localdb->begin(); // Recupère l'id max+1 dans la base webcalendar $id = $this->get_next_id(); - + if ($id > 0) { $age_id = $id; @@ -116,26 +116,26 @@ class Phenix { $sql = "INSERT INTO px_agenda (age_id, age_createur_id, cal_date, cal_time, cal_mod_date, cal_mod_time, cal_duration, cal_priority, cal_type, cal_access, cal_name,cal_description)"; $sql.= " VALUES ($age_id, '$age_createur_id', '$cal_date', '$cal_time', '$cal_mod_date', '$cal_mod_time', $cal_duration, $cal_priority, '$cal_type', '$cal_access', '$cal_name','$cal_description')"; - + dol_syslog("Phenix::add sql=".$sql); $resql=$this->localdb->query($sql); if ($resql) { $sql = "INSERT INTO webcal_entry_user (cal_id, cal_login, cal_status)"; $sql .= " VALUES ($cal_id, '$cal_create_by', 'A')"; - + $resql=$this->localdb->query($sql); if ($resql) { // OK $this->localdb->commit(); - return 1; + return 1; } else { $this->localdb->rollback(); $this->error = $this->localdb->error() . '
' .$sql; - dol_syslog("Phenix::add ERROR ".$this->error); + dol_syslog("Phenix::add ERROR ".$this->error, LOG_ERR); return -1; } } @@ -143,7 +143,7 @@ class Phenix { { $this->localdb->rollback(); $this->error = $this->localdb->error() . '
' .$sql; - dol_syslog("Phenix::add ERROR ".$this->error); + dol_syslog("Phenix::add ERROR ".$this->error, LOG_ERR); return -2; } } @@ -151,11 +151,11 @@ class Phenix { { $this->localdb->rollback(); $this->error = $this->localdb->error() . '
' .$sql; - dol_syslog("Phenix::add ERROR ".$this->error); + dol_syslog("Phenix::add ERROR ".$this->error, LOG_ERR); return -3; } } - + /** \brief Obtient l'id suivant dans phenix @@ -177,6 +177,6 @@ class Phenix { return -1; } } - + } ?> diff --git a/htdocs/product.class.php b/htdocs/product.class.php index 301023c3f50..4ebe60bb87a 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -893,7 +893,7 @@ class Product extends CommonObject if (! $id && ! $ref) { $this->error=$langs->trans('ErrorWrongParameters'); - dol_print_error("Product::fetch ".$this->error); + dol_print_error("Product::fetch ".$this->error, LOG_ERR); return -1; } diff --git a/htdocs/product/stock/entrepot.class.php b/htdocs/product/stock/entrepot.class.php index 4b122a7b6b4..f191745a153 100644 --- a/htdocs/product/stock/entrepot.class.php +++ b/htdocs/product/stock/entrepot.class.php @@ -155,7 +155,7 @@ class Entrepot extends CommonObject { $this->error=$this->db->error()." sql=$sql";; dol_syslog("Entrepot::Update return -1"); - dol_syslog("Entrepot::Update ".$this->error); + dol_syslog("Entrepot::Update ".$this->error, LOG_ERR); return -1; } } @@ -175,7 +175,7 @@ class Entrepot extends CommonObject if ($result) { $obj=$this->db->fetch_object($result); - + $this->id = $obj->rowid; $this->ref = $obj->rowid; $this->libelle = $obj->label; @@ -186,7 +186,7 @@ class Entrepot extends CommonObject $this->cp = $obj->cp; $this->ville = $obj->ville; $this->pays_id = $obj->fk_pays; - + if ($this->pays_id) { $sqlp = "SELECT libelle from ".MAIN_DB_PREFIX."c_pays where rowid = ".$this->pays_id; @@ -201,7 +201,7 @@ class Entrepot extends CommonObject } $this->pays=$objp->libelle; } - + $this->db->free($result); return 1; } @@ -250,7 +250,7 @@ class Entrepot extends CommonObject $this->date_modification = $obj->datem; } - + $this->db->free($result); } @@ -308,14 +308,14 @@ class Entrepot extends CommonObject { $sql.= ' AND IFNULL(c.visible,1)=1'; } - + $result = $this->db->query($sql) ; if ( $result ) { $row = $this->db->fetch_row(0); return $row[0]; - + $this->db->free(); } else diff --git a/htdocs/product/stock/mouvementstock.class.php b/htdocs/product/stock/mouvementstock.class.php index aeda63dba37..050e4904911 100644 --- a/htdocs/product/stock/mouvementstock.class.php +++ b/htdocs/product/stock/mouvementstock.class.php @@ -65,7 +65,7 @@ class MouvementStock } else { - dol_syslog("MouvementStock::_create ".$this->error); + dol_syslog("MouvementStock::_create ".$this->error, LOG_ERR); $error = -1; } @@ -83,7 +83,7 @@ class MouvementStock } else { - dol_syslog("MouvementStock::_create echec update ".$this->error); + dol_syslog("MouvementStock::_create echec update ".$this->error, LOG_ERR); $error = -2; } } @@ -165,7 +165,7 @@ class MouvementStock { $this->db->rollback(); $this->error=$this->db->lasterror(); - dol_syslog("MouvementStock::_create ".$this->error); + dol_syslog("MouvementStock::_create ".$this->error, LOG_ERR); return -2; } } @@ -239,7 +239,7 @@ class MouvementStock } else { - dol_syslog("MouvementStock::_Create echec update ".$this->error); + dol_syslog("MouvementStock::_Create echec update ".$this->error, LOG_ERR); return -1; } @@ -432,7 +432,7 @@ class MouvementStock } else { - dol_syslog("MouvementStock::CalculateValoPmp ERRORSQL[1] ".$this->error); + dol_syslog("MouvementStock::CalculateValoPmp ERRORSQL[1] ".$this->error, LOG_ERR); $error = -16; } } @@ -478,7 +478,7 @@ class MouvementStock } else { - dol_syslog("MouvementStock::CalculateValoPmp ERRORSQL[2] insert ".$this->error); + dol_syslog("MouvementStock::CalculateValoPmp ERRORSQL[2] insert ".$this->error, LOG_ERR); $error = -17; } } diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 3ee45bd670d..66d1954f715 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -464,7 +464,7 @@ class Propal extends CommonObject { $this->error=$this->db->error(); $this->db->rollback(); - dol_syslog("Propal::UpdateLine Erreur sql=$sql, error=".$this->error); + dol_syslog("Propal::UpdateLine Error=".$this->error, LOG_ERR); return -1; } } @@ -611,7 +611,7 @@ class Propal extends CommonObject else { $this->error=$this->db->error(); - dol_syslog("Propal::Create -2 ".$this->error); + dol_syslog("Propal::Create -2 ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } @@ -621,13 +621,13 @@ class Propal extends CommonObject else { $this->error=$this->db->error(); - dol_syslog("Propal::Create -1 ".$this->error); + dol_syslog("Propal::Create -1 ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } $this->db->commit(); - dol_syslog("Propal::Create done id=".$this->id); + dol_syslog("Propal::Create done id=".$this->id, LOG_ERR); return $this->id; } diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php index ce8f5a5c15f..01261d527f5 100644 --- a/htdocs/societe.class.php +++ b/htdocs/societe.class.php @@ -710,7 +710,7 @@ class Societe extends CommonObject else { $this->error .= $this->db->lasterror(); - dol_syslog("Societe::Delete erreur -1 ".$this->error); + dol_syslog("Societe::Delete erreur -1 ".$this->error, LOG_ERR); return -1; } @@ -755,7 +755,7 @@ class Societe extends CommonObject else { $this->error .= $this->db->lasterror(); - dol_syslog("Societe::Delete erreur -1 ".$this->error); + dol_syslog("Societe::Delete erreur -1 ".$this->error, LOG_ERR); } // Update link in member table @@ -769,7 +769,7 @@ class Societe extends CommonObject else { $this->error .= $this->db->lasterror(); - dol_syslog("Societe::Delete erreur -1 ".$this->error); + dol_syslog("Societe::Delete erreur -1 ".$this->error, LOG_ERR); } // Remove ban @@ -783,7 +783,7 @@ class Societe extends CommonObject else { $this->error = $this->db->lasterror(); - dol_syslog("Societe::Delete erreur -2 ".$this->error); + dol_syslog("Societe::Delete erreur -2 ".$this->error, LOG_ERR); } // Remove third party @@ -797,7 +797,7 @@ class Societe extends CommonObject else { $this->error = $this->db->lasterror(); - dol_syslog("Societe::Delete erreur -3 ".$this->error); + dol_syslog("Societe::Delete erreur -3 ".$this->error, LOG_ERR); } if ($sqr == 4) diff --git a/htdocs/user.class.php b/htdocs/user.class.php index 9de63befaea..558e762f963 100644 --- a/htdocs/user.class.php +++ b/htdocs/user.class.php @@ -885,7 +885,7 @@ class User extends CommonObject else { // $this->error deja positionne - dol_syslog("User::create_from_member - 2 - ".$this->error); + dol_syslog("User::create_from_member - 2 - ".$this->error, LOG_ERR); $this->db->rollback(); return $result; diff --git a/htdocs/webcal/webcal.class.php b/htdocs/webcal/webcal.class.php index 6e018df2587..427e308fa3a 100644 --- a/htdocs/webcal/webcal.class.php +++ b/htdocs/webcal/webcal.class.php @@ -33,7 +33,7 @@ */ class Webcal { - + var $localdb; var $error; var $version; /* Version string from webcalendar. Not defined in 1.0 */ @@ -41,9 +41,9 @@ class Webcal { var $duree = 0; /* Secondes */ var $texte; var $desc; - - + + /** \brief Constructeur de la classe d'interface à Webcalendar */ @@ -75,7 +75,7 @@ class Webcal { function add($user) { global $langs; - + dol_syslog("Webcal::add user=".$user->id); // Test si login webcal défini pour le user @@ -83,15 +83,15 @@ class Webcal { { $langs->load("other"); $this->error=$langs->transnoentities("ErrorWebcalLoginNotDefined","id."\">".$user->login.""); - dol_syslog("Webcal::add ERROR ".$this->error); - return -4; + dol_syslog("Webcal::add ERROR ".$this->error, LOG_ERR); + return -4; } - + $this->localdb->begin(); // Recupère l'id max+1 dans la base webcalendar $id = $this->get_next_id(); - + if ($id > 0) { $cal_id = $id; @@ -118,19 +118,19 @@ class Webcal { { $sql = "INSERT INTO webcal_entry_user (cal_id, cal_login, cal_status)"; $sql .= " VALUES ($cal_id, '$cal_create_by', 'A')"; - + $resql=$this->localdb->query($sql); if ($resql) { // OK $this->localdb->commit(); - return 1; + return 1; } else { $this->localdb->rollback(); $this->error = $this->localdb->error() . '
' .$sql; - dol_syslog("Webcal::add ERROR ".$this->error); + dol_syslog("Webcal::add ERROR ".$this->error, LOG_ERR); return -1; } } @@ -138,7 +138,7 @@ class Webcal { { $this->localdb->rollback(); $this->error = $this->localdb->error() . '
' .$sql; - dol_syslog("Webcal::add ERROR ".$this->error); + dol_syslog("Webcal::add ERROR ".$this->error, LOG_ERR); return -2; } } @@ -146,7 +146,7 @@ class Webcal { { $this->localdb->rollback(); $this->error = $this->localdb->error() . '
' .$sql; - dol_syslog("Webcal::add ERROR ".$this->error); + dol_syslog("Webcal::add ERROR ".$this->error, LOG_ERR); return -3; } } @@ -173,12 +173,12 @@ class Webcal { } } - + /** \brief Export fichier cal depuis base webcalendar \param format 'ical' or 'vcal' \param type 'event' or 'journal' - \param cachedelay Do not rebuild file if date older than cachedelay seconds + \param cachedelay Do not rebuild file if date older than cachedelay seconds \param filename Force filename \param filters Array of filters \return int <0 if error, nb of events in new file if ok @@ -186,7 +186,7 @@ class Webcal { function build_calfile($format,$type,$cachedelay,$filename,$filters) { global $conf,$langs; - + require_once (DOL_DOCUMENT_ROOT ."/lib/xcal.lib.php"); dol_syslog("webcal::build_calfile Build cal file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".sizeof($filters), LOG_DEBUG); @@ -201,22 +201,22 @@ class Webcal { if ($format == 'ical') $extension='ics'; $filename=$format.'.'.$extension; } - + create_exdir($conf->webcal->dir_temp); $outputfile=$conf->webcal->dir_temp.'/'.$filename; $result=0; - + $buildfile=true; if ($cachedelay) { // \TODO Check cache } - + if ($buildfile) { // Build event array $eventarray=array(); - + $sql = "SELECT cal_id, cal_create_by, "; $sql.= " cal_date, cal_time, cal_mod_date,"; $sql.= " cal_mod_time, cal_duration, cal_priority, cal_type, cal_access, cal_name, cal_description"; @@ -230,7 +230,7 @@ class Webcal { while ($obj=$this->localdb->fetch_object($resql)) { $qualified=true; - + // 'eid','startdate','duration','enddate','title','summary','category','email','url','desc','author' $event=array(); $event['uid']='dolibarrwebcal-'.$this->localdb->database_name.'-'.$obj->cal_id."@".$_SERVER["SERVER_NAME"]; @@ -264,7 +264,7 @@ class Webcal { if (! eregi('\/$',$url)) $url.='/'; $url.='view_entry.php?id='.$obj->cal_id; $event['url']=$url; - + if ($qualified) { $eventarray[$datestart]=$event; @@ -276,15 +276,15 @@ class Webcal { dol_syslog("webcal::build_calfile ".$this->localdb->lasterror()); return -1; } - + // Write file $title='Webcalendar events '; $desc='Webcalendar events for database '.$this->localdb->database_name.' - built by Dolibarr'; $result=build_calfile($format,$title,$desc,$eventarray,$outputfile); } - + return $result; } - + } ?>