Qual: Uniformize code (ligne -> line)

This commit is contained in:
Laurent Destailleur 2010-10-27 14:15:30 +00:00
parent bc7b3b67c6
commit 5b96527805
10 changed files with 34 additions and 32 deletions

View File

@ -85,7 +85,7 @@ $line1->qty=1;
$line1->total_ht=100; $line1->total_ht=100;
$line1->total_tva=10; $line1->total_tva=10;
$line1->total_ttc=110; $line1->total_ttc=110;
$obj->lignes[]=$line1; $obj->lines[]=$line1;
// Create invoice // Create invoice
$idobject=$obj->create($user); $idobject=$obj->create($user);

View File

@ -954,9 +954,11 @@ class Propal extends CommonObject
$this->brouillon = 1; $this->brouillon = 1;
} }
$this->lignes = array();
$this->db->free($resql); $this->db->free($resql);
$this->lignes = array(); // TODO: deprecated
$this->lines = array();
/* /*
* Lignes propales liees a un produit ou non * Lignes propales liees a un produit ou non
*/ */
@ -1012,8 +1014,8 @@ class Propal extends CommonObject
$this->lignes[$i] = $line; // TODO: deprecated $this->lignes[$i] = $line; // TODO: deprecated
$this->lines[$i] = $line; $this->lines[$i] = $line;
//dol_syslog("1 ".$ligne->fk_product); //dol_syslog("1 ".$line->fk_product);
//print "xx $i ".$this->lignes[$i]->fk_product; //print "xx $i ".$this->lines[$i]->fk_product;
$i++; $i++;
} }
$this->db->free($result); $this->db->free($result);

View File

@ -134,12 +134,12 @@ class Facture extends CommonObject
} }
/** /**
* \brief Create invoice in database * Create invoice in database
* \param user Object user that create * @param user Object user that create
* \param notrigger 1 ne declenche pas les triggers, 0 sinon * @param notrigger 1=Does not execute triggers, 0 otherwise
* \param forceduedate Do not recalculate due date from payment condition but force it with value * @param forceduedate 1=Do not recalculate due date from payment condition but force it with value
* \return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
* \remarks this->ref can be set or empty. If empty, we will use "(PROV)" * @remarks this->ref can be set or empty. If empty, we will use "(PROV)"
*/ */
function create($user,$notrigger=0,$forceduedate=0) function create($user,$notrigger=0,$forceduedate=0)
{ {

View File

@ -237,16 +237,16 @@ class Translate {
{ {
$value=trim(preg_replace('/\\n/',"\n",$tab[1])); $value=trim(preg_replace('/\\n/',"\n",$tab[1]));
if (preg_match('/^CHARSET$/',$key)) // This is to declare in which charset files are encoded if ($key == 'CHARSET') // This is to declare in which charset files are encoded
{ {
$this->charset_inputfile[$newdomain]=strtoupper($value); $this->charset_inputfile[$newdomain]=strtoupper($value);
//print 'File '.$file_lang.' is declared to have format '.$this->charset_inputfile[$newdomain].'<br>'; //print 'File '.$file_lang.' is declared to have format '.$this->charset_inputfile[$newdomain].'<br>';
} }
elseif (preg_match('/^DIRECTION$/',$key)) // This is to declare direction of language elseif ($key == 'DIRECTION') // This is to declare direction of language
{ {
if ($alt < 2) // We do not load direction for alternate files 2 if ($alt < 2) // We do not load direction for alternate files 2
{ {
$this->direction=$value; $this->tab_translate[$key]=$value;
if ($stopafterdirection) break; if ($stopafterdirection) break;
} }
} }

View File

@ -171,13 +171,13 @@ class InterfaceExportsynchro
); );
$i=0; $i=0;
while ($i < count($propal->lignes)) while ($i < count($propal->lines))
{ {
$objPropalLine_data[$i] = array( "Ref"=>$propal->ref, $objPropalLine_data[$i] = array( "Ref"=>$propal->ref,
"ProductRef"=>$propal->lignes[$i]->ref, "ProductRef"=>$propal->lines[$i]->ref,
"Label"=>$propal->lignes[$i]->libelle, "Label"=>$propal->lines[$i]->libelle,
"LineQty"=>$propal->lignes[$i]->qty, "LineQty"=>$propal->lines[$i]->qty,
"LineTotalHT"=>$propal->lignes[$i]->total_ht "LineTotalHT"=>$propal->lines[$i]->total_ht
); );
$i++; $i++;
} }

View File

@ -41,8 +41,8 @@ require_once("../main.inc.php");
if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]); // If language was forced on URL by the main.inc.php if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]); // If language was forced on URL by the main.inc.php
$langs->load("main"); $langs->load("main");
$right=($langs->direction=='rtl'?'left':'right'); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
$left=($langs->direction=='rtl'?'right':'left'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
//var_dump($langs->defaultlang); //var_dump($langs->defaultlang);
//var_dump($conf->format_date_short_java); //var_dump($conf->format_date_short_java);

View File

@ -52,8 +52,8 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]); // If language was forced on URL if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]); // If language was forced on URL
if (! empty($_GET["theme"])) $conf->theme=$_GET["theme"]; // If theme was forced on URL if (! empty($_GET["theme"])) $conf->theme=$_GET["theme"]; // If theme was forced on URL
$langs->load("main",0,1); $langs->load("main",0,1);
$right=($langs->direction=='rtl'?'left':'right'); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
$left=($langs->direction=='rtl'?'right':'left'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
$fontsize=empty($conf->browser->phone)?'12':'12'; $fontsize=empty($conf->browser->phone)?'12':'12';
$fontsizesmaller=empty($conf->browser->phone)?'11':'11'; $fontsizesmaller=empty($conf->browser->phone)?'11':'11';
@ -76,7 +76,7 @@ body {
margin-bottom: 0; margin-bottom: 0;
margin-right: 0; margin-right: 0;
margin-left: 0; margin-left: 0;
<?php print 'direction: '.$langs->direction.";\n"; ?> <?php print 'direction: '.$langs->trans("DIRECTION").";\n"; ?>
} }
a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: bold; color: #000000; text-decoration: none; } a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: bold; color: #000000; text-decoration: none; }

View File

@ -52,8 +52,8 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]); // If language was forced on URL if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]); // If language was forced on URL
if (! empty($_GET["theme"])) $conf->theme=$_GET["theme"]; // If theme was forced on URL if (! empty($_GET["theme"])) $conf->theme=$_GET["theme"]; // If theme was forced on URL
$langs->load("main",0,1); $langs->load("main",0,1);
$right=($langs->direction=='rtl'?'left':'right'); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
$left=($langs->direction=='rtl'?'right':'left'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
$fontsize=empty($conf->browser->phone)?'12':'12'; $fontsize=empty($conf->browser->phone)?'12':'12';
$fontsizesmaller=empty($conf->browser->phone)?'11':'11'; $fontsizesmaller=empty($conf->browser->phone)?'11':'11';
@ -79,7 +79,7 @@ body {
margin-bottom: 0; margin-bottom: 0;
margin-right: 0; margin-right: 0;
margin-left: 0; margin-left: 0;
<?php print 'direction: '.$langs->direction.";\n"; ?> <?php print 'direction: '.$langs->trans("DIRECTION").";\n"; ?>
} }
a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: bold; color: #000000; text-decoration: none; } a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: bold; color: #000000; text-decoration: none; }

View File

@ -51,8 +51,8 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]); // If language was forced on URL if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]); // If language was forced on URL
if (! empty($_GET["theme"])) $conf->theme=$_GET["theme"]; // If theme was forced on URL if (! empty($_GET["theme"])) $conf->theme=$_GET["theme"]; // If theme was forced on URL
$langs->load("main",0,1); $langs->load("main",0,1);
$right=($langs->direction=='rtl'?'left':'right'); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
$left=($langs->direction=='rtl'?'right':'left'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
?> ?>
/* ============================================================================== */ /* ============================================================================== */

View File

@ -51,8 +51,8 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]); // If language was forced on URL if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]); // If language was forced on URL
if (! empty($_GET["theme"])) $conf->theme=$_GET["theme"]; // If theme was forced on URL if (! empty($_GET["theme"])) $conf->theme=$_GET["theme"]; // If theme was forced on URL
$langs->load("main",0,1); $langs->load("main",0,1);
$right=($langs->direction=='rtl'?'left':'right'); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
$left=($langs->direction=='rtl'?'right':'left'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
?> ?>
/* ============================================================================== */ /* ============================================================================== */