diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index c8c9fcc1683..e00e8821014 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -3322,7 +3322,28 @@ class Form $select_month .= ''; return $select_month; } - + + /** + * \brief Affiche tableau avec ref et bouton navigation pour un objet metier + * \param object Objet a afficher + * \return string Portion HTML avec ref + boutons nav + */ + function showrefnav($object) + { + $ret=''; + + $object->load_previous_next_ref($object->next_prev_filter); + $previous_ref = $object->ref_previous?''.img_previous().'':''; + $next_ref = $object->ref_next?''.img_next().'':''; + + if ($previous_ref || $next_ref) $ret.=''; + $ret.='
'; + $ret.=$object->getNomUrl(1); + if ($previous_ref || $next_ref) { + $ret.=''.$previous_ref.''.$next_ref.'
'; + } + return $ret; + } } ?> diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 7e836708b1d..aa644658e95 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -628,9 +628,6 @@ if ($_GET["id"] || $_GET["ref"]) print($mesg); - $product->load_previous_next_ref($product->next_prev_filter); - $previous_ref = $product->ref_previous?''.img_previous().'':''; - $next_ref = $product->ref_next?''.img_next().'':''; } if ($_GET["action"] <> 'edit' && $product->canvas <> '') { @@ -657,12 +654,9 @@ if ($_GET["id"] || $_GET["ref"]) // Reference print ''.$langs->trans("Ref").''; - if ($previous_ref || $next_ref) print '
'; - print ''.$product->ref.''; - if ($previous_ref || $next_ref) print ''.$previous_ref.''.$next_ref.'
'; + print $html->showrefnav($product); print ''; - $nblignes=6; if ($product->isproduct() && $conf->stock->enabled) $nblignes++; if ($product->isservice()) $nblignes++;