From 1fc04d5b5c018f7b399cf39de5a6fa1d33ec2b0c Mon Sep 17 00:00:00 2001 From: fhenry Date: Tue, 30 Apr 2013 13:56:03 +0200 Subject: [PATCH 1/3] Add table extrafield for commande fournisseur... Seems this module work as separate from order but config is missing. Try to create a new one. --- .../install/mysql/migration/3.3.0-3.4.0.sql | 9 ++++++ ...x_commande_fournisseur_extrafields.key.sql | 19 ++++++++++++ .../llx_commande_fournisseur_extrafields.sql | 29 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_commande_fournisseur_extrafields.key.sql create mode 100644 htdocs/install/mysql/tables/llx_commande_fournisseur_extrafields.sql diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 755de6d1034..3dc15055e24 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -356,3 +356,12 @@ UPDATE llx_extrafields SET elementtype='socpeople' WHERE elementtype='contact'; UPDATE llx_extrafields SET elementtype='actioncomm' WHERE elementtype='action'; UPDATE llx_extrafields SET elementtype='adherent' WHERE elementtype='member'; UPDATE llx_extrafields SET elementtype='societe' WHERE elementtype='company'; + +create table llx_commande_fournisseur_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) +) ENGINE=innodb; +ALTER TABLE llx_commande_fournisseur_extrafields ADD INDEX idx_commande_fournisseur_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur_extrafields.key.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur_extrafields.key.sql new file mode 100644 index 00000000000..2d4af196186 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_commande_fournisseur_extrafields.key.sql @@ -0,0 +1,19 @@ +-- ============================================================================ +-- Copyright (C) 2013 Florian Henry +-- +-- 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 . +-- +-- ============================================================================ + +ALTER TABLE llx_commande_fournisseur_extrafields ADD INDEX idx_commande_fournisseur_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur_extrafields.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur_extrafields.sql new file mode 100644 index 00000000000..33d72f3cede --- /dev/null +++ b/htdocs/install/mysql/tables/llx_commande_fournisseur_extrafields.sql @@ -0,0 +1,29 @@ +-- =================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- Copyright (C) 2005-2012 Regis Houssin +-- Copyright (C) 2007 Laurent Destailleur +-- Copyright (C) 2010 Juanjo Menent +-- Copyright (C) 2013 Florian HENRY +-- +-- 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 . +-- +-- =================================================================== + +create table llx_commande_fournisseur_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) +) ENGINE=innodb; From 3b6efd569da3e017e225df3f550a50de34fc16d1 Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 1 May 2013 17:09:08 +0200 Subject: [PATCH 2/3] Fix bug [ bug #861 ] Erreur de droit groupe et utilisateur --- htdocs/core/lib/security.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 4acfd4912c6..e19ed1eb7fa 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -215,7 +215,9 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature { foreach($feature2 as $subfeature) { - if (empty($user->rights->$feature->$subfeature->creer) && empty($user->rights->$feature->$subfeature->write)) $createok=0; + if (empty($user->rights->$feature->$subfeature->creer) + && empty($user->rights->$feature->$subfeature->write) + && empty($user->rights->$feature->$subfeature->create)) $createok=0; else { $createok=1; break; } // For bypass the second test if the first is ok } } From 8d6f959d31f7a2276a7d779f823f54292f57f3eb Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 1 May 2013 22:57:03 +0200 Subject: [PATCH 3/3] Fix [ bug #864 ] fournisseur_extrafields --- .../fourn/class/fournisseur.facture.class.php | 11 ++++++++ .../install/mysql/migration/3.3.0-3.4.0.sql | 9 +++++++ .../llx_facture_fourn_extrafields.key.sql | 20 ++++++++++++++ .../tables/llx_facture_fourn_extrafields.sql | 26 +++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100755 htdocs/install/mysql/tables/llx_facture_fourn_extrafields.key.sql create mode 100755 htdocs/install/mysql/tables/llx_facture_fourn_extrafields.sql diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 06d5a64a8c8..31a8fc85b77 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -659,6 +659,17 @@ class FactureFournisseur extends CommonInvoice } } } + + // Remove extrafields + if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + { + $result=$this->deleteExtraFields(); + if ($result < 0) + { + $error++; + dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); + } + } if (! $error) { diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 3dc15055e24..9a3f073f40d 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -365,3 +365,12 @@ create table llx_commande_fournisseur_extrafields import_key varchar(14) ) ENGINE=innodb; ALTER TABLE llx_commande_fournisseur_extrafields ADD INDEX idx_commande_fournisseur_extrafields (fk_object); + +create table llx_facture_fourn_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; +ALTER TABLE llx_facture_fourn_extrafields ADD INDEX idx_facture_fourn_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_facture_fourn_extrafields.key.sql b/htdocs/install/mysql/tables/llx_facture_fourn_extrafields.key.sql new file mode 100755 index 00000000000..3c51231d036 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_facture_fourn_extrafields.key.sql @@ -0,0 +1,20 @@ +-- =================================================================== +-- Copyright (C) 2013 Jean-Francois FERRY +-- +-- 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 . +-- +-- =================================================================== + + +ALTER TABLE llx_facture_fourn_extrafields ADD INDEX idx_facture_fourn_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_facture_fourn_extrafields.sql b/htdocs/install/mysql/tables/llx_facture_fourn_extrafields.sql new file mode 100755 index 00000000000..d523856d999 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_facture_fourn_extrafields.sql @@ -0,0 +1,26 @@ +-- ======================================================================== +-- Copyright (C) 2013 Florian Henry +-- +-- 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 . +-- +-- ======================================================================== + +create table llx_facture_fourn_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; +