View | Details | Raw Unified | Return to bug 6875
Collapse All | Expand All

(-)a/C4/Branch.pm (-29 lines)
Lines 20-26 use strict; Link Here
20
#use warnings; FIXME - Bug 2505
20
#use warnings; FIXME - Bug 2505
21
require Exporter;
21
require Exporter;
22
use C4::Context;
22
use C4::Context;
23
use C4::Koha;
24
23
25
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
24
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
26
25
Lines 408-441 sub GetBranchDetail { Link Here
408
    return $sth->fetchrow_hashref();
407
    return $sth->fetchrow_hashref();
409
}
408
}
410
409
411
=head2 get_branchinfos_of
412
413
  my $branchinfos_of = get_branchinfos_of(@branchcodes);
414
415
Associates a list of branchcodes to the information of the branch, taken in
416
branches table.
417
418
Returns a href where keys are branchcodes and values are href where keys are
419
branch information key.
420
421
  print 'branchname is ', $branchinfos_of->{$code}->{branchname};
422
423
=cut
424
425
sub get_branchinfos_of {
426
    my @branchcodes = @_;
427
428
    my $query = '
429
    SELECT branchcode,
430
       branchname
431
    FROM branches
432
    WHERE branchcode IN ('
433
      . join( ',', map( { "'" . $_ . "'" } @branchcodes ) ) . ')
434
';
435
    return C4::Koha::get_infos_of( $query, 'branchcode' );
436
}
437
438
439
=head2 GetBranchesInCategory
410
=head2 GetBranchesInCategory
440
411
441
  my $branches = GetBranchesInCategory($categorycode);
412
  my $branches = GetBranchesInCategory($categorycode);
(-)a/reserve/request.pl (-1 / +1 lines)
Lines 28-34 script to place reserves/requests Link Here
28
28
29
use strict;
29
use strict;
30
use warnings;
30
use warnings;
31
use C4::Branch; # GetBranches get_branchinfos_of
31
use C4::Branch;
32
use CGI;
32
use CGI;
33
use List::MoreUtils qw/uniq/;
33
use List::MoreUtils qw/uniq/;
34
use Date::Calc qw/Date_to_Days/;
34
use Date::Calc qw/Date_to_Days/;
(-)a/t/db_dependent/lib/KohaTest/Branch.pm (-2 lines)
Lines 20-26 sub methods : Test( 1 ) { Link Here
20
                      GetCategoryTypes
20
                      GetCategoryTypes
21
                      GetBranch
21
                      GetBranch
22
                      GetBranchDetail
22
                      GetBranchDetail
23
                      get_branchinfos_of
24
                      GetBranchesInCategory
23
                      GetBranchesInCategory
25
                      GetBranchInfo
24
                      GetBranchInfo
26
                      DelBranch
25
                      DelBranch
27
- 

Return to bug 6875