unless(scalar(keys(%authority_browse_axis_cache))) {
my $axes = new_editor->search_authority_browse_axis([
{ code => { '<>' => undef } },
- { flesh => 2, flesh_fields => { aba => ['fields'], acsafm => ['bib_fields','sub_entries'] } }
+ { flesh => 2, flesh_fields => { aba => ['fields'], acsaf => ['bib_fields','sub_entries'] } }
]);
$authority_browse_axis_cache{$_->code} = $_ for (@$axes);
}
my $before = $_storage->request(
"open-ils.cstore.json_query.atomic",
{ select => { afr => [qw/record value/] },
- from => { 'are', 'afr' },
- where => {
- '+afr' => { tag => \@ref_tags, subfield => $subfield, value => { '<' => $value } },
- '+are' => { 'deleted' => 'f' }
- },
+ from => 'afr',
+ where => { tag => \@ref_tags, subfield => $subfield, value => { '<' => $value } },
order_by => { afr => { value => 'desc' } },
limit => $before_limit,
offset => abs($page) * $page_size - $before_offset,
my $after = $_storage->request(
"open-ils.cstore.json_query.atomic",
{ select => { afr => [qw/record value/] },
- from => { 'are', 'afr' },
- where => {
- '+afr' => { tag => \@ref_tags, subfield => $subfield, value => { '>=' => $value } },
- '+are' => { 'deleted' => 'f' }
- },
+ from => 'afr',
+ where => { tag => \@ref_tags, subfield => $subfield, value => { '>=' => $value } },
order_by => { afr => { value => 'asc' } },
limit => $after_limit,
offset => abs($page) * $page_size - $after_offset,
CREATE TRIGGER a_marcxml_is_well_formed BEFORE INSERT OR UPDATE ON authority.record_entry FOR EACH ROW EXECUTE PROCEDURE biblio.check_marcxml_well_formed();
CREATE TRIGGER b_maintain_901 BEFORE INSERT OR UPDATE ON authority.record_entry FOR EACH ROW EXECUTE PROCEDURE evergreen.maintain_901();
CREATE TRIGGER c_maintain_control_numbers BEFORE INSERT OR UPDATE ON authority.record_entry FOR EACH ROW EXECUTE PROCEDURE maintain_control_numbers();
-CREATE RULE protect_authority_rec_delete AS ON DELETE TO authority.record_entry DO INSTEAD (UPDATE authority.record_entry SET deleted = TRUE WHERE OLD.id = authority.record_entry.id);
+CREATE RULE protect_authority_rec_delete AS ON DELETE TO authority.record_entry DO INSTEAD (UPDATE authority.record_entry SET deleted = TRUE WHERE OLD.id = authority.record_entry.id; DELETE FROM authority.full_rec WHERE record = OLD.id);
CREATE TABLE authority.bib_linking (
id BIGSERIAL PRIMARY KEY,
CREATE INDEX authority_full_rec_index_vector_idx ON authority.full_rec USING GIST (index_vector);
/* Enable LIKE to use an index for database clusters with locales other than C or POSIX */
CREATE INDEX authority_full_rec_value_tpo_index ON authority.full_rec (value text_pattern_ops);
+/* But we still need this (boooo) for paging using >, <, etc */
+CREATE INDEX authority_full_rec_value_index ON authority.full_rec (value);
-- Intended to be used in a unique index on authority.record_entry like so:
-- CREATE UNIQUE INDEX unique_by_heading_and_thesaurus
});
- openils.AuthorityControlSet._browse_axis_by_name = {};
- dojo.forEach( openils.AuthorityControlSet._browse_axis_list, function (ba) {
- ba.maps(
- dojo.filter(
- openils.AuthorityControlSet._browse_field_map_list,
- function (m) { m.axis() == ba.code }
- )
- );
- openils.AuthorityControlSet._browse_axis_by_name[ba.code()] = ba;
- });
-
if (this.controlSetList().length > 0)
delete openils.AuthorityControlSet._controlsets['-1'];
openils.AuthorityControlSet._browse_axis_by_name[bname].maps(),
function (m) {
if (dojo.filter(
- m.field().bib_fields,
- function (b) { return b.tag == t }
+ m.field().bib_fields(),
+ function (b) { return b.tag() == t }
).length > 0
) blist.push(bname);
}
}
if (sf.toString().replace(/\s*/, '')) {
- browseAuthority(sf_popup, menu_id, target, sf, 20, page);
+ return browseAuthority(sf_popup, menu_id, target, sf, 20, page);
}
return true;
// Sets will change that
var axis_list = acs.bibFieldBrowseAxes( sf.parent().@tag.toString() );
+
// No matching tag means no authorities to search - shortcut
- if (axis_list.length == 0) return;
+ if (axis_list.length == 0) {
+ target.setAttribute('context', 'clipboard');
+ return false;
+ }
var type = 'authority.' + axis_list[0]; // Just take the first for now
// TODO support multiple axes ... loop?