X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=catalogue%2FISBDdetail.pl;h=2fa76bdda062b8db5d05e3129dd610b932295899;hb=a6a954efa83a4d87eee8a8b1a0864b60f01eaa7f;hp=de24490ce0b04637c0bd010f083a06d7d60d1100;hpb=324615e396be7fadc8ba3cfa1a9f6025e900df3a;p=koha_fer diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl index de24490ce0..2fa76bdda0 100755 --- a/catalogue/ISBDdetail.pl +++ b/catalogue/ISBDdetail.pl @@ -47,6 +47,8 @@ use C4::Members; # to use GetMember use C4::Branch; # GetBranchDetail use C4::Serials; # CountSubscriptionFromBiblionumber use C4::Search; # enabled_staff_search_views +use C4::Acquisition qw(GetOrdersByBiblionumber); + #---- Internal function @@ -109,7 +111,40 @@ $template->param ( z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)), ocoins => GetCOinSBiblio($record), C4::Search::enabled_staff_search_views, + searchid => $query->param('searchid'), ); +my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber); +my @deletedorders_using_biblio; +my @orders_using_biblio; +my @baskets_orders; +my @baskets_deletedorders; + +foreach my $myorder (@allorders_using_biblio) { + my $basket = $myorder->{'basketno'}; + if ((defined $myorder->{'datecancellationprinted'}) and ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){ + push @deletedorders_using_biblio, $myorder; + unless (grep(/^$basket$/, @baskets_deletedorders)){ + push @baskets_deletedorders,$myorder->{'basketno'}; + } + } + else { + push @orders_using_biblio, $myorder; + unless (grep(/^$basket$/, @baskets_orders)){ + push @baskets_orders,$myorder->{'basketno'}; + } + } +} + +my $count_orders_using_biblio = scalar @orders_using_biblio ; +$template->param (countorders => $count_orders_using_biblio); + +my $count_deletedorders_using_biblio = scalar @deletedorders_using_biblio ; +$template->param (countdeletedorders => $count_deletedorders_using_biblio); + +my $holds = C4::Reserves::GetReservesFromBiblionumber({ biblionumber => $biblionumber, all_dates => 1 }); +my $holdcount = scalar( @$holds ); +$template->param( holdcount => scalar ( @$holds ) ); + output_html_with_http_headers $query, $cookie, $template->output;