<td valign='top'>
<strong>[% l("Item Type") %]</strong><br />
[% INCLUDE "default/opac/parts/coded_value_selector.tt2"
- attr="mattype" multiple="multiple" size="4"
+ attr=["mattype", "item_type"] multiple="multiple" size="4"
id="adv_global_item_type_basic" %]
</td>
<td valign='top'>
-[%- name = name || "fi:" _ attr;
- id = id || attr _ "_selector";
- values = values || CGI.param(name); -%]
+
+[%-
+ # If caller passes a list of possible attribute types,
+ # search all until we find some values
+
+ IF !attr.size; attr = [attr]; END;
+ all_values = [];
+ attr_class = '';
+ FOR attr_class IN attr;
+ all_values = ctx.search_ccvm('ctype', attr_class);
+ IF all_values.size > 0; LAST; END;
+ END;
+ name = name || "fi:" _ attr_class;
+ id = id || attr_class _ "_selector";
+ values = values || CGI.param(name);
+-%]
+
<select id='[% id %]' name='[% name %]'[%
multiple ? ' multiple="multiple"' : '';
size ? (' size="' _ size _ '"') : ''; %]>
-[% all_values = ctx.search_ccvm('ctype', attr);
-IF none_ok %]
+[% IF none_ok %]
<option value=''>[% l('-- Any --') %]</option>
-[% END;
-FOR o IN all_values;
- |l(o.value) %]
- <option value='[% o.code %]'[% values.grep('^' _ o.code _ '$').size ? ' selected="selected"' : '' %]>[_1]</option>
-[% END; END -%]
+[% END %]
+[% FOR o IN all_values %]
+ <option value='[% o.code %]'[% values.grep('^' _ o.code _ '$').size ? ' selected="selected"' : '' %]>[% o.value %]</option>
+[% END -%]
</select>
+