Fix: Removed warnings

This commit is contained in:
Laurent Destailleur 2011-09-21 23:28:01 +00:00
parent d61abff915
commit 058de48e1d

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
@ -189,7 +189,7 @@ class ActionComm extends CommonObject
$sql.= $conf->entity;
$sql.= ")";
dol_syslog(get_class($this)."::add sql=".$sql);
dol_syslog("ActionComm::add sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
@ -219,9 +219,7 @@ class ActionComm extends CommonObject
/**
* Charge l'objet action depuis la base
*
* @param int $id id de l'action a recuperer
* @return int <0 if KO, >0 if OK
* @param id id de l'action a recuperer
*/
function fetch($id)
{
@ -249,7 +247,7 @@ class ActionComm extends CommonObject
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
$sql.= " WHERE a.id=".$id." AND a.fk_action=c.id";
dol_syslog(get_class($this)."::fetch sql=".$sql);
dol_syslog("ActionComm::fetch sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
@ -307,15 +305,14 @@ class ActionComm extends CommonObject
/**
* Supprime l'action de la base
*
* @return int <0 if KO, >0 if OK
* @return int <0 si ko, >0 si ok
*/
function delete()
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm";
$sql.= " WHERE id=".$this->id;
dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
dol_syslog("ActionComm::delete sql=".$sql, LOG_DEBUG);
if ($this->db->query($sql))
{
return 1;
@ -330,8 +327,7 @@ class ActionComm extends CommonObject
/**
* Met a jour l'action en base.
* Si percentage = 100, on met a jour date 100%
*
* @return int <0 if KO, >0 if OK
* @return int <0 si ko, >0 si ok
*/
function update($user)
{
@ -376,7 +372,7 @@ class ActionComm extends CommonObject
$sql.= ", fk_user_done=".($this->userdone->id > 0 ? "'".$this->userdone->id."'":"null");
$sql.= " WHERE id=".$this->id;
dol_syslog(get_class($this)."::update sql=".$sql);
dol_syslog("ActionComm::update sql=".$sql);
if ($this->db->query($sql))
{
return 1;
@ -384,7 +380,7 @@ class ActionComm extends CommonObject
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR);
dol_syslog("ActionComm::update ".$this->error,LOG_ERR);
return -1;
}
}
@ -411,7 +407,7 @@ class ActionComm extends CommonObject
}
if (! empty($filter)) $sql.= $filter;
dol_syslog(get_class($this)."::getActions sql=".$sql);
dol_syslog("ActionComm::getActions sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
@ -480,9 +476,7 @@ class ActionComm extends CommonObject
/**
* Charge les informations d'ordre info dans l'objet facture
*
* @param int $id Id de la facture a charger
* @return void
* @param id Id de la facture a charger
*/
function info($id)
{
@ -495,7 +489,7 @@ class ActionComm extends CommonObject
$sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a';
$sql.= ' WHERE a.id = '.$id;
dol_syslog(get_class($this)."::info sql=".$sql);
dol_syslog("ActionComm::info sql=".$sql);
$result=$this->db->query($sql);
if ($result)
{
@ -530,7 +524,6 @@ class ActionComm extends CommonObject
/**
* Return label of status
*
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @param hidenastatus 1=Show nothing if status is "Not applicable"
* @return string String with status
@ -542,7 +535,6 @@ class ActionComm extends CommonObject
/**
* Return label of action status
*
* @param percent Percent
* @param mode 0=Long label, 1=Short label, 2=Picto+Short label, 3=Picto, 4=Picto+Short label, 5=Short label+Picto, 6=Very short label+Picto
* @param hidenastatus 1=Show nothing if status is "Not applicable"
@ -653,7 +645,6 @@ class ActionComm extends CommonObject
/**
* Export events from database into a cal file.
*
* @param format 'vcal', 'ical/ics', 'rss'
* @param type 'event' or 'journal'
* @param cachedelay Do not rebuild file if date older than cachedelay seconds
@ -668,7 +659,7 @@ class ActionComm extends CommonObject
require_once (DOL_DOCUMENT_ROOT ."/lib/xcal.lib.php");
require_once (DOL_DOCUMENT_ROOT ."/lib/date.lib.php");
dol_syslog(get_class($this)."::build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".count($filters), LOG_DEBUG);
dol_syslog("ActionComm::build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".count($filters), LOG_DEBUG);
// Check parameters
if (empty($format)) return -1;
@ -698,7 +689,7 @@ class ActionComm extends CommonObject
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
if (dol_filemtime($outputfile) > ($nowgmt - $cachedelay))
{
dol_syslog(get_class($this)."::build_exportfile file ".$outputfile." is not older than now - cachedelay (".$nowgmt." - ".$cachedelay."). Build is canceled");
dol_syslog("ActionComm::build_exportfile file ".$outputfile." is not older than now - cachedelay (".$nowgmt." - ".$cachedelay."). Build is canceled");
$buildfile = false;
}
}
@ -772,7 +763,7 @@ class ActionComm extends CommonObject
$sql.= " ORDER by datep";
//print $sql;exit;
dol_syslog(get_class($this)."::build_exportfile select events sql=".$sql);
dol_syslog("ActionComm::build_exportfile select events sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
@ -818,7 +809,7 @@ class ActionComm extends CommonObject
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::build_exportfile ".$this->db->lasterror(), LOG_ERR);
dol_syslog("ActionComm::build_exportfile ".$this->db->lasterror(), LOG_ERR);
return -1;
}
@ -857,14 +848,14 @@ class ActionComm extends CommonObject
if (rename($outputfiletmp,$outputfile)) $result=1;
else
{
dol_syslog(get_class($this)."::build_exportfile failed to rename ".$outputfiletmp." to ".$outputfile, LOG_ERR);
dol_syslog("ActionComm::build_exportfile failed to rename ".$outputfiletmp." to ".$outputfile, LOG_ERR);
dol_delete_file($outputfiletmp,0,1);
$result=-1;
}
}
else
{
dol_syslog(get_class($this)."::build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR);
dol_syslog("ActionComm::build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR);
dol_delete_file($outputfiletmp,0,1);
$langs->load("errors");
$this->error=$langs->trans("ErrorFailToCreateFile",$outputfile);