dolibarr 23.0.3
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-2025 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';
31require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
32require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
33require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
34require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
35require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
36require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
37require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
38
47// Load translation files required by the page
48$langs->loadLangs(array('stocks', 'other', 'productbatch'));
49
50// Get parameters
51$action = GETPOST('action', 'aZ09');
52$confirm = GETPOST('confirm', 'alpha');
53$cancel = GETPOST('cancel');
54$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
55$backtopage = GETPOST('backtopage', 'alpha');
56$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
57
58$id = GETPOSTINT('id');
59$lineid = GETPOSTINT('lineid');
60$batch = GETPOST('batch', 'alpha');
61$productid = GETPOSTINT('productid');
62$ref = GETPOST('ref', 'alpha'); // ref is productid_batch
63
64
65$modulepart = 'product_batch';
66
67
68// Initialize a technical objects
69
70$object = new Productlot($db);
71$extrafields = new ExtraFields($db);
72$hookmanager->initHooks(array('productlotcard', 'globalcard')); // Note that conf->hooks_modules contains array
73
74// Fetch optionals attributes and labels
75$extrafields->fetch_name_optionals_label($object->table_element);
76
77$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
78
79// Initialize array of search criteria
80$search_all = GETPOST("search_all", 'alpha');
81$search = array();
82foreach ($object->fields as $key => $val) {
83 if (GETPOST('search_'.$key, 'alpha')) {
84 $search[$key] = GETPOST('search_'.$key, 'alpha');
85 }
86}
87
88if (empty($action) && empty($id) && empty($ref)) {
89 $action = 'view';
90}
91
92$search_entity = GETPOSTINT('search_entity');
93$search_fk_product = GETPOSTINT('search_fk_product');
94$search_batch = GETPOST('search_batch', 'alpha');
95$search_fk_user_creat = GETPOSTINT('search_fk_user_creat');
96$search_fk_user_modif = GETPOSTINT('search_fk_user_modif');
97$search_import_key = GETPOSTINT('search_import_key');
98
99if (empty($action) && empty($id) && empty($ref)) {
100 $action = 'list';
101}
102
103// Load object
104//include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals
105if ($id || $ref) {
106 if ($ref) {
107 $tmp = explode('_', $ref);
108 $productid = $tmp[0];
109 $batch = $tmp[1];
110 }
111 $object->fetch($id, $productid, $batch);
112 $upload_dir = $conf->productbatch->multidir_output[$object->entity ?? $conf->entity].'/'.get_exdir(0, 0, 0, 1, $object, $modulepart);
113 $filearray = dol_dir_list($upload_dir, "files");
114}
115
116// Initialize a technical object to manage hooks of modules. Note that conf->hooks_modules contains array array
117$hookmanager->initHooks(array('productlotcard', 'globalcard'));
118
119$upload_dir = $conf->productbatch->multidir_output[$conf->entity];
120
121$usercanread = $user->hasRight('produit', 'lire');
122$usercancreate = $user->hasRight('produit', 'creer');
123$usercandelete = $user->hasRight('produit', 'supprimer');
124
125$permissiontoread = $usercanread;
126$permissiontoadd = $usercancreate;
127$permissiontodelete = $usercandelete;
128$permissionnote = $user->hasRight('produit', 'creer'); // Used by the include of actions_setnotes.inc.php
129$permissiondellink = $user->hasRight('produit', 'creer'); // Used by the include of actions_setnotes.inc.php
130
131// Security check
132if (!isModEnabled('productbatch')) {
133 accessforbidden('Module not enabled');
134}
135$socid = 0;
136if ($user->socid > 0) { // Protection if external user
137 //$socid = $user->socid;
139}
140//restrictedArea($user, 'productbatch');
141if (!$permissiontoread) {
143}
144
145
146/*
147 * Actions
148 */
149
150$parameters = array();
151$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
152if ($reshook < 0) {
153 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
154}
155
156if (empty($reshook)) {
157 $error = 0;
158
159 $backurlforlist = dol_buildpath('/product/stock/productlot_list.php', 1);
160
161 if ($action == 'seteatby' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
162 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('eatbymonth'), GETPOSTINT('eatbyday'), GETPOSTINT('eatbyyear'));
163
164 // check parameters
165 $object->eatby = $newvalue;
166 $res = $object->checkSellOrEatByMandatory('eatby');
167 if ($res < 0) {
168 $error++;
169 }
170
171 if (!$error) {
172 $result = $object->setValueFrom('eatby', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
173 if ($result < 0) {
174 $error++;
175 }
176 }
177
178 if ($error) {
179 setEventMessages($object->error, $object->errors, 'errors');
180 $action = 'editeatby';
181 } else {
182 $action = 'view';
183 }
184 }
185
186 if ($action == 'setsellby' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
187 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('sellbymonth'), GETPOSTINT('sellbyday'), GETPOSTINT('sellbyyear'));
188
189 // check parameters
190 $object->sellby = $newvalue;
191 $res = $object->checkSellOrEatByMandatory('sellby');
192 if ($res < 0) {
193 $error++;
194 }
195
196 if (!$error) {
197 $result = $object->setValueFrom('sellby', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
198 if ($result < 0) {
199 $error++;
200 }
201 }
202
203 if ($error) {
204 setEventMessages($object->error, $object->errors, 'errors');
205 $action = 'editsellby';
206 } else {
207 $action = 'view';
208 }
209 }
210
211 if ($action == 'seteol_date' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
212 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('eol_datemonth'), GETPOSTINT('eol_dateday'), GETPOSTINT('eol_dateyear'));
213 $result = $object->setValueFrom('eol_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
214 if ($result < 0) {
215 setEventMessages($object->error, null, 'errors');
216 $action = 'editeol_date';
217 } else {
218 $action = 'view';
219 }
220 }
221
222 if ($action == 'setmanufacturing_date' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
223 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('manufacturing_datemonth'), GETPOSTINT('manufacturing_dateday'), GETPOSTINT('manufacturing_dateyear'));
224 $result = $object->setValueFrom('manufacturing_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
225 if ($result < 0) {
226 setEventMessages($object->error, null, 'errors');
227 $action = 'editmanufacturing_date';
228 } else {
229 $action = 'view';
230 }
231 }
232
233 if ($action == 'setscrapping_date' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
234 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('scrapping_datemonth'), GETPOSTINT('scrapping_dateday'), GETPOSTINT('scrapping_dateyear'));
235 $result = $object->setValueFrom('scrapping_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
236 if ($result < 0) {
237 setEventMessages($object->error, null, 'errors');
238 $action = 'editscrapping_date';
239 } else {
240 $action = 'view';
241 }
242 }
243
244 /* if ($action == 'setcommissionning_date' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
245 $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('commissionning_datemonth', 'int'), GETPOSTINT('commissionning_dateday', 'int'), GETPOSTINT('commissionning_dateyear', 'int'));
246 $result = $object->setValueFrom('commissionning_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
247 if ($result < 0) {
248 setEventMessages($object->error, null, 'errors');
249 $action == 'editcommissionning_date';
250 } else {
251 $action = 'view';
252 }
253 } */
254
255 if ($action == 'setqc_frequency' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
256 $result = $object->setValueFrom('qc_frequency', GETPOST('qc_frequency'), '', null, 'int', '', $user, 'PRODUCT_MODIFY');
257 if ($result < 0) { // Prévoir un test de format de durée
258 setEventMessages($object->error, null, 'errors');
259 $action = 'editqc_frequency';
260 } else {
261 $action = 'view';
262 }
263 }
264
265 $triggermodname = 'PRODUCT_LOT_MODIFY'; // Name of trigger action code to execute when we modify record
266
267 // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
268 include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
269
270 // Action to build doc
271 include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
272
273 // Actions to send emails
274 $triggersendname = 'PRODUCT_LOT_SENTBYMAIL';
275 $autocopy = 'MAIN_MAIL_AUTOCOPY_PRODUCT_LOT_TO';
276 $trackid = 'productlot'.$object->id;
277 include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
278}
279
280
281
282
283/*
284 * View
285 */
286
287$form = new Form($db);
288$formfile = new FormFile($db);
289
290$help_url = '';
291$shortlabel = dol_trunc($object->batch, 16);
292$title = $langs->trans('Batch')." ".$shortlabel." - ".$langs->trans('Card');
293$help_url = 'EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
294
295llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-stock_productlot_card');
296
297$res = $object->fetch_product();
298if ($res > 0 && $object->product) {
299 if ($object->product->sell_or_eat_by_mandatory == Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_BY) {
300 $object->fields['sellby']['notnull'] = 1;
301 } elseif ($object->product->sell_or_eat_by_mandatory == Product::SELL_OR_EAT_BY_MANDATORY_ID_EAT_BY) {
302 $object->fields['eatby']['notnull'] = 1;
303 } elseif ($object->product->sell_or_eat_by_mandatory == Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT) {
304 $object->fields['sellby']['notnull'] = 1;
305 $object->fields['eatby']['notnull'] = 1;
306 }
307}
308// Part to create
309if ($action == 'create') {
310 print load_fiche_titre($langs->trans("Batch"), '', 'object_'.$object->picto);
311
312 print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
313 print '<input type="hidden" name="token" value="'.newToken().'">';
314 print '<input type="hidden" name="action" value="add">';
315 if ($backtopage) {
316 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
317 }
318 if ($backtopageforcancel) {
319 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
320 }
321
322 print dol_get_fiche_head(array(), '');
323
324 print '<table class="border centpercent tableforfieldcreate">'."\n";
325
326 // Common attributes
327 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
328
329 // Other attributes
330 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
331
332 print '</table>'."\n";
333
334 print dol_get_fiche_end();
335
336 print $form->buttonsSaveCancel("Create");
337
338 print '</form>';
339
340 //dol_set_focus('input[name="ref"]');
341}
342
343
344// Part to show record
345if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
346 $res = $object->fetch_optionals();
347
348 $head = productlot_prepare_head($object);
349 print dol_get_fiche_head($head, 'card', $langs->trans("Batch"), -1, $object->picto);
350
351 $formconfirm = '';
352
353 // Confirmation to delete
354 if ($action == 'delete') {
355 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBatch'), $langs->trans('ConfirmDeleteBatch'), 'confirm_delete', '', 0, 1);
356 }
357
358 // Call Hook formConfirm
359 $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
360 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
361 if (empty($reshook)) {
362 $formconfirm .= $hookmanager->resPrint;
363 } elseif ($reshook > 0) {
364 $formconfirm = $hookmanager->resPrint;
365 }
366
367 // Print form confirm
368 print $formconfirm;
369
370 // Object card
371 // ------------------------------------------------------------
372 $linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/productlot_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
373
374 $shownav = 1;
375 if ($user->socid && !in_array('batch', explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')))) {
376 $shownav = 0;
377 }
378
379 $morehtmlref = '';
380
381 dol_banner_tab($object, 'id', $linkback, $shownav, 'rowid', 'batch', $morehtmlref);
382
383 print '<div class="fichecenter">';
384 print '<div class="fichehalfleft">';
385 print '<div class="underbanner clearboth"></div>';
386 print '<table class="border centpercent tableforfield">'."\n";
387
388 // Product
389 print '<tr><td class="titlefield">'.$langs->trans("Product").'</td><td>';
390 $producttmp = new Product($db);
391 $producttmp->fetch($object->fk_product);
392 print $producttmp->getNomUrl(1, 'stock')." - ".$producttmp->label;
393 print '</td></tr>';
394
395 // Sell by
396 if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
397 print '<tr><td>';
398 print $form->editfieldkey($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->hasRight('stock', 'creer'), 'datepicker', '', $object->fields['sellby']['notnull']);
399 print '</td><td>';
400 print $form->editfieldval($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->hasRight('stock', 'creer'), 'datepicker', '', null, null, '', 1, '', 'id', 'auto', array(), $action);
401 print '</td>';
402 print '</tr>';
403 }
404
405 // Eat by
406 if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
407 print '<tr><td>';
408 print $form->editfieldkey($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->hasRight('stock', 'creer'), 'datepicker', '', $object->fields['eatby']['notnull']);
409 print '</td><td>';
410 print $form->editfieldval($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->hasRight('stock', 'creer'), 'datepicker', '', null, null, '', 1, '', 'id', 'auto', array(), $action);
411 print '</td>';
412 print '</tr>';
413 }
414
415 if (getDolGlobalString('PRODUCT_LOT_ENABLE_TRACEABILITY')) {
416 print '<tr><td>'.$form->editfieldkey($langs->trans('ManufacturingDate'), 'manufacturing_date', $object->manufacturing_date, $object, $user->hasRight('stock', 'creer')).'</td>';
417 print '<td>'.$form->editfieldval($langs->trans('ManufacturingDate'), 'manufacturing_date', $object->manufacturing_date, $object, $user->hasRight('stock', 'creer'), 'datepicker').'</td>';
418 print '</tr>';
419 // print '<tr><td>'.$form->editfieldkey($langs->trans('FirstUseDate'), 'commissionning_date', $object->commissionning_date, $object, $user->hasRight('stock', 'creer')).'</td>';
420 // print '<td>'.$form->editfieldval($langs->trans('FirstUseDate'), 'commissionning_date', $object->commissionning_date, $object, $user->hasRight('stock', 'creer'), 'datepicker').'</td>';
421 // print '</tr>';
422 print '<tr><td>'.$form->editfieldkey($langs->trans('DestructionDate'), 'scrapping_date', $object->scrapping_date, $object, $user->hasRight('stock', 'creer')).'</td>';
423 print '<td>'.$form->editfieldval($langs->trans('DestructionDate'), 'scrapping_date', $object->scrapping_date, $object, $user->hasRight('stock', 'creer'), 'datepicker').'</td>';
424 print '</tr>';
425 }
426
427 // Quality control
428 if (getDolGlobalString('PRODUCT_LOT_ENABLE_QUALITY_CONTROL')) {
429 print '<tr><td>'.$form->editfieldkey($langs->trans('EndOfLife'), 'eol_date', $object->eol_date, $object, $user->hasRight('stock', 'creer')).'</td>';
430 print '<td>'.$form->editfieldval($langs->trans('EndOfLife'), 'eol_date', $object->eol_date, $object, $user->hasRight('stock', 'creer'), 'datepicker').'</td>';
431 print '</tr>';
432 print '<tr><td>'.$form->editfieldkey($langs->trans('QCFrequency'), 'qc_frequency', $object->qc_frequency, $object, $user->hasRight('stock', 'creer')).'</td>';
433 print '<td>'.$form->editfieldval($langs->trans('QCFrequency'), 'qc_frequency', $object->qc_frequency, $object, $user->hasRight('stock', 'creer'), 'string').'</td>';
434 print '</tr>';
435 print '<tr><td>'.$form->editfieldkey($langs->trans('Lifetime'), 'lifetime', $object->lifetime, $object, $user->hasRight('stock', 'creer')).'</td>';
436 print '<td>'.$form->editfieldval($langs->trans('Lifetime'), 'lifetime', $object->lifetime, $object, $user->hasRight('stock', 'creer'), 'string').'</td>';
437 print '</tr>';
438 }
439
440 // Other attributes
441 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
442
443 print '</table>';
444 print '</div>';
445 print '</div>';
446
447 print '<div class="clearboth"></div>';
448
449 print dol_get_fiche_end();
450
451 // Link to other lists
452 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>';
453 print '<br>';
454 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>';
455
456 print '<br>';
457
458
459 // Buttons for actions
460 if ($action != 'presend' && $action != 'editline') {
461 print '<div class="tabsAction">'."\n";
462 $parameters = array();
463 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
464 if ($reshook < 0) {
465 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
466 }
467
468 if (empty($reshook)) {
469 /*TODO
470 if ($user->hasRight('stock', 'lire')) {
471 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";
472 }
473 */
474 print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
475 }
476
477 print '</div>'."\n";
478 }
479}
480
481
482
483/*
484 * Generated documents
485 */
486
487if ($action != 'presend') {
488 print '<div class="fichecenter"><div class="fichehalfleft">';
489 print '<a name="builddoc"></a>'; // ancre
490
491 $includedocgeneration = 1;
492
493 // Documents
494 if ($includedocgeneration) {
495 $objref = dol_sanitizeFileName($object->ref);
496 $relativepath = $object->id.'/'.$objref.'.pdf';
497 $filedir = $conf->productbatch->multidir_output[$object->entity ?? $conf->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product_batch');
498 $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
499 $genallowed = $usercanread; // If you can read, you can build the PDF to read content
500 $delallowed = $usercancreate; // If you can create/edit, you can remove a file on card
501 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);
502 }
503
504 print '</div><div class="fichehalfright">';
505
506 $MAXEVENT = 10;
507
508 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
509 $formactions = new FormActions($db);
510 $somethingshown = $formactions->showactions($object, 'productlot', 0, 1, '', $MAXEVENT);
511
512 print '</div></div>';
513}
514
515// End of page
516llxFooter();
517$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 standard extra fields.
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.
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.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
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.