34require
'../../main.inc.php';
35require_once DOL_DOCUMENT_ROOT .
'/product/class/product.class.php';
36require_once DOL_DOCUMENT_ROOT .
'/core/class/html.formother.class.php';
37require_once DOL_DOCUMENT_ROOT .
'/core/class/html.form.class.php';
38require_once DOL_DOCUMENT_ROOT .
'/fourn/class/fournisseur.commande.class.php';
39require_once DOL_DOCUMENT_ROOT .
'/product/class/html.formproduct.class.php';
40require_once
'./lib/replenishment.lib.php';
51$langs->loadLangs(array(
'products',
'stocks',
'orders'));
55 $socid = $user->socid;
59$hookmanager->initHooks(array(
'stockreplenishlist'));
65$action =
GETPOST(
'action',
'aZ09');
66$search_ref =
GETPOST(
'search_ref',
'alpha');
67$search_label =
GETPOST(
'search_label',
'alpha');
68$sall = trim(
GETPOST(
'search_all',
'alphanohtml'));
71$salert =
GETPOST(
'salert',
'alpha');
72$includeproductswithoutdesiredqty =
GETPOST(
'includeproductswithoutdesiredqty',
'alpha');
73$mode =
GETPOST(
'mode',
'alpha');
74$draftorder =
GETPOST(
'draftorder',
'alpha');
82$resWar = $db->query(
"SELECT rowid FROM " . MAIN_DB_PREFIX .
"entrepot WHERE entity IN (" . $db->sanitize(
getEntity(
'stock')) .
")");
83$listofqualifiedwarehousesid =
"";
86while ($tmpobj = $db->fetch_object($resWar)) {
87 if (!empty($listofqualifiedwarehousesid)) {
88 $listofqualifiedwarehousesid .=
",";
90 $listofqualifiedwarehousesid .= $tmpobj->rowid;
91 $lastWarehouseID = $tmpobj->rowid;
96if ($count == 1 && (empty($fk_entrepot) || $fk_entrepot <= 0) &&
getDolGlobalString(
'MULTICOMPANY_PRODUCT_SHARING_ENABLED')) {
97 $fk_entrepot = $lastWarehouseID;
100if (!GETPOSTISSET(
'fk_warehouse') && (empty($fk_entrepot) || $fk_entrepot <= 0) &&
getDolGlobalString(
'MAIN_DEFAULT_WAREHOUSE_USER')) {
101 $fk_entrepot = $user->fk_warehouse;
106$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
107$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
109if (empty($page) || $page == -1) {
113$offset = $limit * $page;
116 $sortfield =
'p.ref';
124$virtualdiffersfromphysical = 0;
130 || isModEnabled(
'mrp')) {
131 $virtualdiffersfromphysical = 1;
134if ($virtualdiffersfromphysical) {
135 $usevirtualstock =
getDolGlobalString(
'STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT') ? 0 : 1;
137 $usevirtualstock = 0;
139if ($mode ==
'physical') {
140 $usevirtualstock = 0;
142if ($mode ==
'virtual') {
143 $usevirtualstock = 1;
146$parameters = array();
147$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
157if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
162 $includeproductswithoutdesiredqty =
'';
166if ($draftorder ==
'on') {
167 $draftchecked =
"checked";
171if ($action ==
'order' &&
GETPOST(
'valid') && $user->hasRight(
'fournisseur',
'commande',
'creer')) {
175 unset($_POST[
'linecount']);
176 if ($linecount > 0) {
179 $suppliers = array();
180 require_once DOL_DOCUMENT_ROOT .
'/fourn/class/fournisseur.product.class.php';
182 for ($i = 0; $i < $linecount; $i++) {
189 $idprod = $productsupplier->get_buyprice($supplierpriceid, $qty);
190 $res = $productsupplier->fetch($idprod);
191 if ($res && $idprod > 0) {
196 $line->fk_product = $idprod;
201 $productsupplier->getMultiLangs();
205 if (!empty($productsupplier->desc_supplier) &&
getDolGlobalString(
'PRODUIT_FOURN_TEXTS')) {
206 $desc = $productsupplier->desc_supplier;
208 $desc = $productsupplier->description;
215 $line->tva_tx = $productsupplier->vatrate_supplier;
216 $tva = $line->tva_tx / 100;
219 if (isModEnabled(
'multicurrency') && !empty($productsupplier->fourn_multicurrency_code) && $productsupplier->fourn_multicurrency_code !=
$conf->currency) {
220 $line->multicurrency_code = $productsupplier->fourn_multicurrency_code;
221 $line->fk_multicurrency = (int) $productsupplier->fourn_multicurrency_id;
222 $line->multicurrency_subprice = $productsupplier->fourn_multicurrency_unitprice;
223 $line->multicurrency_total_ht = $line->multicurrency_subprice * $qty;
224 $line->multicurrency_total_tva = $line->multicurrency_total_ht * $tva;
225 $line->multicurrency_total_ttc = $line->multicurrency_total_ht + $line->multicurrency_total_tva;
227 $line->subprice = $productsupplier->fourn_pu;
228 $line->total_ht = $productsupplier->fourn_pu * $qty;
229 $line->total_tva = $line->total_ht * $tva;
230 $line->total_ttc = $line->total_ht + $line->total_tva;
231 $line->remise_percent = (float) $productsupplier->remise_percent;
232 $line->ref_fourn = $productsupplier->ref_supplier;
233 $line->ref_supplier = $productsupplier->ref_supplier;
234 $line->type = $productsupplier->type;
235 $line->fk_unit = $productsupplier->fk_unit;
237 $suppliers[$productsupplier->fourn_socid][
'lines'][] = $line;
239 } elseif ($idprod == -1) {
242 $error = $db->lasterror();
246 unset($_POST[
'fourn' . $i]);
255 $suppliersid = array_keys($suppliers);
256 foreach ($suppliers as $supplier) {
260 $sql =
"SELECT rowid FROM " . MAIN_DB_PREFIX .
"commande_fournisseur";
261 $sql .=
" WHERE fk_soc = " . ((int) $suppliersid[$i]);
262 $sql .=
" AND source = " . ((int) $order::SOURCE_ID_REPLENISHMENT) .
" AND fk_statut = " . ((int) $order::STATUS_DRAFT);
263 $sql .=
" AND entity IN (" .
getEntity(
'commande_fournisseur') .
")";
264 $sql .=
" ORDER BY date_creation DESC";
265 $resql = $db->query($sql);
266 if ($resql && $db->num_rows($resql) > 0) {
267 $obj = $db->fetch_object($resql);
269 $order->fetch($obj->rowid);
270 $order->fetch_thirdparty();
272 foreach ($supplier[
'lines'] as $line) {
273 if (empty($line->remise_percent)) {
274 $line->remise_percent = (float) $order->thirdparty->remise_supplier_percent;
276 $result = $order->addline(
286 $line->remise_percent,
296 $line->multicurrency_subprice
301 $msg = $langs->trans(
'OrderFail') .
" : ";
302 $msg .= $order->error;
309 $order->socid = $suppliersid[$i];
310 $order->fetch_thirdparty();
311 $order->multicurrency_code = $order->thirdparty->multicurrency_code;
314 $order->source = $order::SOURCE_ID_REPLENISHMENT;
316 foreach ($supplier[
'lines'] as $line) {
317 if (empty($line->remise_percent)) {
318 $line->remise_percent = (float) $order->thirdparty->remise_supplier_percent;
320 $order->lines[] = $line;
322 $order->cond_reglement_id = (int) $order->thirdparty->cond_reglement_supplier_id;
323 $order->mode_reglement_id = (int) $order->thirdparty->mode_reglement_supplier_id;
325 $id = $order->create($user);
328 $msg = $langs->trans(
'OrderFail') .
" : ";
329 $msg .= $order->error;
337 setEventMessages($langs->trans(
'ErrorOrdersNotCreatedQtyTooLow'),
null,
'warnings');
344 header(
'Location: replenishorders.php');
351 setEventMessages($langs->trans(
'SelectProductWithNotNullQty'),
null,
'warnings');
360$form =
new Form($db);
364$title = $langs->trans(
'MissingStocks');
366if (
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
367 $sqldesiredtock = $db->ifsql(
"pse.desiredstock IS NULL",
"p.desiredstock",
"pse.desiredstock");
368 $sqlalertstock = $db->ifsql(
"pse.seuil_stock_alerte IS NULL",
"p.seuil_stock_alerte",
"pse.seuil_stock_alerte");
370 $sqldesiredtock =
'p.desiredstock';
371 $sqlalertstock =
'p.seuil_stock_alerte';
374$sql =
'SELECT p.rowid, p.ref, p.label, p.description, p.price,';
375$sql .=
' p.price_ttc, p.price_base_type, p.fk_product_type,';
376$sql .=
' p.tms as datem, p.duration, p.tobuy,';
377$sql .=
' p.desiredstock, p.seuil_stock_alerte,';
378if (
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
379 $sql .=
' pse.desiredstock as desiredstockpse, pse.seuil_stock_alerte as seuil_stock_alertepse,';
381$sql .=
" " . $sqldesiredtock .
" as desiredstockcombined, " . $sqlalertstock .
" as seuil_stock_alertecombined,";
382$sql .=
' s.fk_product,';
383$sql .=
" SUM(".$db->ifsql(
"s.reel IS NULL",
"0",
"s.reel").
') as stock_physique';
384if (
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
385 $sql .=
", SUM(".$db->ifsql(
"s.reel IS NULL OR s.fk_entrepot <> ".((
int) $fk_entrepot),
"0",
"s.reel").
') as stock_real_warehouse';
389$parameters = array();
390$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
391$sql .= $hookmanager->resPrint;
393$list_warehouse = (empty($listofqualifiedwarehousesid) ?
'0' : $listofqualifiedwarehousesid);
395$sql .=
' FROM ' . MAIN_DB_PREFIX .
'product as p';
396$sql .=
' LEFT JOIN ' . MAIN_DB_PREFIX .
'product_stock as s ON p.rowid = s.fk_product';
397$sql .=
' AND s.fk_entrepot IN (' . $db->sanitize($list_warehouse) .
')';
399$list_warehouse_selected = ($fk_entrepot < 0 || empty($fk_entrepot)) ? $list_warehouse : $fk_entrepot;
400$sql .=
' AND s.fk_entrepot IN (' . $db->sanitize($list_warehouse_selected) .
')';
404if (
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
405 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'product_warehouse_properties AS pse ON (p.rowid = pse.fk_product AND pse.fk_entrepot = '.((int) $fk_entrepot).
')';
408$parameters = array();
409$reshook = $hookmanager->executeHooks(
'printFieldListJoin', $parameters);
410$sql .= $hookmanager->resPrint;
412$sql .=
' WHERE p.entity IN (' .
getEntity(
'product') .
')';
414 $sql .=
natural_search(array(
'p.ref',
'p.label',
'p.description',
'p.note'), $sall);
419 $sql .=
' AND p.fk_product_type = 1';
421 $sql .=
' AND p.fk_product_type <> 1';
430$sql .=
' AND p.tobuy = 1';
431if (isModEnabled(
'variants') && !
getDolGlobalString(
'VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT')) {
432 $sql .=
' AND p.rowid NOT IN (SELECT pac.fk_product_parent FROM '.MAIN_DB_PREFIX.
'product_attribute_combination as pac WHERE pac.entity IN ('.
getEntity(
'product').
'))';
434if ($fk_supplier > 0) {
435 $sql .=
' AND EXISTS (SELECT pfp.rowid FROM ' . MAIN_DB_PREFIX .
'product_fournisseur_price as pfp WHERE pfp.fk_product = p.rowid AND pfp.fk_soc = ' . ((int) $fk_supplier) .
' AND pfp.entity IN (' .
getEntity(
'product_fournisseur_price') .
'))';
438$parameters = array();
439$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
440$sql .= $hookmanager->resPrint;
442$sql .=
' GROUP BY p.rowid, p.ref, p.label, p.description, p.price';
443$sql .=
', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms';
444$sql .=
', p.duration, p.tobuy';
445$sql .=
', p.desiredstock';
446$sql .=
', p.seuil_stock_alerte';
447if (
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
448 $sql .=
', pse.desiredstock';
449 $sql .=
', pse.seuil_stock_alerte';
451$sql .=
', s.fk_product';
453if ($usevirtualstock) {
454 if (isModEnabled(
'order')) {
455 $sqlCommandesCli =
"(SELECT ".$db->ifsql(
"SUM(cd1.qty) IS NULL",
"0",
"SUM(cd1.qty)").
" as qty";
456 $sqlCommandesCli .=
" FROM ".MAIN_DB_PREFIX.
"commandedet as cd1, ".MAIN_DB_PREFIX.
"commande as c1";
457 $sqlCommandesCli .=
" WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity(
getDolGlobalString(
'STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ?
'stock' :
'commande').
")";
458 $sqlCommandesCli .=
" AND cd1.fk_product = p.rowid";
459 $sqlCommandesCli .=
" AND c1.fk_statut IN (1,2))";
461 $sqlCommandesCli =
'0';
464 if (isModEnabled(
"shipping")) {
465 $sqlExpeditionsCli =
"(SELECT ".$db->ifsql(
"SUM(ed2.qty) IS NULL",
"0",
"SUM(ed2.qty)").
" as qty";
466 $sqlExpeditionsCli .=
" FROM ".MAIN_DB_PREFIX.
"expedition as e2,";
467 $sqlExpeditionsCli .=
" ".MAIN_DB_PREFIX.
"expeditiondet as ed2,";
468 $sqlExpeditionsCli .=
" ".MAIN_DB_PREFIX.
"commande as c2,";
469 $sqlExpeditionsCli .=
" ".MAIN_DB_PREFIX.
"commandedet as cd2";
470 $sqlExpeditionsCli .=
" WHERE ed2.fk_expedition = e2.rowid AND cd2.rowid = ed2.fk_elementdet AND e2.entity IN (".getEntity(
getDolGlobalString(
'STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ?
'stock' :
'expedition').
")";
471 $sqlExpeditionsCli .=
" AND cd2.fk_commande = c2.rowid";
472 $sqlExpeditionsCli .=
" AND c2.fk_statut IN (1,2)";
473 $sqlExpeditionsCli .=
" AND cd2.fk_product = p.rowid";
474 $sqlExpeditionsCli .=
" AND e2.fk_statut IN (1,2))";
476 $sqlExpeditionsCli =
'0';
479 if (isModEnabled(
"supplier_order")) {
480 $sqlCommandesFourn =
"(SELECT " . $db->ifsql(
"SUM(cd3.qty) IS NULL",
"0",
"SUM(cd3.qty)") .
" as qty";
481 $sqlCommandesFourn .=
" FROM " . MAIN_DB_PREFIX .
"commande_fournisseurdet as cd3,";
482 $sqlCommandesFourn .=
" " . MAIN_DB_PREFIX .
"commande_fournisseur as c3";
483 $sqlCommandesFourn .=
" WHERE c3.rowid = cd3.fk_commande";
484 $sqlCommandesFourn .=
" AND c3.entity IN (".getEntity(
getDolGlobalString(
'STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ?
'stock' :
'supplier_order').
")";
485 $sqlCommandesFourn .=
" AND cd3.fk_product = p.rowid";
486 $sqlCommandesFourn .=
" AND c3.fk_statut IN (3,4))";
488 $sqlReceptionFourn =
"(SELECT ".$db->ifsql(
"SUM(fd4.qty) IS NULL",
"0",
"SUM(fd4.qty)").
" as qty";
489 $sqlReceptionFourn .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseur as cf4,";
490 $sqlReceptionFourn .=
" ".MAIN_DB_PREFIX.
"receptiondet_batch as fd4";
491 $sqlReceptionFourn .=
" WHERE fd4.fk_element = cf4.rowid AND cf4.entity IN (".getEntity(
getDolGlobalString(
'STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ?
'stock' :
'supplier_order').
")";
492 $sqlReceptionFourn .=
" AND fd4.fk_product = p.rowid";
493 $sqlReceptionFourn .=
" AND cf4.fk_statut IN (3,4))";
495 $sqlCommandesFourn =
'0';
496 $sqlReceptionFourn =
'0';
499 if (isModEnabled(
'mrp')) {
500 $sqlProductionToConsume =
"(SELECT GREATEST(0, ".$db->ifsql(
"SUM(".$db->ifsql(
"mp5.role = 'toconsume'",
'mp5.qty',
'- mp5.qty').
") IS NULL",
"0",
"SUM(".$db->ifsql(
"mp5.role = 'toconsume'",
'mp5.qty',
'- mp5.qty').
")").
") as qty";
501 $sqlProductionToConsume .=
" FROM ".MAIN_DB_PREFIX.
"mrp_mo as mm5,";
502 $sqlProductionToConsume .=
" ".MAIN_DB_PREFIX.
"mrp_production as mp5";
503 $sqlProductionToConsume .=
" WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity(
getDolGlobalString(
'STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ?
'stock' :
'mo').
")";
504 $sqlProductionToConsume .=
" AND mp5.fk_product = p.rowid";
505 $sqlProductionToConsume .=
" AND mp5.role IN ('toconsume', 'consumed')";
506 $sqlProductionToConsume .=
" AND mm5.status IN (1,2))";
508 $sqlProductionToProduce =
"(SELECT GREATEST(0, ".$db->ifsql(
"SUM(".$db->ifsql(
"mp5.role = 'toproduce'",
'mp5.qty',
'- mp5.qty').
") IS NULL",
"0",
"SUM(".$db->ifsql(
"mp5.role = 'toproduce'",
'mp5.qty',
'- mp5.qty').
")").
") as qty";
509 $sqlProductionToProduce .=
" FROM ".MAIN_DB_PREFIX.
"mrp_mo as mm5,";
510 $sqlProductionToProduce .=
" ".MAIN_DB_PREFIX.
"mrp_production as mp5";
511 $sqlProductionToProduce .=
" WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity(
getDolGlobalString(
'STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ?
'stock' :
'mo').
")";
512 $sqlProductionToProduce .=
" AND mp5.fk_product = p.rowid";
513 $sqlProductionToProduce .=
" AND mp5.role IN ('toproduce', 'produced')";
514 $sqlProductionToProduce .=
" AND mm5.status IN (1,2))";
516 $sqlProductionToConsume =
'0';
517 $sqlProductionToProduce =
'0';
520 $parameters = array();
521 $sqlHookVirtualStock =
"0";
522 $reshook = $hookmanager->executeHooks(
'printFieldListHavingVirtualStock', $parameters);
523 if (!empty($hookmanager->resPrint)) {
524 $sqlHookVirtualStock = $hookmanager->resPrint;
528 $sql .=
" (" . $sqldesiredtock .
" >= 0 AND (" . $sqldesiredtock .
" > SUM(" . $db->ifsql(
"s.reel IS NULL",
"0",
"s.reel") .
')';
529 $sql .=
" - (" . $sqlCommandesCli .
" - " . $sqlExpeditionsCli .
") + (" . $sqlCommandesFourn .
" - " . $sqlReceptionFourn .
") + (" . $sqlProductionToProduce .
" - " . $sqlProductionToConsume .
") + ".$sqlHookVirtualStock.
"))";
531 if ($includeproductswithoutdesiredqty ==
'on') {
532 $sql .=
" ((" . $sqlalertstock .
" >= 0 OR " . $sqlalertstock .
" IS NULL) AND (" . $db->ifsql($sqlalertstock .
" IS NULL",
"0", $sqlalertstock) .
" > SUM(" . $db->ifsql(
"s.reel IS NULL",
"0",
"s.reel") .
")";
534 $sql .=
" (" . $sqlalertstock .
" >= 0 AND (" . $sqlalertstock .
" > SUM(" . $db->ifsql(
"s.reel IS NULL",
"0",
"s.reel") .
')';
536 $sql .=
" - (" . $sqlCommandesCli .
" - " . $sqlExpeditionsCli .
") + (" . $sqlCommandesFourn .
" - " . $sqlReceptionFourn .
") + (" . $sqlProductionToProduce .
" - " . $sqlProductionToConsume .
") + ".$sqlHookVirtualStock.
"))";
538 if (
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
540 $sql .=
" pse.desiredstock > 0)";
543 if ($salert ==
'on') {
545 if ($includeproductswithoutdesiredqty ==
'on') {
546 $sql .=
"(" . $sqlalertstock .
" >= 0 OR " . $sqlalertstock .
" IS NULL) AND (" . $db->ifsql($sqlalertstock .
" IS NULL",
"0", $sqlalertstock) .
" > SUM(" . $db->ifsql(
"s.reel IS NULL",
"0",
"s.reel") .
")";
548 $sql .= $sqlalertstock .
" >= 0 AND (" . $sqlalertstock .
" > SUM(" . $db->ifsql(
"s.reel IS NULL",
"0",
"s.reel") .
")";
550 $sql .=
" - (" . $sqlCommandesCli .
" - " . $sqlExpeditionsCli .
") + (" . $sqlCommandesFourn .
" - " . $sqlReceptionFourn .
") + (" . $sqlProductionToProduce .
" - " . $sqlProductionToConsume .
") + ".$sqlHookVirtualStock.
")";
552 $alertchecked =
'checked';
556 $sql .=
"(" . $sqldesiredtock .
" >= 0 AND (" . $sqldesiredtock .
" > SUM(" . $db->ifsql(
"s.reel IS NULL",
"0",
"s.reel") .
")))";
558 if ($includeproductswithoutdesiredqty ==
'on') {
559 $sql .=
" ((" . $sqlalertstock .
" >= 0 OR " . $sqlalertstock .
" IS NULL) AND (" . $db->ifsql($sqlalertstock .
" IS NULL",
"0", $sqlalertstock) .
" > SUM(" . $db->ifsql(
"s.reel IS NULL",
"0",
"s.reel") .
')))';
561 $sql .=
" (" . $sqlalertstock .
" >= 0 AND (" . $sqlalertstock .
" > SUM(" . $db->ifsql(
"s.reel IS NULL",
"0",
"s.reel") .
')))';
564 if (
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
566 $sql .=
" pse.desiredstock > 0)";
569 if ($salert ==
'on') {
571 if ($includeproductswithoutdesiredqty ==
'on') {
572 $sql .=
" (" . $sqlalertstock .
" >= 0 OR " . $sqlalertstock .
" IS NULL) AND (" . $db->ifsql($sqlalertstock .
" IS NULL",
"0", $sqlalertstock) .
" > SUM(" . $db->ifsql(
"s.reel IS NULL",
"0",
"s.reel") .
"))";
574 $sql .=
" " . $sqlalertstock .
" >= 0 AND (" . $sqlalertstock .
" > SUM(" . $db->ifsql(
"s.reel IS NULL",
"0",
"s.reel") .
'))';
577 $alertchecked =
'checked';
581$includeproductswithoutdesiredqtychecked =
'';
582if ($includeproductswithoutdesiredqty ==
'on') {
583 $includeproductswithoutdesiredqtychecked =
'checked';
586$nbtotalofrecords =
'';
588 $result = $db->query($sql);
589 $nbtotalofrecords = $db->num_rows($result);
590 if (($page * $limit) > $nbtotalofrecords) {
596$sql .= $db->order($sortfield, $sortorder);
597$sql .= $db->plimit($limit + 1, $offset);
600$resql = $db->query($sql);
606$num = $db->num_rows($resql);
609$helpurl =
'EN:Module_Stocks_En|FR:Module_Stock|';
610$helpurl .=
'ES:Módulo_Stocks';
612llxHeader(
'', $title, $helpurl,
'', 0, 0,
'',
'',
'',
'mod-product page-stock_replenish');
616$head[0][0] = DOL_URL_ROOT .
'/product/stock/replenish.php';
618$head[0][2] =
'replenish';
620$head[1][0] = DOL_URL_ROOT .
'/product/stock/replenishorders.php';
621$head[1][1] = $langs->trans(
"ReplenishmentOrders");
622$head[1][2] =
'replenishorders';
629print
'<span class="opacitymedium">' . $langs->trans(
"ReplenishmentStatusDesc") .
'</span>' .
"\n";
633if (empty($fk_entrepot) &&
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE')) {
634 print
'<span class="opacitymedium">'.$langs->trans(
"ReplenishmentStatusDescPerWarehouse").
'</span>'.
"\n";
637if ($usevirtualstock == 1) {
638 print $langs->trans(
"CurentSelectionMode") .
': ';
639 print
'<span class="a-mesure">' . $langs->trans(
"UseVirtualStock") .
'</span>';
640 print
' <a class="a-mesure-disabled" href="' . $_SERVER[
"PHP_SELF"] .
'?mode=physical' . ($fk_supplier > 0 ?
'&fk_supplier=' . $fk_supplier :
'') . ($fk_entrepot > 0 ?
'&fk_entrepot=' . $fk_entrepot :
'') .
'">' . $langs->trans(
"UsePhysicalStock") .
'</a>';
643if ($usevirtualstock == 0) {
644 print $langs->trans(
"CurentSelectionMode") .
': ';
645 print
'<a class="a-mesure-disabled" href="' . $_SERVER[
"PHP_SELF"] .
'?mode=virtual' . ($fk_supplier > 0 ?
'&fk_supplier=' . $fk_supplier :
'') . ($fk_entrepot > 0 ?
'&fk_entrepot=' . $fk_entrepot :
'') .
'">' . $langs->trans(
"UseVirtualStock") .
'</a>';
646 print
' <span class="a-mesure">' . $langs->trans(
"UsePhysicalStock") .
'</span>';
651print
'<form name="formFilterWarehouse" method="POST" action="' . $_SERVER[
"PHP_SELF"] .
'">';
652print
'<input type="hidden" name="token" value="' .
newToken() .
'">';
653print
'<input type="hidden" name="action" value="filter">';
654print
'<input type="hidden" name="search_ref" value="' . $search_ref .
'">';
655print
'<input type="hidden" name="search_label" value="' . $search_label .
'">';
656print
'<input type="hidden" name="salert" value="' . $salert .
'">';
657print
'<input type="hidden" name="includeproductswithoutdesiredqty" value="' . $includeproductswithoutdesiredqty .
'">';
658print
'<input type="hidden" name="draftorder" value="' . $draftorder .
'">';
659print
'<input type="hidden" name="mode" value="' . $mode .
'">';
660if ($limit > 0 && $limit !=
$conf->liste_limit) {
661 print
'<input type="hidden" name="limit" value="' . $limit .
'">';
664 print
'<div class="inline-block valignmiddle" style="padding-right: 20px;">';
665 print $langs->trans(
'Warehouse') .
' ' . $formproduct->selectWarehouses($fk_entrepot,
'fk_entrepot',
'', 1);
668print
'<div class="inline-block valignmiddle" style="padding-right: 20px;">';
669$filter =
'(fournisseur:=:1)';
670print $langs->trans(
'Supplier') .
' ' . $form->select_company($fk_supplier,
'fk_supplier', $filter, 1);
673$parameters = array();
674$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
675if (empty($reshook)) {
676 print $hookmanager->resPrint;
679print
'<div class="inline-block valignmiddle">';
680print
'<input type="submit" class="button smallpaddingimp" name="valid" value="' . $langs->trans(
'ToFilter') .
'">';
685print
'<form action="' . $_SERVER[
"PHP_SELF"] .
'" method="POST" name="formulaire">';
686print
'<input type="hidden" name="token" value="' .
newToken() .
'">';
687print
'<input type="hidden" name="fk_supplier" value="' . $fk_supplier .
'">';
688print
'<input type="hidden" name="fk_entrepot" value="' . $fk_entrepot .
'">';
689print
'<input type="hidden" name="sortfield" value="' . $sortfield .
'">';
690print
'<input type="hidden" name="sortorder" value="' . $sortorder .
'">';
691print
'<input type="hidden" name="type" value="' . $type .
'">';
692print
'<input type="hidden" name="linecount" value="' . $num .
'">';
693print
'<input type="hidden" name="action" value="order">';
694print
'<input type="hidden" name="mode" value="' . $mode .
'">';
697if ($search_ref || $search_label || $sall || $salert || $draftorder ||
GETPOST(
'search',
'alpha')) {
698 $filters =
'&search_ref=' . urlencode($search_ref) .
'&search_label=' . urlencode($search_label);
699 $filters .=
'&sall=' . urlencode($sall);
700 $filters .=
'&salert=' . urlencode($salert);
701 $filters .=
'&draftorder=' . urlencode($draftorder);
702 $filters .=
'&mode=' . urlencode($mode);
703 if ($fk_supplier > 0) {
704 $filters .=
'&fk_supplier='.urlencode((
string) ($fk_supplier));
706 if ($fk_entrepot > 0) {
707 $filters .=
'&fk_entrepot='.urlencode((
string) ($fk_entrepot));
710 $filters =
'&search_ref='.urlencode($search_ref).
'&search_label='.urlencode($search_label);
711 $filters .=
'&fourn_id='.urlencode((
string) ($fourn_id));
712 $filters .= (isset($type) ?
'&type='.urlencode((
string) ($type)) :
'');
713 $filters .=
'&salert='.urlencode($salert);
714 $filters .=
'&draftorder='.urlencode($draftorder);
715 $filters .=
'&mode='.urlencode($mode);
716 if ($fk_supplier > 0) {
717 $filters .=
'&fk_supplier='.urlencode((
string) ($fk_supplier));
719 if ($fk_entrepot > 0) {
720 $filters .=
'&fk_entrepot='.urlencode((
string) ($fk_entrepot));
723if ($limit > 0 && $limit !=
$conf->liste_limit) {
724 $filters .=
'&limit=' . ((int) $limit);
726if (!empty($includeproductswithoutdesiredqty)) {
727 $filters .=
'&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty);
729if (!empty($salert)) {
730 $filters .=
'&salert='.urlencode($salert);
733$param = (isset($type) ?
'&type='.urlencode((
string) ($type)) :
'');
734$param .=
'&fourn_id='.urlencode((
string) ($fourn_id)).
'&search_label='.urlencode((
string) ($search_label)).
'&includeproductswithoutdesiredqty='.urlencode((
string) ($includeproductswithoutdesiredqty)).
'&salert='.urlencode((
string) ($salert)).
'&draftorder='.urlencode((
string) ($draftorder));
735$param .=
'&search_ref='.urlencode($search_ref);
736$param .=
'&mode='.urlencode($mode);
737$param .=
'&fk_supplier='.urlencode((
string) ($fk_supplier));
738$param .=
'&fk_entrepot='.urlencode((
string) ($fk_entrepot));
739if (!empty($includeproductswithoutdesiredqty)) {
740 $param .=
'&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty);
742if (!empty($salert)) {
743 $param .=
'&salert='.urlencode($salert);
746$stocklabel = $langs->trans(
'Stock');
747$stocklabelbis = $langs->trans(
'Stock');
749if ($usevirtualstock == 1) {
750 $stocklabel = $langs->trans(
'VirtualStock');
751 $stocktooltip = $langs->trans(
"VirtualStockDesc");
753if ($usevirtualstock == 0) {
754 $stocklabel = $langs->trans(
'PhysicalStock');
756if (
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
757 $stocklabelbis = $stocklabel.
' ('.$langs->trans(
'SelectedWarehouse').
')';
758 $stocklabel .=
' ('.$langs->trans(
"AllWarehouses").
')';
760$texte = $langs->trans(
'Replenishment');
798print
'<div class="div-table-responsive-no-min">';
799print
'<table class="liste centpercent">';
802print
'<tr class="liste_titre_filter">';
803print
'<td class="liste_titre"> </td>';
804print
'<td class="liste_titre"><input class="flat" type="text" name="search_ref" size="8" value="' .
dol_escape_htmltag($search_ref) .
'"></td>';
805print
'<td class="liste_titre"><input class="flat" type="text" name="search_label" size="8" value="' .
dol_escape_htmltag($search_label) .
'"></td>';
806if (isModEnabled(
"service") && $type == 1) {
807 print
'<td class="liste_titre"> </td>';
809print
'<td class="liste_titre right">' . $form->textwithpicto($langs->trans(
'IncludeEmptyDesiredStock'), $langs->trans(
'IncludeProductWithUndefinedAlerts')) .
' <input type="checkbox" id="includeproductswithoutdesiredqty" name="includeproductswithoutdesiredqty" ' . (!empty($includeproductswithoutdesiredqtychecked) ? $includeproductswithoutdesiredqtychecked :
'') .
'></td>';
810print
'<td class="liste_titre right"></td>';
811print
'<td class="liste_titre right">'.$langs->trans(
'AlertOnly').
' <input type="checkbox" id="salert" name="salert" '.(!empty($alertchecked) ? $alertchecked :
'').
'></td>';
812if (
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
813 print
'<td class="liste_titre"> </td>';
815print
'<td class="liste_titre right">';
817 print $langs->trans(
'IncludeAlsoDraftOrders').
' <input type="checkbox" id="draftorder" name="draftorder" '.(!empty($draftchecked) ? $draftchecked :
'').
'>';
820print
'<td class="liste_titre"> </td>';
822$parameters = array(
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
823$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
824print $hookmanager->resPrint;
826print
'<td class="liste_titre maxwidthsearch right">';
827$searchpicto = $form->showFilterAndCheckAddButtons(0);
833print
'<tr class="liste_titre">';
837if (isModEnabled(
"service") && $type == 1) {
838 print_liste_field_titre(
'Duration', $_SERVER[
"PHP_SELF"],
'p.duration',
'', $param,
'', $sortfield, $sortorder,
'center ');
840print_liste_field_titre(
'DesiredStock', $_SERVER[
"PHP_SELF"],
'p.desiredstock',
'', $param,
'', $sortfield, $sortorder,
'right ');
841print_liste_field_titre(
'StockLimitShort', $_SERVER[
"PHP_SELF"],
'p.seuil_stock_alerte',
'', $param,
'', $sortfield, $sortorder,
'right ');
842print_liste_field_titre($stocklabel, $_SERVER[
"PHP_SELF"],
'stock_physique',
'', $param,
'', $sortfield, $sortorder,
'right ', $stocktooltip);
843if (
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
844 print_liste_field_titre($stocklabelbis, $_SERVER[
"PHP_SELF"],
'stock_real_warehouse',
'', $param,
'', $sortfield, $sortorder,
'right ');
847print_liste_field_titre(
'StockToBuy', $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
848print_liste_field_titre(
'SupplierRef', $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
851$parameters = array(
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
852$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
853print $hookmanager->resPrint;
857while ($i < ($limit ? min($num, $limit) : $num)) {
858 $objp = $db->fetch_object($resql);
861 $result = $prod->fetch($objp->rowid);
867 $prod->load_stock(
'warehouseopen, warehouseinternal'.(!$usevirtualstock ?
', novirtual' :
''), $draftchecked ===
'checked' ? 1 : 0);
871 $sql =
'SELECT label,description';
872 $sql .=
' FROM ' . MAIN_DB_PREFIX .
'product_lang';
873 $sql .=
' WHERE fk_product = ' . ((int) $objp->rowid);
874 $sql .=
" AND lang = '" . $db->escape($langs->getDefaultLang()) .
"'";
877 $resqlm = $db->query($sql);
879 $objtp = $db->fetch_object($resqlm);
880 if (!empty($objtp->description)) {
881 $objp->description = $objtp->description;
883 if (!empty($objtp->label)) {
884 $objp->label = $objtp->label;
890 if ($usevirtualstock) {
892 $stock = $prod->stock_theorique;
895 $stockwarehouse = $prod->stock_warehouse[$fk_entrepot]->virtual;
898 $stock = $prod->stock_reel;
899 if (
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
900 $stockwarehouse = $prod->stock_warehouse[$fk_entrepot]->real;
905 if (isset($draftchecked)) {
906 $result = $prod->load_stats_commande_fournisseur(0,
'0,1,2,3,4');
907 } elseif (!$usevirtualstock) {
908 $result = $prod->load_stats_commande_fournisseur(0,
'1,2,3,4');
911 if (!$usevirtualstock) {
912 $result = $prod->load_stats_reception(0,
'4');
917 $ordered = $prod->stats_commande_fournisseur[
'qty'] - $prod->stats_reception[
'qty'];
919 $desiredstock = $objp->desiredstock;
920 $alertstock = $objp->seuil_stock_alerte;
921 $desiredstockwarehouse = (!empty($objp->desiredstockpse) ? $objp->desiredstockpse : 0);
922 $alertstockwarehouse = (!empty($objp->seuil_stock_alertepse) ? $objp->seuil_stock_alertepse : 0);
925 if ($alertstock && ($stock < $alertstock)) {
926 $warning =
img_warning($langs->trans(
'StockTooLow')) .
' ';
928 $warningwarehouse =
'';
929 if ($alertstockwarehouse && ($stockwarehouse < $alertstockwarehouse)) {
930 $warningwarehouse =
img_warning($langs->trans(
'StockTooLow')) .
' ';
936 if (empty($usevirtualstock)) {
937 $stocktobuy = max(max($desiredstock, $alertstock) - $stock - $ordered, 0);
939 $stocktobuy = max(max($desiredstock, $alertstock) - $stock, 0);
941 if (empty($usevirtualstock)) {
942 $stocktobuywarehouse = max(max($desiredstockwarehouse, $alertstockwarehouse) - $stockwarehouse - $ordered, 0);
944 $stocktobuywarehouse = max(max($desiredstockwarehouse, $alertstockwarehouse) - $stockwarehouse, 0);
949 $stockforcompare = ($usevirtualstock ? $stock : $stock + $ordered);
957 $picto =
img_picto($langs->trans(
"NoPendingReceptionOnSupplierOrder"),
'help');
960 print
'<tr class="oddeven">';
963 print
'<td><input type="checkbox" class="check" name="choose' . $i .
'"></td>';
965 print
'<td class="nowrap">' . $prod->getNomUrl(1,
'stock') .
'</td>';
967 print
'<td class="tdoverflowmax200" title="' .
dol_escape_htmltag($objp->label) .
'">';
969 print
'<input type="hidden" name="desc' . $i .
'" value="' .
dol_escape_htmltag($objp->description) .
'">';
972 if (isModEnabled(
"service") && $type == 1) {
974 if (preg_match(
'/([0-9]+)y/i', $objp->duration, $regs)) {
975 $duration = $regs[1] .
' ' . $langs->trans(
'DurationYear');
976 } elseif (preg_match(
'/([0-9]+)m/i', $objp->duration, $regs)) {
977 $duration = $regs[1] .
' ' . $langs->trans(
'DurationMonth');
978 } elseif (preg_match(
'/([0-9]+)d/i', $objp->duration, $regs)) {
979 $duration = $regs[1] .
' ' . $langs->trans(
'DurationDay');
981 $duration = $objp->duration;
983 print
'<td class="center">' . $duration .
'</td>';
987 print
'<td class="right">'.((getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? ($objp->desiredstockpse ? $desiredstockwarehouse :
img_info($langs->trans(
'ProductValuesUsedBecauseNoValuesForThisWarehouse')) .
'0') : $desiredstock).
'</td>';
990 print
'<td class="right">'.((getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? ($objp->seuil_stock_alertepse ? $alertstockwarehouse :
img_info($langs->trans(
'ProductValuesUsedBecauseNoValuesForThisWarehouse')) .
'0') : $alertstock).
'</td>';
993 print
'<td class="right">' . $warning . $stock;
994 print
'<!-- stock returned by main sql is ' . $objp->stock_physique .
' -->';
998 if (
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
999 print
'<td class="right">'.$warningwarehouse.$stockwarehouse.
'</td>';
1003 print
'<td class="right"><a href="replenishorders.php?search_product=' . $prod->id .
'">' . $ordered .
'</a> ' . $picto .
'</td>';
1006 $tobuy = ((
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? $stocktobuywarehouse : $stocktobuy);
1007 print
'<td class="right"><input type="text" size="4" name="tobuy'.$i.
'" value="'.$tobuy.
'"></td>';
1010 print
'<td class="right">';
1011 print $form->select_product_fourn_price($prod->id,
'fourn' . $i, $fk_supplier);
1015 $parameters = array(
'objp' => $objp,
'i' => $i,
'tobuy' => $tobuy);
1016 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1017 print $hookmanager->resPrint;
1026 if (isModEnabled(
"service") && $type == 1) {
1029 if (
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
1032 print
'<tr><td colspan="' . $colspan .
'">';
1033 print
'<span class="opacitymedium">';
1034 print $langs->trans(
"None");
1039$parameters = array(
'sql' => $sql);
1040$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters);
1041print $hookmanager->resPrint;
1051$value = $langs->trans(
"CreateOrders");
1052print
'<div class="center"><input type="submit" class="button" name="valid" value="' . $value .
'"></div>';
1060<script type="text/javascript">
1061function toggle(source)
1063 checkboxes = document.getElementsByClassName("check");
1064 for (var i=0; i < checkboxes.length;i++) {
1065 if (!checkboxes[i].disabled) {
1066 checkboxes[i].checked = source.checked;
$id
Support class for third parties, contacts, members, users or resources.
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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 predefined suppliers products.
Class to manage line orders.
Class to manage predefined suppliers products.
Class to manage products or services.
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.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTFLOAT($paramname, $rounding='')
Return the value of a $_GET or $_POST supervariable, converted into float.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
img_info($titlealt='default')
Show info logo.
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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.