|
@@ -215,6 +215,12 @@ class Adherent extends CommonObject
|
|
|
*/
|
|
|
public $public;
|
|
|
|
|
|
+ /**
|
|
|
+ * Default language code of member (en_US, ...)
|
|
|
+ * @var string
|
|
|
+ */
|
|
|
+ public $default_lang;
|
|
|
+
|
|
|
/**
|
|
|
* @var string photo of member
|
|
|
*/
|
|
@@ -328,6 +334,7 @@ class Adherent extends CommonObject
|
|
|
'photo' => array('type' => 'varchar(255)', 'label' => 'Photo', 'enabled' => 1, 'visible' => -1, 'position' => 135),
|
|
|
'public' => array('type' => 'smallint(6)', 'label' => 'Public', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 145),
|
|
|
'datefin' => array('type' => 'datetime', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => -1, 'position' => 150),
|
|
|
+ 'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>-1, 'position'=> 153),
|
|
|
'note_private' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155),
|
|
|
'note_public' => array('type' => 'text', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 160),
|
|
|
'datevalid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 165),
|
|
@@ -710,9 +717,11 @@ class Adherent extends CommonObject
|
|
|
$sql .= ", photo = ".($this->photo ? "'".$this->db->escape($this->photo)."'" : "null");
|
|
|
$sql .= ", public = '".$this->db->escape($this->public)."'";
|
|
|
$sql .= ", statut = ".$this->db->escape($this->statut);
|
|
|
+ $sql .= ", default_lang = ".(!empty($this->default_lang) ? "'".$this->db->escape($this->default_lang)."'" : "null");
|
|
|
$sql .= ", fk_adherent_type = ".$this->db->escape($this->typeid);
|
|
|
$sql .= ", morphy = '".$this->db->escape($this->morphy)."'";
|
|
|
$sql .= ", birth = ".($this->birth ? "'".$this->db->idate($this->birth)."'" : "null");
|
|
|
+
|
|
|
if ($this->datefin) {
|
|
|
$sql .= ", datefin = '".$this->db->idate($this->datefin)."'"; // Must be modified only when deleting a subscription
|
|
|
}
|
|
@@ -833,6 +842,8 @@ class Adherent extends CommonObject
|
|
|
$luser->office_phone = $this->phone;
|
|
|
$luser->user_mobile = $this->phone_mobile;
|
|
|
|
|
|
+ $luser->lang = $this->default_lang;
|
|
|
+
|
|
|
$luser->fk_member = $this->id;
|
|
|
|
|
|
$result = $luser->update($user, 0, 1, 1); // Use nosync to 1 to avoid cyclic updates
|
|
@@ -868,6 +879,7 @@ class Adherent extends CommonObject
|
|
|
$lthirdparty->state_id = $this->state_id;
|
|
|
$lthirdparty->country_id = $this->country_id;
|
|
|
//$lthirdparty->phone_mobile=$this->phone_mobile;
|
|
|
+ $lthirdparty->default_lang = $this->default_lang;
|
|
|
|
|
|
$result = $lthirdparty->update($this->fk_soc, $user, 0, 1, 1, 'update'); // Use sync to 0 to avoid cyclic updates
|
|
|
|
|
@@ -1314,7 +1326,7 @@ class Adherent extends CommonObject
|
|
|
$sql .= " d.photo, d.fk_adherent_type, d.morphy, d.entity,";
|
|
|
$sql .= " d.datec as datec,";
|
|
|
$sql .= " d.tms as datem,";
|
|
|
- $sql .= " d.datefin as datefin,";
|
|
|
+ $sql .= " d.datefin as datefin, d.default_lang,";
|
|
|
$sql .= " d.birth as birthday,";
|
|
|
$sql .= " d.datevalid as datev,";
|
|
|
$sql .= " d.country,";
|
|
@@ -1407,6 +1419,8 @@ class Adherent extends CommonObject
|
|
|
$this->date_validation = $this->db->jdate($obj->datev);
|
|
|
$this->birth = $this->db->jdate($obj->birthday);
|
|
|
|
|
|
+ $this->default_lang = $obj->default_lang;
|
|
|
+
|
|
|
$this->note_private = $obj->note_private;
|
|
|
$this->note_public = $obj->note_public;
|
|
|
$this->morphy = $obj->morphy;
|
|
@@ -2556,6 +2570,7 @@ class Adherent extends CommonObject
|
|
|
|
|
|
$this->datefin = $now;
|
|
|
$this->datevalid = $now;
|
|
|
+ $this->default_lang = '';
|
|
|
|
|
|
$this->typeid = 1; // Id type adherent
|
|
|
$this->type = 'Type adherent'; // Libelle type adherent
|