NEW Use the squarre logo as favicon of pages

This commit is contained in:
Laurent Destailleur 2019-10-11 12:28:13 +02:00
parent 4db57f53f9
commit 5801d09dbe
6 changed files with 31 additions and 29 deletions

View File

@ -24,6 +24,7 @@ Following changes may create regressions for some external modules, but were nec
* Removed function dol_micro_time. Use native PHP microtime instead.
* The trigger BON_PRELEVEMENT_CREATE has been renamed into DIRECT_DEBIT_ORDER_CREATE.
* The constant INVOICE_SHOW_POS_IN_EXPORT has been renamed into INVOICE_SHOW_POS.
* If your logo was visible on the menu bar, you must upload a new logo into 'Home-Setup-Company/Organization' to have it visible agin in menu.
***** ChangeLog for 10.0.2 compared to 10.0.1 *****

View File

@ -282,8 +282,11 @@ if (! function_exists('dol_loginfunction'))
// Set jquery theme
$dol_loginmesg = (! empty($_SESSION["dol_loginmesg"])?$_SESSION["dol_loginmesg"]:'');
$favicon=dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico', 1);
$favicon = DOL_URL_ROOT.'/theme/common/dolibarr_logo_256x256.png';
if (! empty($mysoc->logo_squarred_mini)) $favicon = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini);
if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL;
$jquerytheme = 'base';
if (! empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;

View File

@ -478,16 +478,16 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Show logo company
if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI);
//$mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI);
$mysoc->logo_squarred_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI);
if (! empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini))
{
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini);
}
elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
/*elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
{
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini);
}
}*/
else
{
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo_squarred.png';

View File

@ -1195,7 +1195,7 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0)
*/
function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $disablejmobile = 0, $disablenofollow = 0)
{
global $db, $conf, $langs, $user, $hookmanager;
global $db, $conf, $langs, $user, $mysoc, $hookmanager;
top_httphead();
@ -1224,9 +1224,11 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
print '<meta name="author" content="Dolibarr Development Team">'."\n";
// Favicon
$favicon = DOL_MAIN_URL_ROOT . '/theme/'.$conf->theme.'/img/favicon.ico';
$favicon = DOL_URL_ROOT.'/theme/common/dolibarr_logo_256x256.png';
if (! empty($mysoc->logo_squarred_mini)) $favicon = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini);
if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL;
if (empty($conf->dol_use_jmobile)) print '<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>'."\n"; // Not required into an Android webview
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="top" title="'.$langs->trans("Home").'" href="'.(DOL_URL_ROOT?DOL_URL_ROOT:'/').'">'."\n";
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="copyright" title="GNU General Public License" href="https://www.gnu.org/copyleft/gpl.html#SEC1">'."\n";
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="author" title="Dolibarr Development Team" href="https://www.dolibarr.org">'."\n";
@ -1614,9 +1616,6 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
print '<div class="login_block usedropdown">'."\n";
// Add login user link
$toprightmenu.='<div class="login_block_user">';
@ -1624,17 +1623,17 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
$mode=-1;
$toprightmenu.='<div class="inline-block nowrap"><div class="inline-block login_block_elem login_block_elem_name" style="padding: 0px;">';
if(!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)){
if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)){
// Add search dropdown
$toprightmenu.= top_menu_search($user, $langs);
}
if(!empty($conf->global->MAIN_USE_TOP_MENU_BOOKMARK_DROPDOWN)) {
if (!empty($conf->global->MAIN_USE_TOP_MENU_BOOKMARK_DROPDOWN)) {
// Add bookmark dropdown
$toprightmenu .= top_menu_bookmark($user, $langs);
}
// add user dropdown
// Add user dropdown
$toprightmenu.= top_menu_user($user, $langs);
$toprightmenu.='</div></div>';
@ -1967,10 +1966,10 @@ function top_menu_bookmark(User $user, Translate $langs)
if( e.which === 77 && e.ctrlKey && e.shiftKey ){
console.log(\'control + shift + m : trigger open bookmark dropdown\');
openBookMarkDropDown();
}
}
});
var openBookMarkDropDown = function() {
event.preventDefault();
$("#topmenu-bookmark-dropdown").toggleClass("open");
@ -2054,26 +2053,26 @@ function top_menu_search(User $user, Translate $langs)
<!-- Code to show/hide the user drop-down -->
<script>
$( document ).ready(function() {
// prevent submiting form on press ENTER
$("#top-global-search-input").keydown(function (e) {
if (e.keyCode == 13) {
var inputs = $(this).parents("form").eq(0).find(":button");
if (inputs[inputs.index(this) + 1] != null) {
if (inputs[inputs.index(this) + 1] != null) {
inputs[inputs.index(this) + 1].focus();
}
e.preventDefault();
return false;
}
});
// submit form action
$(".dropdown-global-search-button-list .global-search-item").on("click", function(event) {
$("#top-menu-action-bookmark").attr("action", $(this).data("target"));
$("#top-menu-action-bookmark").submit();
});
// close drop down
$(document).on("click", function(event) {
if (!$(event.target).closest("#topmenu-global-search-dropdown").length) {
@ -2092,10 +2091,10 @@ function top_menu_search(User $user, Translate $langs)
if( e.which === 70 && e.ctrlKey && e.shiftKey ){
console.log(\'control + shift + f : trigger open global-search dropdown\');
openGlobalSearchDropDown();
}
}
});
var openGlobalSearchDropDown = function() {
event.preventDefault();
$("#topmenu-global-search-dropdown").toggleClass("open");

View File

@ -27,7 +27,6 @@ if (empty($usedolheader))
<head>
<meta name="robots" content="noindex,nofollow" />
<meta name="author" content="Dolibarr Development Team">
<link rel="shortcut icon" type="image/x-icon" href="<?php echo DOL_URL_ROOT ?>/theme/eldy/img/favicon.ico"/>
<title>Test page</title>
<!-- Includes for JQuery (Ajax library) -->
<link rel="stylesheet" type="text/css" href="<?php echo DOL_URL_ROOT ?>/includes/jquery/css/base/jquery-ui.css" />

View File

@ -25,14 +25,14 @@
* \brief File for The Web App
*/
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url.
if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1');
if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1);
if (! defined('NOLOGIN')) define('NOLOGIN', 1); // File must be accessed by logon page so without login
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); // We need top menu content
if (! defined('NOLOGIN')) define('NOLOGIN', 1);
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');