From 9d3a0442c0ef9c4e1d913d0cf98a1dcff7dd5e20 Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 16 Jul 2018 17:10:33 +0200 Subject: [PATCH 01/40] dolibarr-develop, php 7.2.7 On third party, add bank account. After spanish account has been added, on summary screen ..../htdocs/societe/paymentmodes.php a correct account number causes the error: Warning: A non-numeric value encountered in .......\public_html\dolibarr-develop\htdocs\core\lib\bank.lib.php on line 359 This is `$sum += $values[$i] * substr($InumCta, $i, 1);` Since substr returns a string it cannot be summed (I assume). I changed it to `$sum += $values[$i] * (int)substr($InumCta, $i, 1)` --- htdocs/core/lib/bank.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 5e1e300520c..e361d8fa9f6 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -356,7 +356,7 @@ function checkES($IentOfi, $InumCta) $sum = 0; for ($i = 0; $i < 11; $i++) { - $sum += $values[$i] * substr($InumCta, $i, 1); + $sum += $values[$i] * (int)substr($InumCta, $i, 1);//int to cast result of substr to a number } $key = 11 - $sum % 11; From d7f58d0087b2b556466340c9c69852a9bf98cd51 Mon Sep 17 00:00:00 2001 From: Philippe Date: Tue, 24 Jul 2018 20:28:49 +0200 Subject: [PATCH 02/40] FIX search on ref project on propal list --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index f7fd5d9b2bb..a8e51d32173 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -283,7 +283,7 @@ if ($search_country) $sql .= " AND s.fk_pays IN (".$db->escape($search_country). if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->escape($search_type_thirdparty).')'; if ($search_ref) $sql .= natural_search('p.ref', $search_ref); if ($search_refcustomer) $sql .= natural_search('p.ref_client', $search_refcustomer); -if ($search_refproject) $sql .= natural_search('pr.ref', $search_refprojet); +if ($search_refproject) $sql .= natural_search('pr.ref', $search_refproject); if ($search_societe) $sql .= natural_search('s.nom', $search_societe); if ($search_login) $sql .= natural_search("u.login", $search_login); From cac596037f0cfc6b4de812640dff6d29069590e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 25 Jul 2018 09:50:04 +0200 Subject: [PATCH 03/40] Update card.php --- htdocs/resource/card.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 832f70f4ea1..e4a21ae9888 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -22,12 +22,7 @@ */ -// Change this following line to use the correct relative path (../, ../../, etc) -$res=0; -$res=@include("../main.inc.php"); // For root directory -if (! $res) $res=@include("../../main.inc.php"); // For "custom" directory -if (! $res) die("Include of main fails"); - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php'; From c7ad6c9a7c072210ee203a70a6bbda7e0578e3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 25 Jul 2018 10:04:44 +0200 Subject: [PATCH 04/40] Update card-rec.php --- htdocs/fichinter/card-rec.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 96d7e106b5a..8b258ebbf6e 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -29,12 +29,7 @@ * \brief Page to show predefined fichinter */ -$res=0; -if (! $res && file_exists("../../main.inc.php")) - $res=@include("../../main.inc.php"); // For root directory -if (! $res && file_exists("../../../main.inc.php")) - $res=@include("../../../main.inc.php"); // For "custom" directory - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinterrec.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; From f79415e740dc466d984bd25c76e18c0a68be2aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 25 Jul 2018 10:08:01 +0200 Subject: [PATCH 05/40] Update payment.php --- htdocs/stripe/payment.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index 1113d1428f5..8ad547a47ee 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -30,8 +30,7 @@ */ // Load Dolibarr environment -$res=@include("../main.inc.php"); // For root directory -if (! $res) $res=@include("../../main.inc.php"); +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; From 843192c73b39db75b279cd33f88a354887cd08ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 25 Jul 2018 10:10:16 +0200 Subject: [PATCH 06/40] Update websiteaccount_card.php --- htdocs/website/websiteaccount_card.php | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 9a1ad910672..0bc4428deb2 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -22,24 +22,11 @@ */ // 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"); - -include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); -include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); -include_once(DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'); -include_once(DOL_DOCUMENT_ROOT.'/website/lib/websiteaccount.lib.php'); +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'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/website/lib/websiteaccount.lib.php'; // Load translation files required by the page $langs->loadLangs(array("website","other")); From cddb82f9be7a49976471967ec53d8c4ed912724c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 25 Jul 2018 10:11:44 +0200 Subject: [PATCH 07/40] Update element_resource.php --- htdocs/resource/element_resource.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 389d0236759..b844fce0f6c 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -23,11 +23,7 @@ */ -$res=0; -$res=@include("../main.inc.php"); // For root directory -if (! $res) $res=@include("../../main.inc.php"); // For "custom" directory -if (! $res) die("Include of main fails"); - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; From 08c4baad2474688cbbabc26fd710b15042df7c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 25 Jul 2018 10:15:34 +0200 Subject: [PATCH 08/40] Update list.php --- htdocs/ticket/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index c99ac7e7e3a..b23b4c5d27e 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -701,7 +701,7 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb $hidegeneratedfilelistifempty=1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0; - require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $formfile = new FormFile($db); // Show list of available documents From 950bc816a251db2f82647e17163ff7ff864b0ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 25 Jul 2018 10:17:01 +0200 Subject: [PATCH 09/40] Update website.php --- htdocs/societe/website.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 3563283ba05..d00b3144185 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -535,7 +535,7 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb $hidegeneratedfilelistifempty=1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0; - require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $formfile = new FormFile($db); // Show list of available documents From 53469ee424d5ff9677753bec7b1140a7272c2475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 25 Jul 2018 11:45:52 +0200 Subject: [PATCH 10/40] Update card-rec.php --- htdocs/fichinter/card-rec.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 8b258ebbf6e..08600d71ee5 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -404,8 +404,7 @@ if ($action == 'create') { $var=true; while ($i < $num) { $objp = $db->fetch_object($result); - $var=!$var; - print ""; + print ''; // Show product and description @@ -733,10 +732,8 @@ if ($action == 'create') { $num = count($object->lines); $i = 0; - $var=true; while ($i < $num) { - $var=!$var; - + // Show product and description if (isset($object->lines[$i]->product_type)) $type=$object->lines[$i]->product_type; @@ -748,7 +745,7 @@ if ($action == 'create') { if (! empty($objp->date_end)) $type=1; // Show line - print ""; + print ''; print ''; $text = img_object($langs->trans('Service'), 'service'); print $text.' '.nl2br($object->lines[$i]->desc); @@ -879,12 +876,10 @@ if ($action == 'create') { // les filtres à faire ensuite if ($num > 0) { - $var=true; while ($i < min($num, $limit)) { $objp = $db->fetch_object($resql); - $var=!$var; - print ""; + print ''; print ''; print img_object($langs->trans("ShowIntervention"), "intervention").' '.$objp->titre; print "\n"; @@ -959,7 +954,7 @@ if ($action == 'create') { } } } else - print ''.$langs->trans("NoneF").''; + print ''.$langs->trans("NoneF").''; print ""; $db->free($resql); From 7d5464cfbcfd6182a69f46bef712eb4244ac3156 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 25 Jul 2018 15:25:23 +0200 Subject: [PATCH 11/40] Clean and update code --- htdocs/compta/bank/ligne.php | 2 +- htdocs/core/actions_massactions.inc.php | 2 +- htdocs/core/lib/admin.lib.php | 2 +- .../interface_50_modTicket_TicketEmail.class.php | 9 ++++++--- htdocs/expedition/card.php | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 10e549dd094..94db9607c30 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page -$langs->loadLangs(array('banks', 'categories', 'compta', 'bills')); +$langs->loadLangs(array('banks', 'categories', 'compta', 'bills', 'other')); if (! empty($conf->adherent->enabled)) $langs->load("members"); if (! empty($conf->don->enabled)) $langs->load("donations"); if (! empty($conf->loan->enabled)) $langs->load("loan"); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 646be9a3f92..7ce7ed12bff 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -703,7 +703,7 @@ if ($massaction == 'confirm_createbills') if (! $error) { $db->commit(); - setEventMessage($langs->trans('BillCreated', $nb_bills_created)); + setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs'); // Make a redirect to avoid to bill twice if we make a refresh or back $param=''; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index eb3ef3698a4..0e7203ba748 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1201,7 +1201,7 @@ function activateModulesRequiredByCountry($country_code) { activateModule($modName); - setEventMessage($objMod->automatic_activation[$country_code],'warnings'); + setEventMessages($objMod->automatic_activation[$country_code], null, 'warnings'); } } diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 56bbd897f3d..3e28ea3e4ef 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -152,9 +152,12 @@ class InterfaceTicketEmail extends DolibarrTriggers } include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { + if ($mailfile->error) + { + setEventMessages($mailfile->error, $mailfile->errors, 'errors'); + } + else + { $result = $mailfile->sendfile(); } if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index ab860ced2e9..faecdbd854e 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -276,7 +276,7 @@ if (empty($reshook)) // We try to set an amount // Case we dont use the list of available qty for each warehouse/lot // GUI does not allow this yet - setEventMessage('StockIsRequiredToChooseWhichLotToUse', 'errors'); + setEventMessages($langs->trans("StockIsRequiredToChooseWhichLotToUse"), null, 'errors'); } } } From ff04cb64c0b3609a9517c0fb4e9918ae37b742d3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 25 Jul 2018 15:36:50 +0200 Subject: [PATCH 12/40] Clean and update code --- htdocs/fourn/commande/card.php | 8 +++++--- htdocs/fourn/commande/list.php | 2 +- htdocs/fourn/facture/card.php | 6 ++++-- htdocs/product/admin/product.php | 4 ++-- htdocs/product/card.php | 6 +++--- htdocs/product/stock/product.php | 8 ++++---- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index e1670e0c4d0..bab095fe6fa 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2016 Regis Houssin * Copyright (C) 2010-2015 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2018 Philippe Grand * Copyright (C) 2012-2016 Marcos García * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Ion Agorria @@ -350,8 +350,10 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; - } else { - setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors'); + } + else + { + setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error ++; } } diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 971f99717f4..25f3118ad14 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -425,7 +425,7 @@ if (empty($reshook)) if (! $error) { $db->commit(); - setEventMessage($langs->trans('BillCreated', $nb_bills_created)); + setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs'); } else { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index d409ba35b86..aefd04914ad 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1160,8 +1160,10 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; - } else { - setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors'); + } + else + { + setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error ++; } } diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index cbf47bbcd21..9b32720a9a8 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -180,13 +180,13 @@ if ($action == 'specimen') // For products } else { - setEventMessage($obj->error,'errors'); + setEventMessages($obj->error, $obj->errors, 'errors'); dol_syslog($obj->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index b01aa8bc3f1..adb127d67f8 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -689,7 +689,7 @@ if (empty($reshook)) if (($result = $propal->defineBuyPrice($pu_ht, GETPOST('remise_percent'), $object->id)) < 0) { dol_syslog($langs->trans('FailedToGetCostPrice')); - setEventMessage($langs->trans('FailedToGetCostPrice'), 'errors'); + setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } else { @@ -732,7 +732,7 @@ if (empty($reshook)) if (($result = $commande->defineBuyPrice($pu_ht, GETPOST('remise_percent'), $object->id)) < 0) { dol_syslog($langs->trans('FailedToGetCostPrice')); - setEventMessage($langs->trans('FailedToGetCostPrice'), 'errors'); + setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } else { @@ -775,7 +775,7 @@ if (empty($reshook)) if (($result = $facture->defineBuyPrice($pu_ht, GETPOST('remise_percent'), $object->id)) < 0) { dol_syslog($langs->trans('FailedToGetCostPrice')); - setEventMessage($langs->trans('FailedToGetCostPrice'), 'errors'); + setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } else { diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 7c18dc11281..d2da5abd3e0 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -135,7 +135,7 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer) // Update $pse->seuil_stock_alerte = $seuil_stock_alerte; $pse->desiredstock = $desiredstock; - if($pse->update($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseUpdated')); + if($pse->update($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseUpdated'), null, 'mesgs'); } else { @@ -144,7 +144,7 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer) $pse->fk_product = $id; $pse->seuil_stock_alerte = GETPOST('seuil_stock_alerte'); $pse->desiredstock = GETPOST('desiredstock'); - if($pse->create($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseCreated')); + if($pse->create($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseCreated'), null, 'mesgs'); } @@ -160,7 +160,7 @@ if($action == 'delete_productstockwarehouse' && !empty($user->rights->produit->c $pse = new ProductStockEntrepot($db); $pse->fetch(GETPOST('fk_productstockwarehouse')); - if($pse->delete($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseDeleted')); + if($pse->delete($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseDeleted'), null, 'mesgs'); $action = ''; @@ -176,7 +176,7 @@ if ($action == 'setseuil_stock_alerte' && !empty($user->rights->produit->creer)) if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); //else - // setEventMessage($lans->trans("SavedRecordSuccessfully")); + // setEventMessages($lans->trans("SavedRecordSuccessfully"), null, 'mesgs'); $action=''; } From e48eec583d5df1354d3205559ce1e024c129a67b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 25 Jul 2018 17:00:49 +0200 Subject: [PATCH 13/40] FIX compatibility with multicompany transverse mode --- htdocs/user/class/api_users.class.php | 48 ++++++++++++++++----------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index dd4e60e4617..77e7f338e1a 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -231,38 +231,48 @@ class Users extends DolibarrApi * * @param int $id User ID * @param int $group Group ID + * @param int $entity Entity ID (valid only for superadmin in multicompany transverse mode) * @return int 1 if success * * @url GET {id}/setGroup/{group} */ - function setGroup($id, $group) { + function setGroup($id, $group, $entity = 1) { global $conf; //if (!DolibarrApiAccess::$user->rights->user->user->supprimer) { //throw new RestException(401); //} - $result = $this->useraccount->fetch($id); - if (!$result) - { - throw new RestException(404, 'User not found'); - } + $result = $this->useraccount->fetch($id); + if (!$result) + { + throw new RestException(404, 'User not found'); + } - if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) - { - throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); - } + if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) + { + throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); + } - // When using API, action is done on entity of logged user because a user of entity X with permission to create user should not be able to - // hack the security by giving himself permissions on another entity. - $result = $this->useraccount->SetInGroup($group, DolibarrApiAccess::$user->entity > 0 ? DolibarrApiAccess::$user->entity : $conf->entity); - if (! ($result > 0)) - { - throw new RestException(500, $this->useraccount->error); - } + if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && ! empty(DolibarrApiAccess::$user->admin) && empty(DolibarrApiAccess::$user->entity)) + { + $entity = (! empty($entity) ? $entity : $conf->entity); + } + else + { + // When using API, action is done on entity of logged user because a user of entity X with permission to create user should not be able to + // hack the security by giving himself permissions on another entity. + $entity = (DolibarrApiAccess::$user->entity > 0 ? DolibarrApiAccess::$user->entity : $conf->entity); + } - return 1; - } + $result = $this->useraccount->SetInGroup($group, $entity); + if (! ($result > 0)) + { + throw new RestException(500, $this->useraccount->error); + } + + return 1; + } /** * Delete account From efa6ad065921e4953bc571e5016fb1d47b7c2e10 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 25 Jul 2018 19:05:40 +0200 Subject: [PATCH 14/40] Clean and update code --- htdocs/product/price.php | 16 +++++++++------ htdocs/public/ticket/create_ticket.php | 28 +++++++++++++++++--------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 70e09114669..e68730acf64 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -6,7 +6,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2014 Florian Henry * Copyright (C) 2014-2016 Juanjo Menent - * Copyright (C) 2014-2015 Philippe Grand + * Copyright (C) 2014-2018 Philippe Grand * Copyright (C) 2014 Ion agorria * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2015 Marcos García @@ -46,7 +46,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { } // Load translation files required by the page -$langs->loadLangs(array('products', 'bills', 'companies')); +$langs->loadLangs(array('products', 'bills', 'companies', 'other')); $mesg=''; $error=0; $errors=array(); @@ -464,8 +464,10 @@ if (empty($reshook)) $sql .= " WHERE rowid = " . $rowid; $result = $db->query($sql); - } else { - setEventMessage('delete_price_by_qty Missing Ids','errors'); + } + else + { + setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors'); } } @@ -477,8 +479,10 @@ if (empty($reshook)) $sql .= " WHERE fk_product_price = " . $priceid; $result = $db->query($sql); - } else { - setEventMessage('delete_all_price_by_qty Missing Ids','errors'); + } + else + { + setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors'); } } diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 066471fddff..c3c4979a843 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -177,7 +177,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $action = "infos_success"; } else { $object->db->rollback(); - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $action = 'create_ticket'; } @@ -226,9 +226,12 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { } include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { + if ($mailfile->error || $mailfile->errors) + { + setEventMessages($mailfile->error, $mailfile->errors, 'errors'); + } + else + { $result = $mailfile->sendfile(); } if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { @@ -287,9 +290,12 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { } include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { + if ($mailfile->error || $mailfile->errors) + { + setEventMessages($mailfile->error, $mailfile->errors, 'errors'); + } + else + { $result = $mailfile->sendfile(); } if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { @@ -308,10 +314,12 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $formmail->remove_attached_files($i); } - setEventMessage($langs->trans('YourTicketSuccessfullySaved')); + setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs'); } - } else { - setEventMessage($object->errors, 'errors'); + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); } } From 2dd907a8e17baf4b402b3ec0969167ba9800bb61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 26 Jul 2018 09:41:44 +0200 Subject: [PATCH 15/40] extrafield totalizable --- htdocs/comm/propal/list.php | 31 ++++++++++++------ htdocs/core/actions_extrafields.inc.php | 10 ++++-- htdocs/core/class/extrafields.class.php | 32 ++++++++++++++----- htdocs/core/tpl/admin_extrafields_add.tpl.php | 4 +++ .../core/tpl/admin_extrafields_edit.tpl.php | 4 +++ .../core/tpl/admin_extrafields_view.tpl.php | 3 ++ .../tpl/extrafields_list_print_fields.tpl.php | 8 +++++ .../install/mysql/migration/8.0.0-9.0.0.sql | 1 + .../install/mysql/tables/llx_extrafields.sql | 1 + htdocs/langs/en_US/main.lang | 2 ++ 10 files changed, 76 insertions(+), 20 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 1a23c0b8728..1e00e48f36e 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -988,27 +988,40 @@ if ($resql) } // Show total line - if (isset($totalarray['totalhtfield']) + if (isset($totalarray['totalhtfield']) || isset($totalarray['totalvatfield']) || isset($totalarray['totalttcfield']) || isset($totalarray['totalamfield']) || isset($totalarray['totalrtpfield']) + || isset($totalarray['totalizable']) ) { print ''; $i=0; while ($i < $totalarray['nbfield']) { - $i++; - if ($i == 1) - { + $i++; + if ($i == 1) + { if ($num < $limit && empty($offset)) print ''.$langs->trans("Total").''; else print ''.$langs->trans("Totalforthispage").''; - } - elseif ($totalarray['totalhtfield'] == $i) print ''.price($totalarray['totalht']).''; - elseif ($totalarray['totalvatfield'] == $i) print ''.price($totalarray['totalvat']).''; - elseif ($totalarray['totalttcfield'] == $i) print ''.price($totalarray['totalttc']).''; - else print ''; + } + elseif ($totalarray['totalhtfield'] == $i) print ''.price($totalarray['totalht']).''; + elseif ($totalarray['totalvatfield'] == $i) print ''.price($totalarray['totalvat']).''; + elseif ($totalarray['totalttcfield'] == $i) print ''.price($totalarray['totalttc']).''; + elseif ($totalarray['totalizable']) { + $printed = false; + foreach ($totalarray['totalizable'] as $totalizable) { + if ($totalizable['pos']==$i && ! $printed) { + print ''.price($totalizable['total']).''; + $printed = true; + } + } + if (! $printed) { + print ''; + } + } + else print ''; } print ''; } diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index 599b847b49e..6b6d4b7a176 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -181,7 +181,9 @@ if ($action == 'add') GETPOST('help','alpha'), GETPOST('computed_value','alpha'), (GETPOST('entitycurrentorall', 'alpha')?0:''), - GETPOST('langfile', 'alpha') + GETPOST('langfile', 'alpha'), + 1, + (GETPOST('totalizable', 'alpha')?1:0) ); if ($result > 0) { @@ -331,7 +333,7 @@ if ($action == 'update') $visibility = GETPOST('list', 'alpha'); if ($type == 'separate') $visibility=3; - $result=$extrafields->update( + $result=$extrafields->update( GETPOST('attrname', 'alpha'), GETPOST('label', 'alpha'), $type, @@ -348,7 +350,9 @@ if ($action == 'update') GETPOST('default_value','alpha'), GETPOST('computed_value','alpha'), (GETPOST('entitycurrentorall', 'alpha')?0:''), - GETPOST('langfile') + GETPOST('langfile'), + 1, + (GETPOST('totalizable', 'alpha')?1:0) ); if ($result > 0) { diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index cd3e6c90fb5..9d8d718993b 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -9,6 +9,7 @@ * Copyright (C) 2015 Charles-Fr BENKE * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2017 Nicolas ZABOURI + * Copyright (C) 2018 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 @@ -516,14 +517,15 @@ class ExtraFields * @param string $entity Entity of extrafields * @param string $langfile Language file * @param string $enabled Condition to have the field enabled or not + * @param int $totalizable Is extrafield totalizable on list * @return int >0 if OK, <=0 if KO */ - function update($attrname, $label, $type, $length, $elementtype, $unique=0, $required=0, $pos=0, $param='', $alwayseditable=0, $perms='', $list='', $help='', $default='', $computed='', $entity='', $langfile='', $enabled='1') + function update($attrname, $label, $type, $length, $elementtype, $unique=0, $required=0, $pos=0, $param='', $alwayseditable=0, $perms='', $list='', $help='', $default='', $computed='', $entity='', $langfile='', $enabled='1', $totalizable=0) { if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'contact') $elementtype='socpeople'; - $table=$elementtype.'_extrafields'; + $table=$elementtype.'_extrafields'; if ($elementtype == 'categorie') $table='categories_extrafields'; if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname)) @@ -568,7 +570,7 @@ class ExtraFields { if ($label) { - $result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable,$perms,$list,$help,$default,$computed,$entity,$langfile,$enabled); + $result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable,$perms,$list,$help,$default,$computed,$entity,$langfile,$enabled, $totalizable); } if ($result > 0) { @@ -625,12 +627,13 @@ class ExtraFields * @param string $entity Entity of extrafields * @param string $langfile Language file * @param string $enabled Condition to have the field enabled or not - * @return int <=0 if KO, >0 if OK + * @param int $totalizable Is extrafield totalizable on list + * @return int <=0 if KO, >0 if OK */ - private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list='0',$help='',$default='',$computed='',$entity='',$langfile='',$enabled='1') + private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list='0',$help='',$default='',$computed='',$entity='',$langfile='',$enabled='1', $totalizable=0) { global $conf, $user; - dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$default.", ".$computed.", ".$entity.", ".$langfile.", ".$enabled); + dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$default.", ".$computed.", ".$entity.", ".$langfile.", ".$enabled.", ".$totalizable); // Clean parameters if ($elementtype == 'thirdparty') $elementtype='societe'; @@ -638,6 +641,9 @@ class ExtraFields if (empty($pos)) $pos=0; if (empty($list)) $list='0'; + if (empty($totalizable)) { + $totalizable = 0; + } if (empty($required)) $required=0; if (empty($unique)) $unique=0; if (empty($alwayseditable)) $alwayseditable=0; @@ -681,6 +687,7 @@ class ExtraFields $sql.= " alwayseditable,"; $sql.= " param,"; $sql.= " list,"; + $sql.= " totalizable,"; $sql.= " fielddefault,"; $sql.= " fieldcomputed,"; $sql.= " fk_user_author,"; @@ -703,6 +710,7 @@ class ExtraFields $sql.= " '".$this->db->escape($alwayseditable)."',"; $sql.= " '".$this->db->escape($params)."',"; $sql.= " '".$this->db->escape($list)."', "; + $sql.= " ".$totalizable.","; $sql.= " ".(($default!='')?"'".$this->db->escape($default)."'":"null").","; $sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null").","; $sql .= " " . $user->id . ","; @@ -773,7 +781,7 @@ class ExtraFields // We should not have several time this log. If we have, there is some optimization to do by calling a simple $object->fetch_optionals() that include cache management. dol_syslog("fetch_name_optionals_label elementtype=".$elementtype); - $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,fielddefault,fieldcomputed,entity,enabled,help"; + $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,totalizable,fielddefault,fieldcomputed,entity,enabled,help"; $sql.= " FROM ".MAIN_DB_PREFIX."extrafields"; $sql.= " WHERE entity IN (0,".$conf->entity.")"; if ($elementtype) $sql.= " AND elementtype = '".$elementtype."'"; // Filed with object->table_element @@ -807,6 +815,7 @@ class ExtraFields $this->attribute_perms[$tab->name]=(strlen($tab->perms) == 0 ? 1 : $tab->perms); $this->attribute_langfile[$tab->name]=$tab->langs; $this->attribute_list[$tab->name]=$tab->list; + $this->attribute_totalizable[$tab->name]=$tab->totalizable; $this->attribute_entityid[$tab->name]=$tab->entity; $this->attribute_entitylabel[$tab->name]=(empty($labelmulticompany[$tab->entity])?'Entity'.$tab->entity:$labelmulticompany[$tab->entity]); @@ -825,6 +834,7 @@ class ExtraFields $this->attributes[$tab->elementtype]['perms'][$tab->name]=(strlen($tab->perms) == 0 ? 1 : $tab->perms); $this->attributes[$tab->elementtype]['langfile'][$tab->name]=$tab->langs; $this->attributes[$tab->elementtype]['list'][$tab->name]=$tab->list; + $this->attributes[$tab->elementtype]['totalizable'][$tab->name]=$tab->totalizable; $this->attributes[$tab->elementtype]['entityid'][$tab->name]=$tab->entity; $this->attributes[$tab->elementtype]['entitylabel'][$tab->name]=(empty($labelmulticompany[$tab->entity])?'Entity'.$tab->entity:$labelmulticompany[$tab->entity]); $this->attributes[$tab->elementtype]['enabled'][$tab->name]=$tab->enabled; @@ -886,6 +896,7 @@ class ExtraFields $perms=dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1); $langfile=$this->attributes[$extrafieldsobjectkey]['langfile'][$key]; $list=dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1); + $totalizable=$this->attributes[$extrafieldsobjectkey]['totalizable'][$key]; $help=$this->attributes[$extrafieldsobjectkey]['help'][$key]; $hidden=(empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) } @@ -902,6 +913,7 @@ class ExtraFields $param=$this->attribute_param[$key]; $langfile=$this->attribute_langfile[$key]; $list=$this->attribute_list[$key]; + $totalizable=$this->attribute_totalizable[$key]; $hidden=(empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) } @@ -1753,7 +1765,7 @@ class ExtraFields $align=''; - if ($type == 'date') + if ($type == 'date') { $align="center"; } @@ -1781,6 +1793,10 @@ class ExtraFields { $align="center"; } + elseif ($type == 'price') + { + $align="right"; + } return $align; } diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index e80685154fc..2c971c7a553 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2017 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2018 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 @@ -52,6 +53,7 @@ $langs->load("modulebuilder"); var required = jQuery("#required"); var alwayseditable = jQuery("#alwayseditable"); var list = jQuery("#list"); + var totalizable = jQuery("#totalizable"); load("modulebuilder"); textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?> + +trans("Totalizable"); ?>> textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?> multicompany->enabled) { ?> diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index cb5ef26bc57..d4dc2776fde 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2018 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 @@ -51,6 +52,7 @@ $langs->load("modulebuilder"); var required = jQuery("#required"); var alwayseditable = jQuery("#alwayseditable"); var list = jQuery("#list"); + var totalizable = jQuery("#totalizable"); attributes[$elementtype]['param'][$attrname]; $perms=$extrafields->attributes[$elementtype]['perms'][$attrname]; $langfile=$extrafields->attributes[$elementtype]['langfile'][$attrname]; $list=$extrafields->attributes[$elementtype]['list'][$attrname]; +$totalizable = $extrafields->attributes[$elementtype]['totalizable'][$attrname]; $help=$extrafields->attributes[$elementtype]['help'][$attrname]; $entitycurrentorall=$extrafields->attributes[$elementtype]['entityid'][$attrname]; @@ -251,6 +254,7 @@ else trans("AlwaysEditable"); ?>> textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?> +textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?>> textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?> multicompany->enabled) { ?> diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index a03c06f2d1d..ebe7a49877d 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -1,6 +1,7 @@ * Copyright (C) 2012-2017 Regis Houssin + * Copyright (C) 2018 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 @@ -61,6 +62,7 @@ print ''.$langs->trans("Unique").''; print ''.$langs->trans("Required").''; print ''.$langs->trans("AlwaysEditable").''; print ''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).''; +print ''.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).''; if ($conf->multicompany->enabled) { print ''.$langs->trans("Entities").''; } @@ -88,6 +90,7 @@ if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafiel print ''.yn($extrafields->attributes[$elementtype]['required'][$key])."\n"; print ''.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."\n"; print ''.$extrafields->attributes[$elementtype]['list'][$key]."\n"; + print ''.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."\n"; if (! empty($conf->multicompany->enabled)) { print ''.($extrafields->attributes[$elementtype]['entityid'][$key]==0?$langs->trans("All"):$extrafields->attributes[$elementtype]['entitylabel'][$key]).''; } diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index e59f50501ab..b506bda0793 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -40,6 +40,14 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ print $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey); print ''; if (! $i) $totalarray['nbfield']++; + + if ($extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key]) { + if (! $i) { + // we keep position for the first line + $totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield']; + } + $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; + } if (! empty($val['isameasure'])) { if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey; diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 87ada98390b..82d58c40192 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -30,6 +30,7 @@ ALTER TABLE llx_extrafields ADD COLUMN help text NULL; +ALTER TABLE llx_extrafields ADD COLUMN totalizable boolean DEFAULT FALSE after list; ALTER TABLE llx_user ADD COLUMN dateemploymentend date after dateemployment; diff --git a/htdocs/install/mysql/tables/llx_extrafields.sql b/htdocs/install/mysql/tables/llx_extrafields.sql index 1a85fc28a5a..9f37383957a 100644 --- a/htdocs/install/mysql/tables/llx_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_extrafields.sql @@ -36,6 +36,7 @@ create table llx_extrafields alwayseditable integer DEFAULT 0, -- 1 if field can be edited whatever is element status param text, -- extra parameters to define possible values of field list varchar(255) DEFAULT '1', -- visibility of field. 0=Never visible, 1=Visible on list and forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing + totalizable boolean DEFAULT FALSE, -- is extrafield totalizable on list langs varchar(64), -- example: fileofmymodule@mymodule help text, -- to store help tooltip fk_user_author integer, -- user making creation diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 72725d3d634..8b47c46cef9 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -733,6 +733,8 @@ Result=Result ToTest=Test ValidateBefore=Card must be validated before using this feature Visibility=Visibility +Totalizable=Totalizable +TotalizableDesc=This field is totalizable in list Private=Private Hidden=Hidden Resources=Resources From 0952cf5e2b6fedaa984fa34fcb7aca01ab93f5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 26 Jul 2018 10:43:50 +0200 Subject: [PATCH 16/40] fix no link in order list --- htdocs/commande/class/commande.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 4202f44720b..605be7e9b3f 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3424,7 +3424,7 @@ class Commande extends CommonOrder if (!$user->rights->commande->lire) $option = 'nolink'; - + if ($option !== 'nolink') { // Add param to save lastsearch_values or not @@ -3468,11 +3468,11 @@ class Commande extends CommonOrder $linkstart.=$linkclose.'>'; $linkend=''; - if ($option == 'nolink') { + if ($option === 'nolink') { $linkstart = ''; $linkend = ''; } - + $result .= $linkstart; if ($withpicto) $result.=img_object(($notooltip?'':$label), $this->picto, ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); if ($withpicto != 2) $result.= $this->ref; From aaf4f066863504aecef62af24916e6691078f64e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 26 Jul 2018 11:10:48 +0200 Subject: [PATCH 17/40] test include --- dev/setup/codesniffer/ruleset.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index a43e4dde82b..5c4175d1f11 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -285,7 +285,7 @@ - + From 3f4db55614690c78f44ffdadb89f907f7b6d3927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 26 Jul 2018 11:34:51 +0200 Subject: [PATCH 18/40] test include --- htdocs/ftp/index.php | 4 ++-- htdocs/mailmanspip/class/mailmanspip.class.php | 2 +- htdocs/webservices/server_actioncomm.php | 10 +++++----- htdocs/webservices/server_category.php | 6 +++--- htdocs/webservices/server_contact.php | 10 +++++----- htdocs/webservices/server_invoice.php | 2 +- htdocs/webservices/server_order.php | 5 ++--- htdocs/webservices/server_other.php | 2 +- htdocs/webservices/server_payment.php | 2 +- htdocs/webservices/server_project.php | 2 +- htdocs/webservices/server_supplier_invoice.php | 3 +-- 11 files changed, 23 insertions(+), 25 deletions(-) diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index 943d4fa94e1..afc7c1f0f7a 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -22,7 +22,7 @@ * \brief Main page for FTP section area */ -require('../main.inc.php'); +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; @@ -83,7 +83,7 @@ $mesg=''; // Submit file if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $result=$ecmdir->fetch($_REQUEST["section"]); if (! $result > 0) diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index f7ae2608da5..240637282db 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -181,7 +181,7 @@ class MailmanSpip if ($mydb) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $mdpass=dol_hash($object->pass); $htpass=crypt($object->pass,makesalt()); $query = "INSERT INTO spip_auteurs (nom, email, login, pass, htpass, alea_futur, statut) VALUES(\"".dolGetFirstLastname($object->firstname,$object->lastname)."\",\"".$object->email."\",\"".$object->login."\",\"$mdpass\",\"$htpass\",FLOOR(32000*RAND()),\"1comite\")"; diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index a00e014d88a..6a581b2ca0d 100644 --- a/htdocs/webservices/server_actioncomm.php +++ b/htdocs/webservices/server_actioncomm.php @@ -25,12 +25,12 @@ if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1'); -require_once("../master.inc.php"); -require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP -require_once(DOL_DOCUMENT_ROOT."/core/lib/ws.lib.php"); +require "../master.inc.php"; +require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP +require_once DOL_DOCUMENT_ROOT."/core/lib/ws.lib.php"; -require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php"); -require_once(DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php"); +require_once DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php"; +require_once DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php"; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php index 9ef07dda952..1096b9da923 100644 --- a/htdocs/webservices/server_category.php +++ b/htdocs/webservices/server_category.php @@ -23,10 +23,10 @@ if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1'); -require_once("../master.inc.php"); -require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP +require "../master.inc.php"; +require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; -require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php"); +require_once DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php"; dol_syslog("Call Dolibarr webservices interfaces"); diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index 6791864ba8b..9ffde3cdf80 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -23,11 +23,11 @@ if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1'); -require_once("../master.inc.php"); -require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP -require_once(DOL_DOCUMENT_ROOT."/core/lib/ws.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require "../master.inc.php"; +require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP +require_once DOL_DOCUMENT_ROOT."/core/lib/ws.lib.php"; +require_once DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/extrafields.class.php"; dol_syslog("Call Contact webservices interfaces"); diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index c93605ab2ea..aed031fa9ca 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -23,7 +23,7 @@ if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1'); -require_once '../master.inc.php'; +require '../master.inc.php'; require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index eb42dd74ce4..e140550207d 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -24,12 +24,11 @@ if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1'); -require_once '../master.inc.php'; +require '../master.inc.php'; require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - -require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); +require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"; dol_syslog("Call Dolibarr webservices interfaces"); diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index 8ac519ae87e..895e5d55af4 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.php @@ -22,7 +22,7 @@ if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1'); -require_once '../master.inc.php'; +require '../master.inc.php'; require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; diff --git a/htdocs/webservices/server_payment.php b/htdocs/webservices/server_payment.php index d6cd261a686..9356b6a558a 100644 --- a/htdocs/webservices/server_payment.php +++ b/htdocs/webservices/server_payment.php @@ -27,7 +27,7 @@ // This is to make Dolibarr working with Plesk set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs'); -require_once '../master.inc.php'; +require '../master.inc.php'; require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; diff --git a/htdocs/webservices/server_project.php b/htdocs/webservices/server_project.php index bc26de37601..822081011aa 100644 --- a/htdocs/webservices/server_project.php +++ b/htdocs/webservices/server_project.php @@ -23,7 +23,7 @@ if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1'); -require_once '../master.inc.php'; +require '../master.inc.php'; require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php index fcfd73270aa..50e5498dbe1 100644 --- a/htdocs/webservices/server_supplier_invoice.php +++ b/htdocs/webservices/server_supplier_invoice.php @@ -22,11 +22,10 @@ if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1'); -require_once '../master.inc.php'; +require '../master.inc.php'; require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; - require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; From fa2de55109ee74bc3fad753d458983f7354f1eb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 26 Jul 2018 11:50:54 +0200 Subject: [PATCH 19/40] test include --- htdocs/expensereport/card.php | 6 +++--- .../expensereport/class/expensereport.class.php | 2 +- htdocs/expensereport/document.php | 2 +- htdocs/expensereport/list.php | 6 +++--- htdocs/expensereport/note.php | 2 +- htdocs/modulebuilder/template/mymoduleindex.php | 12 ++++++------ .../modulebuilder/template/myobject_agenda.php | 12 ++++++------ htdocs/modulebuilder/template/myobject_card.php | 16 ++++++++-------- .../modulebuilder/template/myobject_document.php | 12 ++++++------ htdocs/modulebuilder/template/myobject_list.php | 14 +++++++------- htdocs/modulebuilder/template/myobject_note.php | 12 ++++++------ htdocs/webservices/server_productorservice.php | 4 ++-- 12 files changed, 50 insertions(+), 50 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 141260d36f3..0dee88c8a4c 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.clas require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; if (! empty($conf->accounting->enabled)) { - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; + include_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; } // Load translation files required by the page @@ -95,7 +95,7 @@ $extrafields = new ExtraFields($db); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +require DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be require, not require_once // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('expensereportcard','globalcard')); @@ -2456,7 +2456,7 @@ $defaulttopic='SendExpenseReportRef'; $diroutput = $conf->expensereport->dir_output; $trackid = 'exp'.$object->id; -include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; +require DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; llxFooter(); diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index b7c81c4d33a..8300960e204 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1127,7 +1127,7 @@ class ExpenseReport extends CommonObject // Rename directory if dir was a temporary ref if (preg_match('/^[\(]?PROV/i', $this->ref)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // On renomme repertoire ($this->ref = ancienne ref, $num = nouvelle ref) // in order not to lose the attachments diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index f0d61d0f80d..2bf890e540c 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -73,7 +73,7 @@ $modulepart='trip'; * Actions */ -include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; +require_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; /* diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index e576889d363..64bffc43e3b 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -143,7 +143,7 @@ $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; if (empty($reshook)) { @@ -179,7 +179,7 @@ if (empty($reshook)) if ($action == 'update' && ! $cancel) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; if ($canedituser) // Case we can edit all field { @@ -313,7 +313,7 @@ if (empty($user->rights->expensereport->readall) && empty($user->rights->expense $sql.= " AND d.fk_user_author IN (".join(',',$childids).")\n"; } // Add where from extra fields -include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; +require DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook diff --git a/htdocs/expensereport/note.php b/htdocs/expensereport/note.php index 7eb48443901..9bf360c9ac7 100644 --- a/htdocs/expensereport/note.php +++ b/htdocs/expensereport/note.php @@ -56,7 +56,7 @@ $permissionnote=$user->rights->expensereport->creer; // Used by the include of a * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once +require DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be require, not require_once /* diff --git a/htdocs/modulebuilder/template/mymoduleindex.php b/htdocs/modulebuilder/template/mymoduleindex.php index bf56d00ede0..f439d4fd9d8 100644 --- a/htdocs/modulebuilder/template/mymoduleindex.php +++ b/htdocs/modulebuilder/template/mymoduleindex.php @@ -27,16 +27,16 @@ // 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"); +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"); +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 && 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_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 5c7303ba6a9..dfd69037baf 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -25,16 +25,16 @@ // 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"); +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"); +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 && 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_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 137e394fe08..16a83ee7d0d 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -45,20 +45,20 @@ // 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"); +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"); +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 && 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"); -include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); -include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.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('/mymodule/class/myobject.class.php'); dol_include_once('/mymodule/lib/myobject.lib.php'); diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index c08a360835a..2a72464fb9d 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -25,16 +25,16 @@ // 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"); +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"); +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 && 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_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 21ab2d6cafe..6516f7eeff9 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -43,19 +43,19 @@ // 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"); +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"); +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 && 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_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.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('/mymodule/class/myobject.class.php'); diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index 5b438c32a7c..2574e4239fa 100644 --- a/htdocs/modulebuilder/template/myobject_note.php +++ b/htdocs/modulebuilder/template/myobject_note.php @@ -25,16 +25,16 @@ // 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"); +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"); +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 && 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('/mymodule/class/myobject.class.php'); diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index c4c4d40191e..37df126c753 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -25,14 +25,14 @@ if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1'); -require_once '../master.inc.php'; +require '../master.inc.php'; require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php"); +require_once DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php"; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; From 1297470c999d510cdf7d96b46a4e0ce3092ab151 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Thu, 26 Jul 2018 15:05:32 +0200 Subject: [PATCH 20/40] FIX project overview (can use any fields as fk_projet) --- htdocs/core/class/html.formprojet.class.php | 4 ++-- htdocs/projet/class/project.class.php | 4 ++-- htdocs/projet/element.php | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index a6c94d79780..25e2cb13d81 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -458,7 +458,7 @@ class FormProjets * @param int $limitonstatus Add filters to limit length of list to opened status (for example to avoid ERR_RESPONSE_HEADERS_TOO_BIG on project/element.php page). TODO To implement * @return int|string The HTML select list of element or '' if nothing or -1 if KO */ - function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2) + function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2,$projectkey="fk_projet") { global $conf, $langs; @@ -468,7 +468,7 @@ class FormProjets if (! in_array($table_element, array('don','expensereport_det','expensereport','loan','stock_mouvement','chargesociales'))) $linkedtothirdparty=true; $sqlfilter=''; - $projectkey="fk_projet"; + //print $table_element; switch ($table_element) { diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index edfbef084df..1078733c19e 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -518,7 +518,7 @@ class Project extends CommonObject * @param int $datee End date * @return mixed Array list of object ids linked to project, < 0 or string if error */ - function get_element_list($type, $tablename, $datefieldname='', $dates='', $datee='') + function get_element_list($type, $tablename, $datefieldname='', $dates='', $datee='', $project_field='fk_projet') { $elements = array(); @@ -548,7 +548,7 @@ class Project extends CommonObject } else { - $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE fk_projet IN (". $ids .")"; + $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE ".$project_field." IN (". $ids .")"; } if ($dates > 0) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index dd19ceeb263..93b4cb1b810 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -562,11 +562,12 @@ foreach ($listofreferent as $key => $value) $datefieldname=$value['datefieldname']; $qualified=$value['test']; $margin = $value['margin']; + $project_field = $value['project_field']; if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'plus') { $element = new $classname($db); - $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee); + $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, !empty($project_field)?$project_field:'fk_projet'); if (count($elementarray)>0 && is_array($elementarray)) { @@ -697,6 +698,7 @@ foreach ($listofreferent as $key => $value) $urlnew=$value['urlnew']; $buttonnew=$value['buttonnew']; $testnew=$value['testnew']; + $project_field=$value['project_field']; if ($qualified) { @@ -719,7 +721,7 @@ foreach ($listofreferent as $key => $value) if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty && !in_array($tablename, array('payment_various'))) { - $selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300'); + $selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300',-2,!empty($project_field)?$project_field:'fk_projet'); if (! $selectList || ($selectList<0)) { setEventMessages($formproject->error,$formproject->errors,'errors'); @@ -787,7 +789,7 @@ foreach ($listofreferent as $key => $value) else print ''.$langs->trans("Status").''; print ''; - $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee); + $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee,!empty($project_field)?$project_field:'fk_projet'); if (is_array($elementarray) && count($elementarray)>0) { $total_ht = 0; From a0a5d33641ddd0f2f3511a56c737219d2087467f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 26 Jul 2018 11:57:25 +0200 Subject: [PATCH 21/40] test include --- build/generate_filelist_xml.php | 4 +- dev/examples/code/create_invoice.php | 4 +- dev/examples/code/create_order.php | 4 +- dev/examples/code/create_product.php | 4 +- dev/examples/code/create_user.php | 4 +- dev/examples/code/get_contracts.php | 4 +- dev/initdata/generate-invoice.php | 6 +-- dev/initdata/generate-order.php | 4 +- dev/initdata/generate-product.php | 2 +- dev/initdata/generate-proposal.php | 12 +++--- dev/initdata/generate-thirdparty.php | 2 +- dev/initdata/import-products.php | 2 +- dev/initdata/import-thirdparties.php | 2 +- dev/initdata/import-users.php | 2 +- dev/initdata/purge-data.php | 2 +- dev/initdemo/sftpget_and_loaddump.php | 16 +++---- dev/initdemo/updatedemo.php | 16 +++---- dev/setup/codesniffer/ruleset.xml | 13 ++++++ dev/tools/test/testtcpdf.php | 4 +- dev/tools/test/testutf.php | 4 +- dev/translation/autotranslator.php | 6 +-- htdocs/admin/dolistore/ajax/image.php | 25 ++++------- .../class/PSWebServiceLibrary.class.php | 4 +- htdocs/admin/mails_senderprofile_list.php | 4 +- htdocs/admin/modules.php | 2 +- htdocs/asset/card.php | 4 +- htdocs/cashdesk/affContenu.php | 2 +- htdocs/cashdesk/facturation.php | 2 +- htdocs/cashdesk/validation.php | 2 +- htdocs/cashdesk/validation_ok.php | 2 +- htdocs/cashdesk/validation_ticket.php | 4 +- htdocs/comm/action/class/actioncomm.class.php | 6 +-- htdocs/compta/bank/annuel.php | 2 +- htdocs/compta/bank/bankentries_list.php | 2 +- htdocs/compta/bank/bilan.php | 2 +- htdocs/compta/bank/budget.php | 2 +- htdocs/compta/bank/card.php | 2 +- htdocs/compta/bank/categ.php | 2 +- htdocs/compta/bank/document.php | 2 +- htdocs/compta/bank/graph.php | 2 +- htdocs/compta/bank/info.php | 2 +- htdocs/compta/bank/ligne.php | 6 +-- htdocs/compta/bank/list.php | 2 +- htdocs/compta/bank/releve.php | 2 +- htdocs/compta/bank/transfer.php | 2 +- htdocs/compta/facture/card.php | 4 +- .../facture/class/facture-rec.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/compta/facture/document.php | 4 +- htdocs/compta/facture/fiche-rec.php | 6 +-- htdocs/compta/facture/info.php | 2 +- htdocs/compta/paiement/cheque/card.php | 2 +- .../cheque/class/remisecheque.class.php | 4 +- htdocs/compta/paiement/cheque/index.php | 2 +- htdocs/compta/paiement/cheque/list.php | 2 +- .../compta/paiement/class/paiement.class.php | 6 +-- htdocs/compta/prelevement/bons.php | 2 +- htdocs/compta/prelevement/card.php | 2 +- .../class/bonprelevement.class.php | 8 ++-- htdocs/compta/prelevement/create.php | 2 +- htdocs/compta/prelevement/demandes.php | 2 +- htdocs/compta/prelevement/factures.php | 2 +- htdocs/compta/prelevement/fiche-rejet.php | 2 +- htdocs/compta/prelevement/fiche-stat.php | 2 +- htdocs/compta/prelevement/index.php | 2 +- htdocs/compta/prelevement/ligne.php | 2 +- htdocs/compta/prelevement/list.php | 2 +- htdocs/compta/prelevement/rejets.php | 2 +- htdocs/compta/prelevement/stats.php | 2 +- htdocs/compta/sociales/card.php | 6 +-- .../class/paymentsocialcontribution.class.php | 2 +- htdocs/compta/sociales/document.php | 6 +-- htdocs/compta/sociales/info.php | 4 +- htdocs/conf/conf.php.example | 14 +++---- htdocs/contrat/card.php | 2 +- htdocs/contrat/contact.php | 2 +- htdocs/contrat/document.php | 2 +- htdocs/contrat/index.php | 6 +-- htdocs/contrat/info.php | 2 +- htdocs/contrat/list.php | 2 +- htdocs/contrat/note.php | 2 +- htdocs/contrat/services_list.php | 8 ++-- htdocs/core/actions_massactions.inc.php | 4 +- htdocs/core/ajax/price.php | 2 +- htdocs/core/boxes/box_project.php | 4 +- htdocs/core/boxes/box_task.php | 6 +-- htdocs/core/class/smtps.class.php | 2 +- htdocs/core/lib/invoice2.lib.php | 4 +- .../core/modules/modExpenseReport.class.php | 2 +- htdocs/core/modules/modHRM.class.php | 2 +- htdocs/core/modules/modHoliday.class.php | 2 +- htdocs/core/modules/modOpenSurvey.class.php | 2 +- .../doc/doc_generic_project_odt.modules.php | 2 +- .../modules/syslog/mod_syslog_chromephp.php | 10 ++--- .../modules/syslog/mod_syslog_firephp.php | 2 +- htdocs/core/tpl/resource_add.tpl.php | 2 +- htdocs/cron/admin/cron.php | 2 +- htdocs/cron/class/cronjob.class.php | 2 +- htdocs/dav/fileserver.php | 2 +- htdocs/expedition/card.php | 2 +- htdocs/expedition/class/expedition.class.php | 2 +- htdocs/expensereport/card.php | 6 +-- .../class/expensereport.class.php | 2 +- .../class/expensereportstats.class.php | 4 +- .../class/paymentexpensereport.class.php | 2 +- htdocs/expensereport/document.php | 2 +- htdocs/expensereport/list.php | 8 ++-- htdocs/expensereport/note.php | 2 +- htdocs/externalsite/frametop.php | 2 +- htdocs/fichinter/card-rec.php | 7 +--- .../fournisseur.commande.dispatch.class.php | 6 +-- htdocs/ftp/index.php | 42 +++++++++---------- htdocs/holiday/card.php | 2 +- htdocs/holiday/define_holiday.php | 2 +- htdocs/holiday/list.php | 2 +- htdocs/holiday/month_report.php | 2 +- htdocs/holiday/view_log.php | 2 +- htdocs/hrm/admin/admin_establishment.php | 2 +- htdocs/hrm/admin/admin_hrm.php | 2 +- htdocs/hrm/establishment/card.php | 2 +- htdocs/hrm/establishment/info.php | 2 +- htdocs/hrm/index.php | 2 +- .../mailmanspip/class/mailmanspip.class.php | 2 +- htdocs/main.inc.php | 2 +- htdocs/margin/admin/margin.php | 4 +- htdocs/modulebuilder/index.php | 2 +- htdocs/modulebuilder/template/admin/about.php | 10 ++--- htdocs/modulebuilder/template/admin/setup.php | 10 ++--- .../template/css/mymodule.css.php | 10 ++--- .../modulebuilder/template/js/mymodule.js.php | 10 ++--- .../template/myobject_document.php | 2 +- .../modulebuilder/template/myobject_list.php | 2 +- .../modulebuilder/template/myobject_note.php | 2 +- .../template/scripts/myobject.php | 10 ++--- htdocs/opensurvey/card.php | 12 +++--- .../class/opensurveysondage.class.php | 6 +-- htdocs/opensurvey/exportcsv.php | 8 ++-- htdocs/opensurvey/index.php | 6 +-- htdocs/opensurvey/list.php | 8 ++-- htdocs/opensurvey/results.php | 11 +++-- htdocs/opensurvey/wizard/choix_autre.php | 8 ++-- htdocs/opensurvey/wizard/choix_date.php | 8 ++-- htdocs/opensurvey/wizard/create_survey.php | 10 ++--- htdocs/product/class/productbatch.class.php | 2 +- .../class/propalmergepdfproduct.class.php | 2 +- htdocs/product/inventory/list.php | 2 +- htdocs/projet/activity/index.php | 2 +- htdocs/projet/activity/perday.php | 2 +- htdocs/projet/activity/perweek.php | 2 +- htdocs/projet/ganttview.php | 2 +- htdocs/projet/tasks.php | 2 +- htdocs/projet/tasks/comment.php | 2 +- htdocs/projet/tasks/contact.php | 2 +- htdocs/projet/tasks/list.php | 2 +- htdocs/projet/tasks/note.php | 2 +- htdocs/projet/tasks/task.php | 2 +- htdocs/public/cron/cron_run_jobs.php | 10 +---- htdocs/public/opensurvey/studs.php | 10 ++--- htdocs/public/stripe/ipn.php | 6 +-- htdocs/resource/card.php | 7 +--- htdocs/resource/class/dolresource.class.php | 2 +- .../class/html.formresource.class.php | 4 +- htdocs/resource/element_resource.php | 6 +-- htdocs/societe/checkvat/checkVatPopup.php | 2 +- htdocs/societe/consumption.php | 2 +- htdocs/societe/website.php | 2 +- htdocs/stripe/payment.php | 3 +- htdocs/ticket/class/ticket.class.php | 4 +- htdocs/ticket/class/ticketlogs.class.php | 4 +- htdocs/ticket/list.php | 2 +- htdocs/user/class/usergroup.class.php | 2 +- htdocs/webservices/server_order.php | 4 +- .../webservices/server_productorservice.php | 4 +- htdocs/website/websiteaccount_card.php | 23 +++------- .../accountancy/export-thirdpartyaccount.php | 2 +- scripts/bank/export-bank-receipts.php | 2 +- .../company/export-contacts-xls-example.php | 12 +++--- .../company/sync_contacts_dolibarr2ldap.php | 8 ++-- .../email_expire_services_to_customers.php | 4 +- ...ail_expire_services_to_representatives.php | 4 +- scripts/cron/cron_run_jobs.php | 6 +-- scripts/emailings/mailing-send.php | 6 +-- .../email_unpaid_invoices_to_customers.php | 4 +- ...ail_unpaid_invoices_to_representatives.php | 4 +- scripts/invoices/rebuild_merge_pdf.php | 10 ++--- .../members/sync_members_dolibarr2ldap.php | 6 +-- .../members/sync_members_ldap2dolibarr.php | 10 ++--- .../sync_members_types_dolibarr2ldap.php | 6 +-- .../sync_members_types_ldap2dolibarr.php | 8 ++-- scripts/modulebuilder/builddoc.php | 2 +- scripts/modulebuilder/initmodule.php | 2 +- scripts/product/migrate_picture_path.php | 6 +-- scripts/product/regenerate_thumbs.php | 8 ++-- scripts/user/sync_groups_dolibarr2ldap.php | 6 +-- scripts/user/sync_groups_ldap2dolibarr.php | 10 ++--- scripts/user/sync_users_dolibarr2ldap.php | 6 +-- scripts/user/sync_users_ldap2dolibarr.php | 8 ++-- scripts/withdrawals/build_withdrawal_file.php | 10 ++--- test/phpunit/ModulesTest.php | 2 +- test/phpunit/WebservicesInvoicesTest.php | 2 +- test/phpunit/WebservicesOrdersTest.php | 2 +- test/phpunit/WebservicesOtherTest.php | 2 +- test/phpunit/WebservicesProductsTest.php | 2 +- test/phpunit/WebservicesThirdpartyTest.php | 2 +- test/phpunit/WebservicesUserTest.php | 2 +- 205 files changed, 442 insertions(+), 477 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 0764d64b491..ec9ded557ff 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -34,8 +34,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit; } -require_once($path."../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); +require_once $path."../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; /* diff --git a/dev/examples/code/create_invoice.php b/dev/examples/code/create_invoice.php index bd82d38d306..e519c62a436 100755 --- a/dev/examples/code/create_invoice.php +++ b/dev/examples/code/create_invoice.php @@ -40,7 +40,7 @@ $error=0; // -------------------- START OF YOUR CODE HERE -------------------- // Include Dolibarr environment -require_once($path."../../htdocs/master.inc.php"); +require_once $path."../../htdocs/master.inc.php"; // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file. //$langs->setDefaultLang('en_US'); // To change default language of $langs @@ -58,7 +58,7 @@ print "***** ".$script_file." (".$version.") *****\n"; // Start of transaction $db->begin(); -require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); +require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"; // Create invoice object $obj = new Facture($db); diff --git a/dev/examples/code/create_order.php b/dev/examples/code/create_order.php index 4575e9e28f3..95b047705fa 100755 --- a/dev/examples/code/create_order.php +++ b/dev/examples/code/create_order.php @@ -40,7 +40,7 @@ $error=0; // -------------------- START OF YOUR CODE HERE -------------------- // Include Dolibarr environment -require_once($path."../../htdocs/master.inc.php"); +require_once $path."../../htdocs/master.inc.php"; // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file. //$langs->setDefaultLang('en_US'); // To change default language of $langs @@ -59,7 +59,7 @@ print "***** ".$script_file." (".$version.") *****\n"; // Start of transaction $db->begin(); -require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); +require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"; // Create order object $com = new Commande($db); diff --git a/dev/examples/code/create_product.php b/dev/examples/code/create_product.php index 61598ff59d9..8cbc07a1b63 100755 --- a/dev/examples/code/create_product.php +++ b/dev/examples/code/create_product.php @@ -40,7 +40,7 @@ $error=0; // -------------------- START OF YOUR CODE HERE -------------------- // Include Dolibarr environment -require_once($path."../../htdocs/master.inc.php"); +require_once $path."../../htdocs/master.inc.php"; // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file. //$langs->setDefaultLang('en_US'); // To change default language of $langs @@ -59,7 +59,7 @@ print "***** ".$script_file." (".$version.") *****\n"; // Start of transaction $db->begin(); -require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); +require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; // Create instance of object $myproduct=new Product($db); diff --git a/dev/examples/code/create_user.php b/dev/examples/code/create_user.php index 20173eb914a..f8e0ba23011 100755 --- a/dev/examples/code/create_user.php +++ b/dev/examples/code/create_user.php @@ -40,7 +40,7 @@ $error=0; // -------------------- START OF YOUR CODE HERE -------------------- // Include Dolibarr environment -require_once($path."../../htdocs/master.inc.php"); +require_once $path."../../htdocs/master.inc.php"; // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file. //$langs->setDefaultLang('en_US'); // To change default language of $langs @@ -58,7 +58,7 @@ print "***** ".$script_file." (".$version.") *****\n"; // Start of transaction $db->begin(); -require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php"); +require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php"; // Create user object $obj = new User($db); diff --git a/dev/examples/code/get_contracts.php b/dev/examples/code/get_contracts.php index fbe512300e8..daff0e43e6f 100755 --- a/dev/examples/code/get_contracts.php +++ b/dev/examples/code/get_contracts.php @@ -40,7 +40,7 @@ $error=0; // -------------------- START OF YOUR CODE HERE -------------------- // Include Dolibarr environment -require_once($path."../../htdocs/master.inc.php"); +require_once $path."../../htdocs/master.inc.php"; // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file. //$langs->setDefaultLang('en_US'); // To change default language of $langs @@ -65,7 +65,7 @@ print 'Argument id_thirdparty='.$argv[1]."\n"; // Start of transaction $db->begin(); -require_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); +require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"; // Create contract object $obj = new Contrat($db); diff --git a/dev/initdata/generate-invoice.php b/dev/initdata/generate-invoice.php index e313aa44d1f..4064336cbab 100755 --- a/dev/initdata/generate-invoice.php +++ b/dev/initdata/generate-invoice.php @@ -32,9 +32,9 @@ if (substr($sapi_type, 0, 3) == 'cgi') { // Recupere root dolibarr //$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]); -require (__DIR__. '/../../htdocs/master.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); -require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); +require __DIR__. '/../../htdocs/master.inc.php'; +require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"; +require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; /* diff --git a/dev/initdata/generate-order.php b/dev/initdata/generate-order.php index c73b15b620d..5e53fa752a2 100755 --- a/dev/initdata/generate-order.php +++ b/dev/initdata/generate-order.php @@ -33,14 +33,14 @@ if (substr($sapi_type, 0, 3) == 'cgi') { // Recupere root dolibarr //$path=preg_replace('/generate-commande.php/i','',$_SERVER["PHP_SELF"]); -require (__DIR__. '/../../htdocs/master.inc.php'); +require __DIR__. '/../../htdocs/master.inc.php'; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); +require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"; /* diff --git a/dev/initdata/generate-product.php b/dev/initdata/generate-product.php index 3ae44b00b3a..393d5c5ce3d 100755 --- a/dev/initdata/generate-product.php +++ b/dev/initdata/generate-product.php @@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { // Recupere root dolibarr //$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]); -require (__DIR__. '/../../htdocs/master.inc.php'); +require __DIR__. '/../../htdocs/master.inc.php'; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; diff --git a/dev/initdata/generate-proposal.php b/dev/initdata/generate-proposal.php index 6f1dc293a68..631b734fc9e 100755 --- a/dev/initdata/generate-proposal.php +++ b/dev/initdata/generate-proposal.php @@ -33,11 +33,11 @@ if (substr($sapi_type, 0, 3) == 'cgi') { // Recupere root dolibarr //$path=preg_replace('/generate-propale.php/i','',$_SERVER["PHP_SELF"]); -require (__DIR__. '/../../htdocs/master.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); -require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php"); -require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); -require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); +require __DIR__. '/../../htdocs/master.inc.php'; +require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"; +require_once DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php"; +require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"; +require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; /* * Parameters @@ -157,7 +157,7 @@ $user->rights->propal->propal_advance->validate=1; if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php")) { - require_once(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"); + require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"; } $i=0; diff --git a/dev/initdata/generate-thirdparty.php b/dev/initdata/generate-thirdparty.php index 992ab61f4ef..7f2c3e2055d 100755 --- a/dev/initdata/generate-thirdparty.php +++ b/dev/initdata/generate-thirdparty.php @@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { // Recupere root dolibarr //$path=preg_replace('/generate-societe.php/i','',$_SERVER["PHP_SELF"]); -require (__DIR__. '/../../htdocs/master.inc.php'); +require __DIR__. '/../../htdocs/master.inc.php'; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; diff --git a/dev/initdata/import-products.php b/dev/initdata/import-products.php index a08e3b6066e..942e6f8f5d7 100755 --- a/dev/initdata/import-products.php +++ b/dev/initdata/import-products.php @@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { // Recupere root dolibarr $path=preg_replace('/import-products.php/i','',$_SERVER["PHP_SELF"]); -require ($path."../../htdocs/master.inc.php"); +require $path."../../htdocs/master.inc.php"; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; diff --git a/dev/initdata/import-thirdparties.php b/dev/initdata/import-thirdparties.php index 0c32c7ea6a3..63c6856e5ec 100755 --- a/dev/initdata/import-thirdparties.php +++ b/dev/initdata/import-thirdparties.php @@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { // Recupere root dolibarr $path=preg_replace('/import-thirdparties.php/i','',$_SERVER["PHP_SELF"]); -require ($path."../../htdocs/master.inc.php"); +require $path."../../htdocs/master.inc.php"; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; diff --git a/dev/initdata/import-users.php b/dev/initdata/import-users.php index 3aaa9c11a4a..72a006bbe29 100755 --- a/dev/initdata/import-users.php +++ b/dev/initdata/import-users.php @@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { // Recupere root dolibarr $path=preg_replace('/import-users.php/i','',$_SERVER["PHP_SELF"]); -require ($path."../../htdocs/master.inc.php"); +require $path."../../htdocs/master.inc.php"; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index f992dcb2dc6..5a1e7b3afc3 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { // Recupere root dolibarr $path=preg_replace('/purge-data.php/i','',$_SERVER["PHP_SELF"]); -require ($path."../../htdocs/master.inc.php"); +require $path."../../htdocs/master.inc.php"; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; diff --git a/dev/initdemo/sftpget_and_loaddump.php b/dev/initdemo/sftpget_and_loaddump.php index 981ff964b8e..98cb6189935 100755 --- a/dev/initdemo/sftpget_and_loaddump.php +++ b/dev/initdemo/sftpget_and_loaddump.php @@ -41,15 +41,15 @@ $passwordbase=isset($argv[6])?$argv[6]:''; // Include Dolibarr environment $res=0; -if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php"); -if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include($path."../../htdocs/master.inc.php"); -if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php"); -if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php"); -if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php"); -if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include($path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only -if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include("../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only +if (! $res && file_exists($path."../../master.inc.php")) $res=@include $path."../../master.inc.php"; +if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include $path."../../htdocs/master.inc.php"; +if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php"; +if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php"; +if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php"; +if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only +if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only if (! $res) die ("Failed to include master.inc.php file\n"); -include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'); +include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; /* diff --git a/dev/initdemo/updatedemo.php b/dev/initdemo/updatedemo.php index 9c453096904..ef37e25c04f 100755 --- a/dev/initdemo/updatedemo.php +++ b/dev/initdemo/updatedemo.php @@ -36,15 +36,15 @@ $confirm=isset($argv[1])?$argv[1]:''; // Include Dolibarr environment $res=0; -if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php"); -if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include($path."../../htdocs/master.inc.php"); -if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php"); -if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php"); -if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php"); -if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include($path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only -if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include("../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only +if (! $res && file_exists($path."../../master.inc.php")) $res=@include $path."../../master.inc.php"; +if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include $path."../../htdocs/master.inc.php"; +if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php"; +if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php"; +if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php"; +if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only +if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only if (! $res) die ("Failed to include master.inc.php file\n"); -include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'); +include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; /* diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 5c4175d1f11..6619cf83754 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -286,6 +286,19 @@ + + + 0 + + + 0 + + + 0 + + + 0 + diff --git a/dev/tools/test/testtcpdf.php b/dev/tools/test/testtcpdf.php index e14dae9c2a3..ce962dce3d9 100755 --- a/dev/tools/test/testtcpdf.php +++ b/dev/tools/test/testtcpdf.php @@ -27,8 +27,8 @@ * @since 2008-03-04 */ -require_once('../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php'); -require_once('../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php'); +require_once '../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php'; +require_once '../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php'; // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); diff --git a/dev/tools/test/testutf.php b/dev/tools/test/testutf.php index c626a92a57d..ffa746bcab5 100644 --- a/dev/tools/test/testutf.php +++ b/dev/tools/test/testutf.php @@ -47,8 +47,8 @@ print 'Files has been created. Check its name from your explorer'."\n"; * @since 2008-09-15 */ -require_once('../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php'); -require_once('../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php'); +require_once '../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php'; +require_once '../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php'; // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); diff --git a/dev/translation/autotranslator.php b/dev/translation/autotranslator.php index 58314a23b9e..c7897810a72 100755 --- a/dev/translation/autotranslator.php +++ b/dev/translation/autotranslator.php @@ -37,8 +37,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') { } // Include Dolibarr environment -require_once($path.'../../htdocs/master.inc.php'); -require_once($path.'../../htdocs/core/lib/files.lib.php'); +require_once $path.'../../htdocs/master.inc.php'; +require_once $path.'../../htdocs/core/lib/files.lib.php'; // After this $db is an opened handler to database. We close it at end of file. // Load main language strings @@ -88,7 +88,7 @@ if ($argv[2] != 'all') } } -require_once(DOL_DOCUMENT_ROOT."/../dev/translation/autotranslator.class.php"); +require_once DOL_DOCUMENT_ROOT."/../dev/translation/autotranslator.class.php"; $langParser = new autoTranslator($argv[2],$argv[1],$dir,$file,$argv[3]); diff --git a/htdocs/admin/dolistore/ajax/image.php b/htdocs/admin/dolistore/ajax/image.php index 14d05a036e8..043d24e8376 100644 --- a/htdocs/admin/dolistore/ajax/image.php +++ b/htdocs/admin/dolistore/ajax/image.php @@ -20,22 +20,11 @@ if (!defined('REQUIRE_JQUERY_BLOCKUI')) define('REQUIRE_JQUERY_BLOCKUI', 1); /** - * \file htdocs/commande/info.php - * \ingroup commande - * \brief Page des informations d'une commande + * \file htdocs/admin/dolistore/ajax.php + * \ingroup admin + * \brief Page des informations dolistore */ -$res = 0; -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 && file_exists("../../../../main.inc.php")) $res = @include("../../../../main.inc.php"); -if (!$res && file_exists("../../../dolibarr/htdocs/main.inc.php")) - $res = @include("../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only -if (!$res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) - $res = @include("../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only -if (!$res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) - $res = @include("../../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only -if (!$res) die("Include of main fails"); +require "../../../main.inc.php"; // CORE @@ -52,8 +41,10 @@ $quality = GETPOST('quality', 'alpha'); try { $url = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/images/products/'.$id_product.'/'.$id_image.'/'.$quality; - $api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, - $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $dolistore->debug_api); + $api = new PrestaShopWebservice( + $conf->global->MAIN_MODULE_DOLISTORE_API_SRV, + $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $dolistore->debug_api + ); //echo $url; $request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET')); header('Content-type:image'); diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index de3ca683519..c6e33023e4c 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -53,7 +53,7 @@ class PrestaShopWebservice * PrestaShopWebservice constructor. Throw an exception when CURL is not installed/activated * * * * '."\n"; if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { - require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $formfile = new FormFile($db); $hidegeneratedfilelistifempty=1; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index cb560b29d86..437a43bd05b 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -672,7 +672,7 @@ if ($mode == 'common') print ''; print $versiontrans; if(!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)){ - require_once(DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'); + require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; if (!empty($objMod->url_last_version)) { $newversion = getURLContent($objMod->url_last_version); if(isset($newversion['content'])){ diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 1cb580c8c8d..9126f80617f 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -25,8 +25,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; -include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); -include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Load translation files required by the page $langs->loadLangs(array("asset")); diff --git a/htdocs/cashdesk/affContenu.php b/htdocs/cashdesk/affContenu.php index bd778f3422e..2a3c0279df8 100644 --- a/htdocs/cashdesk/affContenu.php +++ b/htdocs/cashdesk/affContenu.php @@ -87,7 +87,7 @@ print ''; print '
'; print '
'; -require ('tpl/liste_articles.tpl.php'); +require 'tpl/liste_articles.tpl.php'; print '
'; print '
'; diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index f52890b68d2..6a2889f6e71 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -163,4 +163,4 @@ $obj_facturation->paiementLe('RESET'); // Affichage des templates -require ('tpl/facturation1.tpl.php'); +require 'tpl/facturation1.tpl.php'; diff --git a/htdocs/cashdesk/validation.php b/htdocs/cashdesk/validation.php index 289c864ca32..ff1219861e2 100644 --- a/htdocs/cashdesk/validation.php +++ b/htdocs/cashdesk/validation.php @@ -24,5 +24,5 @@ $form=new Form($db); // Affichage des templates -require ('tpl/validation1.tpl.php'); +require 'tpl/validation1.tpl.php'; diff --git a/htdocs/cashdesk/validation_ok.php b/htdocs/cashdesk/validation_ok.php index 70bf3d1b64f..c8c83a91f18 100644 --- a/htdocs/cashdesk/validation_ok.php +++ b/htdocs/cashdesk/validation_ok.php @@ -22,5 +22,5 @@ */ // Affichage des templates -require ('tpl/validation2.tpl.php'); +require 'tpl/validation2.tpl.php'; diff --git a/htdocs/cashdesk/validation_ticket.php b/htdocs/cashdesk/validation_ticket.php index 577df309138..a98b50b0bc9 100644 --- a/htdocs/cashdesk/validation_ticket.php +++ b/htdocs/cashdesk/validation_ticket.php @@ -24,7 +24,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php'; -include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); +require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $obj_facturation = unserialize($_SESSION['serObjFacturation']); unset($_SESSION['serObjFacturation']); @@ -35,7 +35,7 @@ $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters,$obj_facturation); if (empty($reshook)) { - require ('tpl/ticket.tpl.php'); + require 'tpl/ticket.tpl.php'; } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index c6ec428e68f..6c863580203 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1351,9 +1351,9 @@ class ActionComm extends CommonObject { global $conf,$langs,$dolibarr_main_url_root,$mysoc; - require_once (DOL_DOCUMENT_ROOT ."/core/lib/xcal.lib.php"); - require_once (DOL_DOCUMENT_ROOT ."/core/lib/date.lib.php"); - require_once (DOL_DOCUMENT_ROOT ."/core/lib/files.lib.php"); + require_once DOL_DOCUMENT_ROOT ."/core/lib/xcal.lib.php"; + require_once DOL_DOCUMENT_ROOT ."/core/lib/date.lib.php"; + require_once DOL_DOCUMENT_ROOT ."/core/lib/files.lib.php"; dol_syslog(get_class($this)."::build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".count($filters), LOG_DEBUG); diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index a786cf5ca28..82dcfe76d60 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -24,7 +24,7 @@ * \brief Page to report input-output of a bank account */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 8ddc3de0014..b198b54dfc8 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -29,7 +29,7 @@ * \brief List of bank transactions */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; diff --git a/htdocs/compta/bank/bilan.php b/htdocs/compta/bank/bilan.php index 5e5194d55c8..7c04c409bed 100644 --- a/htdocs/compta/bank/bilan.php +++ b/htdocs/compta/bank/bilan.php @@ -22,7 +22,7 @@ * \brief Page de bilan */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index 280cd9bdbc0..a319f6de6a4 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -24,7 +24,7 @@ * \brief Page de budget */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index db497733863..c091d2ac298 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -27,7 +27,7 @@ * \brief Page to create/view a bank account */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index be029fcb2f5..8760852592f 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -26,7 +26,7 @@ * \brief Page ajout de categories bancaires */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php'; diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 33e74dc3691..314ab074c19 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -24,7 +24,7 @@ * \ingroup banque * \brief Page de gestion des documents attaches a un compte bancaire */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . "/core/lib/bank.lib.php"; require_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php"; require_once DOL_DOCUMENT_ROOT . "/core/lib/images.lib.php"; diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index b829002a990..c163c0e421e 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -23,7 +23,7 @@ * \brief Page graph des transactions bancaires */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php index ab43b9374aa..0b622154137 100644 --- a/htdocs/compta/bank/info.php +++ b/htdocs/compta/bank/info.php @@ -21,7 +21,7 @@ * \brief Onglet info d'une ecriture bancaire */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 10e549dd094..78759f40cf0 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -28,7 +28,7 @@ * \brief Page to edit a bank transaction record */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; @@ -98,8 +98,8 @@ if ($action == 'confirm_delete_categ' && $confirm == "yes" && $user->rights->ban { dol_print_error($db); } - } - else + } + else { setEventMessages($langs->trans("MissingIds"), null, 'errors'); } diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index e52e285742c..909785f2fba 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -27,7 +27,7 @@ use Stripe\BankAccount; * \brief Home page of bank module */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 1d9d5526700..af352035bbe 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -25,7 +25,7 @@ * \brief Page to show a bank statement report */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index 765001e75a5..0c8d3ea2b87 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -26,7 +26,7 @@ * \brief Page de saisie d'un virement */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0688d8488ed..b5d04062693 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1705,8 +1705,8 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; - } - else + } + else { setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error ++; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index a82f06ad851..06f33f3f69a 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -443,7 +443,7 @@ class FactureRec extends CommonInvoice // Retreive all extrafield for line // fetch optionals attributes and labels - require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafieldsline=new ExtraFields($this->db); $extrafieldsline=$extrafieldsline->fetch_name_optionals_label('facturedet_rec',true); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index bb00620d056..4edce36b82f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3027,7 +3027,7 @@ class Facture extends CommonInvoice { global $mysoc,$user; - include_once(DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php'); + include_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php'; // Cap percentages to 100 if ($percent > 100) $percent = 100; diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 828c77f1178..161804d8a34 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -35,7 +35,7 @@ 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'; if (! empty($conf->projet->enabled)) { - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } // Load translation files required by the page @@ -78,7 +78,7 @@ if ($object->fetch($id)) * Actions */ -include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; +require_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; /* diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 6719e7091c8..35ce40a6316 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -35,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; if (! empty($conf->projet->enabled)) { - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; - //require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; + include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; + //include_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; } require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; @@ -546,7 +546,7 @@ if (empty($reshook)) } elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { - require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; + include_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; $prodcustprice = new Productcustomerprice($db); diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 8964b85203b..4eba0ba65fc 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; if (! empty($conf->projet->enabled)) { - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } // Load translation files required by the page diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 69f3bd102df..428f55f9362 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -273,7 +273,7 @@ else if ($action == 'remove_file' && $user->rights->banque->cheque) { if ($object->fetch($id) > 0) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $langs->load("other"); diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 528b01477a6..189afeda59f 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -593,8 +593,8 @@ class RemiseCheque extends CommonObject $file = "pdf_".$model.".class.php"; if (file_exists($dir.$file)) { - require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php'; - require_once $dir.$file; + include_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php'; + include_once $dir.$file; $classname='BordereauCheque'.ucfirst($model); $docmodel = new $classname($this->db); diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index 527bd05e3a1..b6770e62d33 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -24,7 +24,7 @@ * \brief Home page for cheque receipts */ -require('../../../main.inc.php'); +require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 800f40b9694..44fd508dc3d 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -25,7 +25,7 @@ * \brief Page list of cheque deposits */ -require('../../../main.inc.php'); +require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 539c70f591b..53a17830c09 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -545,7 +545,7 @@ class Paiement extends CommonObject $this->fk_account=$accountid; - require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; dol_syslog("$user->id,$mode,$label,$this->fk_account,$emetteur_nom,$emetteur_banque"); @@ -1064,7 +1064,7 @@ class Paiement extends CommonObject $arraybill = $this->getBillsArray(); if (is_array($arraybill) && count($arraybill) > 0) { - require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $facturestatic=new Facture($this->db); foreach ($arraybill as $billid) { @@ -1170,7 +1170,7 @@ class Paiement extends CommonObject */ function fetch_thirdparty($force_thirdparty_id=0) { - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; + include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; if (empty($force_thirdparty_id)) { diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 0cbaa9ce55e..c7fee1f70a8 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -24,7 +24,7 @@ * \brief Page liste des bons de prelevements */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 343a45472b6..84c4087e451 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -23,7 +23,7 @@ * \brief Card of a direct debit */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index a6b0ec84317..94d5a764a38 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -762,16 +762,16 @@ class BonPrelevement extends CommonObject dol_syslog(__METHOD__."::Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format, LOG_DEBUG); - require_once (DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); - require_once (DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); + require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"; + require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; if (empty($format)) return 'ErrorBadParametersForDirectDebitFileCreate'; $error = 0; $datetimeprev = time(); - //Choice the date of the execution direct debit - if(!empty($executiondate)) $datetimeprev = $executiondate; + //Choice the date of the execution direct debit + if(!empty($executiondate)) $datetimeprev = $executiondate; $month = strftime("%m", $datetimeprev); $year = strftime("%Y", $datetimeprev); diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 74bd282d606..191a54b7484 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -25,7 +25,7 @@ * \brief Prelevement creation page */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index d20f92cb188..b5058b5c685 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -24,7 +24,7 @@ * \brief Page to list withdraw requests */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/modPrelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 2eabd64873d..d4593a3dcef 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -24,7 +24,7 @@ * \brief Page liste des factures prelevees */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 113153bc896..ebf3876406b 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -24,7 +24,7 @@ * \brief Withdraw reject */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index c126212f17c..e4371abfb5c 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -23,7 +23,7 @@ * \brief Prelevement statistics */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index de99b56eb19..83f14169d4c 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -26,7 +26,7 @@ */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index 721cf62bcd7..8cad6ed70d5 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -24,7 +24,7 @@ * \brief card of withdraw line */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 8d657f00221..cac9e52b3c9 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -24,7 +24,7 @@ * \brief Page liste des prelevements */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index c8812bba1a9..2e340a2c801 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -24,7 +24,7 @@ * \brief Reject page */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 20d213e820b..7c878787e89 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -24,7 +24,7 @@ * \brief Page with statistics on withdrawals */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 101a934a524..697253b90eb 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -32,11 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (! empty($conf->projet->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } if (! empty($conf->accounting->enabled)) { - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; + include_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; } // Load translation files required by the page diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index ba9c671f755..114a2e78cf1 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -518,7 +518,7 @@ class PaymentSocialContribution extends CommonObject if (! empty($conf->banque->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); $acc->fetch($accountid); diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 490dbf3a1fe..5f3fc5aa4eb 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -35,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; if (! empty($conf->projet->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } // Load translation files required by the page @@ -76,7 +76,7 @@ $modulepart='tax'; * Actions */ -include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; +require_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; if ($action == 'setlib' && $user->rights->tax->charges->creer) { diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index 1827c1597f8..4e184e2099f 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -27,8 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; if (! empty($conf->projet->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } // Load translation files required by the page diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index 7475cf54ddb..886a6171818 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -14,7 +14,7 @@ // dolibarr_main_url_root // This parameter defines the root URL of your Dolibarr index.php page without ending "/". // It must link to the directory htdocs. -// In most cases, this is autodetected but it's still required +// In most cases, this is autodetected but it's still required // * to show full url bookmarks for some services (ie: agenda rss export url, ...) // * or when using Apache dir aliases (autodetect fails) // * or when using nginx (autodetect fails) @@ -40,7 +40,7 @@ $dolibarr_main_document_root=''; // dolibarr_main_url_root_alt // This parameter defines the relative sub URLs to add to $dolibarr_main_url_root to // forge alternative root directories (used by modules developers). -// You can put several values, separated by a coma, but number of entries must match +// You can put several values, separated by a coma, but number of entries must match // number of entries into $dolibarr_main_document_root_alt. // Examples: // $dolibarr_main_url_root_alt='/custom'; @@ -52,7 +52,7 @@ $dolibarr_main_document_root=''; // dolibarr_main_document_root_alt // This parameter contains absolute alternative root file system directories (used by // modules developers). -// You can put several values, separated by a coma, but number of entries must match +// You can put several values, separated by a coma, but number of entries must match // number of entries into $dolibarr_main_url_root_alt. // Examples: // $dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/custom'; @@ -162,7 +162,7 @@ $dolibarr_main_db_collation='utf8_unicode_ci'; // Default value: dolibarr // Possible values: Any values found in files in htdocs/core/login directory after // the "function_" string and before the ".php" string. You can also separate several -// values using a ",". In this case, Dolibarr will check login/pass for each value in +// values using a ",". In this case, Dolibarr will check login/pass for each value in // order defined into value. However, note that this can't work with all values. // Examples: // $dolibarr_main_authentication='http'; @@ -207,10 +207,10 @@ $dolibarr_main_authentication='dolibarr'; // 0 = No forced redirect // 1 = Force redirect to https, until SCRIPT_URI start with https into response // 2 = Force redirect to https, until SERVER["HTTPS"] is 'on' into response -// 'https://my.domain.com' = Force reditect to https using this domain name. +// 'https://my.domain.com' = Force reditect to https using this domain name. // Warning: If you enable this parameter, your web server must be configured to -// respond URL with https protocol. -// According to your web server setup, some values may works and other not. Try +// respond URL with https protocol. +// According to your web server setup, some values may works and other not. Try // different values (1,2 or 'https://my.domain.com') if you experience problems. // Default value: 0 // Possible values: 0, 1, 2 or 'https://my.domain.com' diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index d0120d130df..9c13a57112a 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -30,7 +30,7 @@ * \brief Page of a contract */ -require ("../main.inc.php"); +require "../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 4d403198eb8..063e3ecb228 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -24,7 +24,7 @@ * \brief Onglet de gestion des contacts des contrats */ -require ("../main.inc.php"); +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 0208d68f80d..20a70830952 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -27,7 +27,7 @@ * \brief Page des documents joints sur les contrats */ -require ("../main.inc.php"); +require "../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index b78bf52b6be..f348cab8234 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -24,9 +24,9 @@ * \brief Home page of contract area */ -require ("../main.inc.php"); -require_once (DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); -require_once (DOL_DOCUMENT_ROOT."/product/class/product.class.php"); +require "../main.inc.php"; +require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"; +require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; // Load translation files required by the page $langs->loadLangs(array('products', 'companies', 'contracts')); diff --git a/htdocs/contrat/info.php b/htdocs/contrat/info.php index 8899351c284..c783ca4948c 100644 --- a/htdocs/contrat/info.php +++ b/htdocs/contrat/info.php @@ -22,7 +22,7 @@ * \brief Page des informations d'un contrat */ -require ("../main.inc.php"); +require "../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 18e78c7ff0a..e616afefd99 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -28,7 +28,7 @@ * \brief Page liste des contrats */ -require ("../main.inc.php"); +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index c160201191a..a5ea40e146c 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -24,7 +24,7 @@ * \brief Fiche de notes sur un contrat */ -require ("../main.inc.php"); +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; if (! empty($conf->projet->enabled)) { diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index de44410e505..1ce48a7371d 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -25,10 +25,10 @@ * \brief Page to list services in contracts */ -require ("../main.inc.php"); -require_once (DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); -require_once (DOL_DOCUMENT_ROOT."/product/class/product.class.php"); -require_once (DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); +require "../main.inc.php"; +require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"; +require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; +require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; // Load translation files required by the page $langs->loadLangs(array('products', 'contracts', 'companies')); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 646be9a3f92..7d481463294 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -378,7 +378,7 @@ if (! $error && $massaction == 'confirm_presend') //var_dump($filepath); // Send mail (substitutionarray must be done just before this) - require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1); if ($mailfile->error) { @@ -433,7 +433,7 @@ if (! $error && $massaction == 'confirm_presend') if (! empty($trigger_name)) { // Appel des triggers - include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + include_once DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"; $interface=new Interfaces($db); $result=$interface->run_triggers($trigger_name, $objectobj, $user, $langs, $conf); if ($result < 0) { $error++; $errors=$interface->errors; } diff --git a/htdocs/core/ajax/price.php b/htdocs/core/ajax/price.php index 577f659b2cc..453fdc7bc82 100644 --- a/htdocs/core/ajax/price.php +++ b/htdocs/core/ajax/price.php @@ -25,7 +25,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -require('../../main.inc.php'); +require '../../main.inc.php'; $output = GETPOST('output','alpha'); $amount = price2num(GETPOST('amount','alpha')); diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 976cbf1766c..29bc4410b82 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -23,7 +23,7 @@ * \ingroup projet * \brief Module to show Projet activity of the current Year */ -include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); +include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; /** * Class to manage the box to show last projet @@ -80,7 +80,7 @@ class box_project extends ModeleBoxes // list the summary of the orders if ($user->rights->projet->lire) { - include_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'); + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $projectstatic = new Project($this->db); $socid=$user->societe_id; diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 3a665243073..802195ca445 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -22,8 +22,8 @@ * \brief Module to Task activity of the current year */ -include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); +include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"; /** @@ -75,7 +75,7 @@ class box_task extends ModeleBoxes $totalMnt = 0; $totalnb = 0; $totalDuree=0; - include_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php"); + include_once DOL_DOCUMENT_ROOT."/projet/class/task.class.php"; $taskstatic=new Task($db); diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index ffa9dafdfbe..7f0f8143cbd 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -656,7 +656,7 @@ class SMTPs { // If the path is not valid, this will NOT generate an error, // it will simply return false. - if ( ! @include ( $_strConfigPath ) ) + if ( ! @include $_strConfigPath) { $this->_setErr(110, '"' . $_strConfigPath . '" is not a valid path.'); $_retVal = false; diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index 866cf004ca6..f318f493417 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -23,8 +23,8 @@ * \brief Function to rebuild PDF and merge PDF files into one */ -require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'); -require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index 78f517b6768..3226745d6c0 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -23,7 +23,7 @@ * \ingroup expensereport * \brief Description and activation file for module ExpenseReport */ -include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php"); +include_once DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php"; /** diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index 6b9f81a5a1f..d713b4edc4a 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -20,7 +20,7 @@ * \ingroup HRM * \brief Description and activation file for module HRM */ -include_once (DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php"); +include_once DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php"; /** * Class to describe and activate the HRM module diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 0ba265e6089..eb1b727ea31 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -28,7 +28,7 @@ * \ingroup holiday * \brief Description and activation file for module holiday */ -include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php"); +include_once DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php"; /** diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index 23c1b2680b8..951a8ea5d63 100644 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -23,7 +23,7 @@ * \ingroup opensurvey * \brief Description and activation file for module OpenSurvey */ -include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php"); +include_once DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php"; /** diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 2f393e50002..92b3ea54a48 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -206,7 +206,7 @@ class doc_generic_project_odt extends ModelePDFProjects $ret[$pc.'phone_mobile'] = $ct->phone_mobile; // fetch external user extrafields - require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields=new ExtraFields($this->db); $extralabels=$extrafields->fetch_name_optionals_label($ct->table_element, true); $extrafields_num = $ct->fetch_optionals(); diff --git a/htdocs/core/modules/syslog/mod_syslog_chromephp.php b/htdocs/core/modules/syslog/mod_syslog_chromephp.php index 7523588ac15..2617cdb269d 100644 --- a/htdocs/core/modules/syslog/mod_syslog_chromephp.php +++ b/htdocs/core/modules/syslog/mod_syslog_chromephp.php @@ -66,8 +66,8 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface } set_include_path($conf->global->SYSLOG_CHROMEPHP_INCLUDEPATH); - $res = @include_once('ChromePhp.php'); - if (! $res) $res=@include_once('ChromePhp.class.php'); + $res = @include_once 'ChromePhp.php'; + if (! $res) $res=@include_once 'ChromePhp.class.php'; restore_include_path(); @@ -152,12 +152,12 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface try { - // Warning ChromePHP must be into PHP include path. It is not possible to use into require_once() a constant from + // Warning ChromePHP must be into PHP include path. It is not possible to use into require_once a constant from // database or config file because we must be able to log data before database or config file read. $oldinclude=get_include_path(); set_include_path($conf->global->SYSLOG_CHROMEPHP_INCLUDEPATH); - $res = @include_once('ChromePhp.php'); - if (! $res) $res=@include_once('ChromePhp.class.php'); + $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 diff --git a/htdocs/core/modules/syslog/mod_syslog_firephp.php b/htdocs/core/modules/syslog/mod_syslog_firephp.php index f502022c4f6..98a3c7142af 100644 --- a/htdocs/core/modules/syslog/mod_syslog_firephp.php +++ b/htdocs/core/modules/syslog/mod_syslog_firephp.php @@ -153,7 +153,7 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface try { - // Warning FirePHPCore must be into PHP include path. It is not possible to use into require_once() a constant from + // Warning FirePHPCore must be into PHP include path. It is not possible to use into require_once a constant from // database or config file because we must be able to log data before database or config file read. $oldinclude=get_include_path(); set_include_path($conf->global->SYSLOG_FIREPHP_INCLUDEPATH); diff --git a/htdocs/core/tpl/resource_add.tpl.php b/htdocs/core/tpl/resource_add.tpl.php index af1d25aaee1..688d3aba221 100644 --- a/htdocs/core/tpl/resource_add.tpl.php +++ b/htdocs/core/tpl/resource_add.tpl.php @@ -9,7 +9,7 @@ if (empty($conf) || ! is_object($conf)) } -require_once(DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php'); +require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php'; $form = new Form($db); $formresources = new FormResource($db); diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php index 729772bcf7e..647aa8b96e3 100644 --- a/htdocs/cron/admin/cron.php +++ b/htdocs/cron/admin/cron.php @@ -25,7 +25,7 @@ */ // Dolibarr environment -$res = @include("../../main.inc.php"); // From htdocs directory +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php'; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index e3235789d66..3ccf27ee676 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -22,7 +22,7 @@ */ // Put here all includes required by your class file -require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); +require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; /** diff --git a/htdocs/dav/fileserver.php b/htdocs/dav/fileserver.php index a1d145306f5..2fc4485dc76 100644 --- a/htdocs/dav/fileserver.php +++ b/htdocs/dav/fileserver.php @@ -28,7 +28,7 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOLOGIN')) define("NOLOGIN",1); // This means this output page does not require to be logged. if (! defined('NOCSRFCHECK')) define("NOCSRFCHECK",1); // We accept to go on this page from external web site. -require ("../main.inc.php"); +require "../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/dav/dav.class.php'; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index ab860ced2e9..eb932f76c51 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -504,7 +504,7 @@ if (empty($reshook)) // Action update else if ( - ($action == 'settracking_number' + ($action == 'settracking_number' || $action == 'settracking_url' || $action == 'settrueWeight' || $action == 'settrueWidth' diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 4042b202300..4974722166c 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1114,7 +1114,7 @@ class Expedition extends CommonObject // Stock control if (! $error && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > 0) { - require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"); + require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"; $langs->load("agenda"); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 0dee88c8a4c..141260d36f3 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.clas require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; if (! empty($conf->accounting->enabled)) { - include_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; + require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; } // Load translation files required by the page @@ -95,7 +95,7 @@ $extrafields = new ExtraFields($db); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); // Load object -require DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be require, not require_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('expensereportcard','globalcard')); @@ -2456,7 +2456,7 @@ $defaulttopic='SendExpenseReportRef'; $diroutput = $conf->expensereport->dir_output; $trackid = 'exp'.$object->id; -require DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; +include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; llxFooter(); diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 8300960e204..b7c81c4d33a 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1127,7 +1127,7 @@ class ExpenseReport extends CommonObject // Rename directory if dir was a temporary ref if (preg_match('/^[\(]?PROV/i', $this->ref)) { - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // On renomme repertoire ($this->ref = ancienne ref, $num = nouvelle ref) // in order not to lose the attachments diff --git a/htdocs/expensereport/class/expensereportstats.class.php b/htdocs/expensereport/class/expensereportstats.class.php index 07396663f42..2c15b1ffed5 100644 --- a/htdocs/expensereport/class/expensereportstats.class.php +++ b/htdocs/expensereport/class/expensereportstats.class.php @@ -22,8 +22,8 @@ * \ingroup expensereport * \brief Fichier de la classe de gestion des stats des expensereport et notes de frais */ -include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php'; -include_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php'; +require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; /** * Classe permettant la gestion des stats des expensereports et notes de frais diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 0634ca16b7a..781b22d27e7 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -505,7 +505,7 @@ class PaymentExpenseReport extends CommonObject if (! empty($conf->banque->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); $acc->fetch($accountid); diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index 2bf890e540c..f0d61d0f80d 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -73,7 +73,7 @@ $modulepart='trip'; * Actions */ -require_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; +include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; /* diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 64bffc43e3b..d3e5bc6fabd 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -26,7 +26,7 @@ * \brief list of expense reports */ -require "../main.inc.php"; +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; @@ -143,7 +143,7 @@ $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -require DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; if (empty($reshook)) { @@ -179,7 +179,7 @@ if (empty($reshook)) if ($action == 'update' && ! $cancel) { - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; if ($canedituser) // Case we can edit all field { @@ -313,7 +313,7 @@ if (empty($user->rights->expensereport->readall) && empty($user->rights->expense $sql.= " AND d.fk_user_author IN (".join(',',$childids).")\n"; } // Add where from extra fields -require DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook diff --git a/htdocs/expensereport/note.php b/htdocs/expensereport/note.php index 9bf360c9ac7..baa0c174fc1 100644 --- a/htdocs/expensereport/note.php +++ b/htdocs/expensereport/note.php @@ -56,7 +56,7 @@ $permissionnote=$user->rights->expensereport->creer; // Used by the include of a * Actions */ -require DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be require, not require_once +include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once /* diff --git a/htdocs/externalsite/frametop.php b/htdocs/externalsite/frametop.php index 5abc4e840a3..ee746d745cc 100644 --- a/htdocs/externalsite/frametop.php +++ b/htdocs/externalsite/frametop.php @@ -22,7 +22,7 @@ * \brief Top frame to show external web application */ -require ("../main.inc.php"); +require "../main.inc.php"; // Load translation files required by the page $langs->load("externalsite"); diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 96d7e106b5a..8b258ebbf6e 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -29,12 +29,7 @@ * \brief Page to show predefined fichinter */ -$res=0; -if (! $res && file_exists("../../main.inc.php")) - $res=@include("../../main.inc.php"); // For root directory -if (! $res && file_exists("../../../main.inc.php")) - $res=@include("../../../main.inc.php"); // For "custom" directory - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinterrec.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index a72e225b535..910115d8822 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -24,9 +24,9 @@ */ // Put here all includes required by your class file -require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); -//require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); -//require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); +require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; +//require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; +//require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; /** diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index afc7c1f0f7a..de8489ebb55 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -83,7 +83,7 @@ $mesg=''; // Submit file if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC)) { - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $result=$ecmdir->fetch($_REQUEST["section"]); if (! $result > 0) @@ -378,7 +378,7 @@ jQuery(document).ready(function() { $(".checkboxfordelete").prop('checked', false); jQuery("#delconst").hide(); }); - + }); @@ -408,7 +408,7 @@ else if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); - + } // Confirmation de la suppression d'une ligne categorie @@ -486,7 +486,7 @@ else $newsection=$section; $newsectioniso=utf8_decode($section); //$newsection='/home'; - + // List content of directory ($newsection = '/', '/home', ...) if (! empty($conf->global->FTP_CONNECT_WITH_SFTP)) { @@ -551,7 +551,7 @@ else $is_directory=ftp_isdir($conn_id, $newremotefileiso); } - + print ''; // Name print ''; @@ -615,14 +615,14 @@ else print ""; - + if (! $ok) { print $mesg.'
'."\n"; setEventMessages($mesg, null, 'errors'); } - - + + // Actions /* if ($user->rights->ftp->write && ! empty($section)) @@ -654,7 +654,7 @@ else break; } $i++; - } + } if (! $foundsetup) { print $langs->trans("SetupOfFTPClientModuleNotComplete"); @@ -669,11 +669,11 @@ else print '
'; // Close FTP connection -if ($conn_id) +if ($conn_id) { if (! empty($conf->global->FTP_CONNECT_WITH_SFTP)) { - + } else if (! empty($conf->global->FTP_CONNECT_WITH_SSL)) { @@ -684,7 +684,7 @@ if ($conn_id) ftp_close($conn_id); } } - + llxFooter(); @@ -709,7 +709,7 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect $ok=1; $conn_id=null; - + if (! is_numeric($ftp_port)) { $mesg=$langs->transnoentitiesnoconv("FailedToConnectToFTPServer",$ftp_server,$ftp_port); @@ -719,17 +719,17 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect if ($ok) { $connecttimeout=(empty($conf->global->FTP_CONNECT_TIMEOUT)?40:$conf->global->FTP_CONNECT_TIMEOUT); - if (! empty($conf->global->FTP_CONNECT_WITH_SFTP)) + if (! empty($conf->global->FTP_CONNECT_WITH_SFTP)) { dol_syslog('Try to connect with ssh2_ftp'); $tmp_conn_id = ssh2_connect($ftp_server, $ftp_port); } - else if (! empty($conf->global->FTP_CONNECT_WITH_SSL)) + else if (! empty($conf->global->FTP_CONNECT_WITH_SSL)) { dol_syslog('Try to connect with ftp_ssl_connect'); $conn_id = ftp_ssl_connect($ftp_server, $ftp_port, $connecttimeout); } - else + else { dol_syslog('Try to connect with ftp_connect'); $conn_id = ftp_connect($ftp_server, $ftp_port, $connecttimeout); @@ -744,7 +744,7 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect { // Turn on passive mode transfers (must be after a successful login //if ($ftp_passive) ftp_pasv($conn_id, true); - + // Change the dir $newsectioniso=utf8_decode($section); //ftp_chdir($conn_id, $newsectioniso); @@ -756,25 +756,25 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect $error++; } } - else + else { $mesg=$langs->transnoentitiesnoconv("FailedToConnectToFTPServerWithCredentials"); $ok=0; $error++; } - } + } else { if (ftp_login($conn_id, $ftp_user, $ftp_password)) { // Turn on passive mode transfers (must be after a successful login if ($ftp_passive) ftp_pasv($conn_id, true); - + // Change the dir $newsectioniso=utf8_decode($section); ftp_chdir($conn_id, $newsectioniso); } - else + else { $mesg=$langs->transnoentitiesnoconv("FailedToConnectToFTPServerWithCredentials"); $ok=0; diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 494c572eaad..1b6046d50f8 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -26,7 +26,7 @@ * \brief Form and file creation of paid holiday. */ -require('../main.inc.php'); +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 55724549360..380f609ec6d 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -26,7 +26,7 @@ * \brief File that defines the balance of paid holiday of users. */ -require('../main.inc.php'); +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php'; diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 5df3fdb314b..86ca95580b1 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -23,7 +23,7 @@ * \brief List of holiday */ -require('../main.inc.php'); +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index 1e72122c2be..0faa2b56585 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -22,7 +22,7 @@ * \brief Monthly report of leave requests. */ -require('../main.inc.php'); +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 198b9a8854c..c36ccd1f4d7 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -23,7 +23,7 @@ * \ingroup holiday */ -require('../main.inc.php'); +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 996ddd58ed3..f52cb1afc61 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -20,7 +20,7 @@ * \ingroup HRM * \brief HRM Establishment module setup page */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php'; require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php'; diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php index a7a8b8a9352..ac47eec6292 100644 --- a/htdocs/hrm/admin/admin_hrm.php +++ b/htdocs/hrm/admin/admin_hrm.php @@ -20,7 +20,7 @@ * \ingroup HRM * \brief HRM module setup page */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index db316098003..c95e886e792 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -19,7 +19,7 @@ * \file htdocs/hrm/establishment/card.php * \brief Page to show an establishment */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php'; require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index 76eb236d1a1..6cd44861ad5 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -20,7 +20,7 @@ * \brief Page to show info of an establishment */ -require('../../main.inc.php'); +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php'; diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 365d40cca96..b49dfd92998 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -24,7 +24,7 @@ * \brief Home page for HRM area. */ -require('../main.inc.php'); +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index 240637282db..f7ae2608da5 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -181,7 +181,7 @@ class MailmanSpip if ($mydb) { - include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $mdpass=dol_hash($object->pass); $htpass=crypt($object->pass,makesalt()); $query = "INSERT INTO spip_auteurs (nom, email, login, pass, htpass, alea_futur, statut) VALUES(\"".dolGetFirstLastname($object->firstname,$object->lastname)."\",\"".$object->email."\",\"".$object->login."\",\"$mdpass\",\"$htpass\",FLOOR(32000*RAND()),\"1comite\")"; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 826f83356c4..797298c4653 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1732,7 +1732,7 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra // Define $bookmarks if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) { - include_once (DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php'); + include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php'; $langs->load("bookmarks"); $bookmarks=printBookmarksList($db, $langs); diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index eaa53aa8490..ced69451d9d 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -26,8 +26,8 @@ include '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); -require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"; $langs->load("admin"); $langs->load("bills"); diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 5350fd170f1..2eb20f48fea 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1640,7 +1640,7 @@ elseif (! empty($module)) } else { - $result = @include_once($dirread.'/'.$pathtoclass); + $result = @include_once $dirread.'/'.$pathtoclass; } if (class_exists($tabobj)) { diff --git a/htdocs/modulebuilder/template/admin/about.php b/htdocs/modulebuilder/template/admin/about.php index b72917daff0..e580c6c7457 100644 --- a/htdocs/modulebuilder/template/admin/about.php +++ b/htdocs/modulebuilder/template/admin/about.php @@ -25,15 +25,15 @@ // 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"); +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"); +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 && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; if (! $res) die("Include of main fails"); // Libraries diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index fd2c509233b..2cc6468729c 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -25,15 +25,15 @@ // 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"); +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"); +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 && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; if (! $res) die("Include of main fails"); global $langs, $user; diff --git a/htdocs/modulebuilder/template/css/mymodule.css.php b/htdocs/modulebuilder/template/css/mymodule.css.php index 5787fa4f64c..486d860e7f5 100644 --- a/htdocs/modulebuilder/template/css/mymodule.css.php +++ b/htdocs/modulebuilder/template/css/mymodule.css.php @@ -35,15 +35,15 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // 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"); +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(substr($tmp, 0, ($i+1))."/../main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/../main.inc.php"); +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(substr($tmp, 0, ($i+1))."/../main.inc.php")) $res=@include 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 && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; if (! $res) die("Include of main fails"); require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/modulebuilder/template/js/mymodule.js.php b/htdocs/modulebuilder/template/js/mymodule.js.php index 07f44756615..6a3447625a5 100644 --- a/htdocs/modulebuilder/template/js/mymodule.js.php +++ b/htdocs/modulebuilder/template/js/mymodule.js.php @@ -38,15 +38,15 @@ if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // 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"); +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(substr($tmp, 0, ($i+1))."/../main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/../main.inc.php"); +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(substr($tmp, 0, ($i+1))."/../main.inc.php")) $res=@include 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 && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; if (! $res) die("Include of main fails"); // Define js type diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 2a72464fb9d..f005fbf8354 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -29,7 +29,7 @@ if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER // 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(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"; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 6516f7eeff9..4fe54aa63a4 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -563,7 +563,7 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb $hidegeneratedfilelistifempty=1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0; - require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $formfile = new FormFile($db); // Show list of available documents diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index 2574e4239fa..d240f07ef53 100644 --- a/htdocs/modulebuilder/template/myobject_note.php +++ b/htdocs/modulebuilder/template/myobject_note.php @@ -29,7 +29,7 @@ if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER // 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(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"; diff --git a/htdocs/modulebuilder/template/scripts/myobject.php b/htdocs/modulebuilder/template/scripts/myobject.php index 0aad12e2e35..67bcdea1d74 100755 --- a/htdocs/modulebuilder/template/scripts/myobject.php +++ b/htdocs/modulebuilder/template/scripts/myobject.php @@ -47,12 +47,12 @@ $res=0; // Try master.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))."/master.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/master.inc.php"); -if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/master.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/master.inc.php"); +if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/master.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/master.inc.php"; +if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/master.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/master.inc.php"; // Try master.inc.php using relative path -if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php"); -if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php"); -if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php"); +if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php"; +if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php"; +if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php"; if (! $res) die("Include of master fails"); // After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file). // $user is created but empty. diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index fda06d67012..af75bf4783b 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -22,12 +22,12 @@ * \brief Page to edit survey */ -require_once('../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"; +require_once DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"; +require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"; // Security check diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index a2b6096d77c..d80bac70b79 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -24,9 +24,9 @@ */ // Put here all includes required by your class file -require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); -//require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); -//require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); +require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; +//require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; +//require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; /** diff --git a/htdocs/opensurvey/exportcsv.php b/htdocs/opensurvey/exportcsv.php index 90fd56cd4d1..b36a5256059 100644 --- a/htdocs/opensurvey/exportcsv.php +++ b/htdocs/opensurvey/exportcsv.php @@ -23,10 +23,10 @@ */ -require_once('../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"); +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; +require_once DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"; $action=GETPOST('action','aZ09'); $numsondage = ''; diff --git a/htdocs/opensurvey/index.php b/htdocs/opensurvey/index.php index 663d4ad704a..3b800b748ff 100644 --- a/htdocs/opensurvey/index.php +++ b/htdocs/opensurvey/index.php @@ -21,9 +21,9 @@ * \brief Home page of opensurvey area */ -require_once('../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; // Security check if (!$user->rights->opensurvey->read) accessforbidden(); diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 0471abcddb9..de8feaad8da 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -22,10 +22,10 @@ * \brief Page to list surveys */ -require_once('../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"); +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; +require_once DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"; // Security check if (!$user->rights->opensurvey->read) accessforbidden(); diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index cd6e6ed3225..9672e310938 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -22,12 +22,11 @@ * \brief Page to preview votes of a survey */ -$res=0; -require_once('../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; +require_once DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"; +require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"; // Security check diff --git a/htdocs/opensurvey/wizard/choix_autre.php b/htdocs/opensurvey/wizard/choix_autre.php index a415d6b4987..9acf9d441e2 100644 --- a/htdocs/opensurvey/wizard/choix_autre.php +++ b/htdocs/opensurvey/wizard/choix_autre.php @@ -22,10 +22,10 @@ * \brief Page to create a new survey (choice selection) */ -require_once('../../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; +require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"; // Security check if (!$user->rights->opensurvey->write) accessforbidden(); diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index 7dd0168c77a..fb7312b891c 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -22,10 +22,10 @@ * \brief Page to create a new survey (date selection) */ -require_once('../../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; +require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"; // Security check if (!$user->rights->opensurvey->write) accessforbidden(); diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php index 0dfc2505ce3..2e33d377ca2 100644 --- a/htdocs/opensurvey/wizard/create_survey.php +++ b/htdocs/opensurvey/wizard/create_survey.php @@ -23,11 +23,11 @@ * \brief Page to create a new survey */ -require_once('../../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"; +require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"; // Security check if (!$user->rights->opensurvey->write) accessforbidden(); diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 48afbcc9dbb..b52514a4195 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -22,7 +22,7 @@ * \brief Manage record and specific data for batch number management */ -require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); +require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; /** diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 87fdd132878..92c6ffadca4 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -22,7 +22,7 @@ * \brief This file is an CRUD class file (Create/Read/Update/Delete) */ -require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); +require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 74422cc2601..a5592c87f5d 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -525,7 +525,7 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb $hidegeneratedfilelistifempty=1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0; - require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $formfile = new FormFile($db); // Show list of available documents diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 92719093650..53818220081 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -23,7 +23,7 @@ * \brief Page activite perso du module projet */ -require ("../../main.inc.php"); +require "../../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 2b8996373e4..0943d8dd428 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -24,7 +24,7 @@ * \brief List activities of tasks (per day entry) */ -require ("../../main.inc.php"); +require "../../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index cf68f6ccc95..b22ed6ee71a 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -24,7 +24,7 @@ * \brief List activities of tasks (per week entry) */ -require ("../../main.inc.php"); +require "../../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 45a417a6dd2..da418680376 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -23,7 +23,7 @@ * \brief Gantt diagramm of a project */ -require ("../main.inc.php"); +require "../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 5af0d6da9e5..bf2ddf33890 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -23,7 +23,7 @@ * \brief List all tasks of a project */ -require ("../main.inc.php"); +require "../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index ac527424721..6c4b7f56d3f 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -23,7 +23,7 @@ * \brief Page of a project task */ -require ("../../main.inc.php"); +require "../../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 4d78aad4764..6ed9af89385 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -23,7 +23,7 @@ * \brief Actors of a task */ -require ("../../main.inc.php"); +require "../../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 14703f6d3eb..7a97de16f52 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -24,7 +24,7 @@ * \brief List all task of a project */ -require ("../../main.inc.php"); +require "../../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 9e6018ab5c5..2fd47827d6a 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -21,7 +21,7 @@ * \brief Page to show information on a task */ -require ("../../main.inc.php"); +require "../../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 4809cfe1276..ace9ab21a29 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -23,7 +23,7 @@ * \brief Page of a project task */ -require ("../../main.inc.php"); +require "../../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index b11bf4cc42f..3bee8fd6434 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -36,11 +36,7 @@ if (is_numeric($entity)) define("DOLENTITY", $entity); // librarie core // Dolibarr environment -$res = @include("../../main.inc.php"); // From htdocs directory -if (! $res) { - $res = @include("../../../main.inc.php"); // From "custom" directory -} -if (! $res) die("Include of master.inc.php fails"); +require '../../main.inc.php'; // librarie jobs dol_include_once("/cron/class/cronjob.class.php"); @@ -51,10 +47,6 @@ global $langs, $conf; $langs->load("admin"); $langs->load("cron"); - - - - /* * View */ diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index 32cb5f2e1ba..a9bd8a0fb70 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -24,11 +24,11 @@ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. -require_once('../../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; +require_once DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"; +require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"; // Init vars diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 748f1439687..42a732fcb21 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -21,9 +21,7 @@ define("NOCSRFCHECK",1); // We accept to go on this page from external web site. $entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); if (is_numeric($entity)) define("DOLENTITY", $entity); -$res=0; -if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php"); // to work if your module directory is into a subdir of root htdocs directory -if (! $res) die("Include of main fails"); +require '../../main.inc.php'; if (empty($conf->stripe->enabled)) accessforbidden('',0,0,1); require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; @@ -110,7 +108,7 @@ if (! empty($conf->multicompany->enabled) && ! empty($conf->stripeconnect->enabl $key=1; } $ret=$mc->switchEntity($key); - 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"); } diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 832f70f4ea1..e4a21ae9888 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -22,12 +22,7 @@ */ -// Change this following line to use the correct relative path (../, ../../, etc) -$res=0; -$res=@include("../main.inc.php"); // For root directory -if (! $res) $res=@include("../../main.inc.php"); // For "custom" directory -if (! $res) die("Include of main fails"); - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php'; diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 7c3999db7c9..515f08f6053 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -491,7 +491,7 @@ class Dolresource extends CommonObject $sql.= " t.fk_code_type_resource,"; $sql.= " t.tms,"; - require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields=new ExtraFields($this->db); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); if (is_array($extralabels) && count($extralabels)>0) { diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 19bed957f74..ed667fad8ab 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -21,8 +21,8 @@ * \ingroup core * \brief Class file to manage forms into resource module */ -require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); -require_once(DOL_DOCUMENT_ROOT ."/resource/class/dolresource.class.php"); +require_once DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"; +require_once DOL_DOCUMENT_ROOT ."/resource/class/dolresource.class.php"; /** diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 389d0236759..b844fce0f6c 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -23,11 +23,7 @@ */ -$res=0; -$res=@include("../main.inc.php"); // For root directory -if (! $res) $res=@include("../../main.inc.php"); // For "custom" directory -if (! $res) die("Include of main fails"); - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php index f1e56d4a359..e15c0864574 100644 --- a/htdocs/societe/checkvat/checkVatPopup.php +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -21,7 +21,7 @@ * \brief Popup screen to validate VAT */ -require ("../../main.inc.php"); +require "../../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once NUSOAP_PATH.'/nusoap.php'; diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 551f168ded3..947c35a2d5c 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -25,7 +25,7 @@ * \brief Add a tab on thirpdarty view to list all products/services bought or sells by thirdparty */ -require("../main.inc.php"); +require "../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 3563283ba05..d00b3144185 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -535,7 +535,7 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb $hidegeneratedfilelistifempty=1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0; - require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $formfile = new FormFile($db); // Show list of available documents diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index 1113d1428f5..8ad547a47ee 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -30,8 +30,7 @@ */ // Load Dolibarr environment -$res=@include("../main.inc.php"); // For root directory -if (! $res) $res=@include("../../main.inc.php"); +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 3dc0ab39756..bf561c15f83 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -25,8 +25,8 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT . "/core/class/commonobject.class.php"; require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; -//require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); -//require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); +//require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; +//require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; /** diff --git a/htdocs/ticket/class/ticketlogs.class.php b/htdocs/ticket/class/ticketlogs.class.php index ffa6a193415..b4a464f6a17 100644 --- a/htdocs/ticket/class/ticketlogs.class.php +++ b/htdocs/ticket/class/ticketlogs.class.php @@ -23,8 +23,8 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT . "/core/class/commonobject.class.php"; -//require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); -//require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); +//require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; +//require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; /** diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index c99ac7e7e3a..b23b4c5d27e 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -701,7 +701,7 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb $hidegeneratedfilelistifempty=1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0; - require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $formfile = new FormFile($db); // Show list of available documents diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 882e9111b5d..9c2f3437fa4 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -27,7 +27,7 @@ */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -if (! empty($conf->ldap->enabled)) require_once (DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); +if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"; /** diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index e140550207d..8cbe54e0b29 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -22,7 +22,7 @@ * \brief File that is entry point to call Dolibarr WebServices */ -if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1'); +if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1'); require '../master.inc.php'; require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP @@ -659,7 +659,7 @@ function createOrder($authentication,$order) { global $db,$conf,$langs; - require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $now=dol_now(); diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 37df126c753..f6c98599d93 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -570,7 +570,7 @@ function createProductOrService($authentication,$product) // Update stock if stock count is provided and differs from database after creation or update if (isset($product['stock_real']) && $product['stock_real'] != '' && ! empty($conf->global->stock->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; + include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; $savstockreal=$newobject->stock_reel; $newobject->load_stock('novirtual,nobatch'); // This overwrite ->stock_reel, surely 0 because we have just created product @@ -739,7 +739,7 @@ function updateProductOrService($authentication,$product) // Update stock if stock count is provided and differs from database after creation or update if (isset($product['stock_real']) && $product['stock_real'] != '' && ! empty($conf->global->stock->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; + include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; $savstockreal=$newobject->stock_reel; $newobject->load_stock('novirtual,nobatch'); // This overwrite ->stock_reel diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 9a1ad910672..0bc4428deb2 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -22,24 +22,11 @@ */ // 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"); - -include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); -include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); -include_once(DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'); -include_once(DOL_DOCUMENT_ROOT.'/website/lib/websiteaccount.lib.php'); +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'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/website/lib/websiteaccount.lib.php'; // Load translation files required by the page $langs->loadLangs(array("website","other")); diff --git a/scripts/accountancy/export-thirdpartyaccount.php b/scripts/accountancy/export-thirdpartyaccount.php index 2d557768d7d..53136bf67b2 100755 --- a/scripts/accountancy/export-thirdpartyaccount.php +++ b/scripts/accountancy/export-thirdpartyaccount.php @@ -24,7 +24,7 @@ * \brief Page to detect empty accounting account */ -require_once($path."../../htdocs/master.inc.php"); +require_once $path."../../htdocs/master.inc.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/scripts/bank/export-bank-receipts.php b/scripts/bank/export-bank-receipts.php index 398ec1d7a19..1124749fcf4 100755 --- a/scripts/bank/export-bank-receipts.php +++ b/scripts/bank/export-bank-receipts.php @@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit(-1); } -require_once($path."../../htdocs/master.inc.php"); +require_once $path."../../htdocs/master.inc.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; diff --git a/scripts/company/export-contacts-xls-example.php b/scripts/company/export-contacts-xls-example.php index 5fd7806a26c..c4887cb5ee1 100755 --- a/scripts/company/export-contacts-xls-example.php +++ b/scripts/company/export-contacts-xls-example.php @@ -41,13 +41,13 @@ if (! isset($argv[1]) || ! $argv[1]) { $now=$argv[1]; -require_once($path."../../htdocs/master.inc.php"); -//require_once(PHP_WRITEEXCEL_PATH."/class.writeexcel_workbook.inc.php"); -//require_once(PHP_WRITEEXCEL_PATH."/class.writeexcel_worksheet.inc.php"); +require_once $path."../../htdocs/master.inc.php"; +//require_once PHP_WRITEEXCEL_PATH."/class.writeexcel_workbook.inc.php"; +//require_once PHP_WRITEEXCEL_PATH."/class.writeexcel_worksheet.inc.php"; -require_once(PHPEXCEL_PATH."/PHPExcel.php"); -//require_once(PHPEXCEL_PATH."/PHPExcel/Writer/Excel2007.php"); -require_once(PHPEXCEL_PATH."/PHPExcel/Writer/Excel5.php"); +require_once PHPEXCEL_PATH."/PHPExcel.php"; +//require_once PHPEXCEL_PATH."/PHPExcel/Writer/Excel2007.php"; +require_once PHPEXCEL_PATH."/PHPExcel/Writer/Excel5.php"; // Global variables $version=DOL_VERSION; diff --git a/scripts/company/sync_contacts_dolibarr2ldap.php b/scripts/company/sync_contacts_dolibarr2ldap.php index 900cdbc35ed..32260291aa7 100755 --- a/scripts/company/sync_contacts_dolibarr2ldap.php +++ b/scripts/company/sync_contacts_dolibarr2ldap.php @@ -35,10 +35,10 @@ if (substr($sapi_type, 0, 3) == 'cgi') { } -require_once($path."../../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); -require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"; +require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"; // Global variables $version=DOL_VERSION; diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index 0f5c91817db..4edf4fb261d 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -50,8 +50,8 @@ $mode=$argv[1]; $targettype=$argv[2]; -require($path."../../htdocs/master.inc.php"); -require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"); +require $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"; $langs->load('main'); $langs->load('contracts'); diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index ad7ccebcba7..7b15d52dff2 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -48,8 +48,8 @@ if (! isset($argv[1]) || ! $argv[1] || ! in_array($argv[1],array('test','confirm $mode=$argv[1]; -require($path."../../htdocs/master.inc.php"); -require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"); +require $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"; $langs->load('main'); $langs->load('contracts'); diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index c690d7b63ef..88960766a68 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -41,9 +41,9 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit(-1); } -require_once ($path."../../htdocs/master.inc.php"); -require_once (DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php"); -require_once (DOL_DOCUMENT_ROOT.'/user/class/user.class.php'); +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php"; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; // Check parameters if (! isset($argv[1]) || ! $argv[1]) { diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index ef9a35fc1ed..95b06f187e8 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -44,9 +44,9 @@ $id=$argv[1]; if (isset($argv[2]) || !empty($argv[2])) $login = $argv[2]; else $login = ''; -require_once ($path."../../htdocs/master.inc.php"); -require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"); -require_once (DOL_DOCUMENT_ROOT."/comm/mailing/class/mailing.class.php"); +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"; +require_once DOL_DOCUMENT_ROOT."/comm/mailing/class/mailing.class.php"; // Global variables diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php index 02e9db2e0ce..428f8932ea3 100755 --- a/scripts/invoices/email_unpaid_invoices_to_customers.php +++ b/scripts/invoices/email_unpaid_invoices_to_customers.php @@ -50,8 +50,8 @@ $mode=$argv[1]; $targettype=$argv[2]; -require($path."../../htdocs/master.inc.php"); -require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"); +require $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"; $langs->load('main'); diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index e134d693d74..dd92a752dc3 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -48,8 +48,8 @@ if (! isset($argv[1]) || ! $argv[1] || ! in_array($argv[1],array('test','confirm $mode=$argv[1]; -require($path."../../htdocs/master.inc.php"); -require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"); +require $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"; $langs->load('main'); diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php index 30782d3b913..2c71d9cf750 100755 --- a/scripts/invoices/rebuild_merge_pdf.php +++ b/scripts/invoices/rebuild_merge_pdf.php @@ -34,12 +34,12 @@ if (substr($sapi_type, 0, 3) == 'cgi') { } // Include Dolibarr environment -require_once($path."../../htdocs/master.inc.php"); +require_once $path."../../htdocs/master.inc.php"; // After this $db is an opened handler to database. We close it at end of file. -require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); -require_once(DOL_DOCUMENT_ROOT."/core/modules/facture/modules_facture.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); -require_once(DOL_DOCUMENT_ROOT.'/core/lib/invoice2.lib.php'); +require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/modules/facture/modules_facture.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"; +require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice2.lib.php'; // Load main language strings diff --git a/scripts/members/sync_members_dolibarr2ldap.php b/scripts/members/sync_members_dolibarr2ldap.php index a0c393d01c2..e3ca5f38e0a 100755 --- a/scripts/members/sync_members_dolibarr2ldap.php +++ b/scripts/members/sync_members_dolibarr2ldap.php @@ -34,9 +34,9 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit(-1); } -require_once($path."../../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"); +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"; +require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"; $langs->load("main"); diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index e7adb80e733..8cf0005800f 100755 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -34,11 +34,11 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit(-1); } -require_once($path."../../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/subscription.class.php"); +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"; +require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"; +require_once DOL_DOCUMENT_ROOT."/adherents/class/subscription.class.php"; $langs->load("main"); $langs->load("errors"); diff --git a/scripts/members/sync_members_types_dolibarr2ldap.php b/scripts/members/sync_members_types_dolibarr2ldap.php index 939a98c8728..dac7ccfd0bc 100755 --- a/scripts/members/sync_members_types_dolibarr2ldap.php +++ b/scripts/members/sync_members_types_dolibarr2ldap.php @@ -41,9 +41,9 @@ if (! isset($argv[1]) || ! $argv[1]) { } $now=$argv[1]; -require_once($path."../../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php"); +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"; +require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php"; // Global variables $version=DOL_VERSION; diff --git a/scripts/members/sync_members_types_ldap2dolibarr.php b/scripts/members/sync_members_types_ldap2dolibarr.php index 55d5606cd30..1363f989e15 100755 --- a/scripts/members/sync_members_types_ldap2dolibarr.php +++ b/scripts/members/sync_members_types_ldap2dolibarr.php @@ -36,10 +36,10 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit(-1); } -require_once($path."../../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php"); +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"; +require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php"; $langs->load("main"); $langs->load("errors"); diff --git a/scripts/modulebuilder/builddoc.php b/scripts/modulebuilder/builddoc.php index f2c0eef421f..c0b44a0bed8 100755 --- a/scripts/modulebuilder/builddoc.php +++ b/scripts/modulebuilder/builddoc.php @@ -45,7 +45,7 @@ if (! isset($argv[1]) || ! $argv[1]) { } $modulename=$argv[1]; -require_once ($path."../../htdocs/master.inc.php"); +require_once $path."../../htdocs/master.inc.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; diff --git a/scripts/modulebuilder/initmodule.php b/scripts/modulebuilder/initmodule.php index 6c9801878d3..bee931dc8fa 100755 --- a/scripts/modulebuilder/initmodule.php +++ b/scripts/modulebuilder/initmodule.php @@ -41,7 +41,7 @@ if (! isset($argv[1]) || ! $argv[1]) { } $modulename=$argv[1]; -require_once ($path."../../htdocs/master.inc.php"); +require_once $path."../../htdocs/master.inc.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; diff --git a/scripts/product/migrate_picture_path.php b/scripts/product/migrate_picture_path.php index d72c60f05e5..69322b2f350 100755 --- a/scripts/product/migrate_picture_path.php +++ b/scripts/product/migrate_picture_path.php @@ -37,9 +37,9 @@ if (substr($sapi_type, 0, 3) == 'cgi') { define('EVEN_IF_ONLY_LOGIN_ALLOWED',1); // Set this define to 0 if you want to lock your script when dolibarr setup is "locked to admin user only". // Include and load Dolibarr environment variables -require_once($path."../../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; // After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file). // $user is created but empty. diff --git a/scripts/product/regenerate_thumbs.php b/scripts/product/regenerate_thumbs.php index bc3e1f53a6b..a4d114746c2 100755 --- a/scripts/product/regenerate_thumbs.php +++ b/scripts/product/regenerate_thumbs.php @@ -37,10 +37,10 @@ if (substr($sapi_type, 0, 3) == 'cgi') { define('EVEN_IF_ONLY_LOGIN_ALLOWED',1); // Set this define to 0 if you want to lock your script when dolibarr setup is "locked to admin user only". // Include and load Dolibarr environment variables -require_once($path."../../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/images.lib.php"); +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/images.lib.php"; // After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file). // $user is created but empty. diff --git a/scripts/user/sync_groups_dolibarr2ldap.php b/scripts/user/sync_groups_dolibarr2ldap.php index e661a85beb5..ba304305696 100755 --- a/scripts/user/sync_groups_dolibarr2ldap.php +++ b/scripts/user/sync_groups_dolibarr2ldap.php @@ -40,9 +40,9 @@ if (! isset($argv[1]) || ! $argv[1]) { } $now=$argv[1]; -require_once($path."../../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); -require_once(DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php"); +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"; +require_once DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php"; // Global variables $version=DOL_VERSION; diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index cb745d9aff3..c78770c7a5c 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -35,11 +35,11 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit(-1); } -require_once($path."../../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); -require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php"); -require_once(DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php"); +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"; +require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php"; +require_once DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php"; $langs->load("main"); $langs->load("errors"); diff --git a/scripts/user/sync_users_dolibarr2ldap.php b/scripts/user/sync_users_dolibarr2ldap.php index dd5e3d18de4..fa97c871a50 100755 --- a/scripts/user/sync_users_dolibarr2ldap.php +++ b/scripts/user/sync_users_dolibarr2ldap.php @@ -40,9 +40,9 @@ if (! isset($argv[1]) || ! $argv[1]) { } $now=$argv[1]; -require_once($path."../../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); -require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php"); +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"; +require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php"; // Global variables $version=DOL_VERSION; diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php index 9a04f81c557..8c95bc0071f 100755 --- a/scripts/user/sync_users_ldap2dolibarr.php +++ b/scripts/user/sync_users_ldap2dolibarr.php @@ -34,10 +34,10 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit(-1); } -require_once($path."../../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); -require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php"); +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"; +require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php"; $langs->load("main"); $langs->load("errors"); diff --git a/scripts/withdrawals/build_withdrawal_file.php b/scripts/withdrawals/build_withdrawal_file.php index d381c32676a..2f7ad26a1fe 100755 --- a/scripts/withdrawals/build_withdrawal_file.php +++ b/scripts/withdrawals/build_withdrawal_file.php @@ -34,11 +34,11 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit(-1); } -require_once($path."../../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/class/bonprelevement.class.php"); -require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); -require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); -require_once(DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php"); +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/compta/prelevement/class/bonprelevement.class.php"; +require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"; +require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; +require_once DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php"; // Global variables $version=DOL_VERSION; diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php index f8816f8b570..589a9116c78 100755 --- a/test/phpunit/ModulesTest.php +++ b/test/phpunit/ModulesTest.php @@ -136,7 +136,7 @@ class ModulesTest extends PHPUnit_Framework_TestCase 'Salaries','Service','Skype','Societe','Stock','Stripe','SupplierProposal','Syslog','Tax','Ticket','User','Variants','WebServices','WebServicesClient','Website','Workflow'); foreach($modulelist as $modlabel) { - require_once(DOL_DOCUMENT_ROOT.'/core/modules/mod'.$modlabel.'.class.php'); + require_once DOL_DOCUMENT_ROOT.'/core/modules/mod'.$modlabel.'.class.php'; $class='mod'.$modlabel; $mod=new $class($db); $result=$mod->remove(); diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index fe896894d86..6f7ca3610cd 100644 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -28,7 +28,7 @@ global $conf,$user,$langs,$db; //require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; -require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP +require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP if (empty($user->id)) diff --git a/test/phpunit/WebservicesOrdersTest.php b/test/phpunit/WebservicesOrdersTest.php index e81ee2d3604..7fb2d101184 100644 --- a/test/phpunit/WebservicesOrdersTest.php +++ b/test/phpunit/WebservicesOrdersTest.php @@ -28,7 +28,7 @@ global $conf,$user,$langs,$db; //require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; -require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP +require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP if (empty($user->id)) { diff --git a/test/phpunit/WebservicesOtherTest.php b/test/phpunit/WebservicesOtherTest.php index e3725c8609c..45b01aa77d3 100644 --- a/test/phpunit/WebservicesOtherTest.php +++ b/test/phpunit/WebservicesOtherTest.php @@ -28,7 +28,7 @@ global $conf,$user,$langs,$db; //require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; -require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP +require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP if (empty($user->id)) { diff --git a/test/phpunit/WebservicesProductsTest.php b/test/phpunit/WebservicesProductsTest.php index e3500a68f5b..bcbb37b0419 100644 --- a/test/phpunit/WebservicesProductsTest.php +++ b/test/phpunit/WebservicesProductsTest.php @@ -30,7 +30,7 @@ global $conf,$user,$langs,$db; //require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; -require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP +require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP if (empty($user->id)) { diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index 90698407527..e1c2249b62a 100644 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -28,7 +28,7 @@ global $conf,$user,$langs,$db; //require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; -require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP +require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP if (empty($user->id)) { diff --git a/test/phpunit/WebservicesUserTest.php b/test/phpunit/WebservicesUserTest.php index 5098da22e6e..bfcdb400cc6 100644 --- a/test/phpunit/WebservicesUserTest.php +++ b/test/phpunit/WebservicesUserTest.php @@ -28,7 +28,7 @@ global $conf,$user,$langs,$db; //require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; -require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP +require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP if (empty($user->id)) { From 4eacad52f2ce32d3cb08c4b57ac7694be3b48bd5 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 27 Jul 2018 10:06:56 +0200 Subject: [PATCH 22/40] Clean and update code --- htdocs/public/ticket/list.php | 5 +++-- htdocs/public/ticket/view.php | 5 +++-- htdocs/resource/contact.php | 10 +++++----- htdocs/ticket/class/ticket.class.php | 11 +++++++---- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index d8290849f55..fe1dacbbbc7 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -121,8 +121,9 @@ if ($action == "view_ticketlist") { } } - if ($error) { - setEventMessage($object->errors, 'errors'); + if ($error || $errors) + { + setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } } diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 5383133c42e..38fcb3c4991 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -112,8 +112,9 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" | } } - if ($error) { - setEventMessage($object->errors, 'errors'); + if ($error || $errors) + { + setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } } diff --git a/htdocs/resource/contact.php b/htdocs/resource/contact.php index 981a07d7e73..e350c746c12 100644 --- a/htdocs/resource/contact.php +++ b/htdocs/resource/contact.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007-2009 Laurent Destailleur * Copyright (C) 2012 Juanjo Menent - * Copyright (C) 2016 Gilles Poirier + * Copyright (C) 2016 Gilles Poirier * * This program is free software; you can redistribute it and/or modify @@ -47,7 +47,7 @@ $result = $object->fetch($id,$ref); /* - * Ajout d'un nouveau contact + * Add a new contact */ if ($action == 'addcontact' && $user->rights->resource->write) @@ -72,17 +72,17 @@ if ($action == 'addcontact' && $user->rights->resource->write) $mesg = $object->error; } - setEventMessage($mesg, 'errors'); + setEventMessages($mesg, null, 'errors'); } } -// bascule du statut d'un contact +// Toggle the status of a contact else if ($action == 'swapstatut' && $user->rights->resource->write) { $result=$object->swapContactStatus(GETPOST('ligne','int')); } -// Efface un contact +// Erase a contact else if ($action == 'deletecontact' && $user->rights->resource->write) { $result = $object->delete_contact(GETPOST('lineid','int')); diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 3dc0ab39756..bcec0158454 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1614,9 +1614,12 @@ class Ticket extends CommonObject } include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $info_sendto['email'], $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { + if ($mailfile->error || $mailfile->errors) + { + setEventMessages($mailfile->error, $mailfile->errors, 'errors'); + } + else + { $result = $mailfile->sendfile(); if ($result > 0) { $nb_sent++; @@ -1627,7 +1630,7 @@ class Ticket extends CommonObject } } - setEventMessage($langs->trans('TicketNotificationNumberEmailSent', $nb_sent)); + setEventMessages($langs->trans('TicketNotificationNumberEmailSent', $nb_sent), null, 'mesgs'); } return $nb_sent; From 541e919ae0745453590fe0bf75b97510398d8cb2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 27 Jul 2018 14:49:33 +0200 Subject: [PATCH 23/40] Clean and update code --- htdocs/user/notify/card.php | 4 ++-- htdocs/variants/admin/admin.php | 8 ++++---- htdocs/variants/card.php | 16 ++++++++-------- htdocs/variants/combinations.php | 16 ++++++++-------- htdocs/variants/create.php | 4 ++-- htdocs/variants/create_val.php | 6 +++--- htdocs/variants/generator.php | 6 +++--- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 307b8ae5bc9..e8914298ac3 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Abbes Bahfir * @@ -67,7 +67,7 @@ if ($action == 'add') if ($actionid <= 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")), null, 'errors'); $error++; } diff --git a/htdocs/variants/admin/admin.php b/htdocs/variants/admin/admin.php index dc039bf6d5f..57db7c49f20 100644 --- a/htdocs/variants/admin/admin.php +++ b/htdocs/variants/admin/admin.php @@ -31,15 +31,15 @@ if ($_POST) { $value = GETPOST('PRODUIT_ATTRIBUTES_HIDECHILD'); if (dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_HIDECHILD', $value, 'chaine', 0, '', $conf->entity)) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } else { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } if (dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_SEPARATOR', GETPOST('PRODUIT_ATTRIBUTES_SEPARATOR'), 'chaine', 0, '', $conf->entity)) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } else { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } } diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index 547a82d0f63..3addef7ddf9 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -50,9 +50,9 @@ if ($_POST) { $object->label = $label; if ($object->update($user) < 1) { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } else { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/card.php?id='.$id, 2)); exit(); } @@ -77,9 +77,9 @@ if ($_POST) { if (! $error) { if ($objectval->update($user) > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } else { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessage($langs->trans('CoreErrorMessage'), null, 'errors'); } } } @@ -99,11 +99,11 @@ if ($confirm == 'yes') { if ($res < 1 || ($object->delete() < 1)) { $db->rollback(); - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2)); } else { $db->commit(); - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/list.php', 2)); } exit(); @@ -113,9 +113,9 @@ if ($confirm == 'yes') { if ($objectval->fetch($valueid) > 0) { if ($objectval->delete() < 1) { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } else { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2)); diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index dbc413542c4..b741fef40bb 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -104,7 +104,7 @@ if ($_POST) { $features = $_SESSION['addvariant_'.$object->id]; if (!$features) { - setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors'); + setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } else { @@ -147,7 +147,7 @@ if ($_POST) { $result = $prodcomb->createProductCombination($object, $sanit_features, array(), $price_impact_percent, $price_impact, $weight_impact); if ($result > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); unset($_SESSION['addvariant_'.$object->id]); $db->commit(); @@ -214,7 +214,7 @@ if ($_POST) { } else { $db->commit(); - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } } @@ -230,7 +230,7 @@ if ($_POST) { $prodcomb->variation_weight = $weight_impact; if ($prodcomb->update($user) > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/combinations.php?id='.$id, 2)); exit(); } else { @@ -250,13 +250,13 @@ if ($action === 'confirm_deletecombination') { if ($prodcomb->delete($user) > 0 && $prodstatic->fetch($prodcomb->fk_product_child) > 0 && $prodstatic->delete($user) > 0) { $db->commit(); - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/combinations.php?id='.$object->id, 2)); exit(); } $db->rollback(); - setEventMessage($langs->trans('ProductCombinationAlreadyUsed'), 'errors'); + setEventMessages($langs->trans('ProductCombinationAlreadyUsed'), null, 'errors'); $action = ''; } } elseif ($action === 'edit') { @@ -284,12 +284,12 @@ if ($action === 'confirm_deletecombination') { header('Location: '.dol_buildpath('/variants/combinations.php?id='.$prodstatic->id, 2)); exit(); } else { - setEventMessage($langs->trans('ErrorCopyProductCombinations'), 'errors'); + setEventMessages($langs->trans('ErrorCopyProductCombinations'), null, 'errors'); } } } else { - setEventMessage($langs->trans('ErrorDestinationProductNotFound'), 'errors'); + setEventMessages($langs->trans('ErrorDestinationProductNotFound'), null, 'errors'); } } diff --git a/htdocs/variants/create.php b/htdocs/variants/create.php index f1a34a835b6..c4d775f3d50 100644 --- a/htdocs/variants/create.php +++ b/htdocs/variants/create.php @@ -29,7 +29,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); if ($_POST) { if (empty($ref) || empty($label)) { - setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors'); + setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } else { $prodattr = new ProductAttribute($db); @@ -38,7 +38,7 @@ if ($_POST) { $resid = $prodattr->create($user); if ($resid > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); if ($backtopage) { header('Location: '.$backtopage); diff --git a/htdocs/variants/create_val.php b/htdocs/variants/create_val.php index b290182a042..f0dd8e9cb74 100644 --- a/htdocs/variants/create_val.php +++ b/htdocs/variants/create_val.php @@ -58,7 +58,7 @@ if ($cancel) if ($action == 'add') { if (empty($ref) || empty($value)) { - setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors'); + setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } else { $objectval->fk_product_attribute = $object->id; @@ -66,11 +66,11 @@ if ($action == 'add') $objectval->value = $value; if ($objectval->create($user) > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.DOL_URL_ROOT.'/variants/card.php?id='.$object->id); exit(); } else { - setEventMessage($langs->trans('ErrorCreatingProductAttributeValue'), 'errors'); + setEventMessages($langs->trans('ErrorCreatingProductAttributeValue'), null, 'errors'); } } } diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php index 4daa2d8f45a..35cd9fc2a24 100644 --- a/htdocs/variants/generator.php +++ b/htdocs/variants/generator.php @@ -115,18 +115,18 @@ if ($_POST) { if ($res > 0) { $db->commit(); - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/combinations.php?id='.$id, 2)); exit; } } else { - setEventMessage($langs->trans('ErrorDeletingGeneratedProducts'), 'errors'); + setEventMessages($langs->trans('ErrorDeletingGeneratedProducts'), null, 'errors'); } $db->rollback(); } else { - setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors'); + setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } } From 5a4524451c5be80119404724bc33591937e4e76f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 28 Jul 2018 14:02:33 +0200 Subject: [PATCH 24/40] standardize --- htdocs/accountancy/admin/account.php | 1 + htdocs/accountancy/admin/accountmodel.php | 2 +- htdocs/accountancy/admin/card.php | 2 +- htdocs/accountancy/admin/categories.php | 2 +- htdocs/accountancy/admin/categories_list.php | 2 +- htdocs/accountancy/admin/defaultaccounts.php | 1 + htdocs/accountancy/admin/export.php | 1 + htdocs/accountancy/admin/fiscalyear.php | 2 +- htdocs/accountancy/admin/fiscalyear_card.php | 1 + htdocs/accountancy/admin/fiscalyear_info.php | 1 + htdocs/accountancy/admin/importaccounts.php | 1 + htdocs/accountancy/admin/index.php | 1 + htdocs/accountancy/admin/journals_list.php | 2 +- htdocs/accountancy/admin/productaccount.php | 1 + htdocs/accountancy/bookkeeping/balance.php | 3 ++- htdocs/accountancy/bookkeeping/balancebymonth.php | 1 + htdocs/accountancy/bookkeeping/card.php | 1 + htdocs/accountancy/bookkeeping/list.php | 2 +- htdocs/accountancy/bookkeeping/listbyaccount.php | 1 + 19 files changed, 20 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 493c9e62717..2587a58aef6 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -406,5 +406,6 @@ if ($resql) dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index f024f54c41c..2c7d92f3735 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -1004,7 +1004,7 @@ if ($id) print '
'; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 9643227da64..6a92a3f6080 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -397,6 +397,6 @@ else if ($id > 0 || $ref) { } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index aec34469559..735c5595ddc 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -184,6 +184,6 @@ if ($action == 'display' || $action == 'delete') { print ""; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 15a50e7b8e8..900205b7588 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -800,7 +800,7 @@ if ($id) print '
'; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index c33d4326836..8cd45c1cfda 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -190,5 +190,6 @@ print '
"; print ''; - llxFooter(); } +// End of page +llxFooter(); $db->close(); diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index 03265e434f6..3a0a1f73308 100644 --- a/htdocs/accountancy/bookkeeping/balancebymonth.php +++ b/htdocs/accountancy/bookkeeping/balancebymonth.php @@ -140,5 +140,6 @@ if ($resql) { } print "\n"; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 92c5713880c..e17cefd77bb 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -714,5 +714,6 @@ if ($action == 'create') dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index b0a91f7ce36..ee44b52ab7d 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -748,6 +748,6 @@ print '
'; print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 80a4f0db5e8..55e9c8ab7ad 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -421,5 +421,6 @@ print ''; print ""; print ''; +// End of page llxFooter(); $db->close(); From f17275845d46e32414b4b0bdc05f1a3b153b0181 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 28 Jul 2018 14:29:28 +0200 Subject: [PATCH 25/40] standardize --- htdocs/accountancy/customer/card.php | 1 + htdocs/accountancy/customer/index.php | 2 +- htdocs/accountancy/customer/lines.php | 2 +- htdocs/accountancy/customer/list.php | 6 ++++-- htdocs/accountancy/expensereport/card.php | 1 + htdocs/accountancy/expensereport/index.php | 1 + htdocs/accountancy/expensereport/lines.php | 2 +- htdocs/accountancy/expensereport/list.php | 6 ++++-- htdocs/accountancy/index.php | 1 + htdocs/accountancy/supplier/card.php | 1 + htdocs/accountancy/supplier/index.php | 2 +- htdocs/accountancy/supplier/lines.php | 3 +-- htdocs/accountancy/supplier/list.php | 6 ++++-- htdocs/adherents/admin/adherent.php | 3 +-- htdocs/adherents/admin/adherent_emails.php | 3 +-- htdocs/adherents/admin/adherent_extrafields.php | 2 +- htdocs/adherents/admin/adherent_type_extrafields.php | 2 +- htdocs/adherents/admin/website.php | 3 +-- htdocs/adherents/agenda.php | 4 +--- htdocs/adherents/card.php | 2 +- htdocs/adherents/cartes/carte.php | 2 +- htdocs/adherents/document.php | 2 +- htdocs/adherents/htpasswd.php | 3 +-- htdocs/adherents/index.php | 2 +- htdocs/adherents/ldap.php | 1 + htdocs/adherents/list.php | 2 +- htdocs/adherents/note.php | 2 +- htdocs/adherents/stats/byproperties.php | 3 +-- htdocs/adherents/stats/geo.php | 4 +--- htdocs/adherents/stats/index.php | 3 +-- htdocs/adherents/subscription.php | 3 +-- htdocs/adherents/subscription/card.php | 3 +-- htdocs/adherents/subscription/info.php | 1 + htdocs/adherents/subscription/list.php | 2 +- htdocs/adherents/type.php | 3 +-- htdocs/adherents/type_ldap.php | 1 + htdocs/admin/agenda_extrafields.php | 2 +- htdocs/admin/agenda_extsites.php | 3 +-- htdocs/admin/agenda_other.php | 2 +- htdocs/admin/agenda_reminder.php | 2 +- htdocs/admin/agenda_xcal.php | 2 +- htdocs/admin/menus/edit.php | 1 + htdocs/admin/menus/index.php | 2 +- htdocs/admin/menus/other.php | 2 +- htdocs/admin/system/about.php | 3 +-- htdocs/admin/system/browser.php | 3 +-- htdocs/admin/system/constall.php | 3 +-- htdocs/admin/system/database-tables.php | 1 + htdocs/admin/system/database.php | 2 +- htdocs/admin/system/dbtable.php | 2 +- htdocs/admin/system/dolibarr.php | 3 +-- htdocs/admin/system/filecheck.php | 5 +---- htdocs/admin/system/index.php | 7 +++---- htdocs/admin/system/modules.php | 1 + htdocs/admin/system/os.php | 2 +- htdocs/admin/system/perf.php | 3 +-- htdocs/admin/system/phpinfo.php | 3 +-- htdocs/admin/system/xcache.php | 2 +- htdocs/admin/tools/dolibarr_export.php | 2 +- htdocs/admin/tools/dolibarr_import.php | 2 +- htdocs/admin/tools/eaccelerator.php | 3 +-- htdocs/admin/tools/index.php | 2 +- htdocs/admin/tools/listevents.php | 2 +- htdocs/admin/tools/listsessions.php | 1 + htdocs/admin/tools/purge.php | 3 +-- htdocs/admin/tools/update.php | 3 +-- 66 files changed, 77 insertions(+), 87 deletions(-) diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 7e1387db951..677bc627c80 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -159,5 +159,6 @@ if (! empty($id)) { print "Error ID incorrect"; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 4191243e412..45387722719 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -415,6 +415,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. } } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index cc0ced6b067..83ddd1bd888 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -400,6 +400,6 @@ if ($result) { print $db->lasterror(); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 69396131b02..b5fec4a0e7c 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -201,8 +201,9 @@ llxHeader('', $langs->trans("Ventilation")); if (empty($chartaccountcode)) { print $langs->trans("ErrorChartOfAccountSystemNotSelected"); - llxFooter(); - $db->close(); + // End of page + llxFooter(); + $db->close(); exit; } @@ -524,5 +525,6 @@ jQuery(document).ready(function() { }); '; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index d9b2137157d..b245e2539a7 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -167,5 +167,6 @@ if (! empty($id)) { print "Error ID incorrect"; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 47a6f15e8c6..7f906e93879 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -345,5 +345,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print ''; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 473bc379057..ae368a20de1 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -349,6 +349,6 @@ if ($result) { print $db->lasterror(); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index a20f88f1c30..8057c9809f2 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -180,8 +180,9 @@ llxHeader('', $langs->trans("ExpenseReportsVentilation")); if (empty($chartaccountcode)) { print $langs->trans("ErrorChartOfAccountSystemNotSelected"); - llxFooter(); - $db->close(); + // End of page + llxFooter(); + $db->close(); exit; } @@ -422,5 +423,6 @@ jQuery(document).ready(function() { }); '; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 2881de98132..53ba48ff9d9 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -163,5 +163,6 @@ else print $langs->trans("Module10Desc")."
\n"; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index f126d00f2e9..439b8625342 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -162,5 +162,6 @@ if (! empty($id)) { print "Error ID incorrect"; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 3a6af92e41b..3e6a6991f6c 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -342,6 +342,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print ''; } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index ef54dec564d..326d249f86d 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -406,7 +406,6 @@ if ($result) { print $db->lasterror(); } - - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 57fdf0ace48..18c9fa11a3c 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -202,8 +202,9 @@ llxHeader('', $langs->trans("SuppliersVentilation")); if (empty($chartaccountcode)) { print $langs->trans("ErrorChartOfAccountSystemNotSelected"); - llxFooter(); - $db->close(); + // End of page + llxFooter(); + $db->close(); exit; } @@ -532,5 +533,6 @@ jQuery(document).ready(function() { }); '; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 4511ee0e8a7..2abc3b10841 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -265,7 +265,6 @@ form_constantes($constantes, 0, $helptext); dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php index 88514d83da3..76d40e57c17 100644 --- a/htdocs/adherents/admin/adherent_emails.php +++ b/htdocs/adherents/admin/adherent_emails.php @@ -160,7 +160,6 @@ form_constantes($constantes, 0, $helptext); dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index cfdea50538f..f47f92faa4c 100644 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -113,6 +113,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index 2c849628ab9..e78c4ef29e5 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -116,6 +116,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index b35df5f0083..31d9c43afbb 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -250,7 +250,6 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC)) print ''.$urlwithroot.'/public/members/new.php'.$entity_qr.''; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 2b663ecf2bc..8fb1851e021 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -175,8 +175,6 @@ if ($object->id > 0) } } - - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 990c8349e33..bc09ac2c250 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1896,6 +1896,6 @@ else } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index be3a13d8771..ff7e9c3be2e 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -310,6 +310,6 @@ print '
'; print '
'; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 8e12dec056e..4c91efc265c 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -170,6 +170,6 @@ else print $langs->trans("ErrorRecordNotFound"); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php index 5814ed3bf70..adc3d32eea4 100644 --- a/htdocs/adherents/htpasswd.php +++ b/htdocs/adherents/htpasswd.php @@ -86,7 +86,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index c9e3d1936c6..030700bb0f6 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -435,6 +435,6 @@ print ""; print ''; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index ff0bad063bd..b6bffd3d1bd 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -221,5 +221,6 @@ else print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 3a1dd04443f..db017d71f61 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -827,6 +827,6 @@ print ''; if ($num > $limit || $page) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit, 1); - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 1b887406df3..ae278b5dbb5 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -120,6 +120,6 @@ if ($id) } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index ded3dec120e..7ae29a7eeb9 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -143,7 +143,6 @@ print ''; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 1c6944c2a0a..9de537ed39a 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -309,8 +309,6 @@ if ($mode) dol_fiche_end(); - - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 083d81d6db6..902c2d35359 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -229,7 +229,6 @@ print '
'; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 3e4af5438c6..7e3dfe28b0e 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -1108,7 +1108,6 @@ else print $langs->trans("ErrorRecordNotFound"); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index f905225a396..34b58c5b04d 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -417,7 +417,6 @@ if ($rowid && $action != 'edit') print ''; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/subscription/info.php b/htdocs/adherents/subscription/info.php index 05856c35f75..649a1e22996 100644 --- a/htdocs/adherents/subscription/info.php +++ b/htdocs/adherents/subscription/info.php @@ -76,5 +76,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 21ba01088e4..91e5b2f8837 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -381,6 +381,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 56363599c10..e9ad0b91498 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -787,7 +787,6 @@ if ($rowid > 0) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php index 7edb42e6c76..5d60beb2a4d 100644 --- a/htdocs/adherents/type_ldap.php +++ b/htdocs/adherents/type_ldap.php @@ -187,5 +187,6 @@ else print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index 69e834e22e2..887fba847e4 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -117,6 +117,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 906ecd8d092..236483f5ed4 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -238,7 +238,6 @@ print ''; print "\n"; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 2d20d285720..842c8d01470 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -399,6 +399,6 @@ print ''; print "
"; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index e78a8e089ed..269880236cb 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -247,6 +247,6 @@ print ''; print "
"; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 481a850790e..d76d95da47a 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -198,6 +198,6 @@ if (! empty($conf->use_javascript_ajax)) print ''; } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 191db98a402..2864fe79df0 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -514,5 +514,6 @@ elseif ($action == 'edit') print '
'; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index c3211fc2d75..2e6d8a91008 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -410,6 +410,6 @@ else print '
'; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index 7789c3fb21c..0446c59af1d 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -105,6 +105,6 @@ print ''; print ''; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index 61780d51386..e9ea61ac944 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -214,7 +214,6 @@ if ($showpromotemessage) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/browser.php b/htdocs/admin/system/browser.php index 4f2a53de88d..c5aeff70b88 100644 --- a/htdocs/admin/system/browser.php +++ b/htdocs/admin/system/browser.php @@ -66,7 +66,6 @@ print ''; print ''; print '
'; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index 82e8481c2dd..9d4c4fc3cec 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -249,7 +249,6 @@ if ($resql) print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index 556961cb565..17d72edf20a 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -212,5 +212,6 @@ else } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index 45ce3c087e6..d5a7bbcdbfd 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -126,6 +126,6 @@ else } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index cef493c95f8..392c083c382 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -138,6 +138,6 @@ else } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 4b02e7941d2..4dd4ef9dc9b 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -453,7 +453,6 @@ if ($resql) print ''; print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 9a9e2297cba..65a9354a19f 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -433,11 +433,8 @@ if (! $error && $xml) print $out; } - - - +// End of page llxFooter(); - $db->close(); exit($error); diff --git a/htdocs/admin/system/index.php b/htdocs/admin/system/index.php index 3d473640618..7ffef739993 100644 --- a/htdocs/admin/system/index.php +++ b/htdocs/admin/system/index.php @@ -25,9 +25,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -$langs->load("admin"); -$langs->load("user"); -$langs->load("install"); +// Load translation files required by the page +$langs->loadLangs(array("admin", "user", "install")); if (! $user->admin) accessforbidden(); @@ -114,6 +113,6 @@ print '
'; //print "
\n"; print info_admin($langs->trans("SystemInfoDesc")).'
'; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 4a6967089e2..fda1946875a 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -159,5 +159,6 @@ foreach($rights_ids as $right_id) $old = $right_id; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/system/os.php b/htdocs/admin/system/os.php index 01d48f2444d..251025a4c9e 100644 --- a/htdocs/admin/system/os.php +++ b/htdocs/admin/system/os.php @@ -49,6 +49,6 @@ $osversion=version_os(); print "".$langs->trans("Version")."".$osversion."\n"; print ''; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 1e757b72f63..85ac2aea006 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -491,7 +491,6 @@ print ''.$langs->trans("DatabaseStatistics").': '; print '
'; */ - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index 8664a28b28a..aa502cde421 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -116,7 +116,6 @@ foreach($phparray as $key => $value) print '
'; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/xcache.php b/htdocs/admin/system/xcache.php index 53eaeec085f..b582e61619b 100644 --- a/htdocs/admin/system/xcache.php +++ b/htdocs/admin/system/xcache.php @@ -76,6 +76,6 @@ if ($action == 'clear') } */ +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 1c985e23090..c9ef19dae98 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -522,6 +522,6 @@ print $langs->trans("BackupDescX").'

'; close(); diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index f390c192159..aca900c1cbc 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -212,6 +212,6 @@ else if (in_array($type, array('pgsql'))) close(); diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php index d3253c02514..9999734a8f8 100644 --- a/htdocs/admin/tools/eaccelerator.php +++ b/htdocs/admin/tools/eaccelerator.php @@ -335,7 +335,6 @@ if (function_exists('eaccelerator_get')) { print "

"; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/tools/index.php b/htdocs/admin/tools/index.php index 98a490550ca..c5a05ef2136 100644 --- a/htdocs/admin/tools/index.php +++ b/htdocs/admin/tools/index.php @@ -56,6 +56,6 @@ print '

'; //print '
'; print '
'; // For a reason I don't know, the div class="center does not works, we must keep the
- +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 48d3ef57fd5..db5157789e1 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -339,6 +339,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 70b0987732b..13b99d92f6d 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -208,5 +208,6 @@ print ''; print '
'; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index f415ed1692c..097fc507240 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -119,7 +119,6 @@ if (preg_match('/^confirm/i',$choice)) print $form->formconfirm($_SERVER["PHP_SELF"].'?choice=allfiles', $langs->trans('Purge'), $langs->trans('ConfirmPurge').img_warning().' ', 'purge', $formquestion, 'no', 2); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index d0802d6b473..41923aa068d 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -142,7 +142,6 @@ print '
'; print $langs->trans("GoModuleSetupArea", DOL_URL_ROOT.'/admin/modules.php?mode=deploy', $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Modules")); - +// End of page llxFooter(); - $db->close(); From 9cc40fcb215fe22c1997002dc5e07b5ca70364ab Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 28 Jul 2018 17:26:56 +0200 Subject: [PATCH 26/40] standardize --- htdocs/admin/agenda.php | 2 +- htdocs/admin/bank.php | 2 +- htdocs/admin/bank_extrafields.php | 2 +- htdocs/admin/barcode.php | 1 + htdocs/admin/boxes.php | 3 +-- htdocs/admin/chequereceipts.php | 2 +- htdocs/admin/clicktodial.php | 2 +- htdocs/admin/commande.php | 3 +-- htdocs/admin/company.php | 3 +-- htdocs/admin/compta.php | 1 + htdocs/admin/confexped.php | 1 + htdocs/admin/const.php | 3 +-- htdocs/admin/contract.php | 3 +-- htdocs/admin/dav.php | 2 +- htdocs/admin/defaultvalues.php | 3 +-- htdocs/admin/delais.php | 1 + htdocs/admin/dict.php | 2 +- htdocs/admin/ecm.php | 1 + htdocs/admin/events.php | 2 +- htdocs/admin/expedition.php | 1 + htdocs/admin/expedition_extrafields.php | 2 +- htdocs/admin/expeditiondet_extrafields.php | 2 +- htdocs/admin/expensereport.php | 3 +-- htdocs/admin/expensereport_extrafields.php | 2 +- htdocs/admin/expensereport_ik.php | 3 ++- htdocs/admin/expensereport_rules.php | 3 ++- htdocs/admin/export.php | 14 +++++--------- 27 files changed, 33 insertions(+), 36 deletions(-) diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 6fedfa6d2cb..7f41927b478 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -202,6 +202,6 @@ print "\n"; print "
"; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index a4e9e4bb210..1e9acde2665 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -432,6 +432,6 @@ print "\n"; print ''; dol_fiche_end(); +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/bank_extrafields.php b/htdocs/admin/bank_extrafields.php index 99b8d09f277..3b95c158f27 100644 --- a/htdocs/admin/bank_extrafields.php +++ b/htdocs/admin/bank_extrafields.php @@ -114,6 +114,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index a7a863c4725..4e0c683a73f 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -405,5 +405,6 @@ if ($conf->produit->enabled) print "
"; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 04fd76e96fc..9f3453f7587 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -488,7 +488,6 @@ print '
'."\n"; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index df628ecc87f..82b0ed3848c 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -280,6 +280,6 @@ dol_fiche_end(); print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index c2cfaf9f72a..34a641137dc 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -140,6 +140,6 @@ if (! empty($conf->global->CLICKTODIAL_URL)) } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index cee12e4b08e..64df9194197 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -679,7 +679,6 @@ print "\n"; print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 949038b4413..4a006c56268 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -1153,7 +1153,6 @@ else print '
'; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 8e17541bfef..214c30dc544 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -164,5 +164,6 @@ print "\n"; print '

'; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index e4691a42e78..9e6745e6c29 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -147,5 +147,6 @@ print ''; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 9dd68c16326..be5f785f9e4 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -314,7 +314,6 @@ if ($conf->use_javascript_ajax) print "\n"; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 74f7acb04f3..60be9e062ba 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -509,7 +509,6 @@ print ''; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index ea4bbf97af0..e882a56e2b8 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -143,6 +143,6 @@ $message.=img_picto('','object_globe.png').' '.$langs->trans("WebDavServer",'Web $message.='
'; print $message; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 84271cff38f..984ddfbefd7 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -412,7 +412,6 @@ dol_fiche_end(); print "\n"; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index ae3c43c5b24..14dfb9922f6 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -415,5 +415,6 @@ if($action == 'edit') { } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 32995bce38f..0c25f3a5bd8 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1735,7 +1735,7 @@ else print '
'; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index dc2f3e489f7..3126f432938 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -109,5 +109,6 @@ print ''; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 1d1ec548853..606d3a5f201 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -114,6 +114,6 @@ print ""; print "\n"; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index eb18f904229..c851010635e 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -507,5 +507,6 @@ print '
$(function() { }); '; dol_fiche_end(); -llxFooter(); +// End of page +llxFooter(); $db->close(); diff --git a/htdocs/admin/export.php b/htdocs/admin/export.php index b6f12a723ff..292c3604799 100644 --- a/htdocs/admin/export.php +++ b/htdocs/admin/export.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2018 Philippe Grand * * 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 @@ -32,9 +32,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; // Load translation files required by the page -$langs->loadLangs(array('admin', 'exports')); - -$langs->load('other'); +$langs->loadLangs(array('admin', 'exports', 'other')); if (! $user->admin) accessforbidden(); @@ -73,7 +71,7 @@ dol_fiche_head( // Setup page goes here $form=new Form($db); -$var=false; + print ''; print ''; print ''."\n"; @@ -82,8 +80,7 @@ print ''."\n"; // Example with a yes / no select -$var=!$var; -print ''; +print ''; print ''; print ''; print ''; - print '
'.$langs->trans("ExportModel").'
'.$langs->trans("set_EXPORTS_SHARE_MODELS").' '; @@ -94,9 +91,8 @@ echo ajax_constantonoff('EXPORTS_SHARE_MODELS'); print ''; print '
'; +// End of page llxFooter(); - $db->close(); From 36ea20b7d48d21a8df1475ed39536ffe70c4c39c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 28 Jul 2018 18:03:14 +0200 Subject: [PATCH 27/40] standardize --- htdocs/admin/external_rss.php | 2 +- htdocs/admin/facture.php | 3 +-- htdocs/admin/fckeditor.php | 2 +- htdocs/admin/fichinter.php | 7 ++----- htdocs/admin/geoipmaxmind.php | 2 +- htdocs/admin/holiday.php | 1 + htdocs/admin/ihm.php | 2 +- htdocs/admin/index.php | 3 +-- htdocs/admin/ldap.php | 1 + htdocs/admin/ldap_contacts.php | 1 + htdocs/admin/ldap_groups.php | 1 + htdocs/admin/ldap_members.php | 3 +-- htdocs/admin/ldap_members_types.php | 1 + htdocs/admin/ldap_users.php | 1 + htdocs/admin/limits.php | 3 +-- htdocs/admin/livraison.php | 1 + htdocs/admin/livraison_extrafields.php | 2 +- htdocs/admin/livraisondet_extrafields.php | 2 +- htdocs/admin/loan.php | 1 + htdocs/admin/mailing.php | 2 +- htdocs/admin/mailman.php | 3 +-- htdocs/admin/mails.php | 3 +-- htdocs/admin/mails_emailing.php | 3 +-- htdocs/admin/mails_templates.php | 1 + htdocs/admin/menus.php | 3 +-- htdocs/admin/modulehelp.php | 3 +-- htdocs/admin/modules.php | 4 +--- htdocs/admin/multicurrency.php | 2 +- htdocs/admin/notification.php | 3 +-- htdocs/admin/oauth.php | 2 +- htdocs/admin/oauthlogintokens.php | 2 +- htdocs/admin/order_extrafields.php | 2 +- htdocs/admin/orderdet_extrafields.php | 2 +- htdocs/admin/payment.php | 3 +-- htdocs/admin/pdf.php | 3 +-- htdocs/admin/perms.php | 3 ++- htdocs/admin/prelevement.php | 1 + htdocs/admin/propal.php | 3 +-- htdocs/admin/proxy.php | 1 + htdocs/admin/receiptprinter.php | 2 +- htdocs/admin/resource.php | 2 +- htdocs/admin/resource_extrafields.php | 2 +- htdocs/admin/salaries.php | 3 ++- htdocs/admin/security.php | 3 +-- htdocs/admin/security_file.php | 2 +- htdocs/admin/security_other.php | 2 +- htdocs/admin/sms.php | 3 +-- htdocs/admin/spip.php | 2 +- htdocs/admin/stock.php | 3 +-- 49 files changed, 52 insertions(+), 60 deletions(-) diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index e8683dfc4ee..e0f3f72f927 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -325,6 +325,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index f00d125a4d5..6c28081e6fc 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -782,7 +782,6 @@ print ''; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 19d4a4cc772..bed1d4d9bcb 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -234,6 +234,6 @@ else */ } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index a216f2d4ab7..c714c0c6c1b 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2011-2017 Philippe Grand + * Copyright (C) 2011-2018 Philippe Grand * * 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 @@ -560,7 +560,6 @@ print "\n"; print ''; //Use draft Watermark - print "
"; print ''; print ""; @@ -635,12 +634,10 @@ print ''; print ''; print '
'; - - - print ''; print '
'; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index 9c944324527..9f154591f0f 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -153,6 +153,6 @@ if ($geoip) $geoip->close(); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index b199505d214..e2d1cfca145 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -517,5 +517,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 62f17d5cb1d..355f5ae44fd 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -578,6 +578,6 @@ else // Show print '
'; } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 6542cec1174..2f64793c28b 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -114,7 +114,6 @@ if (empty($reshook)) print '
'; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 6776cfb1480..052b2f38988 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -340,5 +340,6 @@ if (function_exists("ldap_connect")) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 3188bf6e58a..dd85a998383 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -318,6 +318,7 @@ if (function_exists("ldap_connect")) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 4ae6ce9ad97..2650fe4fe6e 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -251,5 +251,6 @@ if (function_exists("ldap_connect")) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 616eb99a8da..240901ec04d 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -442,7 +442,6 @@ if (function_exists("ldap_connect")) } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index e45857f2f38..e845fd37adc 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -241,5 +241,6 @@ if (function_exists("ldap_connect")) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 8b11069fc61..513aa63f035 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -470,5 +470,6 @@ if (function_exists("ldap_connect")) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index e9389b0271d..d24891f80f6 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -306,7 +306,6 @@ else */ } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 88ce717f005..91fb9f964e4 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -478,6 +478,7 @@ print ''; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/livraison_extrafields.php b/htdocs/admin/livraison_extrafields.php index c9fed1c6554..55fe6f10362 100644 --- a/htdocs/admin/livraison_extrafields.php +++ b/htdocs/admin/livraison_extrafields.php @@ -119,6 +119,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/livraisondet_extrafields.php b/htdocs/admin/livraisondet_extrafields.php index 921e9cfee41..e70b4f2d09b 100644 --- a/htdocs/admin/livraisondet_extrafields.php +++ b/htdocs/admin/livraisondet_extrafields.php @@ -120,6 +120,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index 3349ac0056a..419f6efbee9 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -122,5 +122,6 @@ print "\n"; print '
'; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 32fbdd4aeb6..d5b866d9d20 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -152,6 +152,6 @@ print '
\n"; print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 87a89f5d99b..9490a291729 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -205,5 +205,6 @@ print '
'; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 4465017bdc6..abe2fbea655 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -447,7 +447,7 @@ $object->barcode = '3700123862396'; //$printer->sendToPrinter($object, 1, 16); //setEventMessages($printer->error, $printer->errors, 'errors'); +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index e8f8bdba204..566e57e587b 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -137,6 +137,6 @@ print ''; dol_fiche_end(); - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/resource_extrafields.php b/htdocs/admin/resource_extrafields.php index 722e5d88a9c..b8ea860ac25 100644 --- a/htdocs/admin/resource_extrafields.php +++ b/htdocs/admin/resource_extrafields.php @@ -116,6 +116,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php index 6c5281173c3..c5ec770e393 100644 --- a/htdocs/admin/salaries.php +++ b/htdocs/admin/salaries.php @@ -127,5 +127,6 @@ print '
'; - // Form to test upload print '
'; $formfile=new FormFile($db); @@ -188,5 +187,6 @@ $formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestF $filearray=dol_dir_list($upload_dir, "files", 0, '', '', 'name', SORT_ASC, 1); $formfile->list_of_documents($filearray, null, 'admin_temp', ''); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 6503ab10f77..0e3da947fa8 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -206,6 +206,6 @@ print '
'; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index db1cb20b5e3..3dbc785d1d7 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -331,7 +331,6 @@ else } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index b9892fdf2a9..d179c66d58d 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -163,6 +163,6 @@ else dol_fiche_end(); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index e1098ef262d..b83f87af162 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -566,7 +566,6 @@ if ($conf->global->PRODUIT_SOUSPRODUITS) } */ - +// End of page llxFooter(); - $db->close(); From 892174cbf8823b774f68e1a1b2adb4c9cfe8512c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 29 Jul 2018 10:29:12 +0200 Subject: [PATCH 28/40] standardize --- htdocs/admin/supplier_invoice.php | 3 +-- htdocs/admin/supplier_order.php | 3 +-- htdocs/admin/supplier_payment.php | 3 +-- htdocs/admin/supplier_proposal.php | 1 + htdocs/admin/supplierinvoice_extrafields.php | 2 +- htdocs/admin/supplierinvoicedet_extrafields.php | 2 +- htdocs/admin/supplierorder_extrafields.php | 2 +- htdocs/admin/supplierorderdet_extrafields.php | 2 +- htdocs/admin/syslog.php | 2 +- htdocs/admin/taxes.php | 2 +- htdocs/admin/ticket.php | 2 +- htdocs/admin/ticket_extrafields.php | 2 +- htdocs/admin/translation.php | 2 +- htdocs/admin/triggers.php | 2 +- htdocs/admin/user.php | 1 + htdocs/admin/usergroup.php | 1 + htdocs/admin/website.php | 4 +--- htdocs/admin/website_options.php | 3 +-- htdocs/admin/workflow.php | 3 +-- 19 files changed, 19 insertions(+), 23 deletions(-) diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 75a917dd185..367d1fe0d36 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -516,7 +516,6 @@ print "\n"; print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 695d25a963c..72050867dfa 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -589,7 +589,6 @@ print "\n"; print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index c1f3a7cb25d..55fb311ccda 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -430,7 +430,6 @@ print ''; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 99069447e81..eeb148e9d99 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -582,6 +582,7 @@ print "\n"; print "\n ".$langs->trans("PathDirectory")."\n ".$conf->supplier_proposal->dir_output."\n\n"; print "\n
"; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 16da8bf7a5c..65ce01a4faf 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -123,6 +123,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/supplierinvoicedet_extrafields.php b/htdocs/admin/supplierinvoicedet_extrafields.php index 4ca9fd516d7..cdf128871fd 100644 --- a/htdocs/admin/supplierinvoicedet_extrafields.php +++ b/htdocs/admin/supplierinvoicedet_extrafields.php @@ -119,6 +119,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 58c0408510d..640b6375c57 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -117,6 +117,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/supplierorderdet_extrafields.php b/htdocs/admin/supplierorderdet_extrafields.php index 7dfaa02545e..65fe0537ba7 100644 --- a/htdocs/admin/supplierorderdet_extrafields.php +++ b/htdocs/admin/supplierorderdet_extrafields.php @@ -118,6 +118,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 45dc91a8b95..e163fc83de5 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -302,6 +302,6 @@ if(! empty($conf->loghandlers['mod_syslog_file']) && ! empty($conf->cron->enable print ''; print "\n"; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 7c4bf64909f..304f9b79bd0 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -273,6 +273,6 @@ if (! empty($conf->accounting->enabled)) print '

'.$langs->trans("AccountingAccountForSalesTaxAreDefinedInto", $langs->transnoentitiesnoconv("MenuAccountancy"), $langs->transnoentitiesnoconv("Setup")).''; } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 95af411b813..38f0a8eb497 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -641,6 +641,6 @@ print ''; print '
'; print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/ticket_extrafields.php b/htdocs/admin/ticket_extrafields.php index 0687a33c52b..07ace9fea0c 100644 --- a/htdocs/admin/ticket_extrafields.php +++ b/htdocs/admin/ticket_extrafields.php @@ -109,6 +109,6 @@ if ($action == 'edit' && !empty($attrname)) { include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index cc21a8ff717..4c215e9ae52 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -584,6 +584,6 @@ if (! empty($langcode)) dol_set_focus('#transvalue'); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 1a1893e2eb0..cd2f33b4cb0 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -84,6 +84,6 @@ foreach ($triggers as $trigger) print ''; print '
'; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index f888c8410bb..2cf8fc5b6f3 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -337,5 +337,6 @@ print "
"; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index 28f1ad6af2f..c1b55dcec6a 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -282,5 +282,6 @@ print "
"; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 80ca0b29c0a..fcdeee79249 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -646,9 +646,7 @@ if ($id) dol_fiche_end(); -//print '
'; - - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index c688da0e550..9d724b86390 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -143,9 +143,8 @@ else dol_fiche_end(); -//print '
'; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index b5bdec73f3e..24a39ce827a 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -187,7 +187,6 @@ if ($nbqualified == 0) } print ''; - +// End of page llxFooter(); - $db->close(); From 69feb3af141829d82c08291e54965186de8dfbb9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 29 Jul 2018 11:33:52 +0200 Subject: [PATCH 29/40] standardize --- htdocs/asset/admin/assets_extrafields.php | 2 +- htdocs/asset/admin/assets_type_extrafields.php | 2 +- htdocs/asset/admin/setup.php | 3 +-- htdocs/asset/document.php | 2 +- htdocs/asset/info.php | 1 + htdocs/asset/note.php | 2 +- htdocs/asset/type.php | 3 +-- htdocs/asterisk/wrapper.php | 1 + htdocs/barcode/codeinit.php | 2 +- htdocs/barcode/printsheet.php | 2 +- htdocs/blockedlog/admin/blockedlog.php | 1 + htdocs/blockedlog/admin/blockedlog_list.php | 3 ++- 12 files changed, 13 insertions(+), 11 deletions(-) diff --git a/htdocs/asset/admin/assets_extrafields.php b/htdocs/asset/admin/assets_extrafields.php index 1cdf78df4bf..109b0f1e94f 100644 --- a/htdocs/asset/admin/assets_extrafields.php +++ b/htdocs/asset/admin/assets_extrafields.php @@ -109,6 +109,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/asset/admin/assets_type_extrafields.php b/htdocs/asset/admin/assets_type_extrafields.php index d828bffa4de..e8f1d71370b 100644 --- a/htdocs/asset/admin/assets_type_extrafields.php +++ b/htdocs/asset/admin/assets_type_extrafields.php @@ -107,6 +107,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index c240f350590..1168fd3ada3 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -107,9 +107,8 @@ else print '
'; } - -// Page end dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index 66baaae196c..6427befd03e 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -148,6 +148,6 @@ else accessforbidden('',0,0); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/asset/info.php b/htdocs/asset/info.php index 71460f31a2c..e8820ee5cfa 100644 --- a/htdocs/asset/info.php +++ b/htdocs/asset/info.php @@ -79,5 +79,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php index cf0166df96f..775b3e8747e 100644 --- a/htdocs/asset/note.php +++ b/htdocs/asset/note.php @@ -144,6 +144,6 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index f4409ee5417..001912f7de3 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -851,7 +851,6 @@ if ($rowid > 0) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index 8cd5ff979a0..66ff541d499 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -190,5 +190,6 @@ else { print 'Bad parameters in URL. Must be '.$_SERVER['PHP_SELF'].'?caller=99999&called=99999&login=xxxxx&password=xxxxx'; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index 26386052480..7086af7f17e 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -319,6 +319,6 @@ if ($conf->product->enabled || $conf->product->service) print ''; print '
'; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 7dfec76b39e..6dd578993ca 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -441,6 +441,6 @@ print '
'; print '
'; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index 326fea79c5d..8c2835d856c 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -178,5 +178,6 @@ if (GETPOST('withtab','alpha')) print '

'; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 8f5d47bf704..6bb1876b926 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -587,5 +587,6 @@ if (GETPOST('withtab','alpha')) print '

'; +// End of page llxFooter(); -$db->close(); +$db->close(); \ No newline at end of file From de70bf983ec424a089879d18df7df18d9628da34 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 29 Jul 2018 13:40:35 +0200 Subject: [PATCH 30/40] standardize --- htdocs/bookmarks/admin/bookmark.php | 1 + htdocs/bookmarks/card.php | 3 +-- htdocs/bookmarks/list.php | 2 +- htdocs/cashdesk/admin/cashdesk.php | 1 + htdocs/categories/admin/categorie.php | 1 + htdocs/categories/admin/categorie_extrafields.php | 2 +- htdocs/categories/card.php | 3 +-- htdocs/categories/edit.php | 3 +-- htdocs/categories/index.php | 2 +- htdocs/categories/photos.php | 2 +- htdocs/categories/traduction.php | 1 + htdocs/categories/viewcat.php | 2 +- htdocs/collab/index.php | 5 +---- htdocs/comm/action/card.php | 3 +-- htdocs/comm/action/document.php | 3 +-- htdocs/comm/action/index.php | 2 +- htdocs/comm/action/info.php | 1 + htdocs/comm/action/list.php | 3 +-- htdocs/comm/action/pertype.php | 4 +--- htdocs/comm/action/peruser.php | 4 +--- htdocs/comm/action/rapport/index.php | 1 + htdocs/comm/admin/propal_extrafields.php | 2 +- htdocs/comm/admin/propaldet_extrafields.php | 2 +- 23 files changed, 23 insertions(+), 30 deletions(-) diff --git a/htdocs/bookmarks/admin/bookmark.php b/htdocs/bookmarks/admin/bookmark.php index 25fa032902f..ed20f619b25 100644 --- a/htdocs/bookmarks/admin/bookmark.php +++ b/htdocs/bookmarks/admin/bookmark.php @@ -81,5 +81,6 @@ print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index d450e476506..b82c2b11b6c 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -336,7 +336,6 @@ if ($id > 0 && ! preg_match('/^add/i',$action)) } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index ac5a89c66f3..10ce877c7e0 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -209,7 +209,7 @@ else dol_print_error($db); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index f4af16b3739..62867d855cb 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -185,5 +185,6 @@ print '
\n"; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index 92e23a2199a..03adfdbb41e 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -122,5 +122,6 @@ print ''; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/categories/admin/categorie_extrafields.php b/htdocs/categories/admin/categorie_extrafields.php index 3fbd29a640b..abea3f41eeb 100644 --- a/htdocs/categories/admin/categorie_extrafields.php +++ b/htdocs/categories/admin/categorie_extrafields.php @@ -111,6 +111,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index db56902347b..ce3324505eb 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -288,7 +288,6 @@ if ($user->rights->categorie->creer) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index b420847f6fd..cdfac54fb9d 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -192,7 +192,6 @@ print '
'; - - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index e57e51caf62..e634da4fe80 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -202,6 +202,6 @@ print ""; print '
'; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 472a8eb9b95..095c0c611c5 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -273,6 +273,6 @@ else print $langs->trans("ErrorUnknown"); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 7d71b43a81b..dbcfca198d2 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -334,5 +334,6 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service print '
'; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 24e70e7d587..ba3580cea87 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -697,6 +697,6 @@ if ($type == Categorie::TYPE_PROJECT) } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/collab/index.php b/htdocs/collab/index.php index 2c056cd0e07..d7d5e9a8bbd 100644 --- a/htdocs/collab/index.php +++ b/htdocs/collab/index.php @@ -456,9 +456,6 @@ if ($action == 'editcontent') print "
\n\n"; - - - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 1d6a0286b68..dae5fb70617 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1611,7 +1611,6 @@ if ($id > 0) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 43e5b89f115..7fc12129cc5 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -268,7 +268,6 @@ else print $langs->trans("ErrorUnknown"); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index c361d275882..178e4bfb6d7 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1250,8 +1250,8 @@ else // View by day print "\n".''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 9a043a13690..2582e9b6b32 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -114,5 +114,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 2c11a1de977..319499d65fd 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -672,7 +672,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 2fdfa180319..9350de8f85c 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -730,10 +730,8 @@ jQuery(document).ready(function() { }); '; - - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 0cf056ef3a9..58690dc512b 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -865,10 +865,8 @@ jQuery(document).ready(function() { }); '; - - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 7e4108b470b..ff1c7746afa 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -209,5 +209,6 @@ else dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index 6a6aa12862a..becfabc949c 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -111,6 +111,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index 0816a4c035c..7172c0e5b7c 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -118,6 +118,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); From d1f100b0c965e6d408c2f39cf72d3169611e0c3d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 29 Jul 2018 17:17:29 +0200 Subject: [PATCH 31/40] standardize --- htdocs/comm/card.php | 1 - htdocs/comm/contact.php | 2 +- htdocs/comm/index.php | 2 +- htdocs/comm/mailing/advtargetemailing.php | 1 + htdocs/comm/mailing/card.php | 1 + htdocs/comm/mailing/cibles.php | 3 +-- htdocs/comm/mailing/index.php | 3 +-- htdocs/comm/mailing/info.php | 1 + htdocs/comm/mailing/list.php | 2 +- htdocs/comm/multiprix.php | 1 + htdocs/comm/propal/contact.php | 2 +- htdocs/comm/propal/document.php | 1 + htdocs/comm/propal/index.php | 3 +-- htdocs/comm/propal/info.php | 1 + htdocs/comm/propal/note.php | 2 +- htdocs/comm/propal/stats/index.php | 3 +-- htdocs/comm/prospect/index.php | 2 +- htdocs/comm/prospect/recap-prospect.php | 1 + htdocs/comm/recap-client.php | 1 + htdocs/comm/remise.php | 6 ++++-- htdocs/comm/remx.php | 1 + 21 files changed, 23 insertions(+), 17 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 83db0e0f1d2..d7d5a3f4f5a 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1346,5 +1346,4 @@ else // End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index aa8dae43140..b6d9f0922aa 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -176,6 +176,6 @@ else dol_print_error($db); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index e90a821b5e3..92757dcac36 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -884,6 +884,6 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index b63ffac6efd..4d10120aaeb 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -471,5 +471,6 @@ if ($object->fetch($id) >= 0) { } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 97746ad9d82..469db6f2a54 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1358,5 +1358,6 @@ else } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 08ed54d2fc3..6caa262500e 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -649,7 +649,6 @@ if ($object->fetch($id) >= 0) } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 17693a1a73c..9cd1e8546d0 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -210,7 +210,6 @@ if ($langs->file_exists("html/spam.html",0)) { print '
'; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index b4f2eaeb6f3..3c1e6e2cffa 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -75,5 +75,6 @@ if ($object->fetch($id) >= 0) dol_fiche_end(); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 87a390d4006..5087698b9ab 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -224,6 +224,6 @@ else dol_print_error($db); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php index 1e8c5c82cf4..e9ddee12b22 100644 --- a/htdocs/comm/multiprix.php +++ b/htdocs/comm/multiprix.php @@ -177,5 +177,6 @@ if ($_socid > 0) } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 5e21f493c64..4e017ff13d9 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -212,6 +212,6 @@ if ($object->id > 0) } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 1c8d494214d..2f16cd54864 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -179,5 +179,6 @@ else print $langs->trans("ErrorUnknown"); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 0dbe2fb855e..b47a4506412 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -530,7 +530,6 @@ if (! empty($conf->propal->enabled)) //print ''; print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index 317c9902d52..7879612b099 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -127,5 +127,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 607cff245d9..a346f8df18f 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -144,6 +144,6 @@ if ($id > 0 || ! empty($ref)) } } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index ac6b42c45d8..00db6264377 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -344,7 +344,6 @@ print '
'; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 2273012696f..6d7e93af4be 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -275,6 +275,6 @@ if ($resql) //print ''; print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/prospect/recap-prospect.php b/htdocs/comm/prospect/recap-prospect.php index 50127d719c8..93cfada8860 100644 --- a/htdocs/comm/prospect/recap-prospect.php +++ b/htdocs/comm/prospect/recap-prospect.php @@ -89,5 +89,6 @@ else dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index 6cd41c6c658..86c1bad0521 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -89,5 +89,6 @@ else dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index 6f3287b8831..f045e570c6e 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -129,8 +129,9 @@ if ($socid > 0) print ''; - llxFooter(); - $db->close(); + // End of page + llxFooter(); + $db->close(); exit; } @@ -324,5 +325,6 @@ if ($socid > 0) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 3eec109e6b3..78e4643d5e3 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -998,5 +998,6 @@ if ($socid > 0) } } +// End of page llxFooter(); $db->close(); From fb565b15c531b276b393d3918b2c697fa4bdc949 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 29 Jul 2018 19:16:28 +0200 Subject: [PATCH 32/40] standardize --- htdocs/commande/card.php | 1 + htdocs/commande/contact.php | 1 + htdocs/commande/customer.php | 2 +- htdocs/commande/document.php | 2 +- htdocs/commande/index.php | 2 +- htdocs/commande/info.php | 1 + htdocs/commande/list.php | 1 + htdocs/commande/note.php | 1 + htdocs/commande/orderstoinvoice.php | 1 + htdocs/commande/stats/index.php | 3 +-- htdocs/compta/bank/annuel.php | 1 + htdocs/compta/bank/bankentries_list.php | 2 +- htdocs/compta/bank/bilan.php | 1 + htdocs/compta/bank/budget.php | 1 + htdocs/compta/bank/card.php | 1 + htdocs/compta/bank/categ.php | 2 ++ htdocs/compta/bank/document.php | 3 +-- htdocs/compta/bank/graph.php | 3 +-- htdocs/compta/bank/info.php | 1 + htdocs/compta/bank/ligne.php | 2 +- htdocs/compta/bank/list.php | 3 +-- htdocs/compta/bank/releve.php | 3 +-- htdocs/compta/bank/transfer.php | 1 + htdocs/compta/bank/treso.php | 1 + htdocs/compta/bank/various_payment/card.php | 4 +--- htdocs/compta/bank/various_payment/document.php | 2 +- htdocs/compta/bank/various_payment/index.php | 1 + htdocs/compta/bank/various_payment/info.php | 2 +- 28 files changed, 29 insertions(+), 20 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 0c3e4328505..10005f3004a 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2678,5 +2678,6 @@ if ($action == 'create' && $user->rights->commande->creer) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 7669239134a..bd00116e026 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -214,5 +214,6 @@ if ($id > 0 || ! empty($ref)) } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 9263ceb3f45..42def36ee28 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -190,7 +190,7 @@ else dol_print_error($db); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index ffebbaa260a..e7d0514a022 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -189,6 +189,6 @@ else } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 5cfb87c7a25..4c596620c6c 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -479,6 +479,6 @@ if (! empty($conf->commande->enabled)) print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index 4bac4a3a447..6c0b5f42ec6 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -128,5 +128,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 2b86ad2f18a..98c2333793f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1160,5 +1160,6 @@ else dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 6cff3bfb3bc..bf02c9b993c 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -142,5 +142,6 @@ if ($id > 0 || ! empty($ref)) } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 03d379270b1..37768ade393 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -739,5 +739,6 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 8f259808357..49e7d5cfb60 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -369,7 +369,6 @@ print '
'; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index a786cf5ca28..1b2a5155a7e 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -494,5 +494,6 @@ else print "\n
\n"; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 8ddc3de0014..72c00f2f3a3 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1529,6 +1529,6 @@ if ($_POST["action"] == "search" && ! $num) print '
'.$langs->trans("NoRecordFound").'
'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/bilan.php b/htdocs/compta/bank/bilan.php index 5e5194d55c8..10798bd0145 100644 --- a/htdocs/compta/bank/bilan.php +++ b/htdocs/compta/bank/bilan.php @@ -92,5 +92,6 @@ print "".$langs->trans("BankBalance").""; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index 280cd9bdbc0..963ad63f98f 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -96,5 +96,6 @@ else } print ""; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index db497733863..1e5c253d801 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -1034,5 +1034,6 @@ else } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index be029fcb2f5..41c9ac987f5 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -144,4 +144,6 @@ if ($action != 'edit') print ''; +// End of page llxFooter(); +$db->close(); diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 33e74dc3691..9ff2c25c9b9 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -147,7 +147,6 @@ else { exit; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index b829002a990..f5e09e11e31 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -864,7 +864,6 @@ if ($mode == 'showalltime') print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php index ab43b9374aa..86a67c38973 100644 --- a/htdocs/compta/bank/info.php +++ b/htdocs/compta/bank/info.php @@ -71,5 +71,6 @@ print ''; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 10e549dd094..147ff16a8a1 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -688,6 +688,6 @@ if ($result) } else dol_print_error($db); +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index e52e285742c..3a8a640cad9 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -604,7 +604,6 @@ print ""; print ""; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 1d9d5526700..e8192859090 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -813,7 +813,6 @@ else } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index 765001e75a5..547aa4d4407 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -265,5 +265,6 @@ print '
"; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 0fb8880ce87..2389d1fec77 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -330,5 +330,6 @@ else print $langs->trans("ErrorBankAccountNotFound"); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 1b4d7579892..9c30dfe3cd8 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -499,8 +499,6 @@ if ($id) print "
"; } - - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index cf596860a4b..e11a608c7d0 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -154,6 +154,6 @@ else print $langs->trans("ErrorUnknown"); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/various_payment/index.php b/htdocs/compta/bank/various_payment/index.php index 6535e0c0082..6e4060bbeb1 100644 --- a/htdocs/compta/bank/various_payment/index.php +++ b/htdocs/compta/bank/various_payment/index.php @@ -344,5 +344,6 @@ else } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/various_payment/info.php b/htdocs/compta/bank/various_payment/info.php index bb66871d6c0..c39a6379000 100644 --- a/htdocs/compta/bank/various_payment/info.php +++ b/htdocs/compta/bank/various_payment/info.php @@ -58,6 +58,6 @@ print ''; print ''; +// End of page llxFooter(); - $db->close(); From d67384802859f6b6f15bf8bf2977f9cfa403002b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 30 Jul 2018 17:28:44 +0200 Subject: [PATCH 33/40] standardize --- htdocs/compta/charges/index.php | 3 +-- htdocs/compta/deplacement/card.php | 3 +-- htdocs/compta/deplacement/document.php | 2 +- htdocs/compta/deplacement/index.php | 3 +-- htdocs/compta/deplacement/info.php | 1 + htdocs/compta/deplacement/list.php | 2 +- htdocs/compta/deplacement/stats/index.php | 3 +-- htdocs/compta/facture/admin/facture_cust_extrafields.php | 2 +- htdocs/compta/facture/admin/facture_rec_cust_extrafields.php | 2 +- htdocs/compta/facture/admin/facturedet_cust_extrafields.php | 2 +- .../compta/facture/admin/facturedet_rec_cust_extrafields.php | 2 +- htdocs/compta/facture/card.php | 1 + htdocs/compta/facture/contact.php | 2 +- htdocs/compta/facture/document.php | 2 +- htdocs/compta/facture/fiche-rec.php | 2 +- htdocs/compta/facture/info.php | 1 + htdocs/compta/facture/invoicetemplate_list.php | 2 +- htdocs/compta/facture/list.php | 1 + htdocs/compta/facture/note.php | 3 +-- htdocs/compta/facture/prelevement.php | 2 +- htdocs/compta/facture/stats/index.php | 3 +-- 21 files changed, 21 insertions(+), 23 deletions(-) diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 6d369b696b9..50e5285cb14 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -568,7 +568,6 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 05d509e268d..1e8fa358929 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -577,7 +577,6 @@ else if ($id) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index 59d92140c86..c2b3595b476 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -129,6 +129,6 @@ else print $langs->trans("ErrorUnknown"); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index a390023e280..98c939965a3 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -204,7 +204,6 @@ else dol_print_error($db); print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/deplacement/info.php b/htdocs/compta/deplacement/info.php index 6a62484323f..f63b1765efb 100644 --- a/htdocs/compta/deplacement/info.php +++ b/htdocs/compta/deplacement/info.php @@ -59,5 +59,6 @@ if ($id) print ''; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index bdbdad0a712..20d300d9da4 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -212,6 +212,6 @@ else dol_print_error($db); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index cf652948a6e..193e2c7e9a9 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -312,7 +312,6 @@ print '
'; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php index 4e44774e0c4..1fe26e82a54 100644 --- a/htdocs/compta/facture/admin/facture_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php @@ -114,6 +114,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php index 54d3da8e18a..23c0d79a33c 100644 --- a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php @@ -115,6 +115,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php index c2490da4f42..0947f788719 100644 --- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php @@ -113,6 +113,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php index 28c70ea9024..46d9ed28335 100644 --- a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php @@ -113,6 +113,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0688d8488ed..5389b567b2e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4886,5 +4886,6 @@ else if ($id > 0 || ! empty($ref)) include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index af872a174ca..ab96700fc53 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -215,6 +215,6 @@ if ($id > 0 || ! empty($ref)) } } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 828c77f1178..045762de74c 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -191,6 +191,6 @@ else print $langs->trans("ErrorUnknown"); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 6719e7091c8..20e09e07eb4 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1734,6 +1734,6 @@ else } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 8964b85203b..ff597ee7071 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -122,5 +122,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 13db00a02c2..0cfb0347a2d 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -709,6 +709,6 @@ else dol_print_error($db); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 75dce3c01a3..7d989e4b63e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1245,5 +1245,6 @@ else dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 58fc26030b7..c46d3ed690e 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -142,7 +142,6 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index ecde973bd3b..d7766268989 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -696,6 +696,6 @@ if ($object->id > 0) print ''; } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 0416e04f7b0..04603076b07 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -347,7 +347,6 @@ print '
'; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); From b0e2e69ed0d67569d5aa325ddeff842b2ae5e33a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 31 Jul 2018 07:45:03 +0200 Subject: [PATCH 34/40] New : Add project on salaries --- htdocs/compta/salaries/card.php | 79 ++++++++++++++++--- .../salaries/class/paymentsalary.class.php | 66 +++++++++------- htdocs/core/modules/modSalaries.class.php | 14 ++-- .../install/mysql/migration/8.0.0-9.0.0.sql | 40 ++++++++++ .../mysql/tables/llx_payment_salary.sql | 3 +- htdocs/langs/en_US/projects.lang | 1 + htdocs/langs/en_US/salaries.lang | 1 + htdocs/projet/element.php | 42 ++++++++-- 8 files changed, 191 insertions(+), 55 deletions(-) create mode 100644 htdocs/install/mysql/migration/8.0.0-9.0.0.sql diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index 45fee127642..30b4164e81b 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2011-2018 Alexandre Spangaro * Copyright (C) 2014 Laurent Destailleur * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Charlie BENKE @@ -29,12 +29,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; +if (! empty($conf->projet->enabled)) +{ + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} // Load translation files required by the page $langs->loadLangs(array("compta","banks","bills","users","salaries","hrm")); +if (! empty($conf->projet->enabled)) $langs->load("projects"); $id=GETPOST("id",'int'); $action=GETPOST('action','aZ09'); +$cancel= GETPOST('cancel', 'aZ09'); +$projectid = (GETPOST('projectid','int') ? GETPOST('projectid', 'int') : GETPOST('fk_project','int')); // Security check $socid = GETPOST("socid","int"); @@ -52,20 +60,27 @@ $hookmanager->initHooks(array('salarycard','globalcard')); * Actions */ -if ($_POST["cancel"] == $langs->trans("Cancel")) +if ($cancel) { header("Location: index.php"); exit; } -if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) +// Link to a project +if ($action == 'classin' && $user->rights->banque->modifier) +{ + $object->fetch($id); + $object->setProject(GETPOST('projectid')); +} + +if ($action == 'add' && empty($cancel)) { $error=0; - $datep=dol_mktime(12,0,0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]); - $datev=dol_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]); - $datesp=dol_mktime(12,0,0, $_POST["datespmonth"], $_POST["datespday"], $_POST["datespyear"]); - $dateep=dol_mktime(12,0,0, $_POST["dateepmonth"], $_POST["dateepday"], $_POST["dateepyear"]); + $datep=dol_mktime(12,0,0, GETPOST("datepmonth",'int'), GETPOST("datepday",'int'), GETPOST("datepyear",'int')); + $datev=dol_mktime(12,0,0, GETPOST("datevmonth",'int'), GETPOST("datevday",'int'), GETPOST("datevyear",'int')); + $datesp=dol_mktime(12,0,0, GETPOST("datespmonth",'int'), GETPOST("datespday",'int'), GETPOST("datespyear",'int')); + $dateep=dol_mktime(12,0,0, GETPOST("dateepmonth",'int'), GETPOST("dateepday",'int'), GETPOST("dateepyear",'int')); if (empty($datev)) $datev=$datep; $type_payment = dol_getIdFromCode($db, GETPOST("paymenttype", 'alpha'), 'c_paiement', 'code', 'id', 1); @@ -82,6 +97,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) $object->type_payment=($type_payment > 0 ? $type_payment : 0); $object->num_payment=GETPOST("num_payment"); $object->fk_user_author=$user->id; + $object->fk_project= GETPOST('fk_project','int'); // Set user current salary as ref salaray for the payment $fuser=new User($db); @@ -187,6 +203,7 @@ if ($action == 'delete') llxHeader("",$langs->trans("SalaryPayment")); $form = new Form($db); +if (! empty($conf->projet->enabled)) $formproject = new FormProjets($db); if ($id) { @@ -278,6 +295,18 @@ if ($action == 'create') print ''; print ''; + // Project + if (! empty($conf->projet->enabled)) + { + $formproject=new FormProjets($db); + + print ''.$langs->trans("Project").''; + + $numproject=$formproject->select_projects(-1, $projectid,'fk_project',0,0,1,1); + + print ''; + } + // Bank if (! empty($conf->banque->enabled)) { @@ -335,14 +364,46 @@ if ($id) dol_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'payment'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; + // Employee $userstatic=new User($db); $userstatic->fetch($object->fk_user); - $morehtmlref.=$langs->trans('Employee') . ' : ' . $userstatic->getNomUrl(1); + + // Project + if (! empty($conf->projet->enabled)) + { + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($user->rights->salaries->write) + { + if ($action != 'classify') + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } + } $morehtmlref.='
'; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', ''); diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 3a3f34b85b4..2e656907aa7 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2014 Juanjo Menent +/* Copyright (C) 2011-2018 Alexandre Spangaro + * Copyright (C) 2014 Juanjo Menent * * 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,9 +17,9 @@ */ /** - * \file htdocs/compta/salaries/class/paymentsalary.class.php - * \ingroup salaries - * \brief Class for salaries module payment + * \file htdocs/compta/salaries/class/paymentsalary.class.php + * \ingroup salaries + * \brief Class for salaries module payment */ // Put here all includes required by your class file @@ -40,6 +40,7 @@ class PaymentSalary extends CommonObject public $datep; public $datev; public $amount; + public $fk_project; public $type_payment; public $num_payment; public $label; @@ -102,6 +103,7 @@ class PaymentSalary extends CommonObject $sql.= " datep='".$this->db->idate($this->datep)."',"; $sql.= " datev='".$this->db->idate($this->datev)."',"; $sql.= " amount=".price2num($this->amount).","; + $sql.= " fk_projet='".$this->db->escape($this->fk_project)."',"; $sql.= " fk_typepayment=".$this->fk_typepayment."',"; $sql.= " num_payment='".$this->db->escape($this->num_payment)."',"; $sql.= " label='".$this->db->escape($this->label)."',"; @@ -161,6 +163,7 @@ class PaymentSalary extends CommonObject $sql.= " s.datep,"; $sql.= " s.datev,"; $sql.= " s.amount,"; + $sql.= " s.fk_projet as fk_project,"; $sql.= " s.fk_typepayment,"; $sql.= " s.num_payment,"; $sql.= " s.label,"; @@ -186,25 +189,26 @@ class PaymentSalary extends CommonObject { $obj = $this->db->fetch_object($resql); - $this->id = $obj->rowid; - $this->ref = $obj->rowid; - $this->tms = $this->db->jdate($obj->tms); - $this->fk_user = $obj->fk_user; - $this->datep = $this->db->jdate($obj->datep); - $this->datev = $this->db->jdate($obj->datev); - $this->amount = $obj->amount; - $this->type_payement = $obj->fk_typepayment; - $this->num_payment = $obj->num_payment; - $this->label = $obj->label; - $this->datesp = $this->db->jdate($obj->datesp); - $this->dateep = $this->db->jdate($obj->dateep); - $this->note = $obj->note; - $this->fk_bank = $obj->fk_bank; - $this->fk_user_author = $obj->fk_user_author; - $this->fk_user_modif = $obj->fk_user_modif; - $this->fk_account = $obj->fk_account; - $this->fk_type = $obj->fk_type; - $this->rappro = $obj->rappro; + $this->id = $obj->rowid; + $this->ref = $obj->rowid; + $this->tms = $this->db->jdate($obj->tms); + $this->fk_user = $obj->fk_user; + $this->datep = $this->db->jdate($obj->datep); + $this->datev = $this->db->jdate($obj->datev); + $this->amount = $obj->amount; + $this->fk_project = $obj->fk_project; + $this->type_payement = $obj->fk_typepayment; + $this->num_payment = $obj->num_payment; + $this->label = $obj->label; + $this->datesp = $this->db->jdate($obj->datesp); + $this->dateep = $this->db->jdate($obj->dateep); + $this->note = $obj->note; + $this->fk_bank = $obj->fk_bank; + $this->fk_user_author = $obj->fk_user_author; + $this->fk_user_modif = $obj->fk_user_modif; + $this->fk_account = $obj->fk_account; + $this->fk_type = $obj->fk_type; + $this->rappro = $obj->rappro; } $this->db->free($resql); @@ -276,12 +280,12 @@ class PaymentSalary extends CommonObject $this->fk_user_modif=''; } - /** - * Create in database - * - * @param User $user User that create - * @return int <0 if KO, >0 if OK - */ + /** + * Create in database + * + * @param User $user User that create + * @return int <0 if KO, >0 if OK + */ function create($user) { global $conf,$langs; @@ -331,6 +335,7 @@ class PaymentSalary extends CommonObject $sql.= ", datep"; $sql.= ", datev"; $sql.= ", amount"; + $sql.= ", fk_projet"; $sql.= ", salary"; $sql.= ", fk_typepayment"; $sql.= ", num_payment"; @@ -348,6 +353,7 @@ class PaymentSalary extends CommonObject $sql.= ", '".$this->db->idate($this->datep)."'"; $sql.= ", '".$this->db->idate($this->datev)."'"; $sql.= ", ".$this->amount; + $sql.= ", ".($this->fk_project > 0? $this->fk_project : 0); $sql.= ", ".($this->salary > 0 ? $this->salary : "null"); $sql.= ", ".$this->db->escape($this->type_payment); $sql.= ", '".$this->db->escape($this->num_payment)."'"; diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index e3d418d182e..eba3f1210eb 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2014 Alexandre Spangaro + * Copyright (C) 2014 Alexandre Spangaro * * 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,11 +23,11 @@ */ /** - * \defgroup salaries Module salaries - * \brief Module to include salaries management - * \file htdocs/core/modules/modSalaries.class.php - * \ingroup salaries - * \brief File to activate module salaries + * \defgroup salaries Module salaries + * \brief Module to include salaries management + * \file htdocs/core/modules/modSalaries.class.php + * \ingroup salaries + * \brief File to activate module salaries */ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; @@ -182,7 +182,7 @@ class modSalaries extends DolibarrModules * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * It also creates data directories * - * @param string $options Options when enabling module ('', 'noboxes') + * @param string $options Options when enabling module ('', 'noboxes') * @return int 1 if OK, 0 if KO */ function init($options='') diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql new file mode 100644 index 00000000000..3208d78d694 --- /dev/null +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -0,0 +1,40 @@ +-- +-- Be carefull to requests order. +-- This file must be loaded by calling /install/index.php page +-- when current version is 9.0.0 or higher. +-- +-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y +-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; +-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); +-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; +-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); +-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; +-- To create a unique index ALTER TABLE llx_table ADD UNIQUE INDEX uk_table_field (field); +-- To drop an index: -- VMYSQL4.1 DROP INDEX nomindex on llx_table +-- To drop an index: -- VPGSQL8.2 DROP INDEX nomindex +-- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_table CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +-- To make pk to be auto increment (postgres): +-- -- VPGSQL8.2 CREATE SEQUENCE llx_table_rowid_seq OWNED BY llx_table.rowid; +-- -- VPGSQL8.2 ALTER TABLE llx_table ADD PRIMARY KEY (rowid); +-- -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN rowid SET DEFAULT nextval('llx_table_rowid_seq'); +-- -- VPGSQL8.2 SELECT setval('llx_table_rowid_seq', MAX(rowid)) FROM llx_table; +-- To set a field as NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NULL; +-- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL; +-- To set a field as NOT NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NOT NULL; +-- To set a field as NOT NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET NOT NULL; +-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; +-- Note: fields with type BLOB/TEXT can't have default value. + + +-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); +-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); + + + +-- Forgot in 8.0.0 + + +-- For 9.0.0 +ALTER TABLE llx_payment_salary ADD COLUMN fk_projet integer DEFAULT NULL after amount; diff --git a/htdocs/install/mysql/tables/llx_payment_salary.sql b/htdocs/install/mysql/tables/llx_payment_salary.sql index e3bcd0a9c4a..4fcbc233f33 100644 --- a/htdocs/install/mysql/tables/llx_payment_salary.sql +++ b/htdocs/install/mysql/tables/llx_payment_salary.sql @@ -26,11 +26,12 @@ create table llx_payment_salary datev date, -- value date (this field should not be here, only into bank tables) salary double(24,8), -- salary of user when payment was done amount double(24,8) NOT NULL DEFAULT 0, + fk_projet integer DEFAULT NULL, fk_typepayment integer NOT NULL, num_payment varchar(50), -- ref label varchar(255), datesp date, -- date start period - dateep date, -- date end period + dateep date, -- date end period entity integer DEFAULT 1 NOT NULL, -- multi company id note text, fk_bank integer, diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 6dfb11e2284..563748b04c9 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -91,6 +91,7 @@ ListFichinterAssociatedProject=List of interventions associated with the project ListExpenseReportsAssociatedProject=List of expense reports associated with the project ListDonationsAssociatedProject=List of donations associated with the project ListVariousPaymentsAssociatedProject=List of miscellaneous payments associated with the project +ListSalariesAssociatedProject=List of salaries associated with the project ListActionsAssociatedProject=List of events associated with the project ListTaskTimeUserProject=List of time consumed on tasks of project ListTaskTimeForTask=List of time consumed on task diff --git a/htdocs/langs/en_US/salaries.lang b/htdocs/langs/en_US/salaries.lang index 432ab894040..ba3a4dfeb70 100644 --- a/htdocs/langs/en_US/salaries.lang +++ b/htdocs/langs/en_US/salaries.lang @@ -5,6 +5,7 @@ SALARIES_ACCOUNTING_ACCOUNT_CHARGE=Accounting account by default for wage paymen Salary=Salary Salaries=Salaries NewSalaryPayment=New salary payment +AddSalaryPayment=Add salary payment SalaryPayment=Salary payment SalariesPayments=Salaries payments ShowSalaryPayment=Show salary payment diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 5070c0a58d4..842527f4bbd 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2012-2016 Juanjo Menent - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2018 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Josep Lluís Amador * @@ -43,7 +43,7 @@ if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; -if (! empty($conf->expedition->enabled)) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; +if (! empty($conf->expedition->enabled)) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; if (! empty($conf->deplacement->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; if (! empty($conf->expensereport->enabled)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; @@ -52,17 +52,19 @@ if (! empty($conf->loan->enabled)) require_once DOL_DOCUMENT_ROOT.'/loan/class if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; +if (! empty($conf->salaries->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; // Load translation files required by the page $langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta')); -if (! empty($conf->facture->enabled)) $langs->load("bills"); -if (! empty($conf->commande->enabled)) $langs->load("orders"); -if (! empty($conf->propal->enabled)) $langs->load("propal"); +if (! empty($conf->facture->enabled)) $langs->load("bills"); +if (! empty($conf->commande->enabled)) $langs->load("orders"); +if (! empty($conf->propal->enabled)) $langs->load("propal"); if (! empty($conf->ficheinter->enabled)) $langs->load("interventions"); if (! empty($conf->deplacement->enabled)) $langs->load("trips"); if (! empty($conf->expensereport->enabled)) $langs->load("trips"); if (! empty($conf->don->enabled)) $langs->load("donations"); if (! empty($conf->loan->enabled)) $langs->load("loan"); +if (! empty($conf->salaries->enabled)) $langs->load("salaries"); $id=GETPOST('id','int'); $ref=GETPOST('ref','alpha'); @@ -438,6 +440,19 @@ $listofreferent=array( 'datefieldname'=>'datem', 'disableamount'=>0, 'test'=>($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))), +'salaries'=>array( + 'name'=>"Salaries", + 'title'=>"ListSalariesAssociatedProject", + 'class'=>'PaymentSalary', + 'table'=>'payment_salary', + 'datefieldname'=>'datev', + 'margin'=>'minus', + 'disableamount'=>0, + 'urlnew'=>DOL_URL_ROOT.'/compta/salaries/card.php?action=create&projectid='.$id, + 'lang'=>'salaries', + 'buttonnew'=>'AddSalariesPayment', + 'testnew'=>$user->rights->salaries->write, + 'test'=>$conf->salaries->enabled && $user->rights->salaries->read), 'variouspayment'=>array( 'name'=>"VariousPayments", 'title'=>"ListVariousPaymentsAssociatedProject", @@ -768,7 +783,7 @@ foreach ($listofreferent as $key => $value) print ''; if (in_array($tablename, array('projet_task')) && $key == 'project_task') print ''; // if $key == 'project_task', we don't want details per user elseif (in_array($tablename, array('payment_various'))) print ''; // if $key == 'payment_various', we don't have any thirdparty - elseif (in_array($tablename, array('expensereport_det','don','projet_task','stock_mouvement'))) print $langs->trans("User"); + elseif (in_array($tablename, array('expensereport_det','don','projet_task','stock_mouvement','payment_salary'))) print $langs->trans("User"); else print $langs->trans("ThirdParty"); print ''; // Amount HT @@ -864,6 +879,10 @@ foreach ($listofreferent as $key => $value) { print $expensereport->getNomUrl(1); } + if ($tablename == 'payment_salary') + { + print ''; + } else { // Show ref with link @@ -901,6 +920,7 @@ foreach ($listofreferent as $key => $value) $date=''; $total_time_by_line = null; if ($tablename == 'expensereport_det') $date = $element->date; // No draft status on lines elseif ($tablename == 'stock_mouvement') $date = $element->datem; + elseif ($tablename == 'payment_salary') $date = $element->datev; elseif ($tablename == 'payment_various') $date = $element->datev; elseif ($tablename == 'chargesociales') $date = $element->date_ech; elseif (! empty($element->status) || ! empty($element->statut) || ! empty($element->fk_status)) @@ -946,6 +966,12 @@ foreach ($listofreferent as $key => $value) $tmpuser->fetch($expensereport->fk_user_author); print $tmpuser->getNomUrl(1,'',48); } + else if ($tablename == 'payment_salary') + { + $tmpuser=new User($db); + $tmpuser->fetch($salaries->fk_user); + print $tmpuser->getNomUrl(1,'',48); + } else if ($tablename == 'don' || $tablename == 'stock_mouvement') { if ($element->fk_user_author > 0) @@ -967,7 +993,7 @@ foreach ($listofreferent as $key => $value) { $total_ht_by_line=null; $othermessage=''; - if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various') $total_ht_by_line=$element->amount; + if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') $total_ht_by_line=$element->amount; else if($tablename == 'fichinter') $total_ht_by_line=$element->getAmount(); elseif ($tablename == 'stock_mouvement') $total_ht_by_line=$element->price*abs($element->qty); elseif (in_array($tablename, array('projet_task'))) @@ -1008,7 +1034,7 @@ foreach ($listofreferent as $key => $value) if (empty($value['disableamount'])) { $total_ttc_by_line=null; - if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various') $total_ttc_by_line=$element->amount; + if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') $total_ttc_by_line=$element->amount; else if($tablename == 'fichinter') $total_ttc_by_line=$element->getAmount(); elseif ($tablename == 'stock_mouvement') $total_ttc_by_line=$element->price*abs($element->qty); elseif ($tablename == 'projet_task') From 37a4a0c4888fd6cef0be2c88e4845faeb1c4193e Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 31 Jul 2018 10:02:36 +0200 Subject: [PATCH 35/40] fix for travis --- htdocs/core/class/html.formprojet.class.php | 1 + htdocs/projet/class/project.class.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 25e2cb13d81..2e3bdafc319 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -456,6 +456,7 @@ class FormProjets * @param string $socid If of thirdparty to use as filter or 'id1,id2,...' * @param string $morecss More CSS * @param int $limitonstatus Add filters to limit length of list to opened status (for example to avoid ERR_RESPONSE_HEADERS_TOO_BIG on project/element.php page). TODO To implement + * @param string $projectkey Equivalent key to fk_projet for actual table_element * @return int|string The HTML select list of element or '' if nothing or -1 if KO */ function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2,$projectkey="fk_projet") diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 1078733c19e..c8c36a697fb 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -516,9 +516,10 @@ class Project extends CommonObject * @param string $datefieldname name of date field for filter * @param int $dates Start date * @param int $datee End date + * @param string $projectkey Equivalent key to fk_projet for actual type * @return mixed Array list of object ids linked to project, < 0 or string if error */ - function get_element_list($type, $tablename, $datefieldname='', $dates='', $datee='', $project_field='fk_projet') + function get_element_list($type, $tablename, $datefieldname='', $dates='', $datee='', $projectkey='fk_projet') { $elements = array(); @@ -548,7 +549,7 @@ class Project extends CommonObject } else { - $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE ".$project_field." IN (". $ids .")"; + $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE ".$projectkey." IN (". $ids .")"; } if ($dates > 0) From ee61a8854082bf8ab8b8109372636d9178a35cb2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 1 Aug 2018 07:46:17 +0200 Subject: [PATCH 36/40] Small fix --- htdocs/compta/salaries/class/paymentsalary.class.php | 6 ++---- htdocs/projet/element.php | 8 ++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 2e656907aa7..31c616ac00d 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -508,13 +508,11 @@ class PaymentSalary extends CommonObject global $langs; $result=''; - $label=$langs->trans("ShowSalaryPayment").': '.$this->ref; + $label=$langs->trans("ShowSalaryPayment").': '.$this->ref; - $linkstart = ''; + $linkstart = ''; $linkend=''; - $picto='payment'; - $result .= $linkstart; if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); if ($withpicto != 2) $result.= $this->ref; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 842527f4bbd..7a263ba3995 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -879,13 +879,9 @@ foreach ($listofreferent as $key => $value) { print $expensereport->getNomUrl(1); } - if ($tablename == 'payment_salary') - { - print ''; - } else { - // Show ref with link + // Show ref with link if ($element instanceof Task) { print $element->getNomUrl(1,'withproject','time'); @@ -969,7 +965,7 @@ foreach ($listofreferent as $key => $value) else if ($tablename == 'payment_salary') { $tmpuser=new User($db); - $tmpuser->fetch($salaries->fk_user); + $tmpuser->fetch($element->fk_user); print $tmpuser->getNomUrl(1,'',48); } else if ($tablename == 'don' || $tablename == 'stock_mouvement') From d50a95c89b49e8491bf744a3331df46f0bf3296f Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 1 Aug 2018 11:40:12 +0200 Subject: [PATCH 37/40] update to straipe cf https://stripe.com/docs/building-plugins#setappinfo --- htdocs/stripe/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index c61de994874..2e7447a6e5f 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -54,4 +54,4 @@ else } \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); -\Stripe\Stripe::setAppInfo("Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version +\Stripe\Stripe::setAppInfo("Dolibarr Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version From 40b19b8e1d3ee0ccaa9cc8a7fe36459678be017f Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 1 Aug 2018 11:50:43 +0200 Subject: [PATCH 38/40] update to Stripe Requirements and Best Practices cf https://stripe.com/docs/partners/requirements --- htdocs/stripe/config.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index 2e7447a6e5f..7aa22678d7a 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -55,3 +55,4 @@ else \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); \Stripe\Stripe::setAppInfo("Dolibarr Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version +\Stripe\Stripe::setApiVersion("2018-07-27"); // force version API From ccabd2b859058a6838126915afb233bd71403bf9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 2 Aug 2018 14:03:50 +0200 Subject: [PATCH 39/40] Uniformize --- htdocs/expedition/card.php | 3 +-- htdocs/expedition/contact.php | 2 +- htdocs/expedition/document.php | 3 +-- htdocs/expedition/index.php | 2 +- htdocs/expedition/list.php | 1 + htdocs/expedition/note.php | 3 +-- htdocs/expedition/shipment.php | 3 +-- htdocs/expedition/stats/index.php | 2 +- htdocs/expedition/stats/month.php | 2 +- htdocs/expensereport/card.php | 5 +++-- htdocs/expensereport/document.php | 2 +- htdocs/expensereport/export_csv.php | 2 +- htdocs/expensereport/index.php | 2 +- htdocs/expensereport/info.php | 2 +- htdocs/expensereport/list.php | 3 +-- htdocs/expensereport/note.php | 2 +- htdocs/expensereport/payment/card.php | 2 +- htdocs/expensereport/payment/info.php | 1 + htdocs/expensereport/payment/payment.php | 1 + htdocs/expensereport/stats/index.php | 3 +-- htdocs/exports/index.php | 3 +-- 21 files changed, 23 insertions(+), 26 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 93b3f3a5f4d..d56134b7726 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2594,7 +2594,6 @@ else if ($id || $ref) include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 3f557059600..acc2b5e1142 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -268,6 +268,6 @@ if ($id > 0 || ! empty($ref)) } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index 4f9616df5ed..5d76a5f4918 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -185,7 +185,6 @@ else{ exit; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 042d107b58e..8dde7bf0125 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -291,6 +291,6 @@ else dol_print_error($db); print ''; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 14f9eb41f44..327a9394b77 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -632,5 +632,6 @@ else dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index fafaf10fe1f..f276b2d0cb4 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -152,7 +152,6 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index cb058e44598..0d3111d9f12 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -926,7 +926,6 @@ if ($id > 0 || ! empty($ref)) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index 651be627b78..a167a447d7d 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -358,6 +358,6 @@ print ''; print '
'; print ''.$langs->trans("StatsOnShipmentsOnlyValidated").''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expedition/stats/month.php b/htdocs/expedition/stats/month.php index b7d217217c2..27b01cc6f55 100644 --- a/htdocs/expedition/stats/month.php +++ b/htdocs/expedition/stats/month.php @@ -71,6 +71,6 @@ print $px->show(); print ''; print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 141260d36f3..75285bf35cf 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1450,8 +1450,9 @@ else print $langs->trans('NotUserRightToView'); print ''; - llxFooter(); - $db->close(); + // End of page + llxFooter(); + $db->close(); exit; } diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index f0d61d0f80d..0ac498ca775 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -139,6 +139,6 @@ else print $langs->trans("ErrorUnknown"); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expensereport/export_csv.php b/htdocs/expensereport/export_csv.php index 4bc461b4d13..8ea72191b1d 100644 --- a/htdocs/expensereport/export_csv.php +++ b/htdocs/expensereport/export_csv.php @@ -195,6 +195,6 @@ if (isset($_POST['action'])) print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index 0d988e4850d..758dd89afe2 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -231,6 +231,6 @@ else dol_print_error($db); print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expensereport/info.php b/htdocs/expensereport/info.php index 6babfcd647c..67f70f3a984 100644 --- a/htdocs/expensereport/info.php +++ b/htdocs/expensereport/info.php @@ -79,6 +79,6 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index d3e5bc6fabd..d328cd21de2 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -861,7 +861,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expensereport/note.php b/htdocs/expensereport/note.php index baa0c174fc1..deb38abe8d6 100644 --- a/htdocs/expensereport/note.php +++ b/htdocs/expensereport/note.php @@ -97,6 +97,6 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index 2876d512c52..2c053d5cc35 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -310,6 +310,6 @@ if ($action == '') print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expensereport/payment/info.php b/htdocs/expensereport/payment/info.php index 97098ef2340..6c7f8dd99c6 100644 --- a/htdocs/expensereport/payment/info.php +++ b/htdocs/expensereport/payment/info.php @@ -77,5 +77,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php index 23959c06e67..dc78b933055 100644 --- a/htdocs/expensereport/payment/payment.php +++ b/htdocs/expensereport/payment/payment.php @@ -336,5 +336,6 @@ if ($action == 'create' || empty($action)) print "\n"; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index b4f0327cd39..b97129a5779 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -305,7 +305,6 @@ print '
'; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index bccf25f1be8..81027882b6b 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -145,7 +145,6 @@ print ''; //print ''; - +// End of page llxFooter(); - $db->close(); From 0e3473701a0d5a0294c542a179277300fb656c13 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 2 Aug 2018 18:38:33 +0200 Subject: [PATCH 40/40] Update bank.lib.php --- htdocs/core/lib/bank.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index e361d8fa9f6..28584b60e32 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -356,9 +356,9 @@ function checkES($IentOfi, $InumCta) $sum = 0; for ($i = 0; $i < 11; $i++) { - $sum += $values[$i] * (int)substr($InumCta, $i, 1);//int to cast result of substr to a number + $sum += $values[$i] * (int) substr($InumCta, $i, 1);//int to cast result of substr to a number } - + $key = 11 - $sum % 11; if ($key == 10)