From 530b122f1eec0cd16cd8136bab6c7714ba1a1a0b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 1 Apr 2021 04:37:47 +0200 Subject: [PATCH 001/216] FIX: Periodicity by default on fiscal year, according to the date, we have plus 1 year added --- htdocs/core/lib/accounting.lib.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 20ffa3f52b6..789a84df04d 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -1,8 +1,8 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro - * Copyright (C) 2014 Florian Henry - * Copyright (C) 2019 Eric Seigne +/* Copyright (C) 2013-2014 Olivier Geffroy + * Copyright (C) 2013-2021 Alexandre Spangaro + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2019 Eric Seigne * * 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 @@ -257,8 +257,8 @@ function getDefaultDatesForTransfer() $periodbydefaultontransfer = $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER; isset($periodbydefaultontransfer) ? $periodbydefaultontransfer : 0; if ($periodbydefaultontransfer == 2) { - $sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; - $sql .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'"; + $sql = "SELECT date_start, date_end FROM ".MAIN_DB_PREFIX."accounting_fiscalyear "; + $sql .= " WHERE date_start < '".$db->idate(dol_now())."' AND date_end > '".$db->idate(dol_now())."'"; $sql .= $db->plimit(1); $res = $db->query($sql); if ($res->num_rows > 0) { @@ -268,6 +268,9 @@ function getDefaultDatesForTransfer() } else { $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1); $year_start = dol_print_date(dol_now(), '%Y'); + if ($conf->global->SOCIETE_FISCAL_MONTH_START > dol_print_date(dol_now(), '%m')) { + $year_start = $year_start - 1; + } $year_end = $year_start + 1; $month_end = $month_start - 1; if ($month_end < 1) From f5617a6247dc437f58eafd9983cb96256bc10999 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Thu, 1 Apr 2021 12:33:23 +0200 Subject: [PATCH 002/216] FIX 13.0 warning - missing quotes around 'label' --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a4fe3df4034..98cb6d61efa 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7207,7 +7207,7 @@ class Form print ''.$objp->ref.''; print ''.(!empty($objp->ref_client) ? $objp->ref_client : $objp->ref_supplier).''; print ''; - if ($possiblelink[label] == 'LinkToContract') { + if ($possiblelink['label'] == 'LinkToContract') { $form = new Form($db); print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; } From 60e13f672705f9a1aedc6d4c76a0efa8be9085ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Apr 2021 22:20:13 +0200 Subject: [PATCH 003/216] FIX #17060 --- htdocs/fourn/class/api_supplier_orders.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index 254e577f2f2..fe74a763eba 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -72,7 +72,7 @@ class SupplierOrders extends DolibarrApi throw new RestException(404, 'Supplier order not found'); } - if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) { + if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, 'commande_fournisseur', 'commande')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -239,7 +239,7 @@ class SupplierOrders extends DolibarrApi throw new RestException(404, 'Supplier order not found'); } - if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) { + if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, 'commande_fournisseur', 'commande')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -270,7 +270,7 @@ class SupplierOrders extends DolibarrApi throw new RestException(404, 'Supplier order not found'); } - if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) { + if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, 'commande_fournisseur', 'commande')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -315,7 +315,7 @@ class SupplierOrders extends DolibarrApi throw new RestException(404, 'Order not found'); } - if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) { + if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, 'commande_fournisseur', 'commande')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } From 5e9ce734a7c7926b1783a89af8ed50af000ee4cc Mon Sep 17 00:00:00 2001 From: Youvious Date: Sat, 3 Apr 2021 15:14:33 +0200 Subject: [PATCH 004/216] Clean llx_accounting_account_be.sql of all 'PRODUCT' and 'SERVICE' (pcg_subtype) --- .../mysql/data/llx_accounting_account_be.sql | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_be.sql b/htdocs/install/mysql/data/llx_accounting_account_be.sql index b1e3dadff90..e99fa1e54fe 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_be.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_be.sql @@ -655,11 +655,11 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1062, 'PCMN-BASE', 'FINAN', '578', '1060', 'Caisses - timbres ( 0 - fiscaux ; 1 - postaux)', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1063, 'PCMN-BASE', 'FINAN', '58', '1355', 'Virements internes', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1064, 'PCMN-BASE', 'EXPENSE', '60', '1356', 'Approvisionnements et marchandises', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1065, 'PCMN-BASE', 'EXPENSE', 'PRODUCT', '600', '1064', 'Achats de matières premières', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1066, 'PCMN-BASE', 'EXPENSE', 'PRODUCT', '601', '1064', 'Achats de fournitures', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1067, 'PCMN-BASE', 'EXPENSE', 'SERVICE', '602', '1064', 'Achats de services, travaux et études', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1065, 'PCMN-BASE', 'EXPENSE', '600', '1064', 'Achats de matières premières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1066, 'PCMN-BASE', 'EXPENSE', '601', '1064', 'Achats de fournitures', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1067, 'PCMN-BASE', 'EXPENSE', '602', '1064', 'Achats de services, travaux et études', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1068, 'PCMN-BASE', 'EXPENSE', '603', '1064', 'Sous-traitances générales', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1069, 'PCMN-BASE', 'EXPENSE', 'PRODUCT', '604', '1064', 'Achats de marchandises', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1069, 'PCMN-BASE', 'EXPENSE', '604', '1064', 'Achats de marchandises', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1070, 'PCMN-BASE', 'EXPENSE', '605', '1064', 'Achats d''immeubles destinés à la revente', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1071, 'PCMN-BASE', 'EXPENSE', '608', '1064', 'Remises , ristournes et rabais obtenus sur achats', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1072, 'PCMN-BASE', 'EXPENSE', '609', '1064', 'Variations de stocks', 1); @@ -849,24 +849,24 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1256, 'PCMN-BASE', 'EXPENSE', '695', '1250', 'Administrateurs ou gérants', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1257, 'PCMN-BASE', 'EXPENSE', '696', '1250', 'Autres allocataires', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1258, 'PCMN-BASE', 'INCOME', '70', '1357', 'Chiffre d''affaires', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1260, 'PCMN-BASE', 'INCOME', 'PRODUCT', '700', '1258', 'Ventes de marchandises', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1261, 'PCMN-BASE', 'INCOME', 'PRODUCT', '7000', '1260', 'Ventes en Belgique', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1262, 'PCMN-BASE', 'INCOME', 'PRODUCT', '7001', '1260', 'Ventes dans les pays membres de la C.E.E.', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1263, 'PCMN-BASE', 'INCOME', 'PRODUCT', '7002', '1260', 'Ventes à l''exportation', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1264, 'PCMN-BASE', 'INCOME', 'PRODUCT', '701', '1258', 'Ventes de produits finis', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1265, 'PCMN-BASE', 'INCOME', 'PRODUCT', '7010', '1264', 'Ventes en Belgique', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1266, 'PCMN-BASE', 'INCOME', 'PRODUCT', '7011', '1264', 'Ventes dans les pays membres de la C.E.E.', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1267, 'PCMN-BASE', 'INCOME', 'PRODUCT', '7012', '1264', 'Ventes à l''exportation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1260, 'PCMN-BASE', 'INCOME', '700', '1258', 'Ventes de marchandises', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1261, 'PCMN-BASE', 'INCOME', '7000', '1260', 'Ventes en Belgique', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1262, 'PCMN-BASE', 'INCOME', '7001', '1260', 'Ventes dans les pays membres de la C.E.E.', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1263, 'PCMN-BASE', 'INCOME', '7002', '1260', 'Ventes à l''exportation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1264, 'PCMN-BASE', 'INCOME', '701', '1258', 'Ventes de produits finis', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1265, 'PCMN-BASE', 'INCOME', '7010', '1264', 'Ventes en Belgique', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1266, 'PCMN-BASE', 'INCOME', '7011', '1264', 'Ventes dans les pays membres de la C.E.E.', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1267, 'PCMN-BASE', 'INCOME', '7012', '1264', 'Ventes à l''exportation', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1268, 'PCMN-BASE', 'INCOME', '702', '1258', 'Ventes de déchets et rebuts', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1269, 'PCMN-BASE', 'INCOME', '7020', '1268', 'Ventes en Belgique', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1270, 'PCMN-BASE', 'INCOME', '7021', '1268', 'Ventes dans les pays membres de la C.E.E.', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1271, 'PCMN-BASE', 'INCOME', '7022', '1268', 'Ventes à l''exportation', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1272, 'PCMN-BASE', 'INCOME', '703', '1258', 'Ventes d''emballages récupérables', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1273, 'PCMN-BASE', 'INCOME', '704', '1258', 'Facturations des travaux en cours (associations momentanées)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1274, 'PCMN-BASE', 'INCOME', 'SERVICE', '705', '1258', 'Prestations de services', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1275, 'PCMN-BASE', 'INCOME', 'SERVICE', '7050', '1274', 'Prestations de services en Belgique', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1276, 'PCMN-BASE', 'INCOME', 'SERVICE', '7051', '1274', 'Prestations de services dans les pays membres de la C.E.E.', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1277, 'PCMN-BASE', 'INCOME', 'SERVICE', '7052', '1274', 'Prestations de services en vue de l''exportation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1274, 'PCMN-BASE', 'INCOME', '705', '1258', 'Prestations de services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1275, 'PCMN-BASE', 'INCOME', '7050', '1274', 'Prestations de services en Belgique', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1276, 'PCMN-BASE', 'INCOME', '7051', '1274', 'Prestations de services dans les pays membres de la C.E.E.', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1277, 'PCMN-BASE', 'INCOME', '7052', '1274', 'Prestations de services en vue de l''exportation', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1278, 'PCMN-BASE', 'INCOME', '706', '1258', 'Pénalités et dédits obtenus par l''entreprise', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1279, 'PCMN-BASE', 'INCOME', '708', '1258', 'Remises, ristournes et rabais accordés', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1280, 'PCMN-BASE', 'INCOME', '7080', '1279', 'Sur ventes de marchandises', 1); From a50ca93a3e878e94ad70656b916cfd42e547fdc6 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 4 Apr 2021 08:06:59 +0200 Subject: [PATCH 005/216] FIX: Accountancy - Warning on the pages of the preparatory statements of accounting entries --- htdocs/accountancy/journal/bankjournal.php | 7 +++++-- htdocs/accountancy/journal/expensereportsjournal.php | 7 +++++-- htdocs/accountancy/journal/purchasesjournal.php | 8 +++++--- htdocs/accountancy/journal/sellsjournal.php | 8 +++++--- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index c47255647cb..d8368bba182 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -985,8 +985,11 @@ if (empty($action) || $action == 'view') { if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1' || ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1' || empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') { - print '
'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); - print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); + print '
'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); + $desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}'); + $desc = str_replace('{link}', ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'', $desc); + print $desc; + print '
'; } diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 70ec097cd27..5a334e0e741 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -498,8 +498,11 @@ if (empty($action) || $action == 'view') { // Button to write into Ledger if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') { - print '
'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); - print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); + print '
'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); + $desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}'); + $desc = str_replace('{link}', ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'', $desc); + print $desc; + print '
'; } print '
'; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 611dde36af5..d064aae33af 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -728,9 +728,11 @@ if (empty($action) || $action == 'view') { // Button to write into Ledger if (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') { - print '
'; - print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); - print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); + print '
'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); + $desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}'); + $desc = str_replace('{link}', ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'', $desc); + print $desc; + print '
'; } print '
'; if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print ''; diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 62d2238a116..2a13b0153c6 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -667,9 +667,11 @@ if (empty($action) || $action == 'view') { // Button to write into Ledger if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') { - print '
'; - print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); - print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); + print '
'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); + $desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}'); + $desc = str_replace('{link}', ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'', $desc); + print $desc; + print '
'; } print '
'; if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print ''; From bd88806982c9ef6eadb23a9c6ce46a5bc0c5af56 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 5 Apr 2021 12:07:51 +0200 Subject: [PATCH 006/216] Fix order status label in comm index page --- htdocs/comm/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index af5b4ac41a5..82081f6f661 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -839,7 +839,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { $langs->load("orders"); - $sql = "SELECT s.nom as name, s.rowid, c.rowid as commandeid, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed"; + $sql = "SELECT s.nom as name, s.rowid, c.rowid as commandeid, c.fk_statut, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed"; $sql .= ", s.code_client"; $sql .= ", s.entity"; $sql .= ", s.email"; @@ -877,6 +877,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) $orderstatic->id = $obj->commandeid; $orderstatic->ref = $obj->ref; + $orderstatic->statut = $obj->fk_statut; $orderstatic->ref_client = $obj->ref_client; $orderstatic->total_ht = $obj->total_ht; $orderstatic->total_tva = $obj->total_tva; From 235725b528aaf6eadbbe8811dbc07564852b6f52 Mon Sep 17 00:00:00 2001 From: Ahmad Hadeed Date: Mon, 5 Apr 2021 19:57:33 +0300 Subject: [PATCH 007/216] Add support for Friday as a holiday and some comment alignment fixes --- htdocs/core/lib/date.lib.php | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index ecf1cf999de..9e921f0f42a 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -658,20 +658,21 @@ function getGMTEasterDatetime($year) } /** - * Return the number of non working days including saturday and sunday (or not) between 2 dates in timestamp. + * Return the number of non working days including saturday and sunday (or not) between 2 dates in timestamp. * Dates must be UTC with hour, min, sec to 0. - * Called by function num_open_day() + * Called by function num_open_day() * - * @param int $timestampStart Timestamp start (UTC with hour, min, sec = 0) - * @param int $timestampEnd Timestamp end (UTC with hour, min, sec = 0) - * @param string $country_code Country code - * @param int $lastday Last day is included, 0: no, 1:yes - * @param int $includesaturday Include saturday as non working day (-1=use setup, 0=no, 1=yes) - * @param int $includesunday Include sunday as non working day (-1=use setup, 0=no, 1=yes) - * @return int|string Number of non working days or error message string if error + * @param int $timestampStart Timestamp start (UTC with hour, min, sec = 0) + * @param int $timestampEnd Timestamp end (UTC with hour, min, sec = 0) + * @param string $country_code Country code + * @param int $lastday Last day is included, 0: no, 1:yes + * @param int $includefriday Include friday as non working day (-1=use setup, 0=no, 1=yes) + * @param int $includesaturday Include saturday as non working day (-1=use setup, 0=no, 1=yes) + * @param int $includesunday Include sunday as non working day (-1=use setup, 0=no, 1=yes) + * @return int|string Number of non working days or error message string if error * @see num_between_day(), num_open_day() */ -function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $lastday = 0, $includesaturday = -1, $includesunday = -1) +function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $lastday = 0, $includefriday = -1, $includesaturday = -1, $includesunday = -1) { global $db, $conf, $mysoc; @@ -685,7 +686,9 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', if (empty($country_code)) { $country_code = $mysoc->country_code; } - + if ($includefriday < 0) { + $includefriday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY : 1); + } if ($includesaturday < 0) { $includesaturday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY : 1); } @@ -838,15 +841,20 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', // If we have to include saturday and sunday if (!$ferie) { - if ($includesaturday || $includesunday) { + if ($includefriday || $includesaturday || $includesunday) { $jour_julien = unixtojd($timestampStart); $jour_semaine = jddayofweek($jour_julien, 0); - if ($includesaturday) { //Saturday (6) and Sunday (0) + if ($includefriday) { //Friday (5), Saturday (6) and Sunday (0) + if ($jour_semaine == 5) { + $ferie = true; + } + } + if ($includesaturday) { //Friday (5), Saturday (6) and Sunday (0) if ($jour_semaine == 6) { $ferie = true; } } - if ($includesunday) { //Saturday (6) and Sunday (0) + if ($includesunday) { //Friday (5), Saturday (6) and Sunday (0) if ($jour_semaine == 0) { $ferie = true; } From caa2facd47a52283be710f2abf9a4f47327afd9c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 5 Apr 2021 17:09:25 +0000 Subject: [PATCH 008/216] Fixing style errors. --- htdocs/core/lib/date.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 9e921f0f42a..56f456e7c51 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -687,8 +687,8 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $country_code = $mysoc->country_code; } if ($includefriday < 0) { - $includefriday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY : 1); - } + $includefriday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY : 1); + } if ($includesaturday < 0) { $includesaturday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY : 1); } @@ -845,10 +845,10 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $jour_julien = unixtojd($timestampStart); $jour_semaine = jddayofweek($jour_julien, 0); if ($includefriday) { //Friday (5), Saturday (6) and Sunday (0) - if ($jour_semaine == 5) { - $ferie = true; - } - } + if ($jour_semaine == 5) { + $ferie = true; + } + } if ($includesaturday) { //Friday (5), Saturday (6) and Sunday (0) if ($jour_semaine == 6) { $ferie = true; From f2f2aed6cd715377cacd676f97e4711ff5a866ce Mon Sep 17 00:00:00 2001 From: Ahmad Hadeed Date: Mon, 5 Apr 2021 22:05:22 +0300 Subject: [PATCH 009/216] Fix 3 weekend holiday behavior after adding support to Friday as a holiday. --- htdocs/core/lib/date.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 56f456e7c51..2d4bb04abb3 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -658,7 +658,7 @@ function getGMTEasterDatetime($year) } /** - * Return the number of non working days including saturday and sunday (or not) between 2 dates in timestamp. + * Return the number of non working days including Friday, Saturday and Sunday (or not) between 2 dates in timestamp. * Dates must be UTC with hour, min, sec to 0. * Called by function num_open_day() * @@ -687,7 +687,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $country_code = $mysoc->country_code; } if ($includefriday < 0) { - $includefriday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY : 1); + $includefriday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY : 0); } if ($includesaturday < 0) { $includesaturday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY : 1); @@ -839,7 +839,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', } //print "ferie=".$ferie."\n"; - // If we have to include saturday and sunday + // If we have to include Friday, Saturday and Sunday if (!$ferie) { if ($includefriday || $includesaturday || $includesunday) { $jour_julien = unixtojd($timestampStart); From 4015e1607f49f4db183fa2d527d2db688746c494 Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Tue, 6 Apr 2021 17:34:50 +0200 Subject: [PATCH 010/216] add masks to product_lot --- htdocs/product/admin/product_lot.php | 94 ++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php index d1b87bf0b14..79e64940d8f 100644 --- a/htdocs/product/admin/product_lot.php +++ b/htdocs/product/admin/product_lot.php @@ -72,6 +72,12 @@ if ($action == 'updateMaskLot') { dolibarr_set_const($db, "PRODUCTBATCH_LOT_ADDON", $value, 'chaine', 0, '', $conf->entity); } elseif ($action == 'setmodsn') { dolibarr_set_const($db, "PRODUCTBATCH_SN_ADDON", $value, 'chaine', 0, '', $conf->entity); +} +if ($action == 'setmaskslot') { + dolibarr_set_const($db, "PRODUCTBATCH_LOT_USE_PRODUCT_MASKS", $value, 'chaine', 0, '', $conf->entity); +} +if ($action == 'setmaskssn') { + dolibarr_set_const($db, "PRODUCTBATCH_SN_USE_PRODUCT_MASKS", $value, 'chaine', 0, '', $conf->entity); } /* @@ -176,6 +182,50 @@ foreach ($dirmodels as $reldir) { } } closedir($handle); + print 'lot_product'."\n"; + print $langs->trans('CustomMasks'); + print ''; + + // Show example of numbering model + print ''; + $tmp = 'NoExample'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; + elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + else print $langs->trans($tmp); + print ''."\n"; + + print ''; + if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS == 'true') { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; + + // Info + $htmltooltip = ''; + $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
'; + $nextval = $module->getNextValue($mysoc, $batch); + if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval + $htmltooltip .= ''.$langs->trans("NextValue").': '; + if ($nextval) { + if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') + $nextval = $langs->trans($nextval); + $htmltooltip .= $nextval.'
'; + } else { + $htmltooltip .= $langs->trans($module->error).'
'; + } + } + + print ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print ''; + + print "\n"; } } } @@ -268,6 +318,50 @@ foreach ($dirmodels as $reldir) { } } closedir($handle); + print 'sn_product'."\n"; + print $langs->trans('CustomMasks'); + print ''; + + // Show example of numbering model + print ''; + $tmp = 'NoExample'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; + elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + else print $langs->trans($tmp); + print ''."\n"; + + print ''; + if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS == 'true') { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; + + // Info + $htmltooltip = ''; + $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
'; + $nextval = $module->getNextValue($mysoc, $batch); + if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval + $htmltooltip .= ''.$langs->trans("NextValue").': '; + if ($nextval) { + if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') + $nextval = $langs->trans($nextval); + $htmltooltip .= $nextval.'
'; + } else { + $htmltooltip .= $langs->trans($module->error).'
'; + } + } + + print ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print ''; + + print "\n"; } } } From 4d60fe8ff9ff9c3971185b0a2307fe785cef41a6 Mon Sep 17 00:00:00 2001 From: Indelog Date: Tue, 6 Apr 2021 22:21:00 +0200 Subject: [PATCH 011/216] Fix empty $sublang dolSavePageAlias Avoid to loop on `explode(',', $object->otherlang)` if `$object->otherlang` is empty. Else we loop once on empty string which is set in `$sublang` and erase the main alias for the page. --- htdocs/core/lib/website2.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 380a7c0dc12..0258d3d2c05 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -104,7 +104,7 @@ function dolSavePageAlias($filealias, $object, $objectpage) } // Save also alias into all language subdirectories if it is a main language elseif (empty($objectpage->lang) || !in_array($objectpage->lang, explode(',', $object->otherlang))) { - if (empty($conf->global->WEBSITE_DISABLE_MAIN_LANGUAGE_INTO_LANGSUBDIR)) { + if (empty($conf->global->WEBSITE_DISABLE_MAIN_LANGUAGE_INTO_LANGSUBDIR) && !empty($object->otherlang)) { $dirname = dirname($filealias); $filename = basename($filealias); foreach (explode(',', $object->otherlang) as $sublang) { From 6609695a8d85ddab17fa60ba4762be8b6e08cb27 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Apr 2021 00:30:28 +0200 Subject: [PATCH 012/216] index.html not required, there is already index.php --- htdocs/hrm/index.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 htdocs/hrm/index.html diff --git a/htdocs/hrm/index.html b/htdocs/hrm/index.html deleted file mode 100644 index e69de29bb2d..00000000000 From 04a55a3df34a0e05a06315faeb851057e9138743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Lukas?= Date: Wed, 7 Apr 2021 09:08:34 +0200 Subject: [PATCH 013/216] Fix #17146 --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index ec05ad5d98d..dfc324c1c00 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -465,7 +465,7 @@ abstract class CommonDocGenerator $array_key.'_total_localtax2'=>price2num($object->total_localtax2), $array_key.'_total_ttc'=>price2num($object->total_ttc), - $array_key.'_multicurrency_code' => price2num($object->multicurrency_code), + $array_key.'_multicurrency_code' => $object->multicurrency_code, $array_key.'_multicurrency_tx' => price2num($object->multicurrency_tx), $array_key.'_multicurrency_total_ht' => price2num($object->multicurrency_total_ht), $array_key.'_multicurrency_total_tva' => price2num($object->multicurrency_total_tva), From 17fa9559a3037ce8cfd5e23143977705eec66db5 Mon Sep 17 00:00:00 2001 From: Indelog Date: Wed, 7 Apr 2021 09:29:40 +0200 Subject: [PATCH 014/216] Fix empty string WEBSITE_OTHERLANG If post WEBSITE_OTHERLANG with empty value or with value like this 'en,,sv' or 'en,sv,' we can get an otherlang with empty value. This can lead unexpected behaviour when we use an element of otherlang to set the subdirectory name to store pages for a sub lang. --- htdocs/core/lib/website2.lib.php | 4 +++- htdocs/website/class/website.class.php | 4 ++++ htdocs/website/index.php | 13 +++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 0258d3d2c05..e922087d0a9 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -104,10 +104,12 @@ function dolSavePageAlias($filealias, $object, $objectpage) } // Save also alias into all language subdirectories if it is a main language elseif (empty($objectpage->lang) || !in_array($objectpage->lang, explode(',', $object->otherlang))) { - if (empty($conf->global->WEBSITE_DISABLE_MAIN_LANGUAGE_INTO_LANGSUBDIR) && !empty($object->otherlang)) { + if (empty($conf->global->WEBSITE_DISABLE_MAIN_LANGUAGE_INTO_LANGSUBDIR)) { $dirname = dirname($filealias); $filename = basename($filealias); foreach (explode(',', $object->otherlang) as $sublang) { + // Avoid to erase main alias file if $sublang is empty string + if (empty(trim($sublang))) continue; $filealiassub = $dirname.'/'.$sublang.'/'.$filename; $aliascontent = 'otherlang); if (is_array($tmparray)) { foreach ($tmparray as $key => $val) { + // It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,' + if (empty(trim($sublang))) continue; $tmparray[$key] = preg_replace('/[_-].*$/', '', trim($val)); // en_US or en-US -> en } $this->otherlang = join(',', $tmparray); @@ -494,6 +496,8 @@ class Website extends CommonObject $tmparray = explode(',', $this->otherlang); if (is_array($tmparray)) { foreach ($tmparray as $key => $val) { + // It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,' + if (empty(trim($val))) continue; $tmparray[$key] = preg_replace('/[_-].*$/', '', trim($val)); // en_US or en-US -> en } $this->otherlang = join(',', $tmparray); diff --git a/htdocs/website/index.php b/htdocs/website/index.php index ebcf31ad2c5..03ce856c2a1 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -551,6 +551,8 @@ if ($action == 'addsite') { $arrayotherlang = explode(',', GETPOST('WEBSITE_OTHERLANG', 'alphanohtml')); foreach ($arrayotherlang as $key => $val) { + // It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,' + if (empty(trim($val))) continue; $arrayotherlang[$key] = substr(trim($val), 0, 2); // Kept short language code only } @@ -1327,6 +1329,8 @@ if ($action == 'updatecss') { $arrayotherlang = explode(',', GETPOST('WEBSITE_OTHERLANG', 'alphanohtml')); foreach ($arrayotherlang as $key => $val) { + // It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,' + if (empty(trim($val))) continue; $arrayotherlang[$key] = substr(trim($val), 0, 2); // Kept short language code only } @@ -1768,6 +1772,10 @@ if ($action == 'updatemeta') $filename = basename($fileoldalias); $sublangs = explode(',', $object->otherlang); foreach ($sublangs as $sublang) { + // Under certain conditions $sublang can be an empty string + // ($object->otherlang with empty string or with string like this 'en,,sv') + // if is the case we try to re-delete the main alias file. Avoid it. + if (empty(trim($sublang))) continue; $fileoldaliassub = $dirname.'/'.$sublang.'/'.$filename; dol_delete_file($fileoldaliassub); } @@ -1790,6 +1798,10 @@ if ($action == 'updatemeta') $filename = basename($pathofwebsite.'/'.trim($tmpaliasalt).'.php'); $sublangs = explode(',', $object->otherlang); foreach ($sublangs as $sublang) { + // Under certain conditions $ sublang can be an empty string + // ($object->otherlang with empty string or with string like this 'en,,sv') + // if is the case we try to re-delete the main alias file. Avoid it. + if (empty(trim($sublang))) continue; $fileoldaliassub = $dirname.'/'.$sublang.'/'.$filename; dol_delete_file($fileoldaliassub); } @@ -2710,6 +2722,7 @@ if (!GETPOST('hide_websitemenu')) $onlylang[$website->lang] = $website->lang.' ('.$langs->trans("Default").')'; } foreach (explode(',', $website->otherlang) as $langkey) { + if (empty(trim($langkey))) continue; $onlylang[$langkey] = $langkey; } $textifempty = $langs->trans("Default"); From 426e846f5874240eedfb1c6460472cf750a5c851 Mon Sep 17 00:00:00 2001 From: Indelog Date: Wed, 7 Apr 2021 10:01:05 +0200 Subject: [PATCH 015/216] Fix website create/update empty otherlang Empty otherlang value was not correctly ignored. --- htdocs/website/class/website.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 1c402b82d34..966e0e8e4d8 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -185,7 +185,10 @@ class Website extends CommonObject if (is_array($tmparray)) { foreach ($tmparray as $key => $val) { // It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,' - if (empty(trim($sublang))) continue; + if (empty(trim($val))) { + unset($tmparray[$key]); + continue; + } $tmparray[$key] = preg_replace('/[_-].*$/', '', trim($val)); // en_US or en-US -> en } $this->otherlang = join(',', $tmparray); @@ -497,7 +500,10 @@ class Website extends CommonObject if (is_array($tmparray)) { foreach ($tmparray as $key => $val) { // It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,' - if (empty(trim($val))) continue; + if (empty(trim($val))) { + unset($tmparray[$key]); + continue; + } $tmparray[$key] = preg_replace('/[_-].*$/', '', trim($val)); // en_US or en-US -> en } $this->otherlang = join(',', $tmparray); From f7b6e239e93568c2f37ce46daa16f24ed18694bd Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Wed, 7 Apr 2021 10:06:38 +0200 Subject: [PATCH 016/216] =?UTF-8?q?nouvelle=20page=20attendee=5Fsubscripti?= =?UTF-8?q?on=20cr=C3=A9=C3=A9e,=20lien=20ajout=C3=A9=20sur=20la=20confere?= =?UTF-8?q?nceorbooth=5Fcard=20(non=20cliquable)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/core/lib/project.lib.php | 2 +- htdocs/core/tpl/commonfields_view.tpl.php | 2 +- .../conferenceorbooth_card.php | 6 +- .../public/members/attendee_subscription.php | 745 ++++++++++++++++++ 4 files changed, 752 insertions(+), 3 deletions(-) create mode 100644 htdocs/public/members/attendee_subscription.php diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index abdb098eb7d..93cf562d7c1 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -204,7 +204,7 @@ function project_prepare_head(Project $project) $h++; } - if ($conf->eventorganization->enabled) { + if ($conf->eventorganization->enabled && !empty($project->usage_organize_event)) { $langs->load('eventorganization'); $head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_list.php?projectid=' . $project->id; $head[$h][1] = $langs->trans("ConferenceOrBoothTab"); diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index 0e661c6e078..4b7821c2dad 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -70,7 +70,7 @@ foreach ($object->fields as $key => $val) { print $langs->trans($val['label']); } print ''; - print 'id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field //unset($object->fields['fk_project']); // Hide field already shown in banner //unset($object->fields['fk_soc']); // Hide field already shown in banner + $link = 'http://localhost/dolibarr/htdocs/public/members/attendee_subscription.php'; + $object->fields['pubregister'] = array('type'=>'text', 'label'=>'Lien public d\'enregistrement à une conférence', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1); + $object->pubregister = $link; + $keyforbreak='pubregister'; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; - + //var_dump($object); // Other attributes. Fields from hook formObjectOptions and Extrafields. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/public/members/attendee_subscription.php b/htdocs/public/members/attendee_subscription.php new file mode 100644 index 00000000000..873742f99b9 --- /dev/null +++ b/htdocs/public/members/attendee_subscription.php @@ -0,0 +1,745 @@ + + * Copyright (C) 2001-2002 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018 Alexandre Spangaro + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/members/new.php + * \ingroup member + * \brief Example of form to add a new member + * + * Note that you can add following constant to change behaviour of page + * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form + * MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited + * MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe + * MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation) + * MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted + * MEMBER_NEWFORM_FORCETYPE Force type of member + * MEMBER_NEWFORM_FORCEMORPHY Force nature of member (mor/phy) + * MEMBER_NEWFORM_FORCECOUNTRYCODE Force country + */ + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + +// Init vars +$errmsg = ''; +$num = 0; +$error = 0; +$backtopage = GETPOST('backtopage', 'alpha'); +$action = GETPOST('action', 'aZ09'); + +// Load translation files +$langs->loadLangs(array("main", "members", "companies", "install", "other")); + +/* Security check +if (empty($conf->adherent->enabled)) { + accessforbidden('', 0, 0, 1); +} + +if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) { + print $langs->trans("Auto subscription form for public visitors has not been enabled"); + exit; +}*/ + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); + +$extrafields = new ExtraFields($db); + +$object = new Adherent($db); + +$user->loadDefaultValues(); + + +/** + * Show header for new member + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +{ + global $user, $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + + print ''; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
'; + // Output html code for logo + if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } + print '
'; + + print '
'; +} + +/** + * Show footer for new member + * + * @return void + */ +function llxFooterVierge() +{ + print '
'; + + printCommonFooter('public'); + + print "\n"; + print "\n"; +} + + + +/* + * Actions + */ +$parameters = array(); +// Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +// Action called when page is submitted +if (empty($reshook) && $action == 'add') { + $error = 0; + $urlback = ''; + + $db->begin(); + + // test if login already exists + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { + if (!GETPOST('login')) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Login"))."
\n"; + } + $sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$db->escape(GETPOST('login'))."'"; + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + } + if ($num != 0) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorLoginAlreadyExists")."
\n"; + } + if (!GETPOSTISSET("pass1") || !GETPOSTISSET("pass2") || GETPOST("pass1", 'none') == '' || GETPOST("pass2", 'none') == '' || GETPOST("pass1", 'none') != GETPOST("pass2", 'none')) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorPasswordsMustMatch")."
\n"; + } + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("EMail"))."
\n"; + } + } + if (GETPOST('type') <= 0) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"))."
\n"; + } + if (!in_array(GETPOST('morphy'), array('mor', 'phy'))) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('Nature'))."
\n"; + } + if (!GETPOST("lastname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n"; + } + if (GETPOST("firstname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n"; + } + if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; + } + $birthday = dol_mktime(GETPOST("birthhour", 'int'), GETPOST("birthmin", 'int'), GETPOST("birthsec", 'int'), GETPOST("birthmonth", 'int'), GETPOST("birthday", 'int'), GETPOST("birthyear", 'int')); + if (GETPOSTISSET("birthmonth") && empty($birthday)) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorBadDateFormat")."
\n"; + } + if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { + if (GETPOST("morphy") == 'mor' && GETPOST('budget') <= 0) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("TurnoverOrBudget"))."
\n"; + } + } + + if (GETPOSTISSET('public')) { + $public = 1; + } else { + $public = 0; + } + + if (!$error) { + // email a peu pres correct et le login n'existe pas + $adh = new Adherent($db); + $adh->statut = -1; + $adh->public = $public; + $adh->firstname = GETPOST("firstname"); + $adh->lastname = GETPOST("lastname"); + $adh->gender = GETPOST("gender"); + $adh->civility_id = GETPOST("civility_id"); + $adh->societe = GETPOST("societe"); + $adh->address = GETPOST("address"); + $adh->zip = GETPOST("zipcode"); + $adh->town = GETPOST("town"); + $adh->email = GETPOST("email"); + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { + $adh->login = GETPOST("login"); + $adh->pass = GETPOST("pass1"); + } + $adh->photo = GETPOST("photo"); + $adh->country_id = GETPOST("country_id", 'int'); + $adh->state_id = GETPOST("state_id", 'int'); + $adh->typeid = GETPOST("type", 'int'); + $adh->note_private = GETPOST("note_private"); + $adh->morphy = GETPOST("morphy"); + $adh->birth = $birthday; + + + // Fill array 'array_options' with data from add form + $extrafields->fetch_name_optionals_label($adh->table_element); + $ret = $extrafields->setOptionalsFromPost(null, $adh); + if ($ret < 0) { + $error++; + } + + $result = $adh->create($user); + if ($result > 0) { + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $object = $adh; + + $adht = new AdherentType($db); + $adht->fetch($object->typeid); + + if ($object->email) { + $subject = ''; + $msg = ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER; + + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs); + + if ($subjecttosend && $texttosend) { + $moreinheader = 'X-Dolibarr-Info: send_an_email by public/members/new.php'."\r\n"; + + $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader); + } + /*if ($result < 0) { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + }*/ + } + + // Send email to the foundation to say a new member subscribed with autosubscribe form + if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) && !empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT) && + !empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL)) { + // Define link to login card + $appli = constant('DOL_APPLICATION_TITLE'); + if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { + $appli = $conf->global->MAIN_APPLICATION_TITLE; + if (preg_match('/\d\.\d/', $appli)) { + if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { + $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core + } + } else { + $appli .= " ".DOL_VERSION; + } + } else { + $appli .= " ".DOL_VERSION; + } + + $to = $adh->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL); + $from = $conf->global->ADHERENT_MAIL_FROM; + $mailfile = new CMailFile( + '['.$appli.'] '.$conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT, + $to, + $from, + $adh->makeSubstitution($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL), + array(), + array(), + array(), + "", + "", + 0, + -1 + ); + + if (!$mailfile->sendfile()) { + dol_syslog($langs->trans("ErrorFailedToSendMail", $from, $to), LOG_ERR); + } + } + + if (!empty($backtopage)) { + $urlback = $backtopage; + } elseif (!empty($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION)) { + $urlback = $conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION; + // TODO Make replacement of __AMOUNT__, etc... + } else { + $urlback = $_SERVER["PHP_SELF"]."?action=added"; + } + + if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE) && $conf->global->MEMBER_NEWFORM_PAYONLINE != '-1') { + if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'all') { + $urlback = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref); + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox') { + $urlback = DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref); + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal') { + $urlback = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref); + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'stripe') { + $urlback = DOL_MAIN_URL_ROOT.'/public/stripe/newpayment.php?from=membernewform&source=membersubscription&ref='.$adh->ref; + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } else { + dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment"); + exit; + } + } + + if (!empty($entity)) { + $urlback .= '&entity='.$entity; + } + dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback); + } else { + $error++; + $errmsg .= join('
', $adh->errors); + } + } + + if (!$error) { + $db->commit(); + + Header("Location: ".$urlback); + exit; + } else { + $db->rollback(); + } +} + +// Action called after a submitted was send and member created successfully +// If MEMBER_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url. +// backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url. +if (empty($reshook) && $action == 'added') { + llxHeaderVierge($langs->trans("NewMemberForm")); + + // Si on a pas ete redirige + print '
'; + print '
'; + print $langs->trans("NewMemberbyWeb"); + print '
'; + + llxFooterVierge(); + exit; +} + + + +/* + * View + */ + +$form = new Form($db); +$formcompany = new FormCompany($db); +$adht = new AdherentType($db); +$extrafields->fetch_name_optionals_label('adherent'); // fetch optionals attributes and labels + + +llxHeaderVierge($langs->trans("NewSubscription")); + + +print load_fiche_titre($langs->trans("NewSubscription"), '', '', 0, 0, 'center'); + + +print '
'; +print '
'; + +print '
'; +if (!empty($conf->global->MEMBER_NEWFORM_TEXT)) { + print $langs->trans($conf->global->MEMBER_NEWFORM_TEXT)."
\n"; +} else { + print $langs->trans("NewSubscriptionDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."
\n"; +} +print '
'; + +dol_htmloutput_errors($errmsg); + +// Print form +print '
'."\n"; +print ''; +print ''; +print ''; + +print '
'; + +print '
'.$langs->trans("FieldsWithAreMandatory", '*').'
'; +//print $langs->trans("FieldsWithIsForPublic",'**').'
'; + +print dol_get_fiche_head(''); + +print ''; + + +print ''."\n"; + +// Type +if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { + $listoftype = $adht->liste_array(); + $tmp = array_keys($listoftype); + $defaulttype = ''; + $isempty = 1; + if (count($listoftype) == 1) { + $defaulttype = $tmp[0]; + $isempty = 0; + } + print ''."\n"; +} else { + $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); + print ''; +} +// Moral/Physic attribute +$morphys["phy"] = $langs->trans("Physical"); +$morphys["mor"] = $langs->trans("Moral"); +if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { + print ''."\n"; +} else { + print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; + print ''; +} +// Civility +print ''."\n"; +// Lastname +print ''."\n"; +// Firstname +print ''."\n"; +// Gender +print ''; +print ''; +// Company +print ''."\n"; +// Address +print ''."\n"; +// Zip / Town +print ''; +// Country +print ''; +// State +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} +// EMail +print ''."\n"; +// Login +if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { + print ''."\n"; + print ''."\n"; + print ''."\n"; +} +// Birthday +print ''."\n"; +// Photo +print ''."\n"; +// Public +print ''."\n"; +// Other attributes +$tpl_context = 'public'; // define templae context to public +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; +// Comments +print ''; +print ''; +print ''; +print ''."\n"; + +// Add specific fields used by Dolibarr foundation for example +if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { + $arraybudget = array('50'=>'<= 100 000', '100'=>'<= 200 000', '200'=>'<= 500 000', '300'=>'<= 1 500 000', '600'=>'<= 3 000 000', '1000'=>'<= 5 000 000', '2000'=>'5 000 000+'); + print ''."\n"; +} +if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { + // $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount + $amount = 0; + if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { + $amount = $conf->global->MEMBER_NEWFORM_AMOUNT; + } + + if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { + $amount = GETPOST('amount') ?GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT; + } + // $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe' + print ''; +} +print "
'.$langs->trans("Type").' *'; + print $form->selectarray("type", $adht->liste_array(), GETPOST('type') ?GETPOST('type') : $defaulttype, $isempty); + print '
'.$langs->trans('MemberNature').' *'."\n"; + print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); + print '
'.$langs->trans('UserTitle').''; +print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Gender").''; +$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); +print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); +print '
'.$langs->trans("Company").'
'.$langs->trans("Address").''."\n"; +print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print ' / '; +print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); +print '
'.$langs->trans('Country').''; +$country_id = GETPOST('country_id'); +if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); +} +if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } + } +} +$country_code = getCountry($country_id, 2, $db, $langs); +print $form->select_country($country_id, 'country_id'); +print '
'.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } else { + print ''; + } + print '
'.$langs->trans("Email").' *
'.$langs->trans("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("DateOfBirth").''; +print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); +print '
'.$langs->trans("URLPhoto").'
'.$langs->trans("Public").'
'.$langs->trans("Comments").'
'.$langs->trans("TurnoverOrBudget").' *'; + print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1); + print ' € or $'; + + print ''; + print '
'.$langs->trans("Subscription").''; + if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { + print ''; + } else { + print ''; + print ''; + } + print ' '.$langs->trans("Currency".$conf->currency); + print '
\n"; + +print dol_get_fiche_end(); + +// Save +print '
'; +print ''; +if (!empty($backtopage)) { + print '     '; +} +print '
'; + + +print "
\n"; +print "
"; +print '
'; + + +llxFooterVierge(); + +$db->close(); From 113db33a24b3aea9dd4276dfae98bf220bae6a89 Mon Sep 17 00:00:00 2001 From: Pierre Payet Date: Wed, 7 Apr 2021 10:24:02 +0200 Subject: [PATCH 017/216] fix paiementfourn ref is now different from id --- htdocs/fourn/class/paiementfourn.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index bb0ecbcfa7c..78bfa6ebff2 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -83,7 +83,7 @@ class PaiementFourn extends Paiement * Load payment object * * @param int $id Id if payment to get - * @param string $ref Ref of payment to get (currently ref = id but this may change in future) + * @param string $ref Ref of payment to get * @param int $fk_bank Id of bank line associated to payment * @return int <0 if KO, -2 if not found, >0 if OK */ @@ -101,7 +101,7 @@ class PaiementFourn extends Paiement if ($id > 0) $sql .= ' AND p.rowid = '.$id; elseif ($ref) - $sql .= ' AND p.rowid = '.$ref; + $sql .= ' AND p.ref = '.$ref; elseif ($fk_bank) $sql .= ' AND p.fk_bank = '.$fk_bank; //print $sql; From fc76e06058e6e3fbf62889f79cfddf5a0d120ac5 Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Wed, 7 Apr 2021 10:23:33 +0200 Subject: [PATCH 018/216] Better tooltip, better name, translation --- htdocs/langs/en_US/productbatch.lang | 5 ++++- htdocs/langs/fr_FR/productbatch.lang | 5 ++++- htdocs/product/admin/product_lot.php | 32 ++++------------------------ 3 files changed, 12 insertions(+), 30 deletions(-) diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index 9e299baf8f3..289b113b10a 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -27,4 +27,7 @@ StockDetailPerBatch=Stock detail per lot SerialNumberAlreadyInUse=Serial number %s is already used for product %s TooManyQtyForSerialNumber=You can only have one product %s for serial number %S BatchLotNumberingModules=Options for automatic generation of batch products managed by lots -BatchSerialNumberingModules=Options for automatic generation of batch products managed by serial numbers \ No newline at end of file +BatchSerialNumberingModules=Options for automatic generation of batch products managed by serial numbers +CustomMasks=Adds an option to define mask in the product card +LotProductTooltip=Adds an option in the product card to define a dedicated batch number mask +SNProductTooltip=Adds an option in the product card to define a dedicated serial number mask \ No newline at end of file diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang index eed5a063318..cd38ac89278 100644 --- a/htdocs/langs/fr_FR/productbatch.lang +++ b/htdocs/langs/fr_FR/productbatch.lang @@ -27,4 +27,7 @@ StockDetailPerBatch=Stock détaillé par lot SerialNumberAlreadyInUse=Le numéro de série %s est déjà utilisé pour le produit %s TooManyQtyForSerialNumber=Vous ne pouvez avoir qu'un produit %s avec le numéro de série %s BatchLotNumberingModules=Modèle de génération et contrôle des numéros de lot -BatchSerialNumberingModules=Modèle de génération et contrôle des numéros de série \ No newline at end of file +BatchSerialNumberingModules=Modèle de génération et contrôle des numéros de série +CustomMasks=Ajoute une option pour définir le masque dans la fiche produit +LotProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de lot +SNProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de série \ No newline at end of file diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php index 79e64940d8f..47d1e6b780f 100644 --- a/htdocs/product/admin/product_lot.php +++ b/htdocs/product/admin/product_lot.php @@ -182,7 +182,7 @@ foreach ($dirmodels as $reldir) { } } closedir($handle); - print 'lot_product'."\n"; + print 'Option'."\n"; print $langs->trans('CustomMasks'); print ''; @@ -207,19 +207,7 @@ foreach ($dirmodels as $reldir) { print ''; // Info - $htmltooltip = ''; - $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval = $module->getNextValue($mysoc, $batch); - if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval - $htmltooltip .= ''.$langs->trans("NextValue").': '; - if ($nextval) { - if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') - $nextval = $langs->trans($nextval); - $htmltooltip .= $nextval.'
'; - } else { - $htmltooltip .= $langs->trans($module->error).'
'; - } - } + $htmltooltip = $langs->trans("LotProductTooltip"); print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); @@ -318,7 +306,7 @@ foreach ($dirmodels as $reldir) { } } closedir($handle); - print 'sn_product'."\n"; + print 'Option'."\n"; print $langs->trans('CustomMasks'); print ''; @@ -343,19 +331,7 @@ foreach ($dirmodels as $reldir) { print ''; // Info - $htmltooltip = ''; - $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval = $module->getNextValue($mysoc, $batch); - if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval - $htmltooltip .= ''.$langs->trans("NextValue").': '; - if ($nextval) { - if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') - $nextval = $langs->trans($nextval); - $htmltooltip .= $nextval.'
'; - } else { - $htmltooltip .= $langs->trans($module->error).'
'; - } - } + $htmltooltip = $langs->trans("SNProductTooltip"); print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); From 7df09b6e9eac9d04451a47b1bce044d20dfa87d6 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Wed, 7 Apr 2021 10:41:36 +0200 Subject: [PATCH 019/216] FIX: esupplier order: error 500 when using packaging with product where it is not defined --- 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 14589374e3d..dbb454ef800 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2707,7 +2707,7 @@ class CommandeFournisseur extends CommonOrder } else { - if (($qty % $this->line->packaging) > 0) + if (! empty($this->line->packaging) && ($qty % $this->line->packaging) > 0) { $coeff = intval($qty / $this->line->packaging) + 1; $qty = $this->line->packaging * $coeff; From d209dbe43ecbbe4982111e3ad4ea0e5598d954d2 Mon Sep 17 00:00:00 2001 From: Pierre Payet Date: Wed, 7 Apr 2021 11:01:51 +0200 Subject: [PATCH 020/216] add missing hooks in fourn invoice list --- htdocs/fourn/facture/list.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 317def67098..792fb91f980 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -419,6 +419,10 @@ if ($search_user > 0) $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc"; } +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; $sql .= ' WHERE f.fk_soc = s.rowid'; $sql .= ' AND f.entity IN ('.getEntity('facture_fourn').')'; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -512,10 +516,19 @@ if (!$search_all) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ",ef.".$key : ''); } } + // Add GroupBy from hooks + $parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall); + $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook + $sql .= $hookmanager->resPrint; } else { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } +// Add HAVING from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= !empty($hookmanager->resPrint) ? (' HAVING 1=1 ' . $hookmanager->resPrint) : ''; + $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; @@ -594,6 +607,10 @@ if ($resql) // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; + // Add $param from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook + $param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( From 07e018dc7dd38d0ac7469c29074bfb2c6ee1aed3 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Wed, 7 Apr 2021 12:30:08 +0200 Subject: [PATCH 021/216] work in progress --- .../conferenceorbooth_card.php | 6 +- htdocs/langs/en_US/eventorganization.lang | 4 + .../public/members/attendee_subscription.php | 179 ++++-------------- 3 files changed, 40 insertions(+), 149 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 61d8fdacbd6..e869d869ba5 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -493,9 +493,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field //unset($object->fields['fk_project']); // Hide field already shown in banner //unset($object->fields['fk_soc']); // Hide field already shown in banner - $link = 'http://localhost/dolibarr/htdocs/public/members/attendee_subscription.php'; - $object->fields['pubregister'] = array('type'=>'text', 'label'=>'Lien public d\'enregistrement à une conférence', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1); - $object->pubregister = $link; + $link_subscription = 'http://localhost/dolibarr/htdocs/public/members/attendee_subscription.php'; + $object->fields['pubregister'] = array('type'=>'url', 'label'=>'Lien public d\'enregistrement à une conférence', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1); + $object->pubregister = $link_subscription; $keyforbreak='pubregister'; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; //var_dump($object); diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index c0ff5e8e281..b1fc2b9b7e5 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -91,3 +91,7 @@ EvntOrgConfirmed = Confirmed EvntOrgNotQualified = Not Qualified EvntOrgDone = Done EvntOrgCancelled = Cancelled +# +# Public page +# +EventOrgWelcomeMessage = This form allows you to register as a new participant to a conference. diff --git a/htdocs/public/members/attendee_subscription.php b/htdocs/public/members/attendee_subscription.php index 873742f99b9..d145c23d207 100644 --- a/htdocs/public/members/attendee_subscription.php +++ b/htdocs/public/members/attendee_subscription.php @@ -76,7 +76,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); // Load translation files -$langs->loadLangs(array("main", "members", "companies", "install", "other")); +$langs->loadLangs(array("main", "members", "companies", "install", "other", "eventorganization")); /* Security check if (empty($conf->adherent->enabled)) { @@ -180,45 +180,15 @@ if (empty($reshook) && $action == 'add') { $db->begin(); - // test if login already exists - if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - if (!GETPOST('login')) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Login"))."
\n"; - } - $sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$db->escape(GETPOST('login'))."'"; - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows($result); - } - if ($num != 0) { - $error++; - $langs->load("errors"); - $errmsg .= $langs->trans("ErrorLoginAlreadyExists")."
\n"; - } - if (!GETPOSTISSET("pass1") || !GETPOSTISSET("pass2") || GETPOST("pass1", 'none') == '' || GETPOST("pass2", 'none') == '' || GETPOST("pass1", 'none') != GETPOST("pass2", 'none')) { - $error++; - $langs->load("errors"); - $errmsg .= $langs->trans("ErrorPasswordsMustMatch")."
\n"; - } - if (!GETPOST("email")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("EMail"))."
\n"; - } - } - if (GETPOST('type') <= 0) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"))."
\n"; - } - if (!in_array(GETPOST('morphy'), array('mor', 'phy'))) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('Nature'))."
\n"; + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("EMail"))."
\n"; } if (!GETPOST("lastname")) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n"; } - if (GETPOST("firstname")) { + if (!GETPOST("firstname")) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n"; } @@ -227,51 +197,29 @@ if (empty($reshook) && $action == 'add') { $langs->load("errors"); $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; } - $birthday = dol_mktime(GETPOST("birthhour", 'int'), GETPOST("birthmin", 'int'), GETPOST("birthsec", 'int'), GETPOST("birthmonth", 'int'), GETPOST("birthday", 'int'), GETPOST("birthyear", 'int')); - if (GETPOSTISSET("birthmonth") && empty($birthday)) { - $error++; - $langs->load("errors"); - $errmsg .= $langs->trans("ErrorBadDateFormat")."
\n"; - } - if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { - if (GETPOST("morphy") == 'mor' && GETPOST('budget') <= 0) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("TurnoverOrBudget"))."
\n"; - } - } - - if (GETPOSTISSET('public')) { - $public = 1; - } else { - $public = 0; - } - if (!$error) { - // email a peu pres correct et le login n'existe pas - $adh = new Adherent($db); - $adh->statut = -1; - $adh->public = $public; - $adh->firstname = GETPOST("firstname"); - $adh->lastname = GETPOST("lastname"); - $adh->gender = GETPOST("gender"); - $adh->civility_id = GETPOST("civility_id"); - $adh->societe = GETPOST("societe"); - $adh->address = GETPOST("address"); - $adh->zip = GETPOST("zipcode"); - $adh->town = GETPOST("town"); - $adh->email = GETPOST("email"); - if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - $adh->login = GETPOST("login"); - $adh->pass = GETPOST("pass1"); - } - $adh->photo = GETPOST("photo"); - $adh->country_id = GETPOST("country_id", 'int'); - $adh->state_id = GETPOST("state_id", 'int'); - $adh->typeid = GETPOST("type", 'int'); - $adh->note_private = GETPOST("note_private"); - $adh->morphy = GETPOST("morphy"); - $adh->birth = $birthday; - + // Client => fournisseur à 0 + $thirdparty = new Client($db); + // Prospect forcé + $thirdparty->fk_prospectlevel = "Prospect"; + $thirdparty->firstname = GETPOST("firstname"); + $thirdparty->lastname = GETPOST("lastname"); + $thirdparty->address = GETPOST("address"); + $thirdparty->zip = GETPOST("zipcode"); + $thirdparty->town = GETPOST("town"); + $thirdparty->email = GETPOST("email"); + $thirdparty->country_id = GETPOST("country_id", 'int'); + $thirdparty->state_id = GETPOST("state_id", 'int'); + + // @todo commit to generate the id, remove it ? + $db->commit(); + + $db->begin(); + // @todo creation of an attendee + $confattendee = new ConferenceOrBoothAttendee($db); + $confattendee->alreadypaid = 0.0; + $confattendee->fk_soc = $thirdparty->rowid; + $confattendee->date_subscription = dol_now(); // Fill array 'array_options' with data from add form $extrafields->fetch_name_optionals_label($adh->table_element); @@ -500,13 +448,10 @@ print load_fiche_titre($langs->trans("NewSubscription"), '', '', 0, 0, 'center') print '
'; print '
'; - print '
'; -if (!empty($conf->global->MEMBER_NEWFORM_TEXT)) { - print $langs->trans($conf->global->MEMBER_NEWFORM_TEXT)."
\n"; -} else { - print $langs->trans("NewSubscriptionDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."
\n"; -} + +// Welcome message +print $langs->trans("EventOrgWelcomeMessage"); print '
'; dol_htmloutput_errors($errmsg); @@ -551,49 +496,12 @@ jQuery(document).ready(function () { print ''."\n"; -// Type -if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { - $listoftype = $adht->liste_array(); - $tmp = array_keys($listoftype); - $defaulttype = ''; - $isempty = 1; - if (count($listoftype) == 1) { - $defaulttype = $tmp[0]; - $isempty = 0; - } - print ''."\n"; -} else { - $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); - print ''; -} -// Moral/Physic attribute -$morphys["phy"] = $langs->trans("Physical"); -$morphys["mor"] = $langs->trans("Moral"); -if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { - print ''."\n"; -} else { - print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; - print ''; -} -// Civility -print ''."\n"; // Lastname print ''."\n"; // Firstname print ''."\n"; -// Gender -print ''; -print ''; // Company -print ''."\n"; +//print ''."\n"; // Address print ''."\n"; @@ -623,6 +531,7 @@ if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { $country_code = getCountry($country_id, 2, $db, $langs); print $form->select_country($country_id, 'country_id'); print ''; + // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print ''; } -// EMail +// Email print ''."\n"; -// Login -if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''."\n"; - print ''."\n"; - print ''."\n"; -} -// Birthday -print ''."\n"; -// Photo -print ''."\n"; -// Public -print ''."\n"; -// Other attributes -$tpl_context = 'public'; // define templae context to public -include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; -// Comments -print ''; -print ''; -print ''; -print ''."\n"; // Add specific fields used by Dolibarr foundation for example if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { From 4ffc6531fec69877b77ea8e4376927e7554862ad Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Wed, 7 Apr 2021 16:09:27 +0200 Subject: [PATCH 022/216] masks options are boolean --- htdocs/product/admin/product_lot.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php index 47d1e6b780f..a3582a2b463 100644 --- a/htdocs/product/admin/product_lot.php +++ b/htdocs/product/admin/product_lot.php @@ -74,10 +74,10 @@ if ($action == 'updateMaskLot') { dolibarr_set_const($db, "PRODUCTBATCH_SN_ADDON", $value, 'chaine', 0, '', $conf->entity); } if ($action == 'setmaskslot') { - dolibarr_set_const($db, "PRODUCTBATCH_LOT_USE_PRODUCT_MASKS", $value, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "PRODUCTBATCH_LOT_USE_PRODUCT_MASKS", $value, 'bool', 0, '', $conf->entity); } if ($action == 'setmaskssn') { - dolibarr_set_const($db, "PRODUCTBATCH_SN_USE_PRODUCT_MASKS", $value, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "PRODUCTBATCH_SN_USE_PRODUCT_MASKS", $value, 'bool', 0, '', $conf->entity); } /* @@ -195,12 +195,12 @@ foreach ($dirmodels as $reldir) { print ''."\n"; print ''."\n"; print ''; foreach ($arrayofparameters as $constname => $val) { - if ($val['enabled']==1) { - $setupnotempty++; - print ''."\n"; -// Zip / Town -print ''; -// Country -print ''; -// State -if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; -} -// Email -print ''."\n"; - -print "
'.$langs->trans("Type").' *'; - print $form->selectarray("type", $adht->liste_array(), GETPOST('type') ?GETPOST('type') : $defaulttype, $isempty); - print '
'.$langs->trans('MemberNature').' *'."\n"; - print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); - print '
'.$langs->trans('UserTitle').''; -print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Gender").''; -$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); -print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); -print '
'.$langs->trans("Company").'
'.$langs->trans("Company").'
'.$langs->trans("Address").''."\n"; print '
'.$langs->trans('State').''; @@ -633,30 +542,8 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { } print '
'.$langs->trans("Email").' *
'.$langs->trans("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("DateOfBirth").''; -print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); -print '
'.$langs->trans("URLPhoto").'
'.$langs->trans("Public").'
'.$langs->trans("Comments").'
'; - if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS == 'true') { - print ''; + if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) { + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -319,12 +319,12 @@ foreach ($dirmodels as $reldir) { print ''; - if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS == 'true') { - print ''; + if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) { + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } From 14e5e63612c4643de36d80c189228b21608a0500 Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Wed, 7 Apr 2021 16:44:51 +0200 Subject: [PATCH 023/216] one space too much --- htdocs/product/admin/product_lot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php index a3582a2b463..2ae8ef9810e 100644 --- a/htdocs/product/admin/product_lot.php +++ b/htdocs/product/admin/product_lot.php @@ -72,7 +72,7 @@ if ($action == 'updateMaskLot') { dolibarr_set_const($db, "PRODUCTBATCH_LOT_ADDON", $value, 'chaine', 0, '', $conf->entity); } elseif ($action == 'setmodsn') { dolibarr_set_const($db, "PRODUCTBATCH_SN_ADDON", $value, 'chaine', 0, '', $conf->entity); -} +} if ($action == 'setmaskslot') { dolibarr_set_const($db, "PRODUCTBATCH_LOT_USE_PRODUCT_MASKS", $value, 'bool', 0, '', $conf->entity); } From c6d3510e3009c39a5d118d1441d1add04540ae4a Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Wed, 7 Apr 2021 17:16:26 +0200 Subject: [PATCH 024/216] form ok, todo : creation of an attendee --- .../class/conferenceorbooth.class.php | 4 +- .../conferenceorbooth_card.php | 1 + htdocs/langs/en_US/eventorganization.lang | 4 +- .../public/members/attendee_subscription.php | 283 ++++-------------- 4 files changed, 58 insertions(+), 234 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 15724233b31..41fe4ebd94d 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -728,7 +728,7 @@ class ConferenceOrBooth extends ActionComm * * @return array|int array of lines if OK, <0 if KO */ - public function getLinesArray() + /*public function getLinesArray() { $this->lines = array(); @@ -743,7 +743,7 @@ class ConferenceOrBooth extends ActionComm $this->lines = $result; return $this->lines; } - } + }*/ /** * Create a document onto disk according to template module. diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index e869d869ba5..57e6ae4f266 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -494,6 +494,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea //unset($object->fields['fk_project']); // Hide field already shown in banner //unset($object->fields['fk_soc']); // Hide field already shown in banner $link_subscription = 'http://localhost/dolibarr/htdocs/public/members/attendee_subscription.php'; + $link_subscription .= '?id='.GETPOST("id"); $object->fields['pubregister'] = array('type'=>'url', 'label'=>'Lien public d\'enregistrement à une conférence', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1); $object->pubregister = $link_subscription; $keyforbreak='pubregister'; diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index b1fc2b9b7e5..9ae9f9ddeef 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -94,4 +94,6 @@ EvntOrgCancelled = Cancelled # # Public page # -EventOrgWelcomeMessage = This form allows you to register as a new participant to a conference. +EvntOrgWelcomeMessage = This form allows you to register as a new participant to the conference +EvntOrgStartDuration = This conference starts on +EvntOrgEndDuration = and ends on diff --git a/htdocs/public/members/attendee_subscription.php b/htdocs/public/members/attendee_subscription.php index d145c23d207..9ded588b54b 100644 --- a/htdocs/public/members/attendee_subscription.php +++ b/htdocs/public/members/attendee_subscription.php @@ -63,38 +63,27 @@ if (is_numeric($entity)) { require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; -require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + // Init vars $errmsg = ''; $num = 0; $error = 0; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); +$id = GETPOST("id"); // Load translation files -$langs->loadLangs(array("main", "members", "companies", "install", "other", "eventorganization")); - -/* Security check -if (empty($conf->adherent->enabled)) { - accessforbidden('', 0, 0, 1); -} - -if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) { - print $langs->trans("Auto subscription form for public visitors has not been enabled"); - exit; -}*/ +$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); $extrafields = new ExtraFields($db); -$object = new Adherent($db); - $user->loadDefaultValues(); @@ -179,18 +168,14 @@ if (empty($reshook) && $action == 'add') { $urlback = ''; $db->begin(); - + if (!GETPOST("email")) { $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("EMail"))."
\n"; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; } - if (!GETPOST("lastname")) { + if (!GETPOST("societe")) { $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n"; - } - if (!GETPOST("firstname")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n"; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; } if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { $error++; @@ -198,213 +183,45 @@ if (empty($reshook) && $action == 'add') { $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; } if (!$error) { - // Client => fournisseur à 0 - $thirdparty = new Client($db); - // Prospect forcé - $thirdparty->fk_prospectlevel = "Prospect"; - $thirdparty->firstname = GETPOST("firstname"); - $thirdparty->lastname = GETPOST("lastname"); - $thirdparty->address = GETPOST("address"); - $thirdparty->zip = GETPOST("zipcode"); - $thirdparty->town = GETPOST("town"); - $thirdparty->email = GETPOST("email"); - $thirdparty->country_id = GETPOST("country_id", 'int'); - $thirdparty->state_id = GETPOST("state_id", 'int'); + // Vérifier si client existe + $thirdparty = new Societe($db); + $nomsociete = GETPOST("societe"); + // @todo utiliser fetch avec la "réf" + $resultfetchthirdparty = $thirdparty->fetch('', $nomsociete); + if($resultfetchthirdparty<0){ + $error++; + $errmsg .= $thirdparty->error; + $res = -1; + } elseif($resultfetchthirdparty==0){ + // si retour =0 : le créer + $thirdparty->name = $nomsociete; + $thirdparty->address = GETPOST("address"); + $thirdparty->zip = GETPOST("zipcode"); + $thirdparty->town = GETPOST("town"); + // It's a prospect + $thirdparty->client = 2; + $thirdparty->fournisseur = 0; + $thirdparty->country_id = GETPOST("country_id", 'int'); + $thirdparty->state_id = GETPOST("state_id", 'int'); + + $res = $thirdparty->create($user); + } - // @todo commit to generate the id, remove it ? - $db->commit(); - - $db->begin(); - // @todo creation of an attendee - $confattendee = new ConferenceOrBoothAttendee($db); - $confattendee->alreadypaid = 0.0; - $confattendee->fk_soc = $thirdparty->rowid; - $confattendee->date_subscription = dol_now(); - - // Fill array 'array_options' with data from add form - $extrafields->fetch_name_optionals_label($adh->table_element); - $ret = $extrafields->setOptionalsFromPost(null, $adh); - if ($ret < 0) { - $error++; - } - - $result = $adh->create($user); - if ($result > 0) { - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $object = $adh; - - $adht = new AdherentType($db); - $adht->fetch($object->typeid); - - if ($object->email) { - $subject = ''; - $msg = ''; - - // Send subscription email - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; - $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER; - - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs); - - if ($subjecttosend && $texttosend) { - $moreinheader = 'X-Dolibarr-Info: send_an_email by public/members/new.php'."\r\n"; - - $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader); - } - /*if ($result < 0) { - $error++; - setEventMessages($object->error, $object->errors, 'errors'); - }*/ - } - - // Send email to the foundation to say a new member subscribed with autosubscribe form - if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) && !empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT) && - !empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL)) { - // Define link to login card - $appli = constant('DOL_APPLICATION_TITLE'); - if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli = $conf->global->MAIN_APPLICATION_TITLE; - if (preg_match('/\d\.\d/', $appli)) { - if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { - $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - } else { - $appli .= " ".DOL_VERSION; - } - } else { - $appli .= " ".DOL_VERSION; - } - - $to = $adh->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL); - $from = $conf->global->ADHERENT_MAIL_FROM; - $mailfile = new CMailFile( - '['.$appli.'] '.$conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT, - $to, - $from, - $adh->makeSubstitution($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL), - array(), - array(), - array(), - "", - "", - 0, - -1 - ); - - if (!$mailfile->sendfile()) { - dol_syslog($langs->trans("ErrorFailedToSendMail", $from, $to), LOG_ERR); - } - } - - if (!empty($backtopage)) { - $urlback = $backtopage; - } elseif (!empty($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION)) { - $urlback = $conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION; - // TODO Make replacement of __AMOUNT__, etc... - } else { - $urlback = $_SERVER["PHP_SELF"]."?action=added"; - } - - if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE) && $conf->global->MEMBER_NEWFORM_PAYONLINE != '-1') { - if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'all') { - $urlback = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref); - if (price2num(GETPOST('amount', 'alpha'))) { - $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); - } - if (GETPOST('email')) { - $urlback .= '&email='.urlencode(GETPOST('email')); - } - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); - } else { - $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); - } - } - } elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox') { - $urlback = DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref); - if (price2num(GETPOST('amount', 'alpha'))) { - $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); - } - if (GETPOST('email')) { - $urlback .= '&email='.urlencode(GETPOST('email')); - } - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); - } else { - $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); - } - } - } elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal') { - $urlback = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref); - if (price2num(GETPOST('amount', 'alpha'))) { - $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); - } - if (GETPOST('email')) { - $urlback .= '&email='.urlencode(GETPOST('email')); - } - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); - } else { - $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); - } - } - } elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'stripe') { - $urlback = DOL_MAIN_URL_ROOT.'/public/stripe/newpayment.php?from=membernewform&source=membersubscription&ref='.$adh->ref; - if (price2num(GETPOST('amount', 'alpha'))) { - $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); - } - if (GETPOST('email')) { - $urlback .= '&email='.urlencode(GETPOST('email')); - } - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); - } else { - $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); - } - } - } else { - dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment"); - exit; - } - } - - if (!empty($entity)) { - $urlback .= '&entity='.$entity; - } - dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback); + if ($res < 0){ + $error++; + $errmsg .= $thirdparty->error; } else { - $error++; - $errmsg .= join('
', $adh->errors); + // @todo creation of an attendee + $confattendee = new ConferenceOrBoothAttendee($db); + $confattendee->fk_soc = $thirdparty->id; + $confattendee->date_subscription = dol_now(); + $confattendee->email = GETPOST("email"); + $confattendee->fk_actioncomm = $id; } } if (!$error) { $db->commit(); - Header("Location: ".$urlback); exit; } else { @@ -436,9 +253,12 @@ if (empty($reshook) && $action == 'added') { $form = new Form($db); $formcompany = new FormCompany($db); -$adht = new AdherentType($db); -$extrafields->fetch_name_optionals_label('adherent'); // fetch optionals attributes and labels +$conference = new ConferenceOrBooth($db); +$resultconf = $conference->fetch($id); +if ($resultconf < 0){ + setEventMessages(null, $object->errors, "errors"); +} llxHeaderVierge($langs->trans("NewSubscription")); @@ -451,7 +271,12 @@ print '
'; print '
'; // Welcome message -print $langs->trans("EventOrgWelcomeMessage"); +print $langs->trans("EvntOrgWelcomeMessage"); +print GETPOST("id").".".'
'; +print $langs->trans("EvntOrgStartDuration"); +print dol_print_date($conference->datep); +print $langs->trans("EvntOrgEndDuration"); +print dol_print_date($conference->datef)."."; print '
'; dol_htmloutput_errors($errmsg); @@ -496,12 +321,8 @@ jQuery(document).ready(function () { print ''."\n"; -// Lastname -print ''."\n"; -// Firstname -print ''."\n"; // Company -//print ''."\n"; +print ''."\n"; // Address print ''."\n"; From 2f005db4a528770811df8acd05b53e220f938bab Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 8 Apr 2021 11:06:34 +0200 Subject: [PATCH 025/216] basic encryption of id in url + wip on creating a thirdparty --- .../conferenceorbooth_card.php | 7 ++- .../public/members/attendee_subscription.php | 50 +++++++++++-------- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 57e6ae4f266..6110687f587 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -493,11 +493,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field //unset($object->fields['fk_project']); // Hide field already shown in banner //unset($object->fields['fk_soc']); // Hide field already shown in banner - $link_subscription = 'http://localhost/dolibarr/htdocs/public/members/attendee_subscription.php'; - $link_subscription .= '?id='.GETPOST("id"); + $link_subscription = 'http://localhost/dolibarr/htdocs/public/members/attendee_subscription.php?id='; + //$link_subscription .= base64_encode($id); + $key = 'DV3PH'; + $link_subscription .= openssl_encrypt($id, 'aes-256-ctr', $key); $object->fields['pubregister'] = array('type'=>'url', 'label'=>'Lien public d\'enregistrement à une conférence', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1); $object->pubregister = $link_subscription; $keyforbreak='pubregister'; + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; //var_dump($object); // Other attributes. Fields from hook formObjectOptions and Extrafields. diff --git a/htdocs/public/members/attendee_subscription.php b/htdocs/public/members/attendee_subscription.php index 9ded588b54b..33034be7019 100644 --- a/htdocs/public/members/attendee_subscription.php +++ b/htdocs/public/members/attendee_subscription.php @@ -74,7 +74,10 @@ $num = 0; $error = 0; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); -$id = GETPOST("id"); +//$id = base64_decode(GETPOST("id")); +$key = 'DV3PH'; +$id = openssl_decrypt(GETPOST('id'), 'aes-256-ctr', $key); +var_dump($id); // Load translation files $langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); @@ -186,24 +189,42 @@ if (empty($reshook) && $action == 'add') { // Vérifier si client existe $thirdparty = new Societe($db); $nomsociete = GETPOST("societe"); - // @todo utiliser fetch avec la "réf" + // @todo utiliser fetch avec la "réf" $resultfetchthirdparty = $thirdparty->fetch('', $nomsociete); if($resultfetchthirdparty<0){ $error++; $errmsg .= $thirdparty->error; $res = -1; } elseif($resultfetchthirdparty==0){ - // si retour =0 : le créer + // creation of a new thirdparty $thirdparty->name = $nomsociete; $thirdparty->address = GETPOST("address"); $thirdparty->zip = GETPOST("zipcode"); $thirdparty->town = GETPOST("town"); - // It's a prospect $thirdparty->client = 2; $thirdparty->fournisseur = 0; $thirdparty->country_id = GETPOST("country_id", 'int'); $thirdparty->state_id = GETPOST("state_id", 'int'); + //@todo jusqu'à la ligne 223 : pas sûr + // Load object modCodeTiers + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeClient = new $module($db); + $tmpcode = $object->code_client; + if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { + $tmpcode = $modCodeClient->getNextValue($object, 0); + } + $res = $thirdparty->create($user); } @@ -272,11 +293,11 @@ print '
'; // Welcome message print $langs->trans("EvntOrgWelcomeMessage"); -print GETPOST("id").".".'
'; +print $id.".".'
'; print $langs->trans("EvntOrgStartDuration"); -print dol_print_date($conference->datep); +print dol_print_date($conference->datep).' '; print $langs->trans("EvntOrgEndDuration"); -print dol_print_date($conference->datef)."."; +print ' '.dol_print_date($conference->datef)."."; print '
'; dol_htmloutput_errors($errmsg); @@ -297,19 +318,6 @@ print dol_get_fiche_head(''); print ''; - print '
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Company").'
'.$langs->trans("Company").' *
'.$langs->trans("Address").''."\n"; print '
'."\n"; // Company @@ -352,7 +359,6 @@ if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { $country_code = getCountry($country_id, 2, $db, $langs); print $form->select_country($country_id, 'country_id'); print ''; - // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print ''; + if ($conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') { + print ''; - // Show example of numbering model - print ''."\n"; + // Show example of numbering model + print ''."\n"; - print ''; + + // Info + $htmltooltip = $langs->trans("LotProductTooltip"); + + print ''; + + print "\n"; } - print ''; - - // Info - $htmltooltip = $langs->trans("LotProductTooltip"); - - print ''; - - print "\n"; } } } @@ -306,38 +308,40 @@ foreach ($dirmodels as $reldir) { } } closedir($handle); - print ''; + if ($conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced') { + print ''; - // Show example of numbering model - print ''."\n"; + // Show example of numbering model + print ''."\n"; - print ''; + + // Info + $htmltooltip = $langs->trans("SNProductTooltip"); + + print ''; + + print "\n"; } - print ''; - - // Info - $htmltooltip = $langs->trans("SNProductTooltip"); - - print ''; - - print "\n"; } } } From af5b623b59303f2b9640c40ce891fdb48e1aa71e Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 8 Apr 2021 16:32:50 +0200 Subject: [PATCH 029/216] securekey added --- htdocs/admin/eventorganization.php | 31 ++++++- .../conferenceorbooth_card.php | 1 + htdocs/langs/en_US/admin.lang | 1 + .../public/members/attendee_subscription.php | 93 +++++-------------- 4 files changed, 54 insertions(+), 72 deletions(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index e142acedf8f..1a7e661699a 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -60,6 +60,7 @@ $arrayofparameters = array( 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), + 'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1), ); $error = 0; @@ -74,6 +75,7 @@ if ((float) DOL_VERSION >= 6) { include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; } + if ($action == 'updateMask') { $maskconstorder = GETPOST('maskconstorder', 'alpha'); $maskorder = GETPOST('maskorder', 'alpha'); @@ -196,7 +198,6 @@ print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, 'even // Setup page goes here echo ''.$langs->trans("EventOrganizationSetupPage").'

'; - if ($action == 'edit') { print '
'; print ''; @@ -255,6 +256,32 @@ if ($action == 'edit') { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $formcompany = new FormCompany($db); print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname); + } elseif ($val['type'] == 'securekey') {// Security key input field + print '
'; + print '"; + print ''; + print ""; + print ""; + + if (!empty($conf->use_javascript_ajax)) { + print "\n".''; + } } else { print ''; } @@ -391,7 +418,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { } if ($module->isEnabled()) { - dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php'); + generate_tokendol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php'); print ''."\n"; -// Add specific fields used by Dolibarr foundation for example -if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { - $arraybudget = array('50'=>'<= 100 000', '100'=>'<= 200 000', '200'=>'<= 500 000', '300'=>'<= 1 500 000', '600'=>'<= 3 000 000', '1000'=>'<= 5 000 000', '2000'=>'5 000 000+'); - print ''."\n"; -} -if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { - // $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount - $amount = 0; - if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { - $amount = $conf->global->MEMBER_NEWFORM_AMOUNT; - } - - if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { - $amount = GETPOST('amount') ?GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT; - } - // $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe' - print ''; -} print "
'.$langs->trans('State').''; From 11700f2162135b178b0587131957f7e2a4d3d9a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Lukas?= Date: Thu, 8 Apr 2021 13:52:29 +0200 Subject: [PATCH 026/216] Fix Ticket-Module public interface: uppercase/lowercaser in e-mail should be ignored #17186 --- htdocs/public/ticket/list.php | 12 ++++++------ htdocs/public/ticket/view.php | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 0f9542c986a..18bc0e83468 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -51,7 +51,7 @@ $langs->loadLangs(array("companies", "other", "ticket")); // Get parameters $track_id = GETPOST('track_id', 'alpha'); $action = GETPOST('action', 'aZ09'); -$email = GETPOST('email', 'alpha'); +$email = strtolower (GETPOST('email', 'alpha')); if (GETPOST('btn_view_ticket_list')) { unset($_SESSION['track_id_customer']); @@ -61,7 +61,7 @@ if (isset($_SESSION['track_id_customer'])) { $track_id = $_SESSION['track_id_customer']; } if (isset($_SESSION['email_customer'])) { - $email = $_SESSION['email_customer']; + $email = strtolower ($_SESSION['email_customer']); } $object = new Ticket($db); @@ -101,7 +101,7 @@ if ($action == "view_ticketlist") { // vérifie si l'adresse email est bien dans les contacts du ticket $contacts = $object->liste_contact(-1, 'external'); foreach ($contacts as $contact) { - if ($contact['email'] == $email) { + if (strtolower($contact['email']) == $email) { $display_ticket_list = true; $_SESSION['email_customer'] = $email; $_SESSION['track_id_customer'] = $track_id; @@ -112,7 +112,7 @@ if ($action == "view_ticketlist") { } if ($object->fk_soc > 0) { $object->fetch_thirdparty(); - if ($email == $object->thirdparty->email) { + if ($email == strtolower($object->thirdparty->email)) { $display_ticket_list = true; $_SESSION['email_customer'] = $email; $_SESSION['track_id_customer'] = $track_id; @@ -121,14 +121,14 @@ if ($action == "view_ticketlist") { if ($object->fk_user_create > 0) { $tmpuser = new User($db); $tmpuser->fetch($object->fk_user_create); - if ($email == $tmpuser->email) { + if ($email == strtolower($tmpuser->email)) { $display_ticket_list = true; $_SESSION['email_customer'] = $email; $_SESSION['track_id_customer'] = $track_id; } } - $emailorigin = CMailFile::getValidAddress($object->origin_email, 2); + $emailorigin = strtolower(CMailFile::getValidAddress($object->origin_email, 2)); if ($email == $emailorigin) { $display_ticket_list = true; $_SESSION['email_customer'] = $email; diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 02c7c9e51d8..cde872c56db 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -53,13 +53,13 @@ $langs->loadLangs(array("companies", "other", "ticket")); $track_id = GETPOST('track_id', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $action = GETPOST('action', 'aZ09'); -$email = GETPOST('email', 'alpha'); +$email = strtolower(GETPOST('email', 'alpha')); if (GETPOST('btn_view_ticket')) { unset($_SESSION['email_customer']); } if (isset($_SESSION['email_customer'])) { - $email = $_SESSION['email_customer']; + $email = strtolower($_SESSION['email_customer']); } $object = new ActionsTicket($db); @@ -103,7 +103,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a $ret = $object->fetch('', '', $track_id); if ($ret && $object->dao->id > 0) { // Check if emails provided is the one of author - $emailofticket = CMailFile::getValidAddress($object->dao->origin_email, 2); + $emailofticket = strtolower(CMailFile::getValidAddress($object->dao->origin_email, 2)); if ($emailofticket == $email) { $display_ticket = true; @@ -113,7 +113,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a else { $contacts = $object->dao->liste_contact(-1, 'external'); foreach ($contacts as $contact) { - if ($contact['email'] == $email) { + if (strtolower($contact['email']) == $email) { $display_ticket = true; $_SESSION['email_customer'] = $email; break; @@ -135,7 +135,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a { $tmpuser = new User($db); $tmpuser->fetch($object->dao->fk_user_create); - if ($email == $tmpuser->email) { + if ($email == strtolower($tmpuser->email)) { $display_ticket = true; $_SESSION['email_customer'] = $email; } @@ -145,7 +145,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a { $tmpuser = new User($db); $tmpuser->fetch($object->dao->fk_user_assign); - if ($email == $tmpuser->email) { + if ($email == strtolower($tmpuser->email)) { $display_ticket = true; $_SESSION['email_customer'] = $email; } From 0b1e3ce7e484f8c15ef77793d508b6b908443cf2 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 8 Apr 2021 12:15:35 +0000 Subject: [PATCH 027/216] Fixing style errors. --- htdocs/public/ticket/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 18bc0e83468..4c426869239 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -51,7 +51,7 @@ $langs->loadLangs(array("companies", "other", "ticket")); // Get parameters $track_id = GETPOST('track_id', 'alpha'); $action = GETPOST('action', 'aZ09'); -$email = strtolower (GETPOST('email', 'alpha')); +$email = strtolower(GETPOST('email', 'alpha')); if (GETPOST('btn_view_ticket_list')) { unset($_SESSION['track_id_customer']); @@ -61,7 +61,7 @@ if (isset($_SESSION['track_id_customer'])) { $track_id = $_SESSION['track_id_customer']; } if (isset($_SESSION['email_customer'])) { - $email = strtolower ($_SESSION['email_customer']); + $email = strtolower($_SESSION['email_customer']); } $object = new Ticket($db); From b7280f652414fb41a3d35880c30f0db489ff4389 Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Thu, 8 Apr 2021 15:15:58 +0200 Subject: [PATCH 028/216] product masks are relevant only if we are in advanced mode --- htdocs/product/admin/product_lot.php | 120 ++++++++++++++------------- 1 file changed, 62 insertions(+), 58 deletions(-) diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php index 2ae8ef9810e..874f4b9e8a9 100644 --- a/htdocs/product/admin/product_lot.php +++ b/htdocs/product/admin/product_lot.php @@ -182,38 +182,40 @@ foreach ($dirmodels as $reldir) { } } closedir($handle); - print '
Option'."\n"; - print $langs->trans('CustomMasks'); - print '
Option'."\n"; + print $langs->trans('CustomMasks'); + print ''; - $tmp = 'NoExample'; - if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); - else print $langs->trans($tmp); - print '
'; + $tmp = 'NoExample'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; + elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + else print $langs->trans($tmp); + print '
'; - if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; + print ''; + if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print '
'; - print $form->textwithpicto('', $htmltooltip, 1, 0); - print '
Option'."\n"; - print $langs->trans('CustomMasks'); - print '
Option'."\n"; + print $langs->trans('CustomMasks'); + print ''; - $tmp = 'NoExample'; - if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); - else print $langs->trans($tmp); - print '
'; + $tmp = 'NoExample'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; + elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + else print $langs->trans($tmp); + print '
'; - if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; + print ''; + if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print '
'; - print $form->textwithpicto('', $htmltooltip, 1, 0); - print '
'.$langs->trans($constname)."'; + if (!empty($conf->use_javascript_ajax)) { + print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); + } + print ' 
'.$module->name."\n"; print $module->info(); diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 6110687f587..a27447682bb 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -497,6 +497,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea //$link_subscription .= base64_encode($id); $key = 'DV3PH'; $link_subscription .= openssl_encrypt($id, 'aes-256-ctr', $key); + $link_subscription .= '&securekey='.$conf->global->EVENTORGANIZATION_SECUREKEY; $object->fields['pubregister'] = array('type'=>'url', 'label'=>'Lien public d\'enregistrement à une conférence', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1); $object->pubregister = $link_subscription; $keyforbreak='pubregister'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 202f11f7f46..567519fdf04 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1750,6 +1750,7 @@ CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT=Keep the checkbox “Automatically create th ##### Agenda ##### AgendaSetup=Events and agenda module setup PasswordTogetVCalExport=Key to authorize export link +SecurityKey = Security Key PastDelayVCalExport=Do not export event older than AGENDA_USE_EVENT_TYPE=Use events types (managed in menu Setup -> Dictionaries -> Type of agenda events) AGENDA_USE_EVENT_TYPE_DEFAULT=Automatically set this default value for type of event in event create form diff --git a/htdocs/public/members/attendee_subscription.php b/htdocs/public/members/attendee_subscription.php index 33034be7019..95eee72785a 100644 --- a/htdocs/public/members/attendee_subscription.php +++ b/htdocs/public/members/attendee_subscription.php @@ -77,7 +77,12 @@ $action = GETPOST('action', 'aZ09'); //$id = base64_decode(GETPOST("id")); $key = 'DV3PH'; $id = openssl_decrypt(GETPOST('id'), 'aes-256-ctr', $key); -var_dump($id); + +// Securekey check +$securekey = GETPOST('securekey', 'alpha'); +if ($securekey != $conf->global->EVENTORGANIZATION_SECUREKEY) { + exit; +} // Load translation files $langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); @@ -205,8 +210,9 @@ if (empty($reshook) && $action == 'add') { $thirdparty->fournisseur = 0; $thirdparty->country_id = GETPOST("country_id", 'int'); $thirdparty->state_id = GETPOST("state_id", 'int'); + //$thirdparty->code_client = -1; + //$thirdparty->code_fournisseur = -1; - //@todo jusqu'à la ligne 223 : pas sûr // Load object modCodeTiers $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { @@ -220,9 +226,20 @@ if (empty($reshook) && $action == 'add') { } } $modCodeClient = new $module($db); - $tmpcode = $object->code_client; - if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { - $tmpcode = $modCodeClient->getNextValue($object, 0); + // We verified if the tag prefix is used + if ($modCodeClient->code_auto) { + $prefixCustomerIsUsed = $modCodeClient->verif_prefixIsUsed(); + } + $module = $conf->global->SOCIETE_CODECLIENT_ADDON; + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } } $res = $thirdparty->create($user); @@ -232,7 +249,7 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $thirdparty->error; } else { - // @todo creation of an attendee + // creation of an attendee $confattendee = new ConferenceOrBoothAttendee($db); $confattendee->fk_soc = $thirdparty->id; $confattendee->date_subscription = dol_now(); @@ -372,70 +389,6 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { // Email print '
'.$langs->trans("Email").' *
'.$langs->trans("TurnoverOrBudget").' *'; - print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1); - print ' € or $'; - - print ''; - print '
'.$langs->trans("Subscription").''; - if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { - print ''; - } else { - print ''; - print ''; - } - print ' '.$langs->trans("Currency".$conf->currency); - print '
\n"; print dol_get_fiche_end(); From 6f51c69588b0a5e64ecf60dec0ee852f4ab57f64 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 8 Apr 2021 17:15:49 +0200 Subject: [PATCH 030/216] securekey ok --- htdocs/admin/eventorganization.php | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 1a7e661699a..a30157e24c0 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -207,12 +207,14 @@ if ($action == 'edit') { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); - print ''.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).''; - print ''; + if ($val['enabled']==1) { + //if ($val['type'] != 'securekey'){ + $setupnotempty++; + print '
'; + $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); + print ''.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).''; + print ''; + //} if ($val['type'] == 'textarea') { print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; -print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); -print ' / '; -print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); -print '
'.$langs->trans('Country').''; -$country_id = GETPOST('country_id'); -if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { - $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); -} -if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { - $country_code = dol_user_country(); - //print $country_code; - if ($country_code) { - $new_country_id = getCountry($country_code, 3, $db, $langs); - //print 'xxx'.$country_code.' - '.$new_country_id; - if ($new_country_id) { - $country_id = $new_country_id; - } - } -} -$country_code = getCountry($country_id, 2, $db, $langs); -print $form->select_country($country_id, 'country_id'); -print '
'.$langs->trans('State').''; - if ($country_code) { - print $formcompany->select_state(GETPOST("state_id"), $country_code); - } else { - print ''; - } - print '
'.$langs->trans("Email").' *
\n"; - -print dol_get_fiche_end(); - -// Save -print '
'; -print ''; -if (!empty($backtopage)) { - print '     '; -} -print '
'; - - -print "\n"; -print "
"; -print '
'; - - -llxFooterVierge(); - -$db->close(); From a99dd2be356469de0464dcf42631a89119a8b663 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 9 Apr 2021 16:20:12 +0200 Subject: [PATCH 042/216] new: add attendees public registration page --- .../llx_eventorganization_conferenceorboothattendee.key.sql | 1 - .../tables/llx_eventorganization_conferenceorboothattendee.sql | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql index 2314221b41d..3b9cc52e68f 100644 --- a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql +++ b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql @@ -22,7 +22,6 @@ ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD CONSTRAINT fx_ev ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_actioncomm (fk_actioncomm); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD CONSTRAINT fx_eventorganization_conferenceorboothattendee_fk_actioncomm FOREIGN KEY (fk_actioncomm) REFERENCES llx_actioncomm(id); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_email (email); -ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD CONSTRAINT llx_eventorganization_conferenceorboothattendee_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_status (status); -- END MODULEBUILDER INDEXES diff --git a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql index c6ff6dedf66..026295627d0 100644 --- a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql +++ b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql @@ -27,7 +27,7 @@ CREATE TABLE llx_eventorganization_conferenceorboothattendee( note_private text, date_creation datetime NOT NULL, tms timestamp, - fk_user_creat integer NOT NULL, + fk_user_creat integer, fk_user_modif integer, last_main_doc varchar(255), import_key varchar(14), From a58e0ac8acb6a9cb488397d604df9dc0fffa542d Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 9 Apr 2021 16:25:40 +0200 Subject: [PATCH 043/216] =?UTF-8?q?=09nouveau=20fichier=C2=A0:=20public/ev?= =?UTF-8?q?entorganization/attendee=5Fsubscription.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attendee_subscription.php | 400 ++++++++++++++++++ 1 file changed, 400 insertions(+) create mode 100644 htdocs/public/eventorganization/attendee_subscription.php diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php new file mode 100644 index 00000000000..885058d34bb --- /dev/null +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -0,0 +1,400 @@ + + * Copyright (C) 2001-2002 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018 Alexandre Spangaro + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/members/new.php + * \ingroup member + * \brief Example of form to add a new member + * + * Note that you can add following constant to change behaviour of page + * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form + * MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited + * MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe + * MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation) + * MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted + * MEMBER_NEWFORM_FORCETYPE Force type of member + * MEMBER_NEWFORM_FORCEMORPHY Force nature of member (mor/phy) + * MEMBER_NEWFORM_FORCECOUNTRYCODE Force country + */ + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + +// Init vars +$errmsg = ''; +$num = 0; +$error = 0; +$backtopage = GETPOST('backtopage', 'alpha'); +$action = GETPOST('action', 'aZ09'); + +$key = 'DV3PH'; +$id = dol_decode(GETPOST('id'), $key); + +// Securekey check +$securekey = GETPOST('securekey', 'alpha'); +if ($securekey != $conf->global->EVENTORGANIZATION_SECUREKEY) { + print $langs->trans('MissingOrBadSecureKey'); + exit; +} + +// Load translation files +$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); + +$extrafields = new ExtraFields($db); + +$user->loadDefaultValues(); + + +/** + * Show header for new member + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +{ + global $user, $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + + print ''; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
'; + // Output html code for logo + if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } + print '
'; + + print '
'; +} + +/** + * Show footer for new member + * + * @return void + */ +function llxFooterVierge() +{ + print '
'; + + printCommonFooter('public'); + + print "\n"; + print "\n"; +} + + + +/* + * Actions + */ +$parameters = array(); +// Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +// Action called when page is submitted +if (empty($reshook) && $action == 'add') { + $error = 0; + + + + $urlback = ''; + + $db->begin(); + + + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; + } + if (!GETPOST("societe")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; + } + if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; + } + + if (!$error) { + // Vérifier si client existe + $thirdparty = new Societe($db); + $nomsociete = GETPOST("societe"); + $resultfetchthirdparty = $thirdparty->fetch('', $nomsociete); + + if($resultfetchthirdparty<0){ + $error++; + $errmsg .= $thirdparty->error; + $readythirdparty = -1; + + } elseif($resultfetchthirdparty==0){ + // creation of a new thirdparty + $thirdparty->name = $nomsociete; + $thirdparty->address = GETPOST("address"); + $thirdparty->zip = GETPOST("zipcode"); + $thirdparty->town = GETPOST("town"); + $thirdparty->client = 2; + $thirdparty->fournisseur = 0; + $thirdparty->country_id = GETPOST("country_id", 'int'); + $thirdparty->state_id = GETPOST("state_id", 'int'); + + // Load object modCodeTiers + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeClient = new $module($db); + + if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { + $tmpcode = $modCodeClient->getNextValue($thirdparty, 0); + } + $thirdparty->code_client = $tmpcode; + $readythirdparty = $thirdparty->create($user); + + } else { + // We have an existing thirdparty ready to use + $readythirdparty = 1; + } + + if ($readythirdparty < 0){ + $error++; + $errmsg .= $thirdparty->error; + } else { + // creation of an attendee + $confattendee = new ConferenceOrBoothAttendee($db); + $confattendee->fk_soc = $thirdparty->id; + $confattendee->date_subscription = dol_now(); + $confattendee->email = GETPOST("email"); + $confattendee->fk_actioncomm = $id; + $resultconfattendee = $confattendee->create($user); + if ($resultconfattendee < 0){ + $error++; + $errmsg .= $confattendee->error; + } + } + } + + if (!$error) { + $db->commit(); + //Header("Location: ".$urlback); + //exit; + } else { + $db->rollback(); + } +} + + +/* + * View + */ + +$form = new Form($db); +$formcompany = new FormCompany($db); + +$conference = new ConferenceOrBooth($db); +$resultconf = $conference->fetch($id); +if ($resultconf < 0){ + setEventMessages(null, $object->errors, "errors"); +} + +llxHeaderVierge($langs->trans("NewSubscription")); + + +print load_fiche_titre($langs->trans("NewSubscription"), '', '', 0, 0, 'center'); + + +print '
'; +print '
'; +print '
'; + +// Welcome message +print $langs->trans("EvntOrgWelcomeMessage"); +print $id.".".'
'; +print $langs->trans("EvntOrgStartDuration"); +print dol_print_date($conference->datep).' '; +print $langs->trans("EvntOrgEndDuration"); +print ' '.dol_print_date($conference->datef)."."; +print '
'; + +dol_htmloutput_errors($errmsg); + +// Print form +print '
'."\n"; +print ''; +print ''; +print ''; +print ''; +print ''; + +print '
'; + +print '
'.$langs->trans("FieldsWithAreMandatory", '*').'
'; +//print $langs->trans("FieldsWithIsForPublic",'**').'
'; + +print dol_get_fiche_head(''); + +print ''; + +print ''."\n"; + +// Company +print ''."\n"; +// Address +print ''."\n"; +// Zip / Town +print ''; +// Country +print ''; +// State +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} +// Email +print ''."\n"; + +print "
'.$langs->trans("Company").' *
'.$langs->trans("Address").''."\n"; +print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print ' / '; +print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); +print '
'.$langs->trans('Country').''; +$country_id = GETPOST('country_id'); +if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); +} +if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } + } +} +$country_code = getCountry($country_id, 2, $db, $langs); +print $form->select_country($country_id, 'country_id'); +print '
'.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } else { + print ''; + } + print '
'.$langs->trans("Email").' *
\n"; + +print dol_get_fiche_end(); + +// Save +print '
'; +print ''; +if (!empty($backtopage)) { + print '     '; +} +print '
'; + + +print "
\n"; +print "
"; +print '
'; + + +llxFooterVierge(); + +$db->close(); From 2b58bc904b1bd38115c5841cdea8777c2125781e Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 9 Apr 2021 14:36:02 +0000 Subject: [PATCH 044/216] Fixing style errors. --- htdocs/admin/eventorganization.php | 2 +- .../attendee_subscription.php | 120 +++++++++--------- 2 files changed, 60 insertions(+), 62 deletions(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 6347e1d4cca..9338aa3a6dd 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -60,7 +60,7 @@ $arrayofparameters = array( 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), - 'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1), + 'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1), ); $error = 0; diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 885058d34bb..800c6dc469d 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -81,8 +81,8 @@ $id = dol_decode(GETPOST('id'), $key); // Securekey check $securekey = GETPOST('securekey', 'alpha'); if ($securekey != $conf->global->EVENTORGANIZATION_SECUREKEY) { - print $langs->trans('MissingOrBadSecureKey'); - exit; + print $langs->trans('MissingOrBadSecureKey'); + exit; } // Load translation files @@ -176,15 +176,15 @@ if (empty($reshook) && $action == 'add') { $error = 0; - + $urlback = ''; $db->begin(); - + if (!GETPOST("email")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; } if (!GETPOST("societe")) { $error++; @@ -197,67 +197,65 @@ if (empty($reshook) && $action == 'add') { } if (!$error) { - // Vérifier si client existe + // Vérifier si client existe $thirdparty = new Societe($db); $nomsociete = GETPOST("societe"); $resultfetchthirdparty = $thirdparty->fetch('', $nomsociete); - if($resultfetchthirdparty<0){ - $error++; - $errmsg .= $thirdparty->error; - $readythirdparty = -1; - - } elseif($resultfetchthirdparty==0){ - // creation of a new thirdparty - $thirdparty->name = $nomsociete; - $thirdparty->address = GETPOST("address"); - $thirdparty->zip = GETPOST("zipcode"); - $thirdparty->town = GETPOST("town"); - $thirdparty->client = 2; - $thirdparty->fournisseur = 0; - $thirdparty->country_id = GETPOST("country_id", 'int'); - $thirdparty->state_id = GETPOST("state_id", 'int'); - - // Load object modCodeTiers - $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); - if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { - $module = substr($module, 0, dol_strlen($module) - 4); - } - $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); - foreach ($dirsociete as $dirroot) { - $res = dol_include_once($dirroot.$module.'.php'); - if ($res) { - break; - } - } - $modCodeClient = new $module($db); + if ($resultfetchthirdparty<0) { + $error++; + $errmsg .= $thirdparty->error; + $readythirdparty = -1; + } elseif ($resultfetchthirdparty==0) { + // creation of a new thirdparty + $thirdparty->name = $nomsociete; + $thirdparty->address = GETPOST("address"); + $thirdparty->zip = GETPOST("zipcode"); + $thirdparty->town = GETPOST("town"); + $thirdparty->client = 2; + $thirdparty->fournisseur = 0; + $thirdparty->country_id = GETPOST("country_id", 'int'); + $thirdparty->state_id = GETPOST("state_id", 'int'); - if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { - $tmpcode = $modCodeClient->getNextValue($thirdparty, 0); - } - $thirdparty->code_client = $tmpcode; - $readythirdparty = $thirdparty->create($user); - + // Load object modCodeTiers + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeClient = new $module($db); + + if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { + $tmpcode = $modCodeClient->getNextValue($thirdparty, 0); + } + $thirdparty->code_client = $tmpcode; + $readythirdparty = $thirdparty->create($user); } else { - // We have an existing thirdparty ready to use - $readythirdparty = 1; + // We have an existing thirdparty ready to use + $readythirdparty = 1; } - - if ($readythirdparty < 0){ - $error++; - $errmsg .= $thirdparty->error; + + if ($readythirdparty < 0) { + $error++; + $errmsg .= $thirdparty->error; } else { - // creation of an attendee - $confattendee = new ConferenceOrBoothAttendee($db); - $confattendee->fk_soc = $thirdparty->id; - $confattendee->date_subscription = dol_now(); - $confattendee->email = GETPOST("email"); - $confattendee->fk_actioncomm = $id; - $resultconfattendee = $confattendee->create($user); - if ($resultconfattendee < 0){ - $error++; - $errmsg .= $confattendee->error; - } + // creation of an attendee + $confattendee = new ConferenceOrBoothAttendee($db); + $confattendee->fk_soc = $thirdparty->id; + $confattendee->date_subscription = dol_now(); + $confattendee->email = GETPOST("email"); + $confattendee->fk_actioncomm = $id; + $resultconfattendee = $confattendee->create($user); + if ($resultconfattendee < 0) { + $error++; + $errmsg .= $confattendee->error; + } } } @@ -280,8 +278,8 @@ $formcompany = new FormCompany($db); $conference = new ConferenceOrBooth($db); $resultconf = $conference->fetch($id); -if ($resultconf < 0){ - setEventMessages(null, $object->errors, "errors"); +if ($resultconf < 0) { + setEventMessages(null, $object->errors, "errors"); } llxHeaderVierge($langs->trans("NewSubscription")); From 937fe333f1a7745df43c872a9b6954968a0ee397 Mon Sep 17 00:00:00 2001 From: Ahmad Hadeed Date: Fri, 9 Apr 2021 20:49:39 +0300 Subject: [PATCH 045/216] Moving Friday to end of function declaration to maintain backward compatibility --- htdocs/core/lib/date.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 2d4bb04abb3..74953305de7 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -672,7 +672,7 @@ function getGMTEasterDatetime($year) * @return int|string Number of non working days or error message string if error * @see num_between_day(), num_open_day() */ -function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $lastday = 0, $includefriday = -1, $includesaturday = -1, $includesunday = -1) +function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $lastday = 0, $includesaturday = -1, $includesunday = -1, $includefriday = -1) { global $db, $conf, $mysoc; @@ -687,7 +687,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $country_code = $mysoc->country_code; } if ($includefriday < 0) { - $includefriday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY : 0); + $includefriday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY : 0); } if ($includesaturday < 0) { $includesaturday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY : 1); From 20e51016eda824257ed18e69d14015ea03d570ed Mon Sep 17 00:00:00 2001 From: Ahmad Hadeed Date: Fri, 9 Apr 2021 21:11:37 +0300 Subject: [PATCH 046/216] fixing function description comment to satisfy 'stickler-ci' --- htdocs/core/lib/date.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 74953305de7..63a6f83da4a 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -666,10 +666,10 @@ function getGMTEasterDatetime($year) * @param int $timestampEnd Timestamp end (UTC with hour, min, sec = 0) * @param string $country_code Country code * @param int $lastday Last day is included, 0: no, 1:yes - * @param int $includefriday Include friday as non working day (-1=use setup, 0=no, 1=yes) + * @param int $includefriday Include friday as non working day (-1=use setup, 0=no, 1=yes) * @param int $includesaturday Include saturday as non working day (-1=use setup, 0=no, 1=yes) * @param int $includesunday Include sunday as non working day (-1=use setup, 0=no, 1=yes) - * @return int|string Number of non working days or error message string if error + * @return int|string Number of non working days or error message string if error * @see num_between_day(), num_open_day() */ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $lastday = 0, $includesaturday = -1, $includesunday = -1, $includefriday = -1) @@ -693,7 +693,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $includesaturday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY : 1); } if ($includesunday < 0) { - $includesunday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY : 1); + $includesunday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY : 1); } $country_id = dol_getIdFromCode($db, $country_code, 'c_country', 'code', 'rowid'); From 63f7369adb04c03bd14d4e39419a150d4fc62e9b Mon Sep 17 00:00:00 2001 From: Ahmad Hadeed Date: Fri, 9 Apr 2021 21:16:24 +0300 Subject: [PATCH 047/216] Fixing 'stickler-ci' complaint, function description not in order --- htdocs/core/lib/date.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 63a6f83da4a..aa7476cd321 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -666,9 +666,9 @@ function getGMTEasterDatetime($year) * @param int $timestampEnd Timestamp end (UTC with hour, min, sec = 0) * @param string $country_code Country code * @param int $lastday Last day is included, 0: no, 1:yes - * @param int $includefriday Include friday as non working day (-1=use setup, 0=no, 1=yes) * @param int $includesaturday Include saturday as non working day (-1=use setup, 0=no, 1=yes) * @param int $includesunday Include sunday as non working day (-1=use setup, 0=no, 1=yes) + * @param int $includefriday Include friday as non working day (-1=use setup, 0=no, 1=yes) * @return int|string Number of non working days or error message string if error * @see num_between_day(), num_open_day() */ From d269e8da15a0e678c4f18061888ad2e51c30f966 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 9 Apr 2021 20:55:28 +0200 Subject: [PATCH 048/216] Update llx_c_socialnetworks.sql --- .../mysql/data/llx_c_socialnetworks.sql | 75 ++++++++++--------- 1 file changed, 41 insertions(+), 34 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_socialnetworks.sql b/htdocs/install/mysql/data/llx_c_socialnetworks.sql index 829cbbf0294..5bfbcf090d9 100644 --- a/htdocs/install/mysql/data/llx_c_socialnetworks.sql +++ b/htdocs/install/mysql/data/llx_c_socialnetworks.sql @@ -1,4 +1,11 @@ +-- Copyright (C) Year(-Year) Author Name -- +-- eldy +-- frederic34 +-- dolibit-ut +-- + +-- License -- 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 -- the Free Software Foundation; either version 3 of the License, or @@ -10,46 +17,46 @@ -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License --- along with this program. If not, see . +-- along with this program. If not, see . -- -- --- +-- Note -- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors -- de l'install et tous les sigles '--' sont supprimés. -- -- socialnetworks -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'facebook', 'Facebook', 'https://www.facebook.com/{socialid}', 'fa-facebook', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'skype', 'Skype', 'https://www.skype.com/{socialid}', 'fa-skype', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'twitter', 'Twitter', 'https://www.twitter.com/{socialid}', 'fa-twitter', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'linkedin', 'LinkedIn', 'https://www.linkedin.com/{socialid}', 'fa-linkedin', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'instagram', 'Instagram', 'https://www.instagram.com/{socialid}', 'fa-instagram', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'snapchat', 'Snapchat', '{socialid}', 'fa-snapchat', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'googleplus', 'GooglePlus', 'https://www.googleplus.com/{socialid}', 'fa-google-plus-g', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'youtube', 'Youtube', 'https://www.youtube.com/{socialid}', 'fa-youtube', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'whatsapp', 'Whatsapp', '{socialid}', 'fa-whatsapp', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'tumblr', 'Tumblr', 'https://www.tumblr.com/{socialid}', 'fa-tumblr', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'vero', 'Vero', 'https://vero.co/{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'viadeo', 'Viadeo', 'https://fr.viadeo.com/fr/{socialid}', 'fa-viadeo', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'slack', 'Slack', '{socialid}', 'fa-slack', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'xing', 'Xing', '{socialid}', 'fa-xing', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'meetup', 'Meetup', '{socialid}', 'fa-meetup', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'pinterest', 'Pinterest', '{socialid}', 'fa-pinterest', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'flickr', 'Flickr', '{socialid}', 'fa-flickr', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, '500px', '500px', '{socialid}', 'fa-500px', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'giphy', 'Giphy', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'gifycat', 'Gificat', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'dailymotion', 'Dailymotion', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'vimeo', 'Vimeo', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'periscope', 'Periscope', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'twitch', 'Twitch', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'discord', 'Discord', '{socialid}', 'fa-discord', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'wikipedia', 'Wikipedia', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'reddit', 'Reddit', '{socialid}', 'fa-reddit', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'quora', 'Quora', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'tripadvisor', 'Tripadvisor', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'mastodon', 'Mastodon', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'diaspora', 'Diaspora', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'viber', 'Viber', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, '500px', '500px', '{socialid}', 'fa-500px', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'dailymotion', 'Dailymotion', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'diaspora', 'Diaspora', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'discord', 'Discord', '{socialid}', 'fa-discord', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'facebook', 'Facebook', 'https://www.facebook.com/{socialid}', 'fa-facebook', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'flickr', 'Flickr', '{socialid}', 'fa-flickr', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'gifycat', 'Gificat', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'giphy', 'Giphy', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'googleplus', 'GooglePlus', 'https://www.googleplus.com/{socialid}', 'fa-google-plus-g', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'instagram', 'Instagram', 'https://www.instagram.com/{socialid}', 'fa-instagram', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'linkedin', 'LinkedIn', 'https://www.linkedin.com/{socialid}', 'fa-linkedin', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'mastodon', 'Mastodon', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'meetup', 'Meetup', '{socialid}', 'fa-meetup', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'periscope', 'Periscope', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'pinterest', 'Pinterest', '{socialid}', 'fa-pinterest', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'quora', 'Quora', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'reddit', 'Reddit', '{socialid}', 'fa-reddit', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'slack', 'Slack', '{socialid}', 'fa-slack', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'snapchat', 'Snapchat', '{socialid}', 'fa-snapchat', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'skype', 'Skype', 'https://www.skype.com/{socialid}', 'fa-skype', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'tripadvisor', 'Tripadvisor', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'tumblr', 'Tumblr', 'https://www.tumblr.com/{socialid}', 'fa-tumblr', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'twitch', 'Twitch', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'twitter', 'Twitter', 'https://www.twitter.com/{socialid}', 'fa-twitter', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'vero', 'Vero', 'https://vero.co/{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'viadeo', 'Viadeo', 'https://fr.viadeo.com/fr/{socialid}', 'fa-viadeo', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'viber', 'Viber', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'vimeo', 'Vimeo', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'whatsapp', 'Whatsapp', '{socialid}', 'fa-whatsapp', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'wikipedia', 'Wikipedia', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'xing', 'Xing', '{socialid}', 'fa-xing', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'youtube', 'Youtube', 'https://www.youtube.com/{socialid}', 'fa-youtube', 1); From 52213d0ac71fe688d910ed022e964cff60766376 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Apr 2021 21:15:43 +0200 Subject: [PATCH 049/216] Fix duplicate permissions --- htdocs/core/menus/init_menu_auguria.sql | 8 ++++---- htdocs/core/menus/standard/eldy.lib.php | 8 ++++---- htdocs/core/modules/modHRM.class.php | 3 ++- htdocs/user/class/api_users.class.php | 3 +-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 27eed001188..2d77f7a285b 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -19,7 +19,7 @@ insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, left insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|asset', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->asset->enabled', 9__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire || $user->rights->asset->read', '', 2, 54, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('adherent', '$conf->adherent->enabled', 13__+MAX_llx_menu__, __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 19, __ENTITY__); -insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', 15__+MAX_llx_menu__, __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->hrm->employee->read || $user->rights->holiday->write || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__); +insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', 15__+MAX_llx_menu__, __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->user->user->lire || $user->rights->holiday->read || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__); -- Home - Dashboard insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 90__+MAX_llx_menu__, 'home', '', 1__+MAX_llx_menu__, '/index.php', 'MyDashboard', 0, '', '', '', 2, 0, __ENTITY__); @@ -411,9 +411,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 5200__+MAX_llx_menu__, 'members', 'cat', 13__+MAX_llx_menu__, '/categories/index.php?mainmenu=members&leftmenu=cat&type=3', 'MembersCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 5201__+MAX_llx_menu__, 'members', '', 5200__+MAX_llx_menu__, '/categories/card.php?mainmenu=members&action=create&type=3', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); -- HRM - Employee -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee', 'Employees', 0, 'hrm', '$user->rights->hrm->employee->read', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4601__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/card.php?mainmenu=hrm&action=create&employee=1', 'NewEmployee', 1, 'hrm', '$user->rights->hrm->employee->write', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist', 'List', 1, 'hrm', '$user->rights->hrm->employee->read', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee', 'Employees', 0, 'hrm', '$user->rights->user->user->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4601__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/card.php?mainmenu=hrm&action=create&employee=1', 'NewEmployee', 1, 'hrm', '$user->rights->user->user->creer', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist', 'List', 1, 'hrm', '$user->rights->user->user->lire', '', 0, 2, __ENTITY__); -- HRM - Holiday insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5000__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&leftmenu=hrm', 'CPTitreMenu', 0, 'holiday', '$user->rights->holiday->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5001__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/card.php?mainmenu=hrm&action=create', 'MenuAddCP', 1, 'holiday', '$user->rights->holiday->write', '', 0, 1, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 31d4baa38f1..ed835a3d4c0 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -361,7 +361,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // HRM $tmpentry = array( 'enabled'=>(!empty($conf->hrm->enabled) || (!empty($conf->holiday->enabled)) || !empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled) || !empty($conf->recruitment->enabled)), - 'perms'=>(!empty($user->rights->hrm->employee->read) || !empty($user->rights->holiday->write) || !empty($user->rights->deplacement->lire) || !empty($user->rights->expensereport->lire) || !empty($user->rights->recruitment->recruitmentjobposition->read)), + 'perms'=>(!empty($user->rights->user->user->lire) || !empty($user->rights->holiday->read) || !empty($user->rights->deplacement->lire) || !empty($user->rights->expensereport->lire) || !empty($user->rights->recruitment->recruitmentjobposition->read)), 'module'=>'hrm|holiday|deplacement|expensereport|recruitment' ); @@ -1741,9 +1741,9 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->hrm->enabled)) { $langs->load("hrm"); - $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->hrm->employee->read, '', $mainmenu, 'hrm'); - $newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->hrm->employee->write); - $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->hrm->employee->read); + $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->user->user->lire, '', $mainmenu, 'hrm'); + $newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->user->user->creer); + $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->user->user->lire); } // Leave/Holiday/Vacation module diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index ad36253fe22..759c8b7d284 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -89,6 +89,7 @@ class modHRM extends DolibarrModules $this->rights = array(); // Permission array used by this module $r = 0; + /* $this->rights[$r][0] = 4001; $this->rights[$r][1] = 'See employees'; $this->rights[$r][3] = 0; @@ -116,7 +117,7 @@ class modHRM extends DolibarrModules $this->rights[$r][4] = 'employee'; $this->rights[$r][5] = 'export'; $r++; - + */ // Menus //------- diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index d50fec76353..571bca3eb39 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -621,8 +621,7 @@ class Users extends DolibarrApi unset($object->facebook); unset($object->linkedin); - $canreadsalary = ((!empty($conf->salaries->enabled) && !empty(DolibarrApiAccess::$user->rights->salaries->read)) - || (!empty($conf->hrm->enabled) && !empty(DolibarrApiAccess::$user->rights->hrm->employee->read))); + $canreadsalary = ((!empty($conf->salaries->enabled) && !empty(DolibarrApiAccess::$user->rights->salaries->read)) || (empty($conf->salaries->enabled))); if (!$canreadsalary) { unset($object->salary); From 0c343f1f0fdd3d12376a2271619a8018af1b6803 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 9 Apr 2021 21:18:42 +0200 Subject: [PATCH 050/216] Update llx_c_type_contact.sql --- .../install/mysql/data/llx_c_type_contact.sql | 134 ++++++++++-------- 1 file changed, 76 insertions(+), 58 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_type_contact.sql b/htdocs/install/mysql/data/llx_c_type_contact.sql index 78fdade6e9a..31135710e86 100644 --- a/htdocs/install/mysql/data/llx_c_type_contact.sql +++ b/htdocs/install/mysql/data/llx_c_type_contact.sql @@ -5,7 +5,10 @@ -- Copyright (C) 2004 Guillaume Delecourt -- Copyright (C) 2005-2009 Regis Houssin -- Copyright (C) 2007 Patrick Raguin +-- Copyright (C) 2021 Udo Tamm -- + +-- -- 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 -- the Free Software Foundation; either version 3 of the License, or @@ -21,84 +24,99 @@ -- -- +-- Notes +-- +-- Do not place a comment at the end of the line, this file is parsed when +-- of the install and all the acronyms '-' are removed. -- -- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors -- de l'install et tous les sigles '--' sont supprimés. -- -- +-- The types of contact of an element -- Les types de contact d'un element -- -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (10, 'contrat', 'internal', 'SALESREPSIGN', 'Commercial signataire du contrat', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (11, 'contrat', 'internal', 'SALESREPFOLL', 'Commercial suivi du contrat', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (20, 'contrat', 'external', 'BILLING', 'Contact client facturation contrat', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (21, 'contrat', 'external', 'CUSTOMER', 'Contact client suivi contrat', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (22, 'contrat', 'external', 'SALESREPSIGN', 'Contact client signataire contrat', 1); - -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (31, 'propal', 'internal', 'SALESREPFOLL', 'Commercial à l''origine de la propale', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (40, 'propal', 'external', 'BILLING', 'Contact client facturation propale', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (41, 'propal', 'external', 'CUSTOMER', 'Contact client suivi propale', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (42, 'propal', 'external', 'SHIPPING', 'Contact client livraison propale', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (50, 'facture', 'internal', 'SALESREPFOLL', 'Responsable suivi du paiement', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (60, 'facture', 'external', 'BILLING', 'Contact client facturation', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (61, 'facture', 'external', 'SHIPPING', 'Contact client livraison', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (62, 'facture', 'external', 'SERVICE', 'Contact client prestation', 1); +-- Contract / Contrat +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (10, 'contrat', 'internal', 'SALESREPSIGN', 'Commercial signataire du contrat', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (11, 'contrat', 'internal', 'SALESREPFOLL', 'Commercial suivi du contrat', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (20, 'contrat', 'external', 'BILLING', 'Contact client facturation contrat', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (21, 'contrat', 'external', 'CUSTOMER', 'Contact client suivi contrat', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (22, 'contrat', 'external', 'SALESREPSIGN', 'Contact client signataire contrat', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (70, 'invoice_supplier', 'internal', 'SALESREPFOLL', 'Responsable suivi du paiement', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (71, 'invoice_supplier', 'external', 'BILLING', 'Contact fournisseur facturation', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (72, 'invoice_supplier', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (73, 'invoice_supplier', 'external', 'SERVICE', 'Contact fournisseur prestation', 1); +-- Proposal / Propal +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (31, 'propal', 'internal', 'SALESREPFOLL', 'Commercial à l''origine de la propale', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (40, 'propal', 'external', 'BILLING', 'Contact client facturation propale', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (41, 'propal', 'external', 'CUSTOMER', 'Contact client suivi propale', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (42, 'propal', 'external', 'SHIPPING', 'Contact client livraison propale', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (80, 'agenda', 'internal', 'ACTOR', 'Responsable', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (81, 'agenda', 'internal', 'GUEST', 'Guest', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (85, 'agenda', 'external', 'ACTOR', 'Responsable', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (86, 'agenda', 'external', 'GUEST', 'Guest', 1); +-- Customer Invoice / Facture +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (50, 'facture', 'internal', 'SALESREPFOLL', 'Responsable suivi du paiement', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (60, 'facture', 'external', 'BILLING', 'Contact client facturation', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (61, 'facture', 'external', 'SHIPPING', 'Contact client livraison', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (62, 'facture', 'external', 'SERVICE', 'Contact client prestation', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (91, 'commande','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (100,'commande','external', 'BILLING', 'Contact client facturation commande', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (101,'commande','external', 'CUSTOMER', 'Contact client suivi commande', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (102,'commande','external', 'SHIPPING', 'Contact client livraison commande', 1); +-- Supplier Invoice +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (70, 'invoice_supplier', 'internal', 'SALESREPFOLL', 'Responsable suivi du paiement', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (71, 'invoice_supplier', 'external', 'BILLING', 'Contact fournisseur facturation', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (72, 'invoice_supplier', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (73, 'invoice_supplier', 'external', 'SERVICE', 'Contact fournisseur prestation', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (120, 'fichinter','internal', 'INTERREPFOLL', 'Responsable suivi de l''intervention', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (121, 'fichinter','internal', 'INTERVENING', 'Intervenant', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (130, 'fichinter','external', 'BILLING', 'Contact client facturation intervention', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (131, 'fichinter','external', 'CUSTOMER', 'Contact client suivi de l''intervention', 1); +-- Agenda +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (80, 'agenda', 'internal', 'ACTOR', 'Responsable', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (81, 'agenda', 'internal', 'GUEST', 'Guest', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (85, 'agenda', 'external', 'ACTOR', 'Responsable', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (86, 'agenda', 'external', 'GUEST', 'Guest', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (140, 'order_supplier','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (141, 'order_supplier','internal', 'SHIPPING', 'Responsable réception de la commande', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (142, 'order_supplier','external', 'BILLING', 'Contact fournisseur facturation commande', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (143, 'order_supplier','external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (145, 'order_supplier','external', 'SHIPPING', 'Contact fournisseur livraison commande', 1); +-- Customer Order / Commande +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (91, 'commande', 'internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (100,'commande', 'external', 'BILLING', 'Contact client facturation commande', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (101,'commande', 'external', 'CUSTOMER', 'Contact client suivi commande', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (102,'commande', 'external', 'SHIPPING', 'Contact client livraison commande', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (150, 'dolresource','internal', 'USERINCHARGE', 'In charge of resource', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (151, 'dolresource','external', 'THIRDINCHARGE', 'In charge of resource', 1); +-- Intervention / Fichinter +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (120, 'fichinter', 'internal', 'INTERREPFOLL', 'Responsable suivi de l''intervention', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (121, 'fichinter', 'internal', 'INTERVENING', 'Intervenant', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (130, 'fichinter', 'external', 'BILLING', 'Contact client facturation intervention', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (131, 'fichinter', 'external', 'CUSTOMER', 'Contact client suivi de l''intervention', 1); --- All project code can start with 'PROJECT' -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (160, 'project', 'internal', 'PROJECTLEADER', 'Chef de Projet', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (161, 'project', 'internal', 'PROJECTCONTRIBUTOR', 'Intervenant', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (170, 'project', 'external', 'PROJECTLEADER', 'Chef de Projet', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (171, 'project', 'external', 'PROJECTCONTRIBUTOR', 'Intervenant', 1); +-- Supplier Order +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (140, 'order_supplier', 'internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (141, 'order_supplier', 'internal', 'SHIPPING', 'Responsable réception de la commande', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (142, 'order_supplier', 'external', 'BILLING', 'Contact fournisseur facturation commande', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (143, 'order_supplier', 'external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (145, 'order_supplier', 'external', 'SHIPPING', 'Contact fournisseur livraison commande', 1); --- All task code can start with 'TASK' -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (180, 'project_task', 'internal', 'TASKEXECUTIVE', 'Responsable', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (181, 'project_task', 'internal', 'TASKCONTRIBUTOR', 'Intervenant', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (190, 'project_task', 'external', 'TASKEXECUTIVE', 'Responsable', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (191, 'project_task', 'external', 'TASKCONTRIBUTOR', 'Intervenant', 1); +-- Resource +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (150, 'dolresource', 'internal', 'USERINCHARGE', 'In charge of resource', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (151, 'dolresource', 'external', 'THIRDINCHARGE', 'In charge of resource', 1); -- Tickets -INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(155, 'ticket', 'internal', 'SUPPORTTEC', 'Utilisateur contact support', 1, NULL); -INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(156, 'ticket', 'internal', 'CONTRIBUTOR', 'Intervenant', 1, NULL); -INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(157, 'ticket', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1, NULL); -INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(158, 'ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1, NULL); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active, module) values (155, 'ticket', 'internal', 'SUPPORTTEC', 'Utilisateur contact support', 1, NULL); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active, module) values (156, 'ticket', 'internal', 'CONTRIBUTOR', 'Intervenant', 1, NULL); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active, module) values (157, 'ticket', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1, NULL); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active, module) values (158, 'ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1, NULL); + +-- Projects / Projet - All project code can start with 'PROJECT' +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (160, 'project', 'internal', 'PROJECTLEADER', 'Chef de Projet', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (161, 'project', 'internal', 'PROJECTCONTRIBUTOR', 'Intervenant', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (170, 'project', 'external', 'PROJECTLEADER', 'Chef de Projet', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (171, 'project', 'external', 'PROJECTCONTRIBUTOR', 'Intervenant', 1); + +-- Project Tasks - All task code can start with 'TASK' +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (180, 'project_task', 'internal', 'TASKEXECUTIVE', 'Responsable', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (181, 'project_task', 'internal', 'TASKCONTRIBUTOR', 'Intervenant', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (190, 'project_task', 'external', 'TASKEXECUTIVE', 'Responsable', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (191, 'project_task', 'external', 'TASKCONTRIBUTOR', 'Intervenant', 1); -- Supplier proposal -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110, 'supplier_proposal', 'internal', 'SALESREPFOLL', 'Responsable suivi de la demande', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (111, 'supplier_proposal', 'external', 'BILLING', 'Contact fournisseur facturation', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (112, 'supplier_proposal', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (113, 'supplier_proposal', 'external', 'SERVICE', 'Contact fournisseur prestation', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (110, 'supplier_proposal', 'internal', 'SALESREPFOLL', 'Responsable suivi de la demande', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (111, 'supplier_proposal', 'external', 'BILLING', 'Contact fournisseur facturation', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (112, 'supplier_proposal', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (113, 'supplier_proposal', 'external', 'SERVICE', 'Contact fournisseur prestation', 1); -- Event Organization -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (210, 'conferenceorbooth', 'internal', 'MANAGER', 'Conference or Booth manager', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (211, 'conferenceorbooth', 'external', 'SPEAKER', 'Conference Speaker', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (212, 'conferenceorbooth', 'external', 'RESPONSIBLE', 'Booth responsible', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (210, 'conferenceorbooth', 'internal', 'MANAGER', 'Conference or Booth manager', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (211, 'conferenceorbooth', 'external', 'SPEAKER', 'Conference Speaker', 1); +insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (212, 'conferenceorbooth', 'external', 'RESPONSIBLE', 'Booth responsible', 1); From 0cf659eb8588378d2595881460b1c67e60400dc9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Apr 2021 00:26:28 +0200 Subject: [PATCH 051/216] Fix syntax error --- htdocs/product/class/api_products.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index a572d0946c4..6b26421d0f8 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -808,7 +808,7 @@ class Products extends DolibarrApi $sql .= ' WHERE t.entity IN ('.getEntity('product').')'; if ($supplier > 0) { - $sql .= " AND s.fk_soc = "((int) $supplier); + $sql .= " AND s.fk_soc = ".((int) $supplier); } if ($socid > 0) { // if external user $sql .= " AND s.fk_soc = ".((int) $socid); From 280d534b7ad0f11a2e5dd6c55ae6424bf68429ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Apr 2021 00:29:32 +0200 Subject: [PATCH 052/216] Fix phpcs --- 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 94f1210041a..5f88a1a3f1e 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2708,7 +2708,7 @@ class CommandeFournisseur extends CommonOrder if ($qty < $this->line->packaging) { $qty = $this->line->packaging; } else { - if (! empty($this->line->packaging) && ($qty % $this->line->packaging) > 0) { + if (! empty($this->line->packaging) && ($qty % $this->line->packaging) > 0) { $coeff = intval($qty / $this->line->packaging) + 1; $qty = $this->line->packaging * $coeff; setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs'); From 83e272951fb3e265c71af3ef0d9c7fe1c4d73eca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Apr 2021 00:31:20 +0200 Subject: [PATCH 053/216] Fix phpcs --- htdocs/core/lib/website2.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 675c691c624..6510d5fff8d 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -108,7 +108,7 @@ function dolSavePageAlias($filealias, $object, $objectpage) $dirname = dirname($filealias); $filename = basename($filealias); foreach (explode(',', $object->otherlang) as $sublang) { - // Avoid to erase main alias file if $sublang is empty string + // Avoid to erase main alias file if $sublang is empty string if (empty(trim($sublang))) continue; $filealiassub = $dirname.'/'.$sublang.'/'.$filename; From eadd8defaf9a4a94cc9d47648c5bc8e8eca70829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20de=20la=20Cal=20Bretschneider?= Date: Sat, 10 Apr 2021 11:22:32 +0200 Subject: [PATCH 054/216] Good friday is a holiday --- htdocs/core/lib/date.lib.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index ecf1cf999de..64a8e67b999 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -775,6 +775,21 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', //print 'annee='.$annee.' $jour='.$jour.' $mois='.$mois.' $jour_lundi_paques='.$jour_lundi_paques.' $mois_lundi_paques='.$mois_lundi_paques."\n"; } + //Good Friday + if (in_array('goodfriday', $specialdayrule)) { + // Pulls the date of Easter + $easter = getGMTEasterDatetime($annee); + + // Calculates the date of Good Friday based on Easter + $date_good_friday = $easter - (2 * 3600 * 24); + $dom_good_friday = gmdate("d", $date_good_friday); + $month_good_friday = gmdate("m", $date_good_friday); + + if ($dom_good_friday == $jour && $month_good_friday == $mois) { + $ferie = true; + } + } + if (in_array('ascension', $specialdayrule)) { // Calcul du jour de l'ascension (39 days after easter day) $date_paques = getGMTEasterDatetime($annee); From c86b100477ba5601c6e25fb624a688337218c7b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Apr 2021 12:34:30 +0200 Subject: [PATCH 055/216] Update llx_c_type_contact.sql --- htdocs/install/mysql/data/llx_c_type_contact.sql | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_type_contact.sql b/htdocs/install/mysql/data/llx_c_type_contact.sql index 31135710e86..825e21ddf42 100644 --- a/htdocs/install/mysql/data/llx_c_type_contact.sql +++ b/htdocs/install/mysql/data/llx_c_type_contact.sql @@ -7,8 +7,6 @@ -- Copyright (C) 2007 Patrick Raguin -- Copyright (C) 2021 Udo Tamm -- - --- -- 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 -- the Free Software Foundation; either version 3 of the License, or @@ -21,9 +19,8 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . --- --- +-- -- Notes -- -- Do not place a comment at the end of the line, this file is parsed when From ce6f8eebf5a7ae513d5bb6fc1b38a868655641b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Apr 2021 12:42:43 +0200 Subject: [PATCH 056/216] Close #17206 Add comment on type of constants --- htdocs/core/lib/admin.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 3088db079e3..e2f93b1152b 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -571,7 +571,7 @@ function dolibarr_get_const($db, $name, $entity = 1) * @param DoliDB $db Database handler * @param string $name Name of constant * @param string $value Value of constant - * @param string $type Type of constant ('chaine by default) + * @param string $type Type of constant. Deprecated, only strings are allowed for $value. Caller must json encode/decode to store other type of data. * @param int $visible Is constant visible in Setup->Other page (0 by default) * @param string $note Note on parameter * @param int $entity Multi company id (0 means all entities) From 6241ba559bd3c4e19ce7892ad6d980929504d8d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Apr 2021 12:44:41 +0200 Subject: [PATCH 057/216] Trans --- htdocs/core/lib/admin.lib.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index e2f93b1152b..ed01d9d6e9f 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -534,24 +534,23 @@ function dolibarr_del_const($db, $name, $entity = 1) } /** - * Recupere une constante depuis la base de donnees. + * Get the value of a setup constant from database * * @param DoliDB $db Database handler - * @param string $name Nom de la constante + * @param string $name Name of constant * @param int $entity Multi company id - * @return string Valeur de la constante + * @return string Value of constant * * @see dolibarr_del_const(), dolibarr_set_const(), dol_set_user_param() */ function dolibarr_get_const($db, $name, $entity = 1) { - global $conf; $value = ''; $sql = "SELECT ".$db->decrypt('value')." as value"; $sql .= " FROM ".MAIN_DB_PREFIX."const"; $sql .= " WHERE name = ".$db->encrypt($name, 1); - $sql .= " AND entity = ".$entity; + $sql .= " AND entity = ".((int) $entity); dol_syslog("admin.lib::dolibarr_get_const", LOG_DEBUG); $resql = $db->query($sql); @@ -599,7 +598,7 @@ function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0, $sql = "DELETE FROM ".MAIN_DB_PREFIX."const"; $sql .= " WHERE name = ".$db->encrypt($name, 1); if ($entity >= 0) { - $sql .= " AND entity = ".$entity; + $sql .= " AND entity = ".((int) $entity); } dol_syslog("admin.lib::dolibarr_set_const", LOG_DEBUG); @@ -610,7 +609,7 @@ function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0, $sql .= " VALUES ("; $sql .= $db->encrypt($name, 1); $sql .= ", ".$db->encrypt($value, 1); - $sql .= ",'".$db->escape($type)."',".$visible.",'".$db->escape($note)."',".$entity.")"; + $sql .= ",'".$db->escape($type)."',".((int) $visible).",'".$db->escape($note)."',".((int) $entity).")"; //print "sql".$value."-".pg_escape_string($value)."-".$sql;exit; //print "xx".$db->escape($value); From 260f39a4d296646ba7161f3604f0e191d0650067 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sat, 10 Apr 2021 13:18:57 +0200 Subject: [PATCH 058/216] Update llx_10_c_regions.sql Switzerland/Suisse San Salvador Netherlands United Kingdom --- .../install/mysql/data/llx_10_c_regions.sql | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index 6c25826c4ca..0c6e5bd9be8 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -66,7 +66,11 @@ -- Germany -> for Departmements -- Greece -- Italy +-- Netherlands -> for Departmements +-- San Salvador -- Spain +-- Switzerland/Suisse -> for Departmements/Cantons +-- United Kingdom @@ -219,7 +223,17 @@ insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3 insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 320, NULL, 1, 'Veneto'); ---Spain Regions (id country=4) +-- Netherlands Regions (id country=17) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 17, 1701, '', 0,'Provincies van Nederland '); + + +-- San Salvador Regions (id country=86) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (86, 8601, NULL, NULL, 'Central'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (86, 8602, NULL, NULL, 'Oriental'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (86, 8603, NULL, NULL, 'Occidental'); + + +-- Spain Regions (id country=4) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 401, '', 0, 'Andalucia'); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 402, '', 0, 'Aragón'); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 403, '', 0, 'Castilla y León'); @@ -242,14 +256,16 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 420, '', 0, 'Otros'); --- Regions Switzerland (id country=6) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 6, 601, '', 1, 'Cantons', 1); +-- Switzerland Regions (id country=6) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 6, 601, '', 1, 'Cantons'); + + +-- UK United Kingdom Regions (id_country=7) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 7, 701, '', 0, 'England'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 7, 702, '', 0, 'Wales'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 7, 703, '', 0, 'Scotland'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 7, 704, '', 0, 'Northern Ireland'); --- Regions UK United Kingdom (id_country=7) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 7, 701, '', 0, 'England', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 7, 702, '', 0, 'Wales', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 7, 703, '', 0, 'Scotland', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 7, 704, '', 0, 'Northern Ireland', 1); -- Regions Tunisia (id country=10) insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1001, '',0,'Ariana'); @@ -277,25 +293,19 @@ insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,102 insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1023, '',0,'Tunis'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1024, '',0,'Zaghouan'); + -- Region USA (id country=11) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 11, 1101, '', 0, 'United-States', 1); --- Regions The Netherlands (id country=17) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 17, 1701, '', 0,'Provincies van Nederland ', 1); - - --- Regions San Salvador (id country=86) -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 8601, 86, NULL, NULL, 'Central', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 8602, 86, NULL, NULL, 'Oriental', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 8603, 86, NULL, NULL, 'Occidental', 1); - -- Regions Honduras (id country=114) insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 114, 11401, '', 0, 'Honduras', 1); + -- Regions India (id country=117) insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 117, 11701, '', 0, 'India', 1); + -- Regions Indonesia (id country=118) insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 118, 11801, '', 0, 'Indonesia', 1); From 95a5296d45f5715c93550604960fe08c773cb361 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Apr 2021 13:29:24 +0200 Subject: [PATCH 059/216] NEW Can hide columns "time consumed" on timesheet per week. --- htdocs/core/lib/project.lib.php | 40 +++++++-------- htdocs/projet/activity/perday.php | 10 +--- htdocs/projet/activity/permonth.php | 10 +--- htdocs/projet/activity/perweek.php | 76 ++++++++++++++++------------- htdocs/theme/md/style.css.php | 4 +- 5 files changed, 68 insertions(+), 72 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index abdb098eb7d..8037c6b2f70 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1903,27 +1903,29 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print ''; } - // Time spent by everybody - print ''; - // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consummed by user - if ($lines[$i]->duration) { - print ''; - print convertSecondToTime($lines[$i]->duration, 'allhourmin'); - print ''; - } else { - print '--:--'; - } - print "\n"; + if (!empty($arrayfields['timeconsumed']['checked'])) { + // Time spent by everybody + print ''; + // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consummed by user + if ($lines[$i]->duration) { + print ''; + print convertSecondToTime($lines[$i]->duration, 'allhourmin'); + print ''; + } else { + print '--:--'; + } + print "\n"; - // Time spent by user - print ''; - $tmptimespent = $taskstatic->getSummaryOfTimeSpent($fuser->id); - if ($tmptimespent['total_duration']) { - print convertSecondToTime($tmptimespent['total_duration'], 'allhourmin'); - } else { - print '--:--'; + // Time spent by user + print ''; + $tmptimespent = $taskstatic->getSummaryOfTimeSpent($fuser->id); + if ($tmptimespent['total_duration']) { + print convertSecondToTime($tmptimespent['total_duration'], 'allhourmin'); + } else { + print '--:--'; + } + print "\n"; } - print "\n"; $disabledproject = 1; $disabledtask = 1; diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index fc5ea53e98a..de4e32143fa 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -61,10 +61,6 @@ $socid = 0; $result = restrictedArea($user, 'projet', $projectid); $now = dol_now(); -$nowtmp = dol_getdate($now); -$nowday = $nowtmp['mday']; -$nowmonth = $nowtmp['mon']; -$nowyear = $nowtmp['year']; $year = GETPOST('reyear', 'int') ?GETPOST('reyear', 'int') : (GETPOST("year", "int") ?GETPOST("year", "int") : (GETPOST("addtimeyear", "int") ?GETPOST("addtimeyear", "int") : date("Y"))); $month = GETPOST('remonth', 'int') ?GETPOST('remonth', 'int') : (GETPOST("month", "int") ?GETPOST("month", "int") : (GETPOST("addtimemonth", "int") ?GETPOST("addtimemonth", "int") : date("m"))); @@ -73,7 +69,7 @@ $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); $day = (int) $day; -$search_categ = GETPOST("search_categ", 'alpha'); +//$search_categ = GETPOST("search_categ", 'alpha'); $search_usertoprocessid = GETPOST('search_usertoprocessid', 'int'); $search_task_ref = GETPOST('search_task_ref', 'alpha'); $search_task_label = GETPOST('search_task_label', 'alpha'); @@ -153,7 +149,7 @@ if ($reshook < 0) { // Purge criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $action = ''; - $search_categ = ''; + //$search_categ = ''; $search_usertoprocessid = $user->id; $search_task_ref = ''; $search_task_label = ''; @@ -422,9 +418,7 @@ $nav = '".dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "day")." \n"; $nav .= ''.img_next($langs->trans("Next"))."\n"; -//$nav .= "   (".$langs->trans("Today").")"; $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' '; -//$nav .= ' '; $nav .= ' '; $picto = 'clock'; diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 5fd76694c34..31067d2e312 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -57,10 +57,6 @@ $socid = 0; $result = restrictedArea($user, 'projet', $projectid); $now = dol_now(); -$nowtmp = dol_getdate($now); -$nowday = $nowtmp['mday']; -$nowmonth = $nowtmp['mon']; -$nowyear = $nowtmp['year']; $year = GETPOST('reyear') ?GETPOST('reyear', 'int') : (GETPOST("year") ?GETPOST("year", "int") : date("Y")); $month = GETPOST('remonth') ?GETPOST('remonth', 'int') : (GETPOST("month") ?GETPOST("month", "int") : date("m")); @@ -68,7 +64,7 @@ $day = GETPOST('reday') ?GETPOST('reday', 'int') : (GETPOST("day") ?GETPOST("day $day = (int) $day; $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); -$search_categ = GETPOST("search_categ", 'alpha'); +//$search_categ = GETPOST("search_categ", 'alpha'); $search_usertoprocessid = GETPOST('search_usertoprocessid', 'int'); $search_task_ref = GETPOST('search_task_ref', 'alpha'); $search_task_label = GETPOST('search_task_label', 'alpha'); @@ -119,7 +115,7 @@ if ($reshook < 0) { // Purge criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $action = ''; - $search_categ = ''; + //$search_categ = ''; $search_usertoprocessid = $user->id; $search_task_ref = ''; $search_task_label = ''; @@ -349,9 +345,7 @@ $param .= ($search_task_label ? '&search_task_label='.$search_task_label : ''); $nav = ''.img_previous($langs->trans("Previous"))."\n"; $nav .= " ".dol_print_date(dol_mktime(0, 0, 0, $month, 1, $year), "%Y").", ".$langs->trans(date('F', mktime(0, 0, 0, $month, 10)))." \n"; $nav .= ''.img_next($langs->trans("Next"))."\n"; -//$nav.="   (".$langs->trans("Today").")"; $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' '; -//$nav.=' '; $nav .= ' '; $picto = 'clock'; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 4201fca41b6..301d9c3da7c 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -61,10 +61,6 @@ $socid = 0; $result = restrictedArea($user, 'projet', $projectid); $now = dol_now(); -$nowtmp = dol_getdate($now); -$nowday = $nowtmp['mday']; -$nowmonth = $nowtmp['mon']; -$nowyear = $nowtmp['year']; $year = GETPOST('reyear', 'int') ?GETPOST('reyear', 'int') : (GETPOST("year", 'int') ?GETPOST("year", "int") : date("Y")); $month = GETPOST('remonth', 'int') ?GETPOST('remonth', 'int') : (GETPOST("month", 'int') ?GETPOST("month", "int") : date("m")); @@ -73,7 +69,7 @@ $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); $day = (int) $day; -$search_categ = GETPOST("search_categ", 'alpha'); +//$search_categ = GETPOST("search_categ", 'alpha'); $search_usertoprocessid = GETPOST('search_usertoprocessid', 'int'); $search_task_ref = GETPOST('search_task_ref', 'alpha'); $search_task_label = GETPOST('search_task_label', 'alpha'); @@ -129,8 +125,9 @@ $arrayfields = array(); 'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110), 'p.usage_bill_time'=>array('label'=>$langs->trans("BillTimeShort"), 'checked'=>0, 'position'=>115), );*/ -$arrayfields['t.planned_workload'] = array('label'=>'PlannedWorkload', 'checked'=>1, 'enabled'=>1, 'position'=>0); -$arrayfields['t.progress'] = array('label'=>'ProgressDeclared', 'checked'=>1, 'enabled'=>1, 'position'=>0); +$arrayfields['t.planned_workload'] = array('label'=>'PlannedWorkload', 'checked'=>1, 'enabled'=>1, 'position'=>5); +$arrayfields['t.progress'] = array('label'=>'ProgressDeclared', 'checked'=>1, 'enabled'=>1, 'position'=>10); +$arrayfields['timeconsumed'] = array('label'=>'TimeConsumed', 'checked'=>1, 'enabled'=>1, 'position'=>15); /*foreach($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field @@ -165,7 +162,7 @@ if ($reshook < 0) { // Purge criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $action = ''; - $search_categ = ''; + //$search_categ = ''; $search_usertoprocessid = $user->id; $search_task_ref = ''; $search_task_label = ''; @@ -441,9 +438,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; $nav = ''.img_previous($langs->trans("Previous"))."\n"; $nav .= " ".dol_print_date(dol_mktime(0, 0, 0, $first_month, $first_day, $first_year), "%Y").", ".$langs->trans("WeekShort")." ".$week." \n"; $nav .= ''.img_next($langs->trans("Next"))."\n"; -//$nav .= "   (".$langs->trans("Today").")"; $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' '; -//$nav .= ' '; $nav .= ' '; $picto = 'clock'; @@ -618,14 +613,16 @@ $search_options_pattern = 'search_task_options_'; $extrafieldsobjectkey = 'projet_task'; $extrafieldsobjectprefix = 'efpt.'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; -print ''; if (!empty($arrayfields['t.planned_workload']['checked'])) { - print ''; -} -if (!empty($arrayfields['t.progress']['checked'])) { print ''; } -print ''; +if (!empty($arrayfields['t.progress']['checked'])) { + print ''; +} +if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; +} for ($idw = 0; $idw < 7; $idw++) { print ''; } @@ -654,17 +651,15 @@ if (!empty($arrayfields['t.planned_workload']['checked'])) { if (!empty($arrayfields['t.progress']['checked'])) { print ''.$langs->trans("ProgressDeclared").''; } -/*print ''.$langs->trans("TimeSpent").''; - if ($usertoprocess->id == $user->id) print ''.$langs->trans("TimeSpentByYou").''; - else print ''.$langs->trans("TimeSpentByUser").'';*/ -print ''.$langs->trans("TimeSpent").'
'; -print ''; -print 'Photo'; -print ''.$langs->trans("Everybody").''; -print ''; -print ''; -print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').''; - +if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''.$langs->trans("TimeSpent").'
'; + print ''; + print 'Photo'; + print ''.$langs->trans("Everybody").''; + print ''; + print ''; + print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').''; +} for ($idw = 0; $idw < 7; $idw++) { $dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); // $firstdaytoshow is a date with hours = 0 $dayinloop = dol_time_plus_duree($startday, $idw, 'd'); @@ -693,7 +688,7 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $ print "\n"; -$colspan = 3 + (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : 2); +$colspan = 1 + (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : 2); if ($conf->use_javascript_ajax) { print ''; @@ -701,7 +696,10 @@ if ($conf->use_javascript_ajax) { print $langs->trans("Total"); print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; print ''; - + if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; + } for ($idw = 0; $idw < 7; $idw++) { $cssweekend = ''; if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) { // This is a day is not inside the setup of working days, so we use a week-end css. @@ -780,6 +778,10 @@ if (count($tasksarray) > 0) { print ''; print $langs->trans("OtherFilteredTasks"); print ''; + if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; + } for ($idw = 0; $idw < 7; $idw++) { $cssweekend = ''; if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) { // This is a day is not inside the setup of working days, so we use a week-end css. @@ -801,11 +803,15 @@ if (count($tasksarray) > 0) { } if ($conf->use_javascript_ajax) { - print ' - '; - print $langs->trans("Total"); - print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; - print ''; + print ''; + print ''; + print $langs->trans("Total"); + print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; + print ''; + if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; + } for ($idw = 0; $idw < 7; $idw++) { $cssweekend = ''; @@ -826,8 +832,8 @@ if (count($tasksarray) > 0) { print '
 
'; } - print '
 
- '; + print '
 
'; + print ''; } } else { print ''.$langs->trans("NoAssignedTasks").''; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index e807ae62234..7e0b857eb6d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2284,8 +2284,8 @@ li.tmenu, li.tmenusel { li.tmenu:hover { opacity: .50; /* show only a slight shadow */ } -li.tmenusel { - text-decoration: underline; +li.tmenusel a.tmenusel { + text-decoration: underline !important; } .tmenuend .tmenuleft { width: 0px; } .tmenuend { display: none; } From cb08151473ef6f34e724e40a150e26f0e5d5aa9e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sat, 10 Apr 2021 13:47:35 +0200 Subject: [PATCH 060/216] Update llx_20_c_departements.sql Romania --- .../mysql/data/llx_20_c_departements.sql | 92 ++++++++++--------- 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index 445a970b3f9..b48831bbd39 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -53,6 +53,8 @@ -- (Italy) -- Luxembourg -- Netherlands +-- (Moroco) +-- Romania @@ -731,6 +733,52 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA19A', 1214, '', 0, '', 'Province de Tan-Tan', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA19B', 1214, '', 0, '', 'Province de Tan-Tan', 1); + +-- Romania Provinces (id country=188) +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'AB', '', 0, '', 'Alba'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'AR', '', 0, '', 'Arad'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'AG', '', 0, '', 'Argeș'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'BC', '', 0, '', 'Bacău'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'BH', '', 0, '', 'Bihor'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'BN', '', 0, '', 'Bistrița-Năsăud'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'BT', '', 0, '', 'Botoșani'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'BV', '', 0, '', 'Brașov'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'BR', '', 0, '', 'Brăila'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'BU', '', 0, '', 'Bucuresti'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'BZ', '', 0, '', 'Buzău'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'CL', '', 0, '', 'Călărași'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'CS', '', 0, '', 'Caraș-Severin'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'CJ', '', 0, '', 'Cluj'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'CT', '', 0, '', 'Constanța'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'CV', '', 0, '', 'Covasna'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'DB', '', 0, '', 'Dâmbovița'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'DJ', '', 0, '', 'Dolj'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'GL', '', 0, '', 'Galați'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'GR', '', 0, '', 'Giurgiu'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'GJ', '', 0, '', 'Gorj'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'HR', '', 0, '', 'Harghita'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'HD', '', 0, '', 'Hunedoara'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'IL', '', 0, '', 'Ialomița'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'IS', '', 0, '', 'Iași'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'IF', '', 0, '', 'Ilfov'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'MM', '', 0, '', 'Maramureș'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'MH', '', 0, '', 'Mehedinți'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'MS', '', 0, '', 'Mureș'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'NT', '', 0, '', 'Neamț'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'OT', '', 0, '', 'Olt'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'PH', '', 0, '', 'Prahova'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'SM', '', 0, '', 'Satu Mare'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'SJ', '', 0, '', 'Sălaj'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'SB', '', 0, '', 'Sibiu'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'SV', '', 0, '', 'Suceava'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'TR', '', 0, '', 'Teleorman'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'TM', '', 0, '', 'Timiș'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'TL', '', 0, '', 'Tulcea'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'VS', '', 0, '', 'Vaslui'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'VL', '', 0, '', 'Vâlcea'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'VN', '', 0, '', 'Vrancea'); + + -- Provinces Tunisia (id country=10) INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN01', 1001, '', 0, '', 'Ariana', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN02', 1001, '', 0, '', 'Béja', 1); @@ -1328,50 +1376,6 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ZAC', 15401, '', 0, 'ZAC', 'Zacatecas', 1); --- Provinces Romania (id country=188) -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AB', 18801, '', 0, '', 'Alba', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AR', 18801, '', 0, '', 'Arad', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AG', 18801, '', 0, '', 'Argeș', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BC', 18801, '', 0, '', 'Bacău', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BH', 18801, '', 0, '', 'Bihor', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BN', 18801, '', 0, '', 'Bistrița-Năsăud', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BT', 18801, '', 0, '', 'Botoșani', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BV', 18801, '', 0, '', 'Brașov', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BR', 18801, '', 0, '', 'Brăila', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BZ', 18801, '', 0, '', 'Buzău', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CL', 18801, '', 0, '', 'Călărași', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CS', 18801, '', 0, '', 'Caraș-Severin', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CJ', 18801, '', 0, '', 'Cluj', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CT', 18801, '', 0, '', 'Constanța', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CV', 18801, '', 0, '', 'Covasna', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('DB', 18801, '', 0, '', 'Dâmbovița', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('DJ', 18801, '', 0, '', 'Dolj', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('GL', 18801, '', 0, '', 'Galați', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('GR', 18801, '', 0, '', 'Giurgiu', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('GJ', 18801, '', 0, '', 'Gorj', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('HR', 18801, '', 0, '', 'Harghita', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('HD', 18801, '', 0, '', 'Hunedoara', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('IL', 18801, '', 0, '', 'Ialomița', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('IS', 18801, '', 0, '', 'Iași', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('IF', 18801, '', 0, '', 'Ilfov', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MM', 18801, '', 0, '', 'Maramureș', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MH', 18801, '', 0, '', 'Mehedinți', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MS', 18801, '', 0, '', 'Mureș', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('NT', 18801, '', 0, '', 'Neamț', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('OT', 18801, '', 0, '', 'Olt', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PH', 18801, '', 0, '', 'Prahova', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SM', 18801, '', 0, '', 'Satu Mare', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SJ', 18801, '', 0, '', 'Sălaj', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SB', 18801, '', 0, '', 'Sibiu', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SV', 18801, '', 0, '', 'Suceava', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('TR', 18801, '', 0, '', 'Teleorman', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('TM', 18801, '', 0, '', 'Timiș', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('TL', 18801, '', 0, '', 'Tulcea', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VS', 18801, '', 0, '', 'Vaslui', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VL', 18801, '', 0, '', 'Vâlcea', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VN', 18801, '', 0, '', 'Vrancea', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BU', 18801, '', 0, '', 'Bucuresti', 1); - -- Provinces Venezuela (id country=232) INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-L', 23201, '', 0, 'VE-L', 'Mérida', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-T', 23201, '', 0, 'VE-T', 'Trujillo', 1); From cb57546d99129f7315454bc35491705e12491b52 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Apr 2021 13:29:24 +0200 Subject: [PATCH 061/216] NEW Can hide columns "time consumed" on timesheet per week. --- htdocs/core/lib/project.lib.php | 80 ++++++++++++++------------- htdocs/projet/activity/perday.php | 63 ++++++++++++---------- htdocs/projet/activity/permonth.php | 10 +--- htdocs/projet/activity/perweek.php | 84 ++++++++++++++++------------- htdocs/theme/md/style.css.php | 4 +- 5 files changed, 128 insertions(+), 113 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index abdb098eb7d..a440940d76d 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1512,27 +1512,29 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr print ''; } - // Time spent by everybody - print ''; - // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consummed by user - if ($lines[$i]->duration) { - print ''; - print convertSecondToTime($lines[$i]->duration, 'allhourmin'); - print ''; - } else { - print '--:--'; - } - print "\n"; + if (!empty($arrayfields['timeconsumed']['checked'])) { + // Time spent by everybody + print ''; + // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consummed by user + if ($lines[$i]->duration) { + print ''; + print convertSecondToTime($lines[$i]->duration, 'allhourmin'); + print ''; + } else { + print '--:--'; + } + print "\n"; - // Time spent by user - print ''; - $tmptimespent = $taskstatic->getSummaryOfTimeSpent($fuser->id); - if ($tmptimespent['total_duration']) { - print convertSecondToTime($tmptimespent['total_duration'], 'allhourmin'); - } else { - print '--:--'; + // Time spent by user + print ''; + $tmptimespent = $taskstatic->getSummaryOfTimeSpent($fuser->id); + if ($tmptimespent['total_duration']) { + print convertSecondToTime($tmptimespent['total_duration'], 'allhourmin'); + } else { + print '--:--'; + } + print "\n"; } - print "\n"; $disabledproject = 1; $disabledtask = 1; @@ -1903,27 +1905,29 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print ''; } - // Time spent by everybody - print ''; - // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consummed by user - if ($lines[$i]->duration) { - print ''; - print convertSecondToTime($lines[$i]->duration, 'allhourmin'); - print ''; - } else { - print '--:--'; - } - print "\n"; + if (!empty($arrayfields['timeconsumed']['checked'])) { + // Time spent by everybody + print ''; + // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consummed by user + if ($lines[$i]->duration) { + print ''; + print convertSecondToTime($lines[$i]->duration, 'allhourmin'); + print ''; + } else { + print '--:--'; + } + print "\n"; - // Time spent by user - print ''; - $tmptimespent = $taskstatic->getSummaryOfTimeSpent($fuser->id); - if ($tmptimespent['total_duration']) { - print convertSecondToTime($tmptimespent['total_duration'], 'allhourmin'); - } else { - print '--:--'; + // Time spent by user + print ''; + $tmptimespent = $taskstatic->getSummaryOfTimeSpent($fuser->id); + if ($tmptimespent['total_duration']) { + print convertSecondToTime($tmptimespent['total_duration'], 'allhourmin'); + } else { + print '--:--'; + } + print "\n"; } - print "\n"; $disabledproject = 1; $disabledtask = 1; diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index fc5ea53e98a..44ed79c2520 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -61,10 +61,6 @@ $socid = 0; $result = restrictedArea($user, 'projet', $projectid); $now = dol_now(); -$nowtmp = dol_getdate($now); -$nowday = $nowtmp['mday']; -$nowmonth = $nowtmp['mon']; -$nowyear = $nowtmp['year']; $year = GETPOST('reyear', 'int') ?GETPOST('reyear', 'int') : (GETPOST("year", "int") ?GETPOST("year", "int") : (GETPOST("addtimeyear", "int") ?GETPOST("addtimeyear", "int") : date("Y"))); $month = GETPOST('remonth', 'int') ?GETPOST('remonth', 'int') : (GETPOST("month", "int") ?GETPOST("month", "int") : (GETPOST("addtimemonth", "int") ?GETPOST("addtimemonth", "int") : date("m"))); @@ -73,7 +69,7 @@ $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); $day = (int) $day; -$search_categ = GETPOST("search_categ", 'alpha'); +//$search_categ = GETPOST("search_categ", 'alpha'); $search_usertoprocessid = GETPOST('search_usertoprocessid', 'int'); $search_task_ref = GETPOST('search_task_ref', 'alpha'); $search_task_label = GETPOST('search_task_label', 'alpha'); @@ -117,6 +113,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $arrayfields = array(); $arrayfields['t.planned_workload'] = array('label'=>'PlannedWorkload', 'checked'=>1, 'enabled'=>1, 'position'=>0); $arrayfields['t.progress'] = array('label'=>'ProgressDeclared', 'checked'=>1, 'enabled'=>1, 'position'=>0); +$arrayfields['timeconsumed'] = array('label'=>'TimeConsumed', 'checked'=>1, 'enabled'=>1, 'position'=>15); /*$arrayfields=array( // Project 'p.opp_amount'=>array('label'=>$langs->trans("OpportunityAmountShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>103), @@ -153,7 +150,7 @@ if ($reshook < 0) { // Purge criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $action = ''; - $search_categ = ''; + //$search_categ = ''; $search_usertoprocessid = $user->id; $search_task_ref = ''; $search_task_label = ''; @@ -403,12 +400,13 @@ llxHeader("", $title, "", '', '', '', array('/core/js/timesheet.js')); $param = ''; $param .= ($mode ? '&mode='.urlencode($mode) : ''); $param .= ($search_project_ref ? '&search_project_ref='.urlencode($search_project_ref) : ''); -$param .= ($search_usertoprocessid ? '&search_usertoprocessid='.urlencode($search_usertoprocessid) : ''); +$param .= ($search_usertoprocessid > 0 ? '&search_usertoprocessid='.urlencode($search_usertoprocessid) : ''); $param .= ($search_thirdparty ? '&search_thirdparty='.urlencode($search_thirdparty) : ''); $param .= ($search_task_ref ? '&search_task_ref='.urlencode($search_task_ref) : ''); $param .= ($search_task_label ? '&search_task_label='.urlencode($search_task_label) : ''); -/*$search_array_options=$search_array_options_project; +/* +$search_array_options = $search_array_options_project; $search_options_pattern='search_options_'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; */ @@ -422,9 +420,7 @@ $nav = '".dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "day")."
\n"; $nav .= ''.img_next($langs->trans("Next"))."\n"; -//$nav .= "   (".$langs->trans("Today").")"; $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' '; -//$nav .= ' '; $nav .= ' '; $picto = 'clock'; @@ -561,14 +557,16 @@ $search_options_pattern = 'search_task_options_'; $extrafieldsobjectkey = 'projet_task'; $extrafieldsobjectprefix = 'efpt.'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; -print ''; if (!empty($arrayfields['t.planned_workload']['checked'])) { - print ''; -} -if (!empty($arrayfields['t.progress']['checked'])) { print ''; } -print ''; +if (!empty($arrayfields['t.progress']['checked'])) { + print ''; +} +if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; +} print ''; print ''; print ''; @@ -592,21 +590,20 @@ $extrafieldsobjectkey = 'projet_task'; $extrafieldsobjectprefix = 'efpt.'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; if (!empty($arrayfields['t.planned_workload']['checked'])) { - print ''.$langs->trans("PlannedWorkload").''; + print ''.$langs->trans("PlannedWorkload").''; } if (!empty($arrayfields['t.progress']['checked'])) { print ''.$langs->trans("ProgressDeclared").''; } -/*print ''.$langs->trans("TimeSpent").''; -if ($usertoprocess->id == $user->id) print ''.$langs->trans("TimeSpentByYou").''; -else print ''.$langs->trans("TimeSpentByUser").'';*/ -print ''.$langs->trans("TimeSpent").'
'; -print ''; -print 'Photo'; -print ''.$langs->trans("Everybody").''; -print ''; -print ''; -print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').''; +if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''.$langs->trans("TimeSpent").'
'; + print ''; + print 'Photo'; + print ''.$langs->trans("Everybody").''; + print ''; + print ''; + print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').''; +} print ''.$langs->trans("HourStart").''; // By default, we can edit only tasks we are assigned to @@ -658,13 +655,17 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $ print "\n"; -$colspan = 4 + (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : 2); +$colspan = 2 + (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : 2); if ($conf->use_javascript_ajax) { print ''; print ''; print $langs->trans("Total"); print ''; + if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; + } print ''; //print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; print ''; @@ -723,6 +724,10 @@ if (count($tasksarray) > 0) { print ''; print $langs->trans("OtherFilteredTasks"); print ''; + if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; + } print ''; print ''; $timeonothertasks = ($totalforeachday[$daytoparse] - $totalforvisibletasks[$daytoparse]); @@ -745,6 +750,10 @@ if (count($tasksarray) > 0) { print ''; print $langs->trans("Total"); print ''; + if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; + } print ''; //print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; print ''; diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 5fd76694c34..31067d2e312 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -57,10 +57,6 @@ $socid = 0; $result = restrictedArea($user, 'projet', $projectid); $now = dol_now(); -$nowtmp = dol_getdate($now); -$nowday = $nowtmp['mday']; -$nowmonth = $nowtmp['mon']; -$nowyear = $nowtmp['year']; $year = GETPOST('reyear') ?GETPOST('reyear', 'int') : (GETPOST("year") ?GETPOST("year", "int") : date("Y")); $month = GETPOST('remonth') ?GETPOST('remonth', 'int') : (GETPOST("month") ?GETPOST("month", "int") : date("m")); @@ -68,7 +64,7 @@ $day = GETPOST('reday') ?GETPOST('reday', 'int') : (GETPOST("day") ?GETPOST("day $day = (int) $day; $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); -$search_categ = GETPOST("search_categ", 'alpha'); +//$search_categ = GETPOST("search_categ", 'alpha'); $search_usertoprocessid = GETPOST('search_usertoprocessid', 'int'); $search_task_ref = GETPOST('search_task_ref', 'alpha'); $search_task_label = GETPOST('search_task_label', 'alpha'); @@ -119,7 +115,7 @@ if ($reshook < 0) { // Purge criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $action = ''; - $search_categ = ''; + //$search_categ = ''; $search_usertoprocessid = $user->id; $search_task_ref = ''; $search_task_label = ''; @@ -349,9 +345,7 @@ $param .= ($search_task_label ? '&search_task_label='.$search_task_label : ''); $nav = ''.img_previous($langs->trans("Previous"))."\n"; $nav .= " ".dol_print_date(dol_mktime(0, 0, 0, $month, 1, $year), "%Y").", ".$langs->trans(date('F', mktime(0, 0, 0, $month, 10)))." \n"; $nav .= ''.img_next($langs->trans("Next"))."\n"; -//$nav.="   (".$langs->trans("Today").")"; $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' '; -//$nav.=' '; $nav .= ' '; $picto = 'clock'; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 4201fca41b6..fdf6e492361 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -61,10 +61,6 @@ $socid = 0; $result = restrictedArea($user, 'projet', $projectid); $now = dol_now(); -$nowtmp = dol_getdate($now); -$nowday = $nowtmp['mday']; -$nowmonth = $nowtmp['mon']; -$nowyear = $nowtmp['year']; $year = GETPOST('reyear', 'int') ?GETPOST('reyear', 'int') : (GETPOST("year", 'int') ?GETPOST("year", "int") : date("Y")); $month = GETPOST('remonth', 'int') ?GETPOST('remonth', 'int') : (GETPOST("month", 'int') ?GETPOST("month", "int") : date("m")); @@ -73,7 +69,7 @@ $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); $day = (int) $day; -$search_categ = GETPOST("search_categ", 'alpha'); +//$search_categ = GETPOST("search_categ", 'alpha'); $search_usertoprocessid = GETPOST('search_usertoprocessid', 'int'); $search_task_ref = GETPOST('search_task_ref', 'alpha'); $search_task_label = GETPOST('search_task_label', 'alpha'); @@ -129,8 +125,9 @@ $arrayfields = array(); 'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110), 'p.usage_bill_time'=>array('label'=>$langs->trans("BillTimeShort"), 'checked'=>0, 'position'=>115), );*/ -$arrayfields['t.planned_workload'] = array('label'=>'PlannedWorkload', 'checked'=>1, 'enabled'=>1, 'position'=>0); -$arrayfields['t.progress'] = array('label'=>'ProgressDeclared', 'checked'=>1, 'enabled'=>1, 'position'=>0); +$arrayfields['t.planned_workload'] = array('label'=>'PlannedWorkload', 'checked'=>1, 'enabled'=>1, 'position'=>5); +$arrayfields['t.progress'] = array('label'=>'ProgressDeclared', 'checked'=>1, 'enabled'=>1, 'position'=>10); +$arrayfields['timeconsumed'] = array('label'=>'TimeConsumed', 'checked'=>1, 'enabled'=>1, 'position'=>15); /*foreach($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field @@ -165,7 +162,7 @@ if ($reshook < 0) { // Purge criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $action = ''; - $search_categ = ''; + //$search_categ = ''; $search_usertoprocessid = $user->id; $search_task_ref = ''; $search_task_label = ''; @@ -184,8 +181,10 @@ if (GETPOST("button_search_x", 'alpha') || GETPOST("button_search.x", 'alpha') | } if (GETPOST('submitdateselect')) { - $daytoparse = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - + if (GETPOST('remonth', 'int') && GETPOST('reday', 'int') && GETPOST('reyear', 'int')) { + $daytoparse = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + } + $action = ''; } @@ -441,9 +440,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; $nav = ''.img_previous($langs->trans("Previous"))."\n"; $nav .= " ".dol_print_date(dol_mktime(0, 0, 0, $first_month, $first_day, $first_year), "%Y").", ".$langs->trans("WeekShort")." ".$week." \n"; $nav .= ''.img_next($langs->trans("Next"))."\n"; -//$nav .= "   (".$langs->trans("Today").")"; $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' '; -//$nav .= ' '; $nav .= ' '; $picto = 'clock'; @@ -618,14 +615,16 @@ $search_options_pattern = 'search_task_options_'; $extrafieldsobjectkey = 'projet_task'; $extrafieldsobjectprefix = 'efpt.'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; -print ''; if (!empty($arrayfields['t.planned_workload']['checked'])) { - print ''; -} -if (!empty($arrayfields['t.progress']['checked'])) { print ''; } -print ''; +if (!empty($arrayfields['t.progress']['checked'])) { + print ''; +} +if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; +} for ($idw = 0; $idw < 7; $idw++) { print ''; } @@ -649,22 +648,20 @@ $extrafieldsobjectkey = 'projet_task'; $extrafieldsobjectprefix = 'efpt.'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; if (!empty($arrayfields['t.planned_workload']['checked'])) { - print ''.$langs->trans("PlannedWorkload").''; + print ''.$langs->trans("PlannedWorkload").''; } if (!empty($arrayfields['t.progress']['checked'])) { print ''.$langs->trans("ProgressDeclared").''; } -/*print ''.$langs->trans("TimeSpent").''; - if ($usertoprocess->id == $user->id) print ''.$langs->trans("TimeSpentByYou").''; - else print ''.$langs->trans("TimeSpentByUser").'';*/ -print ''.$langs->trans("TimeSpent").'
'; -print ''; -print 'Photo'; -print ''.$langs->trans("Everybody").''; -print ''; -print ''; -print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').''; - +if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''.$langs->trans("TimeSpent").'
'; + print ''; + print 'Photo'; + print ''.$langs->trans("Everybody").''; + print ''; + print ''; + print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').''; +} for ($idw = 0; $idw < 7; $idw++) { $dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); // $firstdaytoshow is a date with hours = 0 $dayinloop = dol_time_plus_duree($startday, $idw, 'd'); @@ -693,7 +690,7 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $ print "\n"; -$colspan = 3 + (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : 2); +$colspan = 1 + (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : 2); if ($conf->use_javascript_ajax) { print ''; @@ -701,7 +698,10 @@ if ($conf->use_javascript_ajax) { print $langs->trans("Total"); print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; print ''; - + if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; + } for ($idw = 0; $idw < 7; $idw++) { $cssweekend = ''; if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) { // This is a day is not inside the setup of working days, so we use a week-end css. @@ -780,6 +780,10 @@ if (count($tasksarray) > 0) { print ''; print $langs->trans("OtherFilteredTasks"); print ''; + if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; + } for ($idw = 0; $idw < 7; $idw++) { $cssweekend = ''; if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) { // This is a day is not inside the setup of working days, so we use a week-end css. @@ -801,11 +805,15 @@ if (count($tasksarray) > 0) { } if ($conf->use_javascript_ajax) { - print ' - '; - print $langs->trans("Total"); - print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; - print ''; + print ''; + print ''; + print $langs->trans("Total"); + print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; + print ''; + if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; + } for ($idw = 0; $idw < 7; $idw++) { $cssweekend = ''; @@ -826,8 +834,8 @@ if (count($tasksarray) > 0) { print '
 
'; } - print '
 
- '; + print '
 
'; + print ''; } } else { print ''.$langs->trans("NoAssignedTasks").''; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index e807ae62234..7e0b857eb6d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2284,8 +2284,8 @@ li.tmenu, li.tmenusel { li.tmenu:hover { opacity: .50; /* show only a slight shadow */ } -li.tmenusel { - text-decoration: underline; +li.tmenusel a.tmenusel { + text-decoration: underline !important; } .tmenuend .tmenuleft { width: 0px; } .tmenuend { display: none; } From 35a64e08bf69ed081a24f7307486f475e10be10e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Apr 2021 14:12:51 +0200 Subject: [PATCH 062/216] Fix link --- htdocs/core/lib/project.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index a440940d76d..3c5e9c71dad 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2473,7 +2473,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $i = 0; print ''; - print_liste_field_titre($title.''.$num.'', $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); + print_liste_field_titre($title.''.$num.'', $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { if (!in_array('prospectionstatus', $hiddenfields)) { From 0bc93d437ec2e4d65ba81482285a9832570d079d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Apr 2021 14:21:03 +0200 Subject: [PATCH 063/216] css --- htdocs/projet/activity/perday.php | 6 +++--- htdocs/projet/activity/permonth.php | 6 +++--- htdocs/projet/activity/perweek.php | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 44ed79c2520..5b238d96b92 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -500,18 +500,18 @@ $includeonly = 'hierarchyme'; if (empty($user->rights->user->user->lire)) { $includeonly = array($user->id); } -$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200 marginleftonly'); +$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= '
'; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright"').''; $moreforfilter .= '
'; $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright"').''; $moreforfilter .= '
'; } diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 31067d2e312..43cdfa863f5 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -422,18 +422,18 @@ $includeonly = 'hierachyme'; if (empty($user->rights->user->user->lire)) { $includeonly = array($user->id); } -$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= '
'; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright"').''; $moreforfilter .= '
'; $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright"').''; $moreforfilter .= '
'; } diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index cb331f7d262..c413b5e0533 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -556,18 +556,18 @@ $includeonly = 'hierarchyme'; if (empty($user->rights->user->user->lire)) { $includeonly = array($user->id); } -$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= '
'; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright"').''; $moreforfilter .= '
'; $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright"').''; $moreforfilter .= '
'; } From be800e07f2efabb617b5d812257f641794523dd9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Apr 2021 15:27:44 +0200 Subject: [PATCH 064/216] Use urlencode even on security key --- htdocs/core/lib/payments.lib.php | 14 +++++++------- htdocs/public/payment/newpayment.php | 4 ++-- .../lib/recruitment_recruitmentjobposition.lib.php | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index f9022726511..166814525cf 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -211,9 +211,9 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag $out = $urltouse.'/public/payment/newpayment.php?amount='.($mode ? '' : '').$amount.($mode ? '' : '').'&tag='.($mode ? '' : '').$freetag.($mode ? '' : ''); if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + $out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } else { - $out .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); + $out .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2)); } } //if ($mode) $out.='&noidempotency=1'; @@ -228,7 +228,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag $out .= ($mode ? '' : ''); if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + $out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) { @@ -251,7 +251,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag $out .= ($mode ? '' : ''); if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + $out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) { @@ -274,7 +274,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag $out .= ($mode ? '' : ''); if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + $out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) { @@ -297,7 +297,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag $out .= ($mode ? '' : ''); if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + $out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) { @@ -321,7 +321,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag $out .= ($mode ? '' : ''); if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + $out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) { diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 8931ce1ceed..9a88a1b49ac 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1459,10 +1459,10 @@ if ($source == 'membersubscription') { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; $adht = new AdherentType($db); if ( !$action) { - $form = new Form($db); // so wecan call method selectarray + $form = new Form($db); // so we can call method selectarray print ''.$langs->trans("NewSubscription"); print ''; - print $form->selectarray("typeid", $adht->liste_array(1), $member->typeid, 0, 0, 0, 'onchange="window.location.replace(\''.$urlwithroot.'/public/payment/newpayment.php?source='.$source.'&ref='.$ref.'&amount='.$amount.'&typeid=\' + this.value + \'&securekey='.$SECUREKEY.'\');"', 0, 0, 0, '', '', 1); + print $form->selectarray("typeid", $adht->liste_array(1), $member->typeid, 0, 0, 0, 'onchange="window.location.replace(\''.$urlwithroot.'/public/payment/newpayment.php?source='.urlencode($source).'&ref='.urlencode($ref).'&amount='.urlencode($amount).'&typeid=\' + this.value + \'&securekey='.urlencode($SECUREKEY).'\');"', 0, 0, 0, '', '', 1); print "\n"; } elseif ($action == dopayment) { print ''.$langs->trans("NewMemberType"); diff --git a/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php b/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php index 2be1fea7756..a7bfe03aac4 100644 --- a/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php +++ b/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php @@ -127,8 +127,8 @@ function getPublicJobPositionUrl($mode, $ref = '', $localorexternal = 0) $out = $urltouse.'/public/recruitment/view.php?ref='.($mode ? '' : '').$ref.($mode ? '' : ''); /*if (!empty($conf->global->RECRUITMENT_SECURITY_TOKEN)) { - if (empty($conf->global->RECRUITMENT_SECURITY_TOKEN)) $out .= '&securekey='.$conf->global->RECRUITMENT_SECURITY_TOKEN; - else $out .= '&securekey='.dol_hash($conf->global->RECRUITMENT_SECURITY_TOKEN, 2); + if (empty($conf->global->RECRUITMENT_SECURITY_TOKEN)) $out .= '&securekey='.urlencode($conf->global->RECRUITMENT_SECURITY_TOKEN); + else $out .= '&securekey='.urlencode(dol_hash($conf->global->RECRUITMENT_SECURITY_TOKEN, 2)); }*/ // For multicompany From ce7c5a0c7b73897f9e44859e4cfae7f4f063e39c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 11 Apr 2021 04:24:21 +0200 Subject: [PATCH 065/216] Work on split module fournisseur --- htdocs/admin/stock.php | 2 +- htdocs/comm/propal/card.php | 2 +- htdocs/commande/list.php | 4 ++-- htdocs/core/ajax/selectsearchbox.php | 2 +- htdocs/core/class/conf.class.php | 2 +- htdocs/core/menus/init_menu_auguria.sql | 2 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/core/modules/modProduct.class.php | 18 ++++++++--------- htdocs/core/modules/modService.class.php | 2 +- htdocs/core/modules/modSociete.class.php | 2 +- .../doc/doc_generic_project_odt.modules.php | 4 ++-- .../task/doc/doc_generic_task_odt.modules.php | 4 ++-- .../reception/doc/pdf_squille.modules.php | 2 +- ...e_20_modWorkflow_WorkflowManager.class.php | 2 +- ..._50_modNotification_Notification.class.php | 4 ++-- htdocs/ecm/index_auto.php | 8 ++++---- htdocs/ecm/search.php | 8 ++++---- htdocs/fourn/card.php | 4 ++-- htdocs/fourn/commande/card.php | 4 ++-- htdocs/fourn/commande/index.php | 2 +- htdocs/fourn/paiement/list.php | 4 ++-- htdocs/margin/tabs/thirdpartyMargins.php | 2 +- htdocs/product/admin/product.php | 2 +- htdocs/product/class/product.class.php | 2 +- htdocs/product/list.php | 2 +- htdocs/product/stock/product.php | 4 ++-- htdocs/product/stock/replenish.php | 2 +- htdocs/projet/element.php | 4 ++-- htdocs/reception/card.php | 10 +++++----- htdocs/reception/contact.php | 4 ++-- .../canvas/actions_card_common.class.php | 2 +- htdocs/societe/card.php | 20 +++++++++---------- htdocs/societe/consumption.php | 6 +++--- htdocs/societe/index.php | 6 +++--- htdocs/societe/notify/card.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- 36 files changed, 77 insertions(+), 77 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 570ca0c2a5a..410c7170c30 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -356,7 +356,7 @@ if (!empty($conf->reception->enabled)) { print ''; print ''.$langs->trans("ReStockOnDispatchOrder").''; print ''; - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(), null, 0, 0, 0, 2, 1); } else { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 61bacfb3e66..9e852d4a019 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2534,7 +2534,7 @@ if ($action == 'create') { // Create a purchase order if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_PROPOSAL)) { - if (!empty($conf->fournisseur->enabled) && $object->statut == Propal::STATUS_SIGNED) { + if ($object->statut == Propal::STATUS_SIGNED && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) { if ($usercancreatepurchaseorder) { print ''.$langs->trans("AddPurchaseOrder").''; } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index df79a9edffd..fe279897f7a 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1631,7 +1631,7 @@ if ($resql) { } $stock_order = $generic_product->stats_commande['qty']; } - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) { $generic_product->load_stats_commande_fournisseur(0, '3'); $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty']; @@ -1653,7 +1653,7 @@ if ($resql) { } else { $text_info .= ''.$langs->trans('Available').' : '.$text_stock_reel.''; } - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { $text_info .= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier.'
'; } else { $text_info .= '
'; diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index d10324ef620..3395a21435c 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -68,7 +68,7 @@ if (!empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADH $arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || !empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) { +if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) { $arrayresult['searchintothirdparty'] = array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('', 'object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 56873fe5470..632cfc0311f 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -432,7 +432,7 @@ class Conf $this->fournisseur->payment->dir_temp = $rootfortemp."/fournisseur/payment/temp"; // For backward compatibility // To prepare split of module fournisseur into module 'fournisseur' + supplier_order + supplier_invoice - if (!empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) { // By default, if module supplier is on, and we don't use yet the new modules, we set artificialy the module properties + if (!empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) { // By default, if module supplier is on, and we don't use yet the new modules, we set artificially the module properties $this->supplier_order = new stdClass(); $this->supplier_order->enabled = 1; $this->supplier_order->multidir_output = array($this->entity => $rootfordata."/fournisseur/commande"); diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 104655ee1da..62c53a8ac8b 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -9,7 +9,7 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__; -- table llx_menu -- insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', 1__+MAX_llx_menu__, __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__); -insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur|supplier_order|supplier_invoice', '($conf->societe->enabled && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || $conf->fournisseur->enabled || $conf->supplier_order->enabled || $conf->supplier_invoice->enabled))', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); +insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur|supplier_order|supplier_invoice', '($conf->societe->enabled && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || $conf->supplier_order->enabled || $conf->supplier_invoice->enabled))', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', 16__+MAX_llx_menu__, __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 575f26542e2..cc34b2e5489 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -124,7 +124,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = ) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) ), - 'perms'=> (!empty($user->rights->societe->lire) || !empty($user->rights->fournisseur->lire)), + 'perms'=> (!empty($user->rights->societe->lire) || !empty($user->rights->fournisseur->lire) || !empty($user->rights->supplier_order->lire) || !empty($user->rights->supplier_invoice->lire) || !empty($user->rights->supplier_proposal->lire)), 'module'=>'societe|fournisseur' ); $menu_arr[] = array( diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index fd1c7cceca0..0cc1da3e52b 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -203,7 +203,7 @@ class modProduct extends DolibarrModules if (is_object($mysoc) && $usenpr) { $this->export_fields_array[$r]['p.recuperableonly'] = 'NPR'; } - if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled) || !empty($conf->margin->enabled)) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice')); } if (!empty($conf->stock->enabled)) { @@ -216,7 +216,7 @@ class modProduct extends DolibarrModules $keyforelement = 'product'; $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('s.nom'=>'Supplier', 'pf.ref_fourn'=>'SupplierRef', 'pf.quantity'=>'QtyMin', 'pf.remise_percent'=>'DiscountQtyMin', 'pf.unitprice'=>'BuyingPrice', 'pf.delivery_time_days'=>'NbDaysToDelivery')); } if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { @@ -250,7 +250,7 @@ class modProduct extends DolibarrModules if (!empty($conf->barcode->enabled)) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text')); } - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric')); } if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -269,7 +269,7 @@ class modProduct extends DolibarrModules if (!empty($conf->barcode->enabled)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product')); } - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); } if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -284,7 +284,7 @@ class modProduct extends DolibarrModules if (!empty($conf->barcode->enabled)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product')); } - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); } if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -305,7 +305,7 @@ class modProduct extends DolibarrModules $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid'; } $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object'; - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc'; } if (!empty($conf->stock->enabled)) { @@ -609,7 +609,7 @@ class modProduct extends DolibarrModules )); } - if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled) || !empty($conf->margin->enabled)) { $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.cost_price'=>'CostPrice')); } if (is_object($mysoc) && $usenpr) { @@ -702,7 +702,7 @@ class modProduct extends DolibarrModules 'p.desiredstock' => '' )); } - if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled) || !empty($conf->margin->enabled)) { $import_sample = array_merge($import_sample, array('p.cost_price'=>'90')); } if (is_object($mysoc) && $usenpr) { @@ -741,7 +741,7 @@ class modProduct extends DolibarrModules $this->import_updatekeys_array[$r] = array_merge($this->import_updatekeys_array[$r], array('p.barcode'=>'BarCode')); //only show/allow barcode as update key if Barcode module enabled } - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { // Import suppliers prices (note: this code is duplicated in module Service) $r++; $this->import_code[$r] = $this->rights_class.'_supplierprices'; diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 3b21cf046c8..9e79aee9663 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -168,7 +168,7 @@ class modService extends DolibarrModules if (is_object($mysoc) && $usenpr) { $this->export_fields_array[$r]['p.recuperableonly'] = 'NPR'; } - if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled) || !empty($conf->margin->enabled)) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice')); } if (!empty($conf->stock->enabled)) { diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index f30709445b3..af4fb9e64b8 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -384,7 +384,7 @@ class modSociete extends DolibarrModules 's.address'=>"company", 's.zip'=>"company", 's.town'=>"company", 's.phone'=>"company", 's.email'=>"company", 't.libelle'=>"company" ); // We define here only fields that use another picto - if (empty($conf->fournisseur->enabled)) { + if (empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { unset($this->export_fields_array[$r]['s.code_fournisseur']); unset($this->export_entities_array[$r]['s.code_fournisseur']); } diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 091f26a0872..315336748be 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -964,13 +964,13 @@ class doc_generic_project_odt extends ModelePDFProjects 'title' => "ListSupplierOrdersAssociatedProject", 'table' => 'commande_fournisseur', 'class' => 'CommandeFournisseur', - 'test' => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire + 'test' => ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) ), 'invoice_supplier' => array( 'title' => "ListSupplierInvoicesAssociatedProject", 'table' => 'facture_fourn', 'class' => 'FactureFournisseur', - 'test' => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire + 'test' => ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || !empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire) ), 'contract' => array( 'title' => "ListContractAssociatedProject", diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index fc444babe0d..cd6c6789038 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -50,10 +50,10 @@ if (!empty($conf->facture->enabled)) { if (!empty($conf->commande->enabled)) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } -if (!empty($conf->fournisseur->enabled)) { +if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; } -if (!empty($conf->fournisseur->enabled)) { +if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; } if (!empty($conf->contrat->enabled)) { diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 4aa6db074f6..89d30f23c5f 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -879,7 +879,7 @@ class pdf_squille extends ModelePdfReception $origin_id = $object->origin_id; // TODO move to external function - if (!empty($conf->fournisseur->enabled)) { // commonly $origin='commande' + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { // commonly $origin='commande' $outputlangs->load('orders'); $classname = 'CommandeFournisseur'; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index fc626adbedb..6bbb6d441c8 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -192,7 +192,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // First classify billed the order to allow the proposal classify process - if (!empty($conf->fournisseur->enabled) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER)) { $object->fetchObjectLinked('', 'order_supplier', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index fc0aeb3cd5e..08f94484e37 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -132,9 +132,9 @@ class InterfaceNotification extends DolibarrTriggers $element = $obj->elementtype; // Exclude events if related module is disabled - if ($element == 'order_supplier' && empty($conf->fournisseur->enabled)) { + if ($element == 'order_supplier' && (empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || empty($conf->supplier_order->enabled))) { $qualified = 0; - } elseif ($element == 'invoice_supplier' && empty($conf->fournisseur->enabled)) { + } elseif ($element == 'invoice_supplier' && (empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || empty($conf->supplier_invoice->enabled))) { $qualified = 0; } elseif ($element == 'withdraw' && empty($conf->prelevement->enabled)) { $qualified = 0; diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index f20985d45fb..ebce9b94ad8 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -330,11 +330,11 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { if (!empty($conf->supplier_proposal->enabled)) { $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals"))); } - if (!empty($conf->fournisseur->enabled)) { - $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders"))); + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { + $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders"))); } - if (!empty($conf->fournisseur->enabled)) { - $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) { + $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); } if (!empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index a665d57f1a3..2ef71544764 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -128,11 +128,11 @@ if (!empty($conf->facture->enabled)) { if (!empty($conf->supplier_proposal->enabled)) { $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals"))); } -if (!empty($conf->fournisseur->enabled)) { - $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders"))); +if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { + $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders"))); } -if (!empty($conf->fournisseur->enabled)) { - $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); +if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) { + $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); } if (!empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 294adb50146..bbc427e48df 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -406,7 +406,7 @@ if ($object->id > 0) { } } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { // Box proposals $tmp = $object->getOutstandingOrders('supplier'); $outstandingOpened = $tmp['opened']; @@ -427,7 +427,7 @@ if ($object->id > 0) { } } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) { $tmp = $object->getOutstandingBills('supplier'); $outstandingOpened = $tmp['opened']; $outstandingTotal = $tmp['total_ht']; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 0a03b367717..18c45507f0a 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2438,7 +2438,7 @@ if ($action == 'create') { } if (in_array($object->statut, array(3, 4, 5))) { - if ($conf->fournisseur->enabled && $usercanreceived) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $usercanreceived) { print ''; } else { print ''; @@ -2464,7 +2464,7 @@ if ($action == 'create') { // Create bill //if (! empty($conf->facture->enabled)) //{ - if (!empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) { // statut 2 means approved, 7 means canceled + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) { // statut 2 means approved, 7 means canceled if ($user->rights->fournisseur->facture->creer) { print ''.$langs->trans("CreateBill").''; } diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 9164a223d04..48e45190beb 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -185,7 +185,7 @@ if ($resql) { * Draft orders */ -if (!empty($conf->fournisseur->enabled)) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 000b5def498..ecd572e1046 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -112,10 +112,10 @@ if ($user->socid) { // require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; // $object = new PaiementFourn($db); // restrictedArea($user, $object->element); -if (empty($conf->fournisseur->enabled)) { +if ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_invoice->enabled)) { accessforbidden(); } -if (!$user->rights->fournisseur->facture->lire) { +if (!$user->rights->fournisseur->facture->lire || !$user->rights->supplier_invoice->lire) { accessforbidden(); } diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index b7970a58c80..b1c569c0912 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -120,7 +120,7 @@ if ($socid > 0) { print ''; } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $object->fournisseur && !empty($user->rights->fournisseur->lire)) { + if (((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { print ''; print $langs->trans('SupplierCode').''; print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 0aa39a53bb3..b23cfbc5c4c 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -682,7 +682,7 @@ if (!empty($conf->global->MAIN_MULTILANGS)) { print ''; } -if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { print ''; print ''.$langs->trans("UseProductFournDesc").''; print ''; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 16bbc508ac9..59fc743f8be 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5128,7 +5128,7 @@ class Product extends CommonObject } $stock_sending_client = $this->stats_expedition['qty']; } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { $filterStatus = '1,2,3,4'; if (isset($includedraftpoforvirtual)) { $filterStatus = '0,'.$filterStatus; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index dc035187f30..105e4408a68 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1579,7 +1579,7 @@ if ($resql) { //print price($obj->minsellprice).' '.$langs->trans("HT"); if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) { if ($product_fourn->product_fourn_price_id > 0) { - if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) { + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { $htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1); print ''.$form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent / 100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"), $htmltext).''; } else { diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index f6d77bdb6c0..b97e9b6c2d2 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -701,7 +701,7 @@ if ($id > 0 || $ref) { } // Number of supplier order running - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { if ($found) { $helpondiff .= '
'; } else { @@ -717,7 +717,7 @@ if ($id > 0 || $ref) { } // Number of product from supplier order already received (partial receipt) - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { if ($found) { $helpondiff .= '
'; } else { diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 393fbc73ae2..4c494732499 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -396,7 +396,7 @@ if ($usevirtualstock) { $sqlExpeditionsCli = '0'; } - if (!empty($conf->fournisseur->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { $sqlCommandesFourn = "(SELECT ".$db->ifsql("SUM(cd3.qty) IS NULL", "0", "SUM(cd3.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL $sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd3,"; $sqlCommandesFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur as c3"; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index a71d8c4a602..083f80f836d 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -50,10 +50,10 @@ if (!empty($conf->commande->enabled)) { if (!empty($conf->supplier_proposal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; } -if (!empty($conf->fournisseur->enabled)) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; } -if (!empty($conf->fournisseur->enabled)) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; } if (!empty($conf->contrat->enabled)) { diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 1e78c6636ce..503ab235f95 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -50,7 +50,7 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->fournisseur->enabled)) { +if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; } @@ -745,7 +745,7 @@ if ($action == 'create') { // Ref print ''; - if ($origin == 'supplierorder' && !empty($conf->fournisseur->enabled)) { + if ($origin == 'supplierorder' && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) { print $langs->trans("RefOrder").''.img_object($langs->trans("ShowOrder"), 'order').' '.$object->ref; } if ($origin == 'propal' && !empty($conf->propal->enabled)) { @@ -1270,7 +1270,7 @@ if ($action == 'create') { $objectsrc = new Propal($db); $objectsrc->fetch($object->$typeobject->id); } - if ($typeobject == 'CommandeFournisseur' && $object->$typeobject->id && !empty($conf->fournisseur->enabled)) { + if ($typeobject == 'CommandeFournisseur' && $object->$typeobject->id && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) { $objectsrc = new CommandeFournisseur($db); $objectsrc->fetch($object->$typeobject->id); } @@ -1982,7 +1982,7 @@ if ($action == 'create') { } // Create bill - if (!empty($conf->fournisseur->enabled) && ($object->statut == Reception::STATUS_VALIDATED || $object->statut == Reception::STATUS_CLOSED)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && ($object->statut == Reception::STATUS_VALIDATED || $object->statut == Reception::STATUS_CLOSED)) { if ($user->rights->fournisseur->facture->creer) { // TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) // If we do that, we must also make this option official. @@ -1996,7 +1996,7 @@ if ($action == 'create') { if ($user->rights->reception->creer && $object->statut > 0 && !$object->billed) { $label = "Close"; $paramaction = 'classifyclosed'; // = Transferred/Received // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on receptions instead of orders - if (!empty($conf->fournisseur->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? $label = "ClassifyBilled"; $paramaction = 'classifybilled'; } diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index 3caa9a90fea..c99b44074eb 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -56,7 +56,7 @@ if ($id > 0 || !empty($ref)) { } // Linked documents - if ($origin == 'order_supplier' && $object->$typeobject->id && !empty($conf->fournisseur->enabled)) { + if ($origin == 'order_supplier' && $object->$typeobject->id && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) { $objectsrc = new CommandeFournisseur($db); $objectsrc->fetch($object->$typeobject->id); } @@ -209,7 +209,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Linked documents - if ($origin == 'order_supplier' && $object->$typeobject->id && !empty($conf->fournisseur->enabled)) { + if ($origin == 'order_supplier' && $object->$typeobject->id && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) { print '
'; $objectsrc = new CommandeFournisseur($db); $objectsrc->fetch($object->$typeobject->id); diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 53748c1465a..05c54a914b5 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -186,7 +186,7 @@ abstract class ActionsCardCommon $s = $modCodeClient->getToolTip($langs, $this->object, 0); $this->tpl['help_customercode'] = $form->textwithpicto('', $s, 1); - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->tpl['supplier_enabled'] = 1; // Load object modCodeFournisseur diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 68efa8e694c..97163231baa 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -980,7 +980,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (GETPOST("type") == 'p') { $object->client = 2; } - if (!empty($conf->fournisseur->enabled) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { $object->fournisseur = 1; } @@ -1282,7 +1282,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'; print ''; - if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire)) || (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) { // Supplier print ''; @@ -1300,11 +1300,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } print ''; - if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) { + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print ''; - if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) { + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { print ''; // Supplier - if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) || (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) { print ''; print ''; @@ -1975,7 +1975,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } print ''; @@ -2256,7 +2256,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ""; // Supplier - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { print ''; print ''; print ''; $statstring .= ""; } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $user->rights->fournisseur->lire) { + if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { $statstring2 = ""; $statstring2 .= ''; $statstring2 .= ""; diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index ad83579341d..c70e080528b 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -178,7 +178,7 @@ if ($result > 0) { print ''; } - if (!empty($conf->fournisseur->enabled) && $object->fournisseur && !empty($user->rights->fournisseur->lire)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $object->fournisseur && !empty($user->rights->fournisseur->lire)) { print ''; + // Option to enable custom masks per product + $texte .= ''; + $texte .= ''; $texte .= '
'; $tmpcode = $object->code_fournisseur; if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { @@ -1585,7 +1585,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Supplier - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { print '
'.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, 'parent', null, null, 1); print img_picto('', 'category').$form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0); @@ -1964,7 +1964,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).'
'; - if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) { + if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print '
'.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, null, null, null, 1); @@ -2460,7 +2460,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Supplier code - if (!empty($conf->fournisseur->enabled) && $object->fournisseur && !empty($user->rights->fournisseur->lire)) { + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { print '
'; print $langs->trans('SupplierCode').''; print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); @@ -2667,7 +2667,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Supplier - if (!empty($conf->fournisseur->enabled) && $object->fournisseur) { + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { print '
'.$langs->trans("SuppliersCategoriesShort").''; print $form->showCategories($object->id, Categorie::TYPE_SUPPLIER, 1); diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 3190ad5e64e..1ffd1563838 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -192,13 +192,13 @@ if ($object->fournisseur) { $obj = $db->fetch_object($resql); $nbCmdsFourn = $obj->nb; $thirdTypeArray['supplier'] = $langs->trans("supplier"); - if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) { + if (($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) { $elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices'); } - if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) { + if (($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) { $elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders'); } - if ($conf->fournisseur->enabled && $user->rights->supplier_proposal->lire) { + if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire) { $elementTypeArray['supplier_proposal'] = $langs->transnoentitiesnoconv('SupplierProposals'); } } diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index c87d260f23e..a8a4c454c2c 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -118,7 +118,7 @@ if ($result) { if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) { $found = 1; $third['customer']++; } - if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { + if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { $found = 1; $third['supplier']++; } if (!empty($conf->societe->enabled) && $objp->client == 0 && $objp->fournisseur == 0) { @@ -144,7 +144,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { $dataseries[] = array($langs->trans("Customers"), round($third['customer'])); } - if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { + if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { $dataseries[] = array($langs->trans("Suppliers"), round($third['supplier'])); } if (!empty($conf->societe->enabled)) { @@ -171,7 +171,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + $statstring .= ''.$langs->trans("Customers").''.round($third['customer']).'
'.$langs->trans("Suppliers").''.round($third['supplier']).'
'; print $langs->trans('SupplierCode').''; print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 92b43902405..e16a12581ac 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1859,7 +1859,7 @@ if ($action == 'create') { } // Create an order - if (!empty($conf->fournisseur->enabled) && $object->statut == SupplierProposal::STATUS_SIGNED) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $object->statut == SupplierProposal::STATUS_SIGNED) { if ($usercancreateorder) { print ''; } From 051b3cf9ad57f280a716a3c426469a0fa65d5d68 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Apr 2021 12:37:23 +0200 Subject: [PATCH 066/216] Update llx_20_c_departements.sql Hungary - new sorting --- .../mysql/data/llx_20_c_departements.sql | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index b48831bbd39..c00b0e009f3 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -50,6 +50,7 @@ -- France -- Germany -- Honduras +-- Hungary -- (Italy) -- Luxembourg -- Netherlands @@ -506,6 +507,29 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'DC', '', 0, 'DC', 'Distrito Central'); +-- Hungary Provinces (rowid country=18) +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (180100, 'HU-BU', 'HU101', NULL, NULL, 'Budapest'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (180100, 'HU-PE', 'HU102', NULL, NULL, 'Pest'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (182100, 'HU-FE', 'HU211', NULL, NULL, 'Fejér'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (182100, 'HU-KE', 'HU212', NULL, NULL, 'Komárom-Esztergom'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (182100, 'HU-VE', 'HU213', NULL, NULL, 'Veszprém'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (182200, 'HU-GS', 'HU221', NULL, NULL, 'Győr-Moson-Sopron'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (182200, 'HU-VA', 'HU222', NULL, NULL, 'Vas'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (182200, 'HU-ZA', 'HU223', NULL, NULL, 'Zala'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (182300, 'HU-BA', 'HU231', NULL, NULL, 'Baranya'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (182300, 'HU-SO', 'HU232', NULL, NULL, 'Somogy'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (182300, 'HU-TO', 'HU233', NULL, NULL, 'Tolna'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (183100, 'HU-BZ', 'HU311', NULL, NULL, 'Borsod-Abaúj-Zemplén'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (183100, 'HU-HE', 'HU312', NULL, NULL, 'Heves'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (183100, 'HU-NO', 'HU313', NULL, NULL, 'Nógrád'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (183200, 'HU-HB', 'HU321', NULL, NULL, 'Hajdú-Bihar'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (183200, 'HU-JN', 'HU322', NULL, NULL, 'Jász-Nagykun-Szolnok'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (183200, 'HU-SZ', 'HU323', NULL, NULL, 'Szabolcs-Szatmár-Bereg'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (183300, 'HU-BK', 'HU331', NULL, NULL, 'Bács-Kiskun'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (183300, 'HU-BE', 'HU332', NULL, NULL, 'Békés'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (183300, 'HU-CS', 'HU333', NULL, NULL, 'Csongrád'); + + -- Provinces Italy (id=3) insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AG',315,NULL,NULL,NULL,'AGRIGENTO'); insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AL',312,NULL,NULL,NULL,'ALESSANDRIA'); @@ -1622,27 +1646,6 @@ INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AE-6', 22701, '', 0, '', 'Sharjah', 1); INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AE-7', 22701, '', 0, '', 'Umm al-Quwain', 1); --- Provinces Hungary (rowid country=18) -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-BK', 183300, 'HU331', NULL, NULL, 'Bács-Kiskun'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-BA', 182300, 'HU231', NULL, NULL, 'Baranya'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-BE', 183300, 'HU332', NULL, NULL, 'Békés'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-BZ', 183100, 'HU311', NULL, NULL, 'Borsod-Abaúj-Zemplén'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-BU', 180100, 'HU101', NULL, NULL, 'Budapest'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-CS', 183300, 'HU333', NULL, NULL, 'Csongrád'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-FE', 182100, 'HU211', NULL, NULL, 'Fejér'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-GS', 182200, 'HU221', NULL, NULL, 'Győr-Moson-Sopron'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-HB', 183200, 'HU321', NULL, NULL, 'Hajdú-Bihar'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-HE', 183100, 'HU312', NULL, NULL, 'Heves'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-JN', 183200, 'HU322', NULL, NULL, 'Jász-Nagykun-Szolnok'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-KE', 182100, 'HU212', NULL, NULL, 'Komárom-Esztergom'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-NO', 183100, 'HU313', NULL, NULL, 'Nógrád'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-PE', 180100, 'HU102', NULL, NULL, 'Pest'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-SO', 182300, 'HU232', NULL, NULL, 'Somogy'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-SZ', 183200, 'HU323', NULL, NULL, 'Szabolcs-Szatmár-Bereg'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-TO', 182300, 'HU233', NULL, NULL, 'Tolna'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-VA', 182200, 'HU222', NULL, NULL, 'Vas'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-VE', 182100, 'HU213', NULL, NULL, 'Veszprém'); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HU-ZA', 182200, 'HU223', NULL, NULL, 'Zala'); -- Provinces (postal districts) Portugal (rowid country=25) INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('15001', 'PT-AV', NULL, NULL, 'AVEIRO', 'Aveiro'); From ec9efd80188ae4724f0ea396b12c2130c8b4098d Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Apr 2021 12:49:08 +0200 Subject: [PATCH 067/216] Update llx_10_c_regions.sql USA Honduras India Indonesia Panama Mexique Romania --- .../install/mysql/data/llx_10_c_regions.sql | 60 ++++++++++++------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index 0c6e5bd9be8..8825becdc77 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -65,12 +65,19 @@ -- France -- Germany -> for Departmements -- Greece +-- Honduras -> for Departmements +-- India -> for Departmements +-- Indonesia -> for Departmements -- Italy +-- Mexique -> for Departmements -- Netherlands -> for Departmements +-- Panama -> for Departmements +-- Romania -> for Departmements -- San Salvador -- Spain -- Switzerland/Suisse -> for Departmements/Cantons -- United Kingdom +-- USA -> for Departmements @@ -200,6 +207,18 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (102, 10213, NULL, NULL, 'Δυτική Μακεδονία'); +-- Honduras Regions (id country=114) +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 114, 11401, '', 0, 'Honduras'); + + +-- India Regions (id country=117) +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 117, 11701, '', 0, 'India'); + + +-- Indonesia Regions (id country=118) +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 118, 11801, '', 0, 'Indonesia'); + + -- Italy Regions (id country=3) insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 301, NULL, 1, 'Abruzzo'); insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 302, NULL, 1, 'Basilicata'); @@ -223,10 +242,22 @@ insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3 insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 320, NULL, 1, 'Veneto'); +-- Mexique Regions (id country=154) +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 154, 15401, '', 0, 'Mexique'); + + -- Netherlands Regions (id country=17) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 17, 1701, '', 0,'Provincies van Nederland '); +-- Panama Regions (id country=178) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 178, 17801, '', 0, 'Panama'); + + +-- Romania Regions (id country=188) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 188, 18801, '', 0, 'Romania'); + + -- San Salvador Regions (id country=86) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (86, 8601, NULL, NULL, 'Central'); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (86, 8602, NULL, NULL, 'Oriental'); @@ -267,6 +298,11 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 7 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 7, 704, '', 0, 'Northern Ireland'); +-- USA Region (id country=11) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 11, 1101, '', 0, 'United-States'); + + + -- Regions Tunisia (id country=10) insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1001, '',0,'Ariana'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1002, '',0,'Béja'); @@ -294,22 +330,6 @@ insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,102 insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1024, '',0,'Zaghouan'); --- Region USA (id country=11) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 11, 1101, '', 0, 'United-States', 1); - - --- Regions Honduras (id country=114) -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 114, 11401, '', 0, 'Honduras', 1); - - --- Regions India (id country=117) -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 117, 11701, '', 0, 'India', 1); - - --- Regions Indonesia (id country=118) -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 118, 11801, '', 0, 'Indonesia', 1); - - -- Regions Maroc - Moroco (id country=12) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1201, '', 0, 'Tanger-Tétouan', 1); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1202, '', 0, 'Gharb-Chrarda-Beni Hssen', 1); @@ -347,11 +367,6 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) va INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15211, '', 0, 'Les îles Agaléga', 1); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15212, '', 0, 'Les écueils des Cargados Carajos', 1); --- Regions Mexique (id country=154) -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 154, 15401, '', 0, 'Mexique', 1); - --- Regions Romania (id country=188) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 188, 18801, '', 0, 'Romania', 1); -- Regions Venezuela (id country=232) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23201, '', 0, 'Los Andes', 1); @@ -392,8 +407,7 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) va INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18125, '', 0, 'Tumbes', 1); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18126, '', 0, 'Ucayali', 1); --- Regions Panama (id country=178) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 178, 17801, '', 0, 'Panama', 1); + -- Regions United Arab Emirates (rowid country=227) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 227, 22701, '', 0, 'United Arab Emirates', 1); From 0ab31a8680b64c1e6a8d0e33c19acb63c2c1e16b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 13:07:00 +0200 Subject: [PATCH 068/216] Look and feel v14 --- htdocs/compta/paiement_charge.php | 3 ++- htdocs/fourn/facture/paiement.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 9ac22d30e1f..c161551d3e3 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -185,9 +185,9 @@ if ($action == 'create') { print ''; print ''; + print '\n"; print '\n"; print '\n"; - print '\n"; /*print '\n"; print '';*/ @@ -218,6 +218,7 @@ if ($action == 'create') { print ''; print ''; print ''; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 104e0e7efd2..1efb8fce26b 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -483,6 +483,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; if (!empty($conf->banque->enabled)) { print ''; } else { From fa231d85c955ba445a23140cdec58ccbaba09ee1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 13:48:49 +0200 Subject: [PATCH 069/216] Fix sql --- htdocs/accountancy/customer/list.php | 23 +++++++++++++---------- htdocs/accountancy/supplier/list.php | 28 +++++++++++++++++----------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index a5506fc6ebb..de160fe2b93 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -87,6 +87,13 @@ if (!$sortorder) { } } +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('accountancycustomerlist')); + +$formaccounting = new FormAccounting($db); + +$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); + // Security check if (empty($conf->accounting->enabled)) { accessforbidden(); @@ -98,13 +105,6 @@ if (empty($user->rights->accounting->mouvements->lire)) { accessforbidden(); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('accountancycustomerlist')); - -$formaccounting = new FormAccounting($db); - -$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); - /* * Actions @@ -168,7 +168,7 @@ if ($massaction == 'ventil' && $user->rights->accounting->bind->write) { $monCompte = GETPOST('codeventil'.$monId); if ($monCompte <= 0) { - $msg .= '
'.$langs->trans("Lineofinvoice", $monId).' - '.$langs->trans("NoAccountSelected").'
'; + $msg .= '
'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").'
'; $ko++; } else { $sql = " UPDATE ".MAIN_DB_PREFIX."facturedet"; @@ -215,7 +215,7 @@ if (empty($chartaccountcode)) { } // Customer Invoice lines -$sql = "SELECT f.rowid as facid, f.ref as ref, f.datef, f.type as ftype,"; +$sql = "SELECT f.rowid as facid, f.ref, f.datef, f.type as ftype,"; $sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,"; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.tva_tx as tva_tx_prod,"; if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { @@ -239,7 +239,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; -if (!empty($conf->global->ACCOUNTANCY_COMPANY_SHARED)) { +if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as sa ON sa.fk_soc = s.rowid AND sa.entity = " . ((int) $conf->entity); } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; @@ -347,6 +347,7 @@ dol_syslog("accountancy/customer/list.php", LOG_DEBUG); if ($db->type == 'mysqli') { $db->query("SET SQL_BIG_SELECTS=1"); } + $result = $db->query($sql); if ($result) { $num_lines = $db->num_rows($result); @@ -654,6 +655,7 @@ if ($result) { } print ''; + // Description print '
'; + // VAT Num print ''; // Found accounts diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 24ee3afe218..1dcd17ea074 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -53,8 +53,8 @@ $mesCasesCochees = GETPOST('toselect', 'array'); // Search Getpost $search_societe = GETPOST('search_societe', 'alpha'); $search_lineid = GETPOST('search_lineid', 'int'); -$search_invoice = GETPOST('search_invoice', 'alpha'); $search_ref = GETPOST('search_ref', 'alpha'); +$search_invoice = GETPOST('search_invoice', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); @@ -156,7 +156,7 @@ if (empty($reshook)) { } -if ($massaction == 'ventil') { +if ($massaction == 'ventil' && $user->rights->accounting->bind->write) { $msg = ''; //print '
' . $langs->trans("Processing") . '...
'; @@ -183,7 +183,7 @@ if ($massaction == 'ventil') { $accountventilated = new AccountingAccount($db); $accountventilated->fetch($monCompte, '', 1); - dol_syslog('accountancy/supplier/list.php:: sql='.$sql, LOG_DEBUG); + dol_syslog('accountancy/supplier/list.php sql='.$sql, LOG_DEBUG); if ($db->query($sql)) { $msg .= '
'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'
'; $ok++; @@ -249,6 +249,7 @@ if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn_det as l ON f.rowid = l.fk_facture_fourn"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as pa ON pa.fk_product = p.rowid AND pa.entity = " . ((int) $conf->entity); } @@ -274,12 +275,12 @@ if ($search_lineid) { if (strlen(trim($search_invoice))) { $sql .= natural_search("f.ref", $search_invoice); } -if (strlen(trim($search_label))) { - $sql .= natural_search("f.libelle", $search_label); -} if (strlen(trim($search_ref))) { $sql .= natural_search("p.ref", $search_ref); } +if (strlen(trim($search_label))) { + $sql .= natural_search("f.libelle", $search_label); +} if (strlen(trim($search_desc))) { $sql .= natural_search("l.description", $search_desc); } @@ -344,9 +345,14 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $sql .= $db->plimit($limit + 1, $offset); -dol_syslog('accountancy/supplier/list.php'); -$result = $db->query($sql); +dol_syslog('accountancy/supplier/list.php', LOG_DEBUG); +// MAX_JOIN_SIZE can be very low (ex: 300000) on some limited configurations (ex: https://www.online.net/fr/hosting/online-perso) +// This big SELECT command may exceed the MAX_JOIN_SIZE limit => Therefore we use SQL_BIG_SELECTS=1 to disable the MAX_JOIN_SIZE security +if ($db->type == 'mysqli') { + $db->query("SET SQL_BIG_SELECTS=1"); +} +$result = $db->query($sql); if ($result) { $num_lines = $db->num_rows($result); $i = 0; @@ -447,8 +453,8 @@ if ($result) { print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); - //print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); From 5eda49632abea58232fc6e465e8b25613dcf828a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 15:57:58 +0200 Subject: [PATCH 071/216] Add more accurate information on login and last login date --- htdocs/main.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 61879dbeb87..a4c54275041 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2096,9 +2096,17 @@ function top_menu_user($hideloginname = 0, $urllogout = '') '.$userDropDownImage.'

'.$profilName.'
'; - if ($user->datepreviouslogin) { - $btnUser .= ' '.dol_print_date($user->datepreviouslogin, "dayhour", 'tzuser').'
'; + if ($user->datelastlogin) { + $title = $langs->trans("ConnectedSince").' : '.dol_print_date($user->datelastlogin, "dayhour", 'tzuser'); + if ($user->datepreviouslogin) { + $title .= '
'.$langs->trans("PreviousConnexion").' : '.dol_print_date($user->datepreviouslogin, "dayhour", 'tzuser'); + } } + $btnUser .= ' '.dol_print_date($user->datelastlogin, "dayhour", 'tzuser').'
'; + if ($user->datepreviouslogin) { + $btnUser .= ' '.dol_print_date($user->datepreviouslogin, "dayhour", 'tzuser').'
'; + } + //$btnUser .= ' '.$langs->trans("Version").' '.$appli.''; $btnUser .= '

From 053be7a63c18c4b5e59e0b29bc4419378dd389e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 16:02:52 +0200 Subject: [PATCH 072/216] FIX #17192 - With tz < 0, event is show in bad day on calendar views --- htdocs/comm/action/index.php | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 6c2812d4d27..33e4fabe2aa 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -354,15 +354,13 @@ if ($action == 'show_day') { $next_year = $next['year']; $next_month = $next['month']; $next_day = $next['day']; - // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $prev_day, $prev_year, 'tzuserrel'); $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'tzuserrel'); } //print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day; //print 'xx'.$next_year.'-'.$next_month.'-'.$next_day; -//print dol_print_date($firstdaytoshow,'day'); -//print dol_print_date($lastdaytoshow,'day'); +//print dol_print_date($firstdaytoshow,'dayhour').' '.dol_print_date($lastdaytoshow,'dayhour'); /*$title = $langs->trans("DoneAndToDoActions"); if ($status == 'done') $title = $langs->trans("DoneActions"); @@ -779,6 +777,7 @@ if ($resql) { $event->datep = $db->jdate($obj->datep); // datep and datef are GMT date. Example: 1970-01-01 01:00:00, jdate will return 0 if TZ of PHP server is Europe/Berlin $event->datef = $db->jdate($obj->datep2); + //$event->datep_formated_gmt = dol_print_date($event->datep, 'dayhour', 'gmt'); //var_dump($obj->datep); //var_dump($event->datep); @@ -837,14 +836,15 @@ if ($resql) { $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); - //var_dump(dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt')); + //var_dump(dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt')); // Hour at greenwich //var_dump($annee.'-'.$mois.'-'.$jour); // Loop on each day covered by action to prepare an index to show on calendar $loop = true; $j = 0; $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); do { - //if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'
'; + //if ($event->id==408) + //print 'daykey='.$daykey.' '.dol_print_date($daykey, 'dayhour', 'gmt').' '.$event->datep.' '.$event->datef.'
'; $eventarray[$daykey][] = $event; $j++; @@ -863,6 +863,7 @@ if ($resql) { } else { dol_print_error($db); } +//var_dump($eventarray); // BIRTHDATES CALENDAR // Complete $eventarray with birthdates @@ -946,7 +947,7 @@ $sql .= " AND (x.statut = '2' OR x.statut = '3')"; // Show only public leaves (2 if ($action == 'show_day') { // Request only leaves for the current selected day - $sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date wihout time + $sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date without time } elseif ($action == 'show_week') { // TODO: Add filter to reduce database request } elseif ($action == 'show_month') { @@ -1641,6 +1642,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $dateint = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day); + //print 'show_day_events day='.$day.' month='.$month.' year='.$year.' dateint='.$dateint; + print "\n"; $curtime = dol_mktime(0, 0, 0, $month, $day, $year); @@ -1693,10 +1696,12 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; $tmpholiday = new Holiday($db); - foreach ($eventarray as $daykey => $notused) { - $annee = dol_print_date($daykey, '%Y'); - $mois = dol_print_date($daykey, '%m'); - $jour = dol_print_date($daykey, '%d'); + foreach ($eventarray as $daykey => $notused) { // daykey is the 'YYYYMMDD' to show according to user + $annee = dol_print_date($daykey, '%Y', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' + $mois = dol_print_date($daykey, '%m', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' + $jour = dol_print_date($daykey, '%d', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' + + //print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' jour='.$jour.' mois='.$mois.' annee='.$annee."
\n"; if ($day == $jour && $month == $mois && $year == $annee) { foreach ($eventarray[$daykey] as $index => $event) { From f437e70ac60667222e40f82e20f33454168cc3a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 16:11:05 +0200 Subject: [PATCH 073/216] Selection of theme is easier --- htdocs/core/lib/usergroups.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 3188a9b39e2..93469e9e3c7 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -409,9 +409,9 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''.$title.''; print '
'; if ($subdir == $selected_theme) { - print ' '.$subdir.''; + print ''; } else { - print ' '.$subdir; + print ''; } print ''; From 91fc78ac9cd9b94140119821ef71540c955fd224 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 16:02:52 +0200 Subject: [PATCH 074/216] FIX #17192 - With tz < 0, event is show in bad day on calendar views Conflicts: htdocs/comm/action/index.php --- htdocs/comm/action/index.php | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 9bb22d533f6..4f3c8ec7fd4 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -321,15 +321,13 @@ if ($action == 'show_day') $next_year = $next['year']; $next_month = $next['month']; $next_day = $next['day']; - // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $prev_day, $prev_year, 'tzuserrel'); $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'tzuserrel'); } //print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day; //print 'xx'.$next_year.'-'.$next_month.'-'.$next_day; -//print dol_print_date($firstdaytoshow,'day'); -//print dol_print_date($lastdaytoshow,'day'); +//print dol_print_date($firstdaytoshow,'dayhour').' '.dol_print_date($lastdaytoshow,'dayhour'); /*$title = $langs->trans("DoneAndToDoActions"); if ($status == 'done') $title = $langs->trans("DoneActions"); @@ -679,6 +677,7 @@ if ($resql) $event->datep = $db->jdate($obj->datep); // datep and datef are GMT date. Example: 1970-01-01 01:00:00, jdate will return 0 if TZ of PHP server is Europe/Berlin $event->datef = $db->jdate($obj->datep2); + //$event->datep_formated_gmt = dol_print_date($event->datep, 'dayhour', 'gmt'); //var_dump($obj->datep); //var_dump($event->datep); @@ -727,14 +726,15 @@ if ($resql) $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); - //var_dump(dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt')); + //var_dump(dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt')); // Hour at greenwich //var_dump($annee.'-'.$mois.'-'.$jour); // Loop on each day covered by action to prepare an index to show on calendar $loop = true; $j = 0; $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); do { - //if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'
'; + //if ($event->id==408) + //print 'daykey='.$daykey.' '.dol_print_date($daykey, 'dayhour', 'gmt').' '.$event->datep.' '.$event->datef.'
'; $eventarray[$daykey][] = $event; $j++; @@ -751,6 +751,7 @@ if ($resql) } else { dol_print_error($db); } +//var_dump($eventarray); // Complete $eventarray with birthdates if ($showbirthday) @@ -825,15 +826,12 @@ if ($conf->global->AGENDA_SHOW_HOLIDAYS) $sql .= " AND u.statut = '1'"; // Show only active users (0 = inactive user, 1 = active user) $sql .= " AND (x.statut = '2' OR x.statut = '3')"; // Show only public leaves (2 = leave wait for approval, 3 = leave approved) - if ($action == 'show_day') - { + if ($action == 'show_day') { // Request only leaves for the current selected day - $sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; - } elseif ($action == 'show_week') - { + $sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date without time + } elseif ($action == 'show_week') { // TODO: Add filter to reduce database request - } elseif ($action == 'show_month') - { + } elseif ($action == 'show_month') { // TODO: Add filter to reduce database request } @@ -1488,6 +1486,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $dateint = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day); + //print 'show_day_events day='.$day.' month='.$month.' year='.$year.' dateint='.$dateint; + print "\n"; $curtime = dol_mktime(0, 0, 0, $month, $day, $year); @@ -1538,11 +1538,12 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $nextindextouse = is_array($colorindexused) ?count($colorindexused) : 0; // At first run this is 0, so fist user has 0, next 1, ... //var_dump($colorindexused); - foreach ($eventarray as $daykey => $notused) - { - $annee = dol_print_date($daykey, '%Y'); - $mois = dol_print_date($daykey, '%m'); - $jour = dol_print_date($daykey, '%d'); + foreach ($eventarray as $daykey => $notused) { // daykey is the 'YYYYMMDD' to show according to user + $annee = dol_print_date($daykey, '%Y', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' + $mois = dol_print_date($daykey, '%m', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' + $jour = dol_print_date($daykey, '%d', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' + + //print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' jour='.$jour.' mois='.$mois.' annee='.$annee."
\n"; if ($day == $jour && $month == $mois && $year == $annee) { From 6f6c9058c134080e878a14fc7c736488dba2cc17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 17:08:48 +0200 Subject: [PATCH 075/216] CSS for dark theme --- htdocs/theme/eldy/global.inc.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 4cf7bc0de34..e15d98e909b 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -116,6 +116,7 @@ body { margin-right: 0; margin-left: 0; font-weight: 400; + background-color: var(--colorbackbody); trans("DIRECTION").";\n"; ?> } @@ -1696,6 +1697,11 @@ td.showDragHandle { z-index: 1001; } +global->THEME_DARKMODEENABLED)) { ?> +.side-nav-vert { + border-bottom: 1px solid #888; +} + .side-nav { /*display: block; @@ -2071,7 +2077,7 @@ span.widthpictotitle.pictotitle { opacity: 0.4; } .pictofixedwidth { - text-align: left; + text-align: ; width: 20px; padding-right: 0; } @@ -2810,7 +2816,7 @@ a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { text-align .helppresentcircle { color: var(--colorbackhmenu1); filter: invert(0.8); - margin-left: -7px; + margin-: -7px; display: inline-block; margin-top: -10px; font-size: x-small; @@ -5709,7 +5715,7 @@ input.select2-input { -webkit-box-shadow: none !important; box-shadow: none !important; border-radius: 0 !important; - color: black; + /* color: black; */ } .select2-container-active .select2-choice, .select2-container-active .select2-choices { From 8faaebb05f0ee2af3552572c19a758d6f4d25620 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Apr 2021 18:10:33 +0200 Subject: [PATCH 076/216] Update llx_10_c_regions.sql add new: Denmark --- .../install/mysql/data/llx_10_c_regions.sql | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index 8825becdc77..fc1bb335241 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -62,6 +62,7 @@ -- Canada -> for Departmements -- Chile -- Colombie -> for Departmements +-- Denmark -- France -- Germany -> for Departmements -- Greece @@ -81,8 +82,8 @@ --- TEMPLATE ---------------------------------------------------------------------------------------- -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 0, 0, '0',0,'-'); +-- TEMPLATE ------------------------------------------------------------------------------------------ +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 0, 0, '0', 0, '-'); -- Algeria Regions (id country=13) @@ -118,21 +119,21 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4 -- Belgium Regions (id country=2) -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2, 201, '',1,'Flandre'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2, 202, '',2,'Wallonie'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2, 203, '',3,'Bruxelles-Capitale'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2, 201, '', 1, 'Flandre'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2, 202, '', 2, 'Wallonie'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2, 203, '', 3, 'Bruxelles-Capitale'); -- Bolivia Regions (id country=52) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5201, '', 0, 'Chuquisaca'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5202, '', 0, 'La Paz'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5203, '', 0, 'Cochabamba'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5204, '', 0, 'Oruro'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5205, '', 0, 'Potosí'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5206, '', 0, 'Tarija'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5207, '', 0, 'Santa Cruz'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5208, '', 0, 'El Beni'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5209, '', 0, 'Pando'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5201, '', 0, 'Chuquisaca'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5202, '', 0, 'La Paz'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5203, '', 0, 'Cochabamba'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5204, '', 0, 'Oruro'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5205, '', 0, 'Potosí'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5206, '', 0, 'Tarija'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5207, '', 0, 'Santa Cruz'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5208, '', 0, 'El Beni'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5209, '', 0, 'Pando'); -- Brazil Regions (id country=56) @@ -165,6 +166,14 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 6 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 70, 7001, '', 0, 'Colombie'); +-- Denmark Regions (id country=80) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 80, 8001, '', 0, 'Nordjylland'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 80, 8002, '', 0, 'Midtjylland'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 80, 8003, '', 0, 'Syddanmark'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 80, 8004, '', 0, 'Hovedstaden'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 80, 8005, '', 0, 'Sjælland'); + + -- France Regions (id country=1) insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 1, 1, '97105', 3, 'Guadeloupe'); insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 1, 2, '97209', 3, 'Martinique'); From 70383cca73b3cd58750078f350055274c3d579b0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 18:49:17 +0200 Subject: [PATCH 077/216] Add protection to avoid to overwrite a page with another similar name --- htdocs/website/index.php | 49 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 60e4b514e01..93a2aebc346 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -943,10 +943,45 @@ if ($action == 'addcontainer' && $usercanedit) { } } } else { + $newaliasnames = ''; + if (!$error && GETPOST('WEBSITE_ALIASALT', 'alpha')) { + $arrayofaliastotest = explode(',', str_replace(array('<', '>'), '', GETPOST('WEBSITE_ALIASALT', 'alpha'))); + $websitepagetemp = new WebsitePage($db); + foreach ($arrayofaliastotest as $aliastotest) { + $aliastotest = trim(preg_replace('/\.php$/i', '', $aliastotest)); + + // Disallow alias name pageX (already used to save the page with id) + if (preg_match('/^page\d+/i', $aliastotest)) { + $error++; + $langs->load("errors"); + setEventMessages("Alias name 'pageX' is not allowed", null, 'errors'); + $action = 'createcontainer'; + break; + } else { + $result = $websitepagetemp->fetch(0, $object->id, $aliastotest); + if ($result < 0) { + $error++; + $langs->load("errors"); + setEventMessages($websitepagetemp->error, $websitepagetemp->errors, 'errors'); + $action = 'createcontainer'; + break; + } + if ($result > 0) { + $error++; + $langs->load("errors"); + setEventMessages($langs->trans("ErrorAPageWithThisNameOrAliasAlreadyExists", $websitepagetemp->pageurl), null, 'errors'); + $action = 'createcontainer'; + break; + } + $newaliasnames .= ($newaliasnames ? ', ' : '').$aliastotest; + } + } + } + $objectpage->title = str_replace(array('<', '>'), '', GETPOST('WEBSITE_TITLE', 'alphanohtml')); $objectpage->type_container = GETPOST('WEBSITE_TYPE_CONTAINER', 'aZ09'); $objectpage->pageurl = GETPOST('WEBSITE_PAGENAME', 'alpha'); - $objectpage->aliasalt = str_replace(array('<', '>'), '', GETPOST('WEBSITE_ALIASALT', 'alphanohtml')); + $objectpage->aliasalt = $newaliasnames; $objectpage->description = str_replace(array('<', '>'), '', GETPOST('WEBSITE_DESCRIPTION', 'alphanohtml')); $objectpage->lang = GETPOST('WEBSITE_LANG', 'aZ09'); $objectpage->otherlang = GETPOST('WEBSITE_OTHERLANG', 'aZ09comma'); @@ -1632,15 +1667,20 @@ if ($action == 'updatemeta' && $usercanedit) { $action = 'editmeta'; } } + + $newaliasnames = ''; if (!$error && GETPOST('WEBSITE_ALIASALT', 'alpha')) { - $arrayofaliastotest = explode(',', GETPOST('WEBSITE_ALIASALT', 'alpha')); + $arrayofaliastotest = explode(',', str_replace(array('<', '>'), '', GETPOST('WEBSITE_ALIASALT', 'alpha'))); + $websitepagetemp = new WebsitePage($db); foreach ($arrayofaliastotest as $aliastotest) { + $aliastotest = trim(preg_replace('/\.php$/i', '', $aliastotest)); + // Disallow alias name pageX (already used to save the page with id) if (preg_match('/^page\d+/i', $aliastotest)) { $error++; $langs->load("errors"); - setEventMessages("Alias 'pageX' is not allowed", null, 'errors'); + setEventMessages("Alias name 'pageX' is not allowed", null, 'errors'); $action = 'editmeta'; break; } else { @@ -1659,6 +1699,7 @@ if ($action == 'updatemeta' && $usercanedit) { $action = 'editmeta'; break; } + $newaliasnames .= ($newaliasnames ? ', ' : '').$aliastotest; } } } @@ -1669,7 +1710,7 @@ if ($action == 'updatemeta' && $usercanedit) { $objectpage->title = str_replace(array('<', '>'), '', GETPOST('WEBSITE_TITLE', 'alphanohtml')); $objectpage->type_container = GETPOST('WEBSITE_TYPE_CONTAINER', 'aZ09'); $objectpage->pageurl = GETPOST('WEBSITE_PAGENAME', 'alpha'); - $objectpage->aliasalt = str_replace(array('<', '>'), '', GETPOST('WEBSITE_ALIASALT', 'alphanohtml')); + $objectpage->aliasalt = $newaliasnames; $objectpage->lang = GETPOST('WEBSITE_LANG', 'aZ09'); $objectpage->otherlang = GETPOST('WEBSITE_OTHERLANG', 'aZ09comma'); $objectpage->description = str_replace(array('<', '>'), '', GETPOST('WEBSITE_DESCRIPTION', 'alphanohtml')); From 3893c69dc137f4d81583b6d8f14fc14933373891 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 21:30:41 +0200 Subject: [PATCH 078/216] Enhance perf and security page --- htdocs/admin/system/perf.php | 6 +++++- htdocs/langs/en_US/admin.lang | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 8cc7532b647..7a34b584499 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -77,7 +77,11 @@ $test = empty($conf->syslog->enabled); if ($test) { print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis"); } else { - print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("Syslog")); + if ($conf->global->SYSLOG_LEVEL > LOG_NOTICE) { + print img_picto('', 'warning').' '.$langs->trans("ModuleActivatedWithTooHighLogLevel", $langs->transnoentities("Syslog")); + } else { + print img_picto('', 'tick.png').' '.$langs->trans("ModuleSyslogActivatedButLevelNotTooVerbose", $langs->transnoentities("Syslog"), $conf->global->SYSLOG_LEVEL); + } //print ' '.$langs->trans("MoreInformation").' XDebug admin page'; } print '
'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5d78f312917..0bc0261e373 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2061,9 +2061,11 @@ UseDebugBar=Use the debug bar DEBUGBAR_LOGS_LINES_NUMBER=Number of last log lines to keep in console WarningValueHigherSlowsDramaticalyOutput=Warning, higher values slows dramaticaly output ModuleActivated=Module %s is activated and slows the interface +ModuleActivatedWithTooHighLogLevel=Module %s is activated with a too high logging level (try to use a lower level for better performances) ModuleSyslogActivatedButLevelNotTooVerbose=Module %s is activated and log level (%s) is correct (not too verbose) IfYouAreOnAProductionSetThis=If you are on a production environment, you should set this property to %s. AntivirusEnabledOnUpload=Antivirus enabled on uploaded files +SomeFilesOrDirInRootAreWritable=Some files or directories are not in a read-only mode EXPORTS_SHARE_MODELS=Export models are share with everybody ExportSetup=Setup of module Export ImportSetup=Setup of module Import From 04081954b199b3adafd6dcdc047763ccdecdff74 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 22:19:15 +0200 Subject: [PATCH 079/216] Fix translation --- htdocs/langs/en_US/bills.lang | 6 +++--- htdocs/langs/en_US/companies.lang | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index ad1d7f138e5..c0eb886a987 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -520,10 +520,10 @@ YouMustCreateStandardInvoiceFirstDesc=You have to create a standard invoice firs PDFCrabeDescription=Invoice PDF template Crabe. A complete invoice template (old implementation of Sponge template) PDFSpongeDescription=Invoice PDF template Sponge. A complete invoice template PDFCrevetteDescription=Invoice PDF template Crevette. A complete invoice template for situation invoices -TerreNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 -MarsNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for down payment invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 +TerreNumRefModelDesc1=Return number in the format %syymm-nnnn for standard invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequencial auto-incrementing number with no break and no return to 0 +MarsNumRefModelDesc1=Return number in the format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for down payment invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequencial auto-incrementing number with no break and no return to 0 TerreNumRefModelError=A bill starting with $syymm already exists and is not compatible with this model of sequence. Remove it or rename it to activate this module. -CactusNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for credit notes and %syymm-nnnn for down payment invoices where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 +CactusNumRefModelDesc1=Return number in the format %syymm-nnnn for standard invoices, %syymm-nnnn for credit notes and %syymm-nnnn for down payment invoices where yy is year, mm is month and nnnn is a sequencial auto-incrementing number with no break and no return to 0 EarlyClosingReason=Early closing reason EarlyClosingComment=Early closing note ##### Types de contacts ##### diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 89463a535b3..b41bb49db13 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -449,7 +449,7 @@ CurrentOutstandingBill=Current outstanding bill OutstandingBill=Max. for outstanding bill OutstandingBillReached=Max. for outstanding bill reached OrderMinAmount=Minimum amount for order -MonkeyNumRefModelDesc=Return a number with the format %syymm-nnnn for the customer code and %syymm-nnnn for the vendor code where yy is year, mm is month and nnnn is a sequence with no break and no return to 0. +MonkeyNumRefModelDesc=Return a number in the format %syymm-nnnn for the customer code and %syymm-nnnn for the vendor code where yy is year, mm is month and nnnn is a sequencial auto-incrementing number with no break and no return to 0. LeopardNumRefModelDesc=The code is free. This code can be modified at any time. ManagingDirectors=Manager(s) name (CEO, director, president...) MergeOriginThirdparty=Duplicate third party (third party you want to delete) From 35d37c75fcec31d5efb653c750b9d11cf39aae00 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 22:25:22 +0200 Subject: [PATCH 080/216] Fix EN Translation --- htdocs/langs/en_US/categories.lang | 4 ++-- htdocs/langs/en_US/compta.lang | 2 +- htdocs/langs/en_US/products.lang | 2 +- htdocs/langs/en_US/stocks.lang | 14 +++++++------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index 5ec33145da1..9520ef65a83 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -93,7 +93,7 @@ AddSupplierIntoCategory=Assign category to supplier ShowCategory=Show tag/category ByDefaultInList=By default in list ChooseCategory=Choose category -StocksCategoriesArea=Warehouses Categories -ActionCommCategoriesArea=Events Categories +StocksCategoriesArea=Warehouse Categories +ActionCommCategoriesArea=Event Categories WebsitePagesCategoriesArea=Page-Container Categories UseOrOperatorForCategories=Use or operator for categories diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 7080810bfea..926cda53c9f 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -231,7 +231,7 @@ Pcg_subtype=Pcg subtype InvoiceLinesToDispatch=Invoice lines to dispatch ByProductsAndServices=By product and service RefExt=External ref -ToCreateAPredefinedInvoice=To create a template invoice, create a standard invoice, then, without validating it, click onto button "%s". +ToCreateAPredefinedInvoice=To create a template invoice, create a standard invoice, then, without validating it, click on button "%s". LinkedOrder=Link to order Mode1=Method 1 Mode2=Method 2 diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 9ec22ad00cc..28853762424 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -314,7 +314,7 @@ LastUpdated=Latest update CorrectlyUpdated=Correctly updated PropalMergePdfProductActualFile=Files use to add into PDF Azur are/is PropalMergePdfProductChooseFile=Select PDF files -IncludingProductWithTag=Including product/service with tag +IncludingProductWithTag=Include products/services with tag DefaultPriceRealPriceMayDependOnCustomer=Default price, real price may depend on customer WarningSelectOneDocument=Please select at least one document DefaultUnitToShow=Unit diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index eb238941eae..5f60715ae2a 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -19,8 +19,8 @@ Stock=Stock Stocks=Stocks MissingStocks=Missing stocks StockAtDate=Stocks at date -StockAtDateInPast=Date in past -StockAtDateInFuture=Date in future +StockAtDateInPast=Date in the past +StockAtDateInFuture=Date in the future StocksByLotSerial=Stocks by lot/serial LotSerial=Lots/Serials LotSerialList=List of lot/serials @@ -37,8 +37,8 @@ AllWarehouses=All warehouses IncludeEmptyDesiredStock=Include also negative stock with undefined desired stock IncludeAlsoDraftOrders=Include also draft orders Location=Location -LocationSummary=Short name location -NumberOfDifferentProducts=Number of different products +LocationSummary=Short name of location +NumberOfDifferentProducts=Number of unique products NumberOfProducts=Total number of products LastMovement=Latest movement LastMovements=Latest movements @@ -98,7 +98,7 @@ RealStockDesc=Physical/real stock is the stock currently in the warehouses. RealStockWillAutomaticallyWhen=The real stock will be modified according to this rule (as defined in the Stock module): VirtualStock=Virtual stock VirtualStockAtDate=Virtual stock at date -VirtualStockAtDateDesc=Virtual stock once all pending orders that are planned to be done before the date will be finished +VirtualStockAtDateDesc=Virtual stock once all the pending orders that are planned to be processed before the chosen date will be finished VirtualStockDesc=Virtual stock is the calculated stock available once all open/pending actions (that affect stocks) are closed (purchase orders received, sales orders shipped, manufacturing orders produced, etc) AtDate=At date IdWarehouse=Id warehouse @@ -147,7 +147,7 @@ Replenishments=Replenishments NbOfProductBeforePeriod=Quantity of product %s in stock before selected period (< %s) NbOfProductAfterPeriod=Quantity of product %s in stock after selected period (> %s) MassMovement=Mass movement -SelectProductInAndOutWareHouse=Select a source warehouse and a target warehouse, a product and a quantity then click "%s". Once this is done for all required movements, click onto "%s". +SelectProductInAndOutWareHouse=Select a source warehouse and a target warehouse, a product and a quantity then click "%s". Once this is done for all required movements, click on "%s". RecordMovement=Record transfer ReceivingForSameOrder=Receipts for this order StockMovementRecorded=Stock movements recorded @@ -238,7 +238,7 @@ StockIsRequiredToChooseWhichLotToUse=Stock is required to choose which lot to us ForceTo=Force to AlwaysShowFullArbo=Display full tree of warehouse on popup of warehouse links (Warning: This may decrease dramatically performances) StockAtDatePastDesc=You can view here the stock (real stock) at a given date in the past -StockAtDateFutureDesc=You can view here the stock (virtual stock) at a given date in future +StockAtDateFutureDesc=You can view here the stock (virtual stock) at a given date in the future CurrentStock=Current stock InventoryRealQtyHelp=Set value to 0 to reset qty
Keep field empty, or remove line, to keep unchanged UpdateByScaning=Fill real qty by scaning From 80c6458faa827a8e3183b4ca412d27acb9e9e81e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 11 Apr 2021 22:25:45 +0200 Subject: [PATCH 081/216] Work on split module fournisseur --- htdocs/admin/fckeditor.php | 2 +- htdocs/admin/stock.php | 6 +++--- htdocs/admin/workflow.php | 6 +++--- .../comm/action/class/cactioncomm.class.php | 4 ++-- htdocs/comm/index.php | 10 +++++----- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/commande/list.php | 4 ++-- htdocs/compta/index.php | 2 +- .../stats/supplier_turnover_by_thirdparty.php | 4 ++-- htdocs/contact/consumption.php | 4 ++-- htdocs/core/ajax/selectsearchbox.php | 8 ++++---- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/lib/contact.lib.php | 2 +- htdocs/core/lib/invoice.lib.php | 4 ++-- htdocs/core/lib/product.lib.php | 6 +++--- htdocs/core/lib/project.lib.php | 2 +- htdocs/core/menus/standard/auguria.lib.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 20 +++++++++---------- 19 files changed, 46 insertions(+), 46 deletions(-) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 65029a9246a..987f435e38f 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -61,7 +61,7 @@ $modules = array( $conditions = array( 'SOCIETE' => 1, 'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)), - 'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)), + 'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)), 'USERSIGN' => 1, 'MAILING' => !empty($conf->mailing->enabled), 'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)), diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 410c7170c30..55d6a518250 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -293,7 +293,7 @@ $found = 0; print '
'; print ''; print ''; print ''; print ''; print ''; print ''; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index b87a73e8cc2..974bfb15e77 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -167,10 +167,10 @@ if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) { if ($object->thirdparty->fournisseur) { $thirdTypeArray['supplier'] = $langs->trans("supplier"); - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) { $elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices'); } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) { $elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders'); } diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 3395a21435c..509d10e7858 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -68,7 +68,7 @@ if (!empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADH $arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) { +if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) { $arrayresult['searchintothirdparty'] = array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('', 'object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } @@ -112,10 +112,10 @@ if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUST if (!empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire) { $arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) { +if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED)) { $arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) { +if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED)) { $arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } @@ -130,7 +130,7 @@ if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUST } // Vendor payments -if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) { +if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED)) { $arrayresult['searchintovendorpayments'] = array( 'position'=>175, 'img'=>'object_payment', diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 3c2884e4b5b..fb97d2e5361 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -187,7 +187,7 @@ function societe_prepare_head(Societe $object) } // Related items - if ((!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) + if ((!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || !empty($conf->ficheinter->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->global->THIRPARTIES_DISABLE_RELATED_OBJECT_TAB)) { $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; $head[$h][1] = $langs->trans("Referers"); diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 60612043c25..c60cb0c8c18 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -58,7 +58,7 @@ function contact_prepare_head(Contact $object) $tab++; // Related items - if (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || !empty($conf->ficheinter->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id; $head[$tab][1] = $langs->trans("Referers"); $head[$tab][2] = 'consumption'; diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 0883d8c82be..b3a9ed7b453 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -345,7 +345,7 @@ function getPurchaseInvoicePieChart($socid = 0) { global $conf, $db, $langs, $user; - if (!(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) { + if (!((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire))) { return ''; } @@ -1119,7 +1119,7 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) $result = ''; - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) { $facstatic = new FactureFournisseur($db); $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut as status, ff.type, ff.libelle as label, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye"; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index e8ce515317f..9825b2dac2c 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -58,7 +58,7 @@ function product_prepare_head($object) } if (!empty($object->status_buy) || (!empty($conf->margin->enabled) && !empty($object->status))) { // If margin is on and product on sell, we may need the cost price even if product os not on purchase - if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->lire) + if ((((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->lire) || (!empty($conf->margin->enabled) && $user->rights->margin->liretous) ) { $head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id; @@ -430,7 +430,7 @@ function show_stats_for_company($product, $socid) print ''; } // Supplier orders - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) { $nblines++; $ret = $product->load_stats_commande_fournisseur($socid); if ($ret < 0) { @@ -468,7 +468,7 @@ function show_stats_for_company($product, $socid) print ''; } // Supplier invoices - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) { $nblines++; $ret = $product->load_stats_facture_fournisseur($socid); if ($ret < 0) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 3c5e9c71dad..4162dc4bd51 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -122,7 +122,7 @@ function project_prepare_head(Project $project) $h++; } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->contrat->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled)) { diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 11dc0a6ce7d..b191e24b117 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -388,7 +388,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $nature = "sells"; } if ($objp->nature == 3 - && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) + && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { $nature = "purchases"; } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index cc34b2e5489..64e7461cd07 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -122,7 +122,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'enabled'=> ((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) ) - || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) + || ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) ), 'perms'=> (!empty($user->rights->societe->lire) || !empty($user->rights->fournisseur->lire) || !empty($user->rights->supplier_order->lire) || !empty($user->rights->supplier_invoice->lire) || !empty($user->rights->supplier_proposal->lire)), 'module'=>'societe|fournisseur' @@ -847,7 +847,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } // Suppliers - if (!empty($conf->societe->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->supplier_proposal->enabled))) { + if (!empty($conf->societe->enabled) && (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->supplier_proposal->enabled))) { $langs->load("suppliers"); $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->rights->fournisseur->lire), '', $mainmenu, 'suppliers'); $newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->rights->societe->creer && ($user->rights->fournisseur->lire)); @@ -868,7 +868,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); } // Categories suppliers - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->rights->categorie->lire); } } @@ -884,7 +884,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire); } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); } $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->rights->societe->contact->lire); @@ -1196,7 +1196,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->banque->enabled)) { $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 70); } - if (!empty($conf->facture->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled))) { + if (!empty($conf->facture->enabled) || ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 80); } if (!empty($conf->tax->enabled)) { @@ -1266,7 +1266,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $nature = "sells"; } if ($objp->nature == 3 - && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) + && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { $nature = "purchases"; } @@ -1369,7 +1369,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED } - if ($modecompta && $conf->fournisseur->enabled) { + if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 2, $user->rights->accounting->comptarapport->lire); $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); @@ -1379,7 +1379,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $modecompta = 'RECETTES-DEPENSES'; //if (! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED - if ($modecompta && $conf->fournisseur->enabled) { + if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); @@ -1543,7 +1543,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->variants->enabled)) { $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->rights->produit->lire); } - if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) { + if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire); } @@ -1560,7 +1560,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="pictofixedwidth"')); $newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer); $newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->rights->service->lire); - if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) { + if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_oder->enabled) || !empty($conf->supplier_invoice->enabled)) { $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire && $user->rights->propale->lire); } // Categories From 990da5574df4cf9f1d84d1f36b018731a0b7a833 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 22:35:20 +0200 Subject: [PATCH 082/216] Fix trans --- htdocs/salaries/paiement_salary.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 2f4a0c85905..5ab67c71c0e 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page -$langs->load("bills"); +$langs->loadLangs(array("banks", "bills")); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); @@ -78,7 +78,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y $action = 'create'; } if (!empty($conf->banque->enabled) && !(GETPOST("accountid", 'int') > 0)) { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToDebit")), null, 'errors'); $error++; $action = 'create'; } @@ -223,6 +223,7 @@ if ($action == 'create') { print ''; print ''; print ''; From 062f451b20e1c29e6ce8b198f74ea9fbad4cb053 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 22:40:07 +0200 Subject: [PATCH 083/216] css --- htdocs/salaries/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 323e2c74c5a..7f13a528f4d 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -687,12 +687,12 @@ if ($id) { print '
'.$langs->trans("Ref").''.$chid.'
'.$langs->trans("Label").''.$charge->label."
'.$langs->trans("Type")."".$charge->type_label."
'.$langs->trans("Period")."".dol_print_date($charge->periode, 'day')."
'.$langs->trans("Label").''.$charge->label."
'.$langs->trans("DateDue")."".dol_print_date($charge->date_ech,'day')."
'.$langs->trans("Amount")."".price($charge->amount,0,$outputlangs,1,-1,-1,$conf->currency).'
'.$langs->trans('AccountToDebit').''; + print img_picto('', 'bank_account', 'class="pictofixedwidth"'); $form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid", 'int') : $charge->accountid, "accountid", 0, '', 2); // Show opend bank account list print '
'.$langs->trans('Account').''; + print img_picto('', 'bank_account', 'class="pictofixedwidth"'); $form->select_comptes(empty($accountid) ? $obj->fk_account : $accountid, 'accountid', 0, '', 2); print '
'; $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description)); $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; @@ -681,6 +683,7 @@ if ($result) { print $labelcountry; print ''.$objp->tva_intra.''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth125', 'code2', 1, 0, 1); @@ -528,7 +534,7 @@ if ($result) { $facturefourn_static->ref = $objp->ref; $facturefourn_static->id = $objp->facid; - $facturefourn_static->type = $objp->type; + $facturefourn_static->type = $objp->ftype; $facturefourn_static->label = $objp->invoice_label; $code_buy_p_notset = ''; From 46031dc39e046a4e40abc485b99744dbe4006842 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 13:53:36 +0200 Subject: [PATCH 070/216] Fix missing column --- htdocs/accountancy/supplier/lines.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index a87280744ec..1f81a5d7e2c 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -376,7 +376,7 @@ if ($result) { print '
'.$langs->trans("ReStockOnBill").''; -if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL', array(), null, 0, 0, 0, 2, 1); } else { @@ -311,7 +311,7 @@ $found++; print '
'.$langs->trans("ReStockOnValidateOrder").''; -if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1); } else { @@ -356,7 +356,7 @@ if (!empty($conf->reception->enabled)) { print '
'.$langs->trans("ReStockOnDispatchOrder").''; - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(), null, 0, 0, 0, 2, 1); } else { diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 916c54f4fb3..06847066c9d 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -111,7 +111,7 @@ $workflowcodes = array( 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array( 'family'=>'classify_supplier_proposal', 'position'=>60, - 'enabled'=>(!empty($conf->supplier_proposal->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))), + 'enabled'=>(!empty($conf->supplier_proposal->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))), 'picto'=>'propal', 'warning'=>'' ), @@ -120,7 +120,7 @@ $workflowcodes = array( 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array( 'family'=>'classify_supplier_order', 'position'=>62, - 'enabled'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)), + 'enabled'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)), 'picto'=>'order', 'warning'=>'' ), @@ -129,7 +129,7 @@ $workflowcodes = array( 'WORKFLOW_BILL_ON_RECEPTION'=>array( 'family'=>'classify_reception', 'position'=>64, - 'enabled'=>(!empty($conf->reception->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))), + 'enabled'=>(!empty($conf->reception->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))), 'picto'=>'bill' ), diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 8483839b944..a248482ee9d 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -201,10 +201,10 @@ class CActionComm if ($obj->module == 'propal' && empty($conf->propal->enabled) && empty($user->propale->lire)) { $qualified = 0; } - if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_invoice->enabled)) && empty($user->fournisseur->facture->lire)) { + if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && empty($user->fournisseur->facture->lire)) || (!empty($conf->supplier_invoice->enabled) && empty($user->supplier_invoice->lire)))) { $qualified = 0; } - if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled)) && empty($user->fournisseur->commande->lire)) { + if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && empty($user->fournisseur->commande->lire)) || (empty($conf->supplier_order->enabled) && empty($user->supplier_order->lire)))) { $qualified = 0; } if ($obj->module == 'shipping' && empty($conf->expedition->enabled) && empty($user->expedition->lire)) { diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 14cf54c8cdc..6b287d77fe0 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -90,7 +90,7 @@ if (!empty($conf->supplier_proposal->enabled)) { if (!empty($conf->commande->enabled)) { $orderstatic = new Commande($db); } -if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { $supplierorderstatic = new CommandeFournisseur($db); } @@ -115,7 +115,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { $listofsearchfields['search_supplier_proposal'] = array('text'=>'SupplierProposalShort'); } // Search supplier order - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) { $listofsearchfields['search_supplier_order'] = array('text'=>'SupplierOrder'); } // Search intervention @@ -446,7 +446,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { /* * Draft purchase orders */ -if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) { $sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; @@ -641,7 +641,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) { /* * Last suppliers */ -if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire) { +if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire) { $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur"; @@ -700,7 +700,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU { $s .= ''.dol_substr($langs->trans("Customer"), 0, 1).''; }*/ - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) { $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; } print $s; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 9e852d4a019..915977b1647 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2534,7 +2534,7 @@ if ($action == 'create') { // Create a purchase order if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_PROPOSAL)) { - if ($object->statut == Propal::STATUS_SIGNED && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) { + if ($object->statut == Propal::STATUS_SIGNED && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) { if ($usercancreatepurchaseorder) { print ''.$langs->trans("AddPurchaseOrder").''; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index a1cebf0db4b..3187e012fd2 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2501,7 +2501,7 @@ if ($action == 'create' && $usercancreate) { // Create a purchase order if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_SALE_ORDER)) { - if (!empty($conf->fournisseur->enabled) && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) { if ($usercancreatepurchaseorder) { print ''.$langs->trans("AddPurchaseOrder").''; } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index fe279897f7a..184a0b2c0cf 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1631,7 +1631,7 @@ if ($resql) { } $stock_order = $generic_product->stats_commande['qty']; } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) { $generic_product->load_stats_commande_fournisseur(0, '3'); $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty']; @@ -1653,7 +1653,7 @@ if ($resql) { } else { $text_info .= ''.$langs->trans('Available').' : '.$text_stock_reel.''; } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { $text_info .= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier.'
'; } else { $text_info .= '
'; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 4d46f04a136..aeaf1598e99 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -258,7 +258,7 @@ if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { // Last modified supplier invoices -if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) { $langs->load("boxes"); $facstatic = new FactureFournisseur($db); diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index 556c4437df7..32b85b9aea9 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -588,10 +588,10 @@ if (count($amount)) { if (!empty($conf->supplier_proposal->enabled) && $key > 0) { print ' '.img_picto($langs->trans("ProposalStats"), "stats").' '; } - if (!empty($conf->fournisseur->enabled) && $key > 0) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $key > 0) { print ' '.img_picto($langs->trans("OrderStats"), "stats").' '; } - if (!empty($conf->fournisseur->enabled) && $key > 0) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && $key > 0) { print ' '.img_picto($langs->trans("InvoiceStats"), "stats").' '; } print '
'.$langs->trans('AccountToDebit').''; + print img_picto('', 'bank_account', 'class="pictofixedwidth"'); $form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid", 'int') : $salary->accountid, "accountid", 0, '', 1); // Show opend bank account list print '
'; if ($action == 'edit') { - print '"; } else { print ""; - print ''; } From f6251679a1faf6a0c666eb9de2a0306cc1febfd0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 22:41:53 +0200 Subject: [PATCH 084/216] Fix label --- htdocs/salaries/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 7f13a528f4d..b9042ca6c21 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -492,7 +492,7 @@ if ($action == 'create') { // Bank if (!empty($conf->banque->enabled)) { print ''; @@ -500,7 +500,7 @@ if ($action == 'create') { // Type payment print ''; @@ -723,10 +723,10 @@ if ($id) { print ''; } - // Mode of payment + // Default mode of payment print ''; // Date last update - print ''; // Status of recipient sending email (Warning != status of emailing) if ($obj->statut == 0) { // Date sent - print ''; + print ''; print ''; } else { // Date sent - print ''; + print ''; print ''; + // Option to enable custom masks per product + $texte .= ''; + $texte .= ''; $texte .= '
'.$langs->trans("DateStartPeriod").""; + print '
'.$langs->trans("DateStartPeriod").""; print $form->selectDate($object->datesp, 'datesp', 0, 0, 0, 'datesp', 1); print "
' . $langs->trans("DateStartPeriod") . ''; + print '' . $langs->trans("DateStartPeriod") . ''; print dol_print_date($object->datesp, 'day'); print '
'; - print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; + print $form->editfieldkey('DefaultBankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; print img_picto('', 'bank_account', 'class="paddingrighonly"'); $form->select_comptes($accountid, "accountid", 0, '', 1); // Affiche liste des comptes courant print '
'; - print $form->editfieldkey('PaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).''; + print $form->editfieldkey('DefaultPaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).''; $form->select_types_paiements(GETPOST("paymenttype", 'aZ09'), "paymenttype", ''); print '
' . $langs->trans("Amount") . '' . price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency) . '
'; print ''; if ($action != 'editmode') print ''; @@ -740,11 +740,11 @@ if ($id) { } print ''; - // Bank Account + // Default Bank Account if (!empty($conf->banque->enabled)) { print ''; if (!$i) { @@ -553,13 +553,15 @@ foreach ($accounts as $key => $type) { // Account number if (!empty($arrayfields['b.account_number']['checked'])) { - print ''; if (!$i) { From a68378da3fa6b8d9340482a2f3550d691f018a15 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Apr 2021 10:32:41 +0200 Subject: [PATCH 099/216] Fix #yogosha5840 --- .../bank/class/api_bankaccounts.class.php | 12 ++++++---- htdocs/compta/bank/transfer.php | 23 +++++++++++++------ 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index 23c739064f8..04ef9543867 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -199,10 +199,6 @@ class BankAccounts extends DolibarrApi throw new RestException(401); } - if ($bankaccount_from_id === $bankaccount_to_id) { - throw new RestException(422, 'bankaccount_from_id and bankaccount_to_id must be different !'); - } - require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $accountfrom = new Account($this->db); @@ -227,6 +223,14 @@ class BankAccounts extends DolibarrApi } } + if ($amount_to < 0) { + throw new RestException(422, 'You must provide a positive value for amount.'); + } + + if ($accountto->id == $accountfrom->id) { + throw new RestException(422, 'bankaccount_from_id and bankaccount_to_id must be different !'); + } + $this->db->begin(); $error = 0; diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index c94f8810cd8..903c27ce8d7 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -46,9 +46,11 @@ $error = 0; $hookmanager->initHooks(array('banktransfer')); + /* * Actions */ + $parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -95,8 +97,17 @@ if ($action == 'add') { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AmountTo")), null, 'errors'); } } + if ($amountto < 0) { + $error++; + setEventMessages($langs->trans("AmountMustBePositive"), null, 'errors'); + } - if (($accountto->id != $accountfrom->id) && empty($error)) { + if ($accountto->id == $accountfrom->id) { + $error++; + setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers"), null, 'errors'); + } + + if (empty($error)) { $db->begin(); $bank_line_id_from = 0; @@ -148,9 +159,6 @@ if ($action == 'add') { setEventMessages($accountfrom->error.' '.$accountto->error, null, 'errors'); $db->rollback(); } - } else { - $error++; - setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers"), null, 'errors'); } } } @@ -255,7 +263,8 @@ print ''; print '
'; print '
'; - print $langs->trans('PaymentMode'); + print $langs->trans('DefaultPaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'
'; print ''; From 77d751b03eedea1c14b863c811e3d0002b776e93 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 12 Apr 2021 05:41:37 +0200 Subject: [PATCH 085/216] Work on split module fournisseur --- .../modules/project/doc/doc_generic_project_odt.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 315336748be..5799a59df3f 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -964,13 +964,13 @@ class doc_generic_project_odt extends ModelePDFProjects 'title' => "ListSupplierOrdersAssociatedProject", 'table' => 'commande_fournisseur', 'class' => 'CommandeFournisseur', - 'test' => ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) + 'test' => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) ), 'invoice_supplier' => array( 'title' => "ListSupplierInvoicesAssociatedProject", 'table' => 'facture_fourn', 'class' => 'FactureFournisseur', - 'test' => ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || !empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire) + 'test' => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire) ), 'contract' => array( 'title' => "ListContractAssociatedProject", From bbd774f9877cb961c01466284bd537c834f9d2d7 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 12 Apr 2021 05:50:57 +0200 Subject: [PATCH 086/216] Work on split module fournisseur --- htdocs/admin/dict.php | 2 +- htdocs/main.inc.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index b1a3a96bc3b..9061fd150b7 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -486,7 +486,7 @@ $tabcond[16] = (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_ $tabcond[17] = (!empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled)); $tabcond[18] = !empty($conf->expedition->enabled) || !empty($conf->reception->enabled); $tabcond[19] = !empty($conf->societe->enabled); -$tabcond[20] = (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)); +$tabcond[20] = (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled); $tabcond[21] = !empty($conf->propal->enabled); $tabcond[22] = (!empty($conf->commande->enabled) || !empty($conf->propal->enabled)); $tabcond[23] = true; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a4c54275041..90d935705aa 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2286,7 +2286,7 @@ function top_menu_quickadd() '; } - if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->creer) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->creer) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->creer)) { $langs->load("orders"); $dropDownQuickAddHtml .= ' @@ -2299,7 +2299,7 @@ function top_menu_quickadd() '; } - if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->creer) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->creer) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->creer)) { $langs->load("bills"); $dropDownQuickAddHtml .= ' From b3744bce248528b79bda323d84f9fe3821127f42 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 12 Apr 2021 06:04:08 +0200 Subject: [PATCH 087/216] Work on split module fournisseur --- htdocs/reception/card.php | 10 +++++----- .../societe/canvas/actions_card_common.class.php | 2 +- htdocs/societe/card.php | 14 +++++++------- htdocs/societe/class/societe.class.php | 2 +- htdocs/societe/list.php | 4 ++-- htdocs/societe/notify/card.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 503ab235f95..22acecc574d 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -50,7 +50,7 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; } @@ -745,7 +745,7 @@ if ($action == 'create') { // Ref print ''; // Supplier - if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) + if (((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) || (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) { print ''; print ''; @@ -1975,7 +1975,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } print ''; @@ -2256,7 +2256,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ""; // Supplier - if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { print ''; print ''; print ''; } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $object->fournisseur && !empty($user->rights->fournisseur->lire)) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $object->fournisseur && !empty($user->rights->fournisseur->lire)) { print ''; print ''; - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) { print ''; print '';*/ // Date of payment - print ''; + print ''; print ''; // Payment mode @@ -241,9 +241,9 @@ if ($result > 0) { } // Note - print ''; + print ''; print ''; print '
'; - print $langs->trans('BankAccount'); + print $langs->trans('DefaultBankAccount'); print ''; if ($action != 'editbankaccount' && $user->rights->salaries->write) { print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'
'; - if ($origin == 'supplierorder' && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) { + if ($origin == 'supplierorder' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) { print $langs->trans("RefOrder").''.img_object($langs->trans("ShowOrder"), 'order').' '.$object->ref; } if ($origin == 'propal' && !empty($conf->propal->enabled)) { @@ -1270,7 +1270,7 @@ if ($action == 'create') { $objectsrc = new Propal($db); $objectsrc->fetch($object->$typeobject->id); } - if ($typeobject == 'CommandeFournisseur' && $object->$typeobject->id && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) { + if ($typeobject == 'CommandeFournisseur' && $object->$typeobject->id && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) { $objectsrc = new CommandeFournisseur($db); $objectsrc->fetch($object->$typeobject->id); } @@ -1982,7 +1982,7 @@ if ($action == 'create') { } // Create bill - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && ($object->statut == Reception::STATUS_VALIDATED || $object->statut == Reception::STATUS_CLOSED)) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && ($object->statut == Reception::STATUS_VALIDATED || $object->statut == Reception::STATUS_CLOSED)) { if ($user->rights->fournisseur->facture->creer) { // TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) // If we do that, we must also make this option official. @@ -1996,7 +1996,7 @@ if ($action == 'create') { if ($user->rights->reception->creer && $object->statut > 0 && !$object->billed) { $label = "Close"; $paramaction = 'classifyclosed'; // = Transferred/Received // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on receptions instead of orders - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? $label = "ClassifyBilled"; $paramaction = 'classifybilled'; } diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 05c54a914b5..ea6aaa8d14e 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -186,7 +186,7 @@ abstract class ActionsCardCommon $s = $modCodeClient->getToolTip($langs, $this->object, 0); $this->tpl['help_customercode'] = $form->textwithpicto('', $s, 1); - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->tpl['supplier_enabled'] = 1; // Load object modCodeFournisseur diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 97163231baa..c5f93e9f96a 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -980,7 +980,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (GETPOST("type") == 'p') { $object->client = 2; } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { $object->fournisseur = 1; } @@ -1585,7 +1585,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Supplier - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { print '
'.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, 'parent', null, null, 1); print img_picto('', 'category').$form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0); @@ -1964,7 +1964,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).'
'; - if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print '
'.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, null, null, null, 1); @@ -2460,7 +2460,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Supplier code - if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { + if (((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { print '
'; print $langs->trans('SupplierCode').''; print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); @@ -2667,7 +2667,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Supplier - if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { + if (((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { print '
'.$langs->trans("SuppliersCategoriesShort").''; print $form->showCategories($object->id, Categorie::TYPE_SUPPLIER, 1); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9d449922dd2..09ca33b4961 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2636,7 +2636,7 @@ class Societe extends CommonObject } } if (empty($option) || preg_match('/supplier/', $option)) { - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $this->fournisseur) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $this->fournisseur) { $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; } } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index ef2fbccf490..021b83baaab 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -226,9 +226,9 @@ $arrayfields = array( 's.name_alias'=>array('label'=>"AliasNameShort", 'position'=>3, 'checked'=>1), 's.barcode'=>array('label'=>"Gencod", 'position'=>5, 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))), 's.code_client'=>array('label'=>"CustomerCodeShort", 'position'=>10, 'checked'=>$checkedcustomercode), - 's.code_fournisseur'=>array('label'=>"SupplierCodeShort", 'position'=>11, 'checked'=>$checkedsuppliercode, 'enabled'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))), + 's.code_fournisseur'=>array('label'=>"SupplierCodeShort", 'position'=>11, 'checked'=>$checkedsuppliercode, 'enabled'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))), 's.code_compta'=>array('label'=>"CustomerAccountancyCodeShort", 'position'=>13, 'checked'=>$checkedcustomeraccountcode), - 's.code_compta_fournisseur'=>array('label'=>"SupplierAccountancyCodeShort", 'position'=>14, 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))), + 's.code_compta_fournisseur'=>array('label'=>"SupplierAccountancyCodeShort", 'position'=>14, 'checked'=>$checkedsupplieraccountcode, 'enabled'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))), 's.address'=>array('label'=>"Address", 'position'=>19, 'checked'=>0), 's.zip'=>array('label'=>"Zip", 'position'=>20, 'checked'=>1), 's.town'=>array('label'=>"Town", 'position'=>21, 'checked'=>0), diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index c70e080528b..55ae070363a 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -178,7 +178,7 @@ if ($result > 0) { print '
'; print $langs->trans('SupplierCode').''; print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index e16a12581ac..705ea614f5c 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1859,7 +1859,7 @@ if ($action == 'create') { } // Create an order - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $object->statut == SupplierProposal::STATUS_SIGNED) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $object->statut == SupplierProposal::STATUS_SIGNED) { if ($usercancreateorder) { print ''; } From 2d77b9bdf0d15597fa160445d0a7156296e85649 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 12 Apr 2021 06:15:47 +0200 Subject: [PATCH 088/216] Work on split module fournisseur --- htdocs/ecm/search.php | 8 ++++---- htdocs/fourn/card.php | 6 +++--- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- htdocs/fourn/commande/card.php | 4 ++-- htdocs/fourn/index.php | 4 ++-- htdocs/fourn/recap-fourn.php | 2 +- htdocs/product/class/product.class.php | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 2ef71544764..979e1d3a417 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -128,11 +128,11 @@ if (!empty($conf->facture->enabled)) { if (!empty($conf->supplier_proposal->enabled)) { $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals"))); } -if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { - $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders"))); +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { + $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders"))); } -if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) { - $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) { + $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); } if (!empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index bbc427e48df..18c65bcf3c6 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -326,7 +326,7 @@ if ($object->id > 0) { print '
'; print $form->editfieldkey("OrderMinAmount", 'supplier_order_min_amount', $object->supplier_order_min_amount, $object, $user->rights->societe->creer); @@ -406,7 +406,7 @@ if ($object->id > 0) { } } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { // Box proposals $tmp = $object->getOutstandingOrders('supplier'); $outstandingOpened = $tmp['opened']; @@ -427,7 +427,7 @@ if ($object->id > 0) { } } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) { $tmp = $object->getOutstandingBills('supplier'); $outstandingOpened = $tmp['opened']; $outstandingTotal = $tmp['total_ht']; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 5f88a1a3f1e..7297d0d0c8c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3229,7 +3229,7 @@ class CommandeFournisseur extends CommonOrder { global $conf, $langs; - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; $qtydelivered = array(); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 18c45507f0a..5dc72a402f2 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2438,7 +2438,7 @@ if ($action == 'create') { } if (in_array($object->statut, array(3, 4, 5))) { - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $usercanreceived) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $usercanreceived) { print ''; } else { print ''; @@ -2464,7 +2464,7 @@ if ($action == 'create') { // Create bill //if (! empty($conf->facture->enabled)) //{ - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) { // statut 2 means approved, 7 means canceled + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) { // statut 2 means approved, 7 means canceled if ($user->rights->fournisseur->facture->creer) { print ''.$langs->trans("CreateBill").''; } diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index 54ed40e37b0..4a761ea8b70 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -99,7 +99,7 @@ if ($resql) { // Draft orders -if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { $langs->load("orders"); $sql = "SELECT cf.rowid, cf.ref, cf.total_ttc,"; @@ -157,7 +157,7 @@ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUP } // Draft invoices -if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) { +if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) { $sql = "SELECT ff.ref_supplier, ff.rowid, ff.total_ttc, ff.type"; $sql .= ", s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff"; diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php index 97a6b53f2e2..adeaf7b1447 100644 --- a/htdocs/fourn/recap-fourn.php +++ b/htdocs/fourn/recap-fourn.php @@ -63,7 +63,7 @@ if ($socid > 0) { dol_banner_tab($societe, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom'); print dol_get_fiche_end(); - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->facture->lire) { + if ((!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) { // Invoice list print load_fiche_titre($langs->trans("SupplierPreview")); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 59fc743f8be..0c1e80792f1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5139,7 +5139,7 @@ class Product extends CommonObject } $stock_commande_fournisseur = $this->stats_commande_fournisseur['qty']; } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->reception->enabled)) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->reception->enabled)) { $filterStatus = '4'; if (isset($includedraftpoforvirtual)) { $filterStatus = '0,'.$filterStatus; @@ -5150,7 +5150,7 @@ class Product extends CommonObject } $stock_reception_fournisseur = $this->stats_reception['qty']; } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->reception->enabled)) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->reception->enabled)) { $filterStatus = '4'; if (isset($includedraftpoforvirtual)) { $filterStatus = '0,'.$filterStatus; From ab35b6b4f25e971779f1c89632c52c9be090d50d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 12 Apr 2021 06:21:25 +0200 Subject: [PATCH 089/216] Work on split module fournisseur --- .../modules/project/doc/doc_generic_project_odt.modules.php | 4 ++-- htdocs/core/modules/project/doc/pdf_beluga.modules.php | 4 ++-- .../modules/project/task/doc/doc_generic_task_odt.modules.php | 4 ++-- htdocs/core/modules/reception/doc/pdf_squille.modules.php | 2 +- .../interface_20_modWorkflow_WorkflowManager.class.php | 2 +- .../interface_50_modNotification_Notification.class.php | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 5799a59df3f..d007b421fd7 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -49,10 +49,10 @@ if (!empty($conf->facture->enabled)) { if (!empty($conf->commande->enabled)) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } -if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; } -if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; } if (!empty($conf->contrat->enabled)) { diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 21af4b94ade..30b9271a110 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -400,7 +400,7 @@ class pdf_beluga extends ModelePDFProjects 'class'=>'CommandeFournisseur', 'table'=>'commande_fournisseur', 'datefieldname'=>'date_commande', - 'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire, + 'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire), 'lang'=>'orders'), 'invoice_supplier'=>array( 'name'=>"BillsSuppliers", @@ -409,7 +409,7 @@ class pdf_beluga extends ModelePDFProjects 'margin'=>'minus', 'table'=>'facture_fourn', 'datefieldname'=>'datef', - 'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire, + 'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire), 'lang'=>'bills'), 'contract'=>array( 'name'=>"Contracts", diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index cd6c6789038..2d263aae6c0 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -50,10 +50,10 @@ if (!empty($conf->facture->enabled)) { if (!empty($conf->commande->enabled)) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } -if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; } -if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; } if (!empty($conf->contrat->enabled)) { diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 89d30f23c5f..c9a2b397e17 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -879,7 +879,7 @@ class pdf_squille extends ModelePdfReception $origin_id = $object->origin_id; // TODO move to external function - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { // commonly $origin='commande' + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { // commonly $origin='commande' $outputlangs->load('orders'); $classname = 'CommandeFournisseur'; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 6bbb6d441c8..72a08d22494 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -192,7 +192,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // First classify billed the order to allow the proposal classify process - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER)) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER)) { $object->fetchObjectLinked('', 'order_supplier', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index 08f94484e37..69903ce45f3 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -132,9 +132,9 @@ class InterfaceNotification extends DolibarrTriggers $element = $obj->elementtype; // Exclude events if related module is disabled - if ($element == 'order_supplier' && (empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || empty($conf->supplier_order->enabled))) { + if ($element == 'order_supplier' && ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))) { $qualified = 0; - } elseif ($element == 'invoice_supplier' && (empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || empty($conf->supplier_invoice->enabled))) { + } elseif ($element == 'invoice_supplier' && ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_invoice->enabled))) { $qualified = 0; } elseif ($element == 'withdraw' && empty($conf->prelevement->enabled)) { $qualified = 0; From f7491111482e86132144d73bd6d796bdf8b90fd0 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 12 Apr 2021 06:27:46 +0200 Subject: [PATCH 090/216] Work on split module fournisseur --- htdocs/core/modules/modBanque.class.php | 2 +- htdocs/core/modules/modCategorie.class.php | 4 ++-- htdocs/core/modules/modProduct.class.php | 18 +++++++++--------- htdocs/core/modules/modService.class.php | 18 +++++++++--------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index 3a702007ef3..b4135294293 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -162,7 +162,7 @@ class modBanque extends DolibarrModules "s.nom"=>"company", "s.code_compta"=>"company", "s.code_compta_fournisseur"=>"company" ); $this->export_special_array[$r] = array('-b.amount'=>'NULLIFNEG', 'b.amount'=>'NULLIFNEG'); - if (empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || empty($conf->supplier_order->enabled) || empty($conf->supplier_invoice->enabled)) { + if ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled) || empty($conf->supplier_invoice->enabled)) { unset($this->export_fields_array[$r]['s.code_compta_fournisseur']); unset($this->export_entities_array[$r]['s.code_compta_fournisseur']); } diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 990fdb44bfe..4f97eed58f0 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -130,7 +130,7 @@ class modCategorie extends DolibarrModules if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { $typeexample .= ($typeexample ? " / " : "")."0=Product-Service"; } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $typeexample .= ($typeexample ? "/" : "")."1=Supplier"; } if (!empty($conf->societe->enabled)) { @@ -484,7 +484,7 @@ class modCategorie extends DolibarrModules } // 1 Suppliers - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $r++; $this->import_code[$r] = $this->rights_class.'_1_'.Categorie::$MAP_ID_TO_CODE[1]; $this->import_label[$r] = "CatSupLinks"; // Translation key diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 0cc1da3e52b..e9dc9688217 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -203,7 +203,7 @@ class modProduct extends DolibarrModules if (is_object($mysoc) && $usenpr) { $this->export_fields_array[$r]['p.recuperableonly'] = 'NPR'; } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled) || !empty($conf->margin->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled) || !empty($conf->margin->enabled)) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice')); } if (!empty($conf->stock->enabled)) { @@ -216,7 +216,7 @@ class modProduct extends DolibarrModules $keyforelement = 'product'; $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('s.nom'=>'Supplier', 'pf.ref_fourn'=>'SupplierRef', 'pf.quantity'=>'QtyMin', 'pf.remise_percent'=>'DiscountQtyMin', 'pf.unitprice'=>'BuyingPrice', 'pf.delivery_time_days'=>'NbDaysToDelivery')); } if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { @@ -250,7 +250,7 @@ class modProduct extends DolibarrModules if (!empty($conf->barcode->enabled)) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text')); } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric')); } if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -269,7 +269,7 @@ class modProduct extends DolibarrModules if (!empty($conf->barcode->enabled)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product')); } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); } if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -284,7 +284,7 @@ class modProduct extends DolibarrModules if (!empty($conf->barcode->enabled)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product')); } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); } if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -305,7 +305,7 @@ class modProduct extends DolibarrModules $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid'; } $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object'; - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc'; } if (!empty($conf->stock->enabled)) { @@ -609,7 +609,7 @@ class modProduct extends DolibarrModules )); } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled) || !empty($conf->margin->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled) || !empty($conf->margin->enabled)) { $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.cost_price'=>'CostPrice')); } if (is_object($mysoc) && $usenpr) { @@ -702,7 +702,7 @@ class modProduct extends DolibarrModules 'p.desiredstock' => '' )); } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled) || !empty($conf->margin->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled) || !empty($conf->margin->enabled)) { $import_sample = array_merge($import_sample, array('p.cost_price'=>'90')); } if (is_object($mysoc) && $usenpr) { @@ -741,7 +741,7 @@ class modProduct extends DolibarrModules $this->import_updatekeys_array[$r] = array_merge($this->import_updatekeys_array[$r], array('p.barcode'=>'BarCode')); //only show/allow barcode as update key if Barcode module enabled } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { // Import suppliers prices (note: this code is duplicated in module Service) $r++; $this->import_code[$r] = $this->rights_class.'_supplierprices'; diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 9e79aee9663..fd019ca4c68 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -168,7 +168,7 @@ class modService extends DolibarrModules if (is_object($mysoc) && $usenpr) { $this->export_fields_array[$r]['p.recuperableonly'] = 'NPR'; } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled) || !empty($conf->margin->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled) || !empty($conf->margin->enabled)) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice')); } if (!empty($conf->stock->enabled)) { @@ -181,7 +181,7 @@ class modService extends DolibarrModules $keyforelement = 'product'; $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - if (!empty($conf->fournisseur->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('s.nom'=>'Supplier', 'pf.ref_fourn'=>'SupplierRef', 'pf.quantity'=>'QtyMin', 'pf.remise_percent'=>'DiscountQtyMin', 'pf.unitprice'=>'BuyingPrice', 'pf.delivery_time_days'=>'NbDaysToDelivery')); } if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { @@ -213,7 +213,7 @@ class modService extends DolibarrModules if (!empty($conf->barcode->enabled)) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text')); } - if (!empty($conf->fournisseur->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric')); } if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -232,7 +232,7 @@ class modService extends DolibarrModules if (!empty($conf->barcode->enabled)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product')); } - if (!empty($conf->fournisseur->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); } if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -247,7 +247,7 @@ class modService extends DolibarrModules if (!empty($conf->barcode->enabled)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product')); } - if (!empty($conf->fournisseur->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); } if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -268,7 +268,7 @@ class modService extends DolibarrModules $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid'; } $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object'; - if (!empty($conf->fournisseur->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc'; } $this->export_sql_end[$r] .= ' WHERE p.fk_product_type = 1 AND p.entity IN ('.getEntity('product').')'; @@ -564,7 +564,7 @@ class modService extends DolibarrModules )); } - if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled) || !empty($conf->margin->enabled)) { $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.cost_price'=>'CostPrice')); } if (is_object($mysoc) && $usenpr) { @@ -655,7 +655,7 @@ class modService extends DolibarrModules 'p.desiredstock' => '' )); } - if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled) || !empty($conf->margin->enabled)) { $import_sample = array_merge($import_sample, array('p.cost_price'=>'90')); } if (is_object($mysoc) && $usenpr) { @@ -698,7 +698,7 @@ class modService extends DolibarrModules } if (empty($conf->product->enabled)) { // We enable next import templates only if module product not already enabled (to avoid duplicate entries) - if (!empty($conf->fournisseur->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { // Import suppliers prices (note: this code is duplicated in module Service) $r++; $this->import_code[$r] = $this->rights_class.'_supplierprices'; From 2a1a22763db924183c7043a2c5ddace489680185 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 12 Apr 2021 06:51:00 +0200 Subject: [PATCH 091/216] Work on split module fournisseur --- htdocs/core/boxes/box_dolibarr_state_board.php | 6 +++++- htdocs/core/menus/standard/eldy.lib.php | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 7d4a290f0bc..0e5c80ef16b 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -119,7 +119,11 @@ class box_dolibarr_state_board extends ModeleBoxes 'members' => !empty($conf->adherent->enabled) && $user->rights->adherent->lire, 'customers' => !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), 'prospects' => !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), - 'suppliers' => !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), + 'suppliers' => ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->lire) + || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) + || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire) + ) + && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), 'contacts' => !empty($conf->societe->enabled) && $user->rights->societe->contact->lire, 'products' => !empty($conf->product->enabled) && $user->rights->produit->lire, 'services' => !empty($conf->service->enabled) && $user->rights->service->lire, diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 64e7461cd07..83da57c0594 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -849,8 +849,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Suppliers if (!empty($conf->societe->enabled) && (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->supplier_proposal->enabled))) { $langs->load("suppliers"); - $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->rights->fournisseur->lire), '', $mainmenu, 'suppliers'); - $newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->rights->societe->creer && ($user->rights->fournisseur->lire)); + $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->rights->fournisseur->lire || $user->rights->supplier_order->lire || $user->rights->supplier_invoice->lire || $user->rights->supplier_proposal->lire), '', $mainmenu, 'suppliers'); + $newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->rights->societe->creer && ($user->rights->fournisseur->lire || $user->rights->supplier_order->lire || $user->rights->supplier_invoice->lire || $user->rights->supplier_proposal->lire)); } // Categories @@ -1369,7 +1369,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED } - if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))) { + if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 2, $user->rights->accounting->comptarapport->lire); $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); @@ -1379,7 +1379,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $modecompta = 'RECETTES-DEPENSES'; //if (! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED - if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))) { + if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); @@ -1543,7 +1543,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->variants->enabled)) { $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->rights->produit->lire); } - if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if (!empty($conf->propal->enabled) || (!empty($conf->commande->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire); } From 80995c34b55b106afecc45bd8e6b3d9f1b76602d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 12 Apr 2021 07:13:05 +0200 Subject: [PATCH 092/216] FIX Write right on document --- htdocs/compta/sociales/document.php | 2 +- htdocs/compta/tva/document.php | 2 +- htdocs/contact/document.php | 2 +- htdocs/don/document.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index dbb01060a4d..1134eb71b74 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -160,7 +160,7 @@ if ($object->id) $modulepart = 'tax'; $permission = $user->rights->tax->charges->creer; - $permtoedit = $user->rights->fournisseur->facture->creer; + $permtoedit = $user->rights->tax->charges->creer; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index e310e61fcb8..5634181cefd 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -145,7 +145,7 @@ if ($object->id) print dol_get_fiche_end(); $permission = $user->rights->tax->charges->creer; - $permtoedit = $user->rights->fournisseur->facture->creer; + $permtoedit = $user->rights->tax->charges->creer; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index 2065ab772e6..b79f3ddc9a0 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -168,7 +168,7 @@ if ($object->id) $permission = $user->rights->societe->contact->creer; $permtoedit = $user->rights->societe->contact->creer; $param = '&id='.$object->id; - include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/don/document.php b/htdocs/don/document.php index 9ff1fa98ea2..a0be06f0274 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -182,7 +182,7 @@ if ($object->id) print dol_get_fiche_end(); $modulepart = 'don'; - $permission = $user->rights->don->lire; + $permission = $user->rights->don->creer; $permtoedit = $user->rights->don->creer; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; From 87cc1b2601b4e935d11f1f2a3e8a95ba35d61ba0 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 12 Apr 2021 07:37:34 +0200 Subject: [PATCH 093/216] Add right supplier_invoice --- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/core/tpl/contacts.tpl.php | 14 +++++++++++--- htdocs/core/tpl/extrafields_view.tpl.php | 12 ++++++++++-- htdocs/core/tpl/notes.tpl.php | 12 ++++++++++-- htdocs/fourn/card.php | 4 ++-- htdocs/fourn/commande/card.php | 4 ++-- htdocs/fourn/commande/list.php | 4 ++-- htdocs/fourn/facture/card.php | 10 +++++----- htdocs/fourn/facture/contact.php | 6 +++--- htdocs/fourn/facture/document.php | 4 ++-- htdocs/fourn/facture/list.php | 8 ++++---- htdocs/fourn/facture/note.php | 4 ++-- htdocs/fourn/paiement/card.php | 18 +++++++++--------- htdocs/projet/card.php | 2 +- htdocs/projet/element.php | 4 ++-- htdocs/reception/card.php | 2 +- htdocs/reception/list.php | 4 ++-- 17 files changed, 69 insertions(+), 45 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 83da57c0594..440a6e021bc 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1038,7 +1038,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->societe->enabled) && !empty($conf->supplier_invoice->enabled)) { $langs->load("bills"); $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, $user->rights->fournisseur->facture->creer, '', $mainmenu, 'suppliers_bills_create'); + $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), '', $mainmenu, 'suppliers_bills_create'); $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list'); if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) { diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 4c57ec953d4..511c03a931b 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -44,9 +44,17 @@ if ($module == 'propal') { } elseif ($module == 'fichinter') { $permission = $user->rights->ficheinter->creer; } elseif ($module == 'order_supplier') { - $permission = $user->rights->fournisseur->commande->creer; -} elseif ($module == 'invoice_supplier') { - $permission = $user->rights->fournisseur->facture->creer; + if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { + $permission = $user->rights->fournisseur->commande->creer; + } else { + $permission = $user->rights->supplier_order->creer; + } +} elseif ($module == 'invoice_supplier' && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { + if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { + $permission = $user->rights->fournisseur->facture->creer; + } else { + $permission = $user->rights->supplier_invoice->creer; + } } elseif ($module == 'project') { $permission = $user->rights->projet->creer; } elseif ($module == 'action') { diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index d1613cee7e9..9c15a71f43c 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -162,10 +162,18 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] $permok = !empty($user->rights->$keyforperm->creer) || !empty($user->rights->$keyforperm->create) || !empty($user->rights->$keyforperm->write); } if ($object->element == 'order_supplier') { - $permok = $user->rights->fournisseur->commande->creer; + if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { + $permok = $user->rights->fournisseur->commande->creer; + } else { + $permok = $user->rights->supplier_order->creer; + } } if ($object->element == 'invoice_supplier') { - $permok = $user->rights->fournisseur->facture->creer; + if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { + $permok = $user->rights->fournisseur->facture->creer; + } else { + $permok = $user->rights->supplier_invoice->creer; + } } if ($object->element == 'shipping') { $permok = $user->rights->expedition->creer; diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 60b541d8afb..6c01c44bc36 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -70,9 +70,17 @@ if ($module == 'propal') { } elseif ($module == 'project_task') { $permission = $user->rights->projet->creer; } elseif ($module == 'invoice_supplier') { - $permission = $user->rights->fournisseur->facture->creer; + if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { + $permission = $user->rights->fournisseur->facture->creer; + } else { + $permission = $user->rights->supplier_invoice->creer; + } } elseif ($module == 'order_supplier') { - $permission = $user->rights->fournisseur->commande->creer; + if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { + $permission = $user->rights->fournisseur->commande->creer; + } else { + $permission = $user->rights->supplier_order->creer; + } } elseif ($module == 'societe') { $permission = $user->rights->societe->creer; } elseif ($module == 'contact') { diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 18c65bcf3c6..4c86617d95a 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -841,7 +841,7 @@ if ($object->id > 0) { } } - if ($user->rights->fournisseur->facture->creer) { + if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { if (!empty($orders2invoice) && $orders2invoice > 0) { if ($object->status == 1) { // Company is open @@ -854,7 +854,7 @@ if ($object->id > 0) { } } - if ($user->rights->fournisseur->facture->creer) { + if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { $langs->load("bills"); if ($object->status == 1) { print ''.$langs->trans("AddBill").''; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 5dc72a402f2..c7d45c07f57 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2465,7 +2465,7 @@ if ($action == 'create') { //if (! empty($conf->facture->enabled)) //{ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) { // statut 2 means approved, 7 means canceled - if ($user->rights->fournisseur->facture->creer) { + if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { print ''.$langs->trans("CreateBill").''; } } @@ -2477,7 +2477,7 @@ if ($action == 'create') { print ''.$langs->trans("ClassifyBilled").''; } else { if (!empty($object->linkedObjectsIds['invoice_supplier'])) { - if ($user->rights->fournisseur->facture->creer) { + if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { print ''.$langs->trans("ClassifyBilled").''; } } else { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 2417563c176..8eccc065783 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -459,7 +459,7 @@ if (empty($reshook)) { // Fac builddoc $donotredirect = 1; $upload_dir = $conf->fournisseur->facture->dir_output; - $permissiontoadd = $user->rights->fournisseur->facture->creer; + $permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); //include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -880,7 +880,7 @@ if ($resql) { 'builddoc'=>$langs->trans("PDFMerge"), 'presend'=>$langs->trans("SendByMail"), ); - if ($user->rights->fournisseur->facture->creer) { + if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { $arrayofmassactions['createbills'] = $langs->trans("CreateInvoiceForThisSupplier"); } if ($user->rights->fournisseur->commande->supprimer) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 35b5cd214c8..578c9c7e062 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -111,9 +111,9 @@ $isdraft = (($object->statut == FactureFournisseur::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', 'fk_soc', 'rowid', $isdraft); // Common permissions -$usercanread = $user->rights->fournisseur->facture->lire; -$usercancreate = $user->rights->fournisseur->facture->creer; -$usercandelete = $user->rights->fournisseur->facture->supprimer; +$usercanread = ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire); +$usercancreate = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); +$usercandelete = ($user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer); // Advanced permissions $usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))); @@ -395,7 +395,7 @@ if (empty($reshook)) { } - if ($action == 'settransportmode' && $user->rights->fournisseur->facture->creer) { + if ($action == 'settransportmode' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { // transport mode $result = $object->setTransportMode(GETPOST('transport_mode_id', 'int')); } elseif ($action == 'setlabel' && $usercancreate) { @@ -2894,7 +2894,7 @@ if ($action == 'create') { print ''; - if ($action != 'editmode' && $user->rights->fournisseur->facture->creer) { + if ($action != 'editmode' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { print ''; } print '
'; print $langs->trans('IntracommReportTransportMode'); print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'
'; diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index 1284ee293be..236c3cd6948 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -53,7 +53,7 @@ $object = new FactureFournisseur($db); * Ajout d'un nouveau contact */ -if ($action == 'addcontact' && $user->rights->fournisseur->facture->creer) { +if ($action == 'addcontact' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { $result = $object->fetch($id, $ref); if ($result > 0 && $id > 0) { @@ -73,14 +73,14 @@ if ($action == 'addcontact' && $user->rights->fournisseur->facture->creer) { setEventMessages($object->error, $object->errors, 'errors'); } } -} elseif ($action == 'swapstatut' && $user->rights->fournisseur->facture->creer) { +} elseif ($action == 'swapstatut' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { // bascule du statut d'un contact if ($object->fetch($id)) { $result = $object->swapContactStatus(GETPOST('ligne', 'int')); } else { dol_print_error($db); } -} elseif ($action == 'deletecontact' && $user->rights->fournisseur->facture->creer) { +} elseif ($action == 'deletecontact' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { // Efface un contact $object->fetch($id); $result = $object->delete_contact(GETPOST("lineid", 'int')); diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 24009d35dbc..f75a8bd8ef3 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -251,8 +251,8 @@ if ($object->id > 0) { $modulepart = 'facture_fournisseur'; - $permission = $user->rights->fournisseur->facture->creer; - $permtoedit = $user->rights->fournisseur->facture->creer; + $permission = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); + $permtoedit = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); $param = '&facid='.$object->id; $defaulttpldir = '/core/tpl'; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 0b6e7aca99c..e30e1798a52 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -274,9 +274,9 @@ if (empty($reshook)) { // Mass actions $objectclass = 'FactureFournisseur'; $objectlabel = 'SupplierInvoices'; - $permissiontoread = $user->rights->fournisseur->facture->lire; - $permissiontoadd = $user->rights->fournisseur->facture->creer; - $permissiontodelete = $user->rights->fournisseur->facture->supprimer; + $permissiontoread = ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire); + $permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); + $permissiontodelete = ($user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer); $uploaddir = $conf->fournisseur->facture->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; @@ -878,7 +878,7 @@ if ($resql) { if (!empty($socid)) { $url .= '&socid='.$socid; } - $newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', $user->rights->fournisseur->facture->creer); + $newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)); $i = 0; print '
'."\n"; diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 541121031ee..2cb8dfc66b1 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -48,7 +48,7 @@ $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture'); $object = new FactureFournisseur($db); $object->fetch($id, $ref); -$permissionnote = $user->rights->fournisseur->facture->creer; // Used by the include of actions_setnotes.inc.php +$permissionnote = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); // Used by the include of actions_setnotes.inc.php /* @@ -58,7 +58,7 @@ $permissionnote = $user->rights->fournisseur->facture->creer; // Used by the inc include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once // Set label -if ($action == 'setlabel' && $user->rights->fournisseur->facture->creer) { +if ($action == 'setlabel' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { $object->label = $_POST['label']; $result = $object->update($user); if ($result < 0) { diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index f061385c5bb..ccc29105e4f 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -62,7 +62,7 @@ if ($socid && $socid != $object->thirdparty->id) { * Actions */ -if ($action == 'setnote' && $user->rights->fournisseur->facture->creer) { +if ($action == 'setnote' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { $db->begin(); $object->fetch($id); @@ -92,7 +92,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisse } if ($action == 'confirm_validate' && $confirm == 'yes' && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->facture->creer)) + ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && (!empty($user->rights->fournisseur->facture->creer) || !empty($user->rights->supplier_invoice->creer))) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))) ) { $db->begin(); @@ -182,9 +182,9 @@ if ($result > 0) { print '
'.$form->editfieldkey("Date", 'datep', $object->date, $object, $object->statut == 0 && $user->rights->fournisseur->facture->creer).'
'.$form->editfieldkey("Date", 'datep', $object->date, $object, $object->statut == 0 && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)).''; - print $form->editfieldval("Date", 'datep', $object->date, $object, $object->statut == 0 && $user->rights->fournisseur->facture->creer, 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded')); + print $form->editfieldval("Date", 'datep', $object->date, $object, $object->statut == 0 && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded')); print '
'.$form->editfieldkey("Comments", 'note', $object->note, $object, $user->rights->fournisseur->facture->creer).'
'.$form->editfieldkey("Comments", 'note', $object->note, $object, ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)).''; - print $form->editfieldval("Note", 'note', $object->note, $object, $user->rights->fournisseur->facture->creer, 'textarea'); + print $form->editfieldval("Note", 'note', $object->note, $object, ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), 'textarea'); print '
'; @@ -336,7 +336,7 @@ if ($result > 0) { print '
'; if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { if ($user->socid == 0 && $object->statut == 0 && $action == '') { - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->facture->creer)) + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && (!empty($user->rights->fournisseur->facture->creer) || !empty($user->rights->supplier_invoice->creer))) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))) { print ''.$langs->trans('Valid').''; } @@ -363,8 +363,8 @@ if ($result > 0) { $ref = dol_sanitizeFileName($object->ref); $filedir = $conf->fournisseur->payment->dir_output.'/'.dol_sanitizeFileName($object->ref); $urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id; - $genallowed = $user->rights->fournisseur->facture->lire; - $delallowed = $user->rights->fournisseur->facture->creer; + $genallowed = ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire); + $delallowed = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); $modelpdf = (!empty($object->model_pdf) ? $object->model_pdf : (empty($conf->global->SUPPLIER_PAYMENT_ADDON_PDF) ? '' : $conf->global->SUPPLIER_PAYMENT_ADDON_PDF)); print $formfile->showdocuments('supplier_payment', $ref, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 40, 0, '', '', '', $societe->default_lang); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e39869c409f..ad38fc7aa6e 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1274,7 +1274,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $langs->load("suppliers"); print ''.$langs->trans("AddSupplierOrder").''; } - if (!empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->creer) { + if (!empty($conf->supplier_invoice->enabled) && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { $langs->load("suppliers"); print ''.$langs->trans("AddSupplierInvoice").''; } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 083f80f836d..b248e24da86 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -437,8 +437,8 @@ $listofreferent = array( 'urlnew'=>DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object 'lang'=>'suppliers', 'buttonnew'=>'AddSupplierInvoice', - 'testnew'=>$user->rights->fournisseur->facture->creer, - 'test'=>$conf->supplier_invoice->enabled && $user->rights->fournisseur->facture->lire), + 'testnew'=>($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), + 'test'=>$conf->supplier_invoice->enabled && ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire), 'contract'=>array( 'name'=>"Contracts", 'title'=>"ListContractAssociatedProject", diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 22acecc574d..5ed59cf922b 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1983,7 +1983,7 @@ if ($action == 'create') { // Create bill if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && ($object->statut == Reception::STATUS_VALIDATED || $object->statut == Reception::STATUS_CLOSED)) { - if ($user->rights->fournisseur->facture->creer) { + if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { // TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) // If we do that, we must also make this option official. print ''.$langs->trans("CreateBill").''; diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index bdc65fb301b..a6891e38c79 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -384,7 +384,7 @@ if (empty($reshook)) { // Fac builddoc $donotredirect = 1; $upload_dir = $conf->fournisseur->facture->dir_output; - $permissiontoadd = $user->rights->fournisseur->facture->creer; + $permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -596,7 +596,7 @@ $arrayofmassactions = array( // 'presend'=>$langs->trans("SendByMail"), ); -if ($user->rights->fournisseur->facture->creer) { +if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { $arrayofmassactions['createbills'] = $langs->trans("CreateInvoiceForThisSupplier"); } if ($massaction == 'createbills') { From 1ef89b8e7a82ee08de81e7e68a98b9131c77a71a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 12 Apr 2021 08:59:25 +0200 Subject: [PATCH 094/216] Add right supplier_invoice --- htdocs/projet/element.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index b248e24da86..ac2141269ec 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -425,8 +425,8 @@ $listofreferent = array( 'urlnew'=>DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object 'lang'=>'suppliers', 'buttonnew'=>'AddSupplierOrder', - 'testnew'=>$user->rights->fournisseur->commande->creer, - 'test'=>$conf->supplier_order->enabled && $user->rights->fournisseur->commande->lire), + 'testnew'=>($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->lire), + 'test'=>$conf->supplier_order->enabled && ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)), 'invoice_supplier'=>array( 'name'=>"BillsSuppliers", 'title'=>"ListSupplierInvoicesAssociatedProject", @@ -438,7 +438,7 @@ $listofreferent = array( 'lang'=>'suppliers', 'buttonnew'=>'AddSupplierInvoice', 'testnew'=>($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), - 'test'=>$conf->supplier_invoice->enabled && ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire), + 'test'=>$conf->supplier_invoice->enabled && ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire)), 'contract'=>array( 'name'=>"Contracts", 'title'=>"ListContractAssociatedProject", From 8d72448f43e37c152101cbbc63317e51bfe0cadc Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 12 Apr 2021 09:47:16 +0200 Subject: [PATCH 095/216] Add right supplier_order --- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/core/lib/security.lib.php | 2 +- htdocs/core/menus/init_menu_auguria.sql | 24 +++++++++---------- htdocs/fourn/card.php | 2 +- .../fourn/class/api_supplier_orders.class.php | 6 ++--- .../class/fournisseur.commande.class.php | 6 ++--- htdocs/fourn/commande/card.php | 20 ++++++++-------- htdocs/fourn/commande/contact.php | 8 +++---- htdocs/fourn/commande/dispatch.php | 2 +- htdocs/fourn/commande/document.php | 6 ++--- htdocs/fourn/commande/info.php | 2 +- htdocs/fourn/commande/list.php | 6 ++--- htdocs/fourn/commande/note.php | 4 ++-- htdocs/fourn/facture/note.php | 2 +- htdocs/projet/card.php | 2 +- htdocs/projet/element.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- 18 files changed, 50 insertions(+), 50 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 915977b1647..696340b9533 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -122,7 +122,7 @@ $usercancreateorder = $user->rights->commande->creer; $usercancreateinvoice = $user->rights->facture->creer; $usercancreatecontract = $user->rights->contrat->creer; $usercancreateintervention = $user->rights->ficheinter->creer; -$usercancreatepurchaseorder = $user->rights->fournisseur->commande->creer; +$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php $permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 3187e012fd2..5fa26be7f4e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -114,7 +114,7 @@ $usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancr $usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->annuler))); $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send); -$usercancreatepurchaseorder = $user->rights->fournisseur->commande->creer; +$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php $permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 1b6aa0aa544..e1df5da4dfb 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -371,7 +371,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f $nbko++; } } elseif ($feature == 'commande_fournisseur') { - if (!$user->rights->fournisseur->commande->creer) { + if (!$user->rights->fournisseur->commande->creer || !$user->rights->supplier_order->creer) { $createok = 0; $nbko++; } diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 62c53a8ac8b..d9c2cad7c9f 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -166,18 +166,18 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1652__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/supplier_proposal/list.php?leftmenu=supplier_proposals', 'List', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1653__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier', 'Statistics', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 2, __ENTITY__); -- Commercial - Supplier's orders -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '$user->rights->fournisseur->commande->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', 'List', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5103__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=0', 'StatusOrderDraftShort', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5104__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=1', 'StatusOrderValidated', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5105__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=2', 'StatusOrderApprovedShort', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5106__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=3', 'StatusOrderOnProcessShort', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5107__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=4', 'StatusOrderReceivedPartiallyShort', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5108__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=5', 'StatusOrderReceivedAll', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5109__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=6,7', 'StatusOrderCanceled', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 8, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5110__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=9', 'StatusOrderRefused', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 9, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5111__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders_suppliers&mode=supplier', 'Statistics', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', 'List', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5103__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=0', 'StatusOrderDraftShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5104__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=1', 'StatusOrderValidated', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5105__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=2', 'StatusOrderApprovedShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5106__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=3', 'StatusOrderOnProcessShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5107__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=4', 'StatusOrderReceivedPartiallyShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->creer)', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5108__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=5', 'StatusOrderReceivedAll', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5109__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=6,7', 'StatusOrderCanceled', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 8, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5110__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=9', 'StatusOrderRefused', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 9, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5111__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders_suppliers&mode=supplier', 'Statistics', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 7, __ENTITY__); -- Commercial - Contracts insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1400__+MAX_llx_menu__, 'commercial', 'contracts', 5__+MAX_llx_menu__, '/contrat/index.php?mainmenu=commercial&leftmenu=contracts', 'Contracts', 0, 'contracts', '$user->rights->contrat->lire', '', 2, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/card.php?mainmenu=commercial&action=create&leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 2, 0, __ENTITY__); diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 4c86617d95a..66de187bfe7 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -832,7 +832,7 @@ if ($object->id > 0) { } } - if ($user->rights->fournisseur->commande->creer) { + if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { $langs->load("orders"); if ($object->status == 1) { print ''.$langs->trans("AddOrder").''; diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index a92fe61db24..c20efa2e651 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -224,7 +224,7 @@ class SupplierOrders extends DolibarrApi */ public function post($request_data = null) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer || !DolibarrApiAccess::$user->rights->supplier_order->creer) { throw new RestException(401, "Insuffisant rights"); } // Check mandatory fields @@ -260,7 +260,7 @@ class SupplierOrders extends DolibarrApi */ public function put($id, $request_data = null) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer || !DolibarrApiAccess::$user->rights->supplier_order->creer) { throw new RestException(401); } @@ -340,7 +340,7 @@ class SupplierOrders extends DolibarrApi */ public function validate($id, $idwarehouse = 0, $notrigger = 0) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer || !DolibarrApiAccess::$user->rights->supplier_order->creer) { throw new RestException(401); } $result = $this->order->fetch($id); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 7297d0d0c8c..8b1b2eda09c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -571,7 +571,7 @@ class CommandeFournisseur extends CommonOrder dol_syslog(get_class($this)."::valid"); $result = 0; - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande->creer)) + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && (!empty($user->rights->fournisseur->commande->creer) || !empty($user->rights->supplier_order->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate))) { $this->db->begin(); @@ -2374,7 +2374,7 @@ class CommandeFournisseur extends CommonOrder */ public function setDeliveryDate($user, $delivery_date, $notrigger = 0) { - if ($user->rights->fournisseur->commande->creer) { + if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { $error = 0; $this->db->begin(); @@ -2433,7 +2433,7 @@ class CommandeFournisseur extends CommonOrder public function set_id_projet($user, $id_projet, $notrigger = 0) { // phpcs:enable - if ($user->rights->fournisseur->commande->creer) { + if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { $error = 0; $this->db->begin(); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index c7d45c07f57..8358b71f2c7 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -122,24 +122,24 @@ if ($id > 0 || !empty($ref)) { } // Common permissions -$usercanread = $user->rights->fournisseur->commande->lire; -$usercancreate = $user->rights->fournisseur->commande->creer; -$usercandelete = $user->rights->fournisseur->commande->supprimer; +$usercanread = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire); +$usercancreate = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$usercandelete = ($user->rights->fournisseur->commande->supprimer || $user->rights->supplier_order->supprimer); // Advanced permissions -$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate))); +$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate))); // Additional area permissions $usercanapprove = $user->rights->fournisseur->commande->approuver; -$usercanapprovesecond = $user->rights->fournisseur->commande->approve2; -$usercanorder = $user->rights->fournisseur->commande->commander; +$usercanapprovesecond = $user->rights->fournisseur->commande->approve2; +$usercanorder = $user->rights->fournisseur->commande->commander; $usercanreceived = $user->rights->fournisseur->commande->receptionner; // Permissions for includes -$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php -$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php -$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php -$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php +$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php +$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php /* diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index 2ff1c97e3e5..d673af33f16 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -53,7 +53,7 @@ $object = new CommandeFournisseur($db); * Add a new contact */ -if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer) { +if ($action == 'addcontact' && ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)) { $result = $object->fetch($id); if ($result > 0 && $id > 0) { @@ -73,14 +73,14 @@ if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer) { setEventMessages($object->error, $object->errors, 'errors'); } } -} elseif ($action == 'swapstatut' && $user->rights->fournisseur->commande->creer) { +} elseif ($action == 'swapstatut' && ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)) { // Toggle the status of a contact if ($object->fetch($id)) { $result = $object->swapContactStatus(GETPOST('ligne', 'int')); } else { dol_print_error($db); } -} elseif ($action == 'deletecontact' && $user->rights->fournisseur->commande->creer) { +} elseif ($action == 'deletecontact' && ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)) { // Deleting a contact $object->fetch($id); $result = $object->delete_contact(GETPOST("lineid", 'int')); @@ -136,7 +136,7 @@ if ($id > 0 || !empty($ref)) { if (!empty($conf->projet->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->fournisseur->commande->creer) { + if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 0402fa7a99b..c27a33f522b 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -545,7 +545,7 @@ if ($id > 0 || !empty($ref)) { if (!empty($conf->projet->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->fournisseur->commande->creer) { + if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index 3bc2a799a5f..a4efbec2e55 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -129,7 +129,7 @@ if ($object->id > 0) { if (!empty($conf->projet->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->fournisseur->commande->creer) { + if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; @@ -176,8 +176,8 @@ if ($object->id > 0) { $modulepart = 'commande_fournisseur'; - $permission = $user->rights->fournisseur->commande->creer; - $permtoedit = $user->rights->fournisseur->commande->creer; + $permission = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); + $permtoedit = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 60c67fdd0e8..9260dab0b42 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -141,7 +141,7 @@ $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->ge if (!empty($conf->projet->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->fournisseur->commande->creer) { + if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 8eccc065783..7588dda83f5 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -895,7 +895,7 @@ if ($resql) { if (!empty($socid)) { $url .= '&socid='.$socid; } - $newcardbutton = dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', $user->rights->fournisseur->commande->creer); + $newcardbutton = dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)); // Lines of title fields print ''; @@ -1594,8 +1594,8 @@ if ($resql) { $urlsource .= str_replace('&', '&', $param); $filedir = $diroutputmassaction; - $genallowed = $user->rights->fournisseur->commande->lire; - $delallowed = $user->rights->fournisseur->commande->creer; + $genallowed = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire); + $delallowed = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); print $formfile->showdocuments('massfilesarea_supplier_order', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } else { diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index 9f8c192752c..c4cc134fee7 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -48,7 +48,7 @@ $result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'com $object = new CommandeFournisseur($db); $object->fetch($id, $ref); -$permissionnote = $user->rights->fournisseur->commande->creer; // Used by the include of actions_setnotes.inc.php +$permissionnote = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); // Used by the include of actions_setnotes.inc.php /* @@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) { if (!empty($conf->projet->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->fournisseur->commande->creer) { + if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 2cb8dfc66b1..2f749af54f7 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -103,7 +103,7 @@ if ($object->id > 0) { if (!empty($conf->projet->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->fournisseur->commande->creer) { + if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { if ($action != 'classify') { // $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index ad38fc7aa6e..7731e401203 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1270,7 +1270,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $langs->load("supplier_proposal"); print ''.$langs->trans("AddSupplierProposal").''; } - if (!empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->creer) { + if (!empty($conf->supplier_order->enabled) && ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)) { $langs->load("suppliers"); print ''.$langs->trans("AddSupplierOrder").''; } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index ac2141269ec..f098e653c9a 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -425,7 +425,7 @@ $listofreferent = array( 'urlnew'=>DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object 'lang'=>'suppliers', 'buttonnew'=>'AddSupplierOrder', - 'testnew'=>($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->lire), + 'testnew'=>($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer), 'test'=>$conf->supplier_order->enabled && ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)), 'invoice_supplier'=>array( 'name'=>"BillsSuppliers", diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 705ea614f5c..122b881495f 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -112,7 +112,7 @@ $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights-> // Additional area permissions $usercanclose = $user->rights->supplier_proposal->cloturer; -$usercancreateorder = $user->rights->fournisseur->commande->creer; +$usercancreateorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); // Permissions for includes $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php From fb221a0541f6d9ed3c1f66b5e73b1f9eca19d71f Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 12 Apr 2021 09:59:03 +0200 Subject: [PATCH 096/216] Add right supplier_order --- 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 8b1b2eda09c..f61f4b82618 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -571,7 +571,7 @@ class CommandeFournisseur extends CommonOrder dol_syslog(get_class($this)."::valid"); $result = 0; - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && (!empty($user->rights->fournisseur->commande->creer) || !empty($user->rights->supplier_order->creer)) + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && (!empty($user->rights->fournisseur->commande->creer) || !empty($user->rights->supplier_order->creer))) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate))) { $this->db->begin(); From bb70908dacd7d5c0de64ba367ff886339ef0b4a0 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 12 Apr 2021 10:09:05 +0200 Subject: [PATCH 097/216] modifications to match @eldy's expectations --- htdocs/eventorganization/conferenceorbooth_card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 0098b2d802b..4f0720d11e3 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -493,11 +493,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field //unset($object->fields['fk_project']); // Hide field already shown in banner //unset($object->fields['fk_soc']); // Hide field already shown in banner - $link_subscription = 'http://localhost/dolibarr/htdocs/public/eventorganization/attendee_subscription.php?id='; - //$link_subscription .= base64_encode($id); + global $dolibarr_main_url_root; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='; $key = 'DV3PH'; $link_subscription .= dol_encode($id, $key); - $link_subscription .= '&securekey='.$conf->global->EVENTORGANIZATION_SECUREKEY; + $link_subscription .= '&securekey='.urlencode($conf->global->EVENTORGANIZATION_SECUREKEY); $object->fields['pubregister'] = array('type'=>'url', 'label'=>'Lien public d\'enregistrement à une conférence', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1); $object->pubregister = $link_subscription; $keyforbreak='pubregister'; From 97ace5e3bb738fac970f2cdcf366653cca12ea5e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Apr 2021 10:19:38 +0200 Subject: [PATCH 098/216] Look and feel v14 --- htdocs/compta/bank/list.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 9375cf8aaa1..a07fa968db1 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -535,7 +535,7 @@ foreach ($accounts as $key => $type) { // Account type if (!empty($arrayfields['accountype']['checked'])) { - print '
'; + print ''; print $objecttmp->type_lib[$objecttmp->type]; print ''; + print ''; if (!empty($conf->accounting->enabled) && !empty($objecttmp->account_number)) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch('', $objecttmp->account_number, 1); - print $accountingaccount->getNomUrl(0, 1, 1, '', 1); + print ''; + print $accountingaccount->getNomUrl(0, 1, 1, '', 0); + print ''; } else { - print $objecttmp->account_number; + print ''.$objecttmp->account_number.''; } print '
'; print ''; -print ''; +print ''; +print ''; print ''; print ''; @@ -271,13 +280,13 @@ print "\n"; print ''; -print ''; +print ''; print ''; print "
'.$langs->trans("TransferFrom").''.$langs->trans("TransferTo").''.$langs->trans("Date").''.$langs->trans("Description").''.$langs->trans("Amount").''.$langs->trans("TransferFrom").''.$langs->trans("TransferTo").''.$langs->trans("Date").''.$langs->trans("Description").''.$langs->trans("Amount").'
"; print $form->selectDate((!empty($dateo) ? $dateo : ''), '', '', '', '', 'add'); print "
"; print ''; -print '
'; +print '
'; print ""; From 86328462c76a98026d598beca6371ee1f35f4196 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Apr 2021 11:20:44 +0200 Subject: [PATCH 100/216] Enhance getURLContent --- htdocs/core/lib/geturl.lib.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 435f02f1da0..531e366de77 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -152,20 +152,31 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = $hosttocheck = $newUrlArray['host']; $hosttocheck = str_replace(array('[', ']'), '', $hosttocheck); // Remove brackets of IPv6 + // Deny some reserved host names + if (in_array($hosttocheck, array('metadata.google.internal'))) { + $info['http_code'] = 400; + $info['content'] = 'Error bad hostname (Used by Google metadata). This value for hostname is not allowed.'; + break; + } + + // Clean host name $hosttocheck to convert it into an IP $iptocheck if (in_array($hosttocheck, array('localhost', 'localhost.domain'))) { $iptocheck = '127.0.0.1'; + } elseif (in_array($hosttocheck, array('ip6-localhost', 'ip6-loopback'))) { + $iptocheck = '::1'; } else { - // TODO Resolve $iptocheck to get an IP and set CURLOPT_CONNECT_TO to use this ip + // TODO Resolve $hosttocheck to get the IP $iptocheck and set CURLOPT_CONNECT_TO to use this ip $iptocheck = $hosttocheck; } if (!filter_var($iptocheck, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) { // This is not an IP - $iptocheck = 0; // + $iptocheck = '0'; // } if ($iptocheck) { if ($localurl == 0) { // Only external url allowed (dangerous, may allow to get malware) if (!filter_var($iptocheck, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { + // Deny ips like 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 0.0.0.0/8, 169.254.0.0/16, 127.0.0.0/8 et 240.0.0.0/4, ::1/128, ::/128, ::ffff:0:0/96, fe80::/10... $info['http_code'] = 400; $info['content'] = 'Error bad hostname IP (private or reserved range). Must be an external URL.'; break; From 5dd0d05c4e4e64afd94a742fc44e451e73ddba84 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Apr 2021 12:07:11 +0200 Subject: [PATCH 101/216] Test to disable text in menu --- htdocs/core/menus/standard/eldy.lib.php | 27 +++++++++++++++---------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 575f26542e2..7e815523283 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -590,24 +590,29 @@ function print_start_menu_entry($idsel, $classname, $showmode) */ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, $atarget) { - global $langs; + global $conf, $langs; + //$conf->global->THEME_TOPMENU_DISABLE_TEXT=1; if ($showmode == 1) { print ''; print '
'; print '
'; - print ''; - print ''; - print $text; - print ''; - print ''; + if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) { + print ''; + print ''; + print $text; + print ''; + print ''; + } } elseif ($showmode == 2) { print '
'; - print ''; - print ''; - print $text; - print ''; - print ''; + if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) { + print ''; + print ''; + print $text; + print ''; + print ''; + } } } From eb3438baa74d3a3672453ea87ac086df28395a3d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Apr 2021 13:02:34 +0200 Subject: [PATCH 102/216] css --- htdocs/comm/mailing/cibles.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 336b6431281..8cdccd9fe7e 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -655,21 +655,21 @@ if ($object->fetch($id) >= 0) { print '
'; + print ''; print dol_print_date($obj->tms, 'dayhour'); print ' '; print $object::libStatutDest($obj->statut, 2, ''); print ''.$obj->date_envoi.''.$obj->date_envoi.''; print $object::libStatutDest($obj->statut, 2, $obj->error_text); From a61c1f8807ba588a82764fdd9641827e7c5b11ca Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Mon, 12 Apr 2021 14:01:36 +0200 Subject: [PATCH 103/216] checkboxes for custom masks --- .../product_batch/mod_lot_advanced.php | 10 +++ .../modules/product_batch/mod_sn_advanced.php | 10 +++ htdocs/product/admin/product_lot.php | 80 ++----------------- 3 files changed, 28 insertions(+), 72 deletions(-) diff --git a/htdocs/core/modules/product_batch/mod_lot_advanced.php b/htdocs/core/modules/product_batch/mod_lot_advanced.php index d8629b92dd6..c49a2963e3c 100644 --- a/htdocs/core/modules/product_batch/mod_lot_advanced.php +++ b/htdocs/core/modules/product_batch/mod_lot_advanced.php @@ -84,6 +84,16 @@ class mod_lot_advanced extends ModeleNumRefBatch $texte .= '  '; + if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) { + $texte .= ''.img_picto($langs->trans("Enabled"), 'on').''; + } else { + $texte .= ''.img_picto($langs->trans("Disabled"), 'off').''; + } + $texte .= ' '.$langs->trans('CustomMasks')."\n"; + $texte .= '
'; diff --git a/htdocs/core/modules/product_batch/mod_sn_advanced.php b/htdocs/core/modules/product_batch/mod_sn_advanced.php index 89d70a8239d..74f36a55fe6 100644 --- a/htdocs/core/modules/product_batch/mod_sn_advanced.php +++ b/htdocs/core/modules/product_batch/mod_sn_advanced.php @@ -84,6 +84,16 @@ class mod_sn_advanced extends ModeleNumRefBatch $texte .= '
  '; + if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) { + $texte .= ''.img_picto($langs->trans("Enabled"), 'on').''; + } else { + $texte .= ''.img_picto($langs->trans("Disabled"), 'off').''; + } + $texte .= ' '.$langs->trans('CustomMasks')."\n"; + $texte .= '
'; diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php index 874f4b9e8a9..8cafa97e077 100644 --- a/htdocs/product/admin/product_lot.php +++ b/htdocs/product/admin/product_lot.php @@ -72,12 +72,16 @@ if ($action == 'updateMaskLot') { dolibarr_set_const($db, "PRODUCTBATCH_LOT_ADDON", $value, 'chaine', 0, '', $conf->entity); } elseif ($action == 'setmodsn') { dolibarr_set_const($db, "PRODUCTBATCH_SN_ADDON", $value, 'chaine', 0, '', $conf->entity); -} -if ($action == 'setmaskslot') { +} elseif ($action == 'setmaskslot') { dolibarr_set_const($db, "PRODUCTBATCH_LOT_USE_PRODUCT_MASKS", $value, 'bool', 0, '', $conf->entity); -} -if ($action == 'setmaskssn') { + if ($value == '1' && $conf->global->PRODUCTBATCH_LOT_ADDONS !== 'mod_lot_advanced') { + dolibarr_set_const($db, "PRODUCTBATCH_LOT_ADDON", 'mod_lot_advanced', 'chaine', 0, '', $conf->entity); + } +} elseif ($action == 'setmaskssn') { dolibarr_set_const($db, "PRODUCTBATCH_SN_USE_PRODUCT_MASKS", $value, 'bool', 0, '', $conf->entity); + if ($value == '1' && $conf->global->PRODUCTBATCH_SN_ADDONS !== 'mod_sn_advanced') { + dolibarr_set_const($db, "PRODUCTBATCH_SN_ADDON", 'mod_sn_advanced', 'chaine', 0, '', $conf->entity); + } } /* @@ -182,40 +186,6 @@ foreach ($dirmodels as $reldir) { } } closedir($handle); - if ($conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') { - print 'Option'."\n"; - print $langs->trans('CustomMasks'); - print ''; - - // Show example of numbering model - print ''; - $tmp = 'NoExample'; - if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); - else print $langs->trans($tmp); - print ''."\n"; - - print ''; - if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) { - print '
'; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - } - print ''; - - // Info - $htmltooltip = $langs->trans("LotProductTooltip"); - - print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); - print ''; - - print "\n"; - } } } } @@ -308,40 +278,6 @@ foreach ($dirmodels as $reldir) { } } closedir($handle); - if ($conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced') { - print 'Option'."\n"; - print $langs->trans('CustomMasks'); - print ''; - - // Show example of numbering model - print ''; - $tmp = 'NoExample'; - if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); - else print $langs->trans($tmp); - print ''."\n"; - - print ''; - if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - } - print ''; - - // Info - $htmltooltip = $langs->trans("SNProductTooltip"); - - print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); - print ''; - - print "\n"; - } } } } From 8fa943edc3b88ce2cce75adba76a73c2580a070d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Apr 2021 14:26:09 +0200 Subject: [PATCH 104/216] Fix select field in multiselect of languages --- htdocs/comm/mailing/cibles.php | 6 ++--- htdocs/core/class/html.formadmin.class.php | 30 +++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 8cdccd9fe7e..ac21db8cff8 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -104,9 +104,9 @@ if ($action == 'add') { } if ($result > 0) { setEventMessages($langs->trans("XTargetsAdded", $result), null, 'mesgs'); - - header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); - exit; + //header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + //exit; + $action = ''; } if ($result == 0) { setEventMessages($langs->trans("WarningNoEMailsAdded"), null, 'warnings'); diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 7f83b5f1bac..411b45e03a7 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -47,20 +47,20 @@ class FormAdmin /** * Return html select list with available languages (key='en_US', value='United States' for example) * - * @param string $selected Language pre-selected - * @param string $htmlname Name of HTML select - * @param int $showauto Show 'auto' choice - * @param array $filter Array of keys to exclude in list (opposite of $onlykeys) - * @param string $showempty '1'=Add empty value or 'string to show' - * @param int $showwarning Show a warning if language is not complete - * @param int $disabled Disable edit of select - * @param string $morecss Add more css styles - * @param int $showcode 1=Add language code into label at begining, 2=Add language code into label at end - * @param int $forcecombo Force to use combo box (so no ajax beautify effect) - * @param int $multiselect Make the combo a multiselect - * @param array $onlykeys Array of language keys to restrict list with the following keys (opposite of $filter). Example array('fr', 'es', ...) - * @param int $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...) - * @return string Return HTML select string with list of languages + * @param string|array $selected Language pre-selected. Can be an array if $multiselect is 1. + * @param string $htmlname Name of HTML select + * @param int $showauto Show 'auto' choice + * @param array $filter Array of keys to exclude in list (opposite of $onlykeys) + * @param string $showempty '1'=Add empty value or 'string to show' + * @param int $showwarning Show a warning if language is not complete + * @param int $disabled Disable edit of select + * @param string $morecss Add more css styles + * @param int $showcode 1=Add language code into label at begining, 2=Add language code into label at end + * @param int $forcecombo Force to use combo box (so no ajax beautify effect) + * @param int $multiselect Make the combo a multiselect + * @param array $onlykeys Array of language keys to restrict list with the following keys (opposite of $filter). Example array('fr', 'es', ...) + * @param int $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...) + * @return string Return HTML select string with list of languages */ public function select_language($selected = '', $htmlname = 'lang_id', $showauto = 0, $filter = null, $showempty = '', $showwarning = 0, $disabled = 0, $morecss = '', $showcode = 0, $forcecombo = 0, $multiselect = 0, $onlykeys = null, $mainlangonly = 0) { @@ -129,7 +129,7 @@ class FormAdmin } $valuetoshow = picto_from_langcode($key, 'class="saturatemedium"').' '.$valuetoshow; - if ((string) $selected == (string) $keytouse) { + if ((is_string($selected) && (string) $selected == (string) $keytouse) || (is_array($selected) && in_array($keytouse, $selected))) { $out .= ''; } else { $out .= ''; From ab39cfdf09012ceb87fa77784b9c892e89f8c94c Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Mon, 12 Apr 2021 14:32:05 +0200 Subject: [PATCH 105/216] oops, better if we test the right const --- htdocs/core/modules/product_batch/mod_lot_advanced.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/product_batch/mod_lot_advanced.php b/htdocs/core/modules/product_batch/mod_lot_advanced.php index c49a2963e3c..c580d8915c9 100644 --- a/htdocs/core/modules/product_batch/mod_lot_advanced.php +++ b/htdocs/core/modules/product_batch/mod_lot_advanced.php @@ -86,7 +86,7 @@ class mod_lot_advanced extends ModeleNumRefBatch // Option to enable custom masks per product $texte .= ''; - if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) { + if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) { $texte .= ''.img_picto($langs->trans("Enabled"), 'on').''; } else { $texte .= ''.img_picto($langs->trans("Disabled"), 'off').''; From aff07ac13cc635164999bf9b134b3ea11fdb0d62 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 12 Apr 2021 14:43:28 +0200 Subject: [PATCH 106/216] FIX : UPDATE query must not use alias for postgres compatibility --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index f2ae6c7d173..9760505ac71 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -269,8 +269,8 @@ ALTER TABLE llx_payment_salary CHANGE COLUMN fk_user fk_user integer NULL; ALTER TABLE llx_payment_salary ADD COLUMN fk_salary integer; INSERT INTO llx_salary (rowid, ref, fk_user, amount, fk_projet, fk_typepayment, label, datesp, dateep, entity, note, fk_bank, paye) SELECT ps.rowid, ps.rowid, ps.fk_user, ps.amount, ps.fk_projet, ps.fk_typepayment, ps.label, ps.datesp, ps.dateep, ps.entity, ps.note, ps.fk_bank, 1 FROM llx_payment_salary ps WHERE ps.fk_salary IS NULL; -UPDATE llx_payment_salary as ps SET ps.fk_salary = ps.rowid WHERE ps.fk_salary IS NULL; -UPDATE llx_payment_salary as ps SET ps.ref = ps.rowid WHERE ps.ref IS NULL; +UPDATE llx_payment_salary SET fk_salary = rowid WHERE fk_salary IS NULL; +UPDATE llx_payment_salary SET ref = rowid WHERE ref IS NULL; ALTER TABLE llx_salary CHANGE paye paye smallint default 0 NOT NULL; From 81487d76b2b0611904251b8ab5c489b5a0ccc526 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Apr 2021 15:37:26 +0200 Subject: [PATCH 107/216] Clean code of ol deprecated option --- htdocs/adherents/index.php | 36 ++------------------ htdocs/comm/index.php | 53 ------------------------------ htdocs/comm/mailing/index.php | 2 +- htdocs/comm/propal/index.php | 24 +------------- htdocs/commande/index.php | 19 ++++------- htdocs/contrat/index.php | 24 -------------- htdocs/don/index.php | 2 +- htdocs/expedition/index.php | 12 ------- htdocs/fichinter/index.php | 14 -------- htdocs/fourn/commande/index.php | 13 -------- htdocs/product/index.php | 3 +- htdocs/product/stock/index.php | 2 +- htdocs/projet/activity/index.php | 34 +------------------ htdocs/projet/index.php | 33 ------------------- htdocs/reception/index.php | 2 +- htdocs/supplier_proposal/index.php | 16 --------- 16 files changed, 16 insertions(+), 273 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 0340af431f7..998736e137f 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -155,42 +155,10 @@ if ($result) { $db->free(); } -$searchbox = ''; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - // Search contact/address - if (!empty($conf->adherent->enabled) && $user->rights->adherent->lire) { - $listofsearchfields['search_member'] = array('text'=>'Member'); - } - - if (count($listofsearchfields)) { - $searchbox .='
'; - $searchbox .=''; - $searchbox .='
'; - $searchbox .=''; - $i = 0; - foreach ($listofsearchfields as $key => $value) { - if ($i == 0) { - $searchbox .=''; - } - $searchbox .=''; - $searchbox .=''; - if ($i == 0) { - $searchbox .=''; - } - $searchbox .=''; - $i++; - } - $searchbox .='
'.$langs->trans("Search").'
:
'; - $searchbox .='
'; - $searchbox .='
'; - $searchbox .='
'; - } -} - - /* * Statistics */ + $boxgraph = ''; if ($conf->use_javascript_ajax) { $boxgraph .='
'; @@ -258,7 +226,7 @@ print '
'; print '
'; print '
'; -print $searchbox; + print $boxgraph; print $resultboxes['boxlista']; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 14cf54c8cdc..a3826fa7dcd 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -100,59 +100,6 @@ print load_fiche_titre($langs->trans("CommercialArea"), '', 'commercial'); print '
'; -// This is useless due to the global search combo -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { - // Search proposal - if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { - $listofsearchfields['search_proposal'] = array('text'=>'Proposal'); - } - // Search customer order - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { - $listofsearchfields['search_customer_order'] = array('text'=>'CustomerOrder'); - } - // Search supplier proposal - if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) { - $listofsearchfields['search_supplier_proposal'] = array('text'=>'SupplierProposalShort'); - } - // Search supplier order - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) { - $listofsearchfields['search_supplier_order'] = array('text'=>'SupplierOrder'); - } - // Search intervention - if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) { - $listofsearchfields['search_intervention'] = array('text'=>'Intervention'); - } - // Search contract - if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { - $listofsearchfields['search_contract'] = array('text'=>'Contract'); - } - - if (count($listofsearchfields)) { - print '
'; - print ''; - print '
'; - print ''; - $i = 0; - foreach ($listofsearchfields as $key => $value) { - if ($i == 0) { - print ''; - } - print ''; - print ''; - if ($i == 0) { - print ''; - } - print ''; - $i++; - } - print '
'.$langs->trans("Search").'
'; - print '
'; - print '
'; - print '
'; - } -} - - /* * Draft customer proposals */ diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index a5052786679..026acfc43b8 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -57,7 +57,7 @@ print '
'; //if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo //{ - // Recherche emails + // Search into emailings print '
'; print ''; print '
'; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index a47ae365635..445fd9b5773 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -65,32 +65,10 @@ print load_fiche_titre($langs->trans("ProspectionArea"), '', 'propal'); print '
'; print '
'; -// This is useless due to the global search combo -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { - print ''; - print '
'; - print ''; - print ''; - - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - - print '
'.$langs->trans("Search").'
'.$langs->trans("Proposal").':
'; - print '
'; - print ''; - print '
'; -} - /* * Statistics */ + $listofstatus = array(Propal::STATUS_DRAFT, Propal::STATUS_VALIDATED, Propal::STATUS_SIGNED, Propal::STATUS_NOTSIGNED, Propal::STATUS_BILLED); $sql = "SELECT count(p.rowid) as nb, p.fk_statut as status"; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index ecbffa75028..dc15b85525c 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -50,6 +50,12 @@ if ($user->socid > 0) { $socid = $user->socid; } +$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; + +// Maximum elements of the tables +$maxDraftCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; +$maxLatestEditCount = 5; +$maxOpenCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; /* @@ -70,19 +76,6 @@ print load_fiche_titre($langs->trans("OrdersArea"), '', 'order'); print '
'; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - // Search customer orders - print '
'; - print ''; - print '
'; - print ''; - print ''; - print ''; - print "
'.$langs->trans("Search").'
'; - print $langs->trans("CustomerOrder").':

\n"; -} - - /* * Statistics */ diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 46a89209996..8ab94ca6793 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -75,29 +75,9 @@ llxHeader(); print load_fiche_titre($langs->trans("ContractsArea"), '', 'contract'); -//print ''; -//print '\n"; } } -//if ($totalinprocess != $total) -//print ''; print ''; print "
'; print '
'; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - // Search contract - if (!empty($conf->contrat->enabled)) { - print '
'; - print ''; - - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print "
'.$langs->trans("Search").'
'.$langs->trans("Contract").':
\n"; - print "
"; - } -} - - /* * Statistics */ @@ -250,8 +230,6 @@ foreach ($listofstatus as $status) { print "
'.$langs->trans("Total").' ('.$langs->trans("ServicesRunning").')'.$totalinprocess.'
'.$langs->trans("Total").''.$total.'

"; @@ -320,7 +298,6 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { } -//print ''; print '
'; @@ -645,7 +622,6 @@ if ($resql) { } -//print ''; print '
'; $parameters = array('user' => $user); diff --git a/htdocs/don/index.php b/htdocs/don/index.php index dfdeb76f2a9..2a314068830 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -89,7 +89,7 @@ print load_fiche_titre($langs->trans("DonationsArea"), '', 'object_donation'); print '
'; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo +if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // TODO Add a search into global search combo so we can remove this if (!empty($conf->don->enabled) && $user->rights->don->lire) { $listofsearchfields['search_donation'] = array('text'=>'Donation'); } diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 5ea3b923e91..defd1ddf9b4 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -53,18 +53,6 @@ print load_fiche_titre($langs->trans("SendingsArea"), '', 'dolly'); print '
'; - -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - print '
'; - print ''; - print '
'; - print ''; - print ''; - print ''; - print "
'.$langs->trans("Search").'
'; - print $langs->trans("Shipment").':

\n"; -} - /* * Shipments to validate */ diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 52bde29e660..2d69046b4ba 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -67,20 +67,6 @@ print load_fiche_titre($langs->trans("InterventionsArea"), '', 'intervention'); print '
'; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - // Search ficheinter - $var = false; - print '
'; - print ''; - print '
'; - print ''; - print ''; - print ''; - print "
'.$langs->trans("Search").'
'; - print $langs->trans("Intervention").':

\n"; -} - - /* * Statistics */ diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 9164a223d04..e8365261e1a 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -60,19 +60,6 @@ print load_fiche_titre($langs->trans("SuppliersOrdersArea"), '', 'supplier_order print '
'; - -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - print '
'; - print ''; - print '
'; - print ''; - print ''; - print ''; - print "
'.$langs->trans("Search").'
'; - print $langs->trans("SupplierOrder").':

\n"; -} - - /* * Statistics */ diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 7d5f59c1ed9..e2cb4799965 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -88,7 +88,8 @@ print load_fiche_titre($transAreaType, $linkback, 'product'); print '
'; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo +if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be + is useless due to the global search combo // Search contract if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($user->rights->produit->lire || $user->rights->service->lire)) { $listofsearchfields['search_product'] = array('text'=>'ProductOrService'); diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index ff2c99c0b09..b64068df48b 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -60,7 +60,7 @@ print load_fiche_titre($langs->trans("StocksArea"), '', 'stock'); print '
'; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo +if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be useless due to the global search combo print '
'; print ''; print '
'; diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index fe2188de904..0191cc74ef8 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -108,40 +108,8 @@ print_barre_liste($form->textwithpicto($title, $tooltiphelp), 0, $_SERVER["PHP_S print '
'; +/* Show list of project today */ -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - // Search project - if (!empty($conf->projet->enabled) && $user->rights->projet->lire) { - $listofsearchfields['search_task'] = array('text'=>'Task'); - } - - if (count($listofsearchfields)) { - print ''; - print ''; - print '
'; - print ''; - $i = 0; - foreach ($listofsearchfields as $key => $value) { - if ($i == 0) { - print ''; - } - print ''; - print ''; - if ($i == 0) { - print ''; - } - print ''; - $i++; - } - print '
'.$langs->trans("Search").'
'; - print '
'; - print ''; - print '
'; - } -} - - -/* Affichage de la liste des projets d'aujourd'hui */ print '
'; print ''; print ''; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index f42a0553893..c464cf1694b 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -182,39 +182,6 @@ if ($resql) { print '
'; - -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - // Search project - if (!empty($conf->projet->enabled) && $user->rights->projet->lire) { - $listofsearchfields['search_project'] = array('text'=>'Project'); - } - - if (count($listofsearchfields)) { - print '
'; - print ''; - print '
'; - print '
'; - $i = 0; - foreach ($listofsearchfields as $key => $value) { - if ($i == 0) { - print ''; - } - print ''; - print ''; - if ($i == 0) { - print ''; - } - print ''; - $i++; - } - print '
'.$langs->trans("Search").'
'; - print '
'; - print ''; - print '
'; - } -} - - /* * Statistics */ diff --git a/htdocs/reception/index.php b/htdocs/reception/index.php index a54eea592c0..9eadc3be41a 100644 --- a/htdocs/reception/index.php +++ b/htdocs/reception/index.php @@ -61,7 +61,7 @@ print load_fiche_titre($langs->trans("ReceptionsArea"), '', 'dollyrevert'); print '
'; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo +if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be useless due to the global search combo print '
'; print ''; print '
'; diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index 9a7b6fcbb95..0cfdc5a09b6 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -61,22 +61,6 @@ print load_fiche_titre($langs->trans("SupplierProposalArea"), '', 'supplier_prop print '
'; - -// Search form - -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - print ''; - print ''; - print '
'; - print ''; - print ''; - print ''; - print ''; - print "
'.$langs->trans("Search").'
'; - print $langs->trans("SupplierProposal").':

\n"; -} - - // Statistics $sql = "SELECT count(p.rowid), p.fk_statut"; From 61c7c64d1906aa53e69c83bff4845160258907bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Apr 2021 15:39:55 +0200 Subject: [PATCH 108/216] Removed useless files --- scripts/index.html | 1 - scripts/members/index.html | 1 - 2 files changed, 2 deletions(-) delete mode 100644 scripts/index.html delete mode 100644 scripts/members/index.html diff --git a/scripts/index.html b/scripts/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/scripts/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/scripts/members/index.html b/scripts/members/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/scripts/members/index.html +++ /dev/null @@ -1 +0,0 @@ - From 8a62d97b892a7d55f648828523d91095d487caea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Apr 2021 15:57:16 +0200 Subject: [PATCH 109/216] Remove one thousand of useless files --- htdocs/accountancy/admin/index.html | 0 htdocs/accountancy/bookkeeping/index.html | 0 htdocs/accountancy/class/index.html | 0 htdocs/accountancy/closure/index.html | 0 htdocs/accountancy/journal/index.html | 0 htdocs/accountancy/tpl/index.html | 0 htdocs/adherents/admin/index.html | 0 htdocs/adherents/canvas/default/index.html | 0 htdocs/adherents/canvas/default/tpl/index.html | 0 htdocs/adherents/canvas/index.html | 0 htdocs/adherents/cartes/index.html | 0 htdocs/adherents/class/index.html | 0 htdocs/adherents/stats/index.html | 0 htdocs/adherents/subscription/index.html | 0 htdocs/adherents/tpl/index.html | 0 htdocs/admin/dolistore/ajax/index.html | 1 - htdocs/admin/dolistore/class/index.html | 1 - htdocs/admin/dolistore/index.html | 1 - htdocs/api/class/index.html | 1 - htdocs/asset/admin/index.html | 1 - htdocs/asset/class/index.html | 1 - htdocs/asset/index.html | 1 - htdocs/asterisk/index.html | 0 htdocs/barcode/index.html | 0 htdocs/blockedlog/admin/index.html | 0 htdocs/blockedlog/ajax/index.html | 0 htdocs/blockedlog/class/index.html | 0 htdocs/blockedlog/index.html | 0 htdocs/blockedlog/lib/index.html | 0 htdocs/bom/class/index.html | 0 htdocs/bom/index.html | 0 htdocs/bom/lib/index.html | 0 htdocs/bom/tpl/index.html | 1 - htdocs/bookmarks/admin/index.html | 0 htdocs/bookmarks/class/index.html | 0 htdocs/bookmarks/index.html | 0 htdocs/cashdesk/admin/index.html | 0 htdocs/cashdesk/class/index.html | 0 htdocs/cashdesk/css/index.html | 0 htdocs/cashdesk/img/index.html | 0 htdocs/cashdesk/include/index.html | 0 htdocs/cashdesk/javascript/index.html | 0 htdocs/cashdesk/tpl/index.html | 0 htdocs/categories/admin/index.html | 0 htdocs/categories/class/index.html | 0 htdocs/comm/action/class/index.html | 0 htdocs/comm/admin/index.html | 0 htdocs/comm/mailing/class/index.html | 0 htdocs/comm/propal/class/index.html | 0 htdocs/comm/propal/tpl/index.html | 0 htdocs/commande/class/index.html | 0 htdocs/commande/tpl/index.html | 0 htdocs/compta/bank/class/index.html | 0 htdocs/compta/bank/index.html | 1 - htdocs/compta/bank/various_payment/index.html | 1 - htdocs/compta/cashcontrol/class/index.html | 1 - htdocs/compta/cashcontrol/index.html | 1 - htdocs/compta/deplacement/class/index.html | 0 htdocs/compta/facture/admin/index.html | 0 htdocs/compta/facture/class/index.html | 0 htdocs/compta/facture/index.html | 0 htdocs/compta/facture/tpl/index.html | 0 htdocs/compta/journal/index.html | 0 htdocs/compta/localtax/class/index.html | 0 htdocs/compta/paiement/cheque/class/index.html | 0 htdocs/compta/paiement/class/index.html | 0 htdocs/compta/payment_sc/index.html | 0 htdocs/compta/payment_vat/index.html | 1 - htdocs/compta/prelevement/class/index.html | 0 htdocs/compta/sociales/class/index.html | 0 htdocs/compta/sociales/index.html | 1 - htdocs/compta/tva/class/index.html | 0 htdocs/conf/index.html | 0 htdocs/contact/canvas/default/index.html | 0 htdocs/contact/canvas/default/tpl/index.html | 0 htdocs/contact/canvas/index.html | 0 htdocs/contact/class/index.html | 0 htdocs/contact/index.html | 0 htdocs/contrat/admin/index.html | 0 htdocs/contrat/class/index.html | 0 htdocs/contrat/tpl/index.html | 0 htdocs/core/ajax/index.html | 0 htdocs/core/boxes/index.html | 0 htdocs/core/class/index.html | 0 htdocs/core/data/index.html | 1 - htdocs/core/db/index.html | 0 .../filemanagerdol/browser/default/images/icons/32/index.html | 0 .../core/filemanagerdol/browser/default/images/icons/index.html | 0 htdocs/core/filemanagerdol/browser/default/images/index.html | 0 htdocs/core/filemanagerdol/browser/default/index.html | 0 htdocs/core/filemanagerdol/browser/default/js/index.html | 0 htdocs/core/filemanagerdol/browser/index.html | 0 htdocs/core/filemanagerdol/connectors/index.html | 0 htdocs/core/filemanagerdol/connectors/php/index.html | 0 htdocs/core/filemanagerdol/index.html | 0 htdocs/core/index.html | 0 htdocs/core/js/index.html | 0 htdocs/core/lib/index.html | 0 htdocs/core/login/index.html | 0 htdocs/core/menus/index.html | 0 htdocs/core/menus/standard/index.html | 0 htdocs/core/modules/action/index.html | 0 htdocs/core/modules/bank/doc/index.html | 1 - htdocs/core/modules/bank/index.html | 1 - htdocs/core/modules/barcode/doc/index.html | 0 htdocs/core/modules/barcode/index.html | 0 htdocs/core/modules/bom/doc/index.html | 1 - htdocs/core/modules/bom/index.html | 1 - htdocs/core/modules/cheque/doc/index.html | 0 htdocs/core/modules/cheque/index.html | 0 htdocs/core/modules/commande/doc/index.html | 0 htdocs/core/modules/commande/index.html | 0 htdocs/core/modules/contract/doc/index.html | 0 htdocs/core/modules/contract/index.html | 0 htdocs/core/modules/delivery/doc/index.html | 0 htdocs/core/modules/delivery/index.html | 0 htdocs/core/modules/dons/index.html | 0 htdocs/core/modules/expedition/doc/index.html | 0 htdocs/core/modules/expedition/index.html | 0 htdocs/core/modules/expensereport/doc/index.html | 1 - htdocs/core/modules/expensereport/index.html | 0 htdocs/core/modules/export/index.html | 0 htdocs/core/modules/facture/doc/index.html | 0 htdocs/core/modules/facture/index.html | 0 htdocs/core/modules/fichinter/doc/index.html | 0 htdocs/core/modules/fichinter/index.html | 0 htdocs/core/modules/holiday/index.html | 1 - htdocs/core/modules/import/index.html | 0 htdocs/core/modules/index.html | 0 htdocs/core/modules/mailings/index.html | 0 htdocs/core/modules/member/doc/index.html | 0 htdocs/core/modules/member/index.html | 0 htdocs/core/modules/movement/doc/index.html | 1 - htdocs/core/modules/movement/index.html | 1 - htdocs/core/modules/mrp/doc/index.html | 1 - htdocs/core/modules/mrp/index.html | 1 - htdocs/core/modules/oauth/index.html | 0 htdocs/core/modules/payment/index.html | 1 - htdocs/core/modules/printing/index.html | 0 htdocs/core/modules/printsheet/doc/index.html | 0 htdocs/core/modules/printsheet/index.html | 0 htdocs/core/modules/product/doc/index.html | 1 - htdocs/core/modules/product/index.html | 0 htdocs/core/modules/product_batch/index.html | 0 htdocs/core/modules/project/doc/index.html | 0 htdocs/core/modules/project/index.html | 0 htdocs/core/modules/project/task/doc/index.html | 0 htdocs/core/modules/project/task/index.html | 0 htdocs/core/modules/propale/doc/index.html | 0 htdocs/core/modules/propale/index.html | 0 htdocs/core/modules/rapport/index.html | 0 htdocs/core/modules/reception/doc/index.html | 0 htdocs/core/modules/reception/index.html | 0 htdocs/core/modules/security/generate/index.html | 0 htdocs/core/modules/security/index.html | 0 htdocs/core/modules/societe/doc/index.html | 0 htdocs/core/modules/societe/index.html | 0 htdocs/core/modules/stock/doc/index.html | 1 - htdocs/core/modules/stock/index.html | 1 - htdocs/core/modules/supplier_invoice/doc/index.html | 0 htdocs/core/modules/supplier_invoice/index.html | 0 htdocs/core/modules/supplier_order/doc/index.html | 0 htdocs/core/modules/supplier_order/index.html | 0 htdocs/core/modules/supplier_payment/doc/index.html | 0 htdocs/core/modules/supplier_payment/index.html | 1 - htdocs/core/modules/supplier_proposal/doc/index.html | 0 htdocs/core/modules/supplier_proposal/index.html | 0 htdocs/core/modules/syslog/index.html | 0 htdocs/core/modules/takepos/index.html | 1 - htdocs/core/modules/ticket/doc/index.html | 0 htdocs/core/modules/ticket/index.html | 1 - htdocs/core/modules/user/doc/index.html | 0 htdocs/core/modules/user/index.html | 1 - htdocs/core/modules/usergroup/doc/index.html | 1 - htdocs/core/modules/usergroup/index.html | 1 - htdocs/core/modules/workstation/index.html | 1 - htdocs/core/tpl/ajax/index.html | 0 htdocs/core/tpl/index.html | 0 htdocs/core/triggers/index.html | 0 htdocs/cron/admin/index.html | 0 htdocs/cron/class/index.html | 0 htdocs/cron/index.html | 0 htdocs/custom/index.html | 0 htdocs/datapolicy/admin/index.html | 0 htdocs/datapolicy/class/index.html | 0 htdocs/datapolicy/index.html | 0 htdocs/datapolicy/lib/index.html | 0 htdocs/dav/index.html | 1 - htdocs/debugbar/class/DataCollector/index.html | 1 - htdocs/debugbar/class/index.html | 1 - htdocs/debugbar/index.html | 0 htdocs/debugbar/js/index.html | 1 - htdocs/delivery/class/index.html | 0 htdocs/delivery/index.html | 0 htdocs/don/admin/index.html | 0 htdocs/don/class/index.html | 0 htdocs/don/index.html | 0 htdocs/don/payment/index.html | 0 htdocs/ecm/ajax/index.html | 0 htdocs/ecm/class/index.html | 0 htdocs/ecm/tpl/index.html | 0 htdocs/emailcollector/class/index.html | 1 - htdocs/emailcollector/index.html | 1 - htdocs/emailcollector/lib/index.html | 1 - htdocs/eventorganization/class/index.html | 1 - htdocs/eventorganization/index.html | 1 - htdocs/eventorganization/lib/index.html | 1 - htdocs/expedition/class/index.html | 0 htdocs/expedition/tpl/index.html | 0 htdocs/expensereport/ajax/index.html | 0 htdocs/expensereport/class/index.html | 0 htdocs/expensereport/payment/index.html | 0 htdocs/expensereport/stats/index.html | 0 htdocs/expensereport/tpl/index.html | 0 htdocs/exports/class/index.html | 0 htdocs/externalsite/index.html | 0 htdocs/fichinter/admin/index.html | 0 htdocs/fichinter/class/index.html | 0 htdocs/fichinter/tpl/index.html | 0 htdocs/fourn/ajax/index.html | 0 htdocs/fourn/class/index.html | 0 htdocs/fourn/commande/tpl/index.html | 0 htdocs/fourn/facture/index.html | 0 htdocs/fourn/facture/tpl/index.html | 0 htdocs/fourn/js/index.html | 1 - htdocs/fourn/paiement/index.html | 0 htdocs/ftp/admin/index.html | 0 htdocs/holiday/class/index.html | 0 htdocs/holiday/img/index.html | 0 htdocs/holiday/index.html | 0 htdocs/hrm/admin/index.html | 0 htdocs/hrm/class/index.html | 0 htdocs/hrm/establishment/index.html | 0 htdocs/includes/adodbtime/index.html | 0 htdocs/includes/index.html | 0 htdocs/install/mssql/functions/index.html | 0 htdocs/install/mssql/index.html | 0 htdocs/install/mysql/data/index.html | 0 htdocs/install/mysql/functions/index.html | 0 htdocs/install/mysql/index.html | 0 htdocs/install/mysql/migration/index.html | 0 htdocs/install/mysql/tables/index.html | 0 htdocs/install/pgsql/functions/index.html | 0 htdocs/install/pgsql/index.html | 0 htdocs/install/sqlite3/functions/index.html | 1 - htdocs/install/sqlite3/index.html | 0 htdocs/intracommreport/admin/index.html | 0 htdocs/intracommreport/class/index.html | 0 htdocs/intracommreport/index.html | 0 htdocs/loan/class/index.html | 0 htdocs/loan/index.html | 0 htdocs/loan/payment/index.html | 0 htdocs/mailmanspip/class/index.html | 0 htdocs/mailmanspip/index.html | 0 htdocs/margin/admin/index.html | 0 htdocs/margin/lib/index.html | 0 htdocs/margin/tabs/index.html | 0 htdocs/modulebuilder/admin/index.html | 1 - htdocs/modulebuilder/template/admin/index.html | 1 - htdocs/modulebuilder/template/class/index.html | 1 - htdocs/modulebuilder/template/index.html | 1 - htdocs/modulebuilder/template/js/index.html | 1 - htdocs/modulebuilder/template/lib/index.html | 1 - htdocs/modulebuilder/template/sql/index.html | 1 - htdocs/mrp/ajax/index.html | 1 - htdocs/mrp/class/index.html | 1 - htdocs/mrp/js/index.html | 1 - htdocs/mrp/tpl/index.html | 1 - htdocs/opensurvey/class/index.html | 0 htdocs/opensurvey/css/index.html | 0 htdocs/opensurvey/img/index.html | 0 htdocs/paybox/admin/index.html | 0 htdocs/paybox/img/index.html | 0 htdocs/paybox/index.html | 0 htdocs/paybox/lib/index.html | 0 htdocs/paypal/admin/index.html | 0 htdocs/paypal/img/index.html | 0 htdocs/paypal/index.html | 0 htdocs/paypal/lib/index.html | 0 htdocs/printing/admin/index.html | 0 htdocs/printing/lib/index.html | 0 htdocs/product/admin/index.html | 0 htdocs/product/ajax/index.html | 0 htdocs/product/canvas/index.html | 0 htdocs/product/canvas/product/index.html | 0 htdocs/product/canvas/product/tpl/index.html | 0 htdocs/product/canvas/service/index.html | 0 htdocs/product/canvas/service/tpl/index.html | 0 htdocs/product/class/index.html | 0 htdocs/product/composition/index.html | 0 htdocs/product/dynamic_price/class/index.html | 1 - htdocs/product/dynamic_price/index.html | 1 - htdocs/product/stats/index.html | 0 htdocs/product/stock/class/index.html | 0 htdocs/product/stock/img/index.html | 0 htdocs/product/stock/lib/index.html | 0 htdocs/projet/admin/index.html | 0 htdocs/projet/ajax/index.html | 1 - htdocs/projet/class/index.html | 0 htdocs/reception/class/index.html | 0 htdocs/reception/tpl/index.html | 0 htdocs/recruitment/admin/index.html | 1 - htdocs/recruitment/class/index.html | 1 - htdocs/recruitment/core/modules/recruitment/doc/index.html | 1 - htdocs/recruitment/core/modules/recruitment/index.html | 1 - htdocs/recruitment/index.html | 1 - htdocs/recruitment/lib/index.html | 1 - htdocs/resource/class/index.html | 0 htdocs/resource/index.html | 0 htdocs/salaries/admin/index.html | 1 - htdocs/salaries/class/index.html | 0 htdocs/salaries/index.html | 1 - htdocs/salaries/payment_salary/index.html | 1 - htdocs/societe/ajax/index.html | 0 htdocs/societe/canvas/company/index.html | 0 htdocs/societe/canvas/company/tpl/index.html | 0 htdocs/societe/canvas/index.html | 0 htdocs/societe/canvas/individual/index.html | 0 htdocs/societe/canvas/individual/tpl/index.html | 0 htdocs/societe/checkvat/index.html | 0 htdocs/societe/class/index.html | 0 htdocs/societe/notify/index.html | 0 htdocs/societe/tpl/index.html | 0 htdocs/stripe/admin/index.html | 0 htdocs/stripe/class/index.html | 1 - htdocs/stripe/index.html | 0 htdocs/stripe/lib/index.html | 0 htdocs/supplier_proposal/class/index.html | 0 htdocs/supplier_proposal/tpl/index.html | 0 htdocs/takepos/admin/index.html | 1 - htdocs/theme/common/devices/index.html | 0 htdocs/theme/common/emotes/index.html | 0 htdocs/theme/common/flags/index.html | 0 htdocs/theme/common/index.html | 0 htdocs/theme/common/mime/index.html | 0 htdocs/theme/common/treemenu/index.html | 0 htdocs/theme/common/weather/index.html | 0 htdocs/theme/eldy/ckeditor/index.html | 0 htdocs/theme/eldy/img/index.html | 0 htdocs/theme/eldy/index.html | 0 htdocs/theme/eldy/tpl/index.html | 0 htdocs/theme/index.html | 0 htdocs/theme/md/ckeditor/index.html | 0 htdocs/theme/md/img/index.html | 0 htdocs/theme/md/index.html | 0 htdocs/theme/md/tpl/index.html | 0 htdocs/ticket/tpl/index.html | 1 - htdocs/user/admin/index.html | 0 htdocs/user/class/index.html | 0 htdocs/user/group/index.html | 1 - htdocs/user/index.html | 1 - htdocs/user/notify/index.html | 1 - htdocs/variants/admin/index.html | 0 htdocs/variants/ajax/index.html | 0 htdocs/variants/class/index.html | 0 htdocs/variants/index.html | 0 htdocs/variants/lib/index.html | 0 htdocs/website/class/index.html | 0 htdocs/website/lib/index.html | 0 htdocs/workstation/class/index.html | 1 - htdocs/workstation/index.html | 1 - htdocs/workstation/lib/index.html | 1 - htdocs/zapier/admin/index.html | 1 - htdocs/zapier/class/index.html | 1 - htdocs/zapier/index.html | 1 - htdocs/zapier/lib/index.html | 1 - 366 files changed, 84 deletions(-) delete mode 100644 htdocs/accountancy/admin/index.html delete mode 100644 htdocs/accountancy/bookkeeping/index.html delete mode 100644 htdocs/accountancy/class/index.html delete mode 100644 htdocs/accountancy/closure/index.html delete mode 100644 htdocs/accountancy/journal/index.html delete mode 100644 htdocs/accountancy/tpl/index.html delete mode 100644 htdocs/adherents/admin/index.html delete mode 100644 htdocs/adherents/canvas/default/index.html delete mode 100644 htdocs/adherents/canvas/default/tpl/index.html delete mode 100644 htdocs/adherents/canvas/index.html delete mode 100644 htdocs/adherents/cartes/index.html delete mode 100644 htdocs/adherents/class/index.html delete mode 100644 htdocs/adherents/stats/index.html delete mode 100644 htdocs/adherents/subscription/index.html delete mode 100644 htdocs/adherents/tpl/index.html delete mode 100644 htdocs/admin/dolistore/ajax/index.html delete mode 100644 htdocs/admin/dolistore/class/index.html delete mode 100644 htdocs/admin/dolistore/index.html delete mode 100644 htdocs/api/class/index.html delete mode 100644 htdocs/asset/admin/index.html delete mode 100644 htdocs/asset/class/index.html delete mode 100644 htdocs/asset/index.html delete mode 100644 htdocs/asterisk/index.html delete mode 100644 htdocs/barcode/index.html delete mode 100644 htdocs/blockedlog/admin/index.html delete mode 100644 htdocs/blockedlog/ajax/index.html delete mode 100644 htdocs/blockedlog/class/index.html delete mode 100644 htdocs/blockedlog/index.html delete mode 100644 htdocs/blockedlog/lib/index.html delete mode 100644 htdocs/bom/class/index.html delete mode 100644 htdocs/bom/index.html delete mode 100644 htdocs/bom/lib/index.html delete mode 100644 htdocs/bom/tpl/index.html delete mode 100644 htdocs/bookmarks/admin/index.html delete mode 100644 htdocs/bookmarks/class/index.html delete mode 100644 htdocs/bookmarks/index.html delete mode 100644 htdocs/cashdesk/admin/index.html delete mode 100644 htdocs/cashdesk/class/index.html delete mode 100644 htdocs/cashdesk/css/index.html delete mode 100644 htdocs/cashdesk/img/index.html delete mode 100644 htdocs/cashdesk/include/index.html delete mode 100644 htdocs/cashdesk/javascript/index.html delete mode 100644 htdocs/cashdesk/tpl/index.html delete mode 100644 htdocs/categories/admin/index.html delete mode 100644 htdocs/categories/class/index.html delete mode 100644 htdocs/comm/action/class/index.html delete mode 100644 htdocs/comm/admin/index.html delete mode 100644 htdocs/comm/mailing/class/index.html delete mode 100644 htdocs/comm/propal/class/index.html delete mode 100644 htdocs/comm/propal/tpl/index.html delete mode 100644 htdocs/commande/class/index.html delete mode 100644 htdocs/commande/tpl/index.html delete mode 100644 htdocs/compta/bank/class/index.html delete mode 100644 htdocs/compta/bank/index.html delete mode 100644 htdocs/compta/bank/various_payment/index.html delete mode 100644 htdocs/compta/cashcontrol/class/index.html delete mode 100644 htdocs/compta/cashcontrol/index.html delete mode 100644 htdocs/compta/deplacement/class/index.html delete mode 100644 htdocs/compta/facture/admin/index.html delete mode 100644 htdocs/compta/facture/class/index.html delete mode 100644 htdocs/compta/facture/index.html delete mode 100644 htdocs/compta/facture/tpl/index.html delete mode 100644 htdocs/compta/journal/index.html delete mode 100644 htdocs/compta/localtax/class/index.html delete mode 100644 htdocs/compta/paiement/cheque/class/index.html delete mode 100644 htdocs/compta/paiement/class/index.html delete mode 100644 htdocs/compta/payment_sc/index.html delete mode 100644 htdocs/compta/payment_vat/index.html delete mode 100644 htdocs/compta/prelevement/class/index.html delete mode 100644 htdocs/compta/sociales/class/index.html delete mode 100644 htdocs/compta/sociales/index.html delete mode 100644 htdocs/compta/tva/class/index.html delete mode 100644 htdocs/conf/index.html delete mode 100644 htdocs/contact/canvas/default/index.html delete mode 100644 htdocs/contact/canvas/default/tpl/index.html delete mode 100644 htdocs/contact/canvas/index.html delete mode 100644 htdocs/contact/class/index.html delete mode 100644 htdocs/contact/index.html delete mode 100644 htdocs/contrat/admin/index.html delete mode 100644 htdocs/contrat/class/index.html delete mode 100644 htdocs/contrat/tpl/index.html delete mode 100644 htdocs/core/ajax/index.html delete mode 100644 htdocs/core/boxes/index.html delete mode 100644 htdocs/core/class/index.html delete mode 100644 htdocs/core/data/index.html delete mode 100644 htdocs/core/db/index.html delete mode 100644 htdocs/core/filemanagerdol/browser/default/images/icons/32/index.html delete mode 100644 htdocs/core/filemanagerdol/browser/default/images/icons/index.html delete mode 100644 htdocs/core/filemanagerdol/browser/default/images/index.html delete mode 100644 htdocs/core/filemanagerdol/browser/default/index.html delete mode 100644 htdocs/core/filemanagerdol/browser/default/js/index.html delete mode 100644 htdocs/core/filemanagerdol/browser/index.html delete mode 100644 htdocs/core/filemanagerdol/connectors/index.html delete mode 100644 htdocs/core/filemanagerdol/connectors/php/index.html delete mode 100644 htdocs/core/filemanagerdol/index.html delete mode 100644 htdocs/core/index.html delete mode 100644 htdocs/core/js/index.html delete mode 100644 htdocs/core/lib/index.html delete mode 100644 htdocs/core/login/index.html delete mode 100644 htdocs/core/menus/index.html delete mode 100644 htdocs/core/menus/standard/index.html delete mode 100644 htdocs/core/modules/action/index.html delete mode 100644 htdocs/core/modules/bank/doc/index.html delete mode 100644 htdocs/core/modules/bank/index.html delete mode 100644 htdocs/core/modules/barcode/doc/index.html delete mode 100644 htdocs/core/modules/barcode/index.html delete mode 100644 htdocs/core/modules/bom/doc/index.html delete mode 100644 htdocs/core/modules/bom/index.html delete mode 100644 htdocs/core/modules/cheque/doc/index.html delete mode 100644 htdocs/core/modules/cheque/index.html delete mode 100644 htdocs/core/modules/commande/doc/index.html delete mode 100644 htdocs/core/modules/commande/index.html delete mode 100644 htdocs/core/modules/contract/doc/index.html delete mode 100644 htdocs/core/modules/contract/index.html delete mode 100644 htdocs/core/modules/delivery/doc/index.html delete mode 100644 htdocs/core/modules/delivery/index.html delete mode 100644 htdocs/core/modules/dons/index.html delete mode 100644 htdocs/core/modules/expedition/doc/index.html delete mode 100644 htdocs/core/modules/expedition/index.html delete mode 100644 htdocs/core/modules/expensereport/doc/index.html delete mode 100644 htdocs/core/modules/expensereport/index.html delete mode 100644 htdocs/core/modules/export/index.html delete mode 100644 htdocs/core/modules/facture/doc/index.html delete mode 100644 htdocs/core/modules/facture/index.html delete mode 100644 htdocs/core/modules/fichinter/doc/index.html delete mode 100644 htdocs/core/modules/fichinter/index.html delete mode 100644 htdocs/core/modules/holiday/index.html delete mode 100644 htdocs/core/modules/import/index.html delete mode 100644 htdocs/core/modules/index.html delete mode 100644 htdocs/core/modules/mailings/index.html delete mode 100644 htdocs/core/modules/member/doc/index.html delete mode 100644 htdocs/core/modules/member/index.html delete mode 100644 htdocs/core/modules/movement/doc/index.html delete mode 100644 htdocs/core/modules/movement/index.html delete mode 100644 htdocs/core/modules/mrp/doc/index.html delete mode 100644 htdocs/core/modules/mrp/index.html delete mode 100644 htdocs/core/modules/oauth/index.html delete mode 100644 htdocs/core/modules/payment/index.html delete mode 100644 htdocs/core/modules/printing/index.html delete mode 100644 htdocs/core/modules/printsheet/doc/index.html delete mode 100644 htdocs/core/modules/printsheet/index.html delete mode 100644 htdocs/core/modules/product/doc/index.html delete mode 100644 htdocs/core/modules/product/index.html delete mode 100644 htdocs/core/modules/product_batch/index.html delete mode 100644 htdocs/core/modules/project/doc/index.html delete mode 100644 htdocs/core/modules/project/index.html delete mode 100644 htdocs/core/modules/project/task/doc/index.html delete mode 100644 htdocs/core/modules/project/task/index.html delete mode 100644 htdocs/core/modules/propale/doc/index.html delete mode 100644 htdocs/core/modules/propale/index.html delete mode 100644 htdocs/core/modules/rapport/index.html delete mode 100644 htdocs/core/modules/reception/doc/index.html delete mode 100644 htdocs/core/modules/reception/index.html delete mode 100644 htdocs/core/modules/security/generate/index.html delete mode 100644 htdocs/core/modules/security/index.html delete mode 100644 htdocs/core/modules/societe/doc/index.html delete mode 100644 htdocs/core/modules/societe/index.html delete mode 100644 htdocs/core/modules/stock/doc/index.html delete mode 100644 htdocs/core/modules/stock/index.html delete mode 100644 htdocs/core/modules/supplier_invoice/doc/index.html delete mode 100644 htdocs/core/modules/supplier_invoice/index.html delete mode 100644 htdocs/core/modules/supplier_order/doc/index.html delete mode 100644 htdocs/core/modules/supplier_order/index.html delete mode 100644 htdocs/core/modules/supplier_payment/doc/index.html delete mode 100644 htdocs/core/modules/supplier_payment/index.html delete mode 100644 htdocs/core/modules/supplier_proposal/doc/index.html delete mode 100644 htdocs/core/modules/supplier_proposal/index.html delete mode 100644 htdocs/core/modules/syslog/index.html delete mode 100644 htdocs/core/modules/takepos/index.html delete mode 100644 htdocs/core/modules/ticket/doc/index.html delete mode 100644 htdocs/core/modules/ticket/index.html delete mode 100644 htdocs/core/modules/user/doc/index.html delete mode 100644 htdocs/core/modules/user/index.html delete mode 100644 htdocs/core/modules/usergroup/doc/index.html delete mode 100644 htdocs/core/modules/usergroup/index.html delete mode 100644 htdocs/core/modules/workstation/index.html delete mode 100644 htdocs/core/tpl/ajax/index.html delete mode 100644 htdocs/core/tpl/index.html delete mode 100644 htdocs/core/triggers/index.html delete mode 100644 htdocs/cron/admin/index.html delete mode 100644 htdocs/cron/class/index.html delete mode 100644 htdocs/cron/index.html delete mode 100644 htdocs/custom/index.html delete mode 100644 htdocs/datapolicy/admin/index.html delete mode 100644 htdocs/datapolicy/class/index.html delete mode 100644 htdocs/datapolicy/index.html delete mode 100644 htdocs/datapolicy/lib/index.html delete mode 100644 htdocs/dav/index.html delete mode 100644 htdocs/debugbar/class/DataCollector/index.html delete mode 100644 htdocs/debugbar/class/index.html delete mode 100644 htdocs/debugbar/index.html delete mode 100644 htdocs/debugbar/js/index.html delete mode 100644 htdocs/delivery/class/index.html delete mode 100644 htdocs/delivery/index.html delete mode 100644 htdocs/don/admin/index.html delete mode 100644 htdocs/don/class/index.html delete mode 100644 htdocs/don/index.html delete mode 100644 htdocs/don/payment/index.html delete mode 100644 htdocs/ecm/ajax/index.html delete mode 100644 htdocs/ecm/class/index.html delete mode 100644 htdocs/ecm/tpl/index.html delete mode 100644 htdocs/emailcollector/class/index.html delete mode 100644 htdocs/emailcollector/index.html delete mode 100644 htdocs/emailcollector/lib/index.html delete mode 100644 htdocs/eventorganization/class/index.html delete mode 100644 htdocs/eventorganization/index.html delete mode 100644 htdocs/eventorganization/lib/index.html delete mode 100644 htdocs/expedition/class/index.html delete mode 100644 htdocs/expedition/tpl/index.html delete mode 100644 htdocs/expensereport/ajax/index.html delete mode 100644 htdocs/expensereport/class/index.html delete mode 100644 htdocs/expensereport/payment/index.html delete mode 100644 htdocs/expensereport/stats/index.html delete mode 100644 htdocs/expensereport/tpl/index.html delete mode 100644 htdocs/exports/class/index.html delete mode 100644 htdocs/externalsite/index.html delete mode 100644 htdocs/fichinter/admin/index.html delete mode 100644 htdocs/fichinter/class/index.html delete mode 100644 htdocs/fichinter/tpl/index.html delete mode 100644 htdocs/fourn/ajax/index.html delete mode 100644 htdocs/fourn/class/index.html delete mode 100644 htdocs/fourn/commande/tpl/index.html delete mode 100644 htdocs/fourn/facture/index.html delete mode 100644 htdocs/fourn/facture/tpl/index.html delete mode 100644 htdocs/fourn/js/index.html delete mode 100644 htdocs/fourn/paiement/index.html delete mode 100644 htdocs/ftp/admin/index.html delete mode 100644 htdocs/holiday/class/index.html delete mode 100644 htdocs/holiday/img/index.html delete mode 100644 htdocs/holiday/index.html delete mode 100644 htdocs/hrm/admin/index.html delete mode 100644 htdocs/hrm/class/index.html delete mode 100644 htdocs/hrm/establishment/index.html delete mode 100644 htdocs/includes/adodbtime/index.html delete mode 100644 htdocs/includes/index.html delete mode 100644 htdocs/install/mssql/functions/index.html delete mode 100644 htdocs/install/mssql/index.html delete mode 100644 htdocs/install/mysql/data/index.html delete mode 100644 htdocs/install/mysql/functions/index.html delete mode 100644 htdocs/install/mysql/index.html delete mode 100644 htdocs/install/mysql/migration/index.html delete mode 100644 htdocs/install/mysql/tables/index.html delete mode 100644 htdocs/install/pgsql/functions/index.html delete mode 100644 htdocs/install/pgsql/index.html delete mode 100644 htdocs/install/sqlite3/functions/index.html delete mode 100644 htdocs/install/sqlite3/index.html delete mode 100644 htdocs/intracommreport/admin/index.html delete mode 100644 htdocs/intracommreport/class/index.html delete mode 100644 htdocs/intracommreport/index.html delete mode 100644 htdocs/loan/class/index.html delete mode 100644 htdocs/loan/index.html delete mode 100644 htdocs/loan/payment/index.html delete mode 100644 htdocs/mailmanspip/class/index.html delete mode 100644 htdocs/mailmanspip/index.html delete mode 100644 htdocs/margin/admin/index.html delete mode 100644 htdocs/margin/lib/index.html delete mode 100644 htdocs/margin/tabs/index.html delete mode 100644 htdocs/modulebuilder/admin/index.html delete mode 100644 htdocs/modulebuilder/template/admin/index.html delete mode 100644 htdocs/modulebuilder/template/class/index.html delete mode 100644 htdocs/modulebuilder/template/index.html delete mode 100644 htdocs/modulebuilder/template/js/index.html delete mode 100644 htdocs/modulebuilder/template/lib/index.html delete mode 100644 htdocs/modulebuilder/template/sql/index.html delete mode 100644 htdocs/mrp/ajax/index.html delete mode 100644 htdocs/mrp/class/index.html delete mode 100644 htdocs/mrp/js/index.html delete mode 100644 htdocs/mrp/tpl/index.html delete mode 100644 htdocs/opensurvey/class/index.html delete mode 100644 htdocs/opensurvey/css/index.html delete mode 100644 htdocs/opensurvey/img/index.html delete mode 100644 htdocs/paybox/admin/index.html delete mode 100644 htdocs/paybox/img/index.html delete mode 100644 htdocs/paybox/index.html delete mode 100644 htdocs/paybox/lib/index.html delete mode 100644 htdocs/paypal/admin/index.html delete mode 100644 htdocs/paypal/img/index.html delete mode 100644 htdocs/paypal/index.html delete mode 100644 htdocs/paypal/lib/index.html delete mode 100644 htdocs/printing/admin/index.html delete mode 100644 htdocs/printing/lib/index.html delete mode 100644 htdocs/product/admin/index.html delete mode 100644 htdocs/product/ajax/index.html delete mode 100644 htdocs/product/canvas/index.html delete mode 100644 htdocs/product/canvas/product/index.html delete mode 100644 htdocs/product/canvas/product/tpl/index.html delete mode 100644 htdocs/product/canvas/service/index.html delete mode 100644 htdocs/product/canvas/service/tpl/index.html delete mode 100644 htdocs/product/class/index.html delete mode 100644 htdocs/product/composition/index.html delete mode 100644 htdocs/product/dynamic_price/class/index.html delete mode 100644 htdocs/product/dynamic_price/index.html delete mode 100644 htdocs/product/stats/index.html delete mode 100644 htdocs/product/stock/class/index.html delete mode 100644 htdocs/product/stock/img/index.html delete mode 100644 htdocs/product/stock/lib/index.html delete mode 100644 htdocs/projet/admin/index.html delete mode 100644 htdocs/projet/ajax/index.html delete mode 100644 htdocs/projet/class/index.html delete mode 100644 htdocs/reception/class/index.html delete mode 100644 htdocs/reception/tpl/index.html delete mode 100644 htdocs/recruitment/admin/index.html delete mode 100644 htdocs/recruitment/class/index.html delete mode 100644 htdocs/recruitment/core/modules/recruitment/doc/index.html delete mode 100644 htdocs/recruitment/core/modules/recruitment/index.html delete mode 100644 htdocs/recruitment/index.html delete mode 100644 htdocs/recruitment/lib/index.html delete mode 100644 htdocs/resource/class/index.html delete mode 100644 htdocs/resource/index.html delete mode 100644 htdocs/salaries/admin/index.html delete mode 100644 htdocs/salaries/class/index.html delete mode 100644 htdocs/salaries/index.html delete mode 100644 htdocs/salaries/payment_salary/index.html delete mode 100644 htdocs/societe/ajax/index.html delete mode 100644 htdocs/societe/canvas/company/index.html delete mode 100644 htdocs/societe/canvas/company/tpl/index.html delete mode 100644 htdocs/societe/canvas/index.html delete mode 100644 htdocs/societe/canvas/individual/index.html delete mode 100644 htdocs/societe/canvas/individual/tpl/index.html delete mode 100644 htdocs/societe/checkvat/index.html delete mode 100644 htdocs/societe/class/index.html delete mode 100644 htdocs/societe/notify/index.html delete mode 100644 htdocs/societe/tpl/index.html delete mode 100644 htdocs/stripe/admin/index.html delete mode 100644 htdocs/stripe/class/index.html delete mode 100644 htdocs/stripe/index.html delete mode 100644 htdocs/stripe/lib/index.html delete mode 100644 htdocs/supplier_proposal/class/index.html delete mode 100644 htdocs/supplier_proposal/tpl/index.html delete mode 100644 htdocs/takepos/admin/index.html delete mode 100644 htdocs/theme/common/devices/index.html delete mode 100644 htdocs/theme/common/emotes/index.html delete mode 100644 htdocs/theme/common/flags/index.html delete mode 100644 htdocs/theme/common/index.html delete mode 100644 htdocs/theme/common/mime/index.html delete mode 100644 htdocs/theme/common/treemenu/index.html delete mode 100644 htdocs/theme/common/weather/index.html delete mode 100644 htdocs/theme/eldy/ckeditor/index.html delete mode 100644 htdocs/theme/eldy/img/index.html delete mode 100644 htdocs/theme/eldy/index.html delete mode 100644 htdocs/theme/eldy/tpl/index.html delete mode 100644 htdocs/theme/index.html delete mode 100644 htdocs/theme/md/ckeditor/index.html delete mode 100644 htdocs/theme/md/img/index.html delete mode 100644 htdocs/theme/md/index.html delete mode 100644 htdocs/theme/md/tpl/index.html delete mode 100644 htdocs/ticket/tpl/index.html delete mode 100644 htdocs/user/admin/index.html delete mode 100644 htdocs/user/class/index.html delete mode 100644 htdocs/user/group/index.html delete mode 100644 htdocs/user/index.html delete mode 100644 htdocs/user/notify/index.html delete mode 100644 htdocs/variants/admin/index.html delete mode 100644 htdocs/variants/ajax/index.html delete mode 100644 htdocs/variants/class/index.html delete mode 100644 htdocs/variants/index.html delete mode 100644 htdocs/variants/lib/index.html delete mode 100644 htdocs/website/class/index.html delete mode 100644 htdocs/website/lib/index.html delete mode 100644 htdocs/workstation/class/index.html delete mode 100644 htdocs/workstation/index.html delete mode 100644 htdocs/workstation/lib/index.html delete mode 100644 htdocs/zapier/admin/index.html delete mode 100644 htdocs/zapier/class/index.html delete mode 100644 htdocs/zapier/index.html delete mode 100644 htdocs/zapier/lib/index.html diff --git a/htdocs/accountancy/admin/index.html b/htdocs/accountancy/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/accountancy/bookkeeping/index.html b/htdocs/accountancy/bookkeeping/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/accountancy/class/index.html b/htdocs/accountancy/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/accountancy/closure/index.html b/htdocs/accountancy/closure/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/accountancy/journal/index.html b/htdocs/accountancy/journal/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/accountancy/tpl/index.html b/htdocs/accountancy/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/adherents/admin/index.html b/htdocs/adherents/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/adherents/canvas/default/index.html b/htdocs/adherents/canvas/default/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/adherents/canvas/default/tpl/index.html b/htdocs/adherents/canvas/default/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/adherents/canvas/index.html b/htdocs/adherents/canvas/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/adherents/cartes/index.html b/htdocs/adherents/cartes/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/adherents/class/index.html b/htdocs/adherents/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/adherents/stats/index.html b/htdocs/adherents/stats/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/adherents/subscription/index.html b/htdocs/adherents/subscription/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/adherents/tpl/index.html b/htdocs/adherents/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/admin/dolistore/ajax/index.html b/htdocs/admin/dolistore/ajax/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/admin/dolistore/ajax/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/admin/dolistore/class/index.html b/htdocs/admin/dolistore/class/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/admin/dolistore/class/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/admin/dolistore/index.html b/htdocs/admin/dolistore/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/admin/dolistore/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/api/class/index.html b/htdocs/api/class/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/api/class/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/asset/admin/index.html b/htdocs/asset/admin/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/asset/admin/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/asset/class/index.html b/htdocs/asset/class/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/asset/class/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/asset/index.html b/htdocs/asset/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/asset/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/asterisk/index.html b/htdocs/asterisk/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/barcode/index.html b/htdocs/barcode/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/blockedlog/admin/index.html b/htdocs/blockedlog/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/blockedlog/ajax/index.html b/htdocs/blockedlog/ajax/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/blockedlog/class/index.html b/htdocs/blockedlog/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/blockedlog/index.html b/htdocs/blockedlog/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/blockedlog/lib/index.html b/htdocs/blockedlog/lib/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/bom/class/index.html b/htdocs/bom/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/bom/index.html b/htdocs/bom/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/bom/lib/index.html b/htdocs/bom/lib/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/bom/tpl/index.html b/htdocs/bom/tpl/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/bom/tpl/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/bookmarks/admin/index.html b/htdocs/bookmarks/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/bookmarks/class/index.html b/htdocs/bookmarks/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/bookmarks/index.html b/htdocs/bookmarks/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/cashdesk/admin/index.html b/htdocs/cashdesk/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/cashdesk/class/index.html b/htdocs/cashdesk/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/cashdesk/css/index.html b/htdocs/cashdesk/css/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/cashdesk/img/index.html b/htdocs/cashdesk/img/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/cashdesk/include/index.html b/htdocs/cashdesk/include/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/cashdesk/javascript/index.html b/htdocs/cashdesk/javascript/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/cashdesk/tpl/index.html b/htdocs/cashdesk/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/categories/admin/index.html b/htdocs/categories/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/categories/class/index.html b/htdocs/categories/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/comm/action/class/index.html b/htdocs/comm/action/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/comm/admin/index.html b/htdocs/comm/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/comm/mailing/class/index.html b/htdocs/comm/mailing/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/comm/propal/class/index.html b/htdocs/comm/propal/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/comm/propal/tpl/index.html b/htdocs/comm/propal/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/commande/class/index.html b/htdocs/commande/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/commande/tpl/index.html b/htdocs/commande/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/bank/class/index.html b/htdocs/compta/bank/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/bank/index.html b/htdocs/compta/bank/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/compta/bank/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/compta/bank/various_payment/index.html b/htdocs/compta/bank/various_payment/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/compta/bank/various_payment/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/compta/cashcontrol/class/index.html b/htdocs/compta/cashcontrol/class/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/compta/cashcontrol/class/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/compta/cashcontrol/index.html b/htdocs/compta/cashcontrol/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/compta/cashcontrol/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/compta/deplacement/class/index.html b/htdocs/compta/deplacement/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/facture/admin/index.html b/htdocs/compta/facture/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/facture/class/index.html b/htdocs/compta/facture/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/facture/index.html b/htdocs/compta/facture/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/facture/tpl/index.html b/htdocs/compta/facture/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/journal/index.html b/htdocs/compta/journal/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/localtax/class/index.html b/htdocs/compta/localtax/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/paiement/cheque/class/index.html b/htdocs/compta/paiement/cheque/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/paiement/class/index.html b/htdocs/compta/paiement/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/payment_sc/index.html b/htdocs/compta/payment_sc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/payment_vat/index.html b/htdocs/compta/payment_vat/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/compta/payment_vat/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/compta/prelevement/class/index.html b/htdocs/compta/prelevement/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/sociales/class/index.html b/htdocs/compta/sociales/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/sociales/index.html b/htdocs/compta/sociales/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/compta/sociales/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/compta/tva/class/index.html b/htdocs/compta/tva/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/conf/index.html b/htdocs/conf/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/contact/canvas/default/index.html b/htdocs/contact/canvas/default/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/contact/canvas/default/tpl/index.html b/htdocs/contact/canvas/default/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/contact/canvas/index.html b/htdocs/contact/canvas/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/contact/class/index.html b/htdocs/contact/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/contact/index.html b/htdocs/contact/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/contrat/admin/index.html b/htdocs/contrat/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/contrat/class/index.html b/htdocs/contrat/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/contrat/tpl/index.html b/htdocs/contrat/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/ajax/index.html b/htdocs/core/ajax/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/boxes/index.html b/htdocs/core/boxes/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/class/index.html b/htdocs/core/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/data/index.html b/htdocs/core/data/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/data/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/db/index.html b/htdocs/core/db/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/index.html b/htdocs/core/filemanagerdol/browser/default/images/icons/32/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/index.html b/htdocs/core/filemanagerdol/browser/default/images/icons/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/filemanagerdol/browser/default/images/index.html b/htdocs/core/filemanagerdol/browser/default/images/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/filemanagerdol/browser/default/index.html b/htdocs/core/filemanagerdol/browser/default/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/filemanagerdol/browser/default/js/index.html b/htdocs/core/filemanagerdol/browser/default/js/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/filemanagerdol/browser/index.html b/htdocs/core/filemanagerdol/browser/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/filemanagerdol/connectors/index.html b/htdocs/core/filemanagerdol/connectors/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/filemanagerdol/connectors/php/index.html b/htdocs/core/filemanagerdol/connectors/php/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/filemanagerdol/index.html b/htdocs/core/filemanagerdol/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/index.html b/htdocs/core/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/js/index.html b/htdocs/core/js/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/lib/index.html b/htdocs/core/lib/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/login/index.html b/htdocs/core/login/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/menus/index.html b/htdocs/core/menus/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/menus/standard/index.html b/htdocs/core/menus/standard/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/action/index.html b/htdocs/core/modules/action/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/bank/doc/index.html b/htdocs/core/modules/bank/doc/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/bank/doc/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/bank/index.html b/htdocs/core/modules/bank/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/bank/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/barcode/doc/index.html b/htdocs/core/modules/barcode/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/barcode/index.html b/htdocs/core/modules/barcode/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/bom/doc/index.html b/htdocs/core/modules/bom/doc/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/bom/doc/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/bom/index.html b/htdocs/core/modules/bom/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/bom/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/cheque/doc/index.html b/htdocs/core/modules/cheque/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/cheque/index.html b/htdocs/core/modules/cheque/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/commande/doc/index.html b/htdocs/core/modules/commande/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/commande/index.html b/htdocs/core/modules/commande/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/contract/doc/index.html b/htdocs/core/modules/contract/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/contract/index.html b/htdocs/core/modules/contract/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/delivery/doc/index.html b/htdocs/core/modules/delivery/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/delivery/index.html b/htdocs/core/modules/delivery/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/dons/index.html b/htdocs/core/modules/dons/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/expedition/doc/index.html b/htdocs/core/modules/expedition/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/expedition/index.html b/htdocs/core/modules/expedition/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/expensereport/doc/index.html b/htdocs/core/modules/expensereport/doc/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/expensereport/doc/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/expensereport/index.html b/htdocs/core/modules/expensereport/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/export/index.html b/htdocs/core/modules/export/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/facture/doc/index.html b/htdocs/core/modules/facture/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/facture/index.html b/htdocs/core/modules/facture/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/fichinter/doc/index.html b/htdocs/core/modules/fichinter/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/fichinter/index.html b/htdocs/core/modules/fichinter/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/holiday/index.html b/htdocs/core/modules/holiday/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/holiday/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/import/index.html b/htdocs/core/modules/import/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/index.html b/htdocs/core/modules/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/mailings/index.html b/htdocs/core/modules/mailings/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/member/doc/index.html b/htdocs/core/modules/member/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/member/index.html b/htdocs/core/modules/member/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/movement/doc/index.html b/htdocs/core/modules/movement/doc/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/movement/doc/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/movement/index.html b/htdocs/core/modules/movement/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/movement/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/mrp/doc/index.html b/htdocs/core/modules/mrp/doc/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/mrp/doc/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/mrp/index.html b/htdocs/core/modules/mrp/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/mrp/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/oauth/index.html b/htdocs/core/modules/oauth/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/payment/index.html b/htdocs/core/modules/payment/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/payment/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/printing/index.html b/htdocs/core/modules/printing/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/printsheet/doc/index.html b/htdocs/core/modules/printsheet/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/printsheet/index.html b/htdocs/core/modules/printsheet/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/product/doc/index.html b/htdocs/core/modules/product/doc/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/product/doc/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/product/index.html b/htdocs/core/modules/product/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/product_batch/index.html b/htdocs/core/modules/product_batch/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/project/doc/index.html b/htdocs/core/modules/project/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/project/index.html b/htdocs/core/modules/project/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/project/task/doc/index.html b/htdocs/core/modules/project/task/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/project/task/index.html b/htdocs/core/modules/project/task/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/propale/doc/index.html b/htdocs/core/modules/propale/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/propale/index.html b/htdocs/core/modules/propale/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/rapport/index.html b/htdocs/core/modules/rapport/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/reception/doc/index.html b/htdocs/core/modules/reception/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/reception/index.html b/htdocs/core/modules/reception/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/security/generate/index.html b/htdocs/core/modules/security/generate/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/security/index.html b/htdocs/core/modules/security/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/societe/doc/index.html b/htdocs/core/modules/societe/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/societe/index.html b/htdocs/core/modules/societe/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/stock/doc/index.html b/htdocs/core/modules/stock/doc/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/stock/doc/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/stock/index.html b/htdocs/core/modules/stock/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/stock/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/supplier_invoice/doc/index.html b/htdocs/core/modules/supplier_invoice/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/supplier_invoice/index.html b/htdocs/core/modules/supplier_invoice/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/supplier_order/doc/index.html b/htdocs/core/modules/supplier_order/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/supplier_order/index.html b/htdocs/core/modules/supplier_order/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/supplier_payment/doc/index.html b/htdocs/core/modules/supplier_payment/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/supplier_payment/index.html b/htdocs/core/modules/supplier_payment/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/supplier_payment/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/supplier_proposal/doc/index.html b/htdocs/core/modules/supplier_proposal/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/supplier_proposal/index.html b/htdocs/core/modules/supplier_proposal/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/syslog/index.html b/htdocs/core/modules/syslog/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/takepos/index.html b/htdocs/core/modules/takepos/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/takepos/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/ticket/doc/index.html b/htdocs/core/modules/ticket/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/ticket/index.html b/htdocs/core/modules/ticket/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/ticket/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/user/doc/index.html b/htdocs/core/modules/user/doc/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/modules/user/index.html b/htdocs/core/modules/user/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/user/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/usergroup/doc/index.html b/htdocs/core/modules/usergroup/doc/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/usergroup/doc/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/usergroup/index.html b/htdocs/core/modules/usergroup/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/usergroup/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/modules/workstation/index.html b/htdocs/core/modules/workstation/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/core/modules/workstation/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/core/tpl/ajax/index.html b/htdocs/core/tpl/ajax/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/tpl/index.html b/htdocs/core/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/core/triggers/index.html b/htdocs/core/triggers/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/cron/admin/index.html b/htdocs/cron/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/cron/class/index.html b/htdocs/cron/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/cron/index.html b/htdocs/cron/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/custom/index.html b/htdocs/custom/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/datapolicy/admin/index.html b/htdocs/datapolicy/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/datapolicy/class/index.html b/htdocs/datapolicy/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/datapolicy/index.html b/htdocs/datapolicy/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/datapolicy/lib/index.html b/htdocs/datapolicy/lib/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/dav/index.html b/htdocs/dav/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/dav/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/debugbar/class/DataCollector/index.html b/htdocs/debugbar/class/DataCollector/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/debugbar/class/DataCollector/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/debugbar/class/index.html b/htdocs/debugbar/class/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/debugbar/class/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/debugbar/index.html b/htdocs/debugbar/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/debugbar/js/index.html b/htdocs/debugbar/js/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/debugbar/js/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/delivery/class/index.html b/htdocs/delivery/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/delivery/index.html b/htdocs/delivery/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/don/admin/index.html b/htdocs/don/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/don/class/index.html b/htdocs/don/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/don/index.html b/htdocs/don/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/don/payment/index.html b/htdocs/don/payment/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/ecm/ajax/index.html b/htdocs/ecm/ajax/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/ecm/class/index.html b/htdocs/ecm/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/ecm/tpl/index.html b/htdocs/ecm/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/emailcollector/class/index.html b/htdocs/emailcollector/class/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/emailcollector/class/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/emailcollector/index.html b/htdocs/emailcollector/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/emailcollector/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/emailcollector/lib/index.html b/htdocs/emailcollector/lib/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/emailcollector/lib/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/eventorganization/class/index.html b/htdocs/eventorganization/class/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/eventorganization/class/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/eventorganization/index.html b/htdocs/eventorganization/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/eventorganization/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/eventorganization/lib/index.html b/htdocs/eventorganization/lib/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/eventorganization/lib/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/expedition/class/index.html b/htdocs/expedition/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/expedition/tpl/index.html b/htdocs/expedition/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/expensereport/ajax/index.html b/htdocs/expensereport/ajax/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/expensereport/class/index.html b/htdocs/expensereport/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/expensereport/payment/index.html b/htdocs/expensereport/payment/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/expensereport/stats/index.html b/htdocs/expensereport/stats/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/expensereport/tpl/index.html b/htdocs/expensereport/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/exports/class/index.html b/htdocs/exports/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/externalsite/index.html b/htdocs/externalsite/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/fichinter/admin/index.html b/htdocs/fichinter/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/fichinter/class/index.html b/htdocs/fichinter/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/fichinter/tpl/index.html b/htdocs/fichinter/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/fourn/ajax/index.html b/htdocs/fourn/ajax/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/fourn/class/index.html b/htdocs/fourn/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/fourn/commande/tpl/index.html b/htdocs/fourn/commande/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/fourn/facture/index.html b/htdocs/fourn/facture/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/fourn/facture/tpl/index.html b/htdocs/fourn/facture/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/fourn/js/index.html b/htdocs/fourn/js/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/fourn/js/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/fourn/paiement/index.html b/htdocs/fourn/paiement/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/ftp/admin/index.html b/htdocs/ftp/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/holiday/class/index.html b/htdocs/holiday/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/holiday/img/index.html b/htdocs/holiday/img/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/holiday/index.html b/htdocs/holiday/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/hrm/admin/index.html b/htdocs/hrm/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/hrm/class/index.html b/htdocs/hrm/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/hrm/establishment/index.html b/htdocs/hrm/establishment/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/includes/adodbtime/index.html b/htdocs/includes/adodbtime/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/includes/index.html b/htdocs/includes/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/install/mssql/functions/index.html b/htdocs/install/mssql/functions/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/install/mssql/index.html b/htdocs/install/mssql/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/install/mysql/data/index.html b/htdocs/install/mysql/data/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/install/mysql/functions/index.html b/htdocs/install/mysql/functions/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/install/mysql/index.html b/htdocs/install/mysql/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/install/mysql/migration/index.html b/htdocs/install/mysql/migration/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/install/mysql/tables/index.html b/htdocs/install/mysql/tables/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/install/pgsql/functions/index.html b/htdocs/install/pgsql/functions/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/install/pgsql/index.html b/htdocs/install/pgsql/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/install/sqlite3/functions/index.html b/htdocs/install/sqlite3/functions/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/install/sqlite3/functions/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/install/sqlite3/index.html b/htdocs/install/sqlite3/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/intracommreport/admin/index.html b/htdocs/intracommreport/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/intracommreport/class/index.html b/htdocs/intracommreport/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/intracommreport/index.html b/htdocs/intracommreport/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/loan/class/index.html b/htdocs/loan/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/loan/index.html b/htdocs/loan/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/loan/payment/index.html b/htdocs/loan/payment/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/mailmanspip/class/index.html b/htdocs/mailmanspip/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/mailmanspip/index.html b/htdocs/mailmanspip/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/margin/admin/index.html b/htdocs/margin/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/margin/lib/index.html b/htdocs/margin/lib/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/margin/tabs/index.html b/htdocs/margin/tabs/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/modulebuilder/admin/index.html b/htdocs/modulebuilder/admin/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/modulebuilder/admin/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/modulebuilder/template/admin/index.html b/htdocs/modulebuilder/template/admin/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/modulebuilder/template/admin/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/modulebuilder/template/class/index.html b/htdocs/modulebuilder/template/class/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/modulebuilder/template/class/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/modulebuilder/template/index.html b/htdocs/modulebuilder/template/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/modulebuilder/template/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/modulebuilder/template/js/index.html b/htdocs/modulebuilder/template/js/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/modulebuilder/template/js/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/modulebuilder/template/lib/index.html b/htdocs/modulebuilder/template/lib/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/modulebuilder/template/lib/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/modulebuilder/template/sql/index.html b/htdocs/modulebuilder/template/sql/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/modulebuilder/template/sql/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/mrp/ajax/index.html b/htdocs/mrp/ajax/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/mrp/ajax/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/mrp/class/index.html b/htdocs/mrp/class/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/mrp/class/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/mrp/js/index.html b/htdocs/mrp/js/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/mrp/js/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/mrp/tpl/index.html b/htdocs/mrp/tpl/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/mrp/tpl/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/opensurvey/class/index.html b/htdocs/opensurvey/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/opensurvey/css/index.html b/htdocs/opensurvey/css/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/opensurvey/img/index.html b/htdocs/opensurvey/img/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/paybox/admin/index.html b/htdocs/paybox/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/paybox/img/index.html b/htdocs/paybox/img/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/paybox/index.html b/htdocs/paybox/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/paybox/lib/index.html b/htdocs/paybox/lib/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/paypal/admin/index.html b/htdocs/paypal/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/paypal/img/index.html b/htdocs/paypal/img/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/paypal/index.html b/htdocs/paypal/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/paypal/lib/index.html b/htdocs/paypal/lib/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/printing/admin/index.html b/htdocs/printing/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/printing/lib/index.html b/htdocs/printing/lib/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/product/admin/index.html b/htdocs/product/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/product/ajax/index.html b/htdocs/product/ajax/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/product/canvas/index.html b/htdocs/product/canvas/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/product/canvas/product/index.html b/htdocs/product/canvas/product/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/product/canvas/product/tpl/index.html b/htdocs/product/canvas/product/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/product/canvas/service/index.html b/htdocs/product/canvas/service/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/product/canvas/service/tpl/index.html b/htdocs/product/canvas/service/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/product/class/index.html b/htdocs/product/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/product/composition/index.html b/htdocs/product/composition/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/product/dynamic_price/class/index.html b/htdocs/product/dynamic_price/class/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/product/dynamic_price/class/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/product/dynamic_price/index.html b/htdocs/product/dynamic_price/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/product/dynamic_price/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/product/stats/index.html b/htdocs/product/stats/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/product/stock/class/index.html b/htdocs/product/stock/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/product/stock/img/index.html b/htdocs/product/stock/img/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/product/stock/lib/index.html b/htdocs/product/stock/lib/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/projet/admin/index.html b/htdocs/projet/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/projet/ajax/index.html b/htdocs/projet/ajax/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/projet/ajax/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/projet/class/index.html b/htdocs/projet/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/reception/class/index.html b/htdocs/reception/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/reception/tpl/index.html b/htdocs/reception/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/recruitment/admin/index.html b/htdocs/recruitment/admin/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/recruitment/admin/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/recruitment/class/index.html b/htdocs/recruitment/class/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/recruitment/class/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/recruitment/core/modules/recruitment/doc/index.html b/htdocs/recruitment/core/modules/recruitment/doc/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/recruitment/core/modules/recruitment/doc/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/recruitment/core/modules/recruitment/index.html b/htdocs/recruitment/core/modules/recruitment/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/recruitment/core/modules/recruitment/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/recruitment/index.html b/htdocs/recruitment/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/recruitment/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/recruitment/lib/index.html b/htdocs/recruitment/lib/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/recruitment/lib/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/resource/class/index.html b/htdocs/resource/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/resource/index.html b/htdocs/resource/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/salaries/admin/index.html b/htdocs/salaries/admin/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/salaries/admin/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/salaries/class/index.html b/htdocs/salaries/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/salaries/index.html b/htdocs/salaries/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/salaries/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/salaries/payment_salary/index.html b/htdocs/salaries/payment_salary/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/salaries/payment_salary/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/societe/ajax/index.html b/htdocs/societe/ajax/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/societe/canvas/company/index.html b/htdocs/societe/canvas/company/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/societe/canvas/company/tpl/index.html b/htdocs/societe/canvas/company/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/societe/canvas/index.html b/htdocs/societe/canvas/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/societe/canvas/individual/index.html b/htdocs/societe/canvas/individual/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/societe/canvas/individual/tpl/index.html b/htdocs/societe/canvas/individual/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/societe/checkvat/index.html b/htdocs/societe/checkvat/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/societe/class/index.html b/htdocs/societe/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/societe/notify/index.html b/htdocs/societe/notify/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/societe/tpl/index.html b/htdocs/societe/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/stripe/admin/index.html b/htdocs/stripe/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/stripe/class/index.html b/htdocs/stripe/class/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/stripe/class/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/stripe/index.html b/htdocs/stripe/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/stripe/lib/index.html b/htdocs/stripe/lib/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/supplier_proposal/class/index.html b/htdocs/supplier_proposal/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/supplier_proposal/tpl/index.html b/htdocs/supplier_proposal/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/takepos/admin/index.html b/htdocs/takepos/admin/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/takepos/admin/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/theme/common/devices/index.html b/htdocs/theme/common/devices/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/common/emotes/index.html b/htdocs/theme/common/emotes/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/common/flags/index.html b/htdocs/theme/common/flags/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/common/index.html b/htdocs/theme/common/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/common/mime/index.html b/htdocs/theme/common/mime/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/common/treemenu/index.html b/htdocs/theme/common/treemenu/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/common/weather/index.html b/htdocs/theme/common/weather/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/eldy/ckeditor/index.html b/htdocs/theme/eldy/ckeditor/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/eldy/img/index.html b/htdocs/theme/eldy/img/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/eldy/index.html b/htdocs/theme/eldy/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/eldy/tpl/index.html b/htdocs/theme/eldy/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/index.html b/htdocs/theme/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/md/ckeditor/index.html b/htdocs/theme/md/ckeditor/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/md/img/index.html b/htdocs/theme/md/img/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/md/index.html b/htdocs/theme/md/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/md/tpl/index.html b/htdocs/theme/md/tpl/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/ticket/tpl/index.html b/htdocs/ticket/tpl/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/ticket/tpl/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/user/admin/index.html b/htdocs/user/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/user/class/index.html b/htdocs/user/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/user/group/index.html b/htdocs/user/group/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/user/group/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/user/index.html b/htdocs/user/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/user/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/user/notify/index.html b/htdocs/user/notify/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/user/notify/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/variants/admin/index.html b/htdocs/variants/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/variants/ajax/index.html b/htdocs/variants/ajax/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/variants/class/index.html b/htdocs/variants/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/variants/index.html b/htdocs/variants/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/variants/lib/index.html b/htdocs/variants/lib/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/website/class/index.html b/htdocs/website/class/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/website/lib/index.html b/htdocs/website/lib/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/workstation/class/index.html b/htdocs/workstation/class/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/workstation/class/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/workstation/index.html b/htdocs/workstation/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/workstation/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/workstation/lib/index.html b/htdocs/workstation/lib/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/workstation/lib/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/zapier/admin/index.html b/htdocs/zapier/admin/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/zapier/admin/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/zapier/class/index.html b/htdocs/zapier/class/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/zapier/class/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/zapier/index.html b/htdocs/zapier/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/zapier/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/zapier/lib/index.html b/htdocs/zapier/lib/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/zapier/lib/index.html +++ /dev/null @@ -1 +0,0 @@ - From a7a95cff03abd6b6d61e130835cd314a8464b400 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Apr 2021 16:37:43 +0200 Subject: [PATCH 110/216] Fix payment link for renewal with a unique secure key --- htdocs/core/lib/payments.lib.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 601dad3275d..286243564f1 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -28,7 +28,6 @@ */ function payment_prepare_head(Paiement $object) { - global $langs, $conf; $h = 0; @@ -264,9 +263,9 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag $out .= ($mode ? '' : ''); } } - } elseif ($type == 'member' || $type == 'membersubscription') - { - $out = $urltouse.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode ? '' : ''); + } elseif ($type == 'member' || $type == 'membersubscription') { + $newtype = 'member'; + $out = $urltouse.'/public/payment/newpayment.php?source='.$newtype.'&ref='.($mode ? '' : ''); if ($mode == 1) $out .= 'member_ref'; if ($mode == 0) $out .= urlencode($ref); $out .= ($mode ? '' : ''); @@ -275,8 +274,8 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; else { $out .= '&securekey='.($mode ? '' : ''); - if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + member_ref)"; - if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); + if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$newtype."' + member_ref)"; + if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$newtype.$ref, 2); $out .= ($mode ? '' : ''); } } From d9513da8de4670dc058f4949be65a63941146e6a Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 12 Apr 2021 17:05:09 +0200 Subject: [PATCH 111/216] email now required in the attendee_subscription page, company name no longer required. Check on existing third party now depends on the email. todo: what if the name is empty? --- .../attendee_subscription.php | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 800c6dc469d..bd655362a3d 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -77,6 +77,7 @@ $action = GETPOST('action', 'aZ09'); $key = 'DV3PH'; $id = dol_decode(GETPOST('id'), $key); +$email = GETPOST("email"); // Securekey check $securekey = GETPOST('securekey', 'alpha'); @@ -186,21 +187,24 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; } - if (!GETPOST("societe")) { + /*if (!GETPOST("societe")) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; - } + }*/ if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { $error++; $langs->load("errors"); $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; } + if (!GETPOST("country_id")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; + } if (!$error) { - // Vérifier si client existe + // Vérifier si client existe par l'email $thirdparty = new Societe($db); - $nomsociete = GETPOST("societe"); - $resultfetchthirdparty = $thirdparty->fetch('', $nomsociete); + $resultfetchthirdparty = $thirdparty->fetch('','','','','','','','','','',$email); if ($resultfetchthirdparty<0) { $error++; @@ -208,7 +212,7 @@ if (empty($reshook) && $action == 'add') { $readythirdparty = -1; } elseif ($resultfetchthirdparty==0) { // creation of a new thirdparty - $thirdparty->name = $nomsociete; + $thirdparty->name = GETPOST("societe"); $thirdparty->address = GETPOST("address"); $thirdparty->zip = GETPOST("zipcode"); $thirdparty->town = GETPOST("town"); @@ -216,6 +220,7 @@ if (empty($reshook) && $action == 'add') { $thirdparty->fournisseur = 0; $thirdparty->country_id = GETPOST("country_id", 'int'); $thirdparty->state_id = GETPOST("state_id", 'int'); + $thirdparty->email = $email; // Load object modCodeTiers $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); @@ -331,8 +336,10 @@ jQuery(document).ready(function () { print ''."\n"; +// Email +print ''."\n"; // Company -print ''."\n"; +print ''."\n"; // Address print ''."\n"; @@ -343,7 +350,7 @@ print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print ''; // Country -print ''; } -// Email -print ''."\n"; print "
'.$langs->trans("Email").' *
'.$langs->trans("Company").' *
'.$langs->trans("Company").'
'.$langs->trans("Address").''."\n"; print '
'.$langs->trans('Country').''; +print '
'.$langs->trans('Country').'*'.''; $country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); @@ -372,8 +379,6 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { } print '
'.$langs->trans("Email").' *
\n"; From 358a2bf36595e6e399d2d87dab4645f295c638db Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 12 Apr 2021 17:10:57 +0200 Subject: [PATCH 112/216] hardcoded label put in ->trans --- htdocs/eventorganization/conferenceorbooth_card.php | 2 +- htdocs/langs/en_US/eventorganization.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 4f0720d11e3..87418402f2b 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -498,7 +498,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $key = 'DV3PH'; $link_subscription .= dol_encode($id, $key); $link_subscription .= '&securekey='.urlencode($conf->global->EVENTORGANIZATION_SECUREKEY); - $object->fields['pubregister'] = array('type'=>'url', 'label'=>'Lien public d\'enregistrement à une conférence', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1); + $object->fields['pubregister'] = array('type'=>'url', 'label'=>$langs->trans("PublicAttendeeSubscriptionPage"), 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1); $object->pubregister = $link_subscription; $keyforbreak='pubregister'; diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 03fb460d6b9..e124d1254d8 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -19,7 +19,6 @@ ModuleEventOrganizationName = Event Organization EventOrganizationDescription = Event Organization through Module Project EventOrganizationDescriptionLong= Manage Event organization for conference, attendees, speaker, and attendees, with public subcription page - # # Menu # @@ -94,6 +93,7 @@ EvntOrgCancelled = Cancelled # # Public page # +PublicAttendeeSubscriptionPage = Public link of registration to a conference MissingOrBadSecureKey = The security key is invalid or missing EvntOrgWelcomeMessage = This form allows you to register as a new participant to the conference EvntOrgStartDuration = This conference starts on From 167da1445db543b44314cea657526bffb20bbc30 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 12 Apr 2021 17:16:24 +0200 Subject: [PATCH 113/216] securekey added in --- htdocs/admin/eventorganization.php | 2 +- htdocs/langs/en_US/eventorganization.lang | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 9338aa3a6dd..b6a964d8617 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -60,7 +60,7 @@ $arrayofparameters = array( 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), - 'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1), + 'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1), ); $error = 0; diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index e124d1254d8..a9d31c1dbaf 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -81,6 +81,7 @@ PriceOfBoothHelp=Subscription price to stand a booth EventOrganizationICSLink=Link ICS for events ConferenceOrBoothInformation=Conference Or Booth informations Attendees = Attendees +EVENTORGANIZATION_SECUREKEY = Secure Key of the public registration link to a conference # # Status # From 202243d8a310c7ae7ce6c939254d74f4996ebe7c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Apr 2021 17:19:58 +0200 Subject: [PATCH 114/216] Fix payment link for renewal with a unique secure key --- htdocs/public/payment/newpayment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index e16355d902e..bda291b8d8a 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1336,7 +1336,7 @@ if ($source == 'contractline') } // Payment on member subscription -if ($source == 'membersubscription') +if ($source == 'member' || $source == 'membersubscription') { $found = true; $langs->load("members"); From 7644174c4af4aeb166af1fea3154d4840dd86def Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 12 Apr 2021 17:29:44 +0200 Subject: [PATCH 115/216] subscriptionok page addition --- .../eventorganization/subscriptionok.php | 163 ++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 htdocs/public/eventorganization/subscriptionok.php diff --git a/htdocs/public/eventorganization/subscriptionok.php b/htdocs/public/eventorganization/subscriptionok.php new file mode 100644 index 00000000000..50077099d51 --- /dev/null +++ b/htdocs/public/eventorganization/subscriptionok.php @@ -0,0 +1,163 @@ + + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2021 Waël Almoman + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/payment/paymentok.php + * \ingroup core + * \brief File to show page after a successful payment + * This page is called by payment system with url provided to it completed with parameter TOKEN=xxx + * This token can be used to get more informations. + */ + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. +$entity = (!empty($_GET['e']) ? (int) $_GET['e'] : (!empty($_POST['e']) ? (int) $_POST['e'] : 1)); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; + +if (!empty($conf->paypal->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; +} + +$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); + +$object = new stdClass(); // For triggers + +$error = 0; + + +/* + * Actions + */ + + + +/* + * View + */ + +$now = dol_now(); + +dol_syslog("Callback url when a payment was done. query_string=".(dol_escape_htmltag($_SERVER["QUERY_STRING"]) ?dol_escape_htmltag($_SERVER["QUERY_STRING"]) : '')." script_uri=".(dol_escape_htmltag($_SERVER["SCRIPT_URI"]) ?dol_escape_htmltag($_SERVER["SCRIPT_URI"]) : ''), LOG_DEBUG, 0, '_payment'); + +$tracepost = ""; +foreach ($_POST as $k => $v) { + $tracepost .= "{$k} - {$v}\n"; +} +dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment'); + +$head = ''; +if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) { + $head = ''."\n"; +} + +$conf->dol_hide_topmenu = 1; +$conf->dol_hide_leftmenu = 1; + +$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; +llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); + + +// Show message +print ''."\n"; +print '
'."\n"; + + +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) +// Define logo and logosmall +$logosmall = $mysoc->logo_small; +$logo = $mysoc->logo; +$paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; +if (!empty($conf->global->$paramlogo)) { + $logosmall = $conf->global->$paramlogo; +} elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) { + $logosmall = $conf->global->ONLINE_PAYMENT_LOGO; +} +//print ''."\n"; +// Define urllogo +$urllogo = ''; +$urllogofull = ''; +if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); +} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); +} + +// Output html code for logo +if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; +} + + +print '


'; + + +$fulltag = $FULLTAG; +$tmptag = dolExplodeIntoArray($fulltag, '.', '='); + + +dol_syslog("ispaymentok=".$ispaymentok." tmptag=".var_export($tmptag, true), LOG_DEBUG, 0, '_payment'); + +print $langs->trans("SubscriptionOk"); + +print "\n
\n"; + + +htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix); + + +// Clean session variables to avoid duplicate actions if post is resent +unset($_SESSION["FinalPaymentAmt"]); +unset($_SESSION["TRANSACTIONID"]); + + +llxFooter('', 'public'); + +$db->close(); From a917382f6c01f7506c101de2cdb354eebd1c4601 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 12 Apr 2021 18:29:07 +0200 Subject: [PATCH 116/216] Update member_type_extrafields.php $help_url => |DE:Modul_Mitglieder'; --- htdocs/adherents/admin/member_type_extrafields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/admin/member_type_extrafields.php b/htdocs/adherents/admin/member_type_extrafields.php index 91a9233e5d0..68916df624f 100644 --- a/htdocs/adherents/admin/member_type_extrafields.php +++ b/htdocs/adherents/admin/member_type_extrafields.php @@ -67,7 +67,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject = $langs->transnoentitiesnoconv("MembersTypes"); -$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; +$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; llxHeader('', $langs->trans("MembersSetup"), $help_url); From e177bb059de5a3a92681a603756276527091ce8a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 12 Apr 2021 18:41:44 +0200 Subject: [PATCH 117/216] Update member_emails.php --- htdocs/adherents/admin/member_emails.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/adherents/admin/member_emails.php b/htdocs/adherents/admin/member_emails.php index cdda83b4714..54e74846654 100644 --- a/htdocs/adherents/admin/member_emails.php +++ b/htdocs/adherents/admin/member_emails.php @@ -50,15 +50,15 @@ $error = 0; // Editing global variables not related to a specific theme $constantes = array( 'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))), - 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member', - 'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', /* old was ADHERENT_AUTOREGISTER_MAIL */ - 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */ - 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */ - 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */ - 'ADHERENT_EMAIL_TEMPLATE_EXCLUSION' =>'emailtemplate:member', - 'ADHERENT_MAIL_FROM'=>'string', - 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'=>'string', - 'ADHERENT_AUTOREGISTER_NOTIF_MAIL'=>'html', + 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member', + 'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_AUTOREGISTER_MAIL + 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_VALID + 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_COTIS + 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_RESIL + 'ADHERENT_EMAIL_TEMPLATE_EXCLUSION' =>'emailtemplate:member', + 'ADHERENT_MAIL_FROM' =>'string', + 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT' =>'string', + 'ADHERENT_AUTOREGISTER_NOTIF_MAIL' =>'html', ); @@ -128,7 +128,7 @@ if ($action == 'update' || $action == 'add') { $form = new Form($db); -$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; +$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; llxHeader('', $langs->trans("MembersSetup"), $help_url); From d7665b49c1c106046a34147644b2734ec7ebcda5 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 12 Apr 2021 16:44:07 +0000 Subject: [PATCH 118/216] Fixing style errors. --- htdocs/adherents/admin/member_emails.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/admin/member_emails.php b/htdocs/adherents/admin/member_emails.php index 54e74846654..c55d44d391f 100644 --- a/htdocs/adherents/admin/member_emails.php +++ b/htdocs/adherents/admin/member_emails.php @@ -52,8 +52,8 @@ $constantes = array( 'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))), 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member', 'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_AUTOREGISTER_MAIL - 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_VALID - 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_COTIS + 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_VALID + 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_COTIS 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_RESIL 'ADHERENT_EMAIL_TEMPLATE_EXCLUSION' =>'emailtemplate:member', 'ADHERENT_MAIL_FROM' =>'string', From fd870e9eaf5017f5b1fbb191b2bfa4cc67f37277 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 12 Apr 2021 18:49:35 +0200 Subject: [PATCH 119/216] Update bom_note.php --- htdocs/bom/bom_note.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/bom_note.php b/htdocs/bom/bom_note.php index 5a3a2ec62b4..1110bb4b0d4 100644 --- a/htdocs/bom/bom_note.php +++ b/htdocs/bom/bom_note.php @@ -79,9 +79,11 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, $form = new Form($db); +$title = $langs->trans('BillOfMaterials'); + $help_url = 'EN:Module_BOM'; -llxHeader('', $langs->trans('BillOfMaterials'), $help_url); +llxHeader('', $title, $help_url); if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); From 3d18b0fbf7e094fb5c5a9f587da9e1956de49d80 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 12 Apr 2021 18:51:44 +0200 Subject: [PATCH 120/216] Update bom_card.php $title = $langs->trans('BOM'); --- htdocs/bom/bom_card.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index eaea02cda3a..37ec67e1ba3 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -239,7 +239,10 @@ if (empty($reshook)) { $form = new Form($db); $formfile = new FormFile($db); -llxHeader('', $langs->trans("BOM"), ''); + +$title = $langs->trans('BOM'); + +llxHeader('', $title, ''); // Example : Adding jquery code print ''; - } + print ''; + } } else { print ''; } diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index f61f4b82618..9d67c420e51 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -572,99 +572,99 @@ class CommandeFournisseur extends CommonOrder dol_syslog(get_class($this)."::valid"); $result = 0; if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && (!empty($user->rights->fournisseur->commande->creer) || !empty($user->rights->supplier_order->creer))) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate))) { - $this->db->begin(); + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate))) { + $this->db->begin(); - // Definition of supplier order numbering model name - $soc = new Societe($this->db); - $soc->fetch($this->fourn_id); + // Definition of supplier order numbering model name + $soc = new Societe($this->db); + $soc->fetch($this->fourn_id); - // Check if object has a temporary ref - if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life - $num = $this->getNextNumRef($soc); - } else { - $num = $this->ref; - } - $this->newref = dol_sanitizeFileName($num); + // Check if object has a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life + $num = $this->getNextNumRef($soc); + } else { + $num = $this->ref; + } + $this->newref = dol_sanitizeFileName($num); - $sql = 'UPDATE '.MAIN_DB_PREFIX."commande_fournisseur"; - $sql .= " SET ref='".$this->db->escape($num)."',"; - $sql .= " fk_statut = ".self::STATUS_VALIDATED.","; - $sql .= " date_valid='".$this->db->idate(dol_now())."',"; - $sql .= " fk_user_valid = ".$user->id; - $sql .= " WHERE rowid = ".$this->id; - $sql .= " AND fk_statut = ".self::STATUS_DRAFT; + $sql = 'UPDATE '.MAIN_DB_PREFIX."commande_fournisseur"; + $sql .= " SET ref='".$this->db->escape($num)."',"; + $sql .= " fk_statut = ".self::STATUS_VALIDATED.","; + $sql .= " date_valid='".$this->db->idate(dol_now())."',"; + $sql .= " fk_user_valid = ".$user->id; + $sql .= " WHERE rowid = ".$this->id; + $sql .= " AND fk_statut = ".self::STATUS_DRAFT; - $resql = $this->db->query($sql); - if (!$resql) { - dol_print_error($this->db); - $error++; - } - - if (!$error && !$notrigger) { - // Call trigger - $result = $this->call_trigger('ORDER_SUPPLIER_VALIDATE', $user); - if ($result < 0) { + $resql = $this->db->query($sql); + if (!$resql) { + dol_print_error($this->db); $error++; } - // End call triggers - } - if (!$error) { - $this->oldref = $this->ref; - - // Rename directory if dir was a temporary ref - if (preg_match('/^[\(]?PROV/i', $this->ref)) { - // Now we rename also files into index - $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'fournisseur/commande/".$this->db->escape($this->newref)."'"; - $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'fournisseur/commande/".$this->db->escape($this->ref)."' and entity = ".$conf->entity; - $resql = $this->db->query($sql); - if (!$resql) { - $error++; $this->error = $this->db->lasterror(); + if (!$error && !$notrigger) { + // Call trigger + $result = $this->call_trigger('ORDER_SUPPLIER_VALIDATE', $user); + if ($result < 0) { + $error++; } + // End call triggers + } - // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments - $oldref = dol_sanitizeFileName($this->ref); - $newref = dol_sanitizeFileName($num); - $dirsource = $conf->fournisseur->commande->dir_output.'/'.$oldref; - $dirdest = $conf->fournisseur->commande->dir_output.'/'.$newref; - if (!$error && file_exists($dirsource)) { - dol_syslog(get_class($this)."::valid rename dir ".$dirsource." into ".$dirdest); + if (!$error) { + $this->oldref = $this->ref; - if (@rename($dirsource, $dirdest)) { - dol_syslog("Rename ok"); - // Rename docs starting with $oldref with $newref - $listoffiles = dol_dir_list($conf->fournisseur->commande->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); - foreach ($listoffiles as $fileentry) { - $dirsource = $fileentry['name']; - $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); - $dirsource = $fileentry['path'].'/'.$dirsource; - $dirdest = $fileentry['path'].'/'.$dirdest; - @rename($dirsource, $dirdest); + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref)) { + // Now we rename also files into index + $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'fournisseur/commande/".$this->db->escape($this->newref)."'"; + $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'fournisseur/commande/".$this->db->escape($this->ref)."' and entity = ".$conf->entity; + $resql = $this->db->query($sql); + if (!$resql) { + $error++; $this->error = $this->db->lasterror(); + } + + // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments + $oldref = dol_sanitizeFileName($this->ref); + $newref = dol_sanitizeFileName($num); + $dirsource = $conf->fournisseur->commande->dir_output.'/'.$oldref; + $dirdest = $conf->fournisseur->commande->dir_output.'/'.$newref; + if (!$error && file_exists($dirsource)) { + dol_syslog(get_class($this)."::valid rename dir ".$dirsource." into ".$dirdest); + + if (@rename($dirsource, $dirdest)) { + dol_syslog("Rename ok"); + // Rename docs starting with $oldref with $newref + $listoffiles = dol_dir_list($conf->fournisseur->commande->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); + foreach ($listoffiles as $fileentry) { + $dirsource = $fileentry['name']; + $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); + $dirsource = $fileentry['path'].'/'.$dirsource; + $dirdest = $fileentry['path'].'/'.$dirdest; + @rename($dirsource, $dirdest); + } } } } } - } - if (!$error) { - $result = 1; - $this->statut = self::STATUS_VALIDATED; - $this->ref = $num; - } + if (!$error) { + $result = 1; + $this->statut = self::STATUS_VALIDATED; + $this->ref = $num; + } - if (!$error) { - $this->db->commit(); - return 1; + if (!$error) { + $this->db->commit(); + return 1; + } else { + $this->db->rollback(); + return -1; + } } else { - $this->db->rollback(); + $this->error = 'NotAuthorized'; + dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); return -1; } - } else { - $this->error = 'NotAuthorized'; - dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); - return -1; - } } /** @@ -1371,7 +1371,7 @@ class CommandeFournisseur extends CommonOrder $this->lines[$i]->date_end, $this->lines[$i]->array_options, $this->lines[$i]->fk_unit - ); + ); if ($result < 0) { dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); // do not use dol_print_error here as it may be a functionnal error $this->db->rollback(); @@ -2708,7 +2708,7 @@ class CommandeFournisseur extends CommonOrder if ($qty < $this->line->packaging) { $qty = $this->line->packaging; } else { - if (! empty($this->line->packaging) && ($qty % $this->line->packaging) > 0) { + if (! empty($this->line->packaging) && ($qty % $this->line->packaging) > 0) { $coeff = intval($qty / $this->line->packaging) + 1; $qty = $this->line->packaging * $coeff; setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs'); diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index 97d04336ee6..d3cfb3fbef3 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -81,7 +81,7 @@ $arrayofparameters = array( //'MYMODULE_MYPARAM4'=>array('type'=>'emailtemplate:thirdparty', 'enabled'=>1), //'MYMODULE_MYPARAM5'=>array('type'=>'yesno', 'enabled'=>1), //'MYMODULE_MYPARAM5'=>array('type'=>'thirdparty_type', 'enabled'=>1), - //'MYMODULE_MYPARAM6'=>array('type'=>'securekey', 'enabled'=>1), + //'MYMODULE_MYPARAM6'=>array('type'=>'securekey', 'enabled'=>1), ); $error = 0; @@ -278,13 +278,13 @@ if ($action == 'edit') { $formcompany = new FormCompany($db); print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname); } elseif ($val['type'] == 'securekey') { - print ''; - if (!empty($conf->use_javascript_ajax)) { - print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); - } - if (!empty($conf->use_javascript_ajax)) { - print "\n".''; - } + print ''; + } } else { print ''; } diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index c413b5e0533..62f26a881b7 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -118,21 +118,21 @@ $extrafields->fetch_name_optionals_label($object->table_element); $arrayfields = array(); /*$arrayfields=array( - // Project - 'p.opp_amount'=>array('label'=>$langs->trans("OpportunityAmountShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>103), - 'p.fk_opp_status'=>array('label'=>$langs->trans("OpportunityStatusShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>104), - 'p.opp_percent'=>array('label'=>$langs->trans("OpportunityProbabilityShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>105), - 'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110), - 'p.usage_bill_time'=>array('label'=>$langs->trans("BillTimeShort"), 'checked'=>0, 'position'=>115), -);*/ + // Project + 'p.opp_amount'=>array('label'=>$langs->trans("OpportunityAmountShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>103), + 'p.fk_opp_status'=>array('label'=>$langs->trans("OpportunityStatusShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>104), + 'p.opp_percent'=>array('label'=>$langs->trans("OpportunityProbabilityShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>105), + 'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110), + 'p.usage_bill_time'=>array('label'=>$langs->trans("BillTimeShort"), 'checked'=>0, 'position'=>115), + );*/ $arrayfields['t.planned_workload'] = array('label'=>'PlannedWorkload', 'checked'=>1, 'enabled'=>1, 'position'=>5); $arrayfields['t.progress'] = array('label'=>'ProgressDeclared', 'checked'=>1, 'enabled'=>1, 'position'=>10); $arrayfields['timeconsumed'] = array('label'=>'TimeConsumed', 'checked'=>1, 'enabled'=>1, 'position'=>15); /*foreach($object->fields as $key => $val) -{ - // If $val['visible']==0, then we never show the field - if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled'], 'position'=>$val['position']); -}*/ + { + // If $val['visible']==0, then we never show the field + if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled'], 'position'=>$val['position']); + }*/ // Definition of fields for list // Extra fields if (is_array($extrafields->attributes['projet_task']['label']) && count($extrafields->attributes['projet_task']['label']) > 0) { @@ -333,9 +333,9 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilterac $param .= ($search_task_label ? '&search_task_label='.urlencode($search_task_label) : ''); /*$search_array_options=$search_array_options_project; - $search_options_pattern='search_options_'; - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; - */ + $search_options_pattern='search_options_'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; + */ $search_array_options = $search_array_options_task; $search_options_pattern = 'search_task_options_'; @@ -394,11 +394,11 @@ if ($search_declared_progress) { $sql = &$morewherefilter; /*$search_array_options = $search_array_options_project; -$extrafieldsobjectprefix='efp.'; -$search_options_pattern='search_options_'; -$extrafieldsobjectkey='projet'; -include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; -*/ + $extrafieldsobjectprefix='efp.'; + $search_options_pattern='search_options_'; + $extrafieldsobjectkey='projet'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; + */ $search_array_options = $search_array_options_task; $extrafieldsobjectprefix = 'efpt.'; $search_options_pattern = 'search_task_options_'; @@ -540,14 +540,14 @@ $moreforfilter = ''; // Filter on categories /* -if (! empty($conf->categorie->enabled)) -{ - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('ProjectCategories'). ': '; - $moreforfilter.=$formother->select_categories('project', $search_categ, 'search_categ', 1, 1, 'maxwidth300'); - $moreforfilter.='
'; -}*/ + if (! empty($conf->categorie->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('ProjectCategories'). ': '; + $moreforfilter.=$formother->select_categories('project', $search_categ, 'search_categ', 1, 1, 'maxwidth300'); + $moreforfilter.='
'; + }*/ // If the user can view user other than himself $moreforfilter .= '
'; @@ -806,7 +806,7 @@ if (count($tasksarray) > 0) { if ($conf->use_javascript_ajax) { print ''; - print ''; + print ''; print $langs->trans("Total"); print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; print ''; @@ -835,7 +835,7 @@ if (count($tasksarray) > 0) { print '
 
'; } print '
 
'; - print ''; + print ''; } } else { print ''.$langs->trans("NoAssignedTasks").''; From 161baa672a68f1b151c3ddba16072f19623f9b33 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Apr 2021 21:11:02 +0200 Subject: [PATCH 173/216] Fix phpcs --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 8 ++++---- .../core/modules/commande/doc/pdf_eratosthene.modules.php | 8 ++++---- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 4 ++-- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 8 ++++---- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 8 ++++---- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 8da25b01132..b759711ac49 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -300,10 +300,10 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Set path to the background PDF File if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { - $logodir = $conf->mycompany->dir_output; - if (!empty($conf->mycompany->multidir_output[$object->entity])) { - $logodir = $conf->mycompany->multidir_output[$object->entity]; - } + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } $pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); $tplidx = $pdf->importPage(1); } diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index f1b64fc4944..2c7171fed8a 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -342,10 +342,10 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Set path to the background PDF File if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { - $logodir = $conf->mycompany->dir_output; - if (!empty($conf->mycompany->multidir_output[$object->entity])) { - $logodir = $conf->mycompany->multidir_output[$object->entity]; - } + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } $pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); $tplidx = $pdf->importPage(1); } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 59dbeeaf207..6ffc043eb5e 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -351,8 +351,8 @@ class pdf_sponge extends ModelePDFFactures // Set path to the background PDF File if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { - $logodir = $conf->mycompany->dir_output; - if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { $logodir = $conf->mycompany->multidir_output[$object->entity]; } $pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 0ef3835c81d..15de98e9a58 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -333,10 +333,10 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Set path to the background PDF File if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { - $logodir = $conf->mycompany->dir_output; - if (!empty($conf->mycompany->multidir_output[$object->entity])) { - $logodir = $conf->mycompany->multidir_output[$object->entity]; - } + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } $pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); $tplidx = $pdf->importPage(1); } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 7b04f7974bd..b7e44c6c4d5 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -337,10 +337,10 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Set path to the background PDF File if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { - $logodir = $conf->mycompany->dir_output; - if (!empty($conf->mycompany->multidir_output[$object->entity])) { - $logodir = $conf->mycompany->multidir_output[$object->entity]; - } + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } $pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); $tplidx = $pdf->importPage(1); } From 1c8a2ce15ab8c51e1cbb19f248bfb12bc616bd3c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Apr 2021 22:12:47 +0200 Subject: [PATCH 174/216] Fix phpcs --- .../class/fournisseur.commande.class.php | 118 +++++++++--------- htdocs/theme/md/style.css.php | 2 +- htdocs/ticket/document.php | 2 +- 3 files changed, 61 insertions(+), 61 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 9d67c420e51..48577e33ef7 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -580,11 +580,11 @@ class CommandeFournisseur extends CommonOrder $soc->fetch($this->fourn_id); // Check if object has a temporary ref - if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life - $num = $this->getNextNumRef($soc); - } else { - $num = $this->ref; - } + if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life + $num = $this->getNextNumRef($soc); + } else { + $num = $this->ref; + } $this->newref = dol_sanitizeFileName($num); $sql = 'UPDATE '.MAIN_DB_PREFIX."commande_fournisseur"; @@ -596,75 +596,75 @@ class CommandeFournisseur extends CommonOrder $sql .= " AND fk_statut = ".self::STATUS_DRAFT; $resql = $this->db->query($sql); - if (!$resql) { - dol_print_error($this->db); + if (!$resql) { + dol_print_error($this->db); + $error++; + } + + if (!$error && !$notrigger) { + // Call trigger + $result = $this->call_trigger('ORDER_SUPPLIER_VALIDATE', $user); + if ($result < 0) { $error++; } + // End call triggers + } - if (!$error && !$notrigger) { - // Call trigger - $result = $this->call_trigger('ORDER_SUPPLIER_VALIDATE', $user); - if ($result < 0) { - $error++; + if (!$error) { + $this->oldref = $this->ref; + + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref)) { + // Now we rename also files into index + $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'fournisseur/commande/".$this->db->escape($this->newref)."'"; + $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'fournisseur/commande/".$this->db->escape($this->ref)."' and entity = ".$conf->entity; + $resql = $this->db->query($sql); + if (!$resql) { + $error++; $this->error = $this->db->lasterror(); } - // End call triggers - } - if (!$error) { - $this->oldref = $this->ref; + // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments + $oldref = dol_sanitizeFileName($this->ref); + $newref = dol_sanitizeFileName($num); + $dirsource = $conf->fournisseur->commande->dir_output.'/'.$oldref; + $dirdest = $conf->fournisseur->commande->dir_output.'/'.$newref; + if (!$error && file_exists($dirsource)) { + dol_syslog(get_class($this)."::valid rename dir ".$dirsource." into ".$dirdest); - // Rename directory if dir was a temporary ref - if (preg_match('/^[\(]?PROV/i', $this->ref)) { - // Now we rename also files into index - $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'fournisseur/commande/".$this->db->escape($this->newref)."'"; - $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'fournisseur/commande/".$this->db->escape($this->ref)."' and entity = ".$conf->entity; - $resql = $this->db->query($sql); - if (!$resql) { - $error++; $this->error = $this->db->lasterror(); - } - - // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments - $oldref = dol_sanitizeFileName($this->ref); - $newref = dol_sanitizeFileName($num); - $dirsource = $conf->fournisseur->commande->dir_output.'/'.$oldref; - $dirdest = $conf->fournisseur->commande->dir_output.'/'.$newref; - if (!$error && file_exists($dirsource)) { - dol_syslog(get_class($this)."::valid rename dir ".$dirsource." into ".$dirdest); - - if (@rename($dirsource, $dirdest)) { - dol_syslog("Rename ok"); - // Rename docs starting with $oldref with $newref - $listoffiles = dol_dir_list($conf->fournisseur->commande->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); - foreach ($listoffiles as $fileentry) { - $dirsource = $fileentry['name']; - $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); - $dirsource = $fileentry['path'].'/'.$dirsource; - $dirdest = $fileentry['path'].'/'.$dirdest; - @rename($dirsource, $dirdest); - } + if (@rename($dirsource, $dirdest)) { + dol_syslog("Rename ok"); + // Rename docs starting with $oldref with $newref + $listoffiles = dol_dir_list($conf->fournisseur->commande->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); + foreach ($listoffiles as $fileentry) { + $dirsource = $fileentry['name']; + $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); + $dirsource = $fileentry['path'].'/'.$dirsource; + $dirdest = $fileentry['path'].'/'.$dirdest; + @rename($dirsource, $dirdest); } } } } + } - if (!$error) { - $result = 1; - $this->statut = self::STATUS_VALIDATED; - $this->ref = $num; - } + if (!$error) { + $result = 1; + $this->statut = self::STATUS_VALIDATED; + $this->ref = $num; + } - if (!$error) { - $this->db->commit(); - return 1; - } else { - $this->db->rollback(); - return -1; - } + if (!$error) { + $this->db->commit(); + return 1; } else { - $this->error = 'NotAuthorized'; - dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); + $this->db->rollback(); return -1; } + } else { + $this->error = 'NotAuthorized'; + dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); + return -1; + } } /** diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 7e0b857eb6d..87a9d6b1b47 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2285,7 +2285,7 @@ li.tmenu:hover { opacity: .50; /* show only a slight shadow */ } li.tmenusel a.tmenusel { - text-decoration: underline !important; + text-decoration: underline !important; } .tmenuend .tmenuleft { width: 0px; } .tmenuend { display: none; } diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index f3d40c1c33e..740061f99ba 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -196,7 +196,7 @@ if ($object->id) { $permtoedit = $user->rights->ticket->write; $param = '&id='.$object->id; - include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { accessforbidden('', 0, 1); } From 25a6aa1388c4382ed300ffcac69d7826faa4cdd0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Apr 2021 22:50:50 +0200 Subject: [PATCH 175/216] NEW Add data-eec=1 for EEC countries on select for js interaction --- htdocs/core/class/html.form.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1df58740864..835810ff065 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -883,7 +883,7 @@ class Form $label = array(); $atleastonefavorite = 0; - $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite"; + $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec"; $sql .= " FROM ".MAIN_DB_PREFIX."c_country"; $sql .= " WHERE active > 0"; //$sql.= " ORDER BY code ASC"; @@ -902,7 +902,8 @@ class Form $countryArray[$i]['code_iso'] = $obj->code_iso; $countryArray[$i]['code_iso3'] = $obj->code_iso3; $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); - $countryArray[$i]['favorite'] = $obj->favorite; + $countryArray[$i]['favorite'] = $obj->favorite; + $countryArray[$i]['eec'] = $obj->eec; $favorite[$i] = $obj->favorite; $label[$i] = dol_string_unaccent($countryArray[$i]['label']); $i++; @@ -959,9 +960,9 @@ class Form } if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) { - $out .= ''; From 7f62b6c49b4fefdb996c254e7a6b26377ba109b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Apr 2021 22:58:37 +0200 Subject: [PATCH 176/216] Look and feel v14 --- htdocs/admin/workflow.php | 8 ++++---- htdocs/core/lib/functions.lib.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 06847066c9d..09156e08588 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -112,7 +112,7 @@ $workflowcodes = array( 'family'=>'classify_supplier_proposal', 'position'=>60, 'enabled'=>(!empty($conf->supplier_proposal->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))), - 'picto'=>'propal', + 'picto'=>'supplier_proposal', 'warning'=>'' ), @@ -121,7 +121,7 @@ $workflowcodes = array( 'family'=>'classify_supplier_order', 'position'=>62, 'enabled'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)), - 'picto'=>'order', + 'picto'=>'supplier_order', 'warning'=>'' ), @@ -130,7 +130,7 @@ $workflowcodes = array( 'family'=>'classify_reception', 'position'=>64, 'enabled'=>(!empty($conf->reception->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))), - 'picto'=>'bill' + 'picto'=>'reception' ), // Automatic classification shipping @@ -229,7 +229,7 @@ foreach ($workflowcodes as $key => $params) { print ''; print ''; - print img_object('', $params['picto']); + print img_object('', $params['picto'], 'class="pictofixedwidth"'); print ' '.$langs->trans('desc'.$key); if (!empty($params['warning'])) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6a98976e261..4de7b9e501c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3526,7 +3526,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'object_lot', 'object_mrp', 'object_other', 'object_payment', 'object_pdf', 'object_product', 'object_propal', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask', - 'object_recruitmentjobposition', 'object_recruitmentcandidature', + 'object_reception', 'object_recruitmentjobposition', 'object_recruitmentcandidature', 'object_salary', 'object_shipment', 'object_share-alt', 'object_supplier_invoice', 'object_supplier_invoicea', 'object_supplier_invoiced', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website', 'object_movement', 'object_workstation', @@ -3581,7 +3581,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'other'=>'square', 'playdisabled'=>'play', 'pdf'=>'file-pdf', 'poll'=>'check-double', 'pos'=>'cash-register', 'preview'=>'binoculars', 'project'=>'project-diagram', 'projectpub'=>'project-diagram', 'projecttask'=>'tasks', 'propal'=>'file-signature', 'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell', - 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', + 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', 'refresh'=>'redo', 'resource'=>'laptop-house', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', @@ -3657,7 +3657,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'holiday'=>'infobox-holiday', 'info'=>'opacityhigh', 'invoice'=>'infobox-commande', 'loan'=>'infobox-bank_account', 'eventorganization'=>'infobox-project', 'payment'=>'infobox-bank_account', 'poll'=>'infobox-adherent', 'pos'=>'infobox-bank_account', 'project'=>'infobox-project', 'projecttask'=>'infobox-project', 'propal'=>'infobox-propal', - 'recruitmentjobposition'=>'infobox-adherent', 'recruitmentcandidature'=>'infobox-adherent', + 'reception'=>'flip', 'recruitmentjobposition'=>'infobox-adherent', 'recruitmentcandidature'=>'infobox-adherent', 'resource'=>'infobox-action', 'salary'=>'infobox-bank_account', 'supplier_invoice'=>'infobox-order_supplier', 'supplier_invoicea'=>'infobox-order_supplier', 'supplier_invoiced'=>'infobox-order_supplier', 'supplier_order'=>'infobox-order_supplier', 'supplier_proposal'=>'infobox-supplier_proposal', @@ -3678,7 +3678,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'dolly'=>'#a69944', 'dollyrevert'=>'#a69944', 'lot'=>'#a69944', 'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'inventory'=>'#a69944', 'stock'=>'#a69944', 'movement'=>'#a69944', 'other'=>'#ddd', - 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'resize'=>'#444', 'rss'=>'#cba', + 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'reception'=>'#a69944', 'resize'=>'#444', 'rss'=>'#cba', 'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'technic'=>'#999', 'timespent'=>'#555', 'uparrow'=>'#555', 'user-cog'=>'#999', 'country'=>'#aaa', 'globe-americas'=>'#aaa', 'website'=>'#304', 'workstation'=>'#a69944' ); From db83428e8959a43c034010179eab4da06b907164 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Wed, 14 Apr 2021 00:15:02 +0200 Subject: [PATCH 177/216] Notes improvements --- htdocs/takepos/css/pos.css.php | 2 +- htdocs/takepos/index.php | 19 +++++++++++++++++-- htdocs/takepos/invoice.php | 11 ++++++++--- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index 12dd2836ea2..e180dc33b3e 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -751,7 +751,7 @@ div#moreinfo, div#infowarehouse { border: none; color: white; background-color: #8c907e; - padding: 14px 28px; + padding: 14px 0px; font-size: 16px; cursor: pointer; text-align: center; diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 432afdea73a..93d9be71d5a 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -486,7 +486,8 @@ function FreeZone() { function TakeposOrderNotes() { console.log("Open box to order notes"); - $.colorbox({href:"freezone.php?action=addnote&place="+place+"&idline="+selectedline, onClosed: function () { Refresh(); },width:"80%", height:"250px", transition:"none", iframe:"true", title:"trans("OrderNotes"); ?>"}); + ModalBox('ModalNote'); + $("#textinput").focus(); } function Refresh() { @@ -918,6 +919,20 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
+
+ + +
global->TAKEPOS_ORDER_NOTES == 1) { - $menus[$r++] = array('title'=>'
'.$langs->trans("OrderNotes").'
', 'action'=>'TakeposOrderNotes();'); + $menus[$r++] = array('title'=>'
'.$langs->trans("OrderNotes").'
', 'action'=>'TakeposOrderNotes();'); } if ($conf->global->TAKEPOS_SUPPLEMENTS) { $menus[$r++] = array('title'=>'
'.$langs->trans("ProductSupplements").'
', 'action'=>'LoadProducts(\'supplements\');'); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index d73f6499c93..c7a01e5d8bc 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -565,9 +565,9 @@ if ($action == "freezone") { if ($action == "addnote") { foreach ($invoice->lines as $line) { - if ($line->id == $number) { - $line->array_options['order_notes'] = $desc; - $result = $invoice->updateline($line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); + if ($line->id == $idline) { + $desc = GETPOST('addnote', 'alpha'); + $result = $invoice->updateline($line->id, $desc, $line->subprice, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); } } $invoice->fetch($placeid); @@ -1019,6 +1019,11 @@ function CreditNote() { }); } +function SetNote() { + $("#poslines").load("invoice.php?action=addnote&invoiceid="+placeid+"&idline="+selectedline+"&addnote="+$("#textinput").val(), function() { + }); +} + $( document ).ready(function() { console.log("Set customer info and sales in header placeid= status=statut; ?>"); From 88f95b7f9b0c264f39d4e4ce05d188a55db5bbfa Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 14 Apr 2021 00:32:49 +0200 Subject: [PATCH 178/216] Update index.php --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 93d9be71d5a..4c3ef11294f 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -926,7 +926,7 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {