dialogTitle="Delete Call Number?"
dialogBody="Delete {{deleteVolCount}} Call Number(s) and {{deleteCopyCount}} Associated Item(s)?">
</eg-confirm-dialog>
+
<eg-confirm-dialog
#confirmDelCopy
i18n-dialogTitle i18n-dialogBody
<div class="p-1" [ngStyle]="{flex: flexAt(1)}"> </div>
<div class="p-1" [ngStyle]="{flex: flexAt(2)}"> </div>
<div class="p-1" [ngStyle]="{flex: flexAt(3)}">
- <label class="font-weight-bold" i18n>Classification</label>
+ <div><label class="font-weight-bold" i18n>Classification</label></div>
<div>
<eg-combobox [smallFormControl]="true" [(ngModel)]="batchVolClass">
<eg-combobox-entry *ngFor="let cls of volClasses"
</div>
</div>
<div class="p-1" [ngStyle]="{flex: flexAt(4)}">
- <label class="font-weight-bold" i18n>Prefix</label>
+ <div><label class="font-weight-bold" i18n>Prefix</label></div>
<div>
<eg-combobox [smallFormControl]="true" [(ngModel)]="batchVolPrefix">
<eg-combobox-entry *ngFor="let pfx of volPrefixes"
</div>
</div>
<div class="p-1" [ngStyle]="{flex: flexAt(5)}">
- <label class="font-weight-bold" i18n>Call Number Label</label>
+ <div><label class="font-weight-bold" i18n>Call Number Label</label></div>
<div>
<eg-combobox [smallFormControl]="true" [(ngModel)]="batchVolLabel">
<eg-combobox-entry *ngFor="let label of recordVolLabels" [entryId]="label">
</div>
</div>
<div class="p-1" [ngStyle]="{flex: flexAt(6)}">
- <label class="font-weight-bold" i18n>Suffix</label>
+ <div><label class="font-weight-bold" i18n>Suffix</label></div>
<div>
<eg-combobox [smallFormControl]="true" [(ngModel)]="batchVolSuffix">
<eg-combobox-entry *ngFor="let sfx of volSuffixes"
</div>
</div>
<div class="p-1" [ngStyle]="{flex: flexAt(7)}">
- <label class="font-weight-bold" i18n>Batch</label>
+ <div><label class="font-weight-bold" i18n>Batch</label></div>
<div>
<button class="btn btn-sm btn-outline-dark label-with-material-icon"
(click)="batchVolApply()">
</div>
</div>
<div class="p-1" [ngStyle]="{flex: flexAt(8)}">
- <label class="font-weight-bold" i18n>Generate Barcodes</label>
+ <div><label class="font-weight-bold" i18n>Generate Barcodes</label></div>
<button class="btn btn-sm btn-outline-dark label-with-material-icon"
(click)="generateBarcodes()">
<span i18n>Generate</span>
</button>
</div>
<div class="p-1" [ngStyle]="{flex: flexSpan(9, 10)}">
- <label class="font-weight-bold" i18n>Checkdigit</label>
+ <div><label class="font-weight-bold" i18n>Checkdigit</label></div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox"
id="use-checkdigit" [(ngModel)]="useCheckdigit">
<ng-container *ngIf="copyIdx == 0">
<span>{{orgNode.target.shortname()}}</span>
<button class="clear-button" (click)="deleteVol(volNode)"
- title="Delete Call Number" i18n-title>
+ title="Delete Call Number {{volNode.target.label()}}" i18n-title>
<span class="material-icons">clear</span>
</button>
</ng-container>
<div class="d-flex">
<button class="clear-button" (click)="deleteCopy(copyNode)"
- title="Delete Item" i18n-title>
+ title="Delete Item {{copyNode.target.barcode()}}" i18n-title>
<span class="material-icons">clear</span>
</button>
<input type="text" class="form-control form-control-sm"
id="barcode-input-{{copyNode.target.id()}}"
- spellcheck="false"
- [required]="true"
+ spellcheck="false" [required]="true"
[ngClass]="{'text-danger': copyNode.target._dupe_barcode}"
- (ngModelChange)="barcodeChanged(copyNode.target, $event)"
+ (change)="barcodeChanged(copyNode.target, $event.target.value)"
+ (ngModelChange)="copyNode.target.barcode($event)"
(keyup.enter)="selectNextBarcode(copyNode.target.id())"
(keyup.shift.enter)="selectNextBarcode(copyNode.target.id(), true)"
(focus)="$event.target.select()"
[ngModel]="copyNode.target.barcode()"
(ngModelChange)="applyCopyValue(copyNode.target, 'barcode', $event)"/>
- <div *ngIf="copyNode.target._dupe_barcode"
- class="alert alert-danger font-italic p-1" i18n>
- Duplicate Barcode</div>
+ </div>
+ <div *ngIf="copyNode.target._dupe_barcode"
+ class="alert alert-danger font-italic p-1" i18n>
+ Duplicate Barcode
</div>
</div>
<div class="p-1" [ngStyle]="{flex: flexAt(9)}">
batchVolApply() {
this.context.volNodes().forEach(volNode => {
const vol = volNode.target;
- console.log('batch vol class', this.batchVolClass.id);
if (this.batchVolClass) {
this.applyVolValue(vol, 'label_class', this.batchVolClass.id);
}
}
deleteCopy(copyNode: HoldingsTreeNode) {
+
+ if (copyNode.target.isnew()) {
+ // Confirmation not required when deleting brand new copies.
+ this.deleteOneCopy(copyNode);
+ return;
+ }
+
this.deleteCopyCount = 1;
this.confirmDelCopy.open().toPromise().then(confirmed => {
if (confirmed) { this.deleteOneCopy(copyNode); }
deleteVol(volNode: HoldingsTreeNode) {
+
+ if (volNode.target.isnew()) {
+ // Confirmation not required when deleting brand new vols.
+ this.deleteOneVol(volNode);
+ return;
+ }
+
this.deleteVolCount = 1;
this.deleteCopyCount = volNode.children.length;