Look and feel v14

This commit is contained in:
Laurent Destailleur
2021-04-01 12:27:02 +02:00
parent 3d1c47db35
commit 354adbde54
3 changed files with 21 additions and 46 deletions

View File

@@ -1588,7 +1588,7 @@ if ($action == 'create') {
// Contacts (ask contact only if thirdparty already defined). // Contacts (ask contact only if thirdparty already defined).
print "<tr><td>".$langs->trans("DefaultContact").'</td><td>'; print "<tr><td>".$langs->trans("DefaultContact").'</td><td>';
print img_picto('', 'contact'); print img_picto('', 'contact');
print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, $srccontactslist); print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, '', '', 0, 'minwidth300');
print '</td></tr>'; print '</td></tr>';
// Third party discounts info line // Third party discounts info line

View File

@@ -8280,9 +8280,10 @@ class Form
} }
} else { } else {
$nophoto = '/public/theme/common/nophoto.png'; $nophoto = '/public/theme/common/nophoto.png';
if (in_array($modulepart, array('userphoto', 'contact', 'memberphoto'))) { // For module that are "physical" users $defaultimg = 'identicon'; // For gravatar
if ($modulepart == 'memberphoto' && strpos($object->morphy, 'mor') !== false) { if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found
$nophoto = '/public/theme/common/company.png'; if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && strpos($object->morphy, 'mor')) !== false) {
$nophoto = 'company';
} else { } else {
$nophoto = '/public/theme/common/user_anonymous.png'; $nophoto = '/public/theme/common/user_anonymous.png';
if ($object->gender == 'man') { if ($object->gender == 'man') {
@@ -8296,13 +8297,14 @@ class Form
if (!empty($conf->gravatar->enabled) && $email && empty($noexternsourceoverwrite)) { if (!empty($conf->gravatar->enabled) && $email && empty($noexternsourceoverwrite)) {
// see https://gravatar.com/site/implement/images/php/ // see https://gravatar.com/site/implement/images/php/
global $dolibarr_main_url_root;
$ret .= '<!-- Put link to gravatar -->'; $ret .= '<!-- Put link to gravatar -->';
//$defaultimg=urlencode(dol_buildpath($nophoto,3));
$defaultimg = 'mm';
$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="Gravatar avatar" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.md5(strtolower(trim($email))).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="Gravatar avatar" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.md5(strtolower(trim($email))).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash
} else { } else {
$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; if ($nophoto == 'company') {
$ret .= '<div class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'">'.img_picto('', 'company').'</div>';
} else {
$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
}
} }
} }

View File

@@ -1751,53 +1751,26 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
} }
$modulepart = 'unknown'; $modulepart = 'unknown';
if ($object->element == 'societe') { if ($object->element == 'societe' || $object->element == 'contact' || $object->element == 'product' || $object->element == 'ticket') {
$modulepart = 'societe'; $modulepart = $object->element;
} } elseif ($object->element == 'member') {
if ($object->element == 'contact') {
$modulepart = 'contact';
}
if ($object->element == 'member') {
$modulepart = 'memberphoto'; $modulepart = 'memberphoto';
} } elseif ($object->element == 'user') {
if ($object->element == 'user') {
$modulepart = 'userphoto'; $modulepart = 'userphoto';
} }
if ($object->element == 'product') {
$modulepart = 'product';
}
if ($object->element == 'ticket') {
$modulepart = 'ticket';
}
if (class_exists("Imagick")) { if (class_exists("Imagick")) {
if ($object->element == 'propal') { if ($object->element == 'expensereport' || $object->element == 'propal' || $object->element == 'commande' || $object->element == 'facture' || $object->element == 'supplier_proposal') {
$modulepart = 'propal'; $modulepart = $object->element;
} } elseif ($object->element == 'fichinter') {
if ($object->element == 'commande') {
$modulepart = 'commande';
}
if ($object->element == 'facture') {
$modulepart = 'facture';
}
if ($object->element == 'fichinter') {
$modulepart = 'ficheinter'; $modulepart = 'ficheinter';
} } elseif ($object->element == 'contrat') {
if ($object->element == 'contrat') {
$modulepart = 'contract'; $modulepart = 'contract';
} } elseif ($object->element == 'order_supplier') {
if ($object->element == 'supplier_proposal') {
$modulepart = 'supplier_proposal';
}
if ($object->element == 'order_supplier') {
$modulepart = 'supplier_order'; $modulepart = 'supplier_order';
} } elseif ($object->element == 'invoice_supplier') {
if ($object->element == 'invoice_supplier') {
$modulepart = 'supplier_invoice'; $modulepart = 'supplier_invoice';
} }
if ($object->element == 'expensereport') {
$modulepart = 'expensereport';
}
} }
if ($object->element == 'product') { if ($object->element == 'product') {
@@ -1903,7 +1876,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
$phototoshow .= '</div>'; $phototoshow .= '</div>';
} }
} }
} 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); $phototoshow .= $form->showphoto($modulepart, $object, 0, 0, 0, 'photoref', 'small', 1, 0, $maxvisiblephotos);
} }