# only show selected formats for metarecords
formats = [];
FOR ccvm IN hold.metarecord_selected_filters.icons;
+ NEXT IF ccvm.opac_visible == 'f';
format = {};
- format.icon = PROCESS get_ccvm_icon id=ccvm.id search_label=1;
- format.label = PROCESS get_ccvm_label id=ccvm.id search_label=1;
+ format.label = ccvm.search_label || ccvm.value;
+ format.icon = PROCESS get_ccvm_icon ccvm=ccvm;
formats.push(format);
END;
END;
</div>
<select multiple='multiple'
name="metarecord_formats_[% target_id %]">
- [% FOR ccvm IN
- hold_data.metarecord_filters.formats.sort('search_label') %]
+ [% FOR ccvm IN
+ hold_data.metarecord_filters.formats.sort('search_label');
+ NEXT IF ccvm.opac_visible == 'f' %]
<option value="[% ccvm.code %]"[%- code = ccvm.code;
IF selected_formats.$code %] selected='selected'[% END -%]>
[% ccvm.search_label | html %]
</div>
<select multiple='multiple'
name="metarecord_langs_[% target_id %]">
- [% FOR lang_ccvm IN hold_data.metarecord_filters.langs.sort('value') %]
- [% selected = 0;
+ [% FOR lang_ccvm IN hold_data.metarecord_filters.langs.sort('value');
+ NEXT IF lang_ccvm.opac_visible == 'f';
+ selected = 0;
code = lang_ccvm.code;
IF selected_langs.size;
# user has already selected their preferred language(s)
END;
END;
- BLOCK get_ccvm_label;
- ccvm = ctx.get_ccvm(id); # caches internally
- IF search_label and ccvm.search_label;
- ccvm.search_label;
- ELSE;
- ccvm.$id.value;
- END;
- END;
-
BLOCK get_ccvm_icon;
- ccvm = ctx.get_ccvm(id); # caches internally
- label = PROCESS get_ccvm_label id=id search_label=search_label;
ctx.media_prefix _ '/images/format_icons/' _ ccvm.ctype _ '/' _ ccvm.code _ '.png';
END;
-
# Extract MARC fields from XML
# get_marc_attrs( { marc_xml => doc } )
BLOCK get_marc_attrs;
args.all_formats = [];
FOR node IN xml.findnodes(formats_xpath);
IF node AND node.textContent;
- type = node.textContent;
+ ccvm = ctx.get_ccvm(node.getAttribute('cvmid'));
+ NEXT IF ccvm.opac_visible == 'f';
+
format = {};
- format.icon = PROCESS get_ccvm_icon
- id=node.getAttribute('cvmid') search_label=1;
- format.label = PROCESS get_ccvm_label
- id=node.getAttribute('cvmid') search_label=1;
+ type = node.textContent;
+ format.label = ccvm.search_label || ccvm.value;
+ format.icon = PROCESS get_ccvm_icon ccvm=ccvm;
format.itemtype = schema_typemap.$type || 'CreativeWork';
args.all_formats.push(format); # metarecords want all formats