From 760d2617a0a482c1b92f5649cbc46c355f53f4cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Jul 2017 23:03:28 +0200 Subject: [PATCH] Can disable the search of previous/next in dol_banner --- htdocs/core/class/commonobject.class.php | 3 ++- htdocs/core/class/html.form.class.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d16c3688509..53de8e56eb8 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1309,7 +1309,7 @@ abstract class CommonObject * Load properties id_previous and id_next * * @param string $filter Optional filter. Example: " AND (t.field1 = 'aa' OR t.field2 = 'bb')" - * @param int $fieldid Name of field to use for the select MAX and MIN + * @param string $fieldid Name of field to use for the select MAX and MIN * @param int $nodbprefix Do not include DB prefix to forge table name * @return int <0 if KO, >0 if OK */ @@ -1322,6 +1322,7 @@ abstract class CommonObject dol_print_error('',get_class($this)."::load_previous_next_ref was called on objet with property table_element not defined"); return -1; } + if ($fieldid == 'none') return 1; // this->ismultientitymanaged contains // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 27115d12eb7..880f32cc580 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5864,7 +5864,7 @@ class Form * @param string $paramid Name of parameter to use to name the id into the URL next/previous link. * @param string $morehtml More html content to output just before the nav bar. * @param int $shownav Show Condition (navigation is shown if value is 1). - * @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field). + * @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field). Use 'none' to disable next/prev. * @param string $fieldref Name of field ref of object (object->ref) to show or 'none' to not show ref. * @param string $morehtmlref More html to show after ref. * @param string $moreparam More param to add in nav link url. Must start with '&...'.