diff --git a/htdocs/mrp/tpl/linkedobjectblock.tpl.php b/htdocs/mrp/tpl/linkedobjectblock.tpl.php
index 516e4eddf51..a08e4c25ad2 100644
--- a/htdocs/mrp/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/mrp/tpl/linkedobjectblock.tpl.php
@@ -26,7 +26,7 @@ if (empty($conf) || !is_object($conf)) {
print "\n";
-global $user, $db;
+global $user, $db, $hookmanager;
global $noMoreLinkedObjectBlockAfter;
$langs = $GLOBALS['langs'];
@@ -42,31 +42,34 @@ $ilink = 0;
$mo_static = new Mo($db);
$res = $mo_static->fetch($object->id);
$TMoChilds = $mo_static->getMoChilds();
+$hookmanager->initHooks('LinesLinkedObjectBlock');
+$parameters = array('TMoChilds' => $TMoChilds);
+$reshook = $hookmanager->executeHooks('LinesLinkedObjectBlock', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+if (empty($reshook)) {
+ foreach ($TMoChilds as $key => $objectlink) {
+ $ilink++;
-foreach ($TMoChilds as $key => $objectlink) {
- $ilink++;
+ $trclass = 'oddeven';
- $trclass = 'oddeven';
+ echo '
';
+ echo '| ' . $langs->trans("ManufacturingOrder");
+ if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
+ print ' ';
+ echo ' | ' . $objectlink->getNomUrl(1) . ' | ';
- echo '
';
- echo '| '.$langs->trans("ManufacturingOrder");
- if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
- print ' ';
+ // $result = $product_static->fetch($objectlink->fk_product);
+ print ' | ';
+ echo '' . dol_print_date($objectlink->date_creation, 'day') . ' | ';
+ echo '- | ';
+ echo '' . $objectlink->getLibStatut(3) . ' | ';
+ echo '';
+ // For now, shipments must stay linked to order, so link is not deletable
+ echo 'id . '&action=dellink&token=' . newToken() . '&dellinkid=' . $key . '">' . img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink') . '';
+ echo ' | ';
+ echo "
\n";
}
- echo '';
- echo ''.$objectlink->getNomUrl(1).' | ';
-
- echo '';
- // $result = $product_static->fetch($objectlink->fk_product);
- print ' | ';
- echo ''.dol_print_date($objectlink->date_creation, 'day').' | ';
- echo '- | ';
- echo ''.$objectlink->getLibStatut(3).' | ';
- echo '';
- // For now, shipments must stay linked to order, so link is not deletable
- echo 'id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'';
- echo ' | ';
- echo "\n";
}
-
echo "\n";