syncing dev-week and HEAD

This commit is contained in:
kados 2006-05-21 02:17:02 +00:00
parent aecb302298
commit 90a5a7dc68
2 changed files with 53 additions and 40 deletions

View File

@ -32,7 +32,19 @@ my ($webbiblioitemcount, @webbiblioitems) = &getwebbiblioitems($biblionumber);
my ($websitecount, @websites) = &getwebsites($biblionumber);
my $subscriptionsnumber = getsubscriptionfrombiblionumber($biblionumber);
my @title;
#coping with subscriptions
my $subscriptionsnumber = getsubscriptionfrombiblionumber($biblionumber);
my @subscriptions = getsubscriptions($dat->{title},$dat->{issn},$biblionumber);
my @subs;
foreach my $subscription (@subscriptions){
my %cell;
$cell{subscriptionid}= $subscription->{subscriptionid};
$cell{subscriptionnotes}= $subscription->{notes};
#get the three latest serials.
$cell{latestserials}=getlatestserials($subscription->{subscriptionid},3);
push @subs, \%cell;
}
$dat->{'count'}=@items;
my @author;
if ($dat->{'author'}){
@ -124,38 +136,43 @@ $template->param(BIBLIO_RESULTS => $resultsarray,
LibraryName => C4::Context->preference("LibraryName"),
suggestion => C4::Context->preference("suggestion"),
virtualshelves => C4::Context->preference("virtualshelves"),
titlewords => $titlewords,
authorwords => $authorwords,
titlewords => $titlewords,
authorwords => $authorwords,
);
## Amazon.com stuff
=head
my $isbn=$dat->{'isbn'};
my $amazon_details = &get_amazon_details($isbn);
foreach my $result (@{$amazon_details->{Details}}){
$template->param(item_description => $result->{ProductDescription});
$template->param(image => $result->{ImageUrlMedium});
$template->param(list_price => $result->{ListPrice});
$template->param(amazon_url => $result->{url});
}
## Amazon.com stuff
#not used unless preference set
if (C4::Context->preference("AmazonContent")==1) {
use C4::Amazon;
$dat->{'amazonisbn'}=$dat->{'isbn'};
$dat->{'amazonisbn'} =~ s|-||g;
my @products;
my @reviews;
for my $details( @{ $amazon_details->{ Details } } ) {
next unless $details->{ SimilarProducts };
for my $product ( @{ $details->{ SimilarProducts }->{ Product } } ) {
push @products, +{ Product => $product };
}
next unless $details->{ Reviews };
for my $product ( @{ $details->{ Reviews }->{ AvgCustomerRating } } ) {
$template->param(rating => $product);
}
for my $reviews ( @{ $details->{ Reviews }->{ CustomerReview } } ) {
push @reviews, +{ Summary => $reviews->{ Summary }, Comment => $reviews->{ Comment }, };
}
$template->param( amazonisbn => $dat->{amazonisbn} );
my $amazon_details = &get_amazon_details($dat->{amazonisbn});
foreach my $result (@{$amazon_details->{Details}}){
$template->param(item_description => $result->{ProductDescription});
$template->param(image => $result->{ImageUrlMedium});
$template->param(list_price => $result->{ListPrice});
$template->param(amazon_url => $result->{url});
}
my @products;
my @reviews;
for my $details( @{ $amazon_details->{ Details } } ) {
next unless $details->{ SimilarProducts };
for my $product ( @{ $details->{ SimilarProducts }->{ Product } } ) {
push @products, +{ Product => $product };
}
next unless $details->{ Reviews };
for my $product ( @{ $details->{ Reviews }->{ AvgCustomerRating } } ) {
$template->param(rating => $product * 20);
}
for my $reviews ( @{ $details->{ Reviews }->{ CustomerReview } } ) {
push @reviews, +{ Summary => $reviews->{ Summary }, Comment => $reviews->{ Comment }, };
}
}
$template->param( SIMILAR_PRODUCTS => \@products );
$template->param( REVIEWS => \@reviews );
}
$template->param( SIMILAR_PRODUCTS => \@products );
$template->param( REVIEWS => \@reviews );
## End of Amazon Stuff
=cut
output_html_with_http_headers $query, $cookie, $template->output;

View File

@ -74,16 +74,15 @@ my @CGIbranchlooparray;
foreach my $branch (keys %$branches) {
if ($branch) {
my %line;
$line{branch} = $branches->{$branch}->{'branchname'};
$line{value} = $branch;
push @CGIbranchlooparray, \%line;
$line{branch} = $branches->{$branch}->{'branchname'};
$line{value} = $branch;
push @CGIbranchlooparray, \%line;
}
}
@CGIbranchlooparray = sort {$a->{branch} cmp $b->{branch}} @CGIbranchlooparray;
my $CGIbranchloop = \@CGIbranchlooparray;
$template->param( CGIbranch => $CGIbranchloop);
#### THIS IS A BIT OF A HACK BECAUSE THE BIBLIOITEMS DATA IS A LITTLE MESSED UP!
# get the itemtype data....
my @items = ItemInfo(undef, $biblionumber, 'opac');
@ -175,9 +174,6 @@ for (my $rownum=0;$rownum<$publictypes[0]->{'count'} ;$rownum++) {
$template->param(TYPE_ROWS => \@typerows);
$width = 2*$width -1;
$template->param(totalwidth => 2*$width-1,
LibraryName => C4::Context->preference("LibraryName"),
suggestion => C4::Context->preference("suggestion"),
virtualshelves => C4::Context->preference("virtualshelves"),
);
if ($query->param('item_types_selected')) {
@ -239,7 +235,7 @@ if ($query->param('item_types_selected')) {
} else {
# Here we check that the borrower can actually make reserves Stage 1.
my $noreserves = 0;
my $maxoutstanding = C4::Context->preference("maxoustanding");
my $maxoutstanding = C4::Context->preference("maxoutstanding");
$template->param(noreserve => 1) unless $maxoutstanding;
if ($borr->{'amountoutstanding'} > $maxoutstanding) {
my $amount = sprintf "\$%.02f", $borr->{'amountoutstanding'};