Qual: Removed warnings

This commit is contained in:
Laurent Destailleur 2011-09-20 21:29:13 +00:00
parent 6cd38ecbb8
commit 53d8bf2f17
4 changed files with 18 additions and 54 deletions

View File

@ -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)
{

View File

@ -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);
?>

View File

@ -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()
{

View File

@ -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);
}