New: early development of multi-company module

This commit is contained in:
Regis Houssin 2009-04-17 11:31:06 +00:00
parent cd6dc716cf
commit 177f6b8db5
3 changed files with 7 additions and 29 deletions

View File

@ -394,9 +394,6 @@ class DolibarrModules
$err = 0;
// Removed because create pb of compatibility
// if ($this->family == "base") $conf->entity = 0; // Common module
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const ";
$sql.= "WHERE name = '".$this->const_name."' ";
$sql.= "AND entity = ".$conf->entity;
@ -425,9 +422,6 @@ class DolibarrModules
$err = 0;
// Removed because create pb of compatibility
// if ($this->family == "base") $conf->entity = 0; // Common module
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const ";
$sql.= "WHERE name = '".$this->const_name."'";
$sql.= "AND entity = ".$conf->entity;

View File

@ -204,9 +204,11 @@ class modMultiCompany extends DolibarrModules
{
$sql = array();
//$result=$this->load_tables();
$init = $this->_init($sql);
$result=$this->load_tables('/multicompany/sql/init/');
return $this->_init($sql);
return $init;
}
/**
@ -219,6 +221,7 @@ class modMultiCompany extends DolibarrModules
{
$sql = array();
$result=$this->load_tables('/multicompany/sql/remove/');
$result = $this->destroy_cookie();
return $this->_remove($sql);
@ -232,9 +235,9 @@ class modMultiCompany extends DolibarrModules
* This function is called by this->init.
* \return int <=0 if KO, >0 if OK
*/
function load_tables()
function load_tables($path)
{
return $this->_load_tables('/multicompany/sql/');
return $this->_load_tables($path);
}
/**

View File

@ -1,19 +0,0 @@
-- Copyright (C) 2009 Regis Houssin <regis@dolibarr.fr>
--
-- 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$
--