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);
166 $TMoLines = $moline->fetchAll(
'DESC',
'rowid',
'1',
'', array(
'fk_mo' => $mo_parent->id,
'origin_id' => $id_bom_line,
'origin_type' =>
'bomline'));
168 if (empty($TMoLines)) {
172 foreach ($TMoLines as $tmpmoline) {
173 $_POST[
'fk_bom'] = $objectbomchildline->fk_bom_child;
174 $_POST[
'fk_parent_line'] = $tmpmoline->id;
175 $_POST[
'qty'] = $tmpmoline->qty;
176 $_POST[
'fk_product'] = $tmpmoline->fk_product;
179 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
181 $res =
$object->add_object_linked(
'mo', $mo_parent->id);
184 header(
"Location: ".
dol_buildpath(
'/mrp/mo_card.php?id='.((
int) $mo_parent->id), 1));
186 } elseif ($action ==
'confirm_cancel' && $confirm ==
'yes' && !empty($permissiontoadd)) {
187 $also_cancel_consumed_and_produced_lines = (
GETPOST(
'alsoCancelConsumedAndProducedLines',
'alpha') ? 1 : 0);
188 $result =
$object->cancel($user, 0, $also_cancel_consumed_and_produced_lines);
196 } elseif ($action ==
'confirm_delete' && $confirm ==
'yes' && !empty($permissiontodelete)) {
197 $also_cancel_consumed_and_produced_lines = (
GETPOST(
'alsoCancelConsumedAndProducedLines',
'alpha') ? 1 : 0);
198 $result =
$object->delete($user, 0, $also_cancel_consumed_and_produced_lines);
200 header(
"Location: " . $backurlforlist);
208 if ($action ==
'confirm_delete' && !empty($permissiontodelete)) {
210 dol_print_error(
null,
'Error, object must be fetched before being deleted');
215 $deleteChilds =
GETPOST(
'deletechilds',
'aZ');
220 if ($deleteChilds ===
'on') {
221 $TMoChildren =
$object->getAllMoChilds();
223 foreach ($TMoChildren as $id => $childObject) {
224 if ($childObject->delete($user) == -1) {
226 if (!empty($childObject->errors)) {
236 $result =
$object->delete($user);
241 if ($deleteChilds ===
'on') {
245 if (empty($noback)) {
246 header(
"Location: " . $backurlforlist);
269 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
272 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
275 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
278 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
280 if ($action ==
'set_thirdparty' && $permissiontoadd) {
281 $object->setValueFrom(
'fk_soc',
GETPOSTINT(
'fk_soc'),
'',
'',
'date',
'', $user, $triggermodname);
283 if ($action ==
'classin' && $permissiontoadd) {
288 $triggersendname =
'MO_SENTBYMAIL';
289 $autocopy =
'MAIN_MAIL_AUTOCOPY_MO_TO';
290 $trackid =
'mo'.$object->id;
291 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
297 if ($action ==
'confirm_produced' && $confirm ==
'yes' && $permissiontoadd) {
298 $result =
$object->setStatut($object::STATUS_PRODUCED, 0,
'',
'MRP_MO_PRODUCED');
302 $outputlangs = $langs;
305 $newlang =
GETPOST(
'lang_id',
'aZ09');
308 $newlang =
$object->thirdparty->default_lang;
310 if (!empty($newlang)) {
312 $outputlangs->setDefaultLang($newlang);
317 $object->generateDocument($model, $outputlangs, 0, 0, 0);
332$form =
new Form($db);
336$title = $langs->trans(
'ManufacturingOrder').
" - ".$langs->trans(
"Card");
343if ($action ==
'create') {
345 $titlelist = $langs->trans(
"ToConsume");
346 if ($objectbom->bomtype == 1) {
347 $titlelist = $langs->trans(
"ToObtain");
351 print
load_fiche_titre($langs->trans(
"NewObject", $langs->transnoentitiesnoconv(
"Mo")),
'',
'mrp');
353 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
354 print
'<input type="hidden" name="token" value="'.newToken().
'">';
355 print
'<input type="hidden" name="action" value="add">';
357 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
359 if ($backtopageforcancel) {
360 print
'<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.
'">';
365 print
'<table class="border centpercent tableforfieldcreate">'.
"\n";
368 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_add.tpl.php';
371 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
373 print
'</table>'.
"\n";
379 $(document).ready(
function () {
380 jQuery(
'#fk_bom').change(
function() {
381 console.log(
'We change value of BOM with BOM of id '+jQuery(
'#fk_bom').val());
382 if (jQuery(
'#fk_bom').val() > 0)
385 window.location.href =
'<?php echo $_SERVER["PHP_SELF"] ?>?action=create&token=<?php echo newToken(); ?>&fk_bom='+jQuery(
'#fk_bom').val();
414 else if (jQuery(
'#fk_bom').val() < 0) {
416 console.log(jQuery(
'#fk_product').val());
417 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();
435 print $form->buttonsSaveCancel(
"Create");
437 if ($objectbom->id > 0) {
440 print
'<!-- list of product/services to consume -->'.
"\n";
441 print
'<div class="div-table-responsive-no-min">';
442 print
'<table class="noborder centpercent">';
444 $arrayOfMoLines = array();
445 foreach ($objectbom->lines as $key => $val) {
446 $moLine =
new MoLine($db);
447 $moLine->id = $objectbom->lines[$key]->id;
448 $moLine->position = $objectbom->lines[$key]->position;
449 $moLine->fk_product = $objectbom->lines[$key]->fk_product;
450 $moLine->fk_unit = $objectbom->lines[$key]->fk_unit;
451 $moLine->qty = $objectbom->lines[$key]->qty;
452 $moLine->qty_frozen = $objectbom->lines[$key]->qty_frozen;
453 $moLine->disable_stock_change = $objectbom->lines[$key]->disable_stock_change;
455 $arrayOfMoLines[] = $moLine;
457 $object->lines = $arrayOfMoLines;
458 $object->mrptype = $objectbom->bomtype;
461 $object->printOriginLinesList(
'', array());
471if (($id || $ref) && $action ==
'edit') {
474 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
475 print
'<input type="hidden" name="token" value="'.newToken().
'">';
476 print
'<input type="hidden" name="action" value="update">';
477 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
479 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
481 if ($backtopageforcancel) {
482 print
'<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.
'">';
487 $object->fields[
'fk_bom'][
'disabled'] = 1;
489 print
'<table class="border centpercent tableforfieldedit">'.
"\n";
492 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_edit.tpl.php';
495 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
501 print $form->buttonsSaveCancel();
507if (
$object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
508 $res =
$object->fetch_thirdparty();
517 if ($action ==
'delete') {
518 $numberofmochilds = count(
$object->getAllMoChilds());
520 if ($numberofmochilds > 0) {
521 $label = $langs->trans(
"DeleteMoChild",
'('.strval($numberofmochilds).
')');
523 $label = $langs->trans(
"DeleteMoChild");
526 $formquestion = array(
527 array(
'type' =>
'checkbox',
'name' =>
'deletechilds',
'label' => $label,
'value' => 0),
529 'label' => $langs->trans(
'MoCancelConsumedAndProducedLines'),
530 'name' =>
'alsoCancelConsumedAndProducedLines',
531 'type' =>
'checkbox',
532 'value' => !
getDolGlobalString(
'MO_ALSO_CANCEL_CONSUMED_AND_PRODUCED_LINES_BY_DEFAULT') ? 0 : 1
535 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'DeleteMo'), $langs->trans(
'ConfirmDeleteMo'),
'confirm_delete', $formquestion, 0, 1);
538 if ($action ==
'deleteline') {
539 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
543 if ($action ==
'validate') {
545 $ref = substr(
$object->ref, 1, 4);
546 if ($ref ==
'PROV') {
553 $text = $langs->trans(
'ConfirmValidateMo', $numref);
562 $formquestion = array();
563 if (isModEnabled(
'mrp')) {
565 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
568 if ($conf->browser->name ==
'ie') {
571 $formquestion = array(
578 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'Validate'), $text,
'confirm_validate', $formquestion, 0, 1, 220);
582 if ($action ==
'cancel') {
583 $formquestion = array(
585 'label' => $langs->trans(
'MoCancelConsumedAndProducedLines'),
586 'name' =>
'alsoCancelConsumedAndProducedLines',
587 'type' =>
'checkbox',
591 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id, $langs->trans(
'CancelMo'), $langs->trans(
'ConfirmCancelMo'),
'confirm_cancel', $formquestion, 0, 1);
595 if ($action ==
'clone') {
597 $formquestion = array();
598 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneMo',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1);
602 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
603 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
604 if (empty($reshook)) {
605 $formconfirm .= $hookmanager->resPrint;
606 } elseif ($reshook > 0) {
607 $formconfirm = $hookmanager->resPrint;
616 $linkback =
'<a href="'.dol_buildpath(
'/mrp/mo_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
618 $morehtmlref =
'<div class="refidno">';
624 if (is_object(
$object->thirdparty)) {
625 $morehtmlref .=
$object->thirdparty->getNomUrl(1,
'customer');
627 $morehtmlref .=
' (<a href="'.DOL_URL_ROOT.
'/commande/list.php?socid='.
$object->thirdparty->id.
'">'.$langs->trans(
"OtherOrders").
'</a>)';
631 if (isModEnabled(
'project')) {
632 $langs->load(
"projects");
633 if (is_object(
$object->thirdparty)) {
634 $morehtmlref .=
'<br>';
636 if ($permissiontoadd) {
637 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
638 if ($action !=
'classify') {
639 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
641 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->socid,
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
643 if (!empty(
$object->fk_project)) {
645 $proj->fetch(
$object->fk_project);
646 $morehtmlref .= $proj->getNomUrl(1);
648 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
653 $morehtmlref .=
'</div>';
656 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
659 print
'<div class="fichecenter">';
660 print
'<div class="fichehalfleft">';
661 print
'<div class="underbanner clearboth"></div>';
662 print
'<table class="border centpercent tableforfield">'.
"\n";
665 $mo_parent =
$object->getMoParent();
666 if (is_object($mo_parent)) {
667 print
'<tr class="field_fk_mo_parent">';
668 print
'<td class="titlefield fieldname_fk_mo_parent">' . $langs->trans(
'ParentMo') .
'</td>';
669 print
'<td class="valuefield fieldname_fk_mo_parent">' .$mo_parent->getNomUrl(1).
'</td>';
674 $keyforbreak =
'fk_warehouse';
675 unset(
$object->fields[
'fk_project']);
676 unset(
$object->fields[
'fk_soc']);
677 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
680 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
686 print
'<div class="clearboth"></div>';
695 if (!empty(
$object->table_element_line)) {
700 print
' <form name="addproduct" id="addproduct" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.(($action !=
'editline') ?
'' :
'#line_'.
GETPOSTINT(
'lineid')).
'" method="POST">
701 <input type="hidden" name="token" value="' .
newToken().
'">
702 <input type="hidden" name="action" value="' . (($action !=
'editline') ?
'addline' :
'updateline').
'">
703 <input type="hidden" name="mode" value="">
704 <input type="hidden" name="page_y" value="">
705 <input type="hidden" name="id" value="' .
$object->id.
'">
713 print
'<div class="div-table-responsive-no-min">';
714 print
'<table id="tablelines" class="noborder noshadow" width="100%">';
716 print
'<tr class="liste_titre">';
717 print
'<td class="liste_titre">'.$langs->trans(
"Summary").
'</td>';
721 print
'<tr class="oddeven">';
722 print
'<td>'.$langs->trans(
"ProductsToConsume").
'</td>';
726 foreach (
$object->lines as $line) {
727 if ($line->role ==
'toconsume') {
731 $tmpproduct =
new Product($db);
732 $tmpproduct->fetch($line->fk_product);
733 print $tmpproduct->getNomUrl(1);
741 print
'<tr class="oddeven">';
742 print
'<td>'.$langs->trans(
"ProductsToProduce").
'</td>';
746 foreach (
$object->lines as $line) {
747 if ($line->role ==
'toproduce') {
751 $tmpproduct =
new Product($db);
752 $tmpproduct->fetch($line->fk_product);
753 print $tmpproduct->getNomUrl(1);
771 if ($action !=
'presend' && $action !=
'editline') {
772 print
'<div class="tabsAction">'.
"\n";
773 $parameters = array();
774 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
779 if (empty($reshook)) {
786 if (
$object->status == $object::STATUS_VALIDATED) {
787 if ($permissiontoadd) {
789 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=confirm_setdraft&confirm=yes&token='.
newToken().
'">'.$langs->trans(
"SetToDraft").
'</a>';
794 if (
$object->status == $object::STATUS_DRAFT) {
795 if ($permissiontoadd) {
796 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
798 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
'Modify').
'</a>'.
"\n";
803 if (
$object->status == $object::STATUS_DRAFT) {
804 if ($permissiontoadd) {
806 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=validate&token='.
newToken().
'">'.$langs->trans(
"Validate").
'</a>';
808 $langs->load(
"errors");
809 print
'<a class="butActionRefused" href="" title="'.$langs->trans(
"ErrorAddAtLeastOneLineFirst").
'">'.$langs->trans(
"Validate").
'</a>';
815 if ($permissiontoadd) {
816 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);
820 if ($permissiontoadd) {
821 if (
$object->status == $object::STATUS_VALIDATED ||
$object->status == $object::STATUS_INPROGRESS) {
822 $arrayproduced =
$object->fetchLinesLinked(
'produced', 0);
824 foreach ($arrayproduced as $lineproduced) {
825 $nbProduced += $lineproduced[
'qty'];
827 if ($nbProduced > 0) {
828 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=confirm_produced&confirm=yes&token='.
newToken().
'">'.$langs->trans(
"Close").
'</a>'.
"\n";
830 print
'<a class="butActionRefused" href="#" title="'.$langs->trans(
"GoOnTabProductionToProduceFirst", $langs->transnoentitiesnoconv(
"Production")).
'">'.$langs->trans(
"Close").
'</a>'.
"\n";
833 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=cancel&token='.
newToken().
'">'.$langs->trans(
"Cancel").
'</a>'.
"\n";
836 if (
$object->status == $object::STATUS_PRODUCED ||
$object->status == $object::STATUS_CANCELED) {
837 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=confirm_reopen&confirm=yes&token='.
newToken().
'">'.$langs->trans(
"ReOpen").
'</a>'.
"\n";
842 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken(),
'delete', $permissiontodelete);
849 if (
GETPOST(
'modelselected')) {
853 if ($action !=
'presend') {
854 print
'<div class="fichecenter"><div class="fichehalfleft">';
855 print
'<a name="builddoc"></a>';
859 $relativepath = $objref.
'/'.$objref.
'.pdf';
860 $filedir = $conf->mrp->dir_output.
'/'.$objref;
861 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
862 $genallowed = $user->hasRight(
'mrp',
'read');
863 $delallowed = $user->hasRight(
"mrp",
"creer");
864 print $formfile->showdocuments(
'mrp:mo', $objref, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $mysoc->default_lang,
'', $object);
867 $linktoelem = $form->showLinkToObjectBlock($object,
null, array(
'mo'));
868 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem,
false);
871 print
'</div><div class="fichehalfright">';
875 $morehtmlcenter =
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/mrp/mo_agenda.php?id='.
$object->id);
878 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
880 $somethingshown = $formactions->showactions($object,
$object->element, $socid, 1,
'', $MAXEVENT,
'', $morehtmlcenter);
882 print
'</div></div>';
886 if (
GETPOST(
'modelselected')) {
892 $defaulttopic =
'InformationMessage';
893 $diroutput = $conf->mrp->dir_output;
894 $trackid =
'mo'.$object->id;
896 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.