dolibarr 24.0.2
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-2026 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
139restrictedArea($user, 'produit|service', $object->id, 'product_lot');
140if (!$permissiontoread) {
142}
143
144
145/*
146 * Actions
147 */
148
149$parameters = array();
150$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
151if ($reshook < 0) {
152 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
153}
154
155if (empty($reshook)) {
156 $error = 0;
157
158 $backurlforlist = dol_buildpath('/product/stock/productlot_list.php', 1);
159
160 if ($action == 'seteatby' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
161 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('eatbymonth'), GETPOSTINT('eatbyday'), GETPOSTINT('eatbyyear'));
162
163 // check parameters
164 $object->eatby = $newvalue;
165 $res = $object->checkSellOrEatByMandatory('eatby');
166 if ($res < 0) {
167 $error++;
168 }
169
170 if (!$error) {
171 $result = $object->setValueFrom('eatby', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
172 if ($result < 0) {
173 $error++;
174 }
175 }
176
177 if ($error) {
178 setEventMessages($object->error, $object->errors, 'errors');
179 $action = 'editeatby';
180 } else {
181 $action = 'view';
182 }
183 }
184
185 if ($action == 'setsellby' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
186 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('sellbymonth'), GETPOSTINT('sellbyday'), GETPOSTINT('sellbyyear'));
187
188 // check parameters
189 $object->sellby = $newvalue;
190 $res = $object->checkSellOrEatByMandatory('sellby');
191 if ($res < 0) {
192 $error++;
193 }
194
195 if (!$error) {
196 $result = $object->setValueFrom('sellby', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
197 if ($result < 0) {
198 $error++;
199 }
200 }
201
202 if ($error) {
203 setEventMessages($object->error, $object->errors, 'errors');
204 $action = 'editsellby';
205 } else {
206 $action = 'view';
207 }
208 }
209
210 if ($action == 'seteol_date' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
211 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('eol_datemonth'), GETPOSTINT('eol_dateday'), GETPOSTINT('eol_dateyear'));
212 $result = $object->setValueFrom('eol_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
213 if ($result < 0) {
214 setEventMessages($object->error, null, 'errors');
215 $action = 'editeol_date';
216 } else {
217 $action = 'view';
218 }
219 }
220
221 if ($action == 'setmanufacturing_date' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
222 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('manufacturing_datemonth'), GETPOSTINT('manufacturing_dateday'), GETPOSTINT('manufacturing_dateyear'));
223 $result = $object->setValueFrom('manufacturing_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
224 if ($result < 0) {
225 setEventMessages($object->error, null, 'errors');
226 $action = 'editmanufacturing_date';
227 } else {
228 $action = 'view';
229 }
230 }
231
232 if ($action == 'setscrapping_date' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
233 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('scrapping_datemonth'), GETPOSTINT('scrapping_dateday'), GETPOSTINT('scrapping_dateyear'));
234 $result = $object->setValueFrom('scrapping_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
235 if ($result < 0) {
236 setEventMessages($object->error, null, 'errors');
237 $action = 'editscrapping_date';
238 } else {
239 $action = 'view';
240 }
241 }
242
243 /* if ($action == 'setcommissionning_date' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
244 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('commissionning_datemonth', 'int'), GETPOSTINT('commissionning_dateday', 'int'), GETPOSTINT('commissionning_dateyear', 'int'));
245 $result = $object->setValueFrom('commissionning_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
246 if ($result < 0) {
247 setEventMessages($object->error, null, 'errors');
248 $action == 'editcommissionning_date';
249 } else {
250 $action = 'view';
251 }
252 } */
253
254 if ($action == 'setqc_frequency' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
255 $result = $object->setValueFrom('qc_frequency', GETPOSTINT('qc_frequency'), '', null, 'int', '', $user, 'PRODUCTLOT_MODIFY');
256 if ($result < 0) { // To provide a duration format test
257 setEventMessages($object->error, null, 'errors');
258 $action = 'editqc_frequency';
259 } else {
260 $action = 'view';
261 }
262 }
263
264 if ($action == 'setlifetime' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
265 $result = $object->setValueFrom('lifetime', GETPOSTINT('lifetime'), '', null, 'int', '', $user, 'PRODUCTLOT_MODIFY');
266 if ($result < 0) {
267 setEventMessages($object->error, null, 'errors');
268 $action = 'editlifetime';
269 } else {
270 $action = 'view';
271 }
272 }
273
274 $triggermodname = 'PRODUCTLOT_MODIFY'; // Name of trigger action code to execute when we modify record
275
276 // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
277 include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
278
279 // Action to build doc
280 include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
281
282 // Actions to send emails
283 $triggersendname = 'PRODUCT_LOT_SENTBYMAIL';
284 $autocopy = 'MAIN_MAIL_AUTOCOPY_PRODUCT_LOT_TO';
285 $trackid = 'productlot'.$object->id;
286 include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
287}
288
289
290
291
292/*
293 * View
294 */
295
296$form = new Form($db);
297$formfile = new FormFile($db);
298
299$help_url = '';
300$shortlabel = dol_trunc($object->batch, 16);
301$title = $langs->trans('Batch')." ".$shortlabel." - ".$langs->trans('Card');
302$help_url = 'EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
303
304llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-stock_productlot_card');
305
306$res = $object->fetch_product();
307if ($res > 0 && $object->product) {
308 if ($object->product->sell_or_eat_by_mandatory == Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_BY) {
309 $object->fields['sellby']['notnull'] = 1;
310 } elseif ($object->product->sell_or_eat_by_mandatory == Product::SELL_OR_EAT_BY_MANDATORY_ID_EAT_BY) {
311 $object->fields['eatby']['notnull'] = 1;
312 } elseif ($object->product->sell_or_eat_by_mandatory == Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT) {
313 $object->fields['sellby']['notnull'] = 1;
314 $object->fields['eatby']['notnull'] = 1;
315 }
316}
317// Part to create
318if ($action == 'create') {
319 print load_fiche_titre($langs->trans("Batch"), '', 'object_'.$object->picto);
320
321 print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
322 print '<input type="hidden" name="token" value="'.newToken().'">';
323 print '<input type="hidden" name="action" value="add">';
324 if ($backtopage) {
325 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
326 }
327 if ($backtopageforcancel) {
328 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
329 }
330
331 print dol_get_fiche_head(array(), '');
332
333 print '<table class="border centpercent tableforfieldcreate">'."\n";
334
335 // Common attributes
336 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
337
338 // Other attributes
339 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
340
341 print '</table>'."\n";
342
343 print dol_get_fiche_end();
344
345 print $form->buttonsSaveCancel("Create");
346
347 print '</form>';
348
349 //dol_set_focus('input[name="ref"]');
350}
351
352
353// Part to show record
354if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
355 $res = $object->fetch_optionals();
356
357 $head = productlot_prepare_head($object);
358 print dol_get_fiche_head($head, 'card', $langs->trans("Batch"), -1, $object->picto);
359
360 $formconfirm = '';
361
362 // Confirmation to delete
363 if ($action == 'delete') {
364 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBatch'), $langs->trans('ConfirmDeleteBatch'), 'confirm_delete', '', 0, 1);
365 }
366
367 // Call Hook formConfirm
368 $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
369 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
370 if (empty($reshook)) {
371 $formconfirm .= $hookmanager->resPrint;
372 } elseif ($reshook > 0) {
373 $formconfirm = $hookmanager->resPrint;
374 }
375
376 // Print form confirm
377 print $formconfirm;
378
379 // Object card
380 // ------------------------------------------------------------
381 $linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/productlot_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
382
383 $shownav = 1;
384 if ($user->socid && !in_array('batch', explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')))) {
385 $shownav = 0;
386 }
387
388 $morehtmlref = '';
389
390 dol_banner_tab($object, 'id', $linkback, $shownav, 'rowid', 'batch', $morehtmlref);
391
392 print '<div class="fichecenter">';
393 print '<div class="fichehalfleft">';
394 print '<div class="underbanner clearboth"></div>';
395 print '<table class="border centpercent tableforfield">'."\n";
396
397 // Product
398 print '<tr><td class="titlefield">'.$langs->trans("Product").'</td><td>';
399 $producttmp = new Product($db);
400 $producttmp->fetch($object->fk_product);
401 print $producttmp->getNomUrl(1, 'stock')." - ".$producttmp->label;
402 print '</td></tr>';
403
404 // Sell by
405 if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
406 print '<tr><td>';
407 print $form->editfieldkey($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $permissiontoadd, 'datepicker', '', $object->fields['sellby']['notnull']);
408 print '</td><td>';
409 print $form->editfieldval($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $permissiontoadd, 'datepicker', '', null, null, '', 1, '', 'id', 'auto', array(), $action);
410 print '</td>';
411 print '</tr>';
412 }
413
414 // Eat by
415 if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
416 print '<tr><td>';
417 print $form->editfieldkey($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $permissiontoadd, 'datepicker', '', $object->fields['eatby']['notnull']);
418 print '</td><td>';
419 print $form->editfieldval($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $permissiontoadd, 'datepicker', '', null, null, '', 1, '', 'id', 'auto', array(), $action);
420 print '</td>';
421 print '</tr>';
422 }
423
424 if (getDolGlobalString('PRODUCT_LOT_ENABLE_TRACEABILITY')) {
425 print '<tr><td>'.$form->editfieldkey($langs->trans('ManufacturingDate'), 'manufacturing_date', $object->manufacturing_date, $object, $permissiontoadd).'</td>';
426 print '<td>'.$form->editfieldval($langs->trans('ManufacturingDate'), 'manufacturing_date', $object->manufacturing_date, $object, $permissiontoadd, 'datepicker').'</td>';
427 print '</tr>';
428 // print '<tr><td>'.$form->editfieldkey($langs->trans('FirstUseDate'), 'commissionning_date', $object->commissionning_date, $object, $permissiontoadd).'</td>';
429 // print '<td>'.$form->editfieldval($langs->trans('FirstUseDate'), 'commissionning_date', $object->commissionning_date, $object, $permissiontoadd, 'datepicker').'</td>';
430 // print '</tr>';
431 print '<tr><td>'.$form->editfieldkey($langs->trans('DestructionDate'), 'scrapping_date', $object->scrapping_date, $object, $permissiontoadd).'</td>';
432 print '<td>'.$form->editfieldval($langs->trans('DestructionDate'), 'scrapping_date', $object->scrapping_date, $object, $permissiontoadd, 'datepicker').'</td>';
433 print '</tr>';
434 }
435
436 // Quality control
437 if (getDolGlobalString('PRODUCT_LOT_ENABLE_QUALITY_CONTROL')) {
438 print '<tr><td>'.$form->editfieldkey($langs->trans('EndOfLife'), 'eol_date', $object->eol_date, $object, $permissiontoadd).'</td>';
439 print '<td>'.$form->editfieldval($langs->trans('EndOfLife'), 'eol_date', $object->eol_date, $object, $permissiontoadd, 'datepicker').'</td>';
440 print '</tr>';
441 print '<tr><td>'.$form->editfieldkey($langs->trans('QCFrequency'), 'qc_frequency', $object->qc_frequency, $object, $permissiontoadd).'</td>';
442 print '<td>'.$form->editfieldval($langs->trans('QCFrequency'), 'qc_frequency', $object->qc_frequency, $object, $permissiontoadd, 'string').'</td>';
443 print '</tr>';
444 print '<tr><td>'.$form->editfieldkey($langs->trans('Lifetime'), 'lifetime', $object->lifetime, $object, $permissiontoadd).'</td>';
445 print '<td>'.$form->editfieldval($langs->trans('Lifetime'), 'lifetime', $object->lifetime, $object, $permissiontoadd, 'string').'</td>';
446 print '</tr>';
447 }
448
449 // Other attributes
450 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
451
452 print '</table>';
453 print '</div>';
454 print '</div>';
455
456 print '<div class="clearboth"></div>';
457
458 print dol_get_fiche_end();
459
460 // Link to other lists
461 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>';
462 print '<br>';
463 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>';
464
465 print '<br>';
466
467
468 // Buttons for actions
469 if ($action != 'presend' && $action != 'editline') {
470 print '<div class="tabsAction">'."\n";
471 $parameters = array();
472 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
473 if ($reshook < 0) {
474 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
475 }
476
477 if (empty($reshook)) {
478 /*TODO
479 if ($user->hasRight('stock', 'lire')) {
480 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";
481 }
482 */
483 print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
484 }
485
486 print '</div>'."\n";
487 }
488}
489
490
491
492/*
493 * Generated documents
494 */
495
496if ($action != 'presend') {
497 print '<div class="fichecenter"><div class="fichehalfleft">';
498 print '<a name="builddoc"></a>'; // ancre
499
500 $includedocgeneration = 1;
501
502 // Documents
503 if ($includedocgeneration) {
504 $objref = dol_sanitizeFileName($object->ref);
505 $relativepath = $object->id.'/'.$objref.'.pdf';
506 $filedir = $conf->productbatch->multidir_output[$object->entity ?? $conf->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product_batch');
507 $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
508 $genallowed = $usercanread; // If you can read, you can build the PDF to read content
509 $delallowed = $usercancreate; // If you can create/edit, you can remove a file on card
510 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);
511 }
512
513 print '</div><div class="fichehalfright">';
514
515 $MAXEVENT = 10;
516
517 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
518 $formactions = new FormActions($db);
519 $somethingshown = $formactions->showactions($object, 'productlot', 0, 1, '', $MAXEVENT);
520
521 print '</div></div>';
522}
523
524// End of page
525llxFooter();
526$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.
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.
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.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
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.
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.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.