diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index b4bdb119b29..412b76ea15e 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -70,6 +70,18 @@ class AdherentType extends CommonObject * @var string Adherent type nature */ public $morphy; + + public $duration; + + /* + * type expiration + */ + public $duration_value; + + /** + * Expiration unit + */ + public $duration_unit; /** * @var int Subsription required (0 or 1) @@ -373,8 +385,9 @@ class AdherentType extends CommonObject $sql.= "SET "; $sql.= "statut = ".$this->statut.","; $sql.= "libelle = '".$this->db->escape($this->label) ."',"; - $sql.= "morphy = '".$this->db->escape($this->morphy) ."',"; + $sql.= "morphy = '".$this->db->escape($this->morphy) ."',"; $sql.= "subscription = '".$this->db->escape($this->subscription)."',"; + $sql.= "duration = '" . $this->db->escape($this->duration_value . $this->duration_unit) ."',"; $sql.= "note = '".$this->db->escape($this->note)."',"; $sql.= "vote = ".(integer) $this->db->escape($this->vote).","; $sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'"; @@ -476,7 +489,7 @@ class AdherentType extends CommonObject { global $langs, $conf; - $sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut, d.subscription, d.mail_valid, d.note, d.vote"; + $sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut, d.duration, d.subscription, d.mail_valid, d.note, d.vote"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d"; $sql .= " WHERE d.rowid = ".(int) $rowid; @@ -494,6 +507,9 @@ class AdherentType extends CommonObject $this->label = $obj->label; $this->morphy = $obj->morphy; $this->statut = $obj->statut; + $this->duration = $obj->duration; + $this->duration_value = substr($obj->duration, 0, dol_strlen($obj->duration)-1); + $this->duration_unit = substr($obj->duration, -1); $this->subscription = $obj->subscription; $this->mail_valid = $obj->mail_valid; $this->note = $obj->note;