NEW Add a profile to import product translations
This commit is contained in:
parent
8429de031f
commit
45fc5701ae
@ -308,7 +308,6 @@ class modProduct extends DolibarrModules
|
||||
if (is_object($mysoc) && $mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('sp.recuperableonly'=>'NPR'));
|
||||
if (is_object($mysoc) && $mysoc->useLocalTax(1)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('sp.localtax1_tx'=>'LT1', 'sp.localtax1_type'=>'LT1Type'));
|
||||
if (is_object($mysoc) && $mysoc->useLocalTax(2)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('sp.localtax2_tx'=>'LT2', 'sp.localtax2_type'=>'LT2Type'));
|
||||
|
||||
$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')
|
||||
@ -352,30 +351,19 @@ class modProduct extends DolibarrModules
|
||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||
{
|
||||
$r++;
|
||||
/* FIXME Must be a dedicated import profil. Not working yet
|
||||
$this->import_code[$r]=$this->rights_class.'_multiprice';
|
||||
$this->import_label[$r]="ProductTranslations";
|
||||
$this->import_code[$r]=$this->rights_class.'_languages';
|
||||
$this->import_label[$r]="ProductsOrServicesTranslations";
|
||||
$this->import_icon[$r]=$this->picto;
|
||||
$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]['l']=MAIN_DB_PREFIX.'product_lang';
|
||||
$this->import_tables_array[$r]=array('l'=>MAIN_DB_PREFIX.'product_lang');
|
||||
// multiline translation, one line per translation
|
||||
$this->import_fields_array[$r]['l.lang']='Language';
|
||||
$this->import_fields_array[$r]['l.label']='TranslatedLabel';
|
||||
$this->import_fields_array[$r]['l.description']='TranslatedDescription';
|
||||
$this->import_fields_array[$r]['l.note']='TranslatedNote';
|
||||
$this->import_examplevalues_array[$r]['l.lang']='en_US';
|
||||
*/
|
||||
// single line translation, one column per translation
|
||||
/*
|
||||
foreach($langs as $l) {
|
||||
$this->import_tables_array[$r][$l] = MAIN_DB_PREFIX.'product_lang';
|
||||
$this->import_fields_array[$r][$l.'.label']=$l.'_label';
|
||||
$this->import_fields_array[$r][$l.'.description']=$l.'_description';
|
||||
$this->import_fields_array[$r][$l.'.note']=$l.'_note';
|
||||
$this->import_fieldshidden_array[$r][$l.'.lang']="'$l'";
|
||||
$this->import_fieldshidden_array[$r][$l.'.fk_product']='lastrowid-'.MAIN_DB_PREFIX.'product';
|
||||
}
|
||||
*/
|
||||
$this->import_fields_array[$r]=array('l.fk_product'=>'Ref', 'l.lang'=>'Language', 'l.label'=>'TranslatedLabel', 'l.description'=>'TranslatedDescription');
|
||||
//$this->import_fields_array[$r]['l.note']='TranslatedNote';
|
||||
$this->import_convertvalue_array[$r]=array(
|
||||
'l.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'Product')
|
||||
);
|
||||
$this->import_examplevalues_array[$r]=array('l.fk_product'=>'MyProductRef','l.lang'=>'en_US','l.label'=>'Label in en_US','l.description'=>'Desc in en_US');
|
||||
$this->import_updatekeys_array[$r]=array('l.fk_product'=>'Ref','l.lang'=>'Language');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -315,6 +315,24 @@ class modService extends DolibarrModules
|
||||
'pr.tva_tx'=>'19.6',
|
||||
'pr.date_price'=>'2013-04-10');
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||
{
|
||||
$r++;
|
||||
$this->import_code[$r]=$this->rights_class.'_languages';
|
||||
$this->import_label[$r]="ProductsOrServicesTranslations";
|
||||
$this->import_icon[$r]=$this->picto;
|
||||
$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('l'=>MAIN_DB_PREFIX.'product_lang');
|
||||
// multiline translation, one line per translation
|
||||
$this->import_fields_array[$r]=array('l.fk_product'=>'Ref', 'l.lang'=>'Language', 'l.label'=>'TranslatedLabel', 'l.description'=>'TranslatedDescription');
|
||||
//$this->import_fields_array[$r]['l.note']='TranslatedNote';
|
||||
$this->import_convertvalue_array[$r]=array(
|
||||
'l.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'Product')
|
||||
);
|
||||
$this->import_examplevalues_array[$r]=array('l.fk_product'=>'MyProductRef','l.lang'=>'en_US','l.label'=>'Label in en_US','l.description'=>'Desc in en_US');
|
||||
$this->import_updatekeys_array[$r]=array('l.fk_product'=>'Ref','l.lang'=>'Language');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -362,7 +362,7 @@ if ($step == 1 || ! $datatoimport)
|
||||
print '<tr '.$bc[$val].'><td nospan="nospan">';
|
||||
$titleofmodule=$objimport->array_import_module[$key]->getName();
|
||||
// Special cas for import common to module/services
|
||||
if (in_array($objimport->array_import_code[$key], array('produit_supplierprices','produit_multiprice'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||
if (in_array($objimport->array_import_code[$key], array('produit_supplierprices','produit_multiprice','produit_languages'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||
print $titleofmodule;
|
||||
print '</td><td>';
|
||||
//print $value;
|
||||
@ -415,7 +415,7 @@ if ($step == 2 && $datatoimport)
|
||||
print '<td>';
|
||||
$titleofmodule=$objimport->array_import_module[0]->getName();
|
||||
// Special cas for import common to module/services
|
||||
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice','produit_languages'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||
print $titleofmodule;
|
||||
print '</td></tr>';
|
||||
|
||||
@ -503,7 +503,7 @@ if ($step == 3 && $datatoimport)
|
||||
print '<td>';
|
||||
$titleofmodule=$objimport->array_import_module[0]->getName();
|
||||
// Special cas for import common to module/services
|
||||
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice','produit_languages'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||
print $titleofmodule;
|
||||
print '</td></tr>';
|
||||
|
||||
@ -759,7 +759,7 @@ if ($step == 4 && $datatoimport)
|
||||
print '<td>';
|
||||
$titleofmodule=$objimport->array_import_module[0]->getName();
|
||||
// Special cas for import common to module/services
|
||||
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice','produit_languages'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||
print $titleofmodule;
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1235,7 +1235,7 @@ if ($step == 5 && $datatoimport)
|
||||
print '<td>';
|
||||
$titleofmodule=$objimport->array_import_module[0]->getName();
|
||||
// Special cas for import common to module/services
|
||||
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice','produit_languages'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||
print $titleofmodule;
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1326,7 +1326,7 @@ if ($step == 5 && $datatoimport)
|
||||
if($action=='launchsimu') {
|
||||
if (count($updatekeys))
|
||||
{
|
||||
print $form->multiselectarray('updatekeysbis', $objimport->array_import_updatekeys[0], $updatekeys, 0, 0, '', 1, '', 'disabled');
|
||||
print $form->multiselectarray('updatekeysbis', $objimport->array_import_updatekeys[0], $updatekeys, 0, 0, '', 1, '80%', 'disabled');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1668,8 +1668,10 @@ if ($step == 6 && $datatoimport)
|
||||
|
||||
$head = import_prepare_head($param,6);
|
||||
|
||||
dol_fiche_head($head, 'step6', $langs->trans("NewImport"));
|
||||
dol_fiche_head($head, 'step6', $langs->trans("NewImport"), -1);
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<table width="100%" class="border">';
|
||||
|
||||
@ -1678,7 +1680,7 @@ if ($step == 6 && $datatoimport)
|
||||
print '<td>';
|
||||
$titleofmodule=$objimport->array_import_module[0]->getName();
|
||||
// Special cas for import common to module/services
|
||||
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice','produit_languages'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||
print $titleofmodule;
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1690,10 +1692,13 @@ if ($step == 6 && $datatoimport)
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<b>'.$langs->trans("InformationOnSourceFile").'</b><hr>';
|
||||
print '<b>'.$langs->trans("InformationOnSourceFile").'</b>';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<div class="fichecenter">';
|
||||
print '<table width="100%" class="border">';
|
||||
//print '<tr><td colspan="2"><b>'.$langs->trans("InformationOnSourceFile").'</b></td></tr>';
|
||||
|
||||
@ -1747,10 +1752,13 @@ if ($step == 6 && $datatoimport)
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<b>'.$langs->trans("InformationOnTargetTables").'</b><hr>';
|
||||
print '<b>'.$langs->trans("InformationOnTargetTables").'</b>';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<div class="fichecenter">';
|
||||
print '<table width="100%" class="border">';
|
||||
//print '<tr><td colspan="2"><b>'.$langs->trans("InformationOnTargetTables").'</b></td></tr>';
|
||||
|
||||
@ -1812,6 +1820,7 @@ if ($step == 6 && $datatoimport)
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
// Launch import
|
||||
$arrayoferrors=array();
|
||||
|
||||
@ -271,6 +271,7 @@ WarningSelectOneDocument=Please select at least one document
|
||||
DefaultUnitToShow=Unit
|
||||
NbOfQtyInProposals=Qty in proposals
|
||||
ClinkOnALinkOfColumn=Click on a link of column %s to get a detailed view...
|
||||
ProductsOrServicesTranslations=Products or services translation
|
||||
TranslatedLabel=Translated label
|
||||
TranslatedDescription=Translated description
|
||||
TranslatedNote=Translated notes
|
||||
|
||||
Loading…
Reference in New Issue
Block a user