From 66ad197fc5230383c42609ced6540119f16c26b6 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Mon, 20 Apr 2020 15:49:31 +0200 Subject: [PATCH 1/3] NEW possibility to show society info when print page If global config key SHOW_SOCINFO_ON_PRINT is set, this add a block in top of page which display basic society information when the layout for printing is activated (print button in top bar is cliqued). --- htdocs/main.inc.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 400ad73fad2..10db0b954ae 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -11,6 +11,7 @@ * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2020 Demarest Maxime * * 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 @@ -2364,6 +2365,36 @@ function main_area($title = '') print ''."\n".'
'."\n"; if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) print info_admin($langs->trans("WarningYouAreInMaintenanceMode", $conf->global->MAIN_ONLY_LOGIN_ALLOWED)); + + // Permit to add user company information on each printed document by set SHOW_SOCINFO_ON_PRINT + if ($conf->global->SHOW_SOCINFO_ON_PRINT && GETPOST('optioncss', 'aZ09') == 'print' && empty(GETPOST('disable_show_socinfo_on_print', 'az09'))) + { + global $hookmanager; + $hookmanager->initHooks(array('showsocinfoonprint')); + $parameters = array(); + $reshook = $hookmanager->executeHooks('showSocinfoOnPrint', $parameters); + if (empty($reshook)) + { + print ''."\n"; + print '
'."\n"; + print ''."\n"; + print ''; + print ''."\n"; + print ''."\n"; + print ''."\n"; + if (!empty($conf->global->MAIN_INFO_SOCIETE_TEL)) print ''; + if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL)) print ''; + if (!empty($conf->global->MAIN_INFO_SOCIETE_WEB)) print ''; + print ''; + print '
'; + if ($conf->global->MAIN_SHOW_LOGO && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && !empty($conf->global->MAIN_INFO_SOCIETE_LOGO)) + print ''; + print '
'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM).'
'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ADDRESS).'
'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP).' '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN).'
'.$langs->trans("Phone").' : '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TEL).'
'.$langs->trans("Email").' : '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL).'
'.$langs->trans("Web").' : '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_WEB).'
'."\n"; + print '
'."\n"; + print ''."\n"; + } + } + } From f4d1ca94b34bbbd65e395c05b9fdac6455073e3c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 20 Apr 2020 14:49:18 +0000 Subject: [PATCH 2/3] Fixing style errors. --- htdocs/main.inc.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 10db0b954ae..73c21459b5c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2394,7 +2394,6 @@ function main_area($title = '') print ''."\n"; } } - } From 4777c74366321f56bffaa7bdad18891fc2755bb1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 14:11:03 +0200 Subject: [PATCH 3/3] Update main.inc.php --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 73c21459b5c..481fffbfef6 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2367,7 +2367,7 @@ function main_area($title = '') if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) print info_admin($langs->trans("WarningYouAreInMaintenanceMode", $conf->global->MAIN_ONLY_LOGIN_ALLOWED)); // Permit to add user company information on each printed document by set SHOW_SOCINFO_ON_PRINT - if ($conf->global->SHOW_SOCINFO_ON_PRINT && GETPOST('optioncss', 'aZ09') == 'print' && empty(GETPOST('disable_show_socinfo_on_print', 'az09'))) + if (! empty($conf->global->SHOW_SOCINFO_ON_PRINT) && GETPOST('optioncss', 'aZ09') == 'print' && empty(GETPOST('disable_show_socinfo_on_print', 'az09'))) { global $hookmanager; $hookmanager->initHooks(array('showsocinfoonprint'));