Support for digital bookplates searching in the staff catalog.
Note to testers, the org setting 'opac.search.enable_bookplate_search'
must be set to true and copy tags must be added and linked to copies.
Included in commit is a minor i18n tweak to address some complaints by
the Angular build.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Rogan Hamby <rogan.hamby@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
const matchOp = ts.matchOp[idx];
const fieldClass = ts.fieldClass[idx];
+ // Bookplates are filters but may be displayed as regular
+ // text search indexes.
+ if (fieldClass === 'bookplate') { return ''; }
+
let str = '';
if (!query) { return str; }
if (qcount > 1) { str += ')'; }
// -------
+ // Append bookplate queries as filters
+ ts.query.forEach((q, idx) => {
+ const space = str.length > 0 ? ' ' : '';
+ const query = ts.query[idx];
+ const fieldClass = ts.fieldClass[idx];
+ if (query && fieldClass === 'bookplate') {
+ str += `${space}copy_tag(*,${query})`;
+ }
+ });
+
if (ts.hasBrowseEntry) {
// stored as a comma-separated string of "entryId,fieldId"
str += ` has_browse_entry(${ts.hasBrowseEntry})`;
// during record tab navigation.
currentDetailRecordSummary: any;
+ // Add digital bookplate to search options.
+ enableBookplates = false;
+
constructor(
private router: Router,
private route: ActivatedRoute,
'cat.holdings_show_vols',
'opac.staff_saved_search.size',
'eg.catalog.search_templates',
- 'opac.staff_saved_search.size'
+ 'opac.staff_saved_search.size',
+ 'opac.search.enable_bookplate_search'
]).then(settings => {
this.staffCat.defaultSearchOrg =
this.org.get(settings['eg.search.search_lib']);
this.staffCat.defaultSearchLimit =
Number(settings['eg.catalog.results.count']);
}
+ this.staffCat.enableBookplates =
+ settings['opac.search.enable_bookplate_search'];
});
}
}
<option i18n value='author'>Author</option>
<option i18n value='subject'>Subject</option>
<option i18n value='series'>Series</option>
+ <option i18n value='bookplate'
+ *ngIf="showBookplate()">Digital Bookplate</option>
</select>
</div>
<div class="col-lg-2 pl-0 pr-2">
}
}
}
+
+ showBookplate(): boolean {
+ return this.staffCat.enableBookplates;
+ }
}