From be2a93f4725006954aa68b42fa2ca3bb3a059d1c Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 23 Apr 2026 14:57:36 +0200 Subject: [PATCH] Add phone_code and trunk_prefix to ccountry class (#37983) get phone code and trunk prefix by API Co-authored-by: Laurent Destailleur --- htdocs/core/class/ccountry.class.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index bb74def3838..bde23c299d1 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -62,6 +62,16 @@ class Ccountry extends CommonDict */ public $numeric_code; + /** + * @var string + */ + public $phone_code; + + /** + * @var string + */ + public $trunk_prefix; + /** * @var array|string,position:int,visible:int<-6,6>|string,langfile?:string,notnull?:int<-1,1>,noteditable?:int<0,1>,alwayseditable?:int<0,1>|string,default?:string|int,index?:int<0,1>,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,cssview?:string,csslist?:string,help?:string,helplist?:string,showoncombobox?:int<0,4>|string,disabled?:int<0,1>|string,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>|string,showonheader?:int<0,1>,searchmulti?:int<0,1>,picto?:string,required?:int<0,1>,placeholder?:string}> @@ -173,7 +183,9 @@ class Ccountry extends CommonDict $sql .= " t.eec,"; $sql .= " t.active,"; $sql .= " t.favorite,"; - $sql .= " t.numeric_code"; + $sql .= " t.numeric_code,"; + $sql .= " t.phone_code,"; + $sql .= " t.trunk_prefix"; $sql .= " FROM ".$this->db->prefix()."c_country as t"; if ($id) { $sql .= " WHERE t.rowid = ".((int) $id); @@ -199,6 +211,8 @@ class Ccountry extends CommonDict $this->active = (int) $obj->active; $this->favorite = $obj->favorite; $this->numeric_code = $obj->numeric_code; + $this->phone_code = $obj->phone_code; + $this->trunk_prefix = $obj->trunk_prefix; } $this->db->free($resql);