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

(-)a/Koha/Template/Plugin/Branches.pm (-2 / +5 lines)
Lines 27-37 use C4::Koha; Link Here
27
use C4::Context;
27
use C4::Context;
28
use Koha::Libraries;
28
use Koha::Libraries;
29
29
30
our %branches;
31
30
sub GetName {
32
sub GetName {
31
    my ( $self, $branchcode ) = @_;
33
    my ( $self, $branchcode ) = @_;
32
34
33
    my $l = Koha::Libraries->find($branchcode);
35
    %branches = map { $_->{branchcode} => $_ } @{Koha::Libraries->search()->unblessed} unless %branches;
34
    return $l ? $l->branchname : q{};
36
    my $l = $branches{$branchcode};
37
    return $l ? $l->{branchname} : q{};
35
}
38
}
36
39
37
sub GetLoggedInBranchcode {
40
sub GetLoggedInBranchcode {
(-)a/Koha/Template/Plugin/ItemTypes.pm (-4 / +7 lines)
Lines 24-36 use base qw( Template::Plugin ); Link Here
24
24
25
use Koha::ItemTypes;
25
use Koha::ItemTypes;
26
26
27
our %itemtypes;
28
29
27
sub GetDescription {
30
sub GetDescription {
28
    my ( $self, $itemtypecode, $want_parent ) = @_;
31
    my ( $self, $itemtypecode, $want_parent ) = @_;
29
    my $itemtype = Koha::ItemTypes->find( $itemtypecode );
32
    %itemtypes = map { $_->{itemtype} => $_ } @{Koha::ItemTypes->search_with_localization()->unblessed} unless %itemtypes;
33
    my $itemtype = $itemtypes{$itemtypecode};
30
    return q{} unless $itemtype;
34
    return q{} unless $itemtype;
31
    my $parent;
35
    my $parent;
32
    $parent = $itemtype->parent if $want_parent;
36
    $parent = $itemtypes{$itemtype->{parent_type}} if $want_parent;
33
    return $parent ? $parent->translated_description . "->" . $itemtype->translated_description : $itemtype->translated_description;
37
    return $parent ? $parent->{translated_description} . "->" . $itemtype->{translated_description} : $itemtype->{translated_description};
34
}
38
}
35
39
36
sub Get {
40
sub Get {
37
- 

Return to bug 28436