>
diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php
index 0f1e12348ba..9009e708f09 100644
--- a/htdocs/core/class/translate.class.php
+++ b/htdocs/core/class/translate.class.php
@@ -229,11 +229,11 @@ class Translate {
{
if ($usecachekey) $tabtranslatedomain=array(); // To save lang content in cache
- while ($ligne = fgets($fp,4096)) // Ex: Need 225ms for all fgets on all lang file for Third party page. Same speed than file_get_contents
+ while ($line = fgets($fp,4096)) // Ex: Need 225ms for all fgets on all lang file for Third party page. Same speed than file_get_contents
{
- if ($ligne[0] != "\n" && $ligne[0] != " " && $ligne[0] != "#")
+ if ($line[0] != "\n" && $line[0] != " " && $line[0] != "#")
{
- $tab=explode('=',$ligne,2);
+ $tab=explode('=',$line,2);
$key=trim($tab[0]);
//print "Domain=$domain, found a string for $tab[0] with value $tab[1] ";
if (empty($this->tab_translate[$key]) && isset($tab[1]))
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index b59c0a34e14..9fdf688dfa5 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -50,7 +50,6 @@ class Expedition extends CommonObject
var $modelpdf;
var $origin;
var $origin_id;
- var $lignes=array(); // TODO deprecated
var $lines=array();
var $expedition_method_id;
var $statut;
@@ -77,7 +76,7 @@ class Expedition extends CommonObject
function Expedition($DB)
{
$this->db = $DB;
- $this->lignes = array();
+ $this->lines = array();
$this->products = array();
// List of long language codes for status
@@ -158,9 +157,9 @@ class Expedition extends CommonObject
if ($this->db->query($sql))
{
// Insertion des lignes
- for ($i = 0 ; $i < sizeof($this->lignes) ; $i++)
+ for ($i = 0 ; $i < sizeof($this->lines) ; $i++)
{
- if (! $this->create_line($this->lignes[$i]->entrepot_id, $this->lignes[$i]->origin_line_id, $this->lignes[$i]->qty) > 0)
+ if (! $this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty) > 0)
{
$error++;
}
@@ -410,9 +409,9 @@ class Expedition extends CommonObject
dol_syslog("Expedition::valid movement index ".$i);
$obj = $this->db->fetch_object($resql);
- if ($this->lignes[$i]->fk_product > 0 && $this->lignes[$i]->product_type == 0)
+ if ($this->lines[$i]->fk_product > 0 && $this->lines[$i]->product_type == 0)
{
- //var_dump($this->lignes[$i]);
+ //var_dump($this->lines[$i]);
$mouvS = new MouvementStock($this->db);
// We decrement stock of product (and sub-products)
// We use warehouse selected for each line
@@ -529,14 +528,14 @@ class Expedition extends CommonObject
*/
function addline( $entrepot_id, $id, $qty )
{
- $num = sizeof($this->lignes);
+ $num = sizeof($this->lines);
$line = new ExpeditionLigne($this->db);
$line->entrepot_id = $entrepot_id;
$line->origin_line_id = $id;
$line->qty = $qty;
- $this->lignes[$num] = $line;
+ $this->lines[$num] = $line;
}
/**
@@ -783,7 +782,6 @@ class Expedition extends CommonObject
$line->volume = $obj->volume;
$line->volume_units = $obj->volume_units;
- $this->lignes[$i] = $line; // TODO deprecated
$this->lines[$i] = $line;
$i++;
@@ -920,15 +918,15 @@ class Expedition extends CommonObject
$xnbp = 0;
while ($xnbp < $nbp)
{
- $ligne=new ExpeditionLigne($this->db);
- $ligne->desc=$langs->trans("Description")." ".$xnbp;
- $ligne->libelle=$langs->trans("Description")." ".$xnbp;
- $ligne->qty=10;
- $ligne->qty_asked=5;
- $ligne->qty_shipped=4;
- $ligne->fk_product=$this->commande->lignes[$xnbp]->fk_product;
+ $line=new ExpeditionLigne($this->db);
+ $line->desc=$langs->trans("Description")." ".$xnbp;
+ $line->libelle=$langs->trans("Description")." ".$xnbp;
+ $line->qty=10;
+ $line->qty_asked=5;
+ $line->qty_shipped=4;
+ $line->fk_product=$this->commande->lines[$xnbp]->fk_product;
- $this->lignes[]=$ligne;
+ $this->lines[]=$line;
$xnbp++;
}
diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php
index 57b194d35aa..44aabdc8363 100644
--- a/htdocs/expedition/fiche.php
+++ b/htdocs/expedition/fiche.php
@@ -98,7 +98,7 @@ if ($_POST["action"] == 'add')
$expedition->tracking_number = $_POST["tracking_number"];
//var_dump($_POST);exit;
- for ($i = 0 ; $i < sizeof($object->lignes) ; $i++)
+ for ($i = 0 ; $i < sizeof($object->lines) ; $i++)
{
$qty = "qtyl".$i;
if ($_POST[$qty] > 0)
@@ -447,8 +447,8 @@ if ($_GET["action"] == 'create')
*/
print '
';
- //$lignes = $object->fetch_lines(1);
- $numAsked = sizeof($object->lignes);
+ //$lines = $object->fetch_lines(1);
+ $numAsked = sizeof($object->lines);
/* Lecture des expeditions deja effectuees */
$object->loadExpeditions();
@@ -654,8 +654,8 @@ else
dol_print_error($db,$expedition->error);
exit -1;
}
- $lignes = $expedition->lignes;
- $num_prod = sizeof($lignes);
+ $lines = $expedition->lines;
+ $num_prod = sizeof($lines);
if ($expedition->id > 0)
{
@@ -723,30 +723,30 @@ else
{
$weightUnit=0;
$volumeUnit=0;
- if (! empty($lignes[$i]->weight_units)) $weightUnit = $lignes[$i]->weight_units;
- if (! empty($lignes[$i]->volume_units)) $volumeUnit = $lignes[$i]->volume_units;
+ if (! empty($lines[$i]->weight_units)) $weightUnit = $lines[$i]->weight_units;
+ if (! empty($lines[$i]->volume_units)) $volumeUnit = $lines[$i]->volume_units;
// TODO Use a function addvalueunits(val1,unit1,val2,unit2)=>(val,unit)
- if ($lignes[$i]->weight_units < 50)
+ if ($lines[$i]->weight_units < 50)
{
$trueWeightUnit=pow(10,$weightUnit);
- $totalWeight += $lignes[$i]->weight*$lignes[$i]->qty_shipped*$trueWeightUnit;
+ $totalWeight += $lines[$i]->weight*$lines[$i]->qty_shipped*$trueWeightUnit;
}
else
{
$trueWeightUnit=$weightUnit;
- $totalWeight += $lignes[$i]->weight*$lignes[$i]->qty_shipped;
+ $totalWeight += $lines[$i]->weight*$lines[$i]->qty_shipped;
}
- if ($lignes[$i]->volume_units < 50)
+ if ($lines[$i]->volume_units < 50)
{
- //print $lignes[$i]->volume."x".$lignes[$i]->volume_units."x".($lignes[$i]->volume_units < 50)."x".$volumeUnit;
+ //print $lines[$i]->volume."x".$lines[$i]->volume_units."x".($lines[$i]->volume_units < 50)."x".$volumeUnit;
$trueVolumeUnit=pow(10,$volumeUnit);
- //print $lignes[$i]->volume;
- $totalVolume += $lignes[$i]->volume*$lignes[$i]->qty_shipped*$trueVolumeUnit;
+ //print $lines[$i]->volume;
+ $totalVolume += $lines[$i]->volume*$lines[$i]->qty_shipped*$trueVolumeUnit;
}
else
{
$trueVolumeUnit=$volumeUnit;
- $totalVolume += $lignes[$i]->volume*$lignes[$i]->qty_shipped;
+ $totalVolume += $lines[$i]->volume*$lines[$i]->qty_shipped;
}
}
$totalVolume=$totalVolume;
@@ -966,64 +966,64 @@ else
print "";
// Predefined product or service
- if ($lignes[$i]->fk_product > 0)
+ if ($lines[$i]->fk_product > 0)
{
print '';
// Affiche ligne produit
- $text = '';
- if ($lignes[$i]->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service');
+ $text = '';
+ if ($lines[$i]->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service');
else $text.= img_object($langs->trans('ShowProduct'),'product');
- $text.= ' '.$lignes[$i]->ref.'';
- $text.= ' - '.$lignes[$i]->label;
- $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($lignes[$i]->description));
+ $text.= ' '.$lines[$i]->ref.'';
+ $text.= ' - '.$lines[$i]->label;
+ $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($lines[$i]->description));
//print $description;
print $html->textwithtooltip($text,$description,3,'','',$i);
- print_date_range($lignes[$i]->date_start,$lignes[$i]->date_end);
+ print_date_range($lines[$i]->date_start,$lines[$i]->date_end);
if ($conf->global->PRODUIT_DESC_IN_FORM)
{
- print ($lignes[$i]->description && $lignes[$i]->description!=$lignes[$i]->product)?' '.dol_htmlentitiesbr($lignes[$i]->description):'';
+ print ($lines[$i]->description && $lines[$i]->description!=$lines[$i]->product)?' '.dol_htmlentitiesbr($lines[$i]->description):'';
}
}
else
{
print " | ";
- if ($lignes[$i]->fk_product_type==1) $text = img_object($langs->trans('Service'),'service');
+ if ($lines[$i]->fk_product_type==1) $text = img_object($langs->trans('Service'),'service');
else $text = img_object($langs->trans('Product'),'product');
- print $text.' '.nl2br($lignes[$i]->description);
- print_date_range($lignes[$i]->date_start,$lignes[$i]->date_end);
+ print $text.' '.nl2br($lines[$i]->description);
+ print_date_range($lines[$i]->date_start,$lines[$i]->date_end);
print " | \n";
}
// Qte commande
- print ''.$lignes[$i]->qty_asked.' | ';
+ print ''.$lines[$i]->qty_asked.' | ';
// Qte a expedier ou expedier
- print ''.$lignes[$i]->qty_shipped.' | ';
+ print ''.$lines[$i]->qty_shipped.' | ';
// Weight
print '';
- if ($lignes[$i]->fk_product_type == 0) print $lignes[$i]->weight*$lignes[$i]->qty_shipped.' '.measuring_units_string($lignes[$i]->weight_units,"weight");
+ if ($lines[$i]->fk_product_type == 0) print $lines[$i]->weight*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->weight_units,"weight");
else print ' ';
print ' | ';
// Volume
print '';
- if ($lignes[$i]->fk_product_type == 0) print $lignes[$i]->volume*$lignes[$i]->qty_shipped.' '.measuring_units_string($lignes[$i]->volume_units,"volume");
+ if ($lines[$i]->fk_product_type == 0) print $lines[$i]->volume*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->volume_units,"volume");
else print ' ';
print ' | ';
// Size
- //print ''.$lignes[$i]->volume*$lignes[$i]->qty_shipped.' '.measuring_units_string($lignes[$i]->volume_units,"volume").' | ';
+ //print ''.$lines[$i]->volume*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->volume_units,"volume").' | ';
// Entrepot source
if ($conf->stock->enabled)
{
print '';
- if ($lignes[$i]->entrepot_id > 0)
+ if ($lines[$i]->entrepot_id > 0)
{
$entrepot = new Entrepot($db);
- $entrepot->fetch($lignes[$i]->entrepot_id);
+ $entrepot->fetch($lines[$i]->entrepot_id);
print $entrepot->getNomUrl(1);
}
print ' | ';
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index b21040cdba7..ef80f05f3e9 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -57,7 +57,7 @@ class Fichinter extends CommonObject
var $fk_project;
var $modelpdf;
- var $lignes = array();
+ var $lines = array();
/**
* \brief Constructeur de la classe
@@ -674,14 +674,14 @@ class Fichinter extends CommonObject
$this->db->begin();
// Insertion ligne
- $ligne=new FichinterLigne($this->db);
+ $line=new FichinterLigne($this->db);
- $ligne->fk_fichinter = $fichinterid;
- $ligne->desc = $desc;
- $ligne->datei = $date_intervention;
- $ligne->duration = $duration;
+ $line->fk_fichinter = $fichinterid;
+ $line->desc = $desc;
+ $line->datei = $date_intervention;
+ $line->duration = $duration;
- $result=$ligne->insert();
+ $result=$line->insert();
if ($result > 0)
{
$this->db->commit();
@@ -780,18 +780,16 @@ class Fichinter extends CommonObject
{
$objp = $this->db->fetch_object($result);
- $fichinterligne = new FichinterLigne($this->db);
- $fichinterligne->id = $objp->rowid;
+ $line = new FichinterLigne($this->db);
+ $line->id = $objp->rowid;
//...
- $this->lines[$i] = $fichinterligne;
+ $this->lines[$i] = $line;
$i++;
}
$this->db->free($result);
- $this->lignes=$this->lines; // For backward compatibility
-
return 1;
}
else
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 85c15be5f18..918d3f89898 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -74,7 +74,6 @@ class CommandeFournisseur extends Commande
{
$this->db = $DB;
$this->products = array();
- $this->lignes = array(); // TODO deprecated
$this->lines = array();
// List of language codes for status
@@ -187,7 +186,6 @@ class CommandeFournisseur extends Commande
$line->ref = $objp->ref; // Reference
$line->ref_fourn = $objp->ref_fourn; // Reference supplier
- $this->lignes[$i] = $line; // TODO deprecated
$this->lines[$i] = $line;
$i++;
@@ -527,15 +525,15 @@ class CommandeFournisseur extends Commande
{
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
- for ($i = 0 ; $i < sizeof($this->lignes) ; $i++)
+ for ($i = 0 ; $i < sizeof($this->lines) ; $i++)
{
// Product with reference
- if (!empty($this->lignes[$i]->fk_product))
+ if (!empty($this->lines[$i]->fk_product))
{
$mouvP = new MouvementStock($this->db);
// We decrement stock of product (and sub-products)
$entrepot_id = "1"; //Todo: ajouter possibilite de choisir l'entrepot
- $result=$mouvP->reception($user, $this->lignes[$i]->fk_product, $entrepot_id, $this->lignes[$i]->qty, $this->lignes[$i]->subprice);
+ $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $entrepot_id, $this->lines[$i]->qty, $this->lines[$i]->subprice);
if ($result < 0) { $error++; }
}
}
@@ -1197,10 +1195,10 @@ class CommandeFournisseur extends Commande
$this->lines = array();
- for ($i = 0 ; $i < sizeof($comclient->lignes) ; $i++)
+ for ($i = 0 ; $i < sizeof($comclient->lines) ; $i++)
{
- $prod = new Product($this->db, $comclient->lignes[$i]->fk_product);
- if ($prod->fetch($comclient->lignes[$i]->fk_product) > 0)
+ $prod = new Product($this->db, $comclient->lines[$i]->fk_product);
+ if ($prod->fetch($comclient->lines[$i]->fk_product) > 0)
{
$libelle = $prod->libelle;
$ref = $prod->ref;
@@ -1208,10 +1206,10 @@ class CommandeFournisseur extends Commande
$sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_fournisseurdet";
$sql .= " (fk_commande,label,description,fk_product, price, qty, tva_tx, remise_percent, subprice, remise, ref)";
- $sql .= " VALUES (".$idc.", '" . addslashes($libelle) . "','" . addslashes($comclient->lignes[$i]->desc) . "'";
- $sql .= ",".$comclient->lignes[$i]->fk_product.",'".price2num($comclient->lignes[$i]->price)."'";
- $sql .= ", '".$comclient->lignes[$i]->qty."', ".$comclient->lignes[$i]->tva_tx.", ".$comclient->lignes[$i]->remise_percent;
- $sql .= ", '".price2num($comclient->lignes[$i]->subprice)."','0','".$ref."') ;";
+ $sql .= " VALUES (".$idc.", '" . addslashes($libelle) . "','" . addslashes($comclient->lines[$i]->desc) . "'";
+ $sql .= ",".$comclient->lines[$i]->fk_product.",'".price2num($comclient->lines[$i]->price)."'";
+ $sql .= ", '".$comclient->lines[$i]->qty."', ".$comclient->lines[$i]->tva_tx.", ".$comclient->lines[$i]->remise_percent;
+ $sql .= ", '".price2num($comclient->lines[$i]->subprice)."','0','".$ref."') ;";
if ( $this->db->query( $sql) )
{
$this->update_price();
|