#!/usr/bin/perl #script to provide bookshelf management # # $Header$ # # Change log is at the bottom of the file # use strict; use C4::Search; use CGI; use C4::Output; use C4::BookShelves; use C4::Circulation::Circ2; my $env; my $query = new CGI; print $query->header; my $headerbackgroundcolor='#663266'; my $circbackgroundcolor='#555555'; my $circbackgroundcolor='#550000'; my $linecolor1='#bbbbbb'; my $linecolor2='#dddddd'; print startpage(); print startmenu('catalogue'); my ($shelflist) = GetShelfList(); if ($query->param('modifyshelfcontents')) { my $shelfnumber=$query->param('shelfnumber'); my $barcode=$query->param('addbarcode'); my ($item) = getiteminformation($env, 0, $barcode); AddToShelf($env, $item->{'itemnumber'}, $shelfnumber); foreach ($query->param) { if (/REM-(\d*)/) { my $itemnumber=$1; RemoveFromShelf($env, $itemnumber, $shelfnumber); } } } SWITCH: { if ($query->param('viewshelf')) { viewshelf($query->param('viewshelf')); last SWITCH;} print << "EOF";
EOF my $color=''; foreach (sort keys %$shelflist) { ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1); print "\n"; } print "
Shelf List
$shelflist->{$_}->{'shelfname'} ($shelflist->{$_}->{'count'} books)
\n"; } sub viewshelf { my $shelfnumber=shift; my ($itemlist) = GetShelfContents($env, $shelfnumber); my $item=''; print << "EOF";
Shelf List

EOF my $color=''; foreach $item (sort {$a->{'barcode'} cmp $b->{'barcode'}} @$itemlist) { ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1); print << "EOF"; EOF } print << "EOF";
Add a book by barcode:

Contents of $shelflist->{$shelfnumber}->{'shelfname'} shelf
{'itemnumber'}> $item->{'barcode'} $item->{'title'} $item->{'author'}

EOF } # # $Log$ # Revision 1.2 2001/02/07 23:47:43 tonnesen # Added header and log substition variables # # Revision 1.1 2001/02/07 20:27:16 tonnesen # Start of code to implement virtual bookshelves in Koha. # # #