Merge pull request #1251 from atm-maxime/develop
Add multilang management in ODT models
This commit is contained in:
commit
4dc1708f26
@ -784,6 +784,16 @@ class Translate
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_translations_for_substitutions() {
|
||||||
|
$substitutionarray = array();
|
||||||
|
|
||||||
|
foreach($this->tab_translate as $code => $label) {
|
||||||
|
$substitutionarray['lang_'.$code] = $label;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $substitutionarray;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -74,7 +74,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
$this->option_modereg = 0; // Affiche mode reglement
|
$this->option_modereg = 0; // Affiche mode reglement
|
||||||
$this->option_condreg = 0; // Affiche conditions reglement
|
$this->option_condreg = 0; // Affiche conditions reglement
|
||||||
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
||||||
$this->option_multilang = 0; // Dispo en plusieurs langues
|
$this->option_multilang = 1; // Dispo en plusieurs langues
|
||||||
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
||||||
$this->option_credit_note = 0; // Support credit notes
|
$this->option_credit_note = 0; // Support credit notes
|
||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
@ -535,6 +535,18 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Replace labels translated
|
||||||
|
$tmparray=$outputlangs->get_translations_for_substitutions();
|
||||||
|
foreach($tmparray as $key=>$value)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
|
}
|
||||||
|
catch(OdfException $e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Call the beforeODTSave hook
|
// Call the beforeODTSave hook
|
||||||
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
||||||
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|||||||
@ -74,7 +74,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
$this->option_modereg = 0; // Affiche mode reglement
|
$this->option_modereg = 0; // Affiche mode reglement
|
||||||
$this->option_condreg = 0; // Affiche conditions reglement
|
$this->option_condreg = 0; // Affiche conditions reglement
|
||||||
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
||||||
$this->option_multilang = 0; // Dispo en plusieurs langues
|
$this->option_multilang = 1; // Dispo en plusieurs langues
|
||||||
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
||||||
$this->option_credit_note = 0; // Support credit notes
|
$this->option_credit_note = 0; // Support credit notes
|
||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
@ -535,6 +535,18 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Replace labels translated
|
||||||
|
$tmparray=$outputlangs->get_translations_for_substitutions();
|
||||||
|
foreach($tmparray as $key=>$value)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
|
}
|
||||||
|
catch(OdfException $e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Call the beforeODTSave hook
|
// Call the beforeODTSave hook
|
||||||
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
||||||
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|||||||
@ -74,7 +74,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
$this->option_modereg = 0; // Affiche mode reglement
|
$this->option_modereg = 0; // Affiche mode reglement
|
||||||
$this->option_condreg = 0; // Affiche conditions reglement
|
$this->option_condreg = 0; // Affiche conditions reglement
|
||||||
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
||||||
$this->option_multilang = 0; // Dispo en plusieurs langues
|
$this->option_multilang = 1; // Dispo en plusieurs langues
|
||||||
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
||||||
$this->option_credit_note = 0; // Support credit notes
|
$this->option_credit_note = 0; // Support credit notes
|
||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
@ -515,6 +515,18 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Replace labels translated
|
||||||
|
$tmparray=$outputlangs->get_translations_for_substitutions();
|
||||||
|
foreach($tmparray as $key=>$value)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
|
}
|
||||||
|
catch(OdfException $e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Call the beforeODTSave hook
|
// Call the beforeODTSave hook
|
||||||
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
||||||
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|||||||
@ -90,7 +90,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
$this->option_modereg = 0; // Affiche mode reglement
|
$this->option_modereg = 0; // Affiche mode reglement
|
||||||
$this->option_condreg = 0; // Affiche conditions reglement
|
$this->option_condreg = 0; // Affiche conditions reglement
|
||||||
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
||||||
$this->option_multilang = 0; // Dispo en plusieurs langues
|
$this->option_multilang = 1; // Dispo en plusieurs langues
|
||||||
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
||||||
$this->option_credit_note = 0; // Support credit notes
|
$this->option_credit_note = 0; // Support credit notes
|
||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
@ -977,6 +977,18 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Replace labels translated
|
||||||
|
$tmparray=$outputlangs->get_translations_for_substitutions();
|
||||||
|
foreach($tmparray as $key=>$value)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
|
}
|
||||||
|
catch(OdfException $e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Call the beforeODTSave hook
|
// Call the beforeODTSave hook
|
||||||
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
||||||
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|||||||
@ -74,7 +74,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||||||
$this->option_modereg = 0; // Affiche mode reglement
|
$this->option_modereg = 0; // Affiche mode reglement
|
||||||
$this->option_condreg = 0; // Affiche conditions reglement
|
$this->option_condreg = 0; // Affiche conditions reglement
|
||||||
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
||||||
$this->option_multilang = 0; // Dispo en plusieurs langues
|
$this->option_multilang = 1; // Dispo en plusieurs langues
|
||||||
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
||||||
$this->option_credit_note = 0; // Support credit notes
|
$this->option_credit_note = 0; // Support credit notes
|
||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
@ -488,6 +488,18 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Replace labels translated
|
||||||
|
$tmparray=$outputlangs->get_translations_for_substitutions();
|
||||||
|
foreach($tmparray as $key=>$value)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
|
}
|
||||||
|
catch(OdfException $e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Call the beforeODTSave hook
|
// Call the beforeODTSave hook
|
||||||
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
||||||
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|||||||
@ -319,6 +319,18 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Replace labels translated
|
||||||
|
$tmparray=$outputlangs->get_translations_for_substitutions();
|
||||||
|
foreach($tmparray as $key=>$value)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
|
}
|
||||||
|
catch(OdfException $e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Call the beforeODTSave hook
|
// Call the beforeODTSave hook
|
||||||
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
||||||
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user