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>
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">
</div>
<div class="row mt-3" *ngIf="showFilters()">
<div class="col-lg-12">
- <div class="form-inline" i18n>
- <label for="pub-date1-input">Publication Year is</label>
+ <div class="form-inline">
+ <label for="pub-date1-input" i18n>Publication Year is</label>
<select class="form-control ml-2" [(ngModel)]="context.termSearch.dateOp">
- <option value='is'>Is</option>
- <option value='before'>Before</option>
- <option value='after'>After</option>
- <option value='between'>Between</option>
+ <option i18n value='is'>Is</option>
+ <option i18n value='before'>Before</option>
+ <option i18n value='after'>After</option>
+ <option i18n value='between'>Between</option>
</select>
<input class="form-control ml-2" type="number"
[(ngModel)]="context.termSearch.date1"/>
}
}
}
+
+ showBookplate(): boolean {
+ return this.staffCat.enableBookplates;
+ }
}