Skip to content
Snippets Groups Projects
Commit 52c11115 authored by Regis Houssin's avatar Regis Houssin
Browse files

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

Fix: utf-8
parent cd9a893b
No related branches found
No related tags found
No related merge requests found
...@@ -43,7 +43,7 @@ class ComptaExportPoivre extends ComptaExport ...@@ -43,7 +43,7 @@ class ComptaExportPoivre extends ComptaExport
/** /**
\brief Constructeur de la class \brief Constructeur de la class
\param DB Object de base de donnes \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 ...@@ -53,12 +53,12 @@ class ComptaExportPoivre extends ComptaExport
} }
/** /**
* Agrgation 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 entres"); 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 ...@@ -71,7 +71,7 @@ class ComptaExportPoivre extends ComptaExport
for ( $i = 1 ; $i < $n ; $i++) for ( $i = 1 ; $i < $n ; $i++)
{ {
// On agrge les lignes avec le mme 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 ...@@ -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 ...@@ -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 entres"); dol_syslog("ComptaExportPoivre::Export " . sizeof($linec) . " lignes en entrees");
$this->Agregate($linec); $this->Agregate($linec);
...@@ -168,7 +168,7 @@ class ComptaExportPoivre extends ComptaExport ...@@ -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 ...@@ -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 Numro de pice $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 Opration 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 gnral // C 2 code Compte general
// D 3 code client // D 3 code client
// E 4 Intitul // E 4 Intitul
// F 5 Numro de pice // F 5 Numero de piece
// G 7 Montant // G 7 Montant
// H 8 Type opration D pour Dbit ou C pour Crdit // H 8 Type operation D pour Debit ou C pour Credit
// I Date d'chance, = la date d'opration si pas d'chance // 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 ...@@ -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]); // Numro 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 dbit $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 ...@@ -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]); // Numro 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 crdit $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 ...@@ -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 crdit $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 ...@@ -262,15 +262,15 @@ class ComptaExportPoivre extends ComptaExport
// Pour les paiements // Pour les paiements
// A Date Opration 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 gnral // C code Compte general
// D code client // D code client
// E Intitul // E Intitul
// F Numro de pice // F Numero de piece
// G Montant // G Montant
// H Type opration D pour Dbit ou C pour Crdit // H Type operation D pour Debit ou C pour Credit
// I Date d'chance, = la date d'opration si pas d'chance // 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 ...@@ -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 ngatif 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 ...@@ -296,7 +296,7 @@ class ComptaExportPoivre extends ComptaExport
$debit = "C"; $debit = "C";
$credit = "D"; $credit = "D";
if ($linep[$i][6] == 'Prlvement') if ($linep[$i][6] == 'Prelevement')
{ {
$linep[$i][6] = 'Rejet Prelevement'; $linep[$i][6] = 'Rejet Prelevement';
} }
...@@ -307,13 +307,13 @@ class ComptaExportPoivre extends ComptaExport ...@@ -307,13 +307,13 @@ class ComptaExportPoivre extends ComptaExport
$page->write_string($j,2, '5122000'); $page->write_string($j,2, '5122000');
if ($linep[$i][6] == 'Prlvement') 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]); // Numro 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 ...@@ -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]); // Numro 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]));
......
...@@ -64,21 +64,21 @@ class ComptaExportTableur extends ComptaExport ...@@ -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 Opration 040604 pour 4 juin 2004 // Date Operation 040604 pour 4 juin 2004
// VE -> ventilation // VE -> ventilation
// code Compte gnral // code Compte general
// code client // code client
// Intitul // Intitul
// Numro de pice // Numero de piece
// Montant // Montant
// Type opration D pour Dbit ou C pour Crdit // Type operation D pour Debit ou C pour Credit
// Date d'chance, = la date d'opration si pas d'chance // 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
......
...@@ -19,10 +19,10 @@ ...@@ -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 ...@@ -71,9 +71,9 @@ class Expedition extends CommonObject
} }
/** /**
* \brief Cr expdition 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 expdition cre 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 ...@@ -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� 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 ...@@ -441,7 +441,7 @@ class Expedition extends CommonObject
if (! $error) if (! $error)
{ {
// On efface le rpertoire 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 ...@@ -495,7 +495,7 @@ class Expedition extends CommonObject
/** /**
* \brief Cre un bon de livraison partir de l'expdition * \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 ...@@ -507,7 +507,7 @@ class Expedition extends CommonObject
{ {
if ($this->statut == 1) if ($this->statut == 1)
{ {
// Expdition valide // 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 ...@@ -584,7 +584,7 @@ class Expedition extends CommonObject
{ {
$this->db->commit(); $this->db->commit();
// On efface le rpertoire de pdf provisoire // On efface le r�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 ...@@ -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: rcuprer 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 ...@@ -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 ...@@ -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 ...@@ -737,8 +740,8 @@ class Expedition extends CommonObject
} }
/** /**
* \brief Initialise la facture avec valeurs fictives alatoire * \brief Initialise la facture avec valeurs fictives aleatoire
* Sert gnrer une facture pour l'aperu des modles 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 ...@@ -746,7 +749,7 @@ class Expedition extends CommonObject
dol_syslog("Expedition::initAsSpecimen"); dol_syslog("Expedition::initAsSpecimen");
// Charge tableau des id de socit 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 ...@@ -793,7 +796,7 @@ class Expedition extends CommonObject
$order=new Commande($this->db); $order=new Commande($this->db);
$order->initAsSpecimen(); $order->initAsSpecimen();
// Initialise paramtres // 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 ...@@ -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
{ {
......
...@@ -127,7 +127,7 @@ class ExportExcel extends ModeleExports ...@@ -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();
......
...@@ -627,7 +627,7 @@ class Livraison extends CommonObject ...@@ -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);
} }
......
...@@ -35,7 +35,7 @@ $year = strftime('%Y', time()); ...@@ -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);
......
...@@ -53,7 +53,7 @@ $error = 0; ...@@ -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');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment