From 89dd74c1151ffa963d0f1cfcafb7f8ea3b28d77f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Dec 2019 22:05:09 +0100 Subject: [PATCH 01/63] Fix clean old files --- htdocs/install/upgrade2.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index c932b2631e8..b7b82048e0b 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4463,13 +4463,15 @@ function migrate_delete_old_files($db, $langs, $conf) '/core/modules/facture/pdf_crabe.modules.php', '/core/modules/facture/pdf_oursin.modules.php', - '/compta/facture/class/api_invoice.class.php', + '/categories/class/api_category.class.php', + '/categories/class/api_deprecated_category.class.php', + '/compta/facture/class/api_invoice.class.php', '/commande/class/api_commande.class.php', '/user/class/api_user.class.php', '/product/class/api_product.class.php', '/societe/class/api_contact.class.php', '/societe/class/api_thirdparty.class.php', - '/support/online.php', + '/support/online.php', '/takepos/class/actions_takepos.class.php' ); From 18464de297ca61caf3d8f1123c1ef82712ee985c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Dec 2019 22:08:32 +0100 Subject: [PATCH 02/63] Clean old file --- htdocs/install/upgrade2.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index b7b82048e0b..60064ff33c2 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4463,6 +4463,7 @@ function migrate_delete_old_files($db, $langs, $conf) '/core/modules/facture/pdf_crabe.modules.php', '/core/modules/facture/pdf_oursin.modules.php', + '/api/class/api_generic.class.php', '/categories/class/api_category.class.php', '/categories/class/api_deprecated_category.class.php', '/compta/facture/class/api_invoice.class.php', From 139419c3e85928e3b7ecc6775f10f7369b8216df Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Thu, 5 Dec 2019 10:38:03 +0100 Subject: [PATCH 03/63] FIX 10.0: do not display single-letter values (indicating duration unit without value) in product list (this fix exists in develop) --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index cfa330196d9..f3a190e329b 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -900,7 +900,7 @@ if ($resql) print $duration_value; print (! empty($duration_unit) && isset($dur[$duration_unit]) ? ' '.$langs->trans($dur[$duration_unit]) : ''); } - else + elseif (! preg_match('/^[a-z]$/i', $obj->duration)) // If duration is a simple char (like 's' of 'm'), we do not show value { print $obj->duration; } From 3f6715a377e5a6f094421140df6feb9b7efe7032 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Thu, 5 Dec 2019 15:22:06 +0100 Subject: [PATCH 04/63] FIX: add URL param "restore_last_search_values=1" to all backlinks that point to a list --- htdocs/adherents/document.php | 2 +- htdocs/adherents/subscription/info.php | 2 +- htdocs/bookmarks/card.php | 2 +- htdocs/comm/card.php | 2 +- htdocs/comm/mailing/card.php | 2 +- htdocs/comm/mailing/cibles.php | 2 +- htdocs/comm/mailing/info.php | 2 +- htdocs/compta/paiement/card.php | 2 +- htdocs/compta/paiement/info.php | 2 +- htdocs/livraison/card.php | 2 +- htdocs/loan/card.php | 2 +- htdocs/loan/document.php | 2 +- htdocs/loan/info.php | 2 +- htdocs/loan/note.php | 2 +- htdocs/loan/schedule.php | 2 +- htdocs/product/stock/card.php | 2 +- htdocs/product/stock/info.php | 2 +- htdocs/product/stock/movement_card.php | 2 +- htdocs/product/stock/movement_list.php | 2 +- htdocs/reception/contact.php | 2 +- htdocs/reception/note.php | 2 +- htdocs/societe/paymentmodes.php | 8 ++++---- htdocs/societe/price.php | 2 +- htdocs/ticket/card.php | 4 ++-- htdocs/user/bank.php | 2 +- htdocs/user/param_ihm.php | 2 +- 26 files changed, 30 insertions(+), 30 deletions(-) diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 72a1bd0d569..310bc275a9a 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -115,7 +115,7 @@ if ($id > 0) print '
'; print ''; - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) diff --git a/htdocs/adherents/subscription/info.php b/htdocs/adherents/subscription/info.php index 37a719e52bc..56043d3f8a3 100644 --- a/htdocs/adherents/subscription/info.php +++ b/htdocs/adherents/subscription/info.php @@ -53,7 +53,7 @@ $head = subscription_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("Subscription"), -1, 'payment'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'rowid', $linkback, 1); diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 40558895fe2..1fa904a7781 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -223,7 +223,7 @@ if ($id > 0 && ! preg_match('/^add/i', $action)) dol_fiche_head($head, $hselected, $langs->trans("Bookmark"), -1, 'bookmark'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 3d21c987c69..9130efabeeb 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -238,7 +238,7 @@ if ($object->id > 0) dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"), -1, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 88dfcef7d7f..f0e179c1318 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1174,7 +1174,7 @@ else dol_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlright=''; if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 532e792bd6e..06a6dfccc55 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -176,7 +176,7 @@ if ($object->fetch($id) >= 0) dol_fiche_head($head, 'targets', $langs->trans("Mailing"), -1, 'email'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlright=''; $nbtry = $nbok = 0; diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index 5097b310363..ba606520c18 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -54,7 +54,7 @@ if ($object->fetch($id) >= 0) dol_fiche_head($head, 'info', $langs->trans("Mailing"), -1, 'email'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlright=''; if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 4c0effee111..848cc20d483 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -204,7 +204,7 @@ if ($action == 'valide') print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide', '', 0, 2); } -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', ''); diff --git a/htdocs/compta/paiement/info.php b/htdocs/compta/paiement/info.php index 7cf4c7fede0..18be92e4582 100644 --- a/htdocs/compta/paiement/info.php +++ b/htdocs/compta/paiement/info.php @@ -58,7 +58,7 @@ $head = payment_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("PaymentCustomerInvoice"), -1, 'payment'); -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', ''); diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index cb3aa136c2c..b3e654c8104 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -440,7 +440,7 @@ else /* if (($object->origin == 'shipment' || $object->origin == 'expedition') && $object->origin_id > 0) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; // Ref print ''; diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index a4e6cd57870..73d7a7eeaf0 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -439,7 +439,7 @@ if ($id > 0) // Loan card - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref='
'; // Ref loan diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 7544e1913e8..2dc7566fad7 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -124,7 +124,7 @@ if ($object->id) } $morehtmlref.='
'; - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php index a6f7b12a9de..7027af16636 100644 --- a/htdocs/loan/info.php +++ b/htdocs/loan/info.php @@ -96,7 +96,7 @@ if (! empty($conf->projet->enabled)) { } $morehtmlref.=''; -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index b0ec23316c7..b8a70c19b7e 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -113,7 +113,7 @@ if ($id > 0) } $morehtmlref.=''; - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index d4e7dec9feb..791d16dfa33 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -44,7 +44,7 @@ llxHeader("", $title, $help_url); $head=loan_prepare_head($object); dol_fiche_head($head, 'FinancialCommitment', $langs->trans("Loan"), -1, 'bill'); -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref='
'; // Ref loan diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 1c78d6726d3..879d143b3f7 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -309,7 +309,7 @@ else print $formconfirm; // Warehouse card - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php index c038952f6ba..5ec19cc6e9d 100644 --- a/htdocs/product/stock/info.php +++ b/htdocs/product/stock/info.php @@ -53,7 +53,7 @@ $head = stock_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("Warehouse"), -1, 'stock'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index b75042c7cca..ac9635d525f 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -567,7 +567,7 @@ if ($resql) dol_fiche_head($head, 'movements', $langs->trans("Warehouse"), -1, 'stock'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 836bb97e50c..2c69f7f9005 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -543,7 +543,7 @@ if ($resql) dol_fiche_head($head, 'movements', $langs->trans("Warehouse"), -1, 'stock'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index d51062ef7ef..445d995b488 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -162,7 +162,7 @@ if ($id > 0 || ! empty($ref)) // Reception card - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; // Ref customer reception diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index 740bf6bd522..5af4d12040a 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -103,7 +103,7 @@ if ($id > 0 || ! empty($ref)) // Reception card - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; // Ref customer reception diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 922fea064ec..0276ce9123b 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1451,7 +1451,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); @@ -1555,7 +1555,7 @@ if ($socid && $action == 'editcard' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); @@ -1603,7 +1603,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); @@ -1701,7 +1701,7 @@ if ($socid && $action == 'createcard' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 1476bb8ce75..039c1fe1bd5 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -187,7 +187,7 @@ $head = societe_prepare_head($object); dol_fiche_head($head, 'price', $langs->trans("ThirdParty"), -1, 'company'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 93a6981f8be..a9a8010eb20 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -693,7 +693,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd */ print '
'.$langs->trans("RefSending").'
'; - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; // Ref print ''; print ''; */ -// @TODO Use module notification instead... +// @todo Use module notification instead... // Email de réception des notifications print ''; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index b9d58fc76f1..acbffa109a2 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -98,7 +98,7 @@ class Categorie extends CommonObject /** * @var array Foreign keys mapping from type string * - * @TODO Move to const array when PHP 5.6 will be our minimum target + * @todo Move to const array when PHP 5.6 will be our minimum target */ protected $MAP_CAT_FK = array( 'product' => 'product', diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 69f748412a1..38af9bfd4fd 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1112,7 +1112,7 @@ class ActionComm extends CommonObject /** * Load all objects with filters. - * @TODO WARNING: This make a fetch on all records instead of making one request with a join. + * @todo WARNING: This make a fetch on all records instead of making one request with a join. * * @param DoliDb $db Database handler * @param int $socid Filter by thirdparty diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index ef88c586ede..9f2a69ff6c5 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -248,7 +248,7 @@ if ($action == "create" || $action == "start") $vartouse = 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse; $bankid = $conf->global->$vartouse; // This value is ok for 'Terminal 0' for module 'CashDesk' and 'TakePos' (they manage only 1 terminal) // Hook to get the good bank id according to posmodule and posnumber. - // @TODO add hook here + // @todo add hook here if ($bankid > 0) { diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 851a6450b8b..740a1e47784 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -280,7 +280,7 @@ class RejetPrelevement * * @param int $amounts If you want to get the amount of the order for each invoice * @return array Array List of invoices related to the withdrawal line - * @TODO A withdrawal line is today linked to one and only one invoice. So the function should return only one object ? + * @todo A withdrawal line is today linked to one and only one invoice. So the function should return only one object ? */ private function getListInvoices($amounts = 0) { diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 9af5a559f5e..6e91ef53e2b 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -420,7 +420,7 @@ elseif ($modecompta=="BOOKKEEPING") foreach ($cpts as $i => $cpt) // Loop on each account. { // We make 1 loop for each account because we may want detail per account. - // @TODO Optimize to ask a 'group by' account and a filter with account in (..., ...) in request + // @todo Optimize to ask a 'group by' account and a filter with account in (..., ...) in request // Each month $resultN = 0; diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index ac3e800e6e4..df9ac7d3a7e 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -194,7 +194,7 @@ elseif ($modecompta=="BOOKKEEPING") $sql = "SELECT date_format(b.doc_date,'%Y-%m') as dm, sum(b.credit) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_journal as aj"; $sql.= " WHERE b.entity = ".$conf->entity; - $sql.= " AND b.code_journal = aj.code AND aj.nature = 2" ; // @TODO currently count amount in sale journal, but we need to define a category group for turnover + $sql.= " AND b.code_journal = aj.code AND aj.nature = 2" ; // @todo currently count amount in sale journal, but we need to define a category group for turnover } $sql.= " GROUP BY dm"; diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 35009811fe2..f379cd0c82f 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1280,7 +1280,7 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' } // Generate document foreach object according to model linked to object -// @TODO : propose model selection +// @todo : propose model selection if (!$error && $massaction == 'generate_doc' && $permissiontoread) { $db->begin(); diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index f490397754d..3f13eec2b34 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -431,7 +431,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $object->socid = $sendtosocid; // To link to a company $object->sendtoid = $sendtoid; // To link to contact addresses. This is an array. $object->actiontypecode = $actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) - $object->actionmsg = $actionmsg; // Long text (@TODO Replace this with $message, we already have details of email in dedicated properties) + $object->actionmsg = $actionmsg; // Long text (@todo Replace this with $message, we already have details of email in dedicated properties) $object->actionmsg2 = $actionmsg2; // Short text ($langs->transnoentities('MailSentBy')...); $object->trackid = $trackid; @@ -444,7 +444,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $object->sendtouserid = $sendtouserid; } - $object->email_msgid = $mailfile->msgid; // @TODO Set msgid into $mailfile after sending + $object->email_msgid = $mailfile->msgid; // @todo Set msgid into $mailfile after sending $object->email_from = $from; $object->email_subject = $subject; $object->email_to = $sendto; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 544063bc4c8..25588323103 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2598,7 +2598,7 @@ abstract class CommonObject */ public function updateRangOfLine($rowid, $rang) { - $fieldposition = 'rang'; // @TODO Rename 'rang' into 'position' + $fieldposition = 'rang'; // @todo Rename 'rang' into 'position' if (in_array($this->table_element_line, array('bom_bomline', 'ecm_files', 'emailcollector_emailcollectoraction'))) $fieldposition = 'position'; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET '.$fieldposition.' = '.$rang; @@ -4883,7 +4883,7 @@ abstract class CommonObject /** * Build thumb - * @TODO Move this into files.lib.php + * @todo Move this into files.lib.php * * @param string $file Path file in UTF8 to original file to create thumbs from. * @return void @@ -6607,7 +6607,7 @@ abstract class CommonObject // Show only the key field in params if (is_array($params) && array_key_exists('onlykey', $params) && $key != $params['onlykey']) continue; - // @TODO Add test also on 'enabled' (different than 'list' that is 'visibility') + // @todo Add test also on 'enabled' (different than 'list' that is 'visibility') $enabled = 1; $visibility = 1; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 0352700d91a..c78fe06693b 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -971,7 +971,7 @@ class FormFile } // Get list of files starting with name of ref (but not followed by "-" to discard uploaded files and get only generated files) - // @TODO Why not showing by default all files by just removing the '[^\-]+' at end of regex ? + // @todo Why not showing by default all files by just removing the '[^\-]+' at end of regex ? if (!empty($conf->global->MAIN_SHOW_ALL_FILES_ON_DOCUMENT_TOOLTIP)) { $filterforfilesearch = preg_quote(basename($modulesubdir), '/'); diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 12be3854ed6..7a3508c7d2f 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -65,7 +65,7 @@ class Notify // Les codes actions sont definis dans la table llx_notify_def // codes actions supported are - // @TODO defined also into interface_50_modNotificiation_Notificiation.class.php + // @todo defined also into interface_50_modNotificiation_Notificiation.class.php public $arrayofnotifsupported = array( 'BILL_VALIDATE', 'BILL_PAYED', diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index f467040a00d..490727f9521 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -44,7 +44,7 @@ class InterfaceNotification extends DolibarrTriggers */ public $picto = 'email'; - // @TODO Defined also into notify.class.php) + // @todo Defined also into notify.class.php) public $listofmanagedevents=array( 'BILL_VALIDATE', 'BILL_PAYED', diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index ad21603efce..79ea7552237 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2712,8 +2712,8 @@ class ExpenseReportLine if (!empty($this->id)) $sql.= ' AND d.rowid <> '.$this->id; $sql .= ' AND d.fk_c_type_fees = '.$rule->fk_c_type_fees; if ($mode == 'day' || $mode == 'EX_DAY') $sql .= ' AND d.date = \''.dol_print_date($this->date, '%Y-%m-%d').'\''; - elseif ($mode == 'mon' || $mode == 'EX_MON') $sql .= ' AND DATE_FORMAT(d.date, \'%Y-%m\') = \''.dol_print_date($this->date, '%Y-%m').'\''; // @TODO DATE_FORMAT is forbidden - elseif ($mode == 'year' || $mode == 'EX_YEA') $sql .= ' AND DATE_FORMAT(d.date, \'%Y\') = \''.dol_print_date($this->date, '%Y').'\''; // @TODO DATE_FORMAT is forbidden + elseif ($mode == 'mon' || $mode == 'EX_MON') $sql .= ' AND DATE_FORMAT(d.date, \'%Y-%m\') = \''.dol_print_date($this->date, '%Y-%m').'\''; // @todo DATE_FORMAT is forbidden + elseif ($mode == 'year' || $mode == 'EX_YEA') $sql .= ' AND DATE_FORMAT(d.date, \'%Y\') = \''.dol_print_date($this->date, '%Y').'\''; // @todo DATE_FORMAT is forbidden dol_syslog('ExpenseReportLine::getExpAmount'); diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index 4692687220a..7e4abfb5692 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -28,7 +28,7 @@ /** * \file htdocs/stripe/payment.php * \ingroup stripe - * \brief Payment page for customers invoices. @TODO Seems deprecated and bugged and not used (no link to this page) ! + * \brief Payment page for customers invoices. @todo Seems deprecated and bugged and not used (no link to this page) ! */ // Load Dolibarr environment diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index ffb8c15e3c3..7ade356a360 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1971,7 +1971,7 @@ class User extends CommonObject * * @param User $user Object user that send email * @param string $password New password - * @param int $changelater 0=Send clear passwod into email, 1=Change password only after clicking on confirm email. @TODO Add method 2 = Send link to reset password + * @param int $changelater 0=Send clear passwod into email, 1=Change password only after clicking on confirm email. @todo Add method 2 = Send link to reset password * @return int < 0 si erreur, > 0 si ok */ public function send_password($user, $password = '', $changelater = 0) From 1733aa18df996d6a9a7fb70d4c01bfaf3386225d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 11 Dec 2019 19:57:10 +0100 Subject: [PATCH 20/63] fix phpcs --- htdocs/margin/tabs/productMargins.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 3b53cea29d2..f73dab4136d 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -243,7 +243,7 @@ if ($id > 0 || !empty($ref)) print '\n"; print '\n"; if (!empty($conf->global->DISPLAY_MARGIN_RATES)) - print '\n"; + print '\n"; if (!empty($conf->global->DISPLAY_MARK_RATES)) print "\n"; print ''; From b59d93c8d7a12d5be69ab653b408375bb25c2a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 11 Dec 2019 20:11:53 +0100 Subject: [PATCH 21/63] doxygen --- htdocs/loan/calcmens.php | 5 +++-- .../mymodule/doc/doc_generic_myobject_odt.modules.php | 2 +- htdocs/mrp/ajax/ajax_bom.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/loan/calcmens.php b/htdocs/loan/calcmens.php index e31353b3726..b65aa41c4d4 100644 --- a/htdocs/loan/calcmens.php +++ b/htdocs/loan/calcmens.php @@ -18,8 +18,9 @@ */ /** - * \file tvi/ajax/list.php - * \brief File to return datables output + * \file htdocs/loan/calcmens.php + * \ingroup loan + * \brief File to calculate loan monthly payments */ if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index db6462eb90a..a1314d54226 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -22,7 +22,7 @@ */ /** - * \file htdocs/core/modules/commande/doc/doc_generic_myobject_odt.modules.php + * \file htdocs/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php * \ingroup mymodule * \brief File of class to build ODT documents for myobjects */ diff --git a/htdocs/mrp/ajax/ajax_bom.php b/htdocs/mrp/ajax/ajax_bom.php index 15b70ae17c9..19fea01aa60 100644 --- a/htdocs/mrp/ajax/ajax_bom.php +++ b/htdocs/mrp/ajax/ajax_bom.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/mrp/ajax/ajax.php + * \file htdocs/mrp/ajax/ajax_bom.php * \brief Ajax search component for Mrp. It get BOM content. */ From c98ab917ddd8ef8e0a5940edab63f8089dcb4d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 11 Dec 2019 20:33:58 +0100 Subject: [PATCH 22/63] doxygen --- htdocs/admin/bank_extrafields.php | 17 ++++------ htdocs/admin/commande.php | 2 +- htdocs/api/admin/explorer.php | 31 +++++++++---------- .../admin/facture_cust_extrafields.php | 20 ++++++------ .../admin/facture_rec_cust_extrafields.php | 20 ++++++------ .../admin/facturedet_cust_extrafields.php | 20 ++++++------ .../admin/facturedet_rec_cust_extrafields.php | 20 ++++++------ 7 files changed, 61 insertions(+), 69 deletions(-) diff --git a/htdocs/admin/bank_extrafields.php b/htdocs/admin/bank_extrafields.php index 5daafd17fb9..75fd269abc9 100644 --- a/htdocs/admin/bank_extrafields.php +++ b/htdocs/admin/bank_extrafields.php @@ -87,12 +87,9 @@ if ($action != 'create' && $action != 'edit') } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field - /* */ -/* ************************************************************************** */ - +/* + * Creation of an optional field + */ if ($action == 'create') { print '
'; @@ -101,11 +98,9 @@ if ($action == 'create') require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +/* + * Edition of an optional field + */ if ($action == 'edit' && ! empty($attrname)) { print "
"; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 3f064e22dfb..895c7d6618d 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -587,8 +587,8 @@ if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { print ''; print '
'; -/* Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation. /* +// Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation. // Ask for payment bank during order if ($conf->banque->enabled) { diff --git a/htdocs/api/admin/explorer.php b/htdocs/api/admin/explorer.php index 4e92873c384..ac267d29bc3 100644 --- a/htdocs/api/admin/explorer.php +++ b/htdocs/api/admin/explorer.php @@ -132,24 +132,21 @@ foreach ($modulesdir as $dir) $classname = ucfirst($classname); require_once $dir_part.$file_searched; - if (class_exists($classname)) - { - dol_syslog("Found API classname=".$classname); - $api->r->addAPIClass($classname,''); + // if (class_exists($classname)) + // { + // dol_syslog("Found API classname=".$classname); + // $api->r->addAPIClass($classname,''); + // require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/Routes.php'; + // $tmpclass = new ReflectionClass($classname); + // try { + // $classMetadata = CommentParser::parse($tmpclass->getDocComment()); + // } catch (Exception $e) { + // throw new RestException(500, "Error while parsing comments of `$classname` class. " . $e->getMessage()); + // } - /* - require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/Routes.php'; - $tmpclass = new ReflectionClass($classname); - try { - $classMetadata = CommentParser::parse($tmpclass->getDocComment()); - } catch (Exception $e) { - throw new RestException(500, "Error while parsing comments of `$classname` class. " . $e->getMessage()); - }*/ - - //$listofapis[]=array('classname'=>$classname, 'fullpath'=>$file_searched); - /* } - + // //$listofapis[]=array('classname'=>$classname, 'fullpath'=>$file_searched); + // } }*/ } } @@ -160,7 +157,7 @@ foreach ($modulesdir as $dir) } //var_dump($listofapis); -$listofapis = Routes::toArray(); // TODO api for "status" is lost here +$listofapis = Routes::toArray(); // @todo api for "status" is lost here //var_dump($listofapis); diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php index 127e38a0ddf..c9d4d906280 100644 --- a/htdocs/compta/facture/admin/facture_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php @@ -85,11 +85,11 @@ if ($action != 'create' && $action != 'edit') } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ +/* + * + * Creation of an optional field + * + */ if ($action == 'create') { @@ -99,11 +99,11 @@ if ($action == 'create') require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +/* + * + * Edition of an optional field + * + */ if ($action == 'edit' && ! empty($attrname)) { $langs->load("members"); diff --git a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php index b8fb7ade572..08a2280ff1c 100644 --- a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php @@ -86,11 +86,11 @@ if ($action != 'create' && $action != 'edit') } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ +/* + * + * Creation of an optional field + * + */ if ($action == 'create') { @@ -100,11 +100,11 @@ if ($action == 'create') require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +/* + * + * Edition of an optional field + * + */ if ($action == 'edit' && ! empty($attrname)) { $langs->load("members"); diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php index 07115733efb..fad5ec0e7a2 100644 --- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php @@ -86,11 +86,11 @@ if ($action != 'create' && $action != 'edit') } -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel -/* */ -/* ************************************************************************** */ +/* + * + * Creation d'un champ optionnel + * + */ if ($action == 'create') { @@ -100,11 +100,11 @@ if ($action == 'create') require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +/* + * + * Edition d'un champ optionnel + * + */ if ($action == 'edit' && ! empty($attrname)) { print "
"; diff --git a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php index cd73063e1e6..133102fc282 100644 --- a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php @@ -86,11 +86,11 @@ if ($action != 'create' && $action != 'edit') } -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel -/* */ -/* ************************************************************************** */ +/* + * + * Creation d'un champ optionnel + * + */ if ($action == 'create') { @@ -100,11 +100,11 @@ if ($action == 'create') require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +/* + * + * Edition d'un champ optionnel + * + */ if ($action == 'edit' && ! empty($attrname)) { print "
"; From 4309601ffb3ce36e7b8af3e0fcaecb30b7e6d150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 11 Dec 2019 20:40:18 +0100 Subject: [PATCH 23/63] typo --- build/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/README b/build/README index ab83fef26e4..07f0ebe3b55 100644 --- a/build/README +++ b/build/README @@ -36,7 +36,7 @@ Note: Prerequisites to build autoexe DoliWamp package: > perl makepack-dolibarrmodule.pl - To build developper documentation, launch the script -> perl dolybarr-doxygen-build.pl +> perl dolibarr-doxygen-build.pl Note: From 069e39ead8cf7c445e13732be079fdc2f7dc7bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 11 Dec 2019 21:09:47 +0100 Subject: [PATCH 24/63] Update dolibarr-doxygen-build.pl --- build/doxygen/dolibarr-doxygen-build.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/doxygen/dolibarr-doxygen-build.pl b/build/doxygen/dolibarr-doxygen-build.pl index 259e5aca766..75a5cceddbe 100755 --- a/build/doxygen/dolibarr-doxygen-build.pl +++ b/build/doxygen/dolibarr-doxygen-build.pl @@ -36,7 +36,7 @@ $SOURCE="../.."; $result = open( IN, "< " . $SOURCE . "/htdocs/filefunc.inc.php" ); if ( !$result ) { die "Error: Can't open descriptor file " . $SOURCE . "/htdocs/filefunc.inc.php\n"; } while () { - if ( $_ =~ /define\('DOL_VERSION','([\d\.a-z\-]+)'\)/ ) { $PROJVERSION = $1; break; } + if ( $_ =~ /define\('DOL_VERSION', '([\d\.a-z\-]+)'\)/ ) { $PROJVERSION = $1; break; } } close IN; ($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3); From 66805a502ae977557ff56bec0274a76b765529c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 11 Dec 2019 22:53:57 +0100 Subject: [PATCH 25/63] doxygen --- build/doxygen/dolibarr-doxygen-filter.pl | 4 ++-- .../bookkeeping/thirdparty_lettering_supplier.php | 2 +- htdocs/admin/commande_fournisseur_dispatch_extrafields.php | 2 +- htdocs/asset/admin/assets_extrafields.php | 6 +++--- htdocs/compta/paiement/class/cpaiement.class.php | 2 +- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/user/admin/group_extrafields.php | 6 +++--- htdocs/user/admin/user_extrafields.php | 6 +++--- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/build/doxygen/dolibarr-doxygen-filter.pl b/build/doxygen/dolibarr-doxygen-filter.pl index c3ab35cb8d2..9233bd9e77d 100755 --- a/build/doxygen/dolibarr-doxygen-filter.pl +++ b/build/doxygen/dolibarr-doxygen-filter.pl @@ -8,7 +8,7 @@ # Usage: dolibarr-doxygen-filter.pl pathtofilefromdolibarrroot $file=$ARGV[0]; -if (! $file) +if (! $file) { print "Usage: dolibarr-doxygen-filter.pl pathtofilefromdolibarrroot\n"; exit; @@ -75,7 +75,7 @@ while () { $insidedquote=0; } - } + } } } $ignore=""; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 338c795b4b2..61e5e34da99 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -21,7 +21,7 @@ */ /** - * \file htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php + * \file htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php * \ingroup Accountancy (Double entries) * \brief Tab to setup lettering */ diff --git a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php index f06c4412207..900d66c73b5 100644 --- a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php +++ b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php @@ -25,7 +25,7 @@ */ /** - * \file htdocs/admin/commandefournisseurdispatch_extrafields.php + * \file htdocs/admin/commande_fournisseur_dispatch_extrafields.php * \ingroup reception * \brief Page to setup extra fields of reception */ diff --git a/htdocs/asset/admin/assets_extrafields.php b/htdocs/asset/admin/assets_extrafields.php index 60147cf512b..d4ae2bd2930 100644 --- a/htdocs/asset/admin/assets_extrafields.php +++ b/htdocs/asset/admin/assets_extrafields.php @@ -17,9 +17,9 @@ */ /** - * \file htdocs/asset/admin/asset_extrafields.php - * \ingroup asset - * \brief Page to setup extra fields of assets + * \file htdocs/asset/admin/assets_extrafields.php + * \ingroup asset + * \brief Page to setup extra fields of assets */ require '../../main.inc.php'; diff --git a/htdocs/compta/paiement/class/cpaiement.class.php b/htdocs/compta/paiement/class/cpaiement.class.php index 4363f39216f..9a0e4b6c5fe 100644 --- a/htdocs/compta/paiement/class/cpaiement.class.php +++ b/htdocs/compta/paiement/class/cpaiement.class.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/compat/paiement/class/cpaiement.class.php + * \file htdocs/compta/paiement/class/cpaiement.class.php * \ingroup facture * \brief This file is to manage CRUD function of type of payments */ diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 117af9e8f19..90bbe9d0449 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -18,7 +18,7 @@ */ /** - * \file ticket/class/html.ticket.class.php + * \file htdocs/core/class/html.formticket.class.php * \ingroup ticket * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire */ diff --git a/htdocs/user/admin/group_extrafields.php b/htdocs/user/admin/group_extrafields.php index a934d6cd74c..69b56cf9261 100644 --- a/htdocs/user/admin/group_extrafields.php +++ b/htdocs/user/admin/group_extrafields.php @@ -20,9 +20,9 @@ */ /** - * \file htdocs/adherents/admin/adherent_extrafields.php - * \ingroup member - * \brief Page to setup extra fields of members + * \file htdocs/user/admin/user_extrafields.php + * \ingroup user + * \brief Page to setup extra fields of users */ require '../../main.inc.php'; diff --git a/htdocs/user/admin/user_extrafields.php b/htdocs/user/admin/user_extrafields.php index 712d7318391..1f87b5fbe90 100644 --- a/htdocs/user/admin/user_extrafields.php +++ b/htdocs/user/admin/user_extrafields.php @@ -19,9 +19,9 @@ */ /** - * \file htdocs/adherents/admin/adherent_extrafields.php - * \ingroup member - * \brief Page to setup extra fields of members + * \file htdocs/user/admin/user_extrafields.php + * \ingroup user + * \brief Page to setup extra fields of users */ require '../../main.inc.php'; From 12f84d82543cacb10f6faec8cbe6b3a3800a28a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 11 Dec 2019 23:04:27 +0100 Subject: [PATCH 26/63] doxygen --- htdocs/core/db/sqlite3.class.php | 2 +- htdocs/core/lib/functionsnumtoword.lib.php | 2 +- .../core/modules/modEmailCollector.class.php | 18 +++++++++--------- htdocs/fichinter/class/fichinterrec.class.php | 6 +++--- htdocs/takepos/send.php | 2 +- htdocs/user/admin/group_extrafields.php | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index af529e97fae..20a5f9728cb 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -21,7 +21,7 @@ */ /** - * \file htdocs/core/db/sqlite.class.php + * \file htdocs/core/db/sqlite3.class.php * \brief Class file to manage Dolibarr database access for a SQLite database */ diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php index a0ae9bb3692..5fbb799b7dc 100644 --- a/htdocs/core/lib/functionsnumtoword.lib.php +++ b/htdocs/core/lib/functionsnumtoword.lib.php @@ -17,7 +17,7 @@ * or see https://www.gnu.org/ */ /** - * \file htdocs/core/lib/functionsnumbertoword.lib.php + * \file htdocs/core/lib/functionsnumtoword.lib.php * \brief A set of functions for Dolibarr * This file contains all frequently used functions. */ diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php index 092aeb3fa3a..0b02576f5d4 100644 --- a/htdocs/core/modules/modEmailCollector.class.php +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -16,18 +16,18 @@ */ /** - * \defgroup dav Module dav - * \brief dav module descriptor. + * \defgroup emailcollector Module emailcollector + * \brief emailcollector module descriptor. * - * \file htdocs/dav/core/modules/modDav.class.php - * \ingroup dav - * \brief Description and activation file for module dav + * \file htdocs/emailcollector/core/modules/modEmailCollector.class.php + * \ingroup emailcollector + * \brief Description and activation file for module emailcollector */ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; /** - * Description and activation class for module dav + * Description and activation class for module emailcollector */ class modEmailCollector extends DolibarrModules { @@ -108,10 +108,10 @@ class modEmailCollector extends DolibarrModules ); - if (! isset($conf->dav) || ! isset($conf->dav->enabled)) + if (! isset($conf->emailcollector) || ! isset($conf->emailcollector->enabled)) { - $conf->dav=new stdClass(); - $conf->dav->enabled=0; + $conf->emailcollector=new stdClass(); + $conf->emailcollector->enabled=0; } diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index d4f526d9847..92a42d1ffdf 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -23,9 +23,9 @@ */ /** - * \file fichinterrec/class/fichinter-rec.class.php - * \ingroup facture - * \brief Fichier de la classe des factures recurentes + * \file htdocs/fichinter/class/fichinterrec.class.php + * \ingroup facture + * \brief Fichier de la classe des factures recurentes */ require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; diff --git a/htdocs/takepos/send.php b/htdocs/takepos/send.php index 7c5676c5a1f..268fa6f6670 100644 --- a/htdocs/takepos/send.php +++ b/htdocs/takepos/send.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/takepos/printsend.php + * \file htdocs/takepos/send.php * \ingroup takepos * \brief Page with the content of the popup to enter payments */ diff --git a/htdocs/user/admin/group_extrafields.php b/htdocs/user/admin/group_extrafields.php index 69b56cf9261..92be17dcd47 100644 --- a/htdocs/user/admin/group_extrafields.php +++ b/htdocs/user/admin/group_extrafields.php @@ -20,7 +20,7 @@ */ /** - * \file htdocs/user/admin/user_extrafields.php + * \file htdocs/user/admin/group_extrafields.php * \ingroup user * \brief Page to setup extra fields of users */ From f30d1394ddcbf8970d42dd6ddb7fe44db8eb7f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 11 Dec 2019 23:30:54 +0100 Subject: [PATCH 27/63] doxygen --- htdocs/don/admin/donation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index 9b1c08704b6..b5c775207ba 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -21,9 +21,9 @@ */ /** - * \file htdocs/don/admin/dons.php - * \ingroup donations - * \brief Page to setup the donation module + * \file htdocs/don/admin/donation.php + * \ingroup donations + * \brief Page to setup the donation module */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; From 269e53583d58f7fb932c37bf001a0b246a45d995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 11 Dec 2019 23:46:12 +0100 Subject: [PATCH 28/63] doxygen --- htdocs/compta/bank/class/account.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index ec29e4e5240..aca498c1ed6 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -132,7 +132,7 @@ class Account extends CommonObject /** * IBAN number (International Bank Account Number). Stored into iban_prefix field into database - * @var + * @var string */ public $iban; From 9357bfd98e7d763f7a771148c73d899689a10793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 12 Dec 2019 08:17:14 +0100 Subject: [PATCH 29/63] doxygen --- htdocs/compta/bank/various_payment/card.php | 2 +- htdocs/core/boxes/box_birthdays_members.php | 4 ++-- htdocs/core/boxes/box_last_ticket.php | 2 +- htdocs/core/boxes/box_project.php | 2 +- htdocs/core/class/fileupload.class.php | 2 +- htdocs/core/class/workboardresponse.class.php | 2 +- htdocs/product/class/product.class.php | 2 +- htdocs/zapier/class/api_zapier.class.php | 18 +++++++++--------- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 72226f18cd6..027294663f1 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/compta/bank/various_expenses/card.php + * \file htdocs/compta/bank/various_payment/card.php * \ingroup bank * \brief Page of various expenses */ diff --git a/htdocs/core/boxes/box_birthdays_members.php b/htdocs/core/boxes/box_birthdays_members.php index 1addf1c4827..e48271c4d84 100644 --- a/htdocs/core/boxes/box_birthdays_members.php +++ b/htdocs/core/boxes/box_birthdays_members.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2019 Frederic 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 @@ -19,7 +19,7 @@ */ /** - * \file htdocs/core/boxes/box_adherent_birthdays.php + * \file htdocs/core/boxes/box_birthdays_members.php * \ingroup member * \brief Box for member birthdays */ diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index 0ac4557431b..252141db9eb 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -19,7 +19,7 @@ */ /** - * \file core/boxes/box_ticket_latest.php + * \file htdocs/core/boxes/box_last_ticket.php * \ingroup ticket * \brief This box shows latest created tickets */ diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index edd6c89054d..68095eaec31 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/core/boxes/box_activite.php + * \file htdocs/core/boxes/box_project.php * \ingroup projet * \brief Module to show Projet activity of the current Year */ diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index a4be0739aa5..beb887d8b76 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/core/ajax/fileupload.class.php + * \file htdocs/core/class/fileupload.class.php * \brief File to return Ajax response on file upload */ diff --git a/htdocs/core/class/workboardresponse.class.php b/htdocs/core/class/workboardresponse.class.php index 12174916422..e2d9cc2c0d7 100644 --- a/htdocs/core/class/workboardresponse.class.php +++ b/htdocs/core/class/workboardresponse.class.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/core/class/WorkboardResponse.class.php + * \file htdocs/core/class/workboardresponse.class.php * \brief Class that represents response of load_board functions */ diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 88a0fc30488..e32f0c32f8f 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -252,7 +252,7 @@ class Product extends CommonObject /** * Customs code * - * @var + * @var string */ public $customcode; diff --git a/htdocs/zapier/class/api_zapier.class.php b/htdocs/zapier/class/api_zapier.class.php index c4fb81065d5..638b02c0c58 100644 --- a/htdocs/zapier/class/api_zapier.class.php +++ b/htdocs/zapier/class/api_zapier.class.php @@ -263,15 +263,15 @@ class ZapierApi extends DolibarrApi ); } - /** - * Update hook - * - * @param int $id Id of hook to update - * @param array $request_data Datas - * @return int - * - * @url PUT /hooks/{id} - */ + // /** + // * Update hook + // * + // * @param int $id Id of hook to update + // * @param array $request_data Datas + // * @return int + // * + // * @url PUT /hooks/{id} + // */ /*public function put($id, $request_data = null) { if (! DolibarrApiAccess::$user->rights->zapier->write) { From a527e72124f5b49aa2145542e87f64e8dd55f034 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 12 Dec 2019 16:35:07 +0100 Subject: [PATCH 30/63] FIX #12688 --- htdocs/compta/resultat/index.php | 4 +++- htdocs/compta/stats/index.php | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index d40f00a9c42..887412bc6a4 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -815,7 +815,9 @@ if (! empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING')) $sql = "SELECT b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as debit, sum(b.credit) as credit, sum(b.montant) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_account as aa"; - $sql.= " WHERE b.numero_compte = aa.account_number AND b.entity = ".$conf->entity; + $sql.= " WHERE b.entity = ".$conf->entity; + $sql.= " AND aa.entity = ".$conf->entity; + $sql.= " AND b.numero_compte = aa.account_number"; $sql.= " AND ".$predefinedgroupwhere; $sql.= " AND fk_pcg_version = '".$db->escape($charofaccountstring)."'"; if (! empty($date_start) && ! empty($date_end)) diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index cd17fbba233..c14bc46ad13 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -194,6 +194,7 @@ elseif ($modecompta=="BOOKKEEPING") $sql = "SELECT date_format(b.doc_date,'%Y-%m') as dm, sum(b.credit) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_journal as aj"; $sql.= " WHERE b.entity = ".$conf->entity; + $sql.= " AND aj.entity = ".$conf->entity; $sql.= " AND b.code_journal = aj.code AND aj.nature = 2" ; // @TODO currently count amount in sale journal, but we need to define a category group for turnover } From a0aa51fe0ce3ae51039a70329b43c43191a6bede Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 12 Dec 2019 16:46:25 +0100 Subject: [PATCH 31/63] FIX : CommandeFournisseurLigne update function must not be able to return other value than 1 if success --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index d0d0e4a1615..29d56a3aabf 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3577,7 +3577,7 @@ class CommandeFournisseurLigne extends CommonOrderLine if (! $error) { $this->db->commit(); - return $result; + return 1; } else { From 43f150dc426aafd016972b2dad0c2aaa3571a773 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 12 Dec 2019 17:02:59 +0100 Subject: [PATCH 32/63] Update societe.class.php --- htdocs/societe/class/societe.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c2017c894c0..286aa63821e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -673,6 +673,7 @@ class Societe extends CommonObject if (empty($this->status)) $this->status = 0; $this->name = $this->name ?trim($this->name) : trim($this->nom); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->name = ucwords($this->name); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->name=strtoupper($this->name); $this->nom = $this->name; // For backward compatibility if (empty($this->client)) $this->client = 0; if (empty($this->fournisseur)) $this->fournisseur = 0; @@ -987,7 +988,9 @@ class Societe extends CommonObject dol_syslog(get_class($this)."::Update id=".$id." call_trigger=".$call_trigger." allowmodcodeclient=".$allowmodcodeclient." allowmodcodefournisseur=".$allowmodcodefournisseur); $now = dol_now(); - + + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->name = ucwords($this->name); + if (! empty($conf->global->MAIN_ALL_TO_UPPER)) $this->name=strtoupper($this->name); // Clean parameters $this->id = $id; $this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity); From 380b698c6f6c664a56e7263fdddf820b01a11c0b Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 12 Dec 2019 16:09:23 +0000 Subject: [PATCH 33/63] Fixing style errors. --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 286aa63821e..3160a701f64 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -988,7 +988,7 @@ class Societe extends CommonObject dol_syslog(get_class($this)."::Update id=".$id." call_trigger=".$call_trigger." allowmodcodeclient=".$allowmodcodeclient." allowmodcodefournisseur=".$allowmodcodefournisseur); $now = dol_now(); - + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->name = ucwords($this->name); if (! empty($conf->global->MAIN_ALL_TO_UPPER)) $this->name=strtoupper($this->name); // Clean parameters From 21a28e4bb48ba607c5575624c434337c44914d09 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 12 Dec 2019 17:20:20 +0100 Subject: [PATCH 34/63] Update contact.class.php --- htdocs/contact/class/contact.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index a945e8cb5a5..ddad3792a2b 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -261,6 +261,7 @@ class Contact extends CommonObject $this->lastname = $this->lastname ?trim($this->lastname) : trim($this->name); $this->firstname = trim($this->firstname); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); if (empty($this->socid)) $this->socid = 0; if (empty($this->priv)) $this->priv = 0; @@ -372,6 +373,10 @@ class Contact extends CommonObject $this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity); // Clean parameters + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); + $this->lastname = trim($this->lastname) ?trim($this->lastname) : trim($this->lastname); $this->firstname = trim($this->firstname); $this->email = trim($this->email); From ffde746479371f0754e3f408aa3e19db9eb4d94b Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 12 Dec 2019 16:22:07 +0000 Subject: [PATCH 35/63] Fixing style errors. --- htdocs/contact/class/contact.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index ddad3792a2b..0c8da446df7 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -376,7 +376,7 @@ class Contact extends CommonObject if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); - + $this->lastname = trim($this->lastname) ?trim($this->lastname) : trim($this->lastname); $this->firstname = trim($this->firstname); $this->email = trim($this->email); From 68a1b12fbab1e218c894ae9b8d557d66a0aef888 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 12 Dec 2019 17:27:24 +0100 Subject: [PATCH 36/63] Update user.class.php --- htdocs/user/class/user.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index ffb8c15e3c3..10a71dadd6c 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1175,6 +1175,11 @@ class User extends CommonObject global $mysoc; // Clean parameters + + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords($this->lastname); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname=strtoupper($this->lastname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname); + $this->login = trim($this->login); if (!isset($this->entity)) $this->entity = $conf->entity; // If not defined, we use default value @@ -1513,6 +1518,11 @@ class User extends CommonObject dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember.", nosyncmemberpass=".$nosyncmemberpass); // Clean parameters + + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords($this->lastname); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname=strtoupper($this->lastname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname); + $this->lastname = trim($this->lastname); $this->firstname = trim($this->firstname); $this->employee = $this->employee ? $this->employee : 0; From 31b09f433ffe914e7eff46c9c03e343bdc43940a Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 12 Dec 2019 16:29:11 +0000 Subject: [PATCH 37/63] Fixing style errors. --- htdocs/user/class/user.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 10a71dadd6c..051c9f43d0c 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1175,11 +1175,11 @@ class User extends CommonObject global $mysoc; // Clean parameters - + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords($this->lastname); if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname=strtoupper($this->lastname); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname); - + $this->login = trim($this->login); if (!isset($this->entity)) $this->entity = $conf->entity; // If not defined, we use default value @@ -1518,11 +1518,11 @@ class User extends CommonObject dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember.", nosyncmemberpass=".$nosyncmemberpass); // Clean parameters - + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords($this->lastname); if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname=strtoupper($this->lastname); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname); - + $this->lastname = trim($this->lastname); $this->firstname = trim($this->firstname); $this->employee = $this->employee ? $this->employee : 0; From 7d8707a7b28106ebb5a3572e6d597e9a1da403b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 12 Dec 2019 20:06:01 +0100 Subject: [PATCH 38/63] The variable $conf seems to be never defined --- htdocs/reception/class/reception.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index e43782c2603..260a3744e2e 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1106,7 +1106,7 @@ class Reception extends CommonObject */ public function getNomUrl($withpicto = 0, $option = 0, $max = 0, $short = 0, $notooltip = 0) { - global $langs; + global $conf, $langs; $result = ''; $label = ''.$langs->trans("ShowReception").''; $label .= '
'.$langs->trans('Ref').': '.$this->ref; From 2136499c672614fd3015115d9b05800b379e5735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 12 Dec 2019 20:11:18 +0100 Subject: [PATCH 39/63] The variable $query seems to be never defined --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index abda1519002..977545bdeb9 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2892,9 +2892,9 @@ class CommandeFournisseur extends CommonOrder $resql = $db->query($sql); if ($resql) { - if ($db->num_rows($query)) + if ($db->num_rows($resql)) { - $obj = $db->fetch_object($query); + $obj = $db->fetch_object($resql); $string = $langs->trans($obj->code); if ($string == $obj->code) From e4a7ae2ea0e3e447f5d810f885a64d093b360e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 12 Dec 2019 20:25:36 +0100 Subject: [PATCH 40/63] The variable xxx seems to be never defined --- htdocs/fichinter/class/fichinter.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 380204c2b0d..9ca729aedfc 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Charlie Benke * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -197,6 +197,8 @@ class Fichinter extends CommonObject { global $conf, $langs; + $error = 0; + dol_syslog(get_class($this)."::create ref=".$this->ref); // Check parameters @@ -329,6 +331,8 @@ class Fichinter extends CommonObject */ public function update($user, $notrigger = 0) { + global $conf; + if (! is_numeric($this->duration)) { $this->duration = 0; } @@ -1474,6 +1478,8 @@ class FichinterLigne extends CommonObjectLine { global $langs,$conf; + $error = 0; + dol_syslog("FichinterLigne::insert rang=".$this->rang); $this->db->begin(); @@ -1570,7 +1576,9 @@ class FichinterLigne extends CommonObjectLine { global $langs,$conf; - $this->db->begin(); + $error = 0; + + $this->db->begin(); // Mise a jour ligne en base $sql = "UPDATE ".MAIN_DB_PREFIX."fichinterdet SET"; From a76e35848d41ce048d8173d16f37f293d64df3c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 12 Dec 2019 20:29:16 +0100 Subject: [PATCH 41/63] Update combinations.php --- htdocs/variants/combinations.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index c3f2b198301..04c9e70c447 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -374,7 +374,7 @@ if (! empty($id) || ! empty($ref)) if ($action == 'add' || ($action == 'edit')) { if ($action == 'add') { $title = $langs->trans('NewProductCombination'); - //print dol_fiche_head(); + // dol_fiche_head(); $features = $_SESSION['addvariant_'.$object->id]; //First, sanitize $listofvariantselected = '
'; @@ -499,7 +499,7 @@ if (! empty($id) || ! empty($ref)) print ''."\n"; } - print dol_fiche_head(); + dol_fiche_head(); print '
' . $langs->trans('Ref') . ''; @@ -821,7 +821,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd $morehtmlref.=''; - $linkback = '' . $langs->trans("BackToList") . ' '; + $linkback = '' . $langs->trans("BackToList") . ' '; dol_banner_tab($object, 'ref', $linkback, ($user->societe_id ? 0 : 1), 'ref', 'ref', $morehtmlref); diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 2e2091034f9..2c00dfe3150 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -477,7 +477,7 @@ if ($id && ($action == 'edit' || $action == 'create' ) && $user->rights->user->u $title = $langs->trans("User"); dol_fiche_head($head, 'bank', $title, 0, 'user'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 90228aa952e..de2a84518ff 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -323,7 +323,7 @@ else { dol_fiche_head($head, 'guisetup', $title, -1, 'user'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); From 486f5980673c011f2b815801cccd97d36228429f Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 5 Dec 2019 16:09:52 +0100 Subject: [PATCH 05/63] FIX getrights() request --- htdocs/user/class/user.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 8e0a9d956cb..b2d31b40590 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -879,6 +879,7 @@ class User extends CommonObject else { $sql.= " AND gr.entity = ".$conf->entity; + $sql.= " AND gu.entity = ".$conf->entity; $sql.= " AND r.entity = ".$conf->entity; } $sql.= " AND gr.fk_usergroup = gu.fk_usergroup"; From d73bd3ee9a6b433f513fec4cdedfdc2e0f8c9e21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Dec 2019 18:41:22 +0100 Subject: [PATCH 06/63] Fix a supplier ref is mandatory for import --- htdocs/core/modules/modProduct.class.php | 2 +- htdocs/core/modules/modService.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index d05a767425b..e5c1e91b973 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -587,7 +587,7 @@ class modProduct extends DolibarrModules $this->import_fields_array[$r]=array(//field order as per structure of table llx_product_fournisseur_price, without optional fields 'sp.fk_product'=>"ProductOrService*", 'sp.fk_soc' => "Supplier*", - 'sp.ref_fourn' => 'SupplierRef', + 'sp.ref_fourn' => 'SupplierRef*', 'sp.quantity' => "QtyMin*", 'sp.tva_tx' => 'VATRate', 'sp.default_vat_code' => 'VATCode', diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 20db49d5e69..d4e6313e054 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -563,7 +563,7 @@ class modService extends DolibarrModules $this->import_fields_array[$r]=array(//field order as per structure of table llx_product_fournisseur_price, without optional fields 'sp.fk_product'=>"ProductOrService*", 'sp.fk_soc' => "Supplier*", - 'sp.ref_fourn' => 'SupplierRef', + 'sp.ref_fourn' => 'SupplierRef*', 'sp.quantity' => "QtyMin*", 'sp.tva_tx' => 'VATRate', 'sp.default_vat_code' => 'VATCode', From cafe26cfc34927914fc84f5be22384ad13282d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 6 Dec 2019 23:23:57 +0100 Subject: [PATCH 07/63] Update card.php --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c8ebeb5be57..8abd7779849 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -699,7 +699,7 @@ if (empty($reshook)) if ($lines[$i]->entrepot_id > 0) { // single warehouse shipment line - if ($lines[i]->entrepot_id == $lotStock->warehouseid) + if ($lines[$i]->entrepot_id == $lotStock->warehouseid) { $lineIdToAddLot = $line_id; } From f51a68ceb10fe32d67e6c47c0ea74f9fe114ea2d Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Sat, 7 Dec 2019 15:36:23 +1100 Subject: [PATCH 08/63] Takepos: Well align the search field width, keep old CSS rule as fallback for old browsers --- htdocs/takepos/takepos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index 339bbaa0643..5af931c8fac 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -719,7 +719,7 @@ $menus[$r++]=array('title'=>'< print ''."\n"; print '
'; - print ' '; + print ' '; print ''.img_picto('', 'searchclear').''; print '
'; ?> From f28e4c14e875915db7abe99ea4db5a03a49b25cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Dec 2019 13:40:26 +0100 Subject: [PATCH 09/63] FIX #12644 --- htdocs/compta/facture/card.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 9cb76a2f292..b067adffeca 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1939,7 +1939,14 @@ if (empty($reshook)) if ($tva_npr) $info_bits |= 0x01; - if ($usercanproductignorepricemin && (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { + $price2num_pu_ht = price2num($pu_ht); + $price2num_remise_percent = price2num($remise_percent); + $price2num_price_min = price2num($price_min); + if (empty($price2num_pu_ht)) $price2num_pu_ht = 0; + if (empty($price2num_remise_percent)) $price2num_remise_percent = 0; + if (empty($price2num_price_min)) $price2num_price_min = 0; + + if ($usercanproductignorepricemin && (! empty($price_min) && ($price2num_pu_ht * (1 - $price2num_remise_percent / 100) < $price2num_price_min))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { From 903c3771ba877a717f3efb3503ac68c55290149d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Lelarge?= Date: Mon, 9 Dec 2019 14:56:20 +0100 Subject: [PATCH 10/63] FIX #12665 Mass invoice validation with stock management Normally the mass invoice validation is not authorized due to the need to choose the warehouse where to increase or decrease the stock. A message ErrorMassValidationNotAllowedWhenStockIncreaseOnAction is displayed to inform the user to do this validation manually one by one. The invoices should not be validated. --- htdocs/core/actions_massactions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 6cd98f00e48..440c16954a1 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1084,7 +1084,7 @@ if (! $error && $massaction == 'validate' && $permtocreate) { $objecttmp=new $objectclass($db); - if ($objecttmp->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) { $langs->load("errors"); setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); From 407fe902b49019c9bd62549d12e40f7d237c6a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 9 Dec 2019 16:42:57 +0100 Subject: [PATCH 11/63] missing $db for line 711 --- htdocs/core/class/utils.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 8ce4cca7ca6..12972a89752 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -586,7 +586,7 @@ class Utils */ function generateDoc($module) { - global $conf, $langs; + global $conf, $langs, $db; global $dirins; $error = 0; From a16e342af6b6e5e564e22c09b6812c5640351f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 9 Dec 2019 23:15:15 +0100 Subject: [PATCH 12/63] typo --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 32dd6fbd361..4ae766d4f4d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -497,7 +497,7 @@ abstract class CommonObject $this->country =$tmparray['label']; } - if ($withregion && $this->state_id && (empty($this->state_code) || empty($this->state) || empty($this->region) || empty($this->region_cpde))) + if ($withregion && $this->state_id && (empty($this->state_code) || empty($this->state) || empty($this->region) || empty($this->region_code))) { require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php'; $tmparray=getState($this->state_id,'all',0,1); From de741f5dd023715392c7fb7da9e66fa10482486e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 9 Dec 2019 23:22:13 +0100 Subject: [PATCH 13/63] The variable $id seems to be never defined --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 32dd6fbd361..e73447709ac 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1764,7 +1764,7 @@ abstract class CommonObject */ function setMulticurrencyCode($code) { - dol_syslog(get_class($this).'::setMulticurrencyCode('.$id.')'); + dol_syslog(get_class($this).'::setMulticurrencyCode('.$code.')'); if ($this->statut >= 0 || $this->element == 'societe') { $fieldname = 'multicurrency_code'; @@ -1806,7 +1806,7 @@ abstract class CommonObject */ function setMulticurrencyRate($rate, $mode=1) { - dol_syslog(get_class($this).'::setMulticurrencyRate('.$id.')'); + dol_syslog(get_class($this).'::setMulticurrencyRate('.$rate.','.$mode.')'); if ($this->statut >= 0 || $this->element == 'societe') { $fieldname = 'multicurrency_tx'; From f4674a7558037a6d6c6f57fd16c362ec2b9cec45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 10 Dec 2019 07:51:39 +0100 Subject: [PATCH 14/63] doxygen and $db bot defined --- htdocs/core/lib/files.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index e003b74f3e6..10aa26e99d6 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -958,18 +958,18 @@ function dol_unescapefile($filename) */ function dolCheckVirus($src_file) { - global $conf; + global $conf, $db; if (! empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { if (! class_exists('AntiVir')) { require_once DOL_DOCUMENT_ROOT.'/core/class/antivir.class.php'; } - $antivir=new AntiVir($db); + $antivir = new AntiVir($db); $result = $antivir->dol_avscan_file($src_file); if ($result < 0) // If virus or error, we stop here { - $reterrors=$antivir->errors; + $reterrors = $antivir->errors; return $reterrors; } } @@ -992,7 +992,7 @@ function dolCheckVirus($src_file) * @param integer $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error']) * @param int $nohook Disable all hooks * @param string $varfiles _FILES var name - * @return int >0 if OK, <0 or string if KO + * @return int|string >0 if OK, <0 or string if KO * @see dol_move */ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles='addedfile') From 5d61e53140fa716e6916aa4ab491f27fb0804602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Lelarge?= Date: Mon, 9 Dec 2019 14:56:20 +0100 Subject: [PATCH 15/63] FIX #12665 Mass invoice validation with stock management Normally the mass invoice validation is not authorized due to the need to choose the warehouse where to increase or decrease the stock. A message ErrorMassValidationNotAllowedWhenStockIncreaseOnAction is displayed to inform the user to do this validation manually one by one. The invoices should not be validated. --- htdocs/core/actions_massactions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 62d8e2466b0..ad98cfa2ae1 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1048,7 +1048,7 @@ if (! $error && $massaction == 'validate' && $permtocreate) { $objecttmp=new $objectclass($db); - if ($objecttmp->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) { $langs->load("errors"); setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); From 97ec8b8e0261689194ba5a1be20d702aea6ff2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Lelarge?= Date: Mon, 9 Dec 2019 14:56:20 +0100 Subject: [PATCH 16/63] FIX #12665 Mass invoice validation with stock management Normally the mass invoice validation is not authorized due to the need to choose the warehouse where to increase or decrease the stock. A message ErrorMassValidationNotAllowedWhenStockIncreaseOnAction is displayed to inform the user to do this validation manually one by one. The invoices should not be validated. --- htdocs/core/actions_massactions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 03cf1eae755..99bc62dff79 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1079,7 +1079,7 @@ if (! $error && $massaction == 'validate' && $permtocreate) { $objecttmp=new $objectclass($db); - if ($objecttmp->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) { $langs->load("errors"); setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); From b92ec604ecc4f7034e0bbaac0bea80213e7f3741 Mon Sep 17 00:00:00 2001 From: Mistral Oz - LWEP Date: Tue, 10 Dec 2019 18:25:30 +0100 Subject: [PATCH 17/63] New model "Excel 2007" : first col at wrong position The first column start at id 0 instead of id 1. At id 0, the first column move at Z position. Documentation : https://phpspreadsheet.readthedocs.io/en/latest/topics/migration-from-PHPExcel/#column-index-based-on-1 --- .../modules/export/export_excel2007new.modules.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/export/export_excel2007new.modules.php b/htdocs/core/modules/export/export_excel2007new.modules.php index 038446643a2..776ad5e395a 100644 --- a/htdocs/core/modules/export/export_excel2007new.modules.php +++ b/htdocs/core/modules/export/export_excel2007new.modules.php @@ -262,7 +262,10 @@ class ExportExcel2007new extends ModeleExports $this->workbook->getActiveSheet()->getStyle('1')->getFont()->setBold(true); $this->workbook->getActiveSheet()->getStyle('1')->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT); - $this->col=0; + $this->col=1; + if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) { + $this->col=0; + } foreach($array_selected_sorted as $code => $value) { $alias=$array_export_fields_label[$code]; @@ -302,7 +305,10 @@ class ExportExcel2007new extends ModeleExports global $conf; // Define first row - $this->col=0; + $this->col=1; + if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) { + $this->col=0; + } $reg=array(); From 5c59ddb3572dc1085ea5356e2fc5213646e9c1f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 10 Dec 2019 21:11:52 +0100 Subject: [PATCH 18/63] add hook like for per day/week/month --- htdocs/comm/action/card.php | 2 +- htdocs/comm/action/index.php | 5 +++++ htdocs/comm/action/peruser.php | 25 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 765502075c2..19856095cd5 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -623,7 +623,7 @@ if (empty($reshook) && $action == 'update') */ if (empty($reshook) && $action == 'confirm_delete' && GETPOST("confirm") == 'yes') { - $object->fetch($id); + $object->fetch($id); $object->fetch_optionals(); $object->fetch_userassigned(); $object->oldcopy = clone $object; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 47feb0e75ae..562982dfc47 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -89,6 +89,7 @@ $pid=GETPOST("search_projectid", "int", 3)?GETPOST("search_projectid", "int", 3) $status=GETPOST("search_status", 'aZ09')?GETPOST("search_status", 'aZ09'):GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo' $type=GETPOST("search_type", 'aZ09')?GETPOST("search_type", 'aZ09'):GETPOST("type", 'aZ09'); $maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) if (GETPOST('search_actioncode', 'array')) { @@ -167,6 +168,10 @@ if ($action == 'delete_action') { $event = new ActionComm($db); $event->fetch($actionid); + $event->fetch_optionals(); + $event->fetch_userassigned(); + $event->oldcopy = clone $event; + $result = $event->delete(); } diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 54373fcf8a9..6a2e8167dfb 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -88,6 +88,7 @@ $pid=GETPOST("search_projectid", "int", 3)?GETPOST("search_projectid", "int", 3) $status=GETPOST("search_status", 'alpha')?GETPOST("search_status", 'alpha'):GETPOST("status", 'alpha'); $type=GETPOST("search_type", 'alpha')?GETPOST("search_type", 'alpha'):GETPOST("type", 'alpha'); $maxprint=((GETPOST("maxprint", 'int')!='')?GETPOST("maxprint", 'int'):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) if (GETPOST('search_actioncode', 'array')) { @@ -154,6 +155,10 @@ if ($action == 'delete_action') { $event = new ActionComm($db); $event->fetch($actionid); + $event->fetch_optionals(); + $event->fetch_userassigned(); + $event->oldcopy = clone $event; + $result = $event->delete(); } @@ -162,6 +167,26 @@ if ($action == 'delete_action') /* * View */ +$parameters = array( + 'socid' => $socid, + 'status' => $status, + 'year' => $year, + 'month' => $month, + 'day' => $day, + 'type' => $type, + 'maxprint' => $maxprint, + 'filter' => $filter, + 'filtert' => $filtert, + 'showbirthday' => $showbirthday, + 'canedit' => $canedit, + 'optioncss' => $optioncss, + 'actioncode' => $actioncode, + 'pid' => $pid, + 'resourceid' => $resourceid, + 'usergroup' => $usergroup, +); +$reshook = $hookmanager->executeHooks('beforeAgendaPerUser', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $form = new Form($db); $companystatic = new Societe($db); From 307bad1d2aa3466a9d2d134119f061bb80a33251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 11 Dec 2019 19:11:13 +0100 Subject: [PATCH 19/63] doxygen todo --- htdocs/adherents/subscription.php | 2 +- htdocs/admin/ticket.php | 2 +- htdocs/categories/class/categorie.class.php | 2 +- htdocs/comm/action/class/actioncomm.class.php | 2 +- htdocs/compta/cashcontrol/cashcontrol_card.php | 2 +- htdocs/compta/prelevement/class/rejetprelevement.class.php | 2 +- htdocs/compta/resultat/result.php | 2 +- htdocs/compta/stats/index.php | 2 +- htdocs/core/actions_massactions.inc.php | 2 +- htdocs/core/actions_sendmails.inc.php | 4 ++-- htdocs/core/class/commonobject.class.php | 6 +++--- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/core/class/notify.class.php | 2 +- .../interface_50_modNotification_Notification.class.php | 2 +- htdocs/expensereport/class/expensereport.class.php | 4 ++-- htdocs/stripe/payment.php | 2 +- htdocs/user/class/user.class.php | 2 +- 17 files changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 3d1885799c3..1c6505a260b 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -898,7 +898,7 @@ if ($rowid > 0) 'moreattr' => 'maxlength="128"', ); } - // @TODO Add other extrafields mandatory for thirdparty creation + // @todo Add other extrafields mandatory for thirdparty creation print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id, $langs->trans("CreateDolibarrThirdParty"), $langs->trans("ConfirmCreateThirdParty"), "confirm_create_thirdparty", $formquestion, 1); } diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 98d77d47118..526c8785681 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -432,7 +432,7 @@ print '
'.$langs->trans("TicketEmailNotificationTo").''.price(price2num($cumul_qty, 'MT'))."'.price(price2num($totalMargin, 'MT'))."'.(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."'.(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT')))."".(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%")." 
'; From a63caf38d34d1b2035f4bbf7af88f969e4efec8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 12 Dec 2019 20:39:28 +0100 Subject: [PATCH 42/63] The variable $conf seems to be never defined --- .../modules/societe/mod_codecompta_digitaria.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/societe/mod_codecompta_digitaria.php b/htdocs/core/modules/societe/mod_codecompta_digitaria.php index 7dbf129b766..d97ac5df0ff 100644 --- a/htdocs/core/modules/societe/mod_codecompta_digitaria.php +++ b/htdocs/core/modules/societe/mod_codecompta_digitaria.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2010 Laurent Destailleur * Copyright (C) 2019 Alexandre Spangaro + * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,8 +43,16 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode */ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' + /** + * Prefix customer accountancy code + * @var string + */ public $prefixcustomeraccountancycode; + /** + * Prefix supplier accountancy code + * @var string + */ public $prefixsupplieraccountancycode; public $position = 30; @@ -117,7 +126,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode */ public function getExample($langs, $objsoc = 0, $type = -1) { - global $mysoc; + global $conf, $mysoc; $s = $langs->trans("ThirdPartyName").": ".$mysoc->name; $s .= "
\n"; @@ -142,6 +151,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode public function get_code($db, $societe, $type = '') { // phpcs:enable + global $conf; $i = 0; $this->code = ''; From d4dfa840d9d8773ffd55468e99838795eff58cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 12 Dec 2019 20:48:14 +0100 Subject: [PATCH 43/63] doxygen --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 544063bc4c8..36b21771be9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -73,7 +73,7 @@ abstract class CommonObject public $table_element; /** - * @var int Name of subtable line + * @var string Name of subtable line */ public $table_element_line = ''; From a3dd454f86dfea0f1f24edf9ecf696a4eea9c7d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 08:00:34 +0100 Subject: [PATCH 44/63] The property db does not exist on mod_arctic --- htdocs/core/modules/fichinter/mod_arctic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index 4d8ea35e4d9..3087864b38a 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -63,11 +63,11 @@ class mod_arctic extends ModeleNumRefFicheinter */ public function info() { - global $conf, $langs; + global $db, $conf, $langs; $langs->load("bills"); - $form = new Form($this->db); + $form = new Form($db); $texte = $langs->trans('GenericNumRefModelDesc')."
\n"; $texte.= '
'; From c269229aab6a0ac6ef8f52026b6418ea08836601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 08:12:55 +0100 Subject: [PATCH 45/63] doxygen --- htdocs/product/stock/lib/replenishment.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/lib/replenishment.lib.php b/htdocs/product/stock/lib/replenishment.lib.php index 01f10915ec2..0286b6bc480 100644 --- a/htdocs/product/stock/lib/replenishment.lib.php +++ b/htdocs/product/stock/lib/replenishment.lib.php @@ -110,7 +110,7 @@ function dispatchedOrders() * ordered * * @param int $product_id Product id - * @return void + * @return string|null */ function ordered($product_id) { @@ -155,7 +155,7 @@ function ordered($product_id) * getProducts * * @param int $order_id Order id - * @return void + * @return array|array[integer] */ function getProducts($order_id) { From cad54c6d7a8421678d56a2390b6614534d0d35c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 10:42:49 +0100 Subject: [PATCH 46/63] Update generate_filelist_xml.php --- build/generate_filelist_xml.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 25f4af98207..45955d04ce1 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -72,7 +72,7 @@ while ($i < $argc) if (empty($release)) { - print "Error: Missing release paramater\n"; + print "Error: Missing release parameter\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; exit -1; } @@ -164,7 +164,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1); // Need to ignore document custom etc. Note: this also ignore natively symbolic links. $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); */ -$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; +$regextoinclude='\.(php|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $dir=''; From a923a48e64ffec14d956049d5ae60446653c35b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 10:44:12 +0100 Subject: [PATCH 47/63] Update filecheck.php --- htdocs/admin/system/filecheck.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 14b25aedac2..7e3468160c6 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2007 Rodolphe Quiedeville * Copyright (C) 2007-2012 Regis Houssin - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2019 Frederic France * Copyright (C) 2017 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify @@ -214,7 +214,7 @@ if (! $error && $xml) $includecustom=(empty($xml->dolibarr_htdocs_dir[0]['includecustom'])?0:$xml->dolibarr_htdocs_dir[0]['includecustom']); // Defined qualified files (must be same than into generate_filelist_xml.php) - $regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; + $regextoinclude='\.(php|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude); From 030b78d79f1ab63f3b129363f4c1fff939dfc32e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 11:16:04 +0100 Subject: [PATCH 48/63] Update generate_filelist_xml.php --- build/generate_filelist_xml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 45955d04ce1..490b8ca9f37 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -164,7 +164,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1); // Need to ignore document custom etc. Note: this also ignore natively symbolic links. $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); */ -$regextoinclude='\.(php|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; +$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $dir=''; From 6e64a20f9e859d4b6f039ed1c1ad3d763bb156fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 11:16:46 +0100 Subject: [PATCH 49/63] Update filecheck.php --- htdocs/admin/system/filecheck.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 7e3468160c6..ef1132c272c 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -214,7 +214,7 @@ if (! $error && $xml) $includecustom=(empty($xml->dolibarr_htdocs_dir[0]['includecustom'])?0:$xml->dolibarr_htdocs_dir[0]['includecustom']); // Defined qualified files (must be same than into generate_filelist_xml.php) - $regextoinclude='\.(php|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; + $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude); From 18e3a4bcbb7f9018f3b9cd5a5102c335991047f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 12:56:02 +0100 Subject: [PATCH 50/63] Update generate_filelist_xml.php --- build/generate_filelist_xml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 490b8ca9f37..d8bb0882f6b 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -164,7 +164,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1); // Need to ignore document custom etc. Note: this also ignore natively symbolic links. $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); */ -$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; +$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $dir=''; From 50937f8ca14c046ec76daba922006abf00fc64ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 12:56:48 +0100 Subject: [PATCH 51/63] Update filecheck.php --- htdocs/admin/system/filecheck.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index ef1132c272c..bf777180314 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -214,7 +214,7 @@ if (! $error && $xml) $includecustom=(empty($xml->dolibarr_htdocs_dir[0]['includecustom'])?0:$xml->dolibarr_htdocs_dir[0]['includecustom']); // Defined qualified files (must be same than into generate_filelist_xml.php) - $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|css|scss|html|xml|js|json|tpl|jpg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; + $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude); From bac5c3800e2bfc25b70ae83c378339829b2b5cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 14:46:27 +0100 Subject: [PATCH 52/63] Update api_setup.class.php --- htdocs/api/class/api_setup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index ef2b4c8bb6d..35a6770ead7 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -711,7 +711,7 @@ class Setup extends DolibarrApi $includecustom=(empty($xml->dolibarr_htdocs_dir[0]['includecustom'])?0:$xml->dolibarr_htdocs_dir[0]['includecustom']); // Defined qualified files (must be same than into generate_filelist_xml.php) - $regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; + $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude); From 874eab1619ec34b5fdabc5713f0e34cb7a4eadb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 13 Dec 2019 14:51:18 +0100 Subject: [PATCH 53/63] $type and $module are not defined --- htdocs/api/class/api_setup.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 05bad1bbe7e..a92a372cc99 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1286,9 +1286,9 @@ class Setup extends DolibarrApi $sql = "SELECT rowid, code, pos, label, use_default, description"; $sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_type as t"; - $sql .= " WHERE t.active = ".$active; - if ($type) $sql .= " AND t.type LIKE '%".$this->db->escape($type)."%'"; - if ($module) $sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'"; + $sql .= " WHERE t.active = ".(int) $active; + // if ($type) $sql .= " AND t.type LIKE '%".$this->db->escape($type)."%'"; + // if ($module) $sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'"; // Add sql filters if ($sqlfilters) { From 9f2a628c3b1dd68d7cc56ebf5b2ff73c187a7b2a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Dec 2019 13:25:21 +0100 Subject: [PATCH 54/63] Remove bak file --- build/generate_filelist_xml.php | 2 +- htdocs/admin/system/filecheck.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index d8bb0882f6b..c2d9fa37e69 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -164,7 +164,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1); // Need to ignore document custom etc. Note: this also ignore natively symbolic links. $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); */ -$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; +$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $dir=''; diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index bf777180314..fbdfd71c34e 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -214,7 +214,7 @@ if (! $error && $xml) $includecustom=(empty($xml->dolibarr_htdocs_dir[0]['includecustom'])?0:$xml->dolibarr_htdocs_dir[0]['includecustom']); // Defined qualified files (must be same than into generate_filelist_xml.php) - $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; + $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude); From 31a60ff30b8116f8fe7a8d14171699bd19aba835 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Dec 2019 14:41:27 +0100 Subject: [PATCH 55/63] Fix $db --- htdocs/core/class/utils.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 12972a89752..5007e642300 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -586,7 +586,7 @@ class Utils */ function generateDoc($module) { - global $conf, $langs, $db; + global $conf, $langs; global $dirins; $error = 0; @@ -708,7 +708,7 @@ class Utils $outfile=$dirofmoduletmp.'/out.tmp'; require_once DOL_DOCUMENT_ROOT.'/core/class/utils.class.php'; - $utils = new Utils($db); + $utils = new Utils($this->db); $resarray = $utils->executeCLI($command, $outfile); if ($resarray['result'] != '0') { From f15d65c2b966e01ff4898101d51c52a9baf94d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 14 Dec 2019 16:09:48 +0100 Subject: [PATCH 56/63] doxygen --- htdocs/core/modules/cheque/mod_chequereceipt_mint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php index dfdc0df0fe4..730bed1d247 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php @@ -22,7 +22,7 @@ * \brief File containing class for numbering module Mint */ -require_once DOL_DOCUMENT_ROOT .'/core/modules/cheque/modules_chequereceipts.php'; +require_once DOL_DOCUMENT_ROOT .'/core/modules/cheque/modules_chequereceipt.php'; /** * Class to manage cheque receipts numbering rules Mint From ddc827e48e58f3fdade7916cb7bc5aad2e03c086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 14 Dec 2019 16:11:27 +0100 Subject: [PATCH 57/63] Update mod_chequereceipt_thyme.php --- htdocs/core/modules/cheque/mod_chequereceipt_thyme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php index 1855e51f4bc..ddcb5d1965b 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/core/modules/cheque/mod_chequereceipts_thyme.php + * \file htdocs/core/modules/cheque/mod_chequereceipt_thyme.php * \ingroup cheque * \brief File containing class for numbering module Thyme */ From 440b846e9a613f1f9feee8a1eb7d80c347513c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 14 Dec 2019 16:12:38 +0100 Subject: [PATCH 58/63] Update mod_chequereceipt_mint.php --- htdocs/core/modules/cheque/mod_chequereceipt_mint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php index 730bed1d247..d72f8286488 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php @@ -22,7 +22,7 @@ * \brief File containing class for numbering module Mint */ -require_once DOL_DOCUMENT_ROOT .'/core/modules/cheque/modules_chequereceipt.php'; +require_once DOL_DOCUMENT_ROOT .'/core/modules/cheque/mod_chequereceipt_mint.php'; /** * Class to manage cheque receipts numbering rules Mint From 8c7f0e669b3a04bfd6d8aa01f1645de4cbb584e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 14 Dec 2019 16:13:48 +0100 Subject: [PATCH 59/63] Update mod_chequereceipt_mint.php --- htdocs/core/modules/cheque/mod_chequereceipt_mint.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php index d72f8286488..8ee74065583 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php @@ -17,12 +17,12 @@ */ /** - * \file htdocs/core/modules/cheque/mod_chequereceipts_mint.php + * \file htdocs/core/modules/cheque/mod_chequereceipt_mint.php * \ingroup cheque * \brief File containing class for numbering module Mint */ -require_once DOL_DOCUMENT_ROOT .'/core/modules/cheque/mod_chequereceipt_mint.php'; +require_once DOL_DOCUMENT_ROOT .'/core/modules/cheque/modules_chequereceipts.php'; /** * Class to manage cheque receipts numbering rules Mint From 7eee26cc0f86d1e1f3158c8eed68d19af8a7fc5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 14 Dec 2019 16:18:41 +0100 Subject: [PATCH 60/63] Update project.php --- htdocs/projet/admin/project.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index bd6c5eacc47..f129f2abc62 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -22,7 +22,7 @@ */ /** - * \file htdocs/admin/project.php + * \file htdocs/projet/admin/project.php * \ingroup project * \brief Page to setup project module */ From a6f0a7f49913482dae5c739a05022b8a2b3f2dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 14 Dec 2019 16:19:59 +0100 Subject: [PATCH 61/63] Update note.php --- htdocs/reception/note.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index 838128b871e..82b5724908e 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/reception/nosendingte.php + * \file htdocs/reception/note.php * \ingroup receptionsending * \brief Note card reception */ From bd270cd535a04fac16170f72d4c54713e418199c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 14 Dec 2019 16:21:18 +0100 Subject: [PATCH 62/63] Update dolresource.class.php --- htdocs/resource/class/dolresource.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index e2c00528781..2b3b0613092 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -16,7 +16,7 @@ */ /** - * \file resource/class/resource.class.php + * \file htdocs/resource/class/dolresource.class.php * \ingroup resource * \brief Class file for resource object */ From 9685b56375b653361bed0729d0cd6e83cdbafbc2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Dec 2019 15:03:22 +0100 Subject: [PATCH 63/63] Fix warning --- htdocs/compta/bank/class/account.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index aca498c1ed6..594cad56ea0 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1427,6 +1427,7 @@ class Account extends CommonObject if (!empty($this->iban)) { // If IBAN defined, we can know country of account from it + $reg = array(); if (preg_match("/^([a-zA-Z][a-zA-Z])/i", $this->iban, $reg)) return $reg[1]; }