diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index 8d2bfda24b6..6342db6918c 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -234,7 +234,9 @@ while (($file = readdir($handle))!==false)
$classname = "mod_facture_".$file;
$module = new $classname($db);
- if ($module->version == 'development' && ! $conf->global->MAIN_ENABLE_DEVELOPMENT) continue;
+ // Show modules according to features level
+ if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
+ if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var = !$var;
print '
\n | ".$modCodeTiers->nom." | \n ";
diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php
index 46482c231a7..d378a4d4a2f 100644
--- a/htdocs/install/upgrade2.php
+++ b/htdocs/install/upgrade2.php
@@ -334,7 +334,7 @@ function migrate_paiements_orphelins_1($db,$langs,$conf)
$res = 0;
for ($i = 0 ; $i < sizeof($row) ; $i++)
{
- if ($conf->MAIN_ENABLE_DEVELOPMENT) print '* '.$row[$i]['datec'].' paymentid='.$row[$i]['paymentid'].' pamount='.$row[$i]['pamount'].' fk_bank='.$row[$i]['fk_bank'].' bamount='.$row[$i]['bamount'].' socid='.$row[$i]['socid'].' ';
+ if ($conf->global->MAIN_FEATURES_LEVEL == 2) print '* '.$row[$i]['datec'].' paymentid='.$row[$i]['paymentid'].' pamount='.$row[$i]['pamount'].' fk_bank='.$row[$i]['fk_bank'].' bamount='.$row[$i]['bamount'].' socid='.$row[$i]['socid'].' ';
// On cherche facture sans lien paiement et du meme montant et pour meme societe.
$sql=" SELECT distinct f.rowid from ".MAIN_DB_PREFIX."facture as f";
@@ -442,7 +442,7 @@ function migrate_paiements_orphelins_2($db,$langs,$conf)
$res = 0;
for ($i = 0 ; $i < sizeof($row) ; $i++)
{
- if ($conf->MAIN_ENABLE_DEVELOPMENT) print '* '.$row[$i]['datec'].' paymentid='.$row[$i]['paymentid'].' '.$row[$i]['pamount'].' fk_bank='.$row[$i]['fk_bank'].' '.$row[$i]['bamount'].' socid='.$row[$i]['socid'].' ';
+ if ($conf->global->MAIN_FEATURES_LEVEL == 2) print '* '.$row[$i]['datec'].' paymentid='.$row[$i]['paymentid'].' '.$row[$i]['pamount'].' fk_bank='.$row[$i]['fk_bank'].' '.$row[$i]['bamount'].' socid='.$row[$i]['socid'].' ';
// On cherche facture sans lien paiement et du meme montant et pour meme societe.
$sql=" SELECT distinct f.rowid from ".MAIN_DB_PREFIX."facture as f";
diff --git a/htdocs/theme/auguria/auguria.css.php b/htdocs/theme/auguria/auguria.css.php
index 757db7e39fb..d06d1037a0e 100644
--- a/htdocs/theme/auguria/auguria.css.php
+++ b/htdocs/theme/auguria/auguria.css.php
@@ -31,7 +31,7 @@ require("../../conf/conf.php");
header('Content-type: text/css');
// Important: Avoid page request by browser and dynamic build at
// each Dolibarr page access.
-if (! $conf->global->MAIN_ENABLE_DEVELOPMENT)
+if (! $conf->global->MAIN_FEATURES_LEVEL)
{
//header('Cache-Control: max-age=3600, public, must-revalidate');
}
diff --git a/htdocs/theme/eldy/eldy.css.php b/htdocs/theme/eldy/eldy.css.php
index 4be8ddd92f0..075997fbe31 100644
--- a/htdocs/theme/eldy/eldy.css.php
+++ b/htdocs/theme/eldy/eldy.css.php
@@ -33,7 +33,7 @@ require("../../conf/conf.php");
header('Content-type: text/css');
// Important: Avoid page request by browser and dynamic build at
// each Dolibarr page access.
-if (! $conf->global->MAIN_ENABLE_DEVELOPMENT)
+if (! $conf->global->MAIN_FEATURES_LEVEL)
{
header('Cache-Control: max-age=3600, public, must-revalidate');
}
diff --git a/htdocs/theme/freelug/freelug.css.php b/htdocs/theme/freelug/freelug.css.php
index 9458b981454..9accb1ed7e7 100644
--- a/htdocs/theme/freelug/freelug.css.php
+++ b/htdocs/theme/freelug/freelug.css.php
@@ -32,7 +32,7 @@ require("../../conf/conf.php");
header('Content-type: text/css');
// Important: Avoid page request by browser and dynamic build at
// each Dolibarr page access.
-if (! $conf->global->MAIN_ENABLE_DEVELOPMENT)
+if (! $conf->global->MAIN_FEATURES_LEVEL)
{
header('Cache-Control: max-age=3600, public, must-revalidate');
}
diff --git a/htdocs/theme/yellow/yellow.css.php b/htdocs/theme/yellow/yellow.css.php
index 89bc79c8ccc..026b7f54c01 100644
--- a/htdocs/theme/yellow/yellow.css.php
+++ b/htdocs/theme/yellow/yellow.css.php
@@ -32,7 +32,7 @@ require("../../conf/conf.php");
header('Content-type: text/css');
// Important: Avoid page request by browser and dynamic build at
// each Dolibarr page access.
-if (! $conf->global->MAIN_ENABLE_DEVELOPMENT)
+if (! $conf->global->MAIN_FEATURES_LEVEL)
{
header('Cache-Control: max-age=3600, public, must-revalidate');
}
diff --git a/mysql/data/data.sql b/mysql/data/data.sql
index c5f82318172..96c00f85627 100644
--- a/mysql/data/data.sql
+++ b/mysql/data/data.sql
@@ -65,7 +65,7 @@ insert into llx_const (name, value, type, note, visible) values ('MAIN_MAIL_EMAI
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,visible,note) values('MAIN_ENABLE_DEVELOPMENT','0','yesno',1,'Make development modules visible');
+insert into llx_const(name,value,type,visible,note) values('MAIN_FEATURES_LEVEL','0','chaine',1,'Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development');
insert into llx_const(name,value,type,visible,note) values('MAIN_FASTSEARCH_COMPANY','1','yesno',0,'Show form for quick company search');
insert into llx_const(name,value,type,visible,note) values('MAIN_FASTSEARCH_CONTACT','1','yesno',0,'Show form for quick contact search');
diff --git a/mysql/migration/2.1.0-2.2.0.sql b/mysql/migration/2.1.0-2.2.0.sql
index 3fde2dca2a8..fd04c72262b 100644
--- a/mysql/migration/2.1.0-2.2.0.sql
+++ b/mysql/migration/2.1.0-2.2.0.sql
@@ -40,8 +40,9 @@ ALTER TABLE llx_cotisation modify datef date;
ALTER TABLE llx_cotisation ADD UNIQUE INDEX uk_cotisation (fk_adherent,dateadh);
-- V4.1 update llx_cotisation set datef = ADDDATE(ADDDATE(dateadh, INTERVAL 1 YEAR),INTERVAL -1 DAY);
-update llx_const set name='MAIN_ENABLE_DEVELOPMENT' where name='MAIN_SHOW_DEVELOPMENT_MODULES';
delete from llx_const where name='MAIN_SHOW_DEVELOPMENT_MODULES';
+delete from llx_const where name='MAIN_ENABLE_DEVELOPMENT';
+insert into llx_const(name,value,type,visible,note) values('MAIN_FEATURES_LEVEL','0','chaine',1,'Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development');
update llx_const set name='MAIN_MAIL_EMAIL_FROM' where name='NOTIFICATION_EMAIL_FROM';
|