34require
'../../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
41$langs->loadLangs(array(
'bills',
'products',
'stocks'));
45$action =
GETPOST(
'action',
'aZ09');
46$confirm =
GETPOST(
'confirm',
'alpha');
47$cancel =
GETPOST(
'cancel',
'alpha');
52if (!empty($user->socid)) {
53 $socid = $user->socid;
55$fieldvalue = (!empty($id) ?
$id : (!empty($ref) ? $ref :
''));
56$fieldtype = (!empty($ref) ?
'ref' :
'rowid');
59$hookmanager->initHooks(array(
'productcompositioncard',
'globalcard'));
63if ($id > 0 || !empty($ref)) {
64 $result =
$object->fetch($id, $ref);
69$result =
restrictedArea($user,
'produit|service', $fieldvalue,
'product&product',
'',
'', $fieldtype);
72 if (
$object->type == $object::TYPE_PRODUCT) {
75 if (
$object->type == $object::TYPE_SERVICE) {
79 restrictedArea($user,
'produit|service', $fieldvalue,
'product&product',
'',
'', $fieldtype);
94$reshook = $hookmanager->executeHooks(
'doActions', [],
$object, $action);
101 if ($action ==
'add_prod' && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
105 for ($i = 0; $i < $maxprod; $i++) {
114 if (
$object->error ==
"isFatherOfThis") {
115 setEventMessages($langs->trans(
"ErrorAssociationIsFatherOfThis"),
null,
'errors');
132 header(
"Location: " . $_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id);
135 } elseif ($action ===
'save_composed_product') {
136 $TProduct =
GETPOST(
'TProduct',
'array');
137 if (!empty($TProduct)) {
138 foreach ($TProduct as $id_product => $row) {
139 if ($row[
'qty'] > 0) {
140 $object->update_sousproduit($id, $id_product, $row[
'qty'], isset($row[
'incdec']) ? 1 : 0);
142 $object->del_sousproduit($id, $id_product);
148 header(
"Location: " . $_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id);
157$form =
new Form($db);
160$productstatic =
new Product($db);
163if ($action ==
'search') {
164 $current_lang = $langs->getDefaultLang();
166 $sql =
'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type as type, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
167 $sql .=
' p.fk_product_type, p.tms as datem, p.tobatch';
168 $sql .=
', p.tosell as status, p.tobuy as status_buy';
170 $sql .=
', pl.label as labelm, pl.description as descriptionm';
173 $parameters = array();
174 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters,
$object);
175 $sql .= $hookmanager->resPrint;
177 $sql .=
' FROM '.MAIN_DB_PREFIX.
'product as p';
178 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'categorie_product as cp ON p.rowid = cp.fk_product';
180 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product_lang as pl ON pl.fk_product = p.rowid AND lang='".($current_lang).
"'";
182 $sql .=
' WHERE p.entity IN ('.getEntity(
'product').
')';
184 $parameters = array();
185 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters,
$object);
186 $sql .= $hookmanager->resPrint;
190 $params = array(
'p.ref',
'p.label',
'p.description',
'p.note');
193 $params[] =
'pl.label';
194 $params[] =
'pl.description';
195 $params[] =
'pl.note';
197 if (isModEnabled(
'barcode')) {
198 $params[] =
'p.barcode';
202 if (isModEnabled(
'category') && !empty($parent) && $parent != -1) {
203 $sql .=
" AND cp.fk_categorie ='".$db->escape($parent).
"'";
205 $sql .=
" ORDER BY p.ref ASC";
207 $resql = $db->query($sql);
210$title = $langs->trans(
'ProductServiceCard');
214 $title = $langs->trans(
'Product').
" ".$shortlabel.
" - ".$langs->trans(
'AssociatedProducts');
215 $help_url =
'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos|DE:Modul_Produkte';
218 $title = $langs->trans(
'Service').
" ".$shortlabel.
" - ".$langs->trans(
'AssociatedProducts');
219 $help_url =
'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Leistungen';
222llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-product page-composition_card');
226$titre = $langs->trans(
"CardProduct".
$object->type);
232if ($id > 0 || !empty($ref)) {
236 if ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire')) {
237 $linkback =
'<a href="'.DOL_URL_ROOT.
'/product/list.php?restore_lastsearch_values=1&type='.
$object->type.
'">'.$langs->trans(
"BackToList").
'</a>';
240 if ($user->socid && !in_array(
'product', explode(
',',
getDolGlobalString(
'MAIN_MODULES_FOR_EXTERNAL')))) {
244 dol_banner_tab(
$object,
'ref', $linkback, $shownav,
'ref',
'');
247 print
'<div class="fichecenter">';
248 print
'<div class="fichehalfleft">';
249 print
'<div class="underbanner clearboth"></div>';
251 print
'<table class="border centpercent tableforfield">';
254 if (isModEnabled(
"product") && isModEnabled(
"service")) {
255 $typeformat =
'select;0:'.$langs->trans(
"Product").
',1:'.$langs->trans(
"Service");
256 print
'<tr><td class="titlefield">';
257 print (!
getDolGlobalString(
'PRODUCT_DENY_CHANGE_PRODUCT_TYPE')) ? $form->editfieldkey(
"Type",
'fk_product_type',
$object->type,
$object, $usercancreate, $typeformat) : $langs->trans(
'Type');
259 print $form->editfieldval(
"Type",
'fk_product_type',
$object->type,
$object, $usercancreate, $typeformat);
265 print
'</div><div class="fichehalfright">';
266 print
'<div class="underbanner clearboth"></div>';
268 print
'<table class="border centpercent tableforfield">';
273 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"NatureOfProductShort"), $langs->trans(
"NatureOfProductDesc")).
'</td><td>';
274 print
$object->getLibFinished();
282 print
'<tr><td class="titlefield">'.$langs->trans(
"SellingPrice").
'</td><td>';
283 if (
$object->price_base_type ==
'TTC') {
291 print
'<tr><td>'.$langs->trans(
"MinPrice").
'</td><td>';
292 if (
$object->price_base_type ==
'TTC') {
310 $prodsfather =
$object->getFather();
311 $object->get_sousproduits_arbo();
312 $parent_label =
$object->label;
313 $prods_arbo =
$object->get_arbo_each_prod();
316 if (!empty($conf->use_javascript_ajax)) {
317 $nboflines = $prods_arbo;
318 $table_element_line =
'product_association';
320 include DOL_DOCUMENT_ROOT .
'/core/tpl/ajaxrow.tpl.php';
324 $nbofsubsubproducts = count($prods_arbo);
325 $prodschild =
$object->getChildsArbo($id, 1);
326 $nbofsubproducts = count($prodschild);
329 print
'<div class="fichecenter">';
333 print
'<table class="liste">';
334 print
'<tr class="liste_titre">';
335 print
'<td>'.$langs->trans(
'ParentProducts').
'</td>';
336 print
'<td>'.$langs->trans(
'Label').
'</td>';
337 print
'<td class="right">'.$langs->trans(
'Qty').
'</td>';
339 if (count($prodsfather) > 0) {
340 foreach ($prodsfather as $value) {
341 $idprod = $value[
"id"];
342 $productstatic->id = $idprod;
343 $productstatic->type = $value[
"fk_product_type"];
344 $productstatic->ref = $value[
'ref'];
345 $productstatic->label = $value[
'label'];
346 $productstatic->entity = $value[
'entity'];
347 $productstatic->status = $value[
'status'];
348 $productstatic->status_buy = $value[
'status_buy'];
350 print
'<tr class="oddeven">';
351 print
'<td>'.$productstatic->getNomUrl(1,
'composition').
'</td>';
352 print
'<td>'.dol_escape_htmltag($productstatic->label).
'</td>';
353 print
'<td class="right">'.dol_escape_htmltag($value[
'qty']).
'</td>';
357 print
'<tr class="oddeven">';
358 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
367 print
'<div class="fichecenter">';
369 $atleastonenotdefined = 0;
372 print
'<form name="formComposedProduct" action="'.$_SERVER[
'PHP_SELF'].
'" method="post">';
373 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
374 print
'<input type="hidden" name="action" value="save_composed_product" />';
375 print
'<input type="hidden" name="id" value="'.$id.
'" />';
377 print
'<table id="tablelines" class="ui-sortable liste nobottom">';
379 print
'<tr class="liste_titre nodrag nodrop">';
381 print
'<td>'.$langs->trans(
'Position').
'</td>';
383 print
'<td>'.$langs->trans(
'ComposedProduct').
'</td>';
385 print
'<td>'.$langs->trans(
'Label').
'</td>';
387 print
'<td class="right" colspan="2">'.$langs->trans(
'MinSupplierPrice').
'</td>';
389 print
'<td class="right" colspan="2">'.$langs->trans(
'MinCustomerPrice').
'</td>';
391 if (isModEnabled(
'stock')) {
392 print
'<td class="right">'.$langs->trans(
'Stock').
'</td>';
395 $parameters = array();
396 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
397 print $hookmanager->resPrint;
399 print
'<td class="right">'.$langs->trans(
'Qty').
'</td>';
401 print
'<td class="center">'.$langs->trans(
'ComposedProductIncDecStock').
'</td>';
403 print
'<td class="linecolmove" style="width: 10px"></td>';
408 if (count($prods_arbo)) {
409 foreach ($prods_arbo as $value) {
410 $productstatic->fetch($value[
'id']);
412 if ($value[
'level'] <= 1) {
413 print
'<tr id="'.$object->sousprods[$parent_label][$value[
'id']][6].
'" class="drag drop oddeven level1">';
416 print
'<td>'.$object->sousprods[$parent_label][$value[
'id']][7].
'</td>';
419 $nb_of_subproduct = $value[
'nb'];
422 print
'<td>'.$productstatic->getNomUrl(1,
'composition').
'</td>';
425 print
'<td title="'.dol_escape_htmltag($productstatic->label).
'" class="tdoverflowmax150">'.
dol_escape_htmltag($productstatic->label).
'</td>';
428 print
'<td class="right">';
429 if ($product_fourn->find_min_price_product_fournisseur($productstatic->id) > 0) {
430 print $langs->trans(
"BuyingPriceMinShort").
': ';
431 if ($product_fourn->product_fourn_price_id > 0) {
432 print $product_fourn->display_price_product_fournisseur(0, 0);
434 print $langs->trans(
"NotDefined");
436 $atleastonenotdefined++;
442 $fourn_unitprice = (!empty($product_fourn->fourn_unitprice) ? $product_fourn->fourn_unitprice : 0);
443 $fourn_remise_percent = (!empty($product_fourn->fourn_remise_percent) ? $product_fourn->fourn_remise_percent : 0);
444 $fourn_remise = (!empty($product_fourn->fourn_remise) ? $product_fourn->fourn_remise : 0);
446 $unitline =
price2num(($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise),
'MU');
447 $totalline =
price2num($value[
'nb'] * ($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise),
'MT');
448 $total += $totalline;
450 print
'<td class="right nowraponall">';
451 print($notdefined ?
'' : ($value[
'nb'] > 1 ? $value[
'nb'].
'x ' :
'').
'<span class="amount">'.
price($unitline, 0,
'', 0, 0, -1, $conf->currency)).
'</span>';
455 $pricesell = $productstatic->price;
457 $pricesell =
'Variable';
459 $totallinesell =
price2num($value[
'nb'] * ($pricesell),
'MT');
460 $totalsell += $totallinesell;
462 print
'<td class="right" colspan="2">';
463 print($notdefined ?
'' : ($value[
'nb'] > 1 ? $value[
'nb'].
'x ' :
''));
464 if (is_numeric($pricesell)) {
465 print
'<span class="amount">'.price($pricesell, 0,
'', 0, 0, -1, $conf->currency).
'</span>';
467 print
'<span class="opacitymedium">'.$langs->trans($pricesell).
'</span>';
472 if (isModEnabled(
'stock')) {
473 print
'<td class="right">'.$value[
'stock'].
'</td>';
477 $parameters = array();
478 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $productstatic);
479 print $hookmanager->resPrint;
482 if ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer')) {
483 print
'<td class="center"><input type="text" value="'.$nb_of_subproduct.
'" name="TProduct['.$productstatic->id.
'][qty]" class="right width40" /></td>';
484 print
'<td class="center"><input type="checkbox" name="TProduct['.$productstatic->id.
'][incdec]" value="1" '.($value[
'incdec'] == 1 ?
'checked' :
'').
' /></td>';
486 print
'<td>'.$nb_of_subproduct.
'</td>';
487 print
'<td>'.($value[
'incdec'] == 1 ?
'x' :
'').
'</td>';
491 print
'<td class="linecolmove tdlineupdown center"></td>';
497 $hide =
' hideobject';
500 print
'<tr class="oddeven'.$hide.
'" id="sub-'.$value[
'id_parent'].
'" data-ignoreidfordnd=1>';
503 $productstatic->ref = $value[
'ref'];
510 for ($i = 0; $i < $value[
'level']; $i++) {
511 print
' ';
513 print $productstatic->getNomUrl(1,
'composition');
517 print
'<td>'.dol_escape_htmltag($productstatic->label).
'</td>';
520 print
'<td> </td>';
521 print
'<td> </td>';
523 print
'<td> </td>';
524 print
'<td> </td>';
527 if (isModEnabled(
'stock')) {
532 $parameters = array();
533 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $productstatic);
534 print $hookmanager->resPrint;
537 print
'<td class="right">'.dol_escape_htmltag((
string) $value[
'nb']).
'</td>';
540 print
'<td> </td>';
543 print
'<td> </td>';
552 print
'<tr class="liste_total">';
558 print
'<td class="liste_total"></td>';
561 print
'<td class="liste_total"></td>';
564 print
'<td class="liste_total right">';
565 print $langs->trans(
"TotalBuyingPriceMinShort");
568 print
'<td class="liste_total right">';
569 if ($atleastonenotdefined) {
570 print $langs->trans(
"Unknown").
' ('.$langs->trans(
"SomeSubProductHaveNoPrices").
')';
572 print($atleastonenotdefined ?
'' :
price($total, 0,
'', 0, 0, -1, $conf->currency));
576 print
'<td class="liste_total right">';
577 print $langs->trans(
"TotalSellingPriceMinShort");
580 print
'<td class="liste_total right">';
581 if ($atleastonenotdefined) {
582 print $langs->trans(
"Unknown").
' ('.$langs->trans(
"SomeSubProductHaveNoPrices").
')';
584 print($atleastonenotdefined ?
'' :
price($totalsell, 0,
'', 0, 0, -1, $conf->currency));
588 if (isModEnabled(
'stock')) {
589 print
'<td class="liste_total right"> </td>';
594 print
'<td class="center">';
595 if ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer')) {
596 print
'<input type="submit" class="button button-save" value="'.$langs->trans(
"Save").
'">';
605 if (isModEnabled(
'stock')) {
609 print
'<tr class="oddeven">';
610 print
'<td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
626 if ((empty($action) || $action ==
'view' || $action ==
'edit' || $action ==
'search' || $action ==
're-edit') && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
630 if (isModEnabled(
'category')) {
635 print
'<form action="'.DOL_URL_ROOT.
'/product/composition/card.php?id='.
$id.
'" method="POST">';
636 print
'<input type="hidden" name="action" value="search">';
637 print
'<input type="hidden" name="id" value="'.$id.
'">';
638 print
'<div class="inline-block">';
639 print
'<input type="hidden" name="token" value="'.newToken().
'">';
640 print $langs->trans(
"KeywordFilter").
': ';
641 print
'<input type="text" name="key" value="'.$key.
'"> ';
643 if (isModEnabled(
'category')) {
644 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
645 print
'<div class="inline-block">'.$langs->trans(
"CategoryFilter").
': ';
646 print $form->select_all_categories(Categorie::TYPE_PRODUCT, $parent,
'parent').
' </div>';
649 print
'<div class="inline-block">';
650 print
'<input type="submit" class="button small" value="'.$langs->trans(
"Search").
'">';
657 if ($action ==
'search') {
659 print
'<form action="'.DOL_URL_ROOT.
'/product/composition/card.php?id='.
$id.
'" method="post">';
660 print
'<input type="hidden" name="token" value="'.newToken().
'">';
661 print
'<input type="hidden" name="action" value="add_prod">';
662 print
'<input type="hidden" name="id" value="'.$id.
'">';
664 print
'<table class="noborder centpercent">';
665 print
'<tr class="liste_titre">';
666 print
'<th class="liste_titre">'.$langs->trans(
"ComposedProduct").
'</td>';
667 print
'<th class="liste_titre">'.$langs->trans(
"Label").
'</td>';
669 print
'<th class="liste_titre right">'.$langs->trans(
"Qty").
'</td>';
670 print
'<th class="center">'.$langs->trans(
'ComposedProductIncDecStock').
'</th>';
673 $num = $db->num_rows($resql);
677 print
'<tr><td colspan="4">'.$langs->trans(
"NoMatchFound").
'</td></tr>';
682 while ($i < min($num, $MAX)) {
683 $objp = $db->fetch_object($resql);
684 if ($objp->rowid != $id) {
687 $prod_arbo->id = $objp->rowid;
690 if ($prod_arbo->type == 2 || $prod_arbo->type == 3) {
692 $prod_arbo->get_sousproduits_arbo();
694 $prods_arbo = $prod_arbo->get_arbo_each_prod();
695 if (count($prods_arbo) > 0) {
696 foreach ($prods_arbo as $key => $value) {
698 if ($value[1] == $id) {
711 print
'<tr class="oddeven">';
713 $productstatic->id = $objp->rowid;
714 $productstatic->ref = $objp->ref;
715 $productstatic->label = $objp->label;
716 $productstatic->type = $objp->type;
717 $productstatic->entity = $objp->entity;
718 $productstatic->status = $objp->status;
719 $productstatic->status_buy = $objp->status_buy;
720 $productstatic->status_batch = $objp->tobatch;
722 print
'<td>'.$productstatic->getNomUrl(1,
'', 24).
'</td>';
723 $labeltoshow = $objp->label;
725 $labeltoshow = $objp->labelm;
728 print
'<td>'.$labeltoshow.
'</td>';
731 if (
$object->is_sousproduit($id, $objp->rowid)) {
733 $qty =
$object->is_sousproduit_qty;
734 $incdec =
$object->is_sousproduit_incdec;
744 print
'<td class="right"><input type="hidden" name="prod_id_'.$i.
'" value="'.$objp->rowid.
'"><input type="text" size="2" name="prod_qty_'.$i.
'" value="'.($qty ? $qty :
'').
'"></td>';
747 print
'<td class="center">';
749 print
'<input type="checkbox" name="prod_incdec_'.$i.
'" value="1" '.($incdec ?
'checked' :
'').
'>';
752 print
'<input type="checkbox" name="prod_incdec_'.$i.
'" value="1" checked>';
762 print
'<tr class="oddeven">';
763 print
'<td><span class="opacitymedium">'.$langs->trans(
"More").
'...</span></td>';
773 print
'<input type="hidden" name="max_prod" value="'.$i.
'">';
776 print
'<div class="center">';
777 print
'<input type="submit" class="button button-save" name="save" value="'.$langs->trans(
"Add").
'/'.$langs->trans(
"Update").
'">';
778 print
'<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
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 products or services.
const TYPE_PRODUCT
Regular product.
const TYPE_SERVICE
Service.
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)
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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...
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.
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...
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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...
product_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.