X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=catalogue%2Fmoredetail.pl;h=eed1f68cd5a4c51ae3cb52e49e8a8bfd9796174d;hb=788d6bd724abf2573f699a90d0b7857e01264584;hp=55e827320ff7f018e6cfae1d178f4266041290b8;hpb=cfd3f7186be7d79423ba0c555200614a7e229b97;p=srvgit diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index 55e827320f..eed1f68cd5 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -43,15 +43,18 @@ my $query=new CGI; # FIXME subject is not exported to the template? my $subject=$query->param('subject'); -# if its a subject we need to use the subject.tmpl -my ($template, $loggedinuser, $cookie) = get_template_and_user({ - template_name => ($subject? 'catalogue/subject.tmpl': - 'catalogue/moredetail.tmpl'), - query => $query, - type => "intranet", - authnotrequired => 0, - flagsrequired => {catalogue => 1}, - }); +# if its a subject we need to use the subject.tt +my ($template, $loggedinuser, $cookie) = get_template_and_user( + { + template_name => ( $subject + ? 'catalogue/subject.tt' + : 'catalogue/moredetail.tt'), + query => $query, + type => "intranet", + authnotrequired => 0, + flagsrequired => { catalogue => 1 }, + } +); if($query->cookie("holdfor")){ my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor")); @@ -168,14 +171,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; } } @@ -214,10 +217,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;