From 3cdff5361fcf7009bc29c8a879dd2440be8a9197 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 18 Mar 2012 12:18:23 +0100 Subject: [PATCH] Fix: add empty message in combobox --- htdocs/core/class/html.form.class.php | 8 ++++++-- htdocs/core/tpl/contacts.tpl.php | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 03d5ddb35de..e518fab260d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -815,9 +815,9 @@ class Form if ($resql) { $num=$this->db->num_rows($resql); - if ($num == 0) return 0; + $disable=($num==0 ? ' disabled="disabled"' : ''); - if ($htmlname != 'none') print ''; if ($showempty) print ''; $num = $this->db->num_rows($resql); $i = 0; @@ -870,6 +870,10 @@ class Form $i++; } } + else + { + print ''; + } if ($htmlname != 'none') { print ''; diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 3143722e952..800ed417988 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -76,7 +76,6 @@ $userstatic=new User($db); select_contacts($selectedCompany, '', 'contactid'); ?> - trans("NoContactDefined"); ?> selectTypeContact($object, '', 'type','external'); ?>