Fix: Assigning the return value of new by reference is deprecated

Fix: utf-8
This commit is contained in:
Regis Houssin 2009-11-12 13:33:55 +00:00
parent cd9a893bae
commit 52c111157f
7 changed files with 69 additions and 66 deletions

View File

@ -43,7 +43,7 @@ class ComptaExportPoivre extends ComptaExport
/** /**
\brief Constructeur de la class \brief Constructeur de la class
\param DB Object de base de données \param DB Object de base de donnees
\param USER Object utilisateur \param USER Object utilisateur
*/ */
function ComptaExportPoivre ($DB, $USER) function ComptaExportPoivre ($DB, $USER)
@ -53,12 +53,12 @@ class ComptaExportPoivre extends ComptaExport
} }
/** /**
* Agrégation des lignes de facture * Agregation des lignes de facture
*/ */
function Agregate($line_in) function Agregate($line_in)
{ {
dol_syslog("ComptaExportPoivre::Agregate"); dol_syslog("ComptaExportPoivre::Agregate");
dol_syslog("ComptaExportPoivre::Agregate " . sizeof($line_in) . " lignes en entrées"); dol_syslog("ComptaExportPoivre::Agregate " . sizeof($line_in) . " lignes en entrees");
$i = 0; $i = 0;
$j = 0; $j = 0;
$n = sizeof($line_in); $n = sizeof($line_in);
@ -71,7 +71,7 @@ class ComptaExportPoivre extends ComptaExport
for ( $i = 1 ; $i < $n ; $i++) for ( $i = 1 ; $i < $n ; $i++)
{ {
// On agrège les lignes avec le même code comptable // On agrege les lignes avec le meme code comptable
if ( ($line_in[$i][1] == $line_in[$i-1][1]) && ($line_in[$i][4] == $line_in[$i-1][4]) ) if ( ($line_in[$i][1] == $line_in[$i-1][1]) && ($line_in[$i][4] == $line_in[$i-1][4]) )
{ {
@ -89,7 +89,7 @@ class ComptaExportPoivre extends ComptaExport
return 0; return 0;
} }
/* /**
* *
*/ */
function Export($dir, $linec, $linep, $id=0) function Export($dir, $linec, $linep, $id=0)
@ -97,7 +97,7 @@ class ComptaExportPoivre extends ComptaExport
$error = 0; $error = 0;
dol_syslog("ComptaExportPoivre::Export"); dol_syslog("ComptaExportPoivre::Export");
dol_syslog("ComptaExportPoivre::Export " . sizeof($linec) . " lignes en entrées"); dol_syslog("ComptaExportPoivre::Export " . sizeof($linec) . " lignes en entrees");
$this->Agregate($linec); $this->Agregate($linec);
@ -168,7 +168,7 @@ class ComptaExportPoivre extends ComptaExport
$fxname = $dir . "/".$this->ref.".xls"; $fxname = $dir . "/".$this->ref.".xls";
$workbook = &new writeexcel_workbook($fxname); $workbook = new writeexcel_workbook($fxname);
$page = &$workbook->addworksheet('Export'); $page = &$workbook->addworksheet('Export');
@ -177,21 +177,21 @@ class ComptaExportPoivre extends ComptaExport
$page->set_column(2,2,9); // C $page->set_column(2,2,9); // C
$page->set_column(3,3,14); // D $page->set_column(3,3,14); // D
$page->set_column(4,4,44); // E $page->set_column(4,4,44); // E
$page->set_column(5,5,9); // F Numéro de pièce $page->set_column(5,5,9); // F Numero de piece
$page->set_column(6,6,8); // G $page->set_column(6,6,8); // G
// Pour les factures // Pour les factures
// A 0 Date Opération 040604 pour 4 juin 2004 // A 0 Date Operation 040604 pour 4 juin 2004
// B 1 VE -> ventilation // B 1 VE -> ventilation
// C 2 code Compte général // C 2 code Compte general
// D 3 code client // D 3 code client
// E 4 Intitul // E 4 Intitul
// F 5 Numéro de pièce // F 5 Numero de piece
// G 7 Montant // G 7 Montant
// H 8 Type opération D pour Débit ou C pour Crédit // H 8 Type operation D pour Debit ou C pour Credit
// I Date d'échéance, = à la date d'opération si pas d'échéance // I Date d'echeance, = a la date d'operation si pas d'echeance
// J EUR pour Monnaie en Euros // J EUR pour Monnaie en Euros
// Pour les paiements // Pour les paiements
@ -212,9 +212,9 @@ class ComptaExportPoivre extends ComptaExport
$page->write_string($j, 2, "41100000"); $page->write_string($j, 2, "41100000");
$page->write_string($j, 3, stripslashes($this->line_out[$i][2])); $page->write_string($j, 3, stripslashes($this->line_out[$i][2]));
$page->write_string($j, 4, stripslashes($this->line_out[$i][3])." Facture"); $page->write_string($j, 4, stripslashes($this->line_out[$i][3])." Facture");
$page->write_string($j, 5, $this->line_out[$i][5]); // Numéro de factur $page->write_string($j, 5, $this->line_out[$i][5]); // Numero de facture
$page->write($j, 6, price2num($this->line_out[$i][7])); $page->write($j, 6, price2num($this->line_out[$i][7]));
$page->write_string($j, 7, 'D' ); // D pour débit $page->write_string($j, 7, 'D' ); // D pour debit
$page->write_string($j, 8, strftime("%d%m%y",$this->line_out[$i][0])); $page->write_string($j, 8, strftime("%d%m%y",$this->line_out[$i][0]));
$j++; $j++;
@ -225,9 +225,9 @@ class ComptaExportPoivre extends ComptaExport
$page->write_string($j, 2, '4457119'); $page->write_string($j, 2, '4457119');
$page->write_string($j, 4, stripslashes($this->line_out[$i][3])." Facture"); $page->write_string($j, 4, stripslashes($this->line_out[$i][3])." Facture");
$page->write_string($j, 5, $this->line_out[$i][5]); // Numéro de facture $page->write_string($j, 5, $this->line_out[$i][5]); // Numero de facture
$page->write($j, 6, price2num($this->line_out[$i][6])); // Montant de TVA $page->write($j, 6, price2num($this->line_out[$i][6])); // Montant de TVA
$page->write_string($j, 7, 'C'); // C pour crédit $page->write_string($j, 7, 'C'); // C pour credit
$page->write_string($j, 8, strftime("%d%m%y",$this->line_out[$i][0])); $page->write_string($j, 8, strftime("%d%m%y",$this->line_out[$i][0]));
$oldfacture = $this->line_out[$i][1]; $oldfacture = $this->line_out[$i][1];
@ -240,7 +240,7 @@ class ComptaExportPoivre extends ComptaExport
$page->write_string($j, 4, $this->line_out[$i][3]." Facture"); $page->write_string($j, 4, $this->line_out[$i][3]." Facture");
$page->write_string($j, 5, $this->line_out[$i][5]); $page->write_string($j, 5, $this->line_out[$i][5]);
$page->write($j, 6, price2num(round($this->line_out[$i][8], 2))); $page->write($j, 6, price2num(round($this->line_out[$i][8], 2)));
$page->write_string($j, 7, 'C'); // C pour crédit $page->write_string($j, 7, 'C'); // C pour credit
$page->write_string($j, 8, strftime("%d%m%y",$this->line_out[$i][0])); $page->write_string($j, 8, strftime("%d%m%y",$this->line_out[$i][0]));
$j++; $j++;
@ -262,15 +262,15 @@ class ComptaExportPoivre extends ComptaExport
// Pour les paiements // Pour les paiements
// A Date Opération 040604 pour 4 juin 2004 // A Date Operation 040604 pour 4 juin 2004
// B CE -> caisse d'epargne // B CE -> caisse d'epargne
// C code Compte général // C code Compte general
// D code client // D code client
// E Intitul // E Intitul
// F Numéro de pièce // F Numero de piece
// G Montant // G Montant
// H Type opération D pour Débit ou C pour Crédit // H Type operation D pour Debit ou C pour Credit
// I Date d'échéance, = à la date d'opération si pas d'échéance // I Date d'echeance, = a la date d'operation si pas d'echeance
// J EUR pour Monnaie en Euros // J EUR pour Monnaie en Euros
$i = 0; $i = 0;
@ -282,7 +282,7 @@ class ComptaExportPoivre extends ComptaExport
for ( $i = 0 ; $i < $n ; $i++) for ( $i = 0 ; $i < $n ; $i++)
{ {
/* /*
* En cas de rejet ou paiement en négatif on inverse debit et credit * En cas de rejet ou paiement en negatif on inverse debit et credit
* *
* *
*/ */
@ -296,7 +296,7 @@ class ComptaExportPoivre extends ComptaExport
$debit = "C"; $debit = "C";
$credit = "D"; $credit = "D";
if ($linep[$i][6] == 'Prélèvement') if ($linep[$i][6] == 'Prelevement')
{ {
$linep[$i][6] = 'Rejet Prelevement'; $linep[$i][6] = 'Rejet Prelevement';
} }
@ -307,13 +307,13 @@ class ComptaExportPoivre extends ComptaExport
$page->write_string($j,2, '5122000'); $page->write_string($j,2, '5122000');
if ($linep[$i][6] == 'Prélèvement') if ($linep[$i][6] == 'Prelevement')
{ {
$linep[$i][6] = 'Prelevement'; $linep[$i][6] = 'Prelevement';
} }
$page->write_string($j,4, stripslashes($linep[$i][3])." ".stripslashes($linep[$i][6])); // $page->write_string($j,4, stripslashes($linep[$i][3])." ".stripslashes($linep[$i][6])); //
$page->write_string($j,5, $linep[$i][7]); // Numéro de facture $page->write_string($j,5, $linep[$i][7]); // Numero de facture
$page->write($j,6, price2num(round(abs($linep[$i][5]), 2))); // Montant de la ligne $page->write($j,6, price2num(round(abs($linep[$i][5]), 2))); // Montant de la ligne
$page->write_string($j,7,$debit); $page->write_string($j,7,$debit);
@ -328,7 +328,7 @@ class ComptaExportPoivre extends ComptaExport
$page->write_string($j,2, '41100000'); $page->write_string($j,2, '41100000');
$page->write_string($j,3, $linep[$i][2]); $page->write_string($j,3, $linep[$i][2]);
$page->write_string($j,4, stripslashes($linep[$i][3])." ".stripslashes($linep[$i][6])); // $page->write_string($j,4, stripslashes($linep[$i][3])." ".stripslashes($linep[$i][6])); //
$page->write_string($j,5, $linep[$i][7]); // Numéro de facture $page->write_string($j,5, $linep[$i][7]); // Numero de facture
$page->write($j,6, price2num(round(abs($linep[$i][5]), 2))); // Montant de la ligne $page->write($j,6, price2num(round(abs($linep[$i][5]), 2))); // Montant de la ligne
$page->write_string($j,7, $credit); $page->write_string($j,7, $credit);
$page->write_string($j,8, strftime("%d%m%y",$linep[$i][0])); $page->write_string($j,8, strftime("%d%m%y",$linep[$i][0]));

View File

@ -64,21 +64,21 @@ class ComptaExportTableur extends ComptaExport
//$fname = $dir . "/tmp/toto.xls"; DEBUG DEBUG //$fname = $dir . "/tmp/toto.xls"; DEBUG DEBUG
$fname = "/tmp/toto.xls"; $fname = "/tmp/toto.xls";
$workbook = &new writeexcel_workbook($fname); $workbook = new writeexcel_workbook($fname);
$worksheet = &$workbook->addworksheet(); $worksheet = &$workbook->addworksheet();
// Pour les factures // Pour les factures
// Date Opération 040604 pour 4 juin 2004 // Date Operation 040604 pour 4 juin 2004
// VE -> ventilation // VE -> ventilation
// code Compte général // code Compte general
// code client // code client
// Intitul // Intitul
// Numéro de pièce // Numero de piece
// Montant // Montant
// Type opération D pour Débit ou C pour Crédit // Type operation D pour Debit ou C pour Credit
// Date d'échéance, = à la date d'opération si pas d'échéance // Date d'echeance, = a la date d'operation si pas d'echeance
// EUR pour Monnaie en Euros // EUR pour Monnaie en Euros
// Pour les paiements // Pour les paiements

View File

@ -19,10 +19,10 @@
*/ */
/** /**
\file htdocs/expedition/expedition.class.php * \file htdocs/expedition/expedition.class.php
\ingroup expedition * \ingroup expedition
\brief Fichier de la classe de gestion des expeditions * \brief Fichier de la classe de gestion des expeditions
\version $Id$ * \version $Id$
*/ */
require_once(DOL_DOCUMENT_ROOT."/commonobject.class.php"); require_once(DOL_DOCUMENT_ROOT."/commonobject.class.php");
@ -71,9 +71,9 @@ class Expedition extends CommonObject
} }
/** /**
* \brief Créé expédition en base * \brief Cree expedition en base
* \param user Objet du user qui cré * \param user Objet du user qui cree
* \return int <0 si erreur, id expédition créée si ok * \return int <0 si erreur, id expedition creee si ok
*/ */
function create($user) function create($user)
{ {
@ -421,7 +421,7 @@ class Expedition extends CommonObject
{ {
$mouvS = new MouvementStock($this->db); $mouvS = new MouvementStock($this->db);
// We decrement stock of product (and sub-products) // We decrement stock of product (and sub-products)
$entrepot_id = "1"; // TODO ajouter possibilité de choisir l'entrepot $entrepot_id = "1"; // TODO ajouter possibilit<EFBFBD> de choisir l'entrepot
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice); $result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
} }
@ -441,7 +441,7 @@ class Expedition extends CommonObject
if (! $error) if (! $error)
{ {
// On efface le répertoire de pdf provisoire // On efface le repertoire de pdf provisoire
$expeditionref = dol_sanitizeFileName($this->ref); $expeditionref = dol_sanitizeFileName($this->ref);
if ($conf->expedition->dir_output) if ($conf->expedition->dir_output)
{ {
@ -495,7 +495,7 @@ class Expedition extends CommonObject
/** /**
* \brief Crée un bon de livraison à partir de l'expédition * \brief Cree un bon de livraison a partir de l'expedition
* \param user Utilisateur * \param user Utilisateur
* \return int <0 si ko, >=0 si ok * \return int <0 si ko, >=0 si ok
*/ */
@ -507,7 +507,7 @@ class Expedition extends CommonObject
{ {
if ($this->statut == 1) if ($this->statut == 1)
{ {
// Expédition validée // Expedition validee
include_once(DOL_DOCUMENT_ROOT."/livraison/livraison.class.php"); include_once(DOL_DOCUMENT_ROOT."/livraison/livraison.class.php");
$livraison = new Livraison($this->db); $livraison = new Livraison($this->db);
$result=$livraison->create_from_sending($user, $this->id); $result=$livraison->create_from_sending($user, $this->id);
@ -584,7 +584,7 @@ class Expedition extends CommonObject
{ {
$this->db->commit(); $this->db->commit();
// On efface le répertoire de pdf provisoire // On efface le r<EFBFBD>pertoire de pdf provisoire
$expref = dol_sanitizeFileName($this->ref); $expref = dol_sanitizeFileName($this->ref);
if ($conf->expedition->dir_output) if ($conf->expedition->dir_output)
{ {
@ -630,22 +630,25 @@ class Expedition extends CommonObject
} }
/* /**
* Lit le document associé * Lit le document associe
* *
*/ */
function fetch_object() function fetch_object()
{ {
$object = $this->origin; $object = $this->origin;
$class = ucfirst($object); $class = ucfirst($object);
$this->$object = & new $class($this->db); $this->$object = new $class($this->db);
$this->$object->fetch($this->origin_id); $this->$object->fetch($this->origin_id);
} }
/**
*
*
*/
function fetch_lines() function fetch_lines()
{ {
//Todo: récupérer les champs du document associé a part // TODO: recuperer les champs du document associe a part
$sql = "SELECT cd.rowid, cd.fk_product, cd.description, cd.qty as qty_asked"; $sql = "SELECT cd.rowid, cd.fk_product, cd.description, cd.qty as qty_asked";
$sql.= ", ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot"; $sql.= ", ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot";
@ -696,8 +699,8 @@ class Expedition extends CommonObject
} }
/** /**
* \brief Retourne le libellé du statut d'une expedition * \brief Retourne le libelle du statut d'une expedition
* \return string Libellé * \return string Libelle
*/ */
function getLibStatut($mode=0) function getLibStatut($mode=0)
{ {
@ -705,10 +708,10 @@ class Expedition extends CommonObject
} }
/** /**
* \brief Renvoi le libellé d'un statut donné * \brief Renvoi le libelle d'un statut donne
* \param statut Id statut * \param statut Id statut
* \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Pict * \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* \return string Libellé * \return string Libelle
*/ */
function LibStatut($statut,$mode) function LibStatut($statut,$mode)
{ {
@ -737,8 +740,8 @@ class Expedition extends CommonObject
} }
/** /**
* \brief Initialise la facture avec valeurs fictives aléatoire * \brief Initialise la facture avec valeurs fictives aleatoire
* Sert à générer une facture pour l'aperu des modèles ou dem * Sert a generer une facture pour l'aperu des modeles ou dem
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {
@ -746,7 +749,7 @@ class Expedition extends CommonObject
dol_syslog("Expedition::initAsSpecimen"); dol_syslog("Expedition::initAsSpecimen");
// Charge tableau des id de société socids // Charge tableau des id de societe socids
$socids = array(); $socids = array();
$sql = "SELECT rowid"; $sql = "SELECT rowid";
@ -793,7 +796,7 @@ class Expedition extends CommonObject
$order=new Commande($this->db); $order=new Commande($this->db);
$order->initAsSpecimen(); $order->initAsSpecimen();
// Initialise paramètres // Initialise parametres
$this->id=0; $this->id=0;
$this->ref = 'SPECIMEN'; $this->ref = 'SPECIMEN';
$this->specimen=1; $this->specimen=1;
@ -895,8 +898,8 @@ class Expedition extends CommonObject
/** /**
\class ExpeditionLigne * \class ExpeditionLigne
\brief Classe de gestion des lignes de bons d'expedition * \brief Classe de gestion des lignes de bons d'expedition
*/ */
class ExpeditionLigne class ExpeditionLigne
{ {

View File

@ -127,7 +127,7 @@ class ExportExcel extends ModeleExports
$ret=1; $ret=1;
$outputlangs->load("exports"); $outputlangs->load("exports");
$this->workbook = &new writeexcel_workbookbig($file); $this->workbook = new writeexcel_workbookbig($file);
$this->workbook->set_tempdir($conf->export->dir_temp); // Set temporary directory $this->workbook->set_tempdir($conf->export->dir_temp); // Set temporary directory
$this->workbook->set_sheetname($outputlangs->trans("Sheet")); $this->workbook->set_sheetname($outputlangs->trans("Sheet"));
$this->worksheet = &$this->workbook->addworksheet(); $this->worksheet = &$this->workbook->addworksheet();

View File

@ -627,7 +627,7 @@ class Livraison extends CommonObject
{ {
$object = $this->origin; $object = $this->origin;
$class = ucfirst($this->origin); $class = ucfirst($this->origin);
$this->$object = & new $class($this->db); $this->$object = new $class($this->db);
$this->$object->fetch($this->origin_id); $this->$object->fetch($this->origin_id);
} }

View File

@ -35,7 +35,7 @@ $year = strftime('%Y', time());
$fname = "/tmp/droits-nouveautes-".$year.".xls"; $fname = "/tmp/droits-nouveautes-".$year.".xls";
$workbook = &new writeexcel_workbook($fname); $workbook = new writeexcel_workbook($fname);
$page = &$workbook->addworksheet("Droits nouveautes ".$year); $page = &$workbook->addworksheet("Droits nouveautes ".$year);

View File

@ -53,7 +53,7 @@ $error = 0;
$fname = DOL_DATA_ROOT.'/export-contacts.xls'; $fname = DOL_DATA_ROOT.'/export-contacts.xls';
$workbook = &new writeexcel_workbook($fname); $workbook = new writeexcel_workbook($fname);
$page = &$workbook->addworksheet('Export Dolibarr'); $page = &$workbook->addworksheet('Export Dolibarr');