diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php
index 72d50cebd28..5824d298ee4 100644
--- a/htdocs/admin/barcode.php
+++ b/htdocs/admin/barcode.php
@@ -39,15 +39,16 @@ $action = GETPOST('action','alpha');
* Actions
*/
-if ($action == 'setbarcodeon')
+if ($action == 'setbarcodeproducton')
{
- $res=dolibarr_set_const($db, "BARCODE_ADDON_NUM", GETPOST('value'), 'chaine', 0, '', $conf->entity);
+ $res=dolibarr_set_const($db, "BARCODE_PRODUCT_ADDON_NUM", GETPOST('value'), 'chaine', 0, '', $conf->entity);
}
-elseif ($action == 'setbarcodeoff')
+elseif ($action == 'setbarcodeproductoff')
{
- $res=dolibarr_del_const($db, "BARCODE_ADDON_NUM", $conf->entity);
+ $res=dolibarr_del_const($db, "BARCODE_PRODUCT_ADDON_NUM", $conf->entity);
}
-else if ($action == 'setcoder')
+
+if ($action == 'setcoder')
{
$coder = GETPOST('coder','alpha');
$code_id = GETPOST('code_id','alpha');
@@ -82,7 +83,7 @@ else if ($action == 'update')
if ($action == 'setModuleOptions')
{
$post_size=count($_POST);
-
+
for($i=0;$i < $post_size;$i++)
{
if (array_key_exists('param'.$i,$_POST))
@@ -125,7 +126,8 @@ if ($action && $action != 'setcoder' && $action != 'setModuleOptions')
$form = new Form($db);
$formbarcode = new FormBarCode($db);
-llxHeader('',$langs->trans("BarcodeSetup"),'BarcodeConfiguration');
+$help_url='EN:Module_Barcode|FR:Module_Codes_Barre|ES:Módulo Código de barra';
+llxHeader('',$langs->trans("BarcodeSetup"),$help_url);
$linkback=''.$langs->trans("BackToModuleList").'';
print_fiche_titre($langs->trans("BarcodeSetup"),$linkback,'setup');
@@ -351,74 +353,78 @@ print "\n";
print '
';
+
+
// Select barcode numbering module
-
-print_titre($langs->trans("BarCodeNumberManager"));
-
-print '
';
-print '';
-print '| '.$langs->trans("Name").' | ';
-print ''.$langs->trans("Description").' | ';
-print ''.$langs->trans("Example").' | ';
-print ''.$langs->trans("Status").' | ';
-print ''.$langs->trans("ShortInfo").' | ';
-print "
\n";
-
-$dirbarcodenum=array_merge(array('/core/modules/barcode/'),$conf->modules_parts['barcode']);
-
-foreach ($dirbarcodenum as $dirroot)
+if ($conf->produit->enabled)
{
- $dir = dol_buildpath($dirroot,0);
+ print_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")");
- $handle = @opendir($dir);
- if (is_resource($handle))
- {
- while (($file = readdir($handle))!==false)
- {
- if (preg_match('/^mod_barcode_.*php$/', $file))
- {
- $file = substr($file, 0, dol_strlen($file)-4);
+ print '';
+ print '';
+ print '| '.$langs->trans("Name").' | ';
+ print ''.$langs->trans("Description").' | ';
+ print ''.$langs->trans("Example").' | ';
+ print ''.$langs->trans("Status").' | ';
+ print ''.$langs->trans("ShortInfo").' | ';
+ print "
\n";
- try {
- dol_include_once($dirroot.$file.'.php');
- }
- catch(Exception $e)
- {
- dol_syslog($e->getMessage(), LOG_ERR);
- }
+ $dirbarcodenum=array_merge(array('/core/modules/barcode/'),$conf->modules_parts['barcode']);
- $modBarCode = new $file();
- $var = !$var;
+ foreach ($dirbarcodenum as $dirroot)
+ {
+ $dir = dol_buildpath($dirroot,0);
- print '';
- print '| '.$modBarCode->nom." | \n";
- print $modBarCode->info($langs);
- print ' | ';
- print ''.$modBarCode->getExample($langs)." | \n";
+ $handle = @opendir($dir);
+ if (is_resource($handle))
+ {
+ while (($file = readdir($handle))!==false)
+ {
+ if (preg_match('/^mod_barcode_product_.*php$/', $file))
+ {
+ $file = substr($file, 0, dol_strlen($file)-4);
- if ($conf->global->BARCODE_ADDON_NUM == "$file")
- {
- print '';
- print img_picto($langs->trans("Activated"),'switch_on');
- print ' | ';
- }
- else
- {
- print '';
- print img_picto($langs->trans("Disabled"),'switch_off');
- print ' | ';
- }
- print '';
- $s=$modBarCode->getToolTip($langs,null,-1);
- print $form->textwithpicto('',$s,1);
- print ' | ';
- print "
\n";
- }
- }
- closedir($handle);
- }
+ try {
+ dol_include_once($dirroot.$file.'.php');
+ }
+ catch(Exception $e)
+ {
+ dol_syslog($e->getMessage(), LOG_ERR);
+ }
+
+ $modBarCode = new $file();
+ $var = !$var;
+
+ print '';
+ print '| '.$modBarCode->nom." | \n";
+ print $modBarCode->info($langs);
+ print ' | ';
+ print ''.$modBarCode->getExample($langs)." | \n";
+
+ if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file")
+ {
+ print '';
+ print img_picto($langs->trans("Activated"),'switch_on');
+ print ' | ';
+ }
+ else
+ {
+ print '';
+ print img_picto($langs->trans("Disabled"),'switch_off');
+ print ' | ';
+ }
+ print '';
+ $s=$modBarCode->getToolTip($langs,null,-1);
+ print $form->textwithpicto('',$s,1);
+ print ' | ';
+ print "
\n";
+ }
+ }
+ closedir($handle);
+ }
+ }
+ print "
\n";
}
-print "
\n";
print '';
diff --git a/htdocs/core/modules/barcode/mod_barcode_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php
similarity index 79%
rename from htdocs/core/modules/barcode/mod_barcode_standard.php
rename to htdocs/core/modules/barcode/mod_barcode_product_standard.php
index b543c1d3221..d20c7502f4a 100644
--- a/htdocs/core/modules/barcode/mod_barcode_standard.php
+++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php
@@ -20,7 +20,7 @@
*/
/**
- * \file htdocs/core/modules/product/mod_barcode_standard.php
+ * \file htdocs/core/modules/product/mod_barcode_product_standard.php
* \ingroup barcode
* \brief File of class to manage barcode numbering with standard rule
*/
@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/barcode/modules_barcode.class.php'
/**
* Class to manage barcode with standard rule
*/
-class mod_barcode_standard extends ModeleNumRefBarCode
+class mod_barcode_product_standard extends ModeleNumRefBarCode
{
var $nom='Standard'; // Nom du modele
var $code_modifiable; // Code modifiable
@@ -78,7 +78,7 @@ class mod_barcode_standard extends ModeleNumRefBarCode
$texte.= '