30 require
'../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
35 $langs->load(
"companies");
39 $action =
GETPOST(
'action',
'aZ09');
42 $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref :
''));
43 $fieldtype = (!empty($ref) ?
'ref' :
'rowid');
45 $socid = $user->socid;
49 if ($id > 0 || !empty($ref)) {
50 $object->fetch($id, $ref);
53 $permissionnote = $user->rights->produit->creer;
55 if ($object->id > 0) {
56 if ($object->type == $object::TYPE_PRODUCT) {
57 restrictedArea($user,
'product', $object->id,
'product&product',
'',
'');
59 if ($object->type == $object::TYPE_SERVICE) {
60 restrictedArea($user,
'service', $object->id,
'product&product',
'',
'');
63 restrictedArea($user,
'product|service', $fieldvalue,
'product&product',
'',
'', $fieldtype);
67 $hookmanager->initHooks(array(
'productnote'));
73 $reshook = $hookmanager->executeHooks(
'doActions', array(), $object, $action);
77 if (empty($reshook)) {
78 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
90 $help_url =
'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos|DE:Modul_Produkte';
93 $help_url =
'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Leistungen';
96 $title = $langs->trans(
'ProductServiceCard');
97 $shortlabel =
dol_trunc($object->label, 16);
99 $title = $langs->trans(
'Product').
" ".$shortlabel.
" - ".$langs->trans(
'Notes');
100 $help_url =
'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos|DE:Modul_Produkte';
103 $title = $langs->trans(
'Service').
" ".$shortlabel.
" - ".$langs->trans(
'Notes');
104 $help_url =
'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Leistungen';
109 if ($id > 0 || !empty($ref)) {
114 $langs->load(
"mails");
118 $titre = $langs->trans(
"CardProduct".$object->type);
123 $linkback =
'<a href="'.DOL_URL_ROOT.
'/product/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
124 $object->next_prev_filter =
" fk_product_type = ".$object->type;
127 if ($user->socid && !in_array(
'product', explode(
',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) {
133 $cssclass =
'titlefield';
139 print
'<div class="underbanner clearboth"></div>';
141 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage products or services.
const TYPE_PRODUCT
Regular product.
const TYPE_SERVICE
Service.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
isModEnabled($module)
Is Dolibarr module enabled.
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.