29require
'../../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/modules/import/import_csv.modules.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/import.lib.php';
40$confirm =
GETPOST(
'confirm',
'alpha');
41$filetoimport =
GETPOST(
'filetoimport');
44$langs->loadLangs(array(
'products',
'stocks',
'orders',
'productbatch'));
47$hookmanager->initHooks(array(
'massstockmove'));
51 $socid = $user->socid;
57$action =
GETPOST(
'action',
'aZ09');
67$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
68$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
70if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
74$offset = $limit * $page;
86 unset($_SESSION[
'massstockmove']);
89if (!empty($_SESSION[
'massstockmove'])) {
90 $listofdata = json_decode($_SESSION[
'massstockmove'],
true);
91 if (!is_array($listofdata)) {
92 $listofdata = array();
103if ($action ==
'addline' && $user->hasRight(
'stock',
'mouvement',
'creer')) {
113 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WarehouseTarget")),
null,
'errors');
115 if ($id_sw > 0 && $id_tw == $id_sw) {
117 $langs->load(
"errors");
118 setEventMessages($langs->trans(
"ErrorWarehouseMustDiffers"),
null,
'errors');
120 if (!($id_product > 0)) {
122 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Product")),
null,
'errors');
126 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Qty")),
null,
'errors');
131 $producttmp =
new Product($db);
132 $producttmp->fetch($id_product);
133 if ($producttmp->hasbatch()) {
136 $langs->load(
"errors");
137 setEventMessages($langs->trans(
"ErrorTryToMakeMoveOnProductRequiringBatchData", $producttmp->ref),
null,
'errors');
146 if ($producttmp->hasbatch()) {
153 if (count(array_keys($listofdata)) > 0) {
154 $id = max(array_keys($listofdata)) + 1;
158 $listofdata[
$id] = array(
'id' =>
$id,
'id_product' => $id_product,
'qty' => $qty,
'id_sw' => $id_sw,
'id_tw' => $id_tw,
'batch' => $batch);
159 $_SESSION[
'massstockmove'] = json_encode($listofdata);
169if ($action ==
'delline' && $idline !=
'' && $user->hasRight(
'stock',
'mouvement',
'creer')) {
170 if (!empty($listofdata[$idline])) {
171 unset($listofdata[$idline]);
173 if (count($listofdata) > 0) {
174 $_SESSION[
'massstockmove'] = json_encode($listofdata);
176 unset($_SESSION[
'massstockmove']);
180if ($action ==
'createmovements' && $user->hasRight(
'stock',
'mouvement',
'creer')) {
185 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MovementLabel")),
null,
'errors');
193 foreach ($listofdata as $key => $val) {
195 $id_product = $val[
'id_product'];
196 $id_sw = $val[
'id_sw'];
197 $id_tw = $val[
'id_tw'];
199 $batch = $val[
'batch'];
203 if (!$error && $id_sw != $id_tw && is_numeric($qty) && $id_product) {
204 $result = $product->fetch($id_product);
206 $product->load_stock(
'novirtual');
210 if (!empty($product->pmp)) {
211 $pricesrc = $product->pmp;
213 $pricedest = $pricesrc;
217 if (empty($conf->productbatch->enabled) || !$product->hasbatch()) {
220 $result1 = $product->correct_stock(
236 $result2 = $product->correct_stock(
250 $arraybatchinfo = $product->loadBatchInfo($batch);
251 if (count($arraybatchinfo) > 0) {
252 $firstrecord = array_shift($arraybatchinfo);
253 $dlc = $firstrecord[
'eatby'];
254 $dluo = $firstrecord[
'sellby'];
267 $result1 = $product->correct_stock_batch(
286 $result2 = $product->correct_stock_batch(
312 unset($_SESSION[
'massstockmove']);
316 header(
"Location: ".DOL_URL_ROOT.
'/product/stock/list.php');
324if ($action ==
'importCSV' && $user->hasRight(
'stock',
'mouvement',
'creer')) {
328 $fullpath = $conf->stock->dir_temp.
"/".$user->id.
'-csvfiletotimport.csv';
330 if (is_numeric($resultupload) && $resultupload > 0) {
331 dol_syslog(
"File ".$fullpath.
" was added for import");
334 $langs->load(
"errors");
335 if ($resultupload ===
'ErrorDirNotWritable') {
336 setEventMessages($langs->trans(
"ErrorFailedToSaveFile").
' - '.$langs->trans($resultupload, $fullpath),
null,
'errors');
343 $importcsv =
new ImportCsv($db,
'massstocklist');
346 $nblinesrecord = $importcsv->import_get_nb_of_lines($fullpath) - 1;
347 $importcsv->import_open_file($fullpath);
348 $labelsrecord = $importcsv->import_read_record();
350 if ($nblinesrecord < 1) {
351 setEventMessages($langs->trans(
"BadNumberOfLinesMustHaveAtLeastOneLinePlusTitle"),
null,
'errors');
355 $productstatic =
new Product($db);
356 $warehousestatics =
new Entrepot($db);
357 $warehousestatict =
new Entrepot($db);
360 while (($i < $nblinesrecord) && !$error) {
361 $newrecord = $importcsv->import_read_record();
363 $data[$i] = $newrecord;
364 if (count($data[$i]) == 1) {
371 $tmp_id_sw = $data[$i][0][
'val'];
372 $tmp_id_tw = $data[$i][1][
'val'];
373 $tmp_id_product = $data[$i][2][
'val'];
374 $tmp_qty = $data[$i][3][
'val'];
375 $tmp_batch = $data[$i][4][
'val'];
377 $errorforproduct = 0;
379 if (!is_numeric($tmp_id_product) && $tmp_id_product !=
'' && preg_match(
'/^id:/i', $tmp_id_product)) {
382 $tmp_id_product = preg_replace(
'/^(id|ref):/i',
'', $tmp_id_product);
384 if ($isidorref ===
'ref') {
385 $tmp_id_product = preg_replace(
'/^ref:/',
'', $tmp_id_product);
386 $result =
fetchref($productstatic, $tmp_id_product);
387 if ($result === -2) {
389 $errorforproduct = 1;
390 $langs->load(
"errors");
391 setEventMessages($langs->trans(
"ErrorMultipleRecordFoundFromRef", $tmp_id_product),
null,
'errors');
392 } elseif ($result <= 0) {
394 $errorforproduct = 1;
395 $langs->load(
"errors");
396 setEventMessages($langs->trans(
"ErrorRefNotFound", $tmp_id_product),
null,
'errors');
398 $tmp_id_product = $result;
400 $data[$i][2][
'val'] = $tmp_id_product;
401 if (!$errorforproduct && !($tmp_id_product > 0)) {
403 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Product")),
null,
'errors');
406 if ($tmp_id_sw !==
'') {
408 $errorforwarehouses = 0;
410 if (!is_numeric($tmp_id_sw) && $tmp_id_sw !=
'' && preg_match(
'/^id:/i', $tmp_id_sw)) {
413 $tmp_id_sw = preg_replace(
'/^(id|ref):/i',
'', $tmp_id_sw);
414 if ($isidorref ===
'ref') {
415 $tmp_id_sw = preg_replace(
'/^ref:/',
'', $tmp_id_sw);
416 $result =
fetchref($warehousestatics, $tmp_id_sw);
417 if ($result === -2) {
419 $errorforwarehouses = 1;
420 $langs->load(
"errors");
421 setEventMessages($langs->trans(
"ErrorMultipleRecordFoundFromRef", $tmp_id_sw),
null,
'errors');
422 } elseif ($result <= 0) {
424 $errorforwarehouses = 1;
425 $langs->load(
"errors");
426 setEventMessages($langs->trans(
"ErrorRefNotFound", $tmp_id_sw),
null,
'errors');
428 $tmp_id_sw = $result;
430 $data[$i][0][
'val'] = $tmp_id_sw;
431 if (!$errorforwarehouses && !($tmp_id_sw > 0)) {
433 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WarehouseSource")),
null,
'errors');
437 $errorforwarehouset = 0;
439 if (!is_numeric($tmp_id_tw) && $tmp_id_tw !=
'' && preg_match(
'/^id:/i', $tmp_id_tw)) {
442 $tmp_id_tw = preg_replace(
'/^(id|ref):/i',
'', $tmp_id_tw);
443 if ($isidorref ===
'ref') {
444 $tmp_id_tw = preg_replace(
'/^ref:/',
'', $tmp_id_tw);
445 $result =
fetchref($warehousestatict, $tmp_id_tw);
446 if ($result === -2) {
448 $errorforwarehouset = 1;
449 $langs->load(
"errors");
450 setEventMessages($langs->trans(
"ErrorMultipleRecordFoundFromRef", $tmp_id_tw),
null,
'errors');
451 } elseif ($result <= 0) {
453 $errorforwarehouset = 1;
454 $langs->load(
"errors");
455 setEventMessages($langs->trans(
"ErrorRefNotFound", $tmp_id_tw),
null,
'errors');
457 $tmp_id_tw = $result;
459 $data[$i][1][
'val'] = $tmp_id_tw;
460 if (!$errorforwarehouset && !($tmp_id_tw > 0)) {
462 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WarehouseTarget")),
null,
'errors');
466 if ($tmp_id_sw > 0 && $tmp_id_tw == $tmp_id_sw) {
468 $langs->load(
"errors");
469 setEventMessages($langs->trans(
"ErrorWarehouseMustDiffers"),
null,
'errors');
473 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Qty")),
null,
'errors');
478 $producttmp =
new Product($db);
479 $producttmp->fetch($tmp_id_product);
480 if ($producttmp->hasbatch()) {
481 if (empty($tmp_batch)) {
483 $langs->load(
"errors");
484 setEventMessages($langs->trans(
"ErrorTryToMakeMoveOnProductRequiringBatchData", $producttmp->ref),
null,
'errors');
493 foreach ($data as $key => $value) {
494 if (count(array_keys($listofdata)) > 0) {
495 $id = max(array_keys($listofdata)) + 1;
499 $tmp_id_sw = $data[$key][0][
'val'];
500 $tmp_id_tw = $data[$key][1][
'val'];
501 $tmp_id_product = $data[$key][2][
'val'];
502 $tmp_qty = $data[$key][3][
'val'];
503 $tmp_batch = $data[$key][4][
'val'];
504 $listofdata[$key] = array(
'id' => $key,
'id_sw' => $tmp_id_sw,
'id_tw' => $tmp_id_tw,
'id_product' => $tmp_id_product,
'qty' => $tmp_qty,
'batch' => $tmp_batch);
510 $listofdata = array();
513 $_SESSION[
'massstockmove'] = json_encode($listofdata);
516if ($action ==
'confirm_deletefile' && $confirm ==
'yes') {
517 $langs->load(
"other");
519 $param =
'&datatoimport='.urlencode($datatoimport).
'&format='.urlencode($format);
520 if ($excludefirstline) {
521 $param .=
'&excludefirstline='.urlencode($excludefirstline);
524 $param .=
'&endatlinenb='.urlencode($endatlinenb);
527 $file = $conf->stock->dir_temp.
'/'.
GETPOST(
'urlfile');
534 header(
'Location: '.$_SERVER[
"PHP_SELF"]);
546$form =
new Form($db);
548$productstatic =
new Product($db);
549$warehousestatics =
new Entrepot($db);
550$warehousestatict =
new Entrepot($db);
552$help_url =
'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks|DE:Modul_Bestände';
554$title = $langs->trans(
'MassMovement');
556llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-product page-stock_massstomove');
558print
load_fiche_titre($langs->trans(
"MassStockTransferShort"),
'',
'stock');
560$titletoadd = $langs->trans(
"Select");
561$buttonrecord = $langs->trans(
"RecordMovements");
562$titletoaddnoent = $langs->transnoentitiesnoconv(
"Select");
563$buttonrecordnoent = $langs->transnoentitiesnoconv(
"RecordMovements");
564print
'<span class="opacitymedium">'.$langs->trans(
"SelectProductInAndOutWareHouse", $titletoaddnoent, $buttonrecordnoent).
'</span>';
570print
'<form name="userfile" action="'.$_SERVER[
"PHP_SELF"].
'" enctype="multipart/form-data" method="POST">';
571print
'<input type="hidden" name="token" value="'.newToken().
'">';
572print
'<input type="hidden" name="action" value="importCSV">';
573if (!empty($conf->dol_optimize_smallscreen)) {
576print
'<span class="opacitymedium">';
577print $langs->trans(
"or");
579$importcsv =
new ImportCsv($db,
'massstocklist');
580print $form->textwithpicto($langs->trans(
'SelectAStockMovementFileToImport'), $langs->transnoentitiesnoconv(
"InfoTemplateImport", $importcsv->separator));
584$maxmin = $maxfilesizearray[
'maxmin'];
586 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
588print
'<input type="file" name="userfile" size="20" maxlength="80"> ';
590print
'<input type="submit" class="button small smallpaddingimp" value="'.$langs->trans(
"ImportFromCSV").
'"'.$out.
' name="sendit">';
594 $maxphp = @ini_get(
'upload_max_filesize');
595 if (preg_match(
'/k$/i', $maxphp)) {
596 $maxphp = preg_replace(
'/k$/i',
'', $maxphp);
597 $maxphp = (int) $maxphp * 1;
599 if (preg_match(
'/m$/i', $maxphp)) {
600 $maxphp = preg_replace(
'/m$/i',
'', $maxphp);
601 $maxphp = (int) $maxphp * 1024;
603 if (preg_match(
'/g$/i', $maxphp)) {
604 $maxphp = preg_replace(
'/g$/i',
'', $maxphp);
605 $maxphp = (int) $maxphp * 1024 * 1024;
607 if (preg_match(
'/t$/i', $maxphp)) {
608 $maxphp = preg_replace(
'/t$/i',
'', $maxphp);
609 $maxphp = (int) $maxphp * 1024 * 1024 * 1024;
611 $maxphp2 = @ini_get(
'post_max_size');
612 if (preg_match(
'/k$/i', $maxphp2)) {
613 $maxphp2 = preg_replace(
'/k$/i',
'', $maxphp2);
614 $maxphp2 = (int) $maxphp2 * 1;
616 if (preg_match(
'/m$/i', $maxphp2)) {
617 $maxphp2 = preg_replace(
'/m$/i',
'', $maxphp2);
618 $maxphp2 = (int) $maxphp2 * 1024;
620 if (preg_match(
'/g$/i', $maxphp2)) {
621 $maxphp2 = preg_replace(
'/g$/i',
'', $maxphp2);
622 $maxphp2 = (int) $maxphp2 * 1024 * 1024;
624 if (preg_match(
'/t$/i', $maxphp2)) {
625 $maxphp2 = preg_replace(
'/t$/i',
'', $maxphp2);
626 $maxphp2 = (int) $maxphp2 * 1024 * 1024 * 1024;
630 $maxphptoshow = $maxphptoshowparam =
'';
632 $maxmin = min($max, $maxphp);
633 $maxphptoshow = $maxphp;
634 $maxphptoshowparam =
'upload_max_filesize';
637 $maxmin = min($max, $maxphp2);
638 if ($maxphp2 < $maxphp) {
639 $maxphptoshow = $maxphp2;
640 $maxphptoshowparam =
'post_max_size';
644 $langs->load(
'other');
646 $out .=
info_admin($langs->trans(
"ThisLimitIsDefinedInSetup", $max, $maxphptoshow), 1);
648 $out .=
' ('.$langs->trans(
"UploadDisabled").
')';
657print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" name="formulaire">';
658print
'<input type="hidden" name="token" value="'.newToken().
'">';
659print
'<input type="hidden" name="action" value="addline">';
662print
'<div class="div-table-responsive-no-min">';
663print
'<table class="liste noborder centpercent">';
667print
'<tr class="liste_titre">';
668print
getTitleFieldOfList($langs->trans(
'WarehouseSource'), 0, $_SERVER[
"PHP_SELF"],
'', $param,
'',
'', $sortfield, $sortorder,
'tagtd maxwidthonsmartphone ');
669print
getTitleFieldOfList($langs->trans(
'WarehouseTarget'), 0, $_SERVER[
"PHP_SELF"],
'', $param,
'',
'', $sortfield, $sortorder,
'tagtd maxwidthonsmartphone ');
670print
getTitleFieldOfList($langs->trans(
'Product'), 0, $_SERVER[
"PHP_SELF"],
'', $param,
'',
'', $sortfield, $sortorder,
'tagtd maxwidthonsmartphone ');
671if (isModEnabled(
'productbatch')) {
672 print
getTitleFieldOfList($langs->trans(
'Batch'), 0, $_SERVER[
"PHP_SELF"],
'', $param,
'',
'', $sortfield, $sortorder,
'tagtd maxwidthonsmartphone ');
674print
getTitleFieldOfList($langs->trans(
'Qty'), 0, $_SERVER[
"PHP_SELF"],
'', $param,
'',
'', $sortfield, $sortorder,
'right tagtd maxwidthonsmartphone ');
678print
'<tr class="oddeven">';
680print
'<td class="nowraponall">';
681print
img_picto($langs->trans(
"WarehouseSource"),
'stock',
'class="paddingright"').$formproduct->selectWarehouses($id_sw,
'id_sw',
'warehouseopen,warehouseinternal', 1, 0, 0,
'', 0, 0, array(),
'minwidth200imp maxwidth200');
684print
'<td class="nowraponall">';
685print
img_picto($langs->trans(
"WarehouseTarget"),
'stock',
'class="paddingright"').$formproduct->selectWarehouses($id_tw,
'id_tw',
'warehouseopen,warehouseinternal', 1, 0, 0,
'', 0, 0, array(),
'minwidth200imp maxwidth200');
688print
'<td class="nowraponall">';
698print
img_picto($langs->trans(
"Product"),
'product',
'class="paddingright"');
699print $form->select_produits((isset($id_product) ? $id_product : 0),
'productid', $filtertype, $limit, 0, -1, 2,
'', 1, array(), 0,
'1', 0,
'minwidth200imp maxwidth300', 1,
'', null, 1);
702if (isModEnabled(
'productbatch')) {
703 print
'<td class="nowraponall">';
704 print
img_picto($langs->trans(
"LotSerial"),
'lot',
'class="paddingright"');
705 print
'<input type="text" name="batch" class="flat maxwidth75" value="'.dol_escape_htmltag((isset($batch) ? $batch :
'')).
'">';
709print
'<td class="right"><input type="text" class="flat maxwidth50 right" name="qty" value="'.price2num((
float) (isset($qty) ? $qty : 0),
'MS').
'"></td>';
711print
'<td class="right"><input type="submit" class="button" name="addline" value="'.dol_escape_htmltag($titletoadd).
'"></td>';
715foreach ($listofdata as $key => $val) {
716 $productstatic->id = 0;
717 $productstatic->fetch($val[
'id_product']);
719 $warehousestatics->id = 0;
720 if ($val[
'id_sw'] > 0) {
721 $warehousestatics->fetch($val[
'id_sw']);
723 $warehousestatict->id = 0;
724 if ($val[
'id_tw'] > 0) {
725 $warehousestatict->fetch($val[
'id_tw']);
728 if ($productstatic->id <= 0) {
730 setEventMessages($langs->trans(
"ObjectNotFound", $langs->transnoentitiesnoconv(
"Product").
' (id='.$val[
'id_product'].
')'),
null,
'errors');
732 if ($warehousestatics->id < 0) {
734 setEventMessages($langs->trans(
"ObjectNotFound", $langs->transnoentitiesnoconv(
"WarehouseSource").
' (id='.$val[
'id_sw'].
')'),
null,
'errors');
736 if ($warehousestatict->id <= 0) {
738 setEventMessages($langs->trans(
"ObjectNotFound", $langs->transnoentitiesnoconv(
"WarehouseTarget").
' (id='.$val[
'id_tw'].
')'),
null,
'errors');
742 print
'<tr class="oddeven">';
744 if ($warehousestatics->id > 0) {
745 print $warehousestatics->getNomUrl(1);
747 print
'<span class="opacitymedium">';
748 print $langs->trans(
"None");
753 print $warehousestatict->getNomUrl(1);
758 if (isModEnabled(
'productbatch')) {
763 print
'<td class="right">'.price2num((
float) $val[
'qty'],
'MS').
'</td>';
764 print
'<td class="right"><a href="'.$_SERVER[
"PHP_SELF"].
'?action=delline&token='.
newToken().
'&idline='.$val[
'id'].
'">'.
img_delete($langs->trans(
"Remove")).
'</a></td>';
777if (count($listofdata)) {
778 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" name="formulaire2" class="formconsumeproduce">';
779 print
'<input type="hidden" name="token" value="'.newToken().
'">';
780 print
'<input type="hidden" name="action" value="createmovements">';
784 $labelmovement =
GETPOST(
"label") ?
GETPOST(
'label') : $langs->trans(
"MassStockTransferShort").
' '.
dol_print_date($now,
'%Y-%m-%d %H:%M');
786 print
'<div class="center">';
787 print
'<span class="fieldrequired">'.$langs->trans(
"InventoryCode").
':</span> ';
788 print
'<input type="text" name="codemove" class="maxwidth300" value="'.dol_escape_htmltag($codemove).
'"> ';
789 print
'<span class="clearbothonsmartphone"></span>';
790 print $langs->trans(
"MovementLabel").
': ';
791 print
'<input type="text" name="label" class="minwidth300" value="'.dol_escape_htmltag($labelmovement).
'"><br>';
794 print
'<div class="center"><input type="submit" class="button" name="valid" value="'.dol_escape_htmltag($buttonrecord).
'"></div>';
802if ($action ==
'delete') {
803 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?urlfile='.urlencode(
GETPOST(
'urlfile')).
'&step=3'.$param, $langs->trans(
'DeleteFile'), $langs->trans(
'ConfirmDeleteFile'),
'confirm_deletefile',
'', 0, 1);
820 $length = strlen($needle);
821 return substr($haystack, 0, $length) === $needle;
834 $tmp_ref = str_replace(
'ref:',
'', $tmp_ref);
836 $static_object->id = 0;
837 $static_object->fetch(0, $tmp_ref);
838 return $static_object->id;
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.
Class to manage warehouses.
Class to import CSV files.
Class to manage products or services.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles='addedfile', $upload_dir='')
Check validity of a file upload from an GUI page, and move it to its final destination.
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.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
startsWith($haystack, $needle)
Verify if $haystack startswith $needle.
fetchref($static_object, $tmp_ref)
Fetch object with ref.
getMaxFileSizeArray()
Return the max allowed for file upload.
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.