diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 07446f6bd0e..c09affcb2b1 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -198,12 +198,15 @@ class Conf // Sharings between entities if ($this->multicompany->enabled) { - dol_include_once('/multicompany/class/actions_multicompany.class.php'); - $mc = new ActionsMulticompany($db); - - foreach($multicompany_sharing as $key => $value) + $ret = @dol_include_once('/multicompany/class/actions_multicompany.class.php'); + if ($ret) { - $this->entities[$key]=$mc->check_entity($value); + $mc = new ActionsMulticompany($db); + + foreach($multicompany_sharing as $key => $value) + { + $this->entities[$key]=$mc->check_entity($value); + } } } } diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index c9fa4985326..4e153ac0f3e 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -125,6 +125,10 @@ define('MAIN_DB_PREFIX',(isset($dolibarr_main_db_prefix)?$dolibarr_main_db_prefi define('DOL_CLASS_PATH', 'class/'); // Filsystem path to class dir define('DOL_DATA_ROOT',(isset($dolibarr_main_data_root)?$dolibarr_main_data_root:'')); +if (! empty($dolibarr_main_document_root_alt)) +{ + define('DOL_DOCUMENT_ROOT_ALT', $dolibarr_main_document_root_alt); // Filesystem paths to alternate core php (alternate htdocs) +} define('DOL_MAIN_URL_ROOT', (isset($dolibarr_main_url_root)?$dolibarr_main_url_root:'')); // URL relative root $uri=preg_replace('/^http(s?):\/\//i','',constant('DOL_MAIN_URL_ROOT')); // $uri contains url without http* $suburi = strstr ($uri, '/'); // $suburi contains url without domain diff --git a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql index 4f05d82fdb5..62d3233261b 100755 --- a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql +++ b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql @@ -85,6 +85,10 @@ INSERT INTO llx_c_source (rowid,code,label,active) VALUES (7, 'SRC_06', 'Magasin ALTER TABLE llx_actioncomm ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER id; +ALTER TABLE llx_propaldet ADD INDEX idx_propaldet_fk_product (fk_product); +ALTER TABLE llx_commandedet ADD INDEX idx_commandedet_fk_product (fk_product); +ALTER TABLE llx_facturedet ADD INDEX idx_facturedet_fk_product (fk_product); + --Add Chile data -- Regions Chile (id pays=67) INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6701, 6701, 67, NULL, NULL, 'Tarapacá', 1); diff --git a/htdocs/install/mysql/tables/llx_commandedet.key.sql b/htdocs/install/mysql/tables/llx_commandedet.key.sql index a94e26c9ee1..d1b39863cab 100644 --- a/htdocs/install/mysql/tables/llx_commandedet.key.sql +++ b/htdocs/install/mysql/tables/llx_commandedet.key.sql @@ -1,5 +1,6 @@ -- =================================================================== -- Copyright (C) 2006 Laurent Destailleur +-- Copyright (C) 2011 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 @@ -21,4 +22,6 @@ ALTER TABLE llx_commandedet ADD INDEX idx_commandedet_fk_commande (fk_commande); +ALTER TABLE llx_commandedet ADD INDEX idx_commandedet_fk_product (fk_product); + ALTER TABLE llx_commandedet ADD CONSTRAINT fk_commandedet_fk_commande FOREIGN KEY (fk_commande) REFERENCES llx_commande (rowid); diff --git a/htdocs/install/mysql/tables/llx_contratdet.key.sql b/htdocs/install/mysql/tables/llx_contratdet.key.sql index d14f61a854b..3757e4522bf 100644 --- a/htdocs/install/mysql/tables/llx_contratdet.key.sql +++ b/htdocs/install/mysql/tables/llx_contratdet.key.sql @@ -1,6 +1,7 @@ -- ============================================================================ -- Copyright (C) 2004 Rodolphe Quiedeville -- Copyright (C) 2005 Laurent Destailleur +-- Copyright (C) 2011 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 diff --git a/htdocs/install/mysql/tables/llx_facturedet.key.sql b/htdocs/install/mysql/tables/llx_facturedet.key.sql index bc2d8976966..6b8f7176dee 100644 --- a/htdocs/install/mysql/tables/llx_facturedet.key.sql +++ b/htdocs/install/mysql/tables/llx_facturedet.key.sql @@ -1,5 +1,6 @@ -- =================================================================== -- Copyright (C) 2005 Laurent Destailleur +-- Copyright (C) 2011 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 @@ -23,5 +24,6 @@ -- V4 DELETE llx_facturedet FROM llx_facturedet LEFT JOIN llx_facture ON llx_facturedet.fk_facture = llx_facture.rowid WHERE llx_facture.rowid IS NULL; ALTER TABLE llx_facturedet ADD INDEX idx_facturedet_fk_facture (fk_facture); +ALTER TABLE llx_facturedet ADD INDEX idx_facturedet_fk_product (fk_product); ALTER TABLE llx_facturedet ADD UNIQUE INDEX uk_fk_remise_except (fk_remise_except, fk_facture); ALTER TABLE llx_facturedet ADD CONSTRAINT fk_facturedet_fk_facture FOREIGN KEY (fk_facture) REFERENCES llx_facture (rowid); diff --git a/htdocs/install/mysql/tables/llx_propaldet.key.sql b/htdocs/install/mysql/tables/llx_propaldet.key.sql index 8b45e7693af..e7fc66a0ed6 100644 --- a/htdocs/install/mysql/tables/llx_propaldet.key.sql +++ b/htdocs/install/mysql/tables/llx_propaldet.key.sql @@ -1,5 +1,5 @@ -- =================================================================== --- Copyright (C) 2009 Regis Houssin +-- Copyright (C) 2009-2011 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 @@ -21,4 +21,6 @@ ALTER TABLE llx_propaldet ADD INDEX idx_propaldet_fk_propal (fk_propal); +ALTER TABLE llx_propaldet ADD INDEX idx_propaldet_fk_product (fk_product); + ALTER TABLE llx_propaldet ADD CONSTRAINT fk_propaldet_fk_propal FOREIGN KEY (fk_propal) REFERENCES llx_propal (rowid); diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index cdaf9c1ff8b..2300a5f46fb 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -34,7 +34,6 @@ // For compatibility during upgrade if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '..'); -if (! defined('DOL_DOCUMENT_ROOT_ALT')) define('DOL_DOCUMENT_ROOT_ALT', ''); // If option not enabled, we keep it disabled but avoid warning if (! defined('ADODB_DATE_VERSION')) include_once(DOL_DOCUMENT_ROOT."/includes/adodbtime/adodb-time.inc.php"); /**