From 9400d9897a9a26c56998c8cc23583d629608ffcc Mon Sep 17 00:00:00 2001
From: Grand Philippe <contact@atoo-net.com>
Date: Sat, 23 Feb 2013 10:35:46 +0100
Subject: [PATCH]  english standardization

---
 htdocs/public/members/public_list.php         |  6 ++---
 htdocs/societe/agenda.php                     |  2 +-
 .../canvas/individual/tpl/card_create.tpl.php |  2 +-
 .../canvas/individual/tpl/card_view.tpl.php   |  2 +-
 htdocs/societe/class/address.class.php        |  7 ++---
 htdocs/societe/class/societe.class.php        | 26 ++++++-------------
 6 files changed, 16 insertions(+), 29 deletions(-)

diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php
index e49bab35a4d..13fced8eda2 100644
--- a/htdocs/public/members/public_list.php
+++ b/htdocs/public/members/public_list.php
@@ -101,14 +101,14 @@ if (! $sortfield) {  $sortfield="nom"; }
 
 llxHeaderVierge($langs->trans("ListOfValidatedPublicMembers"));
 
-$sql = "SELECT rowid, prenom, nom, societe, cp as zip, ville as town, email, naiss, photo";
+$sql = "SELECT rowid, prenom, nom, societe, cp as zip, town, email, naiss, photo";
 $sql.= " FROM ".MAIN_DB_PREFIX."adherent";
 $sql.= " WHERE entity = ".$entity;
 $sql.= " AND statut = 1";
 $sql.= " AND public = 1";
 $sql.= $db->order($sortfield,$sortorder);
 $sql.= $db->plimit($conf->liste_limit+1, $offset);
-//$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, cp, ville, d.email, t.libelle as type, d.morphy, d.statut, t.cotisation";
+//$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, cp, town, d.email, t.libelle as type, d.morphy, d.statut, t.cotisation";
 //$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
 //$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = $statut";
 //$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
@@ -130,7 +130,7 @@ if ($result)
 	//print_liste_field_titre($langs->trans("DateToBirth"),"public_list.php","naiss",'',$param,$sortfield,$sortorder); // est-ce nécessaire ??
 	print_liste_field_titre($langs->trans("EMail"),"public_list.php","email",'',$param,$sortfield,$sortorder);
 	print_liste_field_titre($langs->trans("Zip"),"public_list.php","cp","",$param,$sortfield,$sortorder);
-	print_liste_field_titre($langs->trans("Town"),"public_list.php","ville","",$param,$sortfield,$sortorder);
+	print_liste_field_titre($langs->trans("Town"),"public_list.php","town","",$param,$sortfield,$sortorder);
 	print "<td>".$langs->trans("Photo")."</td>\n";
 	print "</tr>\n";
 
diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php
index bc9b11b3149..abe85206fca 100644
--- a/htdocs/societe/agenda.php
+++ b/htdocs/societe/agenda.php
@@ -120,7 +120,7 @@ if ($socid)
 
 	// Zip / Town
 	print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$soc->cp."</td>";
-	print '<td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$soc->ville."</td></tr>";
+	print '<td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$soc->town."</td></tr>";
 
 	// Country
 	if ($soc->pays) {
diff --git a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php
index b4ae5c5547c..d889db81ab9 100644
--- a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php
+++ b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php
@@ -122,7 +122,7 @@
 	<td><?php echo $langs->trans('Zip'); ?></td>
 	<td><input size="6" type="text" name="cp" value="<?php echo $this->control->tpl['cp']; ?>"><?php echo $this->control->tpl['autofilltownfromzip']; ?></td>
 	<td><?php echo $langs->trans('Town'); ?></td>
-	<td><input type="text" name="ville" value="<?php echo $this->control->tpl['ville']; ?>"></td>
+	<td><input type="text" name="town" value="<?php echo $this->control->tpl['town']; ?>"></td>
 </tr>
 
 <tr>
diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
index 75179a3a04a..30794b2a604 100644
--- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
+++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
@@ -84,7 +84,7 @@ dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company');
 	<td width="25%"><?php echo $langs->trans('Zip'); ?></td>
 	<td width="25%"><?php echo $this->control->tpl['cp']; ?></td>
 	<td width="25%"><?php echo $langs->trans('Town'); ?></td>
-	<td width="25%"><?php echo $this->control->tpl['ville']; ?></td>
+	<td width="25%"><?php echo $this->control->tpl['town']; ?></td>
 </tr>
 
 <tr>
diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php
index 07830e7bb0b..7a8ba22dd41 100644
--- a/htdocs/societe/class/address.class.php
+++ b/htdocs/societe/class/address.class.php
@@ -40,7 +40,6 @@ class Address
 	var $address;
 	var $cp;			// deprecated
 	var $zip;
-	var $ville;			// deprecated
 	var $town;
 	var $pays_id;		// deprecated
 	var $country_id;
@@ -271,7 +270,7 @@ class Address
 			{
 				$sql = 'SELECT a.rowid as id, a.label, a.name, a.address, a.datec as dc';
 				$sql .= ', a.tms as date_update, a.fk_soc';
-				$sql .= ', a.cp as zip, a.ville as town, a.note, a.fk_pays as country_id, a.tel, a.fax';
+				$sql .= ', a.cp as zip, a.town, a.note, a.fk_pays as country_id, a.tel, a.fax';
 				$sql .= ', p.code as country_code, p.libelle as country';
 				$sql .= ' FROM '.MAIN_DB_PREFIX.'societe_address as a';
 				$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON a.fk_pays = p.rowid';
@@ -305,7 +304,6 @@ class Address
 
 						// deprecated
 						$line->cp				= $line->zip;
-						$line->ville			= $line->town;
 						$line->pays_id			= $line->country_id;
 						$line->pays_code		= $line->country_code;
 						$line->pays				= $line->country;
@@ -350,7 +348,7 @@ class Address
 
 		$sql = 'SELECT a.rowid, a.fk_soc, a.label, a.name, a.address, a.datec as date_creation';
 		$sql .= ', a.tms as date_update';
-		$sql .= ', a.cp as zip, a.ville as town, a.note, a.fk_pays as country_id, a.tel, a.fax';
+		$sql .= ', a.cp as zip, a.town, a.note, a.fk_pays as country_id, a.tel, a.fax';
 		$sql .= ', p.code as country_code, p.libelle as country';
 		$sql .= ' FROM '.MAIN_DB_PREFIX.'societe_address as a';
 		$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON a.fk_pays = p.rowid';
@@ -384,7 +382,6 @@ class Address
 
 				// deprecated
 				$this->cp				= $this->zip;
-				$this->ville			= $this->town;
 				$this->pays_id			= $this->country_id;
 				$this->pays_code		= $this->country_code;
 				$this->pays				= $this->country;
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 4d45d8d01f9..b73902851db 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -48,10 +48,8 @@ class Societe extends CommonObject
     var $particulier;
     var $civility_id;
     var $address;
-    var $adresse;  // TODO obsolete
     var $cp;       // TODO obsolete
     var $zip;
-    var $ville;    // TODO obsolete
     var $town;
     var $status;   // 0=activity ceased, 1= in activity
 
@@ -394,12 +392,10 @@ class Societe extends CommonObject
         $this->name			= $this->name?trim($this->name):trim($this->nom);
         $this->nom			= trim($this->nom);		// TODO obsolete
         $this->ref_ext		= trim($this->ref_ext);
-        $this->address		= $this->address?trim($this->address):trim($this->adresse);
-        $this->adresse		= $this->address;		// TODO obsolete
+        $this->address		= $this->address?trim($this->address):trim($this->address);
         $this->zip			= $this->zip?trim($this->zip):trim($this->cp);
         $this->cp			= $this->zip;			// TODO obsolete
-        $this->town			= $this->town?trim($this->town):trim($this->ville);
-        $this->ville		= $this->town;			// TODO obsolete
+        $this->town			= $this->town?trim($this->town):trim($this->town);
         $this->state_id		= trim($this->state_id);
         $this->country_id	= ($this->country_id > 0)?$this->country_id:$this->pays_id;
         $this->pays_id      = $this->country_id;	// TODO obsolete
@@ -501,7 +497,7 @@ class Societe extends CommonObject
             $sql .= ",address = '" . $this->db->escape($this->address) ."'";
 
             $sql .= ",cp = ".(! empty($this->zip)?"'".$this->zip."'":"null");
-            $sql .= ",ville = ".(! empty($this->town)?"'".$this->db->escape($this->town)."'":"null");
+            $sql .= ",town = ".(! empty($this->town)?"'".$this->db->escape($this->town)."'":"null");
 
             $sql .= ",fk_departement = '" . (! empty($this->state_id)?$this->state_id:'0') ."'";
             $sql .= ",fk_pays = '" . (! empty($this->country_id)?$this->country_id:'0') ."'";
@@ -699,7 +695,7 @@ class Societe extends CommonObject
         $sql .= ', s.status';
         $sql .= ', s.price_level';
         $sql .= ', s.tms as date_update';
-        $sql .= ', s.tel as phone, s.fax, s.email, s.url, s.cp as zip, s.ville as town, s.note, s.client, s.fournisseur';
+        $sql .= ', s.tel as phone, s.fax, s.email, s.url, s.cp as zip, s.town, s.note, s.client, s.fournisseur';
         $sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6';
         $sql .= ', s.capital, s.tva_intra';
         $sql .= ', s.fk_typent as typent_id';
@@ -760,11 +756,9 @@ class Societe extends CommonObject
                 $this->date_update = $this->db->jdate($obj->date_update);
 
                 $this->address 		= $obj->address;
-                $this->adresse      = $obj->address;	// TODO obsolete
                 $this->zip 			= $obj->zip;
                 $this->cp           = $obj->zip;		// TODO obsolete
                 $this->town 		= $obj->town;
-                $this->ville        = $obj->town;		// TODO obsolete
 
                 $this->pays_id 		= $obj->country_id;	// TODO obsolete
                 $this->country_id   = $obj->country_id;
@@ -2442,12 +2436,10 @@ class Societe extends CommonObject
         // Positionne parametres
         $this->nom=$name;				// TODO obsolete
         $this->name=$name;
-        $this->adresse=$member->adresse; // TODO obsolete
-        $this->address=$member->adresse;
+        $this->address=$member->address;
         $this->cp=$member->cp;			// TODO obsolete
         $this->zip=$member->cp;
-        $this->ville=$member->ville;	// TODO obsolete
-        $this->town=$member->ville;
+        $this->town=$member->town;
         $this->pays_code=$member->country_code;	// TODO obsolete
         $this->country_code=$member->country_code;
         $this->pays_id=$member->country_id;	// TODO obsolete
@@ -2508,16 +2500,14 @@ class Societe extends CommonObject
 
     	$this->id=0;
     	$this->name=empty($conf->global->MAIN_INFO_SOCIETE_NOM)?'':$conf->global->MAIN_INFO_SOCIETE_NOM;
-    	$this->address=empty($conf->global->MAIN_INFO_SOCIETE_ADRESSE)?'':$conf->global->MAIN_INFO_SOCIETE_ADRESSE;
+    	$this->address=empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS;
     	$this->zip=empty($conf->global->MAIN_INFO_SOCIETE_CP)?'':$conf->global->MAIN_INFO_SOCIETE_CP;
-    	$this->town=empty($conf->global->MAIN_INFO_SOCIETE_VILLE)?'':$conf->global->MAIN_INFO_SOCIETE_VILLE;
+    	$this->town=empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN;
     	$this->state_id=empty($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT)?'':$conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT;
     	$this->note=empty($conf->global->MAIN_INFO_SOCIETE_NOTE)?'':$conf->global->MAIN_INFO_SOCIETE_NOTE;
     	
     	$this->nom=$this->name; 									// deprecated
-    	$this->adresse=$this->address; 								// deprecated
     	$this->cp=$this->zip;										// deprecated
-    	$this->ville=$this->town;									// deprecated
     	   
     	// We define country_id, country_code and country
     	$country_id=$country_code=$country_label='';
-- 
GitLab