26require
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/mrp/class/mo.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/mrp/lib/mrp_mo.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/bom/class/bom.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/bom/lib/bom.lib.php';
37if (isModEnabled(
'workstation')) {
38 require_once DOL_DOCUMENT_ROOT.
'/workstation/class/workstation.class.php';
43$langs->loadLangs(array(
'mrp',
'other'));
49$action =
GETPOST(
'action',
'aZ09');
50$confirm =
GETPOST(
'confirm',
'alpha');
51$cancel =
GETPOST(
'cancel',
'aZ09');
52$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'mocard';
53$backtopage =
GETPOST(
'backtopage',
'alpha');
54$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
55$TBomLineId =
GETPOST(
'bomlineid',
'array');
56$lineid =
GETPOST(
'lineid',
'int');
57$socid =
GETPOST(
"socid",
'int');
61$objectbom =
new BOM($db);
64$diroutputmassaction = $conf->mrp->dir_output.
'/temp/massgeneration/'.$user->id;
65$hookmanager->initHooks(array(
'mocard',
'globalcard'));
68$extrafields->fetch_name_optionals_label($object->table_element);
70$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
73$search_all =
GETPOST(
"search_all",
'alpha');
75foreach ($object->fields as $key => $val) {
76 if (
GETPOST(
'search_'.$key,
'alpha')) {
77 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
81if (empty($action) && empty($id) && empty($ref)) {
86include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
88if (
GETPOST(
'fk_bom',
'int') > 0) {
89 $objectbom->fetch(
GETPOST(
'fk_bom',
'int'));
91 if ($action !=
'add') {
93 $_POST[
'fk_product'] = $objectbom->fk_product;
94 $_POST[
'qty'] = $objectbom->qty;
95 $_POST[
'mrptype'] = $objectbom->bomtype;
96 $_POST[
'fk_warehouse'] = $objectbom->fk_warehouse;
97 $_POST[
'note_private'] = $objectbom->note_private;
104$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
105$result =
restrictedArea($user,
'mrp', $object->id,
'mrp_mo',
'',
'fk_soc',
'rowid', $isdraft);
108$permissionnote = $user->rights->mrp->write;
109$permissiondellink = $user->rights->mrp->write;
110$permissiontoadd = $user->rights->mrp->write;
111$permissiontodelete = $user->rights->mrp->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
112$upload_dir = $conf->mrp->multidir_output[isset($object->entity) ? $object->entity : 1];
119$parameters = array();
120$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
125if (empty($reshook)) {
130 $object->oldQty = $object->qty;
132 if (empty($backtopage) || ($cancel && empty($id))) {
133 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
134 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
135 $backtopage = $backurlforlist;
137 $backtopage = DOL_URL_ROOT.
'/mrp/mo_card.php?id='.($id > 0 ? $id :
'__ID__');
141 if ($cancel && !empty($backtopageforcancel)) {
142 $backtopage = $backtopageforcancel;
144 $triggermodname =
'MO_MODIFY';
147 if ($action ==
'add' && empty($id) && !empty($TBomLineId)) {
149 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
151 $mo_parent = $object;
153 $moline =
new MoLine($db);
154 $objectbomchildline =
new BOMLine($db);
156 foreach ($TBomLineId as $id_bom_line) {
157 $object =
new Mo($db);
159 $objectbomchildline->fetch($id_bom_line);
161 $TMoLines = $moline->fetchAll(
'DESC',
'rowid',
'1',
'', array(
'origin_id' => $id_bom_line));
163 foreach ($TMoLines as $tmpmoline) {
164 $_POST[
'fk_bom'] = $objectbomchildline->fk_bom_child;
165 $_POST[
'fk_parent_line'] = $tmpmoline->id;
166 $_POST[
'qty'] = $tmpmoline->qty;
167 $_POST[
'fk_product'] = $tmpmoline->fk_product;
170 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
172 $res = $object->add_object_linked(
'mo', $mo_parent->id);
175 header(
"Location: ".
dol_buildpath(
'/mrp/mo_card.php?id='.((
int) $mo_parent->id), 1));
177 } elseif ($action ==
'confirm_cancel' && $confirm ==
'yes' && !empty($permissiontoadd)) {
178 $also_cancel_consumed_and_produced_lines = (
GETPOST(
'alsoCancelConsumedAndProducedLines',
'alpha') ? 1 : 0);
179 $result = $object->cancel($user, 0, $also_cancel_consumed_and_produced_lines);
181 header(
"Location: " .
dol_buildpath(
'/mrp/mo_card.php?id=' . $object->id, 1));
187 } elseif ($action ==
'confirm_delete' && $confirm ==
'yes' && !empty($permissiontodelete)) {
188 $also_cancel_consumed_and_produced_lines = (
GETPOST(
'alsoCancelConsumedAndProducedLines',
'alpha') ? 1 : 0);
189 $result = $object->delete($user, 0, $also_cancel_consumed_and_produced_lines);
191 header(
"Location: " . $backurlforlist);
199 if ($action ==
'confirm_delete' && !empty($permissiontodelete)) {
200 if (!($object->id > 0)) {
201 dol_print_error(
'',
'Error, object must be fetched before being deleted');
206 $deleteChilds =
GETPOST(
'deletechilds',
'boolean');
211 if ($deleteChilds ===
'on') {
212 $TMoChildren = $object->getAllMoChilds();
214 foreach ($TMoChildren as $id => $childObject) {
215 if ($childObject->delete($user) == -1) {
217 if (!empty($childObject->errors)) {
227 $result = $object->delete($user);
232 if ($deleteChilds ===
'on') {
236 if (empty($noback)) {
237 header(
"Location: " . $backurlforlist);
242 if (!empty($object->errors)) {
260 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
263 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
266 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
269 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
271 if ($action ==
'set_thirdparty' && $permissiontoadd) {
272 $object->setValueFrom(
'fk_soc',
GETPOST(
'fk_soc',
'int'),
'',
'',
'date',
'', $user, $triggermodname);
274 if ($action ==
'classin' && $permissiontoadd) {
275 $object->setProject(
GETPOST(
'projectid',
'int'));
279 $triggersendname =
'MO_SENTBYMAIL';
280 $autocopy =
'MAIN_MAIL_AUTOCOPY_MO_TO';
281 $trackid =
'mo'.$object->id;
282 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
288 if ($action ==
'confirm_produced' && $confirm ==
'yes' && $permissiontoadd) {
289 $result = $object->setStatut($object::STATUS_PRODUCED, 0,
'',
'MRP_MO_PRODUCED');
293 $outputlangs = $langs;
296 $newlang =
GETPOST(
'lang_id',
'aZ09');
299 $newlang = $object->thirdparty->default_lang;
301 if (!empty($newlang)) {
303 $outputlangs->setDefaultLang($newlang);
305 $model = $object->model_pdf;
306 $ret = $object->fetch($id);
308 $object->generateDocument($model, $outputlangs, 0, 0, 0);
323$form =
new Form($db);
327$title = $langs->trans(
'ManufacturingOrder').
" - ".$langs->trans(
"Card");
334if ($action ==
'create') {
335 if (
GETPOST(
'fk_bom',
'int') > 0) {
336 $titlelist = $langs->trans(
"ToConsume");
337 if ($objectbom->bomtype == 1) {
338 $titlelist = $langs->trans(
"ToObtain");
342 print
load_fiche_titre($langs->trans(
"NewObject", $langs->transnoentitiesnoconv(
"Mo")),
'',
'mrp');
344 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
345 print
'<input type="hidden" name="token" value="'.newToken().
'">';
346 print
'<input type="hidden" name="action" value="add">';
348 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
350 if ($backtopageforcancel) {
351 print
'<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.
'">';
356 print
'<table class="border centpercent tableforfieldcreate">'.
"\n";
359 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_add.tpl.php';
362 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
364 print
'</table>'.
"\n";
370 $(document).ready(
function () {
371 jQuery(
'#fk_bom').change(
function() {
372 console.log(
'We change value of BOM with BOM of id '+jQuery(
'#fk_bom').val());
373 if (jQuery(
'#fk_bom').val() > 0)
376 window.location.href =
'<?php echo $_SERVER["PHP_SELF"] ?>?action=create&token=<?php echo newToken(); ?>&fk_bom='+jQuery(
'#fk_bom').val();
405 else if (jQuery(
'#fk_bom').val() < 0) {
407 console.log(jQuery(
'#fk_product').val());
408 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();
426 print $form->buttonsSaveCancel(
"Create");
428 if ($objectbom->id > 0) {
431 print
'<!-- list of product/services to consume -->'.
"\n";
432 print
'<div class="div-table-responsive-no-min">';
433 print
'<table class="noborder centpercent">';
435 $object->lines = $objectbom->lines;
436 $object->mrptype = $objectbom->bomtype;
437 $object->bom = $objectbom;
439 $object->printOriginLinesList(
'', array());
449if (($id || $ref) && $action ==
'edit') {
452 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
453 print
'<input type="hidden" name="token" value="'.newToken().
'">';
454 print
'<input type="hidden" name="action" value="update">';
455 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
457 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
459 if ($backtopageforcancel) {
460 print
'<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.
'">';
465 $object->fields[
'fk_bom'][
'disabled'] = 1;
467 print
'<table class="border centpercent tableforfieldedit">'.
"\n";
470 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_edit.tpl.php';
473 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
479 print $form->buttonsSaveCancel();
485if ($object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
486 $res = $object->fetch_thirdparty();
490 print
dol_get_fiche_head($head,
'card', $langs->trans(
"ManufacturingOrder"), -1, $object->picto);
495 if ($action ==
'delete') {
496 $numberofmochilds = count($object->getAllMoChilds());
498 if ($numberofmochilds > 0) {
499 $label = $langs->trans(
"DeleteMoChild",
'('.strval($numberofmochilds).
')');
501 $label = $langs->trans(
"DeleteMoChild");
504 $formquestion = array(
505 array(
'type' =>
'checkbox',
'name' =>
'deletechilds',
'label' => $label,
'value' => 0),
507 'label' => $langs->trans(
'MoCancelConsumedAndProducedLines'),
508 'name' =>
'alsoCancelConsumedAndProducedLines',
509 'type' =>
'checkbox',
510 'value' => !
getDolGlobalString(
'MO_ALSO_CANCEL_CONSUMED_AND_PRODUCED_LINES_BY_DEFAULT') ? 0 : 1
513 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'DeleteMo'), $langs->trans(
'ConfirmDeleteMo'),
'confirm_delete', $formquestion, 0, 1);
516 if ($action ==
'deleteline') {
517 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
521 if ($action ==
'validate') {
523 $ref = substr($object->ref, 1, 4);
524 if ($ref ==
'PROV') {
525 $object->fetch_product();
526 $numref = $object->getNextNumRef($object->product);
528 $numref = $object->ref;
531 $text = $langs->trans(
'ConfirmValidateMo', $numref);
540 $formquestion = array();
541 if (isModEnabled(
'mrp')) {
543 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
546 if ($conf->browser->name ==
'ie') {
549 $formquestion = array(
556 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'Validate'), $text,
'confirm_validate', $formquestion, 0, 1, 220);
560 if ($action ==
'cancel') {
561 $formquestion = array(
563 'label' => $langs->trans(
'MoCancelConsumedAndProducedLines'),
564 'name' =>
'alsoCancelConsumedAndProducedLines',
565 'type' =>
'checkbox',
569 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"] .
'?id=' . $object->id, $langs->trans(
'CancelMo'), $langs->trans(
'ConfirmCancelMo'),
'confirm_cancel', $formquestion, 0, 1);
573 if ($action ==
'clone') {
575 $formquestion = array();
576 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneMo', $object->ref),
'confirm_clone', $formquestion,
'yes', 1);
580 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
581 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
582 if (empty($reshook)) {
583 $formconfirm .= $hookmanager->resPrint;
584 } elseif ($reshook > 0) {
585 $formconfirm = $hookmanager->resPrint;
594 $linkback =
'<a href="'.dol_buildpath(
'/mrp/mo_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
596 $morehtmlref =
'<div class="refidno">';
602 if (is_object($object->thirdparty)) {
603 $morehtmlref .= $object->thirdparty->getNomUrl(1,
'customer');
605 $morehtmlref .=
' (<a href="'.DOL_URL_ROOT.
'/commande/list.php?socid='.$object->thirdparty->id.
'&search_societe='.urlencode($object->thirdparty->name).
'">'.$langs->trans(
"OtherOrders").
'</a>)';
609 if (isModEnabled(
'project')) {
610 $langs->load(
"projects");
611 if (is_object($object->thirdparty)) {
612 $morehtmlref .=
'<br>';
614 if ($permissiontoadd) {
615 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
616 if ($action !=
'classify') {
617 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.newToken().
'&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
619 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
621 if (!empty($object->fk_project)) {
623 $proj->fetch($object->fk_project);
624 $morehtmlref .= $proj->getNomUrl(1);
626 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
631 $morehtmlref .=
'</div>';
634 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
637 print
'<div class="fichecenter">';
638 print
'<div class="fichehalfleft">';
639 print
'<div class="underbanner clearboth"></div>';
640 print
'<table class="border centpercent tableforfield">'.
"\n";
643 $mo_parent = $object->getMoParent();
644 if (is_object($mo_parent)) {
645 print
'<tr class="field_fk_mo_parent">';
646 print
'<td class="titlefield fieldname_fk_mo_parent">' . $langs->trans(
'ParentMo') .
'</td>';
647 print
'<td class="valuefield fieldname_fk_mo_parent">' .$mo_parent->getNomUrl(1).
'</td>';
652 $keyforbreak =
'fk_warehouse';
653 unset($object->fields[
'fk_project']);
654 unset($object->fields[
'fk_soc']);
655 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
658 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
664 print
'<div class="clearboth"></div>';
673 if (!empty($object->table_element_line)) {
676 $object->fetchLines();
678 print
' <form name="addproduct" id="addproduct" action="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.(($action !=
'editline') ?
'' :
'#line_'.
GETPOST(
'lineid',
'int')).
'" method="POST">
679 <input type="hidden" name="token" value="' . newToken().
'">
680 <input type="hidden" name="action" value="' . (($action !=
'editline') ?
'addline' :
'updateline').
'">
681 <input type="hidden" name="mode" value="">
682 <input type="hidden" name="page_y" value="">
683 <input type="hidden" name="id" value="' . $object->id.
'">
690 if (!empty($object->lines)) {
691 print
'<div class="div-table-responsive-no-min">';
692 print
'<table id="tablelines" class="noborder noshadow" width="100%">';
694 print
'<tr class="liste_titre">';
695 print
'<td class="liste_titre">'.$langs->trans(
"Summary").
'</td>';
699 print
'<tr class="oddeven">';
700 print
'<td>'.$langs->trans(
"ProductsToConsume").
'</td>';
702 if (!empty($object->lines)) {
704 foreach ($object->lines as $line) {
705 if ($line->role ==
'toconsume') {
709 $tmpproduct =
new Product($db);
710 $tmpproduct->fetch($line->fk_product);
711 print $tmpproduct->getNomUrl(1);
719 print
'<tr class="oddeven">';
720 print
'<td>'.$langs->trans(
"ProductsToProduce").
'</td>';
722 if (!empty($object->lines)) {
724 foreach ($object->lines as $line) {
725 if ($line->role ==
'toproduce') {
729 $tmpproduct =
new Product($db);
730 $tmpproduct->fetch($line->fk_product);
731 print $tmpproduct->getNomUrl(1);
749 if ($action !=
'presend' && $action !=
'editline') {
750 print
'<div class="tabsAction">'.
"\n";
751 $parameters = array();
752 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
757 if (empty($reshook)) {
764 if ($object->status == $object::STATUS_VALIDATED) {
765 if ($permissiontoadd) {
767 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&action=confirm_setdraft&confirm=yes&token='.newToken().
'">'.$langs->trans(
"SetToDraft").
'</a>';
772 if ($object->status == $object::STATUS_DRAFT) {
773 if ($permissiontoadd) {
774 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=edit&token='.newToken().
'">'.$langs->trans(
"Modify").
'</a>'.
"\n";
776 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
'Modify').
'</a>'.
"\n";
781 if ($object->status == $object::STATUS_DRAFT) {
782 if ($permissiontoadd) {
783 if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) {
784 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&action=validate">'.$langs->trans(
"Validate").
'</a>';
786 $langs->load(
"errors");
787 print
'<a class="butActionRefused" href="" title="'.$langs->trans(
"ErrorAddAtLeastOneLineFirst").
'">'.$langs->trans(
"Validate").
'</a>';
793 if ($permissiontoadd) {
794 print
dolGetButtonAction($langs->trans(
"ToClone"),
'',
'default', $_SERVER[
'PHP_SELF'].
'?id='.$object->id.(!empty($object->socid) ?
'&socid='.$object->socid :
"").
'&action=clone&object=mo',
'clone', $permissiontoadd);
798 if ($permissiontoadd) {
799 if ($object->status == $object::STATUS_VALIDATED || $object->status == $object::STATUS_INPROGRESS) {
800 $arrayproduced = $object->fetchLinesLinked(
'produced', 0);
802 foreach ($arrayproduced as $lineproduced) {
803 $nbProduced += $lineproduced[
'qty'];
805 if ($nbProduced > 0) {
806 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=confirm_produced&confirm=yes&token='.newToken().
'">'.$langs->trans(
"Close").
'</a>'.
"\n";
808 print
'<a class="butActionRefused" href="#" title="'.$langs->trans(
"GoOnTabProductionToProduceFirst", $langs->transnoentitiesnoconv(
"Production")).
'">'.$langs->trans(
"Close").
'</a>'.
"\n";
811 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=cancel&token='.newToken().
'">'.$langs->trans(
"Cancel").
'</a>'.
"\n";
814 if ($object->status == $object::STATUS_PRODUCED || $object->status == $object::STATUS_CANCELED) {
815 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=confirm_reopen&confirm=yes&token='.newToken().
'">'.$langs->trans(
"ReOpen").
'</a>'.
"\n";
820 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=delete&token='.newToken(),
'delete', $permissiontodelete);
827 if (
GETPOST(
'modelselected')) {
831 if ($action !=
'presend') {
832 print
'<div class="fichecenter"><div class="fichehalfleft">';
833 print
'<a name="builddoc"></a>';
837 $relativepath = $objref.
'/'.$objref.
'.pdf';
838 $filedir = $conf->mrp->dir_output.
'/'.$objref;
839 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".$object->id;
840 $genallowed = $user->rights->mrp->read;
841 $delallowed = $user->hasRight(
"mrp",
"creer");
842 print $formfile->showdocuments(
'mrp:mo', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $mysoc->default_lang);
845 $linktoelem = $form->showLinkToObjectBlock($object,
null, array(
'mo'));
846 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem,
false);
849 print
'</div><div class="fichehalfright">';
853 $morehtmlcenter =
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/mrp/mo_agenda.php?id='.$object->id);
856 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
858 $somethingshown =
$formactions->showactions($object, $object->element, $socid, 1,
'', $MAXEVENT,
'', $morehtmlcenter);
860 print
'</div></div>';
864 if (
GETPOST(
'modelselected')) {
870 $defaulttopic =
'InformationMessage';
871 $diroutput = $conf->mrp->dir_output;
872 $trackid =
'mo'.$object->id;
874 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
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.
Class to manage products or services.
Class to manage projects.
Class to manage translations.
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='', $dragdropfile=0)
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier 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.