Fix: Translation of countries

This commit is contained in:
Laurent Destailleur 2009-06-03 19:50:17 +00:00
parent b71190f5ee
commit dd4efa416a
2 changed files with 51 additions and 40 deletions

View File

@ -100,7 +100,7 @@ $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.t
$tabsql[7] = "SELECT a.id as rowid, a.id as code, a.libelle AS libelle, a.deductible, a.actioncompta, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a";
$tabsql[8] = "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_typent";
$tabsql[9] = "SELECT code, code_iso, label as libelle, active FROM ".MAIN_DB_PREFIX."c_currencies";
$tabsql[10]= "SELECT t.rowid, t.taux, p.libelle as pays, t.fk_pays as pays_id, t.recuperableonly, t.note, t.active FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid";
$tabsql[10]= "SELECT t.rowid, t.taux, p.libelle as pays, p.code as pays_code, t.fk_pays as pays_id, t.recuperableonly, t.note, t.active FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid";
$tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
$tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX."cond_reglement AS c";
$tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN_DB_PREFIX."c_paiement AS c";
@ -620,17 +620,27 @@ if ($_GET["id"])
{
$showfield=1;
$valuetoshow=$obj->$fieldlist[$field];
if ($valuetoshow=='all') {
$valuetoshow=$langs->trans('All');
}
if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm') {
else if ($fieldlist[$field]=='pays') {
$key=$langs->trans("Country".strtoupper($obj->pays_code));
$valuetoshow=($key != "Country".strtoupper($obj->pays_code))?$key:$obj->pays;
}
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm') {
$valuetoshow=yn($valuetoshow);
}
if ($fieldlist[$field]=='price') {
else if ($fieldlist[$field]=='price') {
$valuetoshow=price($valuetoshow);
}
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') {
else if ($fieldlist[$field]=='price') {
$valuetoshow=price($valuetoshow);
}
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]=='llx_c_pays') {
$key=$langs->trans("Country".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
}
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') {
$showfield=0;
}
if ($showfield) print '<td>'.$valuetoshow.'</td>';

View File

@ -212,28 +212,19 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
print '</table>';
print '<br>';
// Message of the day
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>';
// Hide need help link on login page
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageOfDay").'</td><td colspan="2">';
if ($conf->fckeditor->enabled)
{
// Editeur wysiwyg
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('main_motd',$conf->global->MAIN_MOTD,158,'dolibarr_notes','In',false);
$doleditor->Create();
}
else
{
print '<textarea name="main_motd" cols="90" rows="'.ROWS_5.'">'.dol_htmlentitiesbr_decode($conf->global->MAIN_MOTD).'</textarea>';
}
print '</td></tr>';
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
print $html->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Message d'accueil'
// Message on login page
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageLogin").'</td><td colspan="2">';
if ($conf->fckeditor->enabled)
@ -249,13 +240,21 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
}
print '</td></tr>';
// Hide need help link on login page
// Message of the day on home page
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
print $html->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageOfDay").'</td><td colspan="2">';
if ($conf->fckeditor->enabled)
{
// Editeur wysiwyg
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('main_motd',$conf->global->MAIN_MOTD,158,'dolibarr_notes','In',false);
$doleditor->Create();
}
else
{
print '<textarea name="main_motd" cols="90" rows="'.ROWS_5.'">'.dol_htmlentitiesbr_decode($conf->global->MAIN_MOTD).'</textarea>';
}
print '</td></tr>';
print '</table>';
@ -344,7 +343,8 @@ else
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("PermanentLeftSearchForm").'</td><td>'.$langs->trans("Activated").'</td><td>&nbsp;</td></tr>';
$var=true;
foreach ($searchform as $key => $value) {
foreach ($searchform as $key => $value)
{
$var=!$var;
print '<tr '.$bc[$var].'"><td width="35%">'.$searchformtitle[$key].'</td><td>' . ($searchformconst[$key]?$langs->trans("yes"):$langs->trans("no")).'</td>';
print '<td align="left">'.$langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key]));
@ -353,20 +353,9 @@ else
print '</table>';
print '<br>';
// Message of the day
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageOfDay").'</td><td>';
print nl2br($conf->global->MAIN_MOTD);
print '</td></tr>';
// Message login
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageLogin").'</td><td>';
print nl2br($conf->global->MAIN_HOME);
print '</td></tr>';
// Link to help center
$var=!$var;
@ -374,6 +363,18 @@ else
print yn($conf->global->MAIN_HELPCENTER_DISABLELINK);
print '</td></tr>';
// Message login
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageLogin").'</td><td>';
print nl2br($conf->global->MAIN_HOME);
print '</td></tr>';
// Message of the day
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageOfDay").'</td><td>';
print nl2br($conf->global->MAIN_MOTD);
print '</td></tr>';
print '</table>';