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