diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 0b4c4e499e3..c26df50bd53 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -757,30 +757,36 @@ class FormCompany extends Form * @param string $sortorder Sort criteria ('position', 'code', ...) * @param int $showempty 1=Add en empty line * @param string $morecss Add more css to select component + * @param int $output 0=return HTML, 1= direct print * @return void */ - public function selectTypeContact($object, $selected, $htmlname = 'type', $source = 'internal', $sortorder = 'position', $showempty = 0, $morecss = '') + public function selectTypeContact($object, $selected, $htmlname = 'type', $source = 'internal', $sortorder = 'position', $showempty = 0, $morecss = '', $output=1) { global $user, $langs; - + $out = ''; if (is_object($object) && method_exists($object, 'liste_type_contact')) { $lesTypes = $object->liste_type_contact($source, $sortorder, 0, 1); - print ''; + if ($showempty) $out .= ''; foreach ($lesTypes as $key=>$value) { - print ''; + $out .= '