dolibarr 25.0.0-alpha
barcode.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
6 * Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
7 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
29// Load Dolibarr environment
30require '../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
33
42// Load translation files required by the page
43$langs->load("admin");
44
45// Security Check Access
46if (!$user->admin) {
48}
49
50// Get Parameters
51$action = GETPOST('action', 'aZ09');
52$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
53
54
55/*
56 * Actions
57 */
58
59include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
60
61if ($action == 'setbarcodeproducton') {
62 $barcodenumberingmodule = GETPOST('value', 'alpha');
63 $res = dolibarr_set_const($db, "BARCODE_PRODUCT_ADDON_NUM", $barcodenumberingmodule, 'chaine', 0, '', $conf->entity);
64 if ($barcodenumberingmodule == 'mod_barcode_product_standard' && !getDolGlobalString('BARCODE_STANDARD_PRODUCT_MASK')) {
65 $res = dolibarr_set_const($db, "BARCODE_STANDARD_PRODUCT_MASK", '04{0000000000}', 'chaine', 0, '', $conf->entity);
66 }
67} elseif ($action == 'setbarcodeproductoff') {
68 $res = dolibarr_del_const($db, "BARCODE_PRODUCT_ADDON_NUM", $conf->entity);
69}
70
71if ($action == 'setbarcodethirdpartyon') {
72 $barcodenumberingmodule = GETPOST('value', 'alpha');
73 $res = dolibarr_set_const($db, "BARCODE_THIRDPARTY_ADDON_NUM", $barcodenumberingmodule, 'chaine', 0, '', $conf->entity);
74 if ($barcodenumberingmodule == 'mod_barcode_thirdparty_standard' && !getDolGlobalString('BARCODE_STANDARD_THIRDPARTY_MASK')) {
75 $res = dolibarr_set_const($db, "BARCODE_STANDARD_THIRDPARTY_MASK", '04{0000000000}', 'chaine', 0, '', $conf->entity);
76 }
77} elseif ($action == 'setbarcodethirdpartyoff') {
78 $res = dolibarr_del_const($db, "BARCODE_THIRDPARTY_ADDON_NUM", $conf->entity);
79}
80
81if ($action == 'setcoder') {
82 $coder = GETPOST('coder', 'alpha');
83 $code_id = GETPOSTINT('code_id');
84 $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type";
85 $sqlp .= " SET coder = '".$db->escape($coder)."'";
86 $sqlp .= " WHERE rowid = ".((int) $code_id);
87 $sqlp .= " AND entity = ".((int) $conf->entity);
88
89 $resql = $db->query($sqlp);
90 if (!$resql) {
91 dol_print_error($db);
92 }
93} elseif ($action == 'update') {
94 if (GETPOSTISSET('GENBARCODE_LOCATION')) {
95 $location = GETPOST('GENBARCODE_LOCATION', 'alpha');
96 $res = dolibarr_set_const($db, "GENBARCODE_LOCATION", $location, 'chaine', 0, '', $conf->entity);
97 }
98 $coder_id = GETPOST('PRODUIT_DEFAULT_BARCODE_TYPE', 'alpha');
99 $res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id, 'chaine', 0, '', $conf->entity);
100 $coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY', 'alpha');
101 $res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id, 'chaine', 0, '', $conf->entity);
102
103 if ($res > 0) {
104 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
105 } else {
106 setEventMessages($langs->trans("Error"), null, 'errors');
107 }
108} elseif ($action == 'updateengine') {
109 $sql = "SELECT rowid, coder";
110 $sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
111 $sql .= " WHERE entity = ".((int) $conf->entity);
112 $sql .= " ORDER BY code";
113
114 $resql = $db->query($sql);
115 if ($resql) {
116 $num = $db->num_rows($resql);
117 $i = 0;
118
119 while ($i < $num) {
120 $obj = $db->fetch_object($resql);
121
122 if (GETPOST('coder'.$obj->rowid, 'alpha')) {
123 $coder = GETPOST('coder'.$obj->rowid, 'alpha');
124 $code_id = $obj->rowid;
125
126 $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type";
127 $sqlp .= " SET coder = '".$db->escape($coder)."'";
128 $sqlp .= " WHERE rowid = ".((int) $code_id);
129 $sqlp .= " AND entity = ".((int) $conf->entity);
130
131 $upsql = $db->query($sqlp);
132 if (!$upsql) {
133 dol_print_error($db);
134 }
135 }
136
137 $i++;
138 }
139 }
140}
141
142
143/*
144 * View
145 */
146
147$form = new Form($db);
148$formbarcode = new FormBarCode($db);
149
150$help_url = 'EN:Module_Barcode|FR:Module_Codes_Barre|ES:Módulo Código de barra|DE:Modul_Barcode';
151llxHeader('', $langs->trans("BarcodeSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-barcode');
152
153$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
154
155print load_fiche_titre($langs->trans("BarcodeSetup"), $linkback, 'title_setup');
156
157print '<br>';
158
159/*
160 * Usage
161 */
162
163print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" spellcheck="false">';
164print '<input type="hidden" name="token" value="'.newToken().'">';
165print "<input type=\"hidden\" name=\"action\" value=\"update\">";
166
167print '<div class="div-table-responsive-no-min">';
168print '<table class="noborder centpercent">';
169print '<tr class="liste_titre">';
170print '<td>'.$langs->trans("Feature").'</td>';
171print '<td width="60" class="center"></td>';
172print '<td>&nbsp;</td>';
173print '</tr>';
174
175// Module products
176if (isModEnabled('product')) {
177 print '<tr class="oddeven">';
178 print '<td>'.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("UseBarCodeForProducts").'</td>';
179 print '<td width="60" class="right">';
180 print ajax_constantonoff('BARCODE_USE_ON_PRODUCT', array(), null, 0, 0, 1);
181 print '</td>';
182 print '<td>&nbsp;</td>';
183 print '</tr>';
184}
185
186// Module thirdparty
187if (isModEnabled('societe')) {
188 print '<tr class="oddeven">';
189 print '<td>'.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("UseBarCodeForThirdParties").'</td>';
190 print '<td width="60" class="right">';
191 print ajax_constantonoff('BARCODE_USE_ON_THIRDPARTY', array(), null, 0, 0, 1);
192 print '</td>';
193 print '<td>&nbsp;</td>';
194 print '</tr>';
195}
196
197print "</table>\n";
198print '</div>';
199
200
201print '<br>';
202
203
204// Detect bar codes modules
205$barcodelist = array();
206
207clearstatcache();
208
209
210// Scan list of all barcode included provided by external modules
211$dirbarcode = array_merge(array("/core/modules/barcode/doc/"), $conf->modules_parts['barcode']);
212
213foreach ($dirbarcode as $reldir) {
214 $dir = dol_buildpath($reldir);
215 $newdir = dol_osencode($dir);
216
217 // Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php)
218 if (!is_dir($newdir)) {
219 continue;
220 }
221
222 $handle = @opendir($newdir);
223 if (is_resource($handle)) {
224 while (($file = readdir($handle)) !== false) {
225 if (dol_substr($file, 0, 1) != '.' && dol_substr($file, 0, 3) != 'CVS') {
226 if (is_readable($newdir.$file)) {
227 $reg = array();
228 if (preg_match('/(.*)\.modules\.php$/i', $file, $reg)) {
229 $filebis = $reg[1];
230
231 // Loading encoding class
232 require_once $newdir.$file;
233 $classname = "mod".ucfirst($filebis);
234 $module = new $classname($db);
235
236 '@phan-var-force ModeleBarCode $module';
237
238 // Show modules according to features level
239 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
240 continue;
241 }
242 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
243 continue;
244 }
245
246 if ($module->isEnabled()) {
247 $barcodelist[$filebis] = $module->info($langs);
248 }
249 }
250 }
251 }
252 }
253 }
254}
255'@phan-var-force array<string,string> $barcodelist';
256
257
258// Select barcode numbering module
259if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') && isModEnabled('product')) {
260 print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', 'product');
261
262 print '<div class="div-table-responsive-no-min">';
263 print '<table class="noborder centpercent">';
264 print '<tr class="liste_titre">';
265 print '<td width="140">'.$langs->trans("Name").'</td>';
266 print '<td>'.$langs->trans("Description").'</td>';
267 print '<td>'.$langs->trans("Example").'</td>';
268 print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
269 print '<td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
270 print "</tr>\n";
271
272 $dirbarcodenum = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
273
274 foreach ($dirbarcodenum as $dirroot) {
275 $dir = dol_buildpath($dirroot, 0);
276
277 $handle = @opendir($dir);
278 if (is_resource($handle)) {
279 while (($file = readdir($handle)) !== false) {
280 if (preg_match('/^mod_barcode_product_.*php$/', $file)) {
281 $file = dol_substr($file, 0, dol_strlen($file) - 4);
282
283 try {
284 dol_include_once($dirroot.$file.'.php');
285 } catch (Exception $e) {
286 dol_syslog($e->getMessage(), LOG_ERR);
287 continue;
288 }
289
290 $modBarCode = new $file();
291 '@phan-var-force ModeleNumRefBarCode $modBarCode';
292
293 print '<tr class="oddeven">';
294 print '<td>'.(isset($modBarCode->name) ? $modBarCode->name : $modBarCode->nom)."</td><td>\n";
295 print $modBarCode->info($langs);
296 print '</td>';
297 print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";
298
299 if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM') == "$file") {
300 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&token='.newToken().'&amp;value='.urlencode($file).'">';
301 print img_picto($langs->trans("Activated"), 'switch_on');
302 print '</a></td>';
303 } else {
304 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&token='.newToken().'&amp;value='.urlencode($file).'">';
305 print img_picto($langs->trans("Disabled"), 'switch_off');
306 print '</a></td>';
307 }
308 print '<td class="center">';
309 $s = $modBarCode->getToolTip($langs, null, -1);
310 print $form->textwithpicto('', $s, 1);
311 print '</td>';
312 print "</tr>\n";
313 }
314 }
315 closedir($handle);
316 }
317 }
318 print "</table>\n";
319
320 print dolButtonToOpenUrlInDialogPopup('barcodeinitproduct', $langs->trans("MassBarcodeInit"), $langs->trans("GoOnThisPageToInitBarCode").' '.img_picto('', 'url'), '/barcode/codeinit.php', '', 'small');
321 print '<br><br><br>';
322
323 print '</div>';
324}
325
326// Select barcode numbering module
327if (getDolGlobalString('BARCODE_USE_ON_THIRDPARTY') && isModEnabled('societe')) {
328 print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("ThirdParty").")", '', 'company');
329
330 print '<div class="div-table-responsive-no-min">';
331 print '<table class="noborder centpercent">';
332 print '<tr class="liste_titre">';
333 print '<td width="140">'.$langs->trans("Name").'</td>';
334 print '<td>'.$langs->trans("Description").'</td>';
335 print '<td>'.$langs->trans("Example").'</td>';
336 print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
337 print '<td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
338 print "</tr>\n";
339
340 $dirbarcodenum = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
341
342 foreach ($dirbarcodenum as $dirroot) {
343 $dir = dol_buildpath($dirroot, 0);
344
345 $handle = @opendir($dir);
346 if (is_resource($handle)) {
347 while (($file = readdir($handle)) !== false) {
348 if (preg_match('/^mod_barcode_thirdparty_.*php$/', $file)) {
349 $file = dol_substr($file, 0, dol_strlen($file) - 4);
350
351 try {
352 dol_include_once($dirroot.$file.'.php');
353 } catch (Exception $e) {
354 dol_syslog($e->getMessage(), LOG_ERR);
355 continue;
356 }
357
358 $modBarCode = new $file();
359
360 '@phan-var-force ModeleNumRefBarCode $modBarCode';
361
362 print '<tr class="oddeven">';
363 print '<td>'.(isset($modBarCode->name) ? $modBarCode->name : $modBarCode->nom)."</td><td>\n";
364 print $modBarCode->info($langs);
365 print '</td>';
366 print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";
367
368 if (getDolGlobalString('BARCODE_THIRDPARTY_ADDON_NUM') && getDolGlobalString('BARCODE_THIRDPARTY_ADDON_NUM') == "$file") {
369 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodethirdpartyoff&token='.newToken().'&amp;value='.urlencode($file).'">';
370 print img_picto($langs->trans("Activated"), 'switch_on');
371 print '</a></td>';
372 } else {
373 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodethirdpartyon&token='.newToken().'&amp;value='.urlencode($file).'">';
374 print img_picto($langs->trans("Disabled"), 'switch_off');
375 print '</a></td>';
376 }
377 print '<td class="center">';
378 $s = $modBarCode->getToolTip($langs, null, -1);
379 print $form->textwithpicto('', $s, 1);
380 print '</td>';
381 print "</tr>\n";
382 }
383 }
384 closedir($handle);
385 }
386 }
387 print "</table>\n";
388
389 print dolButtonToOpenUrlInDialogPopup('barcodeinitthirdparty', $langs->trans("MassBarcodeInit"), $langs->trans("GoOnThisPageToInitBarCode").' '.img_picto('', 'url'), '/barcode/codeinit.php', '', 'small');
390 print '<br><br><br>';
391
392 print '</div>';
393}
394
395/*
396 * CHOOSE ENCODING
397 */
398if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') || getDolGlobalString('BARCODE_USE_ON_THIRDPARTY')) {
399 print load_fiche_titre($langs->trans("BarcodeEncodeModule"), '', 'barcode');
400
401 if (empty($conf->use_javascript_ajax)) {
402 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" id="form_engine" spellcheck="false">';
403 print '<input type="hidden" name="token" value="'.newToken().'">';
404 print '<input type="hidden" name="action" value="updateengine">';
405 }
406
407 print '<div class="div-table-responsive-no-min">';
408 print '<table class="noborder centpercent">';
409 print '<tr class="liste_titre">';
410 print '<td>'.$langs->trans("Name").'</td>';
411 print '<td>'.$langs->trans("Description").'</td>';
412 print '<td width="200" class="center">'.$langs->trans("Example").'</td>';
413 print '<td class="center" width="60">'.$langs->trans("CodeBarGenerator").'</td>';
414 print "</tr>\n";
415
416 $sql = "SELECT rowid, code as encoding, libelle as label, coder, example";
417 $sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
418 $sql .= " WHERE entity = ".((int) $conf->entity);
419 $sql .= " ORDER BY code";
420
421 dol_syslog("admin/barcode.php", LOG_DEBUG);
422 $resql = $db->query($sql);
423 if ($resql) {
424 $num = $db->num_rows($resql);
425 $i = 0;
426
427 while ($i < $num) {
428 $obj = $db->fetch_object($resql);
429
430 print '<tr class="oddeven">';
431 print '<td width="100">';
432 print dol_escape_htmltag($obj->label);
433 print "</td><td>\n";
434 print $langs->trans('BarcodeDesc'.$obj->encoding);
435 // print "The EAN consists of 8 characters, 7 digits plus a control digit.";
436 // print "The use of EAN8 symbols requires subscription to organizations such as GENCOD.";
437 // print "Numeric codes are used exclusively for the identification of products that are likely to be sold to the general public.";
438 print '</td>';
439
440 // Show example
441 print '<td class="center">';
442 if ($obj->coder && $obj->coder != -1) {
443 $result = 0;
444
445 foreach ($dirbarcode as $reldir) {
446 $dir = dol_buildpath($reldir, 0);
447 $newdir = dol_osencode($dir);
448
449 // Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php)
450 if (!is_dir($newdir)) {
451 continue;
452 }
453
454 $result = @include_once $newdir.$obj->coder.'.modules.php';
455 if ($result) {
456 break;
457 }
458 }
459 if ($result) {
460 $classname = "mod".ucfirst($obj->coder);
461 if (class_exists($classname)) {
462 $module = new $classname($db);
463 '@phan-var-force ModeleBarCode $module';
464 if ($module->encodingIsSupported($obj->encoding)) {
465 // Build barcode on disk (not used, this is done to make debug easier)
466 $result = $module->writeBarCode($obj->example, $obj->encoding, 'Y');
467 // Generate on the fly and output barcode with generator
468 $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&amp;generator='.urlencode($obj->coder).'&amp;code='.urlencode($obj->example).'&amp;encoding='.urlencode($obj->encoding);
469 //print $url;
470 print '<img src="'.$url.'" title="'.$obj->example.'" border="0">';
471 } else {
472 print $langs->trans("FormatNotSupportedByGenerator");
473 }
474 } else {
475 print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder;
476 }
477 }
478 } else {
479 print '<span class="opacitymedium">'.$langs->trans("ChooseABarCode").'</span>';
480 }
481 print '</td>';
482
483 print '<td class="center">';
484 print $formbarcode->setBarcodeEncoder($obj->coder, $barcodelist, $obj->rowid, 'form'.$i);
485 print "</td></tr>\n";
486
487 $i++;
488 }
489 }
490 print "</table>\n";
491 print '</div>';
492
493 if (empty($conf->use_javascript_ajax)) {
494 print $form->buttonsSaveCancel("Save", '');
495 }
496
497 print "<br>";
498}
499
500
501/*
502 * Other options
503 */
504if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') || getDolGlobalString('BARCODE_USE_ON_THIRDPARTY')) {
505 print load_fiche_titre($langs->trans("OtherOptions"), '', '');
506
507 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" spellcheck="false">';
508 print '<input type="hidden" name="token" value="'.newToken().'">';
509 print "<input type=\"hidden\" name=\"action\" value=\"update\">";
510
511 print '<div class="div-table-responsive-no-min">';
512 print '<table class="noborder centpercent">';
513 print '<tr class="liste_titre">';
514 print '<td>'.$langs->trans("Parameter").'</td>';
515 print '<td width="60" class="center"></td>';
516 print '<td>&nbsp;</td>';
517 print '</tr>';
518
519 // Path to binary genbarcode (linux only)
520 if (getDolGlobalString("BARCODE_ALLOW_CLI_BARCODE_GENERATOR") && !isset($_SERVER['WINDIR'])) {
521 print '<tr class="oddeven">';
522 print '<td>'.$langs->trans("GenbarcodeLocation").'</td>';
523 print '<td width="60" class="center">';
524 print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.getDolGlobalString('GENBARCODE_LOCATION').'">';
525 if (getDolGlobalString('GENBARCODE_LOCATION') && !@file_exists(getDolGlobalString('GENBARCODE_LOCATION'))) {
526 $langs->load("errors");
527 print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", getDolGlobalString('GENBARCODE_LOCATION')).'</span>';
528 }
529 print '</td>';
530 print '<td>&nbsp;</td>';
531 print '</tr>';
532 }
533
534 // Module products
535 if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') && isModEnabled('product')) {
536 print '<tr class="oddeven">';
537 print '<td>'.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
538 print '<td width="60" class="right">';
539 print $formbarcode->selectBarcodeType(getDolGlobalInt('PRODUIT_DEFAULT_BARCODE_TYPE'), "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
540 print '</td>';
541 print '<td>&nbsp;</td>';
542 print '</tr>';
543 }
544
545 // Module thirdparty
546 if (getDolGlobalString('BARCODE_USE_ON_THIRDPARTY') && isModEnabled('societe')) {
547 print '<tr class="oddeven">';
548 print '<td>'.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
549 print '<td width="60" class="right">';
550 print $formbarcode->selectBarcodeType(getDolGlobalInt('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
551 print '</td>';
552 print '<td>&nbsp;</td>';
553 print '</tr>';
554 }
555
556 print "</table>\n";
557 print '</div>';
558
559 print '<div class="tabsAction">';
560 print '<input type="submit" class="button" name="submit_GENBARCODE_BARCODETYPE_THIRDPARTY" value="'.$langs->trans("Modify").'">';
561 print "</div>";
562 print '</form>';
563
564 print '<br>';
565}
566
567
568// End of page
569llxFooter();
570$db->close();
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
Class to manage barcode HTML.
Class to manage generation of HTML components Only common components must be here.
if(! $sortfield) if(! $sortorder) $module
Definition list.php:193
dol_strlen($string, $stringencoding='UTF-8', $binarycount=0)
Make a strlen call.
dol_osencode($str)
Return a string encoded into OS filesystem encoding.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
dol_substr($string, $start, $length=null, $stringencoding='', $trunconbytes=0)
Make a substring.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled='', $morecss='classlink button bordertransp', $jsonopen='', $jsonclose='', $accesskey='')
Return HTML code to output a button to open a dialog popup box.
Definition html.lib.php:437
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Definition html.lib.php:183
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.