From 3ffcc3b63f5925e80111bea385633e843f4081e9 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Wed, 9 Jan 2008 15:52:49 -0600 Subject: [PATCH] Shelves - bugfix, toggle "Holds" link, add "Author" column to intranet Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/VirtualShelves.pm | 5 +- .../en/modules/virtualshelves/shelves.tmpl | 74 +++++++++---------- opac/opac-shelves.pl | 12 +-- 3 files changed, 46 insertions(+), 45 deletions(-) diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm index 8312bc67f4..30fcbe892f 100644 --- a/C4/VirtualShelves.pm +++ b/C4/VirtualShelves.pm @@ -356,8 +356,9 @@ sub ShelfPossibleAction { my $sth = $dbh->prepare($query); $sth->execute($shelfnumber); my ( $owner, $category ) = $sth->fetchrow; - return 1 if (($category >= 3 or $owner eq $user) && $action eq 'manage' ); - return 1 if (($category >= 2 or $owner eq $user) && $action eq 'view' ); + return 1 if ($owner eq $user); + return 1 if ( $category >= 3); + return 1 if (($category >= 2) && $action eq 'view' ); return 0; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl index 2415a7cd13..b8f80464b0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl @@ -85,48 +85,46 @@ function confirmDelete(s,n){ Contents of - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + + +
-   -   Type TitleAuthor Call No.  
- " /> - - /../img/.gif" alt="" title="" /> -

- - "> - - - - - "> - - - - "> - - - - -

-

">Holds
+ " /> + + /../img/.gif" alt="" title="" /> + + + "> + + + "> + + "> + + + + + + ">Holds + +
diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl index a118e432b5..abef815354 100755 --- a/opac/opac-shelves.pl +++ b/opac/opac-shelves.pl @@ -156,11 +156,13 @@ SWITCH: { foreach (grep {$i++ % 2} @$items) { # every other item $_->{toggle} = 1; } + my $manageshelf = &ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ); + ($manageshelf) and $showadd = 1; $template->param( shelfname => $shelflist->{$shelfnumber}->{'shelfname'}, shelfnumber => $shelfnumber, viewshelf => $query->param('viewshelf'), - manageshelf => &ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ), + manageshelf => $manageshelf, itemsloop => $items, ); } # else {;} # FIXME - some kind of warning *may* be in order @@ -227,11 +229,11 @@ foreach my $element (sort { lc($shelflist->{$a}->{'shelfname'}) cmp lc($shelflis $line{'firstname'} = $shelflist->{$element}->{'firstname'}; $line{ 'surname' } = $shelflist->{$element}->{ 'surname' }; } - if ($shelflist->{$element}->{'category'} eq 2) { - push (@shelvesloop, \%line); - } elsif ($shelflist->{$element}->{'category'} eq 1) { + if ($shelflist->{$element}->{'category'} eq '1') { push (@shelveslooppriv, \%line); - } + } else { + push (@shelvesloop, \%line); + } } $template->param( -- 2.39.5