From 5c862435a89cebcd46119b26be09bacfc2224fa9 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Mon, 7 Feb 2022 16:06:25 +0100 Subject: [PATCH 01/24] Ajout ligne BOM enfant dans mo_card action "create" --- htdocs/mrp/tpl/originproductline.tpl.php | 98 +++++++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index ba1d7fccd86..97847427fcd 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -32,12 +32,30 @@ $qtytoconsumeforline = $this->tpl['qty'] / ( ! empty($this->tpl['efficiency']) ? }*/ $qtytoconsumeforline = price2num($qtytoconsumeforline, 'MS'); +$tmpproduct = new Product($this->db); +$tmpproduct->fetch($line->fk_product); +$tmpbom = new BOM($this->db); +$res = $tmpbom->fetch($line->fk_bom_child); + ?> tpl['strike']) ? '' : ' strikefordisabled').'">'; -print ''.$this->tpl['label'].''; +print ''; +if($res){ + print $tmpproduct->getNomUrl(1); + print ' '.$langs->trans("or").' '; + print $tmpbom->getNomUrl(1); + print ' '; + print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open')); + print ''; + +} else{ + print $this->tpl['label']; +} +print ''; +//print ''.$this->tpl['label'].''; print ''.$this->tpl['qty'].(($this->tpl['efficiency'] > 0 && $this->tpl['efficiency'] < 1) ? ' / '.$form->textwithpicto($this->tpl['efficiency'], $langs->trans("ValueOfMeansLoss")).' = '.$qtytoconsumeforline : '').''; print ''.(empty($this->tpl['stock']) ? 0 : price2num($this->tpl['stock'], 'MS')); if ($this->tpl['seuil_stock_alerte'] != '' && ($this->tpl['stock'] < $this->tpl['seuil_stock_alerte'])) { @@ -61,5 +79,83 @@ print ''; //print ''; print ''; print ''."\n"; + +// Select of all the sub-BOM lines +$sql = 'SELECT rowid, fk_bom_child, fk_product, qty FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl'; +$sql.= ' WHERE fk_bom ='. (int) $tmpbom->id; +$resql = $this->db->query($sql); + +if ($resql) { + // Loop on all the sub-BOM lines if they exist + while ($obj = $this->db->fetch_object($resql)) { + $sub_bom_product = new Product($this->db); + $sub_bom_product->fetch($obj->fk_product); + $sub_bom_product->load_stock(); + + $sub_bom = new BOM($this->db); + $sub_bom->fetch($obj->fk_bom_child); + + $sub_bom_line = new BOMLine($this->db); + $sub_bom_line->fetch($obj->rowid); + + //If hidden conf is set, we show directly all the sub-BOM lines + if (!empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT)) { + print ''; + } else { + print ''; + } + + // Product OR BOM + print ''; + if (!empty($obj->fk_bom_child)) { + print $sub_bom_product->getNomUrl(1); + print ' '.$langs->trans('or').' '; + print $sub_bom->getNomUrl(1); + } else { + print $sub_bom_product->getNomUrl(1); + print ''; + } + + // Qty + if ($sub_bom_line->qty_frozen > 0) { + print ''.price($sub_bom_line->qty, 0, '', 0, 0).''; + } else { + print ''.price($sub_bom_line->qty * $line->qty, 0, '', 0, 0).''; + } + + // Stock réel + if ($sub_bom_product->stock_reel > 0) { + print ''.$sub_bom_product->stock_reel.''; + } else { + print ' '; + } + + // Stock virtuel + if ($sub_bom_product->stock_theorique > 0) { + print ''.$sub_bom_product->stock_theorique.''; + } else { + print ' '; + } + + // Frozen qty + if ($sub_bom_line->qty_frozen > 0) { + print ''.$langs->trans('Yes').''; + } else { + print ' '; + } + + // Disable stock change + if ($sub_bom_line->disable_stock_change > 0) { + print ''.yn($sub_bom_line->disable_stock_change).''; + } else { + print ' '; + } + + print ''; + print ''; + print ''; + } +} + ?> From f921c10e3ac4204ff5bf5a313fe69ede88100a58 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Mon, 7 Feb 2022 16:28:58 +0100 Subject: [PATCH 02/24] =?UTF-8?q?Gestion=20js=20:=20d=C3=A9roulement=20des?= =?UTF-8?q?=20sous=20bom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/mrp/class/mo.class.php | 7 ++++ htdocs/mrp/mo_card.php | 41 +++++++++++++++++++++++- htdocs/mrp/tpl/originproductline.tpl.php | 2 +- 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 29db4bcb669..7a2b738b81e 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1312,6 +1312,13 @@ class Mo extends CommonObject $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE) ? '- '.$langs->trans("StockOnReception").'
' : ''); print ''; + // Product or sub-bom + print ''.$langs->trans('Description'); + if (!empty($conf->global->BOM_SUB_BOM)) { + print '   '.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'  '; + print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").' '; + } + print ''; print ''.$langs->trans('Ref').''; print ''.$langs->trans('Qty'); if ($this->bom->bomtype == 0) { diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 48e36831592..4ba3fe8f250 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -243,7 +243,46 @@ if ($action == 'create') { ?> - - + + + + array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('propal').')'), 'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'), @@ -8571,7 +8569,6 @@ class Form $sql = $possiblelink['sql']; $resqllist = $this->db->query($sql); - if ($resqllist) { $num = $this->db->num_rows($resqllist); $i = 0; diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index a686e2892f6..f3df78af869 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -675,7 +675,6 @@ class Mo extends CommonObject } $resultline = $moline->create($user, false); // Never use triggers here - if ($resultline <= 0) { $error++; $this->error = $moline->error; @@ -1206,7 +1205,7 @@ class Mo extends CommonObject /** * Create an array of lines - * + * @param string $rolefilter * @return array|int array of lines if OK, <0 if KO */ public function getLinesArray($rolefilter = '') @@ -1694,9 +1693,7 @@ class MoLine extends CommonObjectLine $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); - $i = 0; - while ($i < ($limit ? min($limit, $num) : $num)) { $obj = $this->db->fetch_object($resql); diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index fc6ae99ad55..2b6e7f5dbe4 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php'; require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; + // Load translation files required by the page $langs->loadLangs(array("mrp", "other")); @@ -112,7 +114,6 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - if (empty($reshook)) { $error = 0; @@ -130,14 +131,11 @@ if (empty($reshook)) { if ($cancel && !empty($backtopageforcancel)) { $backtopage = $backtopageforcancel; } - - - $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 - if ($action == 'add' && empty($id)) { + if ($action == 'add' && empty($id) && !empty($TBomLineId)) { $noback = ""; include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; @@ -281,48 +279,11 @@ if ($action == 'create') { print dol_get_fiche_end(); + print mrpCollapseBomManagement(); + ?> Date: Tue, 15 Feb 2022 16:24:39 +0100 Subject: [PATCH 16/24] Clean Code --- htdocs/langs/en_US/mrp.lang | 1 + htdocs/mrp/class/mo.class.php | 2 +- htdocs/mrp/mo_card.php | 14 +++++--------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 97b2634d40d..e3167bb7109 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -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 MOAndLines=Manufacturing Orders and lines MoChildGenerate=Generate Child Mo +ParentMo=MO Parent diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index f3df78af869..0eb01e09cb5 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1205,7 +1205,7 @@ class Mo extends CommonObject /** * 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 */ public function getLinesArray($rolefilter = '') diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 2b6e7f5dbe4..a104a9a5d31 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -133,10 +133,9 @@ if (empty($reshook)) { } $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)) { - $noback = ""; + $noback = 0; include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; $mo_parent = $object; @@ -163,16 +162,13 @@ if (empty($reshook)) { $res = $object->add_object_linked('mo', $mo_parent->id); } - $noback = 0; - - header("Location: ".$urltogo); + header("Location: ".dol_buildpath('/mrp/mo_list.php', 1)); 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'; - - // Actions when linking object each other 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(); if (is_object($mo_parent)) { print ''; - print '' . $langs->trans('MOParent') . ''; + print '' . $langs->trans('ParentMo') . ''; print '' .$mo_parent->getNomUrl(1).''; print ''; } From c2bc3b20bbfd8c40c0e41326f3e8ea9f62417ec6 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 17 Feb 2022 11:05:03 +0100 Subject: [PATCH 17/24] Don't display collapse if no bom on bomline --- htdocs/mrp/tpl/originproductline.tpl.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index d261764f1c8..78d58062d4c 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -45,10 +45,12 @@ print 'getNomUrl(1); - print ' '; - print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open')); + if($tmpbom->id) { + print ' ' . $langs->trans("or") . ' '; + print $tmpbom->getNomUrl(1); + print ' '; + print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open')); + } print ''; } else { print $this->tpl['label']; @@ -92,6 +94,7 @@ $resql = $this->db->query($sql); if ($resql) { // Loop on all the sub-BOM lines if they exist while ($obj = $this->db->fetch_object($resql)) { + $sub_bom_product = new Product($this->db); $sub_bom_product->fetch($obj->fk_product); $sub_bom_product->load_stock(); From 7e6a5d5792ed06a41e6ad35a43e1f9bcc2c83854 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 17 Feb 2022 10:13:30 +0000 Subject: [PATCH 18/24] Fixing style errors. --- htdocs/mrp/tpl/originproductline.tpl.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index 78d58062d4c..17ee9305726 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -45,7 +45,7 @@ print 'getNomUrl(1); print ' '; @@ -94,7 +94,6 @@ $resql = $this->db->query($sql); if ($resql) { // Loop on all the sub-BOM lines if they exist while ($obj = $this->db->fetch_object($resql)) { - $sub_bom_product = new Product($this->db); $sub_bom_product->fetch($obj->fk_product); $sub_bom_product->load_stock(); From c4a8bffa4822276a67ba15a5b39025c3ee0369c3 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Mon, 21 Feb 2022 10:05:18 +0100 Subject: [PATCH 19/24] FIX Travis : global $db --- htdocs/mrp/tpl/originproductline.tpl.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index 78d58062d4c..f4dbf74ea7d 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -22,19 +22,22 @@ if (empty($conf) || !is_object($conf)) { exit; } +global $db; + if (!is_object($form)) { $form = new Form($db); } + $qtytoconsumeforline = $this->tpl['qty'] / ( ! empty($this->tpl['efficiency']) ? $this->tpl['efficiency'] : 1 ); /*if ((empty($this->tpl['qty_frozen']) && $this->tpl['qty_bom'] > 1)) { $qtytoconsumeforline = $qtytoconsumeforline / $this->tpl['qty_bom']; }*/ $qtytoconsumeforline = price2num($qtytoconsumeforline, 'MS'); -$tmpproduct = new Product($this->db); +$tmpproduct = new Product($db); $tmpproduct->fetch($line->fk_product); -$tmpbom = new BOM($this->db); +$tmpbom = new BOM($db); $res = $tmpbom->fetch($line->fk_bom_child); ?> @@ -89,20 +92,20 @@ print ''."\n"; // Select of all the sub-BOM lines $sql = 'SELECT rowid, fk_bom_child, fk_product, qty FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl'; $sql.= ' WHERE fk_bom ='. (int) $tmpbom->id; -$resql = $this->db->query($sql); +$resql = $db->query($sql); if ($resql) { // Loop on all the sub-BOM lines if they exist - while ($obj = $this->db->fetch_object($resql)) { + while ($obj = $db->fetch_object($resql)) { - $sub_bom_product = new Product($this->db); + $sub_bom_product = new Product($db); $sub_bom_product->fetch($obj->fk_product); $sub_bom_product->load_stock(); - $sub_bom = new BOM($this->db); + $sub_bom = new BOM($db); $sub_bom->fetch($obj->fk_bom_child); - $sub_bom_line = new BOMLine($this->db); + $sub_bom_line = new BOMLine($db); $sub_bom_line->fetch($obj->rowid); //If hidden conf is set, we show directly all the sub-BOM lines From e02b82e3464abe8bf46de196737fc0044c6b3502 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 21 Feb 2022 09:09:39 +0000 Subject: [PATCH 20/24] Fixing style errors. --- htdocs/mrp/tpl/originproductline.tpl.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index 035cb3a2184..22e53ae721e 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -96,7 +96,6 @@ $resql = $db->query($sql); if ($resql) { // Loop on all the sub-BOM lines if they exist while ($obj = $db->fetch_object($resql)) { - $sub_bom_product = new Product($db); $sub_bom_product->fetch($obj->fk_product); $sub_bom_product->load_stock(); From f177973efe21dba3e6984d549ecac06249e64419 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Mon, 21 Feb 2022 10:13:25 +0100 Subject: [PATCH 21/24] Don't create Mo Child if it's only a product line on BOM --- htdocs/mrp/tpl/originproductline.tpl.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index 035cb3a2184..d8a7eb99ed8 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -82,9 +82,13 @@ print ''; //print ''; print ''; -print ''; -print ''; -print ''; +if($tmpbom->id) { + print ''; + print ''; + print ''; +} else { + print ' '; +} print ''."\n"; From cf2f2c283b4928b4f9e9bfc4180511f5ef261f9e Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 21 Feb 2022 09:17:20 +0000 Subject: [PATCH 22/24] Fixing style errors. --- htdocs/mrp/tpl/originproductline.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index 096ae6109fd..d65f625048b 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -82,7 +82,7 @@ print ''; //print ''; print ''; -if($tmpbom->id) { +if ($tmpbom->id) { print ''; print ''; print ''; From 45fe83289f77614d5315c1745b5f1db45b51c598 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 22 Feb 2022 11:32:33 +0100 Subject: [PATCH 23/24] MoChild category --- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/langs/en_US/mrp.lang | 1 + htdocs/mrp/mo_card.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b8e1850feaf..6ee9bf79049 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8339,7 +8339,7 @@ class Form * @param array $compatibleImportElementsList Array of compatibles elements object for "import from" action * @return int <0 if KO, >=0 if OK */ - public function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleImportElementsList = false) + public function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleImportElementsList = false, $title='RelatedObjects') { global $conf, $langs, $hookmanager; global $bc, $action; @@ -8358,7 +8358,7 @@ class Form $nbofdifferenttypes = count($object->linkedObjects); print ''; - print load_fiche_titre($langs->trans('RelatedObjects'), $morehtmlright, '', 0, 0, 'showlinkedobjectblock'); + print load_fiche_titre($langs->trans($title), $morehtmlright, '', 0, 0, 'showlinkedobjectblock'); print '
'; diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index e3167bb7109..cef9054f727 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -109,3 +109,4 @@ CollapseBOMHelp=You can define the default display of the details of the nomencl MOAndLines=Manufacturing Orders and lines MoChildGenerate=Generate Child Mo ParentMo=MO Parent +MOChild=MO Child diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index a104a9a5d31..34ed92a2164 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -731,7 +731,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Show links to link elements $linktoelem = $form->showLinkToObjectBlock($object, null, array('mo')); - $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, false, 'MOChild'); print '
'; From e5ba5b208e5f4732dcdf2f285340df552d83c55d Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 22 Feb 2022 11:36:41 +0100 Subject: [PATCH 24/24] Correct Stickler --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6ee9bf79049..48b7b27cc14 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8339,7 +8339,7 @@ class Form * @param array $compatibleImportElementsList Array of compatibles elements object for "import from" action * @return int <0 if KO, >=0 if OK */ - public function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleImportElementsList = false, $title='RelatedObjects') + public function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleImportElementsList = false, $title = 'RelatedObjects') { global $conf, $langs, $hookmanager; global $bc, $action;