From af57949d88a10daec2fdc993dd73ee2b2762fa10 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Mon, 31 Dec 2007 13:01:18 -0600 Subject: [PATCH] opac-shevles - fix for CSS alternating highlight lines Signed-off-by: Joshua Ferraro --- koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl | 4 +++- opac/opac-shelves.pl | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl index f0692b9127..66c670e154 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl @@ -157,7 +157,9 @@ - + + +
List NameContents
"> item(s)
"> item(s)
diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl index d618c5225c..d92823d306 100755 --- a/opac/opac-shelves.pl +++ b/opac/opac-shelves.pl @@ -98,6 +98,7 @@ if ( $query->param('modifyshelfcontents') ) { AddToShelf( $biblio->{'biblionumber'}, $shelfnumber ); foreach ( $query->param ) { /REM-(\d+)/ or next; + $debug and warn "SHELVES: user $loggedinuser removing item $1 from shelf $shelfnumber"; DelFromShelf( $1, $shelfnumber ); # $1 is biblionumber } } @@ -150,6 +151,10 @@ SWITCH: { if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'view' ) ) { my $items = GetShelfContents($shelfnumber); $showadd = 1; + my $i = 0; + foreach (grep {$i++ % 2} @$items) { # every other item + $_->{toggle} = 1; + } $template->param( shelfname => $shelflist->{$shelfnumber}->{'shelfname'}, shelfnumber => $shelfnumber, @@ -208,7 +213,7 @@ my @shelveslooppriv; foreach my $element (sort { lc($shelflist->{$a}->{'shelfname'}) cmp lc($shelflist->{$b}->{'shelfname'}) } keys %$shelflist) { my %line; $color = ($color) ? 0 : 1; - $line{'toggle'} = $color; + $color and $line{'toggle'} = $color; $line{'shelf'} = $element; $line{'shelfname'} = $shelflist->{$element}->{'shelfname'}; $line{'sortfield'} = $shelflist->{$element}->{'sortfield'}; -- 2.39.5