33require
'../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
48$langs->loadLangs(array(
'products',
'stocks'));
50$action =
GETPOST(
'action',
'aZ09');
51$sref =
GETPOST(
"sref",
'alpha');
52$snom =
GETPOST(
"snom",
'alpha');
53$sall = trim(
GETPOST(
'search_all',
'alphanohtml'));
55$search_barcode =
GETPOST(
"search_barcode",
'alpha');
56$search_toolowstock =
GETPOST(
'search_toolowstock');
61$search_stock_physique =
GETPOST(
'search_stock_physique',
'alpha');
63$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
64$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
66if (empty($page) || $page < 0) {
76if (empty($page) || $page == -1) {
79$offset = $limit * $page;
82$search_sale =
GETPOST(
"search_sale");
83if (GETPOSTISSET(
'catid')) {
93 require_once DOL_DOCUMENT_ROOT.
'/core/class/canvas.class.php';
95 $objcanvas->getCanvas(
'product',
'list', $canvas);
99$virtualdiffersfromphysical = 0;
106 $virtualdiffersfromphysical = 1;
110$hookmanager->initHooks(array(
'productreassortlist'));
113 $socid = $user->socid;
115$result =
restrictedArea($user,
'produit|service', 0,
'product&product');
125if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
133 $search_toolowstock =
'';
136 $search_stock_physique =
'';
145$helpurl =
'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
149if (!empty($objp->stock_physique) && $objp->stock_physique < 0) {
150 print
'<span class="warning">';
153$sql =
'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
154$sql .=
' p.fk_product_type, p.tms as datem,';
155$sql .=
' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
156if (
getDolGlobalString(
'PRODUCT_STOCK_LIST_SHOW_WITH_PRECALCULATED_DENORMALIZED_PHYSICAL_STOCK')) {
157 $sql .=
' p.stock as stock_physique';
159 $sql .=
' SUM(s.reel) as stock_physique';
162 $sql .=
', u.short_label as unit_short';
165$parameters = array();
166$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
167$sql .= $hookmanager->resPrint;
168$sql .=
' FROM '.MAIN_DB_PREFIX.
'product as p';
169if (!
getDolGlobalString(
'PRODUCT_STOCK_LIST_SHOW_WITH_PRECALCULATED_DENORMALIZED_PHYSICAL_STOCK')) {
170 $sql .=
' LEFT JOIN ' . MAIN_DB_PREFIX .
'product_stock as s ON p.rowid = s.fk_product';
173 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_units as u on p.fk_unit = u.rowid';
176$parameters = array();
177$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
178$sql .= $hookmanager->resPrint;
179$sql .=
" WHERE p.entity IN (".getEntity(
'product').
")";
180if (!empty($search_categ) && $search_categ !=
'-1') {
182 if ($search_categ == -2) {
183 $sql .=
" NOT EXISTS ";
188 $sql .=
" SELECT cp.fk_categorie, cp.fk_product";
189 $sql .=
" FROM " . MAIN_DB_PREFIX .
"categorie_product as cp";
190 $sql .=
" WHERE cp.fk_product = p.rowid";
191 if ($search_categ > 0) {
192 $sql .=
" AND cp.fk_categorie = " . ((int) $search_categ);
196if (!
getDolGlobalString(
'PRODUCT_STOCK_LIST_SHOW_WITH_PRECALCULATED_DENORMALIZED_PHYSICAL_STOCK')) {
198 $sql .=
" AND EXISTS (SELECT e.rowid FROM " . MAIN_DB_PREFIX .
"entrepot as e WHERE e.rowid = s.fk_entrepot AND e.entity IN (" .
getEntity(
'stock') .
"))";
204 FROM " . MAIN_DB_PREFIX .
"entrepot as e
205 WHERE e.rowid = s.fk_entrepot AND e.entity IN (" .
getEntity(
'stock') .
"))
207 SELECT SUM(cd1.qty) as qty
208 FROM " . MAIN_DB_PREFIX .
"commande_fournisseurdet as cd1
209 LEFT JOIN " . MAIN_DB_PREFIX .
"commande_fournisseur as c1
210 ON c1.rowid = cd1.fk_commande
211 WHERE c1.entity IN (1) AND cd1.fk_product = p.rowid AND c1.fk_statut in (3,4) AND cd1.qty <> 0
214 SELECT SUM(cd2.qty) as qty
215 FROM " . MAIN_DB_PREFIX .
"commandedet as cd2
216 LEFT JOIN " . MAIN_DB_PREFIX .
"commande as c2 ON c2.rowid = cd2.fk_commande
217 WHERE c2.entity IN (1) AND cd2.fk_product = p.rowid AND c2.fk_statut in (1,2) AND cd2.qty <> 0
220 SELECT SUM(ed3.qty) as qty
221 FROM " . MAIN_DB_PREFIX .
"expeditiondet as ed3
222 LEFT JOIN " . MAIN_DB_PREFIX .
"expedition as e3 ON e3.rowid = ed3.fk_expedition
223 LEFT JOIN " . MAIN_DB_PREFIX .
"commandedet as cd3 ON ed3.fk_elementdet = cd3.rowid
224 LEFT JOIN " . MAIN_DB_PREFIX .
"commande as c3 ON c3.rowid = cd3.fk_commande
225 WHERE e3.entity IN (1) AND cd3.fk_product = p.rowid AND c3.fk_statut IN (1,2) AND e3.fk_statut IN (1,2) AND ed3.qty <> 0
228 SELECT SUM(mp4.qty) as qty
229 FROM " . MAIN_DB_PREFIX .
"mrp_production as mp4
230 LEFT JOIN " . MAIN_DB_PREFIX .
"mrp_mo as m4 ON m4.rowid = mp4.fk_mo AND m4.entity IN (1) AND m4.status IN (1,2)
231 WHERE mp4.fk_product = p.rowid AND mp4.qty <> 0
237 $sql .=
natural_search(array(
'p.ref',
'p.label',
'p.description',
'p.note'), $sall);
242 $sql .=
" AND p.fk_product_type = '1'";
244 $sql .=
" AND p.fk_product_type <> '1'";
250if ($search_barcode) {
256if (!empty($tosell)) {
257 $sql .=
" AND p.tosell = ".((int) $tosell);
260 $sql .=
" AND p.tobuy = ".((int) $tobuy);
262if (!empty($canvas)) {
263 $sql .=
" AND p.canvas = '".$db->escape($canvas).
"'";
266 $sql .=
" AND p.rowid = pf.fk_product AND pf.fk_soc = ".((int) $fourn_id);
268if (
getDolGlobalString(
'PRODUCT_STOCK_LIST_SHOW_WITH_PRECALCULATED_DENORMALIZED_PHYSICAL_STOCK')) {
269 if ($search_toolowstock) {
270 $sql .=
" AND p.stock < p.seuil_stock_alerte";
272 if ($search_stock_physique !=
'') {
277$parameters = array();
278$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
279$sql .= $hookmanager->resPrint;
280if (!
getDolGlobalString(
'PRODUCT_STOCK_LIST_SHOW_WITH_PRECALCULATED_DENORMALIZED_PHYSICAL_STOCK')) {
281 $sql .=
" GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,";
282 $sql .=
" p.fk_product_type, p.tms, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock";
286$parameters = array();
287$reshook = $hookmanager->executeHooks(
'printFieldListGroupBy', $parameters, $object);
288$sql .= $hookmanager->resPrint;
291if (!
getDolGlobalString(
'PRODUCT_STOCK_LIST_SHOW_WITH_PRECALCULATED_DENORMALIZED_PHYSICAL_STOCK')) {
292 if ($search_toolowstock) {
293 $sql_having .=
" HAVING SUM(" .
$db->ifsql(
's.reel IS NULL',
'0',
's.reel') .
") < p.seuil_stock_alerte";
295 if ($search_stock_physique !=
'') {
296 $natural_search_physique =
natural_search(
'__SUM_OF_REEL__', $search_stock_physique, 1, 1);
297 $natural_search_physique =
" " . substr(str_replace(
'__SUM_OF_REEL__',
'SUM(COALESCE(s.reel, 0))', $natural_search_physique), 1, -1);
298 if (!empty($sql_having)) {
299 $sql_having .=
" AND";
301 $sql_having .=
" HAVING";
303 $sql_having .= $natural_search_physique;
308$parameters = array();
309$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object);
310if (empty($reshook)) {
311 if (empty($sql_having)) {
312 $sql_having .=
" HAVING 1=1";
314 $sql_having .= $hookmanager->resPrint;
316 $sql_having = $hookmanager->resPrint;
319if (!empty($sql_having)) {
323$sql .=
$db->order($sortfield, $sortorder);
326$nbtotalofrecords =
'';
328 $result =
$db->query($sql);
329 $nbtotalofrecords =
$db->num_rows($result);
330 if (($page * $limit) > (
int) $nbtotalofrecords) {
336$sql .=
$db->plimit($limit + 1, $offset);
338$resql =
$db->query($sql);
340 $num =
$db->num_rows($resql);
344 if ($num == 1 &&
GETPOST(
'autojumpifoneonly') && ($sall || $snom || $sref)) {
345 $objp =
$db->fetch_object($resql);
346 header(
"Location: card.php?id=$objp->rowid");
352 $texte = $langs->trans(
"Services");
354 $texte = $langs->trans(
"Products");
357 $texte = $langs->trans(
"ProductsAndServices");
359 $texte .=
' ('.$langs->trans(
"MenuStocks").
')';
362 if ($limit > 0 && $limit !=
$conf->liste_limit) {
363 $param .=
'&limit='.((int) $limit);
366 $param .=
"&sall=".urlencode($sall);
369 $param .=
"&tosell=".urlencode($tosell);
372 $param .=
"&tobuy=".urlencode($tobuy);
375 $param .=
"&type=".urlencode((
string) ($type));
378 $param .=
"&fourn_id=".urlencode((
string) ($fourn_id));
381 $param .=
"&snom=".urlencode($snom);
384 $param .=
"&sref=".urlencode($sref);
387 $param .=
"&search_sale=".urlencode($search_sale);
389 if ($search_categ > 0) {
390 $param .=
"&search_categ=".urlencode((
string) ($search_categ));
392 if ($search_toolowstock) {
393 $param .=
"&search_toolowstock=".urlencode($search_toolowstock);
396 $param .=
"&sbarcode=".urlencode((
string) ($sbarcode));
398 if ($search_stock_physique) {
399 $param .=
'&search_stock_physique=' . urlencode($search_stock_physique);
402 llxHeader(
"", $texte, $helpurl,
'', 0, 0,
'',
'',
'',
'mod-product page-reassort');
404 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post" name="formulaire">';
405 print
'<input type="hidden" name="token" value="'.newToken().
'">';
406 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
407 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
408 print
'<input type="hidden" name="page" value="'.$page.
'">';
409 print
'<input type="hidden" name="type" value="'.$type.
'">';
411 print_barre_liste($texte, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'product', 0,
'',
'', $limit);
413 if ($search_categ > 0) {
414 print
"<div id='ways'>";
416 $c->fetch($search_categ);
417 $ways =
$c->print_all_ways(
'auto',
'product/reassort.php');
418 print
" > ".$ways[0].
"<br>\n";
425 $moreforfilter .=
'<div class="divsearchfield">';
426 $moreforfilter .=
img_picto($langs->trans(
'Categories'),
'category',
'class="pictofixedwidth"');
427 $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ,
'search_categ', 1);
428 $moreforfilter .=
'</div>';
431 $moreforfilter .=
'<div class="divsearchfield">';
432 $moreforfilter .=
'<label for="search_toolowstock">'.$langs->trans(
"StockTooLow").
' </label><input type="checkbox" id="search_toolowstock" name="search_toolowstock" value="1"'.($search_toolowstock ?
' checked' :
'').
'>';
433 $moreforfilter .=
'</div>';
435 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
436 print $moreforfilter;
437 $parameters = array();
438 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
439 print $hookmanager->resPrint;
443 $formProduct->loadWarehouses();
444 $warehouses_list = $formProduct->cache_warehouses;
445 $nb_warehouse = count($warehouses_list);
446 $colspan_warehouse = 1;
449 $colspan_warehouse = $nb_warehouse > 1 ? $nb_warehouse + 1 : 1;
452 print
'<div class="div-table-responsive">';
453 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">';
456 print
'<tr class="liste_titre_filter">';
458 if (
$conf->main_checkbox_left_column) {
459 print
'<td class="liste_titre maxwidthsearch">';
460 $searchpicto = $form->showFilterAndCheckAddButtons(0);
465 print
'<td class="liste_titre">';
466 print
'<input class="flat" type="text" name="sref" size="6" value="'.$sref.
'">';
469 print
'<td class="liste_titre">';
470 print
'<input class="flat" type="text" name="snom" size="8" value="'.$snom.
'">';
475 print
'<td class="liste_titre">';
481 print
'<td class="liste_titre"> </td>';
483 print
'<td class="liste_titre right"> </td>';
486 print
'<td class="liste_titre right">';
487 print
'<input class="flat" type="text" size="5" name="search_stock_physique" value="'.dol_escape_htmltag($search_stock_physique).
'">';
490 if ($virtualdiffersfromphysical) {
491 print
'<td class="liste_titre"> </td>';
495 print
'<td class="liste_titre"></td>';
498 $parameters = array();
499 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
500 print $hookmanager->resPrint;
501 print
'<td class="liste_titre"> </td>';
503 print
'<td class="liste_titre" colspan="'.$colspan_warehouse.
'"> </td>';
505 print
'<td class="liste_titre"></td>';
507 if (!
$conf->main_checkbox_left_column) {
508 print
'<td class="liste_titre maxwidthsearch">';
509 $searchpicto = $form->showFilterAndCheckAddButtons(0);
517 print
'<tr class="liste_titre">';
519 if (
$conf->main_checkbox_left_column) {
525 print_liste_field_titre(
"Duration", $_SERVER[
"PHP_SELF"],
"p.duration",
'', $param,
"", $sortfield, $sortorder,
'center ');
527 print_liste_field_titre(
"StockLimit", $_SERVER[
"PHP_SELF"],
"p.seuil_stock_alerte",
'', $param,
"", $sortfield, $sortorder,
'right ');
528 print_liste_field_titre(
"DesiredStock", $_SERVER[
"PHP_SELF"],
"p.desiredstock",
'', $param,
"", $sortfield, $sortorder,
'right ');
529 print_liste_field_titre(
"PhysicalStock", $_SERVER[
"PHP_SELF"],
"stock_physique",
'', $param,
"", $sortfield, $sortorder,
'right ');
532 if ($nb_warehouse > 1) {
533 foreach ($warehouses_list as &$wh) {
538 if ($virtualdiffersfromphysical) {
539 print_liste_field_titre(
"VirtualStock", $_SERVER[
"PHP_SELF"],
"",
'', $param,
"", $sortfield, $sortorder,
'right ',
'VirtualStockDesc');
543 print_liste_field_titre(
"Unit", $_SERVER[
"PHP_SELF"],
"unit_short",
'', $param,
'align="right"', $sortfield, $sortorder);
546 $parameters = array(
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
547 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
548 print $hookmanager->resPrint;
550 print_liste_field_titre(
"ProductStatusOnSell", $_SERVER[
"PHP_SELF"],
"p.tosell",
'', $param,
"", $sortfield, $sortorder,
'right ');
551 print_liste_field_titre(
"ProductStatusOnBuy", $_SERVER[
"PHP_SELF"],
"p.tobuy",
'', $param,
"", $sortfield, $sortorder,
'right ');
553 if (!
$conf->main_checkbox_left_column) {
558 while ($i < min($num, $limit)) {
559 $objp =
$db->fetch_object($resql);
562 $product->fetch($objp->rowid);
563 $product->load_stock();
567 if (
$conf->main_checkbox_left_column) {
570 print
'<td class="tdoverflowmax250">';
571 print $product->getNomUrl(1);
574 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($product->label).
'">'.
dol_escape_htmltag($product->label).
'</td>';
577 print
'<td class="center">';
579 if (preg_match(
'/([0-9]+)y/i', $objp->duration, $regs)) {
580 print $regs[1].
' '.$langs->trans(
"DurationYear");
581 } elseif (preg_match(
'/([0-9]+)m/i', $objp->duration, $regs)) {
582 print $regs[1].
' '.$langs->trans(
"DurationMonth");
583 } elseif (preg_match(
'/([0-9]+)d/i', $objp->duration, $regs)) {
584 print $regs[1].
' '.$langs->trans(
"DurationDay");
586 print $objp->duration;
591 print
'<td class="right">';
592 print $objp->seuil_stock_alerte;
594 print
'<td class="right">';
595 print $objp->desiredstock;
598 print
'<td class="right">';
599 if ($objp->seuil_stock_alerte !=
'' && ($objp->stock_physique < $objp->seuil_stock_alerte)) {
600 print
img_warning($langs->trans(
"StockLowerThanLimit", $objp->seuil_stock_alerte)).
' ';
602 if ($objp->stock_physique < 0) {
603 print
'<span class="warning">';
605 print
price(
price2num($objp->stock_physique,
'MS'), 0, $langs, 1, 0);
606 if ($objp->stock_physique < 0) {
613 if ($nb_warehouse > 1) {
614 foreach ($warehouses_list as &$wh) {
615 print
'<td class="right">';
616 print
price(empty($product->stock_warehouse[$wh[
'id']]->real) ? 0 :
price2num($product->stock_warehouse[$wh[
'id']]->real,
'MS'), 0, $langs, 1, 0);
623 if ($virtualdiffersfromphysical) {
624 print
'<td class="right">';
625 if ($objp->seuil_stock_alerte !=
'' && ($product->stock_theorique < (
float) $objp->seuil_stock_alerte)) {
626 print
img_warning($langs->trans(
"StockLowerThanLimit", $objp->seuil_stock_alerte)).
' ';
628 if ($objp->stock_physique < 0) {
629 print
'<span class="warning">';
631 print
price(
price2num($product->stock_theorique,
'MS'), 0, $langs, 1, 0);
632 if ($objp->stock_physique < 0) {
639 print
'<td class="left">'.dol_escape_htmltag($objp->unit_short).
'</td>';
642 $parameters = array(
'obj' => $objp);
643 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $product);
644 print $hookmanager->resPrint;
645 print
'<td class="center nowraponall">';
646 print
img_picto($langs->trans(
"StockMovement"),
'movement',
'class="pictofixedwidth"');
647 print
'<a href="'.DOL_URL_ROOT.
'/product/stock/movement_list.php?idproduct='.$product->id.
'">'.$langs->trans(
"Movements").
'</a>';
649 print
'<td class="right nowrap">'.$product->LibStatut($objp->statut, 5, 0).
'</td>';
650 print
'<td class="right nowrap">'.$product->LibStatut($objp->tobuy, 5, 1).
'</td>';
652 if (!
$conf->main_checkbox_left_column) {
660 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
if(! $sortfield) if(! $sortorder) $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 categories.
Class to manage products or services.
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.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
isModEnabled($module)
Is Dolibarr module enabled.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
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...
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.