X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=detail.pl;h=20978161e93daaa7e45452475bef187ecc8379b4;hb=6b6f9798e76ba1a4fac63a91d972c480ea245f55;hp=96330868c239526257b87ff3bea71ce7fb4f4cb8;hpb=2db02a8285520bf82a141d5e3e5529f318dc2510;p=koha.git diff --git a/detail.pl b/detail.pl index 96330868c2..20978161e9 100755 --- a/detail.pl +++ b/detail.pl @@ -1,235 +1,76 @@ #!/usr/bin/perl - -#script to display detailed information -#written 8/11/99 - use strict; -#use DBI; -use C4::Search; +require Exporter; use CGI; -use C4::Output; - -my $input = new CGI; -print $input->header; -#whether it is called from the opac of the intranet -my $type=$input->param('type'); -if ($type eq ''){ - $type='intra'; -} -#setup colours -my $main; -my $secondary; -if ($type eq 'opac'){ - $main='#99cccc'; - $secondary='#efe5ef'; -} else { - $main='#cccc99'; - $secondary='#ffffcc'; -} -print startpage(); -print startmenu($type); -#print $type; -my $blah; -my $bib=$input->param('bib'); -my $title=$input->param('title'); -if ($type ne 'opac'){ - print ""; -} - - -my @items=ItemInfo(\$blah,$bib,$type); -my $dat=bibdata($bib); -my $count=@items; -my ($count3,$addauthor)=addauthor($bib); -my $additional=$addauthor->[0]->{'author'}; -for (my $i=1;$i<$count3;$i++){ - $additional=$additional."|".$addauthor->[$i]->{'author'}; -} -my @temp=split('\t',$items[0]); -if ($dat->{'author'} ne ''){ - print mkheadr(3,"$dat->{'title'} ($dat->{'author'}) $temp[4]"); -} else { - print mkheadr(3,"$dat->{'title'} $temp[4]"); -} -print < - - - - -
- - - -BIBLIO RECORD -printend -; -if ($type ne 'opac'){ - print "$bib"; -} -print < - - - - -printend -; -if ($type ne 'opac'){ - print " - "; -} -print < - -printend -; - - -if ($type ne 'opac'){ -print <Subtitle: $dat->{'subtitle'}
-Author: $dat->{'author'}
-Additional Author: $additional
-Series Title: $dat->{'seriestitle'}
-Subject: $dat->{'subject'}
-Copyright: $dat->{'copyrightdate'}
-Notes: $dat->{'notes'}
-Unititle: $dat->{'unititle'}
-Analytical Author:
-Analytical Title:
-Serial: $dat->{'serial'}
-Total Number of Items: $count -

-printend -; -} -else { -if ($dat->{'subtitle'} ne ''){ - print "Subtitle: $dat->{'subtitle'}
"; -} -if ($dat->{'author'} ne ''){ - print "Author: $dat->{'author'}
"; -} -#Additional Author:
-if ($dat->{'seriestitle'} ne ''){ - print "Seriestitle: $dat->{'seriestitle'}
"; -} -if ($dat->{'subject'} ne ''){ - print "Subject: $dat->{'subject'}
"; -} -if ($dat->{'copyrightdate'} ne ''){ - print "Copyright: $dat->{'copyrightdate'}
"; -} -if ($dat->{'notes'} ne ''){ - print "Notes: $dat->{'notes'}
"; -} -if ($dat->{'unititle'} ne ''){ - print "Unititle: $dat->{'unititle'}
"; -} -#Analytical Author:
-#Analytical Title:
-if ($dat->{'serial'} ne '0'){ - print "Serial: Yes
"; -} -print "Total Number of Items: $count -

-"; - -} -print < - - - - - - -printend -; - - -#print @items; - -my $i=0; -print center(); -print mktablehdr; -if ($type eq 'opac'){ - - print mktablerow(6,$main,'Item Type','Class','Branch','Date Due','Last Seen'); -} else { - print mktablerow(6,$main,'Itemtype','Class','Location','Date Due','Last Seen','Barcode',"/images/background-mem.gif"); -} -my $colour=1; -while ($i < $count){ -# print $items[$i],"
"; - my @results=split('\t',$items[$i]); - if ($type ne 'opac'){ - $results[1]=mklink("/cgi-bin/koha/moredetail.pl?item=$results[5]&bib=$bib&bi=$results[8]",$results[1]); - } - if ($results[2] eq ''){ - $results[2]='Available'; - } - if ($colour == 1){ - if ($type ne 'opac'){ -# if ($results[6] eq 'PER'){ - print mktablerow(7,$secondary,$results[6],$results[4],$results[3],$results[2],$results[7],$results[1],$results[9]); -# } else { -# print mktablerow(6,$secondary,$results[6],$results[4],$results[3],$results[2],$results[7],$results[1]); -# } - } else { - $results[6]=ItemType($results[6]); -# if ($results[6] =~ /Periodical/){ - print mktablerow(6,$secondary,$results[6],$results[4],$results[3],$results[2],$results[7],$results[9]); -# } else { -# print mktablerow(5,$secondary,$results[6],$results[4],$results[3],$results[2],$results[7]); -# } - } - $colour=0; - } else{ - if ($type ne 'opac'){ -# if ($results[6] eq 'PER'){ - print mktablerow(7,'white',$results[6],$results[4],$results[3],$results[2],$results[7],$results[1],$results[9]); -# }else{ -# print mktablerow(6,'white',$results[6],$results[4],$results[3],$results[2],$results[7],$results[1]); -# } - } else { - $results[6]=ItemType($results[6]); -# if ($results[6] =~ /Periodical/){ - print mktablerow(6,'white',$results[6],$results[4],$results[3],$results[2],$results[7],$results[9]); -# } else { -# print mktablerow(5,'white',$results[6],$results[4],$results[3],$results[2],$results[7]); -# } - } - $colour=1; - } - $i++; -} - -print mktableft(); -print "

"; -print mktablehdr(); -if ($type ne 'opac'){ -print < -

HELP
-Update Biblio for all Items: Click on the Modify button [left] to amend the biblio. Any changes you make will update the record for all the items listed above.

-Updating the Biblio for only ONE or SOME Items: If some of the items listed above need a different biblio, or are on the wrong biblio, you must use the acquisitions process to fix this. You will need to "re-order" the items, and delete them from this biblio.

- - -printend -; -} -print mktableft(); -print endcenter(); -print "
"; -print endmenu($type); -print endpage(); +use C4::Search; +use C4::Auth; +use C4::Bull; #uses getsubscriptionfrom biblionumber +use C4::Interface::CGI::Output; +use HTML::Template; +use C4::Biblio; +use C4::SearchMarc; + +my $query=new CGI; +my ($template, $borrowernumber, $cookie) + = get_template_and_user({template_name => "catalogue/detail.tmpl", + query => $query, + type => "intranet", + authnotrequired => 1, + flagsrequired => {borrow => 1}, + }); + +my $biblionumber=$query->param('bib'); +$template->param(biblionumber => $biblionumber); + + +# change back when ive fixed request.pl +my @items = &ItemInfo(undef, $biblionumber, 'intra'); +my $dat = &bibdata($biblionumber); +my ($authorcount, $addauthor) = &addauthor($biblionumber); +my ($webbiblioitemcount, @webbiblioitems) = &getwebbiblioitems($biblionumber); +my ($websitecount, @websites) = &getwebsites($biblionumber); +my $subscriptionsnumber = getsubscriptionfrombiblionumber($biblionumber); + +$dat->{'count'}=@items; + +$dat->{'additional'}=$addauthor->[0]->{'author'}; +for (my $i = 1; $i < $authorcount; $i++) { + $dat->{'additional'} .= " ; " . $addauthor->[$i]->{'author'}; +} # for + +my $norequests = 1; +foreach my $itm (@items) { + $norequests = 0 unless $itm->{'notforloan'}; + $itm->{$itm->{'publictype'}} = 1; +} + +$template->param(norequests => $norequests); + + ## get notes and subjects from MARC record +my $marc = C4::Context->preference("marc"); +if ($marc eq "yes") { + my $dbh = C4::Context->dbh; + my $bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$biblionumber); + my $marcflavour = C4::Context->preference("marcflavour"); + my $marcnotesarray = &getMARCnotes($dbh,$bibid,$marcflavour); + my $marcsubjctsarray = &getMARCsubjects($dbh,$bibid,$marcflavour); + + $template->param(MARCNOTES => $marcnotesarray); + $template->param(MARCSUBJCTS => $marcsubjctsarray); +} + +my @results = ($dat,); + +my $resultsarray=\@results; +my $itemsarray=\@items; +my $webarray=\@webbiblioitems; +my $sitearray=\@websites; + +$template->param(BIBLIO_RESULTS => $resultsarray, + ITEM_RESULTS => $itemsarray, + WEB_RESULTS => $webarray, + SITE_RESULTS => $sitearray, + subscriptionsnumber => $subscriptionsnumber, +); + +output_html_with_http_headers $query, $cookie, $template->output;