From fbd727869f54897d923c6278b8e841c623029fae Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 5 May 2020 15:27:28 +0200 Subject: [PATCH] Bug 23166: Remove filtering from controllers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Nick Clemens Signed-off-by: Joonas Kylmälä Signed-off-by: Jonathan Druart --- catalogue/ISBDdetail.pl | 21 --------------------- catalogue/MARCdetail.pl | 26 ++------------------------ catalogue/detail.pl | 12 ------------ catalogue/imageviewer.pl | 21 --------------------- catalogue/labeledMARCdetail.pl | 23 +---------------------- catalogue/moredetail.pl | 22 +--------------------- 6 files changed, 4 insertions(+), 121 deletions(-) diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl index 8e1ea52caf..383c155bd2 100755 --- a/catalogue/ISBDdetail.pl +++ b/catalogue/ISBDdetail.pl @@ -45,7 +45,6 @@ use C4::Biblio; use C4::Items; use C4::Serials; # CountSubscriptionFromBiblionumber use C4::Search; # enabled_staff_search_views -use C4::Acquisition qw(GetOrdersByBiblionumber); use Koha::Biblios; use Koha::Patrons; @@ -151,26 +150,6 @@ $template->param ( biblio => $biblio, ); -my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber); -my @deletedorders_using_biblio; -my @orders_using_biblio; - -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; - } - else { - push @orders_using_biblio, $myorder; - } -} - -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 = $biblio->holds; $template->param( holdcount => $holds->count ); diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index eb9553331a..1078dc2f5a 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -341,31 +341,9 @@ $template->param ( z3950_search_params => C4::Search::z3950_search_args($biblio), C4::Search::enabled_staff_search_views, searchid => scalar $query->param('searchid'), - biblio => $biblio_object->unblessed, + biblio => $biblio_object, ); -my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber); -my @deletedorders_using_biblio; -my @orders_using_biblio; - -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; - } - else { - push @orders_using_biblio, $myorder; - } -} - -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); - -$biblio = Koha::Biblios->find( $biblionumber ); -my $holds = $biblio->holds; -$template->param( holdcount => $holds->count ); +$template->param( holdcount => $biblio_object->holds->count ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 45a2918e02..ec349d4d1d 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -554,16 +554,4 @@ if ($StaffDetailItemSelection) { $template->param(biblio => $biblio); -my $orders = - Koha::Acquisition::Orders->search( { biblionumber => $biblionumber } ); - -$template->param( - countorders => $orders->search( { - datecancellationprinted => [ undef, '0000-00-00' ] - } )->count, - countdeletedorders => $orders->search( { - datecancellationprinted => [ { '!=' => [ -and => ( undef, '0000-00-00' ) ] } ] - } )->count, -) if $orders->count; - output_html_with_http_headers $query, $cookie, $template->output; diff --git a/catalogue/imageviewer.pl b/catalogue/imageviewer.pl index 9efba1754a..0fe29a301b 100755 --- a/catalogue/imageviewer.pl +++ b/catalogue/imageviewer.pl @@ -26,7 +26,6 @@ use C4::Items; use C4::Output; use C4::Images; use C4::Search; -use C4::Acquisition qw(GetOrdersByBiblionumber); use Koha::Biblios; use Koha::Patrons; @@ -87,26 +86,6 @@ $template->{VARS}->{'norequests'} = $norequests; $template->param(C4::Search::enabled_staff_search_views); $template->{VARS}->{'biblio'} = $biblio; -my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber); -my @deletedorders_using_biblio; -my @orders_using_biblio; - -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; - } - else { - push @orders_using_biblio, $myorder; - } -} - -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 $hold_count = $biblio ? $biblio->holds->count : 0; $template->param( holdcount => $hold_count ); diff --git a/catalogue/labeledMARCdetail.pl b/catalogue/labeledMARCdetail.pl index 8799a7f805..1269984570 100755 --- a/catalogue/labeledMARCdetail.pl +++ b/catalogue/labeledMARCdetail.pl @@ -28,7 +28,6 @@ use C4::Biblio; use C4::Items; use C4::Search; # enabled_staff_search_views use C4::Serials; -use C4::Acquisition qw(GetOrdersByBiblionumber); use Koha::Biblios; use Koha::BiblioFrameworks; @@ -133,28 +132,8 @@ $template->param ( searchid => scalar $query->param('searchid'), ); -my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber); -my @deletedorders_using_biblio; -my @orders_using_biblio; - -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; - } - else { - push @orders_using_biblio, $myorder; - } -} - -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); - $biblio = Koha::Biblios->find( $biblionumber ); my $holds = $biblio->holds; -$template->param( holdcount => $holds->count ); +$template->param( biblio => $biblio, holdcount => $holds->count ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index ea18505b45..0fc2559433 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -262,31 +262,11 @@ $template->param( biblioitemnumber => $bi, itemnumber => $itemnumber, z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)), - biblio => $biblio->unblessed, + biblio => $biblio, ); $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; - -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; - } - else { - push @orders_using_biblio, $myorder; - } -} - -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 = $biblio->holds; $template->param( holdcount => $holds->count ); -- 2.39.5