dolibarr 24.0.0-beta
productlot_card.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2007-2018 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2018 All-3kcis <contact@all-3kcis.fr>
4 * Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
5 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
6 * Copyright (C) 2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
7 * Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
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';
39require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
40require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
41require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
42require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
43require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
44require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
45
46// Load translation files required by the page
47$langs->loadLangs(array('stocks', 'other', 'productbatch'));
48
49// Get parameters
50$action = GETPOST('action', 'aZ09');
51$confirm = GETPOST('confirm', 'alpha');
52$cancel = GETPOST('cancel');
53$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'productlotcard'; // To manage different context of search
54$backtopage = GETPOST('backtopage', 'alpha');
55$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
56
57$id = GETPOSTINT('id');
58$lineid = GETPOSTINT('lineid');
59$batch = GETPOST('batch', 'alpha');
60$productid = GETPOSTINT('productid');
61$ref = GETPOST('ref', 'alpha'); // ref is productid_batch
62
63
64$modulepart = 'product_batch';
65
66
67// Initialize a technical objects
68
70$hookmanager->initHooks(array('productlotcard', 'globalcard')); // Note that conf->hooks_modules contains array
71
72// Fetch optionals attributes and labels
73$extrafields->fetch_name_optionals_label($object->table_element);
74
75$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
76
77// Initialize array of search criteria
78$search_all = GETPOST("search_all", 'alpha');
79$search = array();
80foreach ($object->fields as $key => $val) {
81 if (GETPOST('search_'.$key, 'alpha')) {
82 $search[$key] = GETPOST('search_'.$key, 'alpha');
83 }
84}
85
86if (empty($action) && empty($id) && empty($ref)) {
87 $action = 'view';
88}
89
90$search_entity = GETPOSTINT('search_entity');
91$search_fk_product = GETPOSTINT('search_fk_product');
92$search_batch = GETPOST('search_batch', 'alpha');
93$search_fk_user_creat = GETPOSTINT('search_fk_user_creat');
94$search_fk_user_modif = GETPOSTINT('search_fk_user_modif');
95$search_import_key = GETPOSTINT('search_import_key');
96
97if (empty($action) && empty($id) && empty($ref)) {
98 $action = 'list';
99}
100
101// Load object
102//include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals
103if ($id || $ref) {
104 if ($ref) {
105 $tmp = explode('_', $ref);
106 $productid = $tmp[0];
107 $batch = $tmp[1];
108 }
109 $object->fetch($id, $productid, $batch);
110 $upload_dir = $conf->productbatch->multidir_output[$object->entity ?? $conf->entity].'/'.get_exdir(0, 0, 0, 1, $object, $modulepart);
111 $filearray = dol_dir_list($upload_dir, "files");
112}
113
114// Initialize a technical object to manage hooks of modules. Note that conf->hooks_modules contains array array
115$hookmanager->initHooks(array('productlotcard', 'globalcard'));
116
117$upload_dir = $conf->productbatch->multidir_output[$conf->entity];
118
119$usercanread = $user->hasRight('produit', 'lire');
120$usercancreate = $user->hasRight('produit', 'creer');
121$usercandelete = $user->hasRight('produit', 'supprimer');
122
123$permissiontoread = $usercanread;
124$permissiontoadd = $usercancreate;
125$permissiontodelete = $usercandelete;
126$permissionnote = $user->hasRight('produit', 'creer'); // Used by the include of actions_setnotes.inc.php
127$permissiondellink = $user->hasRight('produit', 'creer'); // Used by the include of actions_setnotes.inc.php
128
129// Security check
130if (!isModEnabled('productbatch')) {
131 accessforbidden('Module not enabled');
132}
133$socid = 0;
134if ($user->socid > 0) { // Protection if external user
135 //$socid = $user->socid;
137}
138//restrictedArea($user, 'productbatch');
139if (!$permissiontoread) {
141}
142
143
144/*
145 * Actions
146 */
147
148$parameters = array();
149$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
150if ($reshook < 0) {
151 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
152}
153
154if (empty($reshook)) {
155 $error = 0;
156
157 $backurlforlist = dol_buildpath('/product/stock/productlot_list.php', 1);
158
159 if ($action == 'seteatby' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
160 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('eatbymonth'), GETPOSTINT('eatbyday'), GETPOSTINT('eatbyyear'));
161
162 // check parameters
163 $object->eatby = $newvalue;
164 $res = $object->checkSellOrEatByMandatory('eatby');
165 if ($res < 0) {
166 $error++;
167 }
168
169 if (!$error) {
170 $result = $object->setValueFrom('eatby', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
171 if ($result < 0) {
172 $error++;
173 }
174 }
175
176 if ($error) {
177 setEventMessages($object->error, $object->errors, 'errors');
178 $action = 'editeatby';
179 } else {
180 $action = 'view';
181 }
182 }
183
184 if ($action == 'setsellby' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
185 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('sellbymonth'), GETPOSTINT('sellbyday'), GETPOSTINT('sellbyyear'));
186
187 // check parameters
188 $object->sellby = $newvalue;
189 $res = $object->checkSellOrEatByMandatory('sellby');
190 if ($res < 0) {
191 $error++;
192 }
193
194 if (!$error) {
195 $result = $object->setValueFrom('sellby', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
196 if ($result < 0) {
197 $error++;
198 }
199 }
200
201 if ($error) {
202 setEventMessages($object->error, $object->errors, 'errors');
203 $action = 'editsellby';
204 } else {
205 $action = 'view';
206 }
207 }
208
209 if ($action == 'seteol_date' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
210 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('eol_datemonth'), GETPOSTINT('eol_dateday'), GETPOSTINT('eol_dateyear'));
211 $result = $object->setValueFrom('eol_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
212 if ($result < 0) {
213 setEventMessages($object->error, null, 'errors');
214 $action = 'editeol_date';
215 } else {
216 $action = 'view';
217 }
218 }
219
220 if ($action == 'setmanufacturing_date' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
221 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('manufacturing_datemonth'), GETPOSTINT('manufacturing_dateday'), GETPOSTINT('manufacturing_dateyear'));
222 $result = $object->setValueFrom('manufacturing_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
223 if ($result < 0) {
224 setEventMessages($object->error, null, 'errors');
225 $action = 'editmanufacturing_date';
226 } else {
227 $action = 'view';
228 }
229 }
230
231 if ($action == 'setscrapping_date' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
232 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('scrapping_datemonth'), GETPOSTINT('scrapping_dateday'), GETPOSTINT('scrapping_dateyear'));
233 $result = $object->setValueFrom('scrapping_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
234 if ($result < 0) {
235 setEventMessages($object->error, null, 'errors');
236 $action = 'editscrapping_date';
237 } else {
238 $action = 'view';
239 }
240 }
241
242 /* if ($action == 'setcommissionning_date' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
243 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('commissionning_datemonth', 'int'), GETPOSTINT('commissionning_dateday', 'int'), GETPOSTINT('commissionning_dateyear', 'int'));
244 $result = $object->setValueFrom('commissionning_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
245 if ($result < 0) {
246 setEventMessages($object->error, null, 'errors');
247 $action == 'editcommissionning_date';
248 } else {
249 $action = 'view';
250 }
251 } */
252
253 if ($action == 'setqc_frequency' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
254 $result = $object->setValueFrom('qc_frequency', GETPOST('qc_frequency'), '', null, 'int', '', $user, 'PRODUCT_MODIFY');
255 if ($result < 0) { // Prévoir un test de format de durée
256 setEventMessages($object->error, null, 'errors');
257 $action = 'editqc_frequency';
258 } else {
259 $action = 'view';
260 }
261 }
262
263 $triggermodname = 'PRODUCT_LOT_MODIFY'; // Name of trigger action code to execute when we modify record
264
265 // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
266 include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
267
268 // Action to build doc
269 include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
270
271 // Actions to send emails
272 $triggersendname = 'PRODUCT_LOT_SENTBYMAIL';
273 $autocopy = 'MAIN_MAIL_AUTOCOPY_PRODUCT_LOT_TO';
274 $trackid = 'productlot'.$object->id;
275 include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
276}
277
278
279
280
281/*
282 * View
283 */
284
285$form = new Form($db);
286$formfile = new FormFile($db);
287
288$help_url = '';
289$shortlabel = dol_trunc($object->batch, 16);
290$title = $langs->trans('Batch')." ".$shortlabel." - ".$langs->trans('Card');
291$help_url = 'EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
292
293llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-stock_productlot_card');
294
295$res = $object->fetch_product();
296if ($res > 0 && $object->product) {
297 if ($object->product->sell_or_eat_by_mandatory == Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_BY) {
298 $object->fields['sellby']['notnull'] = 1;
299 } elseif ($object->product->sell_or_eat_by_mandatory == Product::SELL_OR_EAT_BY_MANDATORY_ID_EAT_BY) {
300 $object->fields['eatby']['notnull'] = 1;
301 } elseif ($object->product->sell_or_eat_by_mandatory == Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT) {
302 $object->fields['sellby']['notnull'] = 1;
303 $object->fields['eatby']['notnull'] = 1;
304 }
305}
306// Part to create
307if ($action == 'create') {
308 print load_fiche_titre($langs->trans("Batch"), '', 'object_'.$object->picto);
309
310 print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
311 print '<input type="hidden" name="token" value="'.newToken().'">';
312 print '<input type="hidden" name="action" value="add">';
313 if ($backtopage) {
314 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
315 }
316 if ($backtopageforcancel) {
317 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
318 }
319
320 print dol_get_fiche_head(array(), '');
321
322 print '<table class="border centpercent tableforfieldcreate">'."\n";
323
324 // Common attributes
325 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
326
327 // Other attributes
328 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
329
330 print '</table>'."\n";
331
332 print dol_get_fiche_end();
333
334 print $form->buttonsSaveCancel("Create");
335
336 print '</form>';
337
338 //dol_set_focus('input[name="ref"]');
339}
340
341
342// Part to show record
343if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
344 $res = $object->fetch_optionals();
345
346 $head = productlot_prepare_head($object);
347 print dol_get_fiche_head($head, 'card', $langs->trans("Batch"), -1, $object->picto);
348
349 $formconfirm = '';
350
351 // Confirmation to delete
352 if ($action == 'delete') {
353 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBatch'), $langs->trans('ConfirmDeleteBatch'), 'confirm_delete', '', 0, 1);
354 }
355
356 // Call Hook formConfirm
357 $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
358 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
359 if (empty($reshook)) {
360 $formconfirm .= $hookmanager->resPrint;
361 } elseif ($reshook > 0) {
362 $formconfirm = $hookmanager->resPrint;
363 }
364
365 // Print form confirm
366 print $formconfirm;
367
368 // Object card
369 // ------------------------------------------------------------
370 $linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/productlot_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
371
372 $shownav = 1;
373 if ($user->socid && !in_array('batch', explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')))) {
374 $shownav = 0;
375 }
376
377 $morehtmlref = '';
378
379 dol_banner_tab($object, 'id', $linkback, $shownav, 'rowid', 'batch', $morehtmlref);
380
381 print '<div class="fichecenter">';
382 print '<div class="fichehalfleft">';
383 print '<div class="underbanner clearboth"></div>';
384 print '<table class="border centpercent tableforfield">'."\n";
385
386 // Product
387 print '<tr><td class="titlefield">'.$langs->trans("Product").'</td><td>';
388 $producttmp = new Product($db);
389 $producttmp->fetch($object->fk_product);
390 print $producttmp->getNomUrl(1, 'stock')." - ".$producttmp->label;
391 print '</td></tr>';
392
393 // Sell by
394 if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
395 print '<tr><td>';
396 print $form->editfieldkey($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->hasRight('stock', 'creer'), 'datepicker', '', $object->fields['sellby']['notnull']);
397 print '</td><td>';
398 print $form->editfieldval($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->hasRight('stock', 'creer'), 'datepicker', '', null, null, '', 1, '', 'id', 'auto', array(), $action);
399 print '</td>';
400 print '</tr>';
401 }
402
403 // Eat by
404 if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
405 print '<tr><td>';
406 print $form->editfieldkey($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->hasRight('stock', 'creer'), 'datepicker', '', $object->fields['eatby']['notnull']);
407 print '</td><td>';
408 print $form->editfieldval($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->hasRight('stock', 'creer'), 'datepicker', '', null, null, '', 1, '', 'id', 'auto', array(), $action);
409 print '</td>';
410 print '</tr>';
411 }
412
413 if (getDolGlobalString('PRODUCT_LOT_ENABLE_TRACEABILITY')) {
414 print '<tr><td>'.$form->editfieldkey($langs->trans('ManufacturingDate'), 'manufacturing_date', $object->manufacturing_date, $object, $user->hasRight('stock', 'creer')).'</td>';
415 print '<td>'.$form->editfieldval($langs->trans('ManufacturingDate'), 'manufacturing_date', $object->manufacturing_date, $object, $user->hasRight('stock', 'creer'), 'datepicker').'</td>';
416 print '</tr>';
417 // print '<tr><td>'.$form->editfieldkey($langs->trans('FirstUseDate'), 'commissionning_date', $object->commissionning_date, $object, $user->hasRight('stock', 'creer')).'</td>';
418 // print '<td>'.$form->editfieldval($langs->trans('FirstUseDate'), 'commissionning_date', $object->commissionning_date, $object, $user->hasRight('stock', 'creer'), 'datepicker').'</td>';
419 // print '</tr>';
420 print '<tr><td>'.$form->editfieldkey($langs->trans('DestructionDate'), 'scrapping_date', $object->scrapping_date, $object, $user->hasRight('stock', 'creer')).'</td>';
421 print '<td>'.$form->editfieldval($langs->trans('DestructionDate'), 'scrapping_date', $object->scrapping_date, $object, $user->hasRight('stock', 'creer'), 'datepicker').'</td>';
422 print '</tr>';
423 }
424
425 // Quality control
426 if (getDolGlobalString('PRODUCT_LOT_ENABLE_QUALITY_CONTROL')) {
427 print '<tr><td>'.$form->editfieldkey($langs->trans('EndOfLife'), 'eol_date', $object->eol_date, $object, $user->hasRight('stock', 'creer')).'</td>';
428 print '<td>'.$form->editfieldval($langs->trans('EndOfLife'), 'eol_date', $object->eol_date, $object, $user->hasRight('stock', 'creer'), 'datepicker').'</td>';
429 print '</tr>';
430 print '<tr><td>'.$form->editfieldkey($langs->trans('QCFrequency'), 'qc_frequency', $object->qc_frequency, $object, $user->hasRight('stock', 'creer')).'</td>';
431 print '<td>'.$form->editfieldval($langs->trans('QCFrequency'), 'qc_frequency', $object->qc_frequency, $object, $user->hasRight('stock', 'creer'), 'string').'</td>';
432 print '</tr>';
433 print '<tr><td>'.$form->editfieldkey($langs->trans('Lifetime'), 'lifetime', $object->lifetime, $object, $user->hasRight('stock', 'creer')).'</td>';
434 print '<td>'.$form->editfieldval($langs->trans('Lifetime'), 'lifetime', $object->lifetime, $object, $user->hasRight('stock', 'creer'), 'string').'</td>';
435 print '</tr>';
436 }
437
438 // Other attributes
439 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
440
441 print '</table>';
442 print '</div>';
443 print '</div>';
444
445 print '<div class="clearboth"></div>';
446
447 print dol_get_fiche_end();
448
449 // Link to other lists
450 print '<a href="'.DOL_URL_ROOT.'/product/reassortlot.php?sref='.urlencode($producttmp->ref).'&search_batch='.urlencode($object->batch).'">'.img_object('', 'stock', 'class="pictofixedwidth"').$langs->trans("ShowCurrentStockOfLot").'</a><br>';
451 print '<br>';
452 print '<a href="'.DOL_URL_ROOT.'/product/stock/movement_list.php?search_product_ref='.urlencode($producttmp->ref).'&search_batch='.urlencode($object->batch).'">'.img_object('', 'movement', 'class="pictofixedwidth"').$langs->trans("ShowLogOfMovementIfLot").'</a><br>';
453
454 print '<br>';
455
456
457 // Buttons for actions
458 if ($action != 'presend' && $action != 'editline') {
459 print '<div class="tabsAction">'."\n";
460 $parameters = array();
461 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
462 if ($reshook < 0) {
463 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
464 }
465
466 if (empty($reshook)) {
467 /*TODO
468 if ($user->hasRight('stock', 'lire')) {
469 print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a></div>'."\n";
470 }
471 */
472 print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
473 }
474
475 print '</div>'."\n";
476 }
477}
478
479
480
481/*
482 * Generated documents
483 */
484
485if ($action != 'presend') {
486 print '<div class="fichecenter"><div class="fichehalfleft">';
487 print '<a name="builddoc"></a>'; // ancre
488
489 $includedocgeneration = 1;
490
491 // Documents
492 if ($includedocgeneration) {
493 $objref = dol_sanitizeFileName($object->ref);
494 $relativepath = $object->id.'/'.$objref.'.pdf';
495 $filedir = $conf->productbatch->multidir_output[$object->entity ?? $conf->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product_batch');
496 $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
497 $genallowed = $usercanread; // If you can read, you can build the PDF to read content
498 $delallowed = $usercancreate; // If you can create/edit, you can remove a file on card
499 print $formfile->showdocuments('product_batch', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, '', '', '', (empty($object->default_lang) ? '' : $object->default_lang), '', $object);
500 }
501
502 print '</div><div class="fichehalfright">';
503
504 $MAXEVENT = 10;
505
506 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
507 $formactions = new FormActions($db);
508 $somethingshown = $formactions->showactions($object, 'productlot', 0, 1, '', $MAXEVENT);
509
510 print '</div></div>';
511}
512
513// End of page
514llxFooter();
515$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
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 building of HTML components.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
Class to manage products or services.
Class with list of lots and properties.
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.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
Definition files.lib.php:64
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
productlot_prepare_head($object)
Prepare array with list of tabs.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.