[ bug #1546 ] Incorrect page number when searching in the list of bank transactions

This commit is contained in:
Marcos García de La Fuente 2014-09-14 14:32:17 +02:00
parent ba70c1a08a
commit 7bac9444e6
2 changed files with 16 additions and 10 deletions

View File

@ -25,6 +25,7 @@ Fix: [ bug #1544 ] Can remove date from invoice.
Fix: list event view lost type event filter. Fix: list event view lost type event filter.
Fix: Add code save on create event. Fix: Add code save on create event.
Fix: SQL injection. Fix: SQL injection.
Fix: [ bug #1546 ] Incorrect page number when searching in the list of bank transactions
***** ChangeLog for 3.5.4 compared to 3.5.3 ***** ***** ChangeLog for 3.5.4 compared to 3.5.3 *****
Fix: Hide title of event when agenda module disabled. Fix: Hide title of event when agenda module disabled.

View File

@ -5,7 +5,7 @@
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr> * Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -253,17 +253,22 @@ if ($id > 0 || ! empty($ref))
//Total pages //Total pages
$totalPages = ceil($total_lines/$viewline); $totalPages = ceil($total_lines/$viewline);
if ($page > 0) if ($totalPages == 0) {
{ $page = 0;
} else {
if ($page > 0) {
$limitsql = ($totalPages - $page) * $viewline; $limitsql = ($totalPages - $page) * $viewline;
if ($limitsql < $viewline) $limitsql = $viewline; if ($limitsql < $viewline) {
$nbline = $limitsql; $limitsql = $viewline;
} }
else $nbline = $limitsql;
{ } else {
$page = 0; $page = 0;
$limitsql = $nbline; $limitsql = $nbline;
} }
}
//print $limitsql.'-'.$page.'-'.$viewline; //print $limitsql.'-'.$page.'-'.$viewline;
// Onglets // Onglets