tag_used := acsaf.tag;
FOR sf IN SELECT * FROM regexp_split_to_table(acsaf.sf_list,'') LOOP
tmp_text := oils_xpath_string('//*[@tag="'||tag_used||'"]/*[@code="'||sf||'"]', marcxml);
- IF tmp_text IS NOT NULL THEN
+ IF tmp_text IS NOT NULL AND tmp_text <> '' THEN
heading_text := heading_text || E'\u2021' || sf || ' ' || tmp_text;
END IF;
END LOOP;
bibFieldByTag: function (x) {
var me = this;
return dojo.filter(
- me.controlSet().bib_fields(),
+ me.controlSet().bib_fields,
function (bf) { if (bf.tag() == x) return true }
)[0];
},
bibFields: function (x) {
- return this.controlSet(x).bib_fields();
+ return this.controlSet(x).bib_fields;
},
bibFieldBrowseAxes : function (t) {
openils.AuthorityControlSet._browse_axis_by_name[bname].maps(),
function (m) {
if (dojo.filter(
- m.field().bib_fields(),
+ m.field().bib_fields,
function (b) { return b.tag == t }
).length > 0
) blist.push(bname);
},
bibToAuthority : function (field) {
- var b_field = this.bibFieldByTag(field.tag());
+ var b_field = this.bibFieldByTag(field.tag);
if (b_field) { // construct an marc authority record
af = b_field.authority_field();
var m = new MARC.Record ({rtype:'AUT'});
- m.appendField(
+ m.appendFields(
new MARC.Field ({
tag : af.tag(),
ind1: field.ind1,
ind2: field.ind2,
- subfields: dojo.filter(
+ subfields: [dojo.filter(
field.subfields,
function (sf) { return (af.sf_list().indexOf(sf[0]) > -1) }
- )
+ )]
})
);
function (acs_id) {
var acs = me.controlSet(acs_id);
var x = me.bibToAuthority(field);
- if (x) auth_list.push({acs_id : m.toXmlString()});
+ if (x) { var foo = {}; foo[acs_id] = x; auth_list.push(foo); }
}
);
this.controlSetId(old_acs);
var found_acs = [];
dojo.forEach( acs.controlSetList(), function (acs_id) {
- if (ac.controlSet(acs_id).control_map[sf.parent().@tag]) found_acs.push(acs_id);
+ if (acs.controlSet(acs_id).control_map[sf.parent().@tag]) found_acs.push(acs_id);
});
if (!found_acs.length) {
var row = rows[i];
var tag = row.firstChild;
- for (var acs_id in acs.controlSetList()) {
+ var done = false;
+ dojo.forEach(acs.controlSetList(), function (acs_id) {
+ if (done) return;
var control_map = acs.controlSet(acs_id).control_map;
- if (!control_map[tag.value]) continue
+ if (!control_map[tag.value]) return;
button.setAttribute('label', label + ' - ' + tag.value);
var ind1 = tag.nextSibling;
}
}
- if (matches.length) break;
- }
+ if (matches.length) done = true;
+ });
}
button.setAttribute('label', label);