From 53d8bf2f179a1feb32bd919fb8e53fa8327b5c66 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2011 21:29:13 +0000 Subject: [PATCH] Qual: Removed warnings --- htdocs/imports/class/import.class.php | 15 ++++----- htdocs/imports/emptyexample.php | 2 +- htdocs/societe/class/client.class.php | 47 +++++---------------------- htdocs/societe/notify/fiche.php | 8 ++--- 4 files changed, 18 insertions(+), 54 deletions(-) diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index 1676ba73de1..af0ae64074a 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -62,7 +62,7 @@ class Import { global $langs,$conf; - dol_syslog("Import::load_arrays user=".$user->id." filter=".$filter); + dol_syslog(get_class($this)."::load_arrays user=".$user->id." filter=".$filter); $var=true; $i=0; @@ -168,19 +168,18 @@ class Import * Build an import example file. * Arrays this->array_export_xxx are already loaded for required datatoexport * - * @param User $user User qui exporte - * @param string $model Modele d'export + * @param string $model Name of import engine ('csv', ...) * @param string $headerlinefields Array of values for first line of example file * @param string $contentlinevalues Array of values for content line of example file * @return string <0 if KO, >0 if OK */ - function build_example_file($user, $model, $headerlinefields, $contentlinevalues) + function build_example_file($model, $headerlinefields, $contentlinevalues) { global $conf,$langs; $indice=0; - dol_syslog("Import::build_example_file ".$model); + dol_syslog(get_class($this)."::build_example_file ".$model); // Creation de la classe d'import du model Import_XXX $dir = DOL_DOCUMENT_ROOT . "/includes/modules/import/"; @@ -231,7 +230,7 @@ class Import $sql.= ')'; $sql.= " VALUES (".($user->id > 0 ? $user->id : 0).", '".$this->db->escape($this->model_name)."', '".$this->datatoimport."', '".$this->hexa."')"; - dol_syslog("Import::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -242,7 +241,7 @@ class Import { $this->error=$this->db->lasterror(); $this->errno=$this->db->lasterrno(); - dol_syslog("Import::create error ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::create error ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -260,7 +259,7 @@ class Import $sql.= ' FROM '.MAIN_DB_PREFIX.'import_model as em'; $sql.= ' WHERE em.rowid = '.$id; - dol_syslog("Import::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/imports/emptyexample.php b/htdocs/imports/emptyexample.php index 2acf78e557a..1421d116343 100644 --- a/htdocs/imports/emptyexample.php +++ b/htdocs/imports/emptyexample.php @@ -86,6 +86,6 @@ foreach($fieldstarget as $code=>$label) //var_dump($headerlinefields); //var_dump($contentlinevalues); -print $objimport->build_example_file($user,$format,$headerlinefields,$contentlinevalues); +print $objimport->build_example_file($format,$headerlinefields,$contentlinevalues); ?> diff --git a/htdocs/societe/class/client.class.php b/htdocs/societe/class/client.class.php index 6670540d1a3..1d8d9c57213 100644 --- a/htdocs/societe/class/client.class.php +++ b/htdocs/societe/class/client.class.php @@ -30,55 +30,24 @@ include_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); */ class Client extends Societe { - var $db; - + var $nb; /** - * \brief Constructeur de la classe - * \param DB handler acces base de donnees - * \param id id societe (0 par defaut) + * Constructor + * + * @param DoliDB $DB Database handler */ - function Client($DB, $id=0) + function Client($DB) { global $config; $this->db = $DB; - $this->id = $id; - $this->factures = array(); - - return 0; } - function read_factures() - { - $sql = "SELECT rowid, facnumber"; - $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql .= " WHERE f.fk_soc = ".$this->id; - $sql .= " ORDER BY datef DESC"; - - $i = 0; - $resql = $this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - - while ($i < $num ) - { - $row = $this->db->fetch_row($resql); - - $this->factures[$i][0] = $row[0]; - $this->factures[$i][1] = $row[1]; - - $i++; - } - } - return $result; - } - - /** - * \brief Charge indicateurs this->nb de tableaux de bord - * \return int <0 si ko, >0 si ok + * Load indicators into this->nb for board + * + * @return int <0 if KO, >0 if OK */ function load_state_board() { diff --git a/htdocs/societe/notify/fiche.php b/htdocs/societe/notify/fiche.php index 13f9dd0dcc0..0b4870d91f2 100644 --- a/htdocs/societe/notify/fiche.php +++ b/htdocs/societe/notify/fiche.php @@ -86,11 +86,7 @@ if ($action == 'add') $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_soc, fk_contact, fk_action)"; $sql .= " VALUES ('".$db->idate($now)."',".$socid.",".$contactid.",".$actionid.")"; - if ($db->query($sql)) - { - - } - else + if (! $db->query($sql)) { $error++; dol_print_error($db); @@ -115,7 +111,7 @@ if ($action == 'add') // Remove a notification if ($action == 'delete') { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".$_GET["actid"].";"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".$_GET["actid"]; $db->query($sql); }