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

(-)a/Koha/Template/Plugin/AuthorisedValues.pm (-7 / +13 lines)
Lines 69-80 sub GetCategories { Link Here
69
    ];
69
    ];
70
}
70
}
71
71
72
sub GetCategoryByKohaField {
72
sub GetDescriptionByKohaField {
73
    my ($self, $kohafield, $frameworkcode) = @_;
73
    my ( $self, $params ) = @_;
74
74
    my $frameworkcode    = $params->{frameworkcode} || '';
75
    my $category = Koha::AuthorisedValueCategories->find_by_koha_field($kohafield, $frameworkcode);
75
    my $kohafield        = $params->{kohafield};
76
76
    my $authorised_value = $params->{authorised_value};
77
    return $category ? $category->category_name : undef;
77
    my $description = Koha::AuthorisedValues->get_description_by_koha_field(
78
        {
79
            frameworkcode    => $frameworkcode,
80
            kohafield        => $kohafield,
81
            authorised_value => $authorised_value
82
        }
83
    );
84
    return $description ? $description->{lib} : $authorised_value;
78
}
85
}
79
86
80
1;
87
1;
81
- 

Return to bug 18433