New: early development of multi-company module
This commit is contained in:
parent
200923595f
commit
c52636bd38
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
|
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
|
||||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
|
* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -55,31 +55,21 @@ class Conf
|
|||||||
|
|
||||||
var $logbuffer=array();
|
var $logbuffer=array();
|
||||||
|
|
||||||
var $entity = 1; // By default for backward compatibility
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Positionne toutes les variables de configuration
|
* \brief Positionne toutes les variables de configuration
|
||||||
* \param $db Handler d'acces base
|
* \param $db Handler d'acces base
|
||||||
|
* \param $entity Id of company
|
||||||
* \return int < 0 si erreur, >= 0 si succes
|
* \return int < 0 si erreur, >= 0 si succes
|
||||||
*/
|
*/
|
||||||
function setValues($db)
|
function setValues($db,$entity)
|
||||||
{
|
{
|
||||||
dol_syslog("Conf::setValues");
|
dol_syslog("Conf::setValues");
|
||||||
|
|
||||||
// Par defaut, a oui
|
// Par defaut, a oui
|
||||||
$this->global->PRODUIT_CONFIRM_DELETE_LINE=1;
|
$this->global->PRODUIT_CONFIRM_DELETE_LINE=1;
|
||||||
|
|
||||||
// Load entity cookie
|
$this->entity = $entity;
|
||||||
/* 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";
|
|
||||||
if (!$_COOKIE[$entityCookieName]){
|
|
||||||
$this->entity = 1;
|
|
||||||
}else{
|
|
||||||
$this->entity = $_COOKIE[$entityCookieName];
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Definition de toutes les Constantes globales d'environnement
|
* Definition de toutes les Constantes globales d'environnement
|
||||||
@ -87,7 +77,7 @@ class Conf
|
|||||||
* - En $this->global->key=value
|
* - En $this->global->key=value
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT name, value, entity FROM ".MAIN_DB_PREFIX."const ";
|
$sql = "SELECT name, value, entity FROM ".MAIN_DB_PREFIX."const ";
|
||||||
$sql.= " WHERE entity = 0 OR entity = ".$this->entity;
|
$sql.= " WHERE entity = 0 OR entity = ".$entity;
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2008 Matteli
|
* Copyright (C) 2008 Matteli
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -268,13 +268,12 @@ if (! isset($_SESSION["dol_login"]))
|
|||||||
{
|
{
|
||||||
$entitytotest=$_POST["entity"];
|
$entitytotest=$_POST["entity"];
|
||||||
|
|
||||||
// Creation du cookie
|
// Create entity cookie
|
||||||
$entityCookieName = "DOLENTITYID_dolibarr";
|
$entityCookieName = "DOLENTITYID_dolibarr";
|
||||||
if (!isset($HTTP_COOKIE_VARS[$entityCookieName]))
|
if (!isset($HTTP_COOKIE_VARS[$entityCookieName]))
|
||||||
{
|
{
|
||||||
setcookie($entityCookieName, $entitytotest, 0, "/", "", 0);
|
setcookie($entityCookieName, $entitytotest, 0, "/", "", 0);
|
||||||
}
|
}
|
||||||
//$conf->entity = $_COOKIE[$entityCookieName];
|
|
||||||
// Reload index.php
|
// Reload index.php
|
||||||
$url=DOL_URL_ROOT."/index.php";
|
$url=DOL_URL_ROOT."/index.php";
|
||||||
header("Location: ".$url);
|
header("Location: ".$url);
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <andre.cianfarani@acdeveloppement.net>
|
* Copyright (C) 2006 Andre Cianfarani <andre.cianfarani@acdeveloppement.net>
|
||||||
*
|
*
|
||||||
@ -204,7 +204,9 @@ if (! defined('NOREQUIREUSER'))
|
|||||||
*/
|
*/
|
||||||
if (! defined('NOREQUIREDB'))
|
if (! defined('NOREQUIREDB'))
|
||||||
{
|
{
|
||||||
$conf->setValues($db);
|
$entityCookieName = "DOLENTITYID_dolibarr";
|
||||||
|
$entity = $_COOKIE[$entityCookieName]?$_COOKIE[$entityCookieName]:1;
|
||||||
|
$conf->setValues($db,$entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
|
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
|
||||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user