diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index f88f646289c..42391155e80 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -63,7 +63,6 @@ class Adherent extends CommonObject var $country_id; var $country_code; var $country; - var $pays_id; // deprecated var $pays_code; // deprecated var $pays; // deprecated @@ -563,7 +562,7 @@ class Adherent extends CommonObject $lthirdparty->tel=$this->phone; $lthirdparty->state_id=$this->state_id; $lthirdparty->country_id=$this->country_id; - $lthirdparty->pays_id=$this->country_id; + $lthirdparty->country_id=$this->country_id; //$lthirdparty->phone_mobile=$this->phone_mobile; $result=$lthirdparty->update($this->fk_soc,$user,0,1,1,'update'); // Use sync to 0 to avoid cyclic updates @@ -1069,7 +1068,6 @@ class Adherent extends CommonObject $this->country = $langs->transnoentitiesnoconv("Country".$obj->country_code); else $this->country=$obj->country; - $this->pays_id = $obj->country_id; // deprecated $this->pays_code = $obj->country_code; // deprecated $this->pays = $this->country; // deprecated diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 9734562016d..44947730e00 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -263,7 +263,6 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $object->state_id = $_POST["departement_id"]; $object->country_id = $_POST["country_id"]; $object->fk_departement = $_POST["departement_id"]; // deprecated - $object->pays_id = $_POST["country_id"]; // deprecated $object->phone = trim($_POST["phone"]); $object->phone_perso = trim($_POST["phone_perso"]); @@ -438,7 +437,6 @@ if ($action == 'add' && $user->rights->adherent->creer) $object->town = $town; $object->fk_departement = $state_id; $object->state_id = $state_id; - $object->pays_id = $country_id; $object->country_id = $country_id; $object->phone = $phone; $object->phone_perso = $phone_perso; @@ -959,7 +957,6 @@ else { dol_print_error($db); } - $object->pays_id=$obj->rowid; $object->pays_code=$obj->code; $object->pays=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label; $object->country_id=$obj->rowid; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d5fe7846714..bea9df93c65 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -130,18 +130,18 @@ $tablib[24]= "DictionnaryAccountancysystem"; $tabsql=array(); $tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as pays_code, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid"; $tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, p.code as pays_code, p.libelle as pays, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid and r.active=1 and p.active=1"; -$tabsql[3] = "SELECT r.rowid as rowid, code_region as code, nom as libelle, r.fk_pays as pays_id, p.code as pays_code, p.libelle as pays, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1"; +$tabsql[3] = "SELECT r.rowid as rowid, code_region as code, nom as libelle, r.fk_pays as country_id, p.code as pays_code, p.libelle as pays, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1"; $tabsql[4] = "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_pays"; $tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.civilite AS libelle, c.active FROM ".MAIN_DB_PREFIX."c_civilite AS 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[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, 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.accountancy_code as accountancy_code, a.deductible, p.code as pays_code, p.libelle as pays, a.fk_pays as country_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[9] = "SELECT code_iso as code, label, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies"; -$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, 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_sell, t.accountancy_code_buy 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, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as pays, p.code as pays_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy 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.'c_payment_term AS c'; $tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN_DB_PREFIX."c_paiement AS c"; -$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as pays_id, p.code as pays_code, p.libelle as pays, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1"; +$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, p.code as pays_code, p.libelle as pays, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1"; $tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format"; $tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_prospectlevel"; $tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees"; @@ -151,7 +151,7 @@ $tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREF $tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability AS c"; $tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason"; $tabsql[23]= "SELECT rowid as rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number as accountancy_code, account_parent, label, active FROM ".MAIN_DB_PREFIX."accountingaccount"; -$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as pays_id, p.code as pays_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1"; +$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, p.code as pays_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1"; // Critere de tri du dictionnaire $tabsqlsort=array(); @@ -184,18 +184,18 @@ $tabsqlsort[24]="pcg_version ASC"; $tabfield=array(); $tabfield[1] = "code,libelle,pays"; $tabfield[2] = "code,libelle,region_id,region,pays"; // "code,libelle,region,pays_code-pays" -$tabfield[3] = "code,libelle,pays_id,pays"; +$tabfield[3] = "code,libelle,country_id,pays"; $tabfield[4] = "code,libelle"; $tabfield[5] = "code,libelle"; $tabfield[6] = "code,libelle,type,position"; -$tabfield[7] = "code,libelle,pays_id,pays,accountancy_code,deductible"; +$tabfield[7] = "code,libelle,country_id,pays,accountancy_code,deductible"; $tabfield[8] = "code,libelle"; $tabfield[9] = "code,label,unicode"; $tabfield[10]= "pays_id,pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; $tabfield[11]= "element,source,code,libelle"; $tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage"; $tabfield[13]= "code,libelle,type"; -$tabfield[14]= "code,libelle,price,organization,pays_id,pays"; +$tabfield[14]= "code,libelle,price,organization,country_id,pays"; $tabfield[15]= "code,libelle,width,height,unit"; $tabfield[16]= "code,libelle"; $tabfield[17]= "code,libelle"; @@ -205,7 +205,7 @@ $tabfield[20]= "code,libelle"; $tabfield[21]= "code,label"; $tabfield[22]= "code,label"; $tabfield[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label"; -$tabfield[24]= "pcg_version,pays_id,pays,label"; +$tabfield[24]= "pcg_version,country_id,pays,label"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); @@ -739,7 +739,7 @@ if ($id) if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); } if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); } if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); } - if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $valuetoshow=''; } + if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $valuetoshow=''; } if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); } if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); } if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); } @@ -853,7 +853,7 @@ if ($id) if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); } if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); } if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); } - if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $showfield=0; } + if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; } if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); } if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); $sortable=0; } if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); $sortable=0; } @@ -1014,7 +1014,7 @@ if ($id) $key = $langs->trans(strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->$fieldlist[$field]); } - else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { + else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; } else if ($fieldlist[$field]=='unicode') { @@ -1199,9 +1199,9 @@ function fieldList($fieldlist,$obj='',$tabname='') print $form->select_country((! empty($obj->pays_code)?$obj->pays_code:(! empty($obj->pays)?$obj->pays:'')), 'pays', '', 28); print ''; } - elseif ($fieldlist[$field] == 'pays_id') { - $pays_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0); - print ''; + elseif ($fieldlist[$field] == 'country_id') { + $country_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0); + print ''; } elseif ($fieldlist[$field] == 'region') { print '