New: early development of multi-company module

This commit is contained in:
Regis Houssin 2009-05-04 12:43:18 +00:00
parent 37ef88c97b
commit 4022d5f404
5 changed files with 35 additions and 69 deletions

View File

@ -409,16 +409,19 @@ class DolibarrModules
global $conf;
$err = 0;
// Common module
$entity = ((isset($this->always_enabled)||(isset($this->core_enabled)) ? 0 : $conf->entity);
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE name = '".$this->const_name."'";
$sql.= " AND entity = ".$conf->entity;
$sql.= " AND entity = ".$entity;
dol_syslog("DolibarrModules::_active sql=".$sql, LOG_DEBUG);
$this->db->query($sql);
$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,".$entity.")";
dol_syslog("DolibarrModules::_active sql=".$sql, LOG_DEBUG);
if (!$this->db->query($sql))

View File

@ -20,30 +20,4 @@
--
-- Constantes communes de configuration
--
UPDATE llx_const SET entity=0 WHERE name='MAIN_MODULE_MULTICOMPANY' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_MODULE_USER' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_POPUP_CALENDAR' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_MAIL_SMTP_SERVER' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_MAIL_SMTP_PORT' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_UPLOAD_DOC' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_FEATURES_LEVEL' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SEARCHFORM_SOCIETE' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SEARCHFORM_CONTACT' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SEARCHFORM_PRODUITSERVICE' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SEARCHFORM_ADHERENT' AND entity=1;
--
-- IHM
--
UPDATE llx_const SET entity=0 WHERE name='MAIN_SIZE_LISTE_LIMIT' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SHOW_WORKBOARD' AND entity=1;
--
-- Tiers
--
UPDATE llx_const SET entity=0 WHERE name='SOCIETE_NOLIST_COURRIER' AND entity=1;
--
-- Barcode
--
UPDATE llx_const SET entity=0 WHERE name='GENBARCODE_LOCATION' AND entity=1;
-- UPDATE llx_const SET entity=0 WHERE name='MAIN_MODULE_MULTICOMPANY' AND entity=1;

View File

@ -20,30 +20,4 @@
--
-- Constantes communes de configuration
--
DELETE FROM llx_const WHERE name='MAIN_MODULE_MULTICOMPANY';
UPDATE llx_const SET entity=1 WHERE name='MAIN_MODULE_USER' AND entity=0;
UPDATE llx_const SET entity=1 WHERE name='MAIN_POPUP_CALENDAR' AND entity=0;
UPDATE llx_const SET entity=1 WHERE name='MAIN_MAIL_SMTP_SERVER' AND entity=0;
UPDATE llx_const SET entity=1 WHERE name='MAIN_MAIL_SMTP_PORT' AND entity=0;
UPDATE llx_const SET entity=1 WHERE name='MAIN_UPLOAD_DOC' AND entity=0;
UPDATE llx_const SET entity=1 WHERE name='MAIN_FEATURES_LEVEL' AND entity=0;
UPDATE llx_const SET entity=1 WHERE name='MAIN_SEARCHFORM_SOCIETE' AND entity=0;
UPDATE llx_const SET entity=1 WHERE name='MAIN_SEARCHFORM_CONTACT' AND entity=0;
UPDATE llx_const SET entity=1 WHERE name='MAIN_SEARCHFORM_PRODUITSERVICE' AND entity=0;
UPDATE llx_const SET entity=1 WHERE name='MAIN_SEARCHFORM_ADHERENT' AND entity=0;
--
-- IHM
--
UPDATE llx_const SET entity=1 WHERE name='MAIN_SIZE_LISTE_LIMIT' AND entity=0;
UPDATE llx_const SET entity=1 WHERE name='MAIN_SHOW_WORKBOARD' AND entity=0;
--
-- Tiers
--
UPDATE llx_const SET entity=1 WHERE name='SOCIETE_NOLIST_COURRIER' AND entity=0;
--
-- Barcode
--
UPDATE llx_const SET entity=1 WHERE name='GENBARCODE_LOCATION' AND entity=0;
-- DELETE FROM llx_const WHERE name='MAIN_MODULE_MULTICOMPANY';

View File

@ -57,30 +57,30 @@ insert into llx_action_def (rowid,code,titre,description,objet_type) values (3,'
insert into llx_const (name, value, type, note, visible) values ('MAIN_NOT_INSTALLED','1','chaine','Setup is running',1);
insert into llx_const (name, value, type, note, visible) values ('MAIN_MONNAIE','EUR','chaine','Monnaie',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_POPUP_CALENDAR','eldy','chaine','Popup calendar module',0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_POPUP_CALENDAR','eldy','chaine','Popup calendar module',0,0);
insert into llx_const (name, value, type, note, visible) values ('SYSLOG_FILE','dolibarr.log','chaine','Directory where to write log file',0);
insert into llx_const (name, value, type, note, visible) values ('SYSLOG_LEVEL','6','chaine','Level of debug info to show',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_MAIL_SMTP_SERVER','','chaine','Host or ip address for SMTP server',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_MAIL_SMTP_PORT','','chaine','Port for SMTP server',0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_SMTP_SERVER','','chaine','Host or ip address for SMTP server',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_SMTP_PORT','','chaine','Port for SMTP server',0,0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_MAIL_EMAIL_FROM','dolibarr-robot@domain.com','chaine','EMail emetteur pour les emails automatiques Dolibarr',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_UPLOAD_DOC','2048','chaine','Max size for file upload (0 means no upload allowed)',0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_UPLOAD_DOC','2048','chaine','Max size for file upload (0 means no upload allowed)',0,0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_FEATURES_LEVEL','0','chaine','Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development',1);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_FEATURES_LEVEL','0','chaine','Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development',1,0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_SEARCHFORM_SOCIETE','1','yesno','Show form for quick company search',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_SEARCHFORM_CONTACT','1','yesno','Show form for quick contact search',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_SEARCHFORM_PRODUITSERVICE' ,'1','yesno','Show form for quick product search',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_SEARCHFORM_ADHERENT','1','yesno','Show form for quick member search',0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SEARCHFORM_SOCIETE','1','yesno','Show form for quick company search',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SEARCHFORM_CONTACT','1','yesno','Show form for quick contact search',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SEARCHFORM_PRODUITSERVICE' ,'1','yesno','Show form for quick product search',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SEARCHFORM_ADHERENT','1','yesno','Show form for quick member search',0,0);
--
-- IHM
--
insert into llx_const (name, value, type, note, visible) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Longueur maximum des listes',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_SHOW_WORKBOARD','1','yesno','Affichage tableau de bord de travail Dolibarr',0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Longueur maximum des listes',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SHOW_WORKBOARD','1','yesno','Affichage tableau de bord de travail Dolibarr',0,0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_MENU_BARRETOP','eldy_backoffice.php','chaine','Module de gestion de la barre de menu du haut pour utilisateurs internes',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_MENUFRONT_BARRETOP','eldy_frontoffice.php','chaine','Module de gestion de la barre de menu du haut pour utilisateurs externes',0);
@ -107,7 +107,7 @@ insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_TRA
--
-- Tiers
--
insert into llx_const (name, value, type, note, visible) values('SOCIETE_NOLIST_COURRIER','1','yesno','Liste les fichiers du repertoire courrier',0);
insert into llx_const (name, value, type, note, visible, entity) values('SOCIETE_NOLIST_COURRIER','1','yesno','Liste les fichiers du repertoire courrier',0,0);
insert into llx_const (name, value, type, note, visible) values('SOCIETE_CODECLIENT_ADDON','mod_codeclient_leopard','yesno','Module to control third parties codes',0);
insert into llx_const (name, value, type, note, visible) values('SOCIETE_CODECOMPTA_ADDON','mod_codecompta_panicum','yesno','Module to control third parties codes',0);

View File

@ -86,4 +86,19 @@ ALTER TABLE llx_facture_fourn ADD UNIQUE INDEX uk_facture_fourn_ref (facnumber,
ALTER TABLE llx_livraison ADD UNIQUE INDEX idx_livraison_uk_ref (ref, entity);
ALTER TABLE llx_fichinter ADD UNIQUE INDEX uk_fichinter_ref (ref, entity);
ALTER TABLE llx_contrat ADD UNIQUE INDEX uk_contrat_ref (ref, entity);
ALTER TABLE llx_dolibarr_modules ADD PRIMARY KEY (numero, entity);
ALTER TABLE llx_dolibarr_modules ADD PRIMARY KEY (numero, entity);
UPDATE llx_const SET entity=0 WHERE name='MAIN_MODULE_USER' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_POPUP_CALENDAR' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_MAIL_SMTP_SERVER' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_MAIL_SMTP_PORT' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_UPLOAD_DOC' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_FEATURES_LEVEL' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SEARCHFORM_SOCIETE' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SEARCHFORM_CONTACT' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SEARCHFORM_PRODUITSERVICE' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SEARCHFORM_ADHERENT' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SIZE_LISTE_LIMIT' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SHOW_WORKBOARD' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='SOCIETE_NOLIST_COURRIER' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='GENBARCODE_LOCATION' AND entity=1;