X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=catalogue%2Fdetail.pl;h=50d966fd7d8afed773d7b23fb0bd3609bc0c527d;hb=63ec7a4fce6e49b35dd88438514868db58ca33d8;hp=162530f1be919c1152a5f3bbacb812584db09889;hpb=b764c1ee81728ce5007b89e28b8703742d202375;p=koha_fer diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 162530f1be..50d966fd7d 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -177,15 +177,20 @@ $dat->{'hiddencount'} = scalar @all_items + @hostitems - scalar @items; my $shelflocations = GetKohaAuthorisedValues('items.location', $fw); my $collections = GetKohaAuthorisedValues('items.ccode' , $fw); my $copynumbers = GetKohaAuthorisedValues('items.copynumber', $fw); -my (@itemloop, %itemfields); +my (@itemloop, @otheritemloop, %itemfields); my $norequests = 1; my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw); my $authvalcode_items_damaged = GetAuthValCode('items.damaged', $fw); my $analytics_flag; my $materials_flag; # set this if the items have anything in the materials field +my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef; +if ($currentbranch and C4::Context->preference('SeparateHoldings')) { + $template->param(SeparateHoldings => 1); +} +my $separatebranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch'; foreach my $item (@items) { - + my $itembranchcode = $item->{$separatebranch}; $item->{homebranch} = GetBranchName($item->{homebranch}); # can place holds defaults to yes @@ -259,16 +264,27 @@ foreach my $item (@items) { $item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title}; } - #count if item is used in analytical bibliorecords - my $countanalytics= GetAnalyticsCount($item->{itemnumber}); - if ($countanalytics > 0){ - $analytics_flag=1; - $item->{countanalytics} = $countanalytics; - } + #count if item is used in analytical bibliorecords + my $countanalytics= GetAnalyticsCount($item->{itemnumber}); + if ($countanalytics > 0){ + $analytics_flag=1; + $item->{countanalytics} = $countanalytics; + } + if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){ $materials_flag = 1; } - push @itemloop, $item; + + if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET" + and C4::Context->preference('SeparateHoldings')) { + if ($itembranchcode and $itembranchcode eq $currentbranch) { + push @itemloop, $item; + } else { + push @otheritemloop, $item; + } + } else { + push @itemloop, $item; + } } $template->param( norequests => $norequests ); @@ -332,6 +348,7 @@ foreach ( keys %{$dat} ) { $template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages")); $template->param( itemloop => \@itemloop, + otheritemloop => \@otheritemloop, biblionumber => $biblionumber, ($analyze? 'analyze':'detailview') =>1, subscriptions => \@subs,