Fix pb of compatibility
This commit is contained in:
parent
2efd3db4c8
commit
200923595f
@ -45,8 +45,8 @@ class Conf
|
|||||||
|
|
||||||
var $dol_document_root;
|
var $dol_document_root;
|
||||||
|
|
||||||
var $monnaie; // Used to store current currency
|
var $monnaie; // Used to store current currency
|
||||||
var $css; // Used to store current css (from theme)
|
var $css; // Used to store current css (from theme)
|
||||||
var $top_menu;
|
var $top_menu;
|
||||||
var $left_menu;
|
var $left_menu;
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ class Conf
|
|||||||
|
|
||||||
var $logbuffer=array();
|
var $logbuffer=array();
|
||||||
|
|
||||||
var $entity;
|
var $entity = 1; // By default for backward compatibility
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -71,12 +71,15 @@ class Conf
|
|||||||
$this->global->PRODUIT_CONFIRM_DELETE_LINE=1;
|
$this->global->PRODUIT_CONFIRM_DELETE_LINE=1;
|
||||||
|
|
||||||
// Load entity cookie
|
// Load entity cookie
|
||||||
|
/* TODO Removed: La classe conf est une classe de stockage de conf independante
|
||||||
|
de la couche presentation et de la gestion des acces IHM, donc ne doit pas acceder des cookies.
|
||||||
$entityCookieName = "DOLENTITYID_dolibarr";
|
$entityCookieName = "DOLENTITYID_dolibarr";
|
||||||
if (!$_COOKIE[$entityCookieName]){
|
if (!$_COOKIE[$entityCookieName]){
|
||||||
$this->entity = 1;
|
$this->entity = 1;
|
||||||
}else{
|
}else{
|
||||||
$this->entity = $_COOKIE[$entityCookieName];
|
$this->entity = $_COOKIE[$entityCookieName];
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Definition de toutes les Constantes globales d'environnement
|
* Definition de toutes les Constantes globales d'environnement
|
||||||
|
|||||||
@ -393,7 +393,8 @@ class DolibarrModules
|
|||||||
|
|
||||||
$err = 0;
|
$err = 0;
|
||||||
|
|
||||||
if ($this->family == "base") $conf->entity = 0; // Common module
|
// Removed because create pb of compatibility
|
||||||
|
// if ($this->family == "base") $conf->entity = 0; // Common module
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const ";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const ";
|
||||||
$sql.= "WHERE name = '".$this->const_name."' ";
|
$sql.= "WHERE name = '".$this->const_name."' ";
|
||||||
@ -402,7 +403,7 @@ class DolibarrModules
|
|||||||
$this->db->query($sql);
|
$this->db->query($sql);
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible,entity) VALUES";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible,entity) VALUES";
|
||||||
$sql.= " ('".$this->const_name."','1',0,".$conf->entity.")";
|
$sql.= " ('".$this->const_name."','1',0,".$conf->entity.")";
|
||||||
dol_syslog("DolibarrModules::_active sql=".$sql, LOG_DEBUG);
|
dol_syslog("DolibarrModules::_active sql=".$sql, LOG_DEBUG);
|
||||||
if (!$this->db->query($sql))
|
if (!$this->db->query($sql))
|
||||||
{
|
{
|
||||||
@ -423,7 +424,8 @@ class DolibarrModules
|
|||||||
|
|
||||||
$err = 0;
|
$err = 0;
|
||||||
|
|
||||||
if ($this->family == "base") $conf->entity = 0; // Common module
|
// Removed because create pb of compatibility
|
||||||
|
// if ($this->family == "base") $conf->entity = 0; // Common module
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const ";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const ";
|
||||||
$sql.= "WHERE name = '".$this->const_name."'";
|
$sql.= "WHERE name = '".$this->const_name."'";
|
||||||
|
|||||||
@ -126,4 +126,5 @@ ALTER TABLE llx_categorie_association ADD UNIQUE INDEX uk_categorie_association_
|
|||||||
-- Multi company
|
-- Multi company
|
||||||
ALTER TABLE llx_const ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER tms;
|
ALTER TABLE llx_const ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER tms;
|
||||||
ALTER TABLE llx_const DROP INDEX name;
|
ALTER TABLE llx_const DROP INDEX name;
|
||||||
ALTER TABLE llx_const ADD UNIQUE INDEX(name, entity);
|
|
||||||
|
ALTER TABLE llx_const ADD UNIQUE INDEX uk_const (name, entity);
|
||||||
|
|||||||
22
mysql/tables/llx_const.key.sql
Normal file
22
mysql/tables/llx_const.key.sql
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
-- ============================================================================
|
||||||
|
-- Copyright (C) 2009 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 2 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, write to the Free Software
|
||||||
|
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
--
|
||||||
|
-- $Id$
|
||||||
|
-- ============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE llx_const ADD UNIQUE INDEX uk_const (name, entity);
|
||||||
@ -34,9 +34,8 @@ create table llx_const
|
|||||||
visible tinyint DEFAULT 1 NOT NULL,
|
visible tinyint DEFAULT 1 NOT NULL,
|
||||||
note text,
|
note text,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
entity integer DEFAULT 1 NOT NULL -- multi company id
|
||||||
UNIQUE INDEX(name)
|
) type=innodb;
|
||||||
)type=innodb;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- List of codes for the field entity
|
-- List of codes for the field entity
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user