Skip to content

Commit

Permalink
english language standardization
Browse files Browse the repository at this point in the history
  • Loading branch information
grandoc committed Feb 27, 2013
1 parent 61d5bd9 commit 6fb6b91
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 33 deletions.
9 changes: 4 additions & 5 deletions htdocs/adherents/canvas/actions_adherentcard_common.class.php
Expand Up @@ -286,10 +286,10 @@ function assign_values(&$action, $id)
}

// Zip
$this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6);
$this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','state_id'),6);

// Town
$this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','departement_id'));
$this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','state_id'));

if (dol_strlen(trim($this->object->country_id)) == 0) $this->object->country_id = $objsoc->country_id;

Expand All @@ -300,7 +300,7 @@ function assign_values(&$action, $id)
if ($user->admin) $this->tpl['info_admin'] = info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);

// State
if ($this->object->country_id) $this->tpl['select_state'] = $formcompany->select_state($this->object->fk_departement,$this->object->country_code);
if ($this->object->country_id) $this->tpl['select_state'] = $formcompany->select_state($this->object->state_id,$this->object->country_code);
else $this->tpl['select_state'] = $countrynotdefined;

// Physical or Moral
Expand Down Expand Up @@ -400,9 +400,8 @@ private function assign_post()
$this->object->address = $_POST["address"];
$this->object->zip = $_POST["zipcode"];
$this->object->town = $_POST["town"];
$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"];
$this->object->state_id = $_POST["state_id"];
$this->object->phone_perso = $_POST["phone_perso"];
$this->object->phone_mobile = $_POST["phone_mobile"];
$this->object->email = $_POST["email"];
Expand Down
Expand Up @@ -76,7 +76,7 @@

<tr>
<td><?php echo $langs->trans('State'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['departement']; ?></td>
<td colspan="3"><?php echo $this->control->tpl['state']; ?></td>
</tr>

<tr>
Expand Down
22 changes: 8 additions & 14 deletions htdocs/adherents/class/adherent.class.php
Expand Up @@ -56,9 +56,6 @@ class Adherent extends CommonObject
var $state_id; // Id of department
var $state_code; // Code of department
var $state; // Label of department
var $fk_departement; // deprecated
var $departement_code; // deprecated
var $departement; // deprecated

var $country_id;
var $country_code;
Expand Down Expand Up @@ -396,7 +393,7 @@ function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdp
$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->country_id);
$this->state_id=($this->state_id > 0?$this->state_id:$this->fk_departement);
$this->state_id=($this->state_id > 0?$this->state_id:$this->state_id);
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));

Expand All @@ -420,8 +417,8 @@ function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdp
$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.= ", country=" .($this->country_id>0?"'".$this->country_id."'":"null");
$sql.= ", fk_departement=".($this->state_id>0?"'".$this->state_id."'":"null");
$sql.= ", country=".($this->country_id>0?"'".$this->country_id."'":"null");
$sql.= ", state_id=".($this->state_id>0?"'".$this->state_id."'":"null");
$sql.= ", email='".$this->email."'";
$sql.= ", phone=" .($this->phone?"'".$this->db->escape($this->phone)."'":"null");
$sql.= ", phone_perso=" .($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null");
Expand Down Expand Up @@ -1014,14 +1011,14 @@ function fetch($rowid,$ref='',$fk_soc='')
$sql.= " d.naiss as datenaiss,";
$sql.= " d.datevalid as datev,";
$sql.= " d.country,";
$sql.= " d.fk_departement,";
$sql.= " d.state_id,";
$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.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."c_departements as dep ON d.state_id = 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";
if ($rowid) $sql.= " AND d.rowid=".$rowid;
Expand Down Expand Up @@ -1053,12 +1050,9 @@ function fetch($rowid,$ref='',$fk_soc='')
$this->zip = $obj->zip;
$this->town = $obj->town;

$this->state_id = $obj->fk_departement;
$this->state_code = $obj->fk_departement?$obj->state_code:'';
$this->state = $obj->fk_departement?$obj->state:'';
$this->fk_departement = $obj->fk_departement; // deprecated
$this->departement_code = $obj->fk_departement?$obj->state_code:''; // deprecated
$this->departement = $obj->fk_departement?$obj->state:''; // deprecated
$this->state_id = $obj->state_id;
$this->state_code = $obj->state_id?$obj->state_code:'';
$this->state = $obj->state_id?$obj->state:'';

$this->country_id = $obj->country_id;
$this->country_code = $obj->country_code;
Expand Down
22 changes: 10 additions & 12 deletions htdocs/adherents/fiche.php
Expand Up @@ -260,9 +260,8 @@
$object->address = trim($_POST["address"]);
$object->zip = trim($_POST["zipcode"]);
$object->town = trim($_POST["town"]);
$object->state_id = $_POST["departement_id"];
$object->state_id = $_POST["state_id"];
$object->country_id = $_POST["country_id"];
$object->fk_departement = $_POST["departement_id"]; // deprecated

$object->phone = trim($_POST["phone"]);
$object->phone_perso = trim($_POST["phone_perso"]);
Expand Down Expand Up @@ -410,7 +409,7 @@
$address=$_POST["address"];
$zip=$_POST["zipcode"];
$town=$_POST["town"];
$state_id=$_POST["departement_id"];
$state_id=$_POST["state_id"];
$country_id=$_POST["country_id"];

$phone=$_POST["phone"];
Expand All @@ -435,7 +434,6 @@
$object->address = $address;
$object->zip = $zip;
$object->town = $town;
$object->fk_departement = $state_id;
$object->state_id = $state_id;
$object->country_id = $country_id;
$object->phone = $phone;
Expand Down Expand Up @@ -721,7 +719,7 @@
/* */
/* ************************************************************************** */
$object->canvas=$canvas;
$object->fk_departement = GETPOST('departement_id', 'int');
$object->state_id = GETPOST('departement_id', 'int');

// We set country_id, country_code and country for the selected country
$object->country_id=GETPOST('country_id','int')?GETPOST('country_id','int'):$mysoc->country_id;
Expand Down Expand Up @@ -833,9 +831,9 @@ function initfieldrequired()

// Zip / Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
print $formcompany->select_ziptown((GETPOST('zipcode','alpha')?GETPOST('zipcode','alpha'):$object->zip),'zipcode',array('town','selectcountry_id','departement_id'),6);
print $formcompany->select_ziptown((GETPOST('zipcode','alpha')?GETPOST('zipcode','alpha'):$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
print ' ';
print $formcompany->select_ziptown((GETPOST('town','alpha')?GETPOST('town','alpha'):$object->town),'town',array('zipcode','selectcountry_id','departement_id'));
print $formcompany->select_ziptown((GETPOST('town','alpha')?GETPOST('town','alpha'):$object->town),'town',array('zipcode','selectcountry_id','state_id'));
print '</td></tr>';

// Country
Expand All @@ -851,7 +849,7 @@ function initfieldrequired()
print '<tr><td>'.$langs->trans('State').'</td><td>';
if ($object->country_id)
{
print $formcompany->select_state(GETPOST('departement_id','int')?GETPOST('departement_id','int'):$object->fk_departement,$object->country_code);
print $formcompany->select_state(GETPOST('state_id','int')?GETPOST('state_id','int'):$object->state_id,$object->country_code);
}
else
{
Expand Down Expand Up @@ -1083,9 +1081,9 @@ function initfieldrequired()

// Zip / Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','departement_id'),6);
print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
print ' ';
print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','departement_id'));
print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id'));
print '</td></tr>';

// Country
Expand All @@ -1099,7 +1097,7 @@ function initfieldrequired()
if (empty($conf->global->MEMBER_DISABLE_STATE))
{
print '<tr><td>'.$langs->trans('State').'</td><td>';
print $formcompany->select_state($object->fk_departement,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id);
print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id);
print '</td></tr>';
}

Expand Down Expand Up @@ -1432,7 +1430,7 @@ function initfieldrequired()
print '</td></tr>';

// State
print '<tr><td>'.$langs->trans('State').'</td><td class="valeur">'.$object->departement.'</td>';
print '<tr><td>'.$langs->trans('State').'</td><td class="valeur">'.$object->state.'</td>';

// Tel pro.
print '<tr><td>'.$langs->trans("PhonePro").'</td><td class="valeur">'.dol_print_phone($object->phone,$object->country_code,0,$object->fk_soc,1).'</td></tr>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/stats/geo.php
Expand Up @@ -85,7 +85,7 @@

$data = array();
$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.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = 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.country = p.rowid";
$sql.=" WHERE d.entity IN (".getEntity().")";
Expand Down
1 change: 1 addition & 0 deletions htdocs/install/mysql/migration/3.3.0-3.4.0.sql
Expand Up @@ -60,6 +60,7 @@ alter table llx_adherent CHANGE COLUMN prenom firstname varchar(50);
alter table llx_adherent CHANGE COLUMN ville town text;
alter table llx_adherent CHANGE COLUMN cp zip varchar(10);
alter table llx_adherent CHANGE COLUMN pays country varchar(50);
alter table llx_adherent CHANGE COLUMN fk_departement state_id varchar(50);
alter table llx_mailing_cibles CHANGE COLUMN nom lastname varchar(50);
alter table llx_mailing_cibles CHANGE COLUMN prenom firstname varchar(50);
alter table llx_user CHANGE COLUMN name lastname varchar(50);
Expand Down

0 comments on commit 6fb6b91

Please sign in to comment.