$template->param( biblionumber => $biblionumber );
# XSLT processing of some stuff
if (C4::Context->preference("XSLTDetailsDisplay") ) {
- my $newxmlrecord = XSLTParse4Display($biblionumber, $record, C4::Context->config('opachtdocs')."/prog/en/xslt/MARC21slim2OPACDetail.xsl");
- $template->param('XSLTBloc' => $newxmlrecord);
+ $template->param(
+ 'XSLTBloc' => XSLTParse4Display($biblionumber, $record, 'Detail') );
}
$template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") );
$cell{subscriptionid} = $subscription->{subscriptionid};
$cell{subscriptionnotes} = $subscription->{notes};
$cell{branchcode} = $subscription->{branchcode};
+ $cell{branchname} = GetBranchName($subscription->{branchcode});
$cell{hasalert} = $subscription->{hasalert};
#get the three latest serials.
$serials_to_display = $subscription->{opacdisplaycount};
$itm->{'imageurl'} = getitemtypeimagelocation( 'opac', $itemtypes->{ $itm->{itype} }->{'imageurl'} );
$itm->{'description'} = $itemtypes->{ $itm->{itype} }->{'description'};
}
- foreach (qw(ccode enumchron copynumber itemnotes)) {
+ foreach (qw(ccode enumchron copynumber itemnotes uri)) {
$itemfields{$_} = 1 if ($itm->{$_});
}
RequestOnOpac => C4::Context->preference("RequestOnOpac"),
itemdata_ccode => $itemfields{ccode},
itemdata_enumchron => $itemfields{enumchron},
+ itemdata_uri => $itemfields{uri},
itemdata_copynumber => $itemfields{copynumber},
itemdata_itemnotes => $itemfields{itemnotes},
authorised_value_images => $biblio_authorised_value_images,
);
# COinS format FIXME: for books Only
-my $coins_format;
-my $fmt = substr $record->leader(), 6,2;
-my $fmts;
-$fmts->{'am'} = 'book';
-$coins_format = $fmts->{$fmt};
$template->param(
- ocoins_format => $coins_format,
+ ocoins => GetCOinSBiblio($biblionumber),
);
my $reviews = getreviews( $biblionumber, 1 );
$_->{surname} = $borrowerData->{'surname'};
$_->{firstname} = $borrowerData->{'firstname'};
$_->{userid} = $borrowerData->{'userid'};
+ $_->{cardnumber} = $borrowerData->{'cardnumber'};
$_->{datereviewed} = format_date($_->{datereviewed});
if ($borrowerData->{'borrowernumber'} eq $borrowernumber) {
$_->{your_comment} = 1;
my $amazon_details = &get_amazon_details( $isbn, $record, $marcflavour, \@services );
my $similar_products_exist;
if ( $amazon_reviews ) {
- my $item = $amazon_details->{Items}->{Item};
+ my $item = $amazon_details->{Items}->{Item}->[0];
my $customer_reviews = \@{ $item->{CustomerReviews}->{Review} };
for my $one_review ( @$customer_reviews ) {
$one_review->{Date} = format_date($one_review->{Date});
$template->param( AMAZON_EDITORIAL_REVIEWS => $editorial_reviews );
}
if ( $amazon_similars ) {
- my $item = $amazon_details->{Items}->{Item};
+ my $item = $amazon_details->{Items}->{Item}->[0];
my @similar_products;
for my $similar_product (@{ $item->{SimilarProducts}->{SimilarProduct} }) {
# do we have any of these isbns in our collection?
if ( C4::Context->preference("SyndeticsEnabled")
&& C4::Context->preference("SyndeticsSummary")
- && ( $syndetics_elements->{'SUMMARY'} =~ /SUMMARY/
- || $syndetics_elements->{'AVSUMMARY'} =~ /AVSUMMARY/ ) ) {
+ && ( exists($syndetics_elements->{'SUMMARY'}) || exists($syndetics_elements->{'AVSUMMARY'}) ) ) {
eval {
my $syndetics_summary = &get_syndetics_summary($isbn,$upc,$oclc, $syndetics_elements);
$template->param( SYNDETICS_SUMMARY => $syndetics_summary );
if ( C4::Context->preference("SyndeticsEnabled")
&& C4::Context->preference("SyndeticsTOC")
- && $syndetics_elements->{'TOC'} =~ /TOC/) {
+ && exists($syndetics_elements->{'TOC'}) ) {
eval {
my $syndetics_toc = &get_syndetics_toc($isbn,$upc,$oclc);
$template->param( SYNDETICS_TOC => $syndetics_toc );
if ( C4::Context->preference("SyndeticsEnabled")
&& C4::Context->preference("SyndeticsExcerpt")
- && $syndetics_elements->{'DBCHAPTER'} =~ /DBCHAPTER/ ) {
+ && exists($syndetics_elements->{'DBCHAPTER'}) ) {
eval {
my $syndetics_excerpt = &get_syndetics_excerpt($isbn,$upc,$oclc);
$template->param( SYNDETICS_EXCERPT => $syndetics_excerpt );
if ( C4::Context->preference("SyndeticsEnabled")
&& C4::Context->preference("SyndeticsAuthorNotes")
- && $syndetics_elements->{'ANOTES'} =~ /ANOTES/ ) {
+ && exists($syndetics_elements->{'ANOTES'}) ) {
eval {
my $syndetics_anotes = &get_syndetics_anotes($isbn,$upc,$oclc);
$template->param( SYNDETICS_ANOTES => $syndetics_anotes );
## List of Previous Items
# order by cn_sort, which should include everything we need for ordering purposes (though not
# for limits, those need to be handled separately
- my $sth_shelfbrowse_previous = $dbh->prepare("
+ my $sth_shelfbrowse_previous;
+ if (defined $starting_location->{code}) {
+ $sth_shelfbrowse_previous = $dbh->prepare("
SELECT *
FROM items
WHERE
homebranch = ? AND location = ?
ORDER BY cn_sort DESC, itemnumber LIMIT 3
");
- $sth_shelfbrowse_previous->execute($starting_cn_sort, $starting_itemnumber, $starting_cn_sort, $starting_homebranch->{code}, $starting_location->{code});
+ $sth_shelfbrowse_previous->execute($starting_cn_sort, $starting_itemnumber, $starting_cn_sort, $starting_homebranch->{code}, $starting_location->{code});
+ } else {
+ $sth_shelfbrowse_previous = $dbh->prepare("
+ SELECT *
+ FROM items
+ WHERE
+ ((cn_sort = ? AND itemnumber < ?) OR cn_sort < ?) AND
+ homebranch = ?
+ ORDER BY cn_sort DESC, itemnumber LIMIT 3
+ ");
+ $sth_shelfbrowse_previous->execute($starting_cn_sort, $starting_itemnumber, $starting_cn_sort, $starting_homebranch->{code});
+ }
my @previous_items;
while (my $this_item = $sth_shelfbrowse_previous->fetchrow_hashref()) {
my $sth_get_biblio = $dbh->prepare("SELECT biblio.*,biblioitems.isbn AS isbn FROM biblio LEFT JOIN biblioitems ON biblio.biblionumber=biblioitems.biblionumber WHERE biblio.biblionumber=?");
}
## List of Next Items; this also intentionally catches the current item
- my $sth_shelfbrowse_next = $dbh->prepare("
+ my $sth_shelfbrowse_next;
+ if (defined $starting_location->{code}) {
+ $sth_shelfbrowse_next = $dbh->prepare("
SELECT *
FROM items
WHERE
homebranch = ? AND location = ?
ORDER BY cn_sort, itemnumber LIMIT 3
");
- $sth_shelfbrowse_next->execute($starting_cn_sort, $starting_itemnumber, $starting_cn_sort, $starting_homebranch->{code}, $starting_location->{code});
+ $sth_shelfbrowse_next->execute($starting_cn_sort, $starting_itemnumber, $starting_cn_sort, $starting_homebranch->{code}, $starting_location->{code});
+ } else {
+ $sth_shelfbrowse_next = $dbh->prepare("
+ SELECT *
+ FROM items
+ WHERE
+ ((cn_sort = ? AND itemnumber >= ?) OR cn_sort > ?) AND
+ homebranch = ?
+ ORDER BY cn_sort, itemnumber LIMIT 3
+ ");
+ $sth_shelfbrowse_next->execute($starting_cn_sort, $starting_itemnumber, $starting_cn_sort, $starting_homebranch->{code});
+ }
my @next_items;
while (my $this_item = $sth_shelfbrowse_next->fetchrow_hashref()) {
my $sth_get_biblio = $dbh->prepare("SELECT biblio.*,biblioitems.isbn AS isbn FROM biblio LEFT JOIN biblioitems ON biblio.biblionumber=biblioitems.biblionumber WHERE biblio.biblionumber=?");