1 package Koha::Template::Plugin::AuthorisedValues;
6 use base qw( Template::Plugin );
8 use Encode qw{encode decode};
14 my ( $self, $category, $code, $opac ) = @_;
15 return encode( 'UTF-8', GetAuthorisedValueByCode( $category, $code, $opac ) );
19 my ( $self, $category, $selected, $opac ) = @_;
20 return GetAuthorisedValues( $category, $selected, $opac );
23 sub GetAuthValueDropbox {
24 my ( $self, $category, $default ) = @_;
25 return C4::Koha::GetAuthvalueDropbox($category, $default);
32 Koha::Template::Plugin::AuthorisedValues - TT Plugin for authorised values
36 [% USE AuthorisedValues %]
38 [% AuthorisedValues.GetByCode( 'CATEGORY', 'AUTHORISED_VALUE_CODE', 'IS_OPAC' ) %]
40 [% AuthorisedValues.GetAuthValueDropbox( $category, $default ) %]
46 In a template, you can get the description for an authorised value with
47 the following TT code: [% AuthorisedValues.GetByCode( 'CATEGORY', 'AUTHORISED_VALUE_CODE', 'IS_OPAC' ) %]
49 The parameters are identical to those used by the subroutine C4::Koha::GetAuthorisedValueByCode.
51 =head2 GetAuthValueDropbox
53 The parameters are identical to those used by the subroutine C4::Koha::GetAuthValueDropbox
57 Kyle M Hall <kyle@bywatersolutions.com>
59 Jonathan Druart <jonathan.druart@biblibre.com>
63 Copyright ByWater Solutions 2012
65 Copyright BibLibre 2013
69 This file is part of Koha.
71 Koha is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software
72 Foundation; either version 3 of the License, or (at your option) any later version.
74 You should have received a copy of the GNU General Public License along
75 with Koha; if not, write to the Free Software Foundation, Inc.,
76 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.