Lines 62-71
use Koha::Ratings;
Link Here
|
62 |
use Koha::Reviews; |
62 |
use Koha::Reviews; |
63 |
|
63 |
|
64 |
BEGIN { |
64 |
BEGIN { |
65 |
if (C4::Context->preference('BakerTaylorEnabled')) { |
65 |
if (C4::Context->preference('BakerTaylorEnabled')) { |
66 |
require C4::External::BakerTaylor; |
66 |
require C4::External::BakerTaylor; |
67 |
import C4::External::BakerTaylor qw(&image_url &link_url); |
67 |
import C4::External::BakerTaylor qw(&image_url &link_url); |
68 |
} |
68 |
} |
69 |
} |
69 |
} |
70 |
|
70 |
|
71 |
my $query = new CGI; |
71 |
my $query = new CGI; |
Lines 495-504
$hideitems = 1 if C4::Context->preference('hidelostitems') or scalar(@hiddenitem
Link Here
|
495 |
# Hide items |
495 |
# Hide items |
496 |
if ($hideitems) { |
496 |
if ($hideitems) { |
497 |
for my $itm (@all_items) { |
497 |
for my $itm (@all_items) { |
498 |
if ( C4::Context->preference('hidelostitems') ) { |
498 |
if ( C4::Context->preference('hidelostitems') ) { |
499 |
push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems; |
499 |
push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems; |
500 |
} else { |
500 |
} else { |
501 |
push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems; |
501 |
push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems; |
502 |
} |
502 |
} |
503 |
} |
503 |
} |
504 |
} else { |
504 |
} else { |
Lines 585-591
foreach my $subscription (@subscriptions) {
Link Here
|
585 |
#get the three latest serials. |
585 |
#get the three latest serials. |
586 |
$serials_to_display = $subscription->{opacdisplaycount}; |
586 |
$serials_to_display = $subscription->{opacdisplaycount}; |
587 |
$serials_to_display = C4::Context->preference('OPACSerialIssueDisplayCount') unless $serials_to_display; |
587 |
$serials_to_display = C4::Context->preference('OPACSerialIssueDisplayCount') unless $serials_to_display; |
588 |
$cell{opacdisplaycount} = $serials_to_display; |
588 |
$cell{opacdisplaycount} = $serials_to_display; |
589 |
$cell{latestserials} = |
589 |
$cell{latestserials} = |
590 |
GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display ); |
590 |
GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display ); |
591 |
if ( $borrowernumber ) { |
591 |
if ( $borrowernumber ) { |
Lines 598-604
foreach my $subscription (@subscriptions) {
Link Here
|
598 |
|
598 |
|
599 |
$dat->{'count'} = scalar(@items); |
599 |
$dat->{'count'} = scalar(@items); |
600 |
|
600 |
|
601 |
|
|
|
602 |
my (%item_reserves, %priority); |
601 |
my (%item_reserves, %priority); |
603 |
my ($show_holds_count, $show_priority); |
602 |
my ($show_holds_count, $show_priority); |
604 |
for ( C4::Context->preference("OPACShowHoldQueueDetails") ) { |
603 |
for ( C4::Context->preference("OPACShowHoldQueueDetails") ) { |
Lines 682-690
if ( not $viewallitems and @items > $max_items_to_display ) {
Link Here
|
682 |
$itm->{'ccode'} = $collections->{$ccode} if defined($ccode) && $collections && exists( $collections->{$ccode} ); |
681 |
$itm->{'ccode'} = $collections->{$ccode} if defined($ccode) && $collections && exists( $collections->{$ccode} ); |
683 |
my $copynumber = $itm->{'copynumber'}; |
682 |
my $copynumber = $itm->{'copynumber'}; |
684 |
$itm->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumbers) && defined($copynumber) && exists( $copynumbers->{$copynumber} ) ); |
683 |
$itm->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumbers) && defined($copynumber) && exists( $copynumbers->{$copynumber} ) ); |
685 |
if ( defined $itm->{'location'} ) { |
684 |
my $shelfcode = $itm->{'location'}; |
686 |
$itm->{'location_description'} = $shelflocations->{ $itm->{'location'} }; |
685 |
my $permshelfcode = $itm->{'permanent_location'}; |
687 |
} |
686 |
$itm->{'location_description'} = ( $shelflocations->{$permshelfcode} ne '' ) ? $shelflocations->{$permshelfcode} : ( $permshelfcode ) ? $permshelfcode : undef; |
|
|
687 |
$itm->{'location_description'} .= ( ( $shelflocations->{$shelfcode} ne '' ) && ( $shelfcode ne $permshelfcode ) ) ? ' (' . $shelflocations->{$shelfcode} . ')' : ( ( $shelfcode ) && ( $shelfcode ne $permshelfcode ) ) ? ' (' . $shelfcode . ')' : undef; |
688 |
if (exists $itm->{itype} && defined($itm->{itype}) && exists $itemtypes->{ $itm->{itype} }) { |
688 |
if (exists $itm->{itype} && defined($itm->{itype}) && exists $itemtypes->{ $itm->{itype} }) { |
689 |
$itm->{'imageurl'} = getitemtypeimagelocation( 'opac', $itemtypes->{ $itm->{itype} }->{'imageurl'} ); |
689 |
$itm->{'imageurl'} = getitemtypeimagelocation( 'opac', $itemtypes->{ $itm->{itype} }->{'imageurl'} ); |
690 |
$itm->{'description'} = $itemtypes->{ $itm->{itype} }->{translated_description}; |
690 |
$itm->{'description'} = $itemtypes->{ $itm->{itype} }->{translated_description}; |
Lines 822-832
if ( $isbn or $ean or $oclc or $upc ) {
Link Here
|
822 |
$content_identifier_exists = 1; |
822 |
$content_identifier_exists = 1; |
823 |
} |
823 |
} |
824 |
$template->param( |
824 |
$template->param( |
825 |
normalized_upc => $upc, |
825 |
normalized_upc => $upc, |
826 |
normalized_ean => $ean, |
826 |
normalized_ean => $ean, |
827 |
normalized_oclc => $oclc, |
827 |
normalized_oclc => $oclc, |
828 |
normalized_isbn => $isbn, |
828 |
normalized_isbn => $isbn, |
829 |
content_identifier_exists => $content_identifier_exists, |
829 |
content_identifier_exists => $content_identifier_exists, |
830 |
); |
830 |
); |
831 |
|
831 |
|
832 |
# COinS format FIXME: for books Only |
832 |
# COinS format FIXME: for books Only |
Lines 936-948
foreach my $sc_field (@sc_fields) {
Link Here
|
936 |
|
936 |
|
937 |
if (scalar(@serialcollections) > 0) { |
937 |
if (scalar(@serialcollections) > 0) { |
938 |
$template->param( |
938 |
$template->param( |
939 |
serialcollection => 1, |
939 |
serialcollection => 1, |
940 |
serialcollections => \@serialcollections); |
940 |
serialcollections => \@serialcollections); |
941 |
} |
941 |
} |
942 |
|
942 |
|
943 |
# Local cover Images stuff |
943 |
# Local cover Images stuff |
944 |
if (C4::Context->preference("OPACLocalCoverImages")){ |
944 |
if (C4::Context->preference("OPACLocalCoverImages")){ |
945 |
$template->param(OPACLocalCoverImages => 1); |
945 |
$template->param(OPACLocalCoverImages => 1); |
946 |
} |
946 |
} |
947 |
|
947 |
|
948 |
# HTML5 Media |
948 |
# HTML5 Media |
Lines 955-966
my $syndetics_elements;
Link Here
|
955 |
if ( C4::Context->preference("SyndeticsEnabled") ) { |
955 |
if ( C4::Context->preference("SyndeticsEnabled") ) { |
956 |
$template->param("SyndeticsEnabled" => 1); |
956 |
$template->param("SyndeticsEnabled" => 1); |
957 |
$template->param("SyndeticsClientCode" => C4::Context->preference("SyndeticsClientCode")); |
957 |
$template->param("SyndeticsClientCode" => C4::Context->preference("SyndeticsClientCode")); |
958 |
eval { |
958 |
eval { |
959 |
$syndetics_elements = &get_syndetics_index($isbn,$upc,$oclc); |
959 |
$syndetics_elements = &get_syndetics_index($isbn,$upc,$oclc); |
960 |
for my $element (values %$syndetics_elements) { |
960 |
for my $element (values %$syndetics_elements) { |
961 |
$template->param("Syndetics$element"."Exists" => 1 ); |
961 |
$template->param("Syndetics$element"."Exists" => 1 ); |
962 |
#warn "Exists: "."Syndetics$element"."Exists"; |
962 |
#warn "Exists: "."Syndetics$element"."Exists"; |
963 |
} |
963 |
} |
964 |
}; |
964 |
}; |
965 |
warn $@ if $@; |
965 |
warn $@ if $@; |
966 |
} |
966 |
} |
Lines 968-989
if ( C4::Context->preference("SyndeticsEnabled") ) {
Link Here
|
968 |
if ( C4::Context->preference("SyndeticsEnabled") |
968 |
if ( C4::Context->preference("SyndeticsEnabled") |
969 |
&& C4::Context->preference("SyndeticsSummary") |
969 |
&& C4::Context->preference("SyndeticsSummary") |
970 |
&& ( exists($syndetics_elements->{'SUMMARY'}) || exists($syndetics_elements->{'AVSUMMARY'}) ) ) { |
970 |
&& ( exists($syndetics_elements->{'SUMMARY'}) || exists($syndetics_elements->{'AVSUMMARY'}) ) ) { |
971 |
eval { |
971 |
eval { |
972 |
my $syndetics_summary = &get_syndetics_summary($isbn,$upc,$oclc, $syndetics_elements); |
972 |
my $syndetics_summary = &get_syndetics_summary($isbn,$upc,$oclc, $syndetics_elements); |
973 |
$template->param( SYNDETICS_SUMMARY => $syndetics_summary ); |
973 |
$template->param( SYNDETICS_SUMMARY => $syndetics_summary ); |
974 |
}; |
974 |
}; |
975 |
warn $@ if $@; |
975 |
warn $@ if $@; |
976 |
|
|
|
977 |
} |
976 |
} |
978 |
|
977 |
|
979 |
if ( C4::Context->preference("SyndeticsEnabled") |
978 |
if ( C4::Context->preference("SyndeticsEnabled") |
980 |
&& C4::Context->preference("SyndeticsTOC") |
979 |
&& C4::Context->preference("SyndeticsTOC") |
981 |
&& exists($syndetics_elements->{'TOC'}) ) { |
980 |
&& exists($syndetics_elements->{'TOC'}) ) { |
982 |
eval { |
981 |
eval { |
983 |
my $syndetics_toc = &get_syndetics_toc($isbn,$upc,$oclc); |
982 |
my $syndetics_toc = &get_syndetics_toc($isbn,$upc,$oclc); |
984 |
$template->param( SYNDETICS_TOC => $syndetics_toc ); |
983 |
$template->param( SYNDETICS_TOC => $syndetics_toc ); |
985 |
}; |
984 |
}; |
986 |
warn $@ if $@; |
985 |
warn $@ if $@; |
987 |
} |
986 |
} |
988 |
|
987 |
|
989 |
if ( C4::Context->preference("SyndeticsEnabled") |
988 |
if ( C4::Context->preference("SyndeticsEnabled") |
Lines 993-999
if ( C4::Context->preference("SyndeticsEnabled")
Link Here
|
993 |
my $syndetics_excerpt = &get_syndetics_excerpt($isbn,$upc,$oclc); |
992 |
my $syndetics_excerpt = &get_syndetics_excerpt($isbn,$upc,$oclc); |
994 |
$template->param( SYNDETICS_EXCERPT => $syndetics_excerpt ); |
993 |
$template->param( SYNDETICS_EXCERPT => $syndetics_excerpt ); |
995 |
}; |
994 |
}; |
996 |
warn $@ if $@; |
995 |
warn $@ if $@; |
997 |
} |
996 |
} |
998 |
|
997 |
|
999 |
if ( C4::Context->preference("SyndeticsEnabled") |
998 |
if ( C4::Context->preference("SyndeticsEnabled") |
Lines 1002-1013
if ( C4::Context->preference("SyndeticsEnabled")
Link Here
|
1002 |
my $syndetics_reviews = &get_syndetics_reviews($isbn,$upc,$oclc,$syndetics_elements); |
1001 |
my $syndetics_reviews = &get_syndetics_reviews($isbn,$upc,$oclc,$syndetics_elements); |
1003 |
$template->param( SYNDETICS_REVIEWS => $syndetics_reviews ); |
1002 |
$template->param( SYNDETICS_REVIEWS => $syndetics_reviews ); |
1004 |
}; |
1003 |
}; |
1005 |
warn $@ if $@; |
1004 |
warn $@ if $@; |
1006 |
} |
1005 |
} |
1007 |
|
1006 |
|
1008 |
if ( C4::Context->preference("SyndeticsEnabled") |
1007 |
if ( C4::Context->preference("SyndeticsEnabled") |
1009 |
&& C4::Context->preference("SyndeticsAuthorNotes") |
1008 |
&& C4::Context->preference("SyndeticsAuthorNotes") |
1010 |
&& exists($syndetics_elements->{'ANOTES'}) ) { |
1009 |
&& exists($syndetics_elements->{'ANOTES'}) ) { |
1011 |
eval { |
1010 |
eval { |
1012 |
my $syndetics_anotes = &get_syndetics_anotes($isbn,$upc,$oclc); |
1011 |
my $syndetics_anotes = &get_syndetics_anotes($isbn,$upc,$oclc); |
1013 |
$template->param( SYNDETICS_ANOTES => $syndetics_anotes ); |
1012 |
$template->param( SYNDETICS_ANOTES => $syndetics_anotes ); |
Lines 1076-1109
if (C4::Context->preference("OPACShelfBrowser")) {
Link Here
|
1076 |
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages")); |
1075 |
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages")); |
1077 |
|
1076 |
|
1078 |
if (C4::Context->preference("BakerTaylorEnabled")) { |
1077 |
if (C4::Context->preference("BakerTaylorEnabled")) { |
1079 |
$template->param( |
1078 |
$template->param( |
1080 |
BakerTaylorEnabled => 1, |
1079 |
BakerTaylorEnabled => 1, |
1081 |
BakerTaylorImageURL => &image_url(), |
1080 |
BakerTaylorImageURL => &image_url(), |
1082 |
BakerTaylorLinkURL => &link_url(), |
1081 |
BakerTaylorLinkURL => &link_url(), |
1083 |
BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'), |
1082 |
BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'), |
1084 |
); |
1083 |
); |
1085 |
my ($bt_user, $bt_pass); |
1084 |
my ($bt_user, $bt_pass); |
1086 |
if ($isbn and |
1085 |
if ($isbn and |
1087 |
$bt_user = C4::Context->preference('BakerTaylorUsername') and |
1086 |
$bt_user = C4::Context->preference('BakerTaylorUsername') and |
1088 |
$bt_pass = C4::Context->preference('BakerTaylorPassword') ) |
1087 |
$bt_pass = C4::Context->preference('BakerTaylorPassword') ) |
1089 |
{ |
1088 |
{ |
1090 |
$template->param( |
1089 |
$template->param( |
1091 |
BakerTaylorContentURL => |
1090 |
BakerTaylorContentURL => |
1092 |
sprintf("https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y", |
1091 |
sprintf("https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y", |
1093 |
$bt_user,$bt_pass,$isbn) |
1092 |
$bt_user,$bt_pass,$isbn) |
1094 |
); |
1093 |
); |
1095 |
} |
1094 |
} |
1096 |
} |
1095 |
} |
1097 |
|
1096 |
|
1098 |
my $tag_quantity; |
1097 |
my $tag_quantity; |
1099 |
if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail')) { |
1098 |
if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail')) { |
1100 |
$template->param( |
1099 |
$template->param( |
1101 |
TagsEnabled => 1, |
1100 |
TagsEnabled => 1, |
1102 |
TagsShowOnDetail => $tag_quantity, |
1101 |
TagsShowOnDetail => $tag_quantity, |
1103 |
TagsInputOnDetail => C4::Context->preference('TagsInputOnDetail') |
1102 |
TagsInputOnDetail => C4::Context->preference('TagsInputOnDetail') |
1104 |
); |
1103 |
); |
1105 |
$template->param(TagLoop => get_tags({biblionumber=>$biblionumber, approved=>1, |
1104 |
$template->param(TagLoop => get_tags({biblionumber=>$biblionumber, approved=>1, 'sort'=>'-weight', limit=>$tag_quantity})); |
1106 |
'sort'=>'-weight', limit=>$tag_quantity})); |
|
|
1107 |
} |
1105 |
} |
1108 |
|
1106 |
|
1109 |
if (C4::Context->preference("OPACURLOpenInNewWindow")) { |
1107 |
if (C4::Context->preference("OPACURLOpenInNewWindow")) { |
1110 |
- |
|
|