diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 4c4881472c8..61bacfb3e66 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1588,7 +1588,7 @@ if ($action == 'create') { // Contacts (ask contact only if thirdparty already defined). print "".$langs->trans("DefaultContact").''; print img_picto('', 'contact'); - print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, $srccontactslist); + print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, '', '', 0, 'minwidth300'); print ''; // Third party discounts info line diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 60234fa0d70..96a67f4051e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8280,9 +8280,10 @@ class Form } } else { $nophoto = '/public/theme/common/nophoto.png'; - if (in_array($modulepart, array('userphoto', 'contact', 'memberphoto'))) { // For module that are "physical" users - if ($modulepart == 'memberphoto' && strpos($object->morphy, 'mor') !== false) { - $nophoto = '/public/theme/common/company.png'; + $defaultimg = 'identicon'; // For gravatar + if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found + if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && strpos($object->morphy, 'mor')) !== false) { + $nophoto = 'company'; } else { $nophoto = '/public/theme/common/user_anonymous.png'; if ($object->gender == 'man') { @@ -8296,13 +8297,14 @@ class Form if (!empty($conf->gravatar->enabled) && $email && empty($noexternsourceoverwrite)) { // see https://gravatar.com/site/implement/images/php/ - global $dolibarr_main_url_root; $ret .= ''; - //$defaultimg=urlencode(dol_buildpath($nophoto,3)); - $defaultimg = 'mm'; $ret .= 'Gravatar avatar'; // gravatar need md5 hash } else { - $ret .= 'No photo'; + if ($nophoto == 'company') { + $ret .= '
'.img_picto('', 'company').'
'; + } else { + $ret .= 'No photo'; + } } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5cece48ce5d..d22aa0d40e2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1751,53 +1751,26 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi } $modulepart = 'unknown'; - if ($object->element == 'societe') { - $modulepart = 'societe'; - } - if ($object->element == 'contact') { - $modulepart = 'contact'; - } - if ($object->element == 'member') { + if ($object->element == 'societe' || $object->element == 'contact' || $object->element == 'product' || $object->element == 'ticket') { + $modulepart = $object->element; + } elseif ($object->element == 'member') { $modulepart = 'memberphoto'; - } - if ($object->element == 'user') { + } elseif ($object->element == 'user') { $modulepart = 'userphoto'; } - if ($object->element == 'product') { - $modulepart = 'product'; - } - if ($object->element == 'ticket') { - $modulepart = 'ticket'; - } if (class_exists("Imagick")) { - if ($object->element == 'propal') { - $modulepart = 'propal'; - } - if ($object->element == 'commande') { - $modulepart = 'commande'; - } - if ($object->element == 'facture') { - $modulepart = 'facture'; - } - if ($object->element == 'fichinter') { + if ($object->element == 'expensereport' || $object->element == 'propal' || $object->element == 'commande' || $object->element == 'facture' || $object->element == 'supplier_proposal') { + $modulepart = $object->element; + } elseif ($object->element == 'fichinter') { $modulepart = 'ficheinter'; - } - if ($object->element == 'contrat') { + } elseif ($object->element == 'contrat') { $modulepart = 'contract'; - } - if ($object->element == 'supplier_proposal') { - $modulepart = 'supplier_proposal'; - } - if ($object->element == 'order_supplier') { + } elseif ($object->element == 'order_supplier') { $modulepart = 'supplier_order'; - } - if ($object->element == 'invoice_supplier') { + } elseif ($object->element == 'invoice_supplier') { $modulepart = 'supplier_invoice'; } - if ($object->element == 'expensereport') { - $modulepart = 'expensereport'; - } } if ($object->element == 'product') { @@ -1903,7 +1876,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi $phototoshow .= ''; } } - } elseif (!$phototoshow) { // example if modulepart = 'photo' + } elseif (!$phototoshow) { // example if modulepart = 'societe' or 'photo' $phototoshow .= $form->showphoto($modulepart, $object, 0, 0, 0, 'photoref', 'small', 1, 0, $maxvisiblephotos); }