From 0152e226c1f9265c7ebf5c5b6728ab8fac455152 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 18 Oct 2012 13:25:32 +0200 Subject: [PATCH] Fix: Use correct translation of fields --- htdocs/core/modules/modProduct.class.php | 20 ++++++++++++-------- htdocs/imports/emptyexample.php | 3 ++- htdocs/imports/import.php | 2 +- htdocs/langs/fr_FR/exports.lang | 4 ++-- htdocs/product/fournisseurs.php | 2 +- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 09a02331729..e05b65a4f3d 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -189,7 +189,7 @@ class modProduct extends DolibarrModules // End add extra fields $this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_regex_array[$r]=array('p.ref'=>'[^ ]','p.tosell'=>'^[0|1]$','p.tobuy'=>'^[0|1]$','p.fk_product_type'=>'^[0|1]$','p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); - $this->import_examplevalues_array[$r]=array('p.ref'=>"PR123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.tosell'=>"0 or 1",'p.tobuy'=>"0 or 1",'p.fk_product_type'=>"0 for product/1 for service",'p.finished'=>'','p.duration'=>"1y",'p.datec'=>'2008-12-31'); + $this->import_examplevalues_array[$r]=array('p.ref'=>"PREF123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.tosell'=>"0 or 1",'p.tobuy'=>"0 or 1",'p.fk_product_type'=>"0 for product/1 for service",'p.finished'=>'','p.duration'=>"1y",'p.datec'=>'2008-12-31'); if (! empty($conf->fournisseur->enabled)) @@ -197,23 +197,27 @@ class modProduct extends DolibarrModules // Import product suppliers $r++; $this->import_code[$r]=$this->rights_class.'_'.$r; - $this->import_label[$r]="SuppliersProducts"; // Translation key + $this->import_label[$r]="SuppliersPrices"; // Translation key $this->import_icon[$r]='product'; $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon $this->import_tables_array[$r]=array('sp'=>MAIN_DB_PREFIX.'product_fournisseur_price'); $this->import_tables_creator_array[$r]=array('sp'=>'fk_user'); $this->import_fields_array[$r]=array('sp.fk_product'=>"Product*", - 'sp.fk_soc'=>"Supplier*", 'sp.ref_fourn'=>'RefSupplier', 'sp.price'=>"Price*", - 'sp.quantity'=>"Quantity*",'sp.unitprice'=>'UnitPrice*','sp.tva_tx'=>'VAT' + 'sp.fk_soc'=>"Supplier*", 'sp.ref_fourn'=>'SupplierRef', 'sp.quantity'=>"QtyMin*", 'sp.tva_tx'=>'VATRate', + 'sp.price'=>"PriceQtyMinHT*", + 'sp.unitprice'=>'UnitPriceHT*', // TODO Make this file not required and calculate it from price and qty + 'sp.remise_percent'=>'DiscountQtyMin' ); - + $this->import_convertvalue_array[$r]=array( 'sp.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'), 'sp.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'Product') ); - $this->import_examplevalues_array[$r]=array('sp.fk_product'=>"PR123456", - 'sp.fk_soc'=>"My Supplier",'sp.ref_fourn'=>"SupplierRef",'sp.price'=>"50", - 'sp.quantity'=>"1",'sp.unitprice'=>'50','sp.tva_tx'=>'21' + $this->import_examplevalues_array[$r]=array('sp.fk_product'=>"PREF123456", + 'sp.fk_soc'=>"My Supplier",'sp.ref_fourn'=>"SupplierRef", 'sp.quantity'=>"1", 'sp.tva_tx'=>'21', + 'sp.price'=>"50", + 'sp.unitprice'=>'50', + 'sp.remise_percent'=>'0' ); } } diff --git a/htdocs/imports/emptyexample.php b/htdocs/imports/emptyexample.php index 0363c1d29f6..8d5bf1e334e 100644 --- a/htdocs/imports/emptyexample.php +++ b/htdocs/imports/emptyexample.php @@ -77,7 +77,8 @@ $contentlinevalues=array(); $i = 0; foreach($fieldstarget as $code=>$label) { - $headerlinefields[]=$fieldstarget[$code].' ('.$code.')'; + $withoutstar=preg_replace('/\*/','',$fieldstarget[$code]); + $headerlinefields[]=$langs->transnoentities($withoutstar).($withoutstar != $fieldstarget[$code]?'*':'').' ('.$code.')'; $contentlinevalues[]=$valuestarget[$code]; } //var_dump($headerlinefields); diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index bc6fc871b97..c4f0c6727ac 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -733,7 +733,7 @@ if ($step == 4 && $datatoimport) print ''; print '    '.$langs->trans("Enclosure").' : '; print ''; - print ''; + print ''; print ''; print ''; } diff --git a/htdocs/langs/fr_FR/exports.lang b/htdocs/langs/fr_FR/exports.lang index e14fb9ace31..ca317e2dcbc 100644 --- a/htdocs/langs/fr_FR/exports.lang +++ b/htdocs/langs/fr_FR/exports.lang @@ -117,6 +117,6 @@ Excel2007FormatDesc=Format Excel (.xls).
Format standard Excel 2007 (S TsvFormatDesc=Format de fichier à Valeurs Séparées par des Tabulations (.tsv).
C'est un fichier texte dont les champs sont séparés par des tabulations [tab]. ExportFieldAutomaticallyAdded=Le champ %s a été ajouté automatiquement car il évitera que des lignes identiques soient considérées comme des doublons (avec ce champ, aucune ligne ne sera identique mais aura un id propre). CsvOptions=Options du fichier Csv -Separator=Séparateur -Enclosure=Délimiteur de champs +Separator=Séparateur de champs +Enclosure=Encadrement des chaines de textes SuppliersProducts=Produits Fournisseurs \ No newline at end of file diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index c3813538936..4f631358c9f 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -470,7 +470,7 @@ if ($id || $ref) print vatrate($productfourn->fourn_tva_tx,true); print ''; - // Price quantity + // Price for the quantity print ''; print $productfourn->fourn_price?price($productfourn->fourn_price):""; print '';