From c5e1ae26c491791ccb4e528a0bb766eb784940fa Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 30 Dec 2005 22:19:29 +0000 Subject: [PATCH 1/1] allow odd page sizes and "center" the target git-svn-id: svn://svn.open-ils.org/ILS/trunk@2564 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Application/Storage/Publisher/asset.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/asset.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/asset.pm index 7ef8d01fde..b14281f385 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/asset.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/asset.pm @@ -137,8 +137,9 @@ sub cn_browse_target { my $org = $args{org_unit}; my $depth = $args{depth}; my $size = $args{page_size} || 20; - $size /= 2; - $size = int($size); + my $topsize = $size / 2; + $topsize = int($topsize); + $bottomsize = $size - $topsize; my $table = asset::call_number->table; @@ -165,7 +166,7 @@ sub cn_browse_target { limit 1000 ) as foo order by 1 desc, 4 desc - limit $size + limit $topsize ) as bar order by 1,4; SQL @@ -187,7 +188,7 @@ sub cn_browse_target { limit 1000 ) as foo order by 1,4 - limit $size; + limit $bottomsize; SQL my $sth = asset::call_number->db_Main->prepare($top_sql); -- 2.43.2