Bug 27796: (QA follow-up) Missing filters
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / av-build-dropbox.inc
1 [% USE AuthorisedValues %]
2 [%# Parameters: %]
3 [%# name: the name of the select element %]
4 [%# category: the authorised value category %]
5 [%# default: the default authorised value to select %]
6 [%# class: the CSS class of the select element %]
7 [%# size: the size to use for the input (generated if the authorised value category does not exist). %]
8 [%# all: add a "All" entry. All and empty should not be used at the same time. %]
9 [%# empty: add an empty entry. All and empty should not be used at the same time. %]
10
11 [% SET avs = AuthorisedValues.GetAuthValueDropbox( category ) %]
12 [% DEFAULT class = '' size = 20 %]
13
14 [% IF avs %]
15   <select id="[% name | html %]" name="[% name | html %]" class="[% class | html %]" >
16   [% IF all %]<option value="">All</option>[% END %]
17   [% IF empty %]<option value=""></option>[% END %]
18   [% FOR av IN avs %]
19     [% IF av.authorised_value == default %]
20       <option value="[% av.authorised_value | html %]" selected="selected">[% av.lib | html_entity %]</option>
21     [% ELSE %]
22       <option value="[% av.authorised_value | html %]">[% av.lib | html_entity %]</option>
23     [% END %]
24   [% END %]
25   </select>
26 [% ELSE %]
27   <input type="text" id="[% name | html %]" name="[% name | html %]" size="[% size | html %]" value="[% default | html_entity %]" class="[% class | html %]" />
28 [% END %]