28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/bom/class/bom.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/bom/lib/bom.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/mrp/lib/mrp.lib.php';
46$langs->loadLangs(array(
'mrp',
'other'));
52$action =
GETPOST(
'action',
'aZ09');
53$confirm =
GETPOST(
'confirm',
'alpha');
55$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'bomcard';
56$backtopage =
GETPOST(
'backtopage',
'alpha');
67$diroutputmassaction =
$conf->bom->dir_output.
'/temp/massgeneration/'.$user->id;
68$hookmanager->initHooks(array(
'bomcard',
'globalcard'));
71$extrafields->fetch_name_optionals_label(
$object->table_element);
72$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
75$search_all =
GETPOST(
"search_all",
'alpha');
77foreach (
$object->fields as $key => $val) {
78 if (
GETPOST(
'search_'.$key,
'alpha')) {
79 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
83if (empty($action) && empty($id) && empty($ref)) {
88include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
97$isdraft = ((
$object->status == $object::STATUS_DRAFT) ? 1 : 0);
101$permissionnote = $user->hasRight(
'bom',
'write');
102$permissiondellink = $user->hasRight(
'bom',
'write');
103$permissiontoadd = $user->hasRight(
'bom',
'write');
104$permissiontodelete = $user->hasRight(
'bom',
'delete') || ($permissiontoadd && isset(
$object->status) &&
$object->status == $object::STATUS_DRAFT);
112$parameters = array();
113$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
118if (empty($reshook)) {
121 $backurlforlist = DOL_URL_ROOT.
'/bom/bom_list.php';
123 if (empty($backtopage) || ($cancel && empty($id))) {
124 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
125 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
126 $backtopage = $backurlforlist;
128 $backtopage = DOL_URL_ROOT.
'/bom/bom_card.php?id='.(
$id > 0 ?
$id :
'__ID__');
133 $triggermodname =
'BOM_MODIFY';
137 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
140 if ($action ==
'confirm_validate' &&
$object->id > 0) {
145 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
148 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
154 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
157 $triggersendname =
'BOM_SENTBYMAIL';
158 $autocopy =
'MAIN_MAIL_AUTOCOPY_BOM_TO';
159 $trackid =
'bom'.$object->id;
160 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
163 if ($action ==
'addline' && $user->hasRight(
'bom',
'write')) {
164 $langs->load(
'errors');
170 if ($bom_child_id > 0) {
171 $bom_child =
new BOM($db);
172 $res = $bom_child->fetch($bom_child_id);
174 $idprod = $bom_child->fk_product;
182 $disable_stock_change =
GETPOSTINT(
'disable_stock_change');
183 $fk_workstation =
GETPOSTINT(
'idworkstations');
187 $fk_default_workstation = 0;
188 if (!empty($idprod) && isModEnabled(
'workstation')) {
190 $res = $product->fetch($idprod);
192 if ($fk_workstation > 0) {
193 $fk_default_workstation = $fk_workstation;
195 $fk_default_workstation = $product->fk_default_workstation;
198 if (empty($fk_unit)) {
199 $fk_unit = $product->fk_unit;
204 setEventMessages($langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Qty')),
null,
'errors');
207 if (!($idprod > 0)) {
208 setEventMessages($langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Product')),
null,
'errors');
212 if (
$object->fk_product == $idprod) {
213 setEventMessages($langs->trans(
'TheProductXIsAlreadyTheProductToProduce'),
null,
'errors');
218 $TParentBom = array();
219 $object->getParentBomTreeRecursive($TParentBom);
220 if ($bom_child_id > 0 && in_array($bom_child_id, $TParentBom)) {
221 $n_child =
new BOM($db);
222 $n_child->fetch($bom_child_id);
223 setEventMessages($langs->transnoentities(
'BomCantAddChildBom', $n_child->getNomUrl(1),
$object->getNomUrl(1)),
null,
'errors');
229 $extralabelsline = $extrafields->fetch_name_optionals_label(
$object->table_element_line);
230 $array_options = $extrafields->getOptionalsFromPost(
$object->table_element_line, $predef);
232 if (is_array($extralabelsline)) {
234 foreach ($extralabelsline as $key => $value) {
235 unset($_POST[
"options_".$key]);
239 $result =
$object->addLine((
int) $idprod, (
float) $qty, $qty_frozen, $disable_stock_change, (
float) $efficiency, -1, $bom_child_id,
null, (
int) $fk_unit, $array_options, $fk_default_workstation);
245 unset($_POST[
'idprod']);
246 unset($_POST[
'idprodservice']);
247 unset($_POST[
'qty']);
248 unset($_POST[
'qty_frozen']);
249 unset($_POST[
'disable_stock_change']);
259 if ($action ==
'updateline' && $user->hasRight(
'bom',
'write')) {
260 $langs->load(
'errors');
266 $disable_stock_change =
GETPOSTINT(
'disable_stock_change');
271 setEventMessages($langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Qty')),
null,
'errors');
277 $extralabelsline = $extrafields->fetch_name_optionals_label(
$object->table_element_line);
278 $array_options = $extrafields->getOptionalsFromPost(
$object->table_element_line);
280 if (is_array($extralabelsline)) {
282 foreach ($extralabelsline as $key => $value) {
283 unset($_POST[
"options_".$key]);
288 $bomline->fetch($lineid);
290 $fk_default_workstation = $bomline->fk_default_workstation;
291 if (isModEnabled(
'workstation') && GETPOSTISSET(
'idworkstations')) {
292 $fk_default_workstation =
GETPOSTINT(
'idworkstations');
295 $result =
$object->updateLine($lineid, (
float) $qty, (
int) $qty_frozen, (
int) $disable_stock_change, (
float) $efficiency, $bomline->position, $bomline->import_key, $fk_unit, $array_options, $fk_default_workstation);
301 unset($_POST[
'idprod']);
302 unset($_POST[
'idprodservice']);
303 unset($_POST[
'qty']);
304 unset($_POST[
'qty_frozen']);
305 unset($_POST[
'disable_stock_change']);
320$form =
new Form($db);
326 $title = $langs->trans(
'BOM');
328$help_url =
'EN:Module_BOM';
329llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-bom page-card');
332if ($action ==
'create') {
335 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
336 print
'<input type="hidden" name="token" value="'.newToken().
'">';
337 print
'<input type="hidden" name="action" value="add">';
338 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
342 print
'<table class="border centpercent tableforfieldcreate">'.
"\n";
345 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_add.tpl.php';
348 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
350 print
'</table>'.
"\n";
354 print $form->buttonsSaveCancel(
"Create");
360if (($id || $ref) && $action ==
'edit') {
363 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
364 print
'<input type="hidden" name="token" value="'.newToken().
'">';
365 print
'<input type="hidden" name="action" value="update">';
366 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
367 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
373 print
'<table class="border centpercent tableforfieldedit">'.
"\n";
376 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_edit.tpl.php';
379 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
385 print $form->buttonsSaveCancel(
"Update");
391if (
$object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
398 if ($action ==
'delete') {
399 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'DeleteBillOfMaterials'), $langs->trans(
'ConfirmDeleteBillOfMaterials'),
'confirm_delete',
'', 0, 1);
402 if ($action ==
'deleteline') {
403 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
407 if ($action ==
'validate') {
409 $ref = substr(
$object->ref, 1, 4);
410 if ($ref ==
'PROV') {
417 $text = $langs->trans(
'ConfirmValidateBom', $numref);
426 $formquestion = array();
427 if (isModEnabled(
'bom')) {
429 $formquestion = array(
436 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'Validate'), $text,
'confirm_validate', $formquestion, 0, 1, 220);
440 if ($action ==
'close') {
441 $text = $langs->trans(
'ConfirmCloseBom',
$object->ref);
450 $formquestion = array();
451 if (isModEnabled(
'bom')) {
453 $formquestion = array(
460 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'Close'), $text,
'confirm_close', $formquestion, 0, 1, 220);
464 if ($action ==
'reopen') {
465 $text = $langs->trans(
'ConfirmReopenBom',
$object->ref);
474 $formquestion = array();
475 if (isModEnabled(
'bom')) {
477 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
478 $formquestion = array(
485 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ReOpen'), $text,
'confirm_reopen', $formquestion, 0, 1, 220);
489 if ($action ==
'clone') {
491 $formquestion = array();
492 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneBillOfMaterials',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1);
496 if ($action ==
'setdraft') {
497 $text = $langs->trans(
'ConfirmSetToDraft',
$object->ref);
499 $formquestion = array();
500 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'SetToDraft'), $text,
'confirm_setdraft', $formquestion, 0, 1, 220);
504 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
505 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
506 if (empty($reshook)) {
507 $formconfirm .= $hookmanager->resPrint;
508 } elseif ($reshook > 0) {
509 $formconfirm = $hookmanager->resPrint;
518 $linkback =
'<a href="'.DOL_URL_ROOT.
'/bom/bom_list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
520 $morehtmlref =
'<div class="refidno">';
558 $morehtmlref .=
'</div>';
561 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
564 print
'<div class="fichecenter">';
565 print
'<div class="fichehalfleft">';
566 print
'<div class="underbanner clearboth"></div>';
567 print
'<table class="border centpercent tableforfield">'.
"\n";
570 $keyforbreak =
'duration';
571 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
574 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"ManufacturingCost"), $langs->trans(
"BOMTotalCost")).
'</td><td><span class="amount">';
578 print
' <span class="opacitymedium">('.$form->textwithpicto(
price(
$object->unit_cost), $langs->trans(
"ManufacturingUnitCost"), 1,
'help',
'').
')</span>';
584 $manufacturedvalued =
'';
585 if (!empty(
$object->product)) {
586 $tmparray =
$object->product->getSellPrice($mysoc, $mysoc);
587 $manufacturedvalued = $tmparray[
'pu_ht'] *
$object->qty;
589 print
'<tr><td>'.$langs->trans(
"ManufacturingGeneratedValue").
'</td><td><span class="amount">'.
price($manufacturedvalued).
'</span></td></tr>';
592 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
598 print
'<div class="clearboth"></div>';
608 if (!empty(
$object->table_element_line)) {
611 $res =
$object->fetchLinesbytypeproduct(0);
614 print ($res == 0 &&
$object->status >= $object::STATUS_VALIDATED) ?
'' :
load_fiche_titre($langs->trans(
'BOMProductsList'),
'',
'product');
616 print
' <form name="addproduct" id="listbomproducts" action="' . $_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id .
'" method="POST">
617 <input type="hidden" name="token" value="' .
newToken() .
'">
618 <input type="hidden" name="action" value="' . (($action !=
'editline') ?
'addline' :
'updateline') .
'">
619 <input type="hidden" name="mode" value="">
620 <input type="hidden" name="page_y" value="">
621 <input type="hidden" name="id" value="' .
$object->id .
'">
624 if (!empty(
$conf->use_javascript_ajax) &&
$object->status == 0) {
625 include DOL_DOCUMENT_ROOT.
'/core/tpl/ajaxrow.tpl.php';
628 print
'<div class="div-table-responsive-no-min">';
629 if (!empty(
$object->lines) || (
$object->status == $object::STATUS_DRAFT && $permissiontoadd && $action !=
'selectlines' && $action !=
'editline')) {
630 print
'<table id="tablelines" class="noborder noshadow centpercent">';
634 $object->printObjectLines($action, $mysoc,
null,
GETPOSTINT(
'lineid'), 1,
'/bom/tpl');
638 if (
$object->status == 0 && $permissiontoadd && $action !=
'selectlines') {
639 if ($action !=
'editline') {
643 $parameters = array();
644 $reshook = $hookmanager->executeHooks(
'formAddObjectLine', $parameters, $object, $action);
648 if (empty($reshook)) {
649 $object->formAddObjectLine(1, $mysoc,
null,
'/bom/tpl');
654 if (!empty(
$object->lines) || (
$object->status == $object::STATUS_DRAFT && $permissiontoadd && $action !=
'selectlines' && $action !=
'editline')) {
665 $res =
$object->fetchLinesbytypeproduct($filtertype);
668 print ($res == 0 &&
$object->status >= $object::STATUS_VALIDATED) ?
'' :
load_fiche_titre($langs->trans(
'BOMServicesList'),
'',
'service');
670 print
' <form name="addservice" id="listbomservices" action="' . $_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id .
'" method="POST">
671 <input type="hidden" name="token" value="' .
newToken() .
'">
672 <input type="hidden" name="action" value="' . (($action !=
'editline') ?
'addline' :
'updateline') .
'">
673 <input type="hidden" name="mode" value="">
674 <input type="hidden" name="page_y" value=""> <input type="hidden" name="id" value="' .
$object->id .
'">
677 if (!empty(
$conf->use_javascript_ajax) &&
$object->status == 0) {
678 $tagidfortablednd =
'tablelinesservice';
679 include DOL_DOCUMENT_ROOT .
'/core/tpl/ajaxrow.tpl.php';
682 print
'<div class="div-table-responsive-no-min">';
683 if (!empty(
$object->lines) || (
$object->status == $object::STATUS_DRAFT && $permissiontoadd && $action !=
'selectlines' && $action !=
'editline')) {
684 print
'<table id="tablelinesservice" class="noborder noshadow centpercent">';
688 $object->printObjectLines($action, $mysoc,
null,
GETPOSTINT(
'lineid'), 1,
'/bom/tpl');
692 if (
$object->status == 0 && $permissiontoadd && $action !=
'selectlines') {
693 if ($action !=
'editline') {
695 $parameters = array();
696 $reshook = $hookmanager->executeHooks(
'formAddObjectServiceLine', $parameters, $object, $action);
700 if (empty($reshook)) {
701 $object->formAddObjectLine(1, $mysoc,
null,
'/bom/tpl');
707 if (!empty(
$object->lines) || (
$object->status == $object::STATUS_DRAFT && $permissiontoadd && $action !=
'selectlines' && $action !=
'editline')) {
722 if ($action !=
'presend' && $action !=
'editline') {
723 print
'<div class="tabsAction">'.
"\n";
724 $parameters = array();
725 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
730 if (empty($reshook)) {
737 if (
$object->status == $object::STATUS_VALIDATED) {
738 if ($permissiontoadd) {
739 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=setdraft&token='.
newToken().
'">'.$langs->trans(
"SetToDraft").
'</a>'.
"\n";
744 if (
$object->status == $object::STATUS_DRAFT) {
745 if ($permissiontoadd) {
746 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
748 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
'Modify').
'</a>'.
"\n";
753 if (
$object->status == $object::STATUS_DRAFT) {
754 if ($permissiontoadd) {
756 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=validate&token='.
newToken().
'">'.$langs->trans(
"Validate").
'</a>'.
"\n";
758 $langs->load(
"errors");
759 print
'<a class="butActionRefused classfortooltip" href="" title="'.$langs->trans(
"ErrorAddAtLeastOneLineFirst").
'">'.$langs->trans(
"Validate").
'</a>'.
"\n";
765 if ($permissiontoadd &&
$object->status == $object::STATUS_CANCELED) {
766 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=reopen&token='.
newToken().
'">'.$langs->trans(
"ReOpen").
'</a>'.
"\n";
770 if (isModEnabled(
'mrp')) {
771 if (
$object->status == $object::STATUS_VALIDATED && $user->hasRight(
'mrp',
'write')) {
772 print
'<a class="butAction" href="'.DOL_URL_ROOT.
'/mrp/mo_card.php?action=create&fk_bom='.
$object->id.
'&token='.
newToken().
'&backtopageforcancel='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id).
'">'.$langs->trans(
"CreateMO").
'</a>'.
"\n";
777 if ($permissiontoadd) {
778 print
dolGetButtonAction($langs->trans(
"ToClone"),
'',
'default', $_SERVER[
'PHP_SELF'].
'?id='.
$object->id.(!empty(
$object->socid) ?
'&socid='.$object->socid :
"").
'&action=clone&object=bom',
'clone', $permissiontoadd);
782 if ($permissiontoadd &&
$object->status == $object::STATUS_VALIDATED) {
783 print
'<a class="butActionDelete" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=close&token='.
newToken().
'">'.$langs->trans(
"Disable").
'</a>'.
"\n";
797 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken(),
'delete', $permissiontodelete);
804 if (
GETPOST(
'modelselected')) {
808 if ($action !=
'presend') {
809 print
'<div class="fichecenter"><div class="fichehalfleft">';
810 print
'<a name="builddoc"></a>';
814 $relativepath = $objref.
'/'.$objref.
'.pdf';
815 $filedir =
$conf->bom->dir_output.
'/'.$objref;
816 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
817 $genallowed = $user->hasRight(
'bom',
'read');
818 $delallowed = $user->hasRight(
'bom',
'write');
819 print $formfile->showdocuments(
'bom', $objref, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $langs->defaultlang,
'', $object);
822 $tmparray = $form->showLinkToObjectBlock($object, array(), array(
'bom'), 1);
823 $linktoelem = $tmparray[
'linktoelem'];
824 $htmltoenteralink = $tmparray[
'htmltoenteralink'];
825 print $htmltoenteralink;
827 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
830 print
'</div><div class="fichehalfright">';
834 $morehtmlcenter =
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/bom/bom_agenda.php?id='.
$object->id);
837 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
839 $somethingshown = $formactions->showactions($object,
$object->element, 0, 1,
'', $MAXEVENT,
'', $morehtmlcenter);
841 print
'</div></div>';
845 if (
GETPOST(
'modelselected')) {
851 $defaulttopic =
'InformationMessage';
852 $diroutput =
$conf->bom->dir_output;
853 $trackid =
'bom'.$object->id;
855 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
$id
Support class for third parties, contacts, members, users or resources.
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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.
mrpCollapseBomManagement()
Manage collapse bom display.
bomPrepareHead($object)
Prepare array of tabs for BillOfMaterials.
Class to manage products or services.
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, $morecssdiv='')
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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.
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.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.