Bug 7034: de-nesting C4/Branch.pm
use C4::Koha was loaded only to call C4::Koha::get_infos_of in get_branchinfos_of
the sub get_branchinfos_of was used nowhere
(checked with "grep -R get_branchinfos_of *")
only one reference was made to get_branchinfos_of, in reserve/request.pl, but the sub was not used in fact (maybe removed previously & silently)
This patch removes sub get_branchinfos_of and use C4::Koha in C4::Branch, as well as the reference in request.pl and the t test
The patch doesn't remove use C4::Branch in reserve/request.pl, as it's still used for other subroutines.
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit 69732f5c62)
Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
parent
f105fddc19
commit
54ce3fde2b
29
C4/Branch.pm
29
C4/Branch.pm
|
|
@ -20,7 +20,6 @@ use strict;
|
|||
#use warnings; FIXME - Bug 2505
|
||||
require Exporter;
|
||||
use C4::Context;
|
||||
use C4::Koha;
|
||||
|
||||
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
|
||||
|
||||
|
|
@ -408,34 +407,6 @@ sub GetBranchDetail {
|
|||
return $sth->fetchrow_hashref();
|
||||
}
|
||||
|
||||
=head2 get_branchinfos_of
|
||||
|
||||
my $branchinfos_of = get_branchinfos_of(@branchcodes);
|
||||
|
||||
Associates a list of branchcodes to the information of the branch, taken in
|
||||
branches table.
|
||||
|
||||
Returns a href where keys are branchcodes and values are href where keys are
|
||||
branch information key.
|
||||
|
||||
print 'branchname is ', $branchinfos_of->{$code}->{branchname};
|
||||
|
||||
=cut
|
||||
|
||||
sub get_branchinfos_of {
|
||||
my @branchcodes = @_;
|
||||
|
||||
my $query = '
|
||||
SELECT branchcode,
|
||||
branchname
|
||||
FROM branches
|
||||
WHERE branchcode IN ('
|
||||
. join( ',', map( { "'" . $_ . "'" } @branchcodes ) ) . ')
|
||||
';
|
||||
return C4::Koha::get_infos_of( $query, 'branchcode' );
|
||||
}
|
||||
|
||||
|
||||
=head2 GetBranchesInCategory
|
||||
|
||||
my $branches = GetBranchesInCategory($categorycode);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ script to place reserves/requests
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use C4::Branch; # GetBranches get_branchinfos_of
|
||||
use C4::Branch;
|
||||
use CGI;
|
||||
use List::MoreUtils qw/uniq/;
|
||||
use Date::Calc qw/Date_to_Days/;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ sub methods : Test( 1 ) {
|
|||
GetCategoryTypes
|
||||
GetBranch
|
||||
GetBranchDetail
|
||||
get_branchinfos_of
|
||||
GetBranchesInCategory
|
||||
GetBranchInfo
|
||||
DelBranch
|
||||
|
|
|
|||
Loading…
Reference in New Issue