26 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/bom/class/bom.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/bom/lib/bom.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/mrp/lib/mrp.lib.php';
35 $langs->loadLangs(array(
'mrp',
'other'));
39 $lineid =
GETPOST(
'lineid',
'int');
41 $action =
GETPOST(
'action',
'aZ09');
42 $confirm =
GETPOST(
'confirm',
'alpha');
43 $cancel =
GETPOST(
'cancel',
'aZ09');
44 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'bomcard';
45 $backtopage =
GETPOST(
'backtopage',
'alpha');
49 $hidedetails = (
GETPOST(
'hidedetails',
'int') ?
GETPOST(
'hidedetails',
'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
50 $hidedesc = (
GETPOST(
'hidedesc',
'int') ?
GETPOST(
'hidedesc',
'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0));
51 $hideref = (
GETPOST(
'hideref',
'int') ?
GETPOST(
'hideref',
'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
54 $object =
new BOM($db);
56 $diroutputmassaction = $conf->bom->dir_output.
'/temp/massgeneration/'.$user->id;
57 $hookmanager->initHooks(array(
'bomcard',
'globalcard'));
60 $extrafields->fetch_name_optionals_label($object->table_element);
61 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
64 $search_all =
GETPOST(
"search_all",
'alpha');
66 foreach ($object->fields as $key => $val) {
67 if (
GETPOST(
'search_'.$key,
'alpha')) {
68 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
72 if (empty($action) && empty($id) && empty($ref)) {
77 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
78 if ($object->id > 0) {
79 $object->calculateCosts();
86 $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
87 $result =
restrictedArea($user,
'bom', $object->id,
'bom_bom',
'',
'',
'rowid', $isdraft);
90 $permissionnote = $user->rights->bom->write;
91 $permissiondellink = $user->rights->bom->write;
92 $permissiontoadd = $user->rights->bom->write;
93 $permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
94 $upload_dir = $conf->bom->multidir_output[isset($object->entity) ? $object->entity : 1];
101 $parameters = array();
102 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
107 if (empty($reshook)) {
110 $backurlforlist = DOL_URL_ROOT.
'/bom/bom_list.php';
112 if (empty($backtopage) || ($cancel && empty($id))) {
113 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
114 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
115 $backtopage = $backurlforlist;
117 $backtopage = DOL_URL_ROOT.
'/bom/bom_card.php?id='.($id > 0 ? $id :
'__ID__');
122 $triggermodname =
'BOM_MODIFY';
126 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
128 if ($action ==
'confirm_validate' && $object->id > 0) {
129 $object->calculateCosts();
133 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
136 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
142 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
145 $triggersendname =
'BOM_SENTBYMAIL';
146 $autocopy =
'MAIN_MAIL_AUTOCOPY_BOM_TO';
147 $trackid =
'bom'.$object->id;
148 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
151 if ($action ==
'addline' && $user->rights->bom->write) {
152 $langs->load(
'errors');
157 $bom_child_id = (int)
GETPOST(
'bom_id',
'int');
158 if ($bom_child_id > 0) {
159 $bom_child =
new BOM($db);
160 $res = $bom_child->fetch($bom_child_id);
162 $idprod = $bom_child->fk_product;
165 $idprod = (!empty(
GETPOST(
'idprodservice',
'int')) ?
GETPOST(
'idprodservice',
'int') : (int)
GETPOST(
'idprod',
'int'));
170 $disable_stock_change =
GETPOST(
'disable_stock_change',
'int');
172 $fk_unit =
GETPOST(
'fk_unit',
'alphanohtml');
174 setEventMessages($langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Qty')),
null,
'errors');
177 if (!($idprod > 0)) {
178 setEventMessages($langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Product')),
null,
'errors');
182 if ($object->fk_product == $idprod) {
183 setEventMessages($langs->trans(
'TheProductXIsAlreadyTheProductToProduce'),
null,
'errors');
189 $object->getParentBomTreeRecursive($TParentBom);
190 if ($bom_child_id > 0 && !empty($TParentBom) && in_array($bom_child_id, $TParentBom)) {
191 $n_child =
new BOM($db);
192 $n_child->fetch($bom_child_id);
193 setEventMessages($langs->transnoentities(
'BomCantAddChildBom', $n_child->getNomUrl(1), $object->getNomUrl(1)),
null,
'errors');
199 $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
200 $array_options = $extrafields->getOptionalsFromPost($object->table_element_line, $predef);
202 if (is_array($extralabelsline)) {
204 foreach ($extralabelsline as $key => $value) {
205 unset($_POST[
"options_".$key]);
209 $result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id,
null, $fk_unit, $array_options);
215 unset($_POST[
'idprod']);
216 unset($_POST[
'idprodservice']);
217 unset($_POST[
'qty']);
218 unset($_POST[
'qty_frozen']);
219 unset($_POST[
'disable_stock_change']);
222 $object->fetchLines();
224 $object->calculateCosts();
229 if ($action ==
'updateline' && $user->rights->bom->write) {
230 $langs->load(
'errors');
236 $disable_stock_change =
GETPOST(
'disable_stock_change',
'int');
238 $fk_unit =
GETPOST(
'fk_unit',
'alphanohtml');
241 setEventMessages($langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Qty')),
null,
'errors');
247 $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
248 $array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
250 if (is_array($extralabelsline)) {
252 foreach ($extralabelsline as $key => $value) {
253 unset($_POST[
"options_".$key]);
258 $bomline->fetch($lineid);
260 $result = $object->updateLine($lineid, $qty, (
int) $qty_frozen, (
int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key, $fk_unit, $array_options);
266 unset($_POST[
'idprod']);
267 unset($_POST[
'idprodservice']);
268 unset($_POST[
'qty']);
269 unset($_POST[
'qty_frozen']);
270 unset($_POST[
'disable_stock_change']);
273 $object->fetchLines();
275 $object->calculateCosts();
289 $title = $langs->trans(
'BOM');
294 if ($action ==
'create') {
297 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
298 print
'<input type="hidden" name="token" value="'.newToken().
'">';
299 print
'<input type="hidden" name="action" value="add">';
300 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
304 print
'<table class="border centpercent tableforfieldcreate">'.
"\n";
307 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_add.tpl.php';
310 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
312 print
'</table>'.
"\n";
316 print
$form->buttonsSaveCancel(
"Create");
322 if (($id || $ref) && $action ==
'edit') {
325 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
326 print
'<input type="hidden" name="token" value="'.newToken().
'">';
327 print
'<input type="hidden" name="action" value="update">';
328 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
329 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
335 print
'<table class="border centpercent tableforfieldedit">'.
"\n";
338 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_edit.tpl.php';
341 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
347 print
$form->buttonsSaveCancel(
"Create");
353 if ($object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
360 if ($action ==
'delete') {
361 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'DeleteBillOfMaterials'), $langs->trans(
'ConfirmDeleteBillOfMaterials'),
'confirm_delete',
'', 0, 1);
364 if ($action ==
'deleteline') {
365 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
369 if ($action ==
'validate') {
371 $ref = substr($object->ref, 1, 4);
372 if ($ref ==
'PROV') {
373 $object->fetch_product();
374 $numref = $object->getNextNumRef($object->product);
376 $numref = $object->ref;
379 $text = $langs->trans(
'ConfirmValidateBom', $numref);
388 $formquestion = array();
392 if ($conf->browser->name ==
'ie') {
395 $formquestion = array(
402 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'Validate'), $text,
'confirm_validate', $formquestion, 0, 1, 220);
406 if ($action ==
'close') {
407 $text = $langs->trans(
'ConfirmCloseBom', $object->ref);
416 $formquestion = array();
420 if ($conf->browser->name ==
'ie') {
423 $formquestion = array(
430 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'Close'), $text,
'confirm_close', $formquestion, 0, 1, 220);
434 if ($action ==
'reopen') {
435 $text = $langs->trans(
'ConfirmReopenBom', $object->ref);
444 $formquestion = array();
447 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
449 if ($conf->browser->name ==
'ie') {
452 $formquestion = array(
459 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'ReOpen'), $text,
'confirm_reopen', $formquestion, 0, 1, 220);
463 if ($action ==
'clone') {
465 $formquestion = array();
466 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneBillOfMaterials', $object->ref),
'confirm_clone', $formquestion,
'yes', 1);
470 if ($action ==
'setdraft') {
471 $text = $langs->trans(
'ConfirmSetToDraft', $object->ref);
473 $formquestion = array();
474 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'SetToDraft'), $text,
'confirm_setdraft', $formquestion, 0, 1, 220);
478 $parameters = array(
'formConfirm' =>
$formconfirm,
'lineid' => $lineid);
479 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
480 if (empty($reshook)) {
482 } elseif ($reshook > 0) {
492 $linkback =
'<a href="'.DOL_URL_ROOT.
'/bom/bom_list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
494 $morehtmlref =
'<div class="refidno">';
532 $morehtmlref .=
'</div>';
535 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
538 print
'<div class="fichecenter">';
539 print
'<div class="fichehalfleft">';
540 print
'<div class="underbanner clearboth"></div>';
541 print
'<table class="border centpercent tableforfield">'.
"\n";
544 $keyforbreak =
'duration';
545 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
546 $object->calculateCosts();
547 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"TotalCost"), $langs->trans(
"BOMTotalCost")).
'</td><td><span class="amount">'.
price($object->total_cost).
'</span></td></tr>';
548 print
'<tr><td>'.$langs->trans(
"UnitCost").
'</td><td>'.
price($object->unit_cost).
'</td></tr>';
551 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
557 print
'<div class="clearboth"></div>';
567 if (!empty($object->table_element_line)) {
569 $res = $object->fetchLinesbytypeproduct(0);
570 $object->calculateCosts();
572 print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ?
'' :
load_fiche_titre($langs->trans(
'BOMProductsList'),
'',
'product');
574 print
' <form name="addproduct" id="addproduct" action="' . $_SERVER[
"PHP_SELF"] .
'?id=' . $object->id . (($action !=
'editline') ?
'' :
'') .
'" method="POST">
575 <input type="hidden" name="token" value="' .
newToken() .
'">
576 <input type="hidden" name="action" value="' . (($action !=
'editline') ?
'addline' :
'updateline') .
'">
577 <input type="hidden" name="mode" value="">
578 <input type="hidden" name="page_y" value="">
579 <input type="hidden" name="id" value="' . $object->id .
'">
582 if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
583 include DOL_DOCUMENT_ROOT.
'/core/tpl/ajaxrow.tpl.php';
586 print
'<div class="div-table-responsive-no-min">';
587 if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action !=
'selectlines' && $action !=
'editline')) {
588 print
'<table id="tablelines" class="noborder noshadow" width="100%">';
591 if (!empty($object->lines)) {
592 $object->printObjectLines($action, $mysoc,
null,
GETPOST(
'lineid',
'int'), 1,
'/bom/tpl');
596 if ($object->status == 0 && $permissiontoadd && $action !=
'selectlines') {
597 if ($action !=
'editline') {
601 $parameters = array();
602 $reshook = $hookmanager->executeHooks(
'formAddObjectLine', $parameters, $object, $action);
603 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
605 $object->formAddObjectLine(1, $mysoc,
null,
'/bom/tpl');
609 if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action !=
'selectlines' && $action !=
'editline')) {
621 $res = $object->fetchLinesbytypeproduct(1);
622 $object->calculateCosts();
624 print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ?
'' :
load_fiche_titre($langs->trans(
'BOMServicesList'),
'',
'service');
626 print
' <form name="addservice" id="addservice" action="' . $_SERVER[
"PHP_SELF"] .
'?id=' . $object->id . (($action !=
'editline') ?
'' :
'') .
'" method="POST">
627 <input type="hidden" name="token" value="' .
newToken() .
'">
628 <input type="hidden" name="action" value="' . (($action !=
'editline') ?
'addline' :
'updateline') .
'">
629 <input type="hidden" name="mode" value="">
630 <input type="hidden" name="page_y" value=""> <input type="hidden" name="id" value="' . $object->id .
'">
633 if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
634 $tagidfortablednd =
'tablelinesservice';
635 include DOL_DOCUMENT_ROOT .
'/core/tpl/ajaxrow.tpl.php';
638 print
'<div class="div-table-responsive-no-min">';
639 if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action !=
'selectlines' && $action !=
'editline')) {
640 print
'<table id="tablelinesservice" class="noborder noshadow" width="100%">';
643 if (!empty($object->lines)) {
644 $object->printObjectLines($action, $mysoc,
null,
GETPOST(
'lineid',
'int'), 1,
'/bom/tpl');
648 if ($object->status == 0 && $permissiontoadd && $action !=
'selectlines') {
649 if ($action !=
'editline') {
651 $parameters = array();
652 $reshook = $hookmanager->executeHooks(
'formAddObjectServiceLine', $parameters, $object, $action);
653 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
655 $object->formAddObjectLine(1, $mysoc,
null,
'/bom/tpl');
660 if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action !=
'selectlines' && $action !=
'editline')) {
670 $res = $object->fetchLines();
674 if ($action !=
'presend' && $action !=
'editline') {
675 print
'<div class="tabsAction">'.
"\n";
676 $parameters = array();
677 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
682 if (empty($reshook)) {
689 if ($object->status == $object::STATUS_VALIDATED) {
690 if ($permissiontoadd) {
691 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&action=setdraft&token='.
newToken().
'">'.$langs->trans(
"SetToDraft").
'</a>'.
"\n";
696 if ($object->status == $object::STATUS_DRAFT) {
697 if ($permissiontoadd) {
698 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
700 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
'Modify').
'</a>'.
"\n";
705 if ($object->status == $object::STATUS_DRAFT) {
706 if ($permissiontoadd) {
707 if (is_array($object->lines) && count($object->lines) > 0) {
708 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&action=validate&token='.
newToken().
'">'.$langs->trans(
"Validate").
'</a>'.
"\n";
710 $langs->load(
"errors");
711 print
'<a class="butActionRefused" href="" title="'.$langs->trans(
"ErrorAddAtLeastOneLineFirst").
'">'.$langs->trans(
"Validate").
'</a>'.
"\n";
717 if ($permissiontoadd && $object->status == $object::STATUS_CANCELED) {
718 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&action=reopen&token='.
newToken().
'">'.$langs->trans(
"ReOpen").
'</a>'.
"\n";
723 if ($object->status == $object::STATUS_VALIDATED && !empty($user->rights->mrp->write)) {
724 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";
729 if ($permissiontoadd) {
730 print
dolGetButtonAction($langs->trans(
"ToClone"),
'',
'default', $_SERVER[
'PHP_SELF'].
'?id='.$object->id.(!empty($object->socid) ?
'&socid='.$object->socid :
"").
'&action=clone&object=bom',
'clone', $permissiontoadd);
734 if ($permissiontoadd && $object->status == $object::STATUS_VALIDATED) {
735 print
'<a class="butActionDelete" href="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&action=close&token='.
newToken().
'">'.$langs->trans(
"Disable").
'</a>'.
"\n";
753 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=delete&token='.
newToken(),
'delete', $permissiontodelete);
760 if (
GETPOST(
'modelselected')) {
764 if ($action !=
'presend') {
765 print
'<div class="fichecenter"><div class="fichehalfleft">';
766 print
'<a name="builddoc"></a>';
770 $relativepath = $objref.
'/'.$objref.
'.pdf';
771 $filedir = $conf->bom->dir_output.
'/'.$objref;
772 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".$object->id;
773 $genallowed = $user->rights->bom->read;
774 $delallowed = $user->rights->bom->write;
775 print $formfile->showdocuments(
'bom', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $langs->defaultlang);
778 $linktoelem =
$form->showLinkToObjectBlock($object,
null, array(
'bom'));
779 $somethingshown =
$form->showLinkedObjectBlock($object, $linktoelem);
782 print
'</div><div class="fichehalfright">';
786 $morehtmlcenter =
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/bom/bom_agenda.php?id='.$object->id);
789 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
791 $somethingshown =
$formactions->showactions($object, $object->element, 0, 1,
'', $MAXEVENT,
'', $morehtmlcenter);
793 print
'</div></div>';
797 if (
GETPOST(
'modelselected')) {
803 $defaulttopic =
'InformationMessage';
804 $diroutput = $conf->bom->dir_output;
805 $trackid =
'bom'.$object->id;
807 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.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(preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) if(preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) if($action=='set') elseif($action=='specimen') elseif($action=='setmodel') elseif($action=='del') elseif($action=='setdoc') $formactions
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
mrpCollapseBomManagement()
Manage collapse bom display.
bomPrepareHead($object)
Prepare array of tabs for BillOfMaterials.
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.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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)
Clean a string to use it as a file name.
isModEnabled($module)
Is Dolibarr module enabled.
$formconfirm
if ($action == 'delbookkeepingyear') {
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.