From 530b122f1eec0cd16cd8136bab6c7714ba1a1a0b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 1 Apr 2021 04:37:47 +0200 Subject: [PATCH 001/140] 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/140] 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/140] 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/140] 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/140] 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/140] 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/140] 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/140] 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/140] 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 c04387ff3b5bdcd72c0e4c4fbe25ecb2b4105b00 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 6 Apr 2021 11:52:04 +0200 Subject: [PATCH 010/140] Close #17108 : New button to convert images in webp format --- htdocs/langs/en_US/website.lang | 4 ++++ htdocs/website/index.php | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index c23f4425dca..bb656d85a7b 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -141,3 +141,7 @@ GenerateSitemaps=Generate website sitemap file ConfirmGenerateSitemaps=If you confirm, you will erase the existing sitemap file... ConfirmSitemapsCreation=Confirm sitemap generation SitemapGenerated=Sitemap Generated +GenerateImgWebp=Convert all images into webp +ConfirmGenerateImgWebp=If you confirm, you will generate all website's images in webp format... +ConfirmImgWebpCreation=Confirm all images convertion +SucessConvertImgWebp=Images successfully converted \ No newline at end of file diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 26ca6df9bf8..a6b31e0bb39 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2230,7 +2230,31 @@ if ($action == 'generatesitemaps' && $usercanedit) { } $action = 'preview'; } - +$imagefolder = $conf->website->dir_output.'/'.$websitekey.'/medias/image/'.$websitekey.'/'; +if ($action == 'convertimgwebp' && $usercanedit) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + $filelist = dol_dir_list($imagefolder, "all", 1); + foreach ($filelist as $filename) { + $filepath = $filename['fullname']; + if (!(substr_compare($filepath, 'webp', -strlen('webp')) === 0)) { + if (image_format_supported($filepath) == 1) { + $filepathnoext = preg_replace("/\..*/", "", $filepath); + $result = dol_imageResizeOrCrop($filepath, 0, 0, 0, 0, 0, $filepathnoext.'.webp'); + if (!dol_is_file($result)) { + $error++; + setEventMessages($result, null, 'errors'); + } + } + } + if ($error) { + break; + } + } + if (!$error) { + setEventMessages($langs->trans('SucessConvertImgWebp'), null); + } + $action = 'preview'; +} /* * View @@ -2246,7 +2270,10 @@ if ($action == 'confirmgeneratesitemaps') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$website->ref, $langs->trans('ConfirmSitemapsCreation'), $langs->trans('ConfirmGenerateSitemaps', $object->ref), 'generatesitemaps', '', "yes", 1); $action = 'preview'; } - +if ($action == 'confirmconvertimgwebp') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$website->ref, $langs->trans('ConfirmImgWebpCreation'), $langs->trans('ConfirmGenerateImgWebp', $object->ref), 'convertimgwebp', '', "yes", 1); + $action = 'preview'; +} $helpurl = 'EN:Module_Website|FR:Module_Website_FR|ES:Módulo_Website'; $arrayofjs = array( @@ -2465,6 +2492,7 @@ if (!GETPOST('hide_websitemenu')) { // Generate site map print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("GenerateSitemaps")).'">'; + print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("GenerateImgWebp")).'">'; print '   '; print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'">'; From c44522594aa58a6bd84642277a3dade221a89844 Mon Sep 17 00:00:00 2001 From: kamel Date: Tue, 6 Apr 2021 16:04:30 +0200 Subject: [PATCH 011/140] FIX: Fix when add or modify ressources on events with duplicate entries --- htdocs/comm/action/class/actioncomm.class.php | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a1c0ee2badf..b352e405bd2 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -590,9 +590,11 @@ class ActionComm extends CommonObject $resql = $this->db->query($sql); if (!$resql) { - $error++; - dol_syslog('Error to process userassigned: '.$this->db->lasterror(), LOG_ERR); - $this->errors[] = $this->db->lasterror(); + if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $error++; + dol_syslog('Error to process userassigned: ' . $this->db->lasterror(), LOG_ERR); + $this->errors[] = $this->db->lasterror(); + } } //var_dump($sql);exit; } @@ -607,9 +609,11 @@ class ActionComm extends CommonObject $resql = $this->db->query($sql); if (!$resql) { - $error++; - dol_syslog('Error to process socpeopleassigned: '.$this->db->lasterror(), LOG_ERR); - $this->errors[] = $this->db->lasterror(); + if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $error++; + dol_syslog('Error to process socpeopleassigned: ' . $this->db->lasterror(), LOG_ERR); + $this->errors[] = $this->db->lasterror(); + } } } } @@ -1152,8 +1156,10 @@ class ActionComm extends CommonObject $resql = $this->db->query($sql); if (!$resql) { - $error++; - $this->errors[] = $this->db->lasterror(); + if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $error++; + $this->errors[] = $this->db->lasterror(); + } } //var_dump($sql);exit; } @@ -1170,8 +1176,10 @@ class ActionComm extends CommonObject $resql = $this->db->query($sql); if (!$resql) { - $error++; - $this->errors[] = $this->db->lasterror(); + if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $error++; + $this->errors[] = $this->db->lasterror(); + } } } } From 4d60fe8ff9ff9c3971185b0a2307fe785cef41a6 Mon Sep 17 00:00:00 2001 From: Indelog Date: Tue, 6 Apr 2021 22:21:00 +0200 Subject: [PATCH 012/140] 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 013/140] 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 014/140] 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 015/140] 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 fcc27e9177454c784969549bfdc68bdcc0cb749c Mon Sep 17 00:00:00 2001 From: kamel Date: Wed, 7 Apr 2021 09:49:20 +0200 Subject: [PATCH 016/140] Corrections --- htdocs/comm/action/class/actioncomm.class.php | 48 ++++++++++++------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index b352e405bd2..1e506526a1d 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -579,22 +579,25 @@ class ActionComm extends CommonObject // Now insert assigned users if (!$error) { //dol_syslog(var_export($this->userassigned, true)); + $already_inserted = array(); foreach ($this->userassigned as $key => $val) { if (!is_array($val)) { // For backward compatibility when val=id $val = array('id'=>$val); } if ($val['id'] > 0) { + if (!empty($already_inserted[$val['id']])) continue; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)"; $sql .= " VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['mandatory']) ? '0' : $val['mandatory']).", ".(empty($val['transparency']) ? '0' : $val['transparency']).", ".(empty($val['answer_status']) ? '0' : $val['answer_status']).")"; $resql = $this->db->query($sql); if (!$resql) { - if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') { - $error++; - dol_syslog('Error to process userassigned: ' . $this->db->lasterror(), LOG_ERR); - $this->errors[] = $this->db->lasterror(); - } + $error++; + dol_syslog('Error to process userassigned: ' . $this->db->lasterror(), LOG_ERR); + $this->errors[] = $this->db->lasterror(); + } else { + $already_inserted[$val['id']] = true; } //var_dump($sql);exit; } @@ -603,17 +606,20 @@ class ActionComm extends CommonObject if (!$error) { if (!empty($this->socpeopleassigned)) { + $already_inserted = array(); foreach ($this->socpeopleassigned as $id => $val) { + if (!empty($already_inserted[$val['id']])) continue; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)"; $sql .= " VALUES(".$this->id.", 'socpeople', ".$id.", 0, 0, 0)"; $resql = $this->db->query($sql); if (!$resql) { - if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') { - $error++; - dol_syslog('Error to process socpeopleassigned: ' . $this->db->lasterror(), LOG_ERR); - $this->errors[] = $this->db->lasterror(); - } + $error++; + dol_syslog('Error to process socpeopleassigned: ' . $this->db->lasterror(), LOG_ERR); + $this->errors[] = $this->db->lasterror(); + } else { + $already_inserted[$val['id']] = true; } } } @@ -1147,19 +1153,22 @@ class ActionComm extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources where fk_actioncomm = ".$this->id." AND element_type = 'user'"; $resql = $this->db->query($sql); + $already_inserted = array(); foreach ($this->userassigned as $key => $val) { if (!is_array($val)) { // For backward compatibility when val=id $val = array('id'=>$val); } + if (!empty($already_inserted[$val['id']])) continue; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)"; $sql .= " VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['mandatory']) ? '0' : $val['mandatory']).", ".(empty($val['transparency']) ? '0' : $val['transparency']).", ".(empty($val['answer_status']) ? '0' : $val['answer_status']).")"; $resql = $this->db->query($sql); if (!$resql) { - if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') { - $error++; - $this->errors[] = $this->db->lasterror(); - } + $error++; + $this->errors[] = $this->db->lasterror(); + } else { + $already_inserted[$val['id']] = true; } //var_dump($sql);exit; } @@ -1170,16 +1179,19 @@ class ActionComm extends CommonObject $resql = $this->db->query($sql); if (!empty($this->socpeopleassigned)) { + $already_inserted = array(); foreach (array_keys($this->socpeopleassigned) as $id) { + if (!empty($already_inserted[$val['id']])) continue; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)"; $sql .= " VALUES(".$this->id.", 'socpeople', ".$id.", 0, 0, 0)"; $resql = $this->db->query($sql); if (!$resql) { - if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') { - $error++; - $this->errors[] = $this->db->lasterror(); - } + $error++; + $this->errors[] = $this->db->lasterror(); + } else { + $already_inserted[$val['id']] = true; } } } From 426e846f5874240eedfb1c6460472cf750a5c851 Mon Sep 17 00:00:00 2001 From: Indelog Date: Wed, 7 Apr 2021 10:01:05 +0200 Subject: [PATCH 017/140] 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 113db33a24b3aea9dd4276dfae98bf220bae6a89 Mon Sep 17 00:00:00 2001 From: Pierre Payet Date: Wed, 7 Apr 2021 10:24:02 +0200 Subject: [PATCH 018/140] 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 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/140] 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/140] 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 49b397070000d84dacdbea74e454177fdbd7785f Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 7 Apr 2021 11:13:14 +0200 Subject: [PATCH 021/140] Close #17113 : Can upload a favicon in website module --- htdocs/langs/en_US/website.lang | 3 +++ htdocs/website/index.php | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index c23f4425dca..c62937029cf 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -141,3 +141,6 @@ GenerateSitemaps=Generate website sitemap file ConfirmGenerateSitemaps=If you confirm, you will erase the existing sitemap file... ConfirmSitemapsCreation=Confirm sitemap generation SitemapGenerated=Sitemap Generated +ImportFavicon=Favicon +ErrorFaviconType=Favicon must be png +ErrorFaviconSize=Favicon must be of size 32x32 \ No newline at end of file diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 26ca6df9bf8..e4e27ec6c88 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/website2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formwebsite.class.php'; @@ -1313,6 +1314,37 @@ if ($action == 'updatecss' && $usercanedit) { } } + if (!$error) { + if (($_FILES['addedfile']["name"] != '')) { + $uploadfolder = $conf->website->dir_output.'/'.$websitekey; + if ($_FILES['addedfile']['type'] != 'image/png') { + $error++; + setEventMessages($langs->trans('ErrorFaviconType'), array(), 'errors'); + } + $filetoread = realpath(dol_osencode($_FILES['addedfile']['tmp_name'])); + $filesize = getimagesize($filetoread); + if ($filesize[0] != 32 || $filesize[1] != 32) { + $error++; + setEventMessages($langs->trans('ErrorFaviconSize'), array(), 'errors'); + } + if (!$error) { + dol_add_file_process($uploadfolder, 1, 0, 'addedfile', 'favicon.png'); + } + } + if ($error) { + if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect + $action = 'preview'; + if ($backtopage) { + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url + header("Location: ".$backtopage); + exit; + } + } else { + $action = 'editcss'; + } + } + } + if (!$error) { // Save master.inc.php file dol_syslog("Save master file ".$filemaster); @@ -3118,6 +3150,13 @@ if ($action == 'editcss') { print ''; print ''; + // Favicon + print ''; + print $langs->trans('ImportFavicon'); + print ''; + print ''; + print ''; + // CSS file print ''; $htmlhelp = $langs->trans("CSSContentTooltipHelp"); From 0611db68cfc698651fe24a3f4fa9d63123ced06a Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 7 Apr 2021 11:21:41 +0200 Subject: [PATCH 022/140] add of tooltip --- htdocs/langs/en_US/website.lang | 3 ++- htdocs/website/index.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index c62937029cf..9396332d01f 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -143,4 +143,5 @@ ConfirmSitemapsCreation=Confirm sitemap generation SitemapGenerated=Sitemap Generated ImportFavicon=Favicon ErrorFaviconType=Favicon must be png -ErrorFaviconSize=Favicon must be of size 32x32 \ No newline at end of file +ErrorFaviconSize=Favicon must be of size 32x32 +FaviconTooltip=Upload an image which needs to be a png of 32x32 \ No newline at end of file diff --git a/htdocs/website/index.php b/htdocs/website/index.php index e4e27ec6c88..5f040e499e6 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3152,7 +3152,7 @@ if ($action == 'editcss') { // Favicon print ''; - print $langs->trans('ImportFavicon'); + print $form->textwithpicto($langs->trans('ImportFavicon'), $langs->trans('FaviconTooltip')); print ''; print ''; print ''; From 999be03f8dd3037e14c0e079eea4fe7a6724b866 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Wed, 7 Apr 2021 12:36:30 +0200 Subject: [PATCH 023/140] fix: new member public page firstname test --- htdocs/public/members/new.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index d8c25bbebbb..e6b7a3e7a38 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -218,7 +218,7 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n"; } - if (GETPOST("firstname")) { + if (!GETPOST("firstname")) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n"; } From 9997ac59c753baae4794d1e78ba0cd1699f9f297 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Apr 2021 12:38:49 +0200 Subject: [PATCH 024/140] Update llx_20_c_departements.sql Honduras Departamentos --- .../mysql/data/llx_20_c_departements.sql | 71 ++++++++++--------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index 7d4372de604..e4256374c13 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -48,6 +48,7 @@ -- Colombia -- France -- Germany +-- Honduras -- (Italy) -- Luxembourg @@ -422,6 +423,28 @@ INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (5 INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'TH', 'THÜRINGEN', 'Thüringen'); +-- Honduras Departamentos (id country=114) +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'AT', '', 0, 'AT', 'Atlántida'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'CH', '', 0, 'CH', 'Choluteca'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'CL', '', 0, 'CL', 'Colón'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'CM', '', 0, 'CM', 'Comayagua'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'CO', '', 0, 'CO', 'Copán'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'CR', '', 0, 'CR', 'Cortés'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'EP', '', 0, 'EP', 'El Paraíso'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'FM', '', 0, 'FM', 'Francisco Morazán'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'GD', '', 0, 'GD', 'Gracias a Dios'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'IN', '', 0, 'IN', 'Intibucá'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'IB', '', 0, 'IB', 'Islas de la Bahía'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'LP', '', 0, 'LP', 'La Paz'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'LM', '', 0, 'LM', 'Lempira'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'OC', '', 0, 'OC', 'Ocotepeque'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'OL', '', 0, 'OL', 'Olancho'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'SB', '', 0, 'SB', 'Santa Bárbara'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'VL', '', 0, 'VL', 'Valle'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'YO', '', 0, 'YO', 'Yoro'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'DC', '', 0, 'DC', 'Distrito Central'); + + -- 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'); @@ -660,6 +683,7 @@ 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('TN23', 1001, '', 0, '', 'Tunis', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN24', 1001, '', 0, '', 'Zaghouan', 1); + -- Provinces Bolivia (id country=52) INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('001', 5201, '', 0, '', 'Belisario Boeto', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('002', 5201, '', 0, '', 'Hernando Siles', 1); @@ -1103,19 +1127,21 @@ 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 ('WI', 1101, '', 0, 'WISCONSIN', 'Wisconsin', 1); insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('WY', 1101, '', 0, 'WYOMING', 'Wyoming', 1); + -- Provincies van het Koninkrijk der Nederlanden (id country=17) -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom,active) VALUES ('GR',1701,NULL,NULL,NULL,'Groningen',1); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom,active) VALUES ('FR',1701,NULL,NULL,NULL,'Friesland',1); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom,active) VALUES ('DR',1701,NULL,NULL,NULL,'Drenthe',1); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom,active) VALUES ('OV',1701,NULL,NULL,NULL,'Overijssel',1); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom,active) VALUES ('GD',1701,NULL,NULL,NULL,'Gelderland',1); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom,active) VALUES ('FL',1701,NULL,NULL,NULL,'Flevoland',1); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom,active) VALUES ('UT',1701,NULL,NULL,NULL,'Utrecht',1); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom,active) VALUES ('NH',1701,NULL,NULL,NULL,'Noord-Holland',1); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom,active) VALUES ('ZH',1701,NULL,NULL,NULL,'Zuid-Holland',1); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom,active) VALUES ('ZL',1701,NULL,NULL,NULL,'Zeeland',1); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom,active) VALUES ('NB',1701,NULL,NULL,NULL,'Noord-Brabant',1); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom,active) VALUES ('LB',1701,NULL,NULL,NULL,'Limburg',1); +INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('GR',1701,NULL,NULL,NULL,'Groningen'); +INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('FR',1701,NULL,NULL,NULL,'Friesland'); +INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('DR',1701,NULL,NULL,NULL,'Drenthe'); +INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('OV',1701,NULL,NULL,NULL,'Overijssel'); +INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('GD',1701,NULL,NULL,NULL,'Gelderland'); +INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('FL',1701,NULL,NULL,NULL,'Flevoland'); +INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('UT',1701,NULL,NULL,NULL,'Utrecht'); +INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('NH',1701,NULL,NULL,NULL,'Noord-Holland'); +INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('ZH',1701,NULL,NULL,NULL,'Zuid-Holland'); +INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('ZL',1701,NULL,NULL,NULL,'Zeeland'); +INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('NB',1701,NULL,NULL,NULL,'Noord-Brabant'); +INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('LB',1701,NULL,NULL,NULL,'Limburg'); + -- San Salvador (id country=86) INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SS', 8601, '', 0, '', 'San Salvador', 1); @@ -1299,27 +1325,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 Honduras (id country=114) -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AT', 11401, '', 0, 'AT', 'Atlántida', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CH', 11401, '', 0, 'CH', 'Choluteca', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CL', 11401, '', 0, 'CL', 'Colón', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CM', 11401, '', 0, 'CM', 'Comayagua', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CO', 11401, '', 0, 'CO', 'Copán', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CR', 11401, '', 0, 'CR', 'Cortés', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('EP', 11401, '', 0, 'EP', 'El Paraíso', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('FM', 11401, '', 0, 'FM', 'Francisco Morazán', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('GD', 11401, '', 0, 'GD', 'Gracias a Dios', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('IN', 11401, '', 0, 'IN', 'Intibucá', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('IB', 11401, '', 0, 'IB', 'Islas de la Bahía', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LP', 11401, '', 0, 'LP', 'La Paz', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LM', 11401, '', 0, 'LM', 'Lempira', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('OC', 11401, '', 0, 'OC', 'Ocotepeque', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('OL', 11401, '', 0, 'OL', 'Olancho', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SB', 11401, '', 0, 'SB', 'Santa Bárbara', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VL', 11401, '', 0, 'VL', 'Valle', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('YO', 11401, '', 0, 'YO', 'Yoro', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('DC', 11401, '', 0, 'DC', 'Distrito Central', 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); From 41db9abff8a8155fe465b81c1800814281205703 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 7 Apr 2021 12:46:28 +0200 Subject: [PATCH 025/140] Close #17145 : add link to autofill with expected qty --- htdocs/langs/en_US/stocks.lang | 3 ++- htdocs/product/inventory/inventory.php | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 59f510a6bf2..4d1713266f6 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -253,4 +253,5 @@ LabelOfInventoryMovemement=Inventory %s ReOpen=Reopen ConfirmFinish=Do you confirm the closing of the inventory ? This will generate all stock movements to update your stock. ObjectNotFound=%s not found -MakeMovementsAndClose=Generate movements and close \ No newline at end of file +MakeMovementsAndClose=Generate movements and close +AutofillWithExpected=Auto-fill with real quantity expected quantity \ No newline at end of file diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 8d3378fb779..764c1bd78c9 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -466,6 +466,20 @@ if ($object->id > 0) { } else { print ''.$langs->trans("Save").''."\n"; } + if ($permissiontoadd && $conf->use_javascript_ajax) { + print ' '; + print ''; + print ''.$langs->trans('AutofillWithExpected').''; + } print '
'; print '
'; print ''; @@ -603,13 +617,13 @@ if ($object->id > 0) { print ''; } - print ''; + print ''; print $obj->qty_stock; print ''; print ''; if ($object->status == $object::STATUS_VALIDATED) { $qty_view = GETPOST("id_".$obj->rowid) ? GETPOST("id_".$obj->rowid) : $obj->qty_view; - print ''; + print ''; print ''; print ''; print ''.img_delete().''; From 843882c7c799dbe62216fcce89615a1f93b73fae Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 7 Apr 2021 12:46:51 +0200 Subject: [PATCH 026/140] update stock.lang --- htdocs/langs/en_US/stocks.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 4d1713266f6..b3f01b00cf7 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -254,4 +254,4 @@ ReOpen=Reopen ConfirmFinish=Do you confirm the closing of the inventory ? This will generate all stock movements to update your stock. ObjectNotFound=%s not found MakeMovementsAndClose=Generate movements and close -AutofillWithExpected=Auto-fill with real quantity expected quantity \ No newline at end of file +AutofillWithExpected=Auto-fill expected quantity with real quantity \ No newline at end of file From efb88936fd6ff74cb3942e08795602fc7d0b9c29 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Apr 2021 12:49:52 +0200 Subject: [PATCH 027/140] Update llx_10_c_regions.sql Greece --- .../install/mysql/data/llx_10_c_regions.sql | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index 7d370bf0bd0..40e9aca2407 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -63,6 +63,7 @@ -- Colombie -> for Departmements -- France -- Germany -> for Departmements +-- Greece @@ -159,19 +160,19 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 5 -- Greece Regions (id_country=102) -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10201, 102, NULL, NULL, 'Αττική', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10202, 102, NULL, NULL, 'Στερεά Ελλάδα', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10203, 102, NULL, NULL, 'Κεντρική Μακεδονία', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10204, 102, NULL, NULL, 'Κρήτη', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10205, 102, NULL, NULL, 'Ανατολική Μακεδονία και Θράκη', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10206, 102, NULL, NULL, 'Ήπειρος', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10207, 102, NULL, NULL, 'Ιόνια νησιά', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10208, 102, NULL, NULL, 'Βόρειο Αιγαίο', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10209, 102, NULL, NULL, 'Πελοπόννησος', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10210, 102, NULL, NULL, 'Νότιο Αιγαίο', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10211, 102, NULL, NULL, 'Δυτική Ελλάδα', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10212, 102, NULL, NULL, 'Θεσσαλία', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10213, 102, NULL, NULL, 'Δυτική Μακεδονία', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (102, 10201, NULL, NULL, 'Αττική'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (102, 10202, NULL, NULL, 'Στερεά Ελλάδα'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (102, 10203, NULL, NULL, 'Κεντρική Μακεδονία'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (102, 10204, NULL, NULL, 'Κρήτη'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (102, 10205, NULL, NULL, 'Ανατολική Μακεδονία και Θράκη'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (102, 10206, NULL, NULL, 'Ήπειρος'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (102, 10207, NULL, NULL, 'Ιόνια νησιά'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (102, 10208, NULL, NULL, 'Βόρειο Αιγαίο'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (102, 10209, NULL, NULL, 'Πελοπόννησος'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (102, 10210, NULL, NULL, 'Νότιο Αιγαίο'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (102, 10211, NULL, NULL, 'Δυτική Ελλάδα'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (102, 10212, NULL, NULL, 'Θεσσαλία'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (102, 10213, NULL, NULL, 'Δυτική Μακεδονία'); -- Regions Italy (id country=3) @@ -196,6 +197,7 @@ insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 31 insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 319, NULL, 1, 'Valle d Aosta'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 320, NULL, 1, 'Veneto'); + -- Regions Spain (id country=4) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 401, '', 0, 'Andalucia', 1); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 402, '', 0, 'Aragón', 1); From 7be9a98ef03e770f912f5d00392ed675740333ed Mon Sep 17 00:00:00 2001 From: Florent Peyraud Date: Wed, 7 Apr 2021 13:51:08 +0200 Subject: [PATCH 028/140] Add bill tax code article for non profit organization VAT --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 6 +++++- htdocs/langs/fr_FR/bills.lang | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 1d3211407c5..1203943ab91 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1025,7 +1025,11 @@ class pdf_crabe extends ModelePDFFactures if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + if ($mysoc->forme_juridique_code == 92) { + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoiceAsso"), 0, 'L', 0); + } else { + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + } $posy = $pdf->GetY() + 4; } diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index b5588c21df3..342924e1680 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -464,6 +464,7 @@ PaymentByChequeOrderedToShort=Règlement TTC par chèque à l'ordre de SendTo=envoyé à PaymentByTransferOnThisBankAccount=Règlement par virement sur le compte bancaire suivant VATIsNotUsedForInvoice=* TVA non applicable art-293B du CGI +VATIsNotUsedForInvoiceAsso=* TVA non applicable art-261-7 du CGI LawApplicationPart1=Par application de la loi 80.335 du 12/05/80 LawApplicationPart2=les marchandises demeurent la propriété du LawApplicationPart3=vendeur jusqu'à complet encaissement de From c06cc6d75aaa1cd449e64ea24199167435cae1d0 Mon Sep 17 00:00:00 2001 From: kamel Date: Wed, 7 Apr 2021 17:28:13 +0200 Subject: [PATCH 029/140] NEW : Add new permok for edit extrafields on contact card --- htdocs/core/tpl/extrafields_view.tpl.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 9f77eaca415..d1613cee7e9 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -182,6 +182,9 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] if ($object->element == 'mo') { $permok = $user->rights->mrp->write; } + if ($object->element == 'contact') { + $permok = $user->rights->societe->contact->creer; + } $isdraft = ((isset($object->statut) && $object->statut == 0) || (isset($object->status) && $object->status == 0)); if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$tmpkeyextra])) From 87d4e6e2c5209d380c386a1d32be2e8810726286 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Apr 2021 19:07:22 +0200 Subject: [PATCH 030/140] Add option API_DISABLE_LOGIN_API --- htdocs/api/class/api_login.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/api/class/api_login.class.php b/htdocs/api/class/api_login.class.php index b9666269cc1..5209cc51157 100644 --- a/htdocs/api/class/api_login.class.php +++ b/htdocs/api/class/api_login.class.php @@ -58,7 +58,11 @@ class Login { global $conf, $dolibarr_main_authentication, $dolibarr_auto_user; - // TODO Remove the API login. The token must be generated from backoffice only. + // Is the login API disabled ? The token must be generated from backoffice only. + if (! empty($conf->global->API_DISABLE_LOGIN_API)) { + dol_syslog("Warning: A try to use the login API has been done while the login API is disabled. You must generate or get the token from the backoffice.", LOG_WARNING); + throw new RestException(403, "Error, the login API has been disabled for security purpose. You must generate or get the token from the backoffice."); + } // Authentication mode if (empty($dolibarr_main_authentication)) { @@ -87,7 +91,7 @@ class Login } include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - $login = checkLoginPassEntity($login, $password, $entity, $authmode, 'api'); + $login = checkLoginPassEntity($login, $password, $entity, $authmode, 'api'); // Check credentials. if (empty($login)) { throw new RestException(403, 'Access denied'); } From 2d6eb2809ca7076a17f88c203fde701fe13a00b3 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:08:41 +0200 Subject: [PATCH 031/140] Create index.html --- htdocs/mrp/ajax/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/mrp/ajax/index.html diff --git a/htdocs/mrp/ajax/index.html b/htdocs/mrp/ajax/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/mrp/ajax/index.html @@ -0,0 +1 @@ + From 49a6654b58c5ee2d6610f5825169563b7dd5e752 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:09:16 +0200 Subject: [PATCH 032/140] Create index.html --- htdocs/mrp/class/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/mrp/class/index.html diff --git a/htdocs/mrp/class/index.html b/htdocs/mrp/class/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/mrp/class/index.html @@ -0,0 +1 @@ + From 2d6bbf1e87dea94d118edb731c39ca7befa48d64 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:10:13 +0200 Subject: [PATCH 033/140] Create index.html --- htdocs/mrp/js/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/mrp/js/index.html diff --git a/htdocs/mrp/js/index.html b/htdocs/mrp/js/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/mrp/js/index.html @@ -0,0 +1 @@ + From 2fd18ca836d9681e73d2ae2ae897ed0162ca95cf Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:12:04 +0200 Subject: [PATCH 034/140] Create index.html --- htdocs/mrp/tpl/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/mrp/tpl/index.html diff --git a/htdocs/mrp/tpl/index.html b/htdocs/mrp/tpl/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/mrp/tpl/index.html @@ -0,0 +1 @@ + From 3315bf6c00d51422c439db9118c646aa24e29203 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Apr 2021 19:16:07 +0200 Subject: [PATCH 035/140] Add samples to show how to setup fail2ban --- .../web-dolibarr-rulesbruteforce.conf | 20 +++++++++++++ .../web-dolibarr-rulespassforgotten.conf | 20 +++++++++++++ dev/setup/fail2ban/jail.local | 28 +++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf create mode 100644 dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf create mode 100644 dev/setup/fail2ban/jail.local diff --git a/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf b/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf new file mode 100644 index 00000000000..d5922909ba9 --- /dev/null +++ b/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf @@ -0,0 +1,20 @@ +# Fail2Ban configuration file +# +# Regexp to catch known spambots and software alike. Please verify +# that it is your intent to block IPs which were driven by +# above mentioned bots. + + +[Definition] + +# To test, you can inject this example into log +# echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 functions_dolibarr::check_user_password_abcd Authentication KO" >> /mypath/documents/dolibarr.log +# +# then +# fail2ban-client status web-dol-bruteforce +# +# To test rule file on a existing log file +# fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf + +failregex = ^ [A-Z\s]+ \s+functions_dolibarr::check_user_password_.* Authentication KO +ignoreregex = diff --git a/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf b/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf new file mode 100644 index 00000000000..edc2ca68092 --- /dev/null +++ b/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf @@ -0,0 +1,20 @@ +# Fail2Ban configuration file +# +# Regexp to catch known spambots and software alike. Please verify +# that it is your intent to block IPs which were driven by +# above mentioned bots. + + +[Definition] + +# To test, you can inject this example into log +# echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 --- Access to GET /passwordforgotten.php - action=buildnewpassword, massaction=" >> /mypath/documents/dolibarr.log +# +# then +# fail2ban-client status web-dol-passforgotten +# +# To test rule file on a existing log file +# fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf + +failregex = ^ [A-Z\s]+ \s+--- Access to .*/passwordforgotten.php - action=buildnewpassword +ignoreregex = diff --git a/dev/setup/fail2ban/jail.local b/dev/setup/fail2ban/jail.local new file mode 100644 index 00000000000..bd506e20812 --- /dev/null +++ b/dev/setup/fail2ban/jail.local @@ -0,0 +1,28 @@ +# +# Examle of rule you can add to fail2ban to restrict bruteforce attacks. +# + +[web-dol-passforgotten] + +; rule against call of passwordforgottenpage +enabled = true +port = http,https +filter = web-dolibarr-rulespassforgotten +logpath = >> /mypath/documents/documents/dolibarr.log +action = %(action_mw)s +bantime = 4320000 ; 50 days +findtime = 86400 ; 1 day +maxretry = 10 + +[web-dol-bruteforce] + +; rule against bruteforce hacking (login + api) +enabled = true +port = http,https +filter = web-dolibarr-rulesbruteforce +logpath = >> /mypath/documents/documents/dolibarr.log +action = %(action_mw)s +bantime = 86400 ; 1 day +findtime = 3600 ; 1 hour +maxretry = 10 + From a144ae147f8e7e6c50edb5073930cef129766bb3 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:36:13 +0200 Subject: [PATCH 036/140] Create index.html --- htdocs/fourn/js/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/fourn/js/index.html diff --git a/htdocs/fourn/js/index.html b/htdocs/fourn/js/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/fourn/js/index.html @@ -0,0 +1 @@ + From 1e1b963ca74785f3b07d83f89b978d34fcbd7f2a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Apr 2021 19:38:54 +0200 Subject: [PATCH 037/140] Restriction on name of files --- htdocs/admin/system/filecheck.php | 16 +++++++++++----- htdocs/core/boxes/box_external_rss.php | 1 + htdocs/core/modules/modExternalRss.class.php | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index cb7c9667757..e6e95872c91 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -78,10 +78,10 @@ print '
'; $file_list = array('missing' => array(), 'updated' => array()); // Local file to compare to -$xmlshortfile = GETPOST('xmlshortfile', 'alpha') ?GETPOST('xmlshortfile', 'alpha') : '/install/filelist-'.DOL_VERSION.(empty($conf->global->MAIN_FILECHECK_LOCAL_SUFFIX) ? '' : $conf->global->MAIN_FILECHECK_LOCAL_SUFFIX).'.xml'.(empty($conf->global->MAIN_FILECHECK_LOCAL_EXT) ? '' : $conf->global->MAIN_FILECHECK_LOCAL_EXT); -$xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile; +$xmlshortfile = dol_sanitizeFileName(GETPOST('xmlshortfile', 'alpha') ? GETPOST('xmlshortfile', 'alpha') : 'filelist-'.DOL_VERSION.(empty($conf->global->MAIN_FILECHECK_LOCAL_SUFFIX) ? '' : $conf->global->MAIN_FILECHECK_LOCAL_SUFFIX).'.xml'.(empty($conf->global->MAIN_FILECHECK_LOCAL_EXT) ? '' : $conf->global->MAIN_FILECHECK_LOCAL_EXT)); +$xmlfile = DOL_DOCUMENT_ROOT.'/install/'.$xmlshortfile; // Remote file to compare to -$xmlremote = GETPOST('xmlremote'); +$xmlremote = GETPOST('xmlremote', 'alphanohtml'); if (empty($xmlremote) && !empty($conf->global->MAIN_FILECHECK_URL)) { $xmlremote = $conf->global->MAIN_FILECHECK_URL; } @@ -92,7 +92,13 @@ if (empty($xmlremote) && !empty($conf->global->$param)) { if (empty($xmlremote)) { $xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml'; } - +if ($xmlremote && !preg_match('/^https?:\/\//', $xmlremote)) { +} +if ($xmlremote && !preg_match('/^https?:\/\//', $xmlremote)) { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorURLMustStartWithHttp", $xmlremote), '', 'errors'); + $error++; +} // Test if remote test is ok $enableremotecheck = true; @@ -147,7 +153,7 @@ if (GETPOST('target') == 'local') { } $xml = simplexml_load_file($xmlfile); } else { - print $langs->trans('XmlNotFound').': '.$xmlfile; + print '
'.$langs->trans('XmlNotFound').': '.$xmlfile.''; $error++; } } diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index d85f0a3f44b..7bf8a69ed03 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -77,6 +77,7 @@ class box_external_rss extends ModeleBoxes $this->max = $max; // On recupere numero de param de la boite + $reg = array(); preg_match('/^([0-9]+) /', $this->paramdef, $reg); $site = $reg[1]; diff --git a/htdocs/core/modules/modExternalRss.class.php b/htdocs/core/modules/modExternalRss.class.php index 6ca023a65a8..d7710687ca6 100644 --- a/htdocs/core/modules/modExternalRss.class.php +++ b/htdocs/core/modules/modExternalRss.class.php @@ -100,6 +100,7 @@ class modExternalRss extends DolibarrModules $result = $this->db->query($sql); if ($result) { while ($obj = $this->db->fetch_object($result)) { + $reg = array(); if (preg_match('/EXTERNAL_RSS_TITLE_([0-9]+)/i', $obj->name, $reg)) { // Definie la boite si on a trouvee une ancienne configuration //$this->boxes[$reg[1]][0] = "(ExternalRSSInformations)"; From 6fce28e7d0dc4c980a1b60d78a2554e9a4dee211 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:39:29 +0200 Subject: [PATCH 038/140] Create index.html --- htdocs/modulebuilder/template/admin/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/modulebuilder/template/admin/index.html diff --git a/htdocs/modulebuilder/template/admin/index.html b/htdocs/modulebuilder/template/admin/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/modulebuilder/template/admin/index.html @@ -0,0 +1 @@ + From c910fb7594825a7d8d5195a6907b6a44fd7686dc Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:40:46 +0200 Subject: [PATCH 039/140] Create index.html --- htdocs/modulebuilder/template/class/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/modulebuilder/template/class/index.html diff --git a/htdocs/modulebuilder/template/class/index.html b/htdocs/modulebuilder/template/class/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/modulebuilder/template/class/index.html @@ -0,0 +1 @@ + From c9c7a5574895af25dd3bab03048c8af1b0204680 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:42:11 +0200 Subject: [PATCH 040/140] Create index.html --- htdocs/modulebuilder/template/js/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/modulebuilder/template/js/index.html diff --git a/htdocs/modulebuilder/template/js/index.html b/htdocs/modulebuilder/template/js/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/modulebuilder/template/js/index.html @@ -0,0 +1 @@ + From 6d8bbaeeaedab5b9eadaae382e7530d8c341d24e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:42:47 +0200 Subject: [PATCH 041/140] Create index.html --- htdocs/modulebuilder/template/lib/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/modulebuilder/template/lib/index.html diff --git a/htdocs/modulebuilder/template/lib/index.html b/htdocs/modulebuilder/template/lib/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/modulebuilder/template/lib/index.html @@ -0,0 +1 @@ + From 2f349146ed5e46d027640b512f0d3044c805c9a5 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:44:39 +0200 Subject: [PATCH 042/140] Create index.html --- htdocs/modulebuilder/template/sql/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/modulebuilder/template/sql/index.html diff --git a/htdocs/modulebuilder/template/sql/index.html b/htdocs/modulebuilder/template/sql/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/modulebuilder/template/sql/index.html @@ -0,0 +1 @@ + From e5764fa304abd31c21525d74fb1efcfa5516d837 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Apr 2021 20:21:45 +0200 Subject: [PATCH 043/140] Update .gitattributes *.json text eol=lf *.yml text eol=lf --- .gitattributes | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitattributes b/.gitattributes index d1002263778..de9ce3303a9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,12 +11,14 @@ *.htm text eol=lf *.html text eol=lf *.js text eol=lf +*.json text eol=lf *.css text eol=lf *.lang text eol=lf *.txt text eol=lf *.md text eol=lf *.pp text eol=lf *.sh text eol=lf +*.yml text eol=lf *.yaml text eol=lf *.conf text eol=lf @@ -24,15 +26,16 @@ # Denote all files that are truly binary and should not be modified. *.bmp binary -*.ico binary -*.png binary -*.jpg binary -*.jpeg binary -*.odt binary -*.odf binary *.frm binary +*.ico binary +*.jpeg binary +*.jpg binary *.MYD binary *.MYI binary +*.odf binary +*.odt binary +*.png binary + # Export ignores to generate clean production tarballs /build export-ignore From baf8c47ceb3dd3d2d965bc29d59060a0b952d1cf Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Apr 2021 20:48:49 +0200 Subject: [PATCH 044/140] Create index.html --- htdocs/projet/ajax/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/projet/ajax/index.html diff --git a/htdocs/projet/ajax/index.html b/htdocs/projet/ajax/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/projet/ajax/index.html @@ -0,0 +1 @@ + From 6c4f5b851d68c5ab726f6c5e3e9299d2b8d3af60 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Apr 2021 23:31:16 +0200 Subject: [PATCH 045/140] Use all param of getURLContent --- htdocs/admin/system/filecheck.php | 2 +- htdocs/core/lib/geturl.lib.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index e6e95872c91..ab42039b98a 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -158,7 +158,7 @@ if (GETPOST('target') == 'local') { } } if (GETPOST('target') == 'remote') { - $xmlarray = getURLContent($xmlremote); + $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') { diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index d624e2e0ace..435f02f1da0 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -190,6 +190,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = $info = curl_getinfo($ch); // Reading of request must be done after sending request $http_code = $info['http_code']; + if ($followlocation && ($http_code == 301 || $http_code == 302 || $http_code == 303 || $http_code == 307)) { $newUrl = $info['redirect_url']; $maxRedirection--; From 59c8e70fd27ea37af226ef57c15ed15f53629c5a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Apr 2021 23:43:10 +0200 Subject: [PATCH 046/140] Fix #yogosha4510 --- htdocs/admin/modules.php | 2 +- htdocs/admin/system/filecheck.php | 2 -- htdocs/api/class/api_setup.class.php | 10 +++++++--- htdocs/core/class/openid.class.php | 4 ++-- htdocs/core/lib/website.lib.php | 4 ++-- .../class/price_global_variable_updater.class.php | 2 +- htdocs/website/index.php | 6 +++--- 7 files changed, 16 insertions(+), 14 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 9b9fcdea1fd..fbe1ae98619 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -897,7 +897,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) { // This is a bad practice to activate a synch external access during building of a page. 1 external module can hang the application. require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; if (!empty($objMod->url_last_version)) { - $newversion = getURLContent($objMod->url_last_version); + $newversion = getURLContent($objMod->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only if (isset($newversion['content'])) { if (version_compare($newversion['content'], $versiontrans) > 0) { print " ".$newversion['content'].""; diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index ab42039b98a..3869c37ce7d 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -92,8 +92,6 @@ if (empty($xmlremote) && !empty($conf->global->$param)) { if (empty($xmlremote)) { $xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml'; } -if ($xmlremote && !preg_match('/^https?:\/\//', $xmlremote)) { -} if ($xmlremote && !preg_match('/^https?:\/\//', $xmlremote)) { $langs->load("errors"); setEventMessages($langs->trans("ErrorURLMustStartWithHttp", $xmlremote), '', 'errors'); diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 064fb6ad359..0029d0fd110 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1647,8 +1647,8 @@ class Setup extends DolibarrApi $file_list = array('missing' => array(), 'updated' => array()); // Local file to compare to - $xmlshortfile = GETPOST('xmlshortfile') ?GETPOST('xmlshortfile') : '/install/filelist-'.DOL_VERSION.'.xml'; - $xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile; + $xmlshortfile = dol_sanitizeFileName(GETPOST('xmlshortfile', 'alpha') ? GETPOST('xmlshortfile', 'alpha') : 'filelist-'.DOL_VERSION.(empty($conf->global->MAIN_FILECHECK_LOCAL_SUFFIX) ? '' : $conf->global->MAIN_FILECHECK_LOCAL_SUFFIX).'.xml'.(empty($conf->global->MAIN_FILECHECK_LOCAL_EXT) ? '' : $conf->global->MAIN_FILECHECK_LOCAL_EXT)); + $xmlfile = DOL_DOCUMENT_ROOT.'/install/'.$xmlshortfile; // Remote file to compare to $xmlremote = ($target == 'default' ? '' : $target); if (empty($xmlremote) && !empty($conf->global->MAIN_FILECHECK_URL)) { @@ -1661,6 +1661,10 @@ class Setup extends DolibarrApi if (empty($xmlremote)) { $xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml'; } + if ($xmlremote && !preg_match('/^https?:\/\//', $xmlremote)) { + $langs->load("errors"); + throw new RestException(500, $langs->trans("ErrorURLMustStartWithHttp", $xmlremote)); + } if ($target == 'local') { if (dol_is_file($xmlfile)) { @@ -1669,7 +1673,7 @@ class Setup extends DolibarrApi throw new RestException(500, $langs->trans('XmlNotFound').': '.$xmlfile); } } else { - $xmlarray = getURLContent($xmlremote); + $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') { diff --git a/htdocs/core/class/openid.class.php b/htdocs/core/class/openid.class.php index 5156e7b767a..abb006969db 100644 --- a/htdocs/core/class/openid.class.php +++ b/htdocs/core/class/openid.class.php @@ -405,7 +405,7 @@ class SimpleOpenID $url = $conf->global->MAIN_AUTHENTICATION_OPENID_URL; } - $response = getURLContent($url); + $response = getURLContent($url, 'GET', '', 1, array(), array('http', 'https')); list($servers, $delegates) = $this->HTML2OpenIDServer($response); if (count($servers) == 0) { @@ -525,7 +525,7 @@ class SimpleOpenID dol_syslog(get_class($this).'::sendDiscoveryRequestToGetXRDS get XRDS'); $addheaders = array('Accept: application/xrds+xml'); - $response = getURLContent($url, 'GET', '', 1, $addheaders); + $response = getURLContent($url, 'GET', '', 1, $addheaders, array('http', 'https'), 0); /* response should like this: diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index bf3b9f3dd07..4fa0f053236 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -1023,7 +1023,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify if (empty($alreadygrabbed[$urltograbbis])) { if ($grabimages) { - $tmpgeturl = getURLContent($urltograbbis); + $tmpgeturl = getURLContent($urltograbbis, 'GET', '', 1, array(), array('http', 'https'), 0); if ($tmpgeturl['curl_error_no']) { $error++; setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['curl_error_msg'], null, 'errors'); @@ -1094,7 +1094,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify if (empty($alreadygrabbed[$urltograbbis])) { if ($grabimages) { - $tmpgeturl = getURLContent($urltograbbis); + $tmpgeturl = getURLContent($urltograbbis, 'GET', '', 1, array(), array('http', 'https'), 0); if ($tmpgeturl['curl_error_no']) { $error++; setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['curl_error_msg'], null, 'errors'); diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index 96e77d661ab..172c004a2d7 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -487,7 +487,7 @@ class PriceGlobalVariableUpdater if ($this->type == 0) { // Call JSON request include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; - $tmpresult = getURLContent($url); + $tmpresult = getURLContent($url, 'GET', '', 1, array(), array('http', 'https'), 0); $code = $tmpresult['http_code']; $result = $tmpresult['content']; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 26ca6df9bf8..86c50a22247 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -680,7 +680,7 @@ if ($action == 'addcontainer' && $usercanedit) { } if (!$error) { - $tmp = getURLContent($urltograb); + $tmp = getURLContent($urltograb, 'GET', '', 1, array(), array('http', 'https'), 0); if ($tmp['curl_error_no']) { $error++; setEventMessages('Error getting '.$urltograb.': '.$tmp['curl_error_msg'], null, 'errors'); @@ -795,7 +795,7 @@ if ($action == 'addcontainer' && $usercanedit) { } /* - $tmpgeturl = getURLContent($urltograbbis); + $tmpgeturl = getURLContent($urltograbbis, 'GET', '', 1, array(), array('http', 'https'), 0); if ($tmpgeturl['curl_error_no']) { $error++; @@ -860,7 +860,7 @@ if ($action == 'addcontainer' && $usercanedit) { continue; } - $tmpgeturl = getURLContent($urltograbbis); + $tmpgeturl = getURLContent($urltograbbis, 'GET', '', 1, array(), array('http', 'https'), 0); if ($tmpgeturl['curl_error_no']) { $errorforsubresource++; setEventMessages('Error getting link tag url '.$urltograbbis.': '.$tmpgeturl['curl_error_msg'], null, 'errors'); From 626f252ed8652a7de2e29103d4f18386f1a29b46 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Apr 2021 00:33:25 +0200 Subject: [PATCH 047/140] FIX #yogosha5828 --- htdocs/core/lib/security.lib.php | 2 +- htdocs/user/class/api_users.class.php | 135 +++++++++++++++++++------- 2 files changed, 99 insertions(+), 38 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index b6b71f6d8a6..1b6aa0aa544 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -534,7 +534,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f /** * Check access by user to object. - * This function is also called by restrictedArea + * This function is also called by restrictedArea that check before if module is enabled and permissions of user compared to $action. * * @param User $user User to check * @param array $featuresarray Features/modules to check. Example: ('user','service','member','project','task',...) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 803b517a354..0923cf1e7bd 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -30,7 +30,6 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; class Users extends DolibarrApi { /** - * * @var array $FIELDS Mandatory fields, checked when create and update object */ static $FIELDS = array( @@ -71,12 +70,12 @@ class Users extends DolibarrApi { global $db, $conf; - $obj_ret = array(); - if (!DolibarrApiAccess::$user->rights->user->user->lire) { throw new RestException(401, "You are not allowed to read list of users"); } + $obj_ret = array(); + // case of external user, $societe param is ignored and replaced by user's socid //$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe; @@ -150,9 +149,10 @@ class Users extends DolibarrApi */ public function get($id, $includepermissions = 0) { - //if (!DolibarrApiAccess::$user->rights->user->user->lire) { - //throw new RestException(401); - //} + if (empty(DolibarrApiAccess::$user->rights->user->user->lire)) { + throw new RestException(401, 'Not allowed'); + } + if ($id == 0) { $result = $this->useraccount->initAsSpecimen(); } else { @@ -187,9 +187,9 @@ class Users extends DolibarrApi */ public function getByLogin($login, $includepermissions = 0) { - //if (!DolibarrApiAccess::$user->rights->user->user->lire) { - //throw new RestException(401); - //} + if (empty(DolibarrApiAccess::$user->rights->user->user->lire)) { + throw new RestException(401, 'Not allowed'); + } $result = $this->useraccount->fetch('', $login); if (!$result) { @@ -221,9 +221,9 @@ class Users extends DolibarrApi */ public function getByEmail($email, $includepermissions = 0) { - //if (!DolibarrApiAccess::$user->rights->user->user->lire) { - //throw new RestException(401); - //} + if (empty(DolibarrApiAccess::$user->rights->user->user->lire)) { + throw new RestException(401, 'Not allowed'); + } $result = $this->useraccount->fetch('', '', '', 0, -1, $email); if (!$result) { @@ -242,18 +242,22 @@ class Users extends DolibarrApi } /** - * Get properties of user connected + * Get more properties of a user * * @url GET /info * - * @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) - * @return array|mixed Data without useless information + * @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) + * @return array|mixed Data without useless information * * @throws RestException 401 Insufficient rights * @throws RestException 404 User or group not found */ public function getInfo($includepermissions = 0) { + if (empty(DolibarrApiAccess::$user->rights->user->user->lire)) { + throw new RestException(401, 'Not allowed'); + } + $apiUser = DolibarrApiAccess::$user; $result = $this->useraccount->fetch($apiUser->id); @@ -285,13 +289,16 @@ class Users extends DolibarrApi * * @param array $request_data New user data * @return int + * + * @throws RestException 401 Not allowed */ public function post($request_data = null) { - // check user authorization - //if(! DolibarrApiAccess::$user->rights->user->creer) { - // throw new RestException(401, "User creation not allowed"); - //} + // Check user authorization + if (empty(DolibarrApiAccess::$user->rights->user->creer)) { + throw new RestException(401, "User creation not allowed"); + } + // check mandatory fields /*if (!isset($request_data["login"])) throw new RestException(400, "login field missing"); @@ -299,9 +306,23 @@ class Users extends DolibarrApi throw new RestException(400, "password field missing"); if (!isset($request_data["lastname"])) throw new RestException(400, "lastname field missing");*/ + //assign field values foreach ($request_data as $field => $value) { - $this->useraccount->$field = $value; + if (in_array($field, array('pass_crypted', 'pass_indatabase', 'pass_indatabase_crypted', 'pass_temp', 'api_key'))) { + // This properties can't be set/modified with API + throw new RestException(401, 'The property '.$field." can't be set/modified using the APIs"); + continue; + } + /*if ($field == 'pass') { + if (empty(DolibarrApiAccess::$user->rights->user->user->password)) { + throw new RestException(401, 'You are not allowed to modify/set password of other users'); + continue; + } + } + */ + + $this->useraccount->$field = $value; } if ($this->useraccount->create(DolibarrApiAccess::$user) < 0) { @@ -312,7 +333,7 @@ class Users extends DolibarrApi /** - * Update account + * Update user account * * @param int $id Id of account to update * @param array $request_data Datas @@ -324,9 +345,10 @@ class Users extends DolibarrApi */ public function put($id, $request_data = null) { - //if (!DolibarrApiAccess::$user->rights->user->user->creer) { - //throw new RestException(401); - //} + // Check user authorization + if (empty(DolibarrApiAccess::$user->rights->user->creer)) { + throw new RestException(401, "User update not allowed"); + } $result = $this->useraccount->fetch($id); if (!$result) { @@ -341,6 +363,30 @@ class Users extends DolibarrApi if ($field == 'id') { continue; } + if (in_array($field, array('pass_crypted', 'pass_indatabase', 'pass_indatabase_crypted', 'pass_temp', 'api_key'))) { + // This properties can't be set/modified with API + throw new RestException(401, 'The property '.$field." can't be set/modified using the APIs"); + continue; + } + if ($field == 'pass') { + if ($this->useraccount->id != DolibarrApiAccess::$user->id && empty(DolibarrApiAccess::$user->rights->user->user->password)) { + throw new RestException(401, 'You are not allowed to modify password of other users'); + continue; + } + if ($this->useraccount->id == DolibarrApiAccess::$user->id && empty(DolibarrApiAccess::$user->rights->user->self->password)) { + throw new RestException(401, 'You are not allowed to modify your own password'); + continue; + } + } + if (DolibarrApiAccess::$user->admin) { // If user for API is admin + if ($field == 'admin' && $value != $this->useraccount->admin && empty($value)) { + throw new RestException(401, 'Reseting the admin status of a user is not possible using the API'); + } + } else { + if ($field == 'admin' && $value != $this->useraccount->admin) { + throw new RestException(401, 'Only an admin user can modify the admin status of another user'); + } + } // The status must be updated using setstatus() because it // is not handled by the update() method. if ($field == 'statut') { @@ -376,12 +422,12 @@ class Users extends DolibarrApi */ public function getGroups($id) { - $obj_ret = array(); - if (!DolibarrApiAccess::$user->rights->user->user->lire) { throw new RestException(403); } + $obj_ret = array(); + $user = new User($this->db); $result = $user->fetch($id); if (!$result) { @@ -406,16 +452,20 @@ class Users extends DolibarrApi * @param int $entity Entity ID (valid only for superadmin in multicompany transverse mode) * @return int 1 if success * + * @throws RestException 401 Not allowed + * @throws RestException 404 User not found + * @throws RestException 500 Error + * * @url GET {id}/setGroup/{group} */ public function setGroup($id, $group, $entity = 1) { - global $conf; - //if (!DolibarrApiAccess::$user->rights->user->user->supprimer) { - //throw new RestException(401); - //} + if (empty(DolibarrApiAccess::$user->rights->user->user->creer)) { + throw new RestException(401); + } + $result = $this->useraccount->fetch($id); if (!$result) { throw new RestException(404, 'User not found'); @@ -455,6 +505,9 @@ class Users extends DolibarrApi * @param string $group_ids Groups ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i} * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" * @return array Array of User objects + * + * @throws RestException 404 User not found + * @throws RestException 503 Error */ public function listGroups($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $group_ids = 0, $sqlfilters = '') { @@ -462,8 +515,9 @@ class Users extends DolibarrApi $obj_ret = array(); - if (!DolibarrApiAccess::$user->rights->user->group_advance->read) { - throw new RestException(401, "You are not allowed to read list of groups"); + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->user->lire)) || + !empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->group_advance->read)) { + throw new RestException(401, "You are not allowed to read groups"); } // case of external user, $societe param is ignored and replaced by user's socid @@ -527,12 +581,16 @@ class Users extends DolibarrApi * @param int $group ID of group * @param int $load_members Load members list or not {@min 0} {@max 1} * @return array Array of User objects + * + * @throws RestException 401 Not allowed + * @throws RestException 404 User not found */ public function infoGroups($group, $load_members = 0) { global $db, $conf; - if (!DolibarrApiAccess::$user->rights->user->group_advance->read) { + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->user->lire)) || + !empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->group_advance->read)) { throw new RestException(401, "You are not allowed to read groups"); } @@ -547,16 +605,19 @@ class Users extends DolibarrApi } /** - * Delete account + * Delete account/user * * @param int $id Account ID * @return array + * + * @throws RestException 401 Not allowed + * @throws RestException 404 User not found */ public function delete($id) { - //if (!DolibarrApiAccess::$user->rights->user->user->supprimer) { - //throw new RestException(401); - //} + if (empty(DolibarrApiAccess::$user->rights->user->user->supprimer)) { + throw new RestException(401, 'Not allowed'); + } $result = $this->useraccount->fetch($id); if (!$result) { throw new RestException(404, 'User not found'); From 489cff46a37b04784d8e884af7fc2ad623bee17d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Apr 2021 00:33:25 +0200 Subject: [PATCH 048/140] FIX #yogosha5828 --- htdocs/core/lib/security.lib.php | 2 +- htdocs/user/class/api_users.class.php | 138 +++++++++++++++++++------- 2 files changed, 102 insertions(+), 38 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index b6b71f6d8a6..1b6aa0aa544 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -534,7 +534,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f /** * Check access by user to object. - * This function is also called by restrictedArea + * This function is also called by restrictedArea that check before if module is enabled and permissions of user compared to $action. * * @param User $user User to check * @param array $featuresarray Features/modules to check. Example: ('user','service','member','project','task',...) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 803b517a354..871e04450b3 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -30,7 +30,6 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; class Users extends DolibarrApi { /** - * * @var array $FIELDS Mandatory fields, checked when create and update object */ static $FIELDS = array( @@ -71,12 +70,12 @@ class Users extends DolibarrApi { global $db, $conf; - $obj_ret = array(); - if (!DolibarrApiAccess::$user->rights->user->user->lire) { throw new RestException(401, "You are not allowed to read list of users"); } + $obj_ret = array(); + // case of external user, $societe param is ignored and replaced by user's socid //$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe; @@ -150,9 +149,10 @@ class Users extends DolibarrApi */ public function get($id, $includepermissions = 0) { - //if (!DolibarrApiAccess::$user->rights->user->user->lire) { - //throw new RestException(401); - //} + if (empty(DolibarrApiAccess::$user->rights->user->user->lire)) { + throw new RestException(401, 'Not allowed'); + } + if ($id == 0) { $result = $this->useraccount->initAsSpecimen(); } else { @@ -187,9 +187,9 @@ class Users extends DolibarrApi */ public function getByLogin($login, $includepermissions = 0) { - //if (!DolibarrApiAccess::$user->rights->user->user->lire) { - //throw new RestException(401); - //} + if (empty(DolibarrApiAccess::$user->rights->user->user->lire)) { + throw new RestException(401, 'Not allowed'); + } $result = $this->useraccount->fetch('', $login); if (!$result) { @@ -221,9 +221,9 @@ class Users extends DolibarrApi */ public function getByEmail($email, $includepermissions = 0) { - //if (!DolibarrApiAccess::$user->rights->user->user->lire) { - //throw new RestException(401); - //} + if (empty(DolibarrApiAccess::$user->rights->user->user->lire)) { + throw new RestException(401, 'Not allowed'); + } $result = $this->useraccount->fetch('', '', '', 0, -1, $email); if (!$result) { @@ -242,18 +242,22 @@ class Users extends DolibarrApi } /** - * Get properties of user connected + * Get more properties of a user * * @url GET /info * - * @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) - * @return array|mixed Data without useless information + * @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) + * @return array|mixed Data without useless information * * @throws RestException 401 Insufficient rights * @throws RestException 404 User or group not found */ public function getInfo($includepermissions = 0) { + if (empty(DolibarrApiAccess::$user->rights->user->user->lire)) { + throw new RestException(401, 'Not allowed'); + } + $apiUser = DolibarrApiAccess::$user; $result = $this->useraccount->fetch($apiUser->id); @@ -285,13 +289,16 @@ class Users extends DolibarrApi * * @param array $request_data New user data * @return int + * + * @throws RestException 401 Not allowed */ public function post($request_data = null) { - // check user authorization - //if(! DolibarrApiAccess::$user->rights->user->creer) { - // throw new RestException(401, "User creation not allowed"); - //} + // Check user authorization + if (empty(DolibarrApiAccess::$user->rights->user->creer)) { + throw new RestException(401, "User creation not allowed"); + } + // check mandatory fields /*if (!isset($request_data["login"])) throw new RestException(400, "login field missing"); @@ -299,9 +306,23 @@ class Users extends DolibarrApi throw new RestException(400, "password field missing"); if (!isset($request_data["lastname"])) throw new RestException(400, "lastname field missing");*/ + //assign field values foreach ($request_data as $field => $value) { - $this->useraccount->$field = $value; + if (in_array($field, array('pass_crypted', 'pass_indatabase', 'pass_indatabase_crypted', 'pass_temp', 'api_key'))) { + // This properties can't be set/modified with API + throw new RestException(401, 'The property '.$field." can't be set/modified using the APIs"); + continue; + } + /*if ($field == 'pass') { + if (empty(DolibarrApiAccess::$user->rights->user->user->password)) { + throw new RestException(401, 'You are not allowed to modify/set password of other users'); + continue; + } + } + */ + + $this->useraccount->$field = $value; } if ($this->useraccount->create(DolibarrApiAccess::$user) < 0) { @@ -312,7 +333,7 @@ class Users extends DolibarrApi /** - * Update account + * Update user account * * @param int $id Id of account to update * @param array $request_data Datas @@ -324,9 +345,10 @@ class Users extends DolibarrApi */ public function put($id, $request_data = null) { - //if (!DolibarrApiAccess::$user->rights->user->user->creer) { - //throw new RestException(401); - //} + // Check user authorization + if (empty(DolibarrApiAccess::$user->rights->user->creer)) { + throw new RestException(401, "User update not allowed"); + } $result = $this->useraccount->fetch($id); if (!$result) { @@ -341,6 +363,33 @@ class Users extends DolibarrApi if ($field == 'id') { continue; } + if (in_array($field, array('pass_crypted', 'pass_indatabase', 'pass_indatabase_crypted', 'pass_temp', 'api_key'))) { + // This properties can't be set/modified with API + throw new RestException(401, 'The property '.$field." can't be set/modified using the APIs"); + continue; + } + if ($field == 'pass') { + if ($this->useraccount->id != DolibarrApiAccess::$user->id && empty(DolibarrApiAccess::$user->rights->user->user->password)) { + throw new RestException(401, 'You are not allowed to modify password of other users'); + continue; + } + if ($this->useraccount->id == DolibarrApiAccess::$user->id && empty(DolibarrApiAccess::$user->rights->user->self->password)) { + throw new RestException(401, 'You are not allowed to modify your own password'); + continue; + } + } + if (DolibarrApiAccess::$user->admin) { // If user for API is admin + if ($field == 'admin' && $value != $this->useraccount->admin && empty($value)) { + throw new RestException(401, 'Reseting the admin status of a user is not possible using the API'); + } + } else { + if ($field == 'admin' && $value != $this->useraccount->admin) { + throw new RestException(401, 'Only an admin user can modify the admin status of another user'); + } + } + if ($field == 'entity' && $value != $this->useraccount->entity) { + throw new RestException(401, 'Changing entity of a user using the APIs is not possible'); + } // The status must be updated using setstatus() because it // is not handled by the update() method. if ($field == 'statut') { @@ -376,12 +425,12 @@ class Users extends DolibarrApi */ public function getGroups($id) { - $obj_ret = array(); - if (!DolibarrApiAccess::$user->rights->user->user->lire) { throw new RestException(403); } + $obj_ret = array(); + $user = new User($this->db); $result = $user->fetch($id); if (!$result) { @@ -406,16 +455,20 @@ class Users extends DolibarrApi * @param int $entity Entity ID (valid only for superadmin in multicompany transverse mode) * @return int 1 if success * + * @throws RestException 401 Not allowed + * @throws RestException 404 User not found + * @throws RestException 500 Error + * * @url GET {id}/setGroup/{group} */ public function setGroup($id, $group, $entity = 1) { - global $conf; - //if (!DolibarrApiAccess::$user->rights->user->user->supprimer) { - //throw new RestException(401); - //} + if (empty(DolibarrApiAccess::$user->rights->user->user->creer)) { + throw new RestException(401); + } + $result = $this->useraccount->fetch($id); if (!$result) { throw new RestException(404, 'User not found'); @@ -455,6 +508,9 @@ class Users extends DolibarrApi * @param string $group_ids Groups ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i} * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" * @return array Array of User objects + * + * @throws RestException 404 User not found + * @throws RestException 503 Error */ public function listGroups($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $group_ids = 0, $sqlfilters = '') { @@ -462,8 +518,9 @@ class Users extends DolibarrApi $obj_ret = array(); - if (!DolibarrApiAccess::$user->rights->user->group_advance->read) { - throw new RestException(401, "You are not allowed to read list of groups"); + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->user->lire)) || + !empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->group_advance->read)) { + throw new RestException(401, "You are not allowed to read groups"); } // case of external user, $societe param is ignored and replaced by user's socid @@ -527,12 +584,16 @@ class Users extends DolibarrApi * @param int $group ID of group * @param int $load_members Load members list or not {@min 0} {@max 1} * @return array Array of User objects + * + * @throws RestException 401 Not allowed + * @throws RestException 404 User not found */ public function infoGroups($group, $load_members = 0) { global $db, $conf; - if (!DolibarrApiAccess::$user->rights->user->group_advance->read) { + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->user->lire)) || + !empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->group_advance->read)) { throw new RestException(401, "You are not allowed to read groups"); } @@ -547,16 +608,19 @@ class Users extends DolibarrApi } /** - * Delete account + * Delete account/user * * @param int $id Account ID * @return array + * + * @throws RestException 401 Not allowed + * @throws RestException 404 User not found */ public function delete($id) { - //if (!DolibarrApiAccess::$user->rights->user->user->supprimer) { - //throw new RestException(401); - //} + if (empty(DolibarrApiAccess::$user->rights->user->user->supprimer)) { + throw new RestException(401, 'Not allowed'); + } $result = $this->useraccount->fetch($id); if (!$result) { throw new RestException(404, 'User not found'); From 3f119c8004732314810d743baed2f2a15150f8dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Apr 2021 01:43:38 +0200 Subject: [PATCH 049/140] Fix eol --- htdocs/accountancy/class/bookkeeping.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index e7c5d106ddf..6220904dbe8 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -200,7 +200,7 @@ class BookKeeping extends CommonObject $error = 0; - // Clean parameters + // Clean parameters if (isset($this->doc_type)) { $this->doc_type = trim($this->doc_type); } @@ -296,7 +296,7 @@ class BookKeeping extends CommonObject $sql .= " WHERE doc_type = '".$this->db->escape($this->doc_type)."'"; $sql .= " AND fk_doc = ".$this->fk_doc; if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) { - // DO NOT USE THIS IN PRPDUCTION. This will generate a lot of trouble into reports and will corrupt database (by generating duplicate entries. + // DO NOT USE THIS IN PRPDUCTION. This will generate a lot of trouble into reports and will corrupt database (by generating duplicate entries. $sql .= " AND fk_docdet = " . $this->fk_docdet; // This field can be 0 if record is for several lines } $sql .= " AND numero_compte = '".$this->db->escape($this->numero_compte)."'"; From aef164a7eebe626842e00e882aa83e38cd126b2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Apr 2021 02:05:36 +0200 Subject: [PATCH 050/140] Fix bad permission --- htdocs/user/class/api_users.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 871e04450b3..e29506db93b 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -295,8 +295,8 @@ class Users extends DolibarrApi public function post($request_data = null) { // Check user authorization - if (empty(DolibarrApiAccess::$user->rights->user->creer)) { - throw new RestException(401, "User creation not allowed"); + if (empty(DolibarrApiAccess::$user->rights->user->user->creer)) { + throw new RestException(401, "User creation not allowed for login ".DolibarrApiAccess::$user->login); } // check mandatory fields From 1ec6317b804a36a20e2ee34876d56b1bdba48932 Mon Sep 17 00:00:00 2001 From: kamel Date: Thu, 8 Apr 2021 10:33:27 +0200 Subject: [PATCH 051/140] FIX : Fix warning (function errorHandler() is not defined in this class so let the class handle the errors) --- htdocs/core/class/smtps.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index ef26dc4ac65..ba8d4349a38 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -392,7 +392,6 @@ class SMTPs } else { if (function_exists('stream_socket_client') && !empty($this->_options)) { $socket_context = stream_context_create($this->_options); // An array of options for stream_context_create() - set_error_handler([$this, 'errorHandler']); $this->socket = @stream_socket_client( preg_replace('@tls://@i', '', $this->getHost()).// Host to 'hit', IP or domain ':'.$this->getPort(), // which Port number to use 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 052/140] 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 053/140] 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 f8b5bee9eb0ea24156fb79272b8dde2374651366 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Apr 2021 14:20:59 +0200 Subject: [PATCH 054/140] Add function getListOfPossibleImageExt --- htdocs/core/lib/images.lib.php | 24 ++++++++++++++++++------ htdocs/website/index.php | 8 +++++++- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 4803b5e0770..36e8cef6bfe 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -30,6 +30,23 @@ $maxheightmini = 72; // 16/9eme $quality = 80; +/** + * Return if a filename is file name of a supported image format + * + * @param int $acceptsvg 0=Default (depends on setup), 1=Always accept SVG as image files + * @return string Return list fo image format + */ +function getListOfPossibleImageExt($acceptsvg = 0) +{ + global $conf; + + $regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.webp|\.xpm|\.xbm'; // See also into product.class.php + if ($acceptsvg || !empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES)) { + $regeximgext .= '|\.svg'; // Not allowed by default. SVG can contains javascript + } + + return $regeximgext; +} /** * Return if a filename is file name of a supported image format @@ -40,12 +57,7 @@ $quality = 80; */ function image_format_supported($file, $acceptsvg = 0) { - global $conf; - - $regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.webp|\.xpm|\.xbm'; // See also into product.class.php - if ($acceptsvg || !empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES)) { - $regeximgext .= '|\.svg'; // Not allowed by default. SVG can contains javascript - } + $regeximgext = getListOfPossibleImageExt(); // Case filename is not a format image $reg = array(); diff --git a/htdocs/website/index.php b/htdocs/website/index.php index fd24f202a1c..405369ce26f 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2230,10 +2230,16 @@ if ($action == 'generatesitemaps' && $usercanedit) { } $action = 'preview'; } + $imagefolder = $conf->website->dir_output.'/'.$websitekey.'/medias/image/'.$websitekey.'/'; + if ($action == 'convertimgwebp' && $usercanedit) { include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; - $filelist = dol_dir_list($imagefolder, "all", 1); + + $regeximgext = getListOfPossibleImageExt(); + + $filelist = dol_dir_list($imagefolder, "all", 1, $regeximgext); + foreach ($filelist as $filename) { $filepath = $filename['fullname']; if (!(substr_compare($filepath, 'webp', -strlen('webp')) === 0)) { From 539c29b05feaafa25c585d85d170755e60276a64 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 8 Apr 2021 14:38:43 +0200 Subject: [PATCH 055/140] Update llx_10_c_regions.sql Chile --- .../install/mysql/data/llx_10_c_regions.sql | 36 ++++++++++--------- 1 file changed, 19 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 40e9aca2407..2feb15e8436 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -60,6 +60,7 @@ -- Bolivia -- Brazil -> for Departmements -- Canada -> for Departmements +-- Chile -- Colombie -> for Departmements -- France -- Germany -> for Departmements @@ -129,6 +130,24 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 5 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 14, 1401, '', 0, 'Canada'); +-- Chile Regions (id country=67) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6701, NULL, NULL, 'Tarapacá'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6702, NULL, NULL, 'Antofagasta'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6703, NULL, NULL, 'Atacama'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6704, NULL, NULL, 'Coquimbo'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6705, NULL, NULL, 'Valparaíso'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6706, NULL, NULL, 'General Bernardo O Higgins'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6707, NULL, NULL, 'Maule'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6708, NULL, NULL, 'Biobío'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6709, NULL, NULL, 'Raucanía'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6710, NULL, NULL, 'Los Lagos'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6711, NULL, NULL, 'Aysén General Carlos Ibáñez del Campo'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6712, NULL, NULL, 'Magallanes y Antártica Chilena'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6713, NULL, NULL, 'Metropolitana de Santiago'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6714, NULL, NULL, 'Los Ríos'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6715, NULL, NULL, 'Arica y Parinacota'); + + -- Colombie Regions (id country=70) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 70, 7001, '', 0, 'Colombie'); @@ -264,23 +283,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 ( 17, 1701, '', 0,'Provincies van Nederland ', 1); --- Regions Chile (id country=67) -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6701, 67, NULL, NULL, 'Tarapacá', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6702, 67, NULL, NULL, 'Antofagasta', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6703, 67, NULL, NULL, 'Atacama', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6704, 67, NULL, NULL, 'Coquimbo', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6705, 67, NULL, NULL, 'Valparaíso', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6706, 67, NULL, NULL, 'General Bernardo O Higgins', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6707, 67, NULL, NULL, 'Maule', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6708, 67, NULL, NULL, 'Biobío', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6709, 67, NULL, NULL, 'Raucanía', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6710, 67, NULL, NULL, 'Los Lagos', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6711, 67, NULL, NULL, 'Aysén General Carlos Ibáñez del Campo', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6712, 67, NULL, NULL, 'Magallanes y Antártica Chilena', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6713, 67, NULL, NULL, 'Metropolitana de Santiago', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6714, 67, NULL, NULL, 'Los Ríos', 1); -INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6715, 67, NULL, NULL, 'Arica y Parinacota', 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); From f609d03accae5be563973f1a6df3df1b95acea84 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 8 Apr 2021 15:24:59 +0200 Subject: [PATCH 056/140] Update llx_20_c_departements.sql Chile --- .../mysql/data/llx_20_c_departements.sql | 114 +++++++++--------- 1 file changed, 58 insertions(+), 56 deletions(-) diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index e4256374c13..9675fa126c8 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -45,6 +45,7 @@ -- Belgium -- Brazil -- Canada +-- Chile -- Colombia -- France -- Germany @@ -263,6 +264,63 @@ 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 (1401, 'NL','',1,'','Newfoundland and Labrador'); +-- Chile Provinces (id country=67) +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6701, '011', '', 0, '011', 'Iquique'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6701, '014', '', 0, '014', 'Tamarugal'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6702, '021', '', 0, '021', 'Antofagasa'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6702, '022', '', 0, '022', 'El Loa'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6702, '023', '', 0, '023', 'Tocopilla'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6703, '031', '', 0, '031', 'Copiapó'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6703, '032', '', 0, '032', 'Chañaral'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6703, '033', '', 0, '033', 'Huasco'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6704, '041', '', 0, '041', 'Elqui'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6704, '042', '', 0, '042', 'Choapa'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6704, '043', '', 0, '043', 'Limarí'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6705, '051', '', 0, '051', 'Valparaíso'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6705, '052', '', 0, '052', 'Isla de Pascua'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6705, '053', '', 0, '053', 'Los Andes'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6705, '054', '', 0, '054', 'Petorca'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6705, '055', '', 0, '055', 'Quillota'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6705, '056', '', 0, '056', 'San Antonio'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6705, '057', '', 0, '057', 'San Felipe de Aconcagua'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6705, '058', '', 0, '058', 'Marga Marga'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6706, '061', '', 0, '061', 'Cachapoal'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6706, '062', '', 0, '062', 'Cardenal Caro'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6706, '063', '', 0, '063', 'Colchagua'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6707, '071', '', 0, '071', 'Talca'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6707, '072', '', 0, '072', 'Cauquenes'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6707, '073', '', 0, '073', 'Curicó'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6707, '074', '', 0, '074', 'Linares'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6708, '081', '', 0, '081', 'Concepción'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6708, '082', '', 0, '082', 'Arauco'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6708, '083', '', 0, '083', 'Biobío'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6708, '084', '', 0, '084', 'Ñuble'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6709, '091', '', 0, '091', 'Cautín'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6709, '092', '', 0, '092', 'Malleco'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6710, '101', '', 0, '101', 'Llanquihue'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6710, '102', '', 0, '102', 'Chiloé'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6710, '103', '', 0, '103', 'Osorno'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6710, '104', '', 0, '104', 'Palena'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6711, '111', '', 0, '111', 'Coihaique'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6711, '112', '', 0, '112', 'Aisén'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6711, '113', '', 0, '113', 'Capitán Prat'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6711, '114', '', 0, '114', 'General Carrera'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6712, '121', '', 0, '121', 'Magallanes'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6712, '122', '', 0, '122', 'Antártica Chilena'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6712, '123', '', 0, '123', 'Tierra del Fuego'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6712, '124', '', 0, '124', 'Última Esperanza'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6713, '131', '', 0, '131', 'Santiago'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6713, '132', '', 0, '132', 'Cordillera'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6713, '133', '', 0, '133', 'Chacabuco'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6713, '134', '', 0, '134', 'Maipo'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6713, '135', '', 0, '135', 'Melipilla'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6713, '136', '', 0, '136', 'Talagante'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6714, '141', '', 0, '141', 'Valdivia'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6714, '142', '', 0, '142', 'Ranco'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6715, '151', '', 0, '151', 'Arica'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6715, '152', '', 0, '152', 'Parinacota'); + + -- Colombia Departamentos (id country=70) INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (7001, 'ANT', '', 0, 'ANT', 'Antioquia'); INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (7001, 'BOL', '', 0, 'BOL', 'Bolívar'); @@ -1160,62 +1218,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 ('CU', 8601, '', 0, '', 'Cuscatlan', 1); --- Provinces Chile (id country=67) -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('151', 6715, '', 0, '151', 'Arica', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('152', 6715, '', 0, '152', 'Parinacota', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('011', 6701, '', 0, '011', 'Iquique', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('014', 6701, '', 0, '014', 'Tamarugal', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('021', 6702, '', 0, '021', 'Antofagasa', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('022', 6702, '', 0, '022', 'El Loa', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('023', 6702, '', 0, '023', 'Tocopilla', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('031', 6703, '', 0, '031', 'Copiapó', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('032', 6703, '', 0, '032', 'Chañaral', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('033', 6703, '', 0, '033', 'Huasco', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('041', 6704, '', 0, '041', 'Elqui', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('042', 6704, '', 0, '042', 'Choapa', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('043', 6704, '', 0, '043', 'Limarí', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('051', 6705, '', 0, '051', 'Valparaíso', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('052', 6705, '', 0, '052', 'Isla de Pascua', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('053', 6705, '', 0, '053', 'Los Andes', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('054', 6705, '', 0, '054', 'Petorca', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('055', 6705, '', 0, '055', 'Quillota', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('056', 6705, '', 0, '056', 'San Antonio', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('057', 6705, '', 0, '057', 'San Felipe de Aconcagua', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('058', 6705, '', 0, '058', 'Marga Marga', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('061', 6706, '', 0, '061', 'Cachapoal', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('062', 6706, '', 0, '062', 'Cardenal Caro', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('063', 6706, '', 0, '063', 'Colchagua', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('071', 6707, '', 0, '071', 'Talca', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('072', 6707, '', 0, '072', 'Cauquenes', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('073', 6707, '', 0, '073', 'Curicó', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('074', 6707, '', 0, '074', 'Linares', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('081', 6708, '', 0, '081', 'Concepción', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('082', 6708, '', 0, '082', 'Arauco', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('083', 6708, '', 0, '083', 'Biobío', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('084', 6708, '', 0, '084', 'Ñuble', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('091', 6709, '', 0, '091', 'Cautín', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('092', 6709, '', 0, '092', 'Malleco', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('141', 6714, '', 0, '141', 'Valdivia', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('142', 6714, '', 0, '142', 'Ranco', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('101', 6710, '', 0, '101', 'Llanquihue', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('102', 6710, '', 0, '102', 'Chiloé', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('103', 6710, '', 0, '103', 'Osorno', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('104', 6710, '', 0, '104', 'Palena', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('111', 6711, '', 0, '111', 'Coihaique', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('112', 6711, '', 0, '112', 'Aisén', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('113', 6711, '', 0, '113', 'Capitán Prat', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('114', 6711, '', 0, '114', 'General Carrera', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('121', 6712, '', 0, '121', 'Magallanes', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('122', 6712, '', 0, '122', 'Antártica Chilena', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('123', 6712, '', 0, '123', 'Tierra del Fuego', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('124', 6712, '', 0, '124', 'Última Esperanza', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('131', 6713, '', 0, '131', 'Santiago', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('132', 6713, '', 0, '132', 'Cordillera', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('133', 6713, '', 0, '133', 'Chacabuco', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('134', 6713, '', 0, '134', 'Maipo', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('135', 6713, '', 0, '135', 'Melipilla', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('136', 6713, '', 0, '136', 'Talagante', 1); - -- Provinces India (id country=117) INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AN', 11701, NULL, 0, 'AN', 'Andaman & Nicobar', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AP', 11701, NULL, 0, 'AP', 'Andhra Pradesh', 1); From 482b4e808b68f89ebc7755db464f18c6694ef114 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 8 Apr 2021 16:21:50 +0200 Subject: [PATCH 057/140] chnages with eldy's advices --- htdocs/product/inventory/inventory.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 764c1bd78c9..0bdd203caf0 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -468,17 +468,17 @@ if ($object->id > 0) { } if ($permissiontoadd && $conf->use_javascript_ajax) { print ' '; + print ''; print ''; - print ''.$langs->trans('AutofillWithExpected').''; } print '
'; print '
'; @@ -623,7 +623,7 @@ if ($object->id > 0) { print ''; if ($object->status == $object::STATUS_VALIDATED) { $qty_view = GETPOST("id_".$obj->rowid) ? GETPOST("id_".$obj->rowid) : $obj->qty_view; - print ''; + print ''; print ''; print ''; print ''.img_delete().''; From 4f413ca9839e77593c2f4cdd9573a69d8980019a Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 8 Apr 2021 16:46:52 +0200 Subject: [PATCH 058/140] add fk_project to warehouse table --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_entrepot.sql | 1 + 2 files changed, 3 insertions(+) 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 d186dc218ee..f2ae6c7d173 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 @@ -372,3 +372,5 @@ insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) v ALTER TABLE llx_facture_fourn ADD COLUMN date_closing datetime DEFAULT NULL after date_valid; ALTER TABLE llx_facture_fourn ADD COLUMN fk_user_closing integer DEFAULT NULL after fk_user_valid; + +ALTER TABLE llx_entrepot ADD COLUMN fk_project INTEGER DEFAULT NULL AFTER entity; -- project associated to warehouse if any diff --git a/htdocs/install/mysql/tables/llx_entrepot.sql b/htdocs/install/mysql/tables/llx_entrepot.sql index 2a390f008e2..be49978f6b7 100644 --- a/htdocs/install/mysql/tables/llx_entrepot.sql +++ b/htdocs/install/mysql/tables/llx_entrepot.sql @@ -25,6 +25,7 @@ create table llx_entrepot datec datetime, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, entity integer DEFAULT 1 NOT NULL, -- multi company id + fk_project integer DEFAULT NULL, -- project associated to warehouse if any description text, lieu varchar(64), -- resume lieu situation address varchar(255), From d098bf412d5f99480b335ba737ac1c7856486bc9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Apr 2021 17:35:52 +0200 Subject: [PATCH 059/140] Move directory to match the one of composer package for phpspreadsheet --- htdocs/core/modules/export/export_excel2007.modules.php | 2 +- htdocs/core/modules/import/import_xlsx.modules.php | 6 +++--- htdocs/filefunc.inc.php | 2 +- .../src}/PhpSpreadsheet/Calculation/Calculation.php | 0 .../src}/PhpSpreadsheet/Calculation/Category.php | 0 .../src}/PhpSpreadsheet/Calculation/Database.php | 0 .../src}/PhpSpreadsheet/Calculation/DateTime.php | 0 .../Calculation/Engine/CyclicReferenceStack.php | 0 .../src}/PhpSpreadsheet/Calculation/Engine/Logger.php | 0 .../src}/PhpSpreadsheet/Calculation/Engineering.php | 0 .../src}/PhpSpreadsheet/Calculation/Exception.php | 0 .../src}/PhpSpreadsheet/Calculation/ExceptionHandler.php | 0 .../src}/PhpSpreadsheet/Calculation/Financial.php | 0 .../src}/PhpSpreadsheet/Calculation/FormulaParser.php | 0 .../src}/PhpSpreadsheet/Calculation/FormulaToken.php | 0 .../src}/PhpSpreadsheet/Calculation/Functions.php | 0 .../src}/PhpSpreadsheet/Calculation/Logical.php | 0 .../src}/PhpSpreadsheet/Calculation/LookupRef.php | 0 .../src}/PhpSpreadsheet/Calculation/MathTrig.php | 0 .../src}/PhpSpreadsheet/Calculation/Statistical.php | 0 .../src}/PhpSpreadsheet/Calculation/TextData.php | 0 .../src}/PhpSpreadsheet/Calculation/Token/Stack.php | 0 .../src}/PhpSpreadsheet/Calculation/functionlist.txt | 0 .../src}/PhpSpreadsheet/Calculation/locale/bg/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/bg/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/cs/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/cs/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/da/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/da/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/de/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/de/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/en/uk/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/es/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/es/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/fi/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/fi/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/fr/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/fr/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/hu/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/hu/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/it/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/it/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/nl/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/nl/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/no/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/no/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/pl/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/pl/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/pt/br/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/pt/br/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/pt/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/pt/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/ru/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/ru/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/sv/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/sv/functions | 0 .../src}/PhpSpreadsheet/Calculation/locale/tr/config | 0 .../src}/PhpSpreadsheet/Calculation/locale/tr/functions | 0 .../src}/PhpSpreadsheet/Cell/AdvancedValueBinder.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Cell/Cell.php | 0 .../src}/PhpSpreadsheet/Cell/Coordinate.php | 0 .../src}/PhpSpreadsheet/Cell/DataType.php | 0 .../src}/PhpSpreadsheet/Cell/DataValidation.php | 0 .../src}/PhpSpreadsheet/Cell/DataValidator.php | 0 .../src}/PhpSpreadsheet/Cell/DefaultValueBinder.php | 0 .../src}/PhpSpreadsheet/Cell/Hyperlink.php | 0 .../src}/PhpSpreadsheet/Cell/IValueBinder.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/Axis.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/Chart.php | 0 .../src}/PhpSpreadsheet/Chart/DataSeries.php | 0 .../src}/PhpSpreadsheet/Chart/DataSeriesValues.php | 0 .../src}/PhpSpreadsheet/Chart/Exception.php | 0 .../src}/PhpSpreadsheet/Chart/GridLines.php | 0 .../src}/PhpSpreadsheet/Chart/Layout.php | 0 .../src}/PhpSpreadsheet/Chart/Legend.php | 0 .../src}/PhpSpreadsheet/Chart/PlotArea.php | 0 .../src}/PhpSpreadsheet/Chart/Properties.php | 0 .../src}/PhpSpreadsheet/Chart/Renderer/IRenderer.php | 0 .../src}/PhpSpreadsheet/Chart/Renderer/JpGraph.php | 0 .../Chart/Renderer/PHP Charting Libraries.txt | 0 .../src}/PhpSpreadsheet/Chart/Renderer/Polyfill.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/Title.php | 0 .../src}/PhpSpreadsheet/Collection/Cells.php | 0 .../src}/PhpSpreadsheet/Collection/CellsFactory.php | 0 .../src}/PhpSpreadsheet/Collection/Memory.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Comment.php | 0 .../src}/PhpSpreadsheet/Document/Properties.php | 0 .../src}/PhpSpreadsheet/Document/Security.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Exception.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/HashTable.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Helper/Html.php | 0 .../src}/PhpSpreadsheet/Helper/Migrator.php | 0 .../src}/PhpSpreadsheet/Helper/Sample.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/IComparable.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/IOFactory.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/NamedRange.php | 0 .../src}/PhpSpreadsheet/Reader/BaseReader.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Csv.php | 0 .../src}/PhpSpreadsheet/Reader/DefaultReadFilter.php | 0 .../src}/PhpSpreadsheet/Reader/Exception.php | 0 .../src}/PhpSpreadsheet/Reader/Gnumeric.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Html.php | 0 .../src}/PhpSpreadsheet/Reader/IReadFilter.php | 0 .../src}/PhpSpreadsheet/Reader/IReader.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Ods.php | 0 .../src}/PhpSpreadsheet/Reader/Security/XmlScanner.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Slk.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xls.php | 0 .../src}/PhpSpreadsheet/Reader/Xls/Color.php | 0 .../src}/PhpSpreadsheet/Reader/Xls/Color/BIFF5.php | 0 .../src}/PhpSpreadsheet/Reader/Xls/Color/BIFF8.php | 0 .../src}/PhpSpreadsheet/Reader/Xls/Color/BuiltIn.php | 0 .../src}/PhpSpreadsheet/Reader/Xls/ErrorCode.php | 0 .../src}/PhpSpreadsheet/Reader/Xls/Escher.php | 0 .../src}/PhpSpreadsheet/Reader/Xls/MD5.php | 0 .../src}/PhpSpreadsheet/Reader/Xls/RC4.php | 0 .../src}/PhpSpreadsheet/Reader/Xls/Style/Border.php | 0 .../src}/PhpSpreadsheet/Reader/Xls/Style/FillPattern.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xlsx.php | 0 .../src}/PhpSpreadsheet/Reader/Xlsx/Chart.php | 0 .../src}/PhpSpreadsheet/Reader/Xlsx/Theme.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xml.php | 0 .../src}/PhpSpreadsheet/ReferenceHelper.php | 0 .../src}/PhpSpreadsheet/RichText/ITextElement.php | 0 .../src}/PhpSpreadsheet/RichText/RichText.php | 0 .../src}/PhpSpreadsheet/RichText/Run.php | 0 .../src}/PhpSpreadsheet/RichText/TextElement.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Settings.php | 0 .../src}/PhpSpreadsheet/Shared/CodePage.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Date.php | 0 .../src}/PhpSpreadsheet/Shared/Drawing.php | 0 .../src}/PhpSpreadsheet/Shared/Escher.php | 0 .../src}/PhpSpreadsheet/Shared/Escher/DgContainer.php | 0 .../Shared/Escher/DgContainer/SpgrContainer.php | 0 .../Shared/Escher/DgContainer/SpgrContainer/SpContainer.php | 0 .../src}/PhpSpreadsheet/Shared/Escher/DggContainer.php | 0 .../Shared/Escher/DggContainer/BstoreContainer.php | 0 .../Shared/Escher/DggContainer/BstoreContainer/BSE.php | 0 .../Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/File.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Font.php | 0 .../src}/PhpSpreadsheet/Shared/JAMA/CHANGELOG.TXT | 0 .../PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php | 0 .../PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php | 0 .../src}/PhpSpreadsheet/Shared/JAMA/LUDecomposition.php | 0 .../src}/PhpSpreadsheet/Shared/JAMA/Matrix.php | 0 .../src}/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php | 0 .../Shared/JAMA/SingularValueDecomposition.php | 0 .../src}/PhpSpreadsheet/Shared/JAMA/utils/Maths.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/OLE.php | 0 .../src}/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php | 0 .../src}/PhpSpreadsheet/Shared/OLE/PPS.php | 0 .../src}/PhpSpreadsheet/Shared/OLE/PPS/File.php | 0 .../src}/PhpSpreadsheet/Shared/OLE/PPS/Root.php | 0 .../src}/PhpSpreadsheet/Shared/OLERead.php | 0 .../src}/PhpSpreadsheet/Shared/PasswordHasher.php | 0 .../src}/PhpSpreadsheet/Shared/StringHelper.php | 0 .../src}/PhpSpreadsheet/Shared/TimeZone.php | 0 .../src}/PhpSpreadsheet/Shared/Trend/BestFit.php | 0 .../src}/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php | 0 .../src}/PhpSpreadsheet/Shared/Trend/LinearBestFit.php | 0 .../src}/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php | 0 .../src}/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php | 0 .../src}/PhpSpreadsheet/Shared/Trend/PowerBestFit.php | 0 .../src}/PhpSpreadsheet/Shared/Trend/Trend.php | 0 .../src}/PhpSpreadsheet/Shared/XMLWriter.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Xls.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Spreadsheet.php | 0 .../src}/PhpSpreadsheet/Style/Alignment.php | 0 .../src}/PhpSpreadsheet/Style/Border.php | 0 .../src}/PhpSpreadsheet/Style/Borders.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Style/Color.php | 0 .../src}/PhpSpreadsheet/Style/Conditional.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Style/Fill.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Style/Font.php | 0 .../src}/PhpSpreadsheet/Style/NumberFormat.php | 0 .../src}/PhpSpreadsheet/Style/Protection.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Style/Style.php | 0 .../src}/PhpSpreadsheet/Style/Supervisor.php | 0 .../src}/PhpSpreadsheet/Worksheet/AutoFilter.php | 0 .../src}/PhpSpreadsheet/Worksheet/AutoFilter/Column.php | 0 .../PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php | 0 .../src}/PhpSpreadsheet/Worksheet/BaseDrawing.php | 0 .../src}/PhpSpreadsheet/Worksheet/CellIterator.php | 0 .../src}/PhpSpreadsheet/Worksheet/Column.php | 0 .../src}/PhpSpreadsheet/Worksheet/ColumnCellIterator.php | 0 .../src}/PhpSpreadsheet/Worksheet/ColumnDimension.php | 0 .../src}/PhpSpreadsheet/Worksheet/ColumnIterator.php | 0 .../src}/PhpSpreadsheet/Worksheet/Dimension.php | 0 .../src}/PhpSpreadsheet/Worksheet/Drawing.php | 0 .../src}/PhpSpreadsheet/Worksheet/Drawing/Shadow.php | 0 .../src}/PhpSpreadsheet/Worksheet/HeaderFooter.php | 0 .../src}/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php | 0 .../src}/PhpSpreadsheet/Worksheet/Iterator.php | 0 .../src}/PhpSpreadsheet/Worksheet/MemoryDrawing.php | 0 .../src}/PhpSpreadsheet/Worksheet/PageMargins.php | 0 .../src}/PhpSpreadsheet/Worksheet/PageSetup.php | 0 .../src}/PhpSpreadsheet/Worksheet/Protection.php | 0 .../src}/PhpSpreadsheet/Worksheet/Row.php | 0 .../src}/PhpSpreadsheet/Worksheet/RowCellIterator.php | 0 .../src}/PhpSpreadsheet/Worksheet/RowDimension.php | 0 .../src}/PhpSpreadsheet/Worksheet/RowIterator.php | 0 .../src}/PhpSpreadsheet/Worksheet/SheetView.php | 0 .../src}/PhpSpreadsheet/Worksheet/Worksheet.php | 0 .../src}/PhpSpreadsheet/Writer/BaseWriter.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Csv.php | 0 .../src}/PhpSpreadsheet/Writer/Exception.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Html.php | 0 .../src}/PhpSpreadsheet/Writer/IWriter.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Ods.php | 0 .../src}/PhpSpreadsheet/Writer/Ods/Cell/Comment.php | 0 .../src}/PhpSpreadsheet/Writer/Ods/Content.php | 0 .../src}/PhpSpreadsheet/Writer/Ods/Meta.php | 0 .../src}/PhpSpreadsheet/Writer/Ods/MetaInf.php | 0 .../src}/PhpSpreadsheet/Writer/Ods/Mimetype.php | 0 .../src}/PhpSpreadsheet/Writer/Ods/Settings.php | 0 .../src}/PhpSpreadsheet/Writer/Ods/Styles.php | 0 .../src}/PhpSpreadsheet/Writer/Ods/Thumbnails.php | 0 .../src}/PhpSpreadsheet/Writer/Ods/WriterPart.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Pdf.php | 0 .../src}/PhpSpreadsheet/Writer/Pdf/Dompdf.php | 0 .../src}/PhpSpreadsheet/Writer/Pdf/Mpdf.php | 0 .../src}/PhpSpreadsheet/Writer/Pdf/Tcpdf.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xls.php | 0 .../src}/PhpSpreadsheet/Writer/Xls/BIFFwriter.php | 0 .../src}/PhpSpreadsheet/Writer/Xls/Escher.php | 0 .../src}/PhpSpreadsheet/Writer/Xls/Font.php | 0 .../src}/PhpSpreadsheet/Writer/Xls/Parser.php | 0 .../src}/PhpSpreadsheet/Writer/Xls/Workbook.php | 0 .../src}/PhpSpreadsheet/Writer/Xls/Worksheet.php | 0 .../src}/PhpSpreadsheet/Writer/Xls/Xf.php | 0 .../{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx.php | 0 .../src}/PhpSpreadsheet/Writer/Xlsx/Chart.php | 0 .../src}/PhpSpreadsheet/Writer/Xlsx/Comments.php | 0 .../src}/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php | 0 .../src}/PhpSpreadsheet/Writer/Xlsx/DocProps.php | 0 .../src}/PhpSpreadsheet/Writer/Xlsx/Drawing.php | 0 .../src}/PhpSpreadsheet/Writer/Xlsx/Rels.php | 0 .../src}/PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php | 0 .../src}/PhpSpreadsheet/Writer/Xlsx/RelsVBA.php | 0 .../src}/PhpSpreadsheet/Writer/Xlsx/StringTable.php | 0 .../src}/PhpSpreadsheet/Writer/Xlsx/Style.php | 0 .../src}/PhpSpreadsheet/Writer/Xlsx/Theme.php | 0 .../src}/PhpSpreadsheet/Writer/Xlsx/Workbook.php | 0 .../src}/PhpSpreadsheet/Writer/Xlsx/Worksheet.php | 0 .../src}/PhpSpreadsheet/Writer/Xlsx/WriterPart.php | 0 htdocs/install/upgrade2.php | 5 +++++ 247 files changed, 10 insertions(+), 5 deletions(-) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/Calculation.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/Category.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/Database.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/DateTime.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/Engine/Logger.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/Engineering.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/Exception.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/ExceptionHandler.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/Financial.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/FormulaParser.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/FormulaToken.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/Functions.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/Logical.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/LookupRef.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/MathTrig.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/Statistical.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/TextData.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/Token/Stack.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/functionlist.txt (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/bg/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/bg/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/cs/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/cs/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/da/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/da/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/de/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/de/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/en/uk/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/es/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/es/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/fi/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/fi/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/fr/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/fr/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/hu/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/hu/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/it/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/it/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/nl/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/nl/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/no/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/no/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/pl/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/pl/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/pt/br/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/pt/br/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/pt/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/pt/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/ru/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/ru/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/sv/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/sv/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/tr/config (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Calculation/locale/tr/functions (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Cell/AdvancedValueBinder.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Cell/Cell.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Cell/Coordinate.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Cell/DataType.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Cell/DataValidation.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Cell/DataValidator.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Cell/DefaultValueBinder.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Cell/Hyperlink.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Cell/IValueBinder.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/Axis.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/Chart.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/DataSeries.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/DataSeriesValues.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/Exception.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/GridLines.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/Layout.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/Legend.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/PlotArea.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/Properties.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/Renderer/IRenderer.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/Renderer/JpGraph.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/Renderer/PHP Charting Libraries.txt (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/Renderer/Polyfill.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Chart/Title.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Collection/Cells.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Collection/CellsFactory.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Collection/Memory.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Comment.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Document/Properties.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Document/Security.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Exception.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/HashTable.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Helper/Html.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Helper/Migrator.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Helper/Sample.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/IComparable.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/IOFactory.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/NamedRange.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/BaseReader.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Csv.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/DefaultReadFilter.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Exception.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Gnumeric.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Html.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/IReadFilter.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/IReader.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Ods.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Security/XmlScanner.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Slk.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xls.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xls/Color.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xls/Color/BIFF5.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xls/Color/BIFF8.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xls/Color/BuiltIn.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xls/ErrorCode.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xls/Escher.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xls/MD5.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xls/RC4.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xls/Style/Border.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xls/Style/FillPattern.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xlsx.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xlsx/Chart.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xlsx/Theme.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Reader/Xml.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/ReferenceHelper.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/RichText/ITextElement.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/RichText/RichText.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/RichText/Run.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/RichText/TextElement.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Settings.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/CodePage.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Date.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Drawing.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Escher.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Escher/DgContainer.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Escher/DggContainer.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/File.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Font.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/JAMA/CHANGELOG.TXT (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/JAMA/LUDecomposition.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/JAMA/Matrix.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/JAMA/utils/Maths.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/OLE.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/OLE/PPS.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/OLE/PPS/File.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/OLE/PPS/Root.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/OLERead.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/PasswordHasher.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/StringHelper.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/TimeZone.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Trend/BestFit.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Trend/LinearBestFit.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Trend/PowerBestFit.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Trend/Trend.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/XMLWriter.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Shared/Xls.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Spreadsheet.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Style/Alignment.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Style/Border.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Style/Borders.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Style/Color.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Style/Conditional.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Style/Fill.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Style/Font.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Style/NumberFormat.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Style/Protection.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Style/Style.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Style/Supervisor.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/AutoFilter.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/AutoFilter/Column.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/BaseDrawing.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/CellIterator.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/Column.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/ColumnCellIterator.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/ColumnDimension.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/ColumnIterator.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/Dimension.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/Drawing.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/Drawing/Shadow.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/HeaderFooter.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/Iterator.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/MemoryDrawing.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/PageMargins.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/PageSetup.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/Protection.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/Row.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/RowCellIterator.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/RowDimension.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/RowIterator.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/SheetView.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Worksheet/Worksheet.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/BaseWriter.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Csv.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Exception.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Html.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/IWriter.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Ods.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Ods/Cell/Comment.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Ods/Content.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Ods/Meta.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Ods/MetaInf.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Ods/Mimetype.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Ods/Settings.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Ods/Styles.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Ods/Thumbnails.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Ods/WriterPart.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Pdf.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Pdf/Dompdf.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Pdf/Mpdf.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Pdf/Tcpdf.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xls.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xls/BIFFwriter.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xls/Escher.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xls/Font.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xls/Parser.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xls/Workbook.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xls/Worksheet.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xls/Xf.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx/Chart.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx/Comments.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx/DocProps.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx/Drawing.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx/Rels.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx/RelsVBA.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx/StringTable.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx/Style.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx/Theme.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx/Workbook.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx/Worksheet.php (100%) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/PhpSpreadsheet/Writer/Xlsx/WriterPart.php (100%) diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index ed85493f04f..370fc49df7e 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -193,7 +193,7 @@ class ExportExcel2007 extends ModeleExports $outputlangs->load("exports"); - require_once DOL_DOCUMENT_ROOT.'/includes/phpoffice/autoloader.php'; + require_once DOL_DOCUMENT_ROOT.'/includes/phpoffice/phpspreadsheet/src/autoloader.php'; require_once DOL_DOCUMENT_ROOT.'/includes/Psr/autoloader.php'; require_once PHPEXCELNEW_PATH.'Spreadsheet.php'; diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index bc146c5ece7..d90a52755e3 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -112,9 +112,9 @@ class ImportXlsx extends ModeleImports $this->picto = 'mime/xls'; // Picto (This is not used by the example file code as Mime type, too bad ...) $this->version = '1.0'; // Driver version // If driver use an external library, put its name here - require_once DOL_DOCUMENT_ROOT . '/includes/phpoffice/autoloader.php'; - require_once DOL_DOCUMENT_ROOT . '/includes/Psr/autoloader.php'; - require_once PHPEXCELNEW_PATH . 'Spreadsheet.php'; + require_once DOL_DOCUMENT_ROOT.'/includes/phpoffice/phpspreadsheet/src/autoloader.php'; + require_once DOL_DOCUMENT_ROOT.'/includes/Psr/autoloader.php'; + require_once PHPEXCELNEW_PATH.'Spreadsheet.php'; $this->workbook = new Spreadsheet(); //if ($this->id == 'excel2007new') diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index aff0ebad349..e479b1430a1 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -298,7 +298,7 @@ if (!defined('NUSOAP_PATH')) { define('NUSOAP_PATH', (!isset($dolibarr_lib_NUSOAP_PATH)) ?DOL_DOCUMENT_ROOT.'/includes/nusoap/lib/' : (empty($dolibarr_lib_NUSOAP_PATH) ? '' : $dolibarr_lib_NUSOAP_PATH.'/')); } if (!defined('PHPEXCELNEW_PATH')) { - define('PHPEXCELNEW_PATH', (!isset($dolibarr_lib_PHPEXCELNEW_PATH)) ?DOL_DOCUMENT_ROOT.'/includes/phpoffice/PhpSpreadsheet/' : (empty($dolibarr_lib_PHPEXCELNEW_PATH) ? '' : $dolibarr_lib_PHPEXCELNEW_PATH.'/')); + define('PHPEXCELNEW_PATH', (!isset($dolibarr_lib_PHPEXCELNEW_PATH)) ?DOL_DOCUMENT_ROOT.'/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/' : (empty($dolibarr_lib_PHPEXCELNEW_PATH) ? '' : $dolibarr_lib_PHPEXCELNEW_PATH.'/')); } if (!defined('ODTPHP_PATH')) { define('ODTPHP_PATH', (!isset($dolibarr_lib_ODTPHP_PATH)) ?DOL_DOCUMENT_ROOT.'/includes/odtphp/' : (empty($dolibarr_lib_ODTPHP_PATH) ? '' : $dolibarr_lib_ODTPHP_PATH.'/')); diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Calculation.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Calculation.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Category.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Category.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Category.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Category.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Database.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Database.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/DateTime.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTime.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/DateTime.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTime.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Engine/Logger.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Engine/Logger.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Engineering.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Engineering.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Exception.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Exception.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Exception.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Exception.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/ExceptionHandler.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ExceptionHandler.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/ExceptionHandler.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ExceptionHandler.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Financial.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Financial.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/FormulaParser.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaParser.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/FormulaParser.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaParser.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/FormulaToken.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaToken.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/FormulaToken.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaToken.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Functions.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Functions.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Logical.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Logical.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/LookupRef.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/LookupRef.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/MathTrig.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/MathTrig.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Statistical.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Statistical.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/TextData.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/TextData.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Token/Stack.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Token/Stack.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/Token/Stack.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Token/Stack.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/functionlist.txt b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/functionlist.txt similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/functionlist.txt rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/functionlist.txt diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/bg/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/bg/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/bg/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/bg/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/bg/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/bg/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/bg/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/bg/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/cs/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/cs/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/cs/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/cs/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/cs/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/cs/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/cs/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/cs/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/da/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/da/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/da/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/da/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/da/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/da/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/da/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/da/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/de/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/de/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/de/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/de/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/de/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/de/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/de/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/de/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/en/uk/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/en/uk/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/en/uk/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/en/uk/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/es/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/es/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/es/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/es/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/es/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/es/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/es/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/es/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/fi/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fi/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/fi/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fi/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/fi/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fi/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/fi/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fi/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/fr/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fr/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/fr/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fr/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/fr/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fr/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/fr/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fr/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/hu/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/hu/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/hu/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/hu/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/hu/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/hu/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/hu/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/hu/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/it/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/it/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/it/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/it/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/it/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/it/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/it/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/it/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/nl/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nl/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/nl/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nl/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/nl/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nl/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/nl/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nl/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/no/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/no/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/no/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/no/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/no/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/no/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/no/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/no/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/pl/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pl/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/pl/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pl/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/pl/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pl/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/pl/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pl/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/pt/br/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/br/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/pt/br/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/br/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/pt/br/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/br/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/pt/br/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/br/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/pt/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/pt/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/pt/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/pt/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/ru/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/ru/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/ru/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/ru/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/sv/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/sv/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/sv/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/sv/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/sv/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/sv/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/sv/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/sv/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/tr/config b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/tr/config similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/tr/config rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/tr/config diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/tr/functions b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/tr/functions similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Calculation/locale/tr/functions rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/tr/functions diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Cell/AdvancedValueBinder.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Cell/AdvancedValueBinder.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Cell/Cell.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Cell/Cell.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Cell/Coordinate.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Cell/Coordinate.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Cell/DataType.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataType.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Cell/DataType.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataType.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Cell/DataValidation.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidation.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Cell/DataValidation.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidation.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Cell/DataValidator.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidator.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Cell/DataValidator.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidator.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Cell/DefaultValueBinder.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Cell/DefaultValueBinder.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Cell/Hyperlink.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Hyperlink.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Cell/Hyperlink.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Hyperlink.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Cell/IValueBinder.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/IValueBinder.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Cell/IValueBinder.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/IValueBinder.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Axis.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Axis.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Chart.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Chart.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Chart.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Chart.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/DataSeries.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeries.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/DataSeries.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeries.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/DataSeriesValues.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeriesValues.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/DataSeriesValues.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeriesValues.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Exception.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Exception.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Exception.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Exception.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/GridLines.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/GridLines.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/GridLines.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/GridLines.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Layout.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Layout.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Layout.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Layout.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Legend.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Legend.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/PlotArea.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/PlotArea.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/PlotArea.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/PlotArea.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Properties.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Properties.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Properties.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Properties.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Renderer/IRenderer.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/IRenderer.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Renderer/IRenderer.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/IRenderer.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Renderer/JpGraph.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/JpGraph.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Renderer/JpGraph.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/JpGraph.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Renderer/PHP Charting Libraries.txt b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/PHP Charting Libraries.txt similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Renderer/PHP Charting Libraries.txt rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/PHP Charting Libraries.txt diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Renderer/Polyfill.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/Polyfill.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Renderer/Polyfill.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/Polyfill.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Title.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Title.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Chart/Title.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Title.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Collection/Cells.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Cells.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Collection/Cells.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Cells.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Collection/CellsFactory.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/CellsFactory.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Collection/CellsFactory.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/CellsFactory.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Collection/Memory.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Collection/Memory.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Comment.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Comment.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Comment.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Comment.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Document/Properties.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Properties.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Document/Properties.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Properties.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Document/Security.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Security.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Document/Security.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Security.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Exception.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Exception.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Exception.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Exception.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/HashTable.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/HashTable.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/HashTable.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/HashTable.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Helper/Html.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Html.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Helper/Html.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Html.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Helper/Migrator.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Migrator.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Helper/Migrator.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Migrator.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Helper/Sample.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Sample.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Helper/Sample.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Sample.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/IComparable.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IComparable.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/IComparable.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IComparable.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/IOFactory.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/IOFactory.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/NamedRange.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/NamedRange.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/NamedRange.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/NamedRange.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/BaseReader.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/BaseReader.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Csv.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Csv.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/DefaultReadFilter.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/DefaultReadFilter.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/DefaultReadFilter.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/DefaultReadFilter.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Exception.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Exception.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Exception.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Exception.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Gnumeric.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Gnumeric.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Html.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Html.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/IReadFilter.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReadFilter.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/IReadFilter.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReadFilter.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/IReader.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReader.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/IReader.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReader.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Ods.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Ods.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Security/XmlScanner.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Security/XmlScanner.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Slk.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Slk.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Slk.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Slk.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/Color.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/Color.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/Color/BIFF5.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BIFF5.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/Color/BIFF5.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BIFF5.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/Color/BIFF8.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BIFF8.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/Color/BIFF8.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BIFF8.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/Color/BuiltIn.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BuiltIn.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/Color/BuiltIn.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BuiltIn.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/ErrorCode.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/ErrorCode.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/ErrorCode.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/ErrorCode.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/Escher.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Escher.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/Escher.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Escher.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/MD5.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/MD5.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/MD5.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/MD5.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/RC4.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/RC4.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/RC4.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/RC4.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/Style/Border.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Style/Border.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/Style/Border.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Style/Border.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/Style/FillPattern.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Style/FillPattern.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xls/Style/FillPattern.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Style/FillPattern.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xlsx.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xlsx.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xlsx/Chart.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Chart.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xlsx/Chart.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Chart.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xlsx/Theme.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Theme.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xlsx/Theme.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Theme.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xml.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Reader/Xml.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/ReferenceHelper.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/ReferenceHelper.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/RichText/ITextElement.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/ITextElement.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/RichText/ITextElement.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/ITextElement.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/RichText/RichText.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/RichText.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/RichText/RichText.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/RichText.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/RichText/Run.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/RichText/Run.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/RichText/TextElement.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/TextElement.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/RichText/TextElement.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/TextElement.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Settings.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Settings.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/CodePage.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/CodePage.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/CodePage.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/CodePage.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Date.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Date.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Drawing.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Drawing.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Drawing.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Drawing.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher/DgContainer.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher/DgContainer.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher/DggContainer.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher/DggContainer.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/File.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/File.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Font.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Font.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Font.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Font.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/CHANGELOG.TXT b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/CHANGELOG.TXT similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/CHANGELOG.TXT rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/CHANGELOG.TXT diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/LUDecomposition.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/LUDecomposition.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/LUDecomposition.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/LUDecomposition.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/Matrix.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/Matrix.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/Matrix.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/Matrix.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/utils/Maths.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/utils/Maths.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/JAMA/utils/Maths.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/utils/Maths.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/OLE.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/OLE.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/OLE/PPS.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/OLE/PPS.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/OLE/PPS/File.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/File.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/OLE/PPS/File.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/File.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/OLE/PPS/Root.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/OLE/PPS/Root.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/OLERead.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLERead.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/OLERead.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLERead.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/PasswordHasher.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/PasswordHasher.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/PasswordHasher.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/PasswordHasher.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/StringHelper.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/StringHelper.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/TimeZone.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/TimeZone.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/TimeZone.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/TimeZone.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Trend/BestFit.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Trend/BestFit.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Trend/LinearBestFit.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Trend/LinearBestFit.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Trend/PowerBestFit.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Trend/PowerBestFit.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Trend/Trend.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Trend/Trend.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/XMLWriter.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/XMLWriter.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Xls.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Xls.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Shared/Xls.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Xls.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Spreadsheet.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Spreadsheet.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Style/Alignment.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Alignment.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Style/Alignment.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Alignment.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Style/Border.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Border.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Style/Border.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Border.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Style/Borders.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Borders.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Style/Borders.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Borders.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Style/Color.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Color.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Style/Color.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Color.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Style/Conditional.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Style/Conditional.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Style/Fill.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Fill.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Style/Fill.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Fill.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Style/Font.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Font.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Style/Font.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Font.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Style/NumberFormat.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Style/NumberFormat.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Style/Protection.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Protection.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Style/Protection.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Protection.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Style/Style.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Style/Style.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Style/Supervisor.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Supervisor.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Style/Supervisor.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Supervisor.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/AutoFilter.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/AutoFilter.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/AutoFilter/Column.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/AutoFilter/Column.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/BaseDrawing.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/BaseDrawing.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/BaseDrawing.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/BaseDrawing.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/CellIterator.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/CellIterator.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/CellIterator.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/CellIterator.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Column.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Column.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Column.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Column.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/ColumnCellIterator.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/ColumnCellIterator.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/ColumnDimension.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnDimension.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/ColumnDimension.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnDimension.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/ColumnIterator.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnIterator.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/ColumnIterator.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnIterator.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Dimension.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Dimension.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Drawing.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Drawing.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Drawing/Shadow.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Drawing/Shadow.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/HeaderFooter.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooter.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/HeaderFooter.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooter.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Iterator.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Iterator.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Iterator.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Iterator.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/MemoryDrawing.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/MemoryDrawing.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/PageMargins.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageMargins.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/PageMargins.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageMargins.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/PageSetup.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageSetup.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/PageSetup.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageSetup.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Protection.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Protection.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Protection.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Protection.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Row.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Row.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Row.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Row.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/RowCellIterator.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowCellIterator.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/RowCellIterator.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowCellIterator.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/RowDimension.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowDimension.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/RowDimension.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowDimension.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/RowIterator.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowIterator.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/RowIterator.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowIterator.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/SheetView.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/SheetView.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/SheetView.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/SheetView.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Worksheet.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Worksheet/Worksheet.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/BaseWriter.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/BaseWriter.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Csv.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Csv.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Csv.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Csv.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Exception.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Exception.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Exception.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Exception.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Html.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Html.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Html.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Html.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/IWriter.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/IWriter.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/IWriter.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/IWriter.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/Cell/Comment.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Cell/Comment.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/Cell/Comment.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Cell/Comment.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/Content.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Content.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/Content.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Content.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/Meta.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Meta.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/Meta.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Meta.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/MetaInf.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/MetaInf.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/MetaInf.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/MetaInf.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/Mimetype.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Mimetype.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/Mimetype.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Mimetype.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/Settings.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Settings.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/Settings.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Settings.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/Styles.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Styles.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/Styles.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Styles.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/Thumbnails.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Thumbnails.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/Thumbnails.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Thumbnails.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/WriterPart.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/WriterPart.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Ods/WriterPart.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/WriterPart.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Pdf.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Pdf.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Pdf/Dompdf.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Pdf/Dompdf.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Pdf/Mpdf.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Pdf/Mpdf.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Pdf/Tcpdf.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Pdf/Tcpdf.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls/BIFFwriter.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/BIFFwriter.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls/BIFFwriter.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/BIFFwriter.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls/Escher.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Escher.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls/Escher.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Escher.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls/Font.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Font.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls/Font.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Font.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls/Parser.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Parser.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls/Parser.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Parser.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls/Workbook.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Workbook.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls/Workbook.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Workbook.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls/Worksheet.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls/Worksheet.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls/Xf.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Xf.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xls/Xf.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Xf.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Chart.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Chart.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Chart.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Chart.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Comments.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Comments.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Comments.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Comments.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/DocProps.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/DocProps.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/DocProps.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/DocProps.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Drawing.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Drawing.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Drawing.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Drawing.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Rels.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Rels.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Rels.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Rels.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/RelsVBA.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsVBA.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/RelsVBA.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsVBA.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/StringTable.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/StringTable.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/StringTable.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/StringTable.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Style.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Style.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Style.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Style.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Theme.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Theme.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Theme.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Theme.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Workbook.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Workbook.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Workbook.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Workbook.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Worksheet.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/Worksheet.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php diff --git a/htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/WriterPart.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/WriterPart.php similarity index 100% rename from htdocs/includes/phpoffice/PhpSpreadsheet/Writer/Xlsx/WriterPart.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/WriterPart.php diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 0db923b138f..23fa3d95a3c 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4098,6 +4098,11 @@ function migrate_delete_old_dir($db, $langs, $conf) DOL_DOCUMENT_ROOT.'/core/modules/facture/mercure', ); + // On linux, we can also removed old directory with a different case than new directory. + if (!empty($_SERVER["WINDIR"])) { + $filetodeletearray[] = DOL_DOCUMENT_ROOT.'/includes/phpoffice/PhpSpreadsheet'; + } + foreach ($filetodeletearray as $filetodelete) { //print ''.$filetodelete."
\n"; if (file_exists($filetodelete)) { From 04536f9ec8bd641f8e97f8550f1b401fe693c7bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Apr 2021 17:49:13 +0200 Subject: [PATCH 060/140] Fix import --- htdocs/imports/import.php | 25 +++++++++++-------- .../{ => phpspreadsheet/src}/autoloader.php | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) rename htdocs/includes/phpoffice/{ => phpspreadsheet/src}/autoloader.php (81%) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index f484e3b0901..0783e6352a4 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -492,12 +492,16 @@ if ($step == 2 && $datatoimport) { print ''; print ''; + print '
'; + print ''; $s = $langs->trans("ChooseFormatOfFileToImport", '{s1}'); $s = str_replace('{s1}', img_picto('', 'next'), $s); print $s; print '

'; + print '
'; + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; @@ -513,7 +517,9 @@ if ($step == 2 && $datatoimport) { print ''; $text = $objmodelimport->getDriverDescForKey($key); print ''; - print ''; + print ''; // Action button print '
'.img_picto_common($key, $objmodelimport->getPictoForKey($key)).''.$form->textwithpicto($objmodelimport->getDriverLabelForKey($key), $text).''.$langs->trans("DownloadEmptyExample").''; + print img_picto('', 'download', 'class="paddingright opacitymedium"').''.$langs->trans("DownloadEmptyExample").''; + print ''; print ''.img_picto($langs->trans("SelectFormat"), 'next', 'class="fa-15x"').''; @@ -587,7 +593,7 @@ if ($step == 3 && $datatoimport) { print '
'; print '
'; - print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', ''); + print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', 'file-export'); print '
'; print '
'; @@ -598,8 +604,8 @@ if ($step == 3 && $datatoimport) { print ''; $text = $objmodelimport->getDriverDescForKey($format); print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format), $text); - print ''.$langs->trans("DownloadEmptyExample").''; - + print ''; + print img_picto('', 'download', 'class="paddingright opacitymedium"').''.$langs->trans("DownloadEmptyExample").''; print ''; print ''; @@ -890,7 +896,7 @@ if ($step == 4 && $datatoimport) { print ''; print '
'; - print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', ''); + print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', 'file-export'); print '
'; print '
'; @@ -1374,7 +1380,7 @@ if ($step == 5 && $datatoimport) { print ''; print '
'; - print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', ''); + print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', 'file-export'); print '
'; print '
'; @@ -1468,7 +1474,7 @@ if ($step == 5 && $datatoimport) { print '
'; - print load_fiche_titre($langs->trans("InformationOnTargetTables"), '', ''); + print load_fiche_titre($langs->trans("InformationOnTargetTables"), '', 'file-import'); print '
'; print '
'; @@ -1812,7 +1818,7 @@ if ($step == 6 && $datatoimport) { print ''; print '
'; - print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', ''); + print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', 'file-export'); print '
'; print '
'; @@ -1875,8 +1881,7 @@ if ($step == 6 && $datatoimport) { print ''.$langs->trans("InformationOnTargetTables").''; print '
'; print '
'; - print ''; - //print ''; + print '
'.$langs->trans("InformationOnTargetTables").'
'; // Tables imported print '\n"; + +// Amount by member type +$adht = new AdherentType($db); +$amountbytype = empty($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE) ? -1 : json_decode($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE, true); +print '\n"; + // Insert subscription into bank account print ''; $arraychoices = array('0'=>$langs->trans("None")); diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index d4f2df25c0c..8b32e79526d 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -177,7 +177,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print $langs->trans("ForceMemberType"); print '\n"; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 79fef823883..f7a87e9bf0c 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1490,9 +1490,11 @@ class Adherent extends CommonObject * @param string $emetteur_nom Name of cheque writer * @param string $emetteur_banque Name of bank of cheque * @param int $datesubend Date end subscription + * @param int fk_type Member type id + * * @return int rowid of record added, <0 if KO */ - public function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0) + public function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0, $fk_type = NULL) { global $conf, $langs, $user; @@ -1523,6 +1525,7 @@ class Adherent extends CommonObject $subscription->amount = $amount; $subscription->note = $label; // deprecated $subscription->note_public = $label; + $subscription->fk_type = $fk_type; $rowid = $subscription->create($user); if ($rowid > 0) { diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 31d0790b331..7f36f759bb1 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -169,6 +169,7 @@ DocForLabels=Generate address sheets SubscriptionPayment=Subscription payment LastSubscriptionDate=Date of latest subscription payment LastSubscriptionAmount=Amount of latest subscription +LastMemberType=Last Member type MembersStatisticsByCountries=Members statistics by country MembersStatisticsByState=Members statistics by state/province MembersStatisticsByTown=Members statistics by town diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index ea52dc21d7a..a541c347adb 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -162,6 +162,7 @@ DocForLabels=Génération d'étiquettes d'adresses SubscriptionPayment=Paiement cotisation LastSubscriptionDate=Date de dernière adhésion LastSubscriptionAmount=Montant dernière adhésion +LastMemberType=Ancien type de membre MembersStatisticsByCountries=Statistiques des membres par pays MembersStatisticsByState=Statistiques des membres par département/province/canton MembersStatisticsByTown=Statistiques des membres par ville diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 486223b0293..d55a8add8ea 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1437,6 +1437,39 @@ if ($source == 'membersubscription') { $_GET['newamount'] = $member->last_subscription_amount; } } + + if ($member->type) { + // Last member type + print '"."\n"; + } + + if (!empty($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE)) { + // Amount by member type + $amountbytype = json_decode($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE, true); + // Set the member type + $member->typeid = (int)(GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $member->typeid); + // If we change the type of membership, we set also label of new type + $member->type = dol_getIdFromCode($db, $member->typeid, 'adherent_type', 'rowid', 'libelle'); + // Set amount for the subscription + $amount = $amountbytype[$member->typeid] ? $amountbytype[$member->typeid] : $member->last_subscription_amount; + // list member type + 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 + print '"."\n"; + } elseif ($action == dopayment) { + print '"."\n"; + } + } // Amount print '\n"; $adht = new AdherentType($db); $amountbytype = empty($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE) ? -1 : json_decode($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE, true); print '\n"; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index f7a87e9bf0c..40394a36062 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1494,7 +1494,7 @@ class Adherent extends CommonObject * * @return int rowid of record added, <0 if KO */ - public function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0, $fk_type = NULL) + public function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0, $fk_type = null) { global $conf, $langs, $user; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index d55a8add8ea..f665556d3d2 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1437,38 +1437,38 @@ if ($source == 'membersubscription') { $_GET['newamount'] = $member->last_subscription_amount; } } - + if ($member->type) { - // Last member type - print '"."\n"; + // Last member type + print '"."\n"; } - + if (!empty($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE)) { - // Amount by member type - $amountbytype = json_decode($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE, true); - // Set the member type - $member->typeid = (int)(GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $member->typeid); - // If we change the type of membership, we set also label of new type - $member->type = dol_getIdFromCode($db, $member->typeid, 'adherent_type', 'rowid', 'libelle'); - // Set amount for the subscription - $amount = $amountbytype[$member->typeid] ? $amountbytype[$member->typeid] : $member->last_subscription_amount; - // list member type - 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 - print '"."\n"; - } elseif ($action == dopayment) { - print '"."\n"; - } + // Amount by member type + $amountbytype = json_decode($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE, true); + // Set the member type + $member->typeid = (int) (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $member->typeid); + // If we change the type of membership, we set also label of new type + $member->type = dol_getIdFromCode($db, $member->typeid, 'adherent_type', 'rowid', 'libelle'); + // Set amount for the subscription + $amount = $amountbytype[$member->typeid] ? $amountbytype[$member->typeid] : $member->last_subscription_amount; + // list member type + 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 + print '"."\n"; + } elseif ($action == dopayment) { + print '"."\n"; + } } // Amount diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index bf957d4cf6b..399d1c2575a 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -340,7 +340,7 @@ if ($ispaymentok) { $user->rights->facture = new stdClass(); } if (empty($user->rights->adherent)) { - $user->rights->adherent = new stdClass(); + $user->rights->adherent = new stdClass(); $user->rights->adherent->cotisation = new stdClass(); } $user->rights->societe->creer = 1; From 62485655512fb0dde76cc21da7964828bca6f3b8 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Fri, 9 Apr 2021 02:32:40 +0200 Subject: [PATCH 070/140] fix code style --- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/public/payment/newpayment.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index f7a87e9bf0c..6f6f82c5fd1 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1490,7 +1490,7 @@ class Adherent extends CommonObject * @param string $emetteur_nom Name of cheque writer * @param string $emetteur_banque Name of bank of cheque * @param int $datesubend Date end subscription - * @param int fk_type Member type id + * @param int $fk_type Member type id * * @return int rowid of record added, <0 if KO */ diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index d55a8add8ea..8217e36d0d1 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1442,7 +1442,7 @@ if ($source == 'membersubscription') { // Last member type print '"."\n"; + print "\n"; } if (!empty($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE)) { @@ -1462,12 +1462,12 @@ if ($source == 'membersubscription') { print '"."\n"; + print "\n"; } elseif ($action == dopayment) { print '"."\n"; + print "\n"; } } From 51d327e99c6a6811e52e79d33b39f63e9ab6d9c6 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Fri, 9 Apr 2021 02:36:57 +0200 Subject: [PATCH 071/140] Revert "fix code style" This reverts commit 62485655512fb0dde76cc21da7964828bca6f3b8. --- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/public/payment/newpayment.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 6f6f82c5fd1..f7a87e9bf0c 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1490,7 +1490,7 @@ class Adherent extends CommonObject * @param string $emetteur_nom Name of cheque writer * @param string $emetteur_banque Name of bank of cheque * @param int $datesubend Date end subscription - * @param int $fk_type Member type id + * @param int fk_type Member type id * * @return int rowid of record added, <0 if KO */ diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 8217e36d0d1..d55a8add8ea 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1442,7 +1442,7 @@ if ($source == 'membersubscription') { // Last member type print '\n"; + print ""."\n"; } if (!empty($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE)) { @@ -1462,12 +1462,12 @@ if ($source == 'membersubscription') { print '\n"; + print ""."\n"; } elseif ($action == dopayment) { print '\n"; + print ""."\n"; } } From 9ee80be23fbc8b33cdf26b9bc36cdf75d5d08a65 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Fri, 9 Apr 2021 02:40:21 +0200 Subject: [PATCH 072/140] fix code style errors --- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/public/payment/newpayment.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 40394a36062..01b7d7db644 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1490,7 +1490,7 @@ class Adherent extends CommonObject * @param string $emetteur_nom Name of cheque writer * @param string $emetteur_banque Name of bank of cheque * @param int $datesubend Date end subscription - * @param int fk_type Member type id + * @param int $fk_type Member type id * * @return int rowid of record added, <0 if KO */ diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index f665556d3d2..b473fe4f38a 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1442,7 +1442,7 @@ if ($source == 'membersubscription') { // Last member type print '"."\n"; + print "\n"; } if (!empty($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE)) { @@ -1462,12 +1462,12 @@ if ($source == 'membersubscription') { print '"."\n"; + print "\n"; } elseif ($action == dopayment) { print '"."\n"; + print "\n"; } } From 071b50debfbe263175a16c326243a24e04fc2bf6 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Fri, 9 Apr 2021 02:51:05 +0200 Subject: [PATCH 073/140] Copyright --- htdocs/adherents/admin/member.php | 3 ++- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/public/payment/newpayment.php | 1 + htdocs/public/payment/paymentok.php | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 98da5281088..29c0170982b 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -8,7 +8,8 @@ * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2012 J. Fernando Lagrange * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2020-2021 Frédéric France + * Copyright (C) 2020-2021 Frédéric France + * 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 diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 01b7d7db644..aff47d40dc3 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -13,7 +13,7 @@ * Copyright (C) 2018-2019 Thibault FOUCART * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Josep Lluís Amador - * Copyright (C) 2021 Waël Almoman + * 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 diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index b473fe4f38a..8931ce1ceed 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -4,6 +4,7 @@ * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2018-2019 Thibault FOUCART + * 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 diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 399d1c2575a..1942635001f 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2002 Rodolphe Quiedeville * 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 From 555a968f934bfafd73a43e5c99ff39c5231a5273 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Fri, 9 Apr 2021 02:54:11 +0200 Subject: [PATCH 074/140] Fix html style error --- htdocs/adherents/admin/member.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 29c0170982b..03f161e6926 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -228,7 +228,7 @@ print '< foreach ($adht->liste_array(1) as $typeid => $type) { print $type .' : '; print ''; - print '
'; + print '
'; } print "\n"; From 555580710452d175b08602f0e2759168200574ba Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 9 Apr 2021 08:51:09 +0200 Subject: [PATCH 075/140] fix: right definition id in modulebuilder --- .../template/core/modules/modMyModule.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 2f08786e503..18bdfa54158 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -264,17 +264,17 @@ class modMyModule extends DolibarrModules $r = 0; // Add here entries to declare new permissions /* BEGIN MODULEBUILDER PERMISSIONS */ - $this->rights[$r][0] = $this->numero + $r + 1; // Permission id (must not be already used) + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r); // Permission id (must not be already used) $this->rights[$r][1] = 'Read objects of MyModule'; // Permission label $this->rights[$r][4] = 'myobject'; $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->mymodule->myobject->read) $r++; - $this->rights[$r][0] = $this->numero + $r + 1; // Permission id (must not be already used) + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r); // Permission id (must not be already used) $this->rights[$r][1] = 'Create/Update objects of MyModule'; // Permission label $this->rights[$r][4] = 'myobject'; $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->mymodule->myobject->write) $r++; - $this->rights[$r][0] = $this->numero + $r + 1; // Permission id (must not be already used) + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r); // Permission id (must not be already used) $this->rights[$r][1] = 'Delete objects of MyModule'; // Permission label $this->rights[$r][4] = 'myobject'; $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->mymodule->myobject->delete) From 3153966b2438c1faddfcaf00e38150af2f1e24f5 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 9 Apr 2021 09:19:52 +0200 Subject: [PATCH 076/140] New edit object in module builder --- htdocs/modulebuilder/index.php | 204 ++++++++++++++++++++++----------- 1 file changed, 137 insertions(+), 67 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 682fa4bc330..8fa37b17588 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1212,6 +1212,10 @@ if ($dirins && ($action == 'droptable' || $action == 'droptableextrafields') && } } +if ($dirins && $action == 'saveeditproperty' && !empty($module) && !empty($tabobj) && empty($cancel)) { + print 'test'; +} + if ($dirins && $action == 'addproperty' && !empty($module) && !empty($tabobj)) { $error = 0; @@ -2694,75 +2698,141 @@ if ($module == 'initmodule') { print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } else { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + /*print '';*/ + print ''; + print ''; } - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - /*print '';*/ - print ''; - print ''; - print ''; } } else { From 056143450bba835e990aa66404e9ae0a4072d365 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 9 Apr 2021 10:58:33 +0200 Subject: [PATCH 077/140] NEW: add config type securekey module builder --- htdocs/admin/eventorganization.php | 37 +++++++++++++++---- htdocs/modulebuilder/template/admin/setup.php | 21 +++++++++++ 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index e142acedf8f..3bc58638455 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 ''; @@ -206,12 +207,12 @@ if ($action == 'edit') { print '
'; foreach ($arrayofparameters as $constname => $val) { - if ($val['enabled']==1) { - $setupnotempty++; - print ''; - print ''; } else { print ''; print ''; } From 17b446e8f73df9e2111740b9d3b8579593002b20 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Apr 2021 12:27:10 +0200 Subject: [PATCH 089/140] Update adherent.class.php --- htdocs/adherents/class/adherent.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index aff47d40dc3..0299b32663c 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1491,7 +1491,6 @@ class Adherent extends CommonObject * @param string $emetteur_banque Name of bank of cheque * @param int $datesubend Date end subscription * @param int $fk_type Member type id - * * @return int rowid of record added, <0 if KO */ public function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0, $fk_type = null) From 95d3dabdf693f406364f8b38b6d4a9eb1d72334b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Apr 2021 12:48:06 +0200 Subject: [PATCH 090/140] Update website2.lib.php --- 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 e922087d0a9..cb96ed9ca43 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 a50b0e744192e7624fd1fdb36a173b550b9a31fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Apr 2021 13:15:27 +0200 Subject: [PATCH 091/140] Debug inventory module --- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/expedition/card.php | 3 ++- htdocs/expedition/shipment.php | 12 +++--------- htdocs/langs/en_US/stocks.lang | 2 +- htdocs/product/inventory/inventory.php | 16 +++++++++------- 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3305bdc6e74..6a98976e261 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3511,7 +3511,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building', 'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'cron', 'cubes', 'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'edit', 'ellipsis-h', 'email', 'eraser', 'establishment', 'external-link-alt', 'external-link-square-alt', - 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group', + 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'autofill', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group', 'help', 'holiday', 'info', 'intervention', 'inventory', 'intracommreport', 'label', 'language', 'link', 'list', 'listlight', 'loan', 'lot', 'long-arrow-alt-right', @@ -3558,7 +3558,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } $arrayconvpictotofa = array( - 'account'=>'university', 'accountline'=>'receipt', 'accountancy'=>'search-dollar', 'action'=>'calendar-alt', 'add'=>'plus-circle', 'address'=> 'address-book', 'asset'=>'money-check-alt', + 'account'=>'university', 'accountline'=>'receipt', 'accountancy'=>'search-dollar', 'action'=>'calendar-alt', 'add'=>'plus-circle', 'address'=> 'address-book', 'asset'=>'money-check-alt', 'autofill'=>'fill', 'bank_account'=>'university', 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'billr'=>'file-invoice-dollar', 'supplier_invoicea'=>'file-excel', 'billd'=>'file-medical', 'supplier_invoiced'=>'file-medical', 'bom'=>'shapes', 'chart'=>'chart-line', 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'collab'=>'people-arrows', 'conversation'=>'comments', 'country'=>'globe-americas', 'cron'=>'business-time', diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c543ef40880..675372273f0 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -130,6 +130,7 @@ $date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_d if ($user->socid) { $socid = $user->socid; } + $result = restrictedArea($user, 'expedition', $object->id, ''); @@ -1035,7 +1036,7 @@ if ($action == 'create') { print ''; print ''; } - // Time spent by everybody - print '\n"; + if (!empty($arrayfields['timeconsumed']['checked'])) { + // Time spent by everybody + print '\n"; - // Time spent by user - 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 ''; } -/*print ''; - if ($usertoprocess->id == $user->id) print ''; - else print '';*/ -print ''; -print ''; - +if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; +} 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 ''; + 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 ''; + 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 ''; 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 114/140] 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 115/140] 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 '\n"; + if (!empty($arrayfields['timeconsumed']['checked'])) { + // Time spent by everybody + print '\n"; - // Time spent by user - 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 '\n"; + if (!empty($arrayfields['timeconsumed']['checked'])) { + // Time spent by everybody + print '\n"; - // Time spent by user - 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 ''; + print ''; } if (!empty($arrayfields['t.progress']['checked'])) { print ''; } -/*print ''; -if ($usertoprocess->id == $user->id) print ''; -else print '';*/ -print ''; -print ''; +if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; +} 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 ''; + if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; + } print ''; @@ -723,6 +724,10 @@ if (count($tasksarray) > 0) { print ''; + if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; + } print ''; print ''; + if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; + } 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 ''; + print ''; } if (!empty($arrayfields['t.progress']['checked'])) { print ''; } -/*print ''; - if ($usertoprocess->id == $user->id) print ''; - else print '';*/ -print ''; -print ''; - +if (!empty($arrayfields['timeconsumed']['checked'])) { + print ''; + print ''; +} 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 ''; + 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 ''; + 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 ''; 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 116/140] 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 117/140] 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 118/140] 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 '
\n"; } elseif ($action == dopayment) { print '
'; diff --git a/htdocs/includes/phpoffice/autoloader.php b/htdocs/includes/phpoffice/phpspreadsheet/src/autoloader.php similarity index 81% rename from htdocs/includes/phpoffice/autoloader.php rename to htdocs/includes/phpoffice/phpspreadsheet/src/autoloader.php index 71e94e9b738..809725dfb6f 100644 --- a/htdocs/includes/phpoffice/autoloader.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/autoloader.php @@ -5,6 +5,6 @@ spl_autoload_register(function ($class_name) { if (1 === $preg_match) { $class_name = preg_replace('/\\\/', '/', $class_name); $class_name = preg_replace('/^PhpOffice\\/PhpSpreadsheet\\//', '', $class_name); - require_once(__DIR__ . '/PhpSpreadsheet/' . $class_name . '.php'); + require_once __DIR__ . '/PhpSpreadsheet/' . $class_name . '.php'; } }); From 76c3229c97c3a25e39a353d20dbac414b3997011 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Apr 2021 18:32:02 +0200 Subject: [PATCH 061/140] Update to phpspreadsheet 1.8.2 --- COPYRIGHT | 2 +- composer.lock | 57 ++ .../Calculation/Calculation.php | 25 +- .../PhpSpreadsheet/Calculation/Logical.php | 54 ++ .../PhpSpreadsheet/Calculation/LookupRef.php | 34 +- .../PhpSpreadsheet/Calculation/MathTrig.php | 5 +- .../Calculation/functionlist.txt | 1 + .../Cell/AdvancedValueBinder.php | 2 + .../src/PhpSpreadsheet/Cell/Cell.php | 2 +- .../src/PhpSpreadsheet/Cell/Coordinate.php | 4 +- .../Cell/DefaultValueBinder.php | 2 + .../PhpSpreadsheet/Cell/StringValueBinder.php | 31 + .../src/PhpSpreadsheet/Chart/Axis.php | 4 +- .../src/PhpSpreadsheet/Chart/GridLines.php | 4 +- .../src/PhpSpreadsheet/Chart/Layout.php | 16 +- .../src/PhpSpreadsheet/Collection/Cells.php | 6 +- .../PhpSpreadsheet/Document/Properties.php | 2 +- .../src/PhpSpreadsheet/Reader/BaseReader.php | 91 +- .../src/PhpSpreadsheet/Reader/Csv.php | 26 +- .../src/PhpSpreadsheet/Reader/Gnumeric.php | 2 +- .../src/PhpSpreadsheet/Reader/Html.php | 330 ++++++- .../src/PhpSpreadsheet/Reader/IReader.php | 106 +++ .../src/PhpSpreadsheet/Reader/Ods.php | 116 +-- .../PhpSpreadsheet/Reader/Ods/Properties.php | 136 +++ .../Reader/Security/XmlScanner.php | 91 +- .../src/PhpSpreadsheet/Reader/Slk.php | 2 +- .../src/PhpSpreadsheet/Reader/Xls.php | 2 +- .../src/PhpSpreadsheet/Reader/Xlsx.php | 803 +++--------------- .../PhpSpreadsheet/Reader/Xlsx/AutoFilter.php | 144 ++++ .../Reader/Xlsx/BaseParserClass.php | 19 + .../Reader/Xlsx/ColumnAndRowAttributes.php | 204 +++++ .../Reader/Xlsx/ConditionalStyles.php | 92 ++ .../Reader/Xlsx/DataValidations.php | 50 ++ .../PhpSpreadsheet/Reader/Xlsx/Hyperlinks.php | 58 ++ .../PhpSpreadsheet/Reader/Xlsx/PageSetup.php | 150 ++++ .../PhpSpreadsheet/Reader/Xlsx/Properties.php | 91 ++ .../Reader/Xlsx/SheetViewOptions.php | 124 +++ .../PhpSpreadsheet/Reader/Xlsx/SheetViews.php | 127 +++ .../src/PhpSpreadsheet/Reader/Xlsx/Styles.php | 265 ++++++ .../src/PhpSpreadsheet/Reader/Xml.php | 2 +- .../src/PhpSpreadsheet/ReferenceHelper.php | 26 +- .../src/PhpSpreadsheet/Settings.php | 42 + .../src/PhpSpreadsheet/Shared/Date.php | 25 +- .../src/PhpSpreadsheet/Shared/OLE.php | 36 +- .../Shared/Trend/ExponentialBestFit.php | 4 +- .../Shared/Trend/LinearBestFit.php | 4 +- .../Shared/Trend/LogarithmicBestFit.php | 4 +- .../Shared/Trend/PolynomialBestFit.php | 4 +- .../Shared/Trend/PowerBestFit.php | 4 +- .../src/PhpSpreadsheet/Spreadsheet.php | 2 +- .../src/PhpSpreadsheet/Style/NumberFormat.php | 20 +- .../PhpSpreadsheet/Worksheet/Dimension.php | 4 +- .../Worksheet/RowCellIterator.php | 10 + .../PhpSpreadsheet/Worksheet/Worksheet.php | 4 +- .../src/PhpSpreadsheet/Writer/BaseWriter.php | 55 -- .../src/PhpSpreadsheet/Writer/IWriter.php | 69 ++ .../src/PhpSpreadsheet/Writer/Xls/Parser.php | 33 +- .../PhpSpreadsheet/Writer/Xls/Workbook.php | 10 +- .../src/PhpSpreadsheet/Writer/Xlsx.php | 15 +- .../PhpSpreadsheet/Writer/Xlsx/Workbook.php | 4 +- .../PhpSpreadsheet/Writer/Xlsx/Worksheet.php | 26 +- 61 files changed, 2557 insertions(+), 1126 deletions(-) create mode 100644 htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/StringValueBinder.php create mode 100644 htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/Properties.php create mode 100644 htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php create mode 100644 htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/BaseParserClass.php create mode 100644 htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ColumnAndRowAttributes.php create mode 100644 htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php create mode 100644 htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/DataValidations.php create mode 100644 htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Hyperlinks.php create mode 100644 htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/PageSetup.php create mode 100644 htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Properties.php create mode 100644 htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViewOptions.php create mode 100644 htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViews.php create mode 100644 htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php diff --git a/COPYRIGHT b/COPYRIGHT index 21e37f39f1d..b133b05b2cf 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -23,7 +23,7 @@ PEAR Mail_MIME 1.8.9 BSD Yes ParseDown 1.6 MIT License Yes Markdown parser PCLZip 2.8.4 LGPL-3+ Yes Library to zip/unzip files PHPDebugBar 1.15.1 MIT License Yes Used only by the module "debugbar" for developers -PHPSpreadSheet ? LGPL-2.1+ Yes Read/Write XLS files, read ODS files +PHPSpreadSheet 1.8.2 LGPL-2.1+ Yes Read/Write XLS files, read ODS files php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests diff --git a/composer.lock b/composer.lock index c588bc7783f..3e867f8f186 100644 --- a/composer.lock +++ b/composer.lock @@ -328,6 +328,63 @@ }, "time": "2020-03-23T09:12:05+00:00" }, + { + "name": "phpoffice/phpexcel", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/PHPOffice/PHPExcel.git", + "reference": "1441011fb7ecdd8cc689878f54f8b58a6805f870" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/1441011fb7ecdd8cc689878f54f8b58a6805f870", + "reference": "1441011fb7ecdd8cc689878f54f8b58a6805f870", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "php": "^5.2|^7.0" + }, + "require-dev": { + "squizlabs/php_codesniffer": "2.*" + }, + "type": "library", + "autoload": { + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1" + ], + "authors": [ + { + "name": "Maarten Balliauw", + "homepage": "http://blog.maartenballiauw.be" + }, + { + "name": "Erik Tilt" + }, + { + "name": "Franck Lefevre", + "homepage": "http://rootslabs.net" + }, + { + "name": "Mark Baker", + "homepage": "http://markbakeruk.net" + } + ], + "description": "PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", + "homepage": "https://github.com/PHPOffice/PHPExcel", + "keywords": [ + "OpenXML", + "excel", + "xlsx" + ], + "abandoned": "phpoffice/phpspreadsheet", + "time": "2018-11-22T23:07:24+00:00" + }, { "name": "restler/framework", "version": "3.0.0-RC6", diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php index 4f9ef639883..ae06d654dce 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php @@ -117,7 +117,7 @@ class Calculation /** * An array of the nested cell references accessed by the calculation engine, used for the debug log. * - * @var array of string + * @var CyclicReferenceStack */ private $cyclicReferenceStack; @@ -1945,6 +1945,11 @@ class Calculation 'functionCall' => [MathTrig::class, 'SUMXMY2'], 'argumentCount' => '2', ], + 'SWITCH' => [ + 'category' => Category::CATEGORY_LOGICAL, + 'functionCall' => [Logical::class, 'statementSwitch'], + 'argumentCount' => '3+', + ], 'SYD' => [ 'category' => Category::CATEGORY_FINANCIAL, 'functionCall' => [Financial::class, 'SYD'], @@ -2207,8 +2212,8 @@ class Calculation private static function loadLocales() { $localeFileDirectory = __DIR__ . '/locale/'; - foreach (glob($localeFileDirectory . '/*', GLOB_ONLYDIR) as $filename) { - $filename = substr($filename, strlen($localeFileDirectory) + 1); + foreach (glob($localeFileDirectory . '*', GLOB_ONLYDIR) as $filename) { + $filename = substr($filename, strlen($localeFileDirectory)); if ($filename != 'en') { self::$validLocaleLanguages[] = $filename; } @@ -2413,7 +2418,6 @@ class Calculation if (strpos($locale, '_') !== false) { list($language) = explode('_', $locale); } - if (count(self::$validLocaleLanguages) == 1) { self::loadLocales(); } @@ -2704,7 +2708,7 @@ class Calculation * @param Cell $pCell Cell to calculate * @param bool $resetLog Flag indicating whether the debug log should be reset or not * - * @throws Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * * @return mixed */ @@ -2808,7 +2812,7 @@ class Calculation * @param string $cellID Address of the cell to calculate * @param Cell $pCell Cell to calculate * - * @throws Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * * @return mixed */ @@ -2892,6 +2896,15 @@ class Calculation { $cellValue = null; + // Quote-Prefixed cell values cannot be formulae, but are treated as strings + if ($pCell !== null && $pCell->getStyle()->getQuotePrefix() === true) { + return self::wrapResult((string) $formula); + } + + if (preg_match('/^=\s*cmd\s*\|/miu', $formula) !== 0) { + return self::wrapResult($formula); + } + // Basic validation that this is indeed a formula // We simply return the cell value if not $formula = trim($formula); diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php index c36e3fca74f..3e6c5e74177 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php @@ -273,6 +273,60 @@ class Logical return ($condition) ? $returnIfTrue : $returnIfFalse; } + /** + * STATEMENT_SWITCH. + * + * Returns corresponding with first match (any data type such as a string, numeric, date, etc). + * + * Excel Function: + * =SWITCH (expression, value1, result1, value2, result2, ... value_n, result_n [, default]) + * + * Expression + * The expression to compare to a list of values. + * value1, value2, ... value_n + * A list of values that are compared to expression. The SWITCH function is looking for the first value that matches the expression. + * result1, result2, ... result_n + * A list of results. The SWITCH function returns the corresponding result when a value matches expression. + * default + * Optional. It is the default to return if expression does not match any of the values (value1, value2, ... value_n). + * + * @category Logical Functions + * + * @param mixed $arguments Statement arguments + * + * @return mixed The value of matched expression + */ + public static function statementSwitch(...$arguments) + { + $result = Functions::VALUE(); + + if (count($arguments) > 0) { + $targetValue = Functions::flattenSingleValue($arguments[0]); + $argc = count($arguments) - 1; + $switchCount = floor($argc / 2); + $switchSatisfied = false; + $hasDefaultClause = $argc % 2 !== 0; + $defaultClause = $argc % 2 === 0 ? null : $arguments[count($arguments) - 1]; + + if ($switchCount) { + for ($index = 0; $index < $switchCount; ++$index) { + if ($targetValue == $arguments[$index * 2 + 1]) { + $result = $arguments[$index * 2 + 2]; + $switchSatisfied = true; + + break; + } + } + } + + if (!$switchSatisfied) { + $result = $hasDefaultClause ? $defaultClause : Functions::NA(); + } + } + + return $result; + } + /** * IFERROR. * diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php index 2a3c5582108..e6b0f3203f8 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php @@ -4,6 +4,7 @@ namespace PhpOffice\PhpSpreadsheet\Calculation; use PhpOffice\PhpSpreadsheet\Cell\Cell; use PhpOffice\PhpSpreadsheet\Cell\Coordinate; +use PhpOffice\PhpSpreadsheet\Shared\StringHelper; use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; class LookupRef @@ -473,8 +474,9 @@ class LookupRef $lookupValue = Functions::flattenSingleValue($lookupValue); $matchType = ($matchType === null) ? 1 : (int) Functions::flattenSingleValue($matchType); + $initialLookupValue = $lookupValue; // MATCH is not case sensitive - $lookupValue = strtolower($lookupValue); + $lookupValue = StringHelper::strToLower($lookupValue); // Lookup_value type has to be number, text, or logical values if ((!is_numeric($lookupValue)) && (!is_string($lookupValue)) && (!is_bool($lookupValue))) { @@ -502,7 +504,7 @@ class LookupRef } // Convert strings to lowercase for case-insensitive testing if (is_string($lookupArrayValue)) { - $lookupArray[$i] = strtolower($lookupArrayValue); + $lookupArray[$i] = StringHelper::strToLower($lookupArrayValue); } if (($lookupArrayValue === null) && (($matchType == 1) || ($matchType == -1))) { $lookupArray = array_slice($lookupArray, 0, $i - 1); @@ -522,9 +524,13 @@ class LookupRef if ($matchType == 0 || $matchType == 1) { foreach ($lookupArray as $i => $lookupArrayValue) { - if (($matchType == 0) && ($lookupArrayValue == $lookupValue)) { + $onlyNumeric = is_numeric($lookupArrayValue) && is_numeric($lookupValue); + $onlyNumericExactMatch = $onlyNumeric && $lookupArrayValue == $lookupValue; + $nonOnlyNumericExactMatch = !$onlyNumeric && $lookupArrayValue === $lookupValue; + $exactMatch = $onlyNumericExactMatch || $nonOnlyNumericExactMatch; + if (($matchType == 0) && $exactMatch) { // exact match - return ++$i; + return $i + 1; } elseif (($matchType == 1) && ($lookupArrayValue <= $lookupValue)) { $i = array_search($i, $keySet); @@ -661,7 +667,9 @@ class LookupRef { reset($a); $firstColumn = key($a); - if (($aLower = strtolower($a[$firstColumn])) == ($bLower = strtolower($b[$firstColumn]))) { + $aLower = StringHelper::strToLower($a[$firstColumn]); + $bLower = StringHelper::strToLower($b[$firstColumn]); + if ($aLower == $bLower) { return 0; } @@ -707,11 +715,14 @@ class LookupRef uasort($lookup_array, ['self', 'vlookupSort']); } + $lookupLower = StringHelper::strToLower($lookup_value); $rowNumber = $rowValue = false; foreach ($lookup_array as $rowKey => $rowData) { + $firstLower = StringHelper::strToLower($rowData[$firstColumn]); + // break if we have passed possible keys if ((is_numeric($lookup_value) && is_numeric($rowData[$firstColumn]) && ($rowData[$firstColumn] > $lookup_value)) || - (!is_numeric($lookup_value) && !is_numeric($rowData[$firstColumn]) && (strtolower($rowData[$firstColumn]) > strtolower($lookup_value)))) { + (!is_numeric($lookup_value) && !is_numeric($rowData[$firstColumn]) && ($firstLower > $lookupLower))) { break; } // remember the last key, but only if datatypes match @@ -719,17 +730,15 @@ class LookupRef (!is_numeric($lookup_value) && !is_numeric($rowData[$firstColumn]))) { if ($not_exact_match) { $rowNumber = $rowKey; - $rowValue = $rowData[$firstColumn]; continue; - } elseif ((strtolower($rowData[$firstColumn]) == strtolower($lookup_value)) + } elseif (($firstLower == $lookupLower) // Spreadsheets software returns first exact match, // we have sorted and we might have broken key orders // we want the first one (by its initial index) && (($rowNumber == false) || ($rowKey < $rowNumber)) ) { $rowNumber = $rowKey; - $rowValue = $rowData[$firstColumn]; } } } @@ -782,8 +791,11 @@ class LookupRef // break if we have passed possible keys $bothNumeric = is_numeric($lookup_value) && is_numeric($rowData); $bothNotNumeric = !is_numeric($lookup_value) && !is_numeric($rowData); + $lookupLower = StringHelper::strToLower($lookup_value); + $rowDataLower = StringHelper::strToLower($rowData); + if (($bothNumeric && $rowData > $lookup_value) || - ($bothNotNumeric && strtolower($rowData) > strtolower($lookup_value))) { + ($bothNotNumeric && $rowDataLower > $lookupLower)) { break; } @@ -793,7 +805,7 @@ class LookupRef $rowNumber = $rowKey; continue; - } elseif (strtolower($rowData) === strtolower($lookup_value) + } elseif ($rowDataLower === $lookupLower && ($rowNumber === null || $rowKey < $rowNumber) ) { $rowNumber = $rowKey; diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php index 9170196bae5..a06f3a384c9 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php @@ -1224,11 +1224,12 @@ class MathTrig } $testCondition = '=' . $arg . $condition; + $sumValue = array_key_exists($key, $sumArgs) ? $sumArgs[$key] : 0; - if (is_numeric($sumArgs[$key]) && + if (is_numeric($sumValue) && Calculation::getInstance()->_calculateFormulaValue($testCondition)) { // Is it a value within our criteria and only numeric can be added to the result - $returnValue += $sumArgs[$key]; + $returnValue += $sumValue; } } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/functionlist.txt b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/functionlist.txt index ee87c17f63c..4a5cd265ba8 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/functionlist.txt +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/functionlist.txt @@ -337,6 +337,7 @@ SUMSQ SUMX2MY2 SUMX2PY2 SUMXMY2 +SWITCH SYD T TAN diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php index efb8e5ef368..4052c23cb97 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php @@ -16,6 +16,8 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder * @param Cell $cell Cell to bind value to * @param mixed $value Value to bind in cell * + * @throws \PhpOffice\PhpSpreadsheet\Exception + * * @return bool */ public function bindValue(Cell $cell, $value = null) diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php index 416b4a9909b..813eee4a091 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php @@ -523,7 +523,7 @@ class Cell /** * If this cell is in a merge range, then return the range. * - * @return string + * @return false|string */ public function getMergeRange() { diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php index 12e3b689727..5e20ec6d9dc 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php @@ -157,14 +157,12 @@ abstract class Coordinate } // Build range - $imploded = []; $counter = count($pRange); for ($i = 0; $i < $counter; ++$i) { $pRange[$i] = implode(':', $pRange[$i]); } - $imploded = implode(',', $pRange); - return $imploded; + return implode(',', $pRange); } /** diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php index 7cbb6cca27f..0e6433a4ec8 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php @@ -14,6 +14,8 @@ class DefaultValueBinder implements IValueBinder * @param Cell $cell Cell to bind value to * @param mixed $value Value to bind in cell * + * @throws \PhpOffice\PhpSpreadsheet\Exception + * * @return bool */ public function bindValue(Cell $cell, $value) diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/StringValueBinder.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/StringValueBinder.php new file mode 100644 index 00000000000..0552677f295 --- /dev/null +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/StringValueBinder.php @@ -0,0 +1,31 @@ +setValueExplicit((string) $value, DataType::TYPE_STRING); + + // Done! + return true; + } +} diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php index 52f70431453..3d1dd22262d 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php @@ -365,10 +365,10 @@ class Axis extends Properties } /** - * Set Shadow Properties from Maped Values. + * Set Shadow Properties from Mapped Values. * * @param array $properties_map - * @param * $reference + * @param mixed &$reference * * @return Axis */ diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/GridLines.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/GridLines.php index 6e9e39dcf50..8cc83e5540c 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/GridLines.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/GridLines.php @@ -319,7 +319,7 @@ class GridLines extends Properties * Set Shadow Properties Values. * * @param array $properties_map - * @param * $reference + * @param mixed &$reference * * @return GridLines */ @@ -439,7 +439,7 @@ class GridLines extends Properties { if ($size !== null) { $this->activateObject(); - $softEdges['size'] = (string) $this->getExcelPointsWidth($size); + $this->softEdges['size'] = (string) $this->getExcelPointsWidth($size); } } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Layout.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Layout.php index fb5a53a063e..a8a96d2f1cb 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Layout.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Layout.php @@ -175,13 +175,13 @@ class Layout /** * Set X-Mode. * - * @param X-Mode $value + * @param string $value * * @return Layout */ public function setXMode($value) { - $this->xMode = $value; + $this->xMode = (string) $value; return $this; } @@ -199,13 +199,13 @@ class Layout /** * Set Y-Mode. * - * @param Y-Mode $value + * @param string $value * * @return Layout */ public function setYMode($value) { - $this->yMode = $value; + $this->yMode = (string) $value; return $this; } @@ -223,13 +223,13 @@ class Layout /** * Set X-Position. * - * @param X-Position $value + * @param float $value * * @return Layout */ public function setXPosition($value) { - $this->xPos = $value; + $this->xPos = (float) $value; return $this; } @@ -247,13 +247,13 @@ class Layout /** * Set Y-Position. * - * @param Y-Position $value + * @param float $value * * @return Layout */ public function setYPosition($value) { - $this->yPos = $value; + $this->yPos = (float) $value; return $this; } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Cells.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Cells.php index 80a43220988..84c3d3009ca 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Cells.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Cells.php @@ -241,7 +241,7 @@ class Cells */ public function getHighestColumn($row = null) { - if ($row == null) { + if ($row === null) { $colRow = $this->getHighestRowAndColumn(); return $colRow['column']; @@ -259,7 +259,7 @@ class Cells $columnList[] = Coordinate::columnIndexFromString($c); } - return Coordinate::stringFromColumnIndex(max($columnList) + 1); + return Coordinate::stringFromColumnIndex(max($columnList)); } /** @@ -272,7 +272,7 @@ class Cells */ public function getHighestRow($column = null) { - if ($column == null) { + if ($column === null) { $colRow = $this->getHighestRowAndColumn(); return $colRow['row']; diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Properties.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Properties.php index bbac96d92a8..1a432db0497 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Properties.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Properties.php @@ -418,7 +418,7 @@ class Properties * * @param string $propertyName * - * @return string + * @return mixed */ public function getCustomPropertyValue($propertyName) { diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php index c191c3f8d8e..f7af1557fff 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php @@ -55,27 +55,16 @@ abstract class BaseReader implements IReader */ protected $securityScanner; - /** - * Read data only? - * If this is true, then the Reader will only read data values for cells, it will not read any formatting information. - * If false (the default) it will read data and formatting. - * - * @return bool - */ + public function __construct() + { + $this->readFilter = new DefaultReadFilter(); + } + public function getReadDataOnly() { return $this->readDataOnly; } - /** - * Set read data only - * Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information. - * Set to false (the default) to advise the Reader to read both data and formatting for cells. - * - * @param bool $pValue - * - * @return IReader - */ public function setReadDataOnly($pValue) { $this->readDataOnly = (bool) $pValue; @@ -83,27 +72,11 @@ abstract class BaseReader implements IReader return $this; } - /** - * Read empty cells? - * If this is true (the default), then the Reader will read data values for all cells, irrespective of value. - * If false it will not read data for cells containing a null value or an empty string. - * - * @return bool - */ public function getReadEmptyCells() { return $this->readEmptyCells; } - /** - * Set read empty cells - * Set to true (the default) to advise the Reader read data values for all cells, irrespective of value. - * Set to false to advise the Reader to ignore cells containing a null value or an empty string. - * - * @param bool $pValue - * - * @return IReader - */ public function setReadEmptyCells($pValue) { $this->readEmptyCells = (bool) $pValue; @@ -111,29 +84,11 @@ abstract class BaseReader implements IReader return $this; } - /** - * Read charts in workbook? - * If this is true, then the Reader will include any charts that exist in the workbook. - * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. - * If false (the default) it will ignore any charts defined in the workbook file. - * - * @return bool - */ public function getIncludeCharts() { return $this->includeCharts; } - /** - * Set read charts in workbook - * Set to true, to advise the Reader to include any charts that exist in the workbook. - * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. - * Set to false (the default) to discard charts. - * - * @param bool $pValue - * - * @return IReader - */ public function setIncludeCharts($pValue) { $this->includeCharts = (bool) $pValue; @@ -141,27 +96,11 @@ abstract class BaseReader implements IReader return $this; } - /** - * Get which sheets to load - * Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null - * indicating that all worksheets in the workbook should be loaded. - * - * @return mixed - */ public function getLoadSheetsOnly() { return $this->loadSheetsOnly; } - /** - * Set which sheets to load. - * - * @param mixed $value - * This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name. - * If NULL, then it tells the Reader to read all worksheets in the workbook - * - * @return IReader - */ public function setLoadSheetsOnly($value) { if ($value === null) { @@ -173,12 +112,6 @@ abstract class BaseReader implements IReader return $this; } - /** - * Set all sheets to load - * Tells the Reader to load all worksheets from the workbook. - * - * @return IReader - */ public function setLoadAllSheets() { $this->loadSheetsOnly = null; @@ -186,23 +119,11 @@ abstract class BaseReader implements IReader return $this; } - /** - * Read filter. - * - * @return IReadFilter - */ public function getReadFilter() { return $this->readFilter; } - /** - * Set read filter. - * - * @param IReadFilter $pValue - * - * @return IReader - */ public function setReadFilter(IReadFilter $pValue) { $this->readFilter = $pValue; @@ -210,7 +131,7 @@ abstract class BaseReader implements IReader return $this; } - public function getSecuritySCanner() + public function getSecurityScanner() { if (property_exists($this, 'securityScanner')) { return $this->securityScanner; diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php index 25f244c1181..81ca1a8cf3e 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php @@ -62,7 +62,7 @@ class Csv extends BaseReader */ public function __construct() { - $this->readFilter = new DefaultReadFilter(); + parent::__construct(); } /** @@ -143,7 +143,7 @@ class Csv extends BaseReader return; } - return $this->skipBOM(); + $this->skipBOM(); } /** @@ -155,7 +155,7 @@ class Csv extends BaseReader return; } - $potentialDelimiters = [',', ';', "\t", '|', ':', ' ']; + $potentialDelimiters = [',', ';', "\t", '|', ':', ' ', '~']; $counts = []; foreach ($potentialDelimiters as $delimiter) { $counts[$delimiter] = []; @@ -184,8 +184,9 @@ class Csv extends BaseReader // If number of lines is 0, nothing to infer : fall back to the default if ($numberLines === 0) { $this->delimiter = reset($potentialDelimiters); + $this->skipBOM(); - return $this->skipBOM(); + return; } // Calculate the mean square deviations for each delimiter (ignoring delimiters that haven't been found consistently) @@ -230,7 +231,7 @@ class Csv extends BaseReader $this->delimiter = reset($potentialDelimiters); } - return $this->skipBOM(); + $this->skipBOM(); } /** @@ -254,15 +255,13 @@ class Csv extends BaseReader $line = $line . $newLine; // Drop everything that is enclosed to avoid counting false positives in enclosures - $enclosure = preg_quote($this->enclosure, '/'); - $line = preg_replace('/(' . $enclosure . '.*' . $enclosure . ')/U', '', $line); + $enclosure = '(?escapeCharacter, '/') . ')' + . preg_quote($this->enclosure, '/'); + $line = preg_replace('/(' . $enclosure . '.*' . $enclosure . ')/Us', '', $line); // See if we have any enclosures left in the line - $matches = []; - preg_match('/(' . $enclosure . ')/', $line, $matches); - - // if we still have an enclosure then we need to read the next line aswell - if (count($matches) > 0) { + // if we still have an enclosure then we need to read the next line as well + if (preg_match('/(' . $enclosure . ')/', $line) > 0) { $line = $this->getNextLine($line); } @@ -547,7 +546,8 @@ class Csv extends BaseReader fclose($this->fileHandle); // Trust file extension if any - if (strtolower(pathinfo($pFilename, PATHINFO_EXTENSION)) === 'csv') { + $extension = strtolower(pathinfo($pFilename, PATHINFO_EXTENSION)); + if (in_array($extension, ['csv', 'tsv'])) { return true; } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php index 16f1925a738..7445ef1bf25 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php @@ -36,7 +36,7 @@ class Gnumeric extends BaseReader */ public function __construct() { - $this->readFilter = new DefaultReadFilter(); + parent::__construct(); $this->referenceHelper = ReferenceHelper::getInstance(); $this->securityScanner = XmlScanner::getInstance($this); } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php index d9f25a3166d..2e823f03bb5 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php @@ -12,6 +12,9 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Style\Border; use PhpOffice\PhpSpreadsheet\Style\Color; use PhpOffice\PhpSpreadsheet\Style\Fill; +use PhpOffice\PhpSpreadsheet\Style\Font; +use PhpOffice\PhpSpreadsheet\Style\Style; +use PhpOffice\PhpSpreadsheet\Worksheet\Drawing; use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; /** PhpSpreadsheet root directory */ @@ -96,6 +99,26 @@ class Html extends BaseReader ], ], ], // Bottom border + 'strong' => [ + 'font' => [ + 'bold' => true, + ], + ], // Bold + 'b' => [ + 'font' => [ + 'bold' => true, + ], + ], // Bold + 'i' => [ + 'font' => [ + 'italic' => true, + ], + ], // Italic + 'em' => [ + 'font' => [ + 'italic' => true, + ], + ], // Italic ]; protected $rowspan = []; @@ -105,7 +128,7 @@ class Html extends BaseReader */ public function __construct() { - $this->readFilter = new DefaultReadFilter(); + parent::__construct(); $this->securityScanner = XmlScanner::getInstance($this); } @@ -295,11 +318,9 @@ class Html extends BaseReader switch ($child->nodeName) { case 'meta': foreach ($attributeArray as $attributeName => $attributeValue) { - switch ($attributeName) { - case 'content': - // TODO - // Extract character set, so we can convert to UTF-8 if required - break; + // Extract character set, so we can convert to UTF-8 if required + if ($attributeName === 'charset') { + $this->setInputEncoding($attributeValue); } } $this->processDomElement($child, $sheet, $row, $column, $cellContent); @@ -334,6 +355,10 @@ class Html extends BaseReader $cellContent .= ' '; } + if (isset($this->formats[$child->nodeName])) { + $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]); + } + break; case 'hr': $this->flushCell($sheet, $column, $row, $cellContent); @@ -423,6 +448,10 @@ class Html extends BaseReader $column = 'A'; } + break; + case 'img': + $this->insertImage($sheet, $column, $row, $attributeArray); + break; case 'table': $this->flushCell($sheet, $column, $row, $cellContent); @@ -448,6 +477,11 @@ class Html extends BaseReader $column = $this->getTableStartColumn(); $cellContent = ''; $this->processDomElement($child, $sheet, $row, $column, $cellContent); + + if (isset($attributeArray['height'])) { + $sheet->getRowDimension($row)->setRowHeight($attributeArray['height']); + } + ++$row; break; @@ -501,6 +535,27 @@ class Html extends BaseReader ] ); } + + if (isset($attributeArray['width'])) { + $sheet->getColumnDimension($column)->setWidth($attributeArray['width']); + } + + if (isset($attributeArray['height'])) { + $sheet->getRowDimension($row)->setRowHeight($attributeArray['height']); + } + + if (isset($attributeArray['align'])) { + $sheet->getStyle($column . $row)->getAlignment()->setHorizontal($attributeArray['align']); + } + + if (isset($attributeArray['valign'])) { + $sheet->getStyle($column . $row)->getAlignment()->setVertical($attributeArray['valign']); + } + + if (isset($attributeArray['data-format'])) { + $sheet->getStyle($column . $row)->getNumberFormat()->setFormatCode($attributeArray['data-format']); + } + ++$column; break; @@ -608,36 +663,271 @@ class Html extends BaseReader return; } - $supported_styles = ['background-color', 'color']; + $cellStyle = $sheet->getStyle($column . $row); // add color styles (background & text) from dom element,currently support : td & th, using ONLY inline css style with RGB color $styles = explode(';', $attributeArray['style']); foreach ($styles as $st) { $value = explode(':', $st); + $styleName = isset($value[0]) ? trim($value[0]) : null; + $styleValue = isset($value[1]) ? trim($value[1]) : null; - if (empty(trim($value[0])) || !in_array(trim($value[0]), $supported_styles)) { + if (!$styleName) { continue; } - //check if has #, so we can get clean hex - if (substr(trim($value[1]), 0, 1) == '#') { - $style_color = substr(trim($value[1]), 1); - } - - if (empty($style_color)) { - continue; - } - - switch (trim($value[0])) { + switch ($styleName) { + case 'background': case 'background-color': - $sheet->getStyle($column . $row)->applyFromArray(['fill' => ['fillType' => Fill::FILL_SOLID, 'color' => ['rgb' => "{$style_color}"]]]); + $styleColor = $this->getStyleColor($styleValue); + + if (!$styleColor) { + continue 2; + } + + $cellStyle->applyFromArray(['fill' => ['fillType' => Fill::FILL_SOLID, 'color' => ['rgb' => $styleColor]]]); break; case 'color': - $sheet->getStyle($column . $row)->applyFromArray(['font' => ['color' => ['rgb' => "{$style_color}"]]]); + $styleColor = $this->getStyleColor($styleValue); + + if (!$styleColor) { + continue 2; + } + + $cellStyle->applyFromArray(['font' => ['color' => ['rgb' => $styleColor]]]); + + break; + + case 'border': + $this->setBorderStyle($cellStyle, $styleValue, 'allBorders'); + + break; + + case 'border-top': + $this->setBorderStyle($cellStyle, $styleValue, 'top'); + + break; + + case 'border-bottom': + $this->setBorderStyle($cellStyle, $styleValue, 'bottom'); + + break; + + case 'border-left': + $this->setBorderStyle($cellStyle, $styleValue, 'left'); + + break; + + case 'border-right': + $this->setBorderStyle($cellStyle, $styleValue, 'right'); + + break; + + case 'font-size': + $cellStyle->getFont()->setSize( + (float) $styleValue + ); + + break; + + case 'font-weight': + if ($styleValue === 'bold' || $styleValue >= 500) { + $cellStyle->getFont()->setBold(true); + } + + break; + + case 'font-style': + if ($styleValue === 'italic') { + $cellStyle->getFont()->setItalic(true); + } + + break; + + case 'font-family': + $cellStyle->getFont()->setName(str_replace('\'', '', $styleValue)); + + break; + + case 'text-decoration': + switch ($styleValue) { + case 'underline': + $cellStyle->getFont()->setUnderline(Font::UNDERLINE_SINGLE); + + break; + case 'line-through': + $cellStyle->getFont()->setStrikethrough(true); + + break; + } + + break; + + case 'text-align': + $cellStyle->getAlignment()->setHorizontal($styleValue); + + break; + + case 'vertical-align': + $cellStyle->getAlignment()->setVertical($styleValue); + + break; + + case 'width': + $sheet->getColumnDimension($column)->setWidth( + str_replace('px', '', $styleValue) + ); + + break; + + case 'height': + $sheet->getRowDimension($row)->setRowHeight( + str_replace('px', '', $styleValue) + ); + + break; + + case 'word-wrap': + $cellStyle->getAlignment()->setWrapText( + $styleValue === 'break-word' + ); + + break; + + case 'text-indent': + $cellStyle->getAlignment()->setIndent( + (int) str_replace(['px'], '', $styleValue) + ); break; } } } + + /** + * Check if has #, so we can get clean hex. + * + * @param $value + * + * @return null|string + */ + public function getStyleColor($value) + { + if (strpos($value, '#') === 0) { + return substr($value, 1); + } + + return null; + } + + /** + * @param Worksheet $sheet + * @param string $column + * @param int $row + * @param array $attributes + * + * @throws \PhpOffice\PhpSpreadsheet\Exception + */ + private function insertImage(Worksheet $sheet, $column, $row, array $attributes) + { + if (!isset($attributes['src'])) { + return; + } + + $src = urldecode($attributes['src']); + $width = isset($attributes['width']) ? (float) $attributes['width'] : null; + $height = isset($attributes['height']) ? (float) $attributes['height'] : null; + $name = isset($attributes['alt']) ? (float) $attributes['alt'] : null; + + $drawing = new Drawing(); + $drawing->setPath($src); + $drawing->setWorksheet($sheet); + $drawing->setCoordinates($column . $row); + $drawing->setOffsetX(0); + $drawing->setOffsetY(10); + $drawing->setResizeProportional(true); + + if ($name) { + $drawing->setName($name); + } + + if ($width) { + $drawing->setWidth((int) $width); + } + + if ($height) { + $drawing->setHeight((int) $height); + } + + $sheet->getColumnDimension($column)->setWidth( + $drawing->getWidth() / 6 + ); + + $sheet->getRowDimension($row)->setRowHeight( + $drawing->getHeight() * 0.9 + ); + } + + /** + * Map html border style to PhpSpreadsheet border style. + * + * @param string $style + * + * @return null|string + */ + public function getBorderStyle($style) + { + switch ($style) { + case 'solid': + return Border::BORDER_THIN; + case 'dashed': + return Border::BORDER_DASHED; + case 'dotted': + return Border::BORDER_DOTTED; + case 'medium': + return Border::BORDER_MEDIUM; + case 'thick': + return Border::BORDER_THICK; + case 'none': + return Border::BORDER_NONE; + case 'dash-dot': + return Border::BORDER_DASHDOT; + case 'dash-dot-dot': + return Border::BORDER_DASHDOTDOT; + case 'double': + return Border::BORDER_DOUBLE; + case 'hair': + return Border::BORDER_HAIR; + case 'medium-dash-dot': + return Border::BORDER_MEDIUMDASHDOT; + case 'medium-dash-dot-dot': + return Border::BORDER_MEDIUMDASHDOTDOT; + case 'medium-dashed': + return Border::BORDER_MEDIUMDASHED; + case 'slant-dash-dot': + return Border::BORDER_SLANTDASHDOT; + } + + return null; + } + + /** + * @param Style $cellStyle + * @param string $styleValue + * @param string $type + */ + private function setBorderStyle(Style $cellStyle, $styleValue, $type) + { + list(, $borderStyle, $color) = explode(' ', $styleValue); + + $cellStyle->applyFromArray([ + 'borders' => [ + $type => [ + 'borderStyle' => $this->getBorderStyle($borderStyle), + 'color' => ['rgb' => $this->getStyleColor($color)], + ], + ], + ]); + } } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReader.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReader.php index e35c4ee6255..70a7a200d78 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReader.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReader.php @@ -18,6 +18,112 @@ interface IReader */ public function canRead($pFilename); + /** + * Read data only? + * If this is true, then the Reader will only read data values for cells, it will not read any formatting information. + * If false (the default) it will read data and formatting. + * + * @return bool + */ + public function getReadDataOnly(); + + /** + * Set read data only + * Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information. + * Set to false (the default) to advise the Reader to read both data and formatting for cells. + * + * @param bool $pValue + * + * @return IReader + */ + public function setReadDataOnly($pValue); + + /** + * Read empty cells? + * If this is true (the default), then the Reader will read data values for all cells, irrespective of value. + * If false it will not read data for cells containing a null value or an empty string. + * + * @return bool + */ + public function getReadEmptyCells(); + + /** + * Set read empty cells + * Set to true (the default) to advise the Reader read data values for all cells, irrespective of value. + * Set to false to advise the Reader to ignore cells containing a null value or an empty string. + * + * @param bool $pValue + * + * @return IReader + */ + public function setReadEmptyCells($pValue); + + /** + * Read charts in workbook? + * If this is true, then the Reader will include any charts that exist in the workbook. + * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. + * If false (the default) it will ignore any charts defined in the workbook file. + * + * @return bool + */ + public function getIncludeCharts(); + + /** + * Set read charts in workbook + * Set to true, to advise the Reader to include any charts that exist in the workbook. + * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. + * Set to false (the default) to discard charts. + * + * @param bool $pValue + * + * @return IReader + */ + public function setIncludeCharts($pValue); + + /** + * Get which sheets to load + * Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null + * indicating that all worksheets in the workbook should be loaded. + * + * @return mixed + */ + public function getLoadSheetsOnly(); + + /** + * Set which sheets to load. + * + * @param mixed $value + * This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name. + * If NULL, then it tells the Reader to read all worksheets in the workbook + * + * @return IReader + */ + public function setLoadSheetsOnly($value); + + /** + * Set all sheets to load + * Tells the Reader to load all worksheets from the workbook. + * + * @return IReader + */ + public function setLoadAllSheets(); + + /** + * Read filter. + * + * @return IReadFilter + */ + public function getReadFilter(); + + /** + * Set read filter. + * + * @param IReadFilter $pValue + * + * @return IReader + */ + public function setReadFilter(IReadFilter $pValue); + /** * Loads PhpSpreadsheet from file. * diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php index 0941f035dff..51462c2003e 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php @@ -7,7 +7,7 @@ use DateTimeZone; use PhpOffice\PhpSpreadsheet\Calculation\Calculation; use PhpOffice\PhpSpreadsheet\Cell\Coordinate; use PhpOffice\PhpSpreadsheet\Cell\DataType; -use PhpOffice\PhpSpreadsheet\Document\Properties; +use PhpOffice\PhpSpreadsheet\Reader\Ods\Properties as DocumentProperties; use PhpOffice\PhpSpreadsheet\Reader\Security\XmlScanner; use PhpOffice\PhpSpreadsheet\RichText\RichText; use PhpOffice\PhpSpreadsheet\Settings; @@ -25,7 +25,7 @@ class Ods extends BaseReader */ public function __construct() { - $this->readFilter = new DefaultReadFilter(); + parent::__construct(); $this->securityScanner = XmlScanner::getInstance($this); } @@ -52,7 +52,7 @@ class Ods extends BaseReader $stat = $zip->statName('mimetype'); if ($stat && ($stat['size'] <= 255)) { $mimeType = $zip->getFromName($stat['name']); - } elseif ($stat = $zip->statName('META-INF/manifest.xml')) { + } elseif ($zip->statName('META-INF/manifest.xml')) { $xml = simplexml_load_string( $this->securityScanner->scan($zip->getFromName('META-INF/manifest.xml')), 'SimpleXMLElement', @@ -265,7 +265,7 @@ class Ods extends BaseReader $zip = new ZipArchive(); if (!$zip->open($pFilename)) { - throw new Exception('Could not open ' . $pFilename . ' for reading! Error opening file.'); + throw new Exception("Could not open {$pFilename} for reading! Error opening file."); } // Meta @@ -275,97 +275,13 @@ class Ods extends BaseReader 'SimpleXMLElement', Settings::getLibXmlLoaderOptions() ); + if ($xml === false) { + throw new Exception('Unable to read data from {$pFilename}'); + } + $namespacesMeta = $xml->getNamespaces(true); - $docProps = $spreadsheet->getProperties(); - $officeProperty = $xml->children($namespacesMeta['office']); - foreach ($officeProperty as $officePropertyData) { - $officePropertyDC = []; - if (isset($namespacesMeta['dc'])) { - $officePropertyDC = $officePropertyData->children($namespacesMeta['dc']); - } - foreach ($officePropertyDC as $propertyName => $propertyValue) { - $propertyValue = (string) $propertyValue; - switch ($propertyName) { - case 'title': - $docProps->setTitle($propertyValue); - - break; - case 'subject': - $docProps->setSubject($propertyValue); - - break; - case 'creator': - $docProps->setCreator($propertyValue); - $docProps->setLastModifiedBy($propertyValue); - - break; - case 'date': - $creationDate = strtotime($propertyValue); - $docProps->setCreated($creationDate); - $docProps->setModified($creationDate); - - break; - case 'description': - $docProps->setDescription($propertyValue); - - break; - } - } - $officePropertyMeta = []; - if (isset($namespacesMeta['dc'])) { - $officePropertyMeta = $officePropertyData->children($namespacesMeta['meta']); - } - foreach ($officePropertyMeta as $propertyName => $propertyValue) { - $propertyValueAttributes = $propertyValue->attributes($namespacesMeta['meta']); - $propertyValue = (string) $propertyValue; - switch ($propertyName) { - case 'initial-creator': - $docProps->setCreator($propertyValue); - - break; - case 'keyword': - $docProps->setKeywords($propertyValue); - - break; - case 'creation-date': - $creationDate = strtotime($propertyValue); - $docProps->setCreated($creationDate); - - break; - case 'user-defined': - $propertyValueType = Properties::PROPERTY_TYPE_STRING; - foreach ($propertyValueAttributes as $key => $value) { - if ($key == 'name') { - $propertyValueName = (string) $value; - } elseif ($key == 'value-type') { - switch ($value) { - case 'date': - $propertyValue = Properties::convertProperty($propertyValue, 'date'); - $propertyValueType = Properties::PROPERTY_TYPE_DATE; - - break; - case 'boolean': - $propertyValue = Properties::convertProperty($propertyValue, 'bool'); - $propertyValueType = Properties::PROPERTY_TYPE_BOOLEAN; - - break; - case 'float': - $propertyValue = Properties::convertProperty($propertyValue, 'r4'); - $propertyValueType = Properties::PROPERTY_TYPE_FLOAT; - - break; - default: - $propertyValueType = Properties::PROPERTY_TYPE_STRING; - } - } - } - $docProps->setCustomProperty($propertyValueName, $propertyValue, $propertyValueType); - - break; - } - } - } + (new DocumentProperties($spreadsheet))->load($xml, $namespacesMeta); // Content @@ -513,7 +429,7 @@ class Ods extends BaseReader foreach ($paragraphs as $pData) { $dataArray[] = $this->scanElementForText($pData); } - $allCellDataText = implode($dataArray, "\n"); + $allCellDataText = implode("\n", $dataArray); $type = $cellData->getAttributeNS($officeNs, 'value-type'); @@ -580,12 +496,12 @@ class Ods extends BaseReader ); $dataValue = Date::formattedPHPToExcel( - $year, - $month, - $day, - $hour, - $minute, - $second + (int) $year, + (int) $month, + (int) $day, + (int) $hour, + (int) $minute, + (int) $second ); if ($dataValue != floor($dataValue)) { diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/Properties.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/Properties.php new file mode 100644 index 00000000000..8b6122c56e7 --- /dev/null +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/Properties.php @@ -0,0 +1,136 @@ +spreadsheet = $spreadsheet; + } + + public function load(\SimpleXMLElement $xml, $namespacesMeta) + { + $docProps = $this->spreadsheet->getProperties(); + $officeProperty = $xml->children($namespacesMeta['office']); + foreach ($officeProperty as $officePropertyData) { + /** @var \SimpleXMLElement $officePropertyData */ + $officePropertiesDC = (object) []; + if (isset($namespacesMeta['dc'])) { + $officePropertiesDC = $officePropertyData->children($namespacesMeta['dc']); + } + $this->setCoreProperties($docProps, $officePropertiesDC); + + $officePropertyMeta = (object) []; + if (isset($namespacesMeta['dc'])) { + $officePropertyMeta = $officePropertyData->children($namespacesMeta['meta']); + } + foreach ($officePropertyMeta as $propertyName => $propertyValue) { + $this->setMetaProperties($namespacesMeta, $propertyValue, $propertyName, $docProps); + } + } + } + + private function setCoreProperties(DocumentProperties $docProps, \SimpleXMLElement $officePropertyDC) + { + foreach ($officePropertyDC as $propertyName => $propertyValue) { + $propertyValue = (string) $propertyValue; + switch ($propertyName) { + case 'title': + $docProps->setTitle($propertyValue); + + break; + case 'subject': + $docProps->setSubject($propertyValue); + + break; + case 'creator': + $docProps->setCreator($propertyValue); + $docProps->setLastModifiedBy($propertyValue); + + break; + case 'creation-date': + $creationDate = strtotime($propertyValue); + $docProps->setCreated($creationDate); + $docProps->setModified($creationDate); + + break; + case 'keyword': + $docProps->setKeywords($propertyValue); + + break; + case 'description': + $docProps->setDescription($propertyValue); + + break; + } + } + } + + private function setMetaProperties( + $namespacesMeta, + \SimpleXMLElement $propertyValue, + $propertyName, + DocumentProperties $docProps + ) { + $propertyValueAttributes = $propertyValue->attributes($namespacesMeta['meta']); + $propertyValue = (string) $propertyValue; + switch ($propertyName) { + case 'initial-creator': + $docProps->setCreator($propertyValue); + + break; + case 'keyword': + $docProps->setKeywords($propertyValue); + + break; + case 'creation-date': + $creationDate = strtotime($propertyValue); + $docProps->setCreated($creationDate); + + break; + case 'user-defined': + $this->setUserDefinedProperty($propertyValueAttributes, $propertyValue, $docProps); + + break; + } + } + + private function setUserDefinedProperty($propertyValueAttributes, $propertyValue, DocumentProperties $docProps) + { + $propertyValueName = ''; + $propertyValueType = DocumentProperties::PROPERTY_TYPE_STRING; + foreach ($propertyValueAttributes as $key => $value) { + if ($key == 'name') { + $propertyValueName = (string) $value; + } elseif ($key == 'value-type') { + switch ($value) { + case 'date': + $propertyValue = DocumentProperties::convertProperty($propertyValue, 'date'); + $propertyValueType = DocumentProperties::PROPERTY_TYPE_DATE; + + break; + case 'boolean': + $propertyValue = DocumentProperties::convertProperty($propertyValue, 'bool'); + $propertyValueType = DocumentProperties::PROPERTY_TYPE_BOOLEAN; + + break; + case 'float': + $propertyValue = DocumentProperties::convertProperty($propertyValue, 'r4'); + $propertyValueType = DocumentProperties::PROPERTY_TYPE_FLOAT; + + break; + default: + $propertyValueType = DocumentProperties::PROPERTY_TYPE_STRING; + } + } + } + + $docProps->setCustomProperty($propertyValueName, $propertyValue, $propertyValueType); + } +} diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php index b5f7ac60fdc..732f0bf612c 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php @@ -3,16 +3,10 @@ namespace PhpOffice\PhpSpreadsheet\Reader\Security; use PhpOffice\PhpSpreadsheet\Reader; +use PhpOffice\PhpSpreadsheet\Settings; class XmlScanner { - /** - * Identifies whether the thread-safe libxmlDisableEntityLoader() function is available. - * - * @var bool - */ - private $libxmlDisableEntityLoader = false; - /** * String used to identify risky xml elements. * @@ -22,10 +16,16 @@ class XmlScanner private $callback; - private function __construct($pattern = 'pattern = $pattern; - $this->libxmlDisableEntityLoader = $this->identifyLibxmlDisableEntityLoaderAvailability(); + + $this->disableEntityLoaderCheck(); + + // A fatal error will bypass the destructor, so we register a shutdown here + register_shutdown_function([__CLASS__, 'shutdown']); } public static function getInstance(Reader\IReader $reader) @@ -43,7 +43,7 @@ class XmlScanner } } - private function identifyLibxmlDisableEntityLoaderAvailability() + public static function threadSafeLibxmlDisableEntityLoaderAvailability() { if (PHP_MAJOR_VERSION == 7) { switch (PHP_MINOR_VERSION) { @@ -61,11 +61,54 @@ class XmlScanner return false; } + private function disableEntityLoaderCheck() + { + if (Settings::getLibXmlDisableEntityLoader()) { + $libxmlDisableEntityLoaderValue = libxml_disable_entity_loader(true); + + if (self::$libxmlDisableEntityLoaderValue === null) { + self::$libxmlDisableEntityLoaderValue = $libxmlDisableEntityLoaderValue; + } + } + } + + public static function shutdown() + { + if (self::$libxmlDisableEntityLoaderValue !== null) { + libxml_disable_entity_loader(self::$libxmlDisableEntityLoaderValue); + self::$libxmlDisableEntityLoaderValue = null; + } + } + + public function __destruct() + { + self::shutdown(); + } + public function setAdditionalCallback(callable $callback) { $this->callback = $callback; } + private function toUtf8($xml) + { + $pattern = '/encoding="(.*?)"/'; + $result = preg_match($pattern, $xml, $matches); + $charset = strtoupper($result ? $matches[1] : 'UTF-8'); + + if ($charset !== 'UTF-8') { + $xml = mb_convert_encoding($xml, 'UTF-8', $charset); + + $result = preg_match($pattern, $xml, $matches); + $charset = strtoupper($result ? $matches[1] : 'UTF-8'); + if ($charset !== 'UTF-8') { + throw new Reader\Exception('Suspicious Double-encoded XML, spreadsheet file load() aborted to prevent XXE/XEE attacks'); + } + } + + return $xml; + } + /** * Scan the XML for use of libxmlDisableEntityLoader) { - $previousLibxmlDisableEntityLoaderValue = libxml_disable_entity_loader(true); - } + $this->disableEntityLoaderCheck(); - $pattern = '/encoding="(.*?)"/'; - $result = preg_match($pattern, $xml, $matches); - $charset = $result ? $matches[1] : 'UTF-8'; - - if ($charset !== 'UTF-8') { - $xml = mb_convert_encoding($xml, 'UTF-8', $charset); - } + $xml = $this->toUtf8($xml); // Don't rely purely on libxml_disable_entity_loader() $pattern = '/\\0?' . implode('\\0?', str_split($this->pattern)) . '\\0?/'; - try { - if (preg_match($pattern, $xml)) { - throw new Reader\Exception('Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks'); - } + if (preg_match($pattern, $xml)) { + throw new Reader\Exception('Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks'); + } - if ($this->callback !== null && is_callable($this->callback)) { - $xml = call_user_func($this->callback, $xml); - } - } finally { - if (isset($previousLibxmlDisableEntityLoaderValue)) { - libxml_disable_entity_loader($previousLibxmlDisableEntityLoaderValue); - } + if ($this->callback !== null && is_callable($this->callback)) { + $xml = call_user_func($this->callback, $xml); } return $xml; diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Slk.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Slk.php index 61e52334b5c..c1013c2eb22 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Slk.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Slk.php @@ -43,7 +43,7 @@ class Slk extends BaseReader */ public function __construct() { - $this->readFilter = new DefaultReadFilter(); + parent::__construct(); } /** diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php index 514adae2743..bd2c9c1db5b 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php @@ -412,7 +412,7 @@ class Xls extends BaseReader */ public function __construct() { - $this->readFilter = new DefaultReadFilter(); + parent::__construct(); } /** diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php index 335f5d7e99c..5372fef9c13 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php @@ -4,10 +4,19 @@ namespace PhpOffice\PhpSpreadsheet\Reader; use PhpOffice\PhpSpreadsheet\Cell\Coordinate; use PhpOffice\PhpSpreadsheet\Cell\Hyperlink; -use PhpOffice\PhpSpreadsheet\Document\Properties; use PhpOffice\PhpSpreadsheet\NamedRange; use PhpOffice\PhpSpreadsheet\Reader\Security\XmlScanner; +use PhpOffice\PhpSpreadsheet\Reader\Xlsx\AutoFilter; use PhpOffice\PhpSpreadsheet\Reader\Xlsx\Chart; +use PhpOffice\PhpSpreadsheet\Reader\Xlsx\ColumnAndRowAttributes; +use PhpOffice\PhpSpreadsheet\Reader\Xlsx\ConditionalStyles; +use PhpOffice\PhpSpreadsheet\Reader\Xlsx\DataValidations; +use PhpOffice\PhpSpreadsheet\Reader\Xlsx\Hyperlinks; +use PhpOffice\PhpSpreadsheet\Reader\Xlsx\PageSetup; +use PhpOffice\PhpSpreadsheet\Reader\Xlsx\Properties as PropertyReader; +use PhpOffice\PhpSpreadsheet\Reader\Xlsx\SheetViewOptions; +use PhpOffice\PhpSpreadsheet\Reader\Xlsx\SheetViews; +use PhpOffice\PhpSpreadsheet\Reader\Xlsx\Styles; use PhpOffice\PhpSpreadsheet\ReferenceHelper; use PhpOffice\PhpSpreadsheet\RichText\RichText; use PhpOffice\PhpSpreadsheet\Settings; @@ -20,11 +29,9 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Style\Border; use PhpOffice\PhpSpreadsheet\Style\Borders; use PhpOffice\PhpSpreadsheet\Style\Color; -use PhpOffice\PhpSpreadsheet\Style\Conditional; use PhpOffice\PhpSpreadsheet\Style\NumberFormat; use PhpOffice\PhpSpreadsheet\Style\Protection; use PhpOffice\PhpSpreadsheet\Style\Style; -use PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column; use PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooterDrawing; use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; use SimpleXMLElement; @@ -52,7 +59,7 @@ class Xlsx extends BaseReader */ public function __construct() { - $this->readFilter = new DefaultReadFilter(); + parent::__construct(); $this->referenceHelper = ReferenceHelper::getInstance(); $this->securityScanner = XmlScanner::getInstance($this); } @@ -323,60 +330,6 @@ class Xlsx extends BaseReader return $contents; } - /** - * Set Worksheet column attributes by attributes array passed. - * - * @param Worksheet $docSheet - * @param string $column A, B, ... DX, ... - * @param array $columnAttributes array of attributes (indexes are attribute name, values are value) - * 'xfIndex', 'visible', 'collapsed', 'outlineLevel', 'width', ... ? - */ - private function setColumnAttributes(Worksheet $docSheet, $column, array $columnAttributes) - { - if (isset($columnAttributes['xfIndex'])) { - $docSheet->getColumnDimension($column)->setXfIndex($columnAttributes['xfIndex']); - } - if (isset($columnAttributes['visible'])) { - $docSheet->getColumnDimension($column)->setVisible($columnAttributes['visible']); - } - if (isset($columnAttributes['collapsed'])) { - $docSheet->getColumnDimension($column)->setCollapsed($columnAttributes['collapsed']); - } - if (isset($columnAttributes['outlineLevel'])) { - $docSheet->getColumnDimension($column)->setOutlineLevel($columnAttributes['outlineLevel']); - } - if (isset($columnAttributes['width'])) { - $docSheet->getColumnDimension($column)->setWidth($columnAttributes['width']); - } - } - - /** - * Set Worksheet row attributes by attributes array passed. - * - * @param Worksheet $docSheet - * @param int $row 1, 2, 3, ... 99, ... - * @param array $rowAttributes array of attributes (indexes are attribute name, values are value) - * 'xfIndex', 'visible', 'collapsed', 'outlineLevel', 'rowHeight', ... ? - */ - private function setRowAttributes(Worksheet $docSheet, $row, array $rowAttributes) - { - if (isset($rowAttributes['xfIndex'])) { - $docSheet->getRowDimension($row)->setXfIndex($rowAttributes['xfIndex']); - } - if (isset($rowAttributes['visible'])) { - $docSheet->getRowDimension($row)->setVisible($rowAttributes['visible']); - } - if (isset($rowAttributes['collapsed'])) { - $docSheet->getRowDimension($row)->setCollapsed($rowAttributes['collapsed']); - } - if (isset($rowAttributes['outlineLevel'])) { - $docSheet->getRowDimension($row)->setOutlineLevel($rowAttributes['outlineLevel']); - } - if (isset($rowAttributes['rowHeight'])) { - $docSheet->getRowDimension($row)->setRowHeight($rowAttributes['rowHeight']); - } - } - /** * Loads Spreadsheet from file. * @@ -456,70 +409,20 @@ class Xlsx extends BaseReader 'SimpleXMLElement', Settings::getLibXmlLoaderOptions() ); + + $propertyReader = new PropertyReader($this->securityScanner, $excel->getProperties()); foreach ($rels->Relationship as $rel) { switch ($rel['Type']) { case 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties': - $xmlCore = simplexml_load_string( - $this->securityScanner->scan($this->getFromZipArchive($zip, "{$rel['Target']}")), - 'SimpleXMLElement', - Settings::getLibXmlLoaderOptions() - ); - if (is_object($xmlCore)) { - $xmlCore->registerXPathNamespace('dc', 'http://purl.org/dc/elements/1.1/'); - $xmlCore->registerXPathNamespace('dcterms', 'http://purl.org/dc/terms/'); - $xmlCore->registerXPathNamespace('cp', 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties'); - $docProps = $excel->getProperties(); - $docProps->setCreator((string) self::getArrayItem($xmlCore->xpath('dc:creator'))); - $docProps->setLastModifiedBy((string) self::getArrayItem($xmlCore->xpath('cp:lastModifiedBy'))); - $docProps->setCreated(strtotime(self::getArrayItem($xmlCore->xpath('dcterms:created')))); //! respect xsi:type - $docProps->setModified(strtotime(self::getArrayItem($xmlCore->xpath('dcterms:modified')))); //! respect xsi:type - $docProps->setTitle((string) self::getArrayItem($xmlCore->xpath('dc:title'))); - $docProps->setDescription((string) self::getArrayItem($xmlCore->xpath('dc:description'))); - $docProps->setSubject((string) self::getArrayItem($xmlCore->xpath('dc:subject'))); - $docProps->setKeywords((string) self::getArrayItem($xmlCore->xpath('cp:keywords'))); - $docProps->setCategory((string) self::getArrayItem($xmlCore->xpath('cp:category'))); - } + $propertyReader->readCoreProperties($this->getFromZipArchive($zip, "{$rel['Target']}")); break; case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties': - $xmlCore = simplexml_load_string( - $this->securityScanner->scan($this->getFromZipArchive($zip, "{$rel['Target']}")), - 'SimpleXMLElement', - Settings::getLibXmlLoaderOptions() - ); - if (is_object($xmlCore)) { - $docProps = $excel->getProperties(); - if (isset($xmlCore->Company)) { - $docProps->setCompany((string) $xmlCore->Company); - } - if (isset($xmlCore->Manager)) { - $docProps->setManager((string) $xmlCore->Manager); - } - } + $propertyReader->readExtendedProperties($this->getFromZipArchive($zip, "{$rel['Target']}")); break; case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties': - $xmlCore = simplexml_load_string( - $this->securityScanner->scan($this->getFromZipArchive($zip, "{$rel['Target']}")), - 'SimpleXMLElement', - Settings::getLibXmlLoaderOptions() - ); - if (is_object($xmlCore)) { - $docProps = $excel->getProperties(); - /** @var SimpleXMLElement $xmlProperty */ - foreach ($xmlCore as $xmlProperty) { - $cellDataOfficeAttributes = $xmlProperty->attributes(); - if (isset($cellDataOfficeAttributes['name'])) { - $propertyName = (string) $cellDataOfficeAttributes['name']; - $cellDataOfficeChildren = $xmlProperty->children('http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'); - $attributeType = $cellDataOfficeChildren->getName(); - $attributeValue = (string) $cellDataOfficeChildren->{$attributeType}; - $attributeValue = Properties::convertProperty($attributeValue, $attributeType); - $attributeType = Properties::convertPropertyType($attributeType); - $docProps->setCustomProperty($propertyName, $attributeValue, $attributeType); - } - } - } + $propertyReader->readCustomProperties($this->getFromZipArchive($zip, "{$rel['Target']}")); break; //Ribbon @@ -586,8 +489,7 @@ class Xlsx extends BaseReader } } } - $styles = []; - $cellStyles = []; + $xpath = self::getArrayItem($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles']")); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" $xmlStyles = simplexml_load_string( @@ -595,6 +497,9 @@ class Xlsx extends BaseReader 'SimpleXMLElement', Settings::getLibXmlLoaderOptions() ); + + $styles = []; + $cellStyles = []; $numFmts = null; if ($xmlStyles && $xmlStyles->numFmts[0]) { $numFmts = $xmlStyles->numFmts[0]; @@ -674,31 +579,10 @@ class Xlsx extends BaseReader } } - $dxfs = []; - if (!$this->readDataOnly && $xmlStyles) { - // Conditional Styles - if ($xmlStyles->dxfs) { - foreach ($xmlStyles->dxfs->dxf as $dxf) { - $style = new Style(false, true); - self::readStyle($style, $dxf); - $dxfs[] = $style; - } - } - // Cell Styles - if ($xmlStyles->cellStyles) { - foreach ($xmlStyles->cellStyles->cellStyle as $cellStyle) { - if ((int) ($cellStyle['builtinId']) == 0) { - if (isset($cellStyles[(int) ($cellStyle['xfId'])])) { - // Set default style - $style = new Style(); - self::readStyle($style, $cellStyles[(int) ($cellStyle['xfId'])]); - - // normal style, currently not using it for anything - } - } - } - } - } + $styleReader = new Styles($xmlStyles); + $styleReader->setStyleBaseData(self::$theme, $styles, $cellStyles); + $dxfs = $styleReader->dxfs($this->readDataOnly); + $styles = $styleReader->styles(); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" $xmlWorkbook = simplexml_load_string( @@ -765,134 +649,19 @@ class Xlsx extends BaseReader $docSheet->setSheetState((string) $eleSheet['state']); } - if (isset($xmlSheet->sheetViews, $xmlSheet->sheetViews->sheetView)) { - if (isset($xmlSheet->sheetViews->sheetView['zoomScale'])) { - $zoomScale = (int) ($xmlSheet->sheetViews->sheetView['zoomScale']); - if ($zoomScale <= 0) { - // setZoomScale will throw an Exception if the scale is less than or equals 0 - // that is OK when manually creating documents, but we should be able to read all documents - $zoomScale = 100; - } - - $docSheet->getSheetView()->setZoomScale($zoomScale); - } - if (isset($xmlSheet->sheetViews->sheetView['zoomScaleNormal'])) { - $zoomScaleNormal = (int) ($xmlSheet->sheetViews->sheetView['zoomScaleNormal']); - if ($zoomScaleNormal <= 0) { - // setZoomScaleNormal will throw an Exception if the scale is less than or equals 0 - // that is OK when manually creating documents, but we should be able to read all documents - $zoomScaleNormal = 100; - } - - $docSheet->getSheetView()->setZoomScaleNormal($zoomScaleNormal); - } - if (isset($xmlSheet->sheetViews->sheetView['view'])) { - $docSheet->getSheetView()->setView((string) $xmlSheet->sheetViews->sheetView['view']); - } - if (isset($xmlSheet->sheetViews->sheetView['showGridLines'])) { - $docSheet->setShowGridLines(self::boolean((string) $xmlSheet->sheetViews->sheetView['showGridLines'])); - } - if (isset($xmlSheet->sheetViews->sheetView['showRowColHeaders'])) { - $docSheet->setShowRowColHeaders(self::boolean((string) $xmlSheet->sheetViews->sheetView['showRowColHeaders'])); - } - if (isset($xmlSheet->sheetViews->sheetView['rightToLeft'])) { - $docSheet->setRightToLeft(self::boolean((string) $xmlSheet->sheetViews->sheetView['rightToLeft'])); - } - if (isset($xmlSheet->sheetViews->sheetView->pane)) { - $xSplit = 0; - $ySplit = 0; - $topLeftCell = null; - - if (isset($xmlSheet->sheetViews->sheetView->pane['xSplit'])) { - $xSplit = (int) ($xmlSheet->sheetViews->sheetView->pane['xSplit']); - } - - if (isset($xmlSheet->sheetViews->sheetView->pane['ySplit'])) { - $ySplit = (int) ($xmlSheet->sheetViews->sheetView->pane['ySplit']); - } - - if (isset($xmlSheet->sheetViews->sheetView->pane['topLeftCell'])) { - $topLeftCell = (string) $xmlSheet->sheetViews->sheetView->pane['topLeftCell']; - } - - $docSheet->freezePane(Coordinate::stringFromColumnIndex($xSplit + 1) . ($ySplit + 1), $topLeftCell); + if ($xmlSheet) { + if (isset($xmlSheet->sheetViews, $xmlSheet->sheetViews->sheetView)) { + $sheetViews = new SheetViews($xmlSheet->sheetViews->sheetView, $docSheet); + $sheetViews->load(); } - if (isset($xmlSheet->sheetViews->sheetView->selection)) { - if (isset($xmlSheet->sheetViews->sheetView->selection['sqref'])) { - $sqref = (string) $xmlSheet->sheetViews->sheetView->selection['sqref']; - $sqref = explode(' ', $sqref); - $sqref = $sqref[0]; - $docSheet->setSelectedCells($sqref); - } - } + $sheetViewOptions = new SheetViewOptions($docSheet, $xmlSheet); + $sheetViewOptions->load($this->getReadDataOnly()); + + (new ColumnAndRowAttributes($docSheet, $xmlSheet)) + ->load($this->getReadFilter(), $this->getReadDataOnly()); } - if (isset($xmlSheet->sheetPr, $xmlSheet->sheetPr->tabColor)) { - if (isset($xmlSheet->sheetPr->tabColor['rgb'])) { - $docSheet->getTabColor()->setARGB((string) $xmlSheet->sheetPr->tabColor['rgb']); - } - } - if (isset($xmlSheet->sheetPr, $xmlSheet->sheetPr['codeName'])) { - $docSheet->setCodeName((string) $xmlSheet->sheetPr['codeName'], false); - } - if (isset($xmlSheet->sheetPr, $xmlSheet->sheetPr->outlinePr)) { - if (isset($xmlSheet->sheetPr->outlinePr['summaryRight']) && - !self::boolean((string) $xmlSheet->sheetPr->outlinePr['summaryRight'])) { - $docSheet->setShowSummaryRight(false); - } else { - $docSheet->setShowSummaryRight(true); - } - - if (isset($xmlSheet->sheetPr->outlinePr['summaryBelow']) && - !self::boolean((string) $xmlSheet->sheetPr->outlinePr['summaryBelow'])) { - $docSheet->setShowSummaryBelow(false); - } else { - $docSheet->setShowSummaryBelow(true); - } - } - - if (isset($xmlSheet->sheetPr, $xmlSheet->sheetPr->pageSetUpPr)) { - if (isset($xmlSheet->sheetPr->pageSetUpPr['fitToPage']) && - !self::boolean((string) $xmlSheet->sheetPr->pageSetUpPr['fitToPage'])) { - $docSheet->getPageSetup()->setFitToPage(false); - } else { - $docSheet->getPageSetup()->setFitToPage(true); - } - } - - if (isset($xmlSheet->sheetFormatPr)) { - if (isset($xmlSheet->sheetFormatPr['customHeight']) && - self::boolean((string) $xmlSheet->sheetFormatPr['customHeight']) && - isset($xmlSheet->sheetFormatPr['defaultRowHeight'])) { - $docSheet->getDefaultRowDimension()->setRowHeight((float) $xmlSheet->sheetFormatPr['defaultRowHeight']); - } - if (isset($xmlSheet->sheetFormatPr['defaultColWidth'])) { - $docSheet->getDefaultColumnDimension()->setWidth((float) $xmlSheet->sheetFormatPr['defaultColWidth']); - } - if (isset($xmlSheet->sheetFormatPr['zeroHeight']) && - ((string) $xmlSheet->sheetFormatPr['zeroHeight'] == '1')) { - $docSheet->getDefaultRowDimension()->setZeroHeight(true); - } - } - - if (isset($xmlSheet->printOptions) && !$this->readDataOnly) { - if (self::boolean((string) $xmlSheet->printOptions['gridLinesSet'])) { - $docSheet->setShowGridlines(true); - } - if (self::boolean((string) $xmlSheet->printOptions['gridLines'])) { - $docSheet->setPrintGridlines(true); - } - if (self::boolean((string) $xmlSheet->printOptions['horizontalCentered'])) { - $docSheet->getPageSetup()->setHorizontalCentered(true); - } - if (self::boolean((string) $xmlSheet->printOptions['verticalCentered'])) { - $docSheet->getPageSetup()->setVerticalCentered(true); - } - } - - $this->readColumnsAndRowsAttributes($xmlSheet, $docSheet); - if ($xmlSheet && $xmlSheet->sheetData && $xmlSheet->sheetData->row) { $cIndex = 1; // Cell Start from 1 foreach ($xmlSheet->sheetData->row as $row) { @@ -972,38 +741,39 @@ class Xlsx extends BaseReader break; } - // Check for numeric values - if (is_numeric($value) && $cellDataType != 's') { - if ($value == (int) $value) { - $value = (int) $value; - } elseif ($value == (float) $value) { - $value = (float) $value; - } elseif ($value == (float) $value) { - $value = (float) $value; + // read empty cells or the cells are not empty + if ($this->readEmptyCells || ($value !== null && $value !== '')) { + // Check for numeric values + if (is_numeric($value) && $cellDataType != 's') { + if ($value == (int) $value) { + $value = (int) $value; + } elseif ($value == (float) $value) { + $value = (float) $value; + } } - } - // Rich text? - if ($value instanceof RichText && $this->readDataOnly) { - $value = $value->getPlainText(); - } + // Rich text? + if ($value instanceof RichText && $this->readDataOnly) { + $value = $value->getPlainText(); + } - $cell = $docSheet->getCell($r); - // Assign value - if ($cellDataType != '') { - $cell->setValueExplicit($value, $cellDataType); - } else { - $cell->setValue($value); - } - if ($calculatedValue !== null) { - $cell->setCalculatedValue($calculatedValue); - } + $cell = $docSheet->getCell($r); + // Assign value + if ($cellDataType != '') { + $cell->setValueExplicit($value, $cellDataType); + } else { + $cell->setValue($value); + } + if ($calculatedValue !== null) { + $cell->setCalculatedValue($calculatedValue); + } - // Style information? - if ($c['s'] && !$this->readDataOnly) { - // no style index means 0, it seems - $cell->setXfIndex(isset($styles[(int) ($c['s'])]) ? - (int) ($c['s']) : 0); + // Style information? + if ($c['s'] && !$this->readDataOnly) { + // no style index means 0, it seems + $cell->setXfIndex(isset($styles[(int) ($c['s'])]) ? + (int) ($c['s']) : 0); + } } $rowIndex += 1; } @@ -1011,49 +781,8 @@ class Xlsx extends BaseReader } } - $conditionals = []; if (!$this->readDataOnly && $xmlSheet && $xmlSheet->conditionalFormatting) { - foreach ($xmlSheet->conditionalFormatting as $conditional) { - foreach ($conditional->cfRule as $cfRule) { - if (((string) $cfRule['type'] == Conditional::CONDITION_NONE || (string) $cfRule['type'] == Conditional::CONDITION_CELLIS || (string) $cfRule['type'] == Conditional::CONDITION_CONTAINSTEXT || (string) $cfRule['type'] == Conditional::CONDITION_EXPRESSION) && isset($dxfs[(int) ($cfRule['dxfId'])])) { - $conditionals[(string) $conditional['sqref']][(int) ($cfRule['priority'])] = $cfRule; - } - } - } - - foreach ($conditionals as $ref => $cfRules) { - ksort($cfRules); - $conditionalStyles = []; - foreach ($cfRules as $cfRule) { - $objConditional = new Conditional(); - $objConditional->setConditionType((string) $cfRule['type']); - $objConditional->setOperatorType((string) $cfRule['operator']); - - if ((string) $cfRule['text'] != '') { - $objConditional->setText((string) $cfRule['text']); - } - - if (isset($cfRule['stopIfTrue']) && (int) $cfRule['stopIfTrue'] === 1) { - $objConditional->setStopIfTrue(true); - } - - if (count($cfRule->formula) > 1) { - foreach ($cfRule->formula as $formula) { - $objConditional->addCondition((string) $formula); - } - } else { - $objConditional->addCondition((string) $cfRule->formula); - } - $objConditional->setStyle(clone $dxfs[(int) ($cfRule['dxfId'])]); - $conditionalStyles[] = $objConditional; - } - - // Extract all cell references in $ref - $cellBlocks = explode(' ', str_replace('$', '', strtoupper($ref))); - foreach ($cellBlocks as $cellBlock) { - $docSheet->getStyle($cellBlock)->setConditionalStyles($conditionalStyles); - } - } + (new ConditionalStyles($docSheet, $xmlSheet, $dxfs))->load(); } $aKeys = ['sheet', 'objects', 'scenarios', 'formatCells', 'formatColumns', 'formatRows', 'insertColumns', 'insertRows', 'insertHyperlinks', 'deleteColumns', 'deleteRows', 'selectLockedCells', 'sort', 'autoFilter', 'pivotTables', 'selectUnlockedCells']; @@ -1074,103 +803,7 @@ class Xlsx extends BaseReader } if ($xmlSheet && $xmlSheet->autoFilter && !$this->readDataOnly) { - $autoFilterRange = (string) $xmlSheet->autoFilter['ref']; - if (strpos($autoFilterRange, ':') !== false) { - $autoFilter = $docSheet->getAutoFilter(); - $autoFilter->setRange($autoFilterRange); - - foreach ($xmlSheet->autoFilter->filterColumn as $filterColumn) { - $column = $autoFilter->getColumnByOffset((int) $filterColumn['colId']); - // Check for standard filters - if ($filterColumn->filters) { - $column->setFilterType(Column::AUTOFILTER_FILTERTYPE_FILTER); - $filters = $filterColumn->filters; - if ((isset($filters['blank'])) && ($filters['blank'] == 1)) { - // Operator is undefined, but always treated as EQUAL - $column->createRule()->setRule(null, '')->setRuleType(Column\Rule::AUTOFILTER_RULETYPE_FILTER); - } - // Standard filters are always an OR join, so no join rule needs to be set - // Entries can be either filter elements - foreach ($filters->filter as $filterRule) { - // Operator is undefined, but always treated as EQUAL - $column->createRule()->setRule(null, (string) $filterRule['val'])->setRuleType(Column\Rule::AUTOFILTER_RULETYPE_FILTER); - } - // Or Date Group elements - foreach ($filters->dateGroupItem as $dateGroupItem) { - // Operator is undefined, but always treated as EQUAL - $column->createRule()->setRule( - null, - [ - 'year' => (string) $dateGroupItem['year'], - 'month' => (string) $dateGroupItem['month'], - 'day' => (string) $dateGroupItem['day'], - 'hour' => (string) $dateGroupItem['hour'], - 'minute' => (string) $dateGroupItem['minute'], - 'second' => (string) $dateGroupItem['second'], - ], - (string) $dateGroupItem['dateTimeGrouping'] - ) - ->setRuleType(Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP); - } - } - // Check for custom filters - if ($filterColumn->customFilters) { - $column->setFilterType(Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER); - $customFilters = $filterColumn->customFilters; - // Custom filters can an AND or an OR join; - // and there should only ever be one or two entries - if ((isset($customFilters['and'])) && ($customFilters['and'] == 1)) { - $column->setJoin(Column::AUTOFILTER_COLUMN_JOIN_AND); - } - foreach ($customFilters->customFilter as $filterRule) { - $column->createRule()->setRule( - (string) $filterRule['operator'], - (string) $filterRule['val'] - ) - ->setRuleType(Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); - } - } - // Check for dynamic filters - if ($filterColumn->dynamicFilter) { - $column->setFilterType(Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER); - // We should only ever have one dynamic filter - foreach ($filterColumn->dynamicFilter as $filterRule) { - // Operator is undefined, but always treated as EQUAL - $column->createRule()->setRule( - null, - (string) $filterRule['val'], - (string) $filterRule['type'] - ) - ->setRuleType(Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER); - if (isset($filterRule['val'])) { - $column->setAttribute('val', (string) $filterRule['val']); - } - if (isset($filterRule['maxVal'])) { - $column->setAttribute('maxVal', (string) $filterRule['maxVal']); - } - } - } - // Check for dynamic filters - if ($filterColumn->top10) { - $column->setFilterType(Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER); - // We should only ever have one top10 filter - foreach ($filterColumn->top10 as $filterRule) { - $column->createRule()->setRule( - (((isset($filterRule['percent'])) && ($filterRule['percent'] == 1)) - ? Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT - : Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE - ), - (string) $filterRule['val'], - (((isset($filterRule['top'])) && ($filterRule['top'] == 1)) - ? Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP - : Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM - ) - ) - ->setRuleType(Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER); - } - } - } - } + (new AutoFilter($docSheet, $xmlSheet))->load(); } if ($xmlSheet && $xmlSheet->mergeCells && $xmlSheet->mergeCells->mergeCell && !$this->readDataOnly) { @@ -1182,124 +815,12 @@ class Xlsx extends BaseReader } } - if ($xmlSheet && $xmlSheet->pageMargins && !$this->readDataOnly) { - $docPageMargins = $docSheet->getPageMargins(); - $docPageMargins->setLeft((float) ($xmlSheet->pageMargins['left'])); - $docPageMargins->setRight((float) ($xmlSheet->pageMargins['right'])); - $docPageMargins->setTop((float) ($xmlSheet->pageMargins['top'])); - $docPageMargins->setBottom((float) ($xmlSheet->pageMargins['bottom'])); - $docPageMargins->setHeader((float) ($xmlSheet->pageMargins['header'])); - $docPageMargins->setFooter((float) ($xmlSheet->pageMargins['footer'])); - } - - if ($xmlSheet && $xmlSheet->pageSetup && !$this->readDataOnly) { - $docPageSetup = $docSheet->getPageSetup(); - - if (isset($xmlSheet->pageSetup['orientation'])) { - $docPageSetup->setOrientation((string) $xmlSheet->pageSetup['orientation']); - } - if (isset($xmlSheet->pageSetup['paperSize'])) { - $docPageSetup->setPaperSize((int) ($xmlSheet->pageSetup['paperSize'])); - } - if (isset($xmlSheet->pageSetup['scale'])) { - $docPageSetup->setScale((int) ($xmlSheet->pageSetup['scale']), false); - } - if (isset($xmlSheet->pageSetup['fitToHeight']) && (int) ($xmlSheet->pageSetup['fitToHeight']) >= 0) { - $docPageSetup->setFitToHeight((int) ($xmlSheet->pageSetup['fitToHeight']), false); - } - if (isset($xmlSheet->pageSetup['fitToWidth']) && (int) ($xmlSheet->pageSetup['fitToWidth']) >= 0) { - $docPageSetup->setFitToWidth((int) ($xmlSheet->pageSetup['fitToWidth']), false); - } - if (isset($xmlSheet->pageSetup['firstPageNumber'], $xmlSheet->pageSetup['useFirstPageNumber']) && - self::boolean((string) $xmlSheet->pageSetup['useFirstPageNumber'])) { - $docPageSetup->setFirstPageNumber((int) ($xmlSheet->pageSetup['firstPageNumber'])); - } - - $relAttributes = $xmlSheet->pageSetup->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'); - if (isset($relAttributes['id'])) { - $unparsedLoadedData['sheets'][$docSheet->getCodeName()]['pageSetupRelId'] = (string) $relAttributes['id']; - } - } - - if ($xmlSheet && $xmlSheet->headerFooter && !$this->readDataOnly) { - $docHeaderFooter = $docSheet->getHeaderFooter(); - - if (isset($xmlSheet->headerFooter['differentOddEven']) && - self::boolean((string) $xmlSheet->headerFooter['differentOddEven'])) { - $docHeaderFooter->setDifferentOddEven(true); - } else { - $docHeaderFooter->setDifferentOddEven(false); - } - if (isset($xmlSheet->headerFooter['differentFirst']) && - self::boolean((string) $xmlSheet->headerFooter['differentFirst'])) { - $docHeaderFooter->setDifferentFirst(true); - } else { - $docHeaderFooter->setDifferentFirst(false); - } - if (isset($xmlSheet->headerFooter['scaleWithDoc']) && - !self::boolean((string) $xmlSheet->headerFooter['scaleWithDoc'])) { - $docHeaderFooter->setScaleWithDocument(false); - } else { - $docHeaderFooter->setScaleWithDocument(true); - } - if (isset($xmlSheet->headerFooter['alignWithMargins']) && - !self::boolean((string) $xmlSheet->headerFooter['alignWithMargins'])) { - $docHeaderFooter->setAlignWithMargins(false); - } else { - $docHeaderFooter->setAlignWithMargins(true); - } - - $docHeaderFooter->setOddHeader((string) $xmlSheet->headerFooter->oddHeader); - $docHeaderFooter->setOddFooter((string) $xmlSheet->headerFooter->oddFooter); - $docHeaderFooter->setEvenHeader((string) $xmlSheet->headerFooter->evenHeader); - $docHeaderFooter->setEvenFooter((string) $xmlSheet->headerFooter->evenFooter); - $docHeaderFooter->setFirstHeader((string) $xmlSheet->headerFooter->firstHeader); - $docHeaderFooter->setFirstFooter((string) $xmlSheet->headerFooter->firstFooter); - } - - if ($xmlSheet && $xmlSheet->rowBreaks && $xmlSheet->rowBreaks->brk && !$this->readDataOnly) { - foreach ($xmlSheet->rowBreaks->brk as $brk) { - if ($brk['man']) { - $docSheet->setBreak("A$brk[id]", Worksheet::BREAK_ROW); - } - } - } - if ($xmlSheet && $xmlSheet->colBreaks && $xmlSheet->colBreaks->brk && !$this->readDataOnly) { - foreach ($xmlSheet->colBreaks->brk as $brk) { - if ($brk['man']) { - $docSheet->setBreak(Coordinate::stringFromColumnIndex((string) $brk['id'] + 1) . '1', Worksheet::BREAK_COLUMN); - } - } + if ($xmlSheet && !$this->readDataOnly) { + $unparsedLoadedData = (new PageSetup($docSheet, $xmlSheet))->load($unparsedLoadedData); } if ($xmlSheet && $xmlSheet->dataValidations && !$this->readDataOnly) { - foreach ($xmlSheet->dataValidations->dataValidation as $dataValidation) { - // Uppercase coordinate - $range = strtoupper($dataValidation['sqref']); - $rangeSet = explode(' ', $range); - foreach ($rangeSet as $range) { - $stRange = $docSheet->shrinkRangeToFit($range); - - // Extract all cell references in $range - foreach (Coordinate::extractAllCellReferencesInRange($stRange) as $reference) { - // Create validation - $docValidation = $docSheet->getCell($reference)->getDataValidation(); - $docValidation->setType((string) $dataValidation['type']); - $docValidation->setErrorStyle((string) $dataValidation['errorStyle']); - $docValidation->setOperator((string) $dataValidation['operator']); - $docValidation->setAllowBlank($dataValidation['allowBlank'] != 0); - $docValidation->setShowDropDown($dataValidation['showDropDown'] == 0); - $docValidation->setShowInputMessage($dataValidation['showInputMessage'] != 0); - $docValidation->setShowErrorMessage($dataValidation['showErrorMessage'] != 0); - $docValidation->setErrorTitle((string) $dataValidation['errorTitle']); - $docValidation->setError((string) $dataValidation['error']); - $docValidation->setPromptTitle((string) $dataValidation['promptTitle']); - $docValidation->setPrompt((string) $dataValidation['prompt']); - $docValidation->setFormula1((string) $dataValidation->formula1); - $docValidation->setFormula2((string) $dataValidation->formula2); - } - } - } + (new DataValidations($docSheet, $xmlSheet))->load(); } // unparsed sheet AlternateContent @@ -1313,50 +834,25 @@ class Xlsx extends BaseReader } // Add hyperlinks - $hyperlinks = []; if (!$this->readDataOnly) { + $hyperlinkReader = new Hyperlinks($docSheet); // Locate hyperlink relations - if ($zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) { + $relationsFileName = dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels'; + if ($zip->locateName($relationsFileName)) { //~ http://schemas.openxmlformats.org/package/2006/relationships" $relsWorksheet = simplexml_load_string( $this->securityScanner->scan( - $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels') + $this->getFromZipArchive($zip, $relationsFileName) ), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions() ); - foreach ($relsWorksheet->Relationship as $ele) { - if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink') { - $hyperlinks[(string) $ele['Id']] = (string) $ele['Target']; - } - } + $hyperlinkReader->readHyperlinks($relsWorksheet); } // Loop through hyperlinks if ($xmlSheet && $xmlSheet->hyperlinks) { - /** @var SimpleXMLElement $hyperlink */ - foreach ($xmlSheet->hyperlinks->hyperlink as $hyperlink) { - // Link url - $linkRel = $hyperlink->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'); - - foreach (Coordinate::extractAllCellReferencesInRange($hyperlink['ref']) as $cellReference) { - $cell = $docSheet->getCell($cellReference); - if (isset($linkRel['id'])) { - $hyperlinkUrl = $hyperlinks[(string) $linkRel['id']]; - if (isset($hyperlink['location'])) { - $hyperlinkUrl .= '#' . (string) $hyperlink['location']; - } - $cell->getHyperlink()->setUrl($hyperlinkUrl); - } elseif (isset($hyperlink['location'])) { - $cell->getHyperlink()->setUrl('sheet://' . (string) $hyperlink['location']); - } - - // Tooltip - if (isset($hyperlink['tooltip'])) { - $cell->getHyperlink()->setTooltip((string) $hyperlink['tooltip']); - } - } - } + $hyperlinkReader->setHyperlinks($xmlSheet->hyperlinks); } } @@ -1418,12 +914,18 @@ class Xlsx extends BaseReader foreach ($vmlComments as $relName => $relPath) { // Load VML comments file $relPath = File::realpath(dirname("$dir/$fileWorksheet") . '/' . $relPath); - $vmlCommentsFile = simplexml_load_string( - $this->securityScanner->scan($this->getFromZipArchive($zip, $relPath)), - 'SimpleXMLElement', - Settings::getLibXmlLoaderOptions() - ); - $vmlCommentsFile->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); + + try { + $vmlCommentsFile = simplexml_load_string( + $this->securityScanner->scan($this->getFromZipArchive($zip, $relPath)), + 'SimpleXMLElement', + Settings::getLibXmlLoaderOptions() + ); + $vmlCommentsFile->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); + } catch (\Throwable $ex) { + //Ignore unparsable vmlDrawings. Later they will be moved from $unparsedVmlDrawings to $unparsedLoadedData + continue; + } $shapes = $vmlCommentsFile->xpath('//v:shape'); foreach ($shapes as $shape) { @@ -1597,8 +1099,10 @@ class Xlsx extends BaseReader } } if ($xmlSheet->drawing && !$this->readDataOnly) { + $unparsedDrawings = []; foreach ($xmlSheet->drawing as $drawing) { - $fileDrawing = $drawings[(string) self::getArrayItem($drawing->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'), 'id')]; + $drawingRelId = (string) self::getArrayItem($drawing->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'), 'id'); + $fileDrawing = $drawings[$drawingRelId]; //~ http://schemas.openxmlformats.org/package/2006/relationships" $relsDrawing = simplexml_load_string( $this->securityScanner->scan( @@ -1630,10 +1134,11 @@ class Xlsx extends BaseReader $this->securityScanner->scan($this->getFromZipArchive($zip, $fileDrawing)), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions() - )->children('http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing'); + ); + $xmlDrawingChildren = $xmlDrawing->children('http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing'); - if ($xmlDrawing->oneCellAnchor) { - foreach ($xmlDrawing->oneCellAnchor as $oneCellAnchor) { + if ($xmlDrawingChildren->oneCellAnchor) { + foreach ($xmlDrawingChildren->oneCellAnchor as $oneCellAnchor) { if ($oneCellAnchor->pic->blipFill) { /** @var SimpleXMLElement $blip */ $blip = $oneCellAnchor->pic->blipFill->children('http://schemas.openxmlformats.org/drawingml/2006/main')->blip; @@ -1667,12 +1172,13 @@ class Xlsx extends BaseReader if ($outerShdw) { $shadow = $objDrawing->getShadow(); $shadow->setVisible(true); - $shadow->setBlurRadius(Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), 'blurRad'))); - $shadow->setDistance(Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), 'dist'))); + $shadow->setBlurRadius(Drawing::EMUToPixels(self::getArrayItem($outerShdw->attributes(), 'blurRad'))); + $shadow->setDistance(Drawing::EMUToPixels(self::getArrayItem($outerShdw->attributes(), 'dist'))); $shadow->setDirection(Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), 'dir'))); $shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), 'algn')); - $shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), 'val')); - $shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), 'val') / 1000); + $clr = isset($outerShdw->srgbClr) ? $outerShdw->srgbClr : $outerShdw->prstClr; + $shadow->getColor()->setRGB(self::getArrayItem($clr->attributes(), 'val')); + $shadow->setAlpha(self::getArrayItem($clr->alpha->attributes(), 'val') / 1000); } $this->readHyperLinkDrawing($objDrawing, $oneCellAnchor, $hyperlinks); @@ -1688,8 +1194,8 @@ class Xlsx extends BaseReader } } } - if ($xmlDrawing->twoCellAnchor) { - foreach ($xmlDrawing->twoCellAnchor as $twoCellAnchor) { + if ($xmlDrawingChildren->twoCellAnchor) { + foreach ($xmlDrawingChildren->twoCellAnchor as $twoCellAnchor) { if ($twoCellAnchor->pic->blipFill) { $blip = $twoCellAnchor->pic->blipFill->children('http://schemas.openxmlformats.org/drawingml/2006/main')->blip; $xfrm = $twoCellAnchor->pic->spPr->children('http://schemas.openxmlformats.org/drawingml/2006/main')->xfrm; @@ -1719,12 +1225,13 @@ class Xlsx extends BaseReader if ($outerShdw) { $shadow = $objDrawing->getShadow(); $shadow->setVisible(true); - $shadow->setBlurRadius(Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), 'blurRad'))); - $shadow->setDistance(Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), 'dist'))); + $shadow->setBlurRadius(Drawing::EMUToPixels(self::getArrayItem($outerShdw->attributes(), 'blurRad'))); + $shadow->setDistance(Drawing::EMUToPixels(self::getArrayItem($outerShdw->attributes(), 'dist'))); $shadow->setDirection(Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), 'dir'))); $shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), 'algn')); - $shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), 'val')); - $shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), 'val') / 1000); + $clr = isset($outerShdw->srgbClr) ? $outerShdw->srgbClr : $outerShdw->prstClr; + $shadow->getColor()->setRGB(self::getArrayItem($clr->attributes(), 'val')); + $shadow->setAlpha(self::getArrayItem($clr->alpha->attributes(), 'val') / 1000); } $this->readHyperLinkDrawing($objDrawing, $twoCellAnchor, $hyperlinks); @@ -1754,13 +1261,21 @@ class Xlsx extends BaseReader } } } + if ($relsDrawing === false && $xmlDrawing->count() == 0) { + // Save Drawing without rels and children as unparsed + $unparsedDrawings[$drawingRelId] = $xmlDrawing->asXML(); + } } // store original rId of drawing files $unparsedLoadedData['sheets'][$docSheet->getCodeName()]['drawingOriginalIds'] = []; foreach ($relsWorksheet->Relationship as $ele) { if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing') { - $unparsedLoadedData['sheets'][$docSheet->getCodeName()]['drawingOriginalIds'][(string) $ele['Target']] = (string) $ele['Id']; + $drawingRelId = (string) $ele['Id']; + $unparsedLoadedData['sheets'][$docSheet->getCodeName()]['drawingOriginalIds'][(string) $ele['Target']] = $drawingRelId; + if (isset($unparsedDrawings[$drawingRelId])) { + $unparsedLoadedData['sheets'][$docSheet->getCodeName()]['Drawings'][$drawingRelId] = $unparsedDrawings[$drawingRelId]; + } } } @@ -1905,7 +1420,7 @@ class Xlsx extends BaseReader if (strpos((string) $definedName, '!') !== false) { // Extract sheet name $extractedSheetName = Worksheet::extractSheetTitle((string) $definedName, true); - $extractedSheetName = $extractedSheetName[0]; + $extractedSheetName = trim($extractedSheetName[0], "'"); // Locate sheet $locatedSheet = $excel->getSheetByName($extractedSheetName); @@ -2511,94 +2026,4 @@ class Xlsx extends BaseReader return (bool) $xsdBoolean; } - - /** - * Read columns and rows attributes from XML and set them on the worksheet. - * - * @param SimpleXMLElement $xmlSheet - * @param Worksheet $docSheet - */ - private function readColumnsAndRowsAttributes(SimpleXMLElement $xmlSheet, Worksheet $docSheet) - { - $columnsAttributes = []; - $rowsAttributes = []; - if (isset($xmlSheet->cols) && !$this->readDataOnly) { - foreach ($xmlSheet->cols->col as $col) { - for ($i = (int) ($col['min']); $i <= (int) ($col['max']); ++$i) { - if ($col['style'] && !$this->readDataOnly) { - $columnsAttributes[Coordinate::stringFromColumnIndex($i)]['xfIndex'] = (int) $col['style']; - } - if (self::boolean($col['hidden'])) { - $columnsAttributes[Coordinate::stringFromColumnIndex($i)]['visible'] = false; - } - if (self::boolean($col['collapsed'])) { - $columnsAttributes[Coordinate::stringFromColumnIndex($i)]['collapsed'] = true; - } - if ($col['outlineLevel'] > 0) { - $columnsAttributes[Coordinate::stringFromColumnIndex($i)]['outlineLevel'] = (int) $col['outlineLevel']; - } - $columnsAttributes[Coordinate::stringFromColumnIndex($i)]['width'] = (float) $col['width']; - - if ((int) ($col['max']) == 16384) { - break; - } - } - } - } - - if ($xmlSheet && $xmlSheet->sheetData && $xmlSheet->sheetData->row) { - foreach ($xmlSheet->sheetData->row as $row) { - if ($row['ht'] && !$this->readDataOnly) { - $rowsAttributes[(int) $row['r']]['rowHeight'] = (float) $row['ht']; - } - if (self::boolean($row['hidden']) && !$this->readDataOnly) { - $rowsAttributes[(int) $row['r']]['visible'] = false; - } - if (self::boolean($row['collapsed'])) { - $rowsAttributes[(int) $row['r']]['collapsed'] = true; - } - if ($row['outlineLevel'] > 0) { - $rowsAttributes[(int) $row['r']]['outlineLevel'] = (int) $row['outlineLevel']; - } - if ($row['s'] && !$this->readDataOnly) { - $rowsAttributes[(int) $row['r']]['xfIndex'] = (int) $row['s']; - } - } - } - - $readFilter = (\get_class($this->getReadFilter()) !== DefaultReadFilter::class ? $this->getReadFilter() : null); - - // set columns/rows attributes - $columnsAttributesSet = []; - $rowsAttributesSet = []; - foreach ($columnsAttributes as $coordColumn => $columnAttributes) { - if ($readFilter !== null) { - foreach ($rowsAttributes as $coordRow => $rowAttributes) { - if (!$readFilter->readCell($coordColumn, $coordRow, $docSheet->getTitle())) { - continue 2; - } - } - } - - if (!isset($columnsAttributesSet[$coordColumn])) { - $this->setColumnAttributes($docSheet, $coordColumn, $columnAttributes); - $columnsAttributesSet[$coordColumn] = true; - } - } - - foreach ($rowsAttributes as $coordRow => $rowAttributes) { - if ($readFilter !== null) { - foreach ($columnsAttributes as $coordColumn => $columnAttributes) { - if (!$readFilter->readCell($coordColumn, $coordRow, $docSheet->getTitle())) { - continue 2; - } - } - } - - if (!isset($rowsAttributesSet[$coordRow])) { - $this->setRowAttributes($docSheet, $coordRow, $rowAttributes); - $rowsAttributesSet[$coordRow] = true; - } - } - } } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php new file mode 100644 index 00000000000..6929758dfe9 --- /dev/null +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php @@ -0,0 +1,144 @@ +worksheet = $workSheet; + $this->worksheetXml = $worksheetXml; + } + + public function load() + { + $autoFilterRange = (string) $this->worksheetXml->autoFilter['ref']; + if (strpos($autoFilterRange, ':') !== false) { + $this->readAutoFilter($autoFilterRange, $this->worksheetXml); + } + } + + private function readAutoFilter($autoFilterRange, $xmlSheet) + { + $autoFilter = $this->worksheet->getAutoFilter(); + $autoFilter->setRange($autoFilterRange); + + foreach ($xmlSheet->autoFilter->filterColumn as $filterColumn) { + $column = $autoFilter->getColumnByOffset((int) $filterColumn['colId']); + // Check for standard filters + if ($filterColumn->filters) { + $column->setFilterType(Column::AUTOFILTER_FILTERTYPE_FILTER); + $filters = $filterColumn->filters; + if ((isset($filters['blank'])) && ($filters['blank'] == 1)) { + // Operator is undefined, but always treated as EQUAL + $column->createRule()->setRule(null, '')->setRuleType(Rule::AUTOFILTER_RULETYPE_FILTER); + } + // Standard filters are always an OR join, so no join rule needs to be set + // Entries can be either filter elements + foreach ($filters->filter as $filterRule) { + // Operator is undefined, but always treated as EQUAL + $column->createRule()->setRule(null, (string) $filterRule['val'])->setRuleType(Rule::AUTOFILTER_RULETYPE_FILTER); + } + + // Or Date Group elements + $this->readDateRangeAutoFilter($filters, $column); + } + + // Check for custom filters + $this->readCustomAutoFilter($filterColumn, $column); + // Check for dynamic filters + $this->readDynamicAutoFilter($filterColumn, $column); + // Check for dynamic filters + $this->readTopTenAutoFilter($filterColumn, $column); + } + } + + private function readDateRangeAutoFilter(\SimpleXMLElement $filters, Column $column) + { + foreach ($filters->dateGroupItem as $dateGroupItem) { + // Operator is undefined, but always treated as EQUAL + $column->createRule()->setRule( + null, + [ + 'year' => (string) $dateGroupItem['year'], + 'month' => (string) $dateGroupItem['month'], + 'day' => (string) $dateGroupItem['day'], + 'hour' => (string) $dateGroupItem['hour'], + 'minute' => (string) $dateGroupItem['minute'], + 'second' => (string) $dateGroupItem['second'], + ], + (string) $dateGroupItem['dateTimeGrouping'] + )->setRuleType(Rule::AUTOFILTER_RULETYPE_DATEGROUP); + } + } + + private function readCustomAutoFilter(\SimpleXMLElement $filterColumn, Column $column) + { + if ($filterColumn->customFilters) { + $column->setFilterType(Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER); + $customFilters = $filterColumn->customFilters; + // Custom filters can an AND or an OR join; + // and there should only ever be one or two entries + if ((isset($customFilters['and'])) && ($customFilters['and'] == 1)) { + $column->setJoin(Column::AUTOFILTER_COLUMN_JOIN_AND); + } + foreach ($customFilters->customFilter as $filterRule) { + $column->createRule()->setRule( + (string) $filterRule['operator'], + (string) $filterRule['val'] + )->setRuleType(Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); + } + } + } + + private function readDynamicAutoFilter(\SimpleXMLElement $filterColumn, Column $column) + { + if ($filterColumn->dynamicFilter) { + $column->setFilterType(Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER); + // We should only ever have one dynamic filter + foreach ($filterColumn->dynamicFilter as $filterRule) { + // Operator is undefined, but always treated as EQUAL + $column->createRule()->setRule( + null, + (string) $filterRule['val'], + (string) $filterRule['type'] + )->setRuleType(Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER); + if (isset($filterRule['val'])) { + $column->setAttribute('val', (string) $filterRule['val']); + } + if (isset($filterRule['maxVal'])) { + $column->setAttribute('maxVal', (string) $filterRule['maxVal']); + } + } + } + } + + private function readTopTenAutoFilter(\SimpleXMLElement $filterColumn, Column $column) + { + if ($filterColumn->top10) { + $column->setFilterType(Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER); + // We should only ever have one top10 filter + foreach ($filterColumn->top10 as $filterRule) { + $column->createRule()->setRule( + (((isset($filterRule['percent'])) && ($filterRule['percent'] == 1)) + ? Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT + : Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE + ), + (string) $filterRule['val'], + (((isset($filterRule['top'])) && ($filterRule['top'] == 1)) + ? Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP + : Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM + ) + )->setRuleType(Rule::AUTOFILTER_RULETYPE_TOPTENFILTER); + } + } + } +} diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/BaseParserClass.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/BaseParserClass.php new file mode 100644 index 00000000000..1679f01f9f1 --- /dev/null +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/BaseParserClass.php @@ -0,0 +1,19 @@ +worksheet = $workSheet; + $this->worksheetXml = $worksheetXml; + } + + /** + * Set Worksheet column attributes by attributes array passed. + * + * @param string $columnAddress A, B, ... DX, ... + * @param array $columnAttributes array of attributes (indexes are attribute name, values are value) + * 'xfIndex', 'visible', 'collapsed', 'outlineLevel', 'width', ... ? + */ + private function setColumnAttributes($columnAddress, array $columnAttributes) + { + if (isset($columnAttributes['xfIndex'])) { + $this->worksheet->getColumnDimension($columnAddress)->setXfIndex($columnAttributes['xfIndex']); + } + if (isset($columnAttributes['visible'])) { + $this->worksheet->getColumnDimension($columnAddress)->setVisible($columnAttributes['visible']); + } + if (isset($columnAttributes['collapsed'])) { + $this->worksheet->getColumnDimension($columnAddress)->setCollapsed($columnAttributes['collapsed']); + } + if (isset($columnAttributes['outlineLevel'])) { + $this->worksheet->getColumnDimension($columnAddress)->setOutlineLevel($columnAttributes['outlineLevel']); + } + if (isset($columnAttributes['width'])) { + $this->worksheet->getColumnDimension($columnAddress)->setWidth($columnAttributes['width']); + } + } + + /** + * Set Worksheet row attributes by attributes array passed. + * + * @param int $rowNumber 1, 2, 3, ... 99, ... + * @param array $rowAttributes array of attributes (indexes are attribute name, values are value) + * 'xfIndex', 'visible', 'collapsed', 'outlineLevel', 'rowHeight', ... ? + */ + private function setRowAttributes($rowNumber, array $rowAttributes) + { + if (isset($rowAttributes['xfIndex'])) { + $this->worksheet->getRowDimension($rowNumber)->setXfIndex($rowAttributes['xfIndex']); + } + if (isset($rowAttributes['visible'])) { + $this->worksheet->getRowDimension($rowNumber)->setVisible($rowAttributes['visible']); + } + if (isset($rowAttributes['collapsed'])) { + $this->worksheet->getRowDimension($rowNumber)->setCollapsed($rowAttributes['collapsed']); + } + if (isset($rowAttributes['outlineLevel'])) { + $this->worksheet->getRowDimension($rowNumber)->setOutlineLevel($rowAttributes['outlineLevel']); + } + if (isset($rowAttributes['rowHeight'])) { + $this->worksheet->getRowDimension($rowNumber)->setRowHeight($rowAttributes['rowHeight']); + } + } + + /** + * @param IReadFilter $readFilter + * @param bool $readDataOnly + */ + public function load(IReadFilter $readFilter = null, $readDataOnly = false) + { + if ($this->worksheetXml === null) { + return; + } + + $columnsAttributes = []; + $rowsAttributes = []; + if (isset($this->worksheetXml->cols)) { + $columnsAttributes = $this->readColumnAttributes($this->worksheetXml->cols, $readDataOnly); + } + + if ($this->worksheetXml->sheetData && $this->worksheetXml->sheetData->row) { + $rowsAttributes = $this->readRowAttributes($this->worksheetXml->sheetData->row, $readDataOnly); + } + + // set columns/rows attributes + $columnsAttributesAreSet = []; + foreach ($columnsAttributes as $columnCoordinate => $columnAttributes) { + if ($readFilter === null || + !$this->isFilteredColumn($readFilter, $columnCoordinate, $rowsAttributes)) { + if (!isset($columnsAttributesAreSet[$columnCoordinate])) { + $this->setColumnAttributes($columnCoordinate, $columnAttributes); + $columnsAttributesAreSet[$columnCoordinate] = true; + } + } + } + + $rowsAttributesAreSet = []; + foreach ($rowsAttributes as $rowCoordinate => $rowAttributes) { + if ($readFilter === null || + !$this->isFilteredRow($readFilter, $rowCoordinate, $columnsAttributes)) { + if (!isset($rowsAttributesAreSet[$rowCoordinate])) { + $this->setRowAttributes($rowCoordinate, $rowAttributes); + $rowsAttributesAreSet[$rowCoordinate] = true; + } + } + } + } + + private function isFilteredColumn(IReadFilter $readFilter, $columnCoordinate, array $rowsAttributes) + { + foreach ($rowsAttributes as $rowCoordinate => $rowAttributes) { + if (!$readFilter->readCell($columnCoordinate, $rowCoordinate, $this->worksheet->getTitle())) { + return true; + } + } + + return false; + } + + private function readColumnAttributes(\SimpleXMLElement $worksheetCols, $readDataOnly) + { + $columnAttributes = []; + + foreach ($worksheetCols->col as $column) { + $startColumn = Coordinate::stringFromColumnIndex((int) $column['min']); + $endColumn = Coordinate::stringFromColumnIndex((int) $column['max']); + ++$endColumn; + for ($columnAddress = $startColumn; $columnAddress !== $endColumn; ++$columnAddress) { + $columnAttributes[$columnAddress] = $this->readColumnRangeAttributes($column, $readDataOnly); + + if ((int) ($column['max']) == 16384) { + break; + } + } + } + + return $columnAttributes; + } + + private function readColumnRangeAttributes(\SimpleXMLElement $column, $readDataOnly) + { + $columnAttributes = []; + + if ($column['style'] && !$readDataOnly) { + $columnAttributes['xfIndex'] = (int) $column['style']; + } + if (self::boolean($column['hidden'])) { + $columnAttributes['visible'] = false; + } + if (self::boolean($column['collapsed'])) { + $columnAttributes['collapsed'] = true; + } + if (((int) $column['outlineLevel']) > 0) { + $columnAttributes['outlineLevel'] = (int) $column['outlineLevel']; + } + $columnAttributes['width'] = (float) $column['width']; + + return $columnAttributes; + } + + private function isFilteredRow(IReadFilter $readFilter, $rowCoordinate, array $columnsAttributes) + { + foreach ($columnsAttributes as $columnCoordinate => $columnAttributes) { + if (!$readFilter->readCell($columnCoordinate, $rowCoordinate, $this->worksheet->getTitle())) { + return true; + } + } + + return false; + } + + private function readRowAttributes(\SimpleXMLElement $worksheetRow, $readDataOnly) + { + $rowAttributes = []; + + foreach ($worksheetRow as $row) { + if ($row['ht'] && !$readDataOnly) { + $rowAttributes[(int) $row['r']]['rowHeight'] = (float) $row['ht']; + } + if (self::boolean($row['hidden'])) { + $rowAttributes[(int) $row['r']]['visible'] = false; + } + if (self::boolean($row['collapsed'])) { + $rowAttributes[(int) $row['r']]['collapsed'] = true; + } + if ((int) $row['outlineLevel'] > 0) { + $rowAttributes[(int) $row['r']]['outlineLevel'] = (int) $row['outlineLevel']; + } + if ($row['s'] && !$readDataOnly) { + $rowAttributes[(int) $row['r']]['xfIndex'] = (int) $row['s']; + } + } + + return $rowAttributes; + } +} diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php new file mode 100644 index 00000000000..b3de5d1cde6 --- /dev/null +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php @@ -0,0 +1,92 @@ +worksheet = $workSheet; + $this->worksheetXml = $worksheetXml; + $this->dxfs = $dxfs; + } + + public function load() + { + $this->setConditionalStyles( + $this->worksheet, + $this->readConditionalStyles($this->worksheetXml) + ); + } + + private function readConditionalStyles($xmlSheet) + { + $conditionals = []; + foreach ($xmlSheet->conditionalFormatting as $conditional) { + foreach ($conditional->cfRule as $cfRule) { + if (((string) $cfRule['type'] == Conditional::CONDITION_NONE + || (string) $cfRule['type'] == Conditional::CONDITION_CELLIS + || (string) $cfRule['type'] == Conditional::CONDITION_CONTAINSTEXT + || (string) $cfRule['type'] == Conditional::CONDITION_EXPRESSION) + && isset($this->dxfs[(int) ($cfRule['dxfId'])])) { + $conditionals[(string) $conditional['sqref']][(int) ($cfRule['priority'])] = $cfRule; + } + } + } + + return $conditionals; + } + + private function setConditionalStyles(Worksheet $worksheet, array $conditionals) + { + foreach ($conditionals as $ref => $cfRules) { + ksort($cfRules); + $conditionalStyles = $this->readStyleRules($cfRules); + + // Extract all cell references in $ref + $cellBlocks = explode(' ', str_replace('$', '', strtoupper($ref))); + foreach ($cellBlocks as $cellBlock) { + $worksheet->getStyle($cellBlock)->setConditionalStyles($conditionalStyles); + } + } + } + + private function readStyleRules($cfRules) + { + $conditionalStyles = []; + foreach ($cfRules as $cfRule) { + $objConditional = new Conditional(); + $objConditional->setConditionType((string) $cfRule['type']); + $objConditional->setOperatorType((string) $cfRule['operator']); + + if ((string) $cfRule['text'] != '') { + $objConditional->setText((string) $cfRule['text']); + } + + if (isset($cfRule['stopIfTrue']) && (int) $cfRule['stopIfTrue'] === 1) { + $objConditional->setStopIfTrue(true); + } + + if (count($cfRule->formula) > 1) { + foreach ($cfRule->formula as $formula) { + $objConditional->addCondition((string) $formula); + } + } else { + $objConditional->addCondition((string) $cfRule->formula); + } + $objConditional->setStyle(clone $this->dxfs[(int) ($cfRule['dxfId'])]); + $conditionalStyles[] = $objConditional; + } + + return $conditionalStyles; + } +} diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/DataValidations.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/DataValidations.php new file mode 100644 index 00000000000..4bb44129208 --- /dev/null +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/DataValidations.php @@ -0,0 +1,50 @@ +worksheet = $workSheet; + $this->worksheetXml = $worksheetXml; + } + + public function load() + { + foreach ($this->worksheetXml->dataValidations->dataValidation as $dataValidation) { + // Uppercase coordinate + $range = strtoupper($dataValidation['sqref']); + $rangeSet = explode(' ', $range); + foreach ($rangeSet as $range) { + $stRange = $this->worksheet->shrinkRangeToFit($range); + + // Extract all cell references in $range + foreach (Coordinate::extractAllCellReferencesInRange($stRange) as $reference) { + // Create validation + $docValidation = $this->worksheet->getCell($reference)->getDataValidation(); + $docValidation->setType((string) $dataValidation['type']); + $docValidation->setErrorStyle((string) $dataValidation['errorStyle']); + $docValidation->setOperator((string) $dataValidation['operator']); + $docValidation->setAllowBlank($dataValidation['allowBlank'] != 0); + $docValidation->setShowDropDown($dataValidation['showDropDown'] == 0); + $docValidation->setShowInputMessage($dataValidation['showInputMessage'] != 0); + $docValidation->setShowErrorMessage($dataValidation['showErrorMessage'] != 0); + $docValidation->setErrorTitle((string) $dataValidation['errorTitle']); + $docValidation->setError((string) $dataValidation['error']); + $docValidation->setPromptTitle((string) $dataValidation['promptTitle']); + $docValidation->setPrompt((string) $dataValidation['prompt']); + $docValidation->setFormula1((string) $dataValidation->formula1); + $docValidation->setFormula2((string) $dataValidation->formula2); + } + } + } + } +} diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Hyperlinks.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Hyperlinks.php new file mode 100644 index 00000000000..400b272528c --- /dev/null +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Hyperlinks.php @@ -0,0 +1,58 @@ +worksheet = $workSheet; + } + + public function readHyperlinks(\SimpleXMLElement $relsWorksheet) + { + foreach ($relsWorksheet->Relationship as $element) { + if ($element['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink') { + $this->hyperlinks[(string) $element['Id']] = (string) $element['Target']; + } + } + } + + public function setHyperlinks(\SimpleXMLElement $worksheetXml) + { + foreach ($worksheetXml->hyperlink as $hyperlink) { + $this->setHyperlink($hyperlink, $this->worksheet); + } + } + + private function setHyperlink(\SimpleXMLElement $hyperlink, Worksheet $worksheet) + { + // Link url + $linkRel = $hyperlink->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'); + + foreach (Coordinate::extractAllCellReferencesInRange($hyperlink['ref']) as $cellReference) { + $cell = $worksheet->getCell($cellReference); + if (isset($linkRel['id'])) { + $hyperlinkUrl = $this->hyperlinks[(string) $linkRel['id']]; + if (isset($hyperlink['location'])) { + $hyperlinkUrl .= '#' . (string) $hyperlink['location']; + } + $cell->getHyperlink()->setUrl($hyperlinkUrl); + } elseif (isset($hyperlink['location'])) { + $cell->getHyperlink()->setUrl('sheet://' . (string) $hyperlink['location']); + } + + // Tooltip + if (isset($hyperlink['tooltip'])) { + $cell->getHyperlink()->setTooltip((string) $hyperlink['tooltip']); + } + } + } +} diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/PageSetup.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/PageSetup.php new file mode 100644 index 00000000000..6f286769c0e --- /dev/null +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/PageSetup.php @@ -0,0 +1,150 @@ +worksheet = $workSheet; + $this->worksheetXml = $worksheetXml; + } + + public function load(array $unparsedLoadedData) + { + if (!$this->worksheetXml) { + return $unparsedLoadedData; + } + + $this->margins($this->worksheetXml, $this->worksheet); + $unparsedLoadedData = $this->pageSetup($this->worksheetXml, $this->worksheet, $unparsedLoadedData); + $this->headerFooter($this->worksheetXml, $this->worksheet); + $this->pageBreaks($this->worksheetXml, $this->worksheet); + + return $unparsedLoadedData; + } + + private function margins(\SimpleXMLElement $xmlSheet, Worksheet $worksheet) + { + if ($xmlSheet->pageMargins) { + $docPageMargins = $worksheet->getPageMargins(); + $docPageMargins->setLeft((float) ($xmlSheet->pageMargins['left'])); + $docPageMargins->setRight((float) ($xmlSheet->pageMargins['right'])); + $docPageMargins->setTop((float) ($xmlSheet->pageMargins['top'])); + $docPageMargins->setBottom((float) ($xmlSheet->pageMargins['bottom'])); + $docPageMargins->setHeader((float) ($xmlSheet->pageMargins['header'])); + $docPageMargins->setFooter((float) ($xmlSheet->pageMargins['footer'])); + } + } + + private function pageSetup(\SimpleXMLElement $xmlSheet, Worksheet $worksheet, array $unparsedLoadedData) + { + if ($xmlSheet->pageSetup) { + $docPageSetup = $worksheet->getPageSetup(); + + if (isset($xmlSheet->pageSetup['orientation'])) { + $docPageSetup->setOrientation((string) $xmlSheet->pageSetup['orientation']); + } + if (isset($xmlSheet->pageSetup['paperSize'])) { + $docPageSetup->setPaperSize((int) ($xmlSheet->pageSetup['paperSize'])); + } + if (isset($xmlSheet->pageSetup['scale'])) { + $docPageSetup->setScale((int) ($xmlSheet->pageSetup['scale']), false); + } + if (isset($xmlSheet->pageSetup['fitToHeight']) && (int) ($xmlSheet->pageSetup['fitToHeight']) >= 0) { + $docPageSetup->setFitToHeight((int) ($xmlSheet->pageSetup['fitToHeight']), false); + } + if (isset($xmlSheet->pageSetup['fitToWidth']) && (int) ($xmlSheet->pageSetup['fitToWidth']) >= 0) { + $docPageSetup->setFitToWidth((int) ($xmlSheet->pageSetup['fitToWidth']), false); + } + if (isset($xmlSheet->pageSetup['firstPageNumber'], $xmlSheet->pageSetup['useFirstPageNumber']) && + self::boolean((string) $xmlSheet->pageSetup['useFirstPageNumber'])) { + $docPageSetup->setFirstPageNumber((int) ($xmlSheet->pageSetup['firstPageNumber'])); + } + + $relAttributes = $xmlSheet->pageSetup->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'); + if (isset($relAttributes['id'])) { + $unparsedLoadedData['sheets'][$worksheet->getCodeName()]['pageSetupRelId'] = (string) $relAttributes['id']; + } + } + + return $unparsedLoadedData; + } + + private function headerFooter(\SimpleXMLElement $xmlSheet, Worksheet $worksheet) + { + if ($xmlSheet->headerFooter) { + $docHeaderFooter = $worksheet->getHeaderFooter(); + + if (isset($xmlSheet->headerFooter['differentOddEven']) && + self::boolean((string) $xmlSheet->headerFooter['differentOddEven'])) { + $docHeaderFooter->setDifferentOddEven(true); + } else { + $docHeaderFooter->setDifferentOddEven(false); + } + if (isset($xmlSheet->headerFooter['differentFirst']) && + self::boolean((string) $xmlSheet->headerFooter['differentFirst'])) { + $docHeaderFooter->setDifferentFirst(true); + } else { + $docHeaderFooter->setDifferentFirst(false); + } + if (isset($xmlSheet->headerFooter['scaleWithDoc']) && + !self::boolean((string) $xmlSheet->headerFooter['scaleWithDoc'])) { + $docHeaderFooter->setScaleWithDocument(false); + } else { + $docHeaderFooter->setScaleWithDocument(true); + } + if (isset($xmlSheet->headerFooter['alignWithMargins']) && + !self::boolean((string) $xmlSheet->headerFooter['alignWithMargins'])) { + $docHeaderFooter->setAlignWithMargins(false); + } else { + $docHeaderFooter->setAlignWithMargins(true); + } + + $docHeaderFooter->setOddHeader((string) $xmlSheet->headerFooter->oddHeader); + $docHeaderFooter->setOddFooter((string) $xmlSheet->headerFooter->oddFooter); + $docHeaderFooter->setEvenHeader((string) $xmlSheet->headerFooter->evenHeader); + $docHeaderFooter->setEvenFooter((string) $xmlSheet->headerFooter->evenFooter); + $docHeaderFooter->setFirstHeader((string) $xmlSheet->headerFooter->firstHeader); + $docHeaderFooter->setFirstFooter((string) $xmlSheet->headerFooter->firstFooter); + } + } + + private function pageBreaks(\SimpleXMLElement $xmlSheet, Worksheet $worksheet) + { + if ($xmlSheet->rowBreaks && $xmlSheet->rowBreaks->brk) { + $this->rowBreaks($xmlSheet, $worksheet); + } + if ($xmlSheet->colBreaks && $xmlSheet->colBreaks->brk) { + $this->columnBreaks($xmlSheet, $worksheet); + } + } + + private function rowBreaks(\SimpleXMLElement $xmlSheet, Worksheet $worksheet) + { + foreach ($xmlSheet->rowBreaks->brk as $brk) { + if ($brk['man']) { + $worksheet->setBreak("A{$brk['id']}", Worksheet::BREAK_ROW); + } + } + } + + private function columnBreaks(\SimpleXMLElement $xmlSheet, Worksheet $worksheet) + { + foreach ($xmlSheet->colBreaks->brk as $brk) { + if ($brk['man']) { + $worksheet->setBreak( + Coordinate::stringFromColumnIndex(((int) $brk['id']) + 1) . '1', + Worksheet::BREAK_COLUMN + ); + } + } + } +} diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Properties.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Properties.php new file mode 100644 index 00000000000..bc6bba2cdb2 --- /dev/null +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Properties.php @@ -0,0 +1,91 @@ +securityScanner = $securityScanner; + $this->docProps = $docProps; + } + + private function extractPropertyData($propertyData) + { + return simplexml_load_string( + $this->securityScanner->scan($propertyData), + 'SimpleXMLElement', + Settings::getLibXmlLoaderOptions() + ); + } + + public function readCoreProperties($propertyData) + { + $xmlCore = $this->extractPropertyData($propertyData); + + if (is_object($xmlCore)) { + $xmlCore->registerXPathNamespace('dc', 'http://purl.org/dc/elements/1.1/'); + $xmlCore->registerXPathNamespace('dcterms', 'http://purl.org/dc/terms/'); + $xmlCore->registerXPathNamespace('cp', 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties'); + + $this->docProps->setCreator((string) self::getArrayItem($xmlCore->xpath('dc:creator'))); + $this->docProps->setLastModifiedBy((string) self::getArrayItem($xmlCore->xpath('cp:lastModifiedBy'))); + $this->docProps->setCreated(strtotime(self::getArrayItem($xmlCore->xpath('dcterms:created')))); //! respect xsi:type + $this->docProps->setModified(strtotime(self::getArrayItem($xmlCore->xpath('dcterms:modified')))); //! respect xsi:type + $this->docProps->setTitle((string) self::getArrayItem($xmlCore->xpath('dc:title'))); + $this->docProps->setDescription((string) self::getArrayItem($xmlCore->xpath('dc:description'))); + $this->docProps->setSubject((string) self::getArrayItem($xmlCore->xpath('dc:subject'))); + $this->docProps->setKeywords((string) self::getArrayItem($xmlCore->xpath('cp:keywords'))); + $this->docProps->setCategory((string) self::getArrayItem($xmlCore->xpath('cp:category'))); + } + } + + public function readExtendedProperties($propertyData) + { + $xmlCore = $this->extractPropertyData($propertyData); + + if (is_object($xmlCore)) { + if (isset($xmlCore->Company)) { + $this->docProps->setCompany((string) $xmlCore->Company); + } + if (isset($xmlCore->Manager)) { + $this->docProps->setManager((string) $xmlCore->Manager); + } + } + } + + public function readCustomProperties($propertyData) + { + $xmlCore = $this->extractPropertyData($propertyData); + + if (is_object($xmlCore)) { + foreach ($xmlCore as $xmlProperty) { + /** @var \SimpleXMLElement $xmlProperty */ + $cellDataOfficeAttributes = $xmlProperty->attributes(); + if (isset($cellDataOfficeAttributes['name'])) { + $propertyName = (string) $cellDataOfficeAttributes['name']; + $cellDataOfficeChildren = $xmlProperty->children('http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'); + + $attributeType = $cellDataOfficeChildren->getName(); + $attributeValue = (string) $cellDataOfficeChildren->{$attributeType}; + $attributeValue = DocumentProperties::convertProperty($attributeValue, $attributeType); + $attributeType = DocumentProperties::convertPropertyType($attributeType); + $this->docProps->setCustomProperty($propertyName, $attributeValue, $attributeType); + } + } + } + } + + private static function getArrayItem(array $array, $key = 0) + { + return isset($array[$key]) ? $array[$key] : null; + } +} diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViewOptions.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViewOptions.php new file mode 100644 index 00000000000..eb61a5d306c --- /dev/null +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViewOptions.php @@ -0,0 +1,124 @@ +worksheet = $workSheet; + $this->worksheetXml = $worksheetXml; + } + + /** + * @param bool $readDataOnly + */ + public function load($readDataOnly = false) + { + if ($this->worksheetXml === null) { + return; + } + + if (isset($this->worksheetXml->sheetPr)) { + $this->tabColor($this->worksheetXml->sheetPr); + $this->codeName($this->worksheetXml->sheetPr); + $this->outlines($this->worksheetXml->sheetPr); + $this->pageSetup($this->worksheetXml->sheetPr); + } + + if (isset($this->worksheetXml->sheetFormatPr)) { + $this->sheetFormat($this->worksheetXml->sheetFormatPr); + } + + if (!$readDataOnly && isset($this->worksheetXml->printOptions)) { + $this->printOptions($this->worksheetXml->printOptions); + } + } + + private function tabColor(\SimpleXMLElement $sheetPr) + { + if (isset($sheetPr->tabColor, $sheetPr->tabColor['rgb'])) { + $this->worksheet->getTabColor()->setARGB((string) $sheetPr->tabColor['rgb']); + } + } + + private function codeName(\SimpleXMLElement $sheetPr) + { + if (isset($sheetPr['codeName'])) { + $this->worksheet->setCodeName((string) $sheetPr['codeName'], false); + } + } + + private function outlines(\SimpleXMLElement $sheetPr) + { + if (isset($sheetPr->outlinePr)) { + if (isset($sheetPr->outlinePr['summaryRight']) && + !self::boolean((string) $sheetPr->outlinePr['summaryRight'])) { + $this->worksheet->setShowSummaryRight(false); + } else { + $this->worksheet->setShowSummaryRight(true); + } + + if (isset($sheetPr->outlinePr['summaryBelow']) && + !self::boolean((string) $sheetPr->outlinePr['summaryBelow'])) { + $this->worksheet->setShowSummaryBelow(false); + } else { + $this->worksheet->setShowSummaryBelow(true); + } + } + } + + private function pageSetup(\SimpleXMLElement $sheetPr) + { + if (isset($sheetPr->pageSetUpPr)) { + if (isset($sheetPr->pageSetUpPr['fitToPage']) && + !self::boolean((string) $sheetPr->pageSetUpPr['fitToPage'])) { + $this->worksheet->getPageSetup()->setFitToPage(false); + } else { + $this->worksheet->getPageSetup()->setFitToPage(true); + } + } + } + + private function sheetFormat(\SimpleXMLElement $sheetFormatPr) + { + if (isset($sheetFormatPr['customHeight']) && + self::boolean((string) $sheetFormatPr['customHeight']) && + isset($sheetFormatPr['defaultRowHeight'])) { + $this->worksheet->getDefaultRowDimension() + ->setRowHeight((float) $sheetFormatPr['defaultRowHeight']); + } + + if (isset($sheetFormatPr['defaultColWidth'])) { + $this->worksheet->getDefaultColumnDimension() + ->setWidth((float) $sheetFormatPr['defaultColWidth']); + } + + if (isset($sheetFormatPr['zeroHeight']) && + ((string) $sheetFormatPr['zeroHeight'] === '1')) { + $this->worksheet->getDefaultRowDimension()->setZeroHeight(true); + } + } + + private function printOptions(\SimpleXMLElement $printOptions) + { + if (self::boolean((string) $printOptions['gridLinesSet'])) { + $this->worksheet->setShowGridlines(true); + } + if (self::boolean((string) $printOptions['gridLines'])) { + $this->worksheet->setPrintGridlines(true); + } + if (self::boolean((string) $printOptions['horizontalCentered'])) { + $this->worksheet->getPageSetup()->setHorizontalCentered(true); + } + if (self::boolean((string) $printOptions['verticalCentered'])) { + $this->worksheet->getPageSetup()->setVerticalCentered(true); + } + } +} diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViews.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViews.php new file mode 100644 index 00000000000..2caaec3108e --- /dev/null +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViews.php @@ -0,0 +1,127 @@ +sheetViewXml = $sheetViewXml; + $this->worksheet = $workSheet; + } + + public function load() + { + $this->zoomScale(); + $this->view(); + $this->gridLines(); + $this->headers(); + $this->direction(); + + if (isset($this->sheetViewXml->pane)) { + $this->pane(); + } + if (isset($this->sheetViewXml->selection, $this->sheetViewXml->selection['sqref'])) { + $this->selection(); + } + } + + private function zoomScale() + { + if (isset($this->sheetViewXml['zoomScale'])) { + $zoomScale = (int) ($this->sheetViewXml['zoomScale']); + if ($zoomScale <= 0) { + // setZoomScale will throw an Exception if the scale is less than or equals 0 + // that is OK when manually creating documents, but we should be able to read all documents + $zoomScale = 100; + } + + $this->worksheet->getSheetView()->setZoomScale($zoomScale); + } + + if (isset($this->sheetViewXml['zoomScaleNormal'])) { + $zoomScaleNormal = (int) ($this->sheetViewXml['zoomScaleNormal']); + if ($zoomScaleNormal <= 0) { + // setZoomScaleNormal will throw an Exception if the scale is less than or equals 0 + // that is OK when manually creating documents, but we should be able to read all documents + $zoomScaleNormal = 100; + } + + $this->worksheet->getSheetView()->setZoomScaleNormal($zoomScaleNormal); + } + } + + private function view() + { + if (isset($this->sheetViewXml['view'])) { + $this->worksheet->getSheetView()->setView((string) $this->sheetViewXml['view']); + } + } + + private function gridLines() + { + if (isset($this->sheetViewXml['showGridLines'])) { + $this->worksheet->setShowGridLines( + self::boolean((string) $this->sheetViewXml['showGridLines']) + ); + } + } + + private function headers() + { + if (isset($this->sheetViewXml['showRowColHeaders'])) { + $this->worksheet->setShowRowColHeaders( + self::boolean((string) $this->sheetViewXml['showRowColHeaders']) + ); + } + } + + private function direction() + { + if (isset($this->sheetViewXml['rightToLeft'])) { + $this->worksheet->setRightToLeft( + self::boolean((string) $this->sheetViewXml['rightToLeft']) + ); + } + } + + private function pane() + { + $xSplit = 0; + $ySplit = 0; + $topLeftCell = null; + + if (isset($this->sheetViewXml->pane['xSplit'])) { + $xSplit = (int) ($this->sheetViewXml->pane['xSplit']); + } + + if (isset($this->sheetViewXml->pane['ySplit'])) { + $ySplit = (int) ($this->sheetViewXml->pane['ySplit']); + } + + if (isset($this->sheetViewXml->pane['topLeftCell'])) { + $topLeftCell = (string) $this->sheetViewXml->pane['topLeftCell']; + } + + $this->worksheet->freezePane( + Coordinate::stringFromColumnIndex($xSplit + 1) . ($ySplit + 1), + $topLeftCell + ); + } + + private function selection() + { + $sqref = (string) $this->sheetViewXml->selection['sqref']; + $sqref = explode(' ', $sqref); + $sqref = $sqref[0]; + + $this->worksheet->setSelectedCells($sqref); + } +} diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php new file mode 100644 index 00000000000..c06564a3d11 --- /dev/null +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php @@ -0,0 +1,265 @@ +styleXml = $styleXml; + } + + public function setStyleBaseData(Theme $theme = null, $styles = [], $cellStyles = []) + { + self::$theme = $theme; + $this->styles = $styles; + $this->cellStyles = $cellStyles; + } + + private static function readFontStyle(Font $fontStyle, \SimpleXMLElement $fontStyleXml) + { + $fontStyle->setName((string) $fontStyleXml->name['val']); + $fontStyle->setSize((float) $fontStyleXml->sz['val']); + + if (isset($fontStyleXml->b)) { + $fontStyle->setBold(!isset($fontStyleXml->b['val']) || self::boolean((string) $fontStyleXml->b['val'])); + } + if (isset($fontStyleXml->i)) { + $fontStyle->setItalic(!isset($fontStyleXml->i['val']) || self::boolean((string) $fontStyleXml->i['val'])); + } + if (isset($fontStyleXml->strike)) { + $fontStyle->setStrikethrough(!isset($fontStyleXml->strike['val']) || self::boolean((string) $fontStyleXml->strike['val'])); + } + $fontStyle->getColor()->setARGB(self::readColor($fontStyleXml->color)); + + if (isset($fontStyleXml->u) && !isset($fontStyleXml->u['val'])) { + $fontStyle->setUnderline(Font::UNDERLINE_SINGLE); + } elseif (isset($fontStyleXml->u, $fontStyleXml->u['val'])) { + $fontStyle->setUnderline((string) $fontStyleXml->u['val']); + } + + if (isset($fontStyleXml->vertAlign, $fontStyleXml->vertAlign['val'])) { + $verticalAlign = strtolower((string) $fontStyleXml->vertAlign['val']); + if ($verticalAlign === 'superscript') { + $fontStyle->setSuperscript(true); + } + if ($verticalAlign === 'subscript') { + $fontStyle->setSubscript(true); + } + } + } + + private static function readFillStyle(Fill $fillStyle, \SimpleXMLElement $fillStyleXml) + { + if ($fillStyleXml->gradientFill) { + /** @var \SimpleXMLElement $gradientFill */ + $gradientFill = $fillStyleXml->gradientFill[0]; + if (!empty($gradientFill['type'])) { + $fillStyle->setFillType((string) $gradientFill['type']); + } + $fillStyle->setRotation((float) ($gradientFill['degree'])); + $gradientFill->registerXPathNamespace('sml', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'); + $fillStyle->getStartColor()->setARGB(self::readColor(self::getArrayItem($gradientFill->xpath('sml:stop[@position=0]'))->color)); + $fillStyle->getEndColor()->setARGB(self::readColor(self::getArrayItem($gradientFill->xpath('sml:stop[@position=1]'))->color)); + } elseif ($fillStyleXml->patternFill) { + $patternType = (string) $fillStyleXml->patternFill['patternType'] != '' ? (string) $fillStyleXml->patternFill['patternType'] : 'solid'; + $fillStyle->setFillType($patternType); + if ($fillStyleXml->patternFill->fgColor) { + $fillStyle->getStartColor()->setARGB(self::readColor($fillStyleXml->patternFill->fgColor, true)); + } else { + $fillStyle->getStartColor()->setARGB('FF000000'); + } + if ($fillStyleXml->patternFill->bgColor) { + $fillStyle->getEndColor()->setARGB(self::readColor($fillStyleXml->patternFill->bgColor, true)); + } + } + } + + private static function readBorderStyle(Borders $borderStyle, \SimpleXMLElement $borderStyleXml) + { + $diagonalUp = self::boolean((string) $borderStyleXml['diagonalUp']); + $diagonalDown = self::boolean((string) $borderStyleXml['diagonalDown']); + if (!$diagonalUp && !$diagonalDown) { + $borderStyle->setDiagonalDirection(Borders::DIAGONAL_NONE); + } elseif ($diagonalUp && !$diagonalDown) { + $borderStyle->setDiagonalDirection(Borders::DIAGONAL_UP); + } elseif (!$diagonalUp && $diagonalDown) { + $borderStyle->setDiagonalDirection(Borders::DIAGONAL_DOWN); + } else { + $borderStyle->setDiagonalDirection(Borders::DIAGONAL_BOTH); + } + + self::readBorder($borderStyle->getLeft(), $borderStyleXml->left); + self::readBorder($borderStyle->getRight(), $borderStyleXml->right); + self::readBorder($borderStyle->getTop(), $borderStyleXml->top); + self::readBorder($borderStyle->getBottom(), $borderStyleXml->bottom); + self::readBorder($borderStyle->getDiagonal(), $borderStyleXml->diagonal); + } + + private static function readBorder(Border $border, \SimpleXMLElement $borderXml) + { + if (isset($borderXml['style'])) { + $border->setBorderStyle((string) $borderXml['style']); + } + if (isset($borderXml->color)) { + $border->getColor()->setARGB(self::readColor($borderXml->color)); + } + } + + private static function readAlignmentStyle(Alignment $alignment, \SimpleXMLElement $alignmentXml) + { + $alignment->setHorizontal((string) $alignmentXml->alignment['horizontal']); + $alignment->setVertical((string) $alignmentXml->alignment['vertical']); + + $textRotation = 0; + if ((int) $alignmentXml->alignment['textRotation'] <= 90) { + $textRotation = (int) $alignmentXml->alignment['textRotation']; + } elseif ((int) $alignmentXml->alignment['textRotation'] > 90) { + $textRotation = 90 - (int) $alignmentXml->alignment['textRotation']; + } + + $alignment->setTextRotation((int) $textRotation); + $alignment->setWrapText(self::boolean((string) $alignmentXml->alignment['wrapText'])); + $alignment->setShrinkToFit(self::boolean((string) $alignmentXml->alignment['shrinkToFit'])); + $alignment->setIndent((int) ((string) $alignmentXml->alignment['indent']) > 0 ? (int) ((string) $alignmentXml->alignment['indent']) : 0); + $alignment->setReadOrder((int) ((string) $alignmentXml->alignment['readingOrder']) > 0 ? (int) ((string) $alignmentXml->alignment['readingOrder']) : 0); + } + + private function readStyle(Style $docStyle, $style) + { + $docStyle->getNumberFormat()->setFormatCode($style->numFmt); + + if (isset($style->font)) { + self::readFontStyle($docStyle->getFont(), $style->font); + } + + if (isset($style->fill)) { + self::readFillStyle($docStyle->getFill(), $style->fill); + } + + if (isset($style->border)) { + self::readBorderStyle($docStyle->getBorders(), $style->border); + } + + if (isset($style->alignment)) { + self::readAlignmentStyle($docStyle->getAlignment(), $style->alignment); + } + + // protection + if (isset($style->protection)) { + $this->readProtectionLocked($docStyle, $style); + $this->readProtectionHidden($docStyle, $style); + } + + // top-level style settings + if (isset($style->quotePrefix)) { + $docStyle->setQuotePrefix(true); + } + } + + private function readProtectionLocked(Style $docStyle, $style) + { + if (isset($style->protection['locked'])) { + if (self::boolean((string) $style->protection['locked'])) { + $docStyle->getProtection()->setLocked(Protection::PROTECTION_PROTECTED); + } else { + $docStyle->getProtection()->setLocked(Protection::PROTECTION_UNPROTECTED); + } + } + } + + private function readProtectionHidden(Style $docStyle, $style) + { + if (isset($style->protection['hidden'])) { + if (self::boolean((string) $style->protection['hidden'])) { + $docStyle->getProtection()->setHidden(Protection::PROTECTION_PROTECTED); + } else { + $docStyle->getProtection()->setHidden(Protection::PROTECTION_UNPROTECTED); + } + } + } + + private static function readColor($color, $background = false) + { + if (isset($color['rgb'])) { + return (string) $color['rgb']; + } elseif (isset($color['indexed'])) { + return Color::indexedColor($color['indexed'] - 7, $background)->getARGB(); + } elseif (isset($color['theme'])) { + if (self::$theme !== null) { + $returnColour = self::$theme->getColourByIndex((int) $color['theme']); + if (isset($color['tint'])) { + $tintAdjust = (float) $color['tint']; + $returnColour = Color::changeBrightness($returnColour, $tintAdjust); + } + + return 'FF' . $returnColour; + } + } + + return ($background) ? 'FFFFFFFF' : 'FF000000'; + } + + public function dxfs($readDataOnly = false) + { + $dxfs = []; + if (!$readDataOnly && $this->styleXml) { + // Conditional Styles + if ($this->styleXml->dxfs) { + foreach ($this->styleXml->dxfs->dxf as $dxf) { + $style = new Style(false, true); + $this->readStyle($style, $dxf); + $dxfs[] = $style; + } + } + // Cell Styles + if ($this->styleXml->cellStyles) { + foreach ($this->styleXml->cellStyles->cellStyle as $cellStyle) { + if ((int) ($cellStyle['builtinId']) == 0) { + if (isset($this->cellStyles[(int) ($cellStyle['xfId'])])) { + // Set default style + $style = new Style(); + $this->readStyle($style, $this->cellStyles[(int) ($cellStyle['xfId'])]); + + // normal style, currently not using it for anything + } + } + } + } + } + + return $dxfs; + } + + public function styles() + { + return $this->styles; + } + + private static function getArrayItem($array, $key = 0) + { + return isset($array[$key]) ? $array[$key] : null; + } +} diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php index 2b7959f47c1..8ab7a9c3954 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php @@ -41,7 +41,7 @@ class Xml extends BaseReader */ public function __construct() { - $this->readFilter = new DefaultReadFilter(); + parent::__construct(); $this->securityScanner = XmlScanner::getInstance($this); } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php index 54bc182a8eb..13dbe042a75 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php @@ -82,13 +82,13 @@ class ReferenceHelper */ public static function cellSort($a, $b) { - $ac = $bc = ''; - $ar = $br = 0; + // TODO Scrutinizer doesn't like sscanf($a, '%[A-Z]%d', $ac, $ar), and we can't use short list() syntax + // [$ac, $ar] = sscanf($a, '%[A-Z]%d') while retaining PHP 5.6 support. + // Switch when we drop support for 5.6 + list($ac, $ar) = sscanf($a, '%[A-Z]%d'); + list($bc, $br) = sscanf($b, '%[A-Z]%d'); - sscanf($a, '%[A-Z]%d', $ac, $ar); - sscanf($b, '%[A-Z]%d', $bc, $br); - - if ($ar == $br) { + if ($ar === $br) { return strcasecmp(strlen($ac) . $ac, strlen($bc) . $bc); } @@ -106,13 +106,13 @@ class ReferenceHelper */ public static function cellReverseSort($a, $b) { - $ac = $bc = ''; - $ar = $br = 0; + // TODO Scrutinizer doesn't like sscanf($a, '%[A-Z]%d', $ac, $ar), and we can't use short list() syntax + // [$ac, $ar] = sscanf($a, '%[A-Z]%d') while retaining PHP 5.6 support. + // Switch when we drop support for 5.6 + list($ac, $ar) = sscanf($a, '%[A-Z]%d'); + list($bc, $br) = sscanf($b, '%[A-Z]%d'); - sscanf($a, '%[A-Z]%d', $ac, $ar); - sscanf($b, '%[A-Z]%d', $bc, $br); - - if ($ar == $br) { + if ($ar === $br) { return 1 - strcasecmp(strlen($ac) . $ac, strlen($bc) . $bc); } @@ -625,7 +625,7 @@ class ReferenceHelper * Update references within formulas. * * @param string $pFormula Formula to update - * @param int $pBefore Insert before this one + * @param string $pBefore Insert before this one * @param int $pNumCols Number of columns to insert * @param int $pNumRows Number of rows to insert * @param string $sheetName Worksheet name/title diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php index 22196b7e0e2..c297dd682ea 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php @@ -24,6 +24,20 @@ class Settings */ private static $libXmlLoaderOptions = null; + /** + * Allow/disallow libxml_disable_entity_loader() call when not thread safe. + * Default behaviour is to do the check, but if you're running PHP versions + * 7.2 < 7.2.1 + * 7.1 < 7.1.13 + * 7.0 < 7.0.27 + * 5.6 ANY + * then you may need to disable this check to prevent unwanted behaviour in other threads + * SECURITY WARNING: Changing this flag is not recommended. + * + * @var bool + */ + private static $libXmlDisableEntityLoader = true; + /** * The cache implementation to be used for cell collection. * @@ -101,6 +115,34 @@ class Settings return self::$libXmlLoaderOptions; } + /** + * Enable/Disable the entity loader for libxml loader. + * Allow/disallow libxml_disable_entity_loader() call when not thread safe. + * Default behaviour is to do the check, but if you're running PHP versions + * 7.2 < 7.2.1 + * 7.1 < 7.1.13 + * 7.0 < 7.0.27 + * 5.6 ANY + * then you may need to disable this check to prevent unwanted behaviour in other threads + * SECURITY WARNING: Changing this flag to false is not recommended. + * + * @param bool $state + */ + public static function setLibXmlDisableEntityLoader($state) + { + self::$libXmlDisableEntityLoader = (bool) $state; + } + + /** + * Return the state of the entity loader (disabled/enabled) for libxml loader. + * + * @return bool $state + */ + public static function getLibXmlDisableEntityLoader() + { + return self::$libXmlDisableEntityLoader; + } + /** * Sets the implementation of cache that should be used for cell collection. * diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php index 91c3ee0e2ca..5d2deb32c95 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php @@ -192,7 +192,7 @@ class Date $interval = $days . ' days'; return $baseDate->modify($interval) - ->setTime($hours, $minutes, $seconds); + ->setTime((int) $hours, (int) $minutes, (int) $seconds); } /** @@ -244,12 +244,12 @@ class Date public static function dateTimeToExcel(DateTimeInterface $dateValue) { return self::formattedPHPToExcel( - $dateValue->format('Y'), - $dateValue->format('m'), - $dateValue->format('d'), - $dateValue->format('H'), - $dateValue->format('i'), - $dateValue->format('s') + (int) $dateValue->format('Y'), + (int) $dateValue->format('m'), + (int) $dateValue->format('d'), + (int) $dateValue->format('H'), + (int) $dateValue->format('i'), + (int) $dateValue->format('s') ); } @@ -325,11 +325,12 @@ class Date */ public static function isDateTime(Cell $pCell) { - return self::isDateTimeFormat( - $pCell->getWorksheet()->getStyle( - $pCell->getCoordinate() - )->getNumberFormat() - ); + return is_numeric($pCell->getValue()) && + self::isDateTimeFormat( + $pCell->getWorksheet()->getStyle( + $pCell->getCoordinate() + )->getNumberFormat() + ); } /** diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php index 2e9ec256734..f09fbc92adc 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php @@ -537,31 +537,37 @@ class OLE /** * Returns a timestamp from an OLE container's date. * - * @param int $string A binary string with the encoded date + * @param string $oleTimestamp A binary string with the encoded date * - * @return string The timestamp corresponding to the string + * @throws ReaderException + * + * @return int The Unix timestamp corresponding to the string */ - public static function OLE2LocalDate($string) + public static function OLE2LocalDate($oleTimestamp) { - if (strlen($string) != 8) { + if (strlen($oleTimestamp) != 8) { throw new ReaderException('Expecting 8 byte string'); } - // factor used for separating numbers into 4 bytes parts - $factor = pow(2, 32); - list(, $high_part) = unpack('V', substr($string, 4, 4)); - list(, $low_part) = unpack('V', substr($string, 0, 4)); + // convert to units of 100 ns since 1601: + $unpackedTimestamp = unpack('v4', $oleTimestamp); + $timestampHigh = (float) $unpackedTimestamp[4] * 65536 + (float) $unpackedTimestamp[3]; + $timestampLow = (float) $unpackedTimestamp[2] * 65536 + (float) $unpackedTimestamp[1]; - $big_date = ($high_part * $factor) + $low_part; - // translate to seconds - $big_date /= 10000000; + // translate to seconds since 1601: + $timestampHigh /= 10000000; + $timestampLow /= 10000000; - // days from 1-1-1601 until the beggining of UNIX era + // days from 1601 to 1970: $days = 134774; - // translate to seconds from beggining of UNIX era - $big_date -= $days * 24 * 3600; + // translate to seconds since 1970: + $unixTimestamp = floor(65536.0 * 65536.0 * $timestampHigh + $timestampLow - $days * 24 * 3600 + 0.5); - return floor($big_date); + if ((int) $unixTimestamp == $unixTimestamp) { + return (int) $unixTimestamp; + } + + return $unixTimestamp >= 0.0 ? PHP_INT_MAX : PHP_INT_MIN; } } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php index 03723d84d4e..5b57f4b71fe 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php @@ -113,7 +113,9 @@ class ExponentialBestFit extends BestFit */ public function __construct($yValues, $xValues = [], $const = true) { - if (parent::__construct($yValues, $xValues) !== false) { + parent::__construct($yValues, $xValues); + + if (!$this->error) { $this->exponentialRegression($yValues, $xValues, $const); } } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php index 367e9d6ec56..217f0964770 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php @@ -72,7 +72,9 @@ class LinearBestFit extends BestFit */ public function __construct($yValues, $xValues = [], $const = true) { - if (parent::__construct($yValues, $xValues) !== false) { + parent::__construct($yValues, $xValues); + + if (!$this->error) { $this->linearRegression($yValues, $xValues, $const); } } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php index 9092cef8215..96ca2ed8794 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php @@ -81,7 +81,9 @@ class LogarithmicBestFit extends BestFit */ public function __construct($yValues, $xValues = [], $const = true) { - if (parent::__construct($yValues, $xValues) !== false) { + parent::__construct($yValues, $xValues); + + if (!$this->error) { $this->logarithmicRegression($yValues, $xValues, $const); } } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php index afcf5f477e4..a1510491f73 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php @@ -182,7 +182,9 @@ class PolynomialBestFit extends BestFit */ public function __construct($order, $yValues, $xValues = [], $const = true) { - if (parent::__construct($yValues, $xValues) !== false) { + parent::__construct($yValues, $xValues); + + if (!$this->error) { if ($order < $this->valueCount) { $this->bestFitType .= '_' . $order; $this->order = $order; diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php index e1b3b8297cb..4eefec8265c 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php @@ -105,7 +105,9 @@ class PowerBestFit extends BestFit */ public function __construct($yValues, $xValues = [], $const = true) { - if (parent::__construct($yValues, $xValues) !== false) { + parent::__construct($yValues, $xValues); + + if (!$this->error) { $this->powerRegression($yValues, $xValues, $const); } } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php index 150f71b1e4f..8eadcbe8b1a 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php @@ -715,7 +715,7 @@ class Spreadsheet * * @param string $pName Sheet name * - * @return Worksheet + * @return null|Worksheet */ public function getSheetByName($pName) { diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php index b6b803787cd..37442249a50 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php @@ -49,6 +49,8 @@ class NumberFormat extends Supervisor const FORMAT_CURRENCY_USD = '$#,##0_-'; const FORMAT_CURRENCY_EUR_SIMPLE = '#,##0.00_-"€"'; const FORMAT_CURRENCY_EUR = '#,##0_-"€"'; + const FORMAT_ACCOUNTING_USD = '_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)'; + const FORMAT_ACCOUNTING_EUR = '_("€"* #,##0.00_);_("€"* \(#,##0.00\);_("€"* "-"??_);_(@_)'; /** * Excel built-in number formats. @@ -308,6 +310,22 @@ class NumberFormat extends Supervisor self::$builtInFormats[69] = 't# ?/?'; self::$builtInFormats[70] = 't# ??/??'; + // JPN + self::$builtInFormats[28] = '[$-411]ggge"年"m"月"d"日"'; + self::$builtInFormats[29] = '[$-411]ggge"年"m"月"d"日"'; + self::$builtInFormats[31] = 'yyyy"年"m"月"d"日"'; + self::$builtInFormats[32] = 'h"時"mm"分"'; + self::$builtInFormats[33] = 'h"時"mm"分"ss"秒"'; + self::$builtInFormats[34] = 'yyyy"年"m"月"'; + self::$builtInFormats[35] = 'm"月"d"日"'; + self::$builtInFormats[51] = '[$-411]ggge"年"m"月"d"日"'; + self::$builtInFormats[52] = 'yyyy"年"m"月"'; + self::$builtInFormats[53] = 'm"月"d"日"'; + self::$builtInFormats[54] = '[$-411]ggge"年"m"月"d"日"'; + self::$builtInFormats[55] = 'yyyy"年"m"月"'; + self::$builtInFormats[56] = 'm"月"d"日"'; + self::$builtInFormats[58] = '[$-411]ggge"年"m"月"d"日"'; + // Flip array (for faster lookups) self::$flippedBuiltInFormats = array_flip(self::$builtInFormats); } @@ -596,7 +614,7 @@ class NumberFormat extends Supervisor } // Convert any other escaped characters to quoted strings, e.g. (\T to "T") - $format = preg_replace('/(\\\([^ ]))(?=(?:[^"]|"[^"]*")*$)/u', '"${2}"', $format); + $format = preg_replace('/(\\\(((.)(?!((AM\/PM)|(A\/P))))|([^ ])))(?=(?:[^"]|"[^"]*")*$)/u', '"${2}"', $format); // Get the sections, there can be up to four sections, separated with a semi-colon (but only if not a quoted literal) $sections = preg_split('/(;)(?=(?:[^"]|"[^"]*")*$)/u', $format); diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php index 44e66323206..697fc97efc3 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php @@ -64,7 +64,7 @@ abstract class Dimension */ public function setVisible($pValue) { - $this->visible = $pValue; + $this->visible = (bool) $pValue; return $this; } @@ -119,7 +119,7 @@ abstract class Dimension */ public function setCollapsed($pValue) { - $this->collapsed = $pValue; + $this->collapsed = (bool) $pValue; return $this; } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowCellIterator.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowCellIterator.php index 59ef329c8b9..8510d402a35 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowCellIterator.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowCellIterator.php @@ -170,6 +170,16 @@ class RowCellIterator extends CellIterator return $this->currentColumnIndex <= $this->endColumnIndex && $this->currentColumnIndex >= $this->startColumnIndex; } + /** + * Return the current iterator position. + * + * @return int + */ + public function getCurrentColumnIndex() + { + return $this->currentColumnIndex; + } + /** * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary. * diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php index d0224037616..1e525a3fecb 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php @@ -1096,7 +1096,7 @@ class Worksheet implements IComparable * @param string $column Return the highest data row for the specified column, * or the highest data row of any column if no column letter is passed * - * @return string Highest row number that contains data + * @return int Highest row number that contains data */ public function getHighestDataRow($column = null) { @@ -2064,7 +2064,7 @@ class Worksheet implements IComparable /** * Insert a new column, updating all possible related data. * - * @param int $pBefore Insert before this one, eg: 'A' + * @param string $pBefore Insert before this one, eg: 'A' * @param int $pNumCols Number of columns to insert * * @throws Exception diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php index 122783f30c6..f13150d7eb3 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php @@ -35,27 +35,11 @@ abstract class BaseWriter implements IWriter */ private $diskCachingDirectory = './'; - /** - * Write charts in workbook? - * If this is true, then the Writer will write definitions for any charts that exist in the PhpSpreadsheet object. - * If false (the default) it will ignore any charts defined in the PhpSpreadsheet object. - * - * @return bool - */ public function getIncludeCharts() { return $this->includeCharts; } - /** - * Set write charts in workbook - * Set to true, to advise the Writer to include any charts that exist in the PhpSpreadsheet object. - * Set to false (the default) to ignore charts. - * - * @param bool $pValue - * - * @return IWriter - */ public function setIncludeCharts($pValue) { $this->includeCharts = (bool) $pValue; @@ -63,30 +47,11 @@ abstract class BaseWriter implements IWriter return $this; } - /** - * Get Pre-Calculate Formulas flag - * If this is true (the default), then the writer will recalculate all formulae in a workbook when saving, - * so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet - * viewer when opening the file - * If false, then formulae are not calculated on save. This is faster for saving in PhpSpreadsheet, but slower - * when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself. - * - * @return bool - */ public function getPreCalculateFormulas() { return $this->preCalculateFormulas; } - /** - * Set Pre-Calculate Formulas - * Set to true (the default) to advise the Writer to calculate all formulae on save - * Set to false to prevent precalculation of formulae on save. - * - * @param bool $pValue Pre-Calculate Formulas? - * - * @return IWriter - */ public function setPreCalculateFormulas($pValue) { $this->preCalculateFormulas = (bool) $pValue; @@ -94,26 +59,11 @@ abstract class BaseWriter implements IWriter return $this; } - /** - * Get use disk caching where possible? - * - * @return bool - */ public function getUseDiskCaching() { return $this->useDiskCaching; } - /** - * Set use disk caching where possible? - * - * @param bool $pValue - * @param string $pDirectory Disk caching directory - * - * @throws Exception when directory does not exist - * - * @return IWriter - */ public function setUseDiskCaching($pValue, $pDirectory = null) { $this->useDiskCaching = $pValue; @@ -129,11 +79,6 @@ abstract class BaseWriter implements IWriter return $this; } - /** - * Get disk caching directory. - * - * @return string - */ public function getDiskCachingDirectory() { return $this->diskCachingDirectory; diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/IWriter.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/IWriter.php index 9ce45a1946a..448b532fc2a 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/IWriter.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/IWriter.php @@ -13,6 +13,49 @@ interface IWriter */ public function __construct(Spreadsheet $spreadsheet); + /** + * Write charts in workbook? + * If this is true, then the Writer will write definitions for any charts that exist in the PhpSpreadsheet object. + * If false (the default) it will ignore any charts defined in the PhpSpreadsheet object. + * + * @return bool + */ + public function getIncludeCharts(); + + /** + * Set write charts in workbook + * Set to true, to advise the Writer to include any charts that exist in the PhpSpreadsheet object. + * Set to false (the default) to ignore charts. + * + * @param bool $pValue + * + * @return IWriter + */ + public function setIncludeCharts($pValue); + + /** + * Get Pre-Calculate Formulas flag + * If this is true (the default), then the writer will recalculate all formulae in a workbook when saving, + * so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet + * viewer when opening the file + * If false, then formulae are not calculated on save. This is faster for saving in PhpSpreadsheet, but slower + * when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself. + * + * @return bool + */ + public function getPreCalculateFormulas(); + + /** + * Set Pre-Calculate Formulas + * Set to true (the default) to advise the Writer to calculate all formulae on save + * Set to false to prevent precalculation of formulae on save. + * + * @param bool $pValue Pre-Calculate Formulas? + * + * @return IWriter + */ + public function setPreCalculateFormulas($pValue); + /** * Save PhpSpreadsheet to file. * @@ -21,4 +64,30 @@ interface IWriter * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ public function save($pFilename); + + /** + * Get use disk caching where possible? + * + * @return bool + */ + public function getUseDiskCaching(); + + /** + * Set use disk caching where possible? + * + * @param bool $pValue + * @param string $pDirectory Disk caching directory + * + * @throws Exception when directory does not exist + * + * @return IWriter + */ + public function setUseDiskCaching($pValue, $pDirectory = null); + + /** + * Get disk caching directory. + * + * @return string + */ + public function getDiskCachingDirectory(); } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Parser.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Parser.php index e87d09a2233..6049e32878b 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Parser.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Parser.php @@ -1009,7 +1009,7 @@ class Parser break; case '>': - if ($this->lookAhead == '=') { // it's a GE token + if ($this->lookAhead === '=') { // it's a GE token break; } @@ -1018,7 +1018,7 @@ class Parser break; case '<': // it's a LE or a NE token - if (($this->lookAhead == '=') or ($this->lookAhead == '>')) { + if (($this->lookAhead === '=') or ($this->lookAhead === '>')) { break; } @@ -1027,12 +1027,12 @@ class Parser break; default: // if it's a reference A1 or $A$1 or $A1 or A$1 - if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?\d+$/', $token) and !preg_match('/\d/', $this->lookAhead) and ($this->lookAhead != ':') and ($this->lookAhead != '.') and ($this->lookAhead != '!')) { + if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?\d+$/', $token) and !preg_match('/\d/', $this->lookAhead) and ($this->lookAhead !== ':') and ($this->lookAhead !== '.') and ($this->lookAhead !== '!')) { return $token; - } elseif (preg_match('/^' . self::REGEX_SHEET_TITLE_UNQUOTED . '(\\:' . self::REGEX_SHEET_TITLE_UNQUOTED . ')?\\!\$?[A-Ia-i]?[A-Za-z]\$?\\d+$/u', $token) and !preg_match('/\d/', $this->lookAhead) and ($this->lookAhead != ':') and ($this->lookAhead != '.')) { + } elseif (preg_match('/^' . self::REGEX_SHEET_TITLE_UNQUOTED . '(\\:' . self::REGEX_SHEET_TITLE_UNQUOTED . ')?\\!\$?[A-Ia-i]?[A-Za-z]\$?\\d+$/u', $token) and !preg_match('/\d/', $this->lookAhead) and ($this->lookAhead !== ':') and ($this->lookAhead !== '.')) { // If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1 or Sheet1!$A$1 or Sheet1:Sheet2!$A$1) return $token; - } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . '(\\:' . self::REGEX_SHEET_TITLE_QUOTED . ")?'\\!\\$?[A-Ia-i]?[A-Za-z]\\$?\\d+$/u", $token) and !preg_match('/\d/', $this->lookAhead) and ($this->lookAhead != ':') and ($this->lookAhead != '.')) { + } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . '(\\:' . self::REGEX_SHEET_TITLE_QUOTED . ")?'\\!\\$?[A-Ia-i]?[A-Za-z]\\$?\\d+$/u", $token) and !preg_match('/\d/', $this->lookAhead) and ($this->lookAhead !== ':') and ($this->lookAhead !== '.')) { // If it's an external reference ('Sheet1'!A1 or 'Sheet1:Sheet2'!A1 or 'Sheet1'!$A$1 or 'Sheet1:Sheet2'!$A$1) return $token; } elseif (preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?\d+:(\$)?[A-Ia-i]?[A-Za-z](\$)?\d+$/', $token) && !preg_match('/\d/', $this->lookAhead)) { @@ -1044,19 +1044,19 @@ class Parser } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . '(\\:' . self::REGEX_SHEET_TITLE_QUOTED . ")?'\\!\\$?([A-Ia-i]?[A-Za-z])?\\$?\\d+:\\$?([A-Ia-i]?[A-Za-z])?\\$?\\d+$/u", $token) and !preg_match('/\d/', $this->lookAhead)) { // If it's an external range like 'Sheet1'!A1:B2 or 'Sheet1:Sheet2'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1:Sheet2'!$A$1:$B$2 return $token; - } elseif (is_numeric($token) and (!is_numeric($token . $this->lookAhead) or ($this->lookAhead == '')) and ($this->lookAhead != '!') and ($this->lookAhead != ':')) { + } elseif (is_numeric($token) and (!is_numeric($token . $this->lookAhead) or ($this->lookAhead == '')) and ($this->lookAhead !== '!') and ($this->lookAhead !== ':')) { // If it's a number (check that it's not a sheet name or range) return $token; - } elseif (preg_match('/"([^"]|""){0,255}"/', $token) and $this->lookAhead != '"' and (substr_count($token, '"') % 2 == 0)) { + } elseif (preg_match('/"([^"]|""){0,255}"/', $token) and $this->lookAhead !== '"' and (substr_count($token, '"') % 2 == 0)) { // If it's a string (of maximum 255 characters) return $token; - } elseif (preg_match('/^#[A-Z0\\/]{3,5}[!?]{1}$/', $token) or $token == '#N/A') { + } elseif (preg_match('/^#[A-Z0\\/]{3,5}[!?]{1}$/', $token) or $token === '#N/A') { // If it's an error code return $token; - } elseif (preg_match("/^[A-Z0-9\xc0-\xdc\\.]+$/i", $token) and ($this->lookAhead == '(')) { + } elseif (preg_match("/^[A-Z0-9\xc0-\xdc\\.]+$/i", $token) and ($this->lookAhead === '(')) { // if it's a function call return $token; - } elseif (substr($token, -1) == ')') { + } elseif (substr($token, -1) === ')') { // It's an argument of some description (e.g. a named range), // precise nature yet to be determined return $token; @@ -1078,8 +1078,7 @@ class Parser { $this->currentCharacter = 0; $this->formula = $formula; - $this->lookAhead = isset($formula[1]) ? $formula[1] - : ''; + $this->lookAhead = isset($formula[1]) ? $formula[1] : ''; $this->advance(); $this->parseTree = $this->condition(); @@ -1248,10 +1247,10 @@ class Parser */ private function fact() { - if ($this->currentToken == '(') { + if ($this->currentToken === '(') { $this->advance(); // eat the "(" $result = $this->parenthesizedExpression(); - if ($this->currentToken != ')') { + if ($this->currentToken !== ')') { throw new WriterException("')' token expected."); } $this->advance(); // eat the ")" @@ -1299,7 +1298,7 @@ class Parser return $result; } elseif (is_numeric($this->currentToken)) { // If it's a number or a percent - if ($this->lookAhead == '%') { + if ($this->lookAhead === '%') { $result = $this->createTree('ptgPercent', $this->currentToken, ''); $this->advance(); // Skip the percentage operator once we've pre-built that tree } else { @@ -1331,9 +1330,9 @@ class Parser $result = ''; // initialize result $this->advance(); $this->advance(); // eat the "(" - while ($this->currentToken != ')') { + while ($this->currentToken !== ')') { if ($num_args > 0) { - if ($this->currentToken == ',' || $this->currentToken == ';') { + if ($this->currentToken === ',' || $this->currentToken === ';') { $this->advance(); // eat the "," or ";" } else { throw new WriterException("Syntax error: comma expected in function $function, arg #{$num_args}"); diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Workbook.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Workbook.php index b463ce4a8f0..41c8e64e297 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Workbook.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Workbook.php @@ -267,9 +267,7 @@ class Workbook extends BIFFwriter $this->xfWriters[] = $xfWriter; - $xfIndex = count($this->xfWriters) - 1; - - return $xfIndex; + return count($this->xfWriters) - 1; } /** @@ -319,7 +317,7 @@ class Workbook extends BIFFwriter if ($colorIndex) { $this->colors[$rgb] = $colorIndex; } else { - if (count($this->colors) == 0) { + if (count($this->colors) === 0) { $lastColor = 7; } else { $lastColor = end($this->colors); @@ -437,7 +435,7 @@ class Workbook extends BIFFwriter // Prepare part 3 of the workbook global stream, what goes after the SHEET records $part3 = ''; - if ($this->countryCode != -1) { + if ($this->countryCode !== -1) { $part3 .= $this->writeCountry(); } $part3 .= $this->writeRecalcId(); @@ -918,7 +916,7 @@ class Workbook extends BIFFwriter $record = 0x0022; // Record identifier $length = 0x0002; // Bytes to follow - $f1904 = (Date::getExcelCalendar() == Date::CALENDAR_MAC_1904) + $f1904 = (Date::getExcelCalendar() === Date::CALENDAR_MAC_1904) ? 1 : 0; // Flag for 1904 date system diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php index dd19021e46e..58897639024 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php @@ -328,6 +328,17 @@ class Xlsx extends BaseWriter $zip->addFromString('xl/drawings/drawing' . ($i + 1) . '.xml', $this->getWriterPart('Drawing')->writeDrawings($this->spreadSheet->getSheet($i), $this->includeCharts)); } + // Add unparsed drawings + if (isset($unparsedLoadedData['sheets'][$sheetCodeName]['Drawings'])) { + foreach ($unparsedLoadedData['sheets'][$sheetCodeName]['Drawings'] as $relId => $drawingXml) { + $drawingFile = array_search($relId, $unparsedLoadedData['sheets'][$sheetCodeName]['drawingOriginalIds']); + if ($drawingFile !== false) { + $drawingFile = ltrim($drawingFile, '.'); + $zip->addFromString('xl' . $drawingFile, $drawingXml); + } + } + } + // Add comment relationship parts if (count($this->spreadSheet->getSheet($i)->getComments()) > 0) { // VML Comments @@ -338,8 +349,8 @@ class Xlsx extends BaseWriter } // Add unparsed relationship parts - if (isset($unparsedLoadedData['sheets'][$this->spreadSheet->getSheet($i)->getCodeName()]['vmlDrawings'])) { - foreach ($unparsedLoadedData['sheets'][$this->spreadSheet->getSheet($i)->getCodeName()]['vmlDrawings'] as $vmlDrawing) { + if (isset($unparsedLoadedData['sheets'][$sheetCodeName]['vmlDrawings'])) { + foreach ($unparsedLoadedData['sheets'][$sheetCodeName]['vmlDrawings'] as $vmlDrawing) { $zip->addFromString($vmlDrawing['filePath'], $vmlDrawing['content']); } } diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Workbook.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Workbook.php index e3ddb03c143..b9f8f99b71f 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Workbook.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Workbook.php @@ -93,7 +93,7 @@ class Workbook extends WriterPart { $objWriter->startElement('workbookPr'); - if (Date::getExcelCalendar() == Date::CALENDAR_MAC_1904) { + if (Date::getExcelCalendar() === Date::CALENDAR_MAC_1904) { $objWriter->writeAttribute('date1904', '1'); } @@ -225,7 +225,7 @@ class Workbook extends WriterPart $objWriter->startElement('sheet'); $objWriter->writeAttribute('name', $pSheetname); $objWriter->writeAttribute('sheetId', $pSheetId); - if ($sheetState != 'visible' && $sheetState != '') { + if ($sheetState !== 'visible' && $sheetState != '') { $objWriter->writeAttribute('state', $sheetState); } $objWriter->writeAttribute('r:id', 'rId' . $pRelId); diff --git a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php index 78a62e9eca4..065eaaf1c9b 100644 --- a/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php +++ b/htdocs/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php @@ -141,7 +141,7 @@ class Worksheet extends WriterPart $objWriter->startElement('sheetPr'); if ($pSheet->getParent()->hasMacros()) { //if the workbook have macros, we need to have codeName for the sheet - if ($pSheet->hasCodeName() == false) { + if (!$pSheet->hasCodeName()) { $pSheet->setCodeName($pSheet->getTitle()); } $objWriter->writeAttribute('codeName', $pSheet->getCodeName()); @@ -322,7 +322,7 @@ class Worksheet extends WriterPart } // Set Zero Height row - if ((string) $pSheet->getDefaultRowDimension()->getZeroHeight() == '1' || + if ((string) $pSheet->getDefaultRowDimension()->getZeroHeight() === '1' || strtolower((string) $pSheet->getDefaultRowDimension()->getZeroHeight()) == 'true') { $objWriter->writeAttribute('zeroHeight', '1'); } @@ -383,7 +383,7 @@ class Worksheet extends WriterPart } // Column visibility - if ($colDimension->getVisible() == false) { + if ($colDimension->getVisible() === false) { $objWriter->writeAttribute('hidden', 'true'); } @@ -398,7 +398,7 @@ class Worksheet extends WriterPart } // Collapsed - if ($colDimension->getCollapsed() == true) { + if ($colDimension->getCollapsed() === true) { $objWriter->writeAttribute('collapsed', 'true'); } @@ -428,7 +428,7 @@ class Worksheet extends WriterPart // sheetProtection $objWriter->startElement('sheetProtection'); - if ($pSheet->getProtection()->getPassword() != '') { + if ($pSheet->getProtection()->getPassword() !== '') { $objWriter->writeAttribute('password', $pSheet->getProtection()->getPassword()); } @@ -519,6 +519,9 @@ class Worksheet extends WriterPart // Formula $objWriter->writeElement('formula', $formula); } + } elseif ($conditional->getConditionType() == Conditional::CONDITION_CONTAINSBLANKS) { + // formula copied from ms xlsx xml source file + $objWriter->writeElement('formula', 'LEN(TRIM(' . $cellCoordinate . '))=0'); } $objWriter->endElement(); @@ -624,8 +627,9 @@ class Worksheet extends WriterPart $objWriter->writeAttribute('location', str_replace('sheet://', '', $hyperlink->getUrl())); } - if ($hyperlink->getTooltip() != '') { + if ($hyperlink->getTooltip() !== '') { $objWriter->writeAttribute('tooltip', $hyperlink->getTooltip()); + $objWriter->writeAttribute('display', $hyperlink->getTooltip()); } $objWriter->endElement(); @@ -991,12 +995,12 @@ class Worksheet extends WriterPart } // Row visibility - if ($rowDimension->getVisible() == false) { + if (!$rowDimension->getVisible() === true) { $objWriter->writeAttribute('hidden', 'true'); } // Collapsed - if ($rowDimension->getCollapsed() == true) { + if ($rowDimension->getCollapsed() === true) { $objWriter->writeAttribute('collapsed', 'true'); } @@ -1101,7 +1105,7 @@ class Worksheet extends WriterPart break; case 'f': // Formula $attributes = $pCell->getFormulaAttributes(); - if ($attributes['t'] == 'array') { + if ($attributes['t'] === 'array') { $objWriter->startElement('f'); $objWriter->writeAttribute('t', 'array'); $objWriter->writeAttribute('ref', $pCellAddress); @@ -1114,7 +1118,7 @@ class Worksheet extends WriterPart } if ($this->getParentWriter()->getOffice2003Compatibility() === false) { if ($this->getParentWriter()->getPreCalculateFormulas()) { - if (!is_array($calculatedValue) && substr($calculatedValue, 0, 1) != '#') { + if (!is_array($calculatedValue) && substr($calculatedValue, 0, 1) !== '#') { $objWriter->writeElement('v', StringHelper::formatNumber($calculatedValue)); } else { $objWriter->writeElement('v', '0'); @@ -1135,7 +1139,7 @@ class Worksheet extends WriterPart break; case 'e': // Error - if (substr($cellValue, 0, 1) == '=') { + if (substr($cellValue, 0, 1) === '=') { $objWriter->writeElement('f', substr($cellValue, 1)); $objWriter->writeElement('v', substr($cellValue, 1)); } else { From dfdae71e42c435fd97f1ee1a43ce9a9fb40a802d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Apr 2021 18:33:01 +0200 Subject: [PATCH 062/140] Update phpspeadsheet to 1.8.2 --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index f9d06530c9a..130fda34945 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,7 @@ "ckeditor/ckeditor" : "4.12.1", "mike42/escpos-php" : "2.2", "mobiledetect/mobiledetectlib" : "2.8.34", + "phpoffice/phpexcel" : "1.8.2", "restler/framework" : "3.0.0-RC6", "tecnickcom/tcpdf" : "6.3.2", "nnnick/chartjs" : "^2.9", From 6c84b858eeb57b6eee9e7f3f3edd0f2301d7e9a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Apr 2021 18:51:42 +0200 Subject: [PATCH 063/140] Fix #yogosha5832 --- htdocs/bom/class/api_boms.class.php | 4 ++++ htdocs/mrp/class/api_mos.class.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/htdocs/bom/class/api_boms.class.php b/htdocs/bom/class/api_boms.class.php index b0f536140dd..1fe104987a3 100644 --- a/htdocs/bom/class/api_boms.class.php +++ b/htdocs/bom/class/api_boms.class.php @@ -99,6 +99,10 @@ class Boms extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->bom->read) { + throw new RestException(401); + } + $obj_ret = array(); $tmpobject = new BOM($this->db); diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index 281ec0fb731..48f93976d29 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -98,6 +98,10 @@ class Mos extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->mrp->read) { + throw new RestException(401); + } + $obj_ret = array(); $tmpobject = new Mo($this->db); From 667481acd580ce827062883a281e03cdc03859bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Apr 2021 19:05:28 +0200 Subject: [PATCH 064/140] Fix #yogosha5832 - Missin test on permission for /index routes on APIs --- htdocs/comm/propal/class/api_proposals.class.php | 4 ++++ htdocs/commande/class/api_orders.class.php | 4 ++++ htdocs/compta/facture/class/api_invoices.class.php | 4 ++++ htdocs/contrat/class/api_contracts.class.php | 4 ++++ htdocs/don/class/api_donations.class.php | 7 +++++++ htdocs/expedition/class/api_shipments.class.php | 4 ++++ htdocs/expensereport/class/api_expensereports.class.php | 7 +++++++ htdocs/fichinter/class/api_interventions.class.php | 4 ++++ htdocs/fourn/class/api_supplier_invoices.class.php | 4 ++++ htdocs/fourn/class/api_supplier_orders.class.php | 4 ++++ htdocs/product/class/api_products.class.php | 4 ++++ htdocs/projet/class/api_projects.class.php | 4 ++++ htdocs/projet/class/api_tasks.class.php | 4 ++++ htdocs/societe/class/api_contacts.class.php | 2 ++ htdocs/societe/class/api_thirdparties.class.php | 6 ++++++ .../class/api_supplier_proposals.class.php | 4 ++++ htdocs/ticket/class/api_tickets.class.php | 4 ++++ htdocs/zapier/class/api_zapier.class.php | 7 +++++++ 18 files changed, 81 insertions(+) diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 9f5cdea8000..042303b7eed 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -155,6 +155,10 @@ class Proposals extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->propal->lire) { + throw new RestException(401); + } + $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index 17b7d4285b4..1bf3b97a040 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -158,6 +158,10 @@ class Orders extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->commande->lire) { + throw new RestException(401); + } + $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 87bcbe12b3e..0633affef49 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -165,6 +165,10 @@ class Invoices extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->facture->lire) { + throw new RestException(401); + } + $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index cf821ccb2c6..1de8f0c480d 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -106,6 +106,10 @@ class Contracts extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->contrat->lire) { + throw new RestException(401); + } + $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php index ab0d6e5f483..2773ab62c14 100644 --- a/htdocs/don/class/api_donations.class.php +++ b/htdocs/don/class/api_donations.class.php @@ -103,6 +103,10 @@ class Donations extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->don->lire) { + throw new RestException(401); + } + $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid @@ -179,6 +183,7 @@ class Donations extends DolibarrApi if (!DolibarrApiAccess::$user->rights->don->creer) { throw new RestException(401, "Insuffisant rights"); } + // Check mandatory fields $result = $this->_validate($request_data); @@ -247,6 +252,7 @@ class Donations extends DolibarrApi if (!DolibarrApiAccess::$user->rights->don->supprimer) { throw new RestException(401); } + $result = $this->don->fetch($id); if (!$result) { throw new RestException(404, 'Donation not found'); @@ -295,6 +301,7 @@ class Donations extends DolibarrApi if (!DolibarrApiAccess::$user->rights->don->creer) { throw new RestException(401); } + $result = $this->don->fetch($id); if (!$result) { throw new RestException(404, 'Donation not found'); diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index cc5267cdd47..961790cc3bd 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -103,6 +103,10 @@ class Shipments extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->expedition->lire) { + throw new RestException(401); + } + $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php index 13148e4247a..7321cb40625 100644 --- a/htdocs/expensereport/class/api_expensereports.class.php +++ b/htdocs/expensereport/class/api_expensereports.class.php @@ -99,6 +99,10 @@ class ExpenseReports extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->expensereport->lire) { + throw new RestException(401); + } + $obj_ret = array(); // case of external user, $societe param is ignored and replaced by user's socid @@ -164,6 +168,7 @@ class ExpenseReports extends DolibarrApi if (!DolibarrApiAccess::$user->rights->expensereport->creer) { throw new RestException(401, "Insuffisant rights"); } + // Check mandatory fields $result = $this->_validate($request_data); @@ -427,6 +432,7 @@ class ExpenseReports extends DolibarrApi if (!DolibarrApiAccess::$user->rights->expensereport->supprimer) { throw new RestException(401); } + $result = $this->expensereport->fetch($id); if (!$result) { throw new RestException(404, 'Expense Report not found'); @@ -469,6 +475,7 @@ class ExpenseReports extends DolibarrApi if(! DolibarrApiAccess::$user->rights->expensereport->creer) { throw new RestException(401); } + $result = $this->expensereport->fetch($id); if( ! $result ) { throw new RestException(404, 'expensereport not found'); diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index 17aa2b3db53..423bb31f348 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -110,6 +110,10 @@ class Interventions extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->ficheinter->lire) { + throw new RestException(401); + } + $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 5e977473146..b9b541f0229 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -102,6 +102,10 @@ class SupplierInvoices extends DolibarrApi { global $db; + if (!DolibarrApiAccess::$user->rights->fournisseur->facture->lire) { + throw new RestException(401); + } + $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index 8076900b100..b09b5677e10 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -101,6 +101,10 @@ class SupplierOrders extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->fournisseur->commande->lire) { + throw new RestException(401); + } + $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index c38437fb2f0..79751ea2e14 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -172,6 +172,10 @@ class Products extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->produit->lire) { + throw new RestException(403); + } + $obj_ret = array(); $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index 47536986a80..6a08aa7a4bd 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -103,6 +103,10 @@ class Projects extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->projet->lire) { + throw new RestException(401); + } + $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index 748d9ce2594..cd6df68d590 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -109,6 +109,10 @@ class Tasks extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->projet->lire) { + throw new RestException(401); + } + $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index 3993ad38e5f..5a6513ef6e5 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -74,6 +74,7 @@ class Contacts extends DolibarrApi if (!DolibarrApiAccess::$user->rights->societe->contact->lire) { throw new RestException(401, 'No permission to read contacts'); } + if ($id == 0) { $result = $this->contact->initAsSpecimen(); } else { @@ -117,6 +118,7 @@ class Contacts extends DolibarrApi if (!DolibarrApiAccess::$user->rights->societe->contact->lire) { throw new RestException(401, 'No permission to read contacts'); } + if (empty($email)) { $result = $this->contact->initAsSpecimen(); } else { diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index f5eae0be948..b0b486459b1 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -132,6 +132,10 @@ class Thirdparties extends DolibarrApi { $obj_ret = array(); + if (!DolibarrApiAccess::$user->rights->societe->lire) { + throw new RestException(401); + } + // case of external user, we force socids $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; @@ -1842,9 +1846,11 @@ class Thirdparties extends DolibarrApi private function _fetch($rowid, $ref = '', $ref_ext = '', $barcode = '', $idprof1 = '', $idprof2 = '', $idprof3 = '', $idprof4 = '', $idprof5 = '', $idprof6 = '', $email = '', $ref_alias = '') { global $conf; + if (!DolibarrApiAccess::$user->rights->societe->lire) { throw new RestException(401); } + if ($rowid === 0) { $result = $this->company->initAsSpecimen(); } else { diff --git a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php index 1368cce7811..3e38ac10b41 100644 --- a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php +++ b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php @@ -98,6 +98,10 @@ class Supplierproposals extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->supplier_proposal->lire) { + throw new RestException(401); + } + $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index d8e36933ea6..f814beb3398 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -232,6 +232,10 @@ class Tickets extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->ticket->read) { + throw new RestException(403); + } + $obj_ret = array(); if (!$socid && DolibarrApiAccess::$user->socid) { diff --git a/htdocs/zapier/class/api_zapier.class.php b/htdocs/zapier/class/api_zapier.class.php index ebf62d115ab..c141588a7f9 100644 --- a/htdocs/zapier/class/api_zapier.class.php +++ b/htdocs/zapier/class/api_zapier.class.php @@ -104,6 +104,7 @@ class ZapierApi extends DolibarrApi if (!DolibarrApiAccess::$user->rights->zapier->read) { throw new RestException(401); } + $arraychoices = array( 'invoices' => 'Invoices', 'orders' => 'Orders', @@ -143,6 +144,10 @@ class ZapierApi extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->zapier->read) { + throw new RestException(401); + } + $obj_ret = array(); $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; @@ -242,6 +247,7 @@ class ZapierApi extends DolibarrApi if (!DolibarrApiAccess::$user->rights->zapier->write) { throw new RestException(401); } + // Check mandatory fields $fields = array( 'url', @@ -313,6 +319,7 @@ class ZapierApi extends DolibarrApi if (!DolibarrApiAccess::$user->rights->zapier->delete) { throw new RestException(401); } + $result = $this->hook->fetch($id); if (!$result) { throw new RestException(404, 'Hook not found'); From 60711f415da3f47fb47bbd2956d70d02a54293fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Apr 2021 19:52:07 +0200 Subject: [PATCH 065/140] Fix permission on external user --- .../fourn/class/fournisseur.product.class.php | 6 +- htdocs/product/class/api_products.class.php | 58 +++++++++++++++---- 2 files changed, 50 insertions(+), 14 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index c910cffe8d4..21b4ec377a2 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -634,9 +634,10 @@ class ProductFournisseur extends Product * @param string $sortorder Sort order * @param int $limit Limit * @param int $offset Offset + * @param int $socid Filter on a third party id * @return array Array of Products with new properties to define supplier price */ - public function list_product_fournisseur_price($prodid, $sortfield = '', $sortorder = '', $limit = 0, $offset = 0) + public function list_product_fournisseur_price($prodid, $sortfield = '', $sortorder = '', $limit = 0, $offset = 0, $socid = 0) { // phpcs:enable global $conf; @@ -652,7 +653,8 @@ class ProductFournisseur extends Product $sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp, ".MAIN_DB_PREFIX."product as p, ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; $sql .= " AND pfp.fk_soc = s.rowid AND pfp.fk_product = p.rowid"; - $sql .= " AND s.status=1"; // only enabled company selected + $sql .= ($socid > 0 ? ' AND pfp.fk_soc = '.((int) $socid) : ''); + $sql .= " AND s.status = 1"; // only enabled company selected $sql .= " AND pfp.fk_product = ".((int) $prodid); if (empty($sortfield)) { $sql .= " ORDER BY s.nom, pfp.quantity, pfp.price"; diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 79751ea2e14..a572d0946c4 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -574,8 +574,8 @@ class Products extends DolibarrApi /** * Get prices per customer for a product * - * @param int $id ID of product - * @param string $thirdparty_id Thirdparty id to filter orders of (example '1') {@pattern /^[0-9,]*$/i} + * @param int $id ID of product + * @param string $thirdparty_id Thirdparty id to filter orders of (example '1') {@pattern /^[0-9,]*$/i} * * @return mixed * @@ -593,6 +593,11 @@ class Products extends DolibarrApi throw new RestException(400, 'API not available: this mode of pricing is not enabled by setup'); } + $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; + if ($socid > 0 && $socid != $thirdparty_id) { + throw new RestException(401, 'Getting prices for all customers or for the customer ID '.$thirdparty_id.' is not allowed for login '.DolibarrApiAccess::$user->login); + } + $result = $this->product->fetch($id); if (!$result) { throw new RestException(404, 'Product not found'); @@ -700,6 +705,11 @@ class Products extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } + $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; + if ($socid > 0 && $socid != $fourn_id) { + throw new RestException(401, 'Adding purchase price for the supplier ID '.$fourn_id.' is not allowed for login '.DolibarrApiAccess::$user->login); + } + $result = $this->productsupplier->add_fournisseur(DolibarrApiAccess::$user, $fourn_id, $ref_fourn, $qty); if ($result < 0) { throw new RestException(500, "Error adding supplier to product : ".$this->db->lasterror()); @@ -774,9 +784,19 @@ class Products extends DolibarrApi { global $db, $conf; + if (!DolibarrApiAccess::$user->rights->produit->lire) { + throw new RestException(401); + } + $obj_ret = array(); + // Force id of company for external users $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; + if ($socid > 0) { + if ($supplier != $socid || empty($supplier)) { + throw new RestException(401, 'As an external user, you can request only for your supplier id = '.$socid); + } + } $sql = "SELECT t.rowid, t.ref, t.ref_ext"; $sql .= " FROM ".MAIN_DB_PREFIX."product as t"; @@ -788,12 +808,15 @@ class Products extends DolibarrApi $sql .= ' WHERE t.entity IN ('.getEntity('product').')'; if ($supplier > 0) { - $sql .= " AND s.fk_soc = ".$this->db->escape($supplier); + $sql .= " AND s.fk_soc = "((int) $supplier); + } + if ($socid > 0) { // if external user + $sql .= " AND s.fk_soc = ".((int) $socid); } $sql .= " AND s.fk_product = t.rowid"; // Select products of given category if ($category > 0) { - $sql .= " AND c.fk_categorie = ".$this->db->escape($category); + $sql .= " AND c.fk_categorie = ".((int) $category); $sql .= " AND c.fk_product = t.rowid"; } if ($mode == 1) { @@ -878,6 +901,8 @@ class Products extends DolibarrApi throw new RestException(403); } + $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; + $result = $this->product->fetch($id, $ref, $ref_ext, $barcode); if (!$result) { throw new RestException(404, 'Product not found'); @@ -891,7 +916,7 @@ class Products extends DolibarrApi if ($result) { $product_fourn = new ProductFournisseur($this->db); - $product_fourn_list = $product_fourn->list_product_fournisseur_price($this->product->id, '', '', 0, 0); + $product_fourn_list = $product_fourn->list_product_fournisseur_price($this->product->id, '', '', 0, 0, ($socid > 0 ? $socid : 0)); } foreach ($product_fourn_list as $tmpobj) { @@ -911,7 +936,9 @@ class Products extends DolibarrApi * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:color)" * @return array * - * @throws RestException + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 503 * * @url GET attributes */ @@ -976,7 +1003,6 @@ class Products extends DolibarrApi * @param int $id ID of Attribute * @return array * - * @throws RestException * @throws RestException 401 * @throws RestException 404 * @@ -1020,8 +1046,8 @@ class Products extends DolibarrApi * @param string $ref Reference of Attribute * @return array * - * @throws RestException 500 * @throws RestException 401 + * @throws RestException 404 * * @url GET attributes/ref/{ref} */ @@ -1272,7 +1298,10 @@ class Products extends DolibarrApi throw new RestException(401); } - $sql = "SELECT rowid, fk_product_attribute, ref, value FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE ref LIKE '".trim($ref)."' AND fk_product_attribute = ".(int) $id." AND entity IN (".getEntity('product').")"; + $ref = trim($ref); + + $sql = "SELECT rowid, fk_product_attribute, ref, value FROM ".MAIN_DB_PREFIX."product_attribute_value"; + $sql .= " WHERE ref LIKE '".$this->db->escape($ref)."' AND fk_product_attribute = ".((int) $id)." AND entity IN (".getEntity('product').")"; $query = $this->db->query($sql); @@ -1312,7 +1341,10 @@ class Products extends DolibarrApi throw new RestException(401); } - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE ref LIKE '".trim($ref)."' AND fk_product_attribute = ".(int) $id." AND entity IN (".getEntity('product').")"; + $ref = trim($ref); + + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product_attribute_value"; + $sql .= " WHERE ref LIKE '".$this->db->escape($ref)."' AND fk_product_attribute = ".((int) $id)." AND entity IN (".getEntity('product').")"; $query = $this->db->query($sql); if (!$query) { @@ -1383,11 +1415,13 @@ class Products extends DolibarrApi throw new RestException(401); } + $ref = trim($ref); + $return = array(); $sql = 'SELECT '; $sql .= 'v.fk_product_attribute, v.rowid, v.ref, v.value FROM '.MAIN_DB_PREFIX.'product_attribute_value as v'; - $sql .= " WHERE v.fk_product_attribute IN (SELECT rowid FROM ".MAIN_DB_PREFIX."product_attribute WHERE ref LIKE '".$this->db->escape(trim($ref))."')"; + $sql .= " WHERE v.fk_product_attribute IN (SELECT rowid FROM ".MAIN_DB_PREFIX."product_attribute WHERE ref LIKE '".$this->db->escape($ref)."')"; $resql = $this->db->query($sql); @@ -1428,7 +1462,7 @@ class Products extends DolibarrApi } $objectval = new ProductAttributeValue($this->db); - $objectval->fk_product_attribute = $id; + $objectval->fk_product_attribute = ((int) $id); $objectval->ref = $ref; $objectval->value = $value; From 2d771704d0d088af79eb674e7187f822ed7f20f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Apr 2021 00:36:08 +0200 Subject: [PATCH 066/140] Better suggestion for data after clone of social contribution --- htdocs/compta/sociales/card.php | 15 ++++++++++++--- .../sociales/class/chargesociales.class.php | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index b2ac294021c..0f38181e284 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -235,17 +235,26 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char $object->label = $langs->trans("CopyOf").' '.$object->label; } - if (GETPOST('clone_for_next_month', 'int')) { + if (GETPOST('clone_for_next_month', 'int')) { // This can be true only if TAX_ADD_CLONE_FOR_NEXT_MONTH_CHECKBOX has been set $object->periode = dol_time_plus_duree($object->periode, 1, 'm'); $object->date_ech = dol_time_plus_duree($object->date_ech, 1, 'm'); } else { + // Note dateech is often a little bit higher than dateperiod $newdateperiod = dol_mktime(0, 0, 0, GETPOST('clone_periodmonth', 'int'), GETPOST('clone_periodday', 'int'), GETPOST('clone_periodyear', 'int')); $newdateech = dol_mktime(0, 0, 0, GETPOST('clone_date_echmonth', 'int'), GETPOST('clone_date_echday', 'int'), GETPOST('clone_date_echyear', 'int')); if ($newdateperiod) { $object->periode = $newdateperiod; + if (empty($newdateech)) { + $object->date_ech = $object->periode; + } } if ($newdateech) { $object->date_ech = $newdateech; + if (empty($newdateperiod)) { + // TODO We can here get dol_get_last_day of previous month: + // $object->periode = dol_get_last_day(year of $object->date_ech - 1m, month or $object->date_ech -1m) + $object->periode = $object->date_ech; + } } } @@ -410,9 +419,9 @@ if ($id > 0) { // Clone confirmation if ($action === 'clone') { $formquestion = array( - array('type' => 'text', 'name' => 'clone_label', 'label' => $langs->trans("Label"), 'value' => $langs->trans("CopyOf").' '.$object->label), + array('type' => 'text', 'name' => 'clone_label', 'label' => $langs->trans("Label"), 'value' => $langs->trans("CopyOf").' '.$object->label, 'tdclass'=>'fieldrequired'), ); - if (!empty($conf->global->TAX_ADD_CLON_FOR_NEXT_MONTH_CHECKBOX)) { + if (!empty($conf->global->TAX_ADD_CLONE_FOR_NEXT_MONTH_CHECKBOX)) { $formquestion[] = array('type' => 'checkbox', 'name' => 'clone_for_next_month', 'label' => $langs->trans("CloneTaxForNextMonth"), 'value' => 1); } else { $formquestion[] = array('type' => 'date', 'name' => 'clone_date_ech', 'label' => $langs->trans("Date"), 'value' => -1); diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index d7fcd9278a9..20cc2c82b0c 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -197,7 +197,7 @@ class ChargeSociales extends CommonObject { $newamount = price2num($this->amount, 'MT'); - // Validation parametres + // Validation of parameters if (!$newamount > 0 || empty($this->date_ech) || empty($this->periode)) { return false; } From 475bdc24f4bf4377c394ff8c759b9981169f9dae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Apr 2021 01:31:55 +0200 Subject: [PATCH 067/140] Fix sql error --- htdocs/website/class/websitepage.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 32c8c0b8688..f22a5200148 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -426,7 +426,7 @@ class WebsitePage extends CommonObject } $listoflang[] = "'".$this->db->escape(substr(str_replace("'", '', $tmpvalue), 0, 2))."'"; } - $stringtouse = $key." IN (".$this->db->sanitize(join(',', $listoflang)).")"; + $stringtouse = $key." IN (".$this->db->sanitize(join(',', $listoflang), 1).")"; if ($foundnull) { $stringtouse = '('.$stringtouse.' OR '.$key.' IS NULL)'; } From f2a49ef72ff9f4eb0358694d09db47273e01439b Mon Sep 17 00:00:00 2001 From: daraelmin Date: Fri, 9 Apr 2021 02:23:22 +0200 Subject: [PATCH 068/140] New option amount by member type --- htdocs/adherents/admin/member.php | 16 ++++++++++- htdocs/adherents/admin/website.php | 2 +- htdocs/adherents/class/adherent.class.php | 5 +++- htdocs/langs/en_US/members.lang | 1 + htdocs/langs/fr_FR/members.lang | 1 + htdocs/public/payment/newpayment.php | 33 +++++++++++++++++++++++ htdocs/public/payment/paymentok.php | 8 +++--- 7 files changed, 60 insertions(+), 6 deletions(-) diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 3d40f8d758b..73770f38905 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -33,6 +33,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; // Load translation files required by the page $langs->loadLangs(array("admin", "members")); @@ -101,11 +102,12 @@ if ($action == 'set_default') { } } elseif ($action == 'updateall') { $db->begin(); - $res1 = $res2 = $res3 = $res4 = $res5 = $res6 = 0; + $res1 = $res2 = $res3 = $res4 = $res5 = $res6 = $res7 = 0; $res1 = dolibarr_set_const($db, 'ADHERENT_LOGIN_NOT_REQUIRED', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha') ? 0 : 1, 'chaine', 0, '', $conf->entity); $res2 = dolibarr_set_const($db, 'ADHERENT_MAIL_REQUIRED', GETPOST('ADHERENT_MAIL_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity); $res3 = dolibarr_set_const($db, 'ADHERENT_DEFAULT_SENDINFOBYMAIL', GETPOST('ADHERENT_DEFAULT_SENDINFOBYMAIL', 'alpha'), 'chaine', 0, '', $conf->entity); $res4 = dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity); + $res7 = dolibarr_set_const($db, "MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE", json_encode(GETPOST('MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE')), 'array', 0, '', $conf->entity); // Use vat for invoice creation if ($conf->facture->enabled) { $res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); @@ -217,6 +219,18 @@ print '
'.$langs->trans("MemberSendInformationByMailByDef print $form->selectyesno('ADHERENT_DEFAULT_SENDINFOBYMAIL', (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ? $conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL : 0), 1); print "
'.$langs->trans("DefineAmountMemberType").''; +foreach ($adht->liste_array(1) as $typeid => $type){ + print $type .' : '; + print ''; + print '
'; +} +print "
'.$langs->trans("MoreActionsOnSubscription").''; $listofval = array(); - $listofval += $adht->liste_array(); + $listofval += $adht->liste_array(1); $forcetype = empty($conf->global->MEMBER_NEWFORM_FORCETYPE) ? -1 : $conf->global->MEMBER_NEWFORM_FORCETYPE; print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listofval) > 1 ? 1 : 0); print "
'.$langs->trans("LastMemberType"); + print ''.dol_escape_htmltag($member->type); + 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 "
'.$langs->trans("NewMemberType"); + print ''.dol_escape_htmltag($member->type); + print ''; + print "
'.$langs->trans("Amount"); diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 99a97e0c321..bf957d4cf6b 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -98,10 +98,11 @@ $FULLTAG = GETPOST('FULLTAG'); if (empty($FULLTAG)) { $FULLTAG = GETPOST('fulltag'); } -$source = GETPOST('s', 'alpha') ?GETPOST('s', 'alpha') : GETPOST('source', 'alpha'); +$source = GETPOST('s', 'alpha') ? GETPOST('s', 'alpha') : GETPOST('source', 'alpha'); $ref = GETPOST('ref'); $suffix = GETPOST("suffix", 'aZ09'); +$membertypeid = GETPOST("membertypeid", 'int'); // Detect $paymentmethod @@ -339,7 +340,8 @@ if ($ispaymentok) { $user->rights->facture = new stdClass(); } if (empty($user->rights->adherent)) { - $user->rights->adherent = new stdClass(); $user->rights->adherent->cotisation = new stdClass(); + $user->rights->adherent = new stdClass(); + $user->rights->adherent->cotisation = new stdClass(); } $user->rights->societe->creer = 1; $user->rights->facture->creer = 1; @@ -460,7 +462,7 @@ if ($ispaymentok) { if (!$error) { dol_syslog("Call ->subscription to create subscription", LOG_DEBUG, 0, '_payment'); - $crowid = $object->subscription($datesubscription, $amount, $accountid, $operation, $label, $num_chq, $emetteur_nom, $emetteur_banque, $datesubend); + $crowid = $object->subscription($datesubscription, $amount, $accountid, $operation, $label, $num_chq, $emetteur_nom, $emetteur_banque, $datesubend, $membertypeid); if ($crowid <= 0) { $error++; $errmsg = $object->error; From dce5c6be8f5cb78c8fe7a4ccf1faa5554e49301b Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 9 Apr 2021 00:28:07 +0000 Subject: [PATCH 069/140] Fixing style errors. --- htdocs/adherents/admin/member.php | 8 ++-- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/public/payment/newpayment.php | 58 +++++++++++------------ htdocs/public/payment/paymentok.php | 2 +- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 73770f38905..98da5281088 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -224,10 +224,10 @@ print "
'.$langs->trans("DefineAmountMemberType").''; -foreach ($adht->liste_array(1) as $typeid => $type){ - print $type .' : '; - print ''; - print '
'; +foreach ($adht->liste_array(1) as $typeid => $type) { + print $type .' : '; + print ''; + print '
'; } print "
'.$langs->trans("LastMemberType"); - print ''.dol_escape_htmltag($member->type); - print "
'.$langs->trans("LastMemberType"); + print ''.dol_escape_htmltag($member->type); + 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 "
'.$langs->trans("NewMemberType"); - print ''.dol_escape_htmltag($member->type); - print ''; - 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 "
'.$langs->trans("NewMemberType"); + print ''.dol_escape_htmltag($member->type); + print ''; + print "
'.$langs->trans("LastMemberType"); print ''.dol_escape_htmltag($member->type); - 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 "
'.$langs->trans("NewMemberType"); print ''.dol_escape_htmltag($member->type); print ''; - print "
'.$langs->trans("LastMemberType"); print ''.dol_escape_htmltag($member->type); - 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 "
'.$langs->trans("NewMemberType"); print ''.dol_escape_htmltag($member->type); print ''; - print "
'.$langs->trans("LastMemberType"); print ''.dol_escape_htmltag($member->type); - 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 "
'.$langs->trans("NewMemberType"); print ''.dol_escape_htmltag($member->type); print ''; - print "
'.$langs->trans("DefineAmountMemberType").'
'; print dol_escape_htmltag($proplabel); print ''; - print ''.dol_escape_htmltag($proptype).''; - print ''; - if ($proparrayofkeyval) { - print ''; - print dol_escape_htmltag(json_encode($proparrayofkeyval)); + if ($action == 'editproperty' && $propname == $propertykey) { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''.dol_escape_htmltag($proptype).''; + print ''; + if ($proparrayofkeyval) { + print ''; + print dol_escape_htmltag(json_encode($proparrayofkeyval)); + print ''; + } + print ''; + print dol_escape_htmltag($propnotnull); + print ''; + print dol_escape_htmltag($propdefault); + print ''; + print $propindex ? '1' : ''; + print ''; + print $propforeignkey ? dol_escape_htmltag($propforeignkey) : ''; + print ''; + print dol_escape_htmltag($propposition); + print ''; + print $propenabled ? dol_escape_htmltag($propenabled) : ''; + print ''; + print $propvisible ? dol_escape_htmltag($propvisible) : '0'; + print ''; + print $propnoteditable ? dol_escape_htmltag($propnoteditable) : ''; + print ''; + print $propsearchall ? '1' : ''; + print ''; + print $propisameasure ? dol_escape_htmltag($propisameasure) : ''; + print ''; + print $propcss ? dol_escape_htmltag($propcss) : ''; + print ''; + print $propcssview ? dol_escape_htmltag($propcssview) : ''; + print ''; + print $propcsslist ? dol_escape_htmltag($propcsslist) : ''; + print ''; + print $prophelp ? dol_escape_htmltag($prophelp) : ''; + print ''; + print $propshowoncombobox ? dol_escape_htmltag($propshowoncombobox) : ''; + print ''; + print $propdisabled?$propdisabled:''; + print ''; + print ''; + print dol_escape_htmltag($propcomment); print ''; + print ''; + if ($propname != 'rowid') { + print ''.img_delete().''; + print ' '; + print ''.img_edit().''; + } + print ''; - print dol_escape_htmltag($propnotnull); - print ''; - print dol_escape_htmltag($propdefault); - print ''; - print $propindex ? '1' : ''; - print ''; - print $propforeignkey ? dol_escape_htmltag($propforeignkey) : ''; - print ''; - print dol_escape_htmltag($propposition); - print ''; - print $propenabled ? dol_escape_htmltag($propenabled) : ''; - print ''; - print $propvisible ? dol_escape_htmltag($propvisible) : '0'; - print ''; - print $propnoteditable ? dol_escape_htmltag($propnoteditable) : ''; - print ''; - print $propsearchall ? '1' : ''; - print ''; - print $propisameasure ? dol_escape_htmltag($propisameasure) : ''; - print ''; - print $propcss ? dol_escape_htmltag($propcss) : ''; - print ''; - print $propcssview ? dol_escape_htmltag($propcssview) : ''; - print ''; - print $propcsslist ? dol_escape_htmltag($propcsslist) : ''; - print ''; - print $prophelp ? dol_escape_htmltag($prophelp) : ''; - print ''; - print $propshowoncombobox ? dol_escape_htmltag($propshowoncombobox) : ''; - print ''; - print $propdisabled?$propdisabled:''; - print ''; - print ''; - print dol_escape_htmltag($propcomment); - print ''; - print ''; - if ($propname != 'rowid') { - print ''.img_delete().''; - } - 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) { + $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 ''; + + /*print '
'.$langs->trans("or").'
'; print '
'; - print 'Scan a product lot or serial number
'; print '     Qty
'; - + */ print '
'; + print '
'; + print '
'; + print ''.$langs->trans("FeatureNotYetAvailable").''; // TODO Add javascript so each scan will add qty into the inventory page + an ajax save. + print '
'; print ''; + print ''; } From 725c6be7db1e591ec638c64070a92d6ccadb3ad8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Apr 2021 12:13:02 +0200 Subject: [PATCH 087/140] CSS --- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index dc9fa7b6047..4cf7bc0de34 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -987,7 +987,7 @@ div.div-for-modal { div.div-for-modal-topright { /* display: none; */ - position:absolute; + position: fixed; top: 0; right: 0; width:50%; /* adjust as per your needs */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c5cd7da18c7..e807ae62234 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1072,7 +1072,7 @@ div.div-for-modal { div.div-for-modal-topright { /* display: none; */ - position:absolute; + position: fixed; top: 0; right: 0; width:50%; /* adjust as per your needs */ From 445309bef2b4076ebca49fe6ff54c2d076c89235 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Apr 2021 12:25:45 +0200 Subject: [PATCH 088/140] Clean code --- htdocs/modulebuilder/index.html | 0 htdocs/modulebuilder/index.php | 11 +++++------ 2 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 htdocs/modulebuilder/index.html diff --git a/htdocs/modulebuilder/index.html b/htdocs/modulebuilder/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 8918250fc67..572fff42369 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2755,9 +2755,9 @@ if ($module == 'initmodule') { print '
'; print ''; print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; @@ -2825,9 +2825,8 @@ if ($module == 'initmodule') { print ''; if ($propname != 'rowid') { - print ''.img_delete().''; - print ' '; - print ''.img_edit().''; + print ''.img_edit().''; + print ''.img_delete().''; } print ''.$langs->trans("QtyShipped").''.$langs->trans("QtyToShip"); if (empty($conf->productbatch->enabled)) { - print '
'.$langs->trans("Fill").''; + print '
'.img_picto($langs->trans("Autofill"), 'autofill', 'class="paddingrightonly"').$langs->trans("Fill").''; print ' / '; } else { print '
'; diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 809b4803ff5..cba2e14cf74 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -65,6 +65,7 @@ if (!empty($user->socid)) { $result = restrictedArea($user, 'commande', $id); $object = new Commande($db); +$shipment = new Expedition($db); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels @@ -77,7 +78,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'expedition', $object->id, ''); + +$result = restrictedArea($user, 'expedition', 0, ''); // We use 0 for id, because there is no particular shipment on this tab, only id of order is known @@ -94,13 +96,11 @@ if ($reshook < 0) { if (empty($reshook)) { // Categorisation dans projet if ($action == 'classin') { - $object = new Commande($db); $object->fetch($id); $object->setProject(GETPOST('projectid', 'int')); } if ($action == 'confirm_cloture' && GETPOST('confirm', 'alpha') == 'yes') { - $object = new Commande($db); $object->fetch($id); $result = $object->cloture($user); } elseif ($action == 'setref_client' && $user->rights->commande->creer) { @@ -132,7 +132,6 @@ if (empty($reshook)) { } */ if ($action == 'setmode' && $user->rights->commande->creer) { - $object = new Commande($db); $object->fetch($id); $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); if ($result < 0) { @@ -141,7 +140,6 @@ if (empty($reshook)) { } if ($action == 'setavailability' && $user->rights->commande->creer) { - $object = new Commande($db); $object->fetch($id); $result = $object->availability(GETPOST('availability_id')); if ($result < 0) { @@ -150,7 +148,6 @@ if (empty($reshook)) { } if ($action == 'setdemandreason' && $user->rights->commande->creer) { - $object = new Commande($db); $object->fetch($id); $result = $object->demand_reason(GETPOST('demand_reason_id')); if ($result < 0) { @@ -159,7 +156,6 @@ if (empty($reshook)) { } if ($action == 'setconditions' && $user->rights->commande->creer) { - $object = new Commande($db); $object->fetch($id); $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); if ($result < 0) { @@ -175,7 +171,6 @@ if (empty($reshook)) { // shipping method if ($action == 'setshippingmethod' && $user->rights->commande->creer) { - $object = new Commande($db); $object->fetch($id); $result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int')); if ($result < 0) { @@ -185,7 +180,6 @@ if (empty($reshook)) { // warehouse if ($action == 'setwarehouse' && $user->rights->commande->creer) { - $object = new Commande($db); $object->fetch($id); $result = $object->setWarehouse(GETPOST('warehouse_id', 'int')); if ($result < 0) { diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index b3f01b00cf7..eb238941eae 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -254,4 +254,4 @@ ReOpen=Reopen ConfirmFinish=Do you confirm the closing of the inventory ? This will generate all stock movements to update your stock. ObjectNotFound=%s not found MakeMovementsAndClose=Generate movements and close -AutofillWithExpected=Auto-fill expected quantity with real quantity \ No newline at end of file +AutofillWithExpected=Fill real quantity with expected quantity \ No newline at end of file diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index cb3231389b4..bc927a06c50 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -448,23 +448,25 @@ if ($object->id > 0) { print ''.$langs->trans('UpdateByScaningLot').''; }*/ if (!empty($conf->barcode->enabled) || !empty($conf->productbatch->enabled)) { - print ''.$langs->trans("UpdateByScaning").''; + print ''.img_picto('', 'barcode', 'class="paddingrightonly"').$langs->trans("UpdateByScaning").''; } } else { - print ''.$langs->trans("Save").''."\n"; + print ''.$langs->trans("Save").''."\n"; } if ($permissiontoadd && $conf->use_javascript_ajax) { - print ' '; - print ''; + print ''.img_picto('', 'autofill', 'class="paddingrightonly"').$langs->trans('AutofillWithExpected').''; + print ''; } print '
'; From 4025488e08f34fa9a9c3fa30d7a40ce25ece95d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Apr 2021 13:19:57 +0200 Subject: [PATCH 092/140] css --- htdocs/bookmarks/bookmarks.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 950cce19420..199944165b4 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -67,7 +67,7 @@ function printDropdownBookmarksList() // Url to list bookmark $listbtn = ''; - $listbtn .= ''.$langs->trans('Bookmarks').''; + $listbtn .= img_picto('', 'bookmark', 'class="paddingright"').$langs->trans('Bookmarks').''; // Url to go on create new bookmark page $newbtn = ''; @@ -75,7 +75,7 @@ function printDropdownBookmarksList() //$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url); $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url); $newbtn .= ''; - $newbtn .= img_picto('', 'bookmark', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).''; + $newbtn .= img_picto('', 'add', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).''; } // Menu with list of bookmarks From fe7654c06789667000c5169fe0799a704a6e1a10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Apr 2021 13:34:19 +0200 Subject: [PATCH 093/140] Complete doc --- htdocs/comm/action/class/actioncomm.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 1e506526a1d..e105d011e96 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -82,16 +82,19 @@ class ActionComm extends CommonObject /** * @var int Id into parent table llx_c_actioncomm (used only if option to use type is set) + * This field is stored info fk_action. It contains the id into table llx_ac_actioncomm. */ public $type_id; /** * @var string Calendar of event (Type of type of event). 'system'=Default calendar, 'systemauto'=Auto calendar, 'birthdate', 'holiday', 'module'=Calendar specific to a module + * This field contains the type into table llx_ac_actioncomm ('system', 'systemauto', ...). It should be named 'type_type'. */ public $type; /** * @var string Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH. + * This field contains the code into table llx_ac_actioncomm. */ public $type_code; @@ -112,6 +115,7 @@ class ActionComm extends CommonObject /** * @var string Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...) + * This field is stored into field 'code' into llx_actioncomm. */ public $code; From 4016c300d27f88244dea32561f7196a18a600c3a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Apr 2021 13:38:29 +0200 Subject: [PATCH 094/140] Fix missing lin to thirdparty on some actions --- .../core/triggers/interface_50_modAgenda_ActionsAuto.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index fdd18638053..7f7cd5a77be 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -942,6 +942,8 @@ class InterfaceActionsAuto extends DolibarrTriggers $societeforaction->fetch($object->socid); } elseif (isset($object->fk_soc) && $object->fk_soc > 0) { $societeforaction->fetch($object->fk_soc); + } elseif (isset($object->thirdparty) && isset($object->thirdparty->id) && $object->thirdparty->id > 0) { + $societeforaction = $object->thirdparty; } $projectid = isset($object->fk_project) ? $object->fk_project : 0; From 7f91713c4a93fe41421b8752223de2eb073d53ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Apr 2021 14:06:30 +0200 Subject: [PATCH 095/140] Fix merge not complete --- htdocs/comm/index.php | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 54d9453971d..17f1f20718f 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -809,7 +809,6 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { } -<<<<<<< HEAD /* * Opened (validated) order */ @@ -822,14 +821,6 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { $sql .= ", s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; -======= - $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"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql .= ", ".MAIN_DB_PREFIX."commande as c"; ->>>>>>> branch '12.0' of git@github.com:Dolibarr/dolibarr.git if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE c.entity IN (".getEntity($orderstatic->element).")"; $sql .= " AND c.fk_soc = s.rowid"; @@ -862,18 +853,11 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { $orderstatic->id = $obj->commandeid; $orderstatic->ref = $obj->ref; -<<<<<<< HEAD $orderstatic->ref_client = $obj->ref_client; + $orderstatic->statut = $obj->fk_statut; $orderstatic->total_ht = $obj->total_ht; $orderstatic->total_tva = $obj->total_tva; $orderstatic->total_ttc = $obj->total_ttc; -======= - $orderstatic->statut = $obj->fk_statut; - $orderstatic->ref_client = $obj->ref_client; - $orderstatic->total_ht = $obj->total_ht; - $orderstatic->total_tva = $obj->total_tva; - $orderstatic->total_ttc = $obj->total_ttc; ->>>>>>> branch '12.0' of git@github.com:Dolibarr/dolibarr.git $companystatic->id = $obj->socid; $companystatic->name = $obj->name; From 4d243ae0729d3b805d0c69bddb5fae7247508285 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 9 Apr 2021 14:56:52 +0200 Subject: [PATCH 096/140] Update llx_10_c_regions.sql Italy Spain --- .../install/mysql/data/llx_10_c_regions.sql | 86 ++++++++++--------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index 2feb15e8436..6c25826c4ca 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -65,6 +65,8 @@ -- France -- Germany -> for Departmements -- Greece +-- Italy +-- Spain @@ -194,50 +196,50 @@ 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, 'Δυτική Μακεδονία'); --- Regions Italy (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'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 303, NULL, 1, 'Calabria'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 304, NULL, 1, 'Campania'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 305, NULL, 1, 'Emilia-Romagna'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 306, NULL, 1, 'Friuli-Venezia Giulia'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 307, NULL, 1, 'Lazio'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 308, NULL, 1, 'Liguria'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 309, NULL, 1, 'Lombardia'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 310, NULL, 1, 'Marche'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 311, NULL, 1, 'Molise'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 312, NULL, 1, 'Piemonte'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 313, NULL, 1, 'Puglia'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 314, NULL, 1, 'Sardegna'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 315, NULL, 1, 'Sicilia'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 316, NULL, 1, 'Toscana'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 317, NULL, 1, 'Trentino-Alto Adige'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 318, NULL, 1, 'Umbria'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 319, NULL, 1, 'Valle d Aosta'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 320, NULL, 1, 'Veneto'); +-- 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'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 303, NULL, 1, 'Calabria'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 304, NULL, 1, 'Campania'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 305, NULL, 1, 'Emilia-Romagna'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 306, NULL, 1, 'Friuli-Venezia Giulia'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 307, NULL, 1, 'Lazio'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 308, NULL, 1, 'Liguria'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 309, NULL, 1, 'Lombardia'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 310, NULL, 1, 'Marche'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 311, NULL, 1, 'Molise'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 312, NULL, 1, 'Piemonte'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 313, NULL, 1, 'Puglia'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 314, NULL, 1, 'Sardegna'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 315, NULL, 1, 'Sicilia'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 316, NULL, 1, 'Toscana'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 317, NULL, 1, 'Trentino-Alto Adige'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 318, NULL, 1, 'Umbria'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 319, NULL, 1, 'Valle d Aosta'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 320, NULL, 1, 'Veneto'); --- Regions Spain (id country=4) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 401, '', 0, 'Andalucia', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 402, '', 0, 'Aragón', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 403, '', 0, 'Castilla y León', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 404, '', 0, 'Castilla la Mancha', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 405, '', 0, 'Canarias', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 406, '', 0, 'Cataluña', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 407, '', 0, 'Comunidad de Ceuta', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 408, '', 0, 'Comunidad Foral de Navarra', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 409, '', 0, 'Comunidad de Melilla', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 410, '', 0, 'Cantabria', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 411, '', 0, 'Comunidad Valenciana', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 412, '', 0, 'Extemadura', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 413, '', 0, 'Galicia', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 414, '', 0, 'Islas Baleares', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 415, '', 0, 'La Rioja', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 416, '', 0, 'Comunidad de Madrid', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 417, '', 0, 'Región de Murcia', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 418, '', 0, 'Principado de Asturias', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 419, '', 0, 'Pais Vasco', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 420, '', 0, 'Otros', 1); +--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'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 404, '', 0, 'Castilla la Mancha'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 405, '', 0, 'Canarias'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 406, '', 0, 'Cataluña'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 407, '', 0, 'Comunidad de Ceuta'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 408, '', 0, 'Comunidad Foral de Navarra'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 409, '', 0, 'Comunidad de Melilla'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 410, '', 0, 'Cantabria'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 411, '', 0, 'Comunidad Valenciana'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 412, '', 0, 'Extemadura'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 413, '', 0, 'Galicia'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 414, '', 0, 'Islas Baleares'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 415, '', 0, 'La Rioja'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 416, '', 0, 'Comunidad de Madrid'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 417, '', 0, 'Región de Murcia'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 418, '', 0, 'Principado de Asturias'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 419, '', 0, 'Pais Vasco'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 420, '', 0, 'Otros'); -- Regions Switzerland (id country=6) From cf83963e5f36c86df2667fb3bd675bd093992b90 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 9 Apr 2021 15:07:32 +0200 Subject: [PATCH 097/140] Update llx_20_c_departements.sql Netherlands/Nederland --- .../mysql/data/llx_20_c_departements.sql | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index 9675fa126c8..445a970b3f9 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -52,6 +52,7 @@ -- Honduras -- (Italy) -- Luxembourg +-- Netherlands @@ -631,6 +632,21 @@ 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 (14003, 'LU0012', '', 0, '', 'Mersch'); +-- Netherlands/Nederland Provinces (id country=17) +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1701, 'GR', NULL, NULL, NULL, 'Groningen'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1701, 'FR', NULL, NULL, NULL, 'Friesland'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1701, 'DR', NULL, NULL, NULL, 'Drenthe'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1701, 'OV', NULL, NULL, NULL, 'Overijssel'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1701, 'GD', NULL, NULL, NULL, 'Gelderland'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1701, 'FL', NULL, NULL, NULL, 'Flevoland'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1701, 'UT', NULL, NULL, NULL, 'Utrecht'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1701, 'NH', NULL, NULL, NULL, 'Noord-Holland'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1701, 'ZH', NULL, NULL, NULL, 'Zuid-Holland'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1701, 'ZL', NULL, NULL, NULL, 'Zeeland'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1701, 'NB', NULL, NULL, NULL, 'Noord-Brabant'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1701, 'LB', NULL, NULL, NULL, 'Limburg'); + + -- Provinces Maroc - Moroco (id country=12) INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA', 1209, '', 0, '', 'Province de Benslimane', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA1', 1209, '', 0, '', 'Province de Berrechid', 1); @@ -1186,21 +1202,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 ('WY', 1101, '', 0, 'WYOMING', 'Wyoming', 1); --- Provincies van het Koninkrijk der Nederlanden (id country=17) -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('GR',1701,NULL,NULL,NULL,'Groningen'); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('FR',1701,NULL,NULL,NULL,'Friesland'); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('DR',1701,NULL,NULL,NULL,'Drenthe'); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('OV',1701,NULL,NULL,NULL,'Overijssel'); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('GD',1701,NULL,NULL,NULL,'Gelderland'); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('FL',1701,NULL,NULL,NULL,'Flevoland'); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('UT',1701,NULL,NULL,NULL,'Utrecht'); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('NH',1701,NULL,NULL,NULL,'Noord-Holland'); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('ZH',1701,NULL,NULL,NULL,'Zuid-Holland'); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('ZL',1701,NULL,NULL,NULL,'Zeeland'); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('NB',1701,NULL,NULL,NULL,'Noord-Brabant'); -INSERT INTO llx_c_departements ( code_departement,fk_region,cheflieu,tncc,ncc,nom) VALUES ('LB',1701,NULL,NULL,NULL,'Limburg'); - - -- San Salvador (id country=86) INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SS', 8601, '', 0, '', 'San Salvador', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SA', 8603, '', 0, '', 'Santa Ana', 1); From 19ee78e123958e0dcdde25961d1841aa4be1f2d1 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 9 Apr 2021 15:44:47 +0200 Subject: [PATCH 098/140] Close #17193 : Move button convert in webp --- htdocs/core/tpl/filemanager.tpl.php | 42 +++++++++++++++++++++++++++++ htdocs/langs/en_US/ecm.lang | 4 +++ htdocs/website/index.php | 37 +------------------------ 3 files changed, 47 insertions(+), 36 deletions(-) diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index 6ff7bba2390..bfd10e25424 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -86,6 +86,9 @@ if ($module == 'ecm') { print ''; print ''; } +if ($permtoadd) { + print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("GenerateImgWebp")).'">'; +} // Start "Add new file" area $nameforformuserfile = 'formuserfileecm'; @@ -133,6 +136,45 @@ if ($action == 'delete_section') { } // End confirm +if ($action == 'confirmconvertimgwebp') { + print $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$website->ref, $langs->trans('ConfirmImgWebpCreation'), $langs->trans('ConfirmGenerateImgWebp', $object->ref), 'convertimgwebp', '', "yes", 1); + $action = 'file_manager'; +} + +if ($action == 'convertimgwebp' && $permtoadd) { + if ($module == 'medias') { + $imagefolder = $conf->website->dir_output.'/'.$websitekey.'/medias/image/'.$websitekey.'/'; + } else { + $imagefolder = $conf->ecm->dir_output; + } + + include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + + $regeximgext = getListOfPossibleImageExt(); + + $filelist = dol_dir_list($imagefolder, "all", 1, $regeximgext); + + foreach ($filelist as $filename) { + $filepath = $filename['fullname']; + if (!(substr_compare($filepath, 'webp', -strlen('webp')) === 0)) { + if (image_format_supported($filepath) == 1) { + $filepathnoext = preg_replace("/\..*/", "", $filepath); + $result = dol_imageResizeOrCrop($filepath, 0, 0, 0, 0, 0, $filepathnoext.'.webp'); + if (!dol_is_file($result)) { + $error++; + setEventMessages($result, null, 'errors'); + } + } + } + if ($error) { + break; + } + } + if (!$error) { + setEventMessages($langs->trans('SucessConvertImgWebp'), null); + } + $action = 'file_manager'; +} if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg_match('/refresh/i', $action) || $action == 'delete') { $langs->load("ecm"); diff --git a/htdocs/langs/en_US/ecm.lang b/htdocs/langs/en_US/ecm.lang index 71df60734fb..2bac434deb0 100644 --- a/htdocs/langs/en_US/ecm.lang +++ b/htdocs/langs/en_US/ecm.lang @@ -41,3 +41,7 @@ FileNotYetIndexedInDatabase=File not yet indexed into database (try to re-upload ExtraFieldsEcmFiles=Extrafields Ecm Files ExtraFieldsEcmDirectories=Extrafields Ecm Directories ECMSetup=ECM Setup +GenerateImgWebp=Convert all images into webp +ConfirmGenerateImgWebp=If you confirm, you will generate all images in this folder and subfolder in webp format... +ConfirmImgWebpCreation=Confirm all images convertion +SucessConvertImgWebp=Images successfully converted diff --git a/htdocs/website/index.php b/htdocs/website/index.php index b7609878196..60e4b514e01 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2275,36 +2275,6 @@ if ($action == 'generatesitemaps' && $usercanedit) { $action = 'preview'; } -$imagefolder = $conf->website->dir_output.'/'.$websitekey.'/medias/image/'.$websitekey.'/'; - -if ($action == 'convertimgwebp' && $usercanedit) { - include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; - - $regeximgext = getListOfPossibleImageExt(); - - $filelist = dol_dir_list($imagefolder, "all", 1, $regeximgext); - - foreach ($filelist as $filename) { - $filepath = $filename['fullname']; - if (!(substr_compare($filepath, 'webp', -strlen('webp')) === 0)) { - if (image_format_supported($filepath) == 1) { - $filepathnoext = preg_replace("/\..*/", "", $filepath); - $result = dol_imageResizeOrCrop($filepath, 0, 0, 0, 0, 0, $filepathnoext.'.webp'); - if (!dol_is_file($result)) { - $error++; - setEventMessages($result, null, 'errors'); - } - } - } - if ($error) { - break; - } - } - if (!$error) { - setEventMessages($langs->trans('SucessConvertImgWebp'), null); - } - $action = 'preview'; -} /* * View @@ -2320,10 +2290,6 @@ if ($action == 'confirmgeneratesitemaps') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$website->ref, $langs->trans('ConfirmSitemapsCreation'), $langs->trans('ConfirmGenerateSitemaps', $object->ref), 'generatesitemaps', '', "yes", 1); $action = 'preview'; } -if ($action == 'confirmconvertimgwebp') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$website->ref, $langs->trans('ConfirmImgWebpCreation'), $langs->trans('ConfirmGenerateImgWebp', $object->ref), 'convertimgwebp', '', "yes", 1); - $action = 'preview'; -} $helpurl = 'EN:Module_Website|FR:Module_Website_FR|ES:Módulo_Website'; $arrayofjs = array( @@ -2542,7 +2508,6 @@ if (!GETPOST('hide_websitemenu')) { // Generate site map print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("GenerateSitemaps")).'">'; - print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("GenerateImgWebp")).'">'; print '   '; print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'">'; @@ -3882,7 +3847,7 @@ if ($action == 'preview') { print $formconfirm; } -if ($action == 'editfile' || $action == 'file_manager') { +if ($action == 'editfile' || $action == 'file_manager' || $action == 'convertimgwebp' || $action == 'confirmconvertimgwebp') { print ''."\n"; print '

'; //print '
'.$langs->trans("FeatureNotYetAvailable").''; From 937fe333f1a7745df43c872a9b6954968a0ee397 Mon Sep 17 00:00:00 2001 From: Ahmad Hadeed Date: Fri, 9 Apr 2021 20:49:39 +0300 Subject: [PATCH 099/140] 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 100/140] 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 101/140] 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 102/140] 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 103/140] 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 104/140] 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 105/140] 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 106/140] 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 107/140] 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 108/140] 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 109/140] 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 110/140] 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 111/140] 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 112/140] 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 113/140] 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 '
'; - // $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 "'; + // $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 "'; - $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 "'.$langs->trans("ProgressDeclared").''.$langs->trans("TimeSpent").''.$langs->trans("TimeSpentByYou").''.$langs->trans("TimeSpentByUser").''.$langs->trans("TimeSpent").'
'; -print ''; -print 'Photo'; -print ''.$langs->trans("Everybody").''; -print ''; -print '
'.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').'
'.$langs->trans("TimeSpent").'
'; + print ''; + print 'Photo'; + print ''.$langs->trans("Everybody").''; + print ''; + print '
'.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').'
'; print $langs->trans("OtherFilteredTasks"); print '
'; - print $langs->trans("Total"); - print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; - print '
'; + print $langs->trans("Total"); + print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; + print '
 
 
 
'.$langs->trans("NoAssignedTasks").'
'; - // $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 "'; + // $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 "'; - $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 "'; - // $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 "'; + // $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 "'; - $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 "'.$langs->trans("PlannedWorkload").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").''.$langs->trans("TimeSpent").''.$langs->trans("TimeSpentByYou").''.$langs->trans("TimeSpentByUser").''.$langs->trans("TimeSpent").'
'; -print ''; -print 'Photo'; -print ''.$langs->trans("Everybody").''; -print ''; -print '
'.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').'
'.$langs->trans("TimeSpent").'
'; + print ''; + print 'Photo'; + print ''.$langs->trans("Everybody").''; + print ''; + print '
'.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').'
'.$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 "
'; print $langs->trans("Total"); print ''; //print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; print ''; print $langs->trans("OtherFilteredTasks"); print ''; $timeonothertasks = ($totalforeachday[$daytoparse] - $totalforvisibletasks[$daytoparse]); @@ -745,6 +750,10 @@ if (count($tasksarray) > 0) { print ''; print $langs->trans("Total"); print ''; //print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; print ''.$langs->trans("PlannedWorkload").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").''.$langs->trans("TimeSpent").''.$langs->trans("TimeSpentByYou").''.$langs->trans("TimeSpentByUser").''.$langs->trans("TimeSpent").'
'; -print ''; -print 'Photo'; -print ''.$langs->trans("Everybody").''; -print ''; -print '
'.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').'
'.$langs->trans("TimeSpent").'
'; + print ''; + print 'Photo'; + print ''.$langs->trans("Everybody").''; + print ''; + print '
'.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').'
'; print $langs->trans("OtherFilteredTasks"); print '
'; - print $langs->trans("Total"); - print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; - print '
'; + print $langs->trans("Total"); + print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; + print '
 
 
 
'.$langs->trans("NoAssignedTasks").'
'.$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 "
'.$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 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 119/140] 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 120/140] 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 121/140] 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 122/140] 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 124/140] 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 125/140] 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 126/140] 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 6f6c9058c134080e878a14fc7c736488dba2cc17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 17:08:48 +0200 Subject: [PATCH 127/140] 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 70383cca73b3cd58750078f350055274c3d579b0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 18:49:17 +0200 Subject: [PATCH 128/140] 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 129/140] 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 130/140] 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 131/140] 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 990da5574df4cf9f1d84d1f36b018731a0b7a833 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Apr 2021 22:35:20 +0200 Subject: [PATCH 132/140] 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 133/140] 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 123/140] 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('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 134/140] 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 '
'.$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 ''; // 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 '
'; - print $langs->trans('PaymentMode'); + print $langs->trans('DefaultPaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'
'; print ''; From 97ace5e3bb738fac970f2cdcf366653cca12ea5e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Apr 2021 10:19:38 +0200 Subject: [PATCH 135/140] 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 ''; 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 136/140] 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('BankAccount'); + print $langs->trans('DefaultBankAccount'); print ''; if ($action != 'editbankaccount' && $user->rights->salaries->write) { print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; + 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 137/140] 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 138/140] 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 139/140] 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 8fa943edc3b88ce2cce75adba76a73c2580a070d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Apr 2021 14:26:09 +0200 Subject: [PATCH 140/140] 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 .= '';