NEW If not logo defined, can use squarred logo on login page

This commit is contained in:
Laurent Destailleur 2021-02-05 12:07:39 +01:00
parent 54be4f282b
commit c441b54521
6 changed files with 32 additions and 31 deletions

View File

@ -1245,7 +1245,9 @@ if ($action == 'create')
print '<table class="border centpercent tableforfield">';
print '<tr><td class="titlefield">'.$langs->trans("Author").'</td><td>'.$author->getFullName($langs)."</td></tr>";
print '<tr><td class="titlefield">'.$langs->trans("Author").'</td><td>';
print $author->getNomUrl(-1);
print "</td></tr>";
print '<tr><td>'.$langs->trans("AmountHT").'</td>';
print '<td>'.price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency).'</td>';

View File

@ -287,7 +287,9 @@ if ($object->id > 0)
// Type
print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td colspan="3">';
print '<span class="badgeneutral">';
print $object->getLibType();
print '</span>';
if ($object->module_source) {
print ' <span class="opacitymediumbycolor">('.$langs->trans("POS").' '.$object->module_source.' - '.$langs->trans("Terminal").' '.$object->pos_source.')</span>';
}

View File

@ -3363,11 +3363,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
} else {
$fakey = 'fa-'.$pictowithouttext;
}
if ($pictowithouttext == 'payment') {
$fasize = '0.9em';
}
if ($pictowithouttext == 'loan') {
$fasize = '0.95em';
if (in_array($pictowithouttext, array('payment', 'loan'))) {
$fasize = '0.85em';
}
// Define $marginleftonlyshort

View File

@ -219,15 +219,14 @@ if (!function_exists('dol_loginfunction'))
$width = 0;
$urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png';
if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small))
{
if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo))
{
} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo);
$width = 128;
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg'))
{
} elseif (!empty($mysoc->logo_squarred_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_small)) {
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_small);
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
}

View File

@ -82,9 +82,8 @@ if ($permission)
?>
<form class="tagtr liste_titre">
<div class="tagtd liste_titre"><?php echo $langs->trans("NatureOfContact"); ?></div>
<div class="tagtd liste_titre"><?php echo $langs->trans("ThirdParty"); ?></div>
<div class="tagtd liste_titre"><?php echo $langs->trans("Users").'/'.$langs->trans("Contacts"); ?></div>
<div class="tagtd liste_titre"><?php echo $langs->trans("Users").' | '.$langs->trans("Contacts"); ?></div>
<div class="tagtd liste_titre"><?php echo $langs->trans("ContactType"); ?></div>
<div class="tagtd liste_titre">&nbsp;</div>
<div class="tagtd liste_titre">&nbsp;</div>
@ -96,14 +95,15 @@ if ($permission)
{
?>
<form class="tagtr impair nohover" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
<input type="hidden" name="id" value="<?php echo $object->id; ?>" />
<input type="hidden" name="action" value="addcontact" />
<input type="hidden" name="source" value="internal" />
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
<input type="hidden" name="id" value="<?php echo $object->id; ?>" />
<input type="hidden" name="action" value="addcontact" />
<input type="hidden" name="source" value="internal" />
<?php if ($withproject) print '<input type="hidden" name="withproject" value="'.$withproject.'">'; ?>
<div class="nowrap tagtd"><?php echo img_object('', 'user').' '.$langs->trans("Users"); ?></div>
<div class="tagtd"><?php echo $conf->global->MAIN_INFO_SOCIETE_NOM; ?></div>
<div class="tagtd maxwidthonsmartphone"><?php echo $form->select_dolusers($user->id, 'userid', 0, (!empty($userAlreadySelected) ? $userAlreadySelected : null), 0, null, null, 0, 56, '', 0, '', 'minwidth200imp'); ?></div>
<!-- <div class="nowrap tagtd"><?php echo img_object('', 'user').' '.$langs->trans("Users"); ?></div> -->
<div class="tagtd maxwidthonsmartphone"><?php echo img_object('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($user->id, 'userid', 0, (!empty($userAlreadySelected) ? $userAlreadySelected : null), 0, null, null, 0, 56, '', 0, '', 'minwidth200imp'); ?></div>
<div class="tagtd maxwidthonsmartphone">
<?php
$tmpobject = $object;
@ -121,12 +121,12 @@ if ($permission)
?>
<form class="tagtr pair nohover" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
<input type="hidden" name="id" value="<?php echo $object->id; ?>" />
<input type="hidden" name="action" value="addcontact" />
<input type="hidden" name="source" value="external" />
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
<input type="hidden" name="id" value="<?php echo $object->id; ?>" />
<input type="hidden" name="action" value="addcontact" />
<input type="hidden" name="source" value="external" />
<?php if ($withproject) print '<input type="hidden" name="withproject" value="'.$withproject.'">'; ?>
<div class="tagtd nowrap noborderbottom"><?php echo img_object('', 'contact').' '.$langs->trans("ThirdPartyContacts"); ?></div>
<div class="tagtd nowrap maxwidthonsmartphone noborderbottom">
<?php $selectedCompany = isset($_GET["newcompany"]) ? $_GET["newcompany"] : $object->socid; ?>
<?php
@ -138,9 +138,10 @@ if ($permission)
?>
<?php $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?>
</div>
<!-- <div class="tagtd nowrap noborderbottom"><?php echo img_object('', 'contact').' '.$langs->trans("ThirdPartyContacts"); ?></div>-->
<div class="tagtd maxwidthonsmartphone noborderbottom">
<?php
print $form->selectcontacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 1, 'minwidth100imp');
print img_object('', 'contact', 'class="pictofixedwidth"').$form->selectcontacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 1, 'minwidth100imp');
$nbofcontacts = $form->num;
$newcardbutton = '';
@ -277,9 +278,9 @@ print '<table class="tagtable nobottomiftotal liste">';
//print '</tr>';
print '<tr class="liste_titre">';
print_liste_field_titre($arrayfields['nature']['label'], $_SERVER["PHP_SELF"], "nature", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($arrayfields['thirdparty']['label'], $_SERVER["PHP_SELF"], "thirdparty_name", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($arrayfields['contact']['label'], $_SERVER["PHP_SELF"], "contact_name", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($arrayfields['nature']['label'], $_SERVER["PHP_SELF"], "nature", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], "type", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($arrayfields['status']['label'], $_SERVER["PHP_SELF"], "statut", "", $param, "", $sortfield, $sortorder, 'center ');
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder, 'center maxwidthsearch ');
@ -289,9 +290,9 @@ foreach ($list as $entry)
{
print '<tr class="oddeven">';
print '<td class="nowrap">'.$entry->nature.'</td>';
print '<td class="tdoverflowmax200">'.$entry->thirdparty_html.'</td>';
print '<td class="tdoverflowmax200">'.$entry->contact_html.'</td>';
print '<td class="nowrap"><span class="opacitymedium">'.$entry->nature.'</span></td>';
print '<td class="tdoverflowmax200">'.$entry->type.'</td>';
print '<td class="tdoverflowmax200 center">'.$entry->status.'</td>';

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2009-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2013 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2009-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2021 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// Need global variable $title to be defined by caller (like dol_loginfunction)
// Need global variable $urllogo, $title and $titletruedolibarrversion to be defined by caller (like dol_loginfunction in security2.lib.php)
// Caller can also set $morelogincontent = array(['options']=>array('js'=>..., 'table'=>...);