Bug 29844: Fix ->search occurrences
and some more... There are lot of inconsistencies in our ->search calls. We could simplify some of them, but not in this patch. Here we want to prevent regressions as much as possible and so don't add unecessary changes. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
4ae2f6d9d8
commit
e53667105d
|
|
@ -2291,7 +2291,7 @@ sub GetHistory {
|
|||
push @query_params, @$ordernumbers;
|
||||
}
|
||||
if ( @$additional_fields ) {
|
||||
my @baskets = Koha::Acquisition::Baskets->filter_by_additional_fields($additional_fields);
|
||||
my @baskets = Koha::Acquisition::Baskets->filter_by_additional_fields($additional_fields)->as_list;
|
||||
|
||||
return [] unless @baskets;
|
||||
|
||||
|
|
|
|||
|
|
@ -540,7 +540,7 @@ sub get_template_and_user {
|
|||
EnableBorrowerFiles => C4::Context->preference('EnableBorrowerFiles'),
|
||||
UseCourseReserves => C4::Context->preference("UseCourseReserves"),
|
||||
useDischarge => C4::Context->preference('useDischarge'),
|
||||
pending_checkout_notes => scalar Koha::Checkouts->search({ noteseen => 0 }),
|
||||
pending_checkout_notes => Koha::Checkouts->search({ noteseen => 0 }),
|
||||
);
|
||||
}
|
||||
else {
|
||||
|
|
@ -582,7 +582,7 @@ sub get_template_and_user {
|
|||
$opac_name = C4::Context->userenv->{'branch'};
|
||||
}
|
||||
|
||||
my @search_groups = Koha::Library::Groups->get_search_groups({ interface => 'opac' });
|
||||
my @search_groups = Koha::Library::Groups->get_search_groups({ interface => 'opac' })->as_list;
|
||||
$template->param(
|
||||
AnonSuggestions => "" . C4::Context->preference("AnonSuggestions"),
|
||||
LibrarySearchGroups => \@search_groups,
|
||||
|
|
@ -1156,7 +1156,7 @@ sub checkauth {
|
|||
$register_id = $register->id if ($register);
|
||||
$register_name = $register->name if ($register);
|
||||
}
|
||||
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search };
|
||||
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search->as_list };
|
||||
if ( $type ne 'opac' and C4::Context->preference('AutoLocation') ) {
|
||||
|
||||
# we have to check they are coming from the right ip range
|
||||
|
|
@ -1578,7 +1578,7 @@ sub check_api_auth {
|
|||
my $library = Koha::Libraries->find($branchcode);
|
||||
$branchname = $library? $library->branchname: '';
|
||||
}
|
||||
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search };
|
||||
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search->as_list };
|
||||
foreach my $br ( keys %$branches ) {
|
||||
|
||||
# now we work with the treatment of ip
|
||||
|
|
|
|||
|
|
@ -837,7 +837,7 @@ sub CanBookBeIssued {
|
|||
my $no_issues_charge_guarantees = C4::Context->preference("NoIssuesChargeGuarantees");
|
||||
$no_issues_charge_guarantees = undef unless looks_like_number( $no_issues_charge_guarantees );
|
||||
if ( defined $no_issues_charge_guarantees ) {
|
||||
my @guarantees = map { $_->guarantee } $patron->guarantee_relationships();
|
||||
my @guarantees = map { $_->guarantee } $patron->guarantee_relationships->as_list;
|
||||
my $guarantees_non_issues_charges = 0;
|
||||
foreach my $g ( @guarantees ) {
|
||||
$guarantees_non_issues_charges += $g->account->non_issues_charges;
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ sub MapItemsToHoldRequests {
|
|||
|
||||
map { $_->{_object} = Koha::Items->find( $_->{itemnumber} ) } @$available_items;
|
||||
my $libraries = {};
|
||||
map { $libraries->{$_->id} = $_ } Koha::Libraries->search();
|
||||
map { $libraries->{$_->id} = $_ } Koha::Libraries->search->as_list;
|
||||
|
||||
# group available items by itemnumber
|
||||
my %items_by_itemnumber = map { $_->{itemnumber} => $_ } @$available_items;
|
||||
|
|
|
|||
|
|
@ -548,7 +548,7 @@ sub GetPatronInfo {
|
|||
value_description => $_->description, # Awkward retro-compability...
|
||||
}
|
||||
: ()
|
||||
} $patron->extended_attributes->search
|
||||
} $patron->extended_attributes->search->as_list
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -331,8 +331,8 @@ sub grid {
|
|||
my ($class, $where) = @_;
|
||||
my @branch_prefs = $class->find($where);
|
||||
my @default_prefs = $class->find({ branchcode => '*', notification => $where->{notification} });
|
||||
my @cc = Koha::Patron::Categories->search_with_library_limits;
|
||||
my @it = Koha::ItemTypes->search;
|
||||
my @cc = Koha::Patron::Categories->search_with_library_limits->as_list;
|
||||
my @it = Koha::ItemTypes->search->as_list;
|
||||
my $notification = $where->{notification};
|
||||
my %disabled = map {
|
||||
my $key = $_->categorycode . "-" . $_->item_type . "-" . $notification;
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ sub patronflags {
|
|||
$no_issues_charge_guarantees = undef unless looks_like_number( $no_issues_charge_guarantees );
|
||||
if ( defined $no_issues_charge_guarantees ) {
|
||||
my $p = Koha::Patrons->find( $patroninformation->{borrowernumber} );
|
||||
my @guarantees = map { $_->guarantee } $p->guarantee_relationships;
|
||||
my @guarantees = map { $_->guarantee } $p->guarantee_relationships->as_list;
|
||||
my $guarantees_non_issues_charges = 0;
|
||||
foreach my $g ( @guarantees ) {
|
||||
$guarantees_non_issues_charges += $g->account->non_issues_charges;
|
||||
|
|
|
|||
|
|
@ -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' });
|
||||
return map { $_->branchcode } Koha::Libraries->search({}, { order_by => 'branchname' })->as_list;
|
||||
}
|
||||
return @$branchcodes;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -989,7 +989,7 @@ Unsuspends all suspended reserves with a suspend_until date from before today.
|
|||
sub AutoUnsuspendReserves {
|
||||
my $today = dt_from_string();
|
||||
|
||||
my @holds = Koha::Holds->search( { suspend_until => { '<=' => $today->ymd() } } );
|
||||
my @holds = Koha::Holds->search( { suspend_until => { '<=' => $today->ymd() } } )->as_list;
|
||||
|
||||
map { $_->resume() } @holds;
|
||||
}
|
||||
|
|
@ -1414,7 +1414,7 @@ AllowHoldsOnDamagedItems or 'holdallowed' own/sibling library)
|
|||
sub ItemsAnyAvailableAndNotRestricted {
|
||||
my $param = shift;
|
||||
|
||||
my @items = Koha::Items->search( { biblionumber => $param->{biblionumber} } );
|
||||
my @items = Koha::Items->search( { biblionumber => $param->{biblionumber} } )->as_list;
|
||||
|
||||
foreach my $i (@items) {
|
||||
my $reserves_control_branch =
|
||||
|
|
@ -1553,7 +1553,7 @@ sub SuspendAll {
|
|||
$params->{borrowernumber} = $borrowernumber if $borrowernumber;
|
||||
$params->{biblionumber} = $biblionumber if $biblionumber;
|
||||
|
||||
my @holds = Koha::Holds->search($params);
|
||||
my @holds = Koha::Holds->search($params)->as_list;
|
||||
|
||||
if ($suspend) {
|
||||
map { $_->suspend_hold($suspend_until) } @holds;
|
||||
|
|
@ -2287,7 +2287,7 @@ sub GetMaxPatronHoldsForRecord {
|
|||
my ( $borrowernumber, $biblionumber ) = @_;
|
||||
|
||||
my $patron = Koha::Patrons->find($borrowernumber);
|
||||
my @items = Koha::Items->search( { biblionumber => $biblionumber } );
|
||||
my @items = Koha::Items->search( { biblionumber => $biblionumber } )->as_list;
|
||||
|
||||
my $controlbranch = C4::Context->preference('ReservesControlBranch');
|
||||
|
||||
|
|
|
|||
|
|
@ -565,7 +565,7 @@ sub build_patron_attributes_string {
|
|||
borrowernumber => $self->{borrowernumber},
|
||||
code => $a->{code}
|
||||
}
|
||||
);
|
||||
)->as_list;
|
||||
|
||||
foreach my $attribute ( @attributes ) {
|
||||
my $value = $attribute->attribute();
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ sub getRecords {
|
|||
my $results_hashref = ();
|
||||
|
||||
# TODO simplify this structure ( { branchcode => $branchname } is enought) and remove this parameter
|
||||
$branches ||= { map { $_->branchcode => { branchname => $_->branchname } } Koha::Libraries->search };
|
||||
$branches ||= { map { $_->branchcode => { branchname => $_->branchname } } Koha::Libraries->search->as_list };
|
||||
|
||||
# Initialize variables for the faceted results objects
|
||||
my $facets_counter = {};
|
||||
|
|
@ -1638,7 +1638,7 @@ sub searchResults {
|
|||
});
|
||||
|
||||
#Build branchnames hash
|
||||
my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' });
|
||||
my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' })->as_list;
|
||||
|
||||
# FIXME - We build an authorised values hash here, using the default framework
|
||||
# though it is possible to have different authvals for different fws.
|
||||
|
|
|
|||
|
|
@ -528,7 +528,7 @@ sub SearchSubscriptions {
|
|||
my $additional_fields = $args->{additional_fields} // [];
|
||||
my $matching_record_ids_for_additional_fields = [];
|
||||
if ( @$additional_fields ) {
|
||||
my @subscriptions = Koha::Subscriptions->filter_by_additional_fields($additional_fields);
|
||||
my @subscriptions = Koha::Subscriptions->filter_by_additional_fields($additional_fields)->as_list;
|
||||
|
||||
return () unless @subscriptions;
|
||||
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ sub buildKohaItemsNamespace {
|
|||
my $ccodes =
|
||||
{ map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => "", kohafield => 'items.ccode' } ) };
|
||||
|
||||
my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' });
|
||||
my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' })->as_list;
|
||||
|
||||
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search->unblessed } };
|
||||
my $xml = '';
|
||||
|
|
|
|||
|
|
@ -91,14 +91,14 @@ sub move {
|
|||
|
||||
if ( $where eq 'up' ) {
|
||||
unless ( $alert->precedence() == 1 ) {
|
||||
my ($other) = $self->search( { precedence => $alert->precedence() - 1 } );
|
||||
my ($other) = $self->search( { precedence => $alert->precedence() - 1 } )->as_list;
|
||||
$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 } );
|
||||
my ($other) = $self->search( { precedence => $alert->precedence() + 1 } )->as_list;
|
||||
$other->precedence( $alert->precedence() )->store();
|
||||
$alert->precedence( $alert->precedence() + 1 )->store();
|
||||
}
|
||||
|
|
@ -125,7 +125,7 @@ and to have no gaps
|
|||
sub fix_precedences {
|
||||
my ($self) = @_;
|
||||
|
||||
my @alerts = $self->search();
|
||||
my @alerts = $self->search->as_list;
|
||||
|
||||
my $i = 1;
|
||||
map { $_->precedence( $i++ )->store() } @alerts;
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ sub get_descriptions_by_koha_field {
|
|||
my $cached = $memory_cache->get_from_cache($cache_key);
|
||||
return @$cached if $cached;
|
||||
|
||||
my @avs = $self->search_by_koha_field($params);
|
||||
my @avs = $self->search_by_koha_field($params)->as_list;
|
||||
my @descriptions = map {
|
||||
{
|
||||
authorised_value => $_->authorised_value,
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ sub additional_report {
|
|||
|
||||
my $loggedinuser = C4::Context->userenv ? C4::Context->userenv->{'number'} : undef;
|
||||
return {
|
||||
lists => scalar Koha::Virtualshelves->search(
|
||||
lists => Koha::Virtualshelves->search(
|
||||
[
|
||||
{ public => 0, owner => $loggedinuser },
|
||||
{ public => 1 }
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ sub club_enrollments {
|
|||
|
||||
return unless $self->id();
|
||||
|
||||
return scalar Koha::Club::Enrollments->search( { club_id => $self->id(), date_canceled => undef } );
|
||||
return Koha::Club::Enrollments->search( { club_id => $self->id(), date_canceled => undef } );
|
||||
}
|
||||
|
||||
=head3 club_fields
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ sub get_enrollable {
|
|||
my $borrower = $params->{borrower};
|
||||
if ($borrower) {
|
||||
delete( $params->{borrower} );
|
||||
my @enrollments = $borrower->get_club_enrollments();
|
||||
my @enrollments = $borrower->get_club_enrollments->as_list;
|
||||
if (@enrollments) {
|
||||
$params->{'me.id'} = { -not_in => [ map { $_->club()->id() } @enrollments ] };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ sub library {
|
|||
|
||||
=head3 libraries
|
||||
|
||||
my @libraries = $group->libraries( { [invert => 1] } );
|
||||
my $libraries = $group->libraries( { [invert => 1] } );
|
||||
|
||||
Returns the libraries set as direct children of this group.
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ sub libraries {
|
|||
branchcode => { '!=' => undef },
|
||||
},
|
||||
{ order_by => 'branchcode' }
|
||||
);
|
||||
)->as_list;
|
||||
|
||||
my @branchcodes = map { $_->branchcode } @children;
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ sub all_libraries {
|
|||
|
||||
=head3 libraries_not_direct_children
|
||||
|
||||
my @libraries = $group->libraries_not_direct_children();
|
||||
my $libraries = $group->libraries_not_direct_children();
|
||||
|
||||
Returns the libraries *not* set as direct children of this group
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ sub get_root_groups {
|
|||
|
||||
=head3 get_search_groups
|
||||
|
||||
my @search_groups = $self->get_search_groups({[interface => 'staff' || 'opac']}))
|
||||
my $search_groups = $self->get_search_groups({[interface => 'staff' || 'opac']}))
|
||||
|
||||
Returns search groups for the specified interface.
|
||||
Defaults to OPAC if no interface is specified.
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ Koha::Objects::Mixin::AdditionalFields
|
|||
|
||||
=head3 filter_by_additional_fields
|
||||
|
||||
my @objects = Koha::Foos->filter_by_additional_fields([
|
||||
my $objects = Koha::Foos->filter_by_additional_fields([
|
||||
{
|
||||
id => 1,
|
||||
value => 'foo',
|
||||
|
|
|
|||
|
|
@ -395,11 +395,11 @@ sub delete {
|
|||
# This pref should then govern the results of other routines/methods such as
|
||||
# Koha::Virtualshelf->new->delete too.
|
||||
# FIXME Could be $patron->get_lists
|
||||
$_->delete for Koha::Virtualshelves->search( { owner => $self->borrowernumber } );
|
||||
$_->delete for Koha::Virtualshelves->search( { owner => $self->borrowernumber } )->as_list;
|
||||
|
||||
# We cannot have a FK on borrower_modifications.borrowernumber, the table is also used
|
||||
# for patron selfreg
|
||||
$_->delete for Koha::Patron::Modifications->search( { borrowernumber => $self->borrowernumber } );
|
||||
$_->delete for Koha::Patron::Modifications->search( { borrowernumber => $self->borrowernumber } )->as_list;
|
||||
|
||||
$self->SUPER::delete;
|
||||
|
||||
|
|
@ -1207,7 +1207,7 @@ sub get_overdues {
|
|||
|
||||
=head3 get_routing_lists
|
||||
|
||||
my @routinglists = $patron->get_routing_lists
|
||||
my $routinglists = $patron->get_routing_lists
|
||||
|
||||
Returns the routing lists a patron is subscribed to.
|
||||
|
||||
|
|
@ -1779,7 +1779,7 @@ sub _anonymize_column {
|
|||
|
||||
=head3 add_guarantor
|
||||
|
||||
my @relationships = $patron->add_guarantor(
|
||||
my $relationship = $patron->add_guarantor(
|
||||
{
|
||||
borrowernumber => $borrowernumber,
|
||||
relationships => $relationship,
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ sub approve {
|
|||
{ borrowernumber => $patron->borrowernumber,
|
||||
code => $code
|
||||
}
|
||||
);
|
||||
)->as_list;
|
||||
}
|
||||
foreach my $attr ( @{$extended_attributes} ) {
|
||||
$attr->{attribute} = exists $attr->{attribute} ? $attr->{attribute} : $attr->{value};
|
||||
|
|
|
|||
|
|
@ -292,8 +292,8 @@ sub get_checkouts {
|
|||
|
||||
my $checkouts =
|
||||
($checked_in)
|
||||
? $c->objects->search( scalar $biblio->old_checkouts )
|
||||
: $c->objects->search( scalar $biblio->current_checkouts );
|
||||
? $c->objects->search( $biblio->old_checkouts )
|
||||
: $c->objects->search( $biblio->current_checkouts );
|
||||
|
||||
return $c->render(
|
||||
status => 200,
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ sub get {
|
|||
|
||||
return try {
|
||||
my $patron_id = $c->validation->param('patron_id');
|
||||
my $patron = $c->objects->find( scalar Koha::Patrons->search_limited, $patron_id );
|
||||
my $patron = $c->objects->find( Koha::Patrons->search_limited, $patron_id );
|
||||
|
||||
unless ($patron) {
|
||||
return $c->render(
|
||||
|
|
|
|||
|
|
@ -1354,10 +1354,10 @@ sub get_facetable_fields {
|
|||
my @search_field_names = qw( author itype location su-geo title-series subject ccode holdingbranch homebranch ln );
|
||||
my @faceted_fields = Koha::SearchFields->search(
|
||||
{ name => { -in => \@search_field_names }, facet_order => { '!=' => undef } }, { order_by => ['facet_order'] }
|
||||
);
|
||||
)->as_list;
|
||||
my @not_faceted_fields = Koha::SearchFields->search(
|
||||
{ name => { -in => \@search_field_names }, facet_order => undef }, { order_by => ['facet_order'] }
|
||||
);
|
||||
)->as_list;
|
||||
# This could certainly be improved
|
||||
return ( @faceted_fields, @not_faceted_fields );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ sub pickup_locations {
|
|||
if defined $biblio;
|
||||
}
|
||||
} else {
|
||||
@libraries = Koha::Libraries->search( { pickup_location => 1 }, { order_by => ['branchname'] } )
|
||||
@libraries = Koha::Libraries->search( { pickup_location => 1 }, { order_by => ['branchname'] } )->as_list
|
||||
unless @libraries;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ sub ListForLibrary {
|
|||
my ($self) = @_;
|
||||
my $branch_limit =
|
||||
C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
|
||||
return scalar Koha::Desks->search(
|
||||
return Koha::Desks->search(
|
||||
{ branchcode => $branch_limit },
|
||||
{ order_by => { '-asc' => 'desk_name' } }
|
||||
);
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ Koha::Uploader - Facilitate file uploads (temporary and permanent)
|
|||
# Do something with $upload->count, $upload->result or $upload->err
|
||||
|
||||
# get some upload records (in staff) via Koha::UploadedFiles
|
||||
my @uploads1 = Koha::UploadedFiles->search({ filename => $name });
|
||||
my @uploads2 = Koha::UploadedFiles->search_term({ term => $term });
|
||||
my $uploads1 = Koha::UploadedFiles->search({ filename => $name });
|
||||
my $uploads2 = Koha::UploadedFiles->search_term({ term => $term });
|
||||
|
||||
# staff download (via Koha::UploadedFile[s])
|
||||
my $rec = Koha::UploadedFiles->find( $id );
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ 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;
|
||||
my @currencies = Koha::Acquisition::Currencies->search->as_list;
|
||||
|
||||
$template->param("batch_details" => 1,
|
||||
"basketno" => $cgiparams->{'basketno'},
|
||||
|
|
@ -611,7 +611,7 @@ 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;
|
||||
my @itypes = Koha::ItemTypes->search->as_list;
|
||||
$template->param(biblio_list => \@list,
|
||||
num_results => $num_records,
|
||||
import_batch_id => $import_batch_id,
|
||||
|
|
|
|||
|
|
@ -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' }) ],
|
||||
available_additional_fields => [ Koha::AdditionalFields->search( { tablename => 'aqbasket' } ) ],
|
||||
csv_profiles => [ Koha::CsvProfiles->search({ type => 'sql', used_for => 'export_basket' })->as_list ],
|
||||
available_additional_fields => [ Koha::AdditionalFields->search( { tablename => 'aqbasket' } )->as_list ],
|
||||
additional_field_values => { map {
|
||||
$_->field->name => $_->value
|
||||
} Koha::Acquisition::Baskets->find($basketno)->additional_field_values->as_list },
|
||||
|
|
|
|||
|
|
@ -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' } ) ] );
|
||||
$template->param( available_additional_fields => [ Koha::AdditionalFields->search( { tablename => 'aqbasket' } )->as_list ] );
|
||||
|
||||
if ( $op eq 'add_form' ) {
|
||||
my @contractloop;
|
||||
|
|
@ -118,7 +118,7 @@ if ( $op eq 'add_form' ) {
|
|||
}
|
||||
my @booksellers = Koha::Acquisition::Booksellers->search(
|
||||
undef,
|
||||
{ order_by => { -asc => 'name' } } );
|
||||
{ order_by => { -asc => 'name' } } )->as_list;
|
||||
|
||||
$template->param( add_form => 1,
|
||||
basketname => $basket->{'basketname'},
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ if ($booksellerid) {
|
|||
} else {
|
||||
@suppliers = Koha::Acquisition::Booksellers->search(
|
||||
{ name => { -like => "%$supplier%" } },
|
||||
{ order_by => { -asc => 'name' } } );
|
||||
{ order_by => { -asc => 'name' } } )->as_list;
|
||||
}
|
||||
|
||||
my $supplier_count = @suppliers;
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ 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;
|
||||
my @currencies = Koha::Acquisition::Currencies->search->as_list;
|
||||
$template->param(
|
||||
currencies => \@currencies,
|
||||
budget_loop => $budget_loop,
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ 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 } );
|
||||
my @additional_fields = Koha::AdditionalFields->search( { tablename => 'aqbasket', searchable => 1 } )->as_list;
|
||||
$template->param( available_additional_fields => \@additional_fields );
|
||||
my @additional_field_filters;
|
||||
foreach my $additional_field (@additional_fields) {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ if ( $op and $op eq 'do_search' ) {
|
|||
}
|
||||
|
||||
# Build suppliers list
|
||||
my @suppliers = Koha::Acquisition::Booksellers->search( undef, { order_by => { -asc => 'name' } } );
|
||||
my @suppliers = Koha::Acquisition::Booksellers->search( undef, { order_by => { -asc => 'name' } } )->as_list;
|
||||
my $suppliers_loop = [];
|
||||
my $suppliername;
|
||||
foreach (@suppliers) {
|
||||
|
|
|
|||
|
|
@ -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' }) ],
|
||||
csv_profiles => [ Koha::CsvProfiles->search({ type => 'sql', used_for => 'late_orders' })->as_list ],
|
||||
);
|
||||
output_html_with_http_headers $input, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ $template->param( catalog_details => \@catalog_details, );
|
|||
my $suggestion;
|
||||
$suggestion = GetSuggestionInfo($suggestionid) if $suggestionid;
|
||||
|
||||
my @currencies = Koha::Acquisition::Currencies->search;
|
||||
my @currencies = Koha::Acquisition::Currencies->search->as_list;
|
||||
my $active_currency = Koha::Acquisition::Currencies->get_active;
|
||||
|
||||
# build bookfund list
|
||||
|
|
@ -367,7 +367,7 @@ if ($basketobj->effective_create_items eq 'ordering' && !$ordernumber) {
|
|||
|
||||
# Get the item types list, but only if item_level_itype is YES. Otherwise, it will be in the item, no need to display it in the biblio
|
||||
my @itemtypes;
|
||||
@itemtypes = Koha::ItemTypes->search unless C4::Context->preference('item-level_itypes');
|
||||
@itemtypes = Koha::ItemTypes->search->as_list unless C4::Context->preference('item-level_itypes');
|
||||
|
||||
if ( defined $from_subscriptionid ) {
|
||||
# Get the last received order for this subscription
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ $template->param(
|
|||
freight => $freight,
|
||||
name => $bookseller->name,
|
||||
active_currency => $active_currency,
|
||||
currencies => scalar $currencies->search({ rate => { '!=' => 1 } }),
|
||||
currencies => $currencies->search({ rate => { '!=' => 1 } }),
|
||||
invoiceincgst => $bookseller->invoiceincgst,
|
||||
bookfund => $budget->{budget_name},
|
||||
creator => $creator,
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ if ( $op eq 'display' ) {
|
|||
print $query->redirect('/cgi-bin/koha/acqui/acqui-home.pl');
|
||||
exit;
|
||||
} else {
|
||||
my @currencies = Koha::Acquisition::Currencies->search;
|
||||
my @currencies = Koha::Acquisition::Currencies->search->as_list;
|
||||
|
||||
# get option values from TaxRates syspref
|
||||
my @gst_values = map {
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ if( $basketno && $ordernumber) {
|
|||
if( $op eq "do_search" ) {
|
||||
my @booksellers = Koha::Acquisition::Booksellers->search(
|
||||
{ name => { -like => "%$query%" } },
|
||||
{ order_by => { -asc => 'name' } } );
|
||||
{ order_by => { -asc => 'name' } } )->as_list;
|
||||
$template->param(
|
||||
query => $query,
|
||||
do_search => 1,
|
||||
|
|
|
|||
|
|
@ -61,6 +61,6 @@ if (@delete) {
|
|||
Koha::AudioAlerts->fix_precedences();
|
||||
}
|
||||
|
||||
$template->param( AudioAlertsPage => 1, audio_alerts => scalar Koha::AudioAlerts->search() );
|
||||
$template->param( AudioAlertsPage => 1, audio_alerts => Koha::AudioAlerts->search() );
|
||||
|
||||
output_html_with_http_headers $cgi, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ if ($op eq 'add_form') {
|
|||
push @authorised_value_categories, 'itemtypes';
|
||||
|
||||
# build thesaurus categories list
|
||||
my @authtypes = uniq( "", map { $_->authtypecode } Koha::Authority::Types->search );
|
||||
my @authtypes = uniq( "", map { $_->authtypecode } Koha::Authority::Types->search->as_list );
|
||||
|
||||
# build value_builder list
|
||||
my @value_builder=('');
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ $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'] } );
|
||||
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 );
|
||||
|
|
@ -220,7 +220,7 @@ if ( $op eq 'list' ) {
|
|||
|
||||
$searchfield ||= $category_list[0];
|
||||
|
||||
my @avs_by_category = Koha::AuthorisedValues->new->search( { category => $searchfield } );
|
||||
my @avs_by_category = Koha::AuthorisedValues->new->search( { category => $searchfield } )->as_list;
|
||||
my @loop_data = ();
|
||||
# builds value list
|
||||
for my $av ( @avs_by_category ) {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ if ( $op eq 'add_form' ) {
|
|||
$template->param( selected_smtp_server => $library->smtp_server );
|
||||
}
|
||||
|
||||
my @smtp_servers = Koha::SMTP::Servers->search;
|
||||
my @smtp_servers = Koha::SMTP::Servers->search->as_list;
|
||||
|
||||
$template->param(
|
||||
library => $library,
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ if ( $op eq "add_source" ) {
|
|||
$cn_source ? Koha::ClassSources->find($cn_source) : undef;
|
||||
$template->param(
|
||||
class_source => $class_source,
|
||||
sort_rules => scalar Koha::ClassSortRules->search,
|
||||
split_rules => scalar Koha::ClassSplitRules->search,
|
||||
sort_rules => Koha::ClassSortRules->search,
|
||||
split_rules => Koha::ClassSplitRules->search,
|
||||
);
|
||||
}
|
||||
elsif ( $op eq "add_source_validate" ) {
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ sub show {
|
|||
);
|
||||
|
||||
my $branch = $input->param('branch') || '*';
|
||||
my @categories = Koha::Patron::Categories->search_with_library_limits;
|
||||
my @item_types = Koha::ItemTypes->search;
|
||||
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' });
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ my @loop_data;
|
|||
foreach my $col ( @cols ) {
|
||||
my $found;
|
||||
my $readonly = $col =~ /\.(biblio|biblioitem|item)number$/;
|
||||
foreach my $row ( $kohafields->search({ kohafield => $col }) ) {
|
||||
foreach my $row ( $kohafields->search({ kohafield => $col })->as_list ) {
|
||||
$found = 1;
|
||||
push @loop_data, {
|
||||
kohafield => $col,
|
||||
|
|
|
|||
|
|
@ -97,11 +97,11 @@ if ( $op eq 'add_form' ) {
|
|||
$sth2->finish;
|
||||
$sth2 = $dbh->prepare("select distinct category from authorised_values");
|
||||
$sth2->execute;
|
||||
my @av_cat = Koha::AuthorisedValueCategories->search;
|
||||
my @av_cat = Koha::AuthorisedValueCategories->search->as_list;
|
||||
my @authorised_values = map { $_->category_name } @av_cat;
|
||||
|
||||
# build thesaurus categories list
|
||||
my @authtypes = uniq( "", map { $_->authtypecode } Koha::Authority::Types->search );
|
||||
my @authtypes = uniq( "", map { $_->authtypecode } Koha::Authority::Types->search->as_list );
|
||||
|
||||
# build value_builder list
|
||||
my @value_builder = ('');
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ if ( $op && $op eq 'update' ) {
|
|||
}
|
||||
}
|
||||
|
||||
my @branches = Koha::Libraries->search();
|
||||
my @branches = Koha::Libraries->search->as_list;
|
||||
my @branch_od_info;
|
||||
foreach my $branch ( @branches ){
|
||||
my $od_info = Koha::Library::OverDriveInfos->find($branch->branchcode);
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ sub _get_chunk {
|
|||
} elsif ( $options{'choices'} eq 'staff-templates' ) {
|
||||
$options{'choices'} = { map { $_ => $_ } getallthemes( 'intranet' ) }
|
||||
} elsif ( $options{choices} eq 'patron-categories' ) {
|
||||
$options{choices} = { map { $_->categorycode => $_->description } Koha::Patron::Categories->search };
|
||||
$options{choices} = { map { $_->categorycode => $_->description } Koha::Patron::Categories->search->as_list };
|
||||
$add_blank = 1;
|
||||
} else {
|
||||
die 'Unrecognized source of preference values: ' . $options{'choices'};
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ elsif ( $op eq 'delete' ) {
|
|||
$provider->delete() if $provider;
|
||||
}
|
||||
|
||||
my @providers = Koha::SMS::Providers->search();
|
||||
my @providers = Koha::SMS::Providers->search->as_list;
|
||||
|
||||
$template->param( providers => \@providers );
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ unless ($update) {
|
|||
$have_matrix = keys %$cost_matrix if $cost_matrix;
|
||||
}
|
||||
|
||||
my @branchloop = map { code => $_->branchcode, name => $_->branchname }, Koha::Libraries->search({}, { order_by => 'branchname' });
|
||||
my @branchloop = map { code => $_->branchcode, name => $_->branchname }, Koha::Libraries->search({}, { order_by => 'branchname' })->as_list;
|
||||
my (@branchfromloop, @errors);
|
||||
foreach my $branchfrom ( @branchloop ) {
|
||||
my $fromcode = $branchfrom->{code};
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ my $resultsarray = \@results;
|
|||
|
||||
$template->param(
|
||||
BIBLIO_RESULTS => $resultsarray,
|
||||
csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' }) ],
|
||||
csv_profiles => Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' }),
|
||||
bib_list => $bib_list,
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ if ($bib_list && $format) {
|
|||
print $output;
|
||||
|
||||
} else {
|
||||
$template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' }) ]);
|
||||
$template->param(csv_profiles => Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' }));
|
||||
$template->param(bib_list => $bib_list);
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,14 +47,14 @@ my @checkouts = Koha::Checkouts->search(
|
|||
join => 'item',
|
||||
order_by => 'timestamp',
|
||||
}
|
||||
);
|
||||
)->as_list;
|
||||
my @old_checkouts = Koha::Old::Checkouts->search(
|
||||
{ biblionumber => $biblionumber },
|
||||
{
|
||||
join => 'item',
|
||||
order_by => 'timestamp',
|
||||
}
|
||||
);
|
||||
)->as_list;
|
||||
|
||||
my $biblio = Koha::Biblios->find( $biblionumber );
|
||||
|
||||
|
|
|
|||
|
|
@ -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 } });
|
||||
my @items = Koha::Items->search({ itemnumber => { -in => \@itemnumbers } })->as_list;
|
||||
|
||||
if ($format eq 'barcodes') {
|
||||
print $cgi->header({
|
||||
|
|
|
|||
|
|
@ -259,9 +259,9 @@ if ( defined $format ) {
|
|||
|
||||
# Display the search form
|
||||
|
||||
my @branches = map { value => $_->branchcode, label => $_->branchname }, Koha::Libraries->search( {}, { order_by => 'branchname' } );
|
||||
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 ) {
|
||||
foreach my $itemtype ( Koha::ItemTypes->search_with_localization->as_list ) {
|
||||
push @itemtypes, {
|
||||
value => $itemtype->itemtype,
|
||||
label => $itemtype->translated_description,
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ if($cgi->cookie("intranet_bib_list")){
|
|||
}
|
||||
|
||||
my @search_groups =
|
||||
Koha::Library::Groups->get_search_groups( { interface => 'staff' } );
|
||||
Koha::Library::Groups->get_search_groups( { interface => 'staff' } )->as_list;
|
||||
@search_groups = sort { $a->title cmp $b->title } @search_groups;
|
||||
|
||||
$template->param(
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
|||
|
||||
my $schema = Koha::Database->new->schema;
|
||||
|
||||
my @keyboard_shortcuts = Koha::KeyboardShortcuts->search();
|
||||
my @keyboard_shortcuts = Koha::KeyboardShortcuts->search->as_list;
|
||||
|
||||
# Keyboard shortcuts
|
||||
$template->param(
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ my $launcher = sub {
|
|||
}
|
||||
|
||||
my $cn_source = $cgi->param('cn_source') || C4::Context->preference("DefaultClassificationSource");
|
||||
my @class_sources = Koha::ClassSources->search({ used => 1});
|
||||
my @class_sources = Koha::ClassSources->search({ used => 1})->as_list;
|
||||
|
||||
#Don't show half the results of show lt or gt
|
||||
$real_limit = $results_per_page if $search ne $q;
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ my $launcher = sub {
|
|||
}
|
||||
);
|
||||
|
||||
my @itemtypes = Koha::ItemTypes->search;
|
||||
my @itemtypes = Koha::ItemTypes->search->as_list;
|
||||
|
||||
$template->param(
|
||||
itypeloop => \@itemtypes,
|
||||
|
|
|
|||
|
|
@ -484,7 +484,7 @@ sub plugin {
|
|||
}
|
||||
);
|
||||
|
||||
my @itemtypes = Koha::ItemTypes->search;
|
||||
my @itemtypes = Koha::ItemTypes->search->as_list;
|
||||
|
||||
$template->param( #classlist => $classlist,
|
||||
itypeloop => \@itemtypes,
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ my $branchcode = defined( $query->param('branchcode') ) ? $query->param('branchc
|
|||
|
||||
$template->param(
|
||||
branchcode => $branchcode,
|
||||
article_requests_requested => scalar Koha::ArticleRequests->requested($branchcode),
|
||||
article_requests_pending => scalar Koha::ArticleRequests->pending($branchcode),
|
||||
article_requests_processing => scalar Koha::ArticleRequests->processing($branchcode),
|
||||
article_requests_requested => Koha::ArticleRequests->requested($branchcode),
|
||||
article_requests_pending => Koha::ArticleRequests->pending($branchcode),
|
||||
article_requests_processing => Koha::ArticleRequests->processing($branchcode),
|
||||
);
|
||||
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -545,11 +545,11 @@ my $view = $batch
|
|||
|
||||
my @relatives;
|
||||
if ( $patron ) {
|
||||
if ( my @guarantors = $patron->guarantor_relationships()->guarantors() ) {
|
||||
if ( my @guarantors = $patron->guarantor_relationships()->guarantors->as_list ) {
|
||||
push( @relatives, $_->id ) for @guarantors;
|
||||
push( @relatives, $_->id ) for $patron->siblings();
|
||||
push( @relatives, $_->id ) for $patron->siblings->as_list;
|
||||
} else {
|
||||
push( @relatives, $_->id ) for $patron->guarantee_relationships()->guarantees();
|
||||
push( @relatives, $_->id ) for $patron->guarantee_relationships()->guarantees->as_list;
|
||||
}
|
||||
}
|
||||
my $relatives_issues_count =
|
||||
|
|
@ -603,7 +603,7 @@ $template->param(
|
|||
|
||||
|
||||
if ( C4::Context->preference("ExportCircHistory") ) {
|
||||
$template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ]);
|
||||
$template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' })->as_list ]);
|
||||
}
|
||||
|
||||
my $has_modifications = Koha::Patron::Modifications->search( { borrowernumber => $borrowernumber } )->count;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ my @transfers = Koha::Libraries->search(
|
|||
prefetch => 'branchtransfers_tobranches',
|
||||
order_by => 'branchtransfers_tobranches.tobranch'
|
||||
}
|
||||
);
|
||||
)->as_list;
|
||||
|
||||
$template->param(
|
||||
libraries => \@transfers,
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ 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();
|
||||
my @clubs = Koha::Clubs->search();
|
||||
my @club_templates = Koha::Club::Templates->search->as_list;
|
||||
my @clubs = Koha::Clubs->search->as_list;
|
||||
|
||||
$template->param(
|
||||
stored => $stored,
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ my $patronnumber = $cgi->param('borrowernumber');
|
|||
|
||||
my $patron = Koha::Patrons->find($patronnumber);
|
||||
|
||||
my @enrollments = $patron->get_club_enrollments();
|
||||
my @clubs = $patron->get_enrollable_clubs();
|
||||
my @enrollments = $patron->get_club_enrollments->as_list;
|
||||
my @clubs = $patron->get_enrollable_clubs->as_list;
|
||||
|
||||
$template->param(
|
||||
enrollments => \@enrollments,
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ $template->param(
|
|||
backends => $backends,
|
||||
types => [ "Book", "Article", "Journal" ],
|
||||
query_type => $op,
|
||||
branches => scalar Koha::Libraries->search,
|
||||
branches => Koha::Libraries->search,
|
||||
);
|
||||
|
||||
output_html_with_http_headers( $cgi, $cookie, $template->output );
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ if ($op) {
|
|||
|
||||
$template->param(
|
||||
fresh_api_key => $api_key,
|
||||
api_keys => scalar Koha::ApiKeys->search({ patron_id => $patron_id }),
|
||||
api_keys => Koha::ApiKeys->search({ patron_id => $patron_id }),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ if ($op) {
|
|||
}
|
||||
}
|
||||
|
||||
my @api_keys = Koha::ApiKeys->search({ patron_id => $patron_id });
|
||||
my @api_keys = Koha::ApiKeys->search({ patron_id => $patron_id })->as_list;
|
||||
|
||||
$template->param(
|
||||
api_keys => \@api_keys,
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ my $total = $patron->account->balance;
|
|||
my @accountlines = Koha::Account::Lines->search(
|
||||
{ borrowernumber => $patron->borrowernumber },
|
||||
{ order_by => { -desc => 'accountlines_id' } }
|
||||
);
|
||||
)->as_list;
|
||||
|
||||
my $totalcredit;
|
||||
if($total <= 0){
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ else {
|
|||
|
||||
my @credit_types = Koha::Account::CreditTypes->search_with_library_limits(
|
||||
{ can_be_added_manually => 1, archived => 0 },
|
||||
{}, $library_id );
|
||||
{}, $library_id )->as_list;
|
||||
|
||||
$template->param(
|
||||
patron => $patron,
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ if ($add) {
|
|||
|
||||
my @debit_types = Koha::Account::DebitTypes->search_with_library_limits(
|
||||
{ can_be_invoiced => 1, archived => 0 },
|
||||
{}, $library_id );
|
||||
{}, $library_id )->as_list;
|
||||
|
||||
$template->param(
|
||||
debit_types => \@debit_types,
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ if ( $borrowernumber and not $patron ) {
|
|||
}
|
||||
|
||||
if ( C4::Context->preference('SMSSendDriver') eq 'Email' ) {
|
||||
my @providers = Koha::SMS::Providers->search();
|
||||
my @providers = Koha::SMS::Providers->search->as_list;
|
||||
$template->param( sms_providers => \@providers );
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ my $userenv = C4::Context->userenv;
|
|||
my @messages;
|
||||
|
||||
## Deal with guarantor stuff
|
||||
$template->param( relationships => scalar $patron->guarantor_relationships ) if $patron;
|
||||
$template->param( relationships => $patron->guarantor_relationships ) if $patron;
|
||||
|
||||
my @relations = split /\|/, C4::Context->preference('borrowerRelationship'), -1;
|
||||
@relations = ('') unless @relations;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ if( Koha::Libraries->search->count < 1){
|
|||
$template->param(no_branches => 1);
|
||||
}
|
||||
|
||||
my @categories = Koha::Patron::Categories->search_with_library_limits;
|
||||
my @categories = Koha::Patron::Categories->search_with_library_limits->as_list;
|
||||
if(scalar(@categories) < 1){
|
||||
$no_add = 1;
|
||||
$template->param(no_categories => 1);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ foreach my $pm (@$pending_modifications) {
|
|||
foreach my $type (@modified_atypes) {
|
||||
my $type_obj = Koha::Patron::Attribute::Types->find($type);
|
||||
my @before = Koha::Patron::Attributes->search(
|
||||
{ borrowernumber => $pm->{borrowernumber}, code => $type } );
|
||||
{ borrowernumber => $pm->{borrowernumber}, code => $type } )->as_list;
|
||||
my @after = grep { $_->code eq $type } @{ $pm->{extended_attributes} };
|
||||
push @{$modified_attributes}, { type => $type_obj, before => \@before, after => \@after };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,11 +95,11 @@ $template->param( flagged => 1 ) if $patron->account_locked;
|
|||
|
||||
my @relatives;
|
||||
my $guarantor_relationships = $patron->guarantor_relationships;
|
||||
my @guarantees = $patron->guarantee_relationships->guarantees;
|
||||
my @guarantors = $guarantor_relationships->guarantors;
|
||||
my @guarantees = $patron->guarantee_relationships->guarantees->as_list;
|
||||
my @guarantors = $guarantor_relationships->guarantors->as_list;
|
||||
if (@guarantors) {
|
||||
push( @relatives, $_->id ) for @guarantors;
|
||||
push( @relatives, $_->id ) for $patron->siblings();
|
||||
push( @relatives, $_->id ) for $patron->siblings->as_list;
|
||||
}
|
||||
else {
|
||||
push( @relatives, $_->id ) for @guarantees;
|
||||
|
|
@ -162,7 +162,7 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) {
|
|||
}
|
||||
|
||||
if ( C4::Context->preference("ExportCircHistory") ) {
|
||||
$template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ]);
|
||||
$template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' })->as_list ]);
|
||||
}
|
||||
|
||||
my $patron_messages = Koha::Patron::Messages->search(
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ if ( $selected_accts ) {
|
|||
@selected_accountlines = Koha::Account::Lines->search(
|
||||
$search_params,
|
||||
{ order_by => 'date' }
|
||||
);
|
||||
)->as_list;
|
||||
|
||||
my $sum = Koha::Account::Lines->search(
|
||||
$search_params,
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ my $patron = Koha::Patrons->find( $borrowernumber );
|
|||
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
|
||||
|
||||
my $overdues = [
|
||||
map { $_->unblessed_all_relateds } $patron->get_overdues
|
||||
map { $_->unblessed_all_relateds } $patron->get_overdues->as_list
|
||||
];
|
||||
|
||||
my $letter = parse_overdues_letter(
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ elsif ( $op eq 'update' ) {
|
|||
# But we should not hit that with a normal use of the interface
|
||||
die "You are doing something wrong updating this child" unless $adult_category;
|
||||
|
||||
$_->delete() for $patron->guarantor_relationships();
|
||||
$_->delete() for $patron->guarantor_relationships->as_list;
|
||||
|
||||
$patron->categorycode($adult_category->categorycode);
|
||||
$patron->store;
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ foreach my $m (@metadatas) {
|
|||
if ($delete_items) {
|
||||
my $deleted_count = 0;
|
||||
my $biblio = Koha::Biblios->find( $biblionumber );
|
||||
my @items = Koha::Items->search( { biblionumber => $biblionumber } );
|
||||
my @items = Koha::Items->search( { biblionumber => $biblionumber } )->as_list;
|
||||
foreach my $item ( @items ) {
|
||||
my $itemnumber = $item->itemnumber;
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ my @patron_ids = map { $_->borrowernumber } Koha::Account::Lines->search(
|
|||
columns => [ qw/borrowernumber/ ],
|
||||
distinct => 1,
|
||||
}
|
||||
);
|
||||
)->as_list;
|
||||
|
||||
my $patrons = Koha::Patrons->search({ borrowernumber => { -in => \@patron_ids } });
|
||||
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ my $borrowernumber = $cgi->param('borrowernumber');
|
|||
|
||||
my $borrower = Koha::Patrons->find($borrowernumber);
|
||||
|
||||
my @enrollments = $borrower->get_club_enrollments();
|
||||
my @clubs = $borrower->get_enrollable_clubs( my $opac = 1 );
|
||||
my @enrollments = $borrower->get_club_enrollments->as_list;
|
||||
my @clubs = $borrower->get_enrollable_clubs( my $opac = 1 )->as_list;
|
||||
|
||||
$template->param(
|
||||
enrollments => \@enrollments,
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ if ( C4::Context->preference('AllowPatronToSetFinesVisibilityForGuarantor')
|
|||
my @relatives;
|
||||
|
||||
# Filter out guarantees that don't want guarantor to see checkouts
|
||||
foreach my $gr ( $patron->guarantee_relationships() ) {
|
||||
foreach my $gr ( $patron->guarantee_relationships->as_list ) {
|
||||
my $g = $gr->guarantee;
|
||||
if ( $g->privacy_guarantor_fines ) {
|
||||
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ $template->param(
|
|||
csv_profiles => [
|
||||
Koha::CsvProfiles->search(
|
||||
{ type => 'marc', used_for => 'export_records', staff_only => 0 }
|
||||
)
|
||||
)->as_list
|
||||
],
|
||||
bib_list => $bib_list,
|
||||
BIBLIO_RESULTS => $resultsarray,
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ if ($bib_list && $format) {
|
|||
used_for => 'export_records',
|
||||
staff_only => 0
|
||||
}
|
||||
)
|
||||
)->as_list
|
||||
]
|
||||
);
|
||||
$template->param(bib_list => $bib_list);
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) {
|
|||
used_for => 'export_records',
|
||||
staff_only => 0
|
||||
}
|
||||
)
|
||||
)->as_list
|
||||
]
|
||||
);
|
||||
$template->param( shelf => $shelf );
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ if ( $action eq 'create' || $action eq 'new' ) {
|
|||
$params = { branchcode => { -in => \@PatronSelfRegistrationLibraryList } }
|
||||
if @PatronSelfRegistrationLibraryList;
|
||||
}
|
||||
my @libraries = Koha::Libraries->search($params);
|
||||
my @libraries = Koha::Libraries->search($params)->as_list;
|
||||
|
||||
my ( $min, $max ) = C4::Members::get_cardnumber_length();
|
||||
if ( defined $min ) {
|
||||
|
|
@ -698,7 +698,7 @@ sub ParsePatronAttributes {
|
|||
my @values = $cgi->multi_param('patron_attribute_value');
|
||||
|
||||
my @editable_attribute_types
|
||||
= map { $_->code } Koha::Patron::Attribute::Types->search({ opac_editable => 1 });
|
||||
= map { $_->code } Koha::Patron::Attribute::Types->search({ opac_editable => 1 })->as_list;
|
||||
|
||||
my $ea = each_array( @codes, @values );
|
||||
my @attributes;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ $template->param(
|
|||
TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification") );
|
||||
|
||||
if ( C4::Context->preference("SMSSendDriver") eq 'Email' ) {
|
||||
my @providers = Koha::SMS::Providers->search();
|
||||
my @providers = Koha::SMS::Providers->search->as_list;
|
||||
$template->param( sms_providers => \@providers, sms_provider_id => $patron->sms_provider_id );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@ my %is_nolimit = map { $_ => 1 } @nolimits;
|
|||
if (@searchCategories > 0) {
|
||||
my @tabcat;
|
||||
foreach my $typecategory (@searchCategories) {
|
||||
my @itemtypes = Koha::ItemTypes->search({ searchcategory => $typecategory });
|
||||
my @itemtypes = Koha::ItemTypes->search({ searchcategory => $typecategory })->as_list;
|
||||
push @tabcat, $_->itemtype for @itemtypes;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ if ( $op eq 'view' ) {
|
|||
csv_profiles => [
|
||||
Koha::CsvProfiles->search(
|
||||
{ type => 'marc', used_for => 'export_records', staff_only => 0 }
|
||||
)
|
||||
)->as_list
|
||||
],
|
||||
);
|
||||
if ( $page ) {
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ if ( C4::Context->preference('AllowPatronToSetCheckoutsVisibilityForGuarantor'
|
|||
{
|
||||
my @relatives;
|
||||
# Filter out guarantees that don't want guarantor to see checkouts
|
||||
foreach my $gr ( $patron->guarantee_relationships() ) {
|
||||
foreach my $gr ( $patron->guarantee_relationships->as_list ) {
|
||||
my $g = $gr->guarantee;
|
||||
push( @relatives, $g ) if $g->privacy_guarantor_checkouts;
|
||||
}
|
||||
|
|
@ -382,7 +382,7 @@ if ( C4::Context->preference('AllowPatronToSetFinesVisibilityForGuarantor')
|
|||
{
|
||||
my @relatives_with_fines;
|
||||
# Filter out guarantees that don't want guarantor to see checkouts
|
||||
foreach my $gr ( $patron->guarantee_relationships() ) {
|
||||
foreach my $gr ( $patron->guarantee_relationships->as_list ) {
|
||||
my $g = $gr->guarantee;
|
||||
push( @relatives_with_fines, $g ) if $g->privacy_guarantor_fines;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ else {
|
|||
|
||||
my $CGIsepChoice = GetDelimiterChoices;
|
||||
|
||||
my @branches = Koha::Libraries->search({}, { order_by => 'branchname' });
|
||||
my @branches = Koha::Libraries->search({}, { order_by => 'branchname' })->as_list;
|
||||
|
||||
my $ccode_subfield_structure = GetMarcSubfieldStructureFromKohaField('items.ccode');
|
||||
my $ccode_label;
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ sub calculate {
|
|||
}
|
||||
}
|
||||
|
||||
my @branchcodes = map { $_->branchcode } Koha::Libraries->search;
|
||||
my @branchcodes = map { $_->branchcode } Koha::Libraries->search->as_list;
|
||||
($status ) and push @loopfilter,{crit=>"Status", filter=>$status };
|
||||
($activity) and push @loopfilter,{crit=>"Activity",filter=>$activity};
|
||||
# year of activity
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ $template->param(do_it => $do_it,
|
|||
|
||||
our $itemtypes = Koha::ItemTypes->search_with_localization->unblessed;
|
||||
|
||||
our @patron_categories = Koha::Patron::Categories->search_with_library_limits({}, {order_by => ['description']});
|
||||
our @patron_categories = Koha::Patron::Categories->search_with_library_limits({}, {order_by => ['description']})->as_list;
|
||||
|
||||
our $locations = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' }, { order_by => ['description'] } ) };
|
||||
our $ccodes = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.ccode' }, { order_by => ['description'] } ) };
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ $sep = "\t" if ($sep eq 'tabulation');
|
|||
$template->param(do_it => $do_it,
|
||||
);
|
||||
|
||||
my @patron_categories = Koha::Patron::Categories->search_with_library_limits({}, {order_by => ['description']});
|
||||
my @patron_categories = Koha::Patron::Categories->search_with_library_limits({}, {order_by => ['description']})->as_list;
|
||||
|
||||
my $locations = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' }, { order_by => ['description'] } ) };
|
||||
my $ccodes = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.ccode' }, { order_by => ['description'] } ) };
|
||||
|
|
@ -325,7 +325,7 @@ sub display_value {
|
|||
}
|
||||
}
|
||||
elsif ( $crit =~ /category/ ) {
|
||||
my @patron_categories = Koha::Patron::Categories->search_with_library_limits({}, {order_by => ['description']});
|
||||
my @patron_categories = Koha::Patron::Categories->search_with_library_limits({}, {order_by => ['description']})->as_list;
|
||||
foreach my $patron_category ( @patron_categories ) {
|
||||
( $value eq $patron_category->categorycode ) or next;
|
||||
$display_value = $patron_category->description and last;
|
||||
|
|
|
|||
|
|
@ -682,7 +682,7 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
|
|||
$template->param( always_show_holds => $always_show_holds );
|
||||
my $show_holds_now = $input->param('show_holds_now');
|
||||
unless( (defined $always_show_holds && $always_show_holds eq 'DONT') && !$show_holds_now ){
|
||||
my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } );
|
||||
my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } )->as_list;
|
||||
foreach my $res (
|
||||
sort {
|
||||
my $a_found = $a->found() || '';
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ my ($template, $loggedinuser, $cookie)
|
|||
my $supplier=$query->param('supplier');
|
||||
my @suppliers = Koha::Acquisition::Booksellers->search(
|
||||
{ name => { -like => "%$supplier%" } },
|
||||
{ order_by => { -asc => 'name' } } );
|
||||
{ order_by => { -asc => 'name' } } )->as_list;
|
||||
|
||||
#build result page
|
||||
my $loop_suppliers = [];
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ $template->param(
|
|||
supplierid => $supplierid,
|
||||
claimletter => $claimletter,
|
||||
additional_fields_for_subscription => $additional_fields,
|
||||
csv_profiles => [ Koha::CsvProfiles->search({ type => 'sql', used_for => 'late_issues' }) ],
|
||||
csv_profiles => [ Koha::CsvProfiles->search({ type => 'sql', used_for => 'late_issues' })->as_list ],
|
||||
letters => $letters,
|
||||
(uc(C4::Context->preference("marcflavour"))) => 1
|
||||
);
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ if ( $op and $op eq "close" ) {
|
|||
}
|
||||
|
||||
|
||||
my @additional_fields = Koha::AdditionalFields->search( { tablename => 'subscription', searchable => 1 } );
|
||||
my @additional_fields = Koha::AdditionalFields->search( { tablename => 'subscription', searchable => 1 } )->as_list;
|
||||
my @additional_field_filters;
|
||||
for my $field ( @additional_fields ) {
|
||||
my $value = $query->param( 'additional_field_' . $field->id );
|
||||
|
|
@ -163,7 +163,7 @@ else
|
|||
}
|
||||
}
|
||||
|
||||
my @branches = Koha::Libraries->search( {}, { order_by => ['branchcode'] } );
|
||||
my @branches = Koha::Libraries->search( {}, { order_by => ['branchcode'] } )->as_list;
|
||||
my @branches_loop;
|
||||
foreach my $b ( @branches ) {
|
||||
my $selected = 0;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue