From 036f70860e6440c3177439f6878de05ab2fefaff Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 24 Oct 2018 10:17:21 +0200 Subject: [PATCH 1/2] FIX : wrong occurence number of contract on contact card, we must only count externals --- htdocs/contact/class/contact.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 036ee75a43d..bea6843de5f 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -860,6 +860,7 @@ class Contact extends CommonObject $sql.=" FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc"; $sql.=" WHERE ec.fk_c_type_contact = tc.rowid"; $sql.=" AND fk_socpeople = ". $this->id; + $sql.=" AND tc.source = 'external'"; $sql.=" GROUP BY tc.element"; dol_syslog(get_class($this)."::load_ref_elements", LOG_DEBUG); From fccea99e23fd16f5cfed56db3f28b83e1bcfeae3 Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Wed, 24 Oct 2018 10:23:27 +0200 Subject: [PATCH 2/2] FIX translation in select unit form --- htdocs/core/class/html.form.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0ed036f1d1f..cebd49737e5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3388,13 +3388,19 @@ class Form while($res = $this->db->fetch_object($resql)) { + $unitLabel = $res->label; + if (! empty($langs->tab_translate['unit'.$res->code])) // check if Translation is available before + { + $unitLabel = $langs->trans('unit'.$res->code)!=$res->label?$langs->trans('unit'.$res->code):$res->label; + } + if ($selected == $res->rowid) { - $return.=''; + $return.=''; } else { - $return.=''; + $return.=''; } } $return.='';