From b97223edd7a3ae6f1839fd18be23da12a02a9699 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Aug 2016 19:01:51 +0200 Subject: [PATCH] Fix: link to link to objects not visible --- htdocs/core/class/html.form.class.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3354aa01209..813e1aa9a12 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5266,8 +5266,8 @@ class Form * Show block with links to link to other objects. * * @param CommonObject $object Object we want to show links to - * @param array $restrictlinksto Restrict links to some elements, for exemple array('order') or array('supplier_order') - * @return string <0 if KO, >0 if OK + * @param array $restrictlinksto Restrict links to some elements, for exemple array('order') or array('supplier_order'). null or array() if no restriction. + * @return string <0 if KO, >0 if OK */ function showLinkToObjectBlock($object, $restrictlinksto=array()) { @@ -5278,8 +5278,7 @@ class Form if (! is_object($object->thirdparty)) $object->fetch_thirdparty(); - - if (((! is_array($restrictlinksto)) || in_array('order',$restrictlinksto)) + if ((empty($restrictlinksto) || in_array('order',$restrictlinksto)) && ! empty($conf->commande->enabled)) { $linktoelem.=($linktoelem?'   ':'').'' . $langs->trans('LinkedOrder') . ''; @@ -5346,7 +5345,7 @@ class Form print ''; } - if ((in_array('fichinter',$restrictlinksto)) && ! empty($conf->ficheinter->enabled)) + if ((empty($restrictlinksto) || (in_array('fichinter',$restrictlinksto))) && ! empty($conf->ficheinter->enabled)) { $linktoelem.=($linktoelem?'   ':'').'' . $langs->trans('LinkedFichinter') . ''; @@ -5407,7 +5406,7 @@ class Form print ''; } - if (((! is_array($restrictlinksto)) || in_array('supplier_order',$restrictlinksto)) + if ((empty($restrictlinksto) || in_array('supplier_order',$restrictlinksto)) && ! empty($conf->fournisseur->enabled)) { $linktoelem.=($linktoelem?'   ':'').'' . $langs->trans('LinkedOrder') . '';