koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/C4 Koha.pm [rel_3_0]


From: Antoine Farnault
Subject: [Koha-cvs] koha/C4 Koha.pm [rel_3_0]
Date: Mon, 25 Sep 2006 14:39:19 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     Antoine Farnault <toins>        06/09/25 14:39:19

Modified files:
        C4             : Koha.pm 

Log message:
        missing function added : getnbpages

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Koha.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.40.2.3&r2=1.40.2.4

Patches:
Index: Koha.pm
===================================================================
RCS file: /sources/koha/koha/C4/Koha.pm,v
retrieving revision 1.40.2.3
retrieving revision 1.40.2.4
diff -u -b -r1.40.2.3 -r1.40.2.4
--- Koha.pm     20 Sep 2006 16:45:01 -0000      1.40.2.3
+++ Koha.pm     25 Sep 2006 14:39:19 -0000      1.40.2.4
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Koha.pm,v 1.40.2.3 2006/09/20 16:45:01 toins Exp $
+# $Id: Koha.pm,v 1.40.2.4 2006/09/25 14:39:19 toins Exp $
 
 use strict;
 require Exporter;
@@ -25,7 +25,7 @@
 use C4::Output;
 use vars qw($VERSION @ISA @EXPORT);
 
-$VERSION = do { my @v = '$Revision: 1.40.2.3 $' =~ /\d+/g; shift(@v) . "." . 
join("_", map {sprintf "%03d", $_ } @v); };
+$VERSION = do { my @v = '$Revision: 1.40.2.4 $' =~ /\d+/g; shift(@v) . "." . 
join("_", map {sprintf "%03d", $_ } @v); };
 
 =head1 NAME
 
@@ -805,6 +805,19 @@
     }
 }
 
+=item getnbpages
+
+Returns the number of pages to display in a pagination bar, given the number
+of items and the number of items per page.
+
+=cut
+
+sub getnbpages {
+    my ($nb_items, $nb_items_per_page) = @_;
+
+    return int(($nb_items - 1) / $nb_items_per_page) + 1;
+}
+
 =item getallthemes
 
   (@themes) = &getallthemes('opac');




reply via email to

[Prev in Thread] Current Thread [Next in Thread]