diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index ee0fcd5d130..57c32d79318 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -55,6 +55,16 @@ if ($action == 'setbarcodeproducton') { $res = dolibarr_del_const($db, "BARCODE_PRODUCT_ADDON_NUM", $conf->entity); } +if ($action == 'setbarcodethirdpartyon') { + $barcodenumberingmodule = GETPOST('value', 'alpha'); + $res = dolibarr_set_const($db, "BARCODE_THIRDPARTY_ADDON_NUM", $barcodenumberingmodule, 'chaine', 0, '', $conf->entity); + if ($barcodenumberingmodule == 'mod_barcode_thirdparty_standard' && empty($conf->global->BARCODE_STANDARD_THIRDPARTY_MASK)) { + $res = dolibarr_set_const($db, "BARCODE_STANDARD_THIRDPARTY_MASK", '020{000000000}', 'chaine', 0, '', $conf->entity); + } +} elseif ($action == 'setbarcodethirdpartyoff') { + $res = dolibarr_del_const($db, "BARCODE_THIRDPARTY_ADDON_NUM", $conf->entity); +} + if ($action == 'setcoder') { $coder = GETPOST('coder', 'alpha'); $code_id = GETPOST('code_id', 'int'); @@ -241,6 +251,66 @@ if ($conf->product->enabled) { print ''; } +// Select barcode numbering module +if ($conf->societe->enabled) { + print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("ThirdParty").")", '', ''); + + print '
| '.$langs->trans("Name").' | '; + print ''.$langs->trans("Description").' | '; + print ''.$langs->trans("Example").' | '; + print ''.$langs->trans("Status").' | '; + print ''.$langs->trans("ShortInfo").' | '; + print "|
| '.(isset($modBarCode->name) ? $modBarCode->name : $modBarCode->nom)." | \n"; + print $modBarCode->info($langs); + print ' | '; + print ''.$modBarCode->getExample($langs)." | \n"; + + if (!empty($conf->global->BARCODE_THIRDPARTY_ADDON_NUM) && $conf->global->BARCODE_THIRDPARTY_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 "