From fb27c98f9ca3b0bd1b6a72beca34c5052e6a5ddc Mon Sep 17 00:00:00 2001 From: quentin Date: Tue, 10 Nov 2020 09:40:45 +0100 Subject: [PATCH 1/4] FIX : handling $heightforinfotot when he's superior to a page height --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index a32ba1308a3..87fbf1f5085 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -328,6 +328,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 50 + (4 * $nbpayments); // Height reserved to output the info and total part and payment part + if($heightforinfotot > 220) $heightforinfotot = 220; $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS > 0) $heightforfooter += 6; From b16af0a7c3f2a674eae83206f817b368d2e7b022 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 11 Nov 2020 15:43:36 +0100 Subject: [PATCH 2/4] fix deprecated warning php 7.4 --- htdocs/contact/list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 843a894a0fd..295e63c9606 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -76,7 +76,7 @@ $search_no_email = GETPOST("search_no_email", 'int'); if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { - $search_{$key} = GETPOST("search_".$key, 'alpha'); + ${"search_".$key} = GETPOST("search_".$key, 'alpha'); } } } @@ -259,7 +259,7 @@ if (empty($reshook)) if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { - $search_{$key} = ""; + ${"search_".$key} = ""; } } } @@ -363,8 +363,8 @@ if (strlen($search_phone_mobile)) $sql .= natural_search('p.phone_mobile', $se if (strlen($search_fax)) $sql .= natural_search('p.fax', $search_fax); if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { - if ($value['active'] && strlen($search_{$key})) { - $sql .= ' AND p.socialnetworks LIKE \'%"'.$key.'":"'.$search_{$key}.'%\''; + if ($value['active'] && strlen(${"search_".$key})) { + $sql .= ' AND p.socialnetworks LIKE \'%"'.$key.'":"'.${"search_".$key}.'%\''; } } } @@ -674,7 +674,7 @@ if (!empty($conf->socialnetworks->enabled)) { if (!empty($arrayfields['p.'.$key]['checked'])) { print ''; - print ''; + print ''; print ''; } } From ad05451427d77f11ab7d4ee72eacb606585da4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 12 Nov 2020 11:23:03 +0100 Subject: [PATCH 3/4] Fix missing getpost for scandir odt path --- htdocs/admin/user.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 56602502715..e71088da27a 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -6,6 +6,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2020 Frédéric France * * 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 @@ -42,6 +43,8 @@ $action = GETPOST('action', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scandir', 'alpha'); $type = 'user'; From 02158928cc4603949b5f216a35ab62fb3ac86938 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Nov 2020 14:11:59 +0100 Subject: [PATCH 4/4] FIX #15365 export of extrafields for user and resources --- htdocs/core/modules/modResource.class.php | 4 ++-- htdocs/core/modules/modUser.class.php | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 0e96b8d4c11..0d1353076ec 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -246,9 +246,9 @@ class modResource extends DolibarrModules $this->export_dependencies_array[$r] = array('resource'=>array('r.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them. $this->export_sql_start[$r] = 'SELECT DISTINCT '; - $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'resource as r '; + $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'resource as r'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_resource as c ON c.rowid=r.fk_code_type_resource'; - $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'resource_extrafields as extra ON extra.fk_object = c.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'resource_extrafields as extra ON extra.fk_object = r.rowid'; $this->export_sql_end[$r] .= ' AND r.entity IN ('.getEntity('resource').')'; diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index c2ce0fec86f..e5ba3289d05 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -255,13 +255,16 @@ class modUser extends DolibarrModules 'u.admin'=>"user", 'u.statut'=>'user', 'u.datelastlogin'=>'user', 'u.datepreviouslogin'=>'user', 'u.fk_socpeople'=>"contact", 'u.fk_soc'=>"company", 'u.fk_member'=>"member" ); - if (empty($conf->adherent->enabled)) + $keyforselect = 'user'; $keyforelement = 'user'; $keyforaliasextra = 'extra'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + if (empty($conf->adherent->enabled)) { unset($this->export_fields_array[$r]['u.fk_member']); unset($this->export_entities_array[$r]['u.fk_member']); } $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'user as u'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user_extrafields as extra ON u.rowid = extra.fk_object'; $this->export_sql_end[$r] .= ' WHERE u.entity IN ('.getEntity('user').')'; // Imports