From d02e91f2694b7642282e124a871a8b6ebcde1055 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 12 Jan 2022 15:40:36 +0100 Subject: [PATCH] Bug 29859: Use iterator instead of as_list On bug 29844 we decided to remove wantarray from Koha::Objects->search. Reviewing the difference occurrences I found some unnecessary uses of ->as_list, where iterators should be used instead. This patch only removes the obvious places, not the tricky ones. Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Fridolin Somers --- C4/Overdues.pm | 2 +- Koha/Acquisition/Currency.pm | 8 ++--- Koha/AudioAlerts.pm | 4 +-- Koha/Holds.pm | 30 +++++++++---------- Koha/Library/Group.pm | 6 ++-- acqui/addorderiso2709.pl | 10 +++---- acqui/basket.pl | 4 +-- acqui/basketheader.pl | 8 ++--- acqui/duplicate_orders.pl | 3 +- acqui/histsearch.pl | 6 ++-- acqui/lateorders.pl | 2 +- acqui/neworderempty.pl | 4 +-- acqui/supplier.pl | 3 +- acqui/transferorder.pl | 6 ++-- admin/authorised_values.pl | 16 +++++----- admin/branches.pl | 12 ++------ admin/item_circulation_alerts.pl | 13 ++++---- admin/itemtypes.pl | 2 +- admin/marc_subfields_structure.pl | 3 +- admin/sms_providers.pl | 4 +-- catalogue/item-export.pl | 6 ++-- catalogue/itemsearch.pl | 8 +---- cataloguing/editor.pl | 4 +-- circ/circulation.pl | 2 +- circ/transfers_to_send.pl | 6 ++-- clubs/clubs.pl | 7 ++--- .../prog/en/includes/checkouts-table.inc | 4 +-- .../prog/en/modules/acqui/addorderiso2709.tt | 8 ++--- .../prog/en/modules/acqui/basket.tt | 2 +- .../prog/en/modules/acqui/basketheader.tt | 2 +- .../prog/en/modules/acqui/lateorders.tt | 2 +- .../prog/en/modules/acqui/neworderempty.tt | 4 +-- .../prog/en/modules/acqui/transferorder.tt | 4 +-- .../en/modules/admin/authorised_values.tt | 4 +-- .../prog/en/modules/admin/branches.tt | 4 +-- .../prog/en/modules/admin/sms_providers.tt | 2 +- .../prog/en/modules/circ/transfers_to_send.tt | 2 +- .../prog/en/modules/clubs/clubs.tt | 8 ++--- .../prog/en/modules/members/apikeys.tt | 2 +- .../prog/en/modules/serials/claims.tt | 2 +- .../en/modules/serials/subscription-detail.tt | 2 +- .../bootstrap/en/modules/opac-memberentry.tt | 2 +- members/apikeys.pl | 4 +-- members/boraccount.pl | 6 ++-- members/maninvoice.pl | 6 ++-- members/members-home.pl | 7 +++-- members/moremember.pl | 2 +- misc/cronjobs/reconcile_balances.pl | 4 +-- opac/opac-basket.pl | 7 ++--- opac/opac-downloadcart.pl | 18 +++++------ opac/opac-downloadshelf.pl | 18 +++++------ opac/opac-memberentry.pl | 8 ++--- opac/opac-messaging.pl | 4 +-- opac/opac-search.pl | 3 +- opac/opac-shelves.pl | 12 ++++---- reports/acquisitions_stats.pl | 4 +-- reports/borrowers_stats.pl | 2 +- serials/claims.pl | 2 +- serials/subscription-detail.pl | 2 +- suggestion/suggestion.pl | 4 +-- 60 files changed, 153 insertions(+), 193 deletions(-) diff --git a/C4/Overdues.pm b/C4/Overdues.pm index 1f63ce3e0b..c2bb217086 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -652,7 +652,7 @@ sub GetBranchcodesWithOverdueRules { |); if ( $branchcodes->[0] eq '' ) { # If a default rule exists, all branches should be returned - return map { $_->branchcode } Koha::Libraries->search({}, { order_by => 'branchname' })->as_list; + return Koha::Libraries->search({}, { order_by => 'branchname' })->get_column('branchcode'); } return @$branchcodes; } diff --git a/Koha/Acquisition/Currency.pm b/Koha/Acquisition/Currency.pm index ee91925d10..bf1daaf165 100644 --- a/Koha/Acquisition/Currency.pm +++ b/Koha/Acquisition/Currency.pm @@ -42,16 +42,12 @@ sub store { $self->_result->result_source->schema->txn_do( sub { if ( $self->active ) { # Remove the active flag from all other active currencies - my @currencies = Koha::Acquisition::Currencies->search( + Koha::Acquisition::Currencies->search( { currency => { '!=' => $self->currency }, active => 1, } - )->as_list; - for my $currency ( @currencies ) { - $currency->active(0); - $currency->store; - } + )->update({ active => 0 }); } $result = $self->SUPER::store; }); diff --git a/Koha/AudioAlerts.pm b/Koha/AudioAlerts.pm index 734d3a6281..8190ee01d1 100644 --- a/Koha/AudioAlerts.pm +++ b/Koha/AudioAlerts.pm @@ -91,14 +91,14 @@ sub move { if ( $where eq 'up' ) { unless ( $alert->precedence() == 1 ) { - my ($other) = $self->search( { precedence => $alert->precedence() - 1 } )->as_list; + my $other = $self->search( { precedence => $alert->precedence() - 1 } )->next; $other->precedence( $alert->precedence() )->store(); $alert->precedence( $alert->precedence() - 1 )->store(); } } elsif ( $where eq 'down' ) { unless ( $alert->precedence() == $self->get_last_precedence() ) { - my ($other) = $self->search( { precedence => $alert->precedence() + 1 } )->as_list; + my $other = $self->search( { precedence => $alert->precedence() + 1 } )->next; $other->precedence( $alert->precedence() )->store(); $alert->precedence( $alert->precedence() + 1 )->store(); } diff --git a/Koha/Holds.pm b/Koha/Holds.pm index d2d4593479..d2cea098cf 100644 --- a/Koha/Holds.pm +++ b/Koha/Holds.pm @@ -117,22 +117,20 @@ sub get_items_that_can_fill { push @bibs_or_items, 'me.itemnumber' => { in => \@itemnumbers } if @itemnumbers; push @bibs_or_items, 'biblionumber' => { in => \@biblionumbers } if @biblionumbers; - my @branchtransfers = map { $_->itemnumber } - Koha::Item::Transfers->search( - { datearrived => undef }, - { - columns => ['itemnumber'], - collapse => 1, - } - )->as_list; - my @waiting_holds = map { $_->itemnumber } - Koha::Holds->search( - { 'found' => 'W' }, - { - columns => ['itemnumber'], - collapse => 1, - } - )->as_list; + my @branchtransfers = Koha::Item::Transfers->search( + { datearrived => undef }, + { + columns => ['itemnumber'], + collapse => 1, + } + )->get_columns('itemnumber'); + my @waiting_holds = Koha::Holds->search( + { 'found' => 'W' }, + { + columns => ['itemnumber'], + collapse => 1, + } + )->get_column('itemnumber'); return Koha::Items->search( { diff --git a/Koha/Library/Group.pm b/Koha/Library/Group.pm index f85d715dbb..77a3d2196b 100644 --- a/Koha/Library/Group.pm +++ b/Koha/Library/Group.pm @@ -111,15 +111,13 @@ sub libraries { my $in_or_not = $invert ? '-not_in' : '-in'; - my @children = Koha::Library::Groups->search( + my @branchcodes = Koha::Library::Groups->search( { parent_id => $self->id, branchcode => { '!=' => undef }, }, { order_by => 'branchcode' } - )->as_list; - - my @branchcodes = map { $_->branchcode } @children; + )->get_column('branchcode'); return Koha::Libraries->search( { diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index 1ce63d158b..658adb03da 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -96,12 +96,11 @@ if ($op eq ""){ # } elsif ($op eq "batch_details"){ #display lines inside the selected batch - # get currencies (for change rates calcs if needed) - my @currencies = Koha::Acquisition::Currencies->search->as_list; $template->param("batch_details" => 1, "basketno" => $cgiparams->{'basketno'}, - currencies => \@currencies, + # get currencies (for change rates calcs if needed) + currencies => Koha::Acquisition::Currencies->search, bookseller => $bookseller, "allmatch" => $allmatch, ); @@ -611,7 +610,6 @@ sub import_biblios_list { my $overlay_action = GetImportBatchOverlayAction($import_batch_id); my $nomatch_action = GetImportBatchNoMatchAction($import_batch_id); my $item_action = GetImportBatchItemAction($import_batch_id); - my @itypes = Koha::ItemTypes->search->as_list; $template->param(biblio_list => \@list, num_results => $num_records, import_batch_id => $import_batch_id, @@ -622,9 +620,9 @@ sub import_biblios_list { "item_action_${item_action}" => 1, item_action => $item_action, item_error => $item_error, - libraries => scalar Koha::Libraries->search(), + libraries => Koha::Libraries->search, locationloop => \@locations, - itypeloop => \@itypes, + itemtypes => Koha::ItemTypes->search, ccodeloop => \@ccodes, notforloanloop => \@notforloans, ); diff --git a/acqui/basket.pl b/acqui/basket.pl index 7d9ee557c9..f0cbb840fc 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -424,8 +424,8 @@ if ( $op eq 'list' ) { unclosable => @orders || @cancelledorders ? $basket->{is_standing} : 1, has_budgets => $has_budgets, duplinbatch => $duplinbatch, - csv_profiles => [ Koha::CsvProfiles->search({ type => 'sql', used_for => 'export_basket' })->as_list ], - available_additional_fields => [ Koha::AdditionalFields->search( { tablename => 'aqbasket' } )->as_list ], + csv_profiles => Koha::CsvProfiles->search({ type => 'sql', used_for => 'export_basket' }), + available_additional_fields => Koha::AdditionalFields->search( { tablename => 'aqbasket' } ), additional_field_values => { map { $_->field->name => $_->value } Koha::Acquisition::Baskets->find($basketno)->additional_field_values->as_list }, diff --git a/acqui/basketheader.pl b/acqui/basketheader.pl index f813c0e1e1..e79daa70a7 100755 --- a/acqui/basketheader.pl +++ b/acqui/basketheader.pl @@ -74,7 +74,7 @@ my $basket; my $op = $input->param('op'); my $is_an_edit = $input->param('is_an_edit'); -$template->param( available_additional_fields => [ Koha::AdditionalFields->search( { tablename => 'aqbasket' } )->as_list ] ); +$template->param( available_additional_fields => Koha::AdditionalFields->search( { tablename => 'aqbasket' } ) ); if ( $op eq 'add_form' ) { my @contractloop; @@ -116,9 +116,9 @@ if ( $op eq 'add_form' ) { $template->param(contractloop => \@contractloop, basketcontractnumber => $basket->{'contractnumber'}); } - my @booksellers = Koha::Acquisition::Booksellers->search( + my $booksellers = Koha::Acquisition::Booksellers->search( undef, - { order_by => { -asc => 'name' } } )->as_list; + { order_by => { -asc => 'name' } } ); $template->param( add_form => 1, basketname => $basket->{'basketname'}, @@ -127,7 +127,7 @@ if ( $op eq 'add_form' ) { booksellername => $bookseller->name, booksellerid => $booksellerid, basketno => $basketno, - booksellers => \@booksellers, + booksellers => $booksellers, is_standing => $basket->{is_standing}, create_items => $basket->{create_items}, ); diff --git a/acqui/duplicate_orders.pl b/acqui/duplicate_orders.pl index d22babe64d..21e382e72f 100755 --- a/acqui/duplicate_orders.pl +++ b/acqui/duplicate_orders.pl @@ -117,9 +117,8 @@ elsif ( $op eq 'batch_edit' ) { @{$budget_loop} = sort { uc( $a->{b_txt} ) cmp uc( $b->{b_txt} ) } @{$budget_loop}; - my @currencies = Koha::Acquisition::Currencies->search->as_list; $template->param( - currencies => \@currencies, + currencies => Koha::Acquisition::Currencies->search, budget_loop => $budget_loop, ); } diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index a905763283..e1bdb3851f 100755 --- a/acqui/histsearch.pl +++ b/acqui/histsearch.pl @@ -99,10 +99,10 @@ unless ( $input->param('from') ) { } $filters->{from_placed_on} = output_pref( { dt => $from_placed_on, dateformat => 'iso', dateonly => 1 } ); $filters->{to_placed_on} = output_pref( { dt => $to_placed_on, dateformat => 'iso', dateonly => 1 } ); -my @additional_fields = Koha::AdditionalFields->search( { tablename => 'aqbasket', searchable => 1 } )->as_list; -$template->param( available_additional_fields => \@additional_fields ); +my $additional_fields = Koha::AdditionalFields->search( { tablename => 'aqbasket', searchable => 1 } ); +$template->param( available_additional_fields => $additional_fields ); my @additional_field_filters; -foreach my $additional_field (@additional_fields) { +while ( my $additional_field = $additional_fields->next ) { my $value = $input->param('additional_field_' . $additional_field->id); if (defined $value and $value ne '') { push @additional_field_filters, { diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl index 43ce39685a..a47088c44e 100755 --- a/acqui/lateorders.pl +++ b/acqui/lateorders.pl @@ -157,6 +157,6 @@ $template->param( estimateddeliverydatefrom => $estimateddeliverydatefrom, estimateddeliverydateto => $estimateddeliverydateto, intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - csv_profiles => [ Koha::CsvProfiles->search({ type => 'sql', used_for => 'late_orders' })->as_list ], + csv_profiles => Koha::CsvProfiles->search({ type => 'sql', used_for => 'late_orders' }), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index 204448a536..7c443147b1 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -207,7 +207,6 @@ if ( not $ordernumber ) { # create order } if ( not $biblionumber and Koha::BiblioFrameworks->find('ACQ') ) { - #my $acq_mss = Koha::MarcSubfieldStructures->search({ frameworkcode => 'ACQ', tagfield => { '!=' => $itemnumber_tag } }); foreach my $tag ( sort keys %{$tagslib} ) { next if $tag eq ''; next if $tag eq $itemnumber_tag; # skip items fields @@ -326,7 +325,6 @@ $template->param( catalog_details => \@catalog_details, ); my $suggestion; $suggestion = GetSuggestionInfo($suggestionid) if $suggestionid; -my @currencies = Koha::Acquisition::Currencies->search->as_list; my $active_currency = Koha::Acquisition::Currencies->get_active; # build bookfund list @@ -452,7 +450,7 @@ $template->param( invoiceincgst => $bookseller->invoiceincgst, cur_active_sym => $active_currency->symbol, cur_active => $active_currency->currency, - currencies => \@currencies, + currencies => Koha::Acquisition::Currencies->search, currency => $data->{currency}, vendor_currency => $bookseller->listprice, orderexists => ( $new eq 'yes' ) ? 0 : 1, diff --git a/acqui/supplier.pl b/acqui/supplier.pl index 82c08e4b08..af8fce7135 100755 --- a/acqui/supplier.pl +++ b/acqui/supplier.pl @@ -96,7 +96,6 @@ if ( $op eq 'display' ) { print $query->redirect('/cgi-bin/koha/acqui/acqui-home.pl'); exit; } else { - my @currencies = Koha::Acquisition::Currencies->search->as_list; # get option values from TaxRates syspref my @gst_values = map { @@ -108,7 +107,7 @@ if ( $op eq 'display' ) { active => $supplier ? $supplier->active : 1, tax_rate => $supplier ? $supplier->tax_rate + 0.0 : 0, gst_values => \@gst_values, - currencies => \@currencies, + currencies => Koha::Acquisition::Currencies->search, enter => 1, ); } diff --git a/acqui/transferorder.pl b/acqui/transferorder.pl index 06a41aa763..1fa15be7b8 100755 --- a/acqui/transferorder.pl +++ b/acqui/transferorder.pl @@ -117,13 +117,13 @@ if( $basketno && $ordernumber) { # Search for booksellers to transfer from/to $op = '' unless $op; if( $op eq "do_search" ) { - my @booksellers = Koha::Acquisition::Booksellers->search( + my $booksellers = Koha::Acquisition::Booksellers->search( { name => { -like => "%$query%" } }, - { order_by => { -asc => 'name' } } )->as_list; + { order_by => { -asc => 'name' } } ); $template->param( query => $query, do_search => 1, - booksellersloop => \@booksellers, + booksellers => $booksellers, ); } } diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl index f99454e404..b7ee5b4426 100755 --- a/admin/authorised_values.pl +++ b/admin/authorised_values.pl @@ -212,13 +212,15 @@ $template->param( if ( $op eq 'list' ) { # build categories list - my @categories = Koha::AuthorisedValueCategories->search({ category_name => { -not_in => ['', 'branches', 'itemtypes', 'cn_source']}}, { order_by => ['category_name'] } )->as_list; - my @category_list; - for my $category ( @categories ) { - push( @category_list, $category->category_name ); - } + my @category_names = Koha::AuthorisedValueCategories->search( + { + category_name => + { -not_in => [ '', 'branches', 'itemtypes', 'cn_source' ] } + }, + { order_by => ['category_name'] } + )->get_column('category_name'); - $searchfield ||= $category_list[0]; + $searchfield ||= $category_names[0]; my @avs_by_category = Koha::AuthorisedValues->new->search( { category => $searchfield } )->as_list; my @loop_data = (); @@ -238,7 +240,7 @@ if ( $op eq 'list' ) { $template->param( loop => \@loop_data, category => Koha::AuthorisedValueCategories->find($searchfield), # TODO Move this up and add a Koha::AVC->authorised_values method to replace call for avs_by_category - categories => \@category_list, + category_names => \@category_names, ); } diff --git a/admin/branches.pl b/admin/branches.pl index 40b2b346e2..08a73f6571 100755 --- a/admin/branches.pl +++ b/admin/branches.pl @@ -49,17 +49,9 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ); if ( $op eq 'add_form' ) { - my $library; - if ($branchcode) { - $library = Koha::Libraries->find($branchcode); - $template->param( selected_smtp_server => $library->smtp_server ); - } - - my @smtp_servers = Koha::SMTP::Servers->search->as_list; - $template->param( - library => $library, - smtp_servers => \@smtp_servers + library => Koha::Libraries->find($branchcode), + smtp_servers => Koha::SMTP::Servers->search, ); } elsif ( $op eq 'add_validate' ) { my @fields = qw( diff --git a/admin/item_circulation_alerts.pl b/admin/item_circulation_alerts.pl index 58bb6b2745..57a3c7d123 100755 --- a/admin/item_circulation_alerts.pl +++ b/admin/item_circulation_alerts.pl @@ -47,16 +47,15 @@ sub show { ); my $branch = $input->param('branch') || '*'; - my @categories = Koha::Patron::Categories->search_with_library_limits->as_list; - my @item_types = Koha::ItemTypes->search->as_list; my $grid_checkout = $preferences->grid({ branchcode => $branch, notification => 'CHECKOUT' }); my $grid_checkin = $preferences->grid({ branchcode => $branch, notification => 'CHECKIN' }); - $template->param(branch => $branch); - $template->param(categories => \@categories); - $template->param(item_types => \@item_types); - $template->param(grid_checkout => $grid_checkout); - $template->param(grid_checkin => $grid_checkin); + $template->param( + branch => $branch, + item_types => Koha::ItemTypes->search, + grid_checkout => $grid_checkout, + grid_checkin => $grid_checkin, + ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl index 975064af9a..44e9ad5445 100755 --- a/admin/itemtypes.pl +++ b/admin/itemtypes.pl @@ -198,7 +198,7 @@ if ( $op eq 'add_form' ) { if ( $op eq 'list' ) { $template->param( - itemtypes => scalar Koha::ItemTypes->search, + itemtypes => Koha::ItemTypes->search, messages => \@messages, ); } diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index f0f3e0cd3c..cf8e16462f 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -97,8 +97,7 @@ if ( $op eq 'add_form' ) { $sth2->finish; $sth2 = $dbh->prepare("select distinct category from authorised_values"); $sth2->execute; - my @av_cat = Koha::AuthorisedValueCategories->search->as_list; - my @authorised_values = map { $_->category_name } @av_cat; + my @authorised_values= Koha::AuthorisedValueCategories->search->get_column('category_name'); # build thesaurus categories list my @authtypes = uniq( "", map { $_->authtypecode } Koha::Authority::Types->search->as_list ); diff --git a/admin/sms_providers.pl b/admin/sms_providers.pl index a059ece563..1677576d94 100755 --- a/admin/sms_providers.pl +++ b/admin/sms_providers.pl @@ -62,8 +62,8 @@ elsif ( $op eq 'delete' ) { $provider->delete() if $provider; } -my @providers = Koha::SMS::Providers->search->as_list; +my $providers = Koha::SMS::Providers->search; -$template->param( providers => \@providers ); +$template->param( providers => $providers ); output_html_with_http_headers $cgi, $cookie, $template->output; diff --git a/catalogue/item-export.pl b/catalogue/item-export.pl index 4aec67e035..52f6b84a4c 100755 --- a/catalogue/item-export.pl +++ b/catalogue/item-export.pl @@ -36,7 +36,7 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({ my @itemnumbers = $cgi->multi_param('itemnumber'); my $format = $cgi->param('format') // 'csv'; -my @items = Koha::Items->search({ itemnumber => { -in => \@itemnumbers } })->as_list; +my $items = Koha::Items->search({ itemnumber => { -in => \@itemnumbers } }); if ($format eq 'barcodes') { print $cgi->header({ @@ -44,14 +44,14 @@ if ($format eq 'barcodes') { attachment => 'barcodes.txt', }); - foreach my $item (@items) { + while ( my $item = $items->next ) { print $item->barcode . "\n"; } exit; } $template->param( - results => \@items, + results => $items, ); print $cgi->header({ diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl index b9cc03be0b..354ea86ccb 100755 --- a/catalogue/itemsearch.pl +++ b/catalogue/itemsearch.pl @@ -260,13 +260,7 @@ if ( defined $format ) { # Display the search form my @branches = map { value => $_->branchcode, label => $_->branchname }, Koha::Libraries->search( {}, { order_by => 'branchname' } )->as_list; -my @itemtypes; -foreach my $itemtype ( Koha::ItemTypes->search_with_localization->as_list ) { - push @itemtypes, { - value => $itemtype->itemtype, - label => $itemtype->translated_description, - }; -} +my @itemtypes = map { value => $_->itemtype, label => $_->translated_description }, Koha::ItemTypes->search_with_localization->as_list; my @ccodes = Koha::AuthorisedValues->get_descriptions_by_koha_field({ kohafield => 'items.ccode' }); foreach my $ccode (@ccodes) { diff --git a/cataloguing/editor.pl b/cataloguing/editor.pl index 8ce41e8eb2..53152c01dd 100755 --- a/cataloguing/editor.pl +++ b/cataloguing/editor.pl @@ -49,11 +49,9 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $schema = Koha::Database->new->schema; -my @keyboard_shortcuts = Koha::KeyboardShortcuts->search->as_list; - # Keyboard shortcuts $template->param( - shortcuts => \@keyboard_shortcuts, + shortcuts => Koha::KeyboardShortcuts->search, ); # Available import batches diff --git a/circ/circulation.pl b/circ/circulation.pl index 4e31d12485..76355aefb5 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -603,7 +603,7 @@ $template->param( if ( C4::Context->preference("ExportCircHistory") ) { - $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' })->as_list ]); + $template->param(csv_profiles => Koha::CsvProfiles->search({ type => 'marc' })); } my $has_modifications = Koha::Patron::Modifications->search( { borrowernumber => $borrowernumber } )->count; diff --git a/circ/transfers_to_send.pl b/circ/transfers_to_send.pl index da5c0c3e5c..865b9048df 100755 --- a/circ/transfers_to_send.pl +++ b/circ/transfers_to_send.pl @@ -41,7 +41,7 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( my $branchcode = C4::Context->userenv->{'branch'}; # transfers requested but not yet sent -my @transfers = Koha::Libraries->search( +my $transfers = Koha::Libraries->search( { 'branchtransfers_tobranches.frombranch' => $branchcode, 'branchtransfers_tobranches.daterequested' => { '!=' => undef }, @@ -53,10 +53,10 @@ my @transfers = Koha::Libraries->search( prefetch => 'branchtransfers_tobranches', order_by => 'branchtransfers_tobranches.tobranch' } -)->as_list; +); $template->param( - libraries => \@transfers, + libraries => $transfers, show_date => dt_from_string ); diff --git a/clubs/clubs.pl b/clubs/clubs.pl index 05d7fe985e..ce2053e5af 100755 --- a/clubs/clubs.pl +++ b/clubs/clubs.pl @@ -45,15 +45,12 @@ my $club_id = $cgi->param('club_id'); my $club_template = $club_template_id ? Koha::Club::Templates->find( $club_template_id ) : undef; my $club = $club_id ? Koha::Clubs->find( $club_id ) : undef; -my @club_templates = Koha::Club::Templates->search->as_list; -my @clubs = Koha::Clubs->search->as_list; - $template->param( stored => $stored, club_template => $club_template, club => $club, - club_templates => \@club_templates, - clubs => \@clubs, + club_templates => Koha::Club::Templates->search, + clubs => Koha::Clubs->search, ); output_html_with_http_headers( $cgi, $cookie, $template->output ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc index 002a1b4440..0c13322abd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc @@ -64,12 +64,12 @@ - [% IF csv_profiles.size %] + [% IF csv_profiles.count %]
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt index 1914c5545b..09648ab56a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -7,7 +7,7 @@