Clean Code

This commit is contained in:
atm-lena 2022-02-15 16:24:39 +01:00
parent 382aaf8538
commit 398927f2c8
3 changed files with 7 additions and 10 deletions

View File

@ -108,3 +108,4 @@ BOM=Bill Of Materials
CollapseBOMHelp=You can define the default display of the details of the nomenclature in the configuration of the BOM module CollapseBOMHelp=You can define the default display of the details of the nomenclature in the configuration of the BOM module
MOAndLines=Manufacturing Orders and lines MOAndLines=Manufacturing Orders and lines
MoChildGenerate=Generate Child Mo MoChildGenerate=Generate Child Mo
ParentMo=MO Parent

View File

@ -1205,7 +1205,7 @@ class Mo extends CommonObject
/** /**
* Create an array of lines * Create an array of lines
* @param string $rolefilter * @param string $rolefilter string lines role filter
* @return array|int array of lines if OK, <0 if KO * @return array|int array of lines if OK, <0 if KO
*/ */
public function getLinesArray($rolefilter = '') public function getLinesArray($rolefilter = '')

View File

@ -133,10 +133,9 @@ if (empty($reshook)) {
} }
$triggermodname = 'MRP_MO_MODIFY'; // Name of trigger action code to execute when we modify record $triggermodname = 'MRP_MO_MODIFY'; // Name of trigger action code to execute when we modify record
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen //Create MO with Childs
if ($action == 'add' && empty($id) && !empty($TBomLineId)) { if ($action == 'add' && empty($id) && !empty($TBomLineId)) {
$noback = ""; $noback = 0;
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
$mo_parent = $object; $mo_parent = $object;
@ -163,16 +162,13 @@ if (empty($reshook)) {
$res = $object->add_object_linked('mo', $mo_parent->id); $res = $object->add_object_linked('mo', $mo_parent->id);
} }
$noback = 0; header("Location: ".dol_buildpath('/mrp/mo_list.php', 1));
header("Location: ".$urltogo);
exit; exit;
} }
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
// Actions when linking object each other // Actions when linking object each other
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
@ -531,7 +527,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$mo_parent = $object->getMoParent(); $mo_parent = $object->getMoParent();
if (is_object($mo_parent)) { if (is_object($mo_parent)) {
print '<tr class="field_fk_mo_parent">'; print '<tr class="field_fk_mo_parent">';
print '<td class="titlefield fieldname_fk_mo_parent">' . $langs->trans('MOParent') . '</td>'; print '<td class="titlefield fieldname_fk_mo_parent">' . $langs->trans('ParentMo') . '</td>';
print '<td class="valuefield fieldname_fk_mo_parent">' .$mo_parent->getNomUrl(1).'</td>'; print '<td class="valuefield fieldname_fk_mo_parent">' .$mo_parent->getNomUrl(1).'</td>';
print '</tr>'; print '</tr>';
} }