dolibarr 22.0.5
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 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].'/'.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}
140restrictedArea($user, 'produit|service', $object->id, 'product_lot');
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', GETPOSTINT('qc_frequency'), '', null, 'int', '', $user, 'PRODUCTLOT_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 if ($action == 'setlifetime' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
266 $result = $object->setValueFrom('lifetime', GETPOSTINT('lifetime'), '', null, 'int', '', $user, 'PRODUCTLOT_MODIFY');
267 if ($result < 0) {
268 setEventMessages($object->error, null, 'errors');
269 $action = 'editlifetime';
270 } else {
271 $action = 'view';
272 }
273 }
274
275 $triggermodname = 'PRODUCTLOT_MODIFY'; // Name of trigger action code to execute when we modify record
276
277 // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
278 include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
279
280 // Action to build doc
281 include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
282
283 // Actions to send emails
284 $triggersendname = 'PRODUCT_LOT_SENTBYMAIL';
285 $autocopy = 'MAIN_MAIL_AUTOCOPY_PRODUCT_LOT_TO';
286 $trackid = 'productlot'.$object->id;
287 include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
288}
289
290
291
292
293/*
294 * View
295 */
296
297$form = new Form($db);
298$formfile = new FormFile($db);
299
300$help_url = '';
301$shortlabel = dol_trunc($object->batch, 16);
302$title = $langs->trans('Batch')." ".$shortlabel." - ".$langs->trans('Card');
303$help_url = 'EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
304
305llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-stock_productlot_card');
306
307$res = $object->fetch_product();
308if ($res > 0 && $object->product) {
309 if ($object->product->sell_or_eat_by_mandatory == Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_BY) {
310 $object->fields['sellby']['notnull'] = 1;
311 } elseif ($object->product->sell_or_eat_by_mandatory == Product::SELL_OR_EAT_BY_MANDATORY_ID_EAT_BY) {
312 $object->fields['eatby']['notnull'] = 1;
313 } elseif ($object->product->sell_or_eat_by_mandatory == Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT) {
314 $object->fields['sellby']['notnull'] = 1;
315 $object->fields['eatby']['notnull'] = 1;
316 }
317}
318// Part to create
319if ($action == 'create') {
320 print load_fiche_titre($langs->trans("Batch"), '', 'object_'.$object->picto);
321
322 print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
323 print '<input type="hidden" name="token" value="'.newToken().'">';
324 print '<input type="hidden" name="action" value="add">';
325 if ($backtopage) {
326 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
327 }
328 if ($backtopageforcancel) {
329 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
330 }
331
332 print dol_get_fiche_head(array(), '');
333
334 print '<table class="border centpercent tableforfieldcreate">'."\n";
335
336 // Common attributes
337 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
338
339 // Other attributes
340 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
341
342 print '</table>'."\n";
343
344 print dol_get_fiche_end();
345
346 print $form->buttonsSaveCancel("Create");
347
348 print '</form>';
349
350 //dol_set_focus('input[name="ref"]');
351}
352
353
354// Part to show record
355if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
356 $res = $object->fetch_optionals();
357
358 $head = productlot_prepare_head($object);
359 print dol_get_fiche_head($head, 'card', $langs->trans("Batch"), -1, $object->picto);
360
361 $formconfirm = '';
362
363 // Confirmation to delete
364 if ($action == 'delete') {
365 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBatch'), $langs->trans('ConfirmDeleteBatch'), 'confirm_delete', '', 0, 1);
366 }
367
368 // Call Hook formConfirm
369 $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
370 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
371 if (empty($reshook)) {
372 $formconfirm .= $hookmanager->resPrint;
373 } elseif ($reshook > 0) {
374 $formconfirm = $hookmanager->resPrint;
375 }
376
377 // Print form confirm
378 print $formconfirm;
379
380 // Object card
381 // ------------------------------------------------------------
382 $linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/productlot_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
383
384 $shownav = 1;
385 if ($user->socid && !in_array('batch', explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')))) {
386 $shownav = 0;
387 }
388
389 $morehtmlref = '';
390
391 dol_banner_tab($object, 'id', $linkback, $shownav, 'rowid', 'batch', $morehtmlref);
392
393 print '<div class="fichecenter">';
394 print '<div class="fichehalfleft">';
395 print '<div class="underbanner clearboth"></div>';
396 print '<table class="border centpercent tableforfield">'."\n";
397
398 // Product
399 print '<tr><td class="titlefield">'.$langs->trans("Product").'</td><td>';
400 $producttmp = new Product($db);
401 $producttmp->fetch($object->fk_product);
402 print $producttmp->getNomUrl(1, 'stock')." - ".$producttmp->label;
403 print '</td></tr>';
404
405 // Sell by
406 if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
407 print '<tr><td>';
408 print $form->editfieldkey($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $permissiontoadd, 'datepicker', '', $object->fields['sellby']['notnull']);
409 print '</td><td>';
410 print $form->editfieldval($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $permissiontoadd, 'datepicker', '', null, null, '', 1, '', 'id', 'auto', array(), $action);
411 print '</td>';
412 print '</tr>';
413 }
414
415 // Eat by
416 if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
417 print '<tr><td>';
418 print $form->editfieldkey($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $permissiontoadd, 'datepicker', '', $object->fields['eatby']['notnull']);
419 print '</td><td>';
420 print $form->editfieldval($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $permissiontoadd, 'datepicker', '', null, null, '', 1, '', 'id', 'auto', array(), $action);
421 print '</td>';
422 print '</tr>';
423 }
424
425 if (getDolGlobalString('PRODUCT_LOT_ENABLE_TRACEABILITY')) {
426 print '<tr><td>'.$form->editfieldkey($langs->trans('ManufacturingDate'), 'manufacturing_date', $object->manufacturing_date, $object, $permissiontoadd).'</td>';
427 print '<td>'.$form->editfieldval($langs->trans('ManufacturingDate'), 'manufacturing_date', $object->manufacturing_date, $object, $permissiontoadd, 'datepicker').'</td>';
428 print '</tr>';
429 // print '<tr><td>'.$form->editfieldkey($langs->trans('FirstUseDate'), 'commissionning_date', $object->commissionning_date, $object, $permissiontoadd).'</td>';
430 // print '<td>'.$form->editfieldval($langs->trans('FirstUseDate'), 'commissionning_date', $object->commissionning_date, $object, $permissiontoadd, 'datepicker').'</td>';
431 // print '</tr>';
432 print '<tr><td>'.$form->editfieldkey($langs->trans('DestructionDate'), 'scrapping_date', $object->scrapping_date, $object, $permissiontoadd).'</td>';
433 print '<td>'.$form->editfieldval($langs->trans('DestructionDate'), 'scrapping_date', $object->scrapping_date, $object, $permissiontoadd, 'datepicker').'</td>';
434 print '</tr>';
435 }
436
437 // Quality control
438 if (getDolGlobalString('PRODUCT_LOT_ENABLE_QUALITY_CONTROL')) {
439 print '<tr><td>'.$form->editfieldkey($langs->trans('EndOfLife'), 'eol_date', $object->eol_date, $object, $permissiontoadd).'</td>';
440 print '<td>'.$form->editfieldval($langs->trans('EndOfLife'), 'eol_date', $object->eol_date, $object, $permissiontoadd, 'datepicker').'</td>';
441 print '</tr>';
442 print '<tr><td>'.$form->editfieldkey($langs->trans('QCFrequency'), 'qc_frequency', $object->qc_frequency, $object, $permissiontoadd).'</td>';
443 print '<td>'.$form->editfieldval($langs->trans('QCFrequency'), 'qc_frequency', $object->qc_frequency, $object, $permissiontoadd, 'string').'</td>';
444 print '</tr>';
445 print '<tr><td>'.$form->editfieldkey($langs->trans('Lifetime'), 'lifetime', $object->lifetime, $object, $permissiontoadd).'</td>';
446 print '<td>'.$form->editfieldval($langs->trans('Lifetime'), 'lifetime', $object->lifetime, $object, $permissiontoadd, 'string').'</td>';
447 print '</tr>';
448 }
449
450 // Other attributes
451 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
452
453 print '</table>';
454 print '</div>';
455 print '</div>';
456
457 print '<div class="clearboth"></div>';
458
459 print dol_get_fiche_end();
460
461 // Link to other lists
462 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>';
463 print '<br>';
464 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>';
465
466 print '<br>';
467
468
469 // Buttons for actions
470 if ($action != 'presend' && $action != 'editline') {
471 print '<div class="tabsAction">'."\n";
472 $parameters = array();
473 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
474 if ($reshook < 0) {
475 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
476 }
477
478 if (empty($reshook)) {
479 /*TODO
480 if ($user->hasRight('stock', 'lire')) {
481 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";
482 }
483 */
484 print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
485 }
486
487 print '</div>'."\n";
488 }
489}
490
491
492
493/*
494 * Generated documents
495 */
496
497if ($action != 'presend') {
498 print '<div class="fichecenter"><div class="fichehalfleft">';
499 print '<a name="builddoc"></a>'; // ancre
500
501 $includedocgeneration = 1;
502
503 // Documents
504 if ($includedocgeneration) {
505 $objref = dol_sanitizeFileName($object->ref);
506 $relativepath = $object->id.'/'.$objref.'.pdf';
507 $filedir = $conf->productbatch->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product_batch');
508 $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
509 $genallowed = $usercanread; // If you can read, you can build the PDF to read content
510 $delallowed = $usercancreate; // If you can create/edit, you can remove a file on card
511 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);
512 }
513
514 print '</div><div class="fichehalfright">';
515
516 $MAXEVENT = 10;
517
518 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
519 $formactions = new FormActions($db);
520 $somethingshown = $formactions->showactions($object, 'productlot', 0, 1, '', $MAXEVENT);
521
522 print '</div></div>';
523}
524
525// End of page
526llxFooter();
527$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:48
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:67
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:63
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...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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)
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.
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.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
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.