X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=catalogue%2Fmoredetail.pl;h=86adb7260becaaa74d4920df32b32d7c9ba8b5df;hb=5d6c092921919526ade501facb1220f8a108a08f;hp=6e99c6016b6cc44ce31f60ffe152ee85f35ce418;hpb=700f9980bb3d262f444453c9dcbe47ab54d8b91a;p=koha_fer diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index 6e99c6016b..86adb7260b 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -35,6 +35,7 @@ use C4::Circulation; # to use itemissues use C4::Members; # to use GetMember use C4::Search; # enabled_staff_search_views use C4::Members qw/GetHideLostItemsPreference/; +use C4::Reserves qw(GetReservesFromBiblionumber); use Koha::DateUtils; my $query=new CGI; @@ -167,14 +168,14 @@ foreach my $item (@items){ } $item->{'datereceived'} = $order->{'datereceived'}; - if ($item->{notforloantext} or $item->{itemlost} or $item->{damaged} or $item->{wthdrawn}) { + if ($item->{notforloantext} or $item->{itemlost} or $item->{damaged} or $item->{withdrawn}) { $item->{status_advisory} = 1; } - if (C4::Context->preference("IndependantBranches")) { + if (C4::Context->preference("IndependentBranches")) { #verifying rights my $userenv = C4::Context->userenv(); - unless (($userenv->{'flags'} == 1) or ($userenv->{'branch'} eq $item->{'homebranch'})) { + unless (C4::Context->IsSuperLibrarian() or ($userenv->{'branch'} eq $item->{'homebranch'})) { $item->{'nomod'}=1; } } @@ -213,10 +214,39 @@ $template->param( hidepatronname => $hidepatronname, ); $template->param(ONLY_ONE => 1) if ( $itemnumber && $showncount != @items ); +$template->{'VARS'}->{'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 ( $holdcount, $holds ) = GetReservesFromBiblionumber($biblionumber,1); -$template->param( holdcount => $holdcount, holds => $holds ); +my $holds = GetReservesFromBiblionumber({ biblionumber => $biblionumber, all_dates => 1 }); +my $holdcount = scalar( @$holds ); +$template->param( holdcount => scalar ( @$holds ) ); output_html_with_http_headers $query, $cookie, $template->output;