diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php index 38ed6a37fde626362f09d90f4e62836100b0db30..fe444960b531db8e9faeef31986dc7906bf498a0 100644 --- a/htdocs/core/modules/modOauth.class.php +++ b/htdocs/core/modules/modOauth.class.php @@ -138,11 +138,6 @@ class modOauth extends DolibarrModules // Clean before activation $this->remove($options); - $sql = array( - "CREATE TABLE IF NOT EXISTS ".MAIN_DB_PREFIX."oauth_state (rowid int(11) NOT NULL AUTO_INCREMENT, service varchar(36), state varchar(128), fk_user int(11), fk_adherent int(11), entity int(11), PRIMARY KEY (rowid)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;", - "CREATE TABLE IF NOT EXISTS ".MAIN_DB_PREFIX."oauth_token (rowid int(11) NOT NULL AUTO_INCREMENT, service varchar(36), token text, fk_user int(11), fk_adherent int(11), entity int(11), PRIMARY KEY (rowid)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;", - ); - return $this->_init($sql,$options); } } diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index b66dc079262b7c044dd81eec3a1e5768ddc91754..6999d2da27bc2608e949904ea2519549d0b749bd 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -481,6 +481,23 @@ update llx_stock_mouvement set batch = '000000' where batch = 'Undefined'; -- At end (higher risk of error) -- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT; + ALTER TABLE llx_product_batch ADD UNIQUE INDEX uk_product_batch (fk_product_stock, batch); +CREATE TABLE llx_oauth_token ( + rowid integer AUTO_INCREMENT PRIMARY KEY, + service varchar(36), + token text, + fk_user integer, + fk_adherent integer, + entity integer +)ENGINE=InnoDB; +CREATE TABLE llx_oauth_state ( + rowid integer AUTO_INCREMENT PRIMARY KEY, + service varchar(36), + state varchar(128), + fk_user integer, + fk_adherent integer, + entity integer +)ENGINE=InnoDB; diff --git a/htdocs/install/mysql/tables/llx_oauth_state.sql b/htdocs/install/mysql/tables/llx_oauth_state.sql new file mode 100644 index 0000000000000000000000000000000000000000..92cae17ef077c52e935b4dde50f521b039b05e6e --- /dev/null +++ b/htdocs/install/mysql/tables/llx_oauth_state.sql @@ -0,0 +1,25 @@ +-- ============================================================================ +-- Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net> +-- +-- 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 <http://www.gnu.org/licenses/>. +-- ============================================================================ + +CREATE TABLE llx_oauth_state ( + rowid integer AUTO_INCREMENT PRIMARY KEY, + service varchar(36), + state varchar(128), + fk_user integer, + fk_adherent integer, + entity integer +)ENGINE=InnoDB; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_oauth_token.sql b/htdocs/install/mysql/tables/llx_oauth_token.sql new file mode 100644 index 0000000000000000000000000000000000000000..5dd5cd0507f6c42635c27ff4e30cc5391010cf10 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_oauth_token.sql @@ -0,0 +1,25 @@ +-- ============================================================================ +-- Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net> +-- +-- 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 <http://www.gnu.org/licenses/>. +-- ============================================================================ + +CREATE TABLE llx_oauth_token ( + rowid integer AUTO_INCREMENT PRIMARY KEY, + service varchar(36), + token text, + fk_user integer, + fk_adherent integer, + entity integer +)ENGINE=InnoDB; \ No newline at end of file diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 84d11e3ff9962ada2171f246eb9fc0be71c97bcf..5a4b96815367cfcd352050ee37e0a810074b90a1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1353,7 +1353,8 @@ class Product extends CommonObject } $this->buyprice = $obj->price; // deprecated $this->fourn_pu = $obj->price / $obj->quantity; // Prix unitaire du produit pour le fournisseur $fourn_id - $this->ref_fourn = $obj->ref_fourn; // Ref supplier + $this->ref_fourn = $obj->ref_fourn; // deprecated + $this->ref_supplier = $obj->ref_fourn; // Ref supplier $this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier $result=$obj->fk_product; return $result;