mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Look and feel Debug v23
This commit is contained in:
@@ -152,6 +152,53 @@ $linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore
|
||||
|
||||
print load_fiche_titre($langs->trans("BarcodeSetup"), $linkback, 'title_setup');
|
||||
|
||||
print '<br>';
|
||||
|
||||
/*
|
||||
* Usage
|
||||
*/
|
||||
|
||||
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Feature").'</td>';
|
||||
print '<td width="60" class="center"></td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Module products
|
||||
if (isModEnabled('product')) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("UseBarCodeForProducts").'</td>';
|
||||
print '<td width="60" class="right">';
|
||||
print ajax_constantonoff('BARCODE_USE_ON_PRODUCT', array(), null, 0, 0, 1);
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Module thirdparty
|
||||
if (isModEnabled('societe')) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("UseBarCodeForThirdParties").'</td>';
|
||||
print '<td width="60" class="right">';
|
||||
print ajax_constantonoff('BARCODE_USE_ON_THIRDPARTY', array(), null, 0, 0, 1);
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Detect bar codes modules
|
||||
$barcodelist = array();
|
||||
|
||||
@@ -175,6 +222,7 @@ foreach ($dirbarcode as $reldir) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS') {
|
||||
if (is_readable($newdir.$file)) {
|
||||
$reg = array();
|
||||
if (preg_match('/(.*)\.modules\.php$/i', $file, $reg)) {
|
||||
$filebis = $reg[1];
|
||||
|
||||
@@ -206,7 +254,7 @@ foreach ($dirbarcode as $reldir) {
|
||||
|
||||
|
||||
// Select barcode numbering module
|
||||
if (isModEnabled('product')) {
|
||||
if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') && isModEnabled('product')) {
|
||||
print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', 'product');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
@@ -273,7 +321,7 @@ if (isModEnabled('product')) {
|
||||
}
|
||||
|
||||
// Select barcode numbering module
|
||||
if (isModEnabled('societe')) {
|
||||
if (getDolGlobalString('BARCODE_USE_ON_THIRDPARTY') && isModEnabled('societe')) {
|
||||
print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("ThirdParty").")", '', 'company');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
@@ -343,172 +391,175 @@ if (isModEnabled('societe')) {
|
||||
/*
|
||||
* CHOOSE ENCODING
|
||||
*/
|
||||
if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') || getDolGlobalString('BARCODE_USE_ON_THIRDPARTY')) {
|
||||
print load_fiche_titre($langs->trans("BarcodeEncodeModule"), '', '');
|
||||
|
||||
print load_fiche_titre($langs->trans("BarcodeEncodeModule"), '', '');
|
||||
|
||||
if (empty($conf->use_javascript_ajax)) {
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" id="form_engine">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="updateengine">';
|
||||
}
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td width="200" class="center">'.$langs->trans("Example").'</td>';
|
||||
print '<td class="center" width="60">'.$langs->trans("CodeBarGenerator").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT rowid, code as encoding, libelle as label, coder, example";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
|
||||
$sql .= " WHERE entity = ".$conf->entity;
|
||||
$sql .= " ORDER BY code";
|
||||
|
||||
dol_syslog("admin/barcode.php", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="100">';
|
||||
print dol_escape_htmltag($obj->label);
|
||||
print "</td><td>\n";
|
||||
print $langs->trans('BarcodeDesc'.$obj->encoding);
|
||||
//print "L'EAN se compose de 8 characters, 7 chiffres plus une cle de verification.<br>";
|
||||
//print "L'utilisation des symbologies EAN8 impose la souscription et l'abonnement aupres d'organismes comme GENCOD.<br>";
|
||||
//print "Codes numeriques utilises exclusivement a l'identification des produits susceptibles d'etre vendus au grand public.";
|
||||
print '</td>';
|
||||
|
||||
// Show example
|
||||
print '<td class="center">';
|
||||
if ($obj->coder && $obj->coder != -1) {
|
||||
$result = 0;
|
||||
|
||||
foreach ($dirbarcode as $reldir) {
|
||||
$dir = dol_buildpath($reldir, 0);
|
||||
$newdir = dol_osencode($dir);
|
||||
|
||||
// Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php)
|
||||
if (!is_dir($newdir)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$result = @include_once $newdir.$obj->coder.'.modules.php';
|
||||
if ($result) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($result) {
|
||||
$classname = "mod".ucfirst($obj->coder);
|
||||
if (class_exists($classname)) {
|
||||
$module = new $classname($db);
|
||||
'@phan-var-force ModeleBarCode $module';
|
||||
if ($module->encodingIsSupported($obj->encoding)) {
|
||||
// Build barcode on disk (not used, this is done to make debug easier)
|
||||
$result = $module->writeBarCode($obj->example, $obj->encoding, 'Y');
|
||||
// Generate on the fly and output barcode with generator
|
||||
$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding);
|
||||
//print $url;
|
||||
print '<img src="'.$url.'" title="'.$obj->example.'" border="0">';
|
||||
} else {
|
||||
print $langs->trans("FormatNotSupportedByGenerator");
|
||||
}
|
||||
} else {
|
||||
print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("ChooseABarCode").'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
print $formbarcode->setBarcodeEncoder($obj->coder, $barcodelist, $obj->rowid, 'form'.$i);
|
||||
print "</td></tr>\n";
|
||||
|
||||
$i++;
|
||||
if (empty($conf->use_javascript_ajax)) {
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" id="form_engine">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="updateengine">';
|
||||
}
|
||||
}
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
|
||||
if (empty($conf->use_javascript_ajax)) {
|
||||
print $form->buttonsSaveCancel("Save", '');
|
||||
}
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td width="200" class="center">'.$langs->trans("Example").'</td>';
|
||||
print '<td class="center" width="60">'.$langs->trans("CodeBarGenerator").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print "<br>";
|
||||
$sql = "SELECT rowid, code as encoding, libelle as label, coder, example";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
|
||||
$sql .= " WHERE entity = ".$conf->entity;
|
||||
$sql .= " ORDER BY code";
|
||||
|
||||
dol_syslog("admin/barcode.php", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="100">';
|
||||
print dol_escape_htmltag($obj->label);
|
||||
print "</td><td>\n";
|
||||
print $langs->trans('BarcodeDesc'.$obj->encoding);
|
||||
//print "L'EAN se compose de 8 characters, 7 chiffres plus une cle de verification.<br>";
|
||||
//print "L'utilisation des symbologies EAN8 impose la souscription et l'abonnement aupres d'organismes comme GENCOD.<br>";
|
||||
//print "Codes numeriques utilises exclusivement a l'identification des produits susceptibles d'etre vendus au grand public.";
|
||||
print '</td>';
|
||||
|
||||
// Show example
|
||||
print '<td class="center">';
|
||||
if ($obj->coder && $obj->coder != -1) {
|
||||
$result = 0;
|
||||
|
||||
foreach ($dirbarcode as $reldir) {
|
||||
$dir = dol_buildpath($reldir, 0);
|
||||
$newdir = dol_osencode($dir);
|
||||
|
||||
// Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php)
|
||||
if (!is_dir($newdir)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$result = @include_once $newdir.$obj->coder.'.modules.php';
|
||||
if ($result) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($result) {
|
||||
$classname = "mod".ucfirst($obj->coder);
|
||||
if (class_exists($classname)) {
|
||||
$module = new $classname($db);
|
||||
'@phan-var-force ModeleBarCode $module';
|
||||
if ($module->encodingIsSupported($obj->encoding)) {
|
||||
// Build barcode on disk (not used, this is done to make debug easier)
|
||||
$result = $module->writeBarCode($obj->example, $obj->encoding, 'Y');
|
||||
// Generate on the fly and output barcode with generator
|
||||
$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding);
|
||||
//print $url;
|
||||
print '<img src="'.$url.'" title="'.$obj->example.'" border="0">';
|
||||
} else {
|
||||
print $langs->trans("FormatNotSupportedByGenerator");
|
||||
}
|
||||
} else {
|
||||
print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("ChooseABarCode").'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
print $formbarcode->setBarcodeEncoder($obj->coder, $barcodelist, $obj->rowid, 'form'.$i);
|
||||
print "</td></tr>\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
|
||||
if (empty($conf->use_javascript_ajax)) {
|
||||
print $form->buttonsSaveCancel("Save", '');
|
||||
}
|
||||
|
||||
print "<br>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Other options
|
||||
*/
|
||||
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
|
||||
if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') || getDolGlobalString('BARCODE_USE_ON_THIRDPARTY')) {
|
||||
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
|
||||
|
||||
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
print '<td width="60" class="center"></td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
print '<td width="60" class="center"></td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Chemin du binaire genbarcode sous linux
|
||||
if (!isset($_SERVER['WINDIR'])) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("GenbarcodeLocation").'</td>';
|
||||
print '<td width="60" class="center">';
|
||||
print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.getDolGlobalString('GENBARCODE_LOCATION').'">';
|
||||
if (getDolGlobalString('GENBARCODE_LOCATION') && !@file_exists($conf->global->GENBARCODE_LOCATION)) {
|
||||
$langs->load("errors");
|
||||
print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", getDolGlobalString('GENBARCODE_LOCATION')).'</span>';
|
||||
// Chemin du binaire genbarcode sous linux
|
||||
if (!isset($_SERVER['WINDIR'])) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("GenbarcodeLocation").'</td>';
|
||||
print '<td width="60" class="center">';
|
||||
print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.getDolGlobalString('GENBARCODE_LOCATION').'">';
|
||||
if (getDolGlobalString('GENBARCODE_LOCATION') && !@file_exists($conf->global->GENBARCODE_LOCATION)) {
|
||||
$langs->load("errors");
|
||||
print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", getDolGlobalString('GENBARCODE_LOCATION')).'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Module products
|
||||
if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') && isModEnabled('product')) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
|
||||
print '<td width="60" class="right">';
|
||||
print $formbarcode->selectBarcodeType(getDolGlobalInt('PRODUIT_DEFAULT_BARCODE_TYPE'), "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Module thirdparty
|
||||
if (getDolGlobalString('BARCODE_USE_ON_THIRDPARTY') && isModEnabled('societe')) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
|
||||
print '<td width="60" class="right">';
|
||||
print $formbarcode->selectBarcodeType(getDolGlobalInt('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<input type="submit" class="button" name="submit_GENBARCODE_BARCODETYPE_THIRDPARTY" value="'.$langs->trans("Modify").'">';
|
||||
print "</div>";
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
// Module products
|
||||
if (isModEnabled('product')) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
|
||||
print '<td width="60" class="right">';
|
||||
print $formbarcode->selectBarcodeType(getDolGlobalInt('PRODUIT_DEFAULT_BARCODE_TYPE'), "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Module thirdparty
|
||||
if (isModEnabled('societe')) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
|
||||
print '<td width="60" class="right">';
|
||||
print $formbarcode->selectBarcodeType(getDolGlobalInt('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<input type="submit" class="button" name="submit_GENBARCODE_BARCODETYPE_THIRDPARTY" value="'.$langs->trans("Modify").'">';
|
||||
print "</div>";
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
Reference in New Issue
Block a user