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

(-)a/C4/Acquisition.pm (-6 / +14 lines)
Lines 304-312 sub GetBasketAsCSV { Link Here
304
            notes => $order->{'order_vendornote'},
304
            notes => $order->{'order_vendornote'},
305
            quantity => $order->{'quantity'},
305
            quantity => $order->{'quantity'},
306
            rrp => $order->{'rrp'},
306
            rrp => $order->{'rrp'},
307
            deliveryplace => C4::Branch::GetBranchName( $basket->{'deliveryplace'} ),
308
            billingplace => C4::Branch::GetBranchName( $basket->{'billingplace'} ),
309
        };
307
        };
308
        for my $place ( qw( deliveryplace billingplace ) ) {
309
            if ( my $library = Koha::Libraries->find( $row->{deliveryplace} ) ) {
310
                $row->{$place} = $library->branchname
311
            }
312
        }
310
        foreach(qw(
313
        foreach(qw(
311
            contractname author title publishercode collectiontitle notes
314
            contractname author title publishercode collectiontitle notes
312
            deliveryplace billingplace
315
            deliveryplace billingplace
Lines 377-387 sub GetBasketGroupAsCSV { Link Here
377
                booksellerpostal => $bookseller->{postal},
380
                booksellerpostal => $bookseller->{postal},
378
                contractnumber => $contract->{contractnumber},
381
                contractnumber => $contract->{contractnumber},
379
                contractname => $contract->{contractname},
382
                contractname => $contract->{contractname},
380
                basketgroupdeliveryplace => C4::Branch::GetBranchName( $basketgroup->{deliveryplace} ),
383
                basketgroupdeliveryplace => $basketgroup->{deliveryplace},
381
                basketgroupbillingplace => C4::Branch::GetBranchName( $basketgroup->{billingplace} ),
384
                basketgroupbillingplace  => $basketgroup->{billingplace},
382
                basketdeliveryplace => C4::Branch::GetBranchName( $basket->{deliveryplace} ),
385
                basketdeliveryplace      => $basket->{deliveryplace},
383
                basketbillingplace => C4::Branch::GetBranchName( $basket->{billingplace} ),
386
                basketbillingplace       => $basket->{billingplace},
384
            };
387
            };
388
            for my $place (qw( basketgroupdeliveryplace basketgroupbillingplace basketdeliveryplace basketbillingplace )) {
389
                if ( my $library = Koha::Libraries->find( $row->{deliveryplace} ) ) {
390
                    $row->{$place} = $library->branchname;
391
                }
392
            }
385
            foreach(qw(
393
            foreach(qw(
386
                basketname author title publishercode collectiontitle notes
394
                basketname author title publishercode collectiontitle notes
387
                booksellername bookselleraddress booksellerpostal contractname
395
                booksellername bookselleraddress booksellerpostal contractname
(-)a/C4/Auth.pm (-2 / +3 lines)
Lines 33-38 use C4::Branch; # GetBranches Link Here
33
use C4::Search::History;
33
use C4::Search::History;
34
use Koha;
34
use Koha;
35
use Koha::AuthUtils qw(hash_password);
35
use Koha::AuthUtils qw(hash_password);
36
use Koha::Libraries;
36
use Koha::LibraryCategories;
37
use Koha::LibraryCategories;
37
use POSIX qw/strftime/;
38
use POSIX qw/strftime/;
38
use List::MoreUtils qw/ any /;
39
use List::MoreUtils qw/ any /;
Lines 1071-1077 sub checkauth { Link Here
1071
                    # if they specify at login, use that
1072
                    # if they specify at login, use that
1072
                    if ( $query->param('branch') ) {
1073
                    if ( $query->param('branch') ) {
1073
                        $branchcode = $query->param('branch');
1074
                        $branchcode = $query->param('branch');
1074
                        $branchname = GetBranchName($branchcode);
1075
                        $branchname = Koha::Libraries->find($branchcode)->branchname;
1075
                    }
1076
                    }
1076
                    my $branches = GetBranches();
1077
                    my $branches = GetBranches();
1077
                    if ( C4::Context->boolean_preference('IndependentBranches') && C4::Context->boolean_preference('Autolocation') ) {
1078
                    if ( C4::Context->boolean_preference('IndependentBranches') && C4::Context->boolean_preference('Autolocation') ) {
Lines 1512-1518 sub check_api_auth { Link Here
1512
                # if they specify at login, use that
1513
                # if they specify at login, use that
1513
                if ( $query->param('branch') ) {
1514
                if ( $query->param('branch') ) {
1514
                    $branchcode = $query->param('branch');
1515
                    $branchcode = $query->param('branch');
1515
                    $branchname = GetBranchName($branchcode);
1516
                    $branchname = Koha::Libraries->find($branchcode)->branchname;
1516
                }
1517
                }
1517
                my $branches = GetBranches();
1518
                my $branches = GetBranches();
1518
                my @branchesloop;
1519
                my @branchesloop;
(-)a/C4/Biblio.pm (-1 / +2 lines)
Lines 40-45 use C4::OAI::Sets; Link Here
40
40
41
use Koha::Cache;
41
use Koha::Cache;
42
use Koha::Authority::Types;
42
use Koha::Authority::Types;
43
use Koha::Libraries;
43
44
44
use vars qw($VERSION @ISA @EXPORT);
45
use vars qw($VERSION @ISA @EXPORT);
45
46
Lines 1653-1659 sub GetAuthorisedValueDesc { Link Here
1653
1654
1654
        #---- branch
1655
        #---- branch
1655
        if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
1656
        if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
1656
            return C4::Branch::GetBranchName($value);
1657
            return Koha::Libraries->find($value)->branchname;
1657
        }
1658
        }
1658
1659
1659
        #---- itemtypes
1660
        #---- itemtypes
(-)a/C4/Branch.pm (-15 lines)
Lines 29-35 BEGIN { Link Here
29
    $VERSION = 3.07.00.049;
29
    $VERSION = 3.07.00.049;
30
	@ISA    = qw(Exporter);
30
	@ISA    = qw(Exporter);
31
	@EXPORT = qw(
31
	@EXPORT = qw(
32
		&GetBranchName
33
		&GetBranch
32
		&GetBranch
34
		&GetBranches
33
		&GetBranches
35
		&GetBranchesLoop
34
		&GetBranchesLoop
Lines 154-173 sub GetBranchesLoop { # since this is what most pages want anyway Link Here
154
    return \@loop;
153
    return \@loop;
155
}
154
}
156
155
157
=head2 GetBranchName
158
159
=cut
160
161
sub GetBranchName {
162
    my ($branchcode) = @_;
163
    my $dbh = C4::Context->dbh;
164
    my $sth;
165
    $sth = $dbh->prepare("Select branchname from branches where branchcode=?");
166
    $sth->execute($branchcode);
167
    my $branchname = $sth->fetchrow_array;
168
    return ($branchname);
169
}
170
171
=head2 GetBranch
156
=head2 GetBranch
172
157
173
$branch = GetBranch( $query, $branches );
158
$branch = GetBranch( $query, $branches );
(-)a/C4/Circulation.pm (-4 / +3 lines)
Lines 966-972 sub CanBookBeIssued { Link Here
966
                $issuingimpossible{ITEMNOTSAMEBRANCH} = 1;
966
                $issuingimpossible{ITEMNOTSAMEBRANCH} = 1;
967
                $issuingimpossible{'itemhomebranch'} = $item->{C4::Context->preference("HomeOrHoldingBranch")};
967
                $issuingimpossible{'itemhomebranch'} = $item->{C4::Context->preference("HomeOrHoldingBranch")};
968
            }
968
            }
969
            $needsconfirmation{BORRNOTSAMEBRANCH} = GetBranchName( $borrower->{'branchcode'} )
969
            $needsconfirmation{BORRNOTSAMEBRANCH} = $borrower->{'branchcode'}
970
              if ( $borrower->{'branchcode'} ne $userenv->{branch} );
970
              if ( $borrower->{'branchcode'} ne $userenv->{branch} );
971
        }
971
        }
972
    }
972
    }
Lines 1026-1032 sub CanBookBeIssued { Link Here
1026
            my $resbor = $res->{'borrowernumber'};
1026
            my $resbor = $res->{'borrowernumber'};
1027
            if ( $resbor ne $borrower->{'borrowernumber'} ) {
1027
            if ( $resbor ne $borrower->{'borrowernumber'} ) {
1028
                my ( $resborrower ) = C4::Members::GetMember( borrowernumber => $resbor );
1028
                my ( $resborrower ) = C4::Members::GetMember( borrowernumber => $resbor );
1029
                my $branchname = GetBranchName( $res->{'branchcode'} );
1030
                if ( $restype eq "Waiting" )
1029
                if ( $restype eq "Waiting" )
1031
                {
1030
                {
1032
                    # The item is on reserve and waiting, but has been
1031
                    # The item is on reserve and waiting, but has been
Lines 1036-1042 sub CanBookBeIssued { Link Here
1036
                    $needsconfirmation{'ressurname'} = $resborrower->{'surname'};
1035
                    $needsconfirmation{'ressurname'} = $resborrower->{'surname'};
1037
                    $needsconfirmation{'rescardnumber'} = $resborrower->{'cardnumber'};
1036
                    $needsconfirmation{'rescardnumber'} = $resborrower->{'cardnumber'};
1038
                    $needsconfirmation{'resborrowernumber'} = $resborrower->{'borrowernumber'};
1037
                    $needsconfirmation{'resborrowernumber'} = $resborrower->{'borrowernumber'};
1039
                    $needsconfirmation{'resbranchname'} = $branchname;
1038
                    $needsconfirmation{'resbranchcode'} = $res->{branchcode};
1040
                    $needsconfirmation{'reswaitingdate'} = $res->{'waitingdate'};
1039
                    $needsconfirmation{'reswaitingdate'} = $res->{'waitingdate'};
1041
                }
1040
                }
1042
                elsif ( $restype eq "Reserved" ) {
1041
                elsif ( $restype eq "Reserved" ) {
Lines 1046-1052 sub CanBookBeIssued { Link Here
1046
                    $needsconfirmation{'ressurname'} = $resborrower->{'surname'};
1045
                    $needsconfirmation{'ressurname'} = $resborrower->{'surname'};
1047
                    $needsconfirmation{'rescardnumber'} = $resborrower->{'cardnumber'};
1046
                    $needsconfirmation{'rescardnumber'} = $resborrower->{'cardnumber'};
1048
                    $needsconfirmation{'resborrowernumber'} = $resborrower->{'borrowernumber'};
1047
                    $needsconfirmation{'resborrowernumber'} = $resborrower->{'borrowernumber'};
1049
                    $needsconfirmation{'resbranchname'} = $branchname;
1048
                    $needsconfirmation{'resbranchcode'} = $res->{branchcode};
1050
                    $needsconfirmation{'resreservedate'} = $res->{'reservedate'};
1049
                    $needsconfirmation{'resreservedate'} = $res->{'reservedate'};
1051
                }
1050
                }
1052
            }
1051
            }
(-)a/C4/ILSDI/Services.pm (-7 / +16 lines)
Lines 35-40 use CGI qw ( -utf8 ); Link Here
35
use DateTime;
35
use DateTime;
36
use C4::Auth;
36
use C4::Auth;
37
37
38
use Koha::Libraries;
39
38
=head1 NAME
40
=head1 NAME
39
41
40
C4::ILS-DI::Services - ILS-DI Services
42
C4::ILS-DI::Services - ILS-DI Services
Lines 219-226 sub GetRecords { Link Here
219
            delete $item->{'more_subfields_xml'};
221
            delete $item->{'more_subfields_xml'};
220
222
221
            # Display branch names instead of branch codes
223
            # Display branch names instead of branch codes
222
            $item->{'homebranchname'}    = GetBranchName( $item->{'homebranch'} );
224
            my $home_library    = Koha::Libraries->find( $item->{homebranch} );
223
            $item->{'holdingbranchname'} = GetBranchName( $item->{'holdingbranch'} );
225
            my $holding_library = Koha::Libraries->find( $item->{holdingbranch} );
226
            $item->{'homebranchname'}    = $home_library    ? $home_library->branchname    : '';
227
            $item->{'holdingbranchname'} = $holding_library ? $holding_library->branchname : '';
224
        }
228
        }
225
229
226
        # Hashref building...
230
        # Hashref building...
Lines 363-369 sub GetPatronInfo { Link Here
363
367
364
    # Cleaning the borrower hashref
368
    # Cleaning the borrower hashref
365
    $borrower->{'charges'}    = $borrower->{'flags'}->{'CHARGES'}->{'amount'};
369
    $borrower->{'charges'}    = $borrower->{'flags'}->{'CHARGES'}->{'amount'};
366
    $borrower->{'branchname'} = GetBranchName( $borrower->{'branchcode'} );
370
    my $library = Koha::Libraries->find( $borrower->{branchcode} );
371
    $borrower->{'branchname'} = $library ? $library->branchname : '';
367
    delete $borrower->{'flags'};
372
    delete $borrower->{'flags'};
368
    delete $borrower->{'userid'};
373
    delete $borrower->{'userid'};
369
    delete $borrower->{'password'};
374
    delete $borrower->{'password'};
Lines 403-409 sub GetPatronInfo { Link Here
403
408
404
            # Get additional informations
409
            # Get additional informations
405
            my $item = GetBiblioFromItemNumber( $reserve->{'itemnumber'}, undef );
410
            my $item = GetBiblioFromItemNumber( $reserve->{'itemnumber'}, undef );
406
            my $branchname = GetBranchName( $reserve->{'branchcode'} );
411
            my $library = Koha::Libraries->find( $reserve->{branchcode} );
412
            my $branchname = $library ? $library->branchname : '';
407
413
408
            # Remove unwanted fields
414
            # Remove unwanted fields
409
            delete $item->{'marc'};
415
            delete $item->{'marc'};
Lines 632-638 sub HoldTitle { Link Here
632
    # Hashref building
638
    # Hashref building
633
    my $out;
639
    my $out;
634
    $out->{'title'}           = $title;
640
    $out->{'title'}           = $title;
635
    $out->{'pickup_location'} = GetBranchName($branch);
641
    my $library = Koha::Libraries->find( $branch );
642
    $out->{'pickup_location'} = $library ? $library->branchname : '';
636
643
637
    # TODO $out->{'date_available'}  = '';
644
    # TODO $out->{'date_available'}  = '';
638
645
Lines 708-714 sub HoldItem { Link Here
708
715
709
    # Hashref building
716
    # Hashref building
710
    my $out;
717
    my $out;
711
    $out->{'pickup_location'} = GetBranchName($branch);
718
    my $library = Koha::Libraries->find( $branch );
719
    $out->{'pickup_location'} = $library ? $library->branchname : '';
712
720
713
    # TODO $out->{'date_available'} = '';
721
    # TODO $out->{'date_available'} = '';
714
722
Lines 764-770 sub _availability { Link Here
764
    }
772
    }
765
773
766
    my $biblionumber = $item->{'biblioitemnumber'};
774
    my $biblionumber = $item->{'biblioitemnumber'};
767
    my $location     = GetBranchName( $item->{'holdingbranch'} );
775
    my $library = Koha::Libraries->find( $item->{holdingbranch} );
776
    my $location = $library ? $library->branchname : '';
768
777
769
    if ( $item->{'notforloan'} ) {
778
    if ( $item->{'notforloan'} ) {
770
        return ( $biblionumber, 'not available', 'Not for loan', $location );
779
        return ( $biblionumber, 'not available', 'Not for loan', $location );
(-)a/C4/Items.pm (-8 / +5 lines)
Lines 37-42 use Data::Dumper; # used as part of logging item record changes, not just for Link Here
37
use Koha::DateUtils qw/dt_from_string/;
37
use Koha::DateUtils qw/dt_from_string/;
38
38
39
use Koha::Database;
39
use Koha::Database;
40
use Koha::Libraries;
40
41
41
use vars qw($VERSION @ISA @EXPORT);
42
use vars qw($VERSION @ISA @EXPORT);
42
43
Lines 746-765 sub CheckItemPreSave { Link Here
746
747
747
    # check for valid home branch
748
    # check for valid home branch
748
    if (exists $item_ref->{'homebranch'} and defined $item_ref->{'homebranch'}) {
749
    if (exists $item_ref->{'homebranch'} and defined $item_ref->{'homebranch'}) {
749
        my $branch_name = C4::Branch::GetBranchName($item_ref->{'homebranch'});
750
        my $home_library = Koha::Libraries->find( $item_ref->{homebranch} );
750
        unless (defined $branch_name) {
751
        unless (defined $home_library) {
751
            # relies on fact that branches.branchname is a non-NULL column,
752
            # so GetBranchName returns undef only if branch does not exist
753
            $errors{'invalid_homebranch'} = $item_ref->{'homebranch'};
752
            $errors{'invalid_homebranch'} = $item_ref->{'homebranch'};
754
        }
753
        }
755
    }
754
    }
756
755
757
    # check for valid holding branch
756
    # check for valid holding branch
758
    if (exists $item_ref->{'holdingbranch'} and defined $item_ref->{'holdingbranch'}) {
757
    if (exists $item_ref->{'holdingbranch'} and defined $item_ref->{'holdingbranch'}) {
759
        my $branch_name = C4::Branch::GetBranchName($item_ref->{'holdingbranch'});
758
        my $holding_library = Koha::Libraries->find( $item_ref->{holdingbranch} );
760
        unless (defined $branch_name) {
759
        unless (defined $holding_library) {
761
            # relies on fact that branches.branchname is a non-NULL column,
762
            # so GetBranchName returns undef only if branch does not exist
763
            $errors{'invalid_holdingbranch'} = $item_ref->{'holdingbranch'};
760
            $errors{'invalid_holdingbranch'} = $item_ref->{'holdingbranch'};
764
        }
761
        }
765
    }
762
    }
(-)a/C4/Koha.pm (-2 / +1 lines)
Lines 32-41 use DateTime::Format::MySQL; Link Here
32
use Business::ISBN;
32
use Business::ISBN;
33
use autouse 'Data::cselectall_arrayref' => qw(Dumper);
33
use autouse 'Data::cselectall_arrayref' => qw(Dumper);
34
use DBI qw(:sql_types);
34
use DBI qw(:sql_types);
35
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $DEBUG);
35
use vars qw(@ISA @EXPORT @EXPORT_OK $DEBUG);
36
36
37
BEGIN {
37
BEGIN {
38
    $VERSION = 3.07.00.049;
39
	require Exporter;
38
	require Exporter;
40
	@ISA    = qw(Exporter);
39
	@ISA    = qw(Exporter);
41
	@EXPORT = qw(
40
	@EXPORT = qw(
(-)a/C4/Labels/Label.pm (-3 / +4 lines)
Lines 100-108 sub _get_label_item { Link Here
100
    $data->{'itype'} = $data1->{'description'};
100
    $data->{'itype'} = $data1->{'description'};
101
    # add *_description fields
101
    # add *_description fields
102
    if ($data->{'homebranch'} || $data->{'holdingbranch'}){
102
    if ($data->{'homebranch'} || $data->{'holdingbranch'}){
103
        require C4::Branch;
103
        require Koha::Libraries;
104
        $data->{'homebranch_description'} = C4::Branch::GetBranchName($data->{'homebranch'}) if $data->{'homebranch'};
104
        # FIXME Is this used??
105
        $data->{'holdingbranch_description'} = C4::Branch::GetBranchName($data->{'holdingbranch'}) if $data->{'holdingbranch'};
105
        $data->{'homebranch_description'} = Koha::Libraries->find($data->{'homebranch'})->branchname if $data->{'homebranch'};
106
        $data->{'holdingbranch_description'} = Koha::Libraries->find($data->{'holdingbranch'})->branchname if $data->{'holdingbranch'};
106
    }
107
    }
107
    $data->{'ccode_description'} = C4::Biblio::GetAuthorisedValueDesc('','', $data->{'ccode'} ,'','','CCODE', 1) if $data->{'ccode'};
108
    $data->{'ccode_description'} = C4::Biblio::GetAuthorisedValueDesc('','', $data->{'ccode'} ,'','','CCODE', 1) if $data->{'ccode'};
108
    $data->{'location_description'} = C4::Biblio::GetAuthorisedValueDesc('','', $data->{'location'} ,'','','LOC', 1) if $data->{'location'};
109
    $data->{'location_description'} = C4::Biblio::GetAuthorisedValueDesc('','', $data->{'location'} ,'','','LOC', 1) if $data->{'location'};
(-)a/C4/SIP/ILS/Patron.pm (-2 / +4 lines)
Lines 20-29 use C4::Context; Link Here
20
use C4::Koha;
20
use C4::Koha;
21
use C4::Members;
21
use C4::Members;
22
use C4::Reserves;
22
use C4::Reserves;
23
use C4::Branch qw(GetBranchName);
24
use C4::Items qw( GetBarcodeFromItemnumber GetItemnumbersForBiblio);
23
use C4::Items qw( GetBarcodeFromItemnumber GetItemnumbersForBiblio);
25
use C4::Auth qw(checkpw_hash);
24
use C4::Auth qw(checkpw_hash);
26
25
26
use Koha::Libraries;
27
27
our $VERSION = 3.07.00.049;
28
our $VERSION = 3.07.00.049;
28
29
29
our $kp;    # koha patron
30
our $kp;    # koha patron
Lines 357-363 sub holds_blocked_by_excessive_fees { Link Here
357
sub library_name {
358
sub library_name {
358
    my $self = shift;
359
    my $self = shift;
359
    unless ($self->{library_name}) {
360
    unless ($self->{library_name}) {
360
        $self->{library_name} = GetBranchName($self->{branchcode});
361
        my $library = Koha::Libraries->find( $self->{branchcode} );
362
        $self->{library_name} = $library ? $library->branchname : '';
361
    }
363
    }
362
    return $self->{library_name};
364
    return $self->{library_name};
363
}
365
}
(-)a/C4/Search.pm (-3 / +4 lines)
Lines 22-27 use C4::Context; Link Here
22
use C4::Biblio;    # GetMarcFromKohaField, GetBiblioData
22
use C4::Biblio;    # GetMarcFromKohaField, GetBiblioData
23
use C4::Koha;      # getFacets
23
use C4::Koha;      # getFacets
24
use Koha::DateUtils;
24
use Koha::DateUtils;
25
use Koha::Libraries;
25
use Lingua::Stem;
26
use Lingua::Stem;
26
use C4::Search::PazPar2;
27
use C4::Search::PazPar2;
27
use XML::Simple;
28
use XML::Simple;
Lines 1689-1697 sub buildQuery { Link Here
1689
            $limit_cgi  .= "&limit=" . uri_escape_utf8($this_limit);
1690
            $limit_cgi  .= "&limit=" . uri_escape_utf8($this_limit);
1690
            if ($this_limit =~ /^branch:(.+)/) {
1691
            if ($this_limit =~ /^branch:(.+)/) {
1691
                my $branchcode = $1;
1692
                my $branchcode = $1;
1692
                my $branchname = GetBranchName($branchcode);
1693
                my $library = Koha::Libraries->find( $branchcode );
1693
                if (defined $branchname) {
1694
                if (defined $library) {
1694
                    $limit_desc .= " branch:$branchname";
1695
                    $limit_desc .= " branch:" . $library->branchname;
1695
                } else {
1696
                } else {
1696
                    $limit_desc .= " $this_limit";
1697
                    $limit_desc .= " $this_limit";
1697
                }
1698
                }
(-)a/acqui/acqui-home.pl (-7 lines)
Lines 50-58 my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( Link Here
50
    }
50
    }
51
);
51
);
52
52
53
my $user = GetMember( 'borrowernumber' => $loggedinuser );
54
my $branchname = GetBranchName($user->{branchcode});
55
56
my $status           = $query->param('status') || "ASKED";
53
my $status           = $query->param('status') || "ASKED";
57
my $suggestions_count       = CountSuggestion($status);
54
my $suggestions_count       = CountSuggestion($status);
58
55
Lines 73-81 my @budget_loop; Link Here
73
foreach my $budget ( @{$budget_arr} ) {
70
foreach my $budget ( @{$budget_arr} ) {
74
    next unless (CanUserUseBudget($loggedinuser, $budget, $userflags));
71
    next unless (CanUserUseBudget($loggedinuser, $budget, $userflags));
75
72
76
    $budget->{'budget_branchname'} =
77
      GetBranchName( $budget->{'budget_branchcode'} );
78
79
    my $member = GetMember( borrowernumber => $budget->{budget_owner_id} );
73
    my $member = GetMember( borrowernumber => $budget->{budget_owner_id} );
80
    if ($member) {
74
    if ($member) {
81
        $budget->{budget_owner_firstname} = $member->{'firstname'};
75
        $budget->{budget_owner_firstname} = $member->{'firstname'};
Lines 116-122 foreach my $budget ( @{$budget_arr} ) { Link Here
116
$template->param(
110
$template->param(
117
    type          => 'intranet',
111
    type          => 'intranet',
118
    loop_budget   => \@budget_loop,
112
    loop_budget   => \@budget_loop,
119
    branchname    => $branchname,
120
    total         => $total,
113
    total         => $total,
121
    totspent      => $totspent,
114
    totspent      => $totspent,
122
    totordered    => $totordered,
115
    totordered    => $totordered,
(-)a/acqui/basket.pl (-5 / +3 lines)
Lines 340-347 if ( $op eq 'delete_confirm' ) { Link Here
340
340
341
    if ($basket->{basketgroupid}){
341
    if ($basket->{basketgroupid}){
342
        $basketgroup = GetBasketgroup($basket->{basketgroupid});
342
        $basketgroup = GetBasketgroup($basket->{basketgroupid});
343
        $basketgroup->{deliveryplacename} = C4::Branch::GetBranchName( $basketgroup->{deliveryplace} );
344
        $basketgroup->{billingplacename} = C4::Branch::GetBranchName( $basketgroup->{billingplace} );
345
    }
343
    }
346
    my $borrower= GetMember('borrowernumber' => $loggedinuser);
344
    my $borrower= GetMember('borrowernumber' => $loggedinuser);
347
    my $budgets = GetBudgetHierarchy;
345
    my $budgets = GetBudgetHierarchy;
Lines 359-365 if ( $op eq 'delete_confirm' ) { Link Here
359
    $template->param(
357
    $template->param(
360
        basketno             => $basketno,
358
        basketno             => $basketno,
361
        basketname           => $basket->{'basketname'},
359
        basketname           => $basket->{'basketname'},
362
        basketbranchname     => C4::Branch::GetBranchName($basket->{branch}),
360
        basketbranchcode     => $basket->{branch},
363
        basketnote           => $basket->{note},
361
        basketnote           => $basket->{note},
364
        basketbooksellernote => $basket->{booksellernote},
362
        basketbooksellernote => $basket->{booksellernote},
365
        basketcontractno     => $basket->{contractnumber},
363
        basketcontractno     => $basket->{contractnumber},
Lines 372-379 if ( $op eq 'delete_confirm' ) { Link Here
372
        users                => \@basketusers,
370
        users                => \@basketusers,
373
        closedate            => $basket->{closedate},
371
        closedate            => $basket->{closedate},
374
        estimateddeliverydate=> $estimateddeliverydate,
372
        estimateddeliverydate=> $estimateddeliverydate,
375
        deliveryplace        => C4::Branch::GetBranchName( $basket->{deliveryplace} ),
373
        deliveryplace        => $basket->{deliveryplace},
376
        billingplace         => C4::Branch::GetBranchName( $basket->{billingplace} ),
374
        billingplace         => $basket->{billingplace},
377
        active               => $bookseller->{'active'},
375
        active               => $bookseller->{'active'},
378
        booksellerid         => $bookseller->{'id'},
376
        booksellerid         => $bookseller->{'id'},
379
        name                 => $bookseller->{'name'},
377
        name                 => $bookseller->{'name'},
(-)a/acqui/orderreceive.pl (-6 lines)
Lines 129-140 if ($AcqCreateItem eq 'receiving') { Link Here
129
    my @items;
129
    my @items;
130
    foreach (@itemnumbers) {
130
    foreach (@itemnumbers) {
131
        my $item = GetItem($_);
131
        my $item = GetItem($_);
132
        if($item->{homebranch}) {
133
            $item->{homebranchname} = GetBranchName($item->{homebranch});
134
        }
135
        if($item->{holdingbranch}) {
136
            $item->{holdingbranchname} = GetBranchName($item->{holdingbranch});
137
        }
138
        if(my $code = GetAuthValCode("items.notforloan", $fw)) {
132
        if(my $code = GetAuthValCode("items.notforloan", $fw)) {
139
            $item->{notforloan} = GetKohaAuthorisedValueLib($code, $item->{notforloan});
133
            $item->{notforloan} = GetKohaAuthorisedValueLib($code, $item->{notforloan});
140
        }
134
        }
(-)a/acqui/pdfformat/layout3pages.pm (-6 / +6 lines)
Lines 29-36 use strict; Link Here
29
use warnings;
29
use warnings;
30
use utf8;
30
use utf8;
31
31
32
use C4::Branch qw(GetBranchName);
33
34
use Koha::Number::Price;
32
use Koha::Number::Price;
35
use Koha::DateUtils;
33
use Koha::DateUtils;
36
use Koha::Libraries;
34
use Koha::Libraries;
Lines 65-71 sub printorders { Link Here
65
    my $number = 3;
63
    my $number = 3;
66
    for my $basket (@$baskets){
64
    for my $basket (@$baskets){
67
        my $page = $pdf->page();
65
        my $page = $pdf->page();
68
        
66
        my $billing_library = Koha::Libraries->find( $basket->{billingplace} );
67
        my $delivery_library = Koha::Libraries->find( $basket->{deliveryplace} );
68
69
        # print basket header (box)
69
        # print basket header (box)
70
        my $box = $page->gfx;
70
        my $box = $page->gfx;
71
        $box->rectxy(($width - 10)/mm, ($height - 5)/mm, 10/mm, ($height - 25)/mm);
71
        $box->rectxy(($width - 10)/mm, ($height - 5)/mm, 10/mm, ($height - 25)/mm);
Lines 80-88 sub printorders { Link Here
80
        $text->text("Order no. ".$basketgroup->{'id'}.". Basket no. ".$basket->{basketno}.". ".$basket->{booksellernote});
80
        $text->text("Order no. ".$basketgroup->{'id'}.". Basket no. ".$basket->{basketno}.". ".$basket->{booksellernote});
81
        $text->translate(20/mm,  ($height-20)/mm);
81
        $text->translate(20/mm,  ($height-20)/mm);
82
        $text->font( $pdf->corefont("Times", -encoding => "utf8"), 4/mm );
82
        $text->font( $pdf->corefont("Times", -encoding => "utf8"), 4/mm );
83
        $text->text( ( $basket->{billingplace} ? "Billing at " . C4::Branch::GetBranchName( $basket->{billingplace} ) : "" )
83
        $text->text( ( $billing_library ? "Billing at " . $billing_library->branchname : "" )
84
            . ( $basket->{billingplace} and $basket->{deliveryplace} ? " and " : "" )
84
            . ( $billing_library and $delivery_library ? " and " : "" )
85
            . ( $basket->{deliveryplace} ? "delivery at " . C4::Branch::GetBranchName( $basket->{deliveryplace}) : "" )
85
            . ( $delivery_library ? "delivery at " . $delivery_library->branchname : "" )
86
        );
86
        );
87
87
88
        my $pdftable = new PDF::Table();
88
        my $pdftable = new PDF::Table();
(-)a/acqui/pdfformat/layout3pagesfr.pm (-5 / +5 lines)
Lines 28-35 use strict; Link Here
28
use warnings;
28
use warnings;
29
use utf8;
29
use utf8;
30
30
31
use C4::Branch qw(GetBranchName);
32
33
use Koha::Number::Price;
31
use Koha::Number::Price;
34
use Koha::DateUtils;
32
use Koha::DateUtils;
35
use Koha::Libraries;
33
use Koha::Libraries;
Lines 64-69 sub printorders { Link Here
64
    my $number = 3;
62
    my $number = 3;
65
    for my $basket (@$baskets){
63
    for my $basket (@$baskets){
66
        my $page = $pdf->page();
64
        my $page = $pdf->page();
65
        my $billing_library = Koha::Libraries->find( $basket->{billingplace} );
66
        my $delivery_library = Koha::Libraries->find( $basket->{deliveryplace} );
67
67
68
        # print basket header (box)
68
        # print basket header (box)
69
        my $box = $page->gfx;
69
        my $box = $page->gfx;
Lines 79-87 sub printorders { Link Here
79
        $text->text("Commande N°".$basketgroup->{'id'}.". Panier N° ".$basket->{basketno}.". ".$basket->{booksellernote});
79
        $text->text("Commande N°".$basketgroup->{'id'}.". Panier N° ".$basket->{basketno}.". ".$basket->{booksellernote});
80
        $text->translate(20/mm,  ($height-20)/mm);
80
        $text->translate(20/mm,  ($height-20)/mm);
81
        $text->font( $pdf->corefont("Times", -encoding => "utf8"), 4/mm );
81
        $text->font( $pdf->corefont("Times", -encoding => "utf8"), 4/mm );
82
        $text->text( ( $basket->{billingplace} ? "Facturation à " . C4::Branch::GetBranchName( $basket->{billingplace} ) : "" )
82
        $text->text( ( $billing_library ? "Facturation à " . $billing_library->branchname : "" )
83
            . ( $basket->{billingplace} and $basket->{deliveryplace} ? " et " : "" )
83
            . ( $billing_library and $delivery_library ? " et " : "" )
84
            . ( $basket->{deliveryplace} ? "livraison à " . C4::Branch::GetBranchName( $basket->{deliveryplace}) : "" )
84
            . ( $delivery_library ? "livraison à " . $delivery_library->branchname : "" )
85
        );
85
        );
86
86
87
        my $pdftable = new PDF::Table();
87
        my $pdftable = new PDF::Table();
(-)a/admin/branch_transfer_limits.pl (-4 lines)
Lines 50-57 else Link Here
50
	$branchcode = $input->param('branchcode');
50
	$branchcode = $input->param('branchcode');
51
}
51
}
52
52
53
my $branchname = GetBranchName($branchcode);
54
55
# Getting the branches for user selection
53
# Getting the branches for user selection
56
my $branches = GetBranches();
54
my $branches = GetBranches();
57
my @branch_loop;
55
my @branch_loop;
Lines 124-130 foreach my $code ( @codes ) { Link Here
124
		$row_data{ code }         = $code;
122
		$row_data{ code }         = $code;
125
		$row_data{ toBranch }     = $toBranch;
123
		$row_data{ toBranch }     = $toBranch;
126
		$row_data{ isChecked }    = $isChecked;	
124
		$row_data{ isChecked }    = $isChecked;	
127
		$row_data{ toBranchname } = GetBranchName($toBranch);	
128
		push( @to_branch_loop, \%row_data );
125
		push( @to_branch_loop, \%row_data );
129
	}
126
	}
130
127
Lines 138-144 $template->param( Link Here
138
		branch_loop => \@branch_loop,
135
		branch_loop => \@branch_loop,
139
		branchcode_loop => \@branchcode_loop,
136
		branchcode_loop => \@branchcode_loop,
140
		branchcode => $branchcode,
137
		branchcode => $branchcode,
141
		branchname => $branchname,
142
        limitType => $limitType,
138
        limitType => $limitType,
143
		);
139
		);
144
140
(-)a/admin/clone-rules.pl (-3 / +1 lines)
Lines 33-39 use C4::Output; Link Here
33
use C4::Auth;
33
use C4::Auth;
34
use C4::Koha;
34
use C4::Koha;
35
use C4::Debug;
35
use C4::Debug;
36
use C4::Branch; # GetBranches
36
use C4::Branch; # GetBranchesLoop
37
37
38
my $input = new CGI;
38
my $input = new CGI;
39
my $dbh = C4::Context->dbh;
39
my $dbh = C4::Context->dbh;
Lines 52-60 my $tobranch = $input->param("tobranch"); Link Here
52
my $branchloop = GetBranchesLoop;
52
my $branchloop = GetBranchesLoop;
53
53
54
$template->param(frombranch     => $frombranch)                if ($frombranch);
54
$template->param(frombranch     => $frombranch)                if ($frombranch);
55
$template->param(frombranchname => GetBranchName($frombranch)) if ($frombranch);
56
$template->param(tobranch       => $tobranch)                  if ($tobranch);
55
$template->param(tobranch       => $tobranch)                  if ($tobranch);
57
$template->param(tobranchname   => GetBranchName($tobranch))   if ($tobranch);
58
56
59
$template->param(branchloop => $branchloop);
57
$template->param(branchloop => $branchloop);
60
58
(-)a/catalogue/detail.pl (-1 lines)
Lines 152-158 foreach my $subscription (@subscriptions) { Link Here
152
    $cell{missinglist}       = $subscription->{missinglist};
152
    $cell{missinglist}       = $subscription->{missinglist};
153
    $cell{librariannote}     = $subscription->{librariannote};
153
    $cell{librariannote}     = $subscription->{librariannote};
154
    $cell{branchcode}        = $subscription->{branchcode};
154
    $cell{branchcode}        = $subscription->{branchcode};
155
    $cell{branchname}        = GetBranchName($subscription->{branchcode});
156
    $cell{hasalert}          = $subscription->{hasalert};
155
    $cell{hasalert}          = $subscription->{hasalert};
157
    $cell{callnumber}        = $subscription->{callnumber};
156
    $cell{callnumber}        = $subscription->{callnumber};
158
    $cell{closed}            = $subscription->{closed};
157
    $cell{closed}            = $subscription->{closed};
(-)a/catalogue/getitem-ajax.pl (-3 / +3 lines)
Lines 23-32 use JSON; Link Here
23
23
24
use C4::Auth;
24
use C4::Auth;
25
use C4::Biblio;
25
use C4::Biblio;
26
use C4::Branch;
27
use C4::Items;
26
use C4::Items;
28
use C4::Koha;
27
use C4::Koha;
29
use C4::Output;
28
use C4::Output;
29
use Koha::Libraries;
30
30
31
my $cgi = new CGI;
31
my $cgi = new CGI;
32
32
Lines 46-56 if($itemnumber) { Link Here
46
    $item = GetItem($itemnumber);
46
    $item = GetItem($itemnumber);
47
47
48
    if($item->{homebranch}) {
48
    if($item->{homebranch}) {
49
        $item->{homebranchname} = GetBranchName($item->{homebranch});
49
        $item->{homebranchname} = Koha::Libraries->find($item->{homebranch})->branchname;
50
    }
50
    }
51
51
52
    if($item->{holdingbranch}) {
52
    if($item->{holdingbranch}) {
53
        $item->{holdingbranchname} = GetBranchName($item->{holdingbranch});
53
        $item->{holdingbranchname} = Koha::Libraries->find($item->{holdingbranch})->branchname;
54
    }
54
    }
55
55
56
    if(my $code = GetAuthValCode("items.notforloan", $fw)) {
56
    if(my $code = GetAuthValCode("items.notforloan", $fw)) {
(-)a/catalogue/moredetail.pl (-2 lines)
Lines 186-193 foreach my $item (@items){ Link Here
186
                $item->{'nomod'}=1;
186
                $item->{'nomod'}=1;
187
        }
187
        }
188
    }
188
    }
189
    $item->{'homebranchname'} = GetBranchName($item->{'homebranch'});
190
    $item->{'holdingbranchname'} = GetBranchName($item->{'holdingbranch'});
191
    if ($item->{'datedue'}) {
189
    if ($item->{'datedue'}) {
192
        $item->{'issue'}= 1;
190
        $item->{'issue'}= 1;
193
    } else {
191
    } else {
(-)a/circ/branchoverdues.pl (-1 / +1 lines)
Lines 125-131 foreach my $num (@getoverdues) { Link Here
125
    $overdueforbranch{'borrowerfirstname'} = $num->{'firstname'};
125
    $overdueforbranch{'borrowerfirstname'} = $num->{'firstname'};
126
    $overdueforbranch{'borrowerphone'}     = $num->{'phone'};
126
    $overdueforbranch{'borrowerphone'}     = $num->{'phone'};
127
    $overdueforbranch{'borroweremail'}     = $num->{'email'};
127
    $overdueforbranch{'borroweremail'}     = $num->{'email'};
128
    $overdueforbranch{'homebranch'}        = GetBranchName($num->{'homebranch'});
128
    $overdueforbranch{'homebranch'}        = $num->{'homebranch'};
129
    $overdueforbranch{'itemcallnumber'}    = $num->{'itemcallnumber'};
129
    $overdueforbranch{'itemcallnumber'}    = $num->{'itemcallnumber'};
130
    $overdueforbranch{'borrowernumber'}    = $num->{'borrowernumber'};
130
    $overdueforbranch{'borrowernumber'}    = $num->{'borrowernumber'};
131
    $overdueforbranch{'itemnumber'}        = $num->{'itemnumber'};
131
    $overdueforbranch{'itemnumber'}        = $num->{'itemnumber'};
(-)a/circ/circulation.pl (-2 lines)
Lines 70-76 my $branch = $query->param('branch'); Link Here
70
if ($branch){
70
if ($branch){
71
    # update our session so the userenv is updated
71
    # update our session so the userenv is updated
72
    $session->param('branch', $branch);
72
    $session->param('branch', $branch);
73
    $session->param('branchname', GetBranchName($branch));
74
}
73
}
75
74
76
my $printer = $query->param('printer');
75
my $printer = $query->param('printer');
Lines 605-611 $template->param( Link Here
605
    borrowernumber    => $borrowernumber,
604
    borrowernumber    => $borrowernumber,
606
    categoryname      => $borrower->{'description'},
605
    categoryname      => $borrower->{'description'},
607
    branch            => $branch,
606
    branch            => $branch,
608
    branchname        => GetBranchName($borrower->{'branchcode'}),
609
    printer           => $printer,
607
    printer           => $printer,
610
    printername       => $printer,
608
    printername       => $printer,
611
    was_renewed       => $query->param('was_renewed') ? 1 : 0,
609
    was_renewed       => $query->param('was_renewed') ? 1 : 0,
(-)a/circ/returns.pl (-3 / +2 lines)
Lines 44-50 use C4::Reserves; Link Here
44
use C4::Biblio;
44
use C4::Biblio;
45
use C4::Items;
45
use C4::Items;
46
use C4::Members;
46
use C4::Members;
47
use C4::Branch; # GetBranches GetBranchName
47
use C4::Branch; # GetBranches
48
use C4::Koha;   # FIXME : is it still useful ?
48
use C4::Koha;   # FIXME : is it still useful ?
49
use C4::RotatingCollections;
49
use C4::RotatingCollections;
50
use Koha::DateUtils;
50
use Koha::DateUtils;
Lines 171-177 if ( $query->param('resbarcode') ) { Link Here
171
            itemnumber     => $iteminfo->{'itemnumber'},
171
            itemnumber     => $iteminfo->{'itemnumber'},
172
            itembiblionumber => $iteminfo->{'biblionumber'},
172
            itembiblionumber => $iteminfo->{'biblionumber'},
173
            iteminfo       => $iteminfo->{'author'},
173
            iteminfo       => $iteminfo->{'author'},
174
            tobranchname   => GetBranchName($messages->{'transfert'}),
175
            name           => $name,
174
            name           => $name,
176
            borrowernumber => $borrowernumber,
175
            borrowernumber => $borrowernumber,
177
            borcnum        => $borr->{'cardnumber'},
176
            borcnum        => $borr->{'cardnumber'},
Lines 633-639 if ( $itemnumber ) { Link Here
633
    if ( ! ( $holdingBranch eq $collectionBranch ) ) {
632
    if ( ! ( $holdingBranch eq $collectionBranch ) ) {
634
        $template->param(
633
        $template->param(
635
          collectionItemNeedsTransferred => 1,
634
          collectionItemNeedsTransferred => 1,
636
          collectionBranch => GetBranchName($collectionBranch),
635
          collectionBranch => $collectionBranch,
637
        );
636
        );
638
    }
637
    }
639
}
638
}
(-)a/circ/selectbranchprinter.pl (-1 / +3 lines)
Lines 28-33 use C4::Print; # GetPrinters Link Here
28
use C4::Koha;
28
use C4::Koha;
29
use C4::Branch; # GetBranches GetBranchesLoop
29
use C4::Branch; # GetBranches GetBranchesLoop
30
30
31
use Koha::Libraries;
32
31
# this will be the script that chooses branch and printer settings....
33
# this will be the script that chooses branch and printer settings....
32
34
33
my $query = CGI->new();
35
my $query = CGI->new();
Lines 58-64 my @updated; Link Here
58
# $session lddines here are doing the updating
60
# $session lddines here are doing the updating
59
if ($branch and $branches->{$branch}) {
61
if ($branch and $branches->{$branch}) {
60
    if (! $userenv_branch or $userenv_branch ne $branch ) {
62
    if (! $userenv_branch or $userenv_branch ne $branch ) {
61
        my $branchname = GetBranchName($branch);
63
        my $branchname = Koha::Libraries->find($branch)->branchname;
62
        $template->param(LoginBranchname => $branchname);   # update template for new branch
64
        $template->param(LoginBranchname => $branchname);   # update template for new branch
63
        $template->param(LoginBranchcode => $branch);       # update template for new branch
65
        $template->param(LoginBranchcode => $branch);       # update template for new branch
64
        $session->param('branchname', $branchname);         # update sesssion in DB
66
        $session->param('branchname', $branchname);         # update sesssion in DB
(-)a/circ/waitingreserves.pl (-3 / +1 lines)
Lines 23-29 use warnings; Link Here
23
use CGI qw ( -utf8 );
23
use CGI qw ( -utf8 );
24
use C4::Context;
24
use C4::Context;
25
use C4::Output;
25
use C4::Output;
26
use C4::Branch; # GetBranchName
27
use C4::Auth;
26
use C4::Auth;
28
use C4::Circulation;
27
use C4::Circulation;
29
use C4::Members;
28
use C4::Members;
Lines 115-121 foreach my $num (@getreserves) { Link Here
115
    $getreserv{'subtitle'}       = GetRecordValue('subtitle', GetMarcBiblio($gettitle->{'biblionumber'}), GetFrameworkCode($gettitle->{'biblionumber'}));
114
    $getreserv{'subtitle'}       = GetRecordValue('subtitle', GetMarcBiblio($gettitle->{'biblionumber'}), GetFrameworkCode($gettitle->{'biblionumber'}));
116
    $getreserv{'biblionumber'}   = $gettitle->{'biblionumber'};
115
    $getreserv{'biblionumber'}   = $gettitle->{'biblionumber'};
117
    $getreserv{'barcode'}        = $gettitle->{'barcode'};
116
    $getreserv{'barcode'}        = $gettitle->{'barcode'};
118
    $getreserv{'branchname'}     = GetBranchName($gettitle->{'homebranch'});
119
    $getreserv{'homebranch'}     = $gettitle->{'homebranch'};
117
    $getreserv{'homebranch'}     = $gettitle->{'homebranch'};
120
    $getreserv{'holdingbranch'}  = $gettitle->{'holdingbranch'};
118
    $getreserv{'holdingbranch'}  = $gettitle->{'holdingbranch'};
121
    $getreserv{'itemcallnumber'} = $gettitle->{'itemcallnumber'};
119
    $getreserv{'itemcallnumber'} = $gettitle->{'itemcallnumber'};
Lines 190-196 sub cancel { Link Here
190
        my $iteminfo = GetBiblioFromItemNumber($item);
188
        my $iteminfo = GetBiblioFromItemNumber($item);
191
        if ( $messages->{'transfert'} ) {
189
        if ( $messages->{'transfert'} ) {
192
            $res{messagetransfert} = $messages->{'transfert'};
190
            $res{messagetransfert} = $messages->{'transfert'};
193
            $res{branchname}       = GetBranchName($messages->{'transfert'});
191
            $res{branchcode}       = $messages->{'transfert'};
194
        }
192
        }
195
193
196
        $res{message}             = 1;
194
        $res{message}             = 1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc (-1 / +1 lines)
Lines 60-66 Link Here
60
        [% END %]
60
        [% END %]
61
    [% END %][% END %]
61
    [% END %][% END %]
62
    <li class="patroncategory">Category: [% categoryname %] ([% categorycode %])</li>
62
    <li class="patroncategory">Category: [% categoryname %] ([% categorycode %])</li>
63
    <li class="patronlibrary">Home library: [% IF ( branchname ) %][% branchname %][% ELSE %][% branch %][% END %]</li>
63
    <li class="patronlibrary">Home library: [% LoginBranchname %]</li>
64
</ul></div>
64
</ul></div>
65
<div id="menu">
65
<div id="menu">
66
<ul>
66
<ul>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt (-2 / +3 lines)
Lines 1-4 Link Here
1
[% USE Price %]
1
[% USE Price %]
2
[% USE Branches %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Acquisitions</title>
4
<title>Koha &rsaquo; Acquisitions</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
Lines 135-141 $(document).ready(function() { Link Here
135
136
136
[% IF ( loop_budget ) %]
137
[% IF ( loop_budget ) %]
137
138
138
            <h3>All available funds[% IF ( branchname ) %] for [% branchname %][% END %]</h3>
139
            <h3>All available funds[% IF LoginBranchname %] for [% LoginBranchname %][% END %]</h3>
139
140
140
    <div id="BudgetsAndFunds">
141
    <div id="BudgetsAndFunds">
141
    <table id="accounts">
142
    <table id="accounts">
Lines 195-201 $(document).ready(function() { Link Here
195
                        &nbsp;
196
                        &nbsp;
196
                    [% END %]
197
                    [% END %]
197
                </td>
198
                </td>
198
                <td>[% loop_budge.budget_branchname %]</td>
199
                <td>[% Branches.GetName( loop_budge.budget_branchcode ) %]</td>
199
                <td class="data">
200
                <td class="data">
200
                    [% IF loop_budge.budget_parent_id %]
201
                    [% IF loop_budge.budget_parent_id %]
201
                        [% loop_budge.budget_amount | $Price %]
202
                        [% loop_budge.budget_amount | $Price %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-6 / +7 lines)
Lines 1-4 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE Branches %]
2
[% USE Price %]
3
[% USE Price %]
3
[% USE AuthorisedValues %]
4
[% USE AuthorisedValues %]
4
5
Lines 255-262 Link Here
255
                [% IF ( basketcontractno ) %]
256
                [% IF ( basketcontractno ) %]
256
                    <li><span class="label">Contract name:</span> <a href="../admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno %]&amp;booksellerid=[% booksellerid %]">[% basketcontractname %]</a></li>
257
                    <li><span class="label">Contract name:</span> <a href="../admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno %]&amp;booksellerid=[% booksellerid %]">[% basketcontractname %]</a></li>
257
                [% END %]
258
                [% END %]
258
                [% IF ( deliveryplace ) %]<li><span class="label">Delivery place:</span> [% deliveryplace %]</li>[% END %]
259
                [% IF deliveryplace %]<li><span class="label">Delivery place:</span> [% Branches.GetName( deliveryplace ) %]</li>[% END %]
259
                [% IF ( billingplace ) %]<li><span class="label">Billing place:</span> [% billingplace %]</li>[% END %]
260
                [% IF billingplace %]<li><span class="label">Billing place:</span> [% Branches.GetName( billingplace ) %]</li>[% END %]
260
                [% IF ( authorisedbyname ) %]<li><span class="label">Created by:</span>  [% authorisedbyname %]</li>[% END %]
261
                [% IF ( authorisedbyname ) %]<li><span class="label">Created by:</span>  [% authorisedbyname %]</li>[% END %]
261
                <li id="managedby">
262
                <li id="managedby">
262
                    <form action="" method="post">
263
                    <form action="" method="post">
Lines 280-287 Link Here
280
                </li>
281
                </li>
281
                <li id="branch">
282
                <li id="branch">
282
                    <span class="label">Library:</span>
283
                    <span class="label">Library:</span>
283
                    [% IF basketbranchname %]
284
                    [% IF basketbranchcode %]
284
                        [% basketbranchname %]
285
                        [% Branches.GetName( basketbranchcode ) %]
285
                    [% ELSE %]
286
                    [% ELSE %]
286
                        No library
287
                        No library
287
                    [% END %]
288
                    [% END %]
Lines 354-361 Link Here
354
                            <input type="submit" value="Change basket group" />
355
                            <input type="submit" value="Change basket group" />
355
                          [% END %]
356
                          [% END %]
356
                        </li>
357
                        </li>
357
                    [% IF ( basketgroup.deliveryplacename ) %]<li><span class="label">Basket group delivery placename:</span> [% basketgroup.deliveryplacename %]</li>[% END %]
358
                    [% IF basketgroup.deliveryplace %]<li><span class="label">Basket group delivery placename:</span> [% Branches.GetName( basketgroup.deliveryplace ) %]</li>[% END %]
358
                    [% IF ( basketgroup.billingplacename ) %]<li><span class="label">Basket group billing place:</span> [% basketgroup.billingplacename %]</li>[% END %]
359
                    [% IF basketgroup.billingplace %]<li><span class="label">Basket group billing place:</span> [% Branches.GetName( basketgroup.billingplace ) %]</li>[% END %]
359
                        </ol>
360
                        </ol>
360
                    [% IF ( CAN_user_acquisition_group_manage ) %]
361
                    [% IF ( CAN_user_acquisition_group_manage ) %]
361
                    </form>
362
                    </form>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-2 / +3 lines)
Lines 1-4 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE Branches %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Acquisitions &rsaquo; Receipt summary for : [% name %] [% IF ( invoice ) %]invoice, [% invoice %][% END %]</title>
4
<title>Koha &rsaquo; Acquisitions &rsaquo; Receipt summary for : [% name %] [% IF ( invoice ) %]invoice, [% invoice %][% END %]</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
Lines 238-245 Link Here
238
                                <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber %]" /></td>
239
                                <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber %]" /></td>
239
                                <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber %],[% item.itemnumber %]);">Edit</a></td>
240
                                <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber %],[% item.itemnumber %]);">Edit</a></td>
240
                                <td>[% item.barcode %]</td>
241
                                <td>[% item.barcode %]</td>
241
                                <td>[% item.homebranchname %]</td>
242
                                <td>[% Branches.GetName( item.homebranch )%]</td>
242
                                <td>[% item.holdingbranchname %]</td>
243
                                <td>[% Branches.GetName( item.holdingbranch ) %]</td>
243
                                <td>[% item.notforloan %]</td>
244
                                <td>[% item.notforloan %]</td>
244
                                <td>[% item.restricted %]</td>
245
                                <td>[% item.restricted %]</td>
245
                                <td>[% item.location %]</td>
246
                                <td>[% item.location %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt (-2 / +3 lines)
Lines 1-3 Link Here
1
[% USE Branches %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Administration &rsaquo; Library checkin and transfer policy</title>
3
<title>Koha &rsaquo; Administration &rsaquo; Library checkin and transfer policy</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 54-60 Link Here
54
     <div id="yui-main">
55
     <div id="yui-main">
55
    <div class="yui-b">
56
    <div class="yui-b">
56
57
57
<h1>Library [% branchcode %] - [% branchname %] Checkin and transfer policy</h1>
58
<h1>Library [% branchcode %] - [% Branches.GetName( branchcode ) %] Checkin and transfer policy</h1>
58
    <form method="get" action="/cgi-bin/koha/admin/branch_transfer_limits.pl" id="selectlibrary">
59
    <form method="get" action="/cgi-bin/koha/admin/branch_transfer_limits.pl" id="selectlibrary">
59
        <label for="branchselect">Select a library :</label>
60
        <label for="branchselect">Select a library :</label>
60
            <select name="branchcode" id="branchselect">
61
            <select name="branchcode" id="branchselect">
Lines 96-102 Link Here
96
			<tbody>
97
			<tbody>
97
					[% FOREACH to_branch_loo IN codes_loo.to_branch_loop %]
98
					[% FOREACH to_branch_loo IN codes_loo.to_branch_loop %]
98
                        <tr>
99
                        <tr>
99
							<td><label style="min-width:400px;" for="[% to_branch_loo.code %][% to_branch_loo.toBranch %]row">[% to_branch_loo.toBranch %] - [% to_branch_loo.toBranchname %]</label></td>
100
                            <td><label style="min-width:400px;" for="[% to_branch_loo.code %][% to_branch_loo.toBranch %]row">[% to_branch_loo.toBranch %] - [% Branches.GetName( to_branch_loo.toBranch ) %]</label></td>
100
							<td>
101
							<td>
101
							[% IF ( to_branch_loo.isChecked ) %]
102
							[% IF ( to_branch_loo.isChecked ) %]
102
								<input type="checkbox" id="[% to_branch_loo.code %][% to_branch_loo.toBranch %]row" name="[% to_branch_loo.code %]_[% to_branch_loo.toBranch %]" checked="checked" />
103
								<input type="checkbox" id="[% to_branch_loo.code %][% to_branch_loo.toBranch %]row" name="[% to_branch_loo.code %]_[% to_branch_loo.toBranch %]" checked="checked" />
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt (-4 / +3 lines)
Lines 1-3 Link Here
1
[% USE Branches %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Administration &rsaquo; Issuing rules &rsaquo; Clone issuing rules</title>
3
<title>Koha &rsaquo; Administration &rsaquo; Issuing rules &rsaquo; Clone issuing rules</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 14-23 Link Here
14
    <div id="yui-main">
15
    <div id="yui-main">
15
    <div class="yui-b">
16
    <div class="yui-b">
16
    <h2>Cloning issuing rules
17
    <h2>Cloning issuing rules
17
        [% IF ( frombranchname || tobranchname ) %]
18
        [% IF frombranch %] from "[% Branches.GetName( frombranch ) %]"[% END %]
18
            [% IF ( frombranchname ) %] from "[% frombranchname %]"[% END %]
19
        [% IF tobranch %] to "[% Branches.GetName( tobranch ) %]"[% END %]
19
	    [% IF ( tobranchname ) %] to "[% tobranchname %]"[% END %]
20
	[% END %]
21
    </h2>
20
    </h2>
22
21
23
    [% IF ( result ) %]
22
    [% IF ( result ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-3 / +4 lines)
Lines 616-622 function verify_images() { Link Here
616
                            [% item.translated_description %]
616
                            [% item.translated_description %]
617
                        </td>
617
                        </td>
618
                    [% END %]
618
                    [% END %]
619
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% item.branchname %] [% END %]</td>
619
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) %] [% END %]</td>
620
                    <td class="homebranch">[% Branches.GetName(item.homebranch) %]<span class="shelvingloc">[% item.location %]</span> </td>
620
                    <td class="homebranch">[% Branches.GetName(item.homebranch) %]<span class="shelvingloc">[% item.location %]</span> </td>
621
                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode %]</td>[% END %]
621
                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode %]</td>[% END %]
622
                    <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber %][% END %]</td>
622
                    <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber %][% END %]</td>
Lines 875-882 function verify_images() { Link Here
875
    <h2>This is a serial subscription</h2>
875
    <h2>This is a serial subscription</h2>
876
    <p> (There are [% subscriptionsnumber %] subscriptions associated with this title).</p> 
876
    <p> (There are [% subscriptionsnumber %] subscriptions associated with this title).</p> 
877
    [% FOREACH subscription IN subscriptions %]
877
    [% FOREACH subscription IN subscriptions %]
878
	    [% IF ( subscription.branchname ) %]<h3>At library: [% subscription.branchname %]</h3>[% ELSE %]
878
            [% IF subscription.branchcode %]
879
	    [% IF ( subscription.branchcode ) %]<h3>At library: [% subscription.branchcode %]</h3>[% END %][% END %]
879
                <h3>At library: [% Branches.GetName(subscription.branchcode) || subscription.branchcode %]</h3>
880
            [% END %]
880
            [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
881
            [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
881
            [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber %] </p>[% END %]
882
            [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber %] </p>[% END %]
882
            [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes FILTER html_line_break %] </p>[% END %]
883
            [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes FILTER html_line_break %] </p>[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (-2 / +3 lines)
Lines 1-4 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Branches %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% title %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield %][% END %]</title>
4
<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% title %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield %][% END %]</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
Lines 62-68 Link Here
62
         [% END %]
63
         [% END %]
63
         [% END %][% END %]</h4>
64
         [% END %][% END %]</h4>
64
            <ol class="bibliodetails">
65
            <ol class="bibliodetails">
65
            <li><span class="label">Home library:</span> [% ITEM_DAT.homebranchname %]&nbsp;</li>
66
            <li><span class="label">Home library:</span> [% Branches.GetName( ITEM_DAT.homebranch ) %]&nbsp;</li>
66
	    [% IF ( item_level_itypes ) %]
67
	    [% IF ( item_level_itypes ) %]
67
            <li><span class="label">Item type:</span> [% ITEM_DAT.itype %]&nbsp;</li>
68
            <li><span class="label">Item type:</span> [% ITEM_DAT.itype %]&nbsp;</li>
68
	    [% END %]
69
	    [% END %]
Lines 80-86 Link Here
80
            )[% END %]</h4>
81
            )[% END %]</h4>
81
82
82
            <ol class="bibliodetails">
83
            <ol class="bibliodetails">
83
            <li><span class="label">Current location:</span> [% ITEM_DAT.holdingbranchname %]&nbsp;</li>
84
            <li><span class="label">Current location:</span> [% Branches.GetName( ITEM_DAT.holdingbranch ) %]&nbsp;</li>
84
            <li><span class="label">Checkout status:</span>
85
            <li><span class="label">Checkout status:</span>
85
            [% IF ( ITEM_DAT.issue ) %]Checked out to
86
            [% IF ( ITEM_DAT.issue ) %]Checked out to
86
                [% IF ( hidepatronname ) %]
87
                [% IF ( hidepatronname ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.tt (-2 / +3 lines)
Lines 1-3 Link Here
1
[% USE Branches %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Circulation &rsaquo; Overdues at [% LoginBranchname %]</title>
3
<title>Koha &rsaquo; Circulation &rsaquo; Overdues at [% LoginBranchname %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 54-60 Link Here
54
                    [% IF ( overduesloo.borroweremail ) %]<a href="mailto:[% overduesloo.borroweremail %]?subject=Overdue: [% overduesloo.title %]">
55
                    [% IF ( overduesloo.borroweremail ) %]<a href="mailto:[% overduesloo.borroweremail %]?subject=Overdue: [% overduesloo.title %]">
55
                    [% overduesloo.borroweremail %]</a>[% END %]
56
                    [% overduesloo.borroweremail %]</a>[% END %]
56
                    </td>
57
                    </td>
57
                    <td>[% overduesloo.homebranch %] [% overduesloo.itemcallnumber %]
58
                    <td>[% Branches.GetName( overduesloo.homebranch ) %] [% overduesloo.itemcallnumber %]
58
                    </td>
59
                    </td>
59
                    <td align="center">
60
                    <td align="center">
60
                    <b>
61
                    <b>
Lines 132-138 Link Here
132
                        [% todayoverduesloo.borroweremail %]</a>[% END %]
133
                        [% todayoverduesloo.borroweremail %]</a>[% END %]
133
                            </p>
134
                            </p>
134
                        </td>
135
                        </td>
135
                        <td><p>[% todayoverduesloo.homebranch %] [% todayoverduesloo.itemcallnumber %]</p>
136
                        <td><p>[% Branches.GetName( todayoverduesloo.homebranch ) %] [% todayoverduesloo.itemcallnumber %]</p>
136
                        </td>
137
                        </td>
137
                        <td align="center">
138
                        <td align="center">
138
                            <b>
139
                            <b>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-3 / +3 lines)
Lines 238-248 $(document).ready(function() { Link Here
238
[% END %]
238
[% END %]
239
239
240
[% IF ( RESERVE_WAITING ) %]
240
[% IF ( RESERVE_WAITING ) %]
241
    <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber %]">[% resfirstname %] [% ressurname %]</a> ([% rescardnumber %]) at [% resbranchname %] since [% reswaitingdate | $KohaDates %]</li>
241
    <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber %]">[% resfirstname %] [% ressurname %]</a> ([% rescardnumber %]) at [% Branches.GetName( resbranchcode ) %] since [% reswaitingdate | $KohaDates %]</li>
242
[% END %]
242
[% END %]
243
243
244
[% IF ( RESERVED ) %]
244
[% IF ( RESERVED ) %]
245
    <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) has been on hold for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber %]">[% resfirstname %] [% ressurname %]</a> ([% rescardnumber %]) at [% resbranchname %] since [% resreservedate | $KohaDates %]</li>
245
    <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) has been on hold for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber %]">[% resfirstname %] [% ressurname %]</a> ([% rescardnumber %]) at [% Branches.GetName( resbranchcode ) %] since [% resreservedate | $KohaDates %]</li>
246
[% END %]
246
[% END %]
247
247
248
[% IF ( ISSUED_TO_ANOTHER ) %]
248
[% IF ( ISSUED_TO_ANOTHER ) %]
Lines 262-268 $(document).ready(function() { Link Here
262
[% END %]
262
[% END %]
263
263
264
[% IF ( BORRNOTSAMEBRANCH ) %]
264
[% IF ( BORRNOTSAMEBRANCH ) %]
265
    <li>This patron is from a different library ([% BORRNOTSAMEBRANCH %])</li>
265
    <li>This patron is from a different library ([% Branches.GetName( BORRNOTSAMEBRANCH ) %])</li>
266
[% END %]
266
[% END %]
267
267
268
[% IF ( PATRON_CANT ) %]
268
[% IF ( PATRON_CANT ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt (-1 / +1 lines)
Lines 156-162 $(document).ready(function() { Link Here
156
                    Too many checked out.
156
                    Too many checked out.
157
                  [% END %]
157
                  [% END %]
158
                  [% IF checkout_info.BORRNOTSAMEBRANCH %]
158
                  [% IF checkout_info.BORRNOTSAMEBRANCH %]
159
                    This patron is from a different library ([% checkout_info.BORRNOTSAMEBRANCH %])</li>
159
                    This patron is from a different library ([% Branches.GetName( checkout_info.BORRNOTSAMEBRANCH ) %])
160
                  [% END %]
160
                  [% END %]
161
                  [% IF checkout_ino.PATRON_CANT %]
161
                  [% IF checkout_ino.PATRON_CANT %]
162
                    This patron can't check out this item per library circulation policy.
162
                    This patron can't check out this item per library circulation policy.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +1 lines)
Lines 134-140 $(document).ready(function () { Link Here
134
134
135
[% IF ( collectionItemNeedsTransferred ) %]
135
[% IF ( collectionItemNeedsTransferred ) %]
136
 <div id="rotating-collection" class="dialog message">
136
 <div id="rotating-collection" class="dialog message">
137
        <h3>Please transfer item to: [% collectionBranch %]</h3>
137
        <h3>Please transfer item to: [% Branches.GetName( collectionBranch ) %]</h3>
138
            <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode %]: [% title %]</a></p>
138
            <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode %]: [% title %]</a></p>
139
            <p>This item is part of a rotating collection.</p>
139
            <p>This item is part of a rotating collection.</p>
140
</div>
140
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt (-3 / +3 lines)
Lines 47-53 Link Here
47
        [% FOREACH cancel_result %]
47
        [% FOREACH cancel_result %]
48
            [% IF ( messagetransfert ) %]
48
            [% IF ( messagetransfert ) %]
49
                <div class="dialog message">
49
                <div class="dialog message">
50
                    <h2>This item is on hold for pick-up at [% branchname %]</h2>
50
                    <h2>This item is on hold for pick-up at [% Branches.GetName( branchname ) %]</h2>
51
                    <p><strong>[% nextreservtitle %]</strong> is on hold for <strong> [% nextreservsurname %], [% nextreservfirstname %]</strong>.
51
                    <p><strong>[% nextreservtitle %]</strong> is on hold for <strong> [% nextreservsurname %], [% nextreservfirstname %]</strong>.
52
                    Please retain this item and check it in to process the hold.
52
                    Please retain this item and check it in to process the hold.
53
                    </p>
53
                    </p>
Lines 111-117 Link Here
111
                            <input type="hidden" name="tbr" value="[% reserveloo.homebranch %]" />
111
                            <input type="hidden" name="tbr" value="[% reserveloo.homebranch %]" />
112
                            <input type="hidden" name="tab" value="holdswaiting">
112
                            <input type="hidden" name="tab" value="holdswaiting">
113
                            [% IF ( reserveloo.dotransfer ) %]
113
                            [% IF ( reserveloo.dotransfer ) %]
114
                            <input type="submit" value="Cancel hold and return to : [% reserveloo.branchname %]" /> 
114
                            <input type="submit" value="Cancel hold and return to : [% Branches.GetName( reserveloo.homebranch ) %]" />
115
                            [% ELSE %]
115
                            [% ELSE %]
116
                            <input type="submit" value="Cancel hold" />
116
                            <input type="submit" value="Cancel hold" />
117
                            [% END %]
117
                            [% END %]
Lines 171-177 Link Here
171
                            <input type="hidden" name="tbr" value="[% overloo.homebranch %]" />
171
                            <input type="hidden" name="tbr" value="[% overloo.homebranch %]" />
172
                            <input type="hidden" name="tab" value="holdsover">
172
                            <input type="hidden" name="tab" value="holdsover">
173
                            [% IF ( overloo.dotransfer ) %]
173
                            [% IF ( overloo.dotransfer ) %]
174
                            <input type="submit" value="Cancel hold and return to : [% overloo.branchname %]" />
174
                            <input type="submit" value="Cancel hold and return to : [% Branches.GetName( overloo.homebranch ) %]" />
175
                            [% ELSE %]
175
                            [% ELSE %]
176
                            <input type="submit" value="Cancel hold" />
176
                            <input type="submit" value="Cancel hold" />
177
                            [% END %]
177
                            [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt (-1 / +2 lines)
Lines 1-3 Link Here
1
[% USE Branches %]
1
[% USE ItemTypes %]
2
[% USE ItemTypes %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Reports &rsaquo; Catalog by item types</title>
4
<title>Koha &rsaquo; Reports &rsaquo; Catalog by item types</title>
Lines 31-37 $(document).ready(function(){ Link Here
31
32
32
[% IF ( do_it ) %]
33
[% IF ( do_it ) %]
33
[% FOREACH mainloo IN mainloop %]
34
[% FOREACH mainloo IN mainloop %]
34
	<h1>Reports on item types [% IF ( mainloo.branchname ) %] held at [% mainloo.branchname %][% END %]</h1>
35
    <h1>Reports on item types [% IF branch %] held at [% Branches.GetName( branch ) %][% END %]</h1>
35
	<table id="itemtypest">
36
	<table id="itemtypest">
36
		<thead>
37
		<thead>
37
		<tr>
38
		<tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (-1 / +1 lines)
Lines 278-284 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
278
    <fieldset class="rows"> <legend>Acquisition information</legend>
278
    <fieldset class="rows"> <legend>Acquisition information</legend>
279
      <ol>
279
      <ol>
280
        <li>
280
        <li>
281
          <span class="label">Library:</span> [% branchname %]
281
          <span class="label">Library:</span> [% Branches.GetName( branchcode ) %]
282
        </li>
282
        </li>
283
        <li>
283
        <li>
284
          <span class="label">Fund:</span> [% budgetname %]
284
          <span class="label">Fund:</span> [% budgetname %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt (-3 / +4 lines)
Lines 1-5 Link Here
1
[% USE Branches %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Tools &rsaquo; [% branchname %] calendar</title>
3
<title>Koha &rsaquo; Tools &rsaquo; [% Branches.GetName( branch ) %] calendar</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'calendar.inc' %]
5
[% INCLUDE 'calendar.inc' %]
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
6
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
Lines 219-232 td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Bl Link Here
219
[% INCLUDE 'header.inc' %]
220
[% INCLUDE 'header.inc' %]
220
[% INCLUDE 'cat-search.inc' %]
221
[% INCLUDE 'cat-search.inc' %]
221
222
222
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; [% branchname %] calendar</div>
223
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; [% Branches.GetName( branchname ) %] calendar</div>
223
224
224
<div id="doc3" class="yui-t1">
225
<div id="doc3" class="yui-t1">
225
   
226
   
226
   <div id="bd">
227
   <div id="bd">
227
    <div id="yui-main">
228
    <div id="yui-main">
228
    <div class="yui-b">
229
    <div class="yui-b">
229
    <h2>[% branchname %] calendar</h2>
230
    <h2>[% Branches.GetName( branchname ) %] calendar</h2>
230
    <div class="yui-g">
231
    <div class="yui-g">
231
    <div class="yui-u first">
232
    <div class="yui-u first">
232
        <label for="branch">Define the holidays for:</label>
233
        <label for="branch">Define the holidays for:</label>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt (-1 / +2 lines)
Lines 1-4 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE Branches %]
2
[% INCLUDE 'doc-head-open.inc'%]
3
[% INCLUDE 'doc-head-open.inc'%]
3
<title>Koha &rsaquo; Tools &rsaquo; Batch patron modification</title>
4
<title>Koha &rsaquo; Tools &rsaquo; Batch patron modification</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
Lines 253-259 Link Here
253
                                                    <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber %]">[% borrower.cardnumber %]</a></td>
254
                                                    <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber %]">[% borrower.cardnumber %]</a></td>
254
                                                    <td>[% borrower.surname %]</td>
255
                                                    <td>[% borrower.surname %]</td>
255
                                                    <td>[% borrower.firstname %]</td>
256
                                                    <td>[% borrower.firstname %]</td>
256
                                                    <td>[% borrower.branchname %]</td>
257
                                                    <td>[% Branches.GetName( borrower.branchcode ) %]</td>
257
                                                    <td>[% borrower.categorycode %]</td>
258
                                                    <td>[% borrower.categorycode %]</td>
258
                                                    <td>[% borrower.city %]</td>
259
                                                    <td>[% borrower.city %]</td>
259
                                                    <td>[% borrower.state %]</td>
260
                                                    <td>[% borrower.state %]</td>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-2 / +2 lines)
Lines 798-805 Link Here
798
                            <h2>This is a serial</h2>
798
                            <h2>This is a serial</h2>
799
                            <p>There are [% subscriptionsnumber %] subscription(s) associated with this title.</p>
799
                            <p>There are [% subscriptionsnumber %] subscription(s) associated with this title.</p>
800
                            [% FOREACH subscription IN subscriptions %]
800
                            [% FOREACH subscription IN subscriptions %]
801
                                [% IF ( subscription.branchname ) %]
801
                                [% IF ( subscription.branchcode ) %]
802
                                    <h3>At library: [% subscription.branchname %]</h3>
802
                                    <h3>At library: [% Branches.GetName( subscription.branchname ) %]</h3>
803
                                [% ELSE %]
803
                                [% ELSE %]
804
                                    [% IF ( subscription.branchcode ) %]
804
                                    [% IF ( subscription.branchcode ) %]
805
                                        <h3>At library: [% subscription.branchcode %]</h3>
805
                                        <h3>At library: [% subscription.branchcode %]</h3>
(-)a/members/boraccount.pl (-1 lines)
Lines 110-116 $template->param(%$data); Link Here
110
$template->param(
110
$template->param(
111
    finesview           => 1,
111
    finesview           => 1,
112
    borrowernumber      => $borrowernumber,
112
    borrowernumber      => $borrowernumber,
113
    branchname          => GetBranchName($data->{'branchcode'}),
114
    total               => sprintf("%.2f",$total),
113
    total               => sprintf("%.2f",$total),
115
    totalcredit         => $totalcredit,
114
    totalcredit         => $totalcredit,
116
    is_child            => ($data->{'category_type'} eq 'C'),
115
    is_child            => ($data->{'category_type'} eq 'C'),
(-)a/members/deletemem.pl (-1 lines)
Lines 126-132 if ($countissues > 0 or $flags->{'CHARGES'} or $data->{'borrowernumber'} or $de Link Here
126
        phone => $bor->{'phone'},
126
        phone => $bor->{'phone'},
127
        email => $bor->{'email'},
127
        email => $bor->{'email'},
128
        branchcode => $bor->{'branchcode'},
128
        branchcode => $bor->{'branchcode'},
129
        branchname => GetBranchName($bor->{'branchcode'}),
130
		activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
129
		activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
131
        RoutingSerials => C4::Context->preference('RoutingSerials'),
130
        RoutingSerials => C4::Context->preference('RoutingSerials'),
132
    );
131
    );
(-)a/members/files.pl (-1 lines)
Lines 103-109 else { Link Here
103
103
104
    $template->param(
104
    $template->param(
105
        categoryname    => $data->{'description'},
105
        categoryname    => $data->{'description'},
106
        branchname      => GetBranchName($data->{'branchcode'}),
107
        RoutingSerials => C4::Context->preference('RoutingSerials'),
106
        RoutingSerials => C4::Context->preference('RoutingSerials'),
108
    );
107
    );
109
108
(-)a/members/mancredit.pl (-1 lines)
Lines 98-104 if ($add){ Link Here
98
        finesview      => 1,
98
        finesview      => 1,
99
        borrowernumber => $borrowernumber,
99
        borrowernumber => $borrowernumber,
100
        categoryname   => $data->{'description'},
100
        categoryname   => $data->{'description'},
101
        branchname     => GetBranchName($data->{'branchcode'}),
102
        is_child       => ($data->{'category_type'} eq 'C'),
101
        is_child       => ($data->{'category_type'} eq 'C'),
103
        activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
102
        activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
104
        RoutingSerials => C4::Context->preference('RoutingSerials'),
103
        RoutingSerials => C4::Context->preference('RoutingSerials'),
(-)a/members/maninvoice.pl (-1 lines)
Lines 123-129 if ($add){ Link Here
123
        finesview      => 1,
123
        finesview      => 1,
124
        borrowernumber => $borrowernumber,
124
        borrowernumber => $borrowernumber,
125
        categoryname   => $data->{'description'},
125
        categoryname   => $data->{'description'},
126
        branchname     => GetBranchName($data->{'branchcode'}),
127
        is_child       => ($data->{'category_type'} eq 'C'),
126
        is_child       => ($data->{'category_type'} eq 'C'),
128
        activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
127
        activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
129
        RoutingSerials => C4::Context->preference('RoutingSerials'),
128
        RoutingSerials => C4::Context->preference('RoutingSerials'),
(-)a/members/member-flags.pl (-1 lines)
Lines 191-197 $template->param( Link Here
191
		email => $bor->{'email'},
191
		email => $bor->{'email'},
192
        emailpro => $bor->{'emailpro'},
192
        emailpro => $bor->{'emailpro'},
193
		branchcode => $bor->{'branchcode'},
193
		branchcode => $bor->{'branchcode'},
194
		branchname => GetBranchName($bor->{'branchcode'}),
195
		loop => \@loop,
194
		loop => \@loop,
196
		is_child        => ($bor->{'category_type'} eq 'C'),
195
		is_child        => ($bor->{'category_type'} eq 'C'),
197
		activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
196
		activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
(-)a/members/member-password.pl (-1 lines)
Lines 134-140 $template->param( Link Here
134
    email                      => $bor->{'email'},
134
    email                      => $bor->{'email'},
135
    emailpro                   => $bor->{'emailpro'},
135
    emailpro                   => $bor->{'emailpro'},
136
    branchcode                 => $bor->{'branchcode'},
136
    branchcode                 => $bor->{'branchcode'},
137
    branchname                 => GetBranchName( $bor->{'branchcode'} ),
138
    userid                     => $bor->{'userid'},
137
    userid                     => $bor->{'userid'},
139
    destination                => $destination,
138
    destination                => $destination,
140
    is_child                   => ( $bor->{'category_type'} eq 'C' ),
139
    is_child                   => ( $bor->{'category_type'} eq 'C' ),
(-)a/members/moremember.pl (-1 lines)
Lines 47-53 use C4::Circulation; Link Here
47
use C4::Koha;
47
use C4::Koha;
48
use C4::Letters;
48
use C4::Letters;
49
use C4::Biblio;
49
use C4::Biblio;
50
use C4::Branch; # GetBranchName
51
use C4::Form::MessagingPreferences;
50
use C4::Form::MessagingPreferences;
52
use List::MoreUtils qw/uniq/;
51
use List::MoreUtils qw/uniq/;
53
use C4::Members::Attributes qw(GetBorrowerAttributes);
52
use C4::Members::Attributes qw(GetBorrowerAttributes);
(-)a/members/notices.pl (-2 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Output;
25
use C4::Output;
26
use CGI qw ( -utf8 );
26
use CGI qw ( -utf8 );
27
use C4::Members;
27
use C4::Members;
28
use C4::Branch;
29
use C4::Letters;
28
use C4::Letters;
30
use C4::Members::Attributes qw(GetBorrowerAttributes);
29
use C4::Members::Attributes qw(GetBorrowerAttributes);
31
30
Lines 66-72 $template->param( Link Here
66
    QUEUED_MESSAGES    => $queued_messages,
65
    QUEUED_MESSAGES    => $queued_messages,
67
    borrowernumber     => $borrowernumber,
66
    borrowernumber     => $borrowernumber,
68
    sentnotices        => 1,
67
    sentnotices        => 1,
69
    branchname         => GetBranchName($borrower->{'branchcode'}),
70
    categoryname       => $borrower->{'description'},
68
    categoryname       => $borrower->{'description'},
71
    activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
69
    activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
72
    RoutingSerials => C4::Context->preference('RoutingSerials'),
70
    RoutingSerials => C4::Context->preference('RoutingSerials'),
(-)a/members/pay.pl (-1 lines)
Lines 234-240 sub borrower_add_additional_fields { Link Here
234
        );
234
        );
235
    }
235
    }
236
236
237
    $b_ref->{branchname} = GetBranchName( $b_ref->{branchcode} );
238
    return;
237
    return;
239
}
238
}
240
239
(-)a/members/paycollect.pl (-1 lines)
Lines 178-183 sub borrower_add_additional_fields { Link Here
178
        $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber);
178
        $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber);
179
    }
179
    }
180
180
181
    $b_ref->{branchname} = GetBranchName( $b_ref->{branchcode} );
182
    return;
181
    return;
183
}
182
}
(-)a/members/printfeercpt.pl (-1 lines)
Lines 134-140 $template->param( Link Here
134
    phone               => $data->{'phone'},
134
    phone               => $data->{'phone'},
135
    email               => $data->{'email'},
135
    email               => $data->{'email'},
136
    branchcode          => $data->{'branchcode'},
136
    branchcode          => $data->{'branchcode'},
137
	branchname			=> GetBranchName($data->{'branchcode'}),
138
    total               => sprintf("%.2f",$total),
137
    total               => sprintf("%.2f",$total),
139
    totalcredit         => $totalcredit,
138
    totalcredit         => $totalcredit,
140
	is_child        => ($data->{'category_type'} eq 'C'),
139
	is_child        => ($data->{'category_type'} eq 'C'),
(-)a/members/printinvoice.pl (-1 lines)
Lines 133-139 $template->param( Link Here
133
    phone          => $data->{'phone'},
133
    phone          => $data->{'phone'},
134
    email          => $data->{'email'},
134
    email          => $data->{'email'},
135
    branchcode     => $data->{'branchcode'},
135
    branchcode     => $data->{'branchcode'},
136
    branchname     => GetBranchName( $data->{'branchcode'} ),
137
    total          => sprintf( "%.2f", $total ),
136
    total          => sprintf( "%.2f", $total ),
138
    totalcredit    => $totalcredit,
137
    totalcredit    => $totalcredit,
139
    is_child       => ( $data->{'category_type'} eq 'C' ),
138
    is_child       => ( $data->{'category_type'} eq 'C' ),
(-)a/members/purchase-suggestions.pl (-1 lines)
Lines 50-56 foreach my $key ( keys %$borrower ) { Link Here
50
$template->param(
50
$template->param(
51
    suggestionsview  => 1,
51
    suggestionsview  => 1,
52
    categoryname => $borrower->{'description'},
52
    categoryname => $borrower->{'description'},
53
    branchname   => GetBranchName( $borrower->{'branchcode'} ),
54
    RoutingSerials => C4::Context->preference('RoutingSerials'),
53
    RoutingSerials => C4::Context->preference('RoutingSerials'),
55
);
54
);
56
55
(-)a/members/routing-lists.pl (-2 lines)
Lines 41-47 my $branch = $query->param('branch'); Link Here
41
if ($branch){
41
if ($branch){
42
    # update our session so the userenv is updated
42
    # update our session so the userenv is updated
43
    $session->param('branch', $branch);
43
    $session->param('branch', $branch);
44
    $session->param('branchname', GetBranchName($branch));
45
}
44
}
46
45
47
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
46
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
Lines 108-114 $template->param( Link Here
108
    borrower          => $borrower,
107
    borrower          => $borrower,
109
    borrowernumber    => $borrowernumber,
108
    borrowernumber    => $borrowernumber,
110
    branch            => $branch,
109
    branch            => $branch,
111
    branchname        => GetBranchName($borrower->{'branchcode'}),
112
    categoryname      => $borrower->{description},
110
    categoryname      => $borrower->{description},
113
    RoutingSerials    => C4::Context->preference('RoutingSerials'),
111
    RoutingSerials    => C4::Context->preference('RoutingSerials'),
114
);
112
);
(-)a/members/statistics.pl (-1 lines)
Lines 60-66 foreach my $key ( keys %$borrower ) { Link Here
60
}
60
}
61
$template->param(
61
$template->param(
62
    categoryname    => $borrower->{'description'},
62
    categoryname    => $borrower->{'description'},
63
    branchname      => GetBranchName($borrower->{'branchcode'}),
64
);
63
);
65
# Construct column names
64
# Construct column names
66
my $fields = C4::Members::Statistics::get_fields();
65
my $fields = C4::Members::Statistics::get_fields();
(-)a/opac/opac-detail.pl (-1 lines)
Lines 544-550 foreach my $subscription (@subscriptions) { Link Here
544
    $cell{histstartdate}     = $subscription->{histstartdate};
544
    $cell{histstartdate}     = $subscription->{histstartdate};
545
    $cell{histenddate}       = $subscription->{histenddate};
545
    $cell{histenddate}       = $subscription->{histenddate};
546
    $cell{branchcode}        = $subscription->{branchcode};
546
    $cell{branchcode}        = $subscription->{branchcode};
547
    $cell{branchname}        = GetBranchName($subscription->{branchcode});
548
    $cell{hasalert}          = $subscription->{hasalert};
547
    $cell{hasalert}          = $subscription->{hasalert};
549
    $cell{callnumber}        = $subscription->{callnumber};
548
    $cell{callnumber}        = $subscription->{callnumber};
550
    $cell{closed}            = $subscription->{closed};
549
    $cell{closed}            = $subscription->{closed};
(-)a/reports/itemtypes.plugin (-1 lines)
Lines 108-114 sub calculate { Link Here
108
	$globalline{loopitemtype} = \@results;
108
	$globalline{loopitemtype} = \@results;
109
	$globalline{total} = $grantotal;
109
	$globalline{total} = $grantotal;
110
	$globalline{branch} = $branch;
110
	$globalline{branch} = $branch;
111
	$globalline{branchname} = GetBranchName($branch);
112
	push @mainloop,\%globalline;
111
	push @mainloop,\%globalline;
113
	return \@mainloop;
112
	return \@mainloop;
114
}
113
}
(-)a/reports/reserves_stats.pl (-1 / +2 lines)
Lines 32-37 use C4::Output; Link Here
32
use C4::Reports;
32
use C4::Reports;
33
use C4::Members;
33
use C4::Members;
34
use Koha::DateUtils;
34
use Koha::DateUtils;
35
use Koha::Libraries;
35
use Koha::Patron::Categories;
36
use Koha::Patron::Categories;
36
use List::MoreUtils qw/any/;
37
use List::MoreUtils qw/any/;
37
use YAML;
38
use YAML;
Lines 338-344 sub display_value { Link Here
338
        ( $crit =~ /ccode/ )         ? $ccodes->{$value}
339
        ( $crit =~ /ccode/ )         ? $ccodes->{$value}
339
      : ( $crit =~ /location/ )      ? $locations->{$value}
340
      : ( $crit =~ /location/ )      ? $locations->{$value}
340
      : ( $crit =~ /itemtype/ )      ? $itemtypes->{$value}->{description}
341
      : ( $crit =~ /itemtype/ )      ? $itemtypes->{$value}->{description}
341
      : ( $crit =~ /branch/ )        ? GetBranchName($value)
342
      : ( $crit =~ /branch/ )        ? Koha::Libraries->find($value)->branchname
342
      : ( $crit =~ /reservestatus/ ) ? reservestatushuman($value)
343
      : ( $crit =~ /reservestatus/ ) ? reservestatushuman($value)
343
      :                                $value;    # default fallback
344
      :                                $value;    # default fallback
344
    if ($crit =~ /sort1/) {
345
    if ($crit =~ /sort1/) {
(-)a/serials/routing-preview.pl (-1 / +2 lines)
Lines 34-39 use C4::Items; Link Here
34
use C4::Serials;
34
use C4::Serials;
35
use URI::Escape;
35
use URI::Escape;
36
use C4::Branch;
36
use C4::Branch;
37
use Koha::Libraries;
37
38
38
my $query = new CGI;
39
my $query = new CGI;
39
my $subscriptionid = $query->param('subscriptionid');
40
my $subscriptionid = $query->param('subscriptionid');
Lines 66-72 if($ok){ Link Here
66
	my ($count2,@bibitems) = GetBiblioItemByBiblioNumber($biblio);
67
	my ($count2,@bibitems) = GetBiblioItemByBiblioNumber($biblio);
67
	my @itemresults = GetItemsInfo( $subs->{biblionumber} );
68
	my @itemresults = GetItemsInfo( $subs->{biblionumber} );
68
	my $branch = $itemresults[0]->{'holdingbranch'};
69
	my $branch = $itemresults[0]->{'holdingbranch'};
69
	my $branchname = GetBranchName($branch);
70
    my $branchname = Koha::Libraries->find($branch)->branchname;
70
71
71
	if (C4::Context->preference('RoutingListAddReserves')){
72
	if (C4::Context->preference('RoutingListAddReserves')){
72
		# get existing reserves .....
73
		# get existing reserves .....
(-)a/suggestion/suggestion.pl (-2 / +3 lines)
Lines 32-37 use C4::Members; Link Here
32
use C4::Debug;
32
use C4::Debug;
33
33
34
use Koha::DateUtils qw( dt_from_string );
34
use Koha::DateUtils qw( dt_from_string );
35
use Koha::Libraries;
35
36
36
use URI::Escape;
37
use URI::Escape;
37
38
Lines 59-65 sub GetCriteriumDesc{ Link Here
59
        }
60
        }
60
        return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i);
61
        return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i);
61
    }
62
    }
62
    return (GetBranchName($criteriumvalue)) if ($displayby =~/branchcode/);
63
    return Koha::Libraries->find($criteriumvalue)->branchname;
64
        if $displayby =~ /branchcode/;
63
    return GetAuthorisedValueByCode('SUGGEST_FORMAT', $criteriumvalue) || "Unknown" if ($displayby =~/itemtype/);
65
    return GetAuthorisedValueByCode('SUGGEST_FORMAT', $criteriumvalue) || "Unknown" if ($displayby =~/itemtype/);
64
    if ($displayby =~/suggestedby/||$displayby =~/managedby/||$displayby =~/acceptedby/){
66
    if ($displayby =~/suggestedby/||$displayby =~/managedby/||$displayby =~/acceptedby/){
65
        my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue);
67
        my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue);
Lines 212-218 elsif ($op eq "change" ) { Link Here
212
}
214
}
213
elsif ( $op eq 'show' ) {
215
elsif ( $op eq 'show' ) {
214
    $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'});
216
    $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'});
215
    $$suggestion_ref{branchname} = GetBranchName $$suggestion_ref{branchcode};
216
    my $budget = GetBudget $$suggestion_ref{budgetid};
217
    my $budget = GetBudget $$suggestion_ref{budgetid};
217
    $$suggestion_ref{budgetname} = $$budget{budget_name};
218
    $$suggestion_ref{budgetname} = $$budget{budget_name};
218
    Init($suggestion_ref);
219
    Init($suggestion_ref);
(-)a/svc/holds (-2 / +1 lines)
Lines 24-30 use JSON qw(to_json); Link Here
24
24
25
use C4::Auth qw(check_cookie_auth);
25
use C4::Auth qw(check_cookie_auth);
26
use C4::Biblio qw(GetMarcBiblio GetFrameworkCode GetRecordValue );
26
use C4::Biblio qw(GetMarcBiblio GetFrameworkCode GetRecordValue );
27
use C4::Branch qw(GetBranchName);
28
use C4::Charset;
27
use C4::Charset;
29
use C4::Circulation qw(GetTransfers);
28
use C4::Circulation qw(GetTransfers);
30
use C4::Context;
29
use C4::Context;
Lines 127-133 while ( my $h = $holds_rs->next() ) { Link Here
127
            $hold->{color}       = 'transferred';
126
            $hold->{color}       = 'transferred';
128
            $hold->{transferred} = 1;
127
            $hold->{transferred} = 1;
129
            $hold->{date_sent} = output_pref( dt_from_string($transferred_when) );
128
            $hold->{date_sent} = output_pref( dt_from_string($transferred_when) );
130
            $hold->{from_branch} = GetBranchName($transferred_from);
129
            $hold->{from_branch} = Koha::Libraries->find($transferred_from)->branchname;
131
        }
130
        }
132
        elsif ( $item->holding_branch() && $item->holding_branch()->branchcode() ne
131
        elsif ( $item->holding_branch() && $item->holding_branch()->branchcode() ne
133
            $h->branch()->branchcode() )
132
            $h->branch()->branchcode() )
(-)a/t/db_dependent/Branch.t (-6 / +1 lines)
Lines 21-27 use Modern::Perl; Link Here
21
use C4::Context;
21
use C4::Context;
22
use Data::Dumper;
22
use Data::Dumper;
23
23
24
use Test::More tests => 17;
24
use Test::More tests => 16;
25
25
26
use C4::Branch;
26
use C4::Branch;
27
use Koha::Database;
27
use Koha::Database;
Lines 36-42 BEGIN { Link Here
36
}
36
}
37
can_ok(
37
can_ok(
38
    'C4::Branch', qw(
38
    'C4::Branch', qw(
39
      GetBranchName
40
      GetBranch
39
      GetBranch
41
      GetBranches
40
      GetBranches
42
      GetBranchesLoop
41
      GetBranchesLoop
Lines 110-119 is( Koha::Libraries->search->count, $count + 2, "two branches added" ); Link Here
110
is( Koha::Libraries->find( $b2->{branchcode} )->delete, 1,          "One row affected" );
109
is( Koha::Libraries->find( $b2->{branchcode} )->delete, 1,          "One row affected" );
111
is( Koha::Libraries->search->count,             $count + 1, "branch BRB deleted" );
110
is( Koha::Libraries->search->count,             $count + 1, "branch BRB deleted" );
112
111
113
#Test GetBranchName
114
is( GetBranchName( $b1->{branchcode} ),
115
    $b1->{branchname}, "GetBranchName returns the right name" );
116
117
#Test Getbranches
112
#Test Getbranches
118
my $branches = GetBranches();
113
my $branches = GetBranches();
119
is( scalar( keys %$branches ),
114
is( scalar( keys %$branches ),
(-)a/t/db_dependent/NewsChannels.t (-2 / +2 lines)
Lines 1-8 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
use C4::Branch qw(GetBranchName);
5
use Koha::DateUtils;
4
use Koha::DateUtils;
5
use Koha::Libraries;
6
6
7
use Test::More tests => 12;
7
use Test::More tests => 12;
8
8
Lines 18-24 $dbh->{RaiseError} = 1; Link Here
18
18
19
# Add LIB1, if it doesn't exist.
19
# Add LIB1, if it doesn't exist.
20
my $addbra = 'LIB1';
20
my $addbra = 'LIB1';
21
if ( !GetBranchName($addbra) ) {
21
unless ( Koha::Libraries->find($addbra) ) {
22
    $dbh->do( q{ INSERT INTO branches (branchcode,branchname) VALUES (?,?) },
22
    $dbh->do( q{ INSERT INTO branches (branchcode,branchname) VALUES (?,?) },
23
        undef, ( $addbra, "$addbra branch" ) );
23
        undef, ( $addbra, "$addbra branch" ) );
24
}
24
}
(-)a/t/db_dependent/Reserves.t (-1 / +2 lines)
Lines 32-37 use Koha::Holds; Link Here
32
use t::lib::Mocks;
32
use t::lib::Mocks;
33
33
34
use Koha::DateUtils;
34
use Koha::DateUtils;
35
use Koha::Libraries;
35
use Koha::Patron::Categories;
36
use Koha::Patron::Categories;
36
37
37
use Data::Dumper;
38
use Data::Dumper;
Lines 57-63 $dbh->do("update marc_subfield_structure set kohafield='biblioitems.agerestricti Link Here
57
58
58
# Add branches if not existing
59
# Add branches if not existing
59
foreach my $addbra ('CPL', 'FPL', 'RPL') {
60
foreach my $addbra ('CPL', 'FPL', 'RPL') {
60
    $dbh->do("INSERT INTO branches (branchcode,branchname) VALUES (?,?)", undef, ($addbra,"$addbra branch")) unless GetBranchName($addbra);
61
    $dbh->do("INSERT INTO branches (branchcode,branchname) VALUES (?,?)", undef, ($addbra,"$addbra branch")) unless Koha::Libraries->find($addbra);
61
}
62
}
62
63
63
# Add categories if not existing
64
# Add categories if not existing
(-)a/tools/holidays.pl (-3 lines)
Lines 60-66 my $onlymine = Link Here
60
if ( $onlymine ) { 
60
if ( $onlymine ) { 
61
    $branch = C4::Context->userenv->{'branch'};
61
    $branch = C4::Context->userenv->{'branch'};
62
}
62
}
63
my $branchname = GetBranchName($branch);
64
my $branches   = GetBranches($onlymine);
63
my $branches   = GetBranches($onlymine);
65
my @branchloop;
64
my @branchloop;
66
for my $thisbranch (
65
for my $thisbranch (
Lines 154-161 $template->param( Link Here
154
    keydate                  => $keydate,
153
    keydate                  => $keydate,
155
    branchcodes              => $branchcodes,
154
    branchcodes              => $branchcodes,
156
    branch                   => $branch,
155
    branch                   => $branch,
157
    branchname               => $branchname,
158
    branch                   => $branch,
159
);
156
);
160
157
161
# Shows the template with the real values replaced
158
# Shows the template with the real values replaced
(-)a/tools/import_borrowers.pl (-2 / +3 lines)
Lines 40-46 use warnings; Link Here
40
use C4::Auth;
40
use C4::Auth;
41
use C4::Output;
41
use C4::Output;
42
use C4::Context;
42
use C4::Context;
43
use C4::Branch qw/GetBranchesLoop GetBranchName/;
43
use C4::Branch qw/GetBranchesLoop/;
44
use C4::Members;
44
use C4::Members;
45
use C4::Members::Attributes qw(:all);
45
use C4::Members::Attributes qw(:all);
46
use C4::Members::AttributeTypes;
46
use C4::Members::AttributeTypes;
Lines 49-54 use C4::Reports::Guided; Link Here
49
use C4::Templates;
49
use C4::Templates;
50
use Koha::Borrower::Debarments;
50
use Koha::Borrower::Debarments;
51
use Koha::DateUtils;
51
use Koha::DateUtils;
52
use Koha::Libraries;
52
use Koha::Patron::Categories;
53
use Koha::Patron::Categories;
53
54
54
use Text::CSV;
55
use Text::CSV;
Lines 185-191 if ( $uploadborrowers && length($uploadborrowers) > 0 ) { Link Here
185
        }
186
        }
186
        if ($borrower{branchcode}) {
187
        if ($borrower{branchcode}) {
187
            push @missing_criticals, {key=>'branchcode', line=>$. , lineraw=>$borrowerline, value=>$borrower{branchcode}, branch_map=>1}
188
            push @missing_criticals, {key=>'branchcode', line=>$. , lineraw=>$borrowerline, value=>$borrower{branchcode}, branch_map=>1}
188
                unless GetBranchName($borrower{branchcode});
189
                unless Koha::Libraries->find($borrower{branchcode});
189
        } else {
190
        } else {
190
            push @missing_criticals, {key=>'branchcode', line=>$. , lineraw=>$borrowerline};
191
            push @missing_criticals, {key=>'branchcode', line=>$. , lineraw=>$borrowerline};
191
        }
192
        }
(-)a/tools/modborrowers.pl (-1 lines)
Lines 362-368 sub GetBorrowerInfos { Link Here
362
    my ( %info ) = @_;
362
    my ( %info ) = @_;
363
    my $borrower = GetMember( %info );
363
    my $borrower = GetMember( %info );
364
    if ( $borrower ) {
364
    if ( $borrower ) {
365
        $borrower->{branchname} = GetBranchName( $borrower->{branchcode} );
366
        for ( qw(dateenrolled dateexpiry) ) {
365
        for ( qw(dateenrolled dateexpiry) ) {
367
            my $userdate = $borrower->{$_};
366
            my $userdate = $borrower->{$_};
368
            unless ($userdate && $userdate ne "0000-00-00" and $userdate ne "9999-12-31") {
367
            unless ($userdate && $userdate ne "0000-00-00" and $userdate ne "9999-12-31") {
(-)a/tools/viewlog.pl (-2 lines)
Lines 90-96 if ( $src eq 'circ' ) { Link Here
90
        menu           => 1,
90
        menu           => 1,
91
        borrowernumber => $borrowernumber,
91
        borrowernumber => $borrowernumber,
92
        categoryname   => $data->{'description'},
92
        categoryname   => $data->{'description'},
93
        branchname     => GetBranchName( $data->{'branchcode'} ),
94
        RoutingSerials => C4::Context->preference('RoutingSerials'),
93
        RoutingSerials => C4::Context->preference('RoutingSerials'),
95
    );
94
    );
96
}
95
}
97
- 

Return to bug 15758