if (ts.copyLocations.length && ts.copyLocations[0] !== '') {
params.copyLocations = ts.copyLocations.join(',');
}
+
+ if (ts.excludeElectronic) {
+ params.excludeElectronic = true;
+ }
}
if (context.cnBrowseSearch.isSearchable()) {
if (params.get('copyLocations')) {
ts.copyLocations = params.get('copyLocations').split(/,/);
}
+
+ if (params.get('excludeElectronic')) {
+ ts.excludeElectronic = true;
+ }
}
}
}
date2: number;
dateOp: string; // before, after, between, is
+ excludeElectronic = false;
+
reset() {
this.query = [''];
this.fieldClass = ['keyword'];
str += '#available';
}
+ if (ts.excludeElectronic) {
+ str += '-search_format(electronic)';
+ }
+
if (this.sort) {
// e.g. title, title.descending
const parts = this.sort.split(/\./);
// Track the current template through route changes.
selectedTemplate: string;
+ // Display the Exclude Electronic checkbox
+ showExcludeElectronic = false;
+
// TODO: does unapi support pref-lib for result-page copy counts?
prefOrg: IdlObject;
The number of search results to display per page.
</div>
</div>
+
+<div class="row border-bottom border-secondary p-2 m-2">
+ <div class="col-lg-2 offset-lg-1">
+ <label for="pref-lib-selector" class="font-weight-bold" i18n>
+ Exclude Electronic Resources
+ </label>
+ </div>
+ <div class="col-lg-2">
+ <div class="checkbox pl-3 pt-2">
+ <label>
+ <input type="checkbox"
+ (change)="checkboxChanged('eg.staffcat.exclude_electronic')"
+ [(ngModel)]="settings['eg.staffcat.exclude_electronic']">
+ <span class="pl-1" i18n></span>
+ </label>
+ </div>
+ </div>
+ <div class="col-lg-6" i18n>
+ Add the 'Exclude Electronic Resources' checkbox to the main search form.
+ </div>
+</div>
'eg.search.search_lib',
'eg.search.pref_lib',
'eg.search.adv_pane',
- 'eg.catalog.results.count'
+ 'eg.catalog.results.count',
+ 'eg.staffcat.exclude_electronic'
];
@Component({
});
}
+ checkboxChanged(setting: string) {
+ const value = this.settings[setting];
+ this.updateValue(setting, value || null);
+
+ if (setting === 'eg.staffcat.exclude_electronic') {
+ this.staffCat.showExcludeElectronic = value;
+ }
+ }
+
updateValue(setting: string, value: any): Promise<any> {
const promise = (value === null) ?
this.store.removeItem(setting) :
'opac.staff_saved_search.size',
'eg.catalog.search_templates',
'opac.staff_saved_search.size',
- 'opac.search.enable_bookplate_search'
+ 'opac.search.enable_bookplate_search',
+ 'eg.staffcat.exclude_electronic'
]).then(settings => {
this.staffCat.defaultSearchOrg =
this.org.get(settings['eg.search.search_lib']);
}
this.staffCat.enableBookplates =
settings['opac.search.enable_bookplate_search'];
+ this.staffCat.showExcludeElectronic =
+ settings['eg.staffcat.exclude_electronic'] === true;
});
}
}
<option value='poprel' i18n>Popularity Adjusted Relevance</option>
</optgroup>
</select>
- <div class="checkbox pl-2 ml-2">
+ <div class="checkbox pl-2 ml-2 pt-2">
<label>
<input type="checkbox" [(ngModel)]="context.termSearch.available"/>
<span class="pl-1" i18n>Limit to Available</span>
</label>
</div>
- <div class="checkbox pl-3">
+ <div class="checkbox pl-3 pt-2">
<label>
<input type="checkbox"
[(ngModel)]="context.termSearch.groupByMetarecord"/>
<span class="pl-1" i18n>Group Formats/Editions</span>
</label>
</div>
- <div class="checkbox pl-3">
+ <div class="checkbox pl-3 pt-2">
<label>
<input type="checkbox" [(ngModel)]="context.global"/>
<span class="pl-1" i18n>Results from All Libraries</span>
</label>
</div>
+ <div class="checkbox pl-3 pt-2" *ngIf="showExcludeElectronic()">
+ <label>
+ <input type="checkbox"
+ [(ngModel)]="context.termSearch.excludeElectronic"/>
+ <span class="pl-1" i18n>Exclude Electronic Resources</span>
+ </label>
+ </div>
</div>
</div>
<div class="row mt-3" *ngIf="showFilters()">
import {Router, ActivatedRoute, NavigationEnd} from '@angular/router';
import {IdlObject} from '@eg/core/idl.service';
import {OrgService} from '@eg/core/org.service';
+import {ServerStoreService} from '@eg/core/server-store.service';
import {CatalogService} from '@eg/share/catalog/catalog.service';
import {CatalogSearchContext, CatalogSearchState} from '@eg/share/catalog/search-context';
import {StaffCatalogService} from './catalog.service';
showBookplate(): boolean {
return this.staffCat.enableBookplates;
}
+ showExcludeElectronic(): boolean {
+ return this.staffCat.showExcludeElectronic;
+ }
}
INSERT INTO action_trigger.event_params (event_def, param, value)
VALUES (currval('action_trigger.event_definition_id_seq'), 'check_sms_notify', 1);
*/
+
+INSERT INTO config.workstation_setting_type (name, grp, datatype, label)
+VALUES (
+ 'eg.staffcat.exclude_electronic', 'gui', 'bool',
+ oils_i18n_gettext(
+ 'eg.staffcat.exclude_electronic',
+ 'Staff Catalog "Exclude Electronic Resources" Option',
+ 'cwst', 'label'
+ )
+);
--- /dev/null
+BEGIN;
+
+-- SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version);
+
+INSERT INTO config.workstation_setting_type (name, grp, datatype, label)
+VALUES (
+ 'eg.staffcat.exclude_electronic', 'gui', 'bool',
+ oils_i18n_gettext(
+ 'eg.staffcat.exclude_electronic',
+ 'Staff Catalog "Exclude Electronic Resources" Option',
+ 'cwst', 'label'
+ )
+);
+
+COMMIT;
+
+