29 require
'../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
34 $langs->load(
"companies");
38 $action =
GETPOST(
'action',
'aZ09');
41 $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref :
''));
42 $fieldtype = (!empty($ref) ?
'ref' :
'rowid');
43 if ($user->socid) $socid = $user->socid;
44 $result =
restrictedArea($user,
'produit|service', $fieldvalue,
'product&product',
'',
'', $fieldtype);
47 if ($id > 0 || !empty($ref)) $object->fetch($id, $ref);
49 $permissionnote = $user->rights->produit->creer;
56 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
63 $form =
new Form($db);
66 if (
GETPOST(
"type") ==
'0' || ($object->type ==
Product::TYPE_PRODUCT)) $helpurl =
'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
67 if (
GETPOST(
"type") ==
'1' || ($object->type ==
Product::TYPE_SERVICE)) $helpurl =
'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
69 $title = $langs->trans(
'ProductServiceCard');
70 $shortlabel =
dol_trunc($object->label, 16);
73 $title = $langs->trans(
'Product').
" ".$shortlabel.
" - ".$langs->trans(
'Notes');
74 $helpurl =
'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
78 $title = $langs->trans(
'Service').
" ".$shortlabel.
" - ".$langs->trans(
'Notes');
79 $helpurl =
'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
84 if ($id > 0 || !empty($ref))
89 if (!empty($conf->notification->enabled)) $langs->load(
"mails");
92 $titre = $langs->trans(
"CardProduct".$object->type);
97 $linkback =
'<a href="'.DOL_URL_ROOT.
'/product/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
98 $object->next_prev_filter =
" fk_product_type = ".$object->type;
101 if ($user->socid && !in_array(
'product', explode(
',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav = 0;
105 $cssclass =
'titlefield';
111 print '<div class="underbanner clearboth"></div>';
113 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage products or services.
const TYPE_SERVICE
Service.
const TYPE_PRODUCT
Regular product.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
dol_banner_tab($object, $paramid, $morehtml= '', $shownav=1, $fieldid= 'rowid', $fieldref= 'ref', $morehtmlref= '', $moreparam= '', $nodbprefix=0, $morehtmlleft= '', $morehtmlstatus= '', $onlybanner=0, $morehtmlright= '')
Show tab footer of a card.
product_prepare_head($object)
Prepare array with list of tabs.