From tonnesen@users.sourceforge.net Wed Feb 7 12:26:58 2001 From: Steve Tonnesen To: koha-devel@lists.koha-community.org Subject: [Koha-devel] CVS: koha shelves.pl,NONE,1.1 Date: Wed, 07 Feb 2001 12:27:19 -0800 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9024881484946141261==" --===============9024881484946141261== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Update of /cvsroot/koha/koha In directory usw-pr-cvs1:/tmp/cvs-serv31873/koha Added Files: shelves.pl=20 Log Message: Start of code to implement virtual bookshelves in Koha. --- NEW FILE --- #!/usr/bin/perl #script to provide bookshelf management # # $Header: /cvsroot/koha/koha/shelves.pl,v 1.1 2001/02/07 20:27:16 tonnesen E= xp $ # use strict; use C4::Search; use CGI; use C4::Output; use C4::BookShelves; use C4::Circulation::Circ2; my $env; my $query =3D new CGI; print $query->header; my $headerbackgroundcolor=3D'#663266'; my $circbackgroundcolor=3D'#555555'; my $circbackgroundcolor=3D'#550000'; my $linecolor1=3D'#bbbbbb'; my $linecolor2=3D'#dddddd'; print startpage(); print startmenu('catalogue'); my ($shelflist) =3D GetShelfList(); if ($query->param('modifyshelfcontents')) { my $shelfnumber=3D$query->param('shelfnumber'); my $barcode=3D$query->param('addbarcode'); my ($item) =3D getiteminformation($env, 0, $barcode); AddToShelf($env, $item->{'itemnumber'}, $shelfnumber); foreach ($query->param) { if (/REM-(\d*)/) { my $itemnumber=3D$1; RemoveFromShelf($env, $itemnumber, $shelfnumber); } } } SWITCH: { if ($query->param('viewshelf')) { viewshelf($query->param('viewshelf'));= last SWITCH;} print << "EOF";
EOF my $color=3D''; foreach (sort keys %$shelflist) { ($color eq $linecolor1) ? ($color=3D$linecolor2) : ($color=3D$linecolor1); print "\n"; } print "
Shelf List
$shelfli= st->{$_}->{'shelfname'} ($shelflist->{$_}->{'count'} books)
\n"; } sub viewshelf { my $shelfnumber=3Dshift; my ($itemlist) =3D GetShelfContents($env, $shelfnumber); my $item=3D''; print << "EOF";
Shelf List

EOF my $color=3D''; foreach $item (sort {$a->{'barcode'} cmp $b->{'barcode'}} @$itemlist) { ($color eq $linecolor1) ? ($color=3D$linecolor2) : ($color=3D$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: shelves.pl,v $ # Revision 1.1 2001/02/07 20:27:16 tonnesen # Start of code to implement virtual bookshelves in Koha. # # # --===============9024881484946141261==--