From 784012a47e9384eb8ec1c0d61b1e21d5df3154b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Mar 2019 23:47:40 +0100 Subject: [PATCH 01/18] Update main.inc.php --- htdocs/main.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 70571964162..4a85cd8ddab 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -395,6 +395,7 @@ if ((! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && ! empty($conf-> { dol_syslog("Invalid token, so we disable POST and some GET parameters - referer=".$_SERVER['HTTP_REFERER'].", action=".GETPOST('action', 'aZ09').", _GET|POST['token']=".GETPOST('token', 'alpha').", _SESSION['token']=".$_SESSION['token'], LOG_WARNING); //print 'Unset POST by CSRF protection in main.inc.php.'; // Do not output anything because this create problems when using the BACK button on browsers. + if ($conf->global->MAIN_FEATURES_LEVEL>1) setEventMessages('Unset POST by CSRF protection in main.inc.php.', null, 'warnings'); unset($_POST); unset($_GET['confirm']); } From b4851e3d40e9ba0d74384fc39eba06172d1186fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 5 Mar 2019 21:54:51 +0100 Subject: [PATCH 02/18] Update mailinglist_mymodule_myobject.modules.php Warning: Declaration of mailing_***********::add_to_target($mailing_id) should be compatible with MailingTargets::add_to_target($mailing_id, $cibles) --- .../modules/mailings/mailinglist_mymodule_myobject.modules.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index 83644cd1f0e..07419af532d 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -97,9 +97,10 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets * This is the main function that returns the array of emails * * @param int $mailing_id Id of emailing + * @param array $cibles Array with targets * @return int <0 if error, number of emails added if ok */ - public function add_to_target($mailing_id) + public function add_to_target($mailing_id, $cibles) { // phpcs:enable $target = array(); From 2745f986441023472858126a55698d2d15e18f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 5 Mar 2019 22:10:46 +0100 Subject: [PATCH 03/18] PSR2.Classes.PropertyDeclaration.VarUsed --- dev/setup/codesniffer/ruleset.xml | 1 + htdocs/comm/propal/class/propal.class.php | 88 +++++++++---------- htdocs/core/class/commonorder.class.php | 2 +- htdocs/core/class/stats.class.php | 6 +- .../modules/syslog/mod_syslog_chromephp.php | 6 +- .../core/modules/syslog/mod_syslog_file.php | 4 +- .../core/modules/syslog/mod_syslog_syslog.php | 2 +- .../class/expensereportstats.class.php | 10 +-- 8 files changed, 60 insertions(+), 59 deletions(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index b6f62aede64..d8fff2265e9 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -428,4 +428,5 @@ + diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 304eccf9bb7..ad5197512d4 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3526,13 +3526,13 @@ class Propal extends CommonObject if ($option == '') { $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id. $get_params; } - if ($option == 'compta') { // deprecated + elseif ($option == 'compta') { // deprecated $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id. $get_params; } - if ($option == 'expedition') { + elseif ($option == 'expedition') { $url = DOL_URL_ROOT.'/expedition/propal.php?id='.$this->id. $get_params; } - if ($option == 'document') { + elseif ($option == 'document') { $url = DOL_URL_ROOT.'/comm/propal/document.php?id='.$this->id. $get_params; } @@ -3646,68 +3646,68 @@ class PropaleLigne extends CommonObjectLine */ public $table_element='propaldet'; - var $oldline; + public $oldline; // From llx_propaldet - var $fk_propal; - var $fk_parent_line; - var $desc; // Description ligne - var $fk_product; // Id produit predefini + public $fk_propal; + public $fk_parent_line; + public $desc; // Description ligne + public $fk_product; // Id produit predefini /** * @deprecated * @see product_type */ - var $fk_product_type; + public $fk_product_type; /** * Product type. * @var int * @see Product::TYPE_PRODUCT, Product::TYPE_SERVICE */ - var $product_type = Product::TYPE_PRODUCT; + public $product_type = Product::TYPE_PRODUCT; - var $qty; - var $tva_tx; - var $subprice; - var $remise_percent; - var $fk_remise_except; + public $qty; + public $tva_tx; + public $subprice; + public $remise_percent; + public $fk_remise_except; - var $rang = 0; + public $rang = 0; - var $fk_fournprice; - var $pa_ht; - var $marge_tx; - var $marque_tx; + public $fk_fournprice; + public $pa_ht; + public $marge_tx; + public $marque_tx; - var $special_code; // Tag for special lines (exlusive tags) + public $special_code; // Tag for special lines (exlusive tags) // 1: frais de port // 2: ecotaxe // 3: option line (when qty = 0) - var $info_bits = 0; // Liste d'options cumulables: + public $info_bits = 0; // Liste d'options cumulables: // Bit 0: 0 si TVA normal - 1 si TVA NPR // Bit 1: 0 ligne normale - 1 si ligne de remise fixe - var $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne - var $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne - var $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne + public $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne + public $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne + public $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne /** * @deprecated * @see $remise_percent, $fk_remise_except */ - var $remise; + public $remise; /** * @deprecated * @see subprice */ - var $price; + public $price; // From llx_product /** * @deprecated * @see product_ref */ - var $ref; + public $ref; /** * Product reference * @var string @@ -3717,7 +3717,7 @@ class PropaleLigne extends CommonObjectLine * @deprecated * @see product_label */ - var $libelle; + public $libelle; /** * Product label * @var string @@ -3729,25 +3729,25 @@ class PropaleLigne extends CommonObjectLine */ public $product_desc; - var $localtax1_tx; // Local tax 1 - var $localtax2_tx; // Local tax 2 - var $localtax1_type; // Local tax 1 type - var $localtax2_type; // Local tax 2 type - var $total_localtax1; // Line total local tax 1 - var $total_localtax2; // Line total local tax 2 + public $localtax1_tx; // Local tax 1 + public $localtax2_tx; // Local tax 2 + public $localtax1_type; // Local tax 1 type + public $localtax2_type; // Local tax 2 type + public $total_localtax1; // Line total local tax 1 + public $total_localtax2; // Line total local tax 2 - var $date_start; - var $date_end; + public $date_start; + public $date_end; - var $skip_update_total; // Skip update price total for special lines + public $skip_update_total; // Skip update price total for special lines // Multicurrency - var $fk_multicurrency; - var $multicurrency_code; - var $multicurrency_subprice; - var $multicurrency_total_ht; - var $multicurrency_total_tva; - var $multicurrency_total_ttc; + public $fk_multicurrency; + public $multicurrency_code; + public $multicurrency_subprice; + public $multicurrency_total_ht; + public $multicurrency_total_tva; + public $multicurrency_total_ttc; /** * Class line Contructor diff --git a/htdocs/core/class/commonorder.class.php b/htdocs/core/class/commonorder.class.php index 9d9445df91c..ddaef527630 100644 --- a/htdocs/core/class/commonorder.class.php +++ b/htdocs/core/class/commonorder.class.php @@ -82,7 +82,7 @@ abstract class CommonOrderLine extends CommonObjectLine * @deprecated * @see subprice */ - var $price; + public $price; /** * Unit price before taxes diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index b35e9947644..b06f1deb4c3 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -29,9 +29,9 @@ */ abstract class Stats { - protected $db; - var $_lastfetchdate=array(); // Dates of cache file read by methods - var $cachefilesuffix=''; // Suffix to add to name of cache file (to avoid file name conflicts) + protected $db; + private $_lastfetchdate=array(); // Dates of cache file read by methods + public $cachefilesuffix=''; // Suffix to add to name of cache file (to avoid file name conflicts) /** * Return nb of elements by month for several years diff --git a/htdocs/core/modules/syslog/mod_syslog_chromephp.php b/htdocs/core/modules/syslog/mod_syslog_chromephp.php index 8ace164fce6..f3d34c4a9cd 100644 --- a/htdocs/core/modules/syslog/mod_syslog_chromephp.php +++ b/htdocs/core/modules/syslog/mod_syslog_chromephp.php @@ -7,7 +7,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php'; */ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface { - var $code = 'chromephp'; + public $code = 'chromephp'; /** * Return name of logger @@ -50,7 +50,7 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface return ($this->isActive() == 1)?'':$langs->trans('ClassNotFoundIntoPathWarning', 'ChromePhp.class.php'); } - + /** * Is the module active ? * @@ -159,7 +159,7 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface $res = @include_once 'ChromePhp.php'; if (! $res) $res=@include_once 'ChromePhp.class.php'; set_include_path($oldinclude); - + ob_start(); // To be sure headers are not flushed until all page is completely processed if ($content['level'] == LOG_ERR) ChromePhp::error($content['message']); elseif ($content['level'] == LOG_WARNING) ChromePhp::warn($content['message']); diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index ced2cf9133b..4c59eb5ef98 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -7,8 +7,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php'; */ class mod_syslog_file extends LogHandler implements LogHandlerInterface { - var $code = 'file'; - var $lastTime = 0; + public $code = 'file'; + public $lastTime = 0; /** * Return name of logger diff --git a/htdocs/core/modules/syslog/mod_syslog_syslog.php b/htdocs/core/modules/syslog/mod_syslog_syslog.php index 26232e91ed5..97a37ff2c8a 100644 --- a/htdocs/core/modules/syslog/mod_syslog_syslog.php +++ b/htdocs/core/modules/syslog/mod_syslog_syslog.php @@ -7,7 +7,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php'; */ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface { - var $code = 'syslog'; + public $code = 'syslog'; /** * Return name of logger diff --git a/htdocs/expensereport/class/expensereportstats.class.php b/htdocs/expensereport/class/expensereportstats.class.php index 082e3ce016e..5edf301ac25 100644 --- a/htdocs/expensereport/class/expensereportstats.class.php +++ b/htdocs/expensereport/class/expensereportstats.class.php @@ -35,12 +35,12 @@ class ExpenseReportStats extends Stats */ public $table_element; - var $socid; - var $userid; + public $socid; + public $userid; - var $from; - var $field; - var $where; + public $from; + public $field; + public $where; /** * Constructor From cb39c6f3ce5cbe91e94dd5186d2ec317c059a8e9 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 6 Mar 2019 16:48:48 +0100 Subject: [PATCH 04/18] remove specific entry in gitignore --- htdocs/.gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/.gitignore b/htdocs/.gitignore index aa007a70ae5..ac35d8fab2f 100644 --- a/htdocs/.gitignore +++ b/htdocs/.gitignore @@ -28,4 +28,3 @@ /nomenclature* /of/ /workstation/ -/theme/dolipro* \ No newline at end of file From 4382a26c879194d55b84b2cf29af6e56b66997ed Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 6 Mar 2019 17:21:44 +0100 Subject: [PATCH 05/18] sort list of models alphabetically --- htdocs/core/class/html.formfile.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 5e875be176d..a3134f641a1 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -677,11 +677,12 @@ class FormFile $out.= ''; $addcolumforpicto=($delallowed || $printer || $morepicto); - $out.= ''; + $out.= ''; // Model if (! empty($modellist)) { + asort($modellist); $out.= ''.$langs->trans('Model').' '; if (is_array($modellist) && count($modellist) == 1) // If there is only one element { From 8f8fe0648ebe771fe9b25cbf3691a5929304f38f Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 6 Mar 2019 17:24:50 +0100 Subject: [PATCH 06/18] fix bad copy paste --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index a3134f641a1..2577d70e549 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -677,7 +677,7 @@ class FormFile $out.= ''; $addcolumforpicto=($delallowed || $printer || $morepicto); - $out.= ''; + $out.= ''; // Model if (! empty($modellist)) From 8743b43fdbcc3c3433ede604318e007f6f4cc063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Mar 2019 18:01:18 +0100 Subject: [PATCH 07/18] add oldcopy of category before updating --- htdocs/categories/edit.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index a85c320a992..9416ddae748 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -81,6 +81,7 @@ if ($cancel) // Action mise a jour d'une categorie if ($action == 'update' && $user->rights->categorie->creer) { + $object->oldcopy = dol_clone($object); $object->label = $label; $object->description = dol_htmlcleanlastbr($description); $object->color = $color; From 8246c79b15fa039a79c0e48af63b734d6bcfc2be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Mar 2019 18:20:44 +0100 Subject: [PATCH 08/18] Update bom_card.php --- htdocs/bom/bom_card.php | 45 ++++++----------------------------------- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 0054e427996..28deae35d86 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2019 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 @@ -17,50 +17,17 @@ */ /** - * \file bom_card.php + * \file htdocs/bom/bom_card.php * \ingroup bom * \brief Page to create/edit/view bom */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK','1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT','auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE','aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN',1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP','none'); // Disable all Content Security Policies - - // Load Dolibarr environment -$res=0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; -while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } -if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php"; -if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php"; -if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; -if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; -if (! $res) die("Include of main fails"); - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -dol_include_once('/bom/class/bom.class.php'); -dol_include_once('/bom/lib/bom_bom.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom_bom.lib.php'; // Load translation files required by the page $langs->loadLangs(array("mrp","other")); From 6067994119a42eb355cba41f61ec5e458e77fb71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Mar 2019 18:23:25 +0100 Subject: [PATCH 09/18] Update bom_document.php --- htdocs/bom/bom_document.php | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index b13277cd82b..ff8887bb4e8 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2019 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 @@ -23,26 +23,13 @@ */ // Load Dolibarr environment -$res=0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; -while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } -if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php"; -if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php"; -if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; -if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; -if (! $res) die("Include of main fails"); - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -dol_include_once('/bom/class/bom.class.php'); -dol_include_once('/bom/lib/bom_bom.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom_bom.lib.php'; // Load translation files required by the page $langs->loadLangs(array("mrp","companies","other","mails")); From e4de89e3eb17ec315f5802c191fa2c4576109235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Mar 2019 18:25:02 +0100 Subject: [PATCH 10/18] Update bom_list.php --- htdocs/bom/bom_list.php | 39 +++------------------------------------ 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 25fad036b65..6aec37c5f2c 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -17,49 +17,16 @@ */ /** - * \file bom_list.php + * \file htdocs/bom/bom_list.php * \ingroup bom * \brief List page for bom */ - -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data -//if (! defined('NOIPCHECK')) define('NOIPCHECK','1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT','auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE','aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN',1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("XFRAMEOPTIONS_ALLOWALL")) define('XFRAMEOPTIONS_ALLOWALL',1); // Do not add the HTTP header 'X-Frame-Options: SAMEORIGIN' but 'X-Frame-Options: ALLOWALL' - // Load Dolibarr environment -$res=0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; -while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } -if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php"; -if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php"; -if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; -if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; -if (! $res) die("Include of main fails"); - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -dol_include_once('/bom/class/bom.class.php'); +require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; // Load translation files required by the page $langs->loadLangs(array("mrp", "other")); From cf00b2a2df5e69b84261e6253826415bbb52ad7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Mar 2019 18:26:23 +0100 Subject: [PATCH 11/18] Update bom_note.php --- htdocs/bom/bom_note.php | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/htdocs/bom/bom_note.php b/htdocs/bom/bom_note.php index fb0d58509d7..4c45512c064 100644 --- a/htdocs/bom/bom_note.php +++ b/htdocs/bom/bom_note.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2019 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 @@ -23,22 +23,9 @@ */ // Load Dolibarr environment -$res=0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; -while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } -if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php"; -if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php"; -if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; -if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; -if (! $res) die("Include of main fails"); - -dol_include_once('/bom/class/bom.class.php'); -dol_include_once('/bom/lib/bom_bom.lib.php'); +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom_bom.lib.php'; // Load translation files required by the page $langs->loadLangs(array("mrp","companies")); From 02d4a234b71b3fd07279c971adc698aada23c8e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Mar 2019 18:30:34 +0100 Subject: [PATCH 12/18] Update bom.lib.php --- htdocs/bom/lib/bom.lib.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index 0085d06b69c..98f5370217e 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2019 Maxime Kohlhaas + * Copyright (C) 2019 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 @@ -16,7 +17,7 @@ */ /** - * \file bom/lib/bom.lib.php + * \file htdocs/bom/lib/bom.lib.php * \ingroup bom * \brief Library files with common functions for BillOfMaterials */ @@ -40,7 +41,7 @@ function bomAdminPrepareHead() $head[$h][2] = 'settings'; $h++; - /*$head[$h][0] = dol_buildpath("/bom/admin/about.php", 1); + /*$head[$h][0] = DOL_URL_ROOT."/bom/admin/about.php"; $head[$h][1] = $langs->trans("About"); $head[$h][2] = 'about'; $h++; @@ -77,7 +78,7 @@ function bomPrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/bom/bom_card.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT."/bom/bom_card.php?id=".$object->id; $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h++; @@ -87,7 +88,7 @@ function bomPrepareHead($object) $nbNote = 0; if (!empty($object->note_private)) $nbNote++; if (!empty($object->note_public)) $nbNote++; - $head[$h][0] = dol_buildpath('/bom/bom_note.php', 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/bom/bom_note.php?id=".$object->id; $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'note'; @@ -99,13 +100,13 @@ function bomPrepareHead($object) $upload_dir = $conf->bom->dir_output . "/bom/" . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks=Link::count($db, $object->element, $object->id); - $head[$h][0] = dol_buildpath("/bom/bom_document.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT."/bom/bom_document.php?id=".$object->id; $head[$h][1] = $langs->trans('Documents'); if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; $head[$h][2] = 'document'; $h++; - $head[$h][0] = dol_buildpath("/bom/bom_agenda.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT."/bom/bom_agenda.php?id=".$object->id; $head[$h][1] = $langs->trans("Events"); $head[$h][2] = 'agenda'; $h++; From e57a67493905f7c050d0886f849d3b61ca7aa517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Mar 2019 18:36:48 +0100 Subject: [PATCH 13/18] Update setup.php --- htdocs/bom/admin/setup.php | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/htdocs/bom/admin/setup.php b/htdocs/bom/admin/setup.php index 561b44fa262..a484718ac32 100644 --- a/htdocs/bom/admin/setup.php +++ b/htdocs/bom/admin/setup.php @@ -1,6 +1,7 @@ - * Copyright (C) 2019 Maxime Kohlhaas +/* Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2019 Maxime Kohlhaas + * Copyright (C) 2019 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 @@ -23,21 +24,7 @@ */ // Load Dolibarr environment -$res=0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; -while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } -if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php"; -if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; -if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; -if (! $res) die("Include of main fails"); - -global $langs, $user; - +require '../../main.inc.php'; // Libraries require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; require_once '../lib/bom.lib.php'; @@ -62,11 +49,7 @@ $arrayofparameters=array( /* * Actions */ -if ((float) DOL_VERSION >= 6) -{ - include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -} - +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; /* * View From 2185f129cd3b78007f5b95ee49acf8340b94c99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Mar 2019 18:44:03 +0100 Subject: [PATCH 14/18] syntax error --- htdocs/bom/lib/bom.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index 98f5370217e..20f9fccfb01 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -88,7 +88,7 @@ function bomPrepareHead($object) $nbNote = 0; if (!empty($object->note_private)) $nbNote++; if (!empty($object->note_public)) $nbNote++; - $head[$h][0] = DOL_URL_ROOT.'/bom/bom_note.php?id=".$object->id; + $head[$h][0] = DOL_URL_ROOT.'/bom/bom_note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'note'; @@ -100,13 +100,13 @@ function bomPrepareHead($object) $upload_dir = $conf->bom->dir_output . "/bom/" . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks=Link::count($db, $object->element, $object->id); - $head[$h][0] = DOL_URL_ROOT."/bom/bom_document.php?id=".$object->id; + $head[$h][0] = DOL_URL_ROOT.'/bom/bom_document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; $head[$h][2] = 'document'; $h++; - $head[$h][0] = DOL_URL_ROOT."/bom/bom_agenda.php?id=".$object->id; + $head[$h][0] = DOL_URL_ROOT.'/bom/bom_agenda.php?id='.$object->id; $head[$h][1] = $langs->trans("Events"); $head[$h][2] = 'agenda'; $h++; From edf9913c20c5d606fe545145c772384d23ebff1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Mar 2019 19:00:12 +0100 Subject: [PATCH 15/18] Update bom_list.php --- htdocs/bom/bom_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 6aec37c5f2c..cf9ad7ffaf2 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -56,7 +56,7 @@ $pagenext = $page + 1; //if (! $sortorder) $sortorder="DESC"; // Initialize technical objects -$object = new BillOfMaterials($db); +$object = new BOM($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bom->dir_output . '/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('bomlist')); // Note that conf->hooks_modules contains array @@ -146,7 +146,7 @@ if (empty($reshook)) } // Mass actions - $objectclass='BillOfMaterials'; + $objectclass='BOM'; $objectlabel='BillOfMaterials'; $permtoread = $user->rights->bom->read; $permtodelete = $user->rights->bom->delete; From 7b0956297636057d4f976ebc96722c3f20884b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Mar 2019 19:05:13 +0100 Subject: [PATCH 16/18] Update bom_card.php --- htdocs/bom/bom_card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 28deae35d86..19d7fdaa60b 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -42,7 +42,7 @@ $contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'bomcard $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects -$object=new BillOfMaterials($db); +$object=new BOM($db); $extrafields = new ExtraFields($db); $diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('bomcard', 'globalcard')); // Note that conf->hooks_modules contains array @@ -86,10 +86,10 @@ if (empty($reshook)) $permissiontoadd = $user->rights->bom->write; $permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && $object->status == 0); - $backurlforlist = dol_buildpath('/bom/bom_list.php', 1); + $backurlforlist = DOL_URL_ROOT.'/bom/bom_list.php'; if (empty($backtopage)) { if (empty($id)) $backtopage = $backurlforlist; - else $backtopage = dol_buildpath('/bom/bom_card.php', 1).($id > 0 ? $id : '__ID__'); + else $backtopage = DOL_URL_ROOT.'/bom/bom_card.php?id='.$id; } $triggermodname = 'BILLOFMATERIALS_BILLOFMATERIALS_MODIFY'; // Name of trigger action code to execute when we modify record From d39b600ff4cd6eb4b702fef71899e38dffe67837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Mar 2019 20:29:58 +0100 Subject: [PATCH 17/18] Update CMailFile.class.php --- htdocs/core/class/CMailFile.class.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index e23b32c5fb7..3c0e979cbed 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1,11 +1,12 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) Dan Potter + * Copyright (C) Eric Seigne + * Copyright (C) 2000-2005 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2019 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 @@ -1429,7 +1430,7 @@ class CMailFile * Return a formatted address string for SMTP protocol * * @param string $address Example: 'John Doe , Alan Smith ' or 'john@doe.com, alan@smith.com' - * @param int $format 0=auto, 1=emails with <>, 2=emails without <>, 3=auto + label between " + * @param int $format 0=auto, 1=emails with <>, 2=emails without <>, 3=auto + label between ", 4 label or email, 5 mailto link * @param int $encode 0=No encode name, 1=Encode name to RFC2822 * @param int $maxnumberofemail 0=No limit. Otherwise, maximum number of emails returned ($address may contains several email separated with ','). Add '...' if there is more. * @return string If format 0: '' or 'John Doe ' or '=?UTF-8?B?Sm9obiBEb2U=?= ' @@ -1437,6 +1438,7 @@ class CMailFile * If format 2: 'john@doe.com' * If format 3: '' or '"John Doe" ' or '"=?UTF-8?B?Sm9obiBEb2U=?=" ' * If format 4: 'John Doe' or 'john@doe.com' if no label exists + * If format 5: John Doe or john@doe.com if no label exists */ public static function getValidAddress($address, $format, $encode = 0, $maxnumberofemail = 0) { @@ -1466,6 +1468,10 @@ class CMailFile $i++; $newemail=''; + if ($format == 5) { + $newemail = $name?$name:$email; + $newemail = ''.$newemail.''; + } if ($format == 4) { $newemail = $name?$name:$email; From a6bb1cf5f6dc33e473eaca7adff899197c251f76 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 7 Mar 2019 11:27:06 +0100 Subject: [PATCH 18/18] avoid timeout --- htdocs/core/modules/export/export_csv.modules.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 249d1563988..5bdc2f384ac 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -24,6 +24,8 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/export/modules_export.php'; +// avoid timeout for big export +set_time_limit(0); /** * Class to build export files with format CSV