print '</div>'; print '<br>'; if ($producttmp->id > 0) { print $langs->trans("BarCodeDataForProduct", '') . ' ' . $producttmp->getNomUrl(1) . '<br>'; } if ($thirdpartytmp->id > 0) { print $langs->trans("BarCodeDataForThirdparty", '') . ' ' . $thirdpartytmp->getNomUrl(1) . '<br>'; } print '<div class="tagtable">'; // Barcode type print ' <div class="tagtr">'; print ' <div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">'; print $langs->trans("BarcodeType") . ' '; print '</div><div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formbarcode.class.php'; $formbarcode = new FormBarCode($db); $formbarcode->select_barcode_type($fk_barcode_type, 'fk_barcode_type', 1); print '</div></div>'; // Barcode value print ' <div class="tagtr">'; print ' <div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">'; print $langs->trans("BarcodeValue") . ' '; print '</div><div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">'; print '<input size="16" type="text" name="forbarcode" id="forbarcode" value="' . $forbarcode . '">'; print '</div></div>'; /* $barcodestickersmask=GETPOST('barcodestickersmask'); print '<br>'.$langs->trans("BarcodeStickersMask").':<br>'; print '<textarea cols="40" type="text" name="barcodestickersmask" value="'.GETPOST('barcodestickersmask').'">'.$barcodestickersmask.'</textarea>'; print '<br>'; */
} if ($action && $action != 'setcoder' && $action != 'setModuleOptions') { if (!$res > 0) { $error++; } if (!$error) { setEventMessage($langs->trans("SetupSaved")); } else { setEventMessage($langs->trans("Error"), 'errors'); } } /* * View */ $form = new Form($db); $formbarcode = new FormBarCode($db); $help_url = 'EN:Module_Barcode|FR:Module_Codes_Barre|ES:Módulo Código de barra'; llxHeader('', $langs->trans("BarcodeSetup"), $help_url); $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>'; print_fiche_titre($langs->trans("BarcodeSetup"), $linkback, 'title_setup'); // Detect bar codes modules $barcodelist = array(); clearstatcache(); // Scan list of all barcode included provided by external modules $dirbarcode = array_merge(array("/core/modules/barcode/doc/"), $conf->modules_parts['barcode']); foreach ($dirbarcode as $reldir) { $dir = dol_buildpath($reldir); $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;
print '</td></tr>'; } if ($showbarcode) { // Barcode type print '<tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print $langs->trans("BarcodeType"); print '<td>'; if ($action != 'editbarcodetype' && !empty($user->rights->barcode->creer)) { print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editbarcodetype&id=' . $object->id . '">' . img_edit($langs->trans('Edit'), 1) . '</a></td>'; } print '</tr></table>'; print '</td><td colspan="2">'; if ($action == 'editbarcodetype') { require_once DOL_DOCUMENT_ROOT . '/core/class/html.formbarcode.class.php'; $formbarcode = new FormBarCode($db); $formbarcode->form_barcode_type($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->barcode_type, 'fk_barcode_type'); } else { $object->fetch_barcode(); print $object->barcode_type_label ? $object->barcode_type_label : ($object->barcode ? '<div class="warning">' . $langs->trans("SetDefaultBarcodeType") . '<div>' : ''); } print '</td></tr>' . "\n"; // Barcode value print '<tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print $langs->trans("BarcodeValue"); print '<td>'; if ($action != 'editbarcode' && !empty($user->rights->barcode->creer)) { print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editbarcode&id=' . $object->id . '">' . img_edit($langs->trans('Edit'), 1) . '</a></td>'; } print '</tr></table>';
$product->fetch($_GET["id"]); $product->barcode = $_POST['barcode']; //Todo: ajout verification de la validite du code barre en fonction du type $result = $product->update_barcode($user); Header("Location: barcode.php?id=".$_GET["id"]); exit; } /* * View */ llxHeader("","",$langs->trans("BarCode")); $html = new Form($db); $formbarcode = new FormBarCode($db); $product = new Product($db); if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]); $head=product_prepare_head($product, $user); $titre=$langs->trans("CardProduct".$product->type); $picto=($product->type==1?'service':'product'); dol_fiche_head($head, 'barcode', $titre, 0, $picto); print '<table class="border" width="100%">'."\n"; // Reference print '<tr>';