diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index 50a24ea907a..658b266fcf3 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -400,7 +400,6 @@ abstract class ActionsAdherentCardCommon $this->object->address = $_POST["address"]; $this->object->zip = $_POST["zipcode"]; $this->object->town = $_POST["town"]; - $this->object->fk_pays = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id; $this->object->fk_departement = $_POST["departement_id"]; $this->object->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id; $this->object->state_id = $_POST["departement_id"]; @@ -423,7 +422,6 @@ abstract class ActionsAdherentCardCommon { dol_print_error($this->db); } - $this->object->pays = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; $this->object->country_code = $obj->code; $this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; } diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 13fc7f2488e..c45f1aed993 100755 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -62,11 +62,11 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg // requete en prenant que les adherents a jour de cotisation $sql = "SELECT d.rowid, d.firstname, d.lastname, d.login, d.societe as company, d.datefin,"; - $sql.= " d.address, d.zip, d.town, d.naiss, d.email, d.photo,"; + $sql.= " d.address, d.zip, d.town, d.country, d.naiss, d.email, d.photo,"; $sql.= " t.libelle as type,"; $sql.= " p.code as country_code, p.libelle as country"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.pays = p.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.country = p.rowid"; $sql.= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1"; if (is_numeric($foruserid)) $sql.=" AND d.rowid=".$foruserid; if ($foruserlogin) $sql.=" AND d.login='".$db->escape($foruserlogin)."'"; @@ -111,7 +111,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg // For backward compatibility '%SOCIETE%'=>$objp->company, '%ZIP%'=>$objp->zip, - '%PAYS%'=>$objp->country, + '%COUNTRY%'=>$objp->country, '%ANNEE%'=>$year, '%SERVEUR%'=>"http://".$_SERVER["SERVER_NAME"]."/" // deprecated ); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index c3be6de5ed8..54f160adfa3 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; // deprecated var $email; var $phone; @@ -225,7 +224,7 @@ class Adherent extends CommonObject '%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos, '%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe, '%ZIP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip, - '%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, + '%COUNTRY%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, ); complete_substitutions_array($substitutionarray, $langs); @@ -396,7 +395,7 @@ class Adherent extends CommonObject $this->address=($this->address?$this->address:$this->address); $this->zip=($this->zip?$this->zip:$this->zip); $this->town=($this->town?$this->town:$this->town); - $this->country_id=($this->country_id > 0?$this->country_id:$this->fk_pays); + $this->country_id=($this->country_id > 0?$this->country_id:$this->country_id); $this->state_id=($this->state_id > 0?$this->state_id:$this->fk_departement); if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords(trim($this->lastname)); if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords(trim($this->firstname)); @@ -421,7 +420,7 @@ class Adherent extends CommonObject $sql.= ", address=" .($this->address?"'".$this->db->escape($this->address)."'":"null"); $sql.= ", zip=" .($this->zip?"'".$this->db->escape($this->zip)."'":"null"); $sql.= ", town=" .($this->town?"'".$this->db->escape($this->town)."'":"null"); - $sql.= ", pays=" .($this->country_id>0?"'".$this->country_id."'":"null"); + $sql.= ", country=" .($this->country_id>0?"'".$this->country_id."'":"null"); $sql.= ", fk_departement=".($this->state_id>0?"'".$this->state_id."'":"null"); $sql.= ", email='".$this->email."'"; $sql.= ", phone=" .($this->phone?"'".$this->db->escape($this->phone)."'":"null"); @@ -1014,14 +1013,14 @@ class Adherent extends CommonObject $sql.= " d.datefin as datefin,"; $sql.= " d.naiss as datenaiss,"; $sql.= " d.datevalid as datev,"; - $sql.= " d.pays,"; + $sql.= " d.country,"; $sql.= " d.fk_departement,"; $sql.= " p.rowid as country_id, p.code as country_code, p.libelle as country,"; $sql.= " dep.nom as state, dep.code_departement as state_code,"; $sql.= " t.libelle as type, t.cotisation as cotisation,"; $sql.= " u.rowid as user_id, u.login as user_login"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.pays = p.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.country = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as dep ON d.fk_departement = dep.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON d.rowid = u.fk_member"; $sql.= " WHERE d.fk_adherent_type = t.rowid"; @@ -1067,7 +1066,6 @@ class Adherent extends CommonObject $this->country = $langs->transnoentitiesnoconv("Country".$obj->country_code); else $this->country=$obj->country; - $this->pays = $this->country; // deprecated $this->phone = $obj->phone; $this->phone_perso = $obj->phone_perso; diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 59b2a6e2402..81e5158d90d 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -728,7 +728,6 @@ else if ($object->country_id) { $tmparray=getCountry($object->country_id,'all'); - $object->pays=$tmparray['code']; $object->country_code=$tmparray['code']; $object->country=$tmparray['label']; } @@ -944,9 +943,9 @@ else $adht->fetch($object->typeid); // We set country_id, and country_code, country of the chosen country - if (isset($_POST["pays"]) || $object->country_id) + if (isset($_POST["country"]) || $object->country_id) { - $sql = "SELECT rowid, code, libelle as label from ".MAIN_DB_PREFIX."c_pays where rowid = ".(isset($_POST["pays"])?$_POST["pays"]:$object->country_id); + $sql = "SELECT rowid, code, libelle as label from ".MAIN_DB_PREFIX."c_pays where rowid = ".(isset($_POST["country"])?$_POST["country"]:$object->country_id); $resql=$db->query($sql); if ($resql) { @@ -956,7 +955,6 @@ else { dol_print_error($db); } - $object->pays=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label; $object->country_id=$obj->rowid; $object->country_code=$obj->code; $object->country=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label; diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index fcb421e14fe..f04173c00b9 100755 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -71,7 +71,7 @@ if ($mode) $data = array(); $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.libelle as label"; - $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_pays as c on d.pays = c.rowid"; + $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_pays as c on d.country = c.rowid"; $sql.=" WHERE d.entity IN (".getEntity().")"; $sql.=" AND d.statut = 1"; $sql.=" GROUP BY c.libelle, c.code"; @@ -87,7 +87,7 @@ if ($mode) $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, c.nom as label2"; $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.fk_departement = c.rowid"; $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region"; - $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.pays = p.rowid"; + $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.country = p.rowid"; $sql.=" WHERE d.entity IN (".getEntity().")"; $sql.=" AND d.statut = 1"; $sql.=" GROUP BY p.libelle, p.code, c.nom"; @@ -102,7 +102,7 @@ if ($mode) $data = array(); $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, d.town as label2"; $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d"; - $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.pays = p.rowid"; + $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.country = p.rowid"; $sql.=" WHERE d.entity IN (".getEntity().")"; $sql.=" AND d.statut = 1"; $sql.=" GROUP BY p.libelle, p.code, d.town"; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 271318258ee..6e5dd2aabae 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -61,7 +61,7 @@ if ( ($action == 'update' && empty($_POST["cancel"])) $mysoc->country_label=$tmparray['label']; $s=$mysoc->country_id.':'.$mysoc->country_code.':'.$mysoc->country_label; - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_PAYS", $s,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s,'chaine',0,'',$conf->entity); } dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$_POST["nom"],'chaine',0,'',$conf->entity); @@ -289,7 +289,7 @@ if ($action == 'edit' || $action == 'updateedit') // Country $var=!$var; print '
| '.$langs->trans("CompanyIds").' | '.$langs->trans("Value").' |