Debug feature of alternate languages
This commit is contained in:
parent
c2a9819daa
commit
b3118d0189
@ -635,6 +635,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
$contactid = 0;
|
$contactid = 0;
|
||||||
$thirdpartyid = 0;
|
$thirdpartyid = 0;
|
||||||
|
$elementforaltlanguage = $this->element;
|
||||||
if ($this->element == 'societe')
|
if ($this->element == 'societe')
|
||||||
{
|
{
|
||||||
$thirdpartyid = $this->id;
|
$thirdpartyid = $this->id;
|
||||||
@ -682,10 +683,11 @@ abstract class CommonObject
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
|
||||||
$extralanguages = new ExtraLanguages($this->db);
|
$extralanguages = new ExtraLanguages($this->db);
|
||||||
}
|
}
|
||||||
$extralanguages->fetch_name_extralanguages('societe');
|
$extralanguages->fetch_name_extralanguages($elementforaltlanguage);
|
||||||
|
|
||||||
if (!empty($extralanguages->attributes['societe']['address']) || !empty($extralanguages->attributes['societe']['town']))
|
if (!empty($extralanguages->attributes[$elementforaltlanguage]['address']) || !empty($extralanguages->attributes[$elementforaltlanguage]['town']))
|
||||||
{
|
{
|
||||||
|
$out .= "<!-- alternatelanguage for '".$elementforaltlanguage."' set to fields '".join(',', $extralanguages->attributes[$elementforaltlanguage]). "' -->\n";
|
||||||
$this->fetchValuesForExtraLanguages();
|
$this->fetchValuesForExtraLanguages();
|
||||||
if (!is_object($form)) $form = new Form($this->db);
|
if (!is_object($form)) $form = new Form($this->db);
|
||||||
$htmltext = '';
|
$htmltext = '';
|
||||||
|
|||||||
@ -71,7 +71,7 @@ class ExtraLanguages
|
|||||||
/**
|
/**
|
||||||
* Load array this->attributes with list of fields per object that need an alternate translation. The object and field must be managed with
|
* Load array this->attributes with list of fields per object that need an alternate translation. The object and field must be managed with
|
||||||
* the widgetForTranslation() method.
|
* the widgetForTranslation() method.
|
||||||
* You can set variable MAIN_USE_ALTERNATE_TRANSLATION_FOR=elementA:fieldname,fieldname2;elementB:...
|
* You must set variable MAIN_USE_ALTERNATE_TRANSLATION_FOR=elementA:fieldname,fieldname2;elementB:...
|
||||||
* Example: MAIN_USE_ALTERNATE_TRANSLATION_FOR=societe:name,town;contact:firstname,lastname
|
* Example: MAIN_USE_ALTERNATE_TRANSLATION_FOR=societe:name,town;contact:firstname,lastname
|
||||||
*
|
*
|
||||||
* @param string $elementtype Type of element ('' = all, 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
|
* @param string $elementtype Type of element ('' = all, 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user