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';
49$langs->loadLangs(array(
'bills',
'products',
'stocks'));
53$action =
GETPOST(
'action',
'aZ09');
54$confirm =
GETPOST(
'confirm',
'alpha');
55$cancel =
GETPOST(
'cancel',
'alpha');
60if (!empty($user->socid)) {
61 $socid = $user->socid;
63$fieldvalue = (!empty($id) ?
$id : (!empty($ref) ? $ref :
''));
64$fieldtype = (!empty($ref) ?
'ref' :
'rowid');
67$hookmanager->initHooks(array(
'productcompositioncard',
'globalcard'));
71if ($id > 0 || !empty($ref)) {
72 $result =
$object->fetch($id, $ref);
77$result =
restrictedArea($user,
'produit|service', $fieldvalue,
'product&product',
'',
'', $fieldtype);
80 if (
$object->type == $object::TYPE_PRODUCT) {
83 if (
$object->type == $object::TYPE_SERVICE) {
87 restrictedArea($user,
'produit|service', $fieldvalue,
'product&product',
'',
'', $fieldtype);
102$reshook = $hookmanager->executeHooks(
'doActions', [],
$object, $action);
107if (empty($reshook)) {
109 if ($action ==
'add_prod' && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
113 for ($i = 0; $i < $maxprod; $i++) {
122 if (
$object->error ==
"isFatherOfThis") {
123 setEventMessages($langs->trans(
"ErrorAssociationIsFatherOfThis"),
null,
'errors');
140 header(
"Location: " . $_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id);
143 } elseif ($action ===
'save_composed_product') {
144 $TProduct =
GETPOST(
'TProduct',
'array');
145 if (!empty($TProduct)) {
146 foreach ($TProduct as $id_product => $row) {
147 if ($row[
'qty'] > 0) {
148 $object->update_sousproduit($id, $id_product, $row[
'qty'], isset($row[
'incdec']) ? 1 : 0);
150 $object->del_sousproduit($id, $id_product);
156 header(
"Location: " . $_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id);
165$form =
new Form($db);
168$productstatic =
new Product($db);
171if ($action ==
'search') {
172 $current_lang = $langs->getDefaultLang();
174 $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,';
175 $sql .=
' p.fk_product_type, p.tms as datem, p.tobatch';
176 $sql .=
', p.tosell as status, p.tobuy as status_buy';
178 $sql .=
', pl.label as labelm, pl.description as descriptionm';
181 $parameters = array();
182 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters,
$object);
183 $sql .= $hookmanager->resPrint;
185 $sql .=
' FROM '.MAIN_DB_PREFIX.
'product as p';
186 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'categorie_product as cp ON p.rowid = cp.fk_product';
188 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product_lang as pl ON pl.fk_product = p.rowid AND lang='".($current_lang).
"'";
190 $sql .=
' WHERE p.entity IN ('.getEntity(
'product').
')';
192 $parameters = array();
193 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters,
$object);
194 $sql .= $hookmanager->resPrint;
198 $params = array(
'p.ref',
'p.label',
'p.description',
'p.note');
201 $params[] =
'pl.label';
202 $params[] =
'pl.description';
203 $params[] =
'pl.note';
205 if (isModEnabled(
'barcode')) {
206 $params[] =
'p.barcode';
210 if (isModEnabled(
'category') && !empty($parent) && $parent != -1) {
211 $sql .=
" AND cp.fk_categorie ='".$db->escape($parent).
"'";
213 $sql .=
" ORDER BY p.ref ASC";
215 $resql = $db->query($sql);
218$title = $langs->trans(
'ProductServiceCard');
222 $title = $langs->trans(
'Product').
" ".$shortlabel.
" - ".$langs->trans(
'AssociatedProducts');
223 $help_url =
'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos|DE:Modul_Produkte';
226 $title = $langs->trans(
'Service').
" ".$shortlabel.
" - ".$langs->trans(
'AssociatedProducts');
227 $help_url =
'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Leistungen';
230llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-product page-composition_card');
234$titre = $langs->trans(
"CardProduct".
$object->type);
240if ($id > 0 || !empty($ref)) {
244 if ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire')) {
245 $linkback =
'<a href="'.DOL_URL_ROOT.
'/product/list.php?restore_lastsearch_values=1&type='.
$object->type.
'">'.$langs->trans(
"BackToList").
'</a>';
248 if ($user->socid && !in_array(
'product', explode(
',',
getDolGlobalString(
'MAIN_MODULES_FOR_EXTERNAL')))) {
252 dol_banner_tab(
$object,
'ref', $linkback, $shownav,
'ref',
'');
255 print
'<div class="fichecenter">';
256 print
'<div class="fichehalfleft">';
257 print
'<div class="underbanner clearboth"></div>';
259 print
'<table class="border centpercent tableforfield">';
262 if (isModEnabled(
"product") && isModEnabled(
"service")) {
263 $typeformat =
'select;0:'.$langs->trans(
"Product").
',1:'.$langs->trans(
"Service");
264 print
'<tr><td class="titlefield">';
265 print (!
getDolGlobalString(
'PRODUCT_DENY_CHANGE_PRODUCT_TYPE')) ? $form->editfieldkey(
"Type",
'fk_product_type',
$object->type,
$object, $usercancreate, $typeformat) : $langs->trans(
'Type');
267 print $form->editfieldval(
"Type",
'fk_product_type',
$object->type,
$object, $usercancreate, $typeformat);
273 print
'</div><div class="fichehalfright">';
274 print
'<div class="underbanner clearboth"></div>';
276 print
'<table class="border centpercent tableforfield">';
281 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"NatureOfProductShort"), $langs->trans(
"NatureOfProductDesc")).
'</td><td>';
282 print
$object->getLibFinished();
290 print
'<tr><td class="titlefield">'.$langs->trans(
"SellingPrice").
'</td><td>';
291 if (
$object->price_base_type ==
'TTC') {
299 print
'<tr><td>'.$langs->trans(
"MinPrice").
'</td><td>';
300 if (
$object->price_base_type ==
'TTC') {
318 $prodsfather =
$object->getFather();
319 $object->get_sousproduits_arbo();
320 $parent_label =
$object->label;
321 $prods_arbo =
$object->get_arbo_each_prod();
324 if (!empty(
$conf->use_javascript_ajax)) {
325 $nboflines = $prods_arbo;
326 $table_element_line =
'product_association';
328 include DOL_DOCUMENT_ROOT .
'/core/tpl/ajaxrow.tpl.php';
332 $nbofsubsubproducts = count($prods_arbo);
333 $prodschild =
$object->getChildsArbo($id, 1);
334 $nbofsubproducts = count($prodschild);
337 print
'<div class="fichecenter">';
341 print
'<table class="liste noborder">';
342 print
'<tr class="liste_titre">';
343 print
'<th>'.$langs->trans(
'ParentProducts').
'</th>';
344 print
'<th>'.$langs->trans(
'Label').
'</th>';
345 print
'<th class="right">'.$langs->trans(
'Qty').
'</th>';
347 if (count($prodsfather) > 0) {
348 foreach ($prodsfather as $value) {
349 $idprod = $value[
"id"];
350 $productstatic->id = $idprod;
351 $productstatic->type = $value[
"fk_product_type"];
352 $productstatic->ref = $value[
'ref'];
353 $productstatic->label = $value[
'label'];
354 $productstatic->entity = $value[
'entity'];
355 $productstatic->status = $value[
'status'];
356 $productstatic->status_buy = $value[
'status_buy'];
358 print
'<tr class="oddeven">';
359 print
'<td>'.$productstatic->getNomUrl(1,
'composition').
'</td>';
360 print
'<td>'.dol_escape_htmltag($productstatic->label).
'</td>';
361 print
'<td class="right">'.dol_escape_htmltag((
string) $value[
'qty']).
'</td>';
365 print
'<tr class="oddeven">';
366 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
375 print
'<div class="fichecenter">';
377 $atleastonenotdefined = 0;
380 print
'<form name="formComposedProduct" action="'.$_SERVER[
'PHP_SELF'].
'" method="post">';
381 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
382 print
'<input type="hidden" name="action" value="save_composed_product" />';
383 print
'<input type="hidden" name="id" value="'.$id.
'" />';
385 print
'<table id="tablelines" class="ui-sortable liste noborder nobottom">';
387 print
'<tr class="liste_titre nodrag nodrop">';
389 print
'<th>'.$langs->trans(
'Position').
'</th>';
391 print
'<th>'.$langs->trans(
'ComposedProduct').
'</th>';
393 print
'<th>'.$langs->trans(
'Label').
'</th>';
395 print
'<th class="right" colspan="2">'.$langs->trans(
'MinSupplierPrice').
'</th>';
397 print
'<th class="right" colspan="2">'.$langs->trans(
'MinCustomerPrice').
'</th>';
399 if (isModEnabled(
'stock')) {
400 print
'<th class="right">'.$langs->trans(
'Stock').
'</th>';
403 $parameters = array();
404 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
405 print $hookmanager->resPrint;
407 print
'<th class="right">'.$langs->trans(
'Qty').
'</th>';
409 print
'<th class="center">'.$langs->trans(
'ComposedProductIncDecStock').
'</th>';
411 print
'<th class="linecolmove" style="width: 10px"></th>';
416 if (count($prods_arbo)) {
417 foreach ($prods_arbo as $value) {
418 $productstatic->fetch($value[
'id']);
420 if ($value[
'level'] <= 1) {
421 print
'<tr id="'.$object->sousprods[$parent_label][$value[
'id']][6].
'" class="drag drop oddeven level1">';
424 print
'<td>'.$object->sousprods[$parent_label][$value[
'id']][7].
'</td>';
427 $nb_of_subproduct = $value[
'nb'];
430 print
'<td>'.$productstatic->getNomUrl(1,
'composition').
'</td>';
433 print
'<td title="'.dol_escape_htmltag($productstatic->label).
'" class="tdoverflowmax150">'.
dol_escape_htmltag($productstatic->label).
'</td>';
436 print
'<td class="right">';
437 if ($product_fourn->find_min_price_product_fournisseur($productstatic->id) > 0) {
438 print $langs->trans(
"BuyingPriceMinShort").
': ';
439 if ($product_fourn->product_fourn_price_id > 0) {
440 print $product_fourn->display_price_product_fournisseur(0, 0);
442 print $langs->trans(
"NotDefined");
444 $atleastonenotdefined++;
450 $fourn_unitprice = (!empty($product_fourn->fourn_unitprice) ? $product_fourn->fourn_unitprice : 0);
451 $fourn_remise_percent = (!empty($product_fourn->fourn_remise_percent) ? $product_fourn->fourn_remise_percent : 0);
452 $fourn_remise = (!empty($product_fourn->fourn_remise) ? $product_fourn->fourn_remise : 0);
454 $unitline =
price2num(($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise),
'MU');
455 $totalline =
price2num($value[
'nb'] * ($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise),
'MT');
456 $total += $totalline;
458 print
'<td class="right nowraponall">';
459 print($notdefined ?
'' : ($value[
'nb'] > 1 ? $value[
'nb'].
'x ' :
'').
'<span class="amount">'.
price($unitline, 0,
'', 0, 0, -1,
$conf->currency)).
'</span>';
463 $pricesell = $productstatic->price;
465 $pricesell =
'Variable';
467 $totallinesell =
price2num($value[
'nb'] * ($pricesell),
'MT');
468 $totalsell += $totallinesell;
470 print
'<td class="right" colspan="2">';
471 print($notdefined ?
'' : ($value[
'nb'] > 1 ? $value[
'nb'].
'x ' :
''));
472 if (is_numeric($pricesell)) {
473 print
'<span class="amount">'.price($pricesell, 0,
'', 0, 0, -1,
$conf->currency).
'</span>';
475 print
'<span class="opacitymedium">'.$langs->trans($pricesell).
'</span>';
480 if (isModEnabled(
'stock')) {
481 print
'<td class="right">'.$value[
'stock'].
'</td>';
485 $parameters = array();
486 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $productstatic);
487 print $hookmanager->resPrint;
490 if ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer')) {
491 print
'<td class="center"><input type="text" value="'.$nb_of_subproduct.
'" name="TProduct['.$productstatic->id.
'][qty]" class="right width40" /></td>';
492 print
'<td class="center"><input type="checkbox" name="TProduct['.$productstatic->id.
'][incdec]" value="1" '.($value[
'incdec'] == 1 ?
'checked' :
'').
' /></td>';
494 print
'<td>'.$nb_of_subproduct.
'</td>';
495 print
'<td>'.($value[
'incdec'] == 1 ?
'x' :
'').
'</td>';
499 print
'<td class="linecolmove tdlineupdown center"></td>';
505 $hide =
' hideobject';
508 print
'<tr class="oddeven'.$hide.
'" id="sub-'.$value[
'id_parent'].
'" data-ignoreidfordnd=1>';
511 $productstatic->ref = $value[
'ref'];
518 for ($i = 0; $i < $value[
'level']; $i++) {
519 print
' ';
521 print $productstatic->getNomUrl(1,
'composition');
525 print
'<td>'.dol_escape_htmltag($productstatic->label).
'</td>';
528 print
'<td> </td>';
529 print
'<td> </td>';
531 print
'<td> </td>';
532 print
'<td> </td>';
535 if (isModEnabled(
'stock')) {
540 $parameters = array();
541 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $productstatic);
542 print $hookmanager->resPrint;
545 print
'<td class="right">'.dol_escape_htmltag((
string) $value[
'nb']).
'</td>';
548 print
'<td> </td>';
551 print
'<td> </td>';
560 print
'<tr class="liste_total">';
566 print
'<td class="liste_total"></td>';
569 print
'<td class="liste_total"></td>';
572 print
'<td class="liste_total right">';
573 print $langs->trans(
"TotalBuyingPriceMinShort");
576 print
'<td class="liste_total right">';
577 if ($atleastonenotdefined) {
578 print $langs->trans(
"Unknown").
' ('.$langs->trans(
"SomeSubProductHaveNoPrices").
')';
580 print($atleastonenotdefined ?
'' :
price($total, 0,
'', 0, 0, -1,
$conf->currency));
584 print
'<td class="liste_total right">';
585 print $langs->trans(
"TotalSellingPriceMinShort");
588 print
'<td class="liste_total right">';
589 if ($atleastonenotdefined) {
590 print $langs->trans(
"Unknown").
' ('.$langs->trans(
"SomeSubProductHaveNoPrices").
')';
592 print($atleastonenotdefined ?
'' :
price($totalsell, 0,
'', 0, 0, -1,
$conf->currency));
596 if (isModEnabled(
'stock')) {
597 print
'<td class="liste_total right"> </td>';
602 print
'<td class="center">';
603 if ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer')) {
604 print
'<input type="submit" class="button button-save" value="'.$langs->trans(
"Save").
'">';
613 if (isModEnabled(
'stock')) {
617 print
'<tr class="oddeven">';
618 print
'<td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
634 if ((empty($action) || $action ==
'view' || $action ==
'edit' || $action ==
'search' || $action ==
're-edit') && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
638 if (isModEnabled(
'category')) {
643 print
'<form action="'.DOL_URL_ROOT.
'/product/composition/card.php?id='.
$id.
'" method="POST">';
644 print
'<input type="hidden" name="action" value="search">';
645 print
'<input type="hidden" name="id" value="'.$id.
'">';
646 print
'<div class="inline-block">';
647 print
'<input type="hidden" name="token" value="'.newToken().
'">';
648 print $langs->trans(
"KeywordFilter").
': ';
649 print
'<input type="text" name="key" value="'.$key.
'"> ';
651 if (isModEnabled(
'category')) {
652 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
653 print
'<div class="inline-block">'.$langs->trans(
"CategoryFilter").
': ';
654 print $form->select_all_categories(Categorie::TYPE_PRODUCT, $parent,
'parent').
' </div>';
657 print
'<div class="inline-block">';
658 print
'<input type="submit" class="button small" value="'.$langs->trans(
"Search").
'">';
665 if ($action ==
'search') {
667 print
'<form action="'.DOL_URL_ROOT.
'/product/composition/card.php?id='.
$id.
'" method="post">';
668 print
'<input type="hidden" name="token" value="'.newToken().
'">';
669 print
'<input type="hidden" name="action" value="add_prod">';
670 print
'<input type="hidden" name="id" value="'.$id.
'">';
672 print
'<table class="noborder centpercent">';
673 print
'<tr class="liste_titre">';
674 print
'<th class="liste_titre">'.$langs->trans(
"ComposedProduct").
'</td>';
675 print
'<th class="liste_titre">'.$langs->trans(
"Label").
'</td>';
677 print
'<th class="liste_titre right">'.$langs->trans(
"Qty").
'</td>';
678 print
'<th class="center">'.$langs->trans(
'ComposedProductIncDecStock').
'</th>';
681 $num = $db->num_rows($resql);
685 print
'<tr><td colspan="4">'.$langs->trans(
"NoMatchFound").
'</td></tr>';
690 while ($i < min($num, $MAX)) {
691 $objp = $db->fetch_object($resql);
692 if ($objp->rowid != $id) {
695 $prod_arbo->id = $objp->rowid;
698 if ($prod_arbo->type == 2 || $prod_arbo->type == 3) {
700 $prod_arbo->get_sousproduits_arbo();
702 $prods_arbo = $prod_arbo->get_arbo_each_prod();
703 if (count($prods_arbo) > 0) {
704 foreach ($prods_arbo as $key => $value) {
706 if ($value[1] == $id) {
719 print
'<tr class="oddeven">';
721 $productstatic->id = $objp->rowid;
722 $productstatic->ref = $objp->ref;
723 $productstatic->label = $objp->label;
724 $productstatic->type = $objp->type;
725 $productstatic->entity = $objp->entity;
726 $productstatic->status = $objp->status;
727 $productstatic->status_buy = $objp->status_buy;
728 $productstatic->status_batch = $objp->tobatch;
730 print
'<td>'.$productstatic->getNomUrl(1,
'', 24).
'</td>';
731 $labeltoshow = $objp->label;
733 $labeltoshow = $objp->labelm;
736 print
'<td>'.$labeltoshow.
'</td>';
739 if (
$object->is_sousproduit($id, $objp->rowid)) {
741 $qty =
$object->is_sousproduit_qty;
742 $incdec =
$object->is_sousproduit_incdec;
752 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>';
755 print
'<td class="center">';
757 print
'<input type="checkbox" name="prod_incdec_'.$i.
'" value="1" '.($incdec ?
'checked' :
'').
'>';
760 print
'<input type="checkbox" name="prod_incdec_'.$i.
'" value="1" checked>';
770 print
'<tr class="oddeven">';
771 print
'<td><span class="opacitymedium">'.$langs->trans(
"More").
'...</span></td>';
781 print
'<input type="hidden" name="max_prod" value="'.$i.
'">';
784 print
'<div class="center">';
785 print
'<input type="submit" class="button button-save" name="save" value="'.$langs->trans(
"Add").
'/'.$langs->trans(
"Update").
'">';
786 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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.