From 33b915abbe1c6f378d7713b3c599cc9119a6b4b4 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 17 Feb 2025 13:18:20 +0100 Subject: [PATCH 1/7] NEW Better presentation of list of user approver. --- htdocs/fourn/commande/index.php | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 25f6d7e4f90..a5c6a8f75f9 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -235,14 +235,14 @@ if (isModEnabled("supplier_order")) { /* - * List of users allowed + * List of users allowed to approve */ $sql = "SELECT"; if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) { $sql .= " DISTINCT"; } -$sql .= " u.rowid, u.lastname, u.firstname, u.email, u.statut"; +$sql .= " u.rowid, u.login, u.lastname, u.firstname, u.email, u.photo, u.statut"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) { $sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug"; @@ -252,7 +252,7 @@ if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_ } else { $sql .= " WHERE (u.entity IN (".getEntity('user')."))"; } -$sql .= " AND u.fk_soc IS NULL"; // An external user can not approved +$sql .= " AND u.fk_soc IS NULL"; // An external user can not approve $resql = $db->query($sql); if ($resql) { @@ -264,6 +264,9 @@ if ($resql) { print ''.$langs->trans("UserWithApproveOrderGrant").''; print "\n"; + print ''; + print ''; + while ($i < $num) { $obj = $db->fetch_object($resql); @@ -272,19 +275,29 @@ if ($resql) { $userstatic->loadRights('fournisseur'); if ($userstatic->hasRight('fournisseur', 'commande', 'approuver')) { - print ''; - print ''; + if ($i > 0) { + print ', '; + } + $userstatic->lastname = $obj->lastname; $userstatic->firstname = $obj->firstname; $userstatic->email = $obj->email; + $userstatic->login = $obj->login; + $userstatic->photo = $obj->photo; $userstatic->status = $obj->statut; - print $userstatic->getNomUrl(1); - print ''; - print "\n"; + + print $userstatic->getNomUrl(-1); } $i++; } + if ($i == 0) { + print ''.$langs->trans("Nobody").''; + } + + print ''; + print "\n"; + print "
"; $db->free($resql); } else { From 3339ca0ed7b10d18a6dee4a163062807bbbf62da Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 17 Feb 2025 13:45:16 +0100 Subject: [PATCH 2/7] Standardize category tables --- .../install/mysql/migration/21.0.0-22.0.0.sql | 64 +++++++++++++++++++ ... => llx_categorie_invoice-facture.key.sql} | 0 ....sql => llx_categorie_invoice-facture.sql} | 0 .../mysql/tables/llx_categorie_member.sql | 5 +- ...l => llx_categorie_order-commande.key.sql} | 0 ...r.sql => llx_categorie_order-commande.sql} | 0 ... => llx_categorie_warehouse-stock.key.sql} | 0 ....sql => llx_categorie_warehouse-stock.sql} | 0 .../mysql/tables/llx_category_bank.sql | 27 -------- .../mysql/tables/llx_category_bankline.sql | 3 +- 10 files changed, 69 insertions(+), 30 deletions(-) rename htdocs/install/mysql/tables/{llx_categorie_invoice.key.sql => llx_categorie_invoice-facture.key.sql} (100%) rename htdocs/install/mysql/tables/{llx_categorie_invoice.sql => llx_categorie_invoice-facture.sql} (100%) rename htdocs/install/mysql/tables/{llx_categorie_order.key.sql => llx_categorie_order-commande.key.sql} (100%) rename htdocs/install/mysql/tables/{llx_categorie_order.sql => llx_categorie_order-commande.sql} (100%) rename htdocs/install/mysql/tables/{llx_categorie_warehouse.key.sql => llx_categorie_warehouse-stock.key.sql} (100%) rename htdocs/install/mysql/tables/{llx_categorie_warehouse.sql => llx_categorie_warehouse-stock.sql} (100%) delete mode 100644 htdocs/install/mysql/tables/llx_category_bank.sql diff --git a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql index 4cf68ce85ad..f873d5e7a23 100644 --- a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql +++ b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql @@ -58,3 +58,67 @@ ALTER TABLE llx_holiday_config ADD UNIQUE INDEX idx_holiday_config (entity, name ALTER TABLE llx_societe_account ADD COLUMN ip varchar(250); ALTER TABLE llx_product ADD COLUMN packaging float(24,8) DEFAULT NULL; + + +ALTER TABLE llx_categorie_member ADD COLUMN import_key varchar(14); +ALTER TABLE llx_category_bankline ADD COLUMN import_key varchar(14); + + +create table llx_categorie_order +( + fk_categorie integer NOT NULL, + fk_order integer NOT NULL, + import_key varchar(14) +)ENGINE=innodb; + +--ALTER TABLE llx_categorie_order ADD PRIMARY KEY pk_categorie_order(fk_categorie, fk_order); +ALTER TABLE llx_categorie_order ADD INDEX idx_categorie_order_fk_categorie (fk_categorie); +ALTER TABLE llx_categorie_order ADD INDEX idx_categorie_order_fk_order (fk_order); + +ALTER TABLE llx_categorie_order ADD CONSTRAINT fk_categorie_order_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); +ALTER TABLE llx_categorie_order ADD CONSTRAINT fk_categorie_order_fk_order_rowid FOREIGN KEY (fk_order) REFERENCES llx_commande (rowid); + + +create table llx_categorie_invoice +( + fk_categorie integer NOT NULL, + fk_invoice integer NOT NULL, + import_key varchar(14) +)ENGINE=innodb; + +ALTER TABLE llx_categorie_invoice ADD PRIMARY KEY pk_categorie_invoice (fk_categorie, fk_invoice); +ALTER TABLE llx_categorie_invoice ADD INDEX idx_categorie_invoice_fk_categorie (fk_categorie); +ALTER TABLE llx_categorie_invoice ADD INDEX idx_categorie_invoice_fk_invoice (fk_invoice); + +ALTER TABLE llx_categorie_invoice ADD CONSTRAINT fk_categorie_invoice_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); +ALTER TABLE llx_categorie_invoice ADD CONSTRAINT fk_categorie_invoice_fk_invoice_rowid FOREIGN KEY (fk_invoice) REFERENCES llx_facture (rowid); + + +create table llx_categorie_supplier_order +( + fk_categorie integer NOT NULL, + fk_supplier_order integer NOT NULL, + import_key varchar(14) +)ENGINE=innodb; + +ALTER TABLE llx_categorie_supplier_order ADD PRIMARY KEY pk_categorie_supplier_order (fk_categorie, fk_supplier_order); +ALTER TABLE llx_categorie_supplier_order ADD INDEX idx_categorie_supplier_order_fk_categorie (fk_categorie); +ALTER TABLE llx_categorie_supplier_order ADD INDEX idx_categorie_supplier_order_fk_supplier_order (fk_supplier_order); + +ALTER TABLE llx_categorie_supplier_order ADD CONSTRAINT fk_categorie_supplier_order_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); +ALTER TABLE llx_categorie_supplier_order ADD CONSTRAINT fk_categorie_supplier_order_fk_supplier_order_rowid FOREIGN KEY (fk_supplier_order) REFERENCES llx_commande_fournisseur (rowid); + + +create table llx_categorie_supplier_invoice +( + fk_categorie integer NOT NULL, + fk_supplier_invoice integer NOT NULL, + import_key varchar(14) +)ENGINE=innodb; + +ALTER TABLE llx_categorie_supplier_invoice ADD PRIMARY KEY pk_categorie_supplier_invoice (fk_categorie, fk_supplier_invoice); +ALTER TABLE llx_categorie_supplier_invoice ADD INDEX idx_categorie_supplier_invoice_fk_categorie (fk_categorie); +ALTER TABLE llx_categorie_supplier_invoice ADD INDEX idx_categorie_supplier_invoice_fk_supplier_invoice (fk_supplier_invoice); + +ALTER TABLE llx_categorie_supplier_invoice ADD CONSTRAINT fk_categorie_supplier_invoice_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); +ALTER TABLE llx_categorie_supplier_invoice ADD CONSTRAINT fk_categorie_supplier_invoice_fk_supplier_invoice_rowid FOREIGN KEY (fk_supplier_invoice) REFERENCES llx_facture_fourn (rowid); diff --git a/htdocs/install/mysql/tables/llx_categorie_invoice.key.sql b/htdocs/install/mysql/tables/llx_categorie_invoice-facture.key.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_categorie_invoice.key.sql rename to htdocs/install/mysql/tables/llx_categorie_invoice-facture.key.sql diff --git a/htdocs/install/mysql/tables/llx_categorie_invoice.sql b/htdocs/install/mysql/tables/llx_categorie_invoice-facture.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_categorie_invoice.sql rename to htdocs/install/mysql/tables/llx_categorie_invoice-facture.sql diff --git a/htdocs/install/mysql/tables/llx_categorie_member.sql b/htdocs/install/mysql/tables/llx_categorie_member.sql index b8ffedffc1e..0d911afb671 100644 --- a/htdocs/install/mysql/tables/llx_categorie_member.sql +++ b/htdocs/install/mysql/tables/llx_categorie_member.sql @@ -1,6 +1,6 @@ -- ============================================================================ -- Copyright (C) 2005 Brice Davoleau --- Copyright (C) 2005-2010 Matthieu Valleton +-- Copyright (C) 2005-2010 Matthieu Valleton -- -- 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 @@ -20,5 +20,6 @@ create table llx_categorie_member ( fk_categorie integer NOT NULL, - fk_member integer NOT NULL + fk_member integer NOT NULL, + import_key varchar(14) )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_categorie_order.key.sql b/htdocs/install/mysql/tables/llx_categorie_order-commande.key.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_categorie_order.key.sql rename to htdocs/install/mysql/tables/llx_categorie_order-commande.key.sql diff --git a/htdocs/install/mysql/tables/llx_categorie_order.sql b/htdocs/install/mysql/tables/llx_categorie_order-commande.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_categorie_order.sql rename to htdocs/install/mysql/tables/llx_categorie_order-commande.sql diff --git a/htdocs/install/mysql/tables/llx_categorie_warehouse.key.sql b/htdocs/install/mysql/tables/llx_categorie_warehouse-stock.key.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_categorie_warehouse.key.sql rename to htdocs/install/mysql/tables/llx_categorie_warehouse-stock.key.sql diff --git a/htdocs/install/mysql/tables/llx_categorie_warehouse.sql b/htdocs/install/mysql/tables/llx_categorie_warehouse-stock.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_categorie_warehouse.sql rename to htdocs/install/mysql/tables/llx_categorie_warehouse-stock.sql diff --git a/htdocs/install/mysql/tables/llx_category_bank.sql b/htdocs/install/mysql/tables/llx_category_bank.sql deleted file mode 100644 index 10ed331b069..00000000000 --- a/htdocs/install/mysql/tables/llx_category_bank.sql +++ /dev/null @@ -1,27 +0,0 @@ --- =================================================================== --- Copyright (C) 2004-2007 Laurent Destailleur --- Copyright (C) 2005-2009 Regis Houssin --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . --- --- =================================================================== - --- TODO : Remove this file, content of this table has been moved into llx_categories table - -create table llx_category_bank -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - label varchar(255), - entity integer DEFAULT 1 NOT NULL -- multi company id -)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_category_bankline.sql b/htdocs/install/mysql/tables/llx_category_bankline.sql index 61112c3bec8..65d54e4e029 100644 --- a/htdocs/install/mysql/tables/llx_category_bankline.sql +++ b/htdocs/install/mysql/tables/llx_category_bankline.sql @@ -20,5 +20,6 @@ create table llx_category_bankline ( lineid integer NOT NULL, - fk_categ integer NOT NULL + fk_categ integer NOT NULL, + import_key varchar(14) )ENGINE=innodb; From d800b721fd662b23dcc5d16425e40c4a09b72935 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 17 Feb 2025 13:52:52 +0100 Subject: [PATCH 3/7] Standardize category tables --- htdocs/install/mysql/migration/21.0.0-22.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql index f873d5e7a23..7764d425405 100644 --- a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql +++ b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql @@ -71,7 +71,7 @@ create table llx_categorie_order import_key varchar(14) )ENGINE=innodb; ---ALTER TABLE llx_categorie_order ADD PRIMARY KEY pk_categorie_order(fk_categorie, fk_order); +ALTER TABLE llx_categorie_order ADD PRIMARY KEY pk_categorie_order (fk_categorie, fk_order); ALTER TABLE llx_categorie_order ADD INDEX idx_categorie_order_fk_categorie (fk_categorie); ALTER TABLE llx_categorie_order ADD INDEX idx_categorie_order_fk_order (fk_order); From 9af5292cc3cb1eadea7f168709d48d396dbe4e01 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 17 Feb 2025 13:58:47 +0100 Subject: [PATCH 4/7] Standardize category tables --- htdocs/install/mysql/migration/21.0.0-22.0.0.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql index 7764d425405..51cdda10be8 100644 --- a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql +++ b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql @@ -71,7 +71,8 @@ create table llx_categorie_order import_key varchar(14) )ENGINE=innodb; -ALTER TABLE llx_categorie_order ADD PRIMARY KEY pk_categorie_order (fk_categorie, fk_order); +ALTER TABLE llx_categorie_order ADD PRIMARY KEY pk_categorie_order (fk_categorie, fk_order); -- noqa: PRS + ALTER TABLE llx_categorie_order ADD INDEX idx_categorie_order_fk_categorie (fk_categorie); ALTER TABLE llx_categorie_order ADD INDEX idx_categorie_order_fk_order (fk_order); From 8e411b3ead63092a32805de28ce5741fea1a83d4 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 17 Feb 2025 13:59:59 +0100 Subject: [PATCH 5/7] Standardize category tables --- htdocs/install/mysql/migration/21.0.0-22.0.0.sql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql index 51cdda10be8..4b6e2c10de7 100644 --- a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql +++ b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql @@ -71,8 +71,7 @@ create table llx_categorie_order import_key varchar(14) )ENGINE=innodb; -ALTER TABLE llx_categorie_order ADD PRIMARY KEY pk_categorie_order (fk_categorie, fk_order); -- noqa: PRS - +ALTER TABLE llx_categorie_order ADD PRIMARY KEY pk_categorie_order (fk_categorie, fk_order); -- noqa: PRS ALTER TABLE llx_categorie_order ADD INDEX idx_categorie_order_fk_categorie (fk_categorie); ALTER TABLE llx_categorie_order ADD INDEX idx_categorie_order_fk_order (fk_order); From fc96a88bd93f7e3cb027dd485a42805de8ed7a88 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 17 Feb 2025 14:01:16 +0100 Subject: [PATCH 6/7] Standardize category tables --- htdocs/install/mysql/migration/21.0.0-22.0.0.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql index 4b6e2c10de7..e497ac34a96 100644 --- a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql +++ b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql @@ -71,7 +71,9 @@ create table llx_categorie_order import_key varchar(14) )ENGINE=innodb; -ALTER TABLE llx_categorie_order ADD PRIMARY KEY pk_categorie_order (fk_categorie, fk_order); -- noqa: PRS +--noqa:disable=PRS +ALTER TABLE llx_categorie_order ADD PRIMARY KEY pk_categorie_order (fk_categorie, fk_order); +--noqa:enable=all ALTER TABLE llx_categorie_order ADD INDEX idx_categorie_order_fk_categorie (fk_categorie); ALTER TABLE llx_categorie_order ADD INDEX idx_categorie_order_fk_order (fk_order); From 5de4d8a1668d2e95dca6be78a3bd6c0cd2935162 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 17 Feb 2025 14:02:39 +0100 Subject: [PATCH 7/7] Standardize category tables --- .../install/mysql/migration/21.0.0-22.0.0.sql | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql index e497ac34a96..7b9c19450b4 100644 --- a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql +++ b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql @@ -72,8 +72,8 @@ create table llx_categorie_order )ENGINE=innodb; --noqa:disable=PRS -ALTER TABLE llx_categorie_order ADD PRIMARY KEY pk_categorie_order (fk_categorie, fk_order); ---noqa:enable=all +ALTER TABLE llx_categorie_order ADD PRIMARY KEY pk_categorie_order(fk_categorie, fk_order); +--noqa:enable=PRS ALTER TABLE llx_categorie_order ADD INDEX idx_categorie_order_fk_categorie (fk_categorie); ALTER TABLE llx_categorie_order ADD INDEX idx_categorie_order_fk_order (fk_order); @@ -88,7 +88,9 @@ create table llx_categorie_invoice import_key varchar(14) )ENGINE=innodb; -ALTER TABLE llx_categorie_invoice ADD PRIMARY KEY pk_categorie_invoice (fk_categorie, fk_invoice); +--noqa:disable=PRS +ALTER TABLE llx_categorie_invoice ADD PRIMARY KEY pk_categorie_invoice(fk_categorie, fk_invoice); +--noqa:enable=PRS ALTER TABLE llx_categorie_invoice ADD INDEX idx_categorie_invoice_fk_categorie (fk_categorie); ALTER TABLE llx_categorie_invoice ADD INDEX idx_categorie_invoice_fk_invoice (fk_invoice); @@ -103,7 +105,9 @@ create table llx_categorie_supplier_order import_key varchar(14) )ENGINE=innodb; -ALTER TABLE llx_categorie_supplier_order ADD PRIMARY KEY pk_categorie_supplier_order (fk_categorie, fk_supplier_order); +--noqa:disable=PRS +ALTER TABLE llx_categorie_supplier_order ADD PRIMARY KEY pk_categorie_supplier_order(fk_categorie, fk_supplier_order); +--noqa:enable=PRS ALTER TABLE llx_categorie_supplier_order ADD INDEX idx_categorie_supplier_order_fk_categorie (fk_categorie); ALTER TABLE llx_categorie_supplier_order ADD INDEX idx_categorie_supplier_order_fk_supplier_order (fk_supplier_order); @@ -118,7 +122,10 @@ create table llx_categorie_supplier_invoice import_key varchar(14) )ENGINE=innodb; -ALTER TABLE llx_categorie_supplier_invoice ADD PRIMARY KEY pk_categorie_supplier_invoice (fk_categorie, fk_supplier_invoice); +--noqa:disable=PRS +ALTER TABLE llx_categorie_supplier_invoice ADD PRIMARY KEY pk_categorie_supplier_invoice(fk_categorie, fk_supplier_invoice); +--noqa:enable=PRS + ALTER TABLE llx_categorie_supplier_invoice ADD INDEX idx_categorie_supplier_invoice_fk_categorie (fk_categorie); ALTER TABLE llx_categorie_supplier_invoice ADD INDEX idx_categorie_supplier_invoice_fk_supplier_invoice (fk_supplier_invoice);