From 91885c9d6fee6c785f3de70a059d07b185669043 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Fri, 22 May 2015 17:22:57 +0200 Subject: [PATCH 01/12] FIX when multicompany was enabled, this function didn't check just on the good entity (problem when both company use same mask) --- htdocs/core/class/commonobject.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e0bab998982..10e83d80595 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -65,13 +65,17 @@ abstract class CommonObject */ static function isExistingObject($element, $id, $ref='', $ref_ext='') { - global $db; + global $db,$conf; $sql = "SELECT rowid, ref, ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX.$element; - if ($id > 0) $sql.= " WHERE rowid = ".$db->escape($id); - else if ($ref) $sql.= " WHERE ref = '".$db->escape($ref)."'"; - else if ($ref_ext) $sql.= " WHERE ref_ext = '".$db->escape($ref_ext)."'"; + + if($conf->multicompany->enabled)$sql.= " WHERE entity=".$conf->entity; + else $sql.=" WHERE 1 "; + + if ($id > 0) $sql.= " AND rowid = ".$db->escape($id); + else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'"; + else if ($ref_ext) $sql.= " AND ref_ext = '".$db->escape($ref_ext)."'"; else { $error='ErrorWrongParameters'; dol_print_error(get_class()."::isExistingObject ".$error, LOG_ERR); From 44c46d68ed4a443962dbdbb8d8ad130f9ee31f82 Mon Sep 17 00:00:00 2001 From: Alexis ALGOUD Date: Sat, 23 May 2015 23:51:49 +0200 Subject: [PATCH 02/12] Remove the useless if --- htdocs/core/class/commonobject.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 10e83d80595..73019b52eef 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -70,8 +70,7 @@ abstract class CommonObject $sql = "SELECT rowid, ref, ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX.$element; - if($conf->multicompany->enabled)$sql.= " WHERE entity=".$conf->entity; - else $sql.=" WHERE 1 "; + $sql.= " WHERE entity=".$conf->entity; if ($id > 0) $sql.= " AND rowid = ".$db->escape($id); else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'"; From dd7febe2b984f0ab2c60d435279e3a0a6374a5c0 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Fri, 29 May 2015 15:10:59 +0200 Subject: [PATCH 03/12] replace test by getEntity() --- htdocs/core/class/commonobject.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 10e83d80595..03d044a2ee6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -69,9 +69,7 @@ abstract class CommonObject $sql = "SELECT rowid, ref, ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX.$element; - - if($conf->multicompany->enabled)$sql.= " WHERE entity=".$conf->entity; - else $sql.=" WHERE 1 "; + $sql.= " WHERE entity IN (".getEntity($element).")" ; if ($id > 0) $sql.= " AND rowid = ".$db->escape($id); else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'"; From 3f1613197e006e29163b4cdaa1e4c2519827e217 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 2 Jun 2015 08:41:42 +0200 Subject: [PATCH 04/12] FIX : If supplier invoice block linked element is display after other block total HT amount is not reset to 0 and sum other block (like customer orders values) --- htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index c10fea8bb8a..2f66049143e 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -40,6 +40,7 @@ else print_titre($langs->trans("RelatedBill")); trans("Status"); ?> Date: Tue, 2 Jun 2015 11:20:08 +0200 Subject: [PATCH 05/12] FIX : total amount in tpl linked object are not reset --- htdocs/expedition/tpl/linkedobjectblock.tpl.php | 1 + htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/expedition/tpl/linkedobjectblock.tpl.php b/htdocs/expedition/tpl/linkedobjectblock.tpl.php index 364afb92177..a235944bff8 100644 --- a/htdocs/expedition/tpl/linkedobjectblock.tpl.php +++ b/htdocs/expedition/tpl/linkedobjectblock.tpl.php @@ -41,6 +41,7 @@ print_titre($langs->trans('RelatedShippings')); trans("Status"); ?> trans('RelatedOrders')); trans("Status"); ?> Date: Tue, 2 Jun 2015 16:06:03 +0200 Subject: [PATCH 06/12] FIX : When we clone a propal, if it has a project which is not assigned to a third, it was not on new propal because fk_project was always set to empty string if new propal is for another third. --- htdocs/comm/propal/class/propal.class.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 3a8c9c6c0ae..775e1ad2782 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -959,8 +959,10 @@ class Propal extends CommonObject */ function createFromClone($socid=0) { - global $user,$langs,$conf,$hookmanager; - + global $db, $user,$langs,$conf,$hookmanager; + + dol_include_once('/projet/class.project.class.php'); + $this->context['createfromclone']='createfromclone'; $error=0; @@ -985,7 +987,16 @@ class Propal extends CommonObject $this->socid = $objsoc->id; $this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); $this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); - $this->fk_project = ''; + + $project = new Project($db); + + if($objFrom->fk_project > 0 && $project->fetch($objFrom->fk_project)) { + if($project->socid <= 0) $this->fk_project = $objFrom->fk_project; + else $this->fk_project = ''; + } else { + $this->fk_project = ''; + } + $this->fk_delivery_address = ''; } From 195a1b2708655a2d62d00879c574e93d22d7bcdc Mon Sep 17 00:00:00 2001 From: jfefe Date: Thu, 4 Jun 2015 18:10:29 +0200 Subject: [PATCH 07/12] FIX #2957 : missing $langs object for trigger --- htdocs/fourn/class/fournisseur.product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index b642926f802..140bc3d4230 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -156,7 +156,7 @@ class ProductFournisseur extends Product */ function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges=0, $remise_percent=0, $remise=0, $newnpr=0) { - global $conf,$mysoc; + global $conf,$mysoc, $langs; // Clean parameter if (empty($qty)) $qty=0; From e78dba809be12d616226a3faa9195c799e7ecbc7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 4 Jun 2015 15:42:51 +0200 Subject: [PATCH 08/12] Fix: PRODUCT_USE_OLD_PATH_FOR_PHOTO use entity 0 for multicompany Fix: use encrypt/decrypt with llx_const for experimental encryption of sensitive data --- .../install/mysql/migration/3.6.0-3.7.0.sql | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 080fbdc699d..b74c8ddba17 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -98,36 +98,36 @@ ALTER TABLE llx_accountingaccount add column fk_user_author integer DEFAULT NULL ALTER TABLE llx_accountingaccount add column fk_user_modif integer DEFAULT NULL AFTER fk_user_author; -- Qual -UPDATE llx_const SET name = 'ACCOUNTING_MODE' WHERE name = 'COMPTA_MODE'; -UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_CUSTOMER' WHERE name = 'COMPTA_ACCOUNT_CUSTOMER'; -UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_SUPPLIER' WHERE name = 'COMPTA_ACCOUNT_SUPPLIER'; -UPDATE llx_const SET name = 'ACCOUNTING_PRODUCT_BUY_ACCOUNT' WHERE name = 'COMPTA_PRODUCT_BUY_ACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT' WHERE name = 'COMPTA_PRODUCT_SOLD_ACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_SERVICE_BUY_ACCOUNT' WHERE name = 'COMPTA_SERVICE_BUY_ACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_SERVICE_SOLD_ACCOUNT' WHERE name = 'COMPTA_SERVICE_SOLD_ACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_VAT_ACCOUNT' WHERE name = 'COMPTA_VAT_ACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_VAT_BUY_ACCOUNT' WHERE name = 'COMPTA_VAT_BUY_ACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_MODE')__ WHERE __DECRYPT('name')__ = 'COMPTA_MODE'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_ACCOUNT_CUSTOMER')__ WHERE __DECRYPT('name')__ = 'COMPTA_ACCOUNT_CUSTOMER'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_ACCOUNT_SUPPLIER')__ WHERE __DECRYPT('name')__ = 'COMPTA_ACCOUNT_SUPPLIER'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_PRODUCT_BUY_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'COMPTA_PRODUCT_BUY_ACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_PRODUCT_SOLD_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'COMPTA_PRODUCT_SOLD_ACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_SERVICE_BUY_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'COMPTA_SERVICE_BUY_ACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_SERVICE_SOLD_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'COMPTA_SERVICE_SOLD_ACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_VAT_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'COMPTA_VAT_ACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_VAT_BUY_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'COMPTA_VAT_BUY_ACCOUNT'; -- Compatibility with module Accounting Expert -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_MODELCSV' WHERE name = 'ACCOUNTINGEX_MODELCSV'; -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_SEPARATORCSV' WHERE name = 'ACCOUNTINGEX_SEPARATORCSV'; -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_DATE' WHERE name = 'ACCOUNTINGEX_EXP_DATE'; -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_PIECE' WHERE name = 'ACCOUNTINGEX_EXP_PIECE'; -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_GLOBAL_ACCOUNT' WHERE name = 'ACCOUNTINGEX_EXP_GLOBAL_ACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_LABEL' WHERE name = 'ACCOUNTINGEX_EXP_LABEL'; -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_AMOUNT' WHERE name = 'ACCOUNTINGEX_EXP_AMOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_DEVISE' WHERE name = 'ACCOUNTINGEX_EXP_DEVISE'; -UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_SUSPENSE' WHERE name = 'ACCOUNTINGEX_ACCOUNT_SUSPENSE'; -UPDATE llx_const SET name = 'ACCOUNTING_SELL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SELL_JOURNAL'; -UPDATE llx_const SET name = 'ACCOUNTING_PURCHASE_JOURNAL' WHERE name = 'ACCOUNTINGEX_PURCHASE_JOURNAL'; -UPDATE llx_const SET name = 'ACCOUNTING_SOCIAL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SOCIAL_JOURNAL'; -UPDATE llx_const SET name = 'ACCOUNTING_MISCELLANEOUS_JOURNAL' WHERE name = 'ACCOUNTINGEX_MISCELLANEOUS_JOURNAL'; -UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_TRANSFER_CASH' WHERE name = 'ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH'; -UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_GACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_GACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_AACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_AACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_LIMIT_LIST_VENTILATION' WHERE name = 'ACCOUNTINGEX_LIMIT_LIST_VENTILATION'; -UPDATE llx_const SET name = 'ACCOUNTING_LIST_SORT_VENTILATION_TODO' WHERE name = 'ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO'; -UPDATE llx_const SET name = 'ACCOUNTING_LIST_SORT_VENTILATION_DONE' WHERE name = 'ACCOUNTINGEX_LIST_SORT_VENTILATION_DONE'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_MODELCSV')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_MODELCSV'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_SEPARATORCSV')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_SEPARATORCSV'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_DATE')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_EXP_DATE'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_PIECE')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_EXP_PIECE'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_GLOBAL_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_EXP_GLOBAL_ACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_LABEL')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_EXP_LABEL'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_AMOUNT')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_EXP_AMOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_DEVISE')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_EXP_DEVISE'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_ACCOUNT_SUSPENSE')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_ACCOUNT_SUSPENSE'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_SELL_JOURNAL')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_SELL_JOURNAL'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_PURCHASE_JOURNAL')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_PURCHASE_JOURNAL'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_SOCIAL_JOURNAL')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_SOCIAL_JOURNAL'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_MISCELLANEOUS_JOURNAL')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_MISCELLANEOUS_JOURNAL'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_ACCOUNT_TRANSFER_CASH')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_LENGTH_GACCOUNT')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_LENGTH_GACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_LENGTH_AACCOUNT')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_LENGTH_AACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_LIMIT_LIST_VENTILATION')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_LIMIT_LIST_VENTILATION'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_LIST_SORT_VENTILATION_TODO')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_LIST_SORT_VENTILATION_DONE')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_LIST_SORT_VENTILATION_DONE'; -- Drop old table DROP TABLE llx_compta; @@ -1133,9 +1133,9 @@ ALTER TABLE llx_c_email_templates ADD UNIQUE INDEX uk_c_email_templates(entity, ALTER TABLE llx_c_email_templates ADD INDEX idx_type(type_template); -- Remove OSC module -DELETE FROM llx_const WHERE name = 'MAIN_MODULE_BOUTIQUE'; -DELETE FROM llx_const WHERE name = 'OSC_DB_HOST'; -DELETE FROM llx_menu WHERE module = 'boutique'; +DELETE FROM llx_const WHERE __DECRYPT('name')__ = 'MAIN_MODULE_BOUTIQUE'; +DELETE FROM llx_const WHERE __DECRYPT('name')__ = 'OSC_DB_HOST'; +DELETE FROM llx_menu WHERE __DECRYPT('module')__ = 'boutique'; -- Add option always editable on extrafield ALTER TABLE llx_extrafields ADD alwayseditable INTEGER DEFAULT 0 AFTER pos; @@ -1177,4 +1177,4 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_typ ALTER TABLE llx_livraison MODIFY COLUMN date_delivery DATETIME NULL DEFAULT NULL; -INSERT INTO llx_const (name, value, type, note, visible, entity) SELECT 'PRODUCT_USE_OLD_PATH_FOR_PHOTO','1','chaine','Use old path for products images',1,1 FROM llx_const WHERE name='MAIN_VERSION_LAST_INSTALL' AND value < '3.7.0'; +INSERT INTO llx_const (name, value, type, note, visible, entity) SELECT __ENCRYPT('PRODUCT_USE_OLD_PATH_FOR_PHOTO')__,__ENCRYPT('1')__,'chaine','Use old path for products images',1,0 FROM llx_const WHERE __DECRYPT('name')__ = 'MAIN_VERSION_LAST_INSTALL' AND __DECRYPT('value')__ <= '3.7.2'; From f7493de50c4c16bf698f04b4d887a9f67442a1d7 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 5 Jun 2015 13:42:29 +0200 Subject: [PATCH 09/12] Fix : supplier order clone was buggy if notes contains apostrophe --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 8e618ba0eee..b69818bbdb1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -911,8 +911,8 @@ class CommandeFournisseur extends CommonOrder $sql.= " VALUES ("; $sql.= "''"; $sql.= ", '".$this->ref_supplier."'"; - $sql.= ", '".$this->note_private."'"; - $sql.= ", '".$this->note_public."'"; + $sql.= ", '".$this->db->escape($this->note_private)."'"; + $sql.= ", '".$this->db->escape($this->note_public)."'"; $sql.= ", ".$conf->entity; $sql.= ", ".$this->socid; $sql.= ", '".$this->db->idate($now)."'"; From b57f0a0e5fb4ab17565551bcc1f70fdd31054abf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jun 2015 18:32:49 +0200 Subject: [PATCH 10/12] Fix option to use old path for product is for compatibility if user come from 3.6 or lower. Must not be enabled on 3.7.0 or +. --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index b74c8ddba17..f6282edf369 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -1177,4 +1177,5 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_typ ALTER TABLE llx_livraison MODIFY COLUMN date_delivery DATETIME NULL DEFAULT NULL; -INSERT INTO llx_const (name, value, type, note, visible, entity) SELECT __ENCRYPT('PRODUCT_USE_OLD_PATH_FOR_PHOTO')__,__ENCRYPT('1')__,'chaine','Use old path for products images',1,0 FROM llx_const WHERE __DECRYPT('name')__ = 'MAIN_VERSION_LAST_INSTALL' AND __DECRYPT('value')__ <= '3.7.2'; +-- This constant is for compatibility if user come from 3.6 or lower. Must not be enabled on 3.7.0 or + +INSERT INTO llx_const (name, value, type, note, visible, entity) SELECT __ENCRYPT('PRODUCT_USE_OLD_PATH_FOR_PHOTO')__,__ENCRYPT('1')__,'chaine','Use old path for products images',1,0 FROM llx_const WHERE __DECRYPT('name')__ = 'MAIN_VERSION_LAST_INSTALL' AND __DECRYPT('value')__ < '3.7.0'; From 536f565d4e4105844e536a3e573da54ab6e50aff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Jun 2015 02:43:51 +0200 Subject: [PATCH 11/12] Fix Return value is always utf8 encoded and without entities. --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index a9663d447bc..e124c312a77 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -352,7 +352,7 @@ function getState($id,$withcode='',$dbtouse=0) } else { - return $langs->trans("NotDefined"); + return $langs->transnoentitiesnoconv("NotDefined"); } } else dol_print_error($dbtouse,''); From de0dd5da603e93998e9e38d745788ff0fd1dad64 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 8 Jun 2015 09:13:21 +0200 Subject: [PATCH 12/12] Fix: Drop foreign key for avoid Mysql crash --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index f6282edf369..57f29ef9a90 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -208,10 +208,14 @@ UPDATE llx_product SET fk_barcode_type = NULL WHERE fk_barcode_type NOT IN (SELE ALTER TABLE llx_product_price ADD INDEX idx_product_price_fk_user_author (fk_user_author); UPDATE llx_product_price set fk_user_author = null where fk_user_author = 0; UPDATE llx_product_price set fk_user_author = null where fk_user_author not in (select rowid from llx_user); +-- drop foreign key for avoid a mysql crash +ALTER TABLE llx_product_price DROP FOREIGN KEY fk_product_price_user_author; ALTER TABLE llx_product_price ADD CONSTRAINT fk_product_price_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); -- fk_product ALTER TABLE llx_product_price ADD INDEX idx_product_price_fk_product (fk_product); DELETE from llx_product_price where fk_product NOT IN (SELECT rowid from llx_product); +-- drop foreign key for avoid a mysql crash +ALTER TABLE llx_product_price DROP FOREIGN KEY fk_product_price_product; ALTER TABLE llx_product_price ADD CONSTRAINT fk_product_price_product FOREIGN KEY (fk_product) REFERENCES llx_product (rowid); ALTER TABLE llx_commande_fournisseur MODIFY COLUMN date_livraison datetime;