diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php index 38ed6a37fde..fe444960b53 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 b66dc079262..6999d2da27b 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 00000000000..92cae17ef07 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_oauth_state.sql @@ -0,0 +1,25 @@ +-- ============================================================================ +-- Copyright (C) 2013 Laurent Destailleur +-- +-- 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_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 00000000000..5dd5cd0507f --- /dev/null +++ b/htdocs/install/mysql/tables/llx_oauth_token.sql @@ -0,0 +1,25 @@ +-- ============================================================================ +-- Copyright (C) 2013 Laurent Destailleur +-- +-- 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_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 84d11e3ff99..5a4b9681536 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;