Skip to content
Snippets Groups Projects
Commit 620c2583 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: view unicode and currency symbol in dictionnary

parent e34996e9
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,7 @@ $langs->load("companies"); ...@@ -39,7 +39,7 @@ $langs->load("companies");
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
$confirm=GETPOST('confirm','alpha'); $confirm=GETPOST('confirm','alpha');
$id=GETPOST('id','int'); $id=GETPOST('id','int');
$rowid=GETPOST('rowid','int'); $rowid=GETPOST('rowid','alpha');
if (!$user->admin) accessforbidden(); if (!$user->admin) accessforbidden();
...@@ -128,8 +128,7 @@ $tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.civilite AS libelle, c. ...@@ -128,8 +128,7 @@ $tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.civilite AS libelle, c.
$tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a"; $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.deductible, p.code as pays_code, p.libelle as pays, a.fk_pays as pays_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1"; $tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.deductible, p.code as pays_code, p.libelle as pays, a.fk_pays as pays_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1";
$tabsql[8] = "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_typent"; $tabsql[8] = "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_typent";
//$tabsql[9] = "SELECT code, code_iso, label as libelle, symbole, active FROM ".MAIN_DB_PREFIX."c_currencies"; $tabsql[9] = "SELECT code_iso as code, label as libelle, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies";
$tabsql[9] = "SELECT code, code_iso, label as libelle, active FROM ".MAIN_DB_PREFIX."c_currencies";
$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1, t.localtax2, p.libelle as pays, p.code as pays_code, t.fk_pays as pays_id, t.recuperableonly, t.note, t.active, t.accountancy_code FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p WHERE t.fk_pays=p.rowid"; $tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1, t.localtax2, p.libelle as pays, p.code as pays_code, t.fk_pays as pays_id, t.recuperableonly, t.note, t.active, t.accountancy_code FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."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[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.'c_payment_term AS c'; $tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX.'c_payment_term AS c';
...@@ -153,7 +152,7 @@ $tabsqlsort[5] ="libelle ASC"; ...@@ -153,7 +152,7 @@ $tabsqlsort[5] ="libelle ASC";
$tabsqlsort[6] ="a.type ASC, a.module, a.position, a.code ASC"; $tabsqlsort[6] ="a.type ASC, a.module, a.position, a.code ASC";
$tabsqlsort[7] ="pays ASC, code ASC, a.libelle ASC"; $tabsqlsort[7] ="pays ASC, code ASC, a.libelle ASC";
$tabsqlsort[8] ="libelle ASC"; $tabsqlsort[8] ="libelle ASC";
$tabsqlsort[9] ="code ASC"; $tabsqlsort[9] ="libelle ASC";
$tabsqlsort[10]="pays ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC"; $tabsqlsort[10]="pays ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC";
$tabsqlsort[11]="element ASC, source ASC, code ASC"; $tabsqlsort[11]="element ASC, source ASC, code ASC";
$tabsqlsort[12]="sortorder ASC, code ASC"; $tabsqlsort[12]="sortorder ASC, code ASC";
...@@ -177,8 +176,7 @@ $tabfield[5] = "code,libelle"; ...@@ -177,8 +176,7 @@ $tabfield[5] = "code,libelle";
$tabfield[6] = "code,libelle,type,position"; $tabfield[6] = "code,libelle,type,position";
$tabfield[7] = "code,libelle,pays_id,pays,deductible"; $tabfield[7] = "code,libelle,pays_id,pays,deductible";
$tabfield[8] = "code,libelle"; $tabfield[8] = "code,libelle";
//$tabfield[9] = "code,code_iso,libelle,symbole"; $tabfield[9] = "code,libelle,unicode";
$tabfield[9] = "code,code_iso,libelle";
$tabfield[10]= "pays_id,pays,taux,recuperableonly,localtax1,localtax2,accountancy_code,note"; $tabfield[10]= "pays_id,pays,taux,recuperableonly,localtax1,localtax2,accountancy_code,note";
$tabfield[11]= "element,source,code,libelle"; $tabfield[11]= "element,source,code,libelle";
$tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage"; $tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
...@@ -202,8 +200,7 @@ $tabfieldvalue[5] = "code,libelle"; ...@@ -202,8 +200,7 @@ $tabfieldvalue[5] = "code,libelle";
$tabfieldvalue[6] = "code,libelle,type,position"; $tabfieldvalue[6] = "code,libelle,type,position";
$tabfieldvalue[7] = "code,libelle,pays,deductible"; $tabfieldvalue[7] = "code,libelle,pays,deductible";
$tabfieldvalue[8] = "code,libelle"; $tabfieldvalue[8] = "code,libelle";
//$tabfieldvalue[9] = "code,code_iso,libelle,symbole"; $tabfieldvalue[9] = "code,libelle,unicode";
$tabfieldvalue[9] = "code,code_iso,libelle";
$tabfieldvalue[10]= "pays,taux,recuperableonly,localtax1,localtax2,accountancy_code,note"; $tabfieldvalue[10]= "pays,taux,recuperableonly,localtax1,localtax2,accountancy_code,note";
$tabfieldvalue[11]= "element,source,code,libelle"; $tabfieldvalue[11]= "element,source,code,libelle";
$tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage"; $tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
...@@ -227,8 +224,7 @@ $tabfieldinsert[5] = "code,civilite"; ...@@ -227,8 +224,7 @@ $tabfieldinsert[5] = "code,civilite";
$tabfieldinsert[6] = "code,libelle,type,position"; $tabfieldinsert[6] = "code,libelle,type,position";
$tabfieldinsert[7] = "code,libelle,fk_pays,deductible"; $tabfieldinsert[7] = "code,libelle,fk_pays,deductible";
$tabfieldinsert[8] = "code,libelle"; $tabfieldinsert[8] = "code,libelle";
//$tabfieldinsert[9] = "code,code_iso,label,symbole"; $tabfieldinsert[9] = "code_iso,label,unicode";
$tabfieldinsert[9] = "code,code_iso,label";
$tabfieldinsert[10]= "fk_pays,taux,recuperableonly,localtax1,localtax2,accountancy_code,note"; $tabfieldinsert[10]= "fk_pays,taux,recuperableonly,localtax1,localtax2,accountancy_code,note";
$tabfieldinsert[11]= "element,source,code,libelle"; $tabfieldinsert[11]= "element,source,code,libelle";
$tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage"; $tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
...@@ -254,7 +250,7 @@ $tabrowid[5] = "rowid"; ...@@ -254,7 +250,7 @@ $tabrowid[5] = "rowid";
$tabrowid[6] = "id"; $tabrowid[6] = "id";
$tabrowid[7] = "id"; $tabrowid[7] = "id";
$tabrowid[8] = "id"; $tabrowid[8] = "id";
$tabrowid[9] = "code"; $tabrowid[9] = "code_iso";
$tabrowid[10]= ""; $tabrowid[10]= "";
$tabrowid[11]= "rowid"; $tabrowid[11]= "rowid";
$tabrowid[12]= "rowid"; $tabrowid[12]= "rowid";
...@@ -645,7 +641,8 @@ if ($id) ...@@ -645,7 +641,8 @@ if ($id)
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; } if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
if ($fieldlist[$field]=='pays') { if ($fieldlist[$field]=='pays') {
if (in_array('region_id',$fieldlist)) { print '<td>&nbsp;</td>'; continue; } // For region page, we do not show the country input if (in_array('region_id',$fieldlist)) { print '<td>&nbsp;</td>'; continue; } // For region page, we do not show the country input
$valuetoshow=$langs->trans("Country"); } $valuetoshow=$langs->trans("Country");
}
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; } if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; }
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); } if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); } if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); }
...@@ -661,7 +658,6 @@ if ($id) ...@@ -661,7 +658,6 @@ if ($id)
print $valuetoshow; print $valuetoshow;
print '</td>'; print '</td>';
} }
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1; if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
} }
print '<td colspan="3">'; print '<td colspan="3">';
...@@ -883,6 +879,9 @@ if ($id) ...@@ -883,6 +879,9 @@ if ($id)
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') {
$showfield=0; $showfield=0;
} }
else if ($fieldlist[$field]=='unicode') {
$valuetoshow = getCurrencySymbol($obj->code);
}
if ($showfield) print '<td>'.$valuetoshow.'</td>'; if ($showfield) print '<td>'.$valuetoshow.'</td>';
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment