dolibarr 24.0.0-beta
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 = ".$conf->entity;
88
89 $resql = $db->query($sqlp);
90 if (!$resql) {
92 }
93} elseif ($action == 'update') {
94 $location = GETPOST('GENBARCODE_LOCATION', 'alpha');
95 $res = dolibarr_set_const($db, "GENBARCODE_LOCATION", $location, 'chaine', 0, '', $conf->entity);
96 $coder_id = GETPOST('PRODUIT_DEFAULT_BARCODE_TYPE', 'alpha');
97 $res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id, 'chaine', 0, '', $conf->entity);
98 $coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY', 'alpha');
99 $res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id, 'chaine', 0, '', $conf->entity);
100
101 if ($res > 0) {
102 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
103 } else {
104 setEventMessages($langs->trans("Error"), null, 'errors');
105 }
106} elseif ($action == 'updateengine') {
107 $sql = "SELECT rowid, coder";
108 $sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
109 $sql .= " WHERE entity = ".$conf->entity;
110 $sql .= " ORDER BY code";
111
112 $resql = $db->query($sql);
113 if ($resql) {
114 $num = $db->num_rows($resql);
115 $i = 0;
116
117 while ($i < $num) {
118 $obj = $db->fetch_object($resql);
119
120 if (GETPOST('coder'.$obj->rowid, 'alpha')) {
121 $coder = GETPOST('coder'.$obj->rowid, 'alpha');
122 $code_id = $obj->rowid;
123
124 $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type";
125 $sqlp .= " SET coder = '".$db->escape($coder)."'";
126 $sqlp .= " WHERE rowid = ".((int) $code_id);
127 $sqlp .= " AND entity = ".$conf->entity;
128
129 $upsql = $db->query($sqlp);
130 if (!$upsql) {
132 }
133 }
134
135 $i++;
136 }
137 }
138}
139
140
141/*
142 * View
143 */
144
145$form = new Form($db);
146$formbarcode = new FormBarCode($db);
147
148$help_url = 'EN:Module_Barcode|FR:Module_Codes_Barre|ES:Módulo Código de barra|DE:Modul_Barcode';
149llxHeader('', $langs->trans("BarcodeSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-barcode');
150
151$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>';
152
153print load_fiche_titre($langs->trans("BarcodeSetup"), $linkback, 'title_setup');
154
155print '<br>';
156
157/*
158 * Usage
159 */
160
161print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
162print '<input type="hidden" name="token" value="'.newToken().'">';
163print "<input type=\"hidden\" name=\"action\" value=\"update\">";
164
165print '<div class="div-table-responsive-no-min">';
166print '<table class="noborder centpercent">';
167print '<tr class="liste_titre">';
168print '<td>'.$langs->trans("Feature").'</td>';
169print '<td width="60" class="center"></td>';
170print '<td>&nbsp;</td>';
171print '</tr>';
172
173// Module products
174if (isModEnabled('product')) {
175 print '<tr class="oddeven">';
176 print '<td>'.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("UseBarCodeForProducts").'</td>';
177 print '<td width="60" class="right">';
178 print ajax_constantonoff('BARCODE_USE_ON_PRODUCT', array(), null, 0, 0, 1);
179 print '</td>';
180 print '<td>&nbsp;</td>';
181 print '</tr>';
182}
183
184// Module thirdparty
185if (isModEnabled('societe')) {
186 print '<tr class="oddeven">';
187 print '<td>'.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("UseBarCodeForThirdParties").'</td>';
188 print '<td width="60" class="right">';
189 print ajax_constantonoff('BARCODE_USE_ON_THIRDPARTY', array(), null, 0, 0, 1);
190 print '</td>';
191 print '<td>&nbsp;</td>';
192 print '</tr>';
193}
194
195print "</table>\n";
196print '</div>';
197
198
199print '<br>';
200
201
202// Detect bar codes modules
203$barcodelist = array();
204
205clearstatcache();
206
207
208// Scan list of all barcode included provided by external modules
209$dirbarcode = array_merge(array("/core/modules/barcode/doc/"), $conf->modules_parts['barcode']);
210
211foreach ($dirbarcode as $reldir) {
212 $dir = dol_buildpath($reldir);
213 $newdir = dol_osencode($dir);
214
215 // Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php)
216 if (!is_dir($newdir)) {
217 continue;
218 }
219
220 $handle = @opendir($newdir);
221 if (is_resource($handle)) {
222 while (($file = readdir($handle)) !== false) {
223 if (substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS') {
224 if (is_readable($newdir.$file)) {
225 $reg = array();
226 if (preg_match('/(.*)\.modules\.php$/i', $file, $reg)) {
227 $filebis = $reg[1];
228
229 // Loading encoding class
230 require_once $newdir.$file;
231 $classname = "mod".ucfirst($filebis);
232 $module = new $classname($db);
233
234 '@phan-var-force ModeleBarCode $module';
235
236 // Show modules according to features level
237 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
238 continue;
239 }
240 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
241 continue;
242 }
243
244 if ($module->isEnabled()) {
245 $barcodelist[$filebis] = $module->info($langs);
246 }
247 }
248 }
249 }
250 }
251 }
252}
253'@phan-var-force array<string,string> $barcodelist';
254
255
256// Select barcode numbering module
257if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') && isModEnabled('product')) {
258 print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', 'product');
259
260 print '<div class="div-table-responsive-no-min">';
261 print '<table class="noborder centpercent">';
262 print '<tr class="liste_titre">';
263 print '<td width="140">'.$langs->trans("Name").'</td>';
264 print '<td>'.$langs->trans("Description").'</td>';
265 print '<td>'.$langs->trans("Example").'</td>';
266 print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
267 print '<td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
268 print "</tr>\n";
269
270 $dirbarcodenum = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
271
272 foreach ($dirbarcodenum as $dirroot) {
273 $dir = dol_buildpath($dirroot, 0);
274
275 $handle = @opendir($dir);
276 if (is_resource($handle)) {
277 while (($file = readdir($handle)) !== false) {
278 if (preg_match('/^mod_barcode_product_.*php$/', $file)) {
279 $file = substr($file, 0, dol_strlen($file) - 4);
280
281 try {
282 dol_include_once($dirroot.$file.'.php');
283 } catch (Exception $e) {
284 dol_syslog($e->getMessage(), LOG_ERR);
285 continue;
286 }
287
288 $modBarCode = new $file();
289 '@phan-var-force ModeleNumRefBarCode $modBarCode';
290
291 print '<tr class="oddeven">';
292 print '<td>'.(isset($modBarCode->name) ? $modBarCode->name : $modBarCode->nom)."</td><td>\n";
293 print $modBarCode->info($langs);
294 print '</td>';
295 print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";
296
297 if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM') == "$file") {
298 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&token='.newToken().'&amp;value='.urlencode($file).'">';
299 print img_picto($langs->trans("Activated"), 'switch_on');
300 print '</a></td>';
301 } else {
302 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&token='.newToken().'&amp;value='.urlencode($file).'">';
303 print img_picto($langs->trans("Disabled"), 'switch_off');
304 print '</a></td>';
305 }
306 print '<td class="center">';
307 $s = $modBarCode->getToolTip($langs, null, -1);
308 print $form->textwithpicto('', $s, 1);
309 print '</td>';
310 print "</tr>\n";
311 }
312 }
313 closedir($handle);
314 }
315 }
316 print "</table>\n";
317
318 print dolButtonToOpenUrlInDialogPopup('barcodeinitproduct', $langs->trans("MassBarcodeInit"), $langs->trans("GoOnThisPageToInitBarCode").' '.img_picto('', 'url'), '/barcode/codeinit.php', '', 'small');
319 print '<br><br><br>';
320
321 print '</div>';
322}
323
324// Select barcode numbering module
325if (getDolGlobalString('BARCODE_USE_ON_THIRDPARTY') && isModEnabled('societe')) {
326 print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("ThirdParty").")", '', 'company');
327
328 print '<div class="div-table-responsive-no-min">';
329 print '<table class="noborder centpercent">';
330 print '<tr class="liste_titre">';
331 print '<td width="140">'.$langs->trans("Name").'</td>';
332 print '<td>'.$langs->trans("Description").'</td>';
333 print '<td>'.$langs->trans("Example").'</td>';
334 print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
335 print '<td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
336 print "</tr>\n";
337
338 $dirbarcodenum = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
339
340 foreach ($dirbarcodenum as $dirroot) {
341 $dir = dol_buildpath($dirroot, 0);
342
343 $handle = @opendir($dir);
344 if (is_resource($handle)) {
345 while (($file = readdir($handle)) !== false) {
346 if (preg_match('/^mod_barcode_thirdparty_.*php$/', $file)) {
347 $file = substr($file, 0, dol_strlen($file) - 4);
348
349 try {
350 dol_include_once($dirroot.$file.'.php');
351 } catch (Exception $e) {
352 dol_syslog($e->getMessage(), LOG_ERR);
353 continue;
354 }
355
356 $modBarCode = new $file();
357
358 '@phan-var-force ModeleNumRefBarCode $modBarCode';
359
360 print '<tr class="oddeven">';
361 print '<td>'.(isset($modBarCode->name) ? $modBarCode->name : $modBarCode->nom)."</td><td>\n";
362 print $modBarCode->info($langs);
363 print '</td>';
364 print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";
365
366 if (getDolGlobalString('BARCODE_THIRDPARTY_ADDON_NUM') && getDolGlobalString('BARCODE_THIRDPARTY_ADDON_NUM') == "$file") {
367 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodethirdpartyoff&token='.newToken().'&amp;value='.urlencode($file).'">';
368 print img_picto($langs->trans("Activated"), 'switch_on');
369 print '</a></td>';
370 } else {
371 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodethirdpartyon&token='.newToken().'&amp;value='.urlencode($file).'">';
372 print img_picto($langs->trans("Disabled"), 'switch_off');
373 print '</a></td>';
374 }
375 print '<td class="center">';
376 $s = $modBarCode->getToolTip($langs, null, -1);
377 print $form->textwithpicto('', $s, 1);
378 print '</td>';
379 print "</tr>\n";
380 }
381 }
382 closedir($handle);
383 }
384 }
385 print "</table>\n";
386
387 print dolButtonToOpenUrlInDialogPopup('barcodeinitthirdparty', $langs->trans("MassBarcodeInit"), $langs->trans("GoOnThisPageToInitBarCode").' '.img_picto('', 'url'), '/barcode/codeinit.php', '', 'small');
388 print '<br><br><br>';
389
390 print '</div>';
391}
392
393/*
394 * CHOOSE ENCODING
395 */
396if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') || getDolGlobalString('BARCODE_USE_ON_THIRDPARTY')) {
397 print load_fiche_titre($langs->trans("BarcodeEncodeModule"), '', '');
398
399 if (empty($conf->use_javascript_ajax)) {
400 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" id="form_engine">';
401 print '<input type="hidden" name="token" value="'.newToken().'">';
402 print '<input type="hidden" name="action" value="updateengine">';
403 }
404
405 print '<div class="div-table-responsive-no-min">';
406 print '<table class="noborder centpercent">';
407 print '<tr class="liste_titre">';
408 print '<td>'.$langs->trans("Name").'</td>';
409 print '<td>'.$langs->trans("Description").'</td>';
410 print '<td width="200" class="center">'.$langs->trans("Example").'</td>';
411 print '<td class="center" width="60">'.$langs->trans("CodeBarGenerator").'</td>';
412 print "</tr>\n";
413
414 $sql = "SELECT rowid, code as encoding, libelle as label, coder, example";
415 $sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
416 $sql .= " WHERE entity = ".$conf->entity;
417 $sql .= " ORDER BY code";
418
419 dol_syslog("admin/barcode.php", LOG_DEBUG);
420 $resql = $db->query($sql);
421 if ($resql) {
422 $num = $db->num_rows($resql);
423 $i = 0;
424
425 while ($i < $num) {
426 $obj = $db->fetch_object($resql);
427
428 print '<tr class="oddeven">';
429 print '<td width="100">';
430 print dol_escape_htmltag($obj->label);
431 print "</td><td>\n";
432 print $langs->trans('BarcodeDesc'.$obj->encoding);
433 // print "The EAN consists of 8 characters, 7 digits plus a control digit.";
434 // print "The use of EAN8 symbols requires subscription to organizations such as GENCOD.";
435 // print "Numeric codes are used exclusively for the identification of products that are likely to be sold to the general public.";
436 print '</td>';
437
438 // Show example
439 print '<td class="center">';
440 if ($obj->coder && $obj->coder != -1) {
441 $result = 0;
442
443 foreach ($dirbarcode as $reldir) {
444 $dir = dol_buildpath($reldir, 0);
445 $newdir = dol_osencode($dir);
446
447 // Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php)
448 if (!is_dir($newdir)) {
449 continue;
450 }
451
452 $result = @include_once $newdir.$obj->coder.'.modules.php';
453 if ($result) {
454 break;
455 }
456 }
457 if ($result) {
458 $classname = "mod".ucfirst($obj->coder);
459 if (class_exists($classname)) {
460 $module = new $classname($db);
461 '@phan-var-force ModeleBarCode $module';
462 if ($module->encodingIsSupported($obj->encoding)) {
463 // Build barcode on disk (not used, this is done to make debug easier)
464 $result = $module->writeBarCode($obj->example, $obj->encoding, 'Y');
465 // Generate on the fly and output barcode with generator
466 $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&amp;generator='.urlencode($obj->coder).'&amp;code='.urlencode($obj->example).'&amp;encoding='.urlencode($obj->encoding);
467 //print $url;
468 print '<img src="'.$url.'" title="'.$obj->example.'" border="0">';
469 } else {
470 print $langs->trans("FormatNotSupportedByGenerator");
471 }
472 } else {
473 print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder;
474 }
475 }
476 } else {
477 print '<span class="opacitymedium">'.$langs->trans("ChooseABarCode").'</span>';
478 }
479 print '</td>';
480
481 print '<td class="center">';
482 print $formbarcode->setBarcodeEncoder($obj->coder, $barcodelist, $obj->rowid, 'form'.$i);
483 print "</td></tr>\n";
484
485 $i++;
486 }
487 }
488 print "</table>\n";
489 print '</div>';
490
491 if (empty($conf->use_javascript_ajax)) {
492 print $form->buttonsSaveCancel("Save", '');
493 }
494
495 print "<br>";
496}
497
498
499/*
500 * Other options
501 */
502if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') || getDolGlobalString('BARCODE_USE_ON_THIRDPARTY')) {
503 print load_fiche_titre($langs->trans("OtherOptions"), '', '');
504
505 print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
506 print '<input type="hidden" name="token" value="'.newToken().'">';
507 print "<input type=\"hidden\" name=\"action\" value=\"update\">";
508
509 print '<div class="div-table-responsive-no-min">';
510 print '<table class="noborder centpercent">';
511 print '<tr class="liste_titre">';
512 print '<td>'.$langs->trans("Parameter").'</td>';
513 print '<td width="60" class="center"></td>';
514 print '<td>&nbsp;</td>';
515 print '</tr>';
516
517 // Chemin du binaire genbarcode sous linux
518 if (!isset($_SERVER['WINDIR'])) {
519 print '<tr class="oddeven">';
520 print '<td>'.$langs->trans("GenbarcodeLocation").'</td>';
521 print '<td width="60" class="center">';
522 print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.getDolGlobalString('GENBARCODE_LOCATION').'">';
523 if (getDolGlobalString('GENBARCODE_LOCATION') && !@file_exists(getDolGlobalString('GENBARCODE_LOCATION'))) {
524 $langs->load("errors");
525 print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", getDolGlobalString('GENBARCODE_LOCATION')).'</span>';
526 }
527 print '</td>';
528 print '<td>&nbsp;</td>';
529 print '</tr>';
530 }
531
532 // Module products
533 if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') && isModEnabled('product')) {
534 print '<tr class="oddeven">';
535 print '<td>'.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
536 print '<td width="60" class="right">';
537 print $formbarcode->selectBarcodeType(getDolGlobalInt('PRODUIT_DEFAULT_BARCODE_TYPE'), "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
538 print '</td>';
539 print '<td>&nbsp;</td>';
540 print '</tr>';
541 }
542
543 // Module thirdparty
544 if (getDolGlobalString('BARCODE_USE_ON_THIRDPARTY') && isModEnabled('societe')) {
545 print '<tr class="oddeven">';
546 print '<td>'.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
547 print '<td width="60" class="right">';
548 print $formbarcode->selectBarcodeType(getDolGlobalInt('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
549 print '</td>';
550 print '<td>&nbsp;</td>';
551 print '</tr>';
552 }
553
554 print "</table>\n";
555 print '</div>';
556
557 print '<div class="tabsAction">';
558 print '<input type="submit" class="button" name="submit_GENBARCODE_BARCODETYPE_THIRDPARTY" value="'.$langs->trans("Modify").'">';
559 print "</div>";
560 print '</form>';
561
562 print '<br>';
563}
564
565
566// End of page
567llxFooter();
568$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
Class to manage barcode HTML.
Class to manage generation of HTML components Only common components must be here.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_osencode($str)
Return a string encoded into OS filesystem encoding.
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.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.