27require
'../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.
'/core/class/html.formprojet.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/mrp/class/mo.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/mrp/lib/mrp_mo.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/bom/class/bom.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/bom/lib/bom.lib.php';
38if (isModEnabled(
'workstation')) {
39 require_once DOL_DOCUMENT_ROOT.
'/workstation/class/workstation.class.php';
44$langs->loadLangs(array(
'mrp',
'other'));
50$action =
GETPOST(
'action',
'aZ09');
51$confirm =
GETPOST(
'confirm',
'alpha');
52$cancel =
GETPOST(
'cancel',
'aZ09');
53$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'mocard';
54$backtopage =
GETPOST(
'backtopage',
'alpha');
55$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
56$TBomLineId =
GETPOST(
'bomlineid',
'array');
62$objectbom =
new BOM($db);
65$diroutputmassaction = $conf->mrp->dir_output.
'/temp/massgeneration/'.$user->id;
66$hookmanager->initHooks(array(
'mocard',
'globalcard'));
69$extrafields->fetch_name_optionals_label(
$object->table_element);
71$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
74$search_all =
GETPOST(
"search_all",
'alpha');
76foreach (
$object->fields as $key => $val) {
77 if (
GETPOST(
'search_'.$key,
'alpha')) {
78 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
82if (empty($action) && empty($id) && empty($ref)) {
87include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
92 if ($action !=
'add') {
94 $_POST[
'fk_product'] = $objectbom->fk_product;
95 $_POST[
'qty'] = $objectbom->qty;
96 $_POST[
'mrptype'] = $objectbom->bomtype;
97 $_POST[
'fk_warehouse'] = $objectbom->fk_warehouse;
98 $_POST[
'note_private'] = $objectbom->note_private;
105$isdraft = ((
$object->status == $object::STATUS_DRAFT) ? 1 : 0);
109$permissionnote = $user->hasRight(
'mrp',
'write');
110$permissiondellink = $user->hasRight(
'mrp',
'write');
111$permissiontoadd = $user->hasRight(
'mrp',
'write');
112$permissiontodelete = $user->hasRight(
'mrp',
'delete') || ($permissiontoadd && isset(
$object->status) &&
$object->status == $object::STATUS_DRAFT);
113$upload_dir = $conf->mrp->multidir_output[isset(
$object->entity) ?
$object->entity : 1];
120$parameters = array();
121$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
126if (empty($reshook)) {
133 if (empty($backtopage) || ($cancel && empty($id))) {
134 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
135 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
136 $backtopage = $backurlforlist;
138 $backtopage = DOL_URL_ROOT.
'/mrp/mo_card.php?id='.($id > 0 ? $id :
'__ID__');
142 if ($cancel && !empty($backtopageforcancel)) {
143 $backtopage = $backtopageforcancel;
145 $triggermodname =
'MO_MODIFY';
148 if ($action ==
'add' && empty($id) && !empty($TBomLineId)) {
150 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
154 $moline =
new MoLine($db);
155 $objectbomchildline =
new BOMLine($db);
157 foreach ($TBomLineId as $id_bom_line) {
160 $objectbomchildline->fetch($id_bom_line);
162 $TMoLines = $moline->fetchAll(
'DESC',
'rowid',
'1',
'', array(
'origin_id' => $id_bom_line));
164 foreach ($TMoLines as $tmpmoline) {
165 $_POST[
'fk_bom'] = $objectbomchildline->fk_bom_child;
166 $_POST[
'fk_parent_line'] = $tmpmoline->id;
167 $_POST[
'qty'] = $tmpmoline->qty;
168 $_POST[
'fk_product'] = $tmpmoline->fk_product;
171 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
173 $res =
$object->add_object_linked(
'mo', $mo_parent->id);
176 header(
"Location: ".
dol_buildpath(
'/mrp/mo_card.php?id='.((
int) $mo_parent->id), 1));
178 } elseif ($action ==
'confirm_cancel' && $confirm ==
'yes' && !empty($permissiontoadd)) {
179 $also_cancel_consumed_and_produced_lines = (
GETPOST(
'alsoCancelConsumedAndProducedLines',
'alpha') ? 1 : 0);
180 $result =
$object->cancel($user, 0, $also_cancel_consumed_and_produced_lines);
188 } elseif ($action ==
'confirm_delete' && $confirm ==
'yes' && !empty($permissiontodelete)) {
189 $also_cancel_consumed_and_produced_lines = (
GETPOST(
'alsoCancelConsumedAndProducedLines',
'alpha') ? 1 : 0);
190 $result =
$object->delete($user, 0, $also_cancel_consumed_and_produced_lines);
192 header(
"Location: " . $backurlforlist);
200 if ($action ==
'confirm_delete' && !empty($permissiontodelete)) {
202 dol_print_error(
null,
'Error, object must be fetched before being deleted');
207 $deleteChilds =
GETPOST(
'deletechilds',
'aZ');
212 if ($deleteChilds ===
'on') {
213 $TMoChildren =
$object->getAllMoChilds();
215 foreach ($TMoChildren as $id => $childObject) {
216 if ($childObject->delete($user) == -1) {
218 if (!empty($childObject->errors)) {
228 $result =
$object->delete($user);
233 if ($deleteChilds ===
'on') {
237 if (empty($noback)) {
238 header(
"Location: " . $backurlforlist);
261 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
264 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
267 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
270 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
272 if ($action ==
'set_thirdparty' && $permissiontoadd) {
273 $object->setValueFrom(
'fk_soc',
GETPOSTINT(
'fk_soc'),
'',
'',
'date',
'', $user, $triggermodname);
275 if ($action ==
'classin' && $permissiontoadd) {
280 $triggersendname =
'MO_SENTBYMAIL';
281 $autocopy =
'MAIN_MAIL_AUTOCOPY_MO_TO';
282 $trackid =
'mo'.$object->id;
283 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
289 if ($action ==
'confirm_produced' && $confirm ==
'yes' && $permissiontoadd) {
290 $result =
$object->setStatut($object::STATUS_PRODUCED, 0,
'',
'MRP_MO_PRODUCED');
294 $outputlangs = $langs;
297 $newlang =
GETPOST(
'lang_id',
'aZ09');
300 $newlang =
$object->thirdparty->default_lang;
302 if (!empty($newlang)) {
304 $outputlangs->setDefaultLang($newlang);
309 $object->generateDocument($model, $outputlangs, 0, 0, 0);
324$form =
new Form($db);
328$title = $langs->trans(
'ManufacturingOrder').
" - ".$langs->trans(
"Card");
335if ($action ==
'create') {
337 $titlelist = $langs->trans(
"ToConsume");
338 if ($objectbom->bomtype == 1) {
339 $titlelist = $langs->trans(
"ToObtain");
343 print
load_fiche_titre($langs->trans(
"NewObject", $langs->transnoentitiesnoconv(
"Mo")),
'',
'mrp');
345 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
346 print
'<input type="hidden" name="token" value="'.newToken().
'">';
347 print
'<input type="hidden" name="action" value="add">';
349 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
351 if ($backtopageforcancel) {
352 print
'<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.
'">';
357 print
'<table class="border centpercent tableforfieldcreate">'.
"\n";
360 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_add.tpl.php';
363 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
365 print
'</table>'.
"\n";
371 $(document).ready(
function () {
372 jQuery(
'#fk_bom').change(
function() {
373 console.log(
'We change value of BOM with BOM of id '+jQuery(
'#fk_bom').val());
374 if (jQuery(
'#fk_bom').val() > 0)
377 window.location.href =
'<?php echo $_SERVER["PHP_SELF"] ?>?action=create&token=<?php echo newToken(); ?>&fk_bom='+jQuery(
'#fk_bom').val();
406 else if (jQuery(
'#fk_bom').val() < 0) {
408 console.log(jQuery(
'#fk_product').val());
409 window.location.href =
'<?php echo $_SERVER["PHP_SELF"] ?>?action=create&token=<?php echo newToken(); ?>&qty='+jQuery(
'#qty').val()+
'&mrptype='+jQuery(
'#mrptype').val()+
'&fk_product='+jQuery(
'#fk_product').val()+
'&label='+jQuery(
'#label').val()+
'&fk_project='+jQuery(
'#fk_project').val()+
'&fk_warehouse='+jQuery(
'#fk_warehouse').val();
427 print $form->buttonsSaveCancel(
"Create");
429 if ($objectbom->id > 0) {
432 print
'<!-- list of product/services to consume -->'.
"\n";
433 print
'<div class="div-table-responsive-no-min">';
434 print
'<table class="noborder centpercent">';
436 $arrayOfMoLines = array();
437 foreach ($objectbom->lines as $key => $val) {
438 $moLine =
new MoLine($db);
439 $moLine->id = $objectbom->lines[$key]->id;
440 $moLine->position = $objectbom->lines[$key]->position;
441 $moLine->fk_product = $objectbom->lines[$key]->fk_product;
442 $moLine->fk_unit = $objectbom->lines[$key]->fk_unit;
443 $moLine->qty = $objectbom->lines[$key]->qty;
444 $moLine->qty_frozen = $objectbom->lines[$key]->qty_frozen;
445 $moLine->disable_stock_change = $objectbom->lines[$key]->disable_stock_change;
447 $arrayOfMoLines[] = $moLine;
449 $object->lines = $arrayOfMoLines;
450 $object->mrptype = $objectbom->bomtype;
453 $object->printOriginLinesList(
'', array());
463if (($id || $ref) && $action ==
'edit') {
466 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
467 print
'<input type="hidden" name="token" value="'.newToken().
'">';
468 print
'<input type="hidden" name="action" value="update">';
469 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
471 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
473 if ($backtopageforcancel) {
474 print
'<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.
'">';
479 $object->fields[
'fk_bom'][
'disabled'] = 1;
481 print
'<table class="border centpercent tableforfieldedit">'.
"\n";
484 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_edit.tpl.php';
487 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
493 print $form->buttonsSaveCancel();
499if (
$object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
500 $res =
$object->fetch_thirdparty();
509 if ($action ==
'delete') {
510 $numberofmochilds = count(
$object->getAllMoChilds());
512 if ($numberofmochilds > 0) {
513 $label = $langs->trans(
"DeleteMoChild",
'('.strval($numberofmochilds).
')');
515 $label = $langs->trans(
"DeleteMoChild");
518 $formquestion = array(
519 array(
'type' =>
'checkbox',
'name' =>
'deletechilds',
'label' => $label,
'value' => 0),
521 'label' => $langs->trans(
'MoCancelConsumedAndProducedLines'),
522 'name' =>
'alsoCancelConsumedAndProducedLines',
523 'type' =>
'checkbox',
524 'value' => !
getDolGlobalString(
'MO_ALSO_CANCEL_CONSUMED_AND_PRODUCED_LINES_BY_DEFAULT') ? 0 : 1
527 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'DeleteMo'), $langs->trans(
'ConfirmDeleteMo'),
'confirm_delete', $formquestion, 0, 1);
530 if ($action ==
'deleteline') {
531 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
535 if ($action ==
'validate') {
537 $ref = substr(
$object->ref, 1, 4);
538 if ($ref ==
'PROV') {
545 $text = $langs->trans(
'ConfirmValidateMo', $numref);
554 $formquestion = array();
555 if (isModEnabled(
'mrp')) {
557 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
560 if ($conf->browser->name ==
'ie') {
563 $formquestion = array(
570 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'Validate'), $text,
'confirm_validate', $formquestion, 0, 1, 220);
574 if ($action ==
'cancel') {
575 $formquestion = array(
577 'label' => $langs->trans(
'MoCancelConsumedAndProducedLines'),
578 'name' =>
'alsoCancelConsumedAndProducedLines',
579 'type' =>
'checkbox',
583 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id, $langs->trans(
'CancelMo'), $langs->trans(
'ConfirmCancelMo'),
'confirm_cancel', $formquestion, 0, 1);
587 if ($action ==
'clone') {
589 $formquestion = array();
590 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneMo',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1);
594 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
595 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
596 if (empty($reshook)) {
597 $formconfirm .= $hookmanager->resPrint;
598 } elseif ($reshook > 0) {
599 $formconfirm = $hookmanager->resPrint;
608 $linkback =
'<a href="'.dol_buildpath(
'/mrp/mo_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
610 $morehtmlref =
'<div class="refidno">';
616 if (is_object(
$object->thirdparty)) {
617 $morehtmlref .=
$object->thirdparty->getNomUrl(1,
'customer');
619 $morehtmlref .=
' (<a href="'.DOL_URL_ROOT.
'/commande/list.php?socid='.
$object->thirdparty->id.
'&search_societe='.urlencode(
$object->thirdparty->name).
'">'.$langs->trans(
"OtherOrders").
'</a>)';
623 if (isModEnabled(
'project')) {
624 $langs->load(
"projects");
625 if (is_object(
$object->thirdparty)) {
626 $morehtmlref .=
'<br>';
628 if ($permissiontoadd) {
629 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
630 if ($action !=
'classify') {
631 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
633 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->socid,
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
635 if (!empty(
$object->fk_project)) {
637 $proj->fetch(
$object->fk_project);
638 $morehtmlref .= $proj->getNomUrl(1);
640 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
645 $morehtmlref .=
'</div>';
648 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
651 print
'<div class="fichecenter">';
652 print
'<div class="fichehalfleft">';
653 print
'<div class="underbanner clearboth"></div>';
654 print
'<table class="border centpercent tableforfield">'.
"\n";
657 $mo_parent =
$object->getMoParent();
658 if (is_object($mo_parent)) {
659 print
'<tr class="field_fk_mo_parent">';
660 print
'<td class="titlefield fieldname_fk_mo_parent">' . $langs->trans(
'ParentMo') .
'</td>';
661 print
'<td class="valuefield fieldname_fk_mo_parent">' .$mo_parent->getNomUrl(1).
'</td>';
666 $keyforbreak =
'fk_warehouse';
667 unset(
$object->fields[
'fk_project']);
668 unset(
$object->fields[
'fk_soc']);
669 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
672 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
678 print
'<div class="clearboth"></div>';
687 if (!empty(
$object->table_element_line)) {
692 print
' <form name="addproduct" id="addproduct" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.(($action !=
'editline') ?
'' :
'#line_'.
GETPOSTINT(
'lineid')).
'" method="POST">
693 <input type="hidden" name="token" value="' .
newToken().
'">
694 <input type="hidden" name="action" value="' . (($action !=
'editline') ?
'addline' :
'updateline').
'">
695 <input type="hidden" name="mode" value="">
696 <input type="hidden" name="page_y" value="">
697 <input type="hidden" name="id" value="' .
$object->id.
'">
705 print
'<div class="div-table-responsive-no-min">';
706 print
'<table id="tablelines" class="noborder noshadow" width="100%">';
708 print
'<tr class="liste_titre">';
709 print
'<td class="liste_titre">'.$langs->trans(
"Summary").
'</td>';
713 print
'<tr class="oddeven">';
714 print
'<td>'.$langs->trans(
"ProductsToConsume").
'</td>';
718 foreach (
$object->lines as $line) {
719 if ($line->role ==
'toconsume') {
723 $tmpproduct =
new Product($db);
724 $tmpproduct->fetch($line->fk_product);
725 print $tmpproduct->getNomUrl(1);
733 print
'<tr class="oddeven">';
734 print
'<td>'.$langs->trans(
"ProductsToProduce").
'</td>';
738 foreach (
$object->lines as $line) {
739 if ($line->role ==
'toproduce') {
743 $tmpproduct =
new Product($db);
744 $tmpproduct->fetch($line->fk_product);
745 print $tmpproduct->getNomUrl(1);
763 if ($action !=
'presend' && $action !=
'editline') {
764 print
'<div class="tabsAction">'.
"\n";
765 $parameters = array();
766 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
771 if (empty($reshook)) {
778 if (
$object->status == $object::STATUS_VALIDATED) {
779 if ($permissiontoadd) {
781 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=confirm_setdraft&confirm=yes&token='.
newToken().
'">'.$langs->trans(
"SetToDraft").
'</a>';
786 if (
$object->status == $object::STATUS_DRAFT) {
787 if ($permissiontoadd) {
788 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
790 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
'Modify').
'</a>'.
"\n";
795 if (
$object->status == $object::STATUS_DRAFT) {
796 if ($permissiontoadd) {
798 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=validate&token='.
newToken().
'">'.$langs->trans(
"Validate").
'</a>';
800 $langs->load(
"errors");
801 print
'<a class="butActionRefused" href="" title="'.$langs->trans(
"ErrorAddAtLeastOneLineFirst").
'">'.$langs->trans(
"Validate").
'</a>';
807 if ($permissiontoadd) {
808 print
dolGetButtonAction($langs->trans(
"ToClone"),
'',
'default', $_SERVER[
'PHP_SELF'].
'?id='.
$object->id.(!empty(
$object->socid) ?
'&socid='.$object->socid :
"").
'&action=clone&token='.
newToken().
'&object=mo',
'clone', $permissiontoadd);
812 if ($permissiontoadd) {
813 if (
$object->status == $object::STATUS_VALIDATED ||
$object->status == $object::STATUS_INPROGRESS) {
814 $arrayproduced =
$object->fetchLinesLinked(
'produced', 0);
816 foreach ($arrayproduced as $lineproduced) {
817 $nbProduced += $lineproduced[
'qty'];
819 if ($nbProduced > 0) {
820 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=confirm_produced&confirm=yes&token='.
newToken().
'">'.$langs->trans(
"Close").
'</a>'.
"\n";
822 print
'<a class="butActionRefused" href="#" title="'.$langs->trans(
"GoOnTabProductionToProduceFirst", $langs->transnoentitiesnoconv(
"Production")).
'">'.$langs->trans(
"Close").
'</a>'.
"\n";
825 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=cancel&token='.
newToken().
'">'.$langs->trans(
"Cancel").
'</a>'.
"\n";
828 if (
$object->status == $object::STATUS_PRODUCED ||
$object->status == $object::STATUS_CANCELED) {
829 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=confirm_reopen&confirm=yes&token='.
newToken().
'">'.$langs->trans(
"ReOpen").
'</a>'.
"\n";
834 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken(),
'delete', $permissiontodelete);
841 if (
GETPOST(
'modelselected')) {
845 if ($action !=
'presend') {
846 print
'<div class="fichecenter"><div class="fichehalfleft">';
847 print
'<a name="builddoc"></a>';
851 $relativepath = $objref.
'/'.$objref.
'.pdf';
852 $filedir = $conf->mrp->dir_output.
'/'.$objref;
853 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
854 $genallowed = $user->hasRight(
'mrp',
'read');
855 $delallowed = $user->hasRight(
"mrp",
"creer");
856 print $formfile->showdocuments(
'mrp:mo', $objref, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $mysoc->default_lang);
859 $linktoelem = $form->showLinkToObjectBlock($object,
null, array(
'mo'));
860 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem,
false);
863 print
'</div><div class="fichehalfright">';
867 $morehtmlcenter =
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/mrp/mo_agenda.php?id='.
$object->id);
870 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
872 $somethingshown = $formactions->showactions($object,
$object->element, $socid, 1,
'', $MAXEVENT,
'', $morehtmlcenter);
874 print
'</div></div>';
878 if (
GETPOST(
'modelselected')) {
884 $defaulttopic =
'InformationMessage';
885 $diroutput = $conf->mrp->dir_output;
886 $trackid =
'mo'.$object->id;
888 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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.
Class to manage products or services.
Class to manage projects.
Class to manage translations.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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)
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
moPrepareHead($object)
Prepare array of tabs for Mo.
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.