From d57e2e3997cb5c9e5c2ea6a4b223e241b4e5559d Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@users.sourceforge.net>
Date: Sun, 29 Jul 2007 10:32:07 +0000
Subject: [PATCH] Gestion generique de la navigation Fiche suivante-Precedente

---
 htdocs/adherents/fiche.php | 8 +-------
 htdocs/html.form.class.php | 2 +-
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php
index d35be89415d..b7ad7137750 100644
--- a/htdocs/adherents/fiche.php
+++ b/htdocs/adherents/fiche.php
@@ -809,10 +809,6 @@ if ($rowid && $action != 'edit')
 
 	if ($msg) print '<div class="error">'.$msg.'</div>';
 
-	$result=$adh->load_previous_next_id($adh->next_prev_filter);
-	if ($result < 0) dolibarr_print_error($db,$adh->error);
-	$previous_id = $adh->id_previous?'<a href="'.$_SERVER["PHP_SELF"].'?rowid='.urlencode($adh->id_previous).'">'.img_previous().'</a>':'';
-	$next_id     = $adh->id_next?'<a href="'.$_SERVER["PHP_SELF"].'?rowid='.urlencode($adh->id_next).'">'.img_next().'</a>':'';
 
     // Confirmation de la suppression de l'adh�rent
     if ($action == 'delete')
@@ -886,9 +882,7 @@ if ($rowid && $action != 'edit')
     // Ref
     print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
 	print '<td class="valeur" colspan="2">';
-	if ($previous_id || $next_id) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
-	print $adh->id;
-	if ($previous_id || $next_id) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_id.'</td><td class="nobordernopadding" align="center" width="20">'.$next_id.'</td></tr></table>';
+	print $html->showrefnav($adh);
 	print '</td></tr>';
 
     // Nom
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index e00e8821014..6a4014ef317 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -3337,7 +3337,7 @@ class Form
           $next_ref     = $object->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.urlencode($object->ref_next).'">'.img_next().'</a>':'';
 
 		if ($previous_ref || $next_ref) $ret.='<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
-		$ret.=$object->getNomUrl(1);
+		$ret.=$object->getNomUrl(0);
 		if ($previous_ref || $next_ref) {
 			$ret.='</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td>';
 			$ret.='<td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
-- 
GitLab