deleteVolCount: number = null;
deleteCopyCount: number = null;
+ // Set default for Call Number Label requirement
+ requireCNL = true;
+
// When adding multiple vols via add-many popover.
addVolCount: number = null;
// It's possible the loaded data is not strictly allowed,
// e.g. empty string call number labels
.then(_ => this.emitSaveChange(true));
+
+ // Check to see if call number label is required
+ this.org.settings('cat.require_call_number_labels')
+ .then(settings => {this.requireCNL =
+ Boolean(settings['cat.require_call_number_labels']);
+ console.log('CALL NUMBER REQUIRED: ' + this.requireCNL);
+ });
}
copyStatLabel(copy: IdlObject): string {
const badVols = this.context.volNodes().filter(volNode => {
const vol = volNode.target;
- return !(
- vol.prefix() && vol.label() && vol.suffix && vol.label_class()
- );
+
+ // Set badVols only if call number label is required but blank
+ if (this.requireCNL == true) {
+ return !(
+ vol.prefix() && vol.label() && vol.suffix && vol.label_class()
+ );
+ } else {
+ return !(
+ vol.prefix() && vol.suffix && vol.label_class()
+ );
+ }
}).length > 0;
return !badVols;
attrsCanSave = true;
changesPending = false;
routingAllowed = false;
- requireCN = true;
@ViewChild('pendingChangesDialog', {static: false})
pendingChangesDialog: ConfirmDialogComponent;
ngOnInit() {
this.route.paramMap.subscribe(
(params: ParamMap) => this.negotiateRoute(params));
-
- this.org.settings('cat.require_call_number_labels')
- .then(settings => {this.requireCN =
- Boolean(settings['cat.require_call_number_labels']);
- console.log('TESTING:' + this.requireCN);
- });
-
-
}