Lines 71-76
sub list {
Link Here
|
71 |
: () |
71 |
: () |
72 |
})->as_list; |
72 |
})->as_list; |
73 |
|
73 |
|
|
|
74 |
my $fetch_backends = {}; |
75 |
foreach my $request (@requests) { |
76 |
$fetch_backends->{ $request->backend } ||= |
77 |
Koha::Illrequest->new->load_backend( $request->backend ); |
78 |
} |
79 |
|
80 |
# Pre-load the backend object to avoid useless backend lookup/loads |
81 |
@requests = map { $_->_backend( $fetch_backends->{ $_->backend } ); $_ } @requests; |
82 |
|
74 |
# Identify patrons & branches that |
83 |
# Identify patrons & branches that |
75 |
# we're going to need and get them |
84 |
# we're going to need and get them |
76 |
my $to_fetch = { |
85 |
my $to_fetch = { |
Lines 78-84
sub list {
Link Here
|
78 |
branches => {}, |
87 |
branches => {}, |
79 |
capabilities => {} |
88 |
capabilities => {} |
80 |
}; |
89 |
}; |
81 |
foreach my $req(@requests) { |
90 |
foreach my $req (@requests) { |
82 |
$to_fetch->{patrons}->{$req->borrowernumber} = 1 if $embed{patron}; |
91 |
$to_fetch->{patrons}->{$req->borrowernumber} = 1 if $embed{patron}; |
83 |
$to_fetch->{branches}->{$req->branchcode} = 1 if $embed{library}; |
92 |
$to_fetch->{branches}->{$req->branchcode} = 1 if $embed{library}; |
84 |
$to_fetch->{capabilities}->{$req->backend} = 1 if $embed{capabilities}; |
93 |
$to_fetch->{capabilities}->{$req->backend} = 1 if $embed{capabilities}; |
Lines 113-120
sub list {
Link Here
|
113 |
my @backends = keys %{$to_fetch->{capabilities}}; |
122 |
my @backends = keys %{$to_fetch->{capabilities}}; |
114 |
if (scalar @backends > 0) { |
123 |
if (scalar @backends > 0) { |
115 |
foreach my $bc(@backends) { |
124 |
foreach my $bc(@backends) { |
116 |
my $backend = Koha::Illrequest->new->load_backend($bc); |
125 |
$to_fetch->{$bc} = $fetch_backends->{$bc}->capabilities; |
117 |
$to_fetch->{$bc} = $backend->capabilities; |
|
|
118 |
} |
126 |
} |
119 |
} |
127 |
} |
120 |
} |
128 |
} |
121 |
- |
|
|