X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=moredetail.pl;h=8a7e0e271db0b0d5464de30d613e055c6c3b3648;hb=d5dfb954e26b059ee7f1ad157b8b730d9a4e49c0;hp=789508bf7fe0cfd11669a37544c442a814394edd;hpb=0376493cd4bf8bc88a37e5424af4d67e1fa816d8;p=koha.git diff --git a/moredetail.pl b/moredetail.pl index 789508bf7f..8a7e0e271d 100755 --- a/moredetail.pl +++ b/moredetail.pl @@ -1,198 +1,107 @@ #!/usr/bin/perl -#script to display detailed information -#written 8/11/99 - +# $Id$ + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +use HTML::Template; use strict; -#use DBI; -use C4::Search; +require Exporter; use C4::Koha; -use C4::Output; -use C4::Acquisitions; - use CGI; -my $input = new CGI; -print $input->header; -#whether it is called from the opac of the intranet -my $type=$input->param('type'); -#setup colours -my $main; -my $secondary; -if ($type eq 'opac'){ - $main='#99cccc'; - $secondary='#efe5ef'; +use C4::Search; +use C4::Catalogue; +use C4::Output; # contains gettemplate +use C4::Auth; + +my $query=new CGI; + +my $includes = C4::Context->config('includes') || + "/usr/local/www/hdl/htdocs/includes"; +my $startfrom=$query->param('startfrom') || 0; + +my $subject=$query->param('subject'); +# if its a subject we need to use the subject.tmpl +my $template; +if ($subject){ + $template = gettemplate("catalogue/subject.tmpl"); } else { - $main='#cccc99'; - $secondary='#ffffcc'; + $template = gettemplate("catalogue/moredetail.tmpl"); } -print startpage(); -print startmenu($type); -my $blah; - -my $bib=$input->param('bib'); -my $title=$input->param('title'); -my $bi=$input->param('bi'); -my $data=bibitemdata($bi); +my $flagsrequired; +$flagsrequired->{catalogue}=1; +my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 0, $flagsrequired); -my (@items)=itemissues($bi); -my ($order,$ordernum)=getorder($bi,$bib); -#print @items; -my $count=@items; +# get variables -my $i=0; -print center(); +my $biblionumber=$query->param('bib'); +my $title=$query->param('title'); +my $bi=$query->param('bi'); -my $dewey = $data->{'dewey'}; -$dewey =~ s/0+$//; -if ($dewey eq "000.") { $dewey = "";}; -if ($dewey < 10){$dewey='00'.$dewey;} -if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;} +my $data=bibitemdata($bi); +my $dewey = $data->{'dewey'}; +$dewey =~ s/0+$//; +if ($dewey eq "000.") { $dewey = "";}; +if ($dewey < 10){$dewey='00'.$dewey;} +if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;} if ($dewey <= 0){ - $dewey=''; -} -$dewey=~ s/\.$//; -print < - -printend -; -if ($type eq 'catmain'){ - print "Catalogue Maintenance
"; + $dewey=''; } -print <$data->{'title'} ($data->{'author'})

-

-

- - - - - - - - - - -
$data->{'biblioitemnumber'} GROUP - $data->{'description'}
- - -
- -Biblionumber: $bib
-Item Type: $data->{'itemtype'}
-Loan Length: $data->{'loanlength'}
-Rental Charge: $data->{'rentalcharge'}
-Classification: $data->{'classification'}$dewey$data->{'subclass'}
-ISBN: $data->{'isbn'}
-Publisher: $data->{'publishercode'}
-Place: $data->{'place'}
-Date: $data->{'publicationyear'}
-Volume: $data->{'volumeddesc'}
-Pages: $data->{'pages'}
-Illus: $data->{'illus'}
-Size: $data->{'size'}
-Notes: $data->{'bnotes'}
-No. of Items: $count - -printend -; -if ($type eq 'catmain'){ - print "
{'biblioitemnumber'}&bib=$data->{'biblionumber'}>Shift to another biblio"; - -} -print < -
-
-printend -; - -for (my $i=0;$i<$count;$i++){ -print < - - - - - - - -
BARCODE $items[$i]->{'barcode'}
-
- -{'itemnumber'}> - - - -
-printend -; -$items[$i]->{'itemlost'}=~ s/0/No/; -$items[$i]->{'itemlost'}=~ s/1/Yes/; -$items[$i]->{'withdrawn'}=~ s/0/No/; -$items[$i]->{'withdrawn'}=~ s/1/Yes/; -$items[$i]->{'replacementprice'}+=0.00; - -my $year=substr($items[$i]->{'timestamp0'},0,4); -my $mon=substr($items[$i]->{'timestamp0'},4,2); -my $day=substr($items[$i]->{'timestamp0'},6,2); -$items[$i]->{'timestamp0'}="$day/$mon/$year"; - -$items[$i]->{'dateaccessioned'} = slashifyDate($items[$i]->{'dateaccessioned'}); -$items[$i]->{'datelastseen'} = slashifyDate($items[$i]->{'datelastseen'}); - -print < -Home Branch: $items[$i]->{'homebranch'}
-Last seen: $items[$i]->{'datelastseen'}
-Last borrowed: $items[$i]->{'timestamp0'}
-printend -; -if ($items[$i] eq 'Available'){ - print "Currently on issue to:
"; -} else { - print "Currently on issue to: {'borrower0'}>$items[$i]->{'card'}
"; -} -print <Last Borrower 1: $items[$i]->{'card0'}
-Last Borrower 2: $items[$i]->{'card1'}
-Current Branch: $items[$i]->{'holdingbranch'}
-Replacement Price: $items[$i]->{'replacementprice'}
-Item lost: $items[$i]->{'itemlost'}
-Paid for: $items[$i]->{'paidfor'}
-Notes: $items[$i]->{'itemnotes'}
-Renewals: $items[$i]->{'renewals'}
-{'booksellerinvoicenumber'}&catview=yes>Accession Date: $items[$i]->{'dateaccessioned'}
-printend -; -if ($items[$i]->{'wthdrawn'} eq '1'){ - $items[$i]->{'wthdrawn'}="Yes"; -} else { - $items[$i]->{'wthdrawn'}="No"; -} -print <Cancelled: $items[$i]->{'wthdrawn'}
-Total Issues: $items[$i]->{'issues'}
-Group Number: $bi
-Biblio number: $bib
- +$dewey=~ s/\.$//; +$data->{'dewey'}=$dewey; +my @results; - -
- -printend -; +my (@items)=itemissues($bi); +my $count=@items; +$data->{'count'}=$count; +my ($order,$ordernum)=getorder($bi,$biblionumber); + +my $env; +$env->{itemcount}=1; + +$results[0]=$data; + +foreach my $item (@items){ + $item->{'itemlost'}=~ s/0/No/; + $item->{'itemlost'}=~ s/1/Yes/; + $item->{'withdrawn'}=~ s/0/No/; + $item->{'withdrawn'}=~ s/1/Yes/; + $item->{'replacementprice'}+=0.00; + my $year=substr($item->{'timestamp0'},0,4); + my $mon=substr($item->{'timestamp0'},4,2); + my $day=substr($item->{'timestamp0'},6,2); + $item->{'timestamp0'}="$day/$mon/$year"; + $item->{'dateaccessioned'} = slashifyDate($item->{'dateaccessioned'}); + $item->{'datelastseen'} = slashifyDate($item->{'datelastseen'}); + $item->{'ordernumber'} = $ordernum; + $item->{'booksellerinvoicenumber'} = $order->{'booksellerinvoicenumber'}; + + if ($item->{'date_due'} eq 'Available'){ + $item->{'issue'}="Available
"; + } else { + $item->{'issue'}="Currently on issue to: {'borrower0'}>$item->{'card'}
"; + } } -print < - -printend -; - -print endcenter(); +$template->param(includesdir => $includes); +$template->param(BIBITEM_DATA => \@results); +$template->param(ITEM_DATA => \@items); +$template->param(loggedinuser => $loggedinuser); +print "Content-Type: text/html\n\n", $template->output; -print endmenu($type); -print endpage();