use C4::Images;
use Koha::DateUtils;
use C4::HTML5Media;
+use C4::CourseReserves qw(GetItemCourseReservesInfo);
BEGIN {
if (C4::Context->preference('BakerTaylorEnabled')) {
@items = @all_items;
}
+my $branches = GetBranches();
+my $branch = '';
+if (C4::Context->userenv){
+ $branch = C4::Context->userenv->{branch};
+}
+if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) {
+ if (
+ ( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch )
+ ||
+ C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch'
+ ) {
+ my $branchname;
+ if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) {
+ $branchname = $branches->{$branch}->{'branchname'};
+ }
+ elsif ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) {
+ $branchname = $branches->{ $ENV{'BRANCHCODE'} }->{'branchname'};
+ }
+
+ my @our_items;
+ my @other_items;
+
+ foreach my $item ( @items ) {
+ if ( $item->{'branchname'} eq $branchname ) {
+ $item->{'this_branch'} = 1;
+ push( @our_items, $item );
+ } else {
+ push( @other_items, $item );
+ }
+ }
+
+ @items = ( @our_items, @other_items );
+ }
+}
+
my $dat = &GetBiblioData($biblionumber);
my $itemtypes = GetItemTypes();
$template->param( show_priority => $has_hold ) ;
my $norequests = 1;
-my $branches = GetBranches();
my %itemfields;
my (@itemloop, @otheritemloop);
my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef;
}
$template->{VARS}->{'trackclicks'} = C4::Context->preference('TrackClicks');
+if ( C4::Context->preference('UseCourseReserves') ) {
+ foreach my $i ( @items ) {
+ $i->{'course_reserves'} = GetItemCourseReservesInfo( itemnumber => $i->{'itemnumber'} );
+ }
+}
+
output_html_with_http_headers $query, $cookie, $template->output;