34require
'../../main.inc.php';
42require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
48$langs->loadLangs(array(
'bills',
'products',
'stocks'));
52$action =
GETPOST(
'action',
'aZ09');
53$confirm =
GETPOST(
'confirm',
'alpha');
54$cancel =
GETPOST(
'cancel',
'alpha');
59if (!empty($user->socid)) {
60 $socid = $user->socid;
62$fieldvalue = (!empty($id) ?
$id : (!empty($ref) ? $ref :
''));
63$fieldtype = (!empty($ref) ?
'ref' :
'rowid');
66$hookmanager->initHooks(array(
'productcompositioncard',
'globalcard'));
70if ($id > 0 || !empty($ref)) {
71 $result =
$object->fetch($id, $ref);
76$result =
restrictedArea($user,
'produit|service', $fieldvalue,
'product&product',
'',
'', $fieldtype);
79 if (
$object->type == $object::TYPE_PRODUCT) {
82 if (
$object->type == $object::TYPE_SERVICE) {
86 restrictedArea($user,
'produit|service', $fieldvalue,
'product&product',
'',
'', $fieldtype);
101$reshook = $hookmanager->executeHooks(
'doActions', [], $object, $action);
106if (empty($reshook)) {
108 if ($action ==
'add_prod' && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
112 for ($i = 0; $i < $maxprod; $i++) {
120 if (
$object->error ==
"isFatherOfThis") {
121 setEventMessages($langs->trans(
"ErrorAssociationIsFatherOfThis"),
null,
'errors');
138 header(
"Location: " . $_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id);
141 } elseif ($action ===
'save_composed_product') {
142 $TProduct =
GETPOST(
'TProduct',
'array');
143 if (!empty($TProduct)) {
144 foreach ($TProduct as $id_product => $row) {
145 if ($row[
'qty'] > 0) {
146 $object->update_sousproduit($id, $id_product, $row[
'qty'], isset($row[
'incdec']) ? 1 : 0);
148 $object->del_sousproduit($id, $id_product);
154 header(
"Location: " . $_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id);
169if ($action ==
'search') {
170 $current_lang = $langs->getDefaultLang();
172 $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,';
173 $sql .=
' p.fk_product_type, p.tms as datem, p.tobatch';
174 $sql .=
', p.tosell as status, p.tobuy as status_buy';
176 $sql .=
', pl.label as labelm, pl.description as descriptionm';
179 $parameters = array();
180 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
181 $sql .= $hookmanager->resPrint;
183 $sql .=
' FROM '.MAIN_DB_PREFIX.
'product as p';
184 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'categorie_product as cp ON p.rowid = cp.fk_product';
186 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product_lang as pl ON pl.fk_product = p.rowid AND lang='".
$db->escape($current_lang).
"'";
188 $sql .=
' WHERE p.entity IN ('.getEntity(
'product').
')';
190 $parameters = array();
191 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
192 $sql .= $hookmanager->resPrint;
196 $params = array(
'p.ref',
'p.label',
'p.description',
'p.note');
199 $params[] =
'pl.label';
200 $params[] =
'pl.description';
201 $params[] =
'pl.note';
204 $params[] =
'p.barcode';
208 if (
isModEnabled(
'category') && !empty($parent) && $parent != -1) {
209 $sql .=
" AND cp.fk_categorie ='".$db->escape($parent).
"'";
211 $sql .=
" ORDER BY p.ref ASC";
213 $resql =
$db->query($sql);
216$title = $langs->trans(
'ProductServiceCard');
220 $title = $langs->trans(
'Product').
" ".$shortlabel.
" - ".$langs->trans(
'AssociatedProducts');
221 $help_url =
'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos|DE:Modul_Produkte';
224 $title = $langs->trans(
'Service').
" ".$shortlabel.
" - ".$langs->trans(
'AssociatedProducts');
225 $help_url =
'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Leistungen';
228llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-product page-composition_card');
232$titre = $langs->trans(
"CardProduct".
$object->type);
238if ($id > 0 || !empty($ref)) {
243 $iskit =
$object->hasFatherOrChild(1);
245 if ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire')) {
246 $linkback =
'<a href="'.DOL_URL_ROOT.
'/product/list.php?restore_lastsearch_values=1&type='.
$object->type.
'">'.$langs->trans(
"BackToList").
'</a>';
249 if ($user->socid && !in_array(
'product', explode(
',',
getDolGlobalString(
'MAIN_MODULES_FOR_EXTERNAL')))) {
253 dol_banner_tab($object,
'ref', $linkback, $shownav,
'ref',
'');
256 print
'<div class="fichecenter">';
257 print
'<div class="fichehalfleft">';
258 print
'<div class="underbanner clearboth"></div>';
260 print
'<table class="border centpercent tableforfield">';
264 $typeformat =
'select;0:'.$langs->trans(
"Product").
',1:'.$langs->trans(
"Service");
265 print
'<tr><td class="titlefieldmiddle">';
266 print (!
getDolGlobalString(
'PRODUCT_DENY_CHANGE_PRODUCT_TYPE')) ? $form->editfieldkey(
"Type",
'fk_product_type', (
string)
$object->type, $object, 0, $typeformat) : $langs->trans(
'Type');
268 print $form->editfieldval(
"Type",
'fk_product_type',
$object->type, $object, 0, $typeformat);
274 print
'<tr><td>' . $form->textwithpicto($langs->trans(
"StockableProduct"), $langs->trans(
'StockableProductDescription')) .
'</td>';
277 print
'<input type="checkbox" readonly disabled> <span class="opacitymedium">' . $langs->trans(
"NotSupportedOnKits").
'</span>';
279 print
'<input type="checkbox" readonly disabled '.($object->stockable_product == 1 ?
'checked' :
'').
'>';
283 if (
$object->isStockManaged() && !$iskit) {
285 $warehouse->fetch(
$object->fk_default_warehouse);
287 print
'<tr><td>'.$langs->trans(
"DefaultWarehouse").
'</td><td>';
288 print(!empty($warehouse->id) ? $warehouse->getNomUrl(1) :
'');
295 print
'</div><div class="fichehalfright">';
296 print
'<div class="underbanner clearboth"></div>';
298 print
'<table class="border centpercent tableforfield">';
303 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"NatureOfProductShort"), $langs->trans(
"NatureOfProductDesc")).
'</td><td>';
304 print
$object->getLibFinished();
312 print
'<tr><td class="titlefield">'.$langs->trans(
"SellingPrice").
'</td><td>';
313 if (
$object->price_base_type ==
'TTC') {
321 print
'<tr><td>'.$langs->trans(
"MinPrice").
'</td><td>';
322 if (
$object->price_base_type ==
'TTC') {
337 print
'<div class="clearboth"></div>';
339 print
'<div class="clearboth"></div><br>';
342 $prodsfather =
$object->getFather();
343 $object->get_sousproduits_arbo();
344 $parent_label =
$object->label;
345 $prods_arbo =
$object->get_arbo_each_prod();
348 if (!empty(
$conf->use_javascript_ajax)) {
349 $nboflines = $prods_arbo;
350 $table_element_line =
'product_association';
352 include DOL_DOCUMENT_ROOT .
'/core/tpl/ajaxrow.tpl.php';
356 $nbofsubsubproducts = count($prods_arbo);
357 $prodschild =
$object->getChildsArbo($id, 1);
358 $nbofsubproducts = count($prodschild);
361 print
'<div class="fichecenter">';
365 print
'<table class="liste noborder">';
366 print
'<tr class="liste_titre">';
367 print
'<th>'.$langs->trans(
'ParentProducts').
'</th>';
368 print
'<th>'.$langs->trans(
'Label').
'</th>';
369 print
'<th class="right">'.$langs->trans(
'Qty').
'</th>';
371 if (count($prodsfather) > 0) {
372 foreach ($prodsfather as $value) {
373 $idprod = $value[
"id"];
374 $productstatic->id = $idprod;
375 $productstatic->type = $value[
"fk_product_type"];
376 $productstatic->ref = $value[
'ref'];
377 $productstatic->label = $value[
'label'];
378 $productstatic->entity = $value[
'entity'];
379 $productstatic->status = $value[
'status'];
380 $productstatic->status_buy = $value[
'status_buy'];
382 print
'<tr class="oddeven">';
383 print
'<td>'.$productstatic->getNomUrl(1,
'composition').
'</td>';
384 print
'<td>'.dol_escape_htmltag($productstatic->label).
'</td>';
385 print
'<td class="right">'.dol_escape_htmltag((
string) $value[
'qty']).
'</td>';
389 print
'<tr class="oddeven">';
390 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
400 print
'<div class="fichecenter">';
402 $atleastonenotdefined = 0;
404 $tmpurlforbutton =
'javascript:void(0);';
407 'onclick' =>
'console.log("click to add a product in kit");jQuery(".formtoaddinkit").toggle();return false;',
410 $morehtmlright =
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', $tmpurlforbutton,
'', $usercancreate ? 1 : 0, $newButtonParams);
412 print
load_fiche_titre($langs->trans(
"ProductAssociationList"), $morehtmlright,
'');
416 if ((empty($action) || $action ==
'view' || $action ==
'edit' || $action ==
'search' || $action ==
're-edit') && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
424 print
'<form action="'.DOL_URL_ROOT.
'/product/composition/card.php?id='.
$id.
'" method="POST" class="formtoaddinkit'.($action !=
'search' ?
' hideobject' :
'').
'" name="formtoaddinkit" id="formtoaddinkit">';
425 print
'<input type="hidden" name="token" value="'.newToken().
'">';
426 print
'<input type="hidden" name="action" value="search">';
427 print
'<input type="hidden" name="id" value="'.$id.
'">';
429 print
'<div class="inline-block">';
430 print $langs->trans(
"KeywordFilter").
': ';
431 print
'<input type="text" name="key" value="'.$key.
'"> ';
434 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
435 print
'<div class="inline-block">'.$langs->trans(
"CategoryFilter").
': ';
436 print $form->select_all_categories(Categorie::TYPE_PRODUCT, $parent,
'parent').
' </div>';
439 print
'<div class="inline-block">';
440 print
'<input type="submit" class="button small" value="'.$langs->trans(
"Search").
'">';
441 print
'</div><br><br>';
448 if ($action ==
'search') {
449 print
'<form action="'.DOL_URL_ROOT.
'/product/composition/card.php?id='.
$id.
'" method="post" class="formtoaddinkit">';
450 print
'<input type="hidden" name="token" value="'.newToken().
'">';
451 print
'<input type="hidden" name="action" value="add_prod">';
452 print
'<input type="hidden" name="id" value="'.$id.
'">';
454 print
'<table class="noborder centpercent">';
455 print
'<tr class="liste_titre">';
456 print
'<th class="liste_titre">'.$langs->trans(
"ComposedProduct").
'</td>';
457 print
'<th class="liste_titre">'.$langs->trans(
"Label").
'</td>';
459 print
'<th class="liste_titre right">'.$langs->trans(
"Qty").
'</td>';
460 print
'<th class="center">'.$langs->trans(
'ComposedProductIncDecStock').
'</th>';
465 $num =
$db->num_rows($resql);
468 print
'<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"NoMatchFound").
'</span></td></tr>';
473 while ($i < min($num, $MAX)) {
474 $objp =
$db->fetch_object($resql);
475 if ($objp->rowid != $id) {
478 $prod_arbo->id = $objp->rowid;
481 if ($prod_arbo->type == 2 || $prod_arbo->type == 3) {
483 $prod_arbo->get_sousproduits_arbo();
485 $prods_arbo = $prod_arbo->get_arbo_each_prod();
486 if (count($prods_arbo) > 0) {
487 foreach ($prods_arbo as $key => $value) {
489 if ($value[1] == $id) {
502 print
'<tr class="oddeven">';
504 $productstatic->id = $objp->rowid;
505 $productstatic->ref = $objp->ref;
506 $productstatic->label = $objp->label;
507 $productstatic->type = $objp->type;
508 $productstatic->entity = $objp->entity;
509 $productstatic->status = $objp->status;
510 $productstatic->status_buy = $objp->status_buy;
511 $productstatic->status_batch = $objp->tobatch;
513 print
'<td>'.$productstatic->getNomUrl(1,
'', 24).
'</td>';
514 $labeltoshow = $objp->label;
516 $labeltoshow = $objp->labelm;
519 print
'<td>'.$labeltoshow.
'</td>';
522 if (
$object->is_sousproduit($id, $objp->rowid)) {
524 $qty =
$object->is_sousproduit_qty;
525 $incdec =
$object->is_sousproduit_incdec;
535 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>';
538 print
'<td class="center">';
540 print
'<input type="checkbox" name="prod_incdec_'.$i.
'" value="1" '.($incdec ?
'checked' :
'').
'>';
543 print
'<input type="checkbox" name="prod_incdec_'.$i.
'" value="1" checked>';
553 print
'<tr class="oddeven">';
554 print
'<td><span class="opacitymedium">'.$langs->trans(
"More").
'...</span></td>';
564 print
'<input type="hidden" name="max_prod" value="'.$i.
'">';
567 print
'<div class="center">';
568 print
'<input type="submit" class="button button-save" name="save" value="'.$langs->trans(
"Add").
'/'.$langs->trans(
"Update").
'">';
569 print
'<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
570 print
'</div><br><br>';
578 print
'<form name="formComposedProduct" action="'.$_SERVER[
'PHP_SELF'].
'" method="post">';
579 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
580 print
'<input type="hidden" name="action" value="save_composed_product" />';
581 print
'<input type="hidden" name="id" value="'.$id.
'" />';
583 print
'<div class="div-table-responsive-no-min">';
584 print
'<table id="tablelines" class="ui-sortable liste noborder nobottom">';
586 print
'<tr class="liste_titre nodrag nodrop">';
588 print
'<th>'.$langs->trans(
'Position').
'</th>';
590 print
'<th>'.$langs->trans(
'ComposedProduct').
'</th>';
592 print
'<th>'.$langs->trans(
'Label').
'</th>';
594 print
'<th class="right" colspan="2">'.$langs->trans(
'MinSupplierPrice').
'</th>';
596 print
'<th class="right" colspan="2">'.$langs->trans(
'MinCustomerPrice').
'</th>';
599 print
'<th class="right">'.$langs->trans(
'Stock').
'</th>';
602 $parameters = array();
603 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
604 print $hookmanager->resPrint;
606 print
'<th class="right">'.$langs->trans(
'Qty').
'</th>';
608 print
'<th class="center">'.$langs->trans(
'ComposedProductIncDecStock').
'</th>';
610 print
'<th class="linecolmove" style="width: 10px"></th>';
615 if (count($prods_arbo)) {
616 foreach ($prods_arbo as $value) {
617 $productstatic->fetch($value[
'id']);
619 if ($value[
'level'] <= 1) {
620 print
'<tr id="'.$object->sousprods[$parent_label][$value[
'id']][6].
'" class="drag drop oddeven level1">';
623 print
'<td>'.$object->sousprods[$parent_label][$value[
'id']][7].
'</td>';
626 $nb_of_subproduct = $value[
'nb'];
629 print
'<td>'.$productstatic->getNomUrl(1,
'composition').
'</td>';
632 print
'<td title="'.dol_escape_htmltag($productstatic->label).
'" class="tdoverflowmax150">'.
dol_escape_htmltag($productstatic->label).
'</td>';
635 print
'<td class="right"><span class="small">';
636 if ($product_fourn->find_min_price_product_fournisseur($productstatic->id) > 0) {
637 print $langs->trans(
"BuyingPriceMinShort").
': ';
638 if ($product_fourn->product_fourn_price_id > 0) {
639 print $product_fourn->display_price_product_fournisseur(0, 0);
641 print $langs->trans(
"NotDefined");
643 $atleastonenotdefined++;
650 $fourn_unitprice = (!empty($product_fourn->fourn_unitprice) ? $product_fourn->fourn_unitprice : 0);
651 $fourn_remise_percent = (!empty($product_fourn->fourn_remise_percent) ? $product_fourn->fourn_remise_percent : 0);
652 $fourn_remise = (!empty($product_fourn->fourn_remise) ? $product_fourn->fourn_remise : 0);
654 $unitline =
price2num(($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise),
'MU');
655 $totalline =
price2num($value[
'nb'] * ($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise),
'MT');
656 $total += $totalline;
658 print
'<td class="right nowraponall">';
659 print($notdefined ?
'' : ($value[
'nb'] > 1 ? $value[
'nb'].
'x ' :
'').
'<span class="amount">'.
price($unitline, 0,
'', 0, 0, -1,
$conf->currency)).
'</span>';
663 $pricesell = $productstatic->price;
665 $pricesell =
'Variable';
667 $totallinesell =
price2num($value[
'nb'] * ($pricesell),
'MT');
668 $totalsell += $totallinesell;
670 print
'<td class="right" colspan="2">';
671 print($notdefined ?
'' : ($value[
'nb'] > 1 ? $value[
'nb'].
'x ' :
''));
672 if (is_numeric($pricesell)) {
673 print
'<span class="amount">'.price($pricesell, 0,
'', 0, 0, -1,
$conf->currency).
'</span>';
675 print
'<span class="opacitymedium">'.$langs->trans($pricesell).
'</span>';
681 print
'<td class="right">'.$value[
'stock'].
'</td>';
685 $parameters = array();
686 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $productstatic);
687 print $hookmanager->resPrint;
690 if ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer')) {
691 print
'<td class="center"><input type="text" value="'.$nb_of_subproduct.
'" name="TProduct['.$productstatic->id.
'][qty]" class="right width40" /></td>';
692 print
'<td class="center"><input type="checkbox" name="TProduct['.$productstatic->id.
'][incdec]" value="1" '.($value[
'incdec'] == 1 ?
'checked' :
'').
' /></td>';
694 print
'<td>'.$nb_of_subproduct.
'</td>';
695 print
'<td>'.($value[
'incdec'] == 1 ?
'x' :
'').
'</td>';
699 print
'<td class="linecolmove tdlineupdown center"></td>';
705 $hide =
' hideobject';
708 print
'<tr class="oddeven'.$hide.
'" id="sub-'.$value[
'id_parent'].
'" data-ignoreidfordnd=1>';
711 $productstatic->ref = $value[
'ref'];
718 for ($i = 0; $i < $value[
'level']; $i++) {
719 print
' ';
721 print $productstatic->getNomUrl(1,
'composition');
725 print
'<td>'.dol_escape_htmltag($productstatic->label).
'</td>';
728 print
'<td> </td>';
729 print
'<td> </td>';
731 print
'<td> </td>';
732 print
'<td> </td>';
740 $parameters = array();
741 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $productstatic);
742 print $hookmanager->resPrint;
745 print
'<td class="right">'.dol_escape_htmltag((
string) $value[
'nb']).
'</td>';
748 print
'<td> </td>';
751 print
'<td> </td>';
760 print
'<tr class="liste_total">';
766 print
'<td class="liste_total"></td>';
769 print
'<td class="liste_total"></td>';
772 print
'<td class="liste_total right">';
773 print $langs->trans(
"TotalBuyingPriceMinShort");
776 print
'<td class="liste_total right">';
777 if ($atleastonenotdefined) {
778 print $langs->trans(
"Unknown").
' ('.$langs->trans(
"SomeSubProductHaveNoPrices").
')';
780 print($atleastonenotdefined ?
'' :
price($total, 0,
'', 0, 0, -1,
$conf->currency));
784 print
'<td class="liste_total right">';
785 print $langs->trans(
"TotalSellingPriceMinShort");
788 print
'<td class="liste_total right">';
789 if ($atleastonenotdefined) {
790 print $langs->trans(
"Unknown").
' ('.$langs->trans(
"SomeSubProductHaveNoPrices").
')';
792 print($atleastonenotdefined ?
'' :
price($totalsell, 0,
'', 0, 0, -1,
$conf->currency));
797 print
'<td class="liste_total right"> </td>';
802 print
'<td class="center">';
803 if ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer')) {
804 print
'<input type="submit" class="button button-save" value="'.$langs->trans(
"Save").
'">';
817 print
'<tr class="oddeven">';
818 print
'<td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
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 warehouses.
Class to manage predefined suppliers products.
Class to manage products or services.
const TYPE_PRODUCT
Regular product.
const TYPE_SERVICE
Service.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
isModEnabled($module)
Is Dolibarr module enabled.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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.