diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php
index 0efcf15ff0d..57393943104 100644
--- a/htdocs/admin/barcode.php
+++ b/htdocs/admin/barcode.php
@@ -101,8 +101,11 @@ while (($file = readdir($handle))!==false)
// 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;
-
- $barcodelist[$filebis]=$module->info();
+
+ if ($module->isEnabled())
+ {
+ $barcodelist[$filebis]=$module->info();
+ }
}
}
}
diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php
index f390020fedb..f6a8921793d 100644
--- a/htdocs/admin/commande.php
+++ b/htdocs/admin/commande.php
@@ -205,51 +205,54 @@ if ($handle)
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 '
*
* 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
@@ -14,15 +14,13 @@
* 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$
*/
/**
\file htdocs/admin/dons.php
\ingroup dons
\brief Page d'administration/configuration du module Dons
- \version $Revision$
+ \version $Id$
*/
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
@@ -180,64 +178,70 @@ while (($file = readdir($handle))!==false)
require_once($dir.'/'.$file);
$module=new $classname($db);
- print '| ';
- echo $module->name;
- print ' | ';
- print '';
- print $module->description;
- print ' | ';
+ // 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;
- // Activ�
- if (in_array($name, $def))
- {
- print "\n";
- if ($conf->global->DON_ADDON_MODEL == $name)
- {
- print img_tick($langs->trans("Enabled"));
- }
- else
- {
- print ' ';
- print ' | ';
- print ''.$langs->trans("Activate").'';
- }
+ if ($module->isEnabled())
+ {
+ print ' |
| ';
+ echo $module->name;
print ' | ';
- }
- else
- {
- print "\n";
- print ''.$langs->trans("Activate").'';
- print " | ";
- }
-
- // Defaut
- print "";
- if ($conf->global->DON_ADDON_MODEL == "$name")
- {
- print img_tick($langs->trans("Default"));
- }
- else
- {
- print ''.$langs->trans("Default").'';
- }
- print ' | ';
-
- // Info
- $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
- $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
- $htmltooltip.='
'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur;
- $htmltooltip.='
'.$langs->trans("FeaturesSupported").':';
- $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo);
- $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang);
- print '';
- print $html->textwithhelp('',$htmltooltip,1,0);
- print ' | ';
- print '';
- print ''.img_object($langs->trans("Preview"),'generic').'';
- print ' | ';
-
- print "
\n";
-
+ print '';
+ print $module->description;
+ print ' | ';
+
+ // Active
+ if (in_array($name, $def))
+ {
+ print "\n";
+ if ($conf->global->DON_ADDON_MODEL == $name)
+ {
+ print img_tick($langs->trans("Enabled"));
+ }
+ else
+ {
+ print ' ';
+ print ' | ';
+ print ''.$langs->trans("Activate").'';
+ }
+ print ' | ';
+ }
+ else
+ {
+ print "\n";
+ print ''.$langs->trans("Activate").'';
+ print " | ";
+ }
+
+ // Defaut
+ print "";
+ if ($conf->global->DON_ADDON_MODEL == "$name")
+ {
+ print img_tick($langs->trans("Default"));
+ }
+ else
+ {
+ print ''.$langs->trans("Default").'';
+ }
+ print ' | ';
+
+ // Info
+ $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
+ $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
+ $htmltooltip.='
'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur;
+ $htmltooltip.='
'.$langs->trans("FeaturesSupported").':';
+ $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo);
+ $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang);
+ print '';
+ print $html->textwithhelp('',$htmltooltip,1,0);
+ print ' | ';
+ print '';
+ print ''.img_object($langs->trans("Preview"),'generic').'';
+ print ' | ';
+
+ print "\n";
+ }
}
}
closedir($handle);
diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index 17c2c174676..94272857bff 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -257,70 +257,73 @@ while (($file = readdir($handle))!==false)
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 '| ';
- echo "$file";
- print " | \n";
-
- print $module->info();
-
- print ' | ';
-
- // Affiche example
- print ''.$module->getExample().' | ';
-
- print '';
- if ($conf->global->FACTURE_ADDON == "$file")
- {
- print img_tick($langs->trans("Activated"));
- }
- else
- {
- print ''.$langs->trans("Default").'';
- }
- print ' | ';
-
- $facture=new Facture($db);
- $facture->initAsSpecimen();
-
- // Example for standard invoice
- $htmltooltip='';
- $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
';
- $facture->type=0;
- $nextval=$module->getNextValue($mysoc,$facture);
- if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
- {
- $htmltooltip.=''.$langs->trans("NextValueForInvoices").': ';
- if ($nextval)
+ if ($module->isEnabled())
+ {
+ $var = !$var;
+ print '
| ';
+ echo "$file";
+ print " | \n";
+
+ print $module->info();
+
+ print ' | ';
+
+ // Affiche example
+ print ''.$module->getExample().' | ';
+
+ print '';
+ if ($conf->global->FACTURE_ADDON == "$file")
+ {
+ print img_tick($langs->trans("Activated"));
+ }
+ else
+ {
+ print ''.$langs->trans("Default").'';
+ }
+ print ' | ';
+
+ $facture=new Facture($db);
+ $facture->initAsSpecimen();
+
+ // Example for standard invoice
+ $htmltooltip='';
+ $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
';
+ $facture->type=0;
+ $nextval=$module->getNextValue($mysoc,$facture);
+ if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{
- $htmltooltip.=$nextval.'
';
+ $htmltooltip.=''.$langs->trans("NextValueForInvoices").': ';
+ if ($nextval)
+ {
+ $htmltooltip.=$nextval.'
';
+ }
+ else
+ {
+ $htmltooltip.=$langs->trans($module->error).'
';
+ }
}
- else
+ // Example for credit invoice
+ $facture->type=2;
+ $nextval=$module->getNextValue($mysoc,$facture);
+ if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{
- $htmltooltip.=$langs->trans($module->error).'
';
+ $htmltooltip.=''.$langs->trans("NextValueForCreditNotes").': ';
+ if ($nextval)
+ {
+ $htmltooltip.=$nextval;
+ }
+ else
+ {
+ $htmltooltip.=$langs->trans($module->error);
+ }
}
- }
- // Example for credit invoice
- $facture->type=2;
- $nextval=$module->getNextValue($mysoc,$facture);
- if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
- {
- $htmltooltip.=''.$langs->trans("NextValueForCreditNotes").': ';
- if ($nextval)
- {
- $htmltooltip.=$nextval;
- }
- else
- {
- $htmltooltip.=$langs->trans($module->error);
- }
- }
-
- print '';
- print $html->textwithhelp('',$htmltooltip,1,0);
- print ' | ';
-
- print "
\n";
+
+ print '';
+ print $html->textwithhelp('',$htmltooltip,1,0);
+ print ' | ';
+
+ print "\n";
+ }
}
}
}
diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php
index 2d2f7f46d77..af698d89fad 100644
--- a/htdocs/admin/fichinter.php
+++ b/htdocs/admin/fichinter.php
@@ -22,11 +22,11 @@
*/
/**
- \file htdocs/admin/fichinter.php
- \ingroup fichinter
- \brief Page d'administration/configuration du module FicheInter
- \version $Id$
-*/
+ \file htdocs/admin/fichinter.php
+ \ingroup fichinter
+ \brief Page d'administration/configuration du module FicheInter
+ \version $Id$
+ */
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
@@ -38,7 +38,7 @@ $langs->load("other");
$langs->load("interventions");
if (!$user->admin)
- accessforbidden();
+accessforbidden();
/*
@@ -53,7 +53,7 @@ if ($_POST["action"] == 'updateMask')
if ($_POST["action"] == 'set_FICHINTER_DRAFT_WATERMARK')
{
- dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($_POST["FICHINTER_DRAFT_WATERMARK"]));
+ dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($_POST["FICHINTER_DRAFT_WATERMARK"]));
}
if ($_GET["action"] == 'specimen')
@@ -88,56 +88,56 @@ if ($_GET["action"] == 'specimen')
if ($_GET["action"] == 'set')
{
$type='ficheinter';
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type) VALUES ('".$_GET["value"]."','".$type."')";
- if ($db->query($sql))
- {
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type) VALUES ('".$_GET["value"]."','".$type."')";
+ if ($db->query($sql))
+ {
- }
+ }
}
if ($_GET["action"] == 'del')
{
- $type='ficheinter';
- $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
- $sql .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
- if ($db->query($sql))
- {
+ $type='ficheinter';
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
+ $sql .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
+ if ($db->query($sql))
+ {
- }
+ }
}
if ($_GET["action"] == 'setdoc')
{
$db->begin();
-
- if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$_GET["value"]))
- {
- // La constante qui a �t� lue en avant du nouveau set
- // on passe donc par une variable pour avoir un affichage coh�rent
- $conf->global->FICHEINTER_ADDON_PDF = $_GET["value"];
- }
- // On active le modele
- $type='ficheinter';
- $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
- $sql_del .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
- $result1=$db->query($sql_del);
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
- $result2=$db->query($sql);
- if ($result1 && $result2)
- {
+ if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$_GET["value"]))
+ {
+ // La constante qui a �t� lue en avant du nouveau set
+ // on passe donc par une variable pour avoir un affichage coh�rent
+ $conf->global->FICHEINTER_ADDON_PDF = $_GET["value"];
+ }
+
+ // On active le modele
+ $type='ficheinter';
+ $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
+ $sql_del .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
+ $result1=$db->query($sql_del);
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
+ $result2=$db->query($sql);
+ if ($result1 && $result2)
+ {
$db->commit();
- }
- else
- {
- $db->rollback();
- }
+ }
+ else
+ {
+ $db->rollback();
+ }
}
if ($_GET["action"] == 'setmod')
{
- // \todo Verifier si module numerotation choisi peut etre activ�
- // par appel methode canBeActivated
+ // \todo Verifier si module numerotation choisi peut etre activ�
+ // par appel methode canBeActivated
dolibarr_set_const($db, "FICHEINTER_ADDON",$_GET["value"]);
}
@@ -180,56 +180,63 @@ clearstatcache();
$handle = opendir($dir);
if ($handle)
{
- $var=true;
-
- while (($file = readdir($handle))!==false)
- {
- if (eregi('^(mod_.*)\.php$',$file,$reg))
- {
- $file = $reg[1];
- $className = substr($file,4);
+ $var=true;
- require_once($dir.$file.".php");
+ while (($file = readdir($handle))!==false)
+ {
+ if (eregi('^(mod_.*)\.php$',$file,$reg))
+ {
+ $file = $reg[1];
+ $className = substr($file,4);
- $module = new $file;
+ require_once($dir.$file.".php");
- $var=!$var;
- print '| '.$module->nom." | \n";
- print $module->info();
- print ' | ';
+ $module = new $file;
- // Examples
- print ''.$module->getExample()." | \n";
+ // 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;
- print '';
- if ($conf->global->FICHEINTER_ADDON == $className)
- {
- print img_tick($langs->trans("Activated"));
- }
- else
- {
- print ''.$langs->trans("Default").'';
- }
- print ' | ';
+ if ($module->isEnabled())
+ {
+ $var=!$var;
+ print '
| '.$module->nom." | \n";
+ print $module->info();
+ print ' | ';
- $ficheinter=new Fichinter($db);
- $ficheinter->initAsSpecimen();
-
- // Info
- $htmltooltip='';
- $nextval=$module->getNextValue($mysoc,$ficheinter);
- if ($nextval != $langs->trans("NotAvailable"))
- {
- $htmltooltip=''.$langs->trans("NextValue").': '.$nextval;
- }
- print '';
- print $html->textwithhelp('',$htmltooltip,1,0);
- print ' | ';
+ // Examples
+ print ''.$module->getExample()." | \n";
- print '
';
- }
- }
- closedir($handle);
+ print '';
+ if ($conf->global->FICHEINTER_ADDON == $className)
+ {
+ print img_tick($langs->trans("Activated"));
+ }
+ else
+ {
+ print ''.$langs->trans("Default").'';
+ }
+ print ' | ';
+
+ $ficheinter=new Fichinter($db);
+ $ficheinter->initAsSpecimen();
+
+ // Info
+ $htmltooltip='';
+ $nextval=$module->getNextValue($mysoc,$ficheinter);
+ if ($nextval != $langs->trans("NotAvailable"))
+ {
+ $htmltooltip=''.$langs->trans("NextValue").': '.$nextval;
+ }
+ print '';
+ print $html->textwithhelp('',$htmltooltip,1,0);
+ print ' | ';
+
+ print '';
+ }
+ }
+ }
+ closedir($handle);
}
print '
';
@@ -278,26 +285,26 @@ $var=true;
$handle=opendir($dir);
while (($file = readdir($handle))!==false)
{
- if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_')
- {
- $name = substr($file, 4, strlen($file) -16);
- $classname = substr($file, 0, strlen($file) -12);
+ if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_')
+ {
+ $name = substr($file, 4, strlen($file) -16);
+ $classname = substr($file, 0, strlen($file) -12);
- $var=!$var;
+ $var=!$var;
- print '| ';
- echo "$name";
- print " | \n";
- require_once($dir.$file);
- $module = new $classname();
- print $module->description;
- print ' | ';
+ print '
| ';
+ echo "$name";
+ print " | \n";
+ require_once($dir.$file);
+ $module = new $classname();
+ print $module->description;
+ print ' | ';
// Activ�
if (in_array($name, $def))
{
print "\n";
- if ($conf->global->FICHEINTER_ADDON_PDF != "$name")
+ if ($conf->global->FICHEINTER_ADDON_PDF != "$name")
{
print '';
print img_tick($langs->trans("Disable"));
@@ -327,26 +334,26 @@ while (($file = readdir($handle))!==false)
print ''.$langs->trans("Default").'';
}
print ' | ';
-
+
// Info
- $htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
- $htmltooltip.='
'.$langs->trans("Width").': '.$module->page_largeur;
- $htmltooltip.='
'.$langs->trans("Height").': '.$module->page_hauteur;
- $htmltooltip.='
'.$langs->trans("FeaturesSupported").':';
- $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo);
+ $htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
+ $htmltooltip.='
'.$langs->trans("Width").': '.$module->page_largeur;
+ $htmltooltip.='
'.$langs->trans("Height").': '.$module->page_hauteur;
+ $htmltooltip.='
'.$langs->trans("FeaturesSupported").':';
+ $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo);
$htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg);
- $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg);
+ $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg);
$htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang);
$htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark);
- print '';
- print $html->textwithhelp('',$htmltooltip,1,0);
- print ' | ';
- print '';
- print ''.img_object($langs->trans("Preview"),'intervention').'';
- print ' | ';
+ print '';
+ print $html->textwithhelp('',$htmltooltip,1,0);
+ print ' | ';
+ print '';
+ print ''.img_object($langs->trans("Preview"),'intervention').'';
+ print ' | ';
print '
';
- }
+ }
}
closedir($handle);
diff --git a/htdocs/admin/fournisseur.php b/htdocs/admin/fournisseur.php
index 0d707cc454b..933f8fbf1c9 100644
--- a/htdocs/admin/fournisseur.php
+++ b/htdocs/admin/fournisseur.php
@@ -148,8 +148,9 @@ if ($_POST["action"] == 'updatePrefixCommande') dolibarr_set_const($db, "COMMAND
if ($_POST["action"] == 'setOffset') dolibarr_set_const($db, "COMMANDE_FOURNISSEUR_NUM_DELTA",$_POST["offset"]);
if ($_POST["action"] == 'setNumRestart') dolibarr_set_const($db, "COMMANDE_FOURNISSEUR_NUM_RESTART_BEGIN_YEAR",$_POST["numrestart"]);
+
/*
- * Affichage page
+ * View
*/
llxHeader();
@@ -191,55 +192,58 @@ if ($handle)
$module = new $file;
- // 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 '| '.$module->nom." | \n";
- print $module->info();
- print ' | ';
-
- // Examples
- print ''.$module->getExample()." | \n";
-
- print '';
- if ($conf->global->COMMANDE_SUPPLIER_ADDON == "$file")
- {
- print img_tick($langs->trans("Activated"));
- }
- else
- {
- print ''.$langs->trans("Activate").'';
- }
- print ' | ';
-
- $commande=new CommandeFournisseur($db);
- $commande->initAsSpecimen();
-
- // Info
- $htmltooltip='';
- $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
';
- $facture->type=0;
- $nextval=$module->getNextValue($mysoc,$commande);
- if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
+ if ($module->isEnabled())
{
- $htmltooltip.=''.$langs->trans("NextValue").': ';
- if ($nextval)
+ // 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 '
| '.$module->nom." | \n";
+ print $module->info();
+ print ' | ';
+
+ // Examples
+ print ''.$module->getExample()." | \n";
+
+ print '';
+ if ($conf->global->COMMANDE_SUPPLIER_ADDON == "$file")
+ {
+ print img_tick($langs->trans("Activated"));
+ }
+ else
+ {
+ print ''.$langs->trans("Activate").'';
+ }
+ print ' | ';
+
+ $commande=new CommandeFournisseur($db);
+ $commande->initAsSpecimen();
+
+ // Info
+ $htmltooltip='';
+ $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
';
+ $facture->type=0;
+ $nextval=$module->getNextValue($mysoc,$commande);
+ if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{
- $htmltooltip.=$nextval.'
';
- }
- else
- {
- $htmltooltip.=$langs->trans($module->error).'
';
+ $htmltooltip.=''.$langs->trans("NextValue").': ';
+ if ($nextval)
+ {
+ $htmltooltip.=$nextval.'
';
+ }
+ else
+ {
+ $htmltooltip.=$langs->trans($module->error).'
';
+ }
}
+
+ print '';
+ print $html->textwithhelp('',$htmltooltip,1,0);
+ print ' | ';
+
+ print '
';
}
-
- print '';
- print $html->textwithhelp('',$htmltooltip,1,0);
- print ' | ';
-
- print '';
}
}
closedir($handle);
diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php
index b96fe1e74be..1b405833030 100644
--- a/htdocs/admin/livraison.php
+++ b/htdocs/admin/livraison.php
@@ -217,51 +217,54 @@ if ($handle)
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 '| '.$module->nom." | \n";
- print $module->info();
- print ' | ';
-
- // Affiche example
- print ''.$module->getExample().' | ';
-
- print '';
- if ($conf->global->LIVRAISON_ADDON == "$file")
- {
- print img_tick($langs->trans("Activated"));
- }
- else
- {
- print ''.$langs->trans("Default").'';
- }
- print ' | ';
-
- $livraison=new Livraison($db);
- $livraison->initAsSpecimen();
-
- // Info
- $htmltooltip='';
- $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
';
- $facture->type=0;
- $nextval=$module->getNextValue($mysoc,$livraison);
- if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
- {
- $htmltooltip.=''.$langs->trans("NextValue").': ';
- if ($nextval)
+ if ($module->isEnabled())
+ {
+ $var=!$var;
+ print '
| '.$module->nom." | \n";
+ print $module->info();
+ print ' | ';
+
+ // Affiche example
+ print ''.$module->getExample().' | ';
+
+ print '';
+ if ($conf->global->LIVRAISON_ADDON == "$file")
{
- $htmltooltip.=$nextval.' ';
+ print img_tick($langs->trans("Activated"));
}
else
{
- $htmltooltip.=$langs->trans($module->error).' ';
+ print ''.$langs->trans("Default").'';
}
- }
-
- print ' | ';
- print $html->textwithhelp('',$htmltooltip,1,0);
- print ' | ';
-
- print '
';
+ print '';
+
+ $livraison=new Livraison($db);
+ $livraison->initAsSpecimen();
+
+ // Info
+ $htmltooltip='';
+ $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
';
+ $facture->type=0;
+ $nextval=$module->getNextValue($mysoc,$livraison);
+ if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
+ {
+ $htmltooltip.=''.$langs->trans("NextValue").': ';
+ if ($nextval)
+ {
+ $htmltooltip.=$nextval.'
';
+ }
+ else
+ {
+ $htmltooltip.=$langs->trans($module->error).'
';
+ }
+ }
+
+ print '';
+ print $html->textwithhelp('',$htmltooltip,1,0);
+ print ' | ';
+
+ print '';
+ }
}
}
closedir($handle);
diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php
index 8cc3bac4e81..efc1bd0d45b 100644
--- a/htdocs/admin/propale.php
+++ b/htdocs/admin/propale.php
@@ -229,51 +229,54 @@ if ($handle)
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 '| '.$module->nom." | \n";
- print $module->info();
- print ' | ';
-
- // Examples
- print ''.$module->getExample()." | \n";
-
- print '';
- if ($conf->global->PROPALE_ADDON == "$file")
- {
- print img_tick($langs->trans("Activated"));
- }
- else
- {
- print ''.$langs->trans("Activate").'';
- }
- print ' | ';
-
- $propale=new Propal($db);
- $propale->initAsSpecimen();
-
- // Info
- $htmltooltip='';
- $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
';
- $facture->type=0;
- $nextval=$module->getNextValue($mysoc,$propale);
- if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
- {
- $htmltooltip.=''.$langs->trans("NextValue").': ';
- if ($nextval)
+ if ($module->isEnabled())
+ {
+ $var=!$var;
+ print '
| '.$module->nom." | \n";
+ print $module->info();
+ print ' | ';
+
+ // Examples
+ print ''.$module->getExample()." | \n";
+
+ print '';
+ if ($conf->global->PROPALE_ADDON == "$file")
+ {
+ print img_tick($langs->trans("Activated"));
+ }
+ else
+ {
+ print ''.$langs->trans("Activate").'';
+ }
+ print ' | ';
+
+ $propale=new Propal($db);
+ $propale->initAsSpecimen();
+
+ // Info
+ $htmltooltip='';
+ $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
';
+ $facture->type=0;
+ $nextval=$module->getNextValue($mysoc,$propale);
+ if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{
- $htmltooltip.=$nextval.'
';
+ $htmltooltip.=''.$langs->trans("NextValue").': ';
+ if ($nextval)
+ {
+ $htmltooltip.=$nextval.'
';
+ }
+ else
+ {
+ $htmltooltip.=$langs->trans($module->error).'
';
+ }
}
- else
- {
- $htmltooltip.=$langs->trans($module->error).'
';
- }
- }
-
- print '';
- print $html->textwithhelp('',$htmltooltip,1,0);
- print ' | ';
-
- print "
\n";
+
+ print '';
+ print $html->textwithhelp('',$htmltooltip,1,0);
+ print ' | ';
+
+ print "\n";
+ }
}
}
closedir($handle);
diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php
index 86973bd4a68..f8f41aadb41 100644
--- a/htdocs/admin/security.php
+++ b/htdocs/admin/security.php
@@ -208,11 +208,17 @@ print '';
foreach ($arrayhandler as $key => $module)
{
+ // 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;
+
+ if ($module->isEnabled())
+ {
$var = !$var;
print '| ';
print ucfirst($key);
print " | \n";
- print $arrayhandler[$key]->getDescription();
+ print $module->getDescription();
print ' | ';
// Affiche example
@@ -229,6 +235,7 @@ foreach ($arrayhandler as $key => $module)
print ''.$langs->trans("Activate").'';
}
print "
\n";
+ }
}
print '';
print '';
diff --git a/htdocs/fourn/commande/modules/modules_commandefournisseur.php b/htdocs/fourn/commande/modules/modules_commandefournisseur.php
index 29f927389be..b5a62ca9131 100644
--- a/htdocs/fourn/commande/modules/modules_commandefournisseur.php
+++ b/htdocs/fourn/commande/modules/modules_commandefournisseur.php
@@ -91,7 +91,15 @@ class ModeleNumRefSuppliersOrders
{
var $error='';
- /** \brief Renvoi la description par defaut du modele de numérotation
+ /** \brief Return if a module can be used or not
+ * \return boolean true if module can be used
+ */
+ function isEnabled()
+ {
+ return true;
+ }
+
+ /** \brief Renvoi la description par defaut du modele de numérotation
* \return string Texte descripif
*/
function info()
diff --git a/htdocs/includes/modules/barcode/phpbarcode.modules.php b/htdocs/includes/modules/barcode/phpbarcode.modules.php
index 9cb3c8772f8..de7c694a184 100644
--- a/htdocs/includes/modules/barcode/phpbarcode.modules.php
+++ b/htdocs/includes/modules/barcode/phpbarcode.modules.php
@@ -38,7 +38,15 @@ class modPhpbarcode extends ModeleBarCode
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $error='';
- /** \brief Renvoi la description du modele de numérotation
+ /** \brief Return if a module can be used or not
+ * \return boolean true if module can be used
+ */
+ function isEnabled()
+ {
+ return true;
+ }
+
+ /** \brief Renvoi la description du modele de numérotation
* \return string Texte descripif
*/
function info()
diff --git a/htdocs/includes/modules/commande/modules_commande.php b/htdocs/includes/modules/commande/modules_commande.php
index bb611b14732..734c73fec10 100644
--- a/htdocs/includes/modules/commande/modules_commande.php
+++ b/htdocs/includes/modules/commande/modules_commande.php
@@ -95,6 +95,14 @@ class ModeleNumRefCommandes
{
var $error='';
+ /** \brief Return if a module can be used or not
+ * \return boolean true if module can be used
+ */
+ function isEnabled()
+ {
+ return true;
+ }
+
/** \brief Renvoi la description par defaut du modele de numérotation
* \return string Texte descripif
*/
diff --git a/htdocs/includes/modules/dons/modules_don.php b/htdocs/includes/modules/dons/modules_don.php
index 04e54d2f4c0..e635789e662 100644
--- a/htdocs/includes/modules/dons/modules_don.php
+++ b/htdocs/includes/modules/dons/modules_don.php
@@ -88,6 +88,14 @@ class ModeleNumRefDons
{
var $error='';
+ /** \brief Return if a module can be used or not
+ * \return boolean true if module can be used
+ */
+ function isEnabled()
+ {
+ return true;
+ }
+
/** \brief Renvoi la description par defaut du modele de numérotation
* \return string Texte descripif
*/
diff --git a/htdocs/includes/modules/facture/modules_facture.php b/htdocs/includes/modules/facture/modules_facture.php
index 6289b2e161a..c43ece74ba8 100644
--- a/htdocs/includes/modules/facture/modules_facture.php
+++ b/htdocs/includes/modules/facture/modules_facture.php
@@ -93,6 +93,14 @@ class ModeleNumRefFactures
{
var $error='';
+ /** \brief Return if a module can be used or not
+ * \return boolean true if module can be used
+ */
+ function isEnabled()
+ {
+ return true;
+ }
+
/** \brief Renvoi la description par defaut du modele de numérotation
* \return string Texte descripif
*/
diff --git a/htdocs/includes/modules/fichinter/modules_fichinter.php b/htdocs/includes/modules/fichinter/modules_fichinter.php
index 54248e3d173..c31f58deaea 100644
--- a/htdocs/includes/modules/fichinter/modules_fichinter.php
+++ b/htdocs/includes/modules/fichinter/modules_fichinter.php
@@ -96,6 +96,14 @@ class ModeleNumRefFicheinter
{
var $error='';
+ /** \brief Return if a module can be used or not
+ * \return boolean true if module can be used
+ */
+ function isEnabled()
+ {
+ return true;
+ }
+
/** \brief Renvoi la description par defaut du modele de numérotation
* \return string Texte descripif
*/
diff --git a/htdocs/includes/modules/propale/modules_propale.php b/htdocs/includes/modules/propale/modules_propale.php
index 53a09245070..c84ab2fd2d7 100644
--- a/htdocs/includes/modules/propale/modules_propale.php
+++ b/htdocs/includes/modules/propale/modules_propale.php
@@ -90,6 +90,14 @@ class ModeleNumRefPropales
{
var $error='';
+ /** \brief Return if a module can be used or not
+ * \return boolean true if module can be used
+ */
+ function isEnabled()
+ {
+ return true;
+ }
+
/** \brief Renvoi la description par defaut du modele de numérotation
* \return string Texte descripif
*/
diff --git a/htdocs/includes/modules/security/generate/modules_genpassword.php b/htdocs/includes/modules/security/generate/modules_genpassword.php
index 21f7ba31122..0d7e7bb6c8d 100644
--- a/htdocs/includes/modules/security/generate/modules_genpassword.php
+++ b/htdocs/includes/modules/security/generate/modules_genpassword.php
@@ -36,6 +36,14 @@ class ModeleGenPassword
{
var $error='';
+ /** \brief Return if a module can be used or not
+ * \return boolean true if module can be used
+ */
+ function isEnabled()
+ {
+ return true;
+ }
+
/** \brief Renvoi la description par defaut du modele
* \return string Texte descripif
*/
diff --git a/htdocs/livraison/mods/modules_livraison.php b/htdocs/livraison/mods/modules_livraison.php
index e94829e0459..5c0d51f1afe 100644
--- a/htdocs/livraison/mods/modules_livraison.php
+++ b/htdocs/livraison/mods/modules_livraison.php
@@ -92,6 +92,14 @@ class ModeleNumRefDeliveryOrder
{
var $error='';
+ /** \brief Return if a module can be used or not
+ * \return boolean true if module can be used
+ */
+ function isEnabled()
+ {
+ return true;
+ }
+
/** \brief Renvoi la description par defaut du modele de numérotation
* \return string Texte descripif
*/